diff --git a/src/views/inout/IOAddOrder.vue b/src/views/inout/IOAddOrder.vue index 44ccb02..d85544d 100644 --- a/src/views/inout/IOAddOrder.vue +++ b/src/views/inout/IOAddOrder.vue @@ -3,7 +3,6 @@ - -
@@ -49,7 +47,6 @@ -
单据类型: @@ -73,28 +70,29 @@
- 当前分库: + 当前仓库:
- + {{ item.name }} - {{ item.warehouseName }} + {{ + item.warehouseName + }} - @@ -120,6 +118,7 @@ :loading="loading" :disabled="corpOrderIdDisabled" @change="unitChange" + @focus="findMethod('')" > - {{ item.name }} - {{ item.warehouseName }} + {{ + item.warehouseName + }} @@ -158,7 +159,10 @@ placeholder="请输入病人住院号" > + + + @@ -194,27 +198,27 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + +
@@ -246,12 +250,9 @@ - - -
条码数量:{{ total }} @@ -357,6 +358,8 @@ @@ -385,9 +390,9 @@ { @@ -561,11 +571,16 @@ export default { }); }, saveOrder() { + if (this.total < 1) { + this.$message.error('未添加条码'); + return; + } if (this.formData.action == null || this.formData.action == '') { this.$message.error('未选择扫码单据类型'); return } + if (this.formData.invWarehouseCode == null || this.formData.invWarehouseCode == '') { this.$message.error('当前分库不能为空'); return; @@ -583,7 +598,6 @@ export default { }); }, closeCodeDialog() { - //编辑完,获取编辑之后的条码 this.editCodeVisible = false; this.editOriginCodeVisible = false; this.getCodeList(); @@ -610,7 +624,6 @@ export default { code: this.formData.code.trim(), } enterCodeWeb(tQuery).then((response) => { - if (response.code === 20000) { this.$refs.inputRef.focus(); this.$refs.inputRef.select(); @@ -643,6 +656,7 @@ export default { } else if (response.code == 508) { this.originCode = ""; this.formData.code = "01" + response.data.nameCode; + this.originCode = this.formData.code; } else { this.$alert(response.message, '提示', { confirmButtonText: '确定', @@ -659,7 +673,6 @@ export default { }); }, addCode(event) { - this.originCode = ""; this.sictomText = ""; this.formData.corpOrderId = this.formData.corpOrderId.trim(); @@ -667,10 +680,9 @@ export default { this.formData.produceDate = ""; this.formData.expireDate = ""; this.formData.serialNo = ""; - if (event != null) { - event.target.select(); - } this.actionEnable = true; + if (event == null) { + } else event.target.select(); this.$refs.inputRef.select(); if (this.$isBlank(this.formData.action)) { this.$message.warning("请选择单据类型!"); @@ -682,11 +694,6 @@ export default { return; } - // if (this.$isBlank(this.formData.fromCorp)) { - // this.$message.error('当前往来单位不能为空'); - // return; - // } - if (this.curAction.corpType == 1) { if (this.$isBlank(this.formData.fromSubInvCode)) { this.$message.error('当前往来分库不能为空'); @@ -720,7 +727,6 @@ export default { }, addCodeSubmit(tQuery) { - addOrderWeb(tQuery).then((response) => { if (response.code === 20000) { this.idQuery.id = response.data.orderId; @@ -774,8 +780,8 @@ export default { }); } else if (response.code == 507) { - this.editTitle = response.message; this.editOriginCodeVisible = true; + this.editTitle = response.message; this.formData.produceDate = response.data.produceDate; this.formData.expireDate = response.data.expireDate; this.formData.batchNo = response.data.batchNo; @@ -786,6 +792,10 @@ export default { message: "提交失败!" + this.editTitle, customClass: 'messageIndex' }); + + // this.$message.error("提交失败!" + this.editTitle); + + } else { this.$alert(response.message, '提示', { confirmButtonText: '确定', @@ -793,6 +803,7 @@ export default { closeOnClickModal: true, callback: action => { this.$refs.inputRef.focus(); + this.$refs.inputRef.select(); } }); } @@ -806,13 +817,14 @@ export default { this.formData.fromCorp = row.name; this.curRow = row; }, - storageChange(row) { - this.formData.fromSubInvCode = ""; - this.formData.fromCorpId = row.code; + getFormStorageCode(code) { + var row= this.fromSubStorageOptions.find(item => item.code == code) + this.formData.fromSubInvCode = row.code + this.formData.fromCorpId = row.parentId; this.formData.fromCorp = row.name; - this.findSubStorageMethod(); }, + deleteCode(index, row) { this.$confirm("是否确定移除一个条码?", "提示", { confirmButtonText: "确定", @@ -876,53 +888,48 @@ export default { this.$router.go(-1); }, getBusType() { - this.formData.billType=null; let query = { code: this.formData.invWarehouseCode, enabled: true, + type: 1 }; - if (isBlank(query.code)) { - query.code = this.$store.getters.locSubInvCode; - } getLocalJoinByUser(query) .then((response) => { - - this.busTypes = response.data.list || []; - if (this.formData.action != null) { - this.curAction = this.getActionItem(this.formData.action); - if (this.curAction != null) { - this.formData.vailInv = this.curAction.vailInv; - this.formData.codeFillCheck = this.curAction.codeFillCheck; - } + this.busTypes = response.data.list || []; + if (this.formData.action != null) { + this.curAction = this.getActionItem(this.formData.action); + if (this.curAction != null) { + this.formData.vailInv = this.curAction.vailInv; + this.formData.codeFillCheck = this.curAction.codeFillCheck; } else { this.curAction = {corpType: 0, genUnit: false, changeEnable: false,}; this.formData.action = null; } + } - ) + }) .catch(() => { }); }, - subStorageChange() { - this.getBusType(); - }, + geActionName(action) { this.busTypes.forEach((obj) => { if (obj.action == action) { return obj.name; } }); - } - , + }, locCHange() { + if (this.$isNotBlank(this.formData.invWarehouseCode)) { this.formData.invWarehouseCode = ""; } this.findStorageMethod(); this.findSubInvByInv(this.formData.locStorageCode); - } - , + }, + + findMethod(query) { this.fromOptions = []; @@ -959,13 +966,41 @@ export default { .catch(() => { this.loading = false; }); - } - , + }, + findDeptMethod() { + let query = { + flag: 1 + }; + filterDepts(query) + .then((response) => { + this.loading = false; + this.fromDeptOptions = response.data.list || []; + }) + .catch(() => { + this.loading = false; + this.fromDeptOptions = []; + }); + }, + + + findStorageMethod() { + + if (this.formData.locStorageCode == null) + return; + this.fromStorageOptions = []; + let cQuery = { + locInvCode: this.formData.locStorageCode, + }; + filterAllByLoc(cQuery) + .then((response) => { + this.fromStorageOptions = response.data || []; + }) + .catch(() => { + }); + }, - findSubStorageMethod() { - this.formData.invStorageCode= this.subInvList.find(item => item.code == this.formData.invWarehouseCode).parentId - this.formData.locStorageCode= this.subInvList.find(item => item.code == this.formData.invWarehouseCode).parentId + findSubStorageMethod(val) { this.getBusType(); let cQuery = { code: this.formData.invWarehouseCode, @@ -973,48 +1008,45 @@ export default { }; filterSubByInv(cQuery) .then((response) => { + this.fromSubStorageOptions = response.data || []; + if (val == 1) { + + } else + this.formData.fromSubInvCode = this.fromSubStorageOptions[0].code; }) .catch(() => { }); - } - , - getFormCorp(){ - this.formData.subInvCode= this.fromSubStorageOptions.find(item => item.code == this.formData.fromSubInvCode).parentId - this.formData.fromCorp=this.fromSubStorageOptions.find(item => item.code == this.formData.fromSubInvCode).warehouseName - this.formData.fromCorpId=this.fromSubStorageOptions.find(item => item.code == this.formData.fromSubInvCode).code }, - findSubInvByInv(invCode) { + + findSubInvByInv() { + this.subInvList = []; let query = { - filter:3 + filter: 3 }; + filterSubByInv(query) .then((response) => { this.subInvList = response.data || []; - if (this.subInvList != null) { + if (this.subInvList != null && this.subInvList.length == 1) { + this.formData.invWarehouseCode = this.subInvList[0].code; this.getBusType(); - this.findSubStorageMethod(); } }) .catch(() => { }); - } - , + }, - findDeptMethod() { - let query = { - flag: 1 - }; - filterDepts(query) + + getStorage(event) { + this.storageList = []; + filterAllByUser() .then((response) => { - this.loading = false; - this.fromDeptOptions = response.data.list || []; + this.storageList = response.data || []; }) .catch(() => { - this.loading = false; - this.fromDeptOptions = []; }); }, getActionName(action) { @@ -1023,16 +1055,14 @@ export default { return this.busTypes[i].advanceType; } } - } - , + }, getActionItem(action) { for (let i = 0; i < this.busTypes.length; i++) { if (this.busTypes[i].action == action) { return this.busTypes[i]; } } - } - , + }, actionChange(item) { this.curAction = this.getActionItem(item); @@ -1042,21 +1072,25 @@ export default { this.$set(this.formData, "preCheck", this.curAction.scanPreIn); this.$set(this.formData, "outChangeEnable", this.curAction.ullageFill); this.$set(this.formData, "codeFillCheck", this.curAction.codeFillCheck); + this.formData.fromCorp = null; + this.formData.fromSubInvCode = null; - } - , + // this.formData.vailIn = this.curAction.vailInv; + // this.formData.preCheck = this.curAction.scanPreIn; + // this.formData.outChangeEnable = this.curAction.ullageFill; + // this.formData.codeFillCheck = this.curAction.codeFillCheck; + + }, -//绑定数据 + //绑定数据 bindRl(val) { this.curRow = val; this.selectRlVisible = true; - } - , + }, handleUnitClick(row) { this.curRow = row; this.dialogTableVisible = true; - } - , + }, selectSupUnit(row) { let query = { id: this.curRow.id, @@ -1073,8 +1107,7 @@ export default { }).catch(() => { }); - } - , + }, selectBindRl(row) { @@ -1101,30 +1134,25 @@ export default { }).catch(() => { }); - } - , + }, closeBindDialog(val) { this.selectRlVisible = false; this.dialogTableVisible = false; - } - , + }, rowStyle({row, rowIndex}) { let rowBackground = {}; if (!this.$isNotBlank(row.supId) || !this.$isNotBlank(row.relId)) { - //rowBackground.background="#f6f5ee"; rowBackground.color = '#f60303'; } return rowBackground; - } - , + }, }, - filters: {} - , + filters: {}, mounted() { document.body.ondrop = function (event) { event.preventDefault(); @@ -1155,16 +1183,13 @@ export default { }; inputer.focus(); - } - , + }, created() { this.formData.code = ''; this.formData.actDate = new Date(); this.codeArray = []; - - - + this.getStorage(this.formData.action); if (this.$isNotBlank(this.idQuery.id)) { this.formData.actDate = new Date(this.idQuery.actDate); this.formData.corpOrderId = this.idQuery.corpOrderId; @@ -1179,7 +1204,7 @@ export default { this.formData.preCheck = this.idQuery.preCheck; this.actionEnable = true; this.getCodeList(); - this.findSubStorageMethod(); + this.findSubStorageMethod(1); } else { this.corpOrderIdDisabled = false; if (JSON.stringify(this.$route.query) === '{}') { @@ -1190,18 +1215,20 @@ export default { // 将参数拷贝进查询对象 let query = this.$route.query; this.orderNo = query.id; - this.query = Object.assign(this.query, query); this.query.limit = parseInt(this.query.limit); this.query.corpOrderId = query.id; - // 加载表格数据 - // this.getCodeList(); } this.formData.invWarehouseCode = this.$store.getters.locSubInvCode; - this.formData.invStorageCode=this.$store.getters.locInvCode; this.formData.locStorageCode = this.$store.getters.locInvCode; + if (this.$isNotBlank(this.formData.locStorageCode)) { + this.findStorageMethod(); + } } - this.findSubInvByInv(this.formData.locStorageCode); + this.findSubInvByInv(); + this.findSubStorageMethod(); + this.getBusType(); + //查询是否启用多级仓库,判断是否启用部门 selectSysParamByKey({paramKey: "muti_inv_mode"}).then((res) => { if (res.code === 20000) { @@ -1210,13 +1237,13 @@ export default { } } }) - } + + }, };