Browse Source

修改跳转任务自动扫描2024/7/20 13:04:24

pull/1/head
张立 5 months ago
parent
commit
f328e61e08
  1. 29
      src/common/scan.js
  2. 15
      src/mycomponents/scan/winScanPack.vue
  3. 31
      src/mycomponents/scan/winScanPackAndLocation.vue
  4. 2
      src/pages.json
  5. 18
      src/pages/issue/coms/comScanIssuePack.vue
  6. 21
      src/pages/productPutaway/job/productPutawayDetail.vue
  7. 8
      src/pages/productPutaway/job/productPutawayJob.vue
  8. 893
      src/pages/productReceipt/job/ccProductReceiptDetail.vue
  9. 14
      src/pages/productReceipt/job/ccProductReceiptJob.vue
  10. 14
      src/pages/productReceipt/job/fgProductReceiptDetail.vue
  11. 21
      src/pages/productReceipt/job/productReceiptDetail.vue
  12. 24
      src/pages/productionReceipt/job/productionReceiptDetail.vue
  13. 8
      src/pages/productionReceipt/job/productionReceiptJob.vue
  14. 27
      src/pages/purchaseReceipt/job/receiptDetail.vue
  15. 10
      src/pages/purchaseReceipt/job/receiptJob.vue
  16. 24
      src/pages/putaway/job/putawayDetail.vue
  17. 7
      src/pages/putaway/job/putawayJob.vue
  18. 44
      src/pages/repleinsh/coms/comScanReplishPack.vue
  19. 7
      src/pages/repleinsh/job/repleinshDetail.vue
  20. 3
      src/pages/repleinsh/job/repleinshJob.vue

29
src/common/scan.js

@ -1,29 +0,0 @@
import {
getLabelInfo
} from '@/common/label.js';
// export function getLabelInfoResult(scanMsg, headerType callBackInfo) {
// let index = scanMsg.indexOf('\n');
// if (index >= 0) {
// // let content = uni.$u.trim(scanMsg)
// let content = scanMsg
// if (content == "") {
// return ""
// }
// getLabelInfo(content, headerType, callback => {
// let scanResult = callback;
// scanResult.scanMessage = content
// if (scanResult.success) {
// return scanResult
// } else {
// return ""
// }
// });
// }
// }
export function getLabelInfoResult(){
}

15
src/mycomponents/scan/winScanPack.vue

@ -16,8 +16,6 @@
</view> </view>
</view> </view>
</u-popup> </u-popup>
<!-- 模拟扫描功能 -->
<win-com-scan v-show="false" ref="comscansimulate" @getResult="getScanResult" :headerType="headerType" :isShowHistory="false" :clearResult="true"></win-com-scan>
<com-message ref="comMessageRef" @afterClose="getfocus" /> <com-message ref="comMessageRef" @afterClose="getfocus" />
</view> </view>
</template> </template>
@ -26,6 +24,8 @@
import { ref, getCurrentInstance, nextTick, onMounted } from 'vue' import { ref, getCurrentInstance, nextTick, onMounted } from 'vue'
import winComScan from '@/mycomponents/scan/winComScan.vue' import winComScan from '@/mycomponents/scan/winComScan.vue'
import { getLabelInfo } from '@/common/label.js'
const props = defineProps({ const props = defineProps({
title: { title: {
type: String, type: String,
@ -45,9 +45,14 @@ const comMessageRef = ref()
const comscan = ref() const comscan = ref()
const comscansimulate = ref() const comscansimulate = ref()
// //
const simulateScan = (item) => { const simulateScan = (scanMessage) => {
comscansimulate.value.setItemCodeSimulate(item.itemCode, item.copyContent) getLabelInfo(scanMessage, props.headerType, (callback) => {
comscansimulate.value.clickScanMsg() if (callback.success) {
getScanResult(callback)
} else {
showMessage(callback.message)
}
})
} }
const openScanPopup = () => { const openScanPopup = () => {
setTimeout((res) => { setTimeout((res) => {

31
src/mycomponents/scan/winScanPackAndLocation.vue

@ -34,8 +34,6 @@
</view> </view>
</u-popup> </u-popup>
<balance-select ref="balanceSelectRef" @onSelectItem="selectBalanceItem"></balance-select> <balance-select ref="balanceSelectRef" @onSelectItem="selectBalanceItem"></balance-select>
<!-- 模拟扫描功能 -->
<win-com-scan v-show="false" ref="comscansimulate" @getResult="getScanResult" :headerType="headerType" :isShowHistory="false" :clearResult="true"></win-com-scan>
</view> </view>
<com-message ref="comMessageRef" /> <com-message ref="comMessageRef" />
</template> </template>
@ -49,6 +47,7 @@ import { getBalanceByManagementPrecisionByPacking } from '@/common/balance.js'
import { getBasicLocationByCode } from '@/api/request2.js' import { getBasicLocationByCode } from '@/api/request2.js'
import { getListLocationAreaTypeDesc, checkDirectoryItemExist, getDirectoryItemArray, getLocationAreaTypeName, getInventoryStatusDesc } from '@/common/directory.js' import { getListLocationAreaTypeDesc, checkDirectoryItemExist, getDirectoryItemArray, getLocationAreaTypeName, getInventoryStatusDesc } from '@/common/directory.js'
import { getLabelInfo } from '@/common/label.js'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const props = defineProps({ const props = defineProps({
@ -158,27 +157,25 @@ const openScanPopupForJob = (fromLocationCodePrams, fromLocationListPrams, jobCo
const openScanPopupForJobSimulate = (fromLocationCodeParams, fromLocationListParams, jobContent, item) => { const openScanPopupForJobSimulate = (fromLocationCodeParams, fromLocationListParams, jobContent, item) => {
fromLocationCode.value = fromLocationCodeParams fromLocationCode.value = fromLocationCodeParams
fromLocationList.value = fromLocationListParams fromLocationList.value = fromLocationListParams
if (fromLocationListParams != '') { if (!fromLocationCodeParams) {
// this.packGetFocus(); if (fromLocationList.value.length == 0) {
if (comscansimulate.value != undefined) { // this.locationGetFocus();
comscansimulate.value.getfocus() alert('没有来源库位:List')
} else {
fromLocationCode.value = fromLocationList.value[0]
} }
} else if (fromLocationList.value.length == 0) {
// this.locationGetFocus();
alert('没有来源库位:List')
} else {
fromLocationCode.value = fromLocationList.value[0]
} }
fromInventoryStatuses.value = getDirectoryItemArray(jobContent.outInventoryStatuses) fromInventoryStatuses.value = getDirectoryItemArray(jobContent.outInventoryStatuses)
inventoryStatus.value = getDirectoryItemArray(jobContent.outInventoryStatuses) // 出库库存状态; //出库库存状态 inventoryStatus.value = getDirectoryItemArray(jobContent.outInventoryStatuses) // 出库库存状态; //出库库存状态
fromLocationAreaTypeList.value = getDirectoryItemArray(jobContent.fromAreaTypes) // fromLocationAreaTypeList.value = getDirectoryItemArray(jobContent.fromAreaTypes) //
const timer = setTimeout((res) => { getLabelInfo(scanMessage, headerType.value, (callback) => {
if (timer) { if (callback.success) {
clearTimeout(timer) getScanResult(callback)
} else {
showErrorMessage(callback.message, (res) => {})
} }
comscansimulate.value.setItemCodeSimulate(item.copyContent) })
comscansimulate.value.clickScanMsg()
}, 500)
} }
const closeScanPopup = (content) => { const closeScanPopup = (content) => {
show.value = false show.value = false

2
src/pages.json

@ -1892,7 +1892,7 @@
} }
}, },
{
"path": "pages/count/job/fuzzyCountJob", "path": "pages/count/job/fuzzyCountJob",
"style": { "style": {
"navigationBarTitleText": "盲盘任务", "navigationBarTitleText": "盲盘任务",

18
src/pages/issue/coms/comScanIssuePack.vue

@ -48,7 +48,7 @@
<com-message ref="comMessageRef" /> <com-message ref="comMessageRef" />
<balance-qty-edit ref="balanceQtyEditRef" @confirm="confirm" :isShowStatus="true"></balance-qty-edit> <balance-qty-edit ref="balanceQtyEditRef" @confirm="confirm" :isShowStatus="true"></balance-qty-edit>
<!-- 模拟扫描功能 --> <!-- 模拟扫描功能 -->
<win-com-scan v-show="false" ref="comscansimulate" placeholder="箱标签" @getResult="onScan" :clearResult="true" headerType="HPQ,HMQ" :isShowHistory="false"> </win-com-scan> <!-- <win-com-scan v-show="false" ref="comscansimulate" placeholder="箱标签" @getResult="onScan" :clearResult="true" headerType="HPQ,HMQ" :isShowHistory="false"> </win-com-scan> -->
</view> </view>
</template> </template>
@ -67,6 +67,7 @@ import { calc } from '@/common/calc.js'
import { getBalanceByManagementPrecision } from '@/common/balance.js' import { getBalanceByManagementPrecision } from '@/common/balance.js'
import { getDirectoryItemArray } from '../../../common/directory.js' import { getDirectoryItemArray } from '../../../common/directory.js'
import { getLabelInfo } from '@/common/label.js'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const props = defineProps({ const props = defineProps({
@ -114,16 +115,13 @@ const openScanPopupForJobSimulate = (content, jobcontentParams, scanMessage) =>
dataContent.value = content dataContent.value = content
jobContent.value = jobcontentParams jobContent.value = jobcontentParams
initData() initData()
if (comscansimulate.value.vlaue != undefined) { getLabelInfo(scanMessage, 'HPQ,HMQ', (callback) => {
comscansimulate.value.vlaue.getfocus() if (callback.success) {
} onScan(callback)
const timer = setTimeout((res) => { } else {
if (timer) { showErrorMessage(callback.message, (res) => {})
clearTimeout(timer)
} }
comscansimulate.value.vlaue.setItemCodeSimulate(scanMessage) })
comscansimulate.value.vlaue.clickScanMsg()
}, 500)
} }
const openScanPopup = (content, jobcontentParams) => { const openScanPopup = (content, jobcontentParams) => {
issueRecord.value = [] issueRecord.value = []

21
src/pages/productPutaway/job/productPutawayDetail.vue

@ -77,7 +77,7 @@ const jobToLocationCode = ref('')
const type = ref('') const type = ref('')
const isCheckLocation = ref(false) const isCheckLocation = ref(false)
const switchCode = ref('') const switchCode = ref('')
const scanedPackingNumber = ref('') const scanMessage = ref('')
const hintTitle = ref('') const hintTitle = ref('')
const status = ref('') const status = ref('')
const scanPopup = ref() const scanPopup = ref()
@ -87,7 +87,7 @@ const comMessageRef = ref()
onLoad((option) => { onLoad((option) => {
id.value = option.id id.value = option.id
type.value = option.type type.value = option.type
scanedPackingNumber.value = option.scaned || '' scanMessage.value = option.scanMessage || ''
status.value = option.status || '' status.value = option.status || ''
if (type.value == 'predict') { if (type.value == 'predict') {
switchCode.value = 'SemiPutawayLocationCodeValidate' switchCode.value = 'SemiPutawayLocationCodeValidate'
@ -172,16 +172,9 @@ const getDetail = () => {
} else { } else {
toLocationCode.value = jobToLocationCode.value toLocationCode.value = jobToLocationCode.value
} }
detailSource.value.forEach((r) => { if (scanMessage.value) {
r.subList.forEach((s) => { openScanPopupSimulate(scanMessage.value)
if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) { }
s.scaned = true
s.cancleScanedHiht = true
openScanPopupSimulate(s)
scanedPackingNumber.value = ''
}
})
})
} else { } else {
showMessage('列表数据为0') showMessage('列表数据为0')
} }
@ -209,7 +202,7 @@ const updateData = () => {
const openDetail = (item) => { const openDetail = (item) => {
detailInfoPopupRef.value.openPopup(item) detailInfoPopupRef.value.openPopup(item)
} }
const openScanPopupSimulate = (item) => { const openScanPopupSimulate = (scanMessage) => {
let fromlocationCode = '' let fromlocationCode = ''
const fromlocationList = [] const fromlocationList = []
for (let i = 0; i < detailSource.value.length; i++) { for (let i = 0; i < detailSource.value.length; i++) {
@ -226,7 +219,7 @@ const openScanPopupSimulate = (item) => {
} }
}) })
} }
scanPopup.value.openScanPopupForJobSimulate(fromlocationCode, fromlocationList, jobContent.value, item) scanPopup.value.openScanPopupForJobSimulate(fromlocationCode, fromlocationList, jobContent.value, scanMessage)
} }
const openScanPopup = () => { const openScanPopup = () => {
let fromlocationCode = '' let fromlocationCode = ''

8
src/pages/productPutaway/job/productPutawayJob.vue

@ -62,6 +62,7 @@ const todayTime = ref('')
const status = ref('1,2') // const status = ref('1,2') //
const detailOptions = ref([]) const detailOptions = ref([])
const detailGiveupOptions = ref([]) const detailGiveupOptions = ref([])
const scanMessage = ref('')
const filter = ref() const filter = ref()
const comMessageRef = ref() const comMessageRef = ref()
const jobInfoPopupRef = ref() const jobInfoPopupRef = ref()
@ -157,10 +158,11 @@ const getList = (type) => {
showMessage(error) showMessage(error)
}) })
} }
const openJobDetail = (item, packingNumber = '') => { const openJobDetail = (item, scanMessage = '') => {
uni.navigateTo({ uni.navigateTo({
url: `./productPutawayDetail?id=${item.masterId}&status=${item.status}&type=${item.type}&scaned=${packingNumber}&title=${title.value}` url: `./productPutawayDetail?id=${item.masterId}&status=${item.status}&type=${item.type}&scaned=${packingNumber}&title=${title.value}`
}) })
scanMessage.value = ''
} }
const showItemList = (itemList) => { const showItemList = (itemList) => {
@ -268,10 +270,11 @@ const openScanPopup = () => {
} }
const selectItem = (item) => { const selectItem = (item) => {
scanPopup.value.closeScanPopup() scanPopup.value.closeScanPopup()
openJobDetail(item, item.packingNumber) openJobDetail(item, scanMessage.value)
} }
const getScanResult = (result) => { const getScanResult = (result) => {
try { try {
scanMessage.value = ''
const filters = [ const filters = [
{ {
column: 'packingNumber', column: 'packingNumber',
@ -320,6 +323,7 @@ const getScanResult = (result) => {
pageSize: 100 pageSize: 100
}) })
.then((res) => { .then((res) => {
scanMessage.value = result.scanMessage
const resultList = res.data.list const resultList = res.data.list
if (resultList.length > 0) { if (resultList.length > 0) {
resultList.forEach((item) => { resultList.forEach((item) => {

893
src/pages/productReceipt/job/ccProductReceiptDetail.vue

@ -1,456 +1,451 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<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> </view>
</view> </view>
<view class="page-main"> <view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<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="cen_card" style="padding: 5rpx"> <view class="cen_card" style="padding: 5rpx">
<view class="cell_box uni-flex uni-row"> <view class="cell_box uni-flex uni-row">
<view class="cell_info"> <view class="cell_info">
<view class="text_lightblue">车间</view> <view class="text_lightblue">车间</view>
<view> <view>
{{ jobContent.workShopCode }} {{ jobContent.workShopCode }}
</view> </view>
</view> </view>
<view class="cell_info"> <view class="cell_info">
<view class="text_lightblue">生产线</view> <view class="text_lightblue">生产线</view>
<view> <view>
{{ item.subList[0].productionLineCode }} {{ item.subList[0].productionLineCode }}
</view> </view>
</view> </view>
<view class="cell_info"> <view class="cell_info">
<view class="text_lightblue">班组</view> <view class="text_lightblue">班组</view>
<view> <view>
{{ jobContent.team }} {{ jobContent.team }}
</view> </view>
</view> </view>
<view class="cell_info"> <view class="cell_info">
<view class="text_lightblue">班次</view> <view class="text_lightblue">班次</view>
<view> <view>
{{ jobContent.shift }} {{ jobContent.shift }}
</view> </view>
</view> </view>
</view> </view>
<view class="split_line"></view> <view class="split_line"></view>
</view> </view>
<view class=""> <view class="">
<comProductDetailCard :dataContent="item" :settingParam="jobContent" :isShowLocation="false" @remove="updateData" @updateData="updateData" :locationAreaTypeList="toLocationAreaTypeList"> </comProductDetailCard> <comProductDetailCard :dataContent="item" :settingParam="jobContent" :isShowLocation="false"
</view> @remove="updateData" @updateData="updateData" :locationAreaTypeList="toLocationAreaTypeList">
</view> </comProductDetailCard>
</scroll-view> </view>
</view> </view>
</scroll-view>
<view class="page-footer"> </view>
<view class="uni-flex u-col-center space-between padding_10" style="background-color: ghostwhite; width: 100%">
<view class=""> <view class="page-footer">
<locationCompare ref="comScanLocation" title="收货库位" :isShowEdit="jobContent.allowModifyLocation == 'TRUE'" :recommendLocationCode="jobToLocationCode" :locationCode="toLocationCode" @getLocation="scanLocationCode" :locationAreaTypeList="toLocationAreaTypeList"></locationCompare> <view class="uni-flex u-col-center space-between padding_10" style="background-color: ghostwhite; width: 100%">
</view> <view class="">
<view class="uni-flex uni-row"> <<locationCompare ref="comScanLocation" title="收货库位" :isShowEdit="jobContent.allowModifyLocation=='TRUE'"
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> :recommendLocationCode="jobToLocationCode" :locationCode="toLocationCode" @getLocation='scanLocationCode'
</view> :locationAreaTypeList="toLocationAreaTypeList">
</view> </locationCompare>
</view> </view>
<view class="uni-flex uni-row">
<win-scan-button @goScan="openScanPopup"></win-scan-button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
<win-scan-pack ref="scanPopup" @getResult="getScanResult" :title="'制品标签'" headerType="HMQ"></win-scan-pack> </view>
<com-message ref="comMessageRef" /> </view>
</view> </view>
<win-scan-button @goScan="openScanPopup"></win-scan-button>
<win-scan-pack ref="scanPopup" @getResult="getScanResult" :title="'制品标签'" headerType="HMQ"></win-scan-pack>
<com-message ref="comMessageRef" />
</view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, getCurrentInstance, nextTick, onMounted } from 'vue' import { ref, getCurrentInstance, nextTick, onMounted } from 'vue'
import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app' import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import { getManagementPrecisions } from '@/common/balance.js' import { getManagementPrecisions } from '@/common/balance.js'
import { getProductReceiptJobDetail, takeProductReceiptJob, cancleTakeProductReceiptJob, ccProductReceiptJobsubmit } from '@/api/request2.js' import { getProductReceiptJobDetail, takeProductReceiptJob, cancleTakeProductReceiptJob, ccProductReceiptJobsubmit } from '@/api/request2.js'
import { goHome, navigateBack, getPackingNumberAndBatch } from '@/common/basic.js' import { goHome, navigateBack, getPackingNumberAndBatch } from '@/common/basic.js'
import { getDirectoryItemArray, getInventoryStatusName } from '@/common/directory.js' import { getDirectoryItemArray, getInventoryStatusName } from '@/common/directory.js'
import { getDataSource, createRecordInfo, calcHandleQty, getScanCount } from '@/common/detail.js' import { getDataSource, createRecordInfo, calcHandleQty, getScanCount } from '@/common/detail.js'
import { calc } from '@/common/calc.js' import { calc } from '@/common/calc.js'
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import locationCompare from '@/mycomponents/location/locationCompare.vue' import locationCompare from '@/mycomponents/location/locationCompare.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue' import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import comDetailCard from '@/mycomponents/detail/comDetailCard.vue' import comDetailCard from '@/mycomponents/detail/comDetailCard.vue'
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
import comProductDetailCard from '@/pages/productReceipt/coms/comProductDetailCard.vue' import comProductDetailCard from '@/pages/productReceipt/coms/comProductDetailCard.vue'
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
// store // store
const store = useCountStore() const store = useCountStore()
const id= ref('') const id = ref('')
const receiptJob= ref({}) const receiptJob = ref({})
const toLocationCode= ref('') const toLocationCode = ref('')
const isShowPackingCode= ref(true) const isShowPackingCode = ref(true)
const scanCount= ref(0) const scanCount = ref(0)
const jobContent= ref({})// const jobContent = ref({})//
const subList= ref([])// subList const subList = ref([])// subList
const detailSource= ref([])// const detailSource = ref([])//
const toLocationAreaTypeList= ref([]) const toLocationAreaTypeList = ref([])
const managementList= ref([]) const managementList = ref([])
const jobStatus= ref('') const jobStatus = ref('')
const jobToLocationCode= ref('') const jobToLocationCode = ref('')
const scanedPackingNumber= ref('') const scanedPackingNumber = ref('')
const status= ref('') const status = ref('')
const comScanLocation= ref() const scanMessage = ref('')
const scanPopup= ref() const comScanLocation = ref()
const comMessageRef= ref() const scanPopup = ref()
const comMessageRef = ref()
onLoad((option)=> {
setTimeout(res=>{ onLoad((option) => {
uni.setNavigationBarTitle({ setTimeout(res => {
title: `${option.title}详情` uni.setNavigationBarTitle({
}) title: `${option.title}详情`
})
},50)
id.value = option.id }, 50)
scanedPackingNumber.value = option.scaned || '' id.value = option.id
status.value = option.status || '' scanMessage.value = option.scanMessage || ''
}) status.value = option.status || ''
onShow(() =>{ })
if (id.value != undefined) { onShow(() => {
// if (id.value != undefined) {
if (status.value == '1') { //
receive((callback) => { if (status.value == '1') {
getDetail() receive((callback) => {
}) getDetail()
} else { })
getDetail() } else {
} getDetail()
} }
}) }
// })
onNavigationBarButtonTap((e) =>{ //
if (e.index === 0) { onNavigationBarButtonTap((e) => {
goHome() if (e.index === 0) {
} goHome()
}) }
// })
onBackPress((e)=> { //
// onBackPress((e) => {
if (e.from == 'backbutton') { //
if (jobStatus.value == '2') { if (e.from == 'backbutton') {
// if (jobStatus.value == '2') {
cancleTakeProductReceiptJob(id.value ) //
.then((res) => { cancleTakeProductReceiptJob(id.value)
uni.navigateBack() .then((res) => {
}) uni.navigateBack()
.catch((error) => { })
uni.navigateBack() .catch((error) => {
}) uni.navigateBack()
} else { })
uni.navigateBack() } else {
} uni.navigateBack()
}
return true
} return true
}) }
})
onPullDownRefresh(() =>{
getDetail() onPullDownRefresh(() => {
uni.stopPullDownRefresh() getDetail()
}) uni.stopPullDownRefresh()
})
//
const receive=(callback)=> { //
if (id.value != null) { const receive = (callback) => {
takeProductReceiptJob(id.value) if (id.value != null) {
.then((res) => { takeProductReceiptJob(id.value)
callback() .then((res) => {
}) callback()
.catch((error) => { })
showErrorMessage(error) .catch((error) => {
}) showErrorMessage(error)
} })
} }
}
const getDetail=() =>{
uni.showLoading({ const getDetail = () => {
title: '加载中....', uni.showLoading({
mask: true title: '加载中....',
}) mask: true
getProductReceiptJobDetail(that.id) })
.then((res) => { getProductReceiptJobDetail(that.id)
uni.hideLoading() .then((res) => {
if (res.data == null) { uni.hideLoading()
showMessage('未获取到详情') if (res.data == null) {
} else if (res.data.subList.length > 0) { showMessage('未获取到详情')
jobContent.value = res.data } else if (res.data.subList.length > 0) {
subList.value = res.data.subList jobContent.value = res.data
jobStatus.value = res.data.status subList.value = res.data.subList
jobToLocationCode.value = subList.value[0].toLocationCode jobStatus.value = res.data.status
if (jobContent.value.allowModifyLocation == 'FALSE') { jobToLocationCode.value = subList.value[0].toLocationCode
toLocationCode.value = subList.value[0].toLocationCode if (jobContent.value.allowModifyLocation == 'FALSE') {
} toLocationCode.value = subList.value[0].toLocationCode
toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes) }
detailSource.value = getDataSource(subList.value) toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes)
detailSource.value.forEach((r) => { detailSource.value = getDataSource(subList.value)
r.subList.forEach((s) => { if (scanMessage.value) {
if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) { scanPopup.value.simulateScan(scanMessage.value);
s.scaned = true }
s.cancleScanedHiht = true } else {
s.copyContent = `HMQ;V1.0;I${s.itemCode};P${s.packingNumber};B${s.batch};Q${s.qty}` showMessage('列表数据为0')
}
scanPopup.value.simulateScan(s) })
scanedPackingNumber.value = '' .catch((error) => {
// s.handleQty =s.qty uni.hideLoading()
} showErrorMessage(error)
}) })
}) }
} else {
showMessage('列表数据为0') const getScanResult = (result) => {
} const { label } = result
}) const { packingNumber } = label
.catch((error) => { const { batch } = label
uni.hideLoading() const { qty } = label
showErrorMessage(error) const { itemCode } = label
})
} const detail = detailSource.find((r) => r.itemCode == itemCode)
if (detail == undefined) {
const getScanResult=(result) =>{ showErrorMessage(`物料号【${itemCode}】不在列表中`)
const { label } = result } else {
const { packingNumber } = label const itemDetail = detail.subList.find((r) => r.packingNumber == packingNumber && r.batch == batch)
const { batch } = label if (itemDetail == undefined) {
const { qty } = label showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]不在任务列表中`)
const { itemCode } = label } else if (itemDetail.scaned) {
showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]已经扫描`)
const detail = detailSource.find((r) => r.itemCode == itemCode) } else {
if (detail == undefined) { itemDetail.scaned = true
showErrorMessage(`物料号【${itemCode}】不在列表中`) itemDetail.handleQty = Number(result.label.qty)
} else { itemDetail.toLocationCode = toLocationCode.value
const itemDetail = detail.subList.find((r) => r.packingNumber == packingNumber && r.batch == batch) itemDetail.labelQty = Number(result.label.qty)
if (itemDetail == undefined) { calcHandleQty(detailSource.value)
showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]不在任务列表中`) continueScan()
} else if (!itemDetail.cancleScanedHiht && itemDetail.scaned) { $forceUpdate()
showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]已经扫描`) }
} else { }
itemDetail.scaned = true }
itemDetail.handleQty = Number(result.label.qty)
itemDetail.toLocationCode = toLocationCode.value //
itemDetail.labelQty = Number(result.label.qty) const continueScan = () => {
calcHandleQty(detailSource.value) scanCount.value = getScanCount(subList.value)
continueScan() if (scanCount.value == subList.value.length) {
$forceUpdate() closeScanPopup()
} } else {
} scanPopupGetFocus()
} }
}
//
const continueScan=()=> { const updateData = () => {
scanCount.value = getScanCount(subList.value) calcHandleQty(detailSource.value)
if (scanCount.value == subList.value.length) { }
closeScanPopup()
} else { const openScanPopup = () => {
scanPopupGetFocus() scanPopup.value.openScanPopup()
} }
}
const closeScanPopup = () => {
const updateData=() =>{ scanPopup.value.closeScanPopup()
calcHandleQty(detailSource.value) }
}
const scanLocationCode = (location, code) => {
const openScanPopup=() =>{ toLocationCode.value = code
scanPopup.value.openScanPopup() detailSource.value.forEach((item) => {
} item.subList.forEach((detail) => {
detail.toLocationCode = code
const closeScanPopup=() =>{ })
scanPopup.value.closeScanPopup() })
} }
const scanLocationCode=(location, code) =>{ const checkLocation = () => {
toLocationCode.value = code let isPass = true
detailSource.value.forEach((item) => { if (toLocationCode.value == '' || toLocationCode.value == null) {
item.subList.forEach((detail) => { showMessageHint('请扫描收货库位', (callback) => {
detail.toLocationCode = code comScanLocation.value.showLocation()
}) })
})
} return (isPass = false)
}
const checkLocation=() =>{ return isPass
let isPass = true }
if (toLocationCode.value == '' || toLocationCode.value == null) {
showMessageHint('请扫描收货库位', (callback) => { const showMessageHint(hint, callback) {
comScanLocation.value.showLocation() comMessageRef.value.showErrorMessage(hint, (res) => {
}) if (res) {
callback()
return (isPass = false) }
} })
return isPass }
} const commit = () => {
scanCount.value = getScanCount(subList.value)
const showMessageHint(hint, callback) { if (scanCount.value == 0) {
comMessageRef.value.showErrorMessage(hint, (res) => { showErrorMessage('扫描数为0,请先扫描')
if (res) { return
callback() }
} //
}) if (!checkLocation()) {
} return
const commit=() =>{ }
scanCount.value = getScanCount(subList.value)
if (scanCount.value == 0) { //
showErrorMessage('扫描数为0,请先扫描') if (scanCount.value == subList.value.length) {
return if (checkCount()) {
} submitJob()
// }
if (!checkLocation()) { } else if (scanCount.value < subList.value.length) {
return //
} if (jobContent.value.allowPartialComplete == 'TRUE') {
//
// if (checkCount()) {
if (scanCount.value == subList.value.length) { submitJob()
if (checkCount()) { }
submitJob() } else {
} //
} else if (scanCount.value < subList.value.length) { showMessage('请完成扫描后,再进行提交<br>' + `已经扫描[${scanCount.value}]总共[${subList.value.length}]`)
// }
if (jobContent.value.allowPartialComplete == 'TRUE') { }
// }
if (checkCount()) {
submitJob() const checkCount = () => {
} let isCheck = true
} else { let hint = ''
// for (let i = 0; i < detailSource.value.length; i++) {
showMessage('请完成扫描后,再进行提交<br>' + `已经扫描[${scanCount.value}]总共[${subList.value.length}]`) 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) {
isCheck = false
const checkCount=()=> { hint = `包装【${subItem.packingNumber}】实际收货数量:${subItem.handleQty}与包装数量${subItem.qty}不相等,是否继续收货?`
let isCheck = true break
let hint = '' }
for (let i = 0; i < detailSource.value.length; i++) { }
const item =detailSource.value[i] }
for (let j = 0; j < item.subList.length; j++) { if (!isCheck) {
const subItem = item.subList[i] showQuestMessage(hint, (res) => {
if (calc.sub(subItem.handleQty, subItem.qty) < 0) { if (res) {
isCheck = false submitJob()
hint = `包装【${subItem.packingNumber}】实际收货数量:${subItem.handleQty}与包装数量${subItem.qty}不相等,是否继续收货?` }
break })
} }
}
} return isCheck
if (!isCheck) { }
showQuestMessage(hint, (res) => {
if (res) { const submitJob = () => {
submitJob() uni.showLoading({
} title: '提交中....',
}) mask: true
} })
const itemCodes = []
return isCheck detailSource.value.forEach((item) => {
} itemCodes.push(item.itemCode)
})
const submitJob=() =>{ getManagementPrecisions(itemCodes, toLocationCode.value, (res) => {
uni.showLoading({ if (res.success) {
title: '提交中....', managementList.value = res.list
mask: true const params = setParams()
}) ccProductReceiptJobsubmit(params)
const itemCodes = [] .then((res) => {
detailSource.value.forEach((item) => { uni.hideLoading()
itemCodes.push(item.itemCode) if (res.data) {
}) showCommitSuccessMessage("提交成功<br>生成装配收货记录<br>" + res.data)
getManagementPrecisions(itemCodes,toLocationCode.value, (res) => { } else {
if (res.success) { showErrorMessage(`提交失败[${res.msg}]`)
managementList.value = res.list }
const params = setParams() })
ccProductReceiptJobsubmit(params) .catch((error) => {
.then((res) => { uni.hideLoading()
uni.hideLoading() showErrorMessage(error)
if (res.data) { })
showCommitSuccessMessage("提交成功<br>生成装配收货记录<br>" + res.data ) } else {
} else { uni.hideLoading()
showErrorMessage(`提交失败[${res.msg}]`) showErrorMessage(res.message)
} }
}) })
.catch((error) => { }
uni.hideLoading()
showErrorMessage(error) const setParams = () => {
}) const subList = []
} else { const creator = store.id
uni.hideLoading()
showErrorMessage(res.message) detailSource.value.forEach((item) => {
} item.subList.forEach((detail) => {
}) if (detail.scaned) {
} const info = getPackingNumberAndBatch(managementList.value, detail.itemCode, detail.packingNumber, detail.batch)
detail.toPackingNumber = info.packingNumber
const setParams=() =>{ detail.toBatch = info.batch
const subList = [] detail.toContainerNumber = ''
const creator = store.id detail.toInventoryStatus = detail.inventoryStatus
detail.toLocationCode = toLocationCode.value
detailSource.value.forEach((item) => { subList.push(detail)
item.subList.forEach((detail) => { }
if (detail.scaned) { })
const info = getPackingNumberAndBatch(managementList.value, detail.itemCode, detail.packingNumber, detail.batch) })
detail.toPackingNumber = info.packingNumber jobContent.value.subList = subList
detail.toBatch = info.batch jobContent.value.creator = creator
detail.toContainerNumber = '' return jobContent.value
detail.toInventoryStatus = detail.inventoryStatus }
detail.toLocationCode =toLocationCode.value
subList.push(detail) const scanPopupGetFocus = () => {
} if (scanPopup.value != undefined) {
}) scanPopup.value.getfocus()
}) }
jobContent.value.subList = subList }
jobContent.value.creator = creator
return jobContent.value const scanPopupLoseFocus = () => {
} if (scanPopup.value != undefined) {
scanPopup.value.losefocus()
const scanPopupGetFocus=() =>{ }
if (scanPopup.value != undefined) { }
scanPopup.value.getfocus()
} const showMessage = (message) => {
} setTimeout((r) => {
scanPopupLoseFocus()
const scanPopupLoseFocus=()=> { comMessageRef.value.showMessage(message, (res) => {
if (scanPopup.value != undefined) { if (res) {
scanPopup.value.losefocus() scanPopupGetFocus()
} }
} })
})
const showMessage=(message)=> { }
setTimeout((r) => {
scanPopupLoseFocus() const showErrorMessage = (message) => {
comMessageRef.value.showMessage(message, (res) => { setTimeout((r) => {
if (res) { scanPopupLoseFocus()
scanPopupGetFocus() comMessageRef.value.showErrorMessage(message, (res) => {
} if (res) {
}) scanPopupGetFocus()
}) }
} })
})
const showErrorMessage=(message)=> { }
setTimeout((r) => {
scanPopupLoseFocus() const showCommitSuccessMessage = (hint) => {
comMessageRef.value.showErrorMessage(message, (res) => { comMessageRef.value.showSuccessMessage(hint, (res) => {
if (res) { navigateBack(1)
scanPopupGetFocus() })
} }
}) const showQuestMessage = (hint, callBack) => {
}) comMessageRef.value.showQuestionMessage(hint, (res) => {
} if (res) {
callBack(true)
const showCommitSuccessMessage=(hint) =>{ }
comMessageRef.value.showSuccessMessage(hint, (res) => { })
navigateBack(1) }
})
}
const showQuestMessage=(hint, callBack) =>{
comMessageRef.value.showQuestionMessage(hint, (res) => {
if (res) {
callBack(true)
}
})
}
</script> </script>
<style scoped lang="scss"></style> <style scoped lang="scss"></style>

14
src/pages/productReceipt/job/ccProductReceiptJob.vue

@ -68,6 +68,7 @@
const detailGiveupOptions = ref([]) const detailGiveupOptions = ref([])
const type = ref('assemble') const type = ref('assemble')
const title = ref("") const title = ref("")
const scanMessage = ref("")
const filter = ref() const filter = ref()
const comMessageRef = ref() const comMessageRef = ref()
const jobListPopupRef = ref() const jobListPopupRef = ref()
@ -182,11 +183,11 @@
}) })
} }
const openJobDetail = (item, packingNumber = '') => { const openJobDetail = (item, scanMessage = '') => {
uni.navigateTo({ uni.navigateTo({
url: `./ccProductReceiptDetail?id=${item.masterId}&status=${item.status}&scaned=${packingNumber}&title=${title.value}` url: `./ccProductReceiptDetail?id=${item.masterId}&status=${item.status}&scaned=${scanMessage}&title=${title.value}`
}) })
scanMessage.value = ''
} }
const showItemList = (itemList) => { const showItemList = (itemList) => {
@ -308,6 +309,7 @@
} }
const getScanResult = (result) => { const getScanResult = (result) => {
try { try {
scanMessage.value = ""
const filters = [ const filters = [
{ {
column: 'packingNumber', column: 'packingNumber',
@ -338,6 +340,11 @@
column: 'status', column: 'status',
action: 'in', action: 'in',
value: '1,2' value: '1,2'
},
{
column: "accept_user_id",
action: "==",
value: store.id
} }
// { // {
// column: "fromLocationCode", // column: "fromLocationCode",
@ -351,6 +358,7 @@
pageSize: 100 pageSize: 100
}) })
.then((res) => { .then((res) => {
scanMessage.value =result.scanMessage
const resultList = res.data.list const resultList = res.data.list
if (resultList.length > 0) { if (resultList.length > 0) {
resultList.forEach((item) => { resultList.forEach((item) => {

14
src/pages/productReceipt/job/fgProductReceiptDetail.vue

@ -102,7 +102,7 @@ const jobStatus = ref('')
const jobToLocationCode = ref('') const jobToLocationCode = ref('')
const fgList = ref([]) const fgList = ref([])
const itemCode = ref('') const itemCode = ref('')
const scanedPackingNumber = ref('') const scanMessage = ref('')
// const isCheckLocation = ref(false) // const isCheckLocation = ref(false)
const scanPopup = ref() const scanPopup = ref()
const comScanIssuePackRef = ref() const comScanIssuePackRef = ref()
@ -114,7 +114,7 @@ onLoad((option) => {
title: `${option.title}详情` title: `${option.title}详情`
}) })
id.value = option.id id.value = option.id
scanedPackingNumber.value = option.scaned || '' scanMessage.value = option.scanMessage || ''
if (id.value != undefined) { if (id.value != undefined) {
// //
if (option.status == '1') { if (option.status == '1') {
@ -184,16 +184,6 @@ const getDetail = () => {
} }
toLocationTypeList.value = getDirectoryItemArray(jobContent.value.toLocationTypes) toLocationTypeList.value = getDirectoryItemArray(jobContent.value.toLocationTypes)
detailSource.value = getDataSource(subList.value) detailSource.value = getDataSource(subList.value)
detailSource.value.forEach((r) => {
r.subList.forEach((s) => {
if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) {
s.scaned = true
//
scanPopup.value.simulateScan(s)
scanedPackingNumber.value = ''
}
})
})
} else { } else {
showMessage('列表数据为0') showMessage('列表数据为0')
} }

21
src/pages/productReceipt/job/productReceiptDetail.vue

@ -100,8 +100,8 @@ const toLocationAreaTypeList = ref([])
const managementList = ref([]) const managementList = ref([])
const jobStatus = ref('') const jobStatus = ref('')
const jobToLocationCode = ref('') const jobToLocationCode = ref('')
const scanedPackingNumber = ref('')
const status = ref('') const status = ref('')
const scanMessage = ref('')
const scanPopup = ref() const scanPopup = ref()
const comScanLocation = ref() const comScanLocation = ref()
const comMessageRef = ref() const comMessageRef = ref()
@ -110,7 +110,7 @@ onLoad((option) => {
title: `${option.title}详情` title: `${option.title}详情`
}) })
id.value = option.id id.value = option.id
scanedPackingNumber.value = option.scaned || '' scanMessage.value = option.scanMessage || ''
status.value = option.status || '' status.value = option.status || ''
}) })
onShow(() => { onShow(() => {
@ -183,18 +183,9 @@ const getDetail = () => {
} }
toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes) toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes)
detailSource.value = getDataSource(subList.value) detailSource.value = getDataSource(subList.value)
detailSource.value.forEach((r) => { if (scanMessage.value) {
r.subList.forEach((s) => { scanPopup.value.simulateScan(scanMessage.value)
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
}
})
})
} else { } else {
showMessage('列表数据为0') showMessage('列表数据为0')
} }
@ -218,7 +209,7 @@ const getScanResult = (result) => {
const itemDetail = detail.subList.find((r) => r.packingNumber == packingNumber && r.batch == batch) const itemDetail = detail.subList.find((r) => r.packingNumber == packingNumber && r.batch == batch)
if (itemDetail == undefined) { if (itemDetail == undefined) {
showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]不在任务列表中`) showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]不在任务列表中`)
} else if (!itemDetail.cancleScanedHiht && itemDetail.scaned) { } else if (itemDetail.scaned) {
showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]已经扫描`) showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]已经扫描`)
} else { } else {
itemDetail.scaned = true itemDetail.scaned = true

24
src/pages/productionReceipt/job/productionReceiptDetail.vue

@ -75,7 +75,7 @@ const toLocationAreaTypeList = ref([])
const jobStatus = ref('') const jobStatus = ref('')
const jobToLocationCode = ref('') const jobToLocationCode = ref('')
const isCheckLocation = ref(false) const isCheckLocation = ref(false)
const scanedPackingNumber = ref('') const scanMessage = ref('')
const scanPopup = ref() const scanPopup = ref()
const comScanIssuePackRef = ref() const comScanIssuePackRef = ref()
const detailInfoPopupRef = ref() const detailInfoPopupRef = ref()
@ -86,7 +86,7 @@ onLoad((option) => {
title: `${option.title}详情` title: `${option.title}详情`
}) })
id.value = option.id id.value = option.id
scanedPackingNumber.value = option.scaned scanMessage.value = option.scanMessage
if (id.value != undefined) { if (id.value != undefined) {
// //
if (option.status == '1') { if (option.status == '1') {
@ -156,17 +156,9 @@ const getDetail = () => {
} else { } else {
toLocationCode.value = jobToLocationCode.value toLocationCode.value = jobToLocationCode.value
} }
detailSource.value.forEach((r) => { if (scanMessage.value) {
r.subList.forEach((s) => { openScanPopupSimulate(scanMessage.value)
if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) { }
s.scaned = true
s.cancleScanedHiht = true
//
openScanPopupSimulate(s)
scanedPackingNumber.value = ''
}
})
})
} else { } else {
showMessage('列表数据为0') showMessage('列表数据为0')
} }
@ -219,7 +211,7 @@ const closeScanPopup = () => {
scanPopup.value.closeScanPopup() scanPopup.value.closeScanPopup()
} }
// //
const openScanPopupSimulate = (item) => { const openScanPopupSimulate = (scanMessage) => {
let fromlocationCode = '' let fromlocationCode = ''
const fromlocationList = [] const fromlocationList = []
for (let i = 0; i < detailSource.value.length; i++) { for (let i = 0; i < detailSource.value.length; i++) {
@ -238,7 +230,7 @@ const openScanPopupSimulate = (item) => {
} }
}) })
} }
scanPopup.value.openScanPopupForJobSimulate(fromlocationCode, fromlocationList, jobContent.value, item) scanPopup.value.openScanPopupForJobSimulate(fromlocationCode, fromlocationList, jobContent.value, scanMessage)
} }
const getScanResult = (result) => { const getScanResult = (result) => {
try { try {
@ -263,7 +255,7 @@ const getScanResult = (result) => {
}) })
if (itemDetail == undefined) { if (itemDetail == undefined) {
showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]库位[${locationCode}]不在列表中`) showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]库位[${locationCode}]不在列表中`)
} else if (!itemDetail.cancleScanedHiht && itemDetail.scaned) { } else if (itemDetail.scaned) {
showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]库位[${locationCode}]已经扫描`) showErrorMessage(`箱码[${packingNumber}]` + `批次[${batch}]库位[${locationCode}]已经扫描`)
} else { } else {
const balanceStatus = getInventoryStatusName(result.balance.inventoryStatus) const balanceStatus = getInventoryStatusName(result.balance.inventoryStatus)

8
src/pages/productionReceipt/job/productionReceiptJob.vue

@ -56,6 +56,7 @@ const detailOptions = ref([])
const detailGiveupOptions = ref([]) const detailGiveupOptions = ref([])
const filter = ref() const filter = ref()
const title = ref('') const title = ref('')
const scanMessage = ref('')
const comMessageRef = ref() const comMessageRef = ref()
const jobInfoPopupRef = ref() const jobInfoPopupRef = ref()
const jobListPopupRef = ref() const jobListPopupRef = ref()
@ -159,8 +160,9 @@ const getList = (type) => {
showErrorMessage(error) showErrorMessage(error)
}) })
} }
const openJobDetail = (item, packingNumber = '') => { const openJobDetail = (item, scanMessage = '') => {
proxy.$tab.navigateTo(`./productionReceiptDetail?id=${item.masterId}&status=${item.status}&scaned=${packingNumber}`) proxy.$tab.navigateTo(`./productionReceiptDetail?id=${item.masterId}&status=${item.status}&scaned=${packingNumber}`)
scanMessage.value = ''
} }
const selectedItem = (item) => { const selectedItem = (item) => {
openJobDetail(item) openJobDetail(item)
@ -271,11 +273,12 @@ const openScanPopup = () => {
const selectItem = (item) => { const selectItem = (item) => {
scanPopup.value.closeScanPopup() scanPopup.value.closeScanPopup()
openJobDetail(item, item.packingNumber) openJobDetail(item, scanMessage.value)
} }
const getScanResult = (result) => { const getScanResult = (result) => {
try { try {
scanMessage.value = ''
const filters = [ const filters = [
{ {
column: 'packingNumber', column: 'packingNumber',
@ -304,6 +307,7 @@ const getScanResult = (result) => {
pageSize: 100 pageSize: 100
}) })
.then((res) => { .then((res) => {
scanMessage.value = result.scanMessage
const resultList = res.data.list const resultList = res.data.list
if (resultList.length > 0) { if (resultList.length > 0) {
resultList.forEach((item) => { resultList.forEach((item) => {

27
src/pages/purchaseReceipt/job/receiptDetail.vue

@ -94,7 +94,7 @@ const managementList = ref([])
const jobStatus = ref('') const jobStatus = ref('')
const isAllReceived = ref(false) const isAllReceived = ref(false)
const operation = ref('') const operation = ref('')
const scanedPackingNumber = ref('') const scanMessage = ref('')
const status = ref('') const status = ref('')
const switchCode = ref('') const switchCode = ref('')
const isCheckLocation = ref('purchaseReceiptLocationCodeValidate') // const isCheckLocation = ref('purchaseReceiptLocationCodeValidate') //
@ -106,6 +106,7 @@ const comReceiptDetailCardRef = ref()
const count = ref(0) const count = ref(0)
onLoad((option) => { onLoad((option) => {
id.value = option.id id.value = option.id
scanMessage.value = option.scanMessage
scanedPackingNumber.value = option.scaned || '' scanedPackingNumber.value = option.scaned || ''
status.value = option.status || '' status.value = option.status || ''
operation.value = option.operation operation.value = option.operation
@ -189,21 +190,9 @@ const getDetail = () => {
toLocationCode.value = jobToLocationCode.value toLocationCode.value = jobToLocationCode.value
} }
isAllReceived.value = false isAllReceived.value = false
nextTick(() => { if (scanMessage.value) {
detailSource.value.forEach((r) => { scanPopup.value.simulateScan(scanMessage.value)
r.subList.forEach((s) => { }
if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) {
s.scaned = true
s.cancleScanedHiht = true
s.copyContent = `HPQ;V1.0;I${s.itemCode};P${s.packingNumber};B${s.batch};Q${s.qty}`
scanPopup.value.simulateScan(s)
scanedPackingNumber.value = ''
}
})
})
count.value++
isAllReceived.value = false
})
} else { } else {
showMessage('列表数据为0') showMessage('列表数据为0')
} }
@ -226,7 +215,7 @@ const getScanResult = (result) => {
var itemDetail = detail.subList.filter((r) => r.containerNumber == containerNumber) var itemDetail = detail.subList.filter((r) => r.containerNumber == containerNumber)
if (itemDetail.length == 0) { if (itemDetail.length == 0) {
showErrorMessage(`物料【${itemCode}】、托码【${containerNumber}】不在列表中`) showErrorMessage(`物料【${itemCode}】、托码【${containerNumber}】不在列表中`)
} else if (!itemDetail[0].cancleScanedHiht && itemDetail[0].scaned) { } else if (itemDetail[0].scaned) {
showErrorMessage(`物料【${itemCode}】、托码【${containerNumber}】已经扫描`) showErrorMessage(`物料【${itemCode}】、托码【${containerNumber}】已经扫描`)
} else { } else {
itemDetail.forEach((item) => { itemDetail.forEach((item) => {
@ -268,7 +257,7 @@ const getScanResult = (result) => {
if (isExit == undefined) { if (isExit == undefined) {
showMessage(`箱码【${packingNumber}】、批次【${batch}】不在列表中`) showMessage(`箱码【${packingNumber}】、批次【${batch}】不在列表中`)
} else if (!isExit.cancleScanedHiht && isExit.scaned) { } else if (isExit.scaned) {
showMessage(`箱码【${packingNumber}】已经扫描`) showMessage(`箱码【${packingNumber}】已经扫描`)
} else { } else {
isExit.scaned = true isExit.scaned = true
@ -284,7 +273,7 @@ const getScanResult = (result) => {
scanedLength++ scanedLength++
} }
}) })
if (!itemDetail.cancleScanedHiht && itemDetail.scaned && scanedLength == itemDetail.packList.length) { if (itemDetail.scaned && scanedLength == itemDetail.packList.length) {
showMessage(`箱码【${packingNumber}】已经扫描`) showMessage(`箱码【${packingNumber}】已经扫描`)
} else { } else {
itemDetail.scaned = true itemDetail.scaned = true

10
src/pages/purchaseReceipt/job/receiptJob.vue

@ -51,6 +51,7 @@ const todayTime = ref('')
const status = ref('1,2') // const status = ref('1,2') //
const detailOptions = ref([]) const detailOptions = ref([])
const detailGiveupOptions = ref([]) const detailGiveupOptions = ref([])
const scanMessage = ref('')
const filter = ref() const filter = ref()
const comMessageRef = ref() const comMessageRef = ref()
const jobInfoPopup = ref() const jobInfoPopup = ref()
@ -213,8 +214,9 @@ const getDataListByType = (code, type) => {
showMessage(error) showMessage(error)
}) })
} }
const openJobDetail = (item, packingNumber = '') => { const openJobDetail = (item, scanMessage = '') => {
proxy.$tab.navigateTo(`./receiptDetail?id=${item.masterId}&status=${item.status}&operation=${props.operation}&scaned=${props.packingNumber}`) proxy.$tab.navigateTo(`./receiptDetail?id=${item.masterId}&status=${item.status}&operation=${this.operation}&scanMessage=${scanMessage}`)
scanMessage.value = ''
} }
const showItemList = (itemList) => { const showItemList = (itemList) => {
jobListPopup.value.openPopup(itemList) jobListPopup.value.openPopup(itemList)
@ -293,12 +295,13 @@ const selectItem = (item, isScanedASN = false) => {
if (isScanedASN) { if (isScanedASN) {
openJobDetail(item) openJobDetail(item)
} else { } else {
openJobDetail(item, item.packingNumber) openJobDetail(item, scanMessage.value)
} }
} }
const getScanResult = (result) => { const getScanResult = (result) => {
try { try {
scanMessage.value = ''
let filters = [] let filters = []
if (result.label.barType == 'BarCode') { if (result.label.barType == 'BarCode') {
// ASN // ASN
@ -359,6 +362,7 @@ const getScanResult = (result) => {
pageSize: 100 pageSize: 100
}) })
.then((res) => { .then((res) => {
scanMessage.value = result.scanMessage
const resultList = res.data.list const resultList = res.data.list
if (resultList.length > 0) { if (resultList.length > 0) {
resultList.forEach((item) => { resultList.forEach((item) => {

24
src/pages/putaway/job/putawayDetail.vue

@ -72,7 +72,7 @@ const toLocationAreaTypeList = ref([])
const jobStatus = ref('') const jobStatus = ref('')
const jobToLocationCode = ref('') const jobToLocationCode = ref('')
const isCheckLocation = ref(false) const isCheckLocation = ref(false)
const scanedPackingNumber = ref('') const scanMessage = ref('')
const scanPopup = ref() const scanPopup = ref()
const comScanLocation = ref() const comScanLocation = ref()
const comMessageRef = ref() const comMessageRef = ref()
@ -81,7 +81,7 @@ onLoad((option) => {
title: `${option.title}详情` title: `${option.title}详情`
}) })
id.value = option.id id.value = option.id
scanedPackingNumber.value = option.scaned || '' scanMessage.value = option.scanMessage || ''
if (id.value != undefined) { if (id.value != undefined) {
// //
if (option.status == '1') { if (option.status == '1') {
@ -158,18 +158,10 @@ const getDetail = () => {
} else { } else {
toLocationCode.value = jobToLocationCode.value toLocationCode.value = jobToLocationCode.value
} }
detailSource.value.forEach((r) => { //
r.subList.forEach((s) => { if (scanMessage.value) {
if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) { openScanPopupSimulate(scanMessage.value)
s.scaned = true }
s.cancleScanedHiht = true
s.packList.forEach((item) => (item.scaned = true))
s.inventoryStatus = s.inspectResult //
openScanPopupSimulate(s)
scanedPackingNumber.value = ''
}
})
})
} else { } else {
showMessage('列表数据为0') showMessage('列表数据为0')
} }
@ -209,7 +201,7 @@ const updateData = () => {
calcTreeHandleQty(detailSource.value) calcTreeHandleQty(detailSource.value)
} }
// //
const openScanPopupSimulate = (item) => { const openScanPopupSimulate = (message) => {
let fromlocationCode = '' let fromlocationCode = ''
const fromlocationList = [] const fromlocationList = []
for (let i = 0; i < detailSource.value.length; i++) { for (let i = 0; i < detailSource.value.length; i++) {
@ -226,7 +218,7 @@ const openScanPopupSimulate = (item) => {
} }
}) })
} }
scanPopup.value.openScanPopupForJobSimulate(fromlocationCode, fromlocationList, jobContent.value, item) scanPopup.value.openScanPopupForJobSimulate(fromlocationCode, fromlocationList, jobContent.value, message)
} }
const openScanPopup = () => { const openScanPopup = () => {
let fromlocationCode = '' let fromlocationCode = ''

7
src/pages/putaway/job/putawayJob.vue

@ -51,6 +51,7 @@ const status = ref('1,2') // 待处理 、进行中
const detailOptions = ref([]) const detailOptions = ref([])
const detailGiveupOptions = ref([]) const detailGiveupOptions = ref([])
const title = ref('') const title = ref('')
const scanMessage = ref('')
const filter = ref() const filter = ref()
const comMessageRef = ref() const comMessageRef = ref()
const scanPopup = ref() const scanPopup = ref()
@ -163,6 +164,7 @@ const getList = (type) => {
} }
const openJobDetail = (item) => { const openJobDetail = (item) => {
proxy.$tab.navigateTo(`./putawayDetail?id=${item.masterId}&status=${item.status}&title=${title.value}`) proxy.$tab.navigateTo(`./putawayDetail?id=${item.masterId}&status=${item.status}&title=${title.value}`)
scanMessage.value = ''
} }
const selectedItem = (item) => { const selectedItem = (item) => {
@ -273,11 +275,13 @@ const openScanPopup = () => {
const selectItem = (item) => { const selectItem = (item) => {
scanPopup.value.closeScanPopup() scanPopup.value.closeScanPopup()
uni.navigateTo({ uni.navigateTo({
url: `./putawayDetail?id=${item.masterId}&status=${item.status}&scaned=${item.packingNumber}&title=${title.value}` url: `./putawayDetail?id=${item.masterId}&status=${item.status}&scaned=${item.packingNumber}&title=${title.value}&scanMessage=${scanMessage.value}`
}) })
scanMessage.value = ''
} }
const getScanResult = (result) => { const getScanResult = (result) => {
scanMessage.value = ''
try { try {
const filters = [ const filters = [
{ {
@ -322,6 +326,7 @@ const getScanResult = (result) => {
pageSize: 100 pageSize: 100
}) })
.then((res) => { .then((res) => {
scanMessage.value = result.scanMessage
const resultList = res.data.list const resultList = res.data.list
if (resultList.length > 0) { if (resultList.length > 0) {
resultList.forEach((item) => { resultList.forEach((item) => {

44
src/pages/repleinsh/coms/comScanReplishPack.vue

@ -7,26 +7,6 @@
扫描箱码 扫描箱码
<text class="fr" @click="closeScanPopup()">关闭</text> <text class="fr" @click="closeScanPopup()">关闭</text>
</view> </view>
<!-- <view class="uni-flex uni-row" style="align-items: center;
background-color: #fff;
margin-left: 20rpx;
margin-right: 20rpx;
padding:20rpx;
border-radius: 8rpx;">
<view class="uni-center">
位置 :
</view>
<view class="" style="width: 75%;padding: 0rpx">
<view class="uni-flex u-col-center uni-row" @click="showSelect">
<view class="" style="margin-left: 15rpx;font-size: 30rpx;">
{{positionInfo}}
</view>
<u-select v-model="show" mode="mutil-column-auto" :list="positionList" :defaultValue="defaultValueList"
@confirm="confirmSelect"></u-select>
</view>
</view>
</view> -->
<!-- <u-line class='line_color'></u-line> -->
<view class="uni-flex uni-row" style="align-items: center; background-color: #fff; margin-left: 20rpx; margin-right: 20rpx; margin-top: 8rpx; border-radius: 8rpx"> <view class="uni-flex uni-row" style="align-items: center; background-color: #fff; margin-left: 20rpx; margin-right: 20rpx; margin-top: 8rpx; border-radius: 8rpx">
<view class="uni-center" style="width: 25%"> 来源库位 </view> <view class="uni-center" style="width: 25%"> 来源库位 </view>
@ -83,6 +63,7 @@ import { uniqueArray } from '@/common/basic.js'
import { getBalanceByManagementPrecision } from '@/common/balance.js' import { getBalanceByManagementPrecision } from '@/common/balance.js'
import { getDirectoryItemArray } from '../../../common/directory.js' import { getDirectoryItemArray } from '../../../common/directory.js'
import { getLabelInfo } from '@/common/label.js'
const props = defineProps({ const props = defineProps({
title: { title: {
@ -104,7 +85,6 @@ const issueRecord = ref([]) // 发料历史
const expand = ref(true) const expand = ref(true)
const scanOptions = ref({}) const scanOptions = ref({})
const editItem = ref({}) const editItem = ref({})
const positionInfo = ref('请选择位置')
const positionList = ref([]) const positionList = ref([])
const defaultValueList = ref([]) const defaultValueList = ref([])
const label = ref({}) const label = ref({})
@ -131,7 +111,19 @@ const openScanPopup = (content, jobcontent) => {
show.value = true show.value = true
}, 500) }, 500)
} }
const openScanPopupForJobSimulate = (content, jobcontent, scanMessage) => {
issueRecord.value = []
dataContent.value = content
jobContent.value = jobcontent
initData()
getLabelInfo(scanMessage, headerType.value, (callback) => {
if (callback.success) {
onScan(callback)
} else {
showErrorMessage(callback.message)
}
})
}
const closeScanPopup = () => { const closeScanPopup = () => {
show.value = false show.value = false
emit('closeScan') emit('closeScan')
@ -554,10 +546,14 @@ const remove = (record, index) => {
} }
const packGetFocus = () => { const packGetFocus = () => {
comscan.value.getfocus() if (comscan.value) {
comscan.value.getfocus()
}
} }
const packLoseFocus = () => { const packLoseFocus = () => {
comscan.value.losefocus() if (comscan.value) {
comscan.value.losefocus()
}
} }
const showMessage = (message, callback) => { const showMessage = (message, callback) => {
setTimeout((r) => { setTimeout((r) => {

7
src/pages/repleinsh/job/repleinshDetail.vue

@ -80,7 +80,7 @@ const toLocationInfo = ref({})
const businessTypeInfo = ref({}) const businessTypeInfo = ref({})
const managementList = ref([]) const managementList = ref([])
const isAllReceived = ref(false) const isAllReceived = ref(false)
const operation = ref('') const scanMessage = ref('')
const comScanIssuePackRef = ref() const comScanIssuePackRef = ref()
const locationTypes = ref() const locationTypes = ref()
@ -89,7 +89,7 @@ onLoad((option) => {
title: `${option.title}详情` title: `${option.title}详情`
}) })
id.value = option.id id.value = option.id
operation.value = option.operation scanMessage.value = option.scanMessage
if (id.value != undefined) { if (id.value != undefined) {
// //
if (option.status == '1') { if (option.status == '1') {
@ -163,6 +163,9 @@ const getDetail = () => {
console.log(`库位${toLocationCode.value}`) console.log(`库位${toLocationCode.value}`)
toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes) toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes)
detailSource.value = getDataSource(detailSource.value, subList.value) detailSource.value = getDataSource(detailSource.value, subList.value)
if (scanMessage.value) {
comScanIssuePackRef.value.openScanPopupForJobSimulate(detailSource.value, jobContent.value, scanMessage.value)
}
setTimeout((r) => { setTimeout((r) => {
resizeCollapse() resizeCollapse()
}, 100) }, 100)

3
src/pages/repleinsh/job/repleinshJob.vue

@ -53,6 +53,7 @@ const detailOptions = ref([])
const scanMessage = ref('') const scanMessage = ref('')
const detailGiveupOptions = ref([]) const detailGiveupOptions = ref([])
const title = ref('') const title = ref('')
const scanMessage = ref('')
const filter = ref() const filter = ref()
const comMessageRef = ref() const comMessageRef = ref()
const jobInfoPopupRef = ref() const jobInfoPopupRef = ref()
@ -173,6 +174,7 @@ const fromLocationCode = (fromLocationCode) => {
} }
const openJobDetail = (item, scanMessageParams = '') => { const openJobDetail = (item, scanMessageParams = '') => {
proxy.$tab.navigateTo(`./repleinshDetail?id=${item.masterId}&status=${item.status}&scanMessage=${scanMessage.value}&title=${title.value}`) proxy.$tab.navigateTo(`./repleinshDetail?id=${item.masterId}&status=${item.status}&scanMessage=${scanMessage.value}&title=${title.value}`)
scanMessage.value = ''
} }
const selectedItem = (item) => { const selectedItem = (item) => {
openJobDetail(item) openJobDetail(item)
@ -279,6 +281,7 @@ const selectItem = (item) => {
openJobDetail(item, scanMessage.value) openJobDetail(item, scanMessage.value)
} }
const getScanResult = (result) => { const getScanResult = (result) => {
scanMessage.value = ''
if (!result.label.batch) { if (!result.label.batch) {
showMessage('批次为空') showMessage('批次为空')
return return

Loading…
Cancel
Save