Browse Source

增加盲盘时的校验 2024/7/19 22:30:25

hella_vue3
zhang_li 3 months ago
parent
commit
63ee947b31
  1. 4
      src/pages/count/coms/comFuzzyCountJobCard.vue
  2. 145
      src/pages/count/job/fuzzyCountDetail.vue

4
src/pages/count/coms/comFuzzyCountJobCard.vue

@ -1,5 +1,9 @@
<template> <template>
<job-com-main-card :dataContent="dataContent"> <job-com-main-card :dataContent="dataContent">
<view class="card_view">
<text class="card_packing_code">盘点计划</text>
<text class="card_content">{{ dataContent.planNumber }}</text>
</view>
<view v-if="dataContent.countRange != undefined" class=""> <view v-if="dataContent.countRange != undefined" class="">
<view v-for="(range, index) in dataContent.countRange" :key="index"> <view v-for="(range, index) in dataContent.countRange" :key="index">
<view class="card_view"> <view class="card_view">

145
src/pages/count/job/fuzzyCountDetail.vue

@ -3,33 +3,33 @@
<view class="page-header"> <view class="page-header">
<view class="header_job_top"> <view class="header_job_top">
<job-top :dataContent="jobContent"></job-top> <job-top :dataContent="jobContent"></job-top>
<view class="card_view">
<text class="card_packing_code">盘点计划</text>
<text class="card_content">{{ jobContent.planNumber }}</text>
</view>
<view v-for="(range, index) in dataContent.countRange" :key="index">
<view class="card_view">
<text class="card_packing_code">{{ getCountScopeName(range.type) }}</text>
<text class="card_content">{{ range.value }}</text>
</view>
</view>
</view> </view>
</view> </view>
<view class="page-main" style="height: 500px"> <view class="page-main">
<view class=""> <view class="">
<com-blank-view @goScan="showFromLocationPopup" v-if="detailSource.length == 0"></com-blank-view> <com-blank-view @goScan="showFromLocationPopup" v-if="detailSource.length == 0"></com-blank-view>
</view> </view>
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="removeData($event, dataContent)" :right-options="removeOptions"> <uni-swipe-action-item @click="swipeClick($event, item)" :right-options="editRemoveOption">
<!-- {{editRemoveOption}} -->
<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="">
<package-and-item-card :dataContent="item"></package-and-item-card> <package-and-item-card :dataContent="item"></package-and-item-card>
<!-- <com-count-detail-card :ref="'countDetail_'+index" :dataContent="item" :index="index"
@editItem="editItem" :settingParam="jobContent" @remove="updateData"
@updateData="updateData">
</com-count-detail-card> -->
</view> </view>
<view class="split_line"></view> <view class="split_line"></view>
</view> </view>
<!-- <item-qty v-if="settingParam.isOpenCount=='TRUE'" :dataContent="dataContent"
:handleQty="dataContent.handleQty" :isShowBalanceQty="false">
</item-qty>
<item-qty v-else :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowBalanceQty="true" :showRecommendQty="false" :showStdPack="true">
</item-qty> -->
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
</scroll-view> </scroll-view>
@ -55,12 +55,13 @@
</template> </template>
<script> <script>
import { Decimal } from 'decimal.js' //
import { getCountJobDetail, takeCountJob, cancleTakeCountJob, countJobSubmit } from '@/api/request2.js' import { getCountJobDetail, takeCountJob, cancleTakeCountJob, countJobSubmit } from '@/api/request2.js'
import { calc } from '@/common/calc.js'
import { getCountScopeType } from '@/common/directory.js'
import { getEditRemoveOption } from '@/common/array.js'
import { goHome, navigateBack, getPackingNumberAndBatch } from '@/common/basic.js' import { goHome, navigateBack, getPackingNumberAndBatch } from '@/common/basic.js'
import { getCountStageName } from '@/common/directory.js'
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue'
@ -99,7 +100,8 @@ export default {
currentEditItem: {}, currentEditItem: {},
jobStatus: '', jobStatus: '',
fromLocation: {}, fromLocation: {},
fromLocationCode: '' fromLocationCode: '',
editRemoveOption: []
} }
}, },
onLoad(option) { onLoad(option) {
@ -115,6 +117,7 @@ export default {
} }
} }
this.showFromLocationPopup() this.showFromLocationPopup()
this.editRemoveOption = getEditRemoveOption()
}, },
// //
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
@ -186,6 +189,39 @@ export default {
}, },
getLocation(location, code) { getLocation(location, code) {
const { countRange } = this.jobContent
let range = countRange.find((r) => r.type == 'LOCATION_CODE')
if (range != undefined) {
if (!rang.value.includes(location.code)) {
this.showErrorMessage(`库位代码【${location.code}】,不在盘点库位范围【${rangeValue}】内`)
return
}
} else {
range = countRange.find((r) => r.type == 'LOCATIONGROUP_CODE')
if (range != undefined) {
if (!rang.value.includes(location.locationGroupCode)) {
this.showErrorMessage(`库位组代码【${location.locationGroupCode}】,不在盘点库位组范围【${rangeValue}】内`)
return
}
} else {
range = countRange.find((r) => r.type == 'AREA_CODE')
if (range != undefined) {
if (!rang.value.includes(location.areaCode)) {
this.showErrorMessage(`库区代码【${location.areaCode}】,不在盘点库区范围【${rangeValue}】内`)
return
}
} else {
range = countRange.find((r) => r.type == 'WAREHOUSE_CODE')
if (range != undefined) {
if (!rang.value.includes(location.warehouseCode)) {
this.showErrorMessage(`仓库代码【${location.warehouseCode}】,不在盘点仓库范围【${rangeValue}】内`)
return
}
}
}
}
}
this.getFromLocationCode(location, code) this.getFromLocationCode(location, code)
}, },
@ -230,8 +266,21 @@ export default {
// //
getScanResult(result) { getScanResult(result) {
const that = this const that = this
const item = this.createDetailInfo(result.package) const { package } = result
this.detailSource.push(item) let detail = this.detailSource.find((r) => r.itemCode == package.itemCode && r.packingNumber == package.packingNumber && r.batch == package.batch && r.inventoryStatus == 'OK')
if (detail == undefined) {
detail = this.createDetailInfo(package)
this.detailSource.push(detail)
} else {
const { index } = detail
list.unshift(list.splice(index, 1)[0]) //
//
this.showQuestionMessage('该箱码已经扫描,是否要编辑盘点明细?', (res) => {
if (res) {
this.edit(detail)
}
})
}
}, },
// //
@ -249,6 +298,7 @@ export default {
itemDesc2: packInfo.itemDesc2, itemDesc2: packInfo.itemDesc2,
projectCode: '', projectCode: '',
qty: packInfo.qty, qty: packInfo.qty,
countQty: packInfo.qty,
uom: packInfo.uom, uom: packInfo.uom,
remark: '', remark: '',
locationCode: this.fromLocationCode, locationCode: this.fromLocationCode,
@ -260,25 +310,44 @@ export default {
return detail return detail
}, },
swipeClick(e, item) {
if (e.content.text == '编辑') {
this.edit(item)
} else if (e.content.text == '移除') {
this.remove(item)
}
},
// //
editCountResult(item, subItem) { edit(item) {
const that = this const that = this
this.$refs.comMessage.showQuestionMessage(`箱码【${that.label.packingNumber}】已经完成盘点,是否要编辑盘点结果?`, (res) => { this.currentEditItem = item
if (res) { this.$refs.countQtyEdit.openEditPopup(item)
this.currentEditItem = subItem },
this.$refs.countQtyEdit.openEditPopup(subItem, item.subList)
// this.$refs.countQtyEdit.openEditPopupShowSeconds(subItem, editConfirm(qty, inventoryStatus, mode) {
// item.subList); const that = this
} else { //
this.scanPopupGetFocus() if (mode == 'edit') {
} this.currentEditItem.countQty = qty
}) this.currentEditItem.qty = qty
this.currentEditItem.inventoryStatus = inventoryStatus
}
this.scanPopupGetFocus()
}, },
editClose() { editClose() {
this.scanPopupGetFocus() this.scanPopupGetFocus()
}, },
remove(item, index) {
this.showQuestionMessage('是否要移除扫描信息?', (res) => {
if (res) {
this.dataContent.subList.splice(index, 1)
}
})
},
commit() { commit() {
// if(this.detailSource.length==0) // if(this.detailSource.length==0)
// { // {
@ -320,6 +389,7 @@ export default {
} }
}) })
}, },
showErrorMessage(message) { showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, (res) => { this.$refs.comMessage.showErrorMessage(message, (res) => {
if (res) { if (res) {
@ -332,6 +402,12 @@ export default {
this.$refs.comMessage.showScanMessage(message) this.$refs.comMessage.showScanMessage(message)
}, },
showQuestionMessage(message, callback) {
this.$refs.comMessage.showQuestionMessage(message, (res) => {
callback(res)
})
},
afterCloseMessage() { afterCloseMessage() {
this.scanPopupGetFocus() this.scanPopupGetFocus()
}, },
@ -351,11 +427,10 @@ export default {
navigateBack(1) navigateBack(1)
}) })
}, },
getCountStageName(value) {
return getCountStageName(value) getCountScopeName(value) {
}, const item = getCountScopeType(value)
isOpenCount(value) { return item.label
return value == 'TRUE' ? '明盘' : '盲盘'
} }
} }
} }

Loading…
Cancel
Save