|
|
@@ -5,7 +5,7 @@
|
|
|
>是否拆包:</div
|
|
|
>
|
|
|
<span
|
|
|
- v-if="objData.isUnpack == '1'"
|
|
|
+ v-if="objData.isUnpack == '1' || isNewUnpack == 1"
|
|
|
style="
|
|
|
color: green;
|
|
|
font-size: 14px;
|
|
|
@@ -25,15 +25,16 @@
|
|
|
>否</span
|
|
|
>
|
|
|
|
|
|
- <!-- <el-button
|
|
|
+ <el-button
|
|
|
type="primary"
|
|
|
size="mini"
|
|
|
style="margin-left: 40px"
|
|
|
@click="checkUnpack"
|
|
|
- >拆包</el-button
|
|
|
- > -->
|
|
|
+ v-if="objData.isUnpack != '1'"
|
|
|
+ >手动拆包</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
- <div v-if="objData.isUnpack == '1'">
|
|
|
+ <div v-if="objData.isUnpack == '1' && (isNewUnpack == 0 || !isNewUnpack)">
|
|
|
<div class="col userInp" style="display: flex; align-items: center">
|
|
|
<div class="label lable150 rx-cc" style="width: 100px !important"
|
|
|
>规格选择:</div
|
|
|
@@ -207,7 +208,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div v-if="isNewUnpack">
|
|
|
+ <div v-if="isNewUnpack == 1">
|
|
|
<div class="col userInp" style="display: flex; align-items: center">
|
|
|
<div class="label lable150 rx-cc" style="width: 100px !important"
|
|
|
>规格选择:</div
|
|
|
@@ -227,32 +228,58 @@
|
|
|
</el-select>
|
|
|
</div>
|
|
|
|
|
|
- <!-- <div class="material">
|
|
|
+ <div class="material">
|
|
|
<div class="content_table">
|
|
|
<div class="item">
|
|
|
- <div class="lable rx-cc">包装总数 </div>
|
|
|
+ <div class="lable rx-cc">总数 </div>
|
|
|
<div class="content content_num">
|
|
|
<el-input
|
|
|
class="uni-el-input"
|
|
|
v-model="formedNumLast"
|
|
|
type="number"
|
|
|
- v-if="i == 0"
|
|
|
@input="changeinput"
|
|
|
disabled
|
|
|
style="width: 200px"
|
|
|
></el-input>
|
|
|
+ {{ packageUnit }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="material">
|
|
|
+ <div
|
|
|
+ class="content_table"
|
|
|
+ v-for="(item, i) in DispositionList"
|
|
|
+ :key="i"
|
|
|
+ >
|
|
|
+ <div class="title_box rx-bc mt6">
|
|
|
+ <div class="name">{{ item.titel }}</div>
|
|
|
+
|
|
|
+ <div class="rx-bc"> </div>
|
|
|
+ </div>
|
|
|
+ <div class="item">
|
|
|
+ <div class="lable rx-cc">包装总数 </div>
|
|
|
+ <div class="content content_num">
|
|
|
+ <!-- <el-input
|
|
|
+ class="uni-el-input"
|
|
|
+ v-model="formedNumLast"
|
|
|
+ type="number"
|
|
|
+ v-if="i == 0"
|
|
|
+ @input="changeinput"
|
|
|
+ disabled
|
|
|
+ style="width: 200px"
|
|
|
+ ></el-input> -->
|
|
|
<el-input
|
|
|
class="uni-el-input"
|
|
|
v-model="item.formedNumLast"
|
|
|
type="number"
|
|
|
- v-else
|
|
|
disabled
|
|
|
style="width: 200px"
|
|
|
></el-input>
|
|
|
- <div class="unit">{{ item.packageUnit }}</div>
|
|
|
+ <div class="unit">{{ item.conversionUnit }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
<div class="item rx-sc">
|
|
|
<div class="rx ww55">
|
|
|
<div class="lable lable200 rx-cc">{{ item.titel }}单元</div>
|
|
|
@@ -260,8 +287,9 @@
|
|
|
<el-input
|
|
|
class="uni-el-input"
|
|
|
v-model="item.packageCell"
|
|
|
- disabled
|
|
|
style="width: 200px"
|
|
|
+ @input="changeInputPack(item, i)"
|
|
|
+ :disabled="!item.conversionUnit"
|
|
|
></el-input>
|
|
|
<div class="unit">{{ item.packageUnit }}</div
|
|
|
>/<div class="unit">{{ item.conversionUnit }}</div>
|
|
|
@@ -269,7 +297,46 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div> -->
|
|
|
+
|
|
|
+ <div v-for="(item, index) in DispositionList" :key="item.id">
|
|
|
+ <div v-if="item.splitList.length">
|
|
|
+ <ele-pro-table
|
|
|
+ ref="table"
|
|
|
+ :needPage="false"
|
|
|
+ :columns="columnsMin"
|
|
|
+ :datasource="item.splitList"
|
|
|
+ class="time-form"
|
|
|
+ max-height="400"
|
|
|
+ row-key="index"
|
|
|
+ >
|
|
|
+ <template v-slot:newWeight="{ row, $index }">
|
|
|
+ <span
|
|
|
+ >{{ row.extInfo.newWeight }}{{ row.extInfo.weightUnit }}</span
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:feedQuantity="{ row, $index }">
|
|
|
+ <span>{{ row.feedQuantity }}</span>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:reportWeight="{ row, $index }">
|
|
|
+ <span
|
|
|
+ >{{ row.extInfo.reportWeight
|
|
|
+ }}{{ row.extInfo.weightUnit }}</span
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:packageQuantity="{ row, $index }">
|
|
|
+ <span>{{ row.packageQuantity }}{{ row.packingUnit }}</span>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:packageDisposition="{ row, $index }">
|
|
|
+ <el-tag>{{ packageDispositionData }}</el-tag>
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -373,8 +440,17 @@
|
|
|
}
|
|
|
],
|
|
|
cacheKeyUrlMin: 'cacheKeyUrlMin',
|
|
|
- isNewUnpack: false
|
|
|
- // clientEnvironmentId: uni.getStorageSync("userInfo") && uni.getStorageSync("userInfo").clientEnvironmentId,
|
|
|
+ isNewUnpack: 0,
|
|
|
+ packageCell: '',
|
|
|
+ packageUnit: '',
|
|
|
+ conversionUnit: '',
|
|
|
+ packageOneCell: '',
|
|
|
+ packageOneUnit: '',
|
|
|
+ conversionOneUnit: '',
|
|
|
+ packageTwoCell: '',
|
|
|
+ packageTwoUnit: '',
|
|
|
+ conversionTwoUnit: '',
|
|
|
+ packageDispositionData: ''
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -386,10 +462,6 @@
|
|
|
this.formedNumLast = newVal.product.reduce((acc, pro) => {
|
|
|
return pro.feedQuantity ? acc + Number(pro.feedQuantity) : acc;
|
|
|
}, 0);
|
|
|
-
|
|
|
- console.log(this.formedNumLast);
|
|
|
- // this.formedNumLast =
|
|
|
- // newVal.formedNumLast || newVal.product[0].feedQuantity;
|
|
|
} else if (newVal.semiProductList && newVal.semiProductList.length) {
|
|
|
this.newCategoryId = newVal.semiProductList[0].categoryId;
|
|
|
this.formedNumLast = newVal.semiProductList.reduce((acc, pro) => {
|
|
|
@@ -398,7 +470,6 @@
|
|
|
} else {
|
|
|
this.formedNumLast = 0;
|
|
|
}
|
|
|
- console.log(newVal);
|
|
|
if (newVal.isUnpack == '1') {
|
|
|
this.packageDispositionFn();
|
|
|
}
|
|
|
@@ -475,6 +546,24 @@
|
|
|
: '';
|
|
|
}
|
|
|
},
|
|
|
+ {
|
|
|
+ minWidth: 150,
|
|
|
+ prop: 'extInfo.packageDisposition',
|
|
|
+ slot: 'packageDisposition',
|
|
|
+ label: '包装规格',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ minWidth: 150,
|
|
|
+ prop: 'packageQuantity',
|
|
|
+ slot: 'packageQuantity',
|
|
|
+ label: '包装数量',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+
|
|
|
{
|
|
|
minWidth: 120,
|
|
|
prop: 'extInfo.engrave',
|
|
|
@@ -722,11 +811,7 @@
|
|
|
item.textValue = item.text + `(${this.selectPackInfo(res[2])})`;
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
- // console.log(res[0], res[1], res[2], '555555554444444');
|
|
|
-
|
|
|
this.initFn(this.localdataList[0].arr);
|
|
|
- // this.listFn(this.localdataList[0].arr);
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -777,20 +862,10 @@
|
|
|
arr.push({ list: outsidePackage, num: outsideQuantity });
|
|
|
}
|
|
|
|
|
|
- // return;
|
|
|
-
|
|
|
- // let arr = [
|
|
|
- // { list: minimumPackage },
|
|
|
- // { list: withinPackage, num: withinQuantity },
|
|
|
- // { list: outsidePackage, num: outsideQuantity }
|
|
|
- // ];
|
|
|
-
|
|
|
this.minimumPackage = minimumPackage; // 最小包装
|
|
|
this.withinPackage = withinPackage; // 内包装
|
|
|
this.outsidePackage = outsidePackage; //外包装
|
|
|
|
|
|
- console.log(this.newDispositionList, 'this.newDispositionList1');
|
|
|
-
|
|
|
this.newDispositionList.map((v, i) => {
|
|
|
v.splitList = arr[0].list;
|
|
|
v.titel = textList[0];
|
|
|
@@ -801,10 +876,9 @@
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- console.log(this.newDispositionList, 'this.newDispositionList2');
|
|
|
-
|
|
|
this.$nextTick(() => {
|
|
|
this.$set(this, 'DispositionList', this.newDispositionList);
|
|
|
+ this.$forceUpdate();
|
|
|
});
|
|
|
},
|
|
|
|
|
|
@@ -857,78 +931,324 @@
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- // checkUnpack() {
|
|
|
- // this.$confirm('此操作将进行拆包, 是否继续?', '提示', {
|
|
|
- // confirmButtonText: '确定',
|
|
|
- // cancelButtonText: '取消',
|
|
|
- // type: 'warning'
|
|
|
- // })
|
|
|
- // .then(() => {
|
|
|
- // this.checkUnpackProduction();
|
|
|
- // })
|
|
|
- // .catch(() => {});
|
|
|
- // },
|
|
|
-
|
|
|
- // checkUnpackProduction() {
|
|
|
- // this.isNewUnpack = true;
|
|
|
- // this.getPackingData();
|
|
|
- // },
|
|
|
-
|
|
|
- // async getPackingData() {
|
|
|
- // if (!this.newCategoryId) return;
|
|
|
-
|
|
|
- // let that = this;
|
|
|
- // const res = await packageDisposition(this.newCategoryId);
|
|
|
-
|
|
|
- // if (res.length) {
|
|
|
- // res.shift();
|
|
|
- // let data = JSON.parse(JSON.stringify(res));
|
|
|
- // let list = this.groupBy(data, 'code');
|
|
|
- // this.localdataList = [];
|
|
|
- // Object.entries(list).forEach(([key, value]) => {
|
|
|
- // let obj = {
|
|
|
- // text: value[0].name,
|
|
|
- // arr: value,
|
|
|
- // value: key
|
|
|
- // };
|
|
|
- // this.localdataList.push(obj);
|
|
|
- // });
|
|
|
-
|
|
|
- // this.Usertype = this.localdataList[0].value;
|
|
|
- // this.text = this.localdataList[0].text;
|
|
|
- // this.value = this.localdataList[0].value;
|
|
|
- // res.map((v) => {
|
|
|
- // v.splitList = [];
|
|
|
- // });
|
|
|
-
|
|
|
- // this.newDispositionList = res;
|
|
|
- // // if (this.warehouseId == 2) {
|
|
|
- // // this.newDispositionList = [res[0]];
|
|
|
- // // } else if (this.warehouseId == 3) {
|
|
|
- // // this.newDispositionList = [res[1]];
|
|
|
- // // } else if (this.warehouseId == 4) {
|
|
|
- // // this.newDispositionList = [res[2]];
|
|
|
- // // }
|
|
|
- // this.selectList = res;
|
|
|
- // this.initData(this.localdataList[0].arr);
|
|
|
-
|
|
|
- // console.log(this.newDispositionList, 'this.newDispositionList');
|
|
|
- // // this.initFn(this.localdataList[0].arr);
|
|
|
- // }
|
|
|
- // },
|
|
|
-
|
|
|
- // initData(v) {
|
|
|
- // if (v.length) {
|
|
|
- // this.withinQuantity = v[1].packageCell; //内包装数量
|
|
|
- // this.withinUnit = v[1].conversionUnit; //内包装单位
|
|
|
- // this.outsideQuantity = v[2].packageCell; //外包装数量
|
|
|
- // this.outsideUnit = v[2].conversionUnit; //外包装单位
|
|
|
- // this.minimumUnit = v[0].conversionUnit;
|
|
|
- // }
|
|
|
-
|
|
|
- // console.log(v[0], 'v[0]');
|
|
|
- // // this.handleSplit(v[0]);
|
|
|
- // },
|
|
|
+ checkUnpack() {
|
|
|
+ this.$confirm('此操作将进行拆包, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.checkUnpackProduction();
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
+
|
|
|
+ checkUnpackProduction() {
|
|
|
+ this.isNewUnpack = 1;
|
|
|
+ this.getPackingData();
|
|
|
+ },
|
|
|
+
|
|
|
+ async getPackingData() {
|
|
|
+ if (!this.newCategoryId) return;
|
|
|
+
|
|
|
+ let that = this;
|
|
|
+ const res = await packageDisposition(this.newCategoryId);
|
|
|
+
|
|
|
+ if (res.length) {
|
|
|
+ res.shift();
|
|
|
+ let data = JSON.parse(JSON.stringify(res));
|
|
|
+ let list = this.groupBy(data, 'code');
|
|
|
+ this.localdataList = [];
|
|
|
+ Object.entries(list).forEach(([key, value]) => {
|
|
|
+ let obj = {
|
|
|
+ text: value[0].name,
|
|
|
+ arr: value,
|
|
|
+ value: key
|
|
|
+ };
|
|
|
+ this.localdataList.push(obj);
|
|
|
+ });
|
|
|
+
|
|
|
+ this.Usertype = this.localdataList[0].value;
|
|
|
+ this.text = this.localdataList[0].text;
|
|
|
+ this.value = this.localdataList[0].value;
|
|
|
+ res.map((v) => {
|
|
|
+ v.splitList = [];
|
|
|
+ });
|
|
|
+
|
|
|
+ this.newDispositionList = res;
|
|
|
+
|
|
|
+ this.selectList = res;
|
|
|
+ this.initData(this.localdataList[0].arr);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ initData(v) {
|
|
|
+ if (v.length) {
|
|
|
+ this.withinQuantity = v[1].packageCell; //内包装数量
|
|
|
+ this.withinUnit = v[1].conversionUnit; //内包装单位
|
|
|
+ this.outsideQuantity = v[2].packageCell; //外包装数量
|
|
|
+ this.outsideUnit = v[2].conversionUnit; //外包装单位
|
|
|
+ this.minimumUnit = v[0].conversionUnit;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.handleSplit1(v[0]);
|
|
|
+ },
|
|
|
+
|
|
|
+ handleSplit1(v) {
|
|
|
+ console.log(v, 99655);
|
|
|
+
|
|
|
+ if (this.splitList.length) {
|
|
|
+ this.$message.error('产品已分包');
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!this.formedNumLast) {
|
|
|
+ this.$message.error('包装总数数量不能为空');
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!v.packageCell) {
|
|
|
+ this.$message.error('内包装数量不能为空');
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!v.packageUnit) {
|
|
|
+ this.$message.error('包装单位不能为空');
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.packageCell = this.formedNumLast;
|
|
|
+ this.packageUnit = v.packageUnit;
|
|
|
+
|
|
|
+ let param = {
|
|
|
+ workOrderId: this.workOrderId, //工单id
|
|
|
+ taskId: this.taskId,
|
|
|
+ tier: '',
|
|
|
+ totalQuantity: this.formedNumLast, //总数量
|
|
|
+ quantity: v.packageCell, //数量
|
|
|
+ unit: v.packageUnit, //单位
|
|
|
+ minimumUnit: this.minimumUnit, //最小包装单位
|
|
|
+ withinQuantity: this.withinQuantity, //内包装数量
|
|
|
+ withinUnit: this.withinUnit, //内包装单位
|
|
|
+ outsideQuantity: this.outsideQuantity, //外包装数量
|
|
|
+ outsideUnit: this.outsideUnit, //外包装单位
|
|
|
+ packageUnit: v.conversionUnit,
|
|
|
+ isNewUnpack: this.isNewUnpack
|
|
|
+ };
|
|
|
+
|
|
|
+ getPackingList(param).then((res) => {
|
|
|
+ console.log(res, '111111111111');
|
|
|
+
|
|
|
+ if (this.warehouseId != 1) {
|
|
|
+ this.listFn1(res);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ async listFn1(res) {
|
|
|
+ let {
|
|
|
+ minimumPackage,
|
|
|
+ withinQuantity,
|
|
|
+ outsidePackage,
|
|
|
+ outsideQuantity,
|
|
|
+ withinPackage,
|
|
|
+ minimumQuantity
|
|
|
+ } = res;
|
|
|
+ let textList = ['最小包装', '内包装', '外包装'];
|
|
|
+ let arr = [
|
|
|
+ { list: minimumPackage, num: minimumQuantity },
|
|
|
+ { 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) {
|
|
|
+ // v.formedNumLast = this.formedNumLast;
|
|
|
+ // } else {
|
|
|
+ v.formedNumLast = arr[i].num;
|
|
|
+ // }
|
|
|
+ });
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.newDispositionList.forEach((item, index) => {
|
|
|
+ if (index == 0) {
|
|
|
+ this.packageCell = item.formedNumLast ? item.formedNumLast : '';
|
|
|
+ this.packageUnit = item.packageUnit ? item.packageUnit : '';
|
|
|
+ this.conversionUnit = item.conversionUnit
|
|
|
+ ? item.conversionUnit
|
|
|
+ : '';
|
|
|
+ } else if (index == 1) {
|
|
|
+ this.packageOneCell = item.formedNumLast
|
|
|
+ ? item.formedNumLast
|
|
|
+ : '';
|
|
|
+ this.packageOneUnit = item.packageUnit ? item.packageUnit : '';
|
|
|
+ this.conversionOneUnit = item.conversionUnit
|
|
|
+ ? item.conversionUnit
|
|
|
+ : '';
|
|
|
+ } else if (index == 2) {
|
|
|
+ this.packageTwoCell = item.formedNumLast
|
|
|
+ ? item.formedNumLast
|
|
|
+ : '';
|
|
|
+ this.packageTwoUnit = item.packageUnit ? item.packageUnit : '';
|
|
|
+ this.conversionTwoUnit = item.conversionUnit
|
|
|
+ ? item.conversionUnit
|
|
|
+ : '';
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.packageDispositionData = `${this.formedNumLast}${this.packageUnit}/${this.packageCell}${this.conversionUnit}/${this.packageOneCell}${this.conversionOneUnit}/${this.packageTwoCell}${this.conversionTwoUnit}`;
|
|
|
+ this.newDispositionList.forEach((item, index) => {
|
|
|
+ if (item.splitList.length != 0) {
|
|
|
+ item.splitList[0].extInfo.packageDisposition =
|
|
|
+ this.packageDispositionData;
|
|
|
+ if (index == 0) {
|
|
|
+ this.warehouseId = 2;
|
|
|
+ } else if (index == 1) {
|
|
|
+ this.warehouseId = 3;
|
|
|
+ } else if (index == 2) {
|
|
|
+ this.warehouseId = 4;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.$set(this, 'DispositionList', this.newDispositionList);
|
|
|
+ this.$forceUpdate();
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ debounce(func, wait, immediate = false) {
|
|
|
+ let timeout = null;
|
|
|
+
|
|
|
+ // 返回包装后的防抖函数
|
|
|
+ return function (...args) {
|
|
|
+ const context = this;
|
|
|
+
|
|
|
+ // 如果定时器存在,清除之前的定时器(取消未执行的延迟操作)
|
|
|
+ if (timeout) clearTimeout(timeout);
|
|
|
+
|
|
|
+ if (immediate) {
|
|
|
+ // 立即执行模式:首次触发立即执行,后续在 wait 时间内触发则重新计时
|
|
|
+ const callNow = !timeout;
|
|
|
+ timeout = setTimeout(() => {
|
|
|
+ timeout = null; // 恢复可执行状态
|
|
|
+ }, wait);
|
|
|
+ if (callNow) func.apply(context, args);
|
|
|
+ } else {
|
|
|
+ // 延迟执行模式:最后一次触发后等待 wait 时间再执行
|
|
|
+ timeout = setTimeout(() => {
|
|
|
+ func.apply(context, args);
|
|
|
+ }, wait);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+
|
|
|
+ changeInputPack(item, index) {
|
|
|
+ setTimeout(() => {
|
|
|
+ if (this.DispositionList[index]) {
|
|
|
+ if (!this.DispositionList[index].packageCell) {
|
|
|
+ if (index <= this.DispositionList.length - 1) {
|
|
|
+ this.DispositionList[index].formedNumLast = '';
|
|
|
+
|
|
|
+ if (index + 1 <= this.DispositionList.length - 1) {
|
|
|
+ this.DispositionList[index + 1].formedNumLast = '';
|
|
|
+ }
|
|
|
+
|
|
|
+ if (index + 2 <= this.DispositionList.length - 1) {
|
|
|
+ this.DispositionList[index + 2].formedNumLast = '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ this.newDispositionList.forEach((item, index) => {
|
|
|
+ if (index == 0) {
|
|
|
+ this.packageCell = item.formedNumLast
|
|
|
+ ? item.formedNumLast
|
|
|
+ : '';
|
|
|
+ this.packageUnit = item.packageUnit ? item.packageUnit : '';
|
|
|
+ this.conversionUnit = item.conversionUnit
|
|
|
+ ? item.conversionUnit
|
|
|
+ : '';
|
|
|
+ } else if (index == 1) {
|
|
|
+ this.packageOneCell = item.formedNumLast
|
|
|
+ ? item.formedNumLast
|
|
|
+ : '';
|
|
|
+ this.packageOneUnit = item.packageUnit
|
|
|
+ ? item.packageUnit
|
|
|
+ : '';
|
|
|
+ this.conversionOneUnit = item.conversionUnit
|
|
|
+ ? item.conversionUnit
|
|
|
+ : '';
|
|
|
+ } else if (index == 2) {
|
|
|
+ this.packageTwoCell = item.formedNumLast
|
|
|
+ ? item.formedNumLast
|
|
|
+ : '';
|
|
|
+ this.packageTwoUnit = item.packageUnit
|
|
|
+ ? item.packageUnit
|
|
|
+ : '';
|
|
|
+ this.conversionTwoUnit = item.conversionUnit
|
|
|
+ ? item.conversionUnit
|
|
|
+ : '';
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.packageDispositionData = `${this.formedNumLast}${this.packageUnit}/${this.packageCell}${this.conversionUnit}/${this.packageOneCell}${this.conversionOneUnit}/${this.packageTwoCell}${this.conversionTwoUnit}`;
|
|
|
+
|
|
|
+ this.DispositionList.forEach((item, index) => {
|
|
|
+ if (item.splitList.length != 0) {
|
|
|
+ this.DispositionList[
|
|
|
+ index
|
|
|
+ ].splitList[0].extInfo.packageDisposition =
|
|
|
+ this.packageDispositionData;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.$forceUpdate();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.DispositionList[index]) {
|
|
|
+ if (this.DispositionList[index].titel == '最小包装') {
|
|
|
+ if (
|
|
|
+ this.DispositionList[index].formedNumLast &&
|
|
|
+ Number(this.DispositionList[index].packageCell) >
|
|
|
+ Number(this.formedNumLast)
|
|
|
+ ) {
|
|
|
+ this.DispositionList[index].packageCell = Number(
|
|
|
+ this.formedNumLast
|
|
|
+ );
|
|
|
+ }
|
|
|
+ } else if (this.DispositionList[index].titel == '内包装') {
|
|
|
+ if (
|
|
|
+ this.DispositionList[index - 1].formedNumLast &&
|
|
|
+ Number(this.DispositionList[index].packageCell) >
|
|
|
+ Number(this.DispositionList[index - 1].formedNumLast)
|
|
|
+ ) {
|
|
|
+ this.DispositionList[index].packageCell = Number(
|
|
|
+ this.DispositionList[index - 1].formedNumLast
|
|
|
+ );
|
|
|
+ }
|
|
|
+ } else if (this.DispositionList[index].titel == '外包装') {
|
|
|
+ if (
|
|
|
+ this.DispositionList[index - 1].formedNumLast &&
|
|
|
+ Number(this.DispositionList[index].packageCell) >
|
|
|
+ Number(this.DispositionList[index - 1].formedNumLast)
|
|
|
+ ) {
|
|
|
+ this.DispositionList[index].packageCell = Number(
|
|
|
+ this.DispositionList[index - 1].formedNumLast
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log(this.DispositionList, '返回的数据');
|
|
|
+ this.initData(this.DispositionList);
|
|
|
+ }, 500);
|
|
|
+ },
|
|
|
|
|
|
// 第一次调用
|
|
|
handleSplit(v) {
|
|
|
@@ -1084,7 +1404,7 @@
|
|
|
|
|
|
console.log(this.DispositionList, 'this.DispositionList');
|
|
|
let packInfo = {};
|
|
|
- if (this.warehouseId == 2) {
|
|
|
+ if (this.isNewUnpack == 1) {
|
|
|
if (this.DispositionList && this.DispositionList.length != 0) {
|
|
|
packInfo = {
|
|
|
// this.DispositionList[0]
|
|
|
@@ -1092,56 +1412,94 @@
|
|
|
specText: this.text,
|
|
|
specValue: this.value,
|
|
|
minimumPackage: this.minimumPackage, // 最小包装
|
|
|
+ withinPackage: this.withinPackage,
|
|
|
+ outsidePackage: this.outsidePackage,
|
|
|
tier: this.warehouseId,
|
|
|
isUnpack: this.objData.isUnpack,
|
|
|
- packUnitInfo: this.warehouseSpecTypeList[1].textValue,
|
|
|
+ packageUnit: this.packageUnit,
|
|
|
+ formedNumLast: this.formedNumLast,
|
|
|
minimumPackageCell: this.DispositionList[0].packageCell, // 最小包装
|
|
|
minimumPackageUnit: this.DispositionList[0].packageUnit, // 最小包装单位
|
|
|
minimumConversionUnit: this.DispositionList[0].conversionUnit, // 最小包装单位
|
|
|
- minimumFormedNumLast: this.DispositionList[0].formedNumLast // 总包装数量
|
|
|
+ minimumFormedNumLast: this.DispositionList[0].formedNumLast, // 总包装数量
|
|
|
+ withinPackageCell: this.DispositionList[1].packageCell, // 最小包装名称
|
|
|
+ withinPackageUnit: this.DispositionList[1].packageUnit, // 最小包装单位
|
|
|
+ withinConversionUnit: this.DispositionList[1].conversionUnit, // 最小包装单位
|
|
|
+ withinFormedNumLast: this.DispositionList[1].formedNumLast, // 总包装数量
|
|
|
+ outsidePackageCell: this.DispositionList[2].packageCell, // 最小包装名称
|
|
|
+ outsidePackageUnit: this.DispositionList[2].packageUnit, // 最小包装单位
|
|
|
+ outsideConversionUnit: this.DispositionList[2].conversionUnit, // 最小包装单位
|
|
|
+ outsideFormedNumLast: this.DispositionList[2].formedNumLast,
|
|
|
+ isNewUnpack: this.isNewUnpack
|
|
|
};
|
|
|
} else {
|
|
|
packInfo = {
|
|
|
isUnpack: this.objData.isUnpack
|
|
|
};
|
|
|
}
|
|
|
- } else if (this.warehouseId == 3) {
|
|
|
- if (this.DispositionList && this.DispositionList.length != 0) {
|
|
|
- packInfo = {
|
|
|
- specText: this.text,
|
|
|
- specValue: this.value,
|
|
|
- withinPackage: this.withinPackage, // 内包装
|
|
|
- tier: this.warehouseId,
|
|
|
- isUnpack: this.objData.isUnpack,
|
|
|
- packUnitInfo: this.warehouseSpecTypeList[2].textValue,
|
|
|
- withinPackageCell: this.DispositionList[0].packageCell, // 最小包装名称
|
|
|
- withinPackageUnit: this.DispositionList[0].packageUnit, // 最小包装单位
|
|
|
- withinConversionUnit: this.DispositionList[0].conversionUnit, // 最小包装单位
|
|
|
- withinFormedNumLast: this.DispositionList[0].formedNumLast // 总包装数量
|
|
|
- };
|
|
|
- } else {
|
|
|
- packInfo = {
|
|
|
- isUnpack: this.objData.isUnpack
|
|
|
- };
|
|
|
- }
|
|
|
- } else if (this.warehouseId == 4) {
|
|
|
- if (this.DispositionList && this.DispositionList.length != 0) {
|
|
|
- packInfo = {
|
|
|
- specText: this.text,
|
|
|
- specValue: this.value,
|
|
|
- outsidePackage: this.outsidePackage, //外包装
|
|
|
- tier: this.warehouseId,
|
|
|
- isUnpack: this.objData.isUnpack,
|
|
|
- packUnitInfo: this.warehouseSpecTypeList[3].textValue,
|
|
|
- outsidePackageCell: this.DispositionList[0].packageCell, // 最小包装名称
|
|
|
- outsidePackageUnit: this.DispositionList[0].packageUnit, // 最小包装单位
|
|
|
- outsideConversionUnit: this.DispositionList[0].conversionUnit, // 最小包装单位
|
|
|
- outsideFormedNumLast: this.DispositionList[0].formedNumLast
|
|
|
- }; // 总包装数量
|
|
|
- } else {
|
|
|
- packInfo = {
|
|
|
- isUnpack: this.objData.isUnpack
|
|
|
- };
|
|
|
+ } else {
|
|
|
+ if (this.warehouseId == 2) {
|
|
|
+ if (this.DispositionList && this.DispositionList.length != 0) {
|
|
|
+ packInfo = {
|
|
|
+ // this.DispositionList[0]
|
|
|
+
|
|
|
+ specText: this.text,
|
|
|
+ specValue: this.value,
|
|
|
+ minimumPackage: this.minimumPackage, // 最小包装
|
|
|
+ tier: this.warehouseId,
|
|
|
+ isUnpack: this.objData.isUnpack,
|
|
|
+ packUnitInfo: this.warehouseSpecTypeList[1].textValue,
|
|
|
+ minimumPackageCell: this.DispositionList[0].packageCell, // 最小包装
|
|
|
+ minimumPackageUnit: this.DispositionList[0].packageUnit, // 最小包装单位
|
|
|
+ minimumConversionUnit: this.DispositionList[0].conversionUnit, // 最小包装单位
|
|
|
+ minimumFormedNumLast: this.DispositionList[0].formedNumLast, // 总包装数量
|
|
|
+ isNewUnpack: this.isNewUnpack
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ packInfo = {
|
|
|
+ isUnpack: this.objData.isUnpack
|
|
|
+ };
|
|
|
+ }
|
|
|
+ } else if (this.warehouseId == 3) {
|
|
|
+ if (this.DispositionList && this.DispositionList.length != 0) {
|
|
|
+ packInfo = {
|
|
|
+ specText: this.text,
|
|
|
+ specValue: this.value,
|
|
|
+ withinPackage: this.withinPackage, // 内包装
|
|
|
+ tier: this.warehouseId,
|
|
|
+ isUnpack: this.objData.isUnpack,
|
|
|
+ packUnitInfo: this.warehouseSpecTypeList[2].textValue,
|
|
|
+ withinPackageCell: this.DispositionList[1].packageCell, // 最小包装名称
|
|
|
+ withinPackageUnit: this.DispositionList[1].packageUnit, // 最小包装单位
|
|
|
+ withinConversionUnit: this.DispositionList[1].conversionUnit, // 最小包装单位
|
|
|
+ withinFormedNumLast: this.DispositionList[1].formedNumLast, // 总包装数量
|
|
|
+ isNewUnpack: this.isNewUnpack
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ packInfo = {
|
|
|
+ isUnpack: this.objData.isUnpack
|
|
|
+ };
|
|
|
+ }
|
|
|
+ } else if (this.warehouseId == 4) {
|
|
|
+ if (this.DispositionList && this.DispositionList.length != 0) {
|
|
|
+ packInfo = {
|
|
|
+ specText: this.text,
|
|
|
+ specValue: this.value,
|
|
|
+ outsidePackage: this.outsidePackage, //外包装
|
|
|
+ tier: this.warehouseId,
|
|
|
+ isUnpack: this.objData.isUnpack,
|
|
|
+ packUnitInfo: this.warehouseSpecTypeList[3].textValue,
|
|
|
+ outsidePackageCell: this.DispositionList[2].packageCell, // 最小包装名称
|
|
|
+ outsidePackageUnit: this.DispositionList[2].packageUnit, // 最小包装单位
|
|
|
+ outsideConversionUnit: this.DispositionList[2].conversionUnit, // 最小包装单位
|
|
|
+ outsideFormedNumLast: this.DispositionList[2].formedNumLast,
|
|
|
+ isNewUnpack: this.isNewUnpack
|
|
|
+ }; // 总包装数量
|
|
|
+ } else {
|
|
|
+ packInfo = {
|
|
|
+ isUnpack: this.objData.isUnpack
|
|
|
+ };
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|