|
|
@ -40,7 +40,9 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class=""> |
|
|
|
<comProductDetailCard :dataContent="item" :settingParam="jobContent" :isShowLocation="false" @remove="updateData" @updateData="updateData" :locationAreaTypeList="toLocationAreaTypeList"> </comProductDetailCard> |
|
|
|
<comProductDetailCard :dataContent="item" :settingParam="jobContent" :isShowLocation="false" |
|
|
|
@remove="updateData" @updateData="updateData" :locationAreaTypeList="toLocationAreaTypeList"> |
|
|
|
</comProductDetailCard> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
@ -49,7 +51,10 @@ |
|
|
|
<view class="page-footer"> |
|
|
|
<view class="uni-flex u-col-center space-between padding_10" style="background-color: ghostwhite; width: 100%"> |
|
|
|
<view class=""> |
|
|
|
<locationCompare ref="comScanLocation" title="收货库位" :isShowEdit="jobContent.allowModifyLocation == 'TRUE'" :recommendLocationCode="jobToLocationCode" :locationCode="toLocationCode" @getLocation="scanLocationCode" :locationAreaTypeList="toLocationAreaTypeList"></locationCompare> |
|
|
|
<<locationCompare ref="comScanLocation" title="收货库位" :isShowEdit="jobContent.allowModifyLocation=='TRUE'" |
|
|
|
:recommendLocationCode="jobToLocationCode" :locationCode="toLocationCode" @getLocation='scanLocationCode' |
|
|
|
:locationAreaTypeList="toLocationAreaTypeList"> |
|
|
|
</locationCompare> |
|
|
|
</view> |
|
|
|
<view class="uni-flex uni-row"> |
|
|
|
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> |
|
|
@ -65,58 +70,59 @@ |
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import { ref, getCurrentInstance, nextTick, onMounted } from 'vue' |
|
|
|
import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app' |
|
|
|
import { getManagementPrecisions } from '@/common/balance.js' |
|
|
|
|
|
|
|
import { getProductReceiptJobDetail, takeProductReceiptJob, cancleTakeProductReceiptJob, ccProductReceiptJobsubmit } from '@/api/request2.js' |
|
|
|
import { goHome, navigateBack, getPackingNumberAndBatch } from '@/common/basic.js' |
|
|
|
|
|
|
|
import { getDirectoryItemArray, getInventoryStatusName } from '@/common/directory.js' |
|
|
|
|
|
|
|
import { getDataSource, createRecordInfo, calcHandleQty, getScanCount } from '@/common/detail.js' |
|
|
|
import { calc } from '@/common/calc.js' |
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
|
import locationCompare from '@/mycomponents/location/locationCompare.vue' |
|
|
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
|
|
|
import comDetailCard from '@/mycomponents/detail/comDetailCard.vue' |
|
|
|
import jobTop from '@/mycomponents/job/jobTop.vue' |
|
|
|
import comProductDetailCard from '@/pages/productReceipt/coms/comProductDetailCard.vue' |
|
|
|
|
|
|
|
import { useCountStore } from '@/store' |
|
|
|
// 获取自定义的store |
|
|
|
const store = useCountStore() |
|
|
|
const id= ref('') |
|
|
|
const receiptJob= ref({}) |
|
|
|
const toLocationCode= ref('') |
|
|
|
const isShowPackingCode= ref(true) |
|
|
|
const scanCount= ref(0) |
|
|
|
const jobContent= ref({})// 任务内容 |
|
|
|
const subList= ref([])// 接口返回的任务subList |
|
|
|
const detailSource= ref([])// 绑定在页面上的数据源 |
|
|
|
const toLocationAreaTypeList= ref([]) |
|
|
|
const managementList= ref([]) |
|
|
|
const jobStatus= ref('') |
|
|
|
const jobToLocationCode= ref('') |
|
|
|
const scanedPackingNumber= ref('') |
|
|
|
const status= ref('') |
|
|
|
const comScanLocation= ref() |
|
|
|
const scanPopup= ref() |
|
|
|
const comMessageRef= ref() |
|
|
|
|
|
|
|
onLoad((option)=> { |
|
|
|
setTimeout(res=>{ |
|
|
|
import { ref, getCurrentInstance, nextTick, onMounted } from 'vue' |
|
|
|
import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app' |
|
|
|
import { getManagementPrecisions } from '@/common/balance.js' |
|
|
|
|
|
|
|
import { getProductReceiptJobDetail, takeProductReceiptJob, cancleTakeProductReceiptJob, ccProductReceiptJobsubmit } from '@/api/request2.js' |
|
|
|
import { goHome, navigateBack, getPackingNumberAndBatch } from '@/common/basic.js' |
|
|
|
|
|
|
|
import { getDirectoryItemArray, getInventoryStatusName } from '@/common/directory.js' |
|
|
|
|
|
|
|
import { getDataSource, createRecordInfo, calcHandleQty, getScanCount } from '@/common/detail.js' |
|
|
|
import { calc } from '@/common/calc.js' |
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
|
import locationCompare from '@/mycomponents/location/locationCompare.vue' |
|
|
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
|
|
|
import comDetailCard from '@/mycomponents/detail/comDetailCard.vue' |
|
|
|
import jobTop from '@/mycomponents/job/jobTop.vue' |
|
|
|
import comProductDetailCard from '@/pages/productReceipt/coms/comProductDetailCard.vue' |
|
|
|
|
|
|
|
import { useCountStore } from '@/store' |
|
|
|
// 获取自定义的store |
|
|
|
const store = useCountStore() |
|
|
|
const id = ref('') |
|
|
|
const receiptJob = ref({}) |
|
|
|
const toLocationCode = ref('') |
|
|
|
const isShowPackingCode = ref(true) |
|
|
|
const scanCount = ref(0) |
|
|
|
const jobContent = ref({})// 任务内容 |
|
|
|
const subList = ref([])// 接口返回的任务subList |
|
|
|
const detailSource = ref([])// 绑定在页面上的数据源 |
|
|
|
const toLocationAreaTypeList = ref([]) |
|
|
|
const managementList = ref([]) |
|
|
|
const jobStatus = ref('') |
|
|
|
const jobToLocationCode = ref('') |
|
|
|
const scanedPackingNumber = ref('') |
|
|
|
const status = ref('') |
|
|
|
const scanMessage = ref('') |
|
|
|
const comScanLocation = ref() |
|
|
|
const scanPopup = ref() |
|
|
|
const comMessageRef = ref() |
|
|
|
|
|
|
|
onLoad((option) => { |
|
|
|
setTimeout(res => { |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
title: `${option.title}详情` |
|
|
|
}) |
|
|
|
|
|
|
|
},50) |
|
|
|
}, 50) |
|
|
|
id.value = option.id |
|
|
|
scanedPackingNumber.value = option.scaned || '' |
|
|
|
scanMessage.value = option.scanMessage || '' |
|
|
|
status.value = option.status || '' |
|
|
|
}) |
|
|
|
onShow(() =>{ |
|
|
|
onShow(() => { |
|
|
|
if (id.value != undefined) { |
|
|
|
// 新建的任务自动接收 |
|
|
|
if (status.value == '1') { |
|
|
@ -129,18 +135,18 @@ const comMessageRef= ref() |
|
|
|
} |
|
|
|
}) |
|
|
|
// 返回首页 |
|
|
|
onNavigationBarButtonTap((e) =>{ |
|
|
|
onNavigationBarButtonTap((e) => { |
|
|
|
if (e.index === 0) { |
|
|
|
goHome() |
|
|
|
} |
|
|
|
}) |
|
|
|
// 拦截返回按钮事件 |
|
|
|
onBackPress((e)=> { |
|
|
|
onBackPress((e) => { |
|
|
|
// 已经接收但是没提交任务 |
|
|
|
if (e.from == 'backbutton') { |
|
|
|
if (jobStatus.value == '2') { |
|
|
|
// 取消承接任务 |
|
|
|
cancleTakeProductReceiptJob(id.value ) |
|
|
|
cancleTakeProductReceiptJob(id.value) |
|
|
|
.then((res) => { |
|
|
|
uni.navigateBack() |
|
|
|
}) |
|
|
@ -155,13 +161,13 @@ const comMessageRef= ref() |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
onPullDownRefresh(() =>{ |
|
|
|
onPullDownRefresh(() => { |
|
|
|
getDetail() |
|
|
|
uni.stopPullDownRefresh() |
|
|
|
}) |
|
|
|
|
|
|
|
// 接收 |
|
|
|
const receive=(callback)=> { |
|
|
|
const receive = (callback) => { |
|
|
|
if (id.value != null) { |
|
|
|
takeProductReceiptJob(id.value) |
|
|
|
.then((res) => { |
|
|
@ -173,7 +179,7 @@ const comMessageRef= ref() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const getDetail=() =>{ |
|
|
|
const getDetail = () => { |
|
|
|
uni.showLoading({ |
|
|
|
title: '加载中....', |
|
|
|
mask: true |
|
|
@ -193,19 +199,9 @@ const comMessageRef= ref() |
|
|
|
} |
|
|
|
toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes) |
|
|
|
detailSource.value = getDataSource(subList.value) |
|
|
|
detailSource.value.forEach((r) => { |
|
|
|
r.subList.forEach((s) => { |
|
|
|
if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) { |
|
|
|
s.scaned = true |
|
|
|
s.cancleScanedHiht = true |
|
|
|
s.copyContent = `HMQ;V1.0;I${s.itemCode};P${s.packingNumber};B${s.batch};Q${s.qty}` |
|
|
|
|
|
|
|
scanPopup.value.simulateScan(s) |
|
|
|
scanedPackingNumber.value = '' |
|
|
|
// s.handleQty =s.qty |
|
|
|
if (scanMessage.value) { |
|
|
|
scanPopup.value.simulateScan(scanMessage.value); |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
showMessage('列表数据为0') |
|
|
|
} |
|
|
@ -216,7 +212,7 @@ const comMessageRef= ref() |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const getScanResult=(result) =>{ |
|
|
|
const getScanResult = (result) => { |
|
|
|
const { label } = result |
|
|
|
const { packingNumber } = label |
|
|
|
const { batch } = label |
|
|
@ -230,7 +226,7 @@ const comMessageRef= ref() |
|
|
|
const itemDetail = detail.subList.find((r) => r.packingNumber == packingNumber && r.batch == batch) |
|
|
|
if (itemDetail == undefined) { |
|
|
|
showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]不在任务列表中`) |
|
|
|
} else if (!itemDetail.cancleScanedHiht && itemDetail.scaned) { |
|
|
|
} else if (itemDetail.scaned) { |
|
|
|
showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]已经扫描`) |
|
|
|
} else { |
|
|
|
itemDetail.scaned = true |
|
|
@ -245,7 +241,7 @@ const comMessageRef= ref() |
|
|
|
} |
|
|
|
|
|
|
|
// 继续扫描 |
|
|
|
const continueScan=()=> { |
|
|
|
const continueScan = () => { |
|
|
|
scanCount.value = getScanCount(subList.value) |
|
|
|
if (scanCount.value == subList.value.length) { |
|
|
|
closeScanPopup() |
|
|
@ -254,19 +250,19 @@ const comMessageRef= ref() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const updateData=() =>{ |
|
|
|
const updateData = () => { |
|
|
|
calcHandleQty(detailSource.value) |
|
|
|
} |
|
|
|
|
|
|
|
const openScanPopup=() =>{ |
|
|
|
const openScanPopup = () => { |
|
|
|
scanPopup.value.openScanPopup() |
|
|
|
} |
|
|
|
|
|
|
|
const closeScanPopup=() =>{ |
|
|
|
const closeScanPopup = () => { |
|
|
|
scanPopup.value.closeScanPopup() |
|
|
|
} |
|
|
|
|
|
|
|
const scanLocationCode=(location, code) =>{ |
|
|
|
const scanLocationCode = (location, code) => { |
|
|
|
toLocationCode.value = code |
|
|
|
detailSource.value.forEach((item) => { |
|
|
|
item.subList.forEach((detail) => { |
|
|
@ -275,7 +271,7 @@ const comMessageRef= ref() |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const checkLocation=() =>{ |
|
|
|
const checkLocation = () => { |
|
|
|
let isPass = true |
|
|
|
if (toLocationCode.value == '' || toLocationCode.value == null) { |
|
|
|
showMessageHint('请扫描收货库位', (callback) => { |
|
|
@ -294,7 +290,7 @@ const comMessageRef= ref() |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
const commit=() =>{ |
|
|
|
const commit = () => { |
|
|
|
scanCount.value = getScanCount(subList.value) |
|
|
|
if (scanCount.value == 0) { |
|
|
|
showErrorMessage('扫描数为0,请先扫描') |
|
|
@ -324,11 +320,11 @@ const comMessageRef= ref() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const checkCount=()=> { |
|
|
|
const checkCount = () => { |
|
|
|
let isCheck = true |
|
|
|
let hint = '' |
|
|
|
for (let i = 0; i < detailSource.value.length; i++) { |
|
|
|
const item =detailSource.value[i] |
|
|
|
const item = detailSource.value[i] |
|
|
|
for (let j = 0; j < item.subList.length; j++) { |
|
|
|
const subItem = item.subList[i] |
|
|
|
if (calc.sub(subItem.handleQty, subItem.qty) < 0) { |
|
|
@ -349,7 +345,7 @@ const comMessageRef= ref() |
|
|
|
return isCheck |
|
|
|
} |
|
|
|
|
|
|
|
const submitJob=() =>{ |
|
|
|
const submitJob = () => { |
|
|
|
uni.showLoading({ |
|
|
|
title: '提交中....', |
|
|
|
mask: true |
|
|
@ -358,7 +354,7 @@ const comMessageRef= ref() |
|
|
|
detailSource.value.forEach((item) => { |
|
|
|
itemCodes.push(item.itemCode) |
|
|
|
}) |
|
|
|
getManagementPrecisions(itemCodes,toLocationCode.value, (res) => { |
|
|
|
getManagementPrecisions(itemCodes, toLocationCode.value, (res) => { |
|
|
|
if (res.success) { |
|
|
|
managementList.value = res.list |
|
|
|
const params = setParams() |
|
|
@ -366,7 +362,7 @@ const comMessageRef= ref() |
|
|
|
.then((res) => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
|
showCommitSuccessMessage("提交成功<br>生成装配收货记录<br>" + res.data ) |
|
|
|
showCommitSuccessMessage("提交成功<br>生成装配收货记录<br>" + res.data) |
|
|
|
} else { |
|
|
|
showErrorMessage(`提交失败[${res.msg}]`) |
|
|
|
} |
|
|
@ -382,7 +378,7 @@ const comMessageRef= ref() |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const setParams=() =>{ |
|
|
|
const setParams = () => { |
|
|
|
const subList = [] |
|
|
|
const creator = store.id |
|
|
|
|
|
|
@ -394,7 +390,7 @@ const comMessageRef= ref() |
|
|
|
detail.toBatch = info.batch |
|
|
|
detail.toContainerNumber = '' |
|
|
|
detail.toInventoryStatus = detail.inventoryStatus |
|
|
|
detail.toLocationCode =toLocationCode.value |
|
|
|
detail.toLocationCode = toLocationCode.value |
|
|
|
subList.push(detail) |
|
|
|
} |
|
|
|
}) |
|
|
@ -404,19 +400,19 @@ const comMessageRef= ref() |
|
|
|
return jobContent.value |
|
|
|
} |
|
|
|
|
|
|
|
const scanPopupGetFocus=() =>{ |
|
|
|
const scanPopupGetFocus = () => { |
|
|
|
if (scanPopup.value != undefined) { |
|
|
|
scanPopup.value.getfocus() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const scanPopupLoseFocus=()=> { |
|
|
|
const scanPopupLoseFocus = () => { |
|
|
|
if (scanPopup.value != undefined) { |
|
|
|
scanPopup.value.losefocus() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const showMessage=(message)=> { |
|
|
|
const showMessage = (message) => { |
|
|
|
setTimeout((r) => { |
|
|
|
scanPopupLoseFocus() |
|
|
|
comMessageRef.value.showMessage(message, (res) => { |
|
|
@ -427,7 +423,7 @@ const comMessageRef= ref() |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const showErrorMessage=(message)=> { |
|
|
|
const showErrorMessage = (message) => { |
|
|
|
setTimeout((r) => { |
|
|
|
scanPopupLoseFocus() |
|
|
|
comMessageRef.value.showErrorMessage(message, (res) => { |
|
|
@ -438,19 +434,18 @@ const comMessageRef= ref() |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const showCommitSuccessMessage=(hint) =>{ |
|
|
|
const showCommitSuccessMessage = (hint) => { |
|
|
|
comMessageRef.value.showSuccessMessage(hint, (res) => { |
|
|
|
navigateBack(1) |
|
|
|
}) |
|
|
|
} |
|
|
|
const showQuestMessage=(hint, callBack) =>{ |
|
|
|
const showQuestMessage = (hint, callBack) => { |
|
|
|
comMessageRef.value.showQuestionMessage(hint, (res) => { |
|
|
|
if (res) { |
|
|
|
callBack(true) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped lang="scss"></style> |