Browse Source

修改发料和发料记录箱码重复校验

intex
lijuncheng 5 days ago
parent
commit
d6da3ee64a
  1. 13
      src/api/request2.js
  2. 8
      src/mycomponents/recommend/recommend.vue
  3. 8
      src/pages/issue/coms/comIssueDetailCardBatch.vue
  4. 1807
      src/pages/issue/job/issueDetailBatch.vue
  5. 85
      src/pages/issue/record/directIssueByBatch.vue
  6. 1
      src/pages/issue/request/issueScanRequest.vue

13
src/api/request2.js

@ -1528,6 +1528,19 @@ export function getIssueJobDetail(id) {
}); });
} }
/**
* 发料校验
* @param {*} 任务id
*
*/
export function issueCheck(packNumber) {
return request({
url: baseApi + "/wms/issue-record-main/selectRecordByPackNumber?packNumber=" + packNumber,
method: "get",
data: {},
});
}
/** /**
* 获取推荐明细接口 * 获取推荐明细接口

8
src/mycomponents/recommend/recommend.vue

@ -5,7 +5,7 @@
<view style="word-break: break-all;"> <view style="word-break: break-all;">
<!-- <container v-if="isShowContainer&&detail.containerNumber!=null" :container="detail.containerNumber"> <!-- <container v-if="isShowContainer&&detail.containerNumber!=null" :container="detail.containerNumber">
</container> --> </container> -->
<pack v-if="isShowPack && detail.packingNumber" :packingCode="detail.packingNumber"></pack> <pack v-if="isShowPack && detail.packingNumber" :isShowPackingNumberProps="isShowPackingNumberProps" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch && detail.batch!=null" :batch="detail.batch"></batch> <batch v-if="isShowBatch && detail.batch!=null" :batch="detail.batch"></batch>
<location v-if="isShowFromLocation" :title="formLocationTitle" :locationCode="detail.fromLocationCode"> <location v-if="isShowFromLocation" :title="formLocationTitle" :locationCode="detail.fromLocationCode">
</location> </location>
@ -94,6 +94,12 @@
type: String, type: String,
default: '来源库位' default: '来源库位'
}, },
isShowPackingNumberProps: {
type: Boolean,
default: false
},
}, },
watch: { watch: {

8
src/pages/issue/coms/comIssueDetailCardBatch.vue

@ -16,7 +16,7 @@
<uni-swipe-action-item <uni-swipe-action-item
:right-options="(item.scaned&&settingParam.allowModifyQty == 'TRUE')?editAndRemoveOptions : item.scaned? removeOptions:[]" @click="itemCoceClick($event,item,index)"> :right-options="(item.scaned&&settingParam.allowModifyQty == 'TRUE')?editAndRemoveOptions : item.scaned? removeOptions:[]" @click="itemCoceClick($event,item,index)">
<view class="" :class="item.scaned?'scan_view':''"> <view class="" :class="item.scaned?'scan_view':''">
<recommend :detail="item" :isShowLocation="false" :isShowFromLocation="true" :isShowToLocation="settingParam.allowModifyLocation=='TRUE'"></recommend> <recommend :isShowPackingNumberProps="true" :isShowPack="true" :detail="item" :isShowLocation="false" :isShowFromLocation="true" :isShowToLocation="item.isRecommTaskItem?true:false"></recommend>
</view> </view>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
@ -79,6 +79,12 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
isShowPackingNumberProps: {
type: Boolean,
default: true
},
}, },
watch: { watch: {

1807
src/pages/issue/job/issueDetailBatch.vue

File diff suppressed because it is too large

85
src/pages/issue/record/directIssueByBatch.vue

@ -12,8 +12,7 @@
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" <record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowFromLocation="true" @removeItem="removeItem(index,item)" :isShowFromLocation="true" @removeItem="removeItem(index,item)"
:isShowToLocation="false" :isShowParentToLocation="false" @updateData="updateData" :isShowToLocation="false" :isShowParentToLocation="false" @updateData="updateData"
:allowModifyQty="true" :allowModifyQty="true" :isShowPackingNumberProps="true" @removePack="removePack">
@removePack="removePack">
</record-com-detail-card> </record-com-detail-card>
</view> </view>
@ -48,7 +47,7 @@
<!-- <winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode"> <!-- <winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode">
</winComScanBalance> --> </winComScanBalance> -->
<fifoQuery ref="refFifoQuery" :businessTypeCode="businessTypeCode"></fifoQuery> <fifoQuery ref="refFifoQuery" :businessTypeCode="businessTypeCode"></fifoQuery>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
@ -57,7 +56,8 @@
import { import {
issueRecordSubmit, issueRecordSubmit,
getWorkShopLineStation, getWorkShopLineStation,
getBalanceByFilter getBalanceByFilter,
issueCheck
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
@ -104,7 +104,7 @@
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
import fifoQuery from '@/mycomponents/query/fifoQuery.vue' import fifoQuery from '@/mycomponents/query/fifoQuery.vue'
export default { export default {
components: { components: {
@ -142,7 +142,7 @@
resultData: {}, resultData: {},
itemCode: "", itemCode: "",
managementType: '', managementType: '',
fifoSwitch:false fifoSwitch: false
}; };
}, },
onLoad(option) { onLoad(option) {
@ -197,13 +197,36 @@
}); });
}, },
getScanResult(result, managementTypeParams) { getScanResult(result, managementTypeParams) {
this.managementType = managementTypeParams this.managementType = managementTypeParams
if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") { // if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") {
this.setDataBatch(result); // this.setDataBatch(result);
} else { // } else {
this.setData(result); // this.setData(result);
// }
if(!result.package.number){
this.showErrorMessage("包装号不能为空")
return;
} }
uni.showLoading({
title:"校验中...",
mask:true
})
//
issueCheck(result.package.number).then(res=>{
uni.hideLoading()
if(res.data.length==0){
this.setData(result);
}else {
this.showErrorMessage("箱码["+result.package.number+"]已经发过料")
}
}).catch(error=>{
uni.hideLoading()
this.showErrorMessage(error.message)
})
}, },
async setData(result) { async setData(result) {
let balance = result.balance; let balance = result.balance;
@ -217,11 +240,12 @@
if (item == undefined) { if (item == undefined) {
var itemp = createItemInfo(balance, pack); var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); // let newDetail = createDetailInfo(balance, pack); //
newDetail.packingNumber = pack.number
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp)
} else { } else {
var detail = item.subList.find(r => { var detail = item.subList.find(r => {
if (r.packingNumber == balance.packingNumber && if (r.packingNumber == pack.number &&
r.batch == balance.batch && r.batch == balance.batch &&
r.locationCode == balance.locationCode && r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) { r.inventoryStatus == balance.inventoryStatus) {
@ -230,17 +254,18 @@
}) })
if (detail == undefined) { if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack); let newDetail = createDetailInfo(balance, pack);
newDetail.packingNumber = pack.number
item.subList.push(newDetail); item.subList.push(newDetail);
} else { } else {
if (detail.scaned == true) { if (detail.scaned == true) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]重复扫描") this.showErrorMessage("箱码[" + pack.number + "]已经扫描")
} }
} }
} }
calcHandleQty(this.detailSource) calcHandleQty(this.detailSource)
}, },
setDataBatch(result) { setDataBatch(result) {
let balance = result.balance; let balance = result.balance;
let label = result.label; let label = result.label;
let pack = result.package; let pack = result.package;
@ -251,8 +276,9 @@
}) })
if (item == undefined) { if (item == undefined) {
var itemp = createItemInfo(balance, pack); var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack,label); let newDetail = createDetailInfo(balance, pack, label);
newDetail.handleQty =label.qty newDetail.handleQty = label.qty
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp)
} else { } else {
@ -264,14 +290,15 @@
} }
}) })
if (detail == undefined) { if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack,label); let newDetail = createDetailInfo(balance, pack, label);
newDetail.handleQty =label.qty newDetail.handleQty = label.qty
newDetail.packingNumber = pack.number
item.subList.push(newDetail); item.subList.push(newDetail);
} else { } else {
detail.handleQty =calc.add(detail.handleQty, result.label.qty) detail.handleQty = calc.add(detail.handleQty, result.label.qty)
} }
} }
calcHandleQty(this.detailSource) calcHandleQty(this.detailSource)
}, },
@ -395,17 +422,18 @@
this.showErrorMessage("请选择生产线") this.showErrorMessage("请选择生产线")
return return
} }
var commitHint="" var commitHint = ""
this.detailSource.forEach((item) => { this.detailSource.forEach((item) => {
item.subList.forEach(cur=>{ item.subList.forEach(cur => {
if(cur.scaned){ if (cur.scaned) {
if(parseFloat(cur.handleQty)>parseFloat(cur.qty)){ if (parseFloat(cur.handleQty) > parseFloat(cur.qty)) {
commitHint += `物料号【${item.itemCode}】批次【${cur.batch}】实际提交数量【${cur.handleQty}】不可以大于库存数量【${cur.qty}\n` commitHint +=
`物料号【${item.itemCode}】批次【${cur.batch}】实际提交数量【${cur.handleQty}】不可以大于库存数量【${cur.qty}\n`
} }
} }
}) })
}) })
if(commitHint){ if (commitHint) {
this.showErrorMessage(commitHint) this.showErrorMessage(commitHint)
return; return;
} }
@ -479,7 +507,7 @@
submitItem.recordList = [{ submitItem.recordList = [{
toInventoryStatus: detail.inventoryStatus, toInventoryStatus: detail.inventoryStatus,
fromParentPackingNumber: detail.parentNumber, fromParentPackingNumber: detail.parentNumber,
fromPackingNumber: info.packingNumber, fromPackingNumber: detail.packingNumber,
fromBatch: info.batch, fromBatch: info.batch,
toPackingNumber: info.packingNumber, toPackingNumber: info.packingNumber,
toBatch: info.batch, toBatch: info.batch,
@ -501,6 +529,7 @@
this.dataContent.subList = subList this.dataContent.subList = subList
this.dataContent.creator = creator; this.dataContent.creator = creator;
this.dataContent.fromWarehouseCode = this.fromWarehouseCode; this.dataContent.fromWarehouseCode = this.fromWarehouseCode;
this.dataContent.sourceType="record"
return this.dataContent; return this.dataContent;
}, },

1
src/pages/issue/request/issueScanRequest.vue

@ -111,6 +111,7 @@
setParams() { setParams() {
this.detailSource.dueTime = getCurrDateOneMonthsTimes(); this.detailSource.dueTime = getCurrDateOneMonthsTimes();
this.detailSource.isCallMaterialsLabel = "TRUE"; this.detailSource.isCallMaterialsLabel = "TRUE";
this.detailSource.sourceType ="scan"
return this.detailSource return this.detailSource
}, },
submit() { submit() {

Loading…
Cancel
Save