|
|
|
@ -162,8 +162,8 @@
|
|
|
|
|
type="tel"
|
|
|
|
|
placeholder="请点击输入框进行扫码设置或者扫码录入"
|
|
|
|
|
v-model="scanCode"
|
|
|
|
|
:disabled="scanDisabled"
|
|
|
|
|
></el-input>
|
|
|
|
|
<!-- :disabled="scanDisabled"-->
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="4">
|
|
|
|
@ -171,7 +171,7 @@
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
size="mini"
|
|
|
|
|
icon="el-icon-plus"
|
|
|
|
|
icon="el-icon-search"
|
|
|
|
|
@click.native.stop="addCode()"
|
|
|
|
|
style="margin-left: 15px"
|
|
|
|
|
>
|
|
|
|
@ -354,7 +354,7 @@ import prescribeOriginPanel from "./PannelOrderBiz";
|
|
|
|
|
import prescribeCodePanel from "./PanelOrderTagCode";
|
|
|
|
|
import PannelOrderBiz from "./PannelOrderBiz";
|
|
|
|
|
import {listPage} from "@/api/basic/workPlace/sysWorkplaceManage";
|
|
|
|
|
import {enterCodeWeb} from "@/api/inout/order";
|
|
|
|
|
import {enterCodeWeb,batchVailCode,enterCodeBillNo} from "@/api/inout/order";
|
|
|
|
|
import {cancelOrder, draftOrder, finishOrder, startSplit, tagCode, updateOrder} from "@/api/collect/splitCreateOrder";
|
|
|
|
|
import {selectCorpList} from "@/api/basic/basicUnitMaintain";
|
|
|
|
|
import {getCurOrder, getNextOrder, findByBill, findFromCorp} from "@/api/collect/collectOrder";
|
|
|
|
@ -362,6 +362,8 @@ import PanelOrderAllDetail from "@/views/collect/PanelOrderAllDetail";
|
|
|
|
|
import {getWorkBindBusTypes, removeBusTypeById} from '@/api/basic/workPlace/sysWorkplaceDocuments'
|
|
|
|
|
import {getInvListByUser} from "@/api/system/invWarehouse";
|
|
|
|
|
import {orderbatchAddCode} from "@/api/inout/splitCode";
|
|
|
|
|
import {isBlank} from "@/utils/strUtil";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
/**
|
|
|
|
|
* 处理处方
|
|
|
|
@ -454,7 +456,11 @@ export default {
|
|
|
|
|
invList: [],
|
|
|
|
|
viewType: 1,
|
|
|
|
|
scanDisabled: false,
|
|
|
|
|
valiCodes: []
|
|
|
|
|
valiCodes: [],
|
|
|
|
|
warnResult: "",
|
|
|
|
|
errResult: "",
|
|
|
|
|
warnVisible: false,
|
|
|
|
|
errVisible: false,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -630,6 +636,10 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enterKey() {
|
|
|
|
|
if (this.formData.billNo == null){
|
|
|
|
|
this.enterBillNoKey()
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.checkSuccess = true;
|
|
|
|
|
this.filterQuery.code = this.scanCode;
|
|
|
|
|
let tQuery = {
|
|
|
|
@ -704,16 +714,94 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
addCode() {
|
|
|
|
|
enterBillNoKey() {
|
|
|
|
|
this.checkSuccess = true;
|
|
|
|
|
this.filterQuery.code = this.scanCode;
|
|
|
|
|
let tQuery = {
|
|
|
|
|
viewType: "tagCode",
|
|
|
|
|
workPlaceCode: this.workplaceId,
|
|
|
|
|
originCode: this.originCode,
|
|
|
|
|
busType: this.formData.busType,
|
|
|
|
|
code: this.filterQuery.code.trim(),
|
|
|
|
|
};
|
|
|
|
|
enterCodeBillNo(tQuery).then((response) => {
|
|
|
|
|
if (response.code === 20000) {
|
|
|
|
|
this.$refs.inputRef.focus();
|
|
|
|
|
this.$refs.inputRef.select();
|
|
|
|
|
this.isSuccess = true;
|
|
|
|
|
this.printCodeResult(response.data, response.message)
|
|
|
|
|
this.filterQuery.code = response.data.code;
|
|
|
|
|
this.scanCode = ""
|
|
|
|
|
this.originCode = ""
|
|
|
|
|
|
|
|
|
|
this.addCode();
|
|
|
|
|
} else {
|
|
|
|
|
if (response.code == 502) {
|
|
|
|
|
this.checkSuccess = false;
|
|
|
|
|
this.isSuccess = false;
|
|
|
|
|
this.printCodeResult(response.data, response.message)
|
|
|
|
|
this.filterQuery.code = response.data.code;
|
|
|
|
|
this.originCode = response.data.code;
|
|
|
|
|
this.scanCode = ""
|
|
|
|
|
} else if (response.code == 501) {
|
|
|
|
|
this.checkSuccess = false;
|
|
|
|
|
this.$message.error(response.message);
|
|
|
|
|
this.scanCode = ""
|
|
|
|
|
} else if (response.code == 503) {
|
|
|
|
|
this.checkSuccess = false;
|
|
|
|
|
this.isSuccess = false;
|
|
|
|
|
this.printCodeResult(response.data, response.message)
|
|
|
|
|
this.filterQuery.code = response.data.code;
|
|
|
|
|
this.scanCode = ""
|
|
|
|
|
this.$confirm(response.message, "提示", {
|
|
|
|
|
type: "warning",
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
this.filterQuery.code = response.data.code;
|
|
|
|
|
this.addCode();
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.filterQuery.code = response.data.code;
|
|
|
|
|
});
|
|
|
|
|
} else if (response.code == 508) {
|
|
|
|
|
this.originCode = "";
|
|
|
|
|
this.filterQuery.code = "01" + response.data.nameCode;
|
|
|
|
|
this.originCode = this.filterQuery.code;
|
|
|
|
|
} else if (response.code == 601) {
|
|
|
|
|
this.formData.billNo = response.data.billNo
|
|
|
|
|
this.getBillNo(this.formData.billNo)
|
|
|
|
|
this.startDeal();
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
this.scanCode = ""
|
|
|
|
|
this.$alert(response.message, "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
type: "warning",
|
|
|
|
|
closeOnClickModal: true,
|
|
|
|
|
callback: (action) => {
|
|
|
|
|
this.$refs.inputRef.focus();
|
|
|
|
|
this.$refs.inputRef.select();
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
addCode(code) {
|
|
|
|
|
if (this.$isNotBlank(code)) {
|
|
|
|
|
this.filterQuery.code = code;
|
|
|
|
|
}
|
|
|
|
|
if (this.$isBlank(this.filterQuery.code)) {
|
|
|
|
|
this.filterQuery.code = this.scanCode.trim();
|
|
|
|
|
}
|
|
|
|
|
if (this.$isBlank(this.filterQuery.code) && this.$isBlank(this.scanCode)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.$isNotBlank(this.scanCode)) {
|
|
|
|
|
this.filterQuery.code = this.scanCode.trim();
|
|
|
|
|
}
|
|
|
|
|
// if (this.$isNotBlank(this.scanCode)) {
|
|
|
|
|
// this.filterQuery.code = this.scanCode.trim();
|
|
|
|
|
// }
|
|
|
|
|
let tagQuery = {
|
|
|
|
|
workPlaceCode: this.formData.workPlaceCode,
|
|
|
|
|
fromCorp: this.formData.fromCorp,
|
|
|
|
@ -832,6 +920,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateOrder() {
|
|
|
|
|
this.formData.workPlaceCode = this.workplaceId;
|
|
|
|
|
updateOrder(this.formData).then(res => {
|
|
|
|
|
this.loading = false
|
|
|
|
|
}).catch(() => {
|
|
|
|
@ -888,15 +977,17 @@ export default {
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
});
|
|
|
|
|
} else if (temp.tagStatus === 2) {
|
|
|
|
|
this.$confirm('检测到当前工位存在正在处理单据,是否继续上一次单据处理?', '提示', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.formData = temp;
|
|
|
|
|
this.startDeal();
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.formData = temp;
|
|
|
|
|
this.startDeal();
|
|
|
|
|
// this.$confirm('检测到当前工位存在正在处理单据,是否继续上一次单据处理?', '提示', {
|
|
|
|
|
// confirmButtonText: '确定',
|
|
|
|
|
// cancelButtonText: '取消',
|
|
|
|
|
// type: 'warning'
|
|
|
|
|
// }).then(() => {
|
|
|
|
|
//
|
|
|
|
|
// }).catch(() => {
|
|
|
|
|
// });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -980,6 +1071,42 @@ export default {
|
|
|
|
|
this.result = this.result + "\n" + message;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
popupTip(data) {
|
|
|
|
|
this.$confirm(data.errMsg, '提示', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.formData.insert = true
|
|
|
|
|
this.addCode(data.code);
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async printMutiCodeResult(vailCodeResultResponses) {
|
|
|
|
|
this.warnVisible = false;
|
|
|
|
|
this.errVisible = false;
|
|
|
|
|
for (let i = 0; i < vailCodeResultResponses.length; i++) {
|
|
|
|
|
let data = vailCodeResultResponses[i]
|
|
|
|
|
if (data.status == 1)
|
|
|
|
|
this.result = this.result + ";" + vailCodeResultResponses[i].code;
|
|
|
|
|
else if (data.status == 2) {
|
|
|
|
|
this.warnResult = this.warnResult + "\n" + vailCodeResultResponses[i].code + ":" + vailCodeResultResponses[i].errMsg;
|
|
|
|
|
} else if (data.status == 3) {
|
|
|
|
|
this.result = this.result + "\n" + vailCodeResultResponses[i].code;
|
|
|
|
|
// this.warnResult = this.warnResult + "\n" + vailCodeResultResponses[i].code + ":" + vailCodeResultResponses[i].errMsg;
|
|
|
|
|
await this.popupTip(data)
|
|
|
|
|
}
|
|
|
|
|
// else
|
|
|
|
|
// this.errResult = this.errResult + "\n" + vailCodeResultResponses[i].code + ":" + vailCodeResultResponses[i].errMsg;
|
|
|
|
|
}
|
|
|
|
|
if (!isBlank(this.warnResult))
|
|
|
|
|
this.warnVisible = true;
|
|
|
|
|
if (!isBlank(this.errResult))
|
|
|
|
|
this.errVisible = true;
|
|
|
|
|
},
|
|
|
|
|
handleCommand(command) {
|
|
|
|
|
// this.$message('click on item ' + command);
|
|
|
|
|
},
|
|
|
|
@ -1028,47 +1155,58 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
//处理事件
|
|
|
|
|
handleRecCodesEvent(event) {
|
|
|
|
|
console.log('接收 recCodes event:',event.detail.recCodes);
|
|
|
|
|
console.log('接收 recCodes event:', event.detail.recCodes);
|
|
|
|
|
let params = {
|
|
|
|
|
codeList: event.detail.recCodes,
|
|
|
|
|
codeList: event.detail.recCodes,
|
|
|
|
|
};
|
|
|
|
|
//校验
|
|
|
|
|
batchVailCode(params).then((res) => {
|
|
|
|
|
if (res.code === 20000) {
|
|
|
|
|
this.valiCodes = [];
|
|
|
|
|
console.log("==滴码接收==",res.data);
|
|
|
|
|
let list = res.data;
|
|
|
|
|
list.forEach(item => {
|
|
|
|
|
if (item.status === 1) {
|
|
|
|
|
this.valiCodes.push(item.code);
|
|
|
|
|
if (res.code === 20000) {
|
|
|
|
|
this.valiCodes = [];
|
|
|
|
|
let list = res.data;
|
|
|
|
|
list.forEach(item => {
|
|
|
|
|
if (item.status === 1) {
|
|
|
|
|
this.valiCodes.push(item.code);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (this.valiCodes != null && this.valiCodes.length > 0) {
|
|
|
|
|
//批量添加
|
|
|
|
|
let params2 = {
|
|
|
|
|
workPlaceCode: this.formData.workPlaceCode,
|
|
|
|
|
codeList: this.valiCodes,
|
|
|
|
|
fromCorp: this.formData.fromCorp,
|
|
|
|
|
billNo: this.formData.billNo,
|
|
|
|
|
insert: this.formData.insert,
|
|
|
|
|
busType: this.formData.busType,
|
|
|
|
|
}
|
|
|
|
|
orderbatchAddCode(params2).then((res) => {
|
|
|
|
|
if (res.code === 20000) {
|
|
|
|
|
this.formData.tagStatus = 2;
|
|
|
|
|
this.formData.insert = false;
|
|
|
|
|
this.curRow = this.formData;
|
|
|
|
|
this.$refs.inputRef.focus();
|
|
|
|
|
this.refreshCodesPanel(this);
|
|
|
|
|
this.printMutiCodeResult(res.data.vailCodeResultResponses)
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.message)
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
this.$message.error(res.message)
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if(this.valiCodes != null && this.valiCodes.length > 0){
|
|
|
|
|
//批量添加
|
|
|
|
|
let params2 = {
|
|
|
|
|
workPlaceCode:this.formData.workPlaceCode,
|
|
|
|
|
codeList:this.valiCodes
|
|
|
|
|
}
|
|
|
|
|
orderbatchAddCode(params2).then((res) => {
|
|
|
|
|
if (res.code === 20000) {
|
|
|
|
|
this.$message.success("添加成功")
|
|
|
|
|
}else{
|
|
|
|
|
this.$message.error(res.message)
|
|
|
|
|
this.scanCode = this.valiCodes.join(";");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.scanCode = this.valiCodes.join(";");
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.message)
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.$refs.inputRef.focus();
|
|
|
|
|
//环境判断
|
|
|
|
|
if(window.navigator.userAgent.indexOf("GLXP_PC") != -1){
|
|
|
|
|
if (window.navigator.userAgent.indexOf("GLXP_PC") != -1) {
|
|
|
|
|
this.scanDisabled = true;
|
|
|
|
|
window.removeEventListener('djcl', this.handleRecCodesEvent);
|
|
|
|
|
window.addEventListener('djcl', this.handleRecCodesEvent);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|