|
@@ -15,7 +15,7 @@
|
|
|
type="primary"
|
|
|
size="mini"
|
|
|
@click="updateOrderData"
|
|
|
- >保存修改
|
|
|
+ >保存修改
|
|
|
</el-button>
|
|
|
<!-- <el-button
|
|
|
:disabled="tableData.length != 1"
|
|
@@ -40,14 +40,21 @@
|
|
|
>
|
|
|
</el-switch>
|
|
|
<el-button type="primary" size="mini" @click="readStateChange"
|
|
|
- >{{ isStartReadNum ? "停止读数" : "开始读数" }}
|
|
|
+ >{{ isStartReadNum ? "停止读数" : "开始读数" }}
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
v-show="!printAuto"
|
|
|
type="success"
|
|
|
size="mini"
|
|
|
@click="printBtnHandler"
|
|
|
- >打印
|
|
|
+ >打 印
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="info"
|
|
|
+ plain
|
|
|
+ size="mini"
|
|
|
+ @click="continuePrintHandler"
|
|
|
+ >接 续
|
|
|
</el-button>
|
|
|
</div>
|
|
|
<div class="weightWrap" v-show="excuteType == 1">
|
|
@@ -73,6 +80,7 @@
|
|
|
</div>
|
|
|
<el-table
|
|
|
:data="tableData"
|
|
|
+ height="450"
|
|
|
border
|
|
|
stripe
|
|
|
style="width: 100%; margin-bottom: 5px"
|
|
@@ -121,7 +129,7 @@
|
|
|
size="mini"
|
|
|
:disabled="chooseState"
|
|
|
@click="handleSaveOne(scope.row)"
|
|
|
- >保存修改
|
|
|
+ >保存修改
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
v-else-if="excuteType == 3"
|
|
@@ -129,7 +137,7 @@
|
|
|
size="mini"
|
|
|
:disabled="chooseState"
|
|
|
@click="handleSuppleOne(scope.row)"
|
|
|
- >打印
|
|
|
+ >打印
|
|
|
</el-button>
|
|
|
|
|
|
<el-button
|
|
@@ -138,7 +146,7 @@
|
|
|
size="mini"
|
|
|
:disabled="chooseState"
|
|
|
@click="handleDeleteOne(scope.$index, scope.row)"
|
|
|
- >删除
|
|
|
+ >删除
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -212,7 +220,6 @@
|
|
|
<el-form-item prop="machineTool" label="机台">
|
|
|
<el-select
|
|
|
v-model="form.machineTool"
|
|
|
- clearable
|
|
|
filterable
|
|
|
size="mini"
|
|
|
@change="machineToolChange"
|
|
@@ -224,11 +231,11 @@
|
|
|
:value="item.id"
|
|
|
>
|
|
|
<span class="discribe" style="float: left">{{
|
|
|
- item.productionLineName
|
|
|
- }}</span>
|
|
|
+ item.productionLineName
|
|
|
+ }}</span>
|
|
|
<span
|
|
|
style="float: right; color: #8492a6; font-size: 13px"
|
|
|
- >{{ item.productionLineDepartment }}</span
|
|
|
+ >{{ item.productionLineDepartment }}</span
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
@@ -236,12 +243,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item prop="workShifts" label="班次">
|
|
|
- <el-select
|
|
|
- v-model="form.workShifts"
|
|
|
- clearable
|
|
|
- filterable
|
|
|
- size="mini"
|
|
|
- >
|
|
|
+ <el-select v-model="form.workShifts" filterable size="mini">
|
|
|
<el-option
|
|
|
v-for="item in dropDownData.work_shifts"
|
|
|
:key="item.id"
|
|
@@ -267,7 +269,6 @@
|
|
|
<el-form-item prop="levels" label="等级">
|
|
|
<el-select
|
|
|
v-model="form.levels"
|
|
|
- clearable
|
|
|
filterable
|
|
|
size="mini"
|
|
|
@change="levelChangeHandler"
|
|
@@ -488,10 +489,11 @@ import {
|
|
|
AutoPrinting,
|
|
|
getPrintDataNew,
|
|
|
removeProductCodeASInventory,
|
|
|
+ listBySaleProductID,
|
|
|
} from "@/api/codeListManage/productCodeList";
|
|
|
import codeListPrint from "@/utils/print/codeListPrint";
|
|
|
-import {getServerPrintData} from "@/utils/print/printUtils";
|
|
|
-import {v4 as uuidv4} from "uuid";
|
|
|
+import { getServerPrintData } from "@/utils/print/printUtils";
|
|
|
+import { v4 as uuidv4 } from "uuid";
|
|
|
import moment from "moment";
|
|
|
|
|
|
export default {
|
|
@@ -564,36 +566,36 @@ export default {
|
|
|
},
|
|
|
rules: {
|
|
|
grossWeight: [
|
|
|
- {required: true, message: "请输入重量", trigger: "change"},
|
|
|
+ { required: true, message: "请输入重量", trigger: "change" },
|
|
|
],
|
|
|
packaging: [
|
|
|
- {required: true, message: "请选择包装", trigger: "change"},
|
|
|
+ { required: true, message: "请选择包装", trigger: "change" },
|
|
|
],
|
|
|
machineTool: [
|
|
|
- {required: true, message: "请选择机台", trigger: "change"},
|
|
|
+ { required: true, message: "请选择机台", trigger: "change" },
|
|
|
],
|
|
|
workShifts: [
|
|
|
- {required: true, message: "请选择班次", trigger: "change"},
|
|
|
+ { required: true, message: "请选择班次", trigger: "change" },
|
|
|
],
|
|
|
productionDate: [
|
|
|
- {required: true, message: "请选择生产日期", trigger: "change"},
|
|
|
+ { required: true, message: "请选择生产日期", trigger: "change" },
|
|
|
],
|
|
|
- levels: [{required: true, message: "请选择等级", trigger: "change"}],
|
|
|
+ levels: [{ required: true, message: "请选择等级", trigger: "change" }],
|
|
|
// foreignTradeNumber: [
|
|
|
// { required: true, message: "请输入外贸号", trigger: "blur" },
|
|
|
// ],
|
|
|
canisterWeight: [
|
|
|
- {required: true, message: "请选择筒重", trigger: "change"},
|
|
|
+ { required: true, message: "请选择筒重", trigger: "change" },
|
|
|
],
|
|
|
boxWeight: [
|
|
|
- {required: true, message: "请选择箱重/车重", trigger: "change"},
|
|
|
+ { required: true, message: "请选择箱重/车重", trigger: "change" },
|
|
|
],
|
|
|
tubeColor: [
|
|
|
- {required: true, message: "请选择管色", trigger: "change"},
|
|
|
+ { required: true, message: "请选择管色", trigger: "change" },
|
|
|
],
|
|
|
- comPort: [{required: true, message: "请选择端口", trigger: "change"}],
|
|
|
+ comPort: [{ required: true, message: "请选择端口", trigger: "change" }],
|
|
|
printFormat: [
|
|
|
- {required: true, message: "请选择格式", trigger: "change"},
|
|
|
+ { required: true, message: "请选择格式", trigger: "change" },
|
|
|
],
|
|
|
},
|
|
|
dropDownData: {},
|
|
@@ -712,7 +714,7 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|
|
|
- let {excuteType, qrCode} = this.$route.query;
|
|
|
+ let { excuteType, qrCode } = this.$route.query;
|
|
|
if (excuteType == 2) {
|
|
|
//修改
|
|
|
this.handleUpdate(qrCode);
|
|
@@ -735,9 +737,72 @@ export default {
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ // 接续回调
|
|
|
+ async continuePrintHandler() {
|
|
|
+ try {
|
|
|
+ let { machineTool, workShifts, levels } = this.form;
|
|
|
+ if (!this.currentRow || !this.currentRow.lotNum) {
|
|
|
+ this.$message.error("请选择产品");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let payload = {
|
|
|
+ isEnablePaging: false,
|
|
|
+ machineTool,
|
|
|
+ workShifts,
|
|
|
+ levels,
|
|
|
+ lotNum: this.currentRow.lotNum,
|
|
|
+ saleProductId: this.currentRow.id,
|
|
|
+ };
|
|
|
+ let res = await listBySaleProductID(payload);
|
|
|
+ if (res.code == 200) {
|
|
|
+ console.log(res);
|
|
|
+ this.tableData = res.rows;
|
|
|
+ if (res.rows.length > 0) {
|
|
|
+ let lastRow = res.rows[res.rows.length - 1];
|
|
|
+ let {
|
|
|
+ packaging,
|
|
|
+ machineTool,
|
|
|
+ workShifts,
|
|
|
+ productionDate,
|
|
|
+ levels,
|
|
|
+ foreignTradeNumber,
|
|
|
+ canisterWeight,
|
|
|
+ canisterNum,
|
|
|
+ boxWeight,
|
|
|
+ tubeColor,
|
|
|
+ printFormat,
|
|
|
+ grossWeight,
|
|
|
+ remark,
|
|
|
+ } = lastRow;
|
|
|
+ Object.assign(this.form, {
|
|
|
+ packaging,
|
|
|
+ machineTool,
|
|
|
+ workShifts,
|
|
|
+ productionDate,
|
|
|
+ levels,
|
|
|
+ foreignTradeNumber,
|
|
|
+ canisterWeight,
|
|
|
+ canisterNum,
|
|
|
+ boxWeight,
|
|
|
+ tubeColor,
|
|
|
+ printFormat,
|
|
|
+ grossWeight,
|
|
|
+ remark,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.$message.success("接续完成,请继续打印");
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg);
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ this.$message.error("网络异常");
|
|
|
+ }
|
|
|
+ },
|
|
|
// 等级改变回调
|
|
|
async levelChangeHandler() {
|
|
|
// 等级发生变化,重新获取码单号
|
|
|
+ this.tableData = []; //清空打印记录
|
|
|
let res = await getQrCode();
|
|
|
if (res.code == 200) {
|
|
|
this.qrCode = res.msg;
|
|
@@ -858,14 +923,12 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- this.websocket.addEventListener("on", (e) => {
|
|
|
- });
|
|
|
+ this.websocket.addEventListener("on", (e) => {});
|
|
|
this.websocket.addEventListener("error", (event) => {
|
|
|
this.$message.error("WebSocket错误,请重试");
|
|
|
});
|
|
|
|
|
|
- this.websocket.addEventListener("close", () => {
|
|
|
- });
|
|
|
+ this.websocket.addEventListener("close", () => {});
|
|
|
},
|
|
|
// 用于重置与重量相关的状态
|
|
|
resetWeightStatus() {
|
|
@@ -1034,7 +1097,7 @@ export default {
|
|
|
},
|
|
|
// 毛重改变回调
|
|
|
changeGrossWeight(row) {
|
|
|
- let {boxWeight, grossWeight, canisterWeight, canisterNum} = row;
|
|
|
+ let { boxWeight, grossWeight, canisterWeight, canisterNum } = row;
|
|
|
if (!Number(grossWeight)) {
|
|
|
row.suttle = 0;
|
|
|
return;
|
|
@@ -1063,7 +1126,7 @@ export default {
|
|
|
// 确认保存修改一条数据
|
|
|
async handleSaveOne(row) {
|
|
|
try {
|
|
|
- let {sumBoxNum, sumCanisterNum, sumSuttle, sumGrossWeight} =
|
|
|
+ let { sumBoxNum, sumCanisterNum, sumSuttle, sumGrossWeight } =
|
|
|
this.count;
|
|
|
let rowData = JSON.parse(JSON.stringify(row));
|
|
|
|
|
@@ -1092,8 +1155,7 @@ export default {
|
|
|
} else {
|
|
|
this.$message.error(`${msg}失败`);
|
|
|
}
|
|
|
- } catch (error) {
|
|
|
- }
|
|
|
+ } catch (error) {}
|
|
|
},
|
|
|
// 确认打印回调
|
|
|
printConfirmHandler(printData) {
|
|
@@ -1107,13 +1169,13 @@ export default {
|
|
|
});
|
|
|
this.changeGrossWeight(this.printTableData[0]);
|
|
|
// 前端打印
|
|
|
- // codeListPrint(this.printTableData, "printDom");
|
|
|
+ codeListPrint(this.printTableData, "printDom");
|
|
|
|
|
|
- // if (this.excuteType == 1) {
|
|
|
- // this.tableData.push(this.printTableData[0]);
|
|
|
- // }
|
|
|
+ if (this.excuteType == 1) {
|
|
|
+ this.tableData.push(this.printTableData[0]);
|
|
|
+ }
|
|
|
// 后端打印
|
|
|
- this.newPrintHandler();
|
|
|
+ // this.newPrintHandler();
|
|
|
},
|
|
|
// 获取机台选项数据
|
|
|
async getLineOptionLsit() {
|
|
@@ -1130,8 +1192,7 @@ export default {
|
|
|
}
|
|
|
} else {
|
|
|
}
|
|
|
- } catch (error) {
|
|
|
- }
|
|
|
+ } catch (error) {}
|
|
|
},
|
|
|
// 补码打印回调
|
|
|
handleSuppleOne(row) {
|
|
@@ -1144,7 +1205,7 @@ export default {
|
|
|
this.$refs.form.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
try {
|
|
|
- let {sumBoxNum, sumCanisterNum, sumSuttle, sumGrossWeight} =
|
|
|
+ let { sumBoxNum, sumCanisterNum, sumSuttle, sumGrossWeight } =
|
|
|
this.count;
|
|
|
let rowData = newData.machineTool
|
|
|
? JSON.parse(JSON.stringify(newData))
|
|
@@ -1155,12 +1216,12 @@ export default {
|
|
|
// 先打印
|
|
|
this.changeGrossWeight(this.printTableData[0]);
|
|
|
// 后端打印
|
|
|
- await this.newPrintHandler();
|
|
|
+ // await this.newPrintHandler();
|
|
|
// 前端打印
|
|
|
- // codeListPrint(this.printTableData, "printDom");
|
|
|
- // if (this.excuteType == 1) {
|
|
|
- // this.tableData.push(this.printTableData[0]);
|
|
|
- // }
|
|
|
+ codeListPrint(this.printTableData, "printDom");
|
|
|
+ if (this.excuteType == 1) {
|
|
|
+ this.tableData.push(this.printTableData[0]);
|
|
|
+ }
|
|
|
// 后保存数据
|
|
|
let payLoad = {
|
|
|
...this.form,
|
|
@@ -1176,6 +1237,7 @@ export default {
|
|
|
grossWeight: rowData.grossWeight,
|
|
|
productCodeListInfoList: this.tableData,
|
|
|
productColour: rowData.productColor,
|
|
|
+ saleProductId: this.currentRow.id,
|
|
|
};
|
|
|
if (rowData.id) {
|
|
|
payLoad.id = rowData.id;
|
|
@@ -1188,6 +1250,10 @@ export default {
|
|
|
}
|
|
|
this.changeGrossWeight(payLoad);
|
|
|
let res = await tempApiFun(payLoad);
|
|
|
+ if (res.code !== 200) {
|
|
|
+ this.$message.error("网络异常请稍后再试");
|
|
|
+ return;
|
|
|
+ }
|
|
|
let msg = this.isEdit ? "编辑" : "新增";
|
|
|
if (res.code == 200) {
|
|
|
// if (this.excuteType != 1) {
|
|
@@ -1201,8 +1267,7 @@ export default {
|
|
|
} else {
|
|
|
this.$message.error(`${msg}箱单失败`);
|
|
|
}
|
|
|
- } catch (error) {
|
|
|
- }
|
|
|
+ } catch (error) {}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -1211,7 +1276,7 @@ export default {
|
|
|
this.$refs.form.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
try {
|
|
|
- let {sumBoxNum, sumCanisterNum, sumSuttle, sumGrossWeight} =
|
|
|
+ let { sumBoxNum, sumCanisterNum, sumSuttle, sumGrossWeight } =
|
|
|
this.count;
|
|
|
let rowData = JSON.parse(JSON.stringify(this.tableData[0]));
|
|
|
this.printTableData = [rowData];
|
|
@@ -1240,8 +1305,7 @@ export default {
|
|
|
} else {
|
|
|
this.$message.error(`${msg}箱单失败`);
|
|
|
}
|
|
|
- } catch (error) {
|
|
|
- }
|
|
|
+ } catch (error) {}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -1351,7 +1415,7 @@ export default {
|
|
|
},
|
|
|
// 计算净重
|
|
|
getSuttle() {
|
|
|
- let {boxWeight, canisterWeight, canisterNum} = this.form;
|
|
|
+ let { boxWeight, canisterWeight, canisterNum } = this.form;
|
|
|
return (Number(boxWeight) - canisterWeight * canisterNum).toFixed(2);
|
|
|
},
|
|
|
// 表格点击回调
|
|
@@ -1392,7 +1456,7 @@ export default {
|
|
|
this.$refs.form.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
try {
|
|
|
- let {sumBoxNum, sumCanisterNum, sumSuttle, sumGrossWeight} =
|
|
|
+ let { sumBoxNum, sumCanisterNum, sumSuttle, sumGrossWeight } =
|
|
|
this.count;
|
|
|
let rowData = JSON.parse(JSON.stringify(row));
|
|
|
this.printTableData = [rowData];
|
|
@@ -1406,6 +1470,7 @@ export default {
|
|
|
suttle: rowData.suttle,
|
|
|
grossWeight: rowData.grossWeight,
|
|
|
productCodeListInfoList: this.tableData,
|
|
|
+ saleProductId: this.currentRow.id, //货品id
|
|
|
};
|
|
|
if (rowData.id) {
|
|
|
payLoad.id = rowData.id;
|
|
@@ -1418,6 +1483,10 @@ export default {
|
|
|
}
|
|
|
this.changeGrossWeight(payLoad);
|
|
|
let res = await tempApiFun(payLoad);
|
|
|
+ if (res.code !== 200) {
|
|
|
+ this.$message.error("网络异常请稍后再试");
|
|
|
+ return;
|
|
|
+ }
|
|
|
let msg = this.isEdit ? "编辑" : "新增";
|
|
|
if (res.code == 200) {
|
|
|
// this.$message.success(`${msg}箱单成功`);
|
|
@@ -1431,8 +1500,7 @@ export default {
|
|
|
} else {
|
|
|
this.$message.error(`${msg}箱单失败`);
|
|
|
}
|
|
|
- } catch (error) {
|
|
|
- }
|
|
|
+ } catch (error) {}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -1442,15 +1510,14 @@ export default {
|
|
|
// 获取所有批次数据
|
|
|
async getAllBatchData(id) {
|
|
|
try {
|
|
|
- let payload = {machineTool: id};
|
|
|
+ let payload = { machineTool: id };
|
|
|
let res = await finishedProductList(payload);
|
|
|
if (res.code == 200) {
|
|
|
this.batchData = res.data;
|
|
|
this.batchTableData = res.data;
|
|
|
} else {
|
|
|
}
|
|
|
- } catch (error) {
|
|
|
- }
|
|
|
+ } catch (error) {}
|
|
|
},
|
|
|
// 批号查询接口
|
|
|
batchNumChange() {
|
|
@@ -1500,8 +1567,7 @@ export default {
|
|
|
} else {
|
|
|
this.$message.error("网络异常!");
|
|
|
}
|
|
|
- } catch (error) {
|
|
|
- }
|
|
|
+ } catch (error) {}
|
|
|
},
|
|
|
/** 查询产品码单列表 */
|
|
|
getList() {
|
|
@@ -1706,8 +1772,7 @@ export default {
|
|
|
this.getList();
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
- });
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|