Commit 9a1bb78e by liangjianmin

js

parent 52ce8e47
......@@ -47,13 +47,22 @@
margin-bottom: 23rpx;
border-top: 1px solid #e6edf0;
}
.box {
width: 144rpx;
height: 144rpx;
margin-right: 24rpx;
image {
.list {
flex-wrap: wrap;
.box {
width: 144rpx;
height: 144rpx;
margin-right: 24rpx;
&:nth-of-type(4n) {
margin-right: 0;
}
&:nth-child(n+5){
margin-top: 24rpx;
}
image {
width: 144rpx;
height: 144rpx;
}
}
}
}
......@@ -63,7 +72,7 @@
background: #ffffff;
border-radius: 4rpx;
margin-bottom: 48rpx;
.top {
.top {
.title {
.arrow {
width: 12rpx;
......@@ -79,37 +88,37 @@
}
}
}
.list{
.box{
.list {
.box {
height: 123rpx;
border-bottom: 1px solid #E6EDF0;
&:last-child{
border-bottom: 1px solid #e6edf0;
&:last-child {
border-bottom: none;
}
.w1{
.w1 {
width: 241rpx;
}
.text{
.tt{
.t1{
font-size: 22rpx;
color: #6E767A;
}
.t2{
font-size: 22rpx;
color: #404547;
}
.text {
.tt {
.t1 {
font-size: 22rpx;
color: #6e767a;
}
.t2 {
font-size: 22rpx;
color: #404547;
}
}
}
.camera{
.camera {
width: 80rpx;
height: 60rpx;
background: #197ADB;
background: #197adb;
border-radius: 4rpx;
font-size: 22rpx;
color: #FFFFFF;
&.disable{
background: #9CA8AD;
color: #ffffff;
&.disable {
background: #9ca8ad;
}
}
}
......
......@@ -26,8 +26,8 @@
<text class="t2">({{ total }})</text>
</view>
</view>
<view class="list" v-if="warehouseOperation.length > 0">
<navigator class="box row verCenter" url="/pages/goods/warehouseOperationConfirm" hover-class="none" v-for="(item, index) in warehouseOperation" :key="index">
<view class="list" v-if="total > 0">
<navigator class="box row verCenter" :url="'/pages/goods/warehouseOperationConfirm?weonlt_id=' + item.weonlt_id" hover-class="none" v-for="(item, index) in warehouseOperation" :key="index">
<template v-if="item.arrival_status == 1">
<text class="status-text-no">{{ item.arrival_status_cn }}</text>
</template>
......@@ -87,7 +87,7 @@ export default {
textArr: ['待作业'],
warehouseOperation: [],
erp_order_sn: '',
total: 0,
total: 1,
page: 1,
limit: 10,
is_loading: false
......@@ -126,6 +126,7 @@ export default {
this.input_status = false;
},
inputChange() {
this.total = 0;
this.page = 1;
this.warehouseOperation = [];
this.getData();
......
......@@ -9,35 +9,32 @@
</view>
<view class="pp row verCenter">
<text class="t1">关联入仓号:</text>
<text class="t2">A123456/A123456-1/A123456-2</text>
<text class="t2">{{ warehouseOperationDetail.list.erp_order_sn_all }}</text>
</view>
<view class="pp row verCenter">
<text class="t1">提交时间:</text>
<text class="t2">2021-11-02 15:17</text>
<text class="t2">{{ warehouseOperationDetail.list.create_time_cn }}</text>
</view>
<view class="pp row verCenter">
<text class="t1">订单客户:</text>
<text class="t2">富开香港有限公司</text>
<text class="t2">{{ warehouseOperationDetail.list.company_name }}</text>
</view>
<view class="pp row verCenter">
<text class="t1">作业类型:</text>
<text class="t2">整箱作业/拆箱</text>
<text class="t2">{{ warehouseOperationDetail.list.is_unpacking_cn }}</text>
</view>
<view class="pp row verCenter">
<text class="t1">合计作业数:</text>
<text class="t2">100</text>
<text class="t2">{{ warehouseOperationDetail.list.operation_num_sum }}</text>
</view>
<view class="pp row verCenter mb0">
<text class="t1">作业备注:</text>
<text class="t2">需要拆箱把里面的标签都撕掉</text>
<text class="t2">{{ warehouseOperationDetail.list.operation_remark || '-' }}</text>
</view>
<view class="pic-list column">
<text class="title">问题图片</text>
<view class="list row verCenter">
<view class="box"><image src="http://img.ichunt.com/images/ichunt/minProgram/scm/wms/202203/01/7778c9170eb7160d61dc5b10633f7865.png" mode="aspectFill"></image></view>
<view class="box"><image src="http://img.ichunt.com/images/ichunt/minProgram/scm/wms/202203/01/7778c9170eb7160d61dc5b10633f7865.png" mode="aspectFill"></image></view>
<view class="box"><image src="http://img.ichunt.com/images/ichunt/minProgram/scm/wms/202203/01/7778c9170eb7160d61dc5b10633f7865.png" mode="aspectFill"></image></view>
<view class="box"><image src="http://img.ichunt.com/images/ichunt/minProgram/scm/wms/202203/01/7778c9170eb7160d61dc5b10633f7865.png" mode="aspectFill"></image></view>
<view class="box" @click="clickImg(operation_img, index)" v-for="(item, index) in operation_img" :key="index"><image :src="item" mode="aspectFill"></image></view>
</view>
</view>
</view>
......@@ -48,89 +45,155 @@
<text class="tt">作业信息</text>
</view>
</view>
<view class="list">
<view class="box row bothSide verCenter">
<view class="list" v-if="warehouseOperationDetail.detail.length > 0">
<view class="box row bothSide verCenter" v-for="(item, index) in warehouseOperationDetail.detail" :key="index">
<view class="text">
<view class="tt row verCenter">
<view class="w1">
<text class="t1">入仓号:</text>
<text class="t2">B00001-02</text>
<text class="t2">{{ item.erp_order_sn }}</text>
</view>
<text class="t1">商品型号:</text>
<text class="t2">BC847BDW1T</text>
<text class="t2">{{ item.model }}</text>
</view>
<view class="tt row verCenter">
<view class="w1">
<text class="t1">作业类型:</text>
<text class="t2">撕贴标</text>
<text class="t2">{{ item.operation_type_cn }}</text>
</view>
<text class="t1">指令作业数:</text>
<text class="t2">50,000</text>
<text class="t2">{{ item.instructions_num }}</text>
</view>
</view>
<view class="camera row rowCenter verCenter">拍照</view>
</view>
<view class="box row bothSide verCenter">
<view class="text">
<view class="tt row verCenter">
<view class="w1">
<text class="t1">入仓号:</text>
<text class="t2">B00001-02</text>
</view>
<text class="t1">商品型号:</text>
<text class="t2">BC847BDW1T</text>
</view>
<view class="tt row verCenter">
<view class="w1">
<text class="t1">作业类型:</text>
<text class="t2">撕贴标</text>
</view>
<text class="t1">指令作业数:</text>
<text class="t2">50,000</text>
</view>
</view>
<view class="camera disable row rowCenter verCenter">已上传</view>
</view>
<view class="box row bothSide verCenter">
<view class="text">
<view class="tt row verCenter">
<view class="w1">
<text class="t1">入仓号:</text>
<text class="t2">B00001-02</text>
</view>
<text class="t1">商品型号:</text>
<text class="t2">BC847BDW1T</text>
</view>
<view class="tt row verCenter">
<view class="w1">
<text class="t1">作业类型:</text>
<text class="t2">撕贴标</text>
</view>
<text class="t1">指令作业数:</text>
<text class="t2">50,000</text>
</view>
</view>
<view class="camera disable row rowCenter verCenter">已上传</view>
<view class="camera disable row rowCenter verCenter" v-if="item.operation_img">已上传</view>
<view class="camera row rowCenter verCenter" @click="chooseImageChange()" v-else="item.operation_img">拍照</view>
</view>
</view>
</view>
<view class="btn row rowCenter verCenter">确认作业完成</view>
<view class="btn row rowCenter verCenter" @click="submit()">确认作业完成</view>
</view>
</template>
<script>
import { API } from '@/util/api.js';
import w_md5 from '../../js_sdk/zww-md5/w_md5.js';
export default {
data() {
return {};
return {
warehouseOperationDetail: {},
weonlt_id: '', //仓内作业列表ID
operation_img: [], //作业图片
actual_operation_num: [], //作业数量 来自 instructions_num
weondl_ids: [] //仓内作业详情ID
};
},
onLoad(options) {
this.weonlt_id = options.weonlt_id;
},
onShow() {
this.getData();
},
methods: {
clickImg(img, index) {
uni.previewImage({
current: index,
urls: img
});
},
chooseImageChange() {
uni.chooseImage({
count: 1,
sourceType: ['album', 'camera'],
success: chooseImageRes => {
uni.showLoading({
title: '上传中...'
});
const tempFilePaths = chooseImageRes.tempFilePaths;
const time = parseInt(new Date().getTime() / 1000);
console.log(tempFilePaths);
uni.uploadFile({
url: 'http://api.liexin.com/oss/upload',
filePath: tempFilePaths[0],
name: 'upload',
formData: {
source: '1',
k1: time,
k2: w_md5.hex_md5_32(w_md5.hex_md5_32(String(time)) + 'fh6y5t4rr351d2c3bryi')
},
success: uploadFileRes => {
uni.hideLoading();
var data = JSON.parse(uploadFileRes.data);
if (data.code === 200) {
this.operation_img.push(data.data[0]);
} else {
uni.showToast({
title: data.message,
icon: 'error'
});
}
},
fail: error => {
uni.hideLoading();
console.log(error);
}
});
}
});
},
submit() {
this.request(
API.execWarehouseOperation,
'POST',
{
weonlt_id: this.weonlt_id,
'weondl_id[]': this.weondl_ids.join(','),
operation_img: this.operation_img.join(','),
'actual_operation_num[]': this.actual_operation_num.join(',')
},
true
).then(res => {
if (res.err_code === 0) {
this.getData();
uni.showToast({
title: res.err_msg,
icon: 'success'
});
} else {
uni.showToast({
title: res.err_msg,
icon: 'error'
});
}
});
},
getData() {
this.request(API.userInfo, 'POST', {}, false).then(res => {});
this.request(API.warehouseOperationDetail, 'POST', { weonlt_id: this.weonlt_id }, false).then(res => {
if (res.err_code === 0) {
this.weondl_ids = [];
this.actual_operation_num = [];
this.operation_img = [];
this.warehouseOperationDetail = res.data;
if (res.data.list.operation_img != '') {
this.operation_img = res.data.list.operation_img.split(',');
}
//组装weondl_id[] actual_operation_num[]
if (res.data.detail.length > 0) {
for (let i = 0; i < res.data.detail.length; i++) {
this.weondl_ids.push(res.data.detail[i].weondl_id);
this.actual_operation_num.push(res.data.detail[i].instructions_num);
}
}
} else {
uni.showToast({
title: res.err_msg,
icon: 'error'
});
}
});
}
}
};
......
......@@ -36,7 +36,15 @@ const API = {
/**
* 仓内作业列表
* */
warehouseOperationList: API_BASE + '/supplywechatwms/warehouseOperationList'
warehouseOperationList: API_BASE + '/supplywechatwms/warehouseOperationList',
/**
* 仓内作业详情
* */
warehouseOperationDetail: API_BASE + '/supplywechatwms/warehouseOperationDetail',
/**
* 执行仓内作业
* */
execWarehouseOperation: API_BASE + '/supplywechatwms/execWarehouseOperation'
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment