|
|
|
@ -153,9 +153,10 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-alert
|
|
|
|
|
title="扫码解析结果:"
|
|
|
|
|
:title="scanTitle"
|
|
|
|
|
:type="scanResultType"
|
|
|
|
|
:closable="false"
|
|
|
|
|
:dangerouslyUseHTMLString="true"
|
|
|
|
|
:description="result">
|
|
|
|
|
</el-alert>
|
|
|
|
|
|
|
|
|
@ -295,6 +296,7 @@ export default {
|
|
|
|
|
//扫码相关
|
|
|
|
|
scanCode: "",
|
|
|
|
|
isSuccess: false,
|
|
|
|
|
scanTitle: "扫码结果:",
|
|
|
|
|
result: " \n",
|
|
|
|
|
msgTip: "信息提醒:",
|
|
|
|
|
originCode: "",
|
|
|
|
@ -408,14 +410,14 @@ export default {
|
|
|
|
|
this.$refs.inputRef.focus();
|
|
|
|
|
this.$refs.inputRef.select();
|
|
|
|
|
this.isSuccess = true;
|
|
|
|
|
this.printCodeResult(response.data)
|
|
|
|
|
this.printCodeResult(response.data, response.message)
|
|
|
|
|
this.filterQuery.code = response.data.code;
|
|
|
|
|
this.addCode();
|
|
|
|
|
} else {
|
|
|
|
|
if (response.code == 502) {
|
|
|
|
|
this.checkSuccess = false;
|
|
|
|
|
this.isSuccess = false;
|
|
|
|
|
this.printCodeResult(response.data)
|
|
|
|
|
this.printCodeResult(response.data, response.message)
|
|
|
|
|
this.filterQuery.code = response.data.code;
|
|
|
|
|
this.originCode = this.filterQuery.code;
|
|
|
|
|
} else if (response.code == 501) {
|
|
|
|
@ -424,7 +426,7 @@ export default {
|
|
|
|
|
} else if (response.code == 503) {
|
|
|
|
|
this.checkSuccess = false;
|
|
|
|
|
this.isSuccess = false;
|
|
|
|
|
this.printCodeResult(response.data)
|
|
|
|
|
this.printCodeResult(response.data, response.message)
|
|
|
|
|
this.filterQuery.code = response.data.code;
|
|
|
|
|
this.$confirm(response.message, "提示", {
|
|
|
|
|
type: "warning",
|
|
|
|
@ -463,20 +465,36 @@ export default {
|
|
|
|
|
if (this.$isBlank(this.filterQuery.code) && this.$isBlank(this.scanCode)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.$isNotBlank(this.scanCode)) {
|
|
|
|
|
this.filterQuery.code = this.scanCode.trim();
|
|
|
|
|
}
|
|
|
|
|
let tagQuery = {
|
|
|
|
|
workPlaceCode: this.formData.workPlaceCode,
|
|
|
|
|
fromCorp: this.formData.fromCorp,
|
|
|
|
|
billNo: this.formData.billNo,
|
|
|
|
|
code: this.filterQuery.code.trim(),
|
|
|
|
|
insert: this.formData.insert
|
|
|
|
|
};
|
|
|
|
|
tagCode(tagQuery).then(res => {
|
|
|
|
|
this.loading = false
|
|
|
|
|
if (res.code == 20000) {
|
|
|
|
|
this.formData.tagStatus = 2;
|
|
|
|
|
this.formData.insert = false;
|
|
|
|
|
this.formData = res.data;
|
|
|
|
|
this.refreshCodesPanel(this);
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.message)
|
|
|
|
|
if (res.code == 502) {
|
|
|
|
|
this.$confirm(res.message + '是否强制添加?', '提示', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.formData.insert = true;
|
|
|
|
|
this.addCode();
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
});
|
|
|
|
|
} else
|
|
|
|
|
this.$message.error(res.message)
|
|
|
|
|
}
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.loading = false
|
|
|
|
@ -570,8 +588,8 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printCodeResult(data, isSuccess) {
|
|
|
|
|
const resultParts = ["追溯码:" + data.code + "\r\n"];
|
|
|
|
|
printCodeResult(data, message) {
|
|
|
|
|
const resultParts = [];
|
|
|
|
|
|
|
|
|
|
if (data.udi) {
|
|
|
|
|
resultParts.push("层级标识: " + data.udi);
|
|
|
|
@ -588,7 +606,14 @@ export default {
|
|
|
|
|
if (data.serialNo) {
|
|
|
|
|
resultParts.push("序列号: " + data.serialNo);
|
|
|
|
|
}
|
|
|
|
|
this.scanTitle = "扫码结果:" + data.code;
|
|
|
|
|
this.result = resultParts.join(" , ");
|
|
|
|
|
if (message == 'success') {
|
|
|
|
|
this.scanResultType = "success";
|
|
|
|
|
} else {
|
|
|
|
|
this.scanResultType = "warning";
|
|
|
|
|
this.result = this.result + "\n" + message;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleCommand(command) {
|
|
|
|
|
// this.$message('click on item ' + command);
|
|
|
|
|