|
@@ -15,7 +15,7 @@
|
|
|
type="primary"
|
|
|
size="mini"
|
|
|
@click="updateOrderData"
|
|
|
- >保存修改
|
|
|
+ >保存修改
|
|
|
</el-button>
|
|
|
<!-- <el-button
|
|
|
:disabled="tableData.length != 1"
|
|
@@ -40,23 +40,31 @@
|
|
|
>
|
|
|
</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>
|
|
|
+ <el-button
|
|
|
+ :disabled="tableData.length == 0"
|
|
|
+ type="danger"
|
|
|
+ plain
|
|
|
+ size="mini"
|
|
|
+ @click="summeryPrintHandler"
|
|
|
+ >总码单
|
|
|
+ </el-button>
|
|
|
<div class="weightWrap" v-show="excuteType == 1">
|
|
|
<h1>实时重量:{{ nowWeight }}</h1>
|
|
|
</div>
|
|
@@ -91,7 +99,10 @@
|
|
|
width="50"
|
|
|
label="序号"
|
|
|
></el-table-column>
|
|
|
- <el-table-column prop="machineTool" label="机台"></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="productionLineNo"
|
|
|
+ label="机台"
|
|
|
+ ></el-table-column>
|
|
|
<el-table-column
|
|
|
prop="boxNum"
|
|
|
:label="`${tempStr}号`"
|
|
@@ -129,7 +140,7 @@
|
|
|
size="mini"
|
|
|
:disabled="chooseState"
|
|
|
@click="handleSaveOne(scope.row)"
|
|
|
- >保存修改
|
|
|
+ >保存修改
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
v-else-if="excuteType == 3"
|
|
@@ -137,7 +148,7 @@
|
|
|
size="mini"
|
|
|
:disabled="chooseState"
|
|
|
@click="handleSuppleOne(scope.row)"
|
|
|
- >打印
|
|
|
+ >打印
|
|
|
</el-button>
|
|
|
|
|
|
<el-button
|
|
@@ -146,7 +157,7 @@
|
|
|
size="mini"
|
|
|
:disabled="chooseState"
|
|
|
@click="handleDeleteOne(scope.$index, scope.row)"
|
|
|
- >删除
|
|
|
+ >删除
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -231,11 +242,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>
|
|
@@ -283,15 +294,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item prop="foreignTradeNumber" label="外贸号">
|
|
|
- <el-input
|
|
|
- v-model="form.foreignTradeNumber"
|
|
|
- size="mini"
|
|
|
- clearable
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
+
|
|
|
<el-col :span="8">
|
|
|
<el-form-item prop="canisterWeight" label="筒重">
|
|
|
<el-select
|
|
@@ -379,6 +382,20 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="foreignTradeNumber" label="外贸号">
|
|
|
+ <el-input-number
|
|
|
+ v-model="form.foreignTradeNumber"
|
|
|
+ size="mini"
|
|
|
+ label=""
|
|
|
+ :min="1"
|
|
|
+ :step="1"
|
|
|
+ :controls="true"
|
|
|
+ controls-position="both"
|
|
|
+ >
|
|
|
+ </el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item prop="grossWeight" label="毛重">
|
|
|
<el-input
|
|
@@ -492,8 +509,8 @@ import {
|
|
|
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 {
|
|
@@ -507,6 +524,7 @@ export default {
|
|
|
],
|
|
|
data() {
|
|
|
return {
|
|
|
+ summertId: "", //总码单id
|
|
|
qrCode: "", //码单号
|
|
|
isStartReadNum: false, //是否开始读取重量
|
|
|
printAuto: true, //是否自动打印
|
|
@@ -566,36 +584,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: {},
|
|
@@ -714,7 +732,8 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|
|
|
- let {excuteType, qrCode} = this.$route.query;
|
|
|
+ this.summertId = new Date().getTime();
|
|
|
+ let { excuteType, qrCode } = this.$route.query;
|
|
|
if (excuteType == 2) {
|
|
|
//修改
|
|
|
this.handleUpdate(qrCode);
|
|
@@ -737,10 +756,77 @@ export default {
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ // 总码单打印回调
|
|
|
+ async summeryPrintHandler() {
|
|
|
+ console.log("this.tableData", this.tableData);
|
|
|
+ console.log("this.currentRow", this.currentRow);
|
|
|
+ // return;
|
|
|
+ let payload = { qrCodeVal: "", mapList: [], remark: "无", printType: "" };
|
|
|
+ let firstRowData = JSON.parse(JSON.stringify(this.tableData[0])); //以第一条数据为基础
|
|
|
+ let sumObj = {
|
|
|
+ canisterNum: 0, //筒数
|
|
|
+ grossWeight: 0, //毛重
|
|
|
+ suttle: 0, //净重
|
|
|
+ }; //需要累加的数据
|
|
|
+ this.tableData.forEach((item) => {
|
|
|
+ sumObj.canisterNum += Number(item.canisterNum) || 0;
|
|
|
+ sumObj.grossWeight += Number(item.grossWeight) || 0;
|
|
|
+ sumObj.suttle += Number(item.suttle) || 0;
|
|
|
+ });
|
|
|
+ sumObj.canisterNum = sumObj.canisterNum.toFixed(0);
|
|
|
+ sumObj.grossWeight = sumObj.grossWeight.toFixed(2);
|
|
|
+ sumObj.suttle = sumObj.suttle.toFixed(2);
|
|
|
+ // 添加产品信息
|
|
|
+ sumObj.productName = this.currentRow.productName;
|
|
|
+ sumObj.lotNum = this.currentRow.lotNum;
|
|
|
+ sumObj.productColor = this.currentRow.productColor;
|
|
|
+ sumObj.productColour = this.currentRow.productColor;
|
|
|
+ sumObj.saleProductId = this.currentRow.id;
|
|
|
+ sumObj.productSpecifications = this.currentRow.productSpecifications;
|
|
|
+ sumObj.directionOfTwistLabel =
|
|
|
+ this.dict.type.direction_of_twist.find(
|
|
|
+ (item) => item.value == this.currentRow.directionOfTwist
|
|
|
+ )?.label || " "; //捻向
|
|
|
+
|
|
|
+ Object.assign(firstRowData, sumObj);
|
|
|
+ // let timeStemp = new Date().getTime();
|
|
|
+ firstRowData.id = this.summertId;
|
|
|
+ firstRowData.otherStates = 1;
|
|
|
+ firstRowData.printFormat = "6"; //打印类型为总码单
|
|
|
+ // firstRowData.boxSumNum = this.tableData.length; //箱子总数
|
|
|
+ firstRowData.boxNum = this.tableData.length; //箱子总数
|
|
|
+ firstRowData.machineToolNo = this.lineOptions.find(
|
|
|
+ (item) => item.id == this.form.machineTool
|
|
|
+ ).productionLineNo;
|
|
|
+ firstRowData.qrCodeId = uuidv4().slice(0, 8); //生成总码单自己的qrCodeId
|
|
|
+ this.printTableData = [firstRowData];
|
|
|
+
|
|
|
+ // 保存打印数据
|
|
|
+ let payLoad = {
|
|
|
+ ...firstRowData,
|
|
|
+ };
|
|
|
+
|
|
|
+ let res = await productCodeList(payLoad);
|
|
|
+ if (res.code !== 200) {
|
|
|
+ this.$message.error("网络异常请稍后再试");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let msg = this.isEdit ? "编辑" : "新增";
|
|
|
+ if (res.code == 200) {
|
|
|
+ // 后端打印
|
|
|
+ // await this.newPrintHandler();
|
|
|
+ // this.tableData = [];
|
|
|
+ // this.$message.success(`总码单打印成功!`);
|
|
|
+ // 前端打印
|
|
|
+ codeListPrint(this.printTableData, "printDom");
|
|
|
+ } else {
|
|
|
+ this.$message.error(`${msg}箱单失败`);
|
|
|
+ }
|
|
|
+ },
|
|
|
// 接续回调
|
|
|
async continuePrintHandler() {
|
|
|
try {
|
|
|
- let {machineTool, workShifts, levels} = this.form;
|
|
|
+ let { machineTool, workShifts, levels } = this.form;
|
|
|
if (!this.currentRow || !this.currentRow.lotNum) {
|
|
|
this.$message.error("请选择产品");
|
|
|
return;
|
|
@@ -756,9 +842,19 @@ export default {
|
|
|
let res = await listBySaleProductID(payload);
|
|
|
if (res.code == 200) {
|
|
|
console.log(res);
|
|
|
- this.tableData = res.rows;
|
|
|
+ this.tableData = res.rows.map((item) => {
|
|
|
+ let productionLineNo = this.lineOptions.find(
|
|
|
+ (i) => i.id == item.machineTool
|
|
|
+ )?.productionLineNo;
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ productionLineNo,
|
|
|
+ };
|
|
|
+ });
|
|
|
+
|
|
|
if (res.rows.length > 0) {
|
|
|
let lastRow = res.rows[res.rows.length - 1];
|
|
|
+ this.summertId = lastRow.parentCode; //取最后一条数据的总码单code为当前总码单code
|
|
|
this.qrCode = lastRow.qrCode;
|
|
|
let {
|
|
|
packaging,
|
|
@@ -802,9 +898,11 @@ export default {
|
|
|
},
|
|
|
// 等级改变回调
|
|
|
async levelChangeHandler() {
|
|
|
+ // return;
|
|
|
// 等级发生变化,重新获取码单号
|
|
|
this.tableData = []; //清空打印记录
|
|
|
let res = await getQrCode();
|
|
|
+ this.summertId = new Date().getTime(); //总码单id重新生成
|
|
|
if (res.code == 200) {
|
|
|
this.qrCode = res.msg;
|
|
|
} else {
|
|
@@ -924,14 +1022,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() {
|
|
@@ -984,9 +1080,10 @@ export default {
|
|
|
this.dict.type.direction_of_twist.find(
|
|
|
(item) => item.value == directionOfTwist
|
|
|
)?.label || " ";
|
|
|
-
|
|
|
newData = {
|
|
|
- machineToolNo,
|
|
|
+ productionLineNo: this.lineOptions.find(
|
|
|
+ (i) => i.id == this.form.machineTool
|
|
|
+ )?.productionLineNo,
|
|
|
// qrCode: this.getBoxOrderNum(), //箱单号
|
|
|
packaging, //包装方式 1:车丝 2:小包装 3:大包装
|
|
|
qrCode: this.qrCode, //箱单号
|
|
@@ -1041,7 +1138,7 @@ export default {
|
|
|
// 新的后端打印逻辑
|
|
|
async newPrintHandler() {
|
|
|
let printRow = this.printTableData[0];
|
|
|
- let payload = {qrCodeVal: "", mapList: [], remark: "无", printType: "",};
|
|
|
+ let payload = { qrCodeVal: "", mapList: [], remark: "无", printType: "" };
|
|
|
let {
|
|
|
id, //id
|
|
|
qrCode, //箱单号
|
|
@@ -1051,21 +1148,40 @@ export default {
|
|
|
remark, //备注
|
|
|
printFormat,
|
|
|
qrCodeId,
|
|
|
+ otherStates,
|
|
|
} = printRow;
|
|
|
- let temp = id + "@" + qrCodeId + "@" + canisterNum + "@" + suttle + "@" + grossWeight + "@" + qrCode;
|
|
|
+ let temp =
|
|
|
+ id +
|
|
|
+ "@" +
|
|
|
+ qrCodeId +
|
|
|
+ "@" +
|
|
|
+ canisterNum +
|
|
|
+ "@" +
|
|
|
+ suttle +
|
|
|
+ "@" +
|
|
|
+ grossWeight +
|
|
|
+ "@" +
|
|
|
+ qrCode;
|
|
|
+ if (otherStates == 1) {
|
|
|
+ temp += "@" + 1; //总码单标识
|
|
|
+ }
|
|
|
+ console.log("二维码数据", temp);
|
|
|
payload.qrCodeVal = temp;
|
|
|
payload.remark = remark || "注:不同批号,请勿混用";
|
|
|
payload.mapList = getServerPrintData(printRow);
|
|
|
switch (printFormat) {
|
|
|
- case 3: //英文码单
|
|
|
- payload.printType = "normal";
|
|
|
- break;
|
|
|
- case 4: //新思维
|
|
|
+ case "3": //英文码单
|
|
|
payload.printType = "export";
|
|
|
break;
|
|
|
- case 5: //无净重码单(同3)
|
|
|
+ case "4": //新思维
|
|
|
+ payload.printType = "normal";
|
|
|
+ break;
|
|
|
+ case "5": //无净重码单(同3)
|
|
|
payload.printType = "normal";
|
|
|
break;
|
|
|
+ case "6": //总码单
|
|
|
+ payload.printType = "assembleNormal";
|
|
|
+ break;
|
|
|
}
|
|
|
try {
|
|
|
let res = await AutoPrinting(payload);
|
|
@@ -1092,7 +1208,7 @@ export default {
|
|
|
},
|
|
|
// 毛重改变回调
|
|
|
changeGrossWeight(row) {
|
|
|
- let {boxWeight, grossWeight, canisterWeight, canisterNum} = row;
|
|
|
+ let { boxWeight, grossWeight, canisterWeight, canisterNum } = row;
|
|
|
if (!Number(grossWeight)) {
|
|
|
row.suttle = 0;
|
|
|
return;
|
|
@@ -1121,7 +1237,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));
|
|
|
|
|
@@ -1150,8 +1266,7 @@ export default {
|
|
|
} else {
|
|
|
this.$message.error(`${msg}失败`);
|
|
|
}
|
|
|
- } catch (error) {
|
|
|
- }
|
|
|
+ } catch (error) {}
|
|
|
},
|
|
|
// 确认打印回调
|
|
|
printConfirmHandler(printData) {
|
|
@@ -1165,13 +1280,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() {
|
|
@@ -1188,8 +1303,7 @@ export default {
|
|
|
}
|
|
|
} else {
|
|
|
}
|
|
|
- } catch (error) {
|
|
|
- }
|
|
|
+ } catch (error) {}
|
|
|
},
|
|
|
// 补码打印回调
|
|
|
handleSuppleOne(row) {
|
|
@@ -1202,7 +1316,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))
|
|
@@ -1212,13 +1326,7 @@ export default {
|
|
|
this.printTableData[0].id = timeStemp;
|
|
|
// 先打印
|
|
|
this.changeGrossWeight(this.printTableData[0]);
|
|
|
- // 后端打印
|
|
|
- // await this.newPrintHandler();
|
|
|
- // 前端打印
|
|
|
- codeListPrint(this.printTableData, "printDom");
|
|
|
- if (this.excuteType == 1) {
|
|
|
- this.tableData.push(this.printTableData[0]);
|
|
|
- }
|
|
|
+
|
|
|
// 后保存数据
|
|
|
let payLoad = {
|
|
|
...this.form,
|
|
@@ -1235,6 +1343,11 @@ export default {
|
|
|
productCodeListInfoList: this.tableData,
|
|
|
productColour: rowData.productColor,
|
|
|
saleProductId: this.currentRow.id,
|
|
|
+ // 总码单相关数据 start
|
|
|
+ otherStates: 0,
|
|
|
+ parentCode: this.summertId,
|
|
|
+ // 总码单相关数据 end
|
|
|
+ directionOfTwist: this.currentRow.directionOfTwist, //捻向
|
|
|
};
|
|
|
if (rowData.id) {
|
|
|
payLoad.id = rowData.id;
|
|
@@ -1253,19 +1366,17 @@ export default {
|
|
|
}
|
|
|
let msg = this.isEdit ? "编辑" : "新增";
|
|
|
if (res.code == 200) {
|
|
|
- // if (this.excuteType != 1) {
|
|
|
- // this.printShow = false;
|
|
|
- // this.getList();
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // this.tableData[0].id = res.data;
|
|
|
- // this.printTableData[0].id = res.data;
|
|
|
- // this.printConfirmHandler(res.data);
|
|
|
+ // 后端打印
|
|
|
+ // await this.newPrintHandler();
|
|
|
+ // 前端打印
|
|
|
+ codeListPrint(this.printTableData, "printDom");
|
|
|
+ if (this.excuteType == 1) {
|
|
|
+ this.tableData.push(this.printTableData[0]);
|
|
|
+ }
|
|
|
} else {
|
|
|
this.$message.error(`${msg}箱单失败`);
|
|
|
}
|
|
|
- } catch (error) {
|
|
|
- }
|
|
|
+ } catch (error) {}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -1274,7 +1385,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];
|
|
@@ -1303,8 +1414,7 @@ export default {
|
|
|
} else {
|
|
|
this.$message.error(`${msg}箱单失败`);
|
|
|
}
|
|
|
- } catch (error) {
|
|
|
- }
|
|
|
+ } catch (error) {}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -1414,7 +1524,7 @@ export default {
|
|
|
},
|
|
|
// 计算净重
|
|
|
getSuttle() {
|
|
|
- let {boxWeight, canisterWeight, canisterNum} = this.form;
|
|
|
+ let { boxWeight, canisterWeight, canisterNum } = this.form;
|
|
|
return (Number(boxWeight) - canisterWeight * canisterNum).toFixed(2);
|
|
|
},
|
|
|
// 表格点击回调
|
|
@@ -1432,8 +1542,10 @@ export default {
|
|
|
// 手动打印 获取码单号
|
|
|
this.getQrCodeHandle();
|
|
|
// }
|
|
|
+ this.summertId = new Date().getTime(); //总码单id重新生成
|
|
|
}
|
|
|
this.currentRow = val;
|
|
|
+ // this.continuePrintHandler(); //产品选择后,自动执行接续逻辑
|
|
|
},
|
|
|
// 获取码单号
|
|
|
async getQrCodeHandle() {
|
|
@@ -1455,7 +1567,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];
|
|
@@ -1470,6 +1582,8 @@ export default {
|
|
|
grossWeight: rowData.grossWeight,
|
|
|
productCodeListInfoList: this.tableData,
|
|
|
saleProductId: this.currentRow.id, //货品id
|
|
|
+ directionOfTwistLabel:
|
|
|
+ this.currentRow.directionOfTwistLabel, //捻向
|
|
|
};
|
|
|
if (rowData.id) {
|
|
|
payLoad.id = rowData.id;
|
|
@@ -1499,8 +1613,7 @@ export default {
|
|
|
} else {
|
|
|
this.$message.error(`${msg}箱单失败`);
|
|
|
}
|
|
|
- } catch (error) {
|
|
|
- }
|
|
|
+ } catch (error) {}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -1510,15 +1623,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() {
|
|
@@ -1568,17 +1680,16 @@ export default {
|
|
|
} else {
|
|
|
this.$message.error("网络异常!");
|
|
|
}
|
|
|
- } catch (error) {
|
|
|
- }
|
|
|
+ } catch (error) {}
|
|
|
},
|
|
|
/** 查询产品码单列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
- listProductCodeList(this.queryParams).then((response) => {
|
|
|
- this.productCodeListList = response.rows;
|
|
|
- this.total = response.total;
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
+ // listProductCodeList(this.queryParams).then((response) => {
|
|
|
+ // this.productCodeListList = response.rows;
|
|
|
+ // this.total = response.total;
|
|
|
+ // this.loading = false;
|
|
|
+ // });
|
|
|
},
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
@@ -1774,8 +1885,7 @@ export default {
|
|
|
this.getList();
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
- });
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|