From 46dd7ab5e4c62276390ec404a93fb97f4568c0f6 Mon Sep 17 00:00:00 2001 From: yewj Date: Mon, 23 Dec 2024 20:58:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BD=8D=E4=B8=8A=E8=B4=A7=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/collect/IoCreateOrder.vue | 238 +++++++--------------------- 1 file changed, 60 insertions(+), 178 deletions(-) diff --git a/src/views/collect/IoCreateOrder.vue b/src/views/collect/IoCreateOrder.vue index 059f3997..01bb6c3b 100644 --- a/src/views/collect/IoCreateOrder.vue +++ b/src/views/collect/IoCreateOrder.vue @@ -62,68 +62,6 @@ - - - - - - - - - - - - - - - - - {{ item.name }} - {{ - item.warehouseName - }} - - - - - - - - - - @@ -354,8 +292,15 @@ import { submitOrderWeb, saveOrderWeb, deleteByOrderId, - enterCodeWeb, submitAllocateBiz, rollbackWaitcheck, submitCodeResult, submitCheckResult, delmitBiz, - batchVailCode, batchAddCode, batchAddCodeByOrderFinish, upProcessing, getProcessingOrder + enterCodeWeb, + submitAllocateBiz, + rollbackWaitcheck, + submitCodeResult, + submitCheckResult, + batchVailCode, + batchAddCode, + batchAddCodeByOrderFinish, + upProcessing } from '@/api/inout/order' import {filterSubAll, findByFrom, findInvByUser} from '@/api/system/invSubWarehouse' import {parseTime} from '@/utils/coTools' @@ -384,6 +329,33 @@ import {getWorkBindBusTypes} from '@/api/basic/workPlace/sysWorkplaceDocuments' import {filterWorkOptimize} from '@/api/basic/workPlace/sysWorkplaceManage' import {getByCode} from "@/api/basic/workPlace/SysWorkplaceQueue"; +// 常量定义 +const SCAN_TIMEOUT = 1000 +const ACTION_TYPES = { + BIZ: 'biz', + CODES: 'codes' +} + +// 工具方法 +const utils = { + isValidJson(str) { + try { + JSON.parse(str) + return true + } catch (e) { + return false + } + } +} + +// 错误处理 +const errorHandler = { + handle(error) { + console.error(error) + this.$message.error(error.message) + } +} + export default { name: 'ioCreateOrder', props: { @@ -417,11 +389,6 @@ export default { type: Object, required: true }, - splitBusType: {//科室拆零单据类型 - type: Object, - default: null, - required: true - }, dialogTitle: {//科室拆零单据类型 type: Object, @@ -450,8 +417,9 @@ export default { }, data() { return { - queueStatus: null, // 1:货位功能开启 0:货位功能关闭 + queueStatus: null, busTypeList: [], + splitBusType: null, busQuery: { busKey: '', workplaceCode: null, @@ -762,39 +730,11 @@ export default { this.orderFormData.curSpaceCode = false this.orderFormData.checkPreInSpaceCode = false this.orderFormData.preCurSpaceCode = false - this.getBusTypeByInv() this.findCurSpaceList(row) this.orderFormData.workPlaceCode = null this.findCurWorkPlaces() }, - //根据仓库,用户获取单据类型 - getBusTypeByInv() { - let query = { - code: this.orderFormData.invCode, - editType: 2 //可编辑 - } - if (this.viewTypeKsck) { - query = { - code: this.orderFormData.invCode, - editType: 2, //可编辑 - useDyCount: 2 //可编辑 - } - } - - findByInvUser(query) - .then((response) => { - this.busTypeOptions = response.data || [] - if (this.splitBusType != null) { - this.orderFormData.action = this.splitBusType - } else if (this.busTypeOptions.length == 1) { - this.orderFormData.action = this.busTypeOptions[0].action - this.actionChange(this.orderFormData.action) - } - }) - .catch(() => { - }) - }, //关闭预选单弹框 closeDialogtwo() { this.selectorder = false @@ -923,85 +863,6 @@ export default { }) }, - //单据类型改变 - actionChange(item) { - this.orderFormData.checkPreInOption = null - if (!this.viewTypeKsck) { - this.orderFormData.checkPreInOrders = null - this.checkPreInArray = [] - } - this.curAction = this.getActionItem(item) - if ((this.curAction.checkEnable && this.curAction.checkWebNew != 0) || this.viewType == 1) { - //单据类型需要一次校验 或 单据类型为1,显示业务单据页面 - this.bizShow = true - } else { - this.bizShow = false - } - if ( - this.curAction.corpType == 0 || - this.curAction.corpType == 2 || - this.curAction.corpType == 4 || - (this.curAction.corpType == 1 && !this.curAction.genUnit) - ) { - //1.切换往来单位 - this.orderFormData.fromCorp = null - - this.delorderData() - - this.findMethod() - } else if (this.curAction.corpType == 3) { - //2. 切换往来仓库 - this.orderFormData.fromInvCode = null - this.findFromInvList() - } - if (this.curAction.scanPreIn && this.curAction.backPreinType == 1 && this.curAction.preInBack) { - this.documentShow = true - } else if (this.curAction.scanPreIn && this.curAction.backPreinType == 2 && this.curAction.preInBack) { - this.preInSpaceShow = true - this.findPreInInvList() - } else { - this.documentShow = false - this.preInSpaceShow = false - } - - if (this.curAction.vailPrescribe != null && this.curAction.vailPrescribe) { - this.viewSickVisible = true - } else { - this.viewSickVisible = false - } - - if (this.curAction.scanPreIn && this.curAction.spaceOut == 1) { - this.preInSpaceShow = true - this.curSpaceShow = false - this.preSpaceShow = false - this.orderFormData.curSpaceCode = null - this.orderFormData.checkPreInSpaceCode = null - this.orderFormData.preCurSpaceCode = null - this.findPreInSpaceList() - } else if (this.curAction.advancePreIn && this.curAction.spaceOut == 1) { - this.preInSpaceShow = false - this.curSpaceShow = false - this.preSpaceShow = true - this.orderFormData.curSpaceCode = null - this.orderFormData.checkPreInSpaceCode = null - this.orderFormData.preCurSpaceCode = null - this.findPreSpaceList() - } else if (this.curAction.spaceOut == 1) { - this.curSpaceShow = true - this.preInSpaceShow = false - this.preSpaceShow = false - this.orderFormData.curSpaceCode = null - this.orderFormData.checkPreInSpaceCode = null - this.orderFormData.preCurSpaceCode = null - } else { - this.curSpaceShow = false - this.preInSpaceShow = false - this.preSpaceShow = false - this.orderFormData.curSpaceCode = null - this.orderFormData.checkPreInSpaceCode = null - this.orderFormData.preCurSpaceCode = null - } - }, //获取往来仓库列表 findFromInvList(val) { @@ -1165,6 +1026,8 @@ export default { this.$message.warning('请选择单据类型!') return } + console.log(this.curAction) + console.log(this.splitBusType) if (this.splitBusType != null) { this.orderFormData.fromCorp = '72198012799726' } @@ -2140,8 +2003,10 @@ export default { if (this.splitType == 'search') { } else if (this.splitType == 'out') { this.orderFormData.action = 'SC72197936495755' + this.getBusType(); } else if (this.splitType == 'return') { this.orderFormData.action = 'SC72249388338364' + this.getBusType(); } this.orderFormData.fromCorp = '72198012799726' @@ -2159,7 +2024,7 @@ export default { this.curAction = {} this.refreshCodesPanel() this.findInvListByUser() - this.initBusType() + // this.initBusType() this.findFromInvList() // this.getWorkBindBusTypes(null); } else { @@ -2302,6 +2167,23 @@ export default { } }) }, + + getBusType() { + let query = { + action: this.orderFormData.action, + page: 1, + limit: 10 + } + getBusTypeList(query) + .then((response) => { + this.busTypes = response.data.list || [] + this.splitBusType = this.busTypes[0].busType + console.log('==busTypes==', this.busTypes) + }) + .catch(() => { + }) + }, + handleScanComplete(fullScanData) { if (this.queueStatus == "1" && !this.orderFormData.workPlaceQueueCode) { if (fullScanData != null && fullScanData[0].includes("DMQ")) {