Browse Source

YT-552所有直接xxx任务,需要增加扫码库位

intex_online20241111
zhang_li 4 weeks ago
parent
commit
01a215bfd9
  1. 2
      src/pages/login/index.vue
  2. 196
      src/pages/productPutaway/record/productPutawayRecord.vue
  3. 8
      src/pages/putaway/record/putawayRecord.vue

2
src/pages/login/index.vue

@ -132,7 +132,7 @@
storage.clearStorage() storage.clearStorage()
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
this.username = "admin" this.username = "admin"
this.password = "win123456"; this.password = "CD_win09";
} }
uni.setNavigationBarColor({ uni.setNavigationBarColor({
frontColor: '#ffffff', frontColor: '#ffffff',

196
src/pages/productPutaway/record/productPutawayRecord.vue

@ -8,10 +8,17 @@
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class=""> <view class="">
<record-com-detail-card-batch :dataContent="item" :index="index" :settingParam="dataContent"
:isShowStatus="true" :isShowToLocation='false' @removeItem="removeItem(index,item)"
:isShowModifedLocation="true"
@updateData="updateData" @removePack="removePack" @editLocation="showScanToLocation"
v-if="managementType == 'BY_BATCH'||managementType =='BY_QUANTITY' ">
</record-com-detail-card-batch >
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" <record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowStatus="true" :isShowToLocation='false' @removeItem="removeItem(index,item)" :isShowStatus="true" :isShowToLocation='false' @removeItem="removeItem(index,item)"
:isShowModifedLocation="true" :isShowModifedLocation="true"
@updateData="updateData" @removePack="removePack" @editLocation="showScanToLocation"> @updateData="updateData" @removePack="removePack" @editLocation="showScanToLocation"
v-else>
</record-com-detail-card> </record-com-detail-card>
</view> </view>
</view> </view>
@ -42,6 +49,12 @@
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getToLocationCode' <win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getToLocationCode'
:locationAreaTypeList="toLocationAreaTypeList"></win-scan-location> :locationAreaTypeList="toLocationAreaTypeList"></win-scan-location>
<win-scan-pack-and-location ref="winScanPackAndLocationRef" @getResult='getScanResult' :allowModifyLocation='false'>
</win-scan-pack-and-location>
<comMessage ref="comMessage"></comMessage>
<win-scan-location ref="winScanFromLocation" title="来源库位" @getLocation='getLocation'
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
@ -72,7 +85,8 @@
getBusinessType, getBusinessType,
createItemInfo, createItemInfo,
createDetailInfo, createDetailInfo,
calcHandleQty calcHandleQty,
calcHandleQtyAdd
} from '@/common/record.js'; } from '@/common/record.js';
import { import {
@ -87,6 +101,8 @@
import winScanPackage from '@/mycomponents/scan/winScanPackage.vue' import winScanPackage from '@/mycomponents/scan/winScanPackage.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import recordComDetailCardBatch from '@/mycomponents/record/recordComDetailCardBatch.vue'
import { import {
updateTitle updateTitle
} from '@/common/basic.js'; } from '@/common/basic.js';
@ -100,7 +116,9 @@
recordComDetailCard, recordComDetailCard,
winScanPackage, winScanPackage,
winScanLocation, winScanLocation,
winComScanBalance winComScanBalance,
winScanPackAndLocation,
recordComDetailCardBatch
}, },
data() { data() {
return { return {
@ -120,7 +138,8 @@
businessType: {}, businessType: {},
managementList: [], managementList: [],
type: '', type: '',
editItem: null editItem: null,
managementType:''
}; };
}, },
// type = 'assemble' // type = 'assemble'
@ -154,8 +173,140 @@
}, },
methods: { methods: {
getScanResult(result) { getScanResult(result,managementTypeParams) {
this.setData(result); this.managementType = managementTypeParams
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){
this.setDataBatch(result)
}else{
this.setData(result)
}
},
async setDataBatch(result) {
let balance = result.balance;
let label = result.label;
let pack = result.package;
var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) {
return res
}
})
if (item == undefined) {
var itemp = createItemInfo(balance, pack);
// itemp.containerNumber=""
let newDetail = createDetailInfo(balance, pack); //
newDetail.fromLocationCode=balance.locationCode
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
newDetail.handleQty =0;
newDetail.balanceQty =result.balance.qty;
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
this.itemCode = balance.itemCode;
this.fromLocationCode = balance.locationCode
await this.getRecommendLocation(balance,result)
await this.scanPopupGetFocus()
} else {
var detail = item.subList.find(r => {
if (r.batch == balance.batch &&
r.fromLocationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) {
return r;
}
})
if (detail == undefined) {
//
//
//,
if (pack.parentNumber) {
var checkData = item.subList.find(r => {
if (r.packingNumber == pack.parentNumber &&
r.batch == balance.batch&&
r.fromLocationCode == balance.locationCode) {
return r;
}
})
if (checkData) {
//
this.showErrorMessage("扫描箱码[" + pack.number + "]批次[" + balance.batch +
"]的父包装已经扫描")
console.log("父包装已经扫描")
} else {
let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
newDetail.fromLocationCode=balance.locationCode
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
newDetail.handleQty =0;
newDetail.balanceQty =result.balance.qty;
item.subList.push(newDetail);
}
} else {
//
var checkData = item.subList.find(r => {
if (r.parentNumber == pack.number &&
r.batch == balance.batch&&
r.fromLocationCode == balance.locationCode) {
return r;
}
})
if (checkData) {
//
this.$refs.comMessage.showQuestionMessage("箱码[" + checkData.parentNumber+"]" + "批次[" + balance
.batch + "]是父包装,是否移除子包装", res => {
if (res) {
item.subList = [];
let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
newDetail.fromLocationCode=balance.locationCode
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
newDetail.handleQty =0;
newDetail.balanceQty =result.balance.qty;
item.subList.push(newDetail);
calcHandleQtyAdd(this.detailSource,result.label);
}
})
console.log("扫描的是父包装,是否移除子包装")
} else {
let newDetail = createDetailInfo(balance, pack);
newDetail.fromLocationCode=balance.locationCode
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
newDetail.handleQty =0;
newDetail.balanceQty =result.balance.qty;
item.subList.push(newDetail);
}
}
this.scanPopupGetFocus()
} else {
if (detail.scaned == true) {
// detail.handleQty = calc.add(detail.handleQty,result.label.qty)
// this.showErrorMessage("[" + detail.packingNumber + "[" + balance.batch + "]")
}
}
}
calcHandleQtyAdd(this.detailSource,result.label);
}, },
async setData(result) { async setData(result) {
@ -421,7 +572,8 @@
openScanPopup() { openScanPopup() {
if (this.businessType) { if (this.businessType) {
this.toLocationAreaTypeList = getDirectoryItemArray(this.businessType.inAreaTypes) this.toLocationAreaTypeList = getDirectoryItemArray(this.businessType.inAreaTypes)
this.$refs.scanPopup.openScanPopup(this.businessType); // this.$refs.scanPopup.openScanPopup(this.businessType);
this.openFromLocationScanPopup()
} else { } else {
this.getBusinessType() this.getBusinessType()
} }
@ -444,7 +596,18 @@
this.$refs.scanPopup.losefocus(); this.$refs.scanPopup.losefocus();
} }
}, },
openFromLocationScanPopup() {
if (this.fromLocationCode == "") {
this.showFromLocationPopup();
return
}
this.$refs.winScanPackAndLocationRef.openScanPopupForType(this.fromLocationCode, this.businessType);
},
showFromLocationPopup() {
this.$nextTick(() => {
this.$refs.winScanFromLocation.openScanPopup();
})
},
scanLocationCode(location, code) { scanLocationCode(location, code) {
this.toLocationCode = code this.toLocationCode = code
this.detailSource.forEach(item => { this.detailSource.forEach(item => {
@ -463,7 +626,15 @@
}); });
var params = this.setParams() var params = this.setParams()
console.log("提交" + JSON.stringify(params)) console.log("提交" + JSON.stringify(params))
const isHaveItem =params.subList.find(item=>item.handleQty > item.balanceQty)
if(isHaveItem){
this.showErrorMessage(`物料号${isHaveItem.itemCode}`)
this.$refs.comMessage.showConfirmWarningModal('物料号'+isHaveItem.itemCode+'数量[' + isHaveItem.handleQty + ']不允许大于库存数量[' + isHaveItem.balanceQty + ']')
uni.hideLoading()
return
}
productPutawayRecordSubmit(params).then(res => { productPutawayRecordSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
@ -574,7 +745,14 @@
getToLocationCode(location, code) { getToLocationCode(location, code) {
this.editItem.toLocationCode = code; this.editItem.toLocationCode = code;
}, },
getLocation(location, code) {
this.getFromLocationCode(location, code)
},
getFromLocationCode(location, code) {
this.fromLocationInfo = location;
this.fromLocationCode = code;
this.openScanPopup();
},
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
this.clearData(); this.clearData();

8
src/pages/putaway/record/putawayRecord.vue

@ -173,13 +173,13 @@
getScanResult(result,managementType) { getScanResult(result,managementType) {
this.managementType = managementTypeParams this.managementType = managementTypeParams
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){
this. getScanResultAfterBatch(result) this.setDataBatch(result)
}else{ }else{
this. getScanResultAfter(result) this.setData(result)
} }
}, },
getScanResultAfterBatch(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,7 +251,7 @@
} }
}, },
getScanResultAfter(result){ setData(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;

Loading…
Cancel
Save