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>
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm"></balance-qty-edit>
<record-detail-popup ref="recordDetailPopup"></record-detail-popup>
<!-- <balance-detail-popup ref="balanceDetailPopup"></balance-detail-popup> -->
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
// import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import balance from '@/mycomponents/balance/balance.vue'
import recommend from '@/mycomponents/recommend/recommend.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) {
var filters = []
let filters = [];
let label = result.label;
let packageInfo = result.package;
if (packageInfo.parentNumber) {
var packingNumber = packageInfo.parentNumber + "," + label.packingNumber;
let comfilters = this.getParams(label);
if (packageInfo.parentNumber !== null) {
let packingNumber = packageInfo.parentNumber + "," + label.packingNumber;
filters.push({
column: "packingNumber",
action: "in",
@ -131,25 +165,7 @@
})
}
filters.push({
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
})
}
filters = filters.concat(comfilters);
var params = {
filters: filters,
pageNo: 1,
@ -157,16 +173,44 @@
}
getBalanceByFilter(params).then(res => {
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 {
callback(res.data)
callback(res.data.list)
}
}).catch(err => {
this.showErrorMessage(err.message);
})
},
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="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowStatus="false" @removeItem="removeItem(index,item)" @updateData="updateData"
@removePack="removePack">
:isShowStatus="true" :isShowToLocation='false' @removeItem="removeItem(index,item)"
@updateData="updateData" @removePack="removePack">
</record-com-detail-card>
</view>
<view class='split_line'></view>
@ -33,16 +33,7 @@
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<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>
</view>
</template>
@ -73,12 +64,9 @@
} from '@/common/record.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comProductionRecord from '@/pages/productionReceipt/coms/comProductionRecord.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 winScanPackage from '@/mycomponents/scan/winScanPackage.vue'
@ -90,12 +78,9 @@
export default {
components: {
winScanButton,
winScanPack,
comProductionRecord,
requiredLocation,
comBlankView,
winScanLocation,
winScanPackAndLocation,
recordComDetailCard,
winScanPackage
},
@ -155,49 +140,48 @@
mounted() {},
methods: {
getScanResult(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);
let newDetail = createDetailInfo(balance, pack); //
newDetail.fromInventoryStatus = balance.inventoryStatus;
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == balance.packingNumber &&
r.batch == balance.batch &&
r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) {
return r;
}
})
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack);
newDetail.fromInventoryStatus = balance.inventoryStatus;
item.subList.push(newDetail);
} else {
if (detail.scaned == true) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中")
result.balance.forEach(
balance => {
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); //
newDetail.fromInventoryStatus = balance.inventoryStatus;
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == balance.packingNumber &&
r.batch == balance.batch &&
r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) {
return r;
}
})
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack);
newDetail.fromInventoryStatus = balance.inventoryStatus;
item.subList.push(newDetail);
} else {
if (detail.scaned == true) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch +
"]已经在列表中")
}
}
}
this.calcHandleQty();
}
}
this.calcHandleQty();
)
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
this.$refs.comMessage.showErrorMessage(message, res => {});
},
calcHandleQty() {
calcHandleQty(this.detailSource);
@ -258,10 +242,17 @@
commit() {
if (this.toLocationCode == "") {
this.showMessage("请先选择目标库位")
return;
this.$refs.comMessage.showQuestionMessage('未指定目标库位,系统将按上架策略推荐库位是否继续提交?', res => {
if (res) {
this.commitRecord();
}
});
} else {
this.commitRecord();
}
},
commitRecord() {
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
//
uni.showLoading({
@ -292,13 +283,10 @@
uni.hideLoading();
this.showErrorMessage(res.message);
}
})
} else {
this.showErrorMessage("没有要提交的数据,请先扫描")
}
},
setPrecisionStrategParams() {
@ -321,7 +309,6 @@
}
itemList.push(result)
}
}
})
})
@ -329,7 +316,6 @@
},
setParams() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {

Loading…
Cancel
Save