Browse Source

修改制品直接上架功能

hella_online_20240829
niexiting 4 months ago
parent
commit
0995886427
  1. 2
      src/mycomponents/record/recordComDetailCard.vue
  2. 100
      src/mycomponents/scan/winScanPackage.vue
  3. 106
      src/pages/productPutaway/record/productPutawayRecord.vue

2
src/mycomponents/record/recordComDetailCard.vue

@ -27,14 +27,12 @@
</uni-collapse> </uni-collapse>
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm"></balance-qty-edit> <balance-qty-edit ref="balanceQtyEdit" @confirm="confirm"></balance-qty-edit>
<record-detail-popup ref="recordDetailPopup"></record-detail-popup> <record-detail-popup ref="recordDetailPopup"></record-detail-popup>
<!-- <balance-detail-popup ref="balanceDetailPopup"></balance-detail-popup> -->
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
<script> <script>
import itemQty from '@/mycomponents/item/itemQty.vue' import itemQty from '@/mycomponents/item/itemQty.vue'
// import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import balance from '@/mycomponents/balance/balance.vue' import balance from '@/mycomponents/balance/balance.vue'
import recommend from '@/mycomponents/recommend/recommend.vue' import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'

100
src/mycomponents/scan/winScanPackage.vue

@ -111,13 +111,47 @@
} }
}, },
getParams(label) {
let filters = [{
column: "itemCode",
action: "==",
value: label.itemCode
}, {
column: "batch",
action: "==",
value: label.batch
}];
if (this.businessType.outInventoryStatuses != null) {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.businessType.outInventoryStatuses
})
}
if (this.businessType.outAreaTypes != null){
filters.push({
column: "areaType",
action: "in",
value: this.businessType.outAreaTypes
})
}
if (this.businessType.outAreaCodes != null){
filters.push({
column: "areaCode",
action: "in",
value: this.businessType.outAreaCodes
})
}
return filters;
},
getBalance(result, callback) { getBalance(result, callback) {
var filters = [] let filters = [];
let label = result.label; let label = result.label;
let packageInfo = result.package; let packageInfo = result.package;
let comfilters = this.getParams(label);
if (packageInfo.parentNumber) { if (packageInfo.parentNumber !== null) {
var packingNumber = packageInfo.parentNumber + "," + label.packingNumber; let packingNumber = packageInfo.parentNumber + "," + label.packingNumber;
filters.push({ filters.push({
column: "packingNumber", column: "packingNumber",
action: "in", action: "in",
@ -131,25 +165,7 @@
}) })
} }
filters.push({ filters = filters.concat(comfilters);
column: "itemCode",
action: "==",
value: label.itemCode
})
filters.push({
column: "batch",
action: "==",
value: label.batch
})
if (this.businessType != null) {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.businessType.inInventoryStatuses
})
}
var params = { var params = {
filters: filters, filters: filters,
pageNo: 1, pageNo: 1,
@ -157,16 +173,44 @@
} }
getBalanceByFilter(params).then(res => { getBalanceByFilter(params).then(res => {
if (res.data.list.length == 0) { if (res.data.list.length == 0) {
this.showErrorMessage('未查找到该包装的库存余额', res => { //
this.packGetFocus(); if (packageInfo.subList.length > 0) {
}) let packparams = '';
packageInfo.subList.forEach(pack => {
packparams = packparams + pack.number + ','
})
packparams = packparams.trimEnd(',');
filters = [];
filters.push({
column: "packingNumber",
action: "in",
value: packparams
})
filters = filters.concat(comfilters);
params.filters = filters;
getBalanceByFilter(params).then(res1 => {
if (res1.data.list.length == 0) {
this.showErrorMessage('未查找到该包装的库存余额', res => {
this.packGetFocus();
})
} else {
callback(res1.data.list)
}
}).catch(err => {
this.showErrorMessage(err.message);
})
} else {
this.showErrorMessage('未查找到该包装的库存余额', res => {
this.packGetFocus();
})
}
} else { } else {
callback(res.data) callback(res.data.list)
} }
}).catch(err => { }).catch(err => {
this.showErrorMessage(err.message); this.showErrorMessage(err.message);
}) })
}, },
getfocus() { getfocus() {

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

@ -10,8 +10,8 @@
<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 :dataContent="item" :index="index" :settingParam="dataContent" <record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowStatus="false" @removeItem="removeItem(index,item)" @updateData="updateData" :isShowStatus="true" :isShowToLocation='false' @removeItem="removeItem(index,item)"
@removePack="removePack"> @updateData="updateData" @removePack="removePack">
</record-com-detail-card> </record-com-detail-card>
</view> </view>
<view class='split_line'></view> <view class='split_line'></view>
@ -33,16 +33,7 @@
</view> </view>
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
</view> </view>
<win-scan-package ref="scanPopup" @getResult='getScanResult'></win-scan-package> <win-scan-package ref="scanPopup" @getResult='getScanResult'></win-scan-package>
<!-- <win-scan-pack-and-location :balanceFromInventoryStatuses="false" ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location> -->
<!-- <win-com-scan-balance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="bussinessCode">
</win-com-scan-balance> -->
<!-- <win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location> -->
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
@ -73,12 +64,9 @@
} from '@/common/record.js'; } from '@/common/record.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comProductionRecord from '@/pages/productionReceipt/coms/comProductionRecord.vue' import comProductionRecord from '@/pages/productionReceipt/coms/comProductionRecord.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue' import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import winScanPackage from '@/mycomponents/scan/winScanPackage.vue' import winScanPackage from '@/mycomponents/scan/winScanPackage.vue'
@ -90,12 +78,9 @@
export default { export default {
components: { components: {
winScanButton, winScanButton,
winScanPack,
comProductionRecord, comProductionRecord,
requiredLocation, requiredLocation,
comBlankView, comBlankView,
winScanLocation,
winScanPackAndLocation,
recordComDetailCard, recordComDetailCard,
winScanPackage winScanPackage
}, },
@ -155,49 +140,48 @@
mounted() {}, mounted() {},
methods: { methods: {
getScanResult(result) { getScanResult(result) {
let balance = result.balance;
let label = result.label; let label = result.label;
let pack = result.package; let pack = result.package;
var item = this.detailSource.find(res => { result.balance.forEach(
if (res.itemCode == balance.itemCode) { balance => {
return res var item = this.detailSource.find(res => {
} if (res.itemCode == balance.itemCode) {
}) return res
if (item == undefined) { }
var itemp = createItemInfo(balance, pack); })
let newDetail = createDetailInfo(balance, pack); // if (item == undefined) {
newDetail.fromInventoryStatus = balance.inventoryStatus; var itemp = createItemInfo(balance, pack);
itemp.subList.push(newDetail); let newDetail = createDetailInfo(balance, pack); //
this.detailSource.push(itemp) newDetail.fromInventoryStatus = balance.inventoryStatus;
} else { itemp.subList.push(newDetail);
var detail = item.subList.find(r => { this.detailSource.push(itemp)
if (r.packingNumber == balance.packingNumber && } else {
r.batch == balance.batch && var detail = item.subList.find(r => {
r.locationCode == balance.locationCode && if (r.packingNumber == balance.packingNumber &&
r.inventoryStatus == balance.inventoryStatus) { r.batch == balance.batch &&
return r; r.locationCode == balance.locationCode &&
} r.inventoryStatus == balance.inventoryStatus) {
}) return r;
if (detail == undefined) { }
let newDetail = createDetailInfo(balance, pack); })
newDetail.fromInventoryStatus = balance.inventoryStatus; if (detail == undefined) {
item.subList.push(newDetail); let newDetail = createDetailInfo(balance, pack);
} else { newDetail.fromInventoryStatus = balance.inventoryStatus;
if (detail.scaned == true) { item.subList.push(newDetail);
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中") } else {
if (detail.scaned == true) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch +
"]已经在列表中")
}
}
} }
this.calcHandleQty();
} }
} )
this.calcHandleQty();
}, },
showErrorMessage(message) { showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {});
if (res) {
}
});
}, },
calcHandleQty() { calcHandleQty() {
calcHandleQty(this.detailSource); calcHandleQty(this.detailSource);
@ -258,10 +242,17 @@
commit() { commit() {
if (this.toLocationCode == "") { if (this.toLocationCode == "") {
this.showMessage("请先选择目标库位") this.$refs.comMessage.showQuestionMessage('未指定目标库位,系统将按上架策略推荐库位是否继续提交?', res => {
return; if (res) {
this.commitRecord();
}
});
} else {
this.commitRecord();
} }
},
commitRecord() {
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
// //
uni.showLoading({ uni.showLoading({
@ -292,13 +283,10 @@
uni.hideLoading(); uni.hideLoading();
this.showErrorMessage(res.message); this.showErrorMessage(res.message);
} }
}) })
} else { } else {
this.showErrorMessage("没有要提交的数据,请先扫描") this.showErrorMessage("没有要提交的数据,请先扫描")
} }
}, },
setPrecisionStrategParams() { setPrecisionStrategParams() {
@ -321,7 +309,6 @@
} }
itemList.push(result) itemList.push(result)
} }
} }
}) })
}) })
@ -329,7 +316,6 @@
}, },
setParams() { setParams() {
var subList = [] var subList = []
var creator = this.$store.state.user.id var creator = this.$store.state.user.id
this.detailSource.forEach(item => { this.detailSource.forEach(item => {

Loading…
Cancel
Save