Browse Source

日常打印代码1222

branch_ccpg_220107
44673626 3 years ago
parent
commit
3f20081a23
  1. 489
      vue/src/views/pg-fis/basedate/m100Online/normalPritIndex.vue

489
vue/src/views/pg-fis/basedate/m100Online/normalPritIndex.vue

@ -280,12 +280,13 @@
v-show="isShowHostSN" v-show="isShowHostSN"
> >
<el-input <el-input
v-model="form.beginHostSN" v-model.number="form.beginHostSN"
placeholder="" placeholder=""
clearable clearable
:disabled="true" type="number"
size="small" size="small"
style="width: 240px" style="width: 240px"
@change="beginHostSNChange"
/> />
<label class="label1">-</label> <label class="label1">-</label>
<el-input <el-input
@ -427,6 +428,9 @@ export default {
erpAssemblyName: [ erpAssemblyName: [
{ required: true, message: "必须输入!", trigger: "blur" }, { required: true, message: "必须输入!", trigger: "blur" },
], ],
beginHostSN: [
{ required: true, message: "必须输入数字!", trigger: "number" },
],
}, },
billState: [ billState: [
{ id: 2, name: "已匹配" }, { id: 2, name: "已匹配" },
@ -633,20 +637,31 @@ export default {
...mapGetters(["userInfo"]), // ...mapGetters(["userInfo"]), //
}, },
methods: { methods: {
//
beginHostSNChange(val) {
if (this.listQuery.productType === 1) {
this.form.endHostSN =
parseInt(this.printNum) + parseInt(this.form.beginHostSN) - 1;
} else if (this.listQuery.productType === 2) {
this.form.endHostSN =
parseInt(this.printNumZHB) + parseInt(this.form.beginHostSN) - 1;
}
},
// //
valueNumChange(val) { valueNumChange(val) {
this.printNum = val; this.printNum = val;
if (val == 12) {
//12
this.$axios this.$axios
.gets("/api/newjit/bill-m100/get-print-start-hostsn2", this.hostSNQuery) .gets(
"/api/newjit/bill-m100/get-print-start-hostsn2",
this.hostSNQuery
)
.then((response) => { .then((response) => {
if (response.item !== null) { if (response.item !== null) {
this.form.beginHostSN = parseInt(response.item); this.form.beginHostSN = parseInt(response.item);
if (val == 12) {
// //
this.form.endHostSN = parseInt(response.item) + 11; this.form.endHostSN = parseInt(response.item) + 11;
} else {
this.form.endHostSN = parseInt(response.item) + this.printNum - 1;
}
} else { } else {
this.$message({ this.$message({
message: "获取不到大众顺序号", message: "获取不到大众顺序号",
@ -655,22 +670,47 @@ export default {
return; return;
} }
}); });
} else {
//12
this.form.endHostSN =
parseInt(this.printNum) + parseInt(this.form.beginHostSN) - 1;
}
// this.$axios
// .gets("/api/newjit/bill-m100/get-print-start-hostsn2", this.hostSNQuery)
// .then((response) => {
// if (response.item !== null) {
// this.form.beginHostSN = parseInt(response.item);
// if (val == 12) {
// //
// this.form.endHostSN = parseInt(response.item) + 11;
// } else {
// this.form.endHostSN =
// parseInt(response.item) + parseInt(this.printNum) - 1;
// }
// } else {
// this.$message({
// message: "",
// type: "warning",
// });
// return;
// }
// });
}, },
// //
valueNumChangeZHB(val) { valueNumChangeZHB(val) {
this.printNumZHB = val; this.printNumZHB = val;
if (val == 12) {
//12
this.$axios this.$axios
.gets("/api/newjit/bill-m100/get-print-start-hostsn2", this.hostSNQuery) .gets(
"/api/newjit/bill-m100/get-print-start-hostsn2",
this.hostSNQuery
)
.then((response) => { .then((response) => {
if (response.item !== null) { if (response.item !== null) {
this.form.beginHostSN = parseInt(response.item); this.form.beginHostSN = parseInt(response.item);
if (val == 24) { //
// this.form.endHostSN = parseInt(response.item) + 11;
this.form.endHostSN = parseInt(response.item) + 23;
} else {
this.form.endHostSN =
parseInt(response.item) + this.printNumZHB - 1;
}
} else { } else {
this.$message({ this.$message({
message: "获取不到大众顺序号", message: "获取不到大众顺序号",
@ -679,6 +719,31 @@ export default {
return; return;
} }
}); });
} else {
//12
this.form.endHostSN =
parseInt(this.printNumZHB) + parseInt(this.form.beginHostSN) - 1;
}
// this.$axios
// .gets("/api/newjit/bill-m100/get-print-start-hostsn2", this.hostSNQuery)
// .then((response) => {
// if (response.item !== null) {
// this.form.beginHostSN = parseInt(response.item);
// if (val == 24) {
// //
// this.form.endHostSN = parseInt(response.item) + 23;
// } else {
// this.form.endHostSN =
// parseInt(response.item) + this.printNumZHB - 1;
// }
// } else {
// this.$message({
// message: "",
// type: "warning",
// });
// return;
// }
// });
}, },
// //
handleDrawerOpen(param) { handleDrawerOpen(param) {
@ -1124,8 +1189,394 @@ export default {
this.isShowHostSN = false; this.isShowHostSN = false;
this.isShowVin = true; this.isShowVin = true;
}, },
/**保存*/
save() { save() {
this.$refs.form.validate((valid) => {
if (valid) {
//this.listLoaddingPrint = true;
if (this.isShowHostSN === true) {
if (this.form.beginHostSN === "" || this.form.endHostSN === "") {
this.$message({
message: "请输入完整的顺序号起始范围",
type: "error",
});
return;
} else {
if (this.listQuery.productType === 1) {
//
if (
parseInt(this.form.endHostSN) -
parseInt(this.form.beginHostSN) <=
0
) {
this.$message({
message: "起止大众顺序号相减不能为零!",
type: "error",
});
return;
}
} else if (this.listQuery.productType === 2) {
//
if (
parseInt(this.form.endHostSN) -
parseInt(this.form.beginHostSN) >
23
) {
this.$message({
message:
"最多只能打印24个顺序号,终止顺序号不能大于" +
(parseInt(this.form.beginHostSN) + 23),
type: "error",
});
return;
}
}
}
}
if (this.isShowVin === true) {
if (this.form.beginVin === "" || this.form.endVin === "") {
this.$message({
message: "请输入完整的底盘号起始范围",
type: "error",
});
return;
}
}
/**打印时传递大众顺序号范围,接口1获取大众顺序号,接口2验证是否断号,接口3获取打印数据,接口4获得grid++模板的base64编码 */
if (
this.formTitle === "打印-门板发货排序单" ||
this.formTitle === "打印-柱护板发货排序单"
) {
this.hostPrintQuery.beginHostSN = parseInt(this.form.beginHostSN);
this.hostPrintQuery.endHostSN = parseInt(this.form.endHostSN);
if (this.listQuery.productType === 1) {
//-
this.$axios
.posts(
"/api/newjit/bill-m100/check-mb-hostsn-break-num",
this.hostCheckQuery
)
.then((response) => {
console.log("检查门板-大众顺序号是否断号");
if (response.item.length > 0) {
//
this.$confirm(
"本次打印存在断号是否继续?" + response.item,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
//
//
this.$axios
.posts(
"/api/newjit/bill-m100/print-menban-packing-list",
this.hostPrintQuery
)
.then((response) => {
console.log("打印门板装箱单");
console.log(response);
console.log(response.status);
if (response.status === false) {
this.$message({
message: response.message,
type: "error",
});
return;
} else {
//grid++jsonbase64
//this.fileQuery.report = "menban";
this.fileQuery.dataname = JSON.stringify(
response.item
);
//this.fileQuery.dataname = "";
console.log("打印json");
console.log(this.fileQuery.dataname);
this.$axios
.posts(
"/Handlers/Handler1.ashx?report=menban",
qs.stringify(this.fileQuery)
)
.then((response) => {
console.log("获取文件base64编码");
console.log(response);
this.formLoading = false;
this.printpdf(response); //
})
.catch((error) => {
this.formLoading = false;
});
}
});
})
.catch(() => {});
} else {
//
//
//
this.$axios
.posts(
"/api/newjit/bill-m100/print-menban-packing-list",
this.hostPrintQuery
)
.then((response) => {
console.log("打印门板装箱单");
console.log(response);
if (response.status === false) {
this.$message({
message: response.message,
type: "error",
});
return;
} else {
//grid++jsonbase64
//this.fileQuery.report = "menban";
this.fileQuery.dataname = JSON.stringify(
response.item
);
//this.fileQuery.dataname = "";
console.log("打印json");
console.log(this.fileQuery.dataname);
this.$axios
.posts(
"/Handlers/Handler1.ashx?report=menban",
qs.stringify(this.fileQuery)
)
.then((response) => {
console.log("获取文件base64编码");
console.log(response);
this.formLoading = false;
this.printpdf(response); //
})
.catch((error) => {
this.formLoading = false;
});
}
})
.catch(() => {
this.$message({
message: response.message,
type: "error",
});
return;
});
}
});
} else if (this.listQuery.productType === 2) {
//
this.$axios
.posts(
"/api/newjit/bill-m100/check-zhb-hostsn-break-num",
this.hostCheckQuery
)
.then((response) => {
console.log("检查柱护板-大众顺序号是否断号");
if (response.item.length > 0) {
//
this.$confirm(
"本次打印存在断号是否继续?" + response.item,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(() => {
//
//
this.$axios
.posts(
"/api/newjit/bill-m100/print-zhuhuban-packing-list",
this.hostPrintQuery
)
.then((response) => {
console.log("打印门板装箱单");
console.log(response);
console.log(response.status);
if (response.status === false) {
this.$message({
message: response.message,
type: "error",
});
return;
} else {
//grid++jsonbase64
//this.fileQuery.report = "menban";
this.fileQuery.dataname = JSON.stringify(
response.item
);
//this.fileQuery.dataname = "";
console.log("打印json");
console.log(this.fileQuery.dataname);
this.$axios
.posts(
"/Handlers/Handler1.ashx?report=menban",
qs.stringify(this.fileQuery)
)
.then((response) => {
console.log("获取文件base64编码");
console.log(response);
this.printpdf(response); //
});
}
});
})
.catch(() => {});
} //
else {
//
//
this.$axios
.posts(
"/api/newjit/bill-m100/print-zhuhuban-packing-list",
this.hostPrintQuery
)
.then((response) => {
console.log("打印门板装箱单");
console.log(response);
if (response.status === false) {
this.$message({
message: response.message,
type: "error",
});
return;
} else {
//grid++jsonbase64
//this.fileQuery.report = "menban";
this.fileQuery.dataname = JSON.stringify(
response.item
);
//this.fileQuery.dataname = "";
console.log("打印json");
console.log(this.fileQuery.dataname);
this.$axios
.posts(
"/Handlers/Handler1.ashx?report=menban",
qs.stringify(this.fileQuery)
)
.then((response) => {
console.log("获取文件base64编码");
console.log(response);
this.printpdf(response); //
});
}
})
.catch(() => {
this.$message({
message: response.message,
type: "error",
});
return;
});
}
});
}
} else {
/**接口1获取打印数据,接口2获得grid++模板的base64编码 */
this.hostPrintQuery.beginVin = this.form.beginVin;
this.hostPrintQuery.endVin = this.form.endVin;
//productType
if (this.listQuery.productType === 1) {
//
//
this.$axios
.posts(
"/api/newjit/bill-m100/print-menban-packing-list",
this.hostPrintQuery
)
.then((response) => {
console.log(
"重新或补打打印门板装箱单" +
JSON.stringify(this.hostPrintQuery)
);
console.log(response);
if (response.status === false) {
this.$message({
message: response.message,
type: "error",
});
return;
} else {
//grid++jsonbase64
//this.fileQuery.report = "menban";
this.fileQuery.dataname = JSON.stringify(response.item);
//this.fileQuery.dataname = "";
console.log("打印json");
console.log(this.fileQuery.dataname);
this.$axios
.posts(
"/Handlers/Handler1.ashx?report=menban",
qs.stringify(this.fileQuery)
)
.then((response) => {
console.log("获取文件base64编码");
console.log(response);
this.printpdf(response); //
});
}
})
.catch(() => {
this.$message({
message: response.message,
type: "error",
});
return;
});
} else if (this.listQuery.productType === 2) {
//
//
this.$axios
.posts(
"/api/newjit/bill-m100/print-zhuhuban-packing-list",
this.hostPrintQuery
)
.then((response) => {
console.log("打印柱护板装箱单");
console.log(response);
if (response.status === false) {
this.$message({
message: response.message,
type: "error",
});
return;
} else {
//grid++jsonbase64
//this.fileQuery.report = "zhuhuban";
this.fileQuery.dataname = JSON.stringify(response.item);
//this.fileQuery.dataname = "";
console.log("打印json");
console.log(this.fileQuery.dataname);
this.$axios
.posts(
"/Handlers/Handler1.ashx?report=zhuhuban",
qs.stringify(this.fileQuery)
)
.then((response) => {
console.log("获取文件base64编码");
console.log(response);
this.printpdf(response); //
});
}
})
.catch(() => {
this.$message({
message: response.message,
type: "error",
});
return;
});
}
}
}
});
},
/**保存*/
save1() {
//this.listLoaddingPrint = true; //this.listLoaddingPrint = true;
if (this.isShowHostSN === true) { if (this.isShowHostSN === true) {
if (this.form.beginHostSN === "" || this.form.endHostSN === "") { if (this.form.beginHostSN === "" || this.form.endHostSN === "") {
@ -1238,7 +1689,6 @@ export default {
console.log(response); console.log(response);
this.formLoading = false; this.formLoading = false;
this.printpdf(response); // this.printpdf(response); //
}) })
.catch((error) => { .catch((error) => {
this.formLoading = false; this.formLoading = false;
@ -1247,8 +1697,8 @@ export default {
}); });
}) })
.catch(() => {}); .catch(() => {});
} } else {
else {// //
// //
// //
this.$axios this.$axios
@ -1282,7 +1732,6 @@ export default {
console.log(response); console.log(response);
this.formLoading = false; this.formLoading = false;
this.printpdf(response); // this.printpdf(response); //
}) })
.catch((error) => { .catch((error) => {
this.formLoading = false; this.formLoading = false;

Loading…
Cancel
Save