diff --git a/src/api/inout/order.js b/src/api/inout/order.js index 55a1d66c..415dbfa6 100644 --- a/src/api/inout/order.js +++ b/src/api/inout/order.js @@ -1,6 +1,15 @@ import axios from '@/utils/request' +export function getDraft(query) { + return axios({ + url: "/udiwms/inout/order/draft", + method: "get", + params: query + }); +} + + export function orderList(query) { return axios({ url: "/admin/warehouse/inout/order/list", diff --git a/src/api/inout/orderDetailCode.js b/src/api/inout/orderDetailCode.js new file mode 100644 index 00000000..ec87bc63 --- /dev/null +++ b/src/api/inout/orderDetailCode.js @@ -0,0 +1,19 @@ +import axios from '@/utils/request' + + +export function getDetailCodes(query) { + return axios({ + url: "/udiwms/inout/order/draft/detailCode", + method: "get", + params: query + }); +} + + +export function getDetailBizs(query) { + return axios({ + url: "/udiwms/inout/order/draft/detailBiz", + method: "get", + params: query + }); +} diff --git a/src/views/inout/IoCreateOrder.vue b/src/views/inout/IoCreateOrder.vue index 02335a0b..ed120043 100644 --- a/src/views/inout/IoCreateOrder.vue +++ b/src/views/inout/IoCreateOrder.vue @@ -179,13 +179,16 @@ - - + + + - + + + @@ -274,6 +277,8 @@ import {getLocalJoinByUser} from "../../api/basic/busType"; import codesPanel from "./IoCreateOrderCodes" +import codeDetailPanel from "./IoCreateOrderCodeDetail" +import bizDetailPanel from "./IoCreateOrderBizDetail" import A from "../../plugins/KeyScaner" import {isBlank} from "@/utils/strUtil"; import {filterDepts} from "@/api/auth/authDept"; @@ -319,35 +324,11 @@ export default { corpType: 0, genUnit: false, }, - + fromOptions: [], + isCodeAlive: true, editCodeVisible: false, - billAction: null, actionEnable: false, - // formData: { - // corpOrderId: "", - // code: "", - // actor: "", - // fromCorpId: "", - // fromCorp: null, - // fromType: 2, - // actDate: new Date(), - // action: null, - // locStorageCode: null, - // outChangeEnable: false, - // preCheck: false, - // batchNo: null, - // produceDate: null, - // expireDate: null, - // serialNo: null, - // invWarehouseCode: null, - // subInvCode: null, - // fromInvCode: null, - // codeFillCheck: null, - // vailInv: null, - // deptCode: null, - // - // }, editOriginCodeVisible: false, curId: null, storageList: [], @@ -367,7 +348,7 @@ export default { formVisible: false, deleteLoading: false, orderNo: null, - fromOptions: [], + fromStorageOptions: [], @@ -389,7 +370,7 @@ export default { components: { draggable, // DialogSelectUnit, selectRlDialog, editCodeDialog - codesPanel + codesPanel, codeDetailPanel, bizDetailPanel }, methods: { @@ -438,13 +419,11 @@ export default { page: 1, limit: 20 }; - if (this.curAction.corpType == 3) {//特殊往来 - cQuery.corpType = 4; - this.formData.fromCorpId = this.curAction.defaultUnit; - } else if (this.curAction.corpType == 2)//客户 + if (this.curAction.corpType == 3) {//内部科室 + cQuery.corpType = 3; + } else if (this.curAction.corpType == 2)//供应商信息 { - cQuery.corpType = 1; - cQuery.outType = 2; + cQuery.corpType = 2; } else if (this.curAction.corpType == 0) { cQuery.corpType = 2; } else return; @@ -529,6 +508,95 @@ export default { this.$refs.inputRef.select(); }, + //添加条码后提交 + addCodeSubmit(tQuery) { + addOrderWeb(tQuery).then((response) => { + if (response.code === 20000) { + this.idQuery.id = response.data.orderId; + if (response.data.errMsg != null) { + this.$alert(response.data.errMsg, '提示', { + confirmButtonText: '确定', + type: 'warning', + closeOnClickModal: true, + callback: action => { + } + }); + } + this.corpOrderIdDisabled = true; + this.refreshCodesPanel(); + this.$refs.inputRef.focus(); + this.$refs.inputRef.select(); + } else { + if (response.code == 502) { + this.curRow = response.data; + this.idQuery.id = this.curRow.orderId; + this.refreshCodesPanel(); + this.selectRlTitle = response.message; + this.bindRl(response.data); + } else if (response.code == 503) { + this.curRow = response.data; + this.idQuery.id = this.curRow.orderId; + this.refreshCodesPanel(); + this.selectUnitTitle = response.message; + this.handleUnitClick(response.data); + } else if (response.code == 504) { + + this.$confirm(response.message, "提示", { + confirmButtonText: "确定", + cancelButtonText: "忽略", + type: "error", + }).then(() => { + tQuery.ignoreExpire = true; + this.addCodeSubmit(tQuery) + }).catch(() => { + + }); + } else if (response.code == 505) { + this.$confirm(response.message, "提示", { + confirmButtonText: "确定", + cancelButtonText: "忽略", + type: "warning", + }).then(() => { + tQuery.ignoreRecentExpire = true; + this.addCodeSubmit(tQuery) + }).catch(() => { + + }); + } else if (response.code == 507) { + 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; + this.formData.serialNo = response.data.serialNo; + this.$message({ + type: 'error', + message: "提交失败!" + this.editTitle, + customClass: 'messageIndex' + }); + } else { + this.$alert(response.message, '提示', { + confirmButtonText: '确定', + type: 'warning', + closeOnClickModal: true, + callback: action => { + this.$refs.inputRef.focus(); + this.$refs.inputRef.select(); + } + }); + } + } + this.loading = false; + }); + }, + + refreshCodesPanel() { + this.isCodeAlive = false; + this.$nextTick(() => { //重新加载组件 + this.isCodeAlive = true + }) + }, + submit(formName) { if (this.total < 1) { @@ -669,86 +737,6 @@ export default { this.addCodeSubmit(tQuery); }, - addCodeSubmit(tQuery) { - addOrderWeb(tQuery).then((response) => { - if (response.code === 20000) { - this.idQuery.id = response.data.orderId; - if (response.data.errMsg != null) { - this.$alert(response.data.errMsg, '提示', { - confirmButtonText: '确定', - type: 'warning', - closeOnClickModal: true, - callback: action => { - } - }); - } - this.corpOrderIdDisabled = true; - this.getCodeList(); - this.$refs.inputRef.focus(); - this.$refs.inputRef.select(); - } else { - if (response.code == 502) { - this.curRow = response.data; - this.idQuery.id = this.curRow.orderId; - this.getCodeList(); - this.selectRlTitle = response.message; - this.bindRl(response.data); - } else if (response.code == 503) { - this.curRow = response.data; - this.idQuery.id = this.curRow.orderId; - this.getCodeList(); - this.selectUnitTitle = response.message; - this.handleUnitClick(response.data); - } else if (response.code == 504) { - - this.$confirm(response.message, "提示", { - confirmButtonText: "确定", - cancelButtonText: "忽略", - type: "error", - }).then(() => { - tQuery.ignoreExpire = true; - this.addCodeSubmit(tQuery) - }).catch(() => { - - }); - } else if (response.code == 505) { - this.$confirm(response.message, "提示", { - confirmButtonText: "确定", - cancelButtonText: "忽略", - type: "warning", - }).then(() => { - tQuery.ignoreRecentExpire = true; - this.addCodeSubmit(tQuery) - }).catch(() => { - - }); - } else if (response.code == 507) { - 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; - this.formData.serialNo = response.data.serialNo; - this.$message({ - type: 'error', - message: "提交失败!" + this.editTitle, - customClass: 'messageIndex' - }); - } else { - this.$alert(response.message, '提示', { - confirmButtonText: '确定', - type: 'warning', - closeOnClickModal: true, - callback: action => { - this.$refs.inputRef.focus(); - this.$refs.inputRef.select(); - } - }); - } - } - this.loading = false; - }); - }, getInputFocus(event) { @@ -855,52 +843,39 @@ export default { }, created() { this.formData.code = ''; - this.formData.actDate = new Date(); this.codeArray = []; - if (this.$isNotBlank(this.idQuery.id)) { + if (this.$isNotBlank(this.idQuery.billNo)) { this.formData.actDate = new Date(this.idQuery.actDate); this.formData.corpOrderId = this.idQuery.corpOrderId; this.corpOrderIdDisabled = true; this.formData.action = this.idQuery.action; this.formData.fromCorp = this.idQuery.fromCorp; this.formData.deptCode = this.idQuery.deptCode - this.formData.fromCorpId = this.idQuery.fromCorpId; - this.formData.locStorageCode = this.idQuery.locStorageCode; - this.formData.invWarehouseCode = this.idQuery.invWarehouseCode; + this.formData.invCode = this.idQuery.invCode; this.formData.fromInvCode = this.idQuery.fromInvCode; - this.formData.outChangeEnable = this.idQuery.outChangeEnable; this.formData.preCheck = this.idQuery.preCheck; + this.formData.remark = this.idQuery.remark; this.actionEnable = true; - this.getCodeList(); - this.findFromInvList(1); + this.refreshCodesPanel(); + //选择框候选数据 + this.findInvByUser(); + this.getBusTypeByInv(); + this.findMethod(this.formData.fromCorp); + this.findFromInvList(); } else { this.corpOrderIdDisabled = false; - if (JSON.stringify(this.$route.query) === '{}') { - // this.formData.corpOrderId = new Date().getTime() + (Math.ceil(Math.random() * 10 + 10) + ''); - let date = new Date(); - this.formData.corpOrderId = parseTime(date, '{y}{m}{d}{h}{i}{s}') + Math.ceil(Math.random() * 89 + 10); - } else { - // 将参数拷贝进查询对象 - 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.formData.invWarehouseCode = this.$store.getters.locSubInvCode; - this.formData.locStorageCode = this.$store.getters.locInvCode; + this.formData.actDate = new Date(); + let date = new Date(); + this.formData.corpOrderId = parseTime(date, '{y}{m}{d}{h}{i}{s}') + Math.ceil(Math.random() * 89 + 10); + this.formData.invCode = this.$store.getters.locInvCode; + this.findInvByUser(); } - this.findInvByUser(); - //查询是否启用多级仓库,判断是否启用部门 - selectSysParamByKey({paramKey: "muti_inv_mode"}).then((res) => { - if (res.code === 20000) { - if (res.data.paramValue === "0") { - this.enableDept = true; - } - } - }) - }, -}; + + + } + , +} +; diff --git a/src/views/inout/IoCreateOrderBizDetail.vue b/src/views/inout/IoCreateOrderBizDetail.vue index 35f6c816..4d8f8b5a 100644 --- a/src/views/inout/IoCreateOrderBizDetail.vue +++ b/src/views/inout/IoCreateOrderBizDetail.vue @@ -1,15 +1,272 @@ - + + + diff --git a/src/views/inout/IoCreateOrderCodeDetail.vue b/src/views/inout/IoCreateOrderCodeDetail.vue index 0356d0f5..2b00610c 100644 --- a/src/views/inout/IoCreateOrderCodeDetail.vue +++ b/src/views/inout/IoCreateOrderCodeDetail.vue @@ -1,12 +1,98 @@ diff --git a/src/views/inout/IoCreateOrderCodes.vue b/src/views/inout/IoCreateOrderCodes.vue index c93032c4..5b68e513 100644 --- a/src/views/inout/IoCreateOrderCodes.vue +++ b/src/views/inout/IoCreateOrderCodes.vue @@ -12,7 +12,7 @@ - + - +