|
@@ -317,7 +317,7 @@
|
|
@click="updateOrderData"
|
|
@click="updateOrderData"
|
|
>保存修改
|
|
>保存修改
|
|
</el-button>
|
|
</el-button>
|
|
- <el-button
|
|
|
|
|
|
+ <!-- <el-button
|
|
:disabled="tableData.length != 1"
|
|
:disabled="tableData.length != 1"
|
|
type="primary"
|
|
type="primary"
|
|
size="mini"
|
|
size="mini"
|
|
@@ -331,7 +331,7 @@
|
|
size="mini"
|
|
size="mini"
|
|
@click="chooseOneToPrint"
|
|
@click="chooseOneToPrint"
|
|
>{{ chooseState ? "退出批箱单" : "批箱单" }}
|
|
>{{ chooseState ? "退出批箱单" : "批箱单" }}
|
|
- </el-button>
|
|
|
|
|
|
+ </el-button> -->
|
|
<el-switch
|
|
<el-switch
|
|
class="ml10 mr10"
|
|
class="ml10 mr10"
|
|
v-model="printAuto"
|
|
v-model="printAuto"
|
|
@@ -342,6 +342,13 @@
|
|
<el-button type="primary" size="mini" @click="readStateChange"
|
|
<el-button type="primary" size="mini" @click="readStateChange"
|
|
>{{ isStartReadNum ? "停止读数" : "开始读数" }}
|
|
>{{ isStartReadNum ? "停止读数" : "开始读数" }}
|
|
</el-button>
|
|
</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-show="!printAuto"
|
|
|
|
+ type="success"
|
|
|
|
+ size="mini"
|
|
|
|
+ @click="printBtnHandler"
|
|
|
|
+ >打印
|
|
|
|
+ </el-button>
|
|
</div>
|
|
</div>
|
|
<div class="weightWrap">
|
|
<div class="weightWrap">
|
|
<h1>实时重量:{{ nowWeight }}</h1>
|
|
<h1>实时重量:{{ nowWeight }}</h1>
|
|
@@ -395,7 +402,7 @@
|
|
label="筒数"
|
|
label="筒数"
|
|
></el-table-column>
|
|
></el-table-column>
|
|
<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="excuteType == 3"
|
|
:disabled="excuteType == 3"
|
|
v-model="scope.row.grossWeight"
|
|
v-model="scope.row.grossWeight"
|
|
@@ -403,7 +410,7 @@
|
|
size="mini"
|
|
size="mini"
|
|
clearable
|
|
clearable
|
|
></el-input>
|
|
></el-input>
|
|
- </template>
|
|
|
|
|
|
+ </template> -->
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="suttle" label="净重"></el-table-column>
|
|
<el-table-column prop="suttle" label="净重"></el-table-column>
|
|
<el-table-column prop="workShifts" label="班次"></el-table-column>
|
|
<el-table-column prop="workShifts" label="班次"></el-table-column>
|
|
@@ -465,7 +472,7 @@
|
|
label-width="80px"
|
|
label-width="80px"
|
|
:inline="false"
|
|
:inline="false"
|
|
size="normal"
|
|
size="normal"
|
|
- :disabled="isDisabled"
|
|
|
|
|
|
+ :disabled="isDisabled || isStartReadNum"
|
|
>
|
|
>
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
<el-form-item prop="packaging" label="包装">
|
|
<el-form-item prop="packaging" label="包装">
|
|
@@ -697,7 +704,7 @@
|
|
clearable
|
|
clearable
|
|
@input="batchNumChange"
|
|
@input="batchNumChange"
|
|
@keyup.enter.native="batchNumChange"
|
|
@keyup.enter.native="batchNumChange"
|
|
- :disabled="isDisabled"
|
|
|
|
|
|
+ :disabled="isDisabled || isStartReadNum"
|
|
></el-input>
|
|
></el-input>
|
|
<el-button
|
|
<el-button
|
|
class="ml10"
|
|
class="ml10"
|
|
@@ -710,6 +717,7 @@
|
|
</div>
|
|
</div>
|
|
<div class="table-wrap">
|
|
<div class="table-wrap">
|
|
<el-table
|
|
<el-table
|
|
|
|
+ ref="proTableRef"
|
|
:data="batchTableData"
|
|
:data="batchTableData"
|
|
border
|
|
border
|
|
stripe
|
|
stripe
|
|
@@ -718,6 +726,11 @@
|
|
highlight-current-row
|
|
highlight-current-row
|
|
@current-change="handleCurrentChange"
|
|
@current-change="handleCurrentChange"
|
|
>
|
|
>
|
|
|
|
+ <!-- <el-table-column
|
|
|
|
+ type="index"
|
|
|
|
+ label="序号"
|
|
|
|
+ width="50"
|
|
|
|
+ ></el-table-column> -->
|
|
<el-table-column
|
|
<el-table-column
|
|
v-for="col in columns"
|
|
v-for="col in columns"
|
|
:prop="col.id"
|
|
:prop="col.id"
|
|
@@ -770,6 +783,7 @@ export default {
|
|
],
|
|
],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ qrCode: "", //码单号
|
|
isStartReadNum: false, //是否开始读取重量
|
|
isStartReadNum: false, //是否开始读取重量
|
|
printAuto: true, //是否自动打印
|
|
printAuto: true, //是否自动打印
|
|
timer: null, //定时器
|
|
timer: null, //定时器
|
|
@@ -965,13 +979,27 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
- readStateChange() {
|
|
|
|
|
|
+ // 打印按钮回调
|
|
|
|
+ async printBtnHandler() {
|
|
|
|
+ let res = await this.validateAndPrint();
|
|
|
|
+ if (!res) {
|
|
|
|
+ this.$message.error("请完善数据");
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ async readStateChange() {
|
|
if (this.isStartReadNum) {
|
|
if (this.isStartReadNum) {
|
|
//正在读
|
|
//正在读
|
|
this.closeWebSocket();
|
|
this.closeWebSocket();
|
|
this.isStartReadNum = false;
|
|
this.isStartReadNum = false;
|
|
this.$message.success("已关闭读数");
|
|
this.$message.success("已关闭读数");
|
|
} else {
|
|
} else {
|
|
|
|
+ // 开启读数时 先获取码单号
|
|
|
|
+ let res = await getQrCode();
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.qrCode = res.msg;
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(res.msg);
|
|
|
|
+ }
|
|
this.initWebSocket();
|
|
this.initWebSocket();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -1091,17 +1119,11 @@ export default {
|
|
let directionOfTwistLabel = this.dict.type.direction_of_twist.find(
|
|
let directionOfTwistLabel = this.dict.type.direction_of_twist.find(
|
|
(item) => item.value == directionOfTwist
|
|
(item) => item.value == directionOfTwist
|
|
)?.label;
|
|
)?.label;
|
|
- let res = await getQrCode();
|
|
|
|
- let qrCode = "";
|
|
|
|
- if (res.code == 200) {
|
|
|
|
- qrCode = res.msg;
|
|
|
|
- } else {
|
|
|
|
- this.$message.error(res.msg);
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
newData = {
|
|
newData = {
|
|
// qrCode: this.getBoxOrderNum(), //箱单号
|
|
// qrCode: this.getBoxOrderNum(), //箱单号
|
|
packaging, //包装方式 1:车丝 2:小包装 3:大包装
|
|
packaging, //包装方式 1:车丝 2:小包装 3:大包装
|
|
- qrCode, //箱单号
|
|
|
|
|
|
+ qrCode: this.qrCode, //箱单号
|
|
levels,
|
|
levels,
|
|
machineTool,
|
|
machineTool,
|
|
boxWeight,
|
|
boxWeight,
|
|
@@ -1191,6 +1213,7 @@ export default {
|
|
if (res.code == 200 && res.status == "success") {
|
|
if (res.code == 200 && res.status == "success") {
|
|
this.$message.success(res.msg);
|
|
this.$message.success(res.msg);
|
|
if (this.excuteType == 1 && this.printAuto) {
|
|
if (this.excuteType == 1 && this.printAuto) {
|
|
|
|
+ this.changeGrossWeight(printRow);
|
|
this.tableData.push(printRow);
|
|
this.tableData.push(printRow);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -1220,6 +1243,7 @@ export default {
|
|
Number(boxWeight) -
|
|
Number(boxWeight) -
|
|
Number(canisterWeight) * Number(canisterNum)
|
|
Number(canisterWeight) * Number(canisterNum)
|
|
).toFixed(2);
|
|
).toFixed(2);
|
|
|
|
+ console.log(row);
|
|
},
|
|
},
|
|
// 删除表格一条数据回调
|
|
// 删除表格一条数据回调
|
|
handleDeleteOne(index) {
|
|
handleDeleteOne(index) {
|
|
@@ -1237,10 +1261,10 @@ export default {
|
|
item.qrCodeData = printData + "-" + item.boxNum;
|
|
item.qrCodeData = printData + "-" + item.boxNum;
|
|
});
|
|
});
|
|
// 前端打印
|
|
// 前端打印
|
|
- // codeListPrint(this.printTableData, "printDom");
|
|
|
|
|
|
+ codeListPrint(this.printTableData, "printDom");
|
|
// 后端打印
|
|
// 后端打印
|
|
console.log("newPrintHandler");
|
|
console.log("newPrintHandler");
|
|
- this.newPrintHandler();
|
|
|
|
|
|
+ // this.newPrintHandler();
|
|
},
|
|
},
|
|
// 获取机台选项数据
|
|
// 获取机台选项数据
|
|
async getLineOptionLsit() {
|
|
async getLineOptionLsit() {
|
|
@@ -1470,7 +1494,30 @@ export default {
|
|
// 表格点击回调
|
|
// 表格点击回调
|
|
async handleCurrentChange(val) {
|
|
async handleCurrentChange(val) {
|
|
console.log("row", val);
|
|
console.log("row", val);
|
|
- this.currentRow = JSON.parse(JSON.stringify(val));
|
|
|
|
|
|
+ if (!val) return;
|
|
|
|
+ if (this.isStartReadNum) {
|
|
|
|
+ this.$refs.proTableRef.setCurrentRow(this.currentRow);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (val.id != this.currentRow.id) {
|
|
|
|
+ this.tableData = [];
|
|
|
|
+ // this.$refs.form.resetFields();
|
|
|
|
+ this.nowWeight = 0;
|
|
|
|
+ if (!this.printAuto) {
|
|
|
|
+ // 手动打印 获取码单号
|
|
|
|
+ this.getQrCodeHandle();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.currentRow = val;
|
|
|
|
+ },
|
|
|
|
+ // 获取码单号
|
|
|
|
+ async getQrCodeHandle() {
|
|
|
|
+ let res = await getQrCode();
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.qrCode = res.msg;
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(res.msg);
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 选择打印数据回调
|
|
// 选择打印数据回调
|
|
handlePrintOneChange(row) {
|
|
handlePrintOneChange(row) {
|