Browse Source

修改制品直接上架功能 2024/8/2

pull/1/head
test 4 months ago
parent
commit
c832238124
  1. 1
      src/mycomponents/record/recordComDetailCard.vue
  2. 87
      src/mycomponents/scan/winScanPackage.vue
  3. 91
      src/pages/productPutaway/record/productPutawayRecord.vue

1
src/mycomponents/record/recordComDetailCard.vue

@ -21,7 +21,6 @@
<script setup lang="ts">
import { ref, onMounted, nextTick, watch } from 'vue'
import itemQty from '@/mycomponents/item/itemQty.vue'
// import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import balance from '@/mycomponents/balance/balance.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import recordDetailPopup from '@/mycomponents/detail/recordDetailPopup.vue'

87
src/mycomponents/scan/winScanPackage.vue

@ -88,11 +88,44 @@ const getScanResult = (result) => {
showMessage(result.message)
}
}
const getParams = (label)=> {
let filters = [{
column: "itemCode",
action: "==",
value: label.itemCode
}, {
column: "batch",
action: "==",
value: label.batch
}];
if (businessType.value.outInventoryStatuses != null) {
filters.push({
column: "inventoryStatus",
action: "in",
value: businessType.value.outInventoryStatuses
})
}
if (businessType.value.outAreaTypes != null){
filters.push({
column: "areaType",
action: "in",
value: businessType.value.outAreaTypes
})
}
if (businessType.value.outAreaCodes != null){
filters.push({
column: "areaCode",
action: "in",
value: businessType.value.outAreaCodes
})
}
return filters;
}
const getBalance = (result, callback) => {
const filters = []
let filters = []
const { label } = result
const packageInfo = result.package
let comfilters = getParams(label);
if (packageInfo.parentNumber) {
const packingNumber = `${packageInfo.parentNumber},${label.packingNumber}`
filters.push({
@ -107,26 +140,12 @@ const getBalance = (result, callback) => {
value: label.packingNumber
})
}
filters = filters.concat(comfilters);
filters.push({
column: 'itemCode',
action: '==',
value: label.itemCode
})
filters.push({
column: 'batch',
action: '==',
value: label.batch
})
if (businessType.value != null) {
filters.push({
column: 'inventoryStatus',
action: 'in',
value: businessType.value.inInventoryStatuses
})
}
const params = {
filters,
pageNo: 1,
@ -135,9 +154,37 @@ const getBalance = (result, callback) => {
getBalanceByFilter(params)
.then((res) => {
if (res.data.list.length == 0) {
showErrorMessage('未查找到该包装的库存余额', (res) => {
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)
}

91
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>
</view>
@ -31,9 +31,7 @@
</view>
<win-scan-button @goScan="openScanPopup"></win-scan-button>
</view>
<win-scan-package ref="scanPopup" @getResult='getScanResult'></win-scan-package>
<com-message ref="comMessageRef" />
</view>
</template>
@ -50,12 +48,8 @@
import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } 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'
@ -111,35 +105,44 @@
})
const getScanResult = (result) => {
const { balance } = result
const { label } = result
const pack = result.package
const item = detailSource.value.find((res) => {
if (res.itemCode == balance.itemCode) {
return res
}
})
if (item == undefined) {
const itemp = createItemInfo(balance, pack)
const newDetail = createDetailInfo(balance, pack) //
newDetail.fromInventoryStatus = balance.inventoryStatus
itemp.subList.push(newDetail)
detailSource.value.push(itemp)
} else {
const 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) {
const newDetail = createDetailInfo(balance, pack)
newDetail.fromInventoryStatus = balance.inventoryStatus
item.subList.push(newDetail)
} else if (detail.scaned == true) {
showErrorMessage(`箱码[${balance.packingNumber}批次[${balance.batch}]已经在列表中`)
}
}
handleCalcHandleQty()
result.balance.forEach(
balance => {
var item = detailSource.value.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);
detailSource.value.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) {
showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch +
"]已经在列表中")
}
}
}
handleCalcHandleQty();
}
)
}
const handleCalcHandleQty = () => {
@ -192,6 +195,17 @@
// }
const commit = () => {
if (toLocationCode.value == "") {
showQuestionMessage('未指定目标库位,系统将按上架策略推荐库位是否继续提交?', res => {
if (res) {
commitRecord();
}
});
} else {
commitRecord();
}
}
const commitRecord = ()=>{
if (detailSource.value.length > 0 && detailSource.value[0].subList.length > 0) {
//
@ -335,6 +349,13 @@
}
})
}
const showQuestionMessage = (hint) => {
comMessageRef.value.showQuestionMessage(hint, (res) => {
if (res) {
clearData()
}
})
}
const clearData = () => {
fromLocationCode.value = ''

Loading…
Cancel
Save