diff --git a/src/common/utils/storage.js b/src/common/utils/storage.js index 515d413a..d4c6f93e 100644 --- a/src/common/utils/storage.js +++ b/src/common/utils/storage.js @@ -10,7 +10,21 @@ const setStorage = (key,value)=>{ // 清除全部本地存储 const clearStorage = ()=>{ - uni.clearStorageSync(); + const overPackageRecordPointParams = '' + if( uni.getStorageSync('overPackageRecordPointParams')){ + overPackageRecordPointParams = uni.getStorageSync('overPackageRecordPointParams') + } + const overPackageJobDetailPointParams = '' + if( uni.getStorageSync('overPackageJobDetailPointParams')){ + overPackageJobDetailPointParams = uni.getStorageSync('overPackageJobDetailPointParams') + } + uni.clearStorageSync(); + if(overPackageRecordPointParams){ + uni.setStorageSync('overPackageRecordPointParams',overPackageRecordPointParams) + } + if(overPackageJobDetailPointParams){ + uni.setStorageSync('overPackageJobDetailPointParams',overPackageJobDetailPointParams) + } } // 清除指定key本地存储 diff --git a/src/mycomponents/balance/balance.vue b/src/mycomponents/balance/balance.vue index a0084956..75fdf2a3 100644 --- a/src/mycomponents/balance/balance.vue +++ b/src/mycomponents/balance/balance.vue @@ -15,9 +15,9 @@ - + @@ -59,6 +58,10 @@ export default { bussinessCode: { type: String, default: '' + }, + verifyCategory: { + type: Boolean, + default: false } }, data() { @@ -152,11 +155,19 @@ export default { .then((res) => { if (res.data != null && res.data.list.length > 0) { const result = res.data.list[0] - const { status } = result + const status = result.available const { type } = result - if (status == 'ENABLE') { + if (status == 'TRUE') { if (checkDirectoryItemExist(this.itemTypesList, type)) { - callBack() + if (this.verifyCategory) { + if (result.category == 'LCJ' || result.category == 'BJ') { + callBack() + } else { + this.showErrorMessage('扫描物料的种类不是【量产件】或者【备件】') + } + } else { + callBack() + } } else { const hint = getListItemTypeDesc(this.itemTypesList) uni.hideLoading() @@ -197,6 +208,11 @@ export default { if (this.$refs.comscan) { this.$refs.comscan.getfocus() } + }, + losefocus() { + if (this.$refs.comscan) { + this.$refs.comscan.losefocus() + } } } } diff --git a/src/pages/fg/fgChange.vue b/src/pages/fg/fgChange.vue index f88007ab..de509f5f 100644 --- a/src/pages/fg/fgChange.vue +++ b/src/pages/fg/fgChange.vue @@ -6,60 +6,64 @@ - + - + + + 变更前物料 + + {{ currentPackage.itemCode }} + + + + 变更后物料 + + + {{ toItemCode }} + + + + + + + + 变更原因 + + + + + - - - - - - - - - 唯一码 - {{ item.remark }} - - - - - - - + + + + + + + + + - - - 变更后物料 - - - {{ toItemCode }} - - - - - - - - + - + - + - + @@ -85,6 +89,8 @@ import comBlankView from '@/mycomponents/common/comBlankView.vue' import PackageAndItemCard from '@/mycomponents/package/PackageAndItemCard.vue' import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' import winScanFgLabel from '@/mycomponents/scan/winScanFgLabel.vue' +import balance from '@/mycomponents/balance/balance.vue' +import light from '@/mycomponents/balance/light.vue' export default { components: { @@ -94,24 +100,20 @@ export default { comBlankView, PackageAndItemCard, winComScanBalance, - winScanFgLabel + winScanFgLabel, + balance, + light }, data() { return { - detailSource: [], // 绑定在页面上的数据源 - toLocationCode: '', - fromLocationTypeList: [], - fromLocationCode: '', + bussinessCode: 'Relegate', businessType: {}, - dataContent: {}, - managementList: [], show: false, toItemCode: '请选择变更后物料', toItemList: [], fgList: [], - options: [], currentPackage: null, - bussinessCode: 'Relegate' + reason: '' } }, mounted() {}, @@ -187,6 +189,7 @@ export default { .then((res) => { if (res.data.length > 0) { this.fgList = res.data + const pack = result.package const { balance } = result this.currentPackage = result.package @@ -209,29 +212,31 @@ export default { }, getFgScanResult(result) { - const that = this - const itemIndex = this.allList.findIndex((r) => r.content == result.content) + const item = this.fgList.find((r) => r.remark == result.content) // 不存在 - if (itemIndex == -1) { - // if (this.allList.length > this.dataContent.packQty) { - // this.showErrorMessage("唯一码数量不能大于计划数量") - // return; - // } - result.countTime = new Date() - this.allList.push(result) - this.allList.sort(compare('countTime')) // 按扫描信息排序 - this.initList() - this.scanPopupGetFocus() - this.calcFgQty() + if (item != undefined) { + const index = this.fgList.findIndex((r) => r.remark == result.content) + if (item.scaned == true) { + this.$refs.comMessage.showQuestionMessage(`灯码【${result.content}】已经扫描,是否移除`, (res) => { + if (res) { + item.scaned = false + this.fgList.splice(index, 1) + this.fgList.push(item) // 置底(); + } + }) + } else { + item.scaned = true + this.fgList.unshift(this.fgList.splice(index, 1)[0]) // 置顶(); + } + this.calcHandleQty() } else { - this.$refs.comMessage.showQuestionMessage(`唯一码【${result.content}】已经扫描,是否移除`, (res) => { - if (res) { - this.allList.splice(itemIndex, 1) - this.allList.sort(compare('countTime')) // 按扫描信息排序 - this.initList() - that.calcFgQty() - } - }) + this.showErrorMessage('扫描的灯码不在灯码列表中') + } + }, + + calcHandleQty() { + if (this.fgList.length > 0) { + this.currentPackage.handleQty = this.fgList.filter((r) => r.scaned == true).length } }, @@ -242,114 +247,43 @@ export default { }) }, + openScanFgPopup() { + setTimeout((r) => { + this.$refs.scanFgPopup.openScanPopup(this.currentPackage.itemCode) + this.scanFgPopupGetFocus() + }) + }, + commit() { - if (this.positionInfo == '请选择位置') { - this.showMessage('请先选择位置') + if (this.toItemCode == '请选择变更后物料') { + this.showMessage('请选择变更后物料') return } - - if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { - // 查询管理模式 - uni.showLoading({ - title: '提交中....', - mask: true - }) - this.managementList = [] - const precisionStrategParams = this.setPrecisionStrategParams() - - getPrecisionStrategyList(precisionStrategParams, (res) => { - if (res.success) { - this.managementList = res.list - const params = this.setParams() - console.log(`提交${JSON.stringify(params)}`) - productionReceiptRecordSubmit(params) - .then((res) => { - uni.hideLoading() - if (res.data) { - this.showCommitSuccessMessage(`提交成功
生成制品收货记录
${res.data}`) - } else { - this.showErrorMessage(`提交失败[${res.msg}]`) - } - }) - .catch((error) => { - uni.hideLoading() - this.showErrorMessage(error) - }) - } else { - uni.hideLoading() - this.showErrorMessage(res.message) + if (this.currentPackage.handleQty == null) { + this.$refs.comMessage.showQuestionMessage('是否要将全部灯码进行变更?', (res) => { + if (res) { + this.commitRecord() } }) } else { - this.showErrorMessage('没有要提交的数据,请先扫描') - } - }, - setPrecisionStrategParams() { - const itemList = [] - this.detailSource.forEach((item) => { - item.subList.forEach((detail) => { - if (detail.scaned) { - detail.toLocationCode = this.fgLocationCode - const filterResult = itemList.filter((res) => { - if (res.itemCode == item.itemCode && detail.toLocationCode == res.locationCode) { - return res - } - }) - // 去掉重复元素 - if (filterResult.length == 0) { - const result = { - itemCode: item.itemCode, - locationCode: detail.toLocationCode - } - itemList.push(result) - } + this.$refs.comMessage.showQuestionMessage(`是否要将已扫描的【${this.currentPackage.handleQty}】个灯码进行变更?`, (res) => { + if (res) { + this.commitRecord() } }) - }) - return itemList + } + }, + commitRecord() { + // this.showCommitSuccessMessage('提交成功') }, setParams() { - const subList = [] - const creator = this.$store.state.user.id - this.detailSource.forEach((item) => { - item.subList.forEach((detail) => { - if (detail.scaned) { - const submitItem = deepCopyData(detail) - const info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, detail.packingNumber, detail.toLocationCode, detail.batch) - submitItem.itemCode = detail.itemCode - submitItem.itemName = detail.package.itemName - submitItem.itemDesc1 = detail.package.itemDesc1 - submitItem.itemDesc2 = detail.package.itemDesc2 - - submitItem.inventoryStatus = detail.inventoryStatus - - submitItem.fromPackingNumber = info.packingNumber - submitItem.toPackingNumber = info.packingNumber - - submitItem.fromContainerNumber = detail.containerNumber - submitItem.toContainerNumber = detail.containerNumber - - submitItem.fromBatch = info.batch - submitItem.toBatch = info.batch - - submitItem.fromLocationCode = detail.locationCode - submitItem.toLocationCode = detail.toLocationCode - - submitItem.productionlineCode = this.productionLineCode - submitItem.workStationCode = this.workStationCode - - submitItem.qty = detail.handleQty - submitItem.package = '' + let scanedList = this.fgList.filter((r) => r.scaned == true) + if (this.currentPackage.handleQty > 0) { + scanedList = this.fgList.filter((r) => r.scaned == true) + } - subList.push(submitItem) - } - }) - }) - this.dataContent.subList = subList - this.dataContent.creator = creator - this.dataContent.workshopCode = this.workshopCode - return this.dataContent + const creator = this.$store.state.user.id }, showMessage(message) { @@ -384,6 +318,12 @@ export default { } }, + scanFgPopupGetFocus() { + if (this.$refs.scanFgPopup != undefined) { + this.$refs.scanFgPopup.getfocus() + } + }, + scanPopupLoseFocus() { if (this.$refs.scanPopup != undefined) { this.$refs.scanPopup.losefocus() @@ -401,28 +341,15 @@ export default { showCommitSuccessMessage(hint) { this.$refs.comMessage.showSuccessMessage(hint, (res) => { this.clearData() + this.openScanPopup() }) }, clearData() { - this.subList = [] - this.detailSource = [] - this.toLocationCode = '' - this.dataContent = {} - this.positionInfo = '请选择位置' - this.fgLocationCode = '' - }, - removePack() { - for (let i = 0; i < this.detailSource.length; i++) { - const item = this.detailSource[i] - if (item.subList.length == 0) { - this.detailSource.splice(i, 1) - } - } - this.updateData() - }, - - removeItem(index, item) { - this.detailSource.splice(index, 1) + this.toItemCode = '请选择变更后物料' + this.toItemList = [] + this.fgList = [] + this.currentPackage = null + this.reason = '' }, showSelect() { diff --git a/src/pages/fg/receiptByPlan.vue b/src/pages/fg/receiptByPlan.vue index d38f7305..b35babd9 100644 --- a/src/pages/fg/receiptByPlan.vue +++ b/src/pages/fg/receiptByPlan.vue @@ -42,7 +42,7 @@ {{ dataContent.handleQty }}/ - {{ dataContent.packQtyHint }} + {{ dataContent.packQtyHint }} @@ -54,11 +54,12 @@ - - + + + @@ -100,6 +101,7 @@ import batch from '@/mycomponents/balance/batch.vue' import pack from '@/mycomponents/balance/pack.vue' import winScanFgLabel from '@/mycomponents/scan/winScanFgLabel.vue' import comFgCard from '@/pages/productReceipt/coms/comFgCard.vue' +import light from '@/mycomponents/balance/light.vue' const dataContent = ref(null) const options = ref([]) diff --git a/src/pages/fg/receiptNoPlan.vue b/src/pages/fg/receiptNoPlan.vue index ddb6293c..8970a669 100644 --- a/src/pages/fg/receiptNoPlan.vue +++ b/src/pages/fg/receiptNoPlan.vue @@ -31,7 +31,8 @@ {{ dataContent.handleQty }}/ - {{ dataContent.packQtyHint }} + + {{ dataContent.packQtyHint }} @@ -42,11 +43,12 @@ - - - 唯一码 - {{ item.content }} - + + + @@ -87,6 +89,7 @@ import batch from '@/mycomponents/balance/batch.vue' import pack from '@/mycomponents/balance/pack.vue' import winScanFgLabel from '@/mycomponents/scan/winScanFgLabel.vue' import comFgCard from '@/pages/productReceipt/coms/comFgCard.vue' +import light from '@/mycomponents/balance/light.vue' export default { components: { @@ -97,7 +100,8 @@ export default { pack, winScanButton, winScanFgLabel, - comFgCard + comFgCard, + light }, data() { return { diff --git a/src/pages/package/job/overPackageJobDetail.vue b/src/pages/package/job/overPackageJobDetail.vue index 5cc5e384..7850f6d4 100644 --- a/src/pages/package/job/overPackageJobDetail.vue +++ b/src/pages/package/job/overPackageJobDetail.vue @@ -1,5 +1,8 @@