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

装箱bug修改

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