Browse Source

page/productPutaway 文件迁移 8/8-10/25

pull/1/head
test 4 months ago
parent
commit
96d26ac908
  1. 3
      src/pages/productPutaway/coms/comProductJobCard.vue
  2. 31
      src/pages/productPutaway/job/fgProductPutawayJob.vue
  3. 92
      src/pages/productPutaway/job/productPutawayDetail.vue
  4. 94
      src/pages/productPutaway/job/productPutawayJob.vue
  5. 27
      src/pages/productPutaway/job/semiProductPutawayJob.vue
  6. 306
      src/pages/productPutaway/record/productPutawayRecord.vue
  7. 4
      src/pages/productPutaway/request/putawayRequestCreate.vue

3
src/pages/productPutaway/coms/comProductJobCard.vue

@ -1,12 +1,15 @@
<template>
<job-com-main-card :dataContent="dataContent">
<jobComMainDetailCard :dataContent="dataContent"></jobComMainDetailCard>
<view class='split_line' v-show="dataContent.acceptUserName"></view>
<jobAccept :dataContent="dataContent" v-show="dataContent.acceptUserName"></jobAccept>
</job-com-main-card>
</template>
<script setup lang="ts">
import jobComMainCard from '@/mycomponents/job/jobComMainCard.vue'
import jobComMainDetailCard from '@/mycomponents/job/jobComMainDetailCard.vue'
import jobAccept from '@/mycomponents/job/jobAccept.vue'
const props = defineProps({
dataContent: {

31
src/pages/productPutaway/job/fgProductPutawayJob.vue

@ -5,28 +5,45 @@
</template>
<script setup lang="ts">
import { ref, getCurrentInstance, nextTick } from 'vue'
import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import {ref, getCurrentInstance, nextTick} from 'vue'
import {
onLoad,
onShow,
onNavigationBarButtonTap,
onReady,
onBackPress,
onReachBottom,
onPullDownRefresh,
onHide, onUnload
} from '@dcloudio/uni-app'
import productPutawayJob from '@/pages/productPutaway/job/productPutawayJob.vue'
const productPutawayJobRef = ref()
const title = ref('')
onShow(() => {
nextTick(() => {
if (productPutawayJobRef.value != undefined) {
productPutawayJobRef.value.refresh()
if (productPutawayJobRef.value) {
productPutawayJobRef.value.timerRefresh()
}
})
})
onLoad((option) => {
title.value = option.title
})
onHide(() => {
if (productPutawayJobRef.value) {
productPutawayJobRef.value.stopRefresh();
}
})
onPullDownRefresh(() => {
productPutawayJobRef.value.refresh()
productPutawayJobRef.value.timerRefresh()
})
onReachBottom(() => {
productPutawayJobRef.value.onReach()
onUnload(() => {
if (productPutawayJobRef.value) {
productPutawayJobRef.value.stopRefresh();
}
})
onNavigationBarButtonTap((e) => {
if (e.index === 0) {
productPutawayJobRef.value.toHome()

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

@ -12,7 +12,15 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<com-detail-card :dataContent="item" :index="index" :settingParam="jobContent" :isShowStatus="false" @remove="updateData" @updateData="updateData" @openDetail="openDetail" :locationAreaTypeList="toLocationAreaTypeList"> </com-detail-card>
<comDetailCardBatch :dataContent="item" :index="index" :settingParam="jobContent"
:isShowStatus="false" @remove="updateData" @updateData="updateData" @openDetail="openDetail"
:locationAreaTypeList='toLocationAreaTypeList' v-if="managementType=='BY_BATCH'">
</comDetailCardBatch>
<com-detail-card :dataContent="item" :index="index"
:settingParam="jobContent" :isShowStatus="false"
@remove="updateData" @updateData="updateData" @openDetail="openDetail"
:locationAreaTypeList="toLocationAreaTypeList" v-else>
</com-detail-card>
</view>
</view>
</scroll-view>
@ -56,7 +64,7 @@ import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.v
import comDetailCard from '@/mycomponents/detail/comDetailCard.vue'
import detailInfoPopup from '@/pages/productPutaway/coms/detailInfoPopup.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import comDetailCardBatch from "@/mycomponents/detail/comDetailCardBatch.vue"
import { useCountStore } from '@/store'
// store
const store = useCountStore()
@ -68,6 +76,7 @@ const toLocationCode = ref('')
const subList = ref([]) // subList
const detailSource = ref([]) //
const managementList = ref([])
const managementType = ref('')
const fromLocationCode = ref('')
const toLocationAreaTypeList = ref([])
const toLocationInfo = ref({})
@ -155,7 +164,7 @@ const receive = (callback) => {
const getDetail = () => {
proxy.$modal.loading('加载中....')
getProductPutawayJobDetail(id.value)
.then((res) => {
.then(async (res) => {
uni.hideLoading()
if (res.data == null) {
showMessage('未获取到详情')
@ -165,7 +174,7 @@ const getDetail = () => {
subList.value = res.data.subList
fromLocationCode.value = subList.value[0].fromLocationCode
jobToLocationCode.value = subList.value[0].toLocationCode
detailSource.value = getDataSource(subList.value)
detailSource.value = await getDataSource(subList.value)
isCheckLocation.value = getSwitchInfoByCode(that.switchCode)
if (isCheckLocation.value) {
toLocationCode.value = ''
@ -175,6 +184,19 @@ const getDetail = () => {
if (scanMessage.value) {
openScanPopupSimulate(scanMessage.value)
}
//
let itemCodes = []
detailSource.value.forEach(item => {
itemCodes.push(item.itemCode)
item.scaned = false
})
getManagementPrecisions(itemCodes, jobToLocationCode.value, res => {
if (res.success) {
managementList.value = res.list;
managementType.value = managementList.value.some(item => item.ManagementPrecision ==
'BY_BATCH') ? 'BY_BATCH' : ''
}
})
} else {
showMessage('列表数据为0')
}
@ -248,7 +270,7 @@ const closeScanPopup = () => {
}
const getScanResult = (result) => {
try {
const { packingNumber } = result.balance
const { packingNumber } = result.balance.packingNumber==result.package.number?result.balance.packingNumber:result.package.number;
const { batch } = result.balance
const { qty } = result.balance
const { itemCode } = result.balance
@ -259,34 +281,28 @@ const getScanResult = (result) => {
if (detail == undefined) {
showErrorMessage(`物料号【${itemCode}】不在列表中`)
} else {
const itemDetail = detail.subList.find((r) => {
return r.packingNumber == packingNumber && r.batch == batch && r.fromLocationCode == result.fromLocationCode
})
if (itemDetail == undefined) {
showErrorMessage(`箱码【${packingNumber}】,批次【${batch}】库位【${result.fromLocationCode}】不在列表中`)
} else if (!itemDetail.cancleScanedHiht && itemDetail.scaned) {
showErrorMessage(`箱码【${packingNumber}】,批次【${batch}】库位【${result.fromLocationCode}】已经扫描`)
let itemDetail = ''
detailSource.value.find(item => {
const itemDetail1 = item.subList.find(r => {
return r.batch == result.label.batch && r.fromLocationCode == result.fromLocationCode
})
if(itemDetail1){
itemDetail = itemDetail1
}
});
if (!itemDetail) {
showErrorMessage(`批次【${batch}】库位【${result.fromLocationCode}】不在列表中`)
} else {
// itemDetail.cancleScanedHiht = false
// addDetail(itemDetail, result)
// return
//
const itemStatus = getInventoryStatusName(itemDetail.inventoryStatus)
const balanceStatus = getInventoryStatusName(result.balance.inventoryStatus)
// if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
// // if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
// showQuestionMessage(`[${balanceStatus}][${itemStatus}],?`, (res) => {
// if (res) {
// itemDetail.cancleScanedHiht = false
// addDetail(itemDetail, result)
// } else {
// scanPopupGetFocus()
// }
// })
// } else {
detail.scaned = true
if(!itemDetail.cancleScanedHiht && itemDetail.scaned){
this.showErrorMessage(`批次【${batch}】库位【${result.fromLocationCode}】已经扫描`)
}else {
//
const itemStatus = getInventoryStatusName(itemDetail.inventoryStatus)
const balanceStatus = getInventoryStatusName(result.balance.inventoryStatus)
itemDetail.cancleScanedHiht = false
addDetail(itemDetail, result)
// }
}
}
}
} catch (e) {
@ -328,7 +344,11 @@ const commit = () => {
//
if (jobContent.value.allowPartialComplete == 'TRUE') {
//
submitJob()
comMessageRef.value.showQuestionMessage1("任务明细未全部完成,是否提交?", 'red', res => {
if (res) {
submitJob()
}
});
} else {
//
comMessageRef.value.showErrorMessage('请完成扫描后,再进行提交<br>' + `已经扫描[${scanCount.value}]箱总共[${subList.value.length}]箱`, (res) => {
@ -374,7 +394,7 @@ const submitJob = () => {
.then((res) => {
uni.hideLoading()
if (res.data) {
showCommitSuccessMessage(`提交成功<br>生成${hintTitle.value}记录<br>${res.data}`)
showCommitSuccessMessage(`提交成功\n生成${hintTitle.value}记录\n${res.data}`)
} else {
showErrorMessage(`提交失败[${res.msg}]`)
}
@ -397,9 +417,11 @@ const setParams = () => {
item.subList.forEach((detail) => {
if (detail.scaned) {
const info = getPackingNumberAndBatch(managementList.value, detail.itemCode, detail.packingNumber, detail.batch)
detail.toPackingNumber = detail.packingNumber
detail.toContainerNumber = detail.containerNumber
detail.toBatch = detail.batch
detail.toPackingNumber = info.packingNumber
detail.packingNumber = info.packingNumber;
detail.fromPackingNumber = info.packingNumber
detail.toContainerNumber = ''
detail.toBatch = info.batch
detail.toLocationCode = toLocationCode.value
subList.push(detail)

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

@ -26,7 +26,7 @@ import { cancleTakeProductPutawayJob, getProductPutawayJobList } from '@/api/req
import { goHome, updateTitle, getSwitchInfoByCode } from '@/common/basic.js'
import { getDetailOption, getDetailGiveupOption } from '@/common/array.js'
import {planRefreshTime} from '@/common/config.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comProductJobCard from '@/pages/productPutaway/coms/comProductJobCard.vue'
@ -70,13 +70,23 @@ const jobListPopupRef = ref()
const scanPopup = ref()
const jobListComRef = ref()
const scanList = ref()
const timer = ref(null)
onMounted(() => {
detailOptions.value = getDetailOption()
detailGiveupOptions.value = getDetailGiveupOption()
timerRefresh()
// getList('refresh')
})
const refresh = () => {
const timerRefresh = () => {
getList('refresh')
stopRefresh();
timer.value = setInterval(function() {
getList('refresh');
}, planRefreshTime)
}
const stopRefresh = ()=> {
if (timer.value) {
clearInterval(timer.value);
timer.value = null;
}
}
const openFilter = () => {
filter.value.openFilter()
@ -111,11 +121,6 @@ const getList = (type) => {
action: 'in',
value: status.value
})
filters.push({
column: 'accept_user_id',
action: '==',
value: store.id
})
filters.push({
column: 'type',
action: '==',
@ -159,12 +164,55 @@ const getList = (type) => {
})
}
const openJobDetail = (item, scanMessage = '') => {
uni.navigateTo({
url: `./productPutawayDetail?id=${item.masterId}&status=${item.status}&type=${item.type}&scaned=${packingNumber}&title=${title.value}`
})
scanMessage.value = ''
getJobInfoByNumber(item.number,scanMessage)
}
const getJobInfoByNumber = (number,scanMessage)=>{
uni.showLoading({
title: "加载中....",
mask: true
});
let filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: number
})
const params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getProductPutawayJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
showMessage('未查找到' + '【' + number + '】的发料任务');
} else {
let result = res.data.list[0];
if(result.acceptUserId&&result.acceptUserId!=store.id){
comMessageRef.value.showErrorMessage("任务号["+result.number+"]已经被["+result.acceptUserName+"]承接,无法执行", res => {
if (res) {
getList('refresh')
}
});
return;
}
uni.navigateTo({
url: './productPutawayDetail?id=' + result.masterId + '&status=' + result.status + '&type=' + result
.type + '&scanMessage=' + this.scanMessage + '&title=' + props.title
});
scanMessage.value = ''
}
}).catch(error => {
uni.hideLoading();
showMessage(error);
})
}
const showItemList = (itemList) => {
scanList.value.openPopup(itemList)
}
@ -235,11 +283,6 @@ const getDataListByType = (code) => {
action: '==',
value: code
})
filters.push({
column: 'accept_user_id',
action: '==',
value: store.id
})
const params = {
filters,
pageNo: 1,
@ -260,8 +303,14 @@ const getDataListByType = (code) => {
})
}
const showMessage = (message) => {
if(scanPopup.value){
scanPopup.value.packLoseFocus()
}
comMessageRef.value.showErrorMessage(message, (res) => {
if (res) {
if(scanPopup.value){
scanPopup.value.packLoseFocus()
}
}
})
}
@ -310,11 +359,6 @@ const getScanResult = (result) => {
column: 'status',
action: 'in',
value: '1,2'
},
{
column: 'accept_user_id',
action: '==',
value: store.id
}
// {
// column: 'fromLocationCode',
@ -347,11 +391,11 @@ const getScanResult = (result) => {
selectItem(list[0])
}
} else {
showMessage('未查找到任务<br>' + `扫描[${result.scanMessage}]`)
showMessage('未查找到任务\n' + `扫描[${result.scanMessage}]`)
}
})
.catch((error) => {
showMessage(`${error}<br>扫描[${result.scanMessage}]`)
showMessage(`${error}\n扫描[${result.scanMessage}]`)
})
} catch (e) {
showMessage(e.message)

27
src/pages/productPutaway/job/semiProductPutawayJob.vue

@ -6,26 +6,45 @@
<script setup lang="ts">
import { ref, getCurrentInstance, nextTick } from 'vue'
import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import {
onLoad,
onShow,
onNavigationBarButtonTap,
onReady,
onBackPress,
onReachBottom,
onPullDownRefresh,
onHide, onUnload
} from '@dcloudio/uni-app'
import productPutawayJob from '@/pages/productPutaway/job/productPutawayJob.vue'
const productPutawayJobRef = ref()
const title = ref('')
onShow(() => {
nextTick(() => {
if (productPutawayJobRef.value != undefined) {
productPutawayJobRef.value.refresh()
if (productPutawayJobRef.value) {
productPutawayJobRef.value.timerRefresh()
}
})
})
onLoad((option) => {
title.value = option.title
})
onHide(()=>{
if (productPutawayJobRef.value) {
productPutawayJobRef.value.stopRefresh()
}
})
const onReachBottom = ()=> {
productPutawayJobRef.value.onReach();
}
onUnload(()=>{
if (productPutawayJobRef.value) {
productPutawayJobRef.value.stopRefresh()
}
})
onPullDownRefresh(() => {
productPutawayJobRef.value.refresh()
productPutawayJobRef.value.timerRefresh()
})
onReachBottom(() => {
productPutawayJobRef.value.onReach()

306
src/pages/productPutaway/record/productPutawayRecord.vue

@ -4,14 +4,16 @@
<com-blank-view @goScan="openScanPopup" v-if="detailSource.length == 0"></com-blank-view>
</view>
<view class="uni-flex uni-column" v-if="detailSource.length > 0">
<view class="" style="flex: 1;">
<view class="page-wraper" v-if="detailSource.length > 0">
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowStatus="true" :isShowToLocation='false' @removeItem="removeItem(index,item)"
@updateData="updateData" @removePack="removePack" @editLocation="showScanToLocation">
<record-com-detail-card
:dataContent="item" :index="index" :settingParam="dataContent"
:isShowStatus="true" :isShowToLocation='false' @removeItem="removeItem(index,item)"
:isShowModifedLocation="true"
@updateData="updateData" @removePack="removePack" @editLocation="showScanToLocation">
</record-com-detail-card>
</view>
</view>
@ -31,7 +33,8 @@
</view>
<win-scan-button @goScan="openScanPopup"></win-scan-button>
</view>
<win-scan-package ref="scanPopup" @getResult='getScanResult'></win-scan-package>
<win-scan-button v-if="detailSource.length>0" @goScan='openScanPopup'></win-scan-button>
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode"></winComScanBalance>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getToLocationCode'
:locationAreaTypeList="toLocationAreaTypeList"></win-scan-location>
<com-message ref="comMessageRef" />
@ -41,20 +44,21 @@
<script setup lang="ts">
import {ref, getCurrentInstance, nextTick, onMounted} from 'vue'
import { onLoad, onNavigationBarButtonTap, onReady, onReachBottom, onPullDownRefresh ,onBackPress } from '@dcloudio/uni-app'
import { productPutawayRecordSubmit,getrecommendLocationExpectin, recommendLocationRemoveExpectin } from '@/api/request2.js'
import { productPutawayRecordSubmit,getrecommendLocationExpectin, recommendLocationRemoveExpectin,getBalanceByFilter } from '@/api/request2.js'
import { goHome, getPackingNumberAndBatchByList, deepCopyData, updateTitle } from '@/common/basic.js'
import { getPrecisionStrategyList } from '@/common/balance.js'
import { getPrecisionStrategyList ,getManagementPrecisions} from '@/common/balance.js'
import { getInventoryStatusDesc, getDirectoryItemArray } from '@/common/directory.js'
import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js'
import {calc} from '@/common/calc.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import winScanPackage from '@/mycomponents/scan/winScanPackage.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
import { useCountStore } from '@/store'
// store
@ -71,7 +75,7 @@ import {ref, getCurrentInstance, nextTick, onMounted} from 'vue'
const tolocationTypeList = ref([])
const inInventoryStatus = ref('') //
const outInventoryStatus = ref('') //
const bussinessCode = ref('ProductPutaway')
const businessTypeCode = ref('ProductPutaway')
const businessType = ref({})
const managementList = ref([])
const scanLocationCode = ref()
@ -80,6 +84,9 @@ import {ref, getCurrentInstance, nextTick, onMounted} from 'vue'
const type = ref('')
const editItem = ref(null)
const toLocationAreaTypeList = ref([])
const fromInventoryStatuses = ref()
const itemCode = ref()
const managementType = ref()
// type = 'assemble'
// type = 'predict'
const props = defineProps({
@ -101,12 +108,11 @@ import {ref, getCurrentInstance, nextTick, onMounted} from 'vue'
// } else if (type.value == 'assemble') {
// updateTitle('')
// }
getBusinessType(bussinessCode.value, (res) => {
getBusinessType(businessTypeCode.value, (res) => {
if (res.success) {
businessType.value = res.businessType
fromLocationAreaTypeList.value = res.fromLocationAreaTypeList
tolocationTypeList.value = res.tolocationTypeList
toLocationAreaTypeList.value = res.toLocationAreaTypeList;
fromInventoryStatuses.value = getDirectoryItemArray(res.fromInventoryStatuses);
fromLocationAreaTypeList.value = res.fromLocationAreaTypeList
openScanPopup()
} else {
showErrorMessage(res.message)
@ -121,51 +127,120 @@ import {ref, getCurrentInstance, nextTick, onMounted} from 'vue'
})
const getScanResult = (result) => {
setData(result)
const { label } = result
const pack = result.package
result.balance.forEach(
balance => {
let item = detailSource.value.find(res => {
if (res.itemCode == balance.itemCode && res.containerNumber == balance.parentPackingNumber) {
return res
handleCalcHandleQty()
}
const setData = async (result)=>{
const { balance } = result.balance
const { label } = result
const pack = result.package
let item = detailSource.value.find(res => {
if (res.itemCode == balance.itemCode) {
return res
}
})
if (item == undefined) {
let itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); //
newDetail.fromLocationCode = balance.locationCode
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
itemp.subList.push(newDetail);
detailSource.value.push(itemp)
itemCode.value = balance.itemCode;
fromLocationCode.value = balance.locationCode
await getRecommendLocation(balance, result)
await scanPopupGetFocus()
} else {
let detail = item.subList.find(r => {
if (r.batch == balance.batch &&
r.fromLocationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) {
return r;
}
})
if (detail == undefined) {
if (pack.parentNumber) {
let checkData = item.subList.find(r => {
if (r.packingNumber == pack.parentNumber &&
r.batch == balance.batch&&
r.fromLocationCode == balance.locationCode) {
return r;
}
})
if (item == undefined) {
var itemp = createItemInfo(balance, pack);
//
getRecommendLocation(balance, res => {
itemp.toLocationCode = res.code;
itemp.expectinNumber = res.expectinNumber;
})
let newDetail = createDetailInfo(balance, pack); //
newDetail.fromInventoryStatus = balance.inventoryStatus;
itemp.subList.push(newDetail);
detailSource.value.push(itemp)
if (checkData) {
//
showErrorMessage("扫描箱码[" + pack.number + "]批次[" + balance.batch +
"]的父包装已经扫描")
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == balance.packingNumber &&
r.batch == balance.batch &&
r.locationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) {
return r;
let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
newDetail.fromLocationCode=balance.locationCode
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
item.subList.push(newDetail);
}
}else {
//
let checkData = item.subList.find(r => {
if (r.parentNumber == pack.number &&
r.batch == balance.batch&&
r.fromLocationCode == balance.locationCode) {
return r;
}
})
if(checkData){
//
comMessageRef.value.showQuestionMessage("箱码[" + checkData.parentNumber+"]" + "批次[" + balance
.batch + "]是父包装,是否移除子包装", res => {
if (res) {
item.subList = [];
let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
newDetail.fromLocationCode=balance.locationCode
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
item.subList.push(newDetail);
calcHandleQty(this.detailSource);
}
})
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack);
newDetail.fromInventoryStatus = balance.inventoryStatus;
item.subList.push(newDetail);
} else {
if (detail.scaned == true) {
showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch +
"]已经在列表中")
}
}else {
let newDetail = createDetailInfo(balance, pack);
newDetail.fromLocationCode = balance.locationCode
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
item.subList.push(newDetail);
}
handleCalcHandleQty();
}
)
}
const getRecommendLocation = (balance, callback)=> {
scanPopupGetFocus()
} else {
if (detail.scaned == true) {
detail.handleQty = calc.add(detail.handleQty,result.label.qty)
}
}
}
}
const getRecommendLocation = async (balance, result)=> {
uni.showLoading({
title: '扫描中...',
mask: true
@ -175,17 +250,116 @@ import {ref, getCurrentInstance, nextTick, onMounted} from 'vue'
expectinNumber: balance.packingNumber + "-" + Date.now(),
itemCode: balance.itemCode,
inventoryStatus: balance.inventoryStatus,
batch: balance.batch
};
console.log(JSON.stringify(param))
getrecommendLocationExpectin(param).then(res => {
callback(res.data);
await getrecommendLocationExpectin(param).then(async result1 => {
uni.hideLoading();
let item = detailSource.value.find(res => {
if (res.itemCode == balance.itemCode) {
return res
}
})
item.toLocationCode = result1.data.code;
item.expectinNumber = result1.data.expectinNumber;
getToLocationBalance(item.toLocationCode,result)
}).catch(error => {
uni.hideLoading()
showErrorMessage(error);
})
}
const getRecommendLocation = async (balance,result)=> {
uni.showLoading({
title: '扫描中...',
mask: true
})
let param = {
expectinNumber: balance.packingNumber + "-" + Date.now(),
itemCode: balance.itemCode,
inventoryStatus: balance.inventoryStatus,
batch: balance.batch
};
console.log(JSON.stringify(param))
await getrecommendLocationExpectin(param).then(async result1 => {
uni.hideLoading();
let item = detailSource.value.find(res => {
if (res.itemCode == balance.itemCode) {
return res
}
})
item.toLocationCode = result1.data.code;
item.expectinNumber = result1.data.expectinNumber;
await getToLocationBalance(item.toLocationCode,result)
}).catch(error => {
uni.hideLoading()
showErrorMessage(error);
})
}
//
const getToLocationBalance = async (toLocationCode,result)=> {
uni.showLoading({
title: '查询中',
mask: true
})
let filters = []
if (result.package.parentNumber) {
let packingNumber = result.package.parentNumber + "," + result.package.number;
filters.push({
column: "packingNumber",
action: "in",
value: packingNumber
})
} else {
filters.push({
column: "packingNumber",
action: "==",
value: result.package.number
})
}
filters.push({
column: "itemCode",
action: "==",
value: result.package.itemCode
})
filters.push({
column: "batch",
action: "==",
value: result.package.batch
})
filters.push({
column: "areaType",
action: "in",
value: toLocationAreaTypeList.value.join(',')
})
const params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
await getManagementPrecisions([result.package.itemCode], toLocationCode,async 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'){
uni.hideLoading()
}else{
await getBalanceByFilter(params).then(res => {
uni.hideLoading()
if (res.data.list.length > 0) {
showErrorMessage("包装在库位【" + res.data.list[0].locationCode + "】已有库存余额");
}
// callback(res.data)
}).catch(err => {
showErrorMessage(err.message);
})
}
}
})
}
//
const removeRecommendLocation = ()=> {
let param = {
@ -225,9 +399,12 @@ import {ref, getCurrentInstance, nextTick, onMounted} from 'vue'
}
const openScanPopup = () => {
setTimeout(r => {
scanPopup.value.openScanPopupByBusinessType(businessType.value)
})
if (this.businessType) {
toLocationAreaTypeList.value = getDirectoryItemArray(businessType.value.inAreaTypes)
scanPopup.value.openScanPopupByBusinessType(businessType.value)
} else {
getBusinessType()
}
}
const showFromLocationPopup = () => {
nextTick(() => {
@ -279,7 +456,7 @@ import {ref, getCurrentInstance, nextTick, onMounted} from 'vue'
.then((res) => {
uni.hideLoading()
if (res.data) {
showCommitSuccessMessage(`提交成功<br>生成制品上架记录<br>${res.data}`)
showCommitSuccessMessage(`提交成功\n生成制品上架记录\n${res.data}`)
let removeId = [];
detailSource.value.forEach(r => {
removeId.push(r.expectinNumber)
@ -330,7 +507,6 @@ import {ref, getCurrentInstance, nextTick, onMounted} from 'vue'
item.subList.forEach((detail) => {
if (detail.scaned) {
const submitItem = deepCopyData(detail)
// const info = getPackingNumberAndBatchByList(managementList.value, detail.itemCode, detail.packingNumber, detail.toLocationCode, detail.batch)
submitItem.itemCode = detail.itemCode
submitItem.itemName = detail.package.itemName
submitItem.itemDesc1 = detail.package.itemDesc1
@ -338,9 +514,6 @@ import {ref, getCurrentInstance, nextTick, onMounted} from 'vue'
submitItem.inventoryStatus = detail.inventoryStatus
// submitItem.fromPackingNumber = info.packingNumber
// submitItem.toPackingNumber = info.packingNumber
submitItem.fromPackingNumber = detail.packingNumber;
submitItem.toPackingNumber = detail.packingNumber;
@ -349,7 +522,7 @@ import {ref, getCurrentInstance, nextTick, onMounted} from 'vue'
// submitItem.fromBatch = info.batch
// submitItem.toBatch = info.batch
submitItem.fromParentPackingNumber = detail.parentNumber;
submitItem.fromBatch = detail.package.batch;
submitItem.toBatch = detail.package.batch;
@ -375,9 +548,9 @@ import {ref, getCurrentInstance, nextTick, onMounted} from 'vue'
})
}
const showErrorMessage = (message) => {
scanPopupLoseFocus()
comMessageRef.value.showErrorMessage(message, (res) => {
if (res) {
}
scanPopupGetFocus()
})
}
const showScanMessage = (message) => {
@ -431,9 +604,14 @@ import {ref, getCurrentInstance, nextTick, onMounted} from 'vue'
}
}
}
const scanPopupLoseFocus = ()=> {
if (scanPopup.value) {
scanPopup.value.losefocus();
}
}
const cancel = () => {
this.clearData();
this.openScanPopup();
clearData();
openScanPopup();
}
</script>

4
src/pages/productPutaway/request/putawayRequestCreate.vue

@ -149,7 +149,7 @@ const getScanResult = (result) => {
item.subList.push(newDetail)
// });
} else if (detail.scaned == true) {
showErrorMessage(`箱码[${balance.packingNumber}批次[${balance.batch}]已经在列表中`)
showErrorMessage(`箱码[${balance.packingNumber}批次[${balance.batch}]重复扫描`)
}
}
handleCalcHandleQty()
@ -201,7 +201,7 @@ const commit = () => {
.then((res) => {
uni.hideLoading()
if (res.data) {
showCommitSuccessMessage(`提交成功<br>生成采购退货申请<br>${res.data}`)
showCommitSuccessMessage(`提交成功\n生成采购退货申请\n${res.data}`)
} else {
showErrorMessage(`提交失败[${res.msg}]`)
}

Loading…
Cancel
Save