|
@@ -297,28 +297,36 @@
|
|
>打印</el-button
|
|
>打印</el-button
|
|
> -->
|
|
> -->
|
|
<el-button
|
|
<el-button
|
|
- v-if="!isDisabled"
|
|
|
|
|
|
+ v-if="excuteType == 2"
|
|
|
|
+ :disabled="tableData.length != 1"
|
|
|
|
+ type="primary"
|
|
|
|
+ size="mini"
|
|
|
|
+ @click="updateOrderData"
|
|
|
|
+ >保存修改</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
:disabled="tableData.length != 1"
|
|
:disabled="tableData.length != 1"
|
|
type="primary"
|
|
type="primary"
|
|
size="mini"
|
|
size="mini"
|
|
@click="getOrderData"
|
|
@click="getOrderData"
|
|
- >{{ excuteType == 1 ? "箱单" : "保存修改" }}</el-button
|
|
|
|
|
|
+ >箱单</el-button
|
|
>
|
|
>
|
|
<el-button
|
|
<el-button
|
|
:disabled="tableData.length < 2"
|
|
:disabled="tableData.length < 2"
|
|
|
|
+ v-if="excuteType == 1"
|
|
type="primary"
|
|
type="primary"
|
|
size="mini"
|
|
size="mini"
|
|
@click="chooseOneToPrint"
|
|
@click="chooseOneToPrint"
|
|
>{{ chooseState ? "退出批箱单" : "批箱单" }}</el-button
|
|
>{{ chooseState ? "退出批箱单" : "批箱单" }}</el-button
|
|
>
|
|
>
|
|
- <el-button
|
|
|
|
|
|
+ <!-- <el-button
|
|
:disabled="tableData.length != 1"
|
|
:disabled="tableData.length != 1"
|
|
type="primary"
|
|
type="primary"
|
|
size="mini"
|
|
size="mini"
|
|
v-if="excuteType == 3"
|
|
v-if="excuteType == 3"
|
|
@click="supplementCodeHandler"
|
|
@click="supplementCodeHandler"
|
|
>补码</el-button
|
|
>补码</el-button
|
|
- >
|
|
|
|
|
|
+ > -->
|
|
</div>
|
|
</div>
|
|
<div class="msg" v-if="orderData.boxNo">
|
|
<div class="msg" v-if="orderData.boxNo">
|
|
<div class="msg-item">
|
|
<div class="msg-item">
|
|
@@ -343,7 +351,7 @@
|
|
></el-table-column>
|
|
></el-table-column>
|
|
<el-table-column prop="machineTool" label="机台"> </el-table-column>
|
|
<el-table-column prop="machineTool" label="机台"> </el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
- prop="boxNumber"
|
|
|
|
|
|
+ prop="boxNum"
|
|
:label="`${tempStr}号`"
|
|
:label="`${tempStr}号`"
|
|
></el-table-column>
|
|
></el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
@@ -358,7 +366,7 @@
|
|
<el-table-column prop="grossWeight" label="毛重">
|
|
<el-table-column prop="grossWeight" label="毛重">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-input
|
|
<el-input
|
|
- :disabled="isDisabled"
|
|
|
|
|
|
+ :disabled="excuteType == 3"
|
|
v-model="scope.row.grossWeight"
|
|
v-model="scope.row.grossWeight"
|
|
@input="changeGrossWeight(scope.row)"
|
|
@input="changeGrossWeight(scope.row)"
|
|
size="mini"
|
|
size="mini"
|
|
@@ -887,7 +895,7 @@ export default {
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
isDisabled() {
|
|
isDisabled() {
|
|
- return this.excuteType == 3;
|
|
|
|
|
|
+ return this.excuteType != 1;
|
|
},
|
|
},
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -915,7 +923,7 @@ export default {
|
|
|
|
|
|
console.log("打印", this.printTableData);
|
|
console.log("打印", this.printTableData);
|
|
this.printTableData.forEach((item) => {
|
|
this.printTableData.forEach((item) => {
|
|
- item.qrCodeData = printData + "-" + item.boxNumber;
|
|
|
|
|
|
+ item.qrCodeData = printData + "-" + item.boxNum;
|
|
});
|
|
});
|
|
codeListPrint(this.printTableData, "printDom");
|
|
codeListPrint(this.printTableData, "printDom");
|
|
},
|
|
},
|
|
@@ -938,17 +946,6 @@ export default {
|
|
},
|
|
},
|
|
// 获取箱单数据
|
|
// 获取箱单数据
|
|
async getOrderData() {
|
|
async getOrderData() {
|
|
- // let year = (new Date().getFullYear() + "").slice(-2);
|
|
|
|
- // let month = new Date().getMonth() + 1;
|
|
|
|
- // if (month < 10) {
|
|
|
|
- // month = "0" + month;
|
|
|
|
- // }
|
|
|
|
- // let day = new Date().getDate();
|
|
|
|
- // if (day < 10) {
|
|
|
|
- // day = "0" + day;
|
|
|
|
- // }
|
|
|
|
- // let timeStamp = (new Date().getTime() + "").slice(-5);
|
|
|
|
- // this.orderData.boxNo = year + month + day + timeStamp;
|
|
|
|
this.$refs.form.validate(async (valid) => {
|
|
this.$refs.form.validate(async (valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
try {
|
|
try {
|
|
@@ -961,31 +958,26 @@ export default {
|
|
qrCode: rowData.qrCode,
|
|
qrCode: rowData.qrCode,
|
|
lotNum: rowData.lotNum,
|
|
lotNum: rowData.lotNum,
|
|
// boxNum: sumBoxNum,
|
|
// boxNum: sumBoxNum,
|
|
- boxNum: rowData.boxNumber,
|
|
|
|
|
|
+ boxNum: rowData.boxNum,
|
|
productId: rowData.productId,
|
|
productId: rowData.productId,
|
|
// cartonNumber: rowData.canisterWeight,
|
|
// cartonNumber: rowData.canisterWeight,
|
|
suttle: rowData.suttle,
|
|
suttle: rowData.suttle,
|
|
grossWeight: rowData.grossWeight,
|
|
grossWeight: rowData.grossWeight,
|
|
productCodeListInfoList: this.tableData,
|
|
productCodeListInfoList: this.tableData,
|
|
};
|
|
};
|
|
|
|
+ console.log(rowData);
|
|
if (rowData.id) {
|
|
if (rowData.id) {
|
|
payLoad.id = rowData.id;
|
|
payLoad.id = rowData.id;
|
|
}
|
|
}
|
|
let tempApiFun = productCodeList;
|
|
let tempApiFun = productCodeList;
|
|
- if (this.excuteType == 1) {
|
|
|
|
- tempApiFun = productCodeList;
|
|
|
|
- } else if (this.excuteType == 2) {
|
|
|
|
- tempApiFun = updateProductCodeList;
|
|
|
|
- }
|
|
|
|
let res = await tempApiFun(payLoad);
|
|
let res = await tempApiFun(payLoad);
|
|
let msg = this.isEdit ? "编辑" : "新增";
|
|
let msg = this.isEdit ? "编辑" : "新增";
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
- this.$message.success(`${msg}箱单成功`);
|
|
|
|
- if (this.excuteType != 1) {
|
|
|
|
- this.printShow = false;
|
|
|
|
- this.getList();
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
+ // if (this.excuteType != 1) {
|
|
|
|
+ // this.printShow = false;
|
|
|
|
+ // this.getList();
|
|
|
|
+ // return;
|
|
|
|
+ // }
|
|
this.tableData[0].id = res.data;
|
|
this.tableData[0].id = res.data;
|
|
this.printConfirmHandler(res.data);
|
|
this.printConfirmHandler(res.data);
|
|
} else {
|
|
} else {
|
|
@@ -998,6 +990,47 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ // 保存修改箱单数据
|
|
|
|
+ updateOrderData() {
|
|
|
|
+ this.$refs.form.validate(async (valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ try {
|
|
|
|
+ let { sumBoxNum, sumCanisterNum, sumSuttle, sumGrossWeight } =
|
|
|
|
+ this.count;
|
|
|
|
+ let rowData = JSON.parse(JSON.stringify(this.tableData[0]));
|
|
|
|
+ this.printTableData = [rowData];
|
|
|
|
+ let payLoad = {
|
|
|
|
+ ...this.form,
|
|
|
|
+ qrCode: rowData.qrCode,
|
|
|
|
+ lotNum: rowData.lotNum,
|
|
|
|
+ // boxNum: sumBoxNum,
|
|
|
|
+ boxNum: rowData.boxNum,
|
|
|
|
+ productId: rowData.productId,
|
|
|
|
+ // cartonNumber: rowData.canisterWeight,
|
|
|
|
+ suttle: rowData.suttle,
|
|
|
|
+ grossWeight: rowData.grossWeight,
|
|
|
|
+ productCodeListInfoList: this.tableData,
|
|
|
|
+ };
|
|
|
|
+ if (rowData.id) {
|
|
|
|
+ payLoad.id = rowData.id;
|
|
|
|
+ }
|
|
|
|
+ let tempApiFun = updateProductCodeList;
|
|
|
|
+ let res = await tempApiFun(payLoad);
|
|
|
|
+ let msg = "编辑";
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.$message.success(`${msg}箱单成功`);
|
|
|
|
+ this.printShow = false;
|
|
|
|
+ this.getList();
|
|
|
|
+ } else {
|
|
|
|
+ console.log(res);
|
|
|
|
+ this.$message.error(`${msg}箱单失败`);
|
|
|
|
+ }
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.error(error);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
// 选择一个打印
|
|
// 选择一个打印
|
|
chooseOneToPrint() {
|
|
chooseOneToPrint() {
|
|
this.chooseState = !this.chooseState; //开启选择状态
|
|
this.chooseState = !this.chooseState; //开启选择状态
|
|
@@ -1083,7 +1116,7 @@ export default {
|
|
grossWeight: 0, //毛重
|
|
grossWeight: 0, //毛重
|
|
// suttle: this.getSuttle(), //净重
|
|
// suttle: this.getSuttle(), //净重
|
|
suttle: 0, //净重
|
|
suttle: 0, //净重
|
|
- boxNumber: this.tableData.length + 1, //序号
|
|
|
|
|
|
+ boxNum: this.tableData.length + 1, //序号
|
|
productionDate, //日期
|
|
productionDate, //日期
|
|
printFormat, //格式
|
|
printFormat, //格式
|
|
productName,
|
|
productName,
|
|
@@ -1130,7 +1163,7 @@ export default {
|
|
...this.form,
|
|
...this.form,
|
|
qrCode: rowData.qrCode,
|
|
qrCode: rowData.qrCode,
|
|
lotNum: rowData.lotNum,
|
|
lotNum: rowData.lotNum,
|
|
- boxNum: rowData.boxNumber,
|
|
|
|
|
|
+ boxNum: rowData.boxNum,
|
|
productId: rowData.productId,
|
|
productId: rowData.productId,
|
|
// cartonNumber: rowData.canisterWeight,
|
|
// cartonNumber: rowData.canisterWeight,
|
|
suttle: rowData.suttle,
|
|
suttle: rowData.suttle,
|
|
@@ -1289,13 +1322,19 @@ export default {
|
|
this.reset();
|
|
this.reset();
|
|
const id = row.id || this.ids;
|
|
const id = row.id || this.ids;
|
|
getPrintData(id).then(async (response) => {
|
|
getPrintData(id).then(async (response) => {
|
|
- this.excuteType = 2;
|
|
|
|
- this.form = response.data;
|
|
|
|
- this.tableData = response.data.productCodeListInfoList || [];
|
|
|
|
- await this.getAllBatchData(); //获取所有产品数据
|
|
|
|
- await this.getLineOptionLsit(); //获取机台选项数据
|
|
|
|
- await this.getSelectOptions();
|
|
|
|
- this.printShow = true;
|
|
|
|
|
|
+ if (response.code == 200) {
|
|
|
|
+ this.excuteType = 2;
|
|
|
|
+ this.form = response.data;
|
|
|
|
+ this.tableData = [response.data] || [{}];
|
|
|
|
+
|
|
|
|
+ await this.getAllBatchData(); //获取所有产品数据
|
|
|
|
+ await this.getLineOptionLsit(); //获取机台选项数据
|
|
|
|
+ await this.getSelectOptions();
|
|
|
|
+ this.initProductData();
|
|
|
|
+ this.printShow = true;
|
|
|
|
+ } else {
|
|
|
|
+ console.log(response);
|
|
|
|
+ }
|
|
});
|
|
});
|
|
},
|
|
},
|
|
// 补码回调
|
|
// 补码回调
|
|
@@ -1305,7 +1344,7 @@ export default {
|
|
getPrintData(id).then(async (response) => {
|
|
getPrintData(id).then(async (response) => {
|
|
this.excuteType = 3; //补码
|
|
this.excuteType = 3; //补码
|
|
this.form = response.data;
|
|
this.form = response.data;
|
|
- this.tableData = response.data.productCodeListInfoList;
|
|
|
|
|
|
+ this.tableData = [response.data] || [];
|
|
await this.getAllBatchData(); //获取所有产品数据
|
|
await this.getAllBatchData(); //获取所有产品数据
|
|
await this.getLineOptionLsit(); //获取机台选项数据
|
|
await this.getLineOptionLsit(); //获取机台选项数据
|
|
await this.getSelectOptions();
|
|
await this.getSelectOptions();
|
|
@@ -1313,11 +1352,12 @@ export default {
|
|
this.printShow = true;
|
|
this.printShow = true;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+
|
|
// 初始化产品相关数据
|
|
// 初始化产品相关数据
|
|
initProductData() {
|
|
initProductData() {
|
|
this.batchNum = this.form.lotNum;
|
|
this.batchNum = this.form.lotNum;
|
|
this.batchNumChange();
|
|
this.batchNumChange();
|
|
- if (Object.keys(this.currentRow).length) {
|
|
|
|
|
|
+ if (this.batchTableData.length) {
|
|
let {
|
|
let {
|
|
machineTool,
|
|
machineTool,
|
|
boxWeight,
|
|
boxWeight,
|
|
@@ -1339,7 +1379,13 @@ export default {
|
|
lotNum,
|
|
lotNum,
|
|
directionOfTwist,
|
|
directionOfTwist,
|
|
productId,
|
|
productId,
|
|
- } = this.currentRow;
|
|
|
|
|
|
+ } = this.batchTableData[0];
|
|
|
|
+ Object.assign(this.tableData[0], {
|
|
|
|
+ productName, //品种
|
|
|
|
+ productSpecifications, //规格
|
|
|
|
+ productColor, //色号
|
|
|
|
+ directionOfTwist, //捻向
|
|
|
|
+ });
|
|
}
|
|
}
|
|
},
|
|
},
|
|
/** 提交按钮 */
|
|
/** 提交按钮 */
|