Browse Source

mycomponents/page/count/job 文件迁移 8/8-10/25

pull/1/head
test 3 months ago
parent
commit
05c24a6a4c
  1. 4
      src/pages/count/job/countBlindDetail.vue
  2. 4
      src/pages/count/job/countDetail.vue
  3. 4
      src/pages/count/job/countDetail1.vue
  4. 171
      src/pages/count/job/countJob.vue
  5. 162
      src/pages/count/job/countLightDetail.vue
  6. 80
      src/pages/count/job/fuzzyCountDetail.vue

4
src/pages/count/job/countBlindDetail.vue

@ -438,7 +438,7 @@ export default {
})
} else {
//
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交<br>' + `已经扫描[${this.scanCount}]总共[${this.getTotalCount()}]`, (res) => {
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交\n' + `已经扫描[${this.scanCount}]总共[${this.getTotalCount()}]`, (res) => {
if (res) {
this.openScanPopup()
}
@ -458,7 +458,7 @@ export default {
.then((res) => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage(`提交成功<br>生成盘点记录<br>${res.data}`)
this.showCommitSuccessMessage(`提交成功\n生成盘点记录\n${res.data}`)
} else {
this.showErrorMessage(`提交失败[${res.msg}]`)
}

4
src/pages/count/job/countDetail.vue

@ -617,7 +617,7 @@ const commit = () => {
})
} else {
//
comMessageRef.value.showErrorMessage('请完成扫描后,再进行提交<br>' + `已经扫描[${scanCount.value}]总共[${getTotalCount()}]`, (res) => {
comMessageRef.value.showErrorMessage('请完成扫描后,再进行提交\n' + `已经扫描[${scanCount.value}]总共[${getTotalCount()}]`, (res) => {
if (res) {
openScanPopup()
}
@ -633,7 +633,7 @@ const submitJob = () => {
.then((res) => {
uni.hideLoading()
if (res.data) {
showCommitSuccessMessage(`提交成功<br>生成盘点记录<br>${res.data}`)
showCommitSuccessMessage(`提交成功\n生成盘点记录\n${res.data}`)
} else {
showErrorMessage(`提交失败[${res.msg}]`)
}

4
src/pages/count/job/countDetail1.vue

@ -434,7 +434,7 @@ export default {
})
} else {
//
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交<br>' + `已经扫描[${this.scanCount}]总共[${this.getTotalCount()}]`, (res) => {
this.$refs.comMessage.showErrorMessage('请完成扫描后,再进行提交\n' + `已经扫描[${this.scanCount}]总共[${this.getTotalCount()}]`, (res) => {
if (res) {
this.openScanPopup()
}
@ -453,7 +453,7 @@ export default {
// countJobSubmit(params).then(res => {
// uni.hideLoading()
// if (res.data) {
// this.showCommitSuccessMessage("<br><br>" + res.data)
// this.showCommitSuccessMessage("\n\n" + res.data)
// } else {
// this.showErrorMessage("[" + res.msg + "]")
// }

171
src/pages/count/job/countJob.vue

@ -1,7 +1,10 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length == 0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday" :checkedWaitTask="checkedWaitTask"> </job-filter>
<job-filter ref="filter" :isShowFromLocationCode="true" @onQuery="getListByFilter"
fromLoactionCodeName="盘点库位"
:isShowQurery="true">
</job-filter>
<view v-if="jobList.length > 0" class="u-m-20">
<!-- <uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in jobList" :key="index">
@ -28,7 +31,7 @@
</template>
<script setup lang="ts">
import { ref, getCurrentInstance, nextTick } from 'vue'
import {ref, getCurrentInstance, nextTick, reactive} from 'vue'
import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import { cancleTakeCountJob, getCountJobList } from '@/api/request2.js'
@ -69,6 +72,11 @@ const jobInfoPopupRef = ref()
const jobListPopupRef = ref()
const jobListRef = ref()
const scanPopup = ref()
const queryParams = reactive({
creationTime: "",
status: "1,2",
fromLocationCode: ""
} )
onShow(() => {
nextTick(() => {
getList('refresh')
@ -115,40 +123,10 @@ const getList = (type) => {
pageNo.value = 1
jobList.value = []
}
const queryFiltersParams = setQueryParam()
const filters = []
if (checkedToday.value) {
filters.push({
column: 'create_time',
action: 'betweeen',
value: todayTime.value
})
}
filters.push({
column: 'status',
action: 'in',
value: status.value
})
filters.push({
column: 'countSplitType',
action: '==',
value: 'locationCode'
})
filters.push({
column: 'isOpenCount',
action: '==',
value: 'TRUE'
})
filters.push({
column: 'accept_user_id',
action: '==',
value: store.id
})
const params = {
filters,
filters:queryFiltersParams,
pageNo: pageNo.value,
pageSize: pageSize.value,
sort: 'number',
@ -195,6 +173,68 @@ const openJobDetail = (item) => {
})
}
}
const setQueryParam = ()=> {
let filterParams = []
//
if (queryParams.creationTime) {
filterParams.push({
column: "create_time",
action: "betweeen",
value: queryParams.creationTime
})
}
//
if (queryParams.status) {
filterParams.push({
column: "status",
action: "in",
value: queryParams.status
})
} else {
filterParams.push({
column: "status",
action: "in",
value: "1,2"
})
}
//
if (queryParams.fromLocationCode) {
filterParams.push({
column: "countSplitCode",
action: "==",
value: queryParams.fromLocationCode
})
}
filterParams.push({
column: "countSplitType",
action: "==",
value: "locationCode"
})
filterParams.push({
column: "isOpenCount",
action: "==",
value: "TRUE"
})
filterParams.push({
column: "accept_user_id",
action: "==",
value: store.id
})
return filterParams;
}
const getListByFilter = (params)=> {
queryParams.creationTime = params.creationTime;
queryParams.status = params.status;
queryParams.fromLocationCode = params.fromLocationCode;
getList('refresh')
}
const selectedItem = (item) => {
openJobDetail(item)
}
@ -247,68 +287,7 @@ const cancleJob = (id) => {
showMessage(error)
})
}
const switchChangeToday = (state, creationTime) => {
checkedToday.value = state
todayTime.value = creationTime
getList('refresh')
}
const switchChangeWait = (state, jobStatus) => {
checkedWaitTask.value = state
status.value = jobStatus
getList('refresh')
}
const getScanNumber = (code) => {
getDataListByType(code)
}
const getDataListByType = (code) => {
proxy.$modal.loading('加载中­....')
const filters = []
filters.push({
column: 'status',
action: 'in',
value: '1,2'
})
filters.push({
column: 'number',
action: '==',
value: code
})
filters.push({
column: 'countSplitType',
action: '==',
value: 'locationCode'
})
filters.push({
column: 'isOpenCount',
action: '==',
value: 'TRUE'
})
filters.push({
column: 'accept_user_id',
action: '==',
value: store.id
})
const params = {
filters,
pageNo: 1,
pageSize: 100,
sort: 'number',
by: 'DESC'
}
getCountJobList(params)
.then((res) => {
uni.hideLoading()
if (res.data.list.length == 0) {
showMessage('未查找到' + `${code}】的收货任务`)
} else if (res.data.list.length == 1) {
openJobDetail(res.data.list[0])
}
})
.catch((error) => {
uni.hideLoading()
showMessage(error)
})
}
const showMessage = (message) => {
comMessageRef.value.showErrorMessage(message, (res) => {
if (res) {

162
src/pages/count/job/countLightDetail.vue

@ -38,7 +38,9 @@
<uni-swipe-action-item @click="swipeClick($event, item)" :right-options="item.scaned ? scanOptions : detailOptions">
<view class="uni-flex uni-row" style="align-items: center" :class="item.scaned ? 'scan_view' : 'item'">
<view class="" style="font-size: 30rpx; font-weight: bold"> {{ index + 1 }}. </view>
<comCountDetailcards :ref="'countDetail_' + index" :dataContent="item" :index="index" @editItem="editItem" :settingParam="jobContent" @remove="updateData" @updateData="updateData"> </comCountDetailcards>
<comCountDetailcards :ref="'countDetail_'+index" :dataContent="item" :index="index" @editItem="editItem"
:settingParam="jobContent" @remove="updateData" @updateData="updateData">
</comCountDetailcards>
</view>
<view class="split_line"></view>
</uni-swipe-action-item>
@ -70,10 +72,11 @@ import { ref, getCurrentInstance, onMounted, nextTick, watch } from 'vue'
import { onShow, onNavigationBarButtonTap, onReady, onReachBottom, onPullDownRefresh, onLoad, onBackPress } from '@dcloudio/uni-app'
import { getCountJobDetail, takeCountJob, cancleTakeCountJob, countJobSubmit } from '@/api/request2.js'
import { goHome, navigateBack, compare } from '@/common/basic.js'
import { goHome, navigateBack, getPackingNumberAndBatch ,compare } from '@/common/basic.js'
import { getDetailOption, getDetailEditRemoveOption } from '@/common/array.js'
import { getCountStageName } from '@/common/directory.js'
import {getManagementPrecisions,} from '@/common/balance.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comCountDetailcards from '@/pages/count/coms/comCountDetailcards.vue'
@ -107,7 +110,9 @@ const showItem = ref()
const comMessageRef = ref()
const scanPopup = ref()
const countQtyEditRef = ref()
const managementList = ref([])
const managementType = ref('')
const emit = defineEmits(['removePack'])
onLoad((option) => {
uni.setNavigationBarTitle({
title: `${option.title}详情`
@ -192,7 +197,7 @@ const getDetail = () => {
mask: true
})
getCountJobDetail(id.value)
.then((res) => {
.then(async (res) => {
uni.hideLoading()
if (res.data == null) {
showMessage('未获取到详情')
@ -208,6 +213,26 @@ const getDetail = () => {
})
allDetails.value = res.data.subList
allCount.value = res.data.subList.length
//
let itemCodes = []
allDetails.value.forEach(item => {
itemCodes.push(item.itemCode)
item.scaned = false
})
await getManagementPrecisions(itemCodes, fromLocationCode.value, res => {
if (res.success) {
managementList.value = res.list;
managementType.value = managementList.value.some(item => item.ManagementPrecision ==
'BY_BATCH') ? 'BY_BATCH' : ''
if (managementType.value == 'BY_BATCH') {
allDetails.value.forEach(item => {
item.packingNumber = ''
item.toPackingNumber = ''
item.fromPackingNumber = ''
})
}
}
})
initList()
}
})
@ -252,6 +277,7 @@ const remove = (item, index) => {
if (res) {
item.scaned = false
item.handleQty = 0
showList.value.splice(index, 1)
emit('removePack')
}
})
@ -288,36 +314,66 @@ const getScanResult = (result) => {
const pack = result.package
const { batch } = result.label
const inventoryStatus = result.balance ? result.balance.inventoryStatus : 'OK'
const qty = result.balance ? result.balance.qty : 0
const qty = result.balance ? result.balance.qty : result.label.qty
//
const items = allDetails.value.filter((r) => r.itemCode === itemCode && r.packingNumber === packingNumber && r.batch === batch && r.inventoryStatus === inventoryStatus)
const items = allDetails.value.filter((r) => r.itemCode === itemCode &&
// r.packingNumber === packingNumber &&
r.batch === batch &&
r.inventoryStatus === inventoryStatus)
// ,
if (items.length == 0) {
comMessageRef.value.showQuestionMessage(`包装【${result.label.packingNumber}】不在任务列表中,是否要添加到列表中?`, (res) => {
//
if (res) {
const detail = createAddDetailInfo(pack, qty)
detail.countTime = new Date()
allDetails.value.push(detail)
updateList()
countQtyEditRef.value.openEditPopupShowSeconds(detail, null)
} else {
scanPopupGetFocus()
}
})
} else {
const selectItem = items[0]
//
if (selectItem.scaned) {
comMessageRef.value.showQuestionMessage(`包装【${result.label.packingNumber}】已经完成盘点,是否要编辑盘点结果?`, (res) => {
if(managementType.value == 'BY_BATCH'){
comMessageRef.value.showQuestionMessage(`批次【${result.label.batch}】不在任务列表中,是否要添加到列表中?`, (res) => {
//
if (res) {
const detail = createAddDetailInfo(pack, qty)
detail.countTime = new Date()
allDetails.value.push(detail)
updateList()
countQtyEditRef.value.openEditPopupShowSeconds(detail, null)
} else {
scanPopupGetFocus()
}
})
}else {
comMessageRef.value.showQuestionMessage(`包装【${result.label.packingNumber}】不在任务列表中,是否要添加到列表中?`, (res) => {
//
if (res) {
currentEditItem.value = selectItem
countQtyEditRef.value.openEditPopup(selectItem, null)
const detail = createAddDetailInfo(pack, qty)
detail.countTime = new Date()
allDetails.value.push(detail)
updateList()
countQtyEditRef.value.openEditPopupShowSeconds(detail, null)
} else {
scanPopupGetFocus()
}
})
}
} else {
const selectItem = items[0]
//
if (selectItem.scaned) {
//
if(managementType.value == 'BY_BATCH'){
comMessageRef.value.showQuestionMessage(`批次【${result.label.batch}】已经完成盘点,是否要编辑盘点结果?`, (res) => {
if (res) {
currentEditItem.value = selectItem
countQtyEditRef.value.openEditPopup(selectItem, null)
} else {
scanPopupGetFocus()
}
})
}else {
comMessageRef.value.showQuestionMessage(`包装【${result.label.packingNumber}】已经完成盘点,是否要编辑盘点结果?`, (res) => {
if (res) {
currentEditItem.value = selectItem
countQtyEditRef.value.openEditPopup(selectItem, null)
} else {
scanPopupGetFocus()
}
})
}
} else {
//
selectItem.scaned = true
@ -325,6 +381,7 @@ const getScanResult = (result) => {
selectItem.handleQty = Number(qty)
selectItem.packQty = pack.packQty
selectItem.packUnit = pack.packUnit
selectItem.parentPackingNumber = pack.parentPackingNumber
selectItem.locationCode = fromLocationCode.value
selectItem.fromLocationCode = fromLocationCode.value
@ -391,7 +448,7 @@ const createAddDetailInfo = (pack, qty) => {
uom: pack.uom,
number: pack.number,
remark: '',
countQty: 0,
countQty: Number(qty),
balanceQty: Number(qty),
fromLocationCode: fromLocationCode.value,
locationCode: fromLocationCode.value,
@ -404,7 +461,10 @@ const createAddDetailInfo = (pack, qty) => {
const commit = () => {
calcAllCount()
calcScanCount()
// if(scanCount.value){
// comMessageRef.value.showErrorMessage(',');
// return
// }
if (scanCount.value == allCount.value) {
submitJob()
} else if (scanCount.value < allCount.value) {
@ -426,7 +486,7 @@ const commit = () => {
})
} else {
//
comMessageRef.value.showErrorMessage('请完成扫描后,再进行提交<br>' + `已经扫描[${scanCount.value}]总共[${getTotalCount()}]`, (res) => {
comMessageRef.value.showErrorMessage('请完成扫描后,再进行提交\n' + `已经扫描[${scanCount.value}]总共[${getTotalCount()}]`, (res) => {
if (res) {
openScanPopup()
}
@ -440,20 +500,34 @@ const submitJob = () => {
title: '提交中....',
mask: true
})
const params = setParams()
countJobSubmit(params)
.then((res) => {
uni.hideLoading()
if (res.data) {
showCommitSuccessMessage(`提交成功<br>生成盘点记录<br>${res.data}`)
} else {
showErrorMessage(`提交失败[${res.msg}]`)
}
})
.catch((error) => {
uni.hideLoading()
showErrorMessage(error)
})
//
let itemCodes = []
allDetails.value.forEach(item => {
itemCodes.push(item.itemCode)
// item.scaned = false
})
getManagementPrecisions(itemCodes, this.fromLocationCode, res => {
if (res.success) {
managementList.value = res.list
const params = setParams()
countJobSubmit(params)
.then((res) => {
uni.hideLoading()
const str = res.data || ''
showCommitSuccessMessage("提交成功\n生成盘点记录\n" + str)
// if (res.data) {
// showCommitSuccessMessage(`\n\n${res.data}`)
// } else {
// showErrorMessage(`[${res.msg}]`)
// }
})
.catch((error) => {
uni.hideLoading()
showErrorMessage(error)
})
}
})
}
const setParams = () => {
@ -463,6 +537,10 @@ const setParams = () => {
allDetails.value.forEach((item) => {
if (item.scaned) {
item.countQty = item.handleQty
let info = getPackingNumberAndBatch(this.managementList, item.itemCode, item.packingNumber, item.batch);
item.toPackingNumber = info.packingNumber;
item.packingNumber = info.packingNumber;
item.fromPackingNumber = info.packingNumber;
}
subList.push(item)
})

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

@ -73,7 +73,7 @@ import { getEditRemoveOption } from '@/common/array.js'
import { goHome, navigateBack, getPackingNumberAndBatch } from '@/common/basic.js'
import { getCountScopeType } from '@/common/directory.js'
import {getManagementPrecisions,} from '@/common/balance.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import comCountDetailCard from '@/pages/count/coms/comCountDetailCard.vue'
@ -190,7 +190,7 @@ export default {
uni.hideLoading()
that.jobContent = res.data
that.jobStatus = res.data.status
const range = that.jobContent.countRange.find((r) => r.type == 'ITEMS_CODE')
const range = that.jobContent.countRange.find((r) => r.type == 'ITEM_CODE')
if (range != undefined) {
that.itemRangeValue = range.value
}
@ -286,7 +286,7 @@ export default {
scanPopupLoseFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.packLoseFocus()
this.$refs.scanPopup.losefocus()
}
},
@ -305,27 +305,57 @@ export default {
}
},
onScan(packInfo) {
let detail = this.detailSource.find((r) => r.itemCode == packInfo.itemCode && r.packingNumber == packInfo.number && r.batch == packInfo.batch && r.inventoryStatus == 'OK')
if (detail == undefined) {
detail = this.createDetailInfo(packInfo)
this.detailSource.unshift(detail)
this.scanPopupGetFocus()
} else {
const index = this.detailSource.findIndex((r) => r.itemCode == packInfo.itemCode && r.packingNumber == packInfo.number && r.batch == packInfo.batch && r.inventoryStatus == 'OK')
if (index >= 0) {
this.detailSource.unshift(this.detailSource.splice(index, 1)[0]) //
//
this.$refs.comMessage.showQuestionMessage('该箱码已经扫描,是否要编辑盘点明细?', (res) => {
if (res) {
this.closeScanPopup()
this.edit(detail)
async onScan(packInfo) {
console.log(packInfo)
//\
await getManagementPrecisions([packInfo.itemCode], packInfo.toLocationCode, res => {
if (res.success) {
this.managementList = res.list;
this.managementType = this.managementList.some(item => item.ManagementPrecision ==
'BY_BATCH') ? 'BY_BATCH' : ''
if (this.managementType == 'BY_BATCH') {
let detail = this.detailSource.find(r => r.itemCode == packInfo.itemCode && r.batch == packInfo
.batch && r.inventoryStatus == "OK");
if (detail == undefined) {
detail = this.createDetailInfo(packInfo);
detail.packingNumber = ''
detail.packUnit = ''
this.detailSource.unshift(detail)
this.scanPopupGetFocus();
} else {
this.scanPopupGetFocus()
let index = this.detailSource.findIndex(r => r.itemCode == packInfo.itemCode && r.batch == packInfo
.batch && r.inventoryStatus == "OK");
if (index >= 0) {
this.detailSource.unshift(this.detailSource.splice(index, 1)[0]); //
this.detailSource[0].qty = calc.add(this.detailSource[0].qty, packInfo.qty)
}
}
})
} else {
let detail = this.detailSource.find(r => r.itemCode == packInfo.itemCode && r.packingNumber ==
packInfo.number && r.batch == packInfo.batch && r.inventoryStatus == "OK");
if (detail == undefined) {
detail = this.createDetailInfo(packInfo);
this.detailSource.unshift(detail)
this.scanPopupGetFocus();
} else {
let index = this.detailSource.findIndex(r => r.itemCode == packInfo.itemCode && r.packingNumber ==
packInfo.number && r.batch == packInfo.batch && r.inventoryStatus == "OK");
if (index >= 0) {
this.detailSource.unshift(this.detailSource.splice(index, 1)[0]); //
//
this.$refs.comMessage.showQuestionMessage('该箱码已经扫描,是否要编辑盘点明细?', res => {
if (res) {
this.closeScanPopup();
this.edit(detail);
} else {
this.scanPopupGetFocus();
}
});
}
}
}
}
}
})
},
//
@ -362,10 +392,6 @@ export default {
return detail
},
editClose() {
this.$refs.countQtyEdit.closeEditPopup()
},
swipeClick(e, item, index) {
if (e.content.text == '编辑') {
this.edit(item)
@ -395,10 +421,12 @@ export default {
},
remove(item, index) {
this.scanPopupLoseFocus();
this.showQuestionMessage('是否要移除扫描信息?', (res) => {
if (res) {
this.detailSource.splice(index, 1)
}
this.scanPopupGetFocus();
})
},
@ -449,6 +477,7 @@ export default {
},
showMessage(message) {
this.scanPopupLoseFocus();
this.$refs.comMessage.showMessage(message, (res) => {
if (res) {
this.afterCloseMessage()
@ -456,6 +485,7 @@ export default {
})
},
showErrorMessage(message) {
this.scanPopupLoseFocus();
this.$refs.comMessage.showErrorMessage(message, (res) => {
if (res) {
this.afterCloseMessage()

Loading…
Cancel
Save