|
|
@@ -14,9 +14,9 @@
|
|
|
<!-- 最小包装单元 -->
|
|
|
<view class="name">{{ item.titel }}</view>
|
|
|
|
|
|
- <view class="btn_box rx-bc" @click="handCancelPacking">
|
|
|
+ <!-- <view class="btn_box rx-bc" @click="handCancelPacking">
|
|
|
重置打包
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
</view>
|
|
|
|
|
|
<view class="material ">
|
|
|
@@ -25,9 +25,8 @@
|
|
|
<view class="item">
|
|
|
<view class="lable rx-cc">包装总数 </view>
|
|
|
<view class="content content_num">
|
|
|
- <input class="uni-input" v-model="item.formedNumLast" type="number" :disabled="i != 0"
|
|
|
+ <input class="uni-input" v-model="item.formedNumLast" type="number" :disabled="i != 0"
|
|
|
@input="changeinput"></input>
|
|
|
-
|
|
|
<view class="unit">{{ item.packageUnit }}</view>
|
|
|
|
|
|
</view>
|
|
|
@@ -59,14 +58,12 @@
|
|
|
|
|
|
</view>
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
<view class="content_table2" v-if='item.splitList.length'>
|
|
|
<view class="head row rx-sc">
|
|
|
<view class="item ww10">序号</view>
|
|
|
<view class="item ww30">数量</view>
|
|
|
- <view class="item ww50">条码</view>
|
|
|
+ <view class="item ww20">计量数</view>
|
|
|
+ <view class="item ww40">条码</view>
|
|
|
<!-- <view class="item ww10 jsColor" @click="calculation()" v-if="clientEnvironmentId != 3">计算</view>
|
|
|
<view class="item ww10" v-if="clientEnvironmentId == 3"></view> -->
|
|
|
</view>
|
|
|
@@ -76,11 +73,12 @@
|
|
|
<view class="item ww10 rx-cc ">{{ it.computeSize }}</view>
|
|
|
<view class="item ww30 content_num rx-sc">
|
|
|
<input class="uni-input" v-model="it.quantity" type="digit"></input>
|
|
|
- <view style="width: 260rpx; font-size: 22rpx;"> {{ it.unit }}/{{
|
|
|
+ <view style="width: 260rpx; font-size: 22rpx;"> {{ it.packageUnit }}/{{
|
|
|
item.conversionUnit }}
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="item ww50">
|
|
|
+ <view class="item ww20 rx-cc ">{{ it.totalQuantity }}</view>
|
|
|
+ <view class="item ww40">
|
|
|
{{ it.code }}
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -178,17 +176,28 @@ export default {
|
|
|
unit: '',
|
|
|
Usertype: "",// 规格
|
|
|
unitList: [],
|
|
|
-
|
|
|
+ resObj: {},
|
|
|
splitList: [],
|
|
|
localdataList: [],
|
|
|
-
|
|
|
-
|
|
|
+ newDispositionList: [],
|
|
|
+ withinQuantity: '',//内包装数量
|
|
|
+ withinUnit: '',//内包装单位
|
|
|
+ outsideQuantity: '',//外包装数量
|
|
|
+ outsideUnit: '',//外包装单位
|
|
|
+ timeout: null,
|
|
|
packUnit: null,
|
|
|
temporaryNum: 0,
|
|
|
temporaryCount: 0,
|
|
|
temporaryList: [],
|
|
|
packTwoList: [],
|
|
|
DispositionList: [],
|
|
|
+ selectList: [],
|
|
|
+ text : '',
|
|
|
+ value : '',
|
|
|
+ minimumPackage: [],// 最小包装
|
|
|
+ withinPackage: [],// 内包装
|
|
|
+
|
|
|
+ outsidePackage: [], //外包装
|
|
|
newCategoryId: '',
|
|
|
|
|
|
show: false,
|
|
|
@@ -210,15 +219,18 @@ export default {
|
|
|
},
|
|
|
objData: {
|
|
|
handler(newVal) {
|
|
|
- this.formedNumLast = newVal.formedNumLast;
|
|
|
- console.log(this.formedNumLast );
|
|
|
+ console.log(newVal, 'newVal');
|
|
|
+ if (newVal.product && newVal.product.length) {
|
|
|
+ this.formedNumLast = newVal.product[0].feedQuantity;
|
|
|
+ }
|
|
|
+ //
|
|
|
},
|
|
|
deep: true,
|
|
|
immediate: true
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- // this.formedNumLast = this.objData.formedNumLast;
|
|
|
+ // this.formedNumLast = this.objData.product[0].feedQuantity;
|
|
|
|
|
|
this.byCode();
|
|
|
|
|
|
@@ -229,14 +241,22 @@ export default {
|
|
|
|
|
|
methods: {
|
|
|
// 输入数量变化
|
|
|
- changeinput(e){
|
|
|
- console.log(e);
|
|
|
+ changeinput(e) {
|
|
|
+ clearTimeout(this.timeout)
|
|
|
+ // 设置新的定时器
|
|
|
+ this.timeout = setTimeout(() => {
|
|
|
+ this.formedNumLast = e.detail.value;
|
|
|
+ this.initFn(this.selectList);
|
|
|
+ }, 500) // 500毫秒后触发
|
|
|
|
|
|
},
|
|
|
|
|
|
changeUserType(e) {
|
|
|
-
|
|
|
- this.listFn(e.arr);
|
|
|
+ console.log(e);
|
|
|
+ this.text = e.text;
|
|
|
+ this.value = e.value;
|
|
|
+ this.selectList = e.arr;
|
|
|
+ this.initFn(e.arr);
|
|
|
},
|
|
|
groupBy(arr, key) {
|
|
|
return arr.reduce((acc, obj) => {
|
|
|
@@ -253,7 +273,7 @@ export default {
|
|
|
async packageDispositionFn() {
|
|
|
let that = this;
|
|
|
const res = await packageDisposition(this.newCategoryId);
|
|
|
-
|
|
|
+
|
|
|
if (res.length) {
|
|
|
res.shift();
|
|
|
let data = JSON.parse(JSON.stringify(res));
|
|
|
@@ -268,46 +288,58 @@ export default {
|
|
|
});
|
|
|
|
|
|
this.Usertype = this.localdataList[0].value;
|
|
|
- this.listFn(this.localdataList[0].arr);
|
|
|
+ this.text = this.localdataList[0].text;
|
|
|
+ this.value =this.localdataList[0].value;
|
|
|
+ res.map(v => {
|
|
|
+ v.splitList = [];
|
|
|
+ })
|
|
|
+ this.newDispositionList = res;
|
|
|
+ this.selectList = res;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ this.initFn(this.localdataList[0].arr);
|
|
|
+ // this.listFn(this.localdataList[0].arr);
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
+ initFn(v) {
|
|
|
|
|
|
- listFn(arr) {
|
|
|
- let obj = {
|
|
|
- withinQuantity: "",
|
|
|
- withinUnit: '',
|
|
|
- outsideQuantity: '',
|
|
|
- outsideUnit: ''
|
|
|
- }
|
|
|
+ if (v.length) {
|
|
|
+ this.withinQuantity = v[1].packageCell;//内包装数量
|
|
|
+ this.withinUnit = v[1].packageUnit;//内包装单位
|
|
|
+ this.outsideQuantity = v[2].packageCell;//外包装数量
|
|
|
+ this.outsideUnit = v[2].packageUnit;//外包装单位
|
|
|
+ };
|
|
|
+ console.log('几次');
|
|
|
+ this.handleSplit(v[0]);
|
|
|
+ },
|
|
|
+
|
|
|
+ async listFn(res) {
|
|
|
+
|
|
|
+ let { minimumPackage, withinQuantity, outsidePackage, outsideQuantity, withinPackage } = res;
|
|
|
let textList = ['最小包装', '内包装', '外包装'];
|
|
|
- arr.map(async (v, i) => {
|
|
|
- v.splitList = [];
|
|
|
+ let arr = [{ list: minimumPackage }, { list: withinPackage, num: withinQuantity }, { list: outsidePackage, num: outsideQuantity }];
|
|
|
+
|
|
|
+ this.minimumPackage= minimumPackage;// 最小包装
|
|
|
+ this.withinPackage= withinPackage;// 内包装
|
|
|
+ this.outsidePackage= outsidePackage; //外包装
|
|
|
+
|
|
|
+ this.newDispositionList.map((v, i) => {
|
|
|
+ v.splitList = arr[i].list;
|
|
|
v.titel = textList[i];
|
|
|
- if (i === 0) {
|
|
|
+ if (i == 0) {
|
|
|
v.formedNumLast = this.formedNumLast;
|
|
|
- v.splitList = await this.handleSplit(v)||[];
|
|
|
- // this.$nextTick(c () => {
|
|
|
-
|
|
|
- // })
|
|
|
- }
|
|
|
-
|
|
|
- if (i === 1) {
|
|
|
- obj.withinQuantity = v.packageCell;
|
|
|
- obj.withinUnit = v.conversionUnit
|
|
|
- }
|
|
|
- if (i === 2) {
|
|
|
- obj.outsideQuantity = v.packageCell;
|
|
|
- obj.outsideUnit = v.conversionUnit;
|
|
|
+ } else {
|
|
|
+ v.formedNumLast = arr[i].num;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
})
|
|
|
-
|
|
|
- this.$set(this,'DispositionList',arr)
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$set(this, 'DispositionList', this.newDispositionList);
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
|
|
|
@@ -393,6 +425,7 @@ export default {
|
|
|
|
|
|
// 第一次调用
|
|
|
handleSplit(v) {
|
|
|
+
|
|
|
if (this.splitList.length) {
|
|
|
uni.showToast({
|
|
|
title: '产品已分包',
|
|
|
@@ -401,7 +434,7 @@ export default {
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
- if (!v.formedNumLast) {
|
|
|
+ if (!this.formedNumLast) {
|
|
|
uni.showToast({
|
|
|
title: '包装总数数量不能为空',
|
|
|
icon: 'none'
|
|
|
@@ -426,31 +459,31 @@ export default {
|
|
|
}
|
|
|
|
|
|
let param = {
|
|
|
- totalQuantity: v.formedNumLast,
|
|
|
- quantity: v.packageCell,
|
|
|
- unit: v.packageUnit,
|
|
|
- packageUnit: v.conversionUnit,
|
|
|
- workOrderId: this.workOrderId,
|
|
|
+ workOrderId: this.workOrderId,//工单id
|
|
|
taskId: this.taskId,
|
|
|
- tier: 1
|
|
|
+ tier: 1,
|
|
|
+ totalQuantity: this.formedNumLast,//总数量
|
|
|
+ quantity: v.packageCell,//数量
|
|
|
+ unit: v.packageUnit,//单位
|
|
|
+
|
|
|
+ withinQuantity: this.withinQuantity,//内包装数量
|
|
|
+ withinUnit: this.withinUnit,//内包装单位
|
|
|
+ outsideQuantity: this.outsideQuantity,//外包装数量
|
|
|
+ outsideUnit: this.outsideUnit,//外包装单位
|
|
|
+
|
|
|
+ packageUnit: v.conversionUnit,
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- packingReport(param).then(res => {
|
|
|
- this.splitList = res.map(m => {
|
|
|
+ packingReport(param).then(res => {
|
|
|
+
|
|
|
+ this.listFn(res);
|
|
|
|
|
|
- return {
|
|
|
- check: false,
|
|
|
- ...m
|
|
|
- }
|
|
|
- })
|
|
|
- resolve(this.splitList)
|
|
|
- // this.getPackingDetails()
|
|
|
- })
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
},
|
|
|
|
|
|
handleCheck(idx, it) {
|
|
|
@@ -560,11 +593,30 @@ export default {
|
|
|
_packingReportMarginList = this.splitList.filter(e => {
|
|
|
return !e.parentId
|
|
|
})
|
|
|
-
|
|
|
let packInfo = {
|
|
|
- packingReportList: this.packTwoList,
|
|
|
- packingReportMarginList: _packingReportMarginList,
|
|
|
- formedNumLast: this.formedNumLast
|
|
|
+ // this.DispositionList[0]
|
|
|
+ specText : this.text,
|
|
|
+ specValue : this.value,
|
|
|
+ minimumPackage: this.minimumPackage,// 最小包装
|
|
|
+ minimumPackageCell: this.DispositionList[0].packageCell,// 最小包装
|
|
|
+ minimumPackageUnit: this.DispositionList[0].packageUnit,// 最小包装单位
|
|
|
+ minimumConversionUnit: this.DispositionList[0].conversionUnit,// 最小包装单位
|
|
|
+ minimumFormedNumLast : this.DispositionList[0].formedNumLast,// 总包装数量
|
|
|
+
|
|
|
+
|
|
|
+ withinPackage: this.withinPackage,// 内包装
|
|
|
+
|
|
|
+ withinPackageCell: this.DispositionList[1].packageCell,// 最小包装名称
|
|
|
+ withinPackageUnit: this.DispositionList[1].packageUnit,// 最小包装单位
|
|
|
+ withinConversionUnit: this.DispositionList[1].conversionUnit,// 最小包装单位
|
|
|
+ withinFormedNumLast : this.DispositionList[1].formedNumLast,// 总包装数量
|
|
|
+ // packingReportList: this.packTwoList,
|
|
|
+ // packingReportMarginList: _packingReportMarginList,
|
|
|
+ outsidePackage: this.outsidePackage, //外包装
|
|
|
+ outsidePackageCell: this.DispositionList[2].packageCell,// 最小包装名称
|
|
|
+ outsidePackageUnit: this.DispositionList[2].packageUnit,// 最小包装单位
|
|
|
+ outsideConversionUnit: this.DispositionList[2].conversionUnit,// 最小包装单位
|
|
|
+ outsideFormedNumLast : this.DispositionList[2].formedNumLast,// 总包装数量
|
|
|
}
|
|
|
return packInfo
|
|
|
},
|
|
|
@@ -623,6 +675,10 @@ export default {
|
|
|
.title_box {
|
|
|
margin-top: 20rpx;
|
|
|
|
|
|
+ .ww20 {
|
|
|
+ width: 20%;
|
|
|
+ }
|
|
|
+
|
|
|
.name {
|
|
|
font-size: 28rpx;
|
|
|
font-style: normal;
|
|
|
@@ -781,6 +837,14 @@ export default {
|
|
|
width: 30%;
|
|
|
}
|
|
|
|
|
|
+ .ww20 {
|
|
|
+ width: 20%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ww40 {
|
|
|
+ width: 40%;
|
|
|
+ }
|
|
|
+
|
|
|
.jsColor {
|
|
|
color: $theme-color;
|
|
|
font-size: 20rpx;
|