|
@ -5,6 +5,12 @@ |
|
|
<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 class="task_text"> |
|
|
|
|
|
<view class="card_view"> |
|
|
|
|
|
<text class="card_packing_code ">目的地</text> |
|
|
|
|
|
<text class="card_content " style="word-wrap: break-word; word-break: break-all;" >{{jobContent.destination}}</text> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
<!-- <view class="header_item"> 申请单号 : {{ jobContent.requestNumber }} </view> --> |
|
|
<!-- <view class="header_item"> 申请单号 : {{ jobContent.requestNumber }} </view> --> |
|
|
<!-- <view class='split_line'></view> --> |
|
|
<!-- <view class='split_line'></view> --> |
|
|
</view> |
|
|
</view> |
|
@ -14,7 +20,12 @@ |
|
|
<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=""> |
|
|
<view class=""> |
|
|
<com-detail-card :dataContent="item" :index="index" :settingParam="jobContent" @remove="updateData" @updateData="updateData" @openDetail="openDetail"> </com-detail-card> |
|
|
<comRecommendDetailCardBatch :dataContent="item" :index="index" :settingParam="jobContent" |
|
|
|
|
|
@remove="updateData" @updateData="updateData" @openDetail="openDetail" v-if="managementType=='BY_BATCH'"> |
|
|
|
|
|
</comRecommendDetailCardBatch> |
|
|
|
|
|
<comRecommendDetailCard :dataContent="item" :index="index" :settingParam="jobContent" |
|
|
|
|
|
@remove="updateData" @updateData="updateData" @openDetail="openDetail" v-else> |
|
|
|
|
|
</comRecommendDetailCard> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</scroll-view> |
|
|
</scroll-view> |
|
@ -43,11 +54,18 @@ import { getManagementPrecisions } from '@/common/balance.js' |
|
|
import { getUnPlannedIssueJobDetail, takeUnPlannedIssueJob, cancleTakeUnPlannedIssueJob, unPlannedIssueJobSubmit } from '@/api/request2.js' |
|
|
import { getUnPlannedIssueJobDetail, takeUnPlannedIssueJob, cancleTakeUnPlannedIssueJob, unPlannedIssueJobSubmit } from '@/api/request2.js' |
|
|
import { goHome, navigateBack, getPackingNumberAndBatch, getDirectoryItemArray, getInventoryStatusName } from '@/common/basic.js' |
|
|
import { goHome, navigateBack, getPackingNumberAndBatch, getDirectoryItemArray, getInventoryStatusName } from '@/common/basic.js' |
|
|
|
|
|
|
|
|
import { getDataSource, createRecordInfo, calcHandleQty, getScanCount } from '@/common/detail.js' |
|
|
import { getDataSource, createRecordInfo, calcHandleQty, getScanCount,calcHandleNewQty } from '@/common/detail.js' |
|
|
|
|
|
import { |
|
|
|
|
|
calc |
|
|
|
|
|
} from '@/common/calc' |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
Decimal |
|
|
|
|
|
} from 'decimal.js'; //引入 |
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.vue' |
|
|
import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.vue' |
|
|
import comDetailCard from '@/mycomponents/detail/comDetailCard.vue' |
|
|
import comRecommendDetailCard from "@/mycomponents/detail/comRecommendDetailCard.vue" |
|
|
|
|
|
import comRecommendDetailCardBatch from "@/mycomponents/detail/comRecommendDetailCardBatch.vue" |
|
|
import detailInfoPopup from '@/pages/unPlanned/coms/detailInfoPopup.vue' |
|
|
import detailInfoPopup from '@/pages/unPlanned/coms/detailInfoPopup.vue' |
|
|
import jobTop from '@/mycomponents/job/jobTop.vue' |
|
|
import jobTop from '@/mycomponents/job/jobTop.vue' |
|
|
import { useCountStore } from '@/store' |
|
|
import { useCountStore } from '@/store' |
|
@ -61,11 +79,13 @@ const subList = ref([]) // 接口返回的任务subList |
|
|
const detailSource = ref([]) // 绑定在页面上的数据源 |
|
|
const detailSource = ref([]) // 绑定在页面上的数据源 |
|
|
const businessTypeInfo = ref({}) |
|
|
const businessTypeInfo = ref({}) |
|
|
const managementList = ref([]) |
|
|
const managementList = ref([]) |
|
|
|
|
|
const managementType = ref('') |
|
|
const jobStatus = ref('') |
|
|
const jobStatus = ref('') |
|
|
const scanPopup = ref() |
|
|
const scanPopup = ref() |
|
|
const comScanLocation = ref() |
|
|
const comScanLocation = ref() |
|
|
const detailInfoPopupRef = ref() |
|
|
const detailInfoPopupRef = ref() |
|
|
const comMessageRef = ref() |
|
|
const comMessageRef = ref() |
|
|
|
|
|
const fromLocationCode = ref('') |
|
|
onLoad((option) => { |
|
|
onLoad((option) => { |
|
|
uni.setNavigationBarTitle({ |
|
|
uni.setNavigationBarTitle({ |
|
|
title: `${option.title}详情` |
|
|
title: `${option.title}详情` |
|
@ -129,7 +149,7 @@ const receive = (callback) => { |
|
|
const getDetail = () => { |
|
|
const getDetail = () => { |
|
|
proxy.$modal.loading('加载中...') |
|
|
proxy.$modal.loading('加载中...') |
|
|
getUnPlannedIssueJobDetail(id.value) |
|
|
getUnPlannedIssueJobDetail(id.value) |
|
|
.then((res) => { |
|
|
.then(async (res) => { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
if (res.data == null) { |
|
|
if (res.data == null) { |
|
|
showMessage('未获取到详情') |
|
|
showMessage('未获取到详情') |
|
@ -137,7 +157,24 @@ const getDetail = () => { |
|
|
jobContent.value = res.data |
|
|
jobContent.value = res.data |
|
|
jobStatus.value = res.data.status |
|
|
jobStatus.value = res.data.status |
|
|
subList.value = res.data.subList |
|
|
subList.value = res.data.subList |
|
|
detailSource.value = getDataSource(subList.value) |
|
|
subList.value.forEach(item=>{ |
|
|
|
|
|
item.isRecommend = true |
|
|
|
|
|
}) |
|
|
|
|
|
detailSource.value = await getDataSource(subList.value) |
|
|
|
|
|
//获取管理模式,封装参数 |
|
|
|
|
|
let itemCodes = [] |
|
|
|
|
|
detailSource.value.forEach(item => { |
|
|
|
|
|
itemCodes.push(item.itemCode) |
|
|
|
|
|
item.scaned = false |
|
|
|
|
|
}) |
|
|
|
|
|
fromLocationCode.value = subList.value[0].fromLocationCode |
|
|
|
|
|
await getManagementPrecisions(itemCodes, fromLocationCode.value, res => { |
|
|
|
|
|
if (res.success) { |
|
|
|
|
|
managementList.value = res.list; |
|
|
|
|
|
managementType.value = managementList.value.some(item => item.ManagementPrecision == |
|
|
|
|
|
'BY_BATCH') ? 'BY_BATCH' : '' |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
showMessage('列表数据为0') |
|
|
showMessage('列表数据为0') |
|
|
} |
|
|
} |
|
@ -157,10 +194,20 @@ const continueScan = () => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
const calcHandleQty1 = () => { |
|
|
const calcHandleQty1 = () => { |
|
|
calcHandleQty(detailSource.value) |
|
|
calcHandleNewQty(detailSource.value) |
|
|
continueScan() |
|
|
continueScan() |
|
|
} |
|
|
} |
|
|
const updateData = () => { |
|
|
const updateData = () => { |
|
|
|
|
|
//删除新添加的 |
|
|
|
|
|
for (let i = 0; i < detailSource.value.length; i++) { |
|
|
|
|
|
let item = detailSource.value[i] |
|
|
|
|
|
for (let j = 0; j < item.subList.length; j++) { |
|
|
|
|
|
var sub = item.subList[j] |
|
|
|
|
|
if(!sub.isRecommend&&!sub.scaned){ |
|
|
|
|
|
item.subList.splice(j,1) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
calcHandleQty1() |
|
|
calcHandleQty1() |
|
|
} |
|
|
} |
|
|
const openDetail = (item) => { |
|
|
const openDetail = (item) => { |
|
@ -181,45 +228,32 @@ const getScanResult = (result) => { |
|
|
showErrorMessage(`物料号【${itemCode}】不在列表中`) |
|
|
showErrorMessage(`物料号【${itemCode}】不在列表中`) |
|
|
} else { |
|
|
} else { |
|
|
const itemDetail = detail.subList.find((r) => { |
|
|
const itemDetail = detail.subList.find((r) => { |
|
|
return r.packingNumber == packingNumber && r.batch == batch && r.fromLocationCode == result.fromLocationCode |
|
|
return r.packingNumber == packingNumber && r.batch == batch && r.fromLocationCode == result.fromLocationCode && r.isRecommend==false |
|
|
}) |
|
|
}) |
|
|
if (itemDetail == undefined) { |
|
|
if (itemDetail == undefined) { |
|
|
showErrorMessage(`箱码【${packingNumber}】,批次【${batch}】库位【${result.fromLocationCode}】不在列表中`) |
|
|
let newAdd = { |
|
|
} else if (itemDetail.scaned) { |
|
|
itemCode:itemCode, |
|
|
showErrorMessage(`箱码【${packingNumber}】,批次【${batch}】库位【${result.fromLocationCode}】已经扫描`) |
|
|
packingNumber:packingNumber, |
|
|
} else { |
|
|
batch:batch, |
|
|
const balanceStatus = getInventoryStatusName(result.balance.inventoryStatus) |
|
|
handleQty:detail.qty<Number(result.balance.qty)?detail.qty:Number(result.balance.qty), |
|
|
const itemStatus = getInventoryStatusName(itemDetail.inventoryStatus) |
|
|
qty:detail.qty, |
|
|
if (itemDetail.inventoryStatus != result.balance.inventoryStatus) { |
|
|
fromLocationCode:locationCode, |
|
|
if (jobContent.value.allowModifyInventoryStatus == 'TRUE') { |
|
|
inventoryStatus:inventoryStatus, |
|
|
showQuestionMessage(`任务中允许修改库存状态,实际库存状态[${balanceStatus}]与推荐库存状态[${itemStatus}]不一致,是否继续出库?`, (res) => { |
|
|
toInventoryStatus:inventoryStatus, |
|
|
if (res) { |
|
|
balance:result.balance, |
|
|
itemDetail.scaned = true |
|
|
isRecommend:false, |
|
|
itemDetail.handleQty = Number(result.balance.qty) |
|
|
isNewAdd:"newAdd" |
|
|
itemDetail.toInventoryStatus = result.balance.inventoryStatus |
|
|
|
|
|
itemDetail.balance = result.balance |
|
|
|
|
|
itemDetail.balance.balanceQty = Number(result.balance.qty) |
|
|
|
|
|
itemDetail.balance.packQty = Number(result.package.packQty) |
|
|
|
|
|
itemDetail.balance.packUnit = result.package.packUnit |
|
|
|
|
|
calcHandleQty1() |
|
|
|
|
|
} else { |
|
|
|
|
|
scanPopupGetFocus() |
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
newAdd.balance.balanceQty = Number(result.balance.qty); |
|
|
|
|
|
newAdd.balance.packQty = Number(result.package.packQty) |
|
|
|
|
|
newAdd.balance.packUnit = result.package.packUnit |
|
|
|
|
|
newAdd.scaned = true; |
|
|
|
|
|
detail.subList.push(newAdd) |
|
|
|
|
|
calcHandleQty(); |
|
|
} else { |
|
|
} else { |
|
|
showQuestionMessage(`任务中不允许修改库存状态,实际库存状态[${balanceStatus}]与推荐库存状态[${itemStatus}]不一致,不允许转移!`, (res) => { |
|
|
if (itemDetail.scaned) { |
|
|
scanPopupGetFocus() |
|
|
showErrorMessage("箱码【" + packingNumber + "】,批次【" + batch + "】库位【" + result |
|
|
}) |
|
|
.fromLocationCode + "】已经扫描") |
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
itemDetail.scaned = true |
|
|
|
|
|
itemDetail.handleQty = Number(result.balance.qty) |
|
|
|
|
|
itemDetail.toInventoryStatus = result.balance.inventoryStatus |
|
|
|
|
|
itemDetail.balance = result.balance |
|
|
|
|
|
itemDetail.balance.balanceQty = Number(result.balance.qty) |
|
|
|
|
|
itemDetail.balance.packQty = Number(result.package.packQty) |
|
|
|
|
|
itemDetail.balance.packUnit = result.package.packUnit |
|
|
|
|
|
calcHandleQty1() |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -228,11 +262,21 @@ const getScanResult = (result) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
const commit = () => { |
|
|
const commit = () => { |
|
|
scanCount.value = getScanCount(subList.value) |
|
|
let scanCount = 0; |
|
|
if (scanCount.value == 0) { |
|
|
detailSource.value.forEach((item) => { |
|
|
|
|
|
item.subList.forEach(cur => { |
|
|
|
|
|
if (cur.scaned) { |
|
|
|
|
|
scanCount++; |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
if (scanCount == 0) { |
|
|
showErrorMessage('扫描数为0,请先扫描') |
|
|
showErrorMessage('扫描数为0,请先扫描') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
checkCount() |
|
|
|
|
|
} |
|
|
|
|
|
const checkCount = ()=>{ |
|
|
// 提交的数量和任务数量不一致提示 |
|
|
// 提交的数量和任务数量不一致提示 |
|
|
let str = '' |
|
|
let str = '' |
|
|
detailSource.value.forEach((item) => { |
|
|
detailSource.value.forEach((item) => { |
|
@ -243,7 +287,7 @@ const commit = () => { |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
if (str) { |
|
|
if (str) { |
|
|
str += ',是否确认提交?' |
|
|
str = str+'\n是否提交?' |
|
|
comMessageRef.value.showQuestionMessage1(str, 'red', res => { |
|
|
comMessageRef.value.showQuestionMessage1(str, 'red', res => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
submitJob() |
|
|
submitJob() |
|
@ -252,33 +296,24 @@ const commit = () => { |
|
|
} else { |
|
|
} else { |
|
|
submitJob() |
|
|
submitJob() |
|
|
} |
|
|
} |
|
|
// // 允许部分提交 |
|
|
|
|
|
// // 扫描数量和任务数量相等,直接提交 |
|
|
|
|
|
// if (scanCount.value == subList.value.length) { |
|
|
|
|
|
// submitJob() |
|
|
|
|
|
// } else if (scanCount.value < subList.value.length) { |
|
|
|
|
|
// // 扫描数量小于任务数量,判断是否允许部分提交 |
|
|
|
|
|
// if (jobContent.value.allowPartialComplete == 'TRUE') { |
|
|
|
|
|
// // 提交 |
|
|
|
|
|
// submitJob() |
|
|
|
|
|
// } else { |
|
|
|
|
|
// // 不允许部分提交,提示 |
|
|
|
|
|
// comMessageRef.value.showErrorMessage('请完成扫描后,再进行提交<br>' + `已经扫描[${scanCount.value}]箱总共[${subList.value.length}]箱`, (res) => { |
|
|
|
|
|
// if (res) { |
|
|
|
|
|
// openScanPopup() |
|
|
|
|
|
// } |
|
|
|
|
|
// }) |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
} |
|
|
} |
|
|
const submitJob = () => { |
|
|
const submitJob = () => { |
|
|
proxy.$modal.loading('提交中...') |
|
|
proxy.$modal.loading('提交中...') |
|
|
|
|
|
let itemCodes = [] |
|
|
|
|
|
this.detailSource.forEach(item => { |
|
|
|
|
|
itemCodes.push(item.itemCode) |
|
|
|
|
|
item.scaned = false |
|
|
|
|
|
}) |
|
|
|
|
|
getManagementPrecisions(itemCodes, fromLocationCode.value, res => { |
|
|
|
|
|
if (res.success) { |
|
|
|
|
|
managementList.value = res.list; |
|
|
|
|
|
//没有目标库位,不查询管理模式 |
|
|
const params = setParams() |
|
|
const params = setParams() |
|
|
unPlannedIssueJobSubmit(params) |
|
|
unPlannedIssueJobSubmit(params) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
if (res.data) { |
|
|
if (res.data) { |
|
|
showCommitSuccessMessage(`提交成功<br>生成计划外出库记录<br>${res.data}`) |
|
|
showCommitSuccessMessage(`提交成功\n生成计划外出库记录\n${res.data}`) |
|
|
} else { |
|
|
} else { |
|
|
showErrorMessage(`提交失败[${res.msg}]`) |
|
|
showErrorMessage(`提交失败[${res.msg}]`) |
|
|
} |
|
|
} |
|
@ -287,6 +322,11 @@ const submitJob = () => { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
showErrorMessage(error) |
|
|
showErrorMessage(error) |
|
|
}) |
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
showErrorMessage(res.message); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
const setParams = () => { |
|
|
const setParams = () => { |
|
|
const subList = [] |
|
|
const subList = [] |
|
@ -294,10 +334,14 @@ const setParams = () => { |
|
|
|
|
|
|
|
|
detailSource.value.forEach((item) => { |
|
|
detailSource.value.forEach((item) => { |
|
|
item.subList.forEach((detail) => { |
|
|
item.subList.forEach((detail) => { |
|
|
if (detail.scaned) { |
|
|
if (detail.scaned && !detail.isRecommend) { |
|
|
detail.toPackingNumber = detail.packingNumber |
|
|
detail.toPackingNumber = detail.packingNumber |
|
|
detail.toContainerNumber = '' |
|
|
detail.toContainerNumber = '' |
|
|
detail.toBatch = detail.batch |
|
|
detail.toBatch = detail.batch |
|
|
|
|
|
let info = getPackingNumberAndBatch(managementList.value, detail.itemCode,detail.packingNumber, detail.batch); |
|
|
|
|
|
detail.toPackingNumber = info.packingNumber; |
|
|
|
|
|
detail.packingNumber = info.packingNumber; |
|
|
|
|
|
detail.fromPackingNumber = info.packingNumber; |
|
|
subList.push(detail) |
|
|
subList.push(detail) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|