Commit fb43f66a authored by 何远江's avatar 何远江

装箱bug修改

parent 0abe899b
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
></uni-easyinput> ></uni-easyinput>
<uni-easyinput <uni-easyinput
prefixIcon="search" prefixIcon="search"
:disabled="isEdit" :disabled="checkedBox"
v-model="wxparams" v-model="wxparams"
:focus="isFocus" :focus="isFocus"
placeholder="请扫描产品包装条码/外箱码" placeholder="请扫描产品包装条码/外箱码"
...@@ -166,10 +166,10 @@ export default { ...@@ -166,10 +166,10 @@ export default {
LONG: "", //长 LONG: "", //长
WIDE: "", //宽 WIDE: "", //宽
HIGH: "", //高 HIGH: "", //高
updkz: "I", UPDKZ: "I",
datum: "", //扫描日期 DATUM: "", //扫描日期
uzeit: "", //扫描时间 UZEIT: "", //扫描时间
uname: "admin", //扫描人 UNAME: "admin", //扫描人
ZXTEXT: "", ZXTEXT: "",
ZTEXT: "", ZTEXT: "",
}, },
...@@ -243,7 +243,7 @@ export default { ...@@ -243,7 +243,7 @@ export default {
keys.forEach((v) => (itm[v] = this.upForm[v])); keys.forEach((v) => (itm[v] = this.upForm[v]));
} }
} }
this.isEdit = !!res.length && isBL;
// 如果已经装箱 // 如果已经装箱
if (res.length) { if (res.length) {
this.isEdit = true; this.isEdit = true;
...@@ -258,7 +258,7 @@ export default { ...@@ -258,7 +258,7 @@ export default {
plInfo.WIDE = WIDE; plInfo.WIDE = WIDE;
plInfo.HIGH = HIGH; plInfo.HIGH = HIGH;
} }
this.goodsList.push({ ...plInfo }); this.goodsList.push({ ...plInfo, UPDKZ: "U" });
} else { } else {
this.goodsList = res.map((v) => { this.goodsList = res.map((v) => {
// 如果有规格,需要解析出长宽高 // 如果有规格,需要解析出长宽高
...@@ -268,6 +268,7 @@ export default { ...@@ -268,6 +268,7 @@ export default {
v.WIDE = WIDE; v.WIDE = WIDE;
v.HIGH = HIGH; v.HIGH = HIGH;
} }
v.UPDKZ = "U";
return v; return v;
}); });
} }
...@@ -275,7 +276,6 @@ export default { ...@@ -275,7 +276,6 @@ export default {
this.checkedBox = res[0].ZSTATUS == "Y"; this.checkedBox = res[0].ZSTATUS == "Y";
this.form = this.goodsList[0]; this.form = this.goodsList[0];
} else { } else {
this.isEdit = false;
if (!isBL) { if (!isBL) {
console.log("没有装箱的PL"); console.log("没有装箱的PL");
const plInfo = { PLNR: blpl, ZZXFS: this.form.ZZXFS, UPDKZ: "I" }; const plInfo = { PLNR: blpl, ZZXFS: this.form.ZZXFS, UPDKZ: "I" };
...@@ -301,8 +301,11 @@ export default { ...@@ -301,8 +301,11 @@ export default {
weightInfo.HIGH = lastPLInfo.HIGH; weightInfo.HIGH = lastPLInfo.HIGH;
} }
this.goodsList.push({ ...plInfo, ...weightInfo }); this.goodsList.push({ ...plInfo, ...weightInfo });
} else {
console.log("执行-----", this.isEdit);
this.isEdit = false;
} }
console.log("goodsList", this.goodsList); console.log("goodsList", this.goodsList, this.isEdit);
} }
}); });
}, },
...@@ -344,44 +347,42 @@ export default { ...@@ -344,44 +347,42 @@ export default {
// 请求发送 // 请求发送
subRequest() { subRequest() {
const arr = []; const arr = [];
const baseParams = {
ZZXFS: this.form.ZZXFS,
WERKS: this.vuex_user_factory, // 工厂
ZXSPE: this.form.LONG + "*" + this.form.WIDE + "*" + this.form.HIGH, // 规格
ZXVOLUM: (
(+this.form.LONG * +this.form.WIDE * +this.form.HIGH) /
1000000
).toFixed(6), // 体积
NTGEW: (+this.form.BRGEW - this.form.ZXNTGEW).toFixed(2), // 净重
DATUM: parseTime(new Date(), "{y}{m}{d}"),
UZEIT: parseTime(new Date(), "{h}{i}{s}"),
ZSTATUS: this.checkedBox ? "Y" : "N",
};
if (this.form.ZZXFS != "PL" && this.isEdit) { if (this.form.ZZXFS != "PL" && this.isEdit) {
// 只传一条数据 // 只传一条数据
const itm = this.goodsList[0]; const editItem = this.goodsList[0];
arr.push({ const addItems = this.goodsList.filter((v) => v.UPDKZ == "I");
...itm, // 添加修改
ZZXFS: this.form.ZZXFS, arr.push({ ...editItem, PLNR: "", ...baseParams });
ZCODE: this.blNum, // 添加新增的数据
PLNR: this.isEdit ? "" : itm.PLNR, arr.push(
werks: this.vuex_user_factory, ...addItems.map((v) =>
ZXSPE: itm.LONG + "*" + itm.WIDE + "*" + itm.HIGH, Object.assign(v, baseParams, {
ZXVOLUM: ((+itm.LONG * +itm.WIDE * +itm.HIGH) / 1000000).toFixed(6), UNAME: this.vuex_user.userName,
NTGEW: (+itm.BRGEW - itm.ZXNTGEW).toFixed(2), ZCODE: this.blNum,
DATUM: parseTime(new Date(), "{y}{m}{d}"), })
UZEIT: parseTime(new Date(), "{h}{i}{s}"), )
ZSTATUS: this.checkedBox ? "Y" : "N", );
UPDKZ: itm.ZCODE && itm.PLNR ? "U" : "I",
});
} else if (this.form.ZZXFS == "BL+PL" && !this.isEdit) { } else if (this.form.ZZXFS == "BL+PL" && !this.isEdit) {
this.goodsList.forEach((ele) => { this.goodsList.forEach((ele) => {
arr.push({ arr.push({
...ele, ...ele,
...this.form, ...this.form,
...baseParams,
ZCODE: this.blNum, ZCODE: this.blNum,
ZZXFS: this.form.ZZXFS,
PLNR: this.isEdit ? "" : ele.PLNR,
WERKS: this.vuex_user_factory,
ZXSPE:
this.form.LONG + "*" + this.form.WIDE + "*" + this.form.HIGH,
ZXVOLUM: (
(this.form.LONG * this.form.WIDE * this.form.HIGH) /
1000000
).toFixed(6),
NTGEW: (+this.form.BRGEW - this.form.ZXNTGEW).toFixed(2),
DATUM: parseTime(new Date(), "{y}{m}{d}"),
UZEIT: parseTime(new Date(), "{h}{i}{s}"),
UNAME: this.vuex_user.userName, UNAME: this.vuex_user.userName,
ZSTATUS: this.checkedBox ? "Y" : "N",
UPDKZ: ele.ZCODE && ele.PLNR ? "U" : "I",
}); });
}); });
} else { } else {
...@@ -389,17 +390,9 @@ export default { ...@@ -389,17 +390,9 @@ export default {
arr.push({ arr.push({
...ele, ...ele,
ZCODE: this.blNum, ZCODE: this.blNum,
ZZXFS: this.form.ZZXFS,
PLNR: this.isEdit ? "" : ele.PLNR, PLNR: this.isEdit ? "" : ele.PLNR,
WERKS: this.vuex_user_factory,
ZXSPE: ele.LONG + "*" + ele.WIDE + "*" + ele.HIGH,
ZXVOLUM: ((ele.LONG * ele.WIDE * ele.HIGH) / 1000000).toFixed(6),
NTGEW: (+ele.BRGEW - ele.ZXNTGEW).toFixed(2),
DATUM: parseTime(new Date(), "{y}{m}{d}"),
UZEIT: parseTime(new Date(), "{h}{i}{s}"),
UNAME: this.vuex_user.userName, UNAME: this.vuex_user.userName,
ZSTATUS: this.checkedBox ? "Y" : "N", ...baseParams,
UPDKZ: ele.ZCODE && ele.PLNR ? "U" : "I",
}); });
}); });
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<view class="item">物料描述:{{ item.MAKTX }}</view> <view class="item">物料描述:{{ item.MAKTX }}</view>
<view class="item">数量:{{ item.MAKTX }}</view> --> <view class="item">数量:{{ item.MAKTX }}</view> -->
</view> </view>
<u-button v-if="!isEdit" size="mini" type="primary" plain @click="deleGonds(index)"> <u-button v-if="item.UPDKZ == 'I'" size="mini" type="primary" plain @click="deleGonds(index)">
<u-icon name="trash" size="28"></u-icon> <u-icon name="trash" size="28"></u-icon>
</u-button> </u-button>
</view> </view>
......
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 to comment