|
@@ -40,30 +40,7 @@
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="筒数" prop="canisterNum">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.canisterNum"
|
|
|
- placeholder="请输入筒数"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="箱数" prop="boxNum">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.boxNum"
|
|
|
- placeholder="请输入箱数"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="净重" prop="suttle">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.suttle"
|
|
|
- placeholder="请输入净重"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
+
|
|
|
<el-form-item>
|
|
|
<el-button
|
|
|
type="primary"
|
|
@@ -146,7 +123,7 @@
|
|
|
/>
|
|
|
<el-table-column label="批号" align="center" prop="lotNum" />
|
|
|
<el-table-column label="色泽" align="center" prop="productColor" />
|
|
|
- <el-table-column label="货品编号" align="center" prop="productId" />
|
|
|
+ <!-- <el-table-column label="货品编号" align="center" prop="productId" /> -->
|
|
|
<el-table-column label="等级" align="center" prop="levels" />
|
|
|
<el-table-column label="筒数" align="center" prop="canisterNum" />
|
|
|
<el-table-column label="箱数" align="center" prop="boxNum" />
|
|
@@ -158,22 +135,42 @@
|
|
|
class-name="small-padding fixed-width"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-edit"
|
|
|
- @click="handleUpdate(scope.row)"
|
|
|
- v-hasPermi="['system:productCodeList:edit']"
|
|
|
- >修改</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-delete"
|
|
|
- @click="handleDelete(scope.row)"
|
|
|
- v-hasPermi="['system:productCodeList:remove']"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
+ <el-dropdown>
|
|
|
+ <el-button type="warning" plain size="small">
|
|
|
+ 操作<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
+ v-hasPermi="['system:productCodeList:edit']"
|
|
|
+ >修改</el-button
|
|
|
+ >
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-circle-plus-outline"
|
|
|
+ @click="supplementCode(scope.row)"
|
|
|
+ >补码</el-button
|
|
|
+ >
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
+ v-hasPermi="['system:productCodeList:remove']"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -304,7 +301,7 @@
|
|
|
type="primary"
|
|
|
size="mini"
|
|
|
@click="getOrderData"
|
|
|
- >箱单</el-button
|
|
|
+ >{{ excuteType == 1 ? "箱单" : "保存修改" }}</el-button
|
|
|
>
|
|
|
</div>
|
|
|
<div class="msg" v-if="orderData.boxNo">
|
|
@@ -329,7 +326,7 @@
|
|
|
></el-table-column>
|
|
|
<el-table-column prop="machineTool" label="机台"> </el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="qrCode"
|
|
|
+ prop="boxNumber"
|
|
|
:label="`${tempStr}号`"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
@@ -679,11 +676,12 @@ import {
|
|
|
getProductCodeList,
|
|
|
delProductCodeList,
|
|
|
addProductCodeList,
|
|
|
- updateProductCodeList,
|
|
|
finishedProductList,
|
|
|
getOptionLsit,
|
|
|
getLineOptionLsit,
|
|
|
productCodeList,
|
|
|
+ getPrintData,
|
|
|
+ updateProductCodeList,
|
|
|
} from "@/api/codeListManage/productCodeList";
|
|
|
import codeListPrint from "@/utils/print/codeListPrint";
|
|
|
import { async } from "@/components/updateModule/k-form-design/lib/k-form-design.common";
|
|
@@ -693,6 +691,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
// 自定义数据 start
|
|
|
+ excuteType: false, //1:新增 2:编辑 3:补码
|
|
|
lineOptions: [], //机台选项数据
|
|
|
orderData: {
|
|
|
boxNo: "",
|
|
@@ -867,13 +866,16 @@ export default {
|
|
|
this.tableData.splice(index, 1);
|
|
|
},
|
|
|
// 确认打印回调
|
|
|
- printConfirmHandler() {
|
|
|
+ printConfirmHandler(printData) {
|
|
|
if (this.tableData.length == 0) {
|
|
|
this.$message.warning("请添加打印的数据");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
console.log("打印", this.tableData);
|
|
|
+ this.tableData.forEach((item) => {
|
|
|
+ item.qrCodeData = printData + "-" + item.boxNumber;
|
|
|
+ });
|
|
|
codeListPrint(this.tableData, "printDom");
|
|
|
},
|
|
|
// 获取机台选项数据
|
|
@@ -921,13 +923,26 @@ export default {
|
|
|
cartonNumber: sumCanisterNum,
|
|
|
suttle: sumSuttle,
|
|
|
grossWeight: sumGrossWeight,
|
|
|
+ productCodeListInfoList: this.tableData,
|
|
|
};
|
|
|
- let res = await productCodeList(payLoad);
|
|
|
+ let tempApiFun = productCodeList;
|
|
|
+ if (this.excuteType == 1) {
|
|
|
+ tempApiFun = productCodeList;
|
|
|
+ } else if (this.excuteType == 2) {
|
|
|
+ tempApiFun = updateProductCodeList;
|
|
|
+ }
|
|
|
+ let res = await tempApiFun(payLoad);
|
|
|
+ let msg = this.isEdit ? "编辑" : "新增";
|
|
|
if (res.code == 200) {
|
|
|
- this.$message.success("保存箱单成功");
|
|
|
+ this.$message.success(`${msg}箱单成功`);
|
|
|
+ if (this.excuteType != 1) {
|
|
|
+ this.printShow = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.printConfirmHandler(res.data);
|
|
|
} else {
|
|
|
console.log(res);
|
|
|
- this.$message.error("保存箱单失败");
|
|
|
+ this.$message.error(`${msg}箱单失败`);
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.error(error);
|
|
@@ -996,7 +1011,7 @@ export default {
|
|
|
tubeColor,
|
|
|
grossWeight: 0, //毛重
|
|
|
suttle: this.getSuttle(), //净重
|
|
|
- myNO: this.tableData.length + 1, //序号
|
|
|
+ boxNumber: this.tableData.length + 1, //序号
|
|
|
productionDate, //日期
|
|
|
printFormat, //格式
|
|
|
productName,
|
|
@@ -1130,6 +1145,7 @@ export default {
|
|
|
},
|
|
|
// 打印按钮操作
|
|
|
async printHandler() {
|
|
|
+ this.excuteType = 1;
|
|
|
this.reset();
|
|
|
await this.getAllBatchData(); //获取所有产品数据
|
|
|
await this.getLineOptionLsit(); //获取机台选项数据
|
|
@@ -1140,12 +1156,19 @@ export default {
|
|
|
handleUpdate(row) {
|
|
|
this.reset();
|
|
|
const id = row.id || this.ids;
|
|
|
- getProductCodeList(id).then((response) => {
|
|
|
+ getPrintData(id).then(async (response) => {
|
|
|
+ console.log(response);
|
|
|
+ this.isEdit = 2;
|
|
|
this.form = response.data;
|
|
|
- this.open = true;
|
|
|
- this.title = "修改产品码单";
|
|
|
+ this.tableData = response.data.productCodeListInfoList;
|
|
|
+ await this.getAllBatchData(); //获取所有产品数据
|
|
|
+ await this.getLineOptionLsit(); //获取机台选项数据
|
|
|
+ await this.getSelectOptions();
|
|
|
+ this.printShow = true;
|
|
|
});
|
|
|
},
|
|
|
+ // 补码回调
|
|
|
+ supplementCode() {},
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
this.$refs["form"].validate((valid) => {
|