|
|
@ -20,6 +20,9 @@ |
|
|
|
|
|
|
|
<u-loadmore :status="loadingType" /> |
|
|
|
</view> |
|
|
|
<win-scan-button @goScan="openScanPopup" v-if="jobList.length > 0"></win-scan-button> |
|
|
|
<winScanPackJob title="库位" ref="scanPopup" @getResult="getScanResult"> </winScanPackJob> |
|
|
|
<jobListView ref="jobListRef" @selectItem="selectItem"></jobListView> |
|
|
|
<com-message ref="comMessageRef" /> |
|
|
|
</view> |
|
|
|
</template> |
|
|
@ -39,6 +42,9 @@ import jobFilter from '@/mycomponents/job/jobFilter.vue' |
|
|
|
import comCountJobCard from '@/pages/count/coms/comCountJobCard.vue' |
|
|
|
import jobListPopup from '@/pages/count/coms/jobListPopup.vue' |
|
|
|
import jobInfoPopup from '@/pages/count/coms/jobInfoPopup.vue' |
|
|
|
import jobListView from '@/mycomponents/jobList/jobList.vue' |
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
|
import winScanPackJob from '@/mycomponents/scan/winScanPackJob.vue' |
|
|
|
|
|
|
|
import { useCountStore } from '@/store' |
|
|
|
// 获取自定义的store |
|
|
@ -60,6 +66,8 @@ const filter = ref() |
|
|
|
const comMessageRef = ref() |
|
|
|
const jobInfoPopupRef = ref() |
|
|
|
const jobListPopupRef = ref() |
|
|
|
const jobListRef = ref() |
|
|
|
const scanPopup = ref() |
|
|
|
onShow(() => { |
|
|
|
nextTick(() => { |
|
|
|
getList('refresh') |
|
|
@ -162,6 +170,14 @@ const openJobDetail = (item) => { |
|
|
|
const selectedItem = (item) => { |
|
|
|
openJobDetail(item) |
|
|
|
} |
|
|
|
const openScanPopup = () => { |
|
|
|
scanPopup.value.openScanPopup() |
|
|
|
} |
|
|
|
|
|
|
|
const selectItem = (item) => { |
|
|
|
scanPopup.value.closeScanPopup() |
|
|
|
openJobDetail(item) |
|
|
|
} |
|
|
|
const showItemList = (itemList) => { |
|
|
|
jobListPopupRef.value.openPopup(itemList) |
|
|
|
} |
|
|
@ -254,6 +270,58 @@ const showMessage = (message) => { |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
const getScanResult = (result) => { |
|
|
|
uni.showLoading({ |
|
|
|
title: '加载中....', |
|
|
|
mask: true |
|
|
|
}) |
|
|
|
const filters = [] |
|
|
|
filters.push({ |
|
|
|
column: 'status', |
|
|
|
action: 'in', |
|
|
|
value: '1,2' |
|
|
|
}) |
|
|
|
filters.push({ |
|
|
|
column: 'locationCode', |
|
|
|
action: '==', |
|
|
|
value: result.label.code |
|
|
|
}) |
|
|
|
|
|
|
|
const params = { |
|
|
|
filters, |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 1000, |
|
|
|
sort: 'number', |
|
|
|
by: 'DESC' |
|
|
|
} |
|
|
|
getCountJobList(params) |
|
|
|
.then((res) => { |
|
|
|
uni.hideLoading() |
|
|
|
const resultList = res.data.list |
|
|
|
resultList.forEach((item) => { |
|
|
|
item.title = item.number |
|
|
|
item.selected = false |
|
|
|
}) |
|
|
|
const list = [] |
|
|
|
resultList.forEach((item) => { |
|
|
|
if (!list.find((subItem) => subItem.title == item.title)) { |
|
|
|
list.push(item) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
if (list.length == 0) { |
|
|
|
showMessage('未查找到库位' + `【${result.label.code}】的盘点任务`) |
|
|
|
} else if (list.length == 1) { |
|
|
|
selectItem(list[0]) |
|
|
|
} else { |
|
|
|
jobListRef.value.openList(list) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
uni.hideLoading() |
|
|
|
showMessage(error) |
|
|
|
}) |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped lang="scss"></style> |
|
|
|