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>
<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-for="(range, index) in dataContent.countRange" :key="index">
<view class="card_view">

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

@ -3,33 +3,33 @@
<view class="page-header">
<view class="header_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 class="page-main" style="height: 500px">
<view class="page-main">
<view class="">
<com-blank-view @goScan="showFromLocationPopup" v-if="detailSource.length == 0"></com-blank-view>
</view>
<scroll-view scroll-y="true" class="page-main-scroll">
<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="">
<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 class="split_line"></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>
</scroll-view>
@ -55,12 +55,13 @@
</template>
<script>
import { Decimal } from 'decimal.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 { getCountStageName } from '@/common/directory.js'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
@ -99,7 +100,8 @@ export default {
currentEditItem: {},
jobStatus: '',
fromLocation: {},
fromLocationCode: ''
fromLocationCode: '',
editRemoveOption: []
}
},
onLoad(option) {
@ -115,6 +117,7 @@ export default {
}
}
this.showFromLocationPopup()
this.editRemoveOption = getEditRemoveOption()
},
//
onNavigationBarButtonTap(e) {
@ -186,6 +189,39 @@ export default {
},
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)
},
@ -230,8 +266,21 @@ export default {
//
getScanResult(result) {
const that = this
const item = this.createDetailInfo(result.package)
this.detailSource.push(item)
const { package } = result
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,
projectCode: '',
qty: packInfo.qty,
countQty: packInfo.qty,
uom: packInfo.uom,
remark: '',
locationCode: this.fromLocationCode,
@ -260,25 +310,44 @@ export default {
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
this.$refs.comMessage.showQuestionMessage(`箱码【${that.label.packingNumber}】已经完成盘点,是否要编辑盘点结果?`, (res) => {
if (res) {
this.currentEditItem = subItem
this.$refs.countQtyEdit.openEditPopup(subItem, item.subList)
// this.$refs.countQtyEdit.openEditPopupShowSeconds(subItem,
// item.subList);
} else {
this.scanPopupGetFocus()
}
})
this.currentEditItem = item
this.$refs.countQtyEdit.openEditPopup(item)
},
editConfirm(qty, inventoryStatus, mode) {
const that = this
//
if (mode == 'edit') {
this.currentEditItem.countQty = qty
this.currentEditItem.qty = qty
this.currentEditItem.inventoryStatus = inventoryStatus
}
this.scanPopupGetFocus()
},
editClose() {
this.scanPopupGetFocus()
},
remove(item, index) {
this.showQuestionMessage('是否要移除扫描信息?', (res) => {
if (res) {
this.dataContent.subList.splice(index, 1)
}
})
},
commit() {
// if(this.detailSource.length==0)
// {
@ -320,6 +389,7 @@ export default {
}
})
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, (res) => {
if (res) {
@ -332,6 +402,12 @@ export default {
this.$refs.comMessage.showScanMessage(message)
},
showQuestionMessage(message, callback) {
this.$refs.comMessage.showQuestionMessage(message, (res) => {
callback(res)
})
},
afterCloseMessage() {
this.scanPopupGetFocus()
},
@ -351,11 +427,10 @@ export default {
navigateBack(1)
})
},
getCountStageName(value) {
return getCountStageName(value)
},
isOpenCount(value) {
return value == 'TRUE' ? '明盘' : '盲盘'
getCountScopeName(value) {
const item = getCountScopeType(value)
return item.label
}
}
}

Loading…
Cancel
Save