|
|
|
@ -112,8 +112,8 @@
|
|
|
|
|
<view> |
|
|
|
|
包条码: {{item.orderPackageCode || '暂无数据'}} |
|
|
|
|
</view> |
|
|
|
|
<view :style="{color : (item.isManuallyAdd ? '#f00' : '#000')}" |
|
|
|
|
@click="editOrderCode(item)"> |
|
|
|
|
<view v-if="details.pageType !== 3" |
|
|
|
|
:style="{color : (item.isManuallyAdd ? '#f00' : '#000')}" @click="editOrderCode(item)"> |
|
|
|
|
合同号: {{item.orderCode || '暂无数据'}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -126,7 +126,7 @@
|
|
|
|
|
<view> |
|
|
|
|
运单号: {{item.waybillNumber || '暂无数据'}} |
|
|
|
|
</view> |
|
|
|
|
<view> |
|
|
|
|
<view v-if="details.pageType !== 3"> |
|
|
|
|
合同号: {{item.orderCode || '暂无数据'}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -139,7 +139,7 @@
|
|
|
|
|
<view> |
|
|
|
|
物料编码: {{item.materialCode || '暂无数据'}} |
|
|
|
|
</view> |
|
|
|
|
<view> |
|
|
|
|
<view v-if="details.pageType !== 3"> |
|
|
|
|
合同号: {{item.orderCode || '暂无数据'}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -147,21 +147,21 @@
|
|
|
|
|
|
|
|
|
|
<view class="main_render_item"> |
|
|
|
|
<view> |
|
|
|
|
库位: {{item.allocation || '暂无数据'}} |
|
|
|
|
库位: {{item.positionCode || '暂无数据'}} |
|
|
|
|
</view> |
|
|
|
|
<template v-if="tabBarCode !== 1"> |
|
|
|
|
<view> |
|
|
|
|
物品名称: {{item.materialName || '暂无数据'}} |
|
|
|
|
</view> |
|
|
|
|
<view> |
|
|
|
|
数量: {{item.stockNum || '暂无数据'}} |
|
|
|
|
数量: {{item.maxNum || '暂无数据'}} |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<template v-else> |
|
|
|
|
<view> |
|
|
|
|
状态: |
|
|
|
|
{{details.stateArr.find(val => val.code === Number(item.cargoName)).title || '暂无数据'}} |
|
|
|
|
{{(details.stateArr.find(val => val.code === Number(item.cargoName)) || {}).title || '暂无数据'}} |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
</view> |
|
|
|
@ -170,7 +170,8 @@
|
|
|
|
|
<template v-if="tabBarCode !== 1"> |
|
|
|
|
<view> |
|
|
|
|
状态: |
|
|
|
|
{{details.stateArr.find(val => val.code === Number(item.cargoName)).title || '暂无数据'}} |
|
|
|
|
{{(details.stateArr.find(val => val.code === Number(item.cargoName)) || {}).title || '暂无数据' }} |
|
|
|
|
{{ item.cargoName }} |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
@ -192,7 +193,8 @@
|
|
|
|
|
<view class="button" @click="handleState(item)"> |
|
|
|
|
处理 |
|
|
|
|
</view> |
|
|
|
|
<view class="button" v-if='details.pageType !== 4' @click="handleItemUp(item)"> |
|
|
|
|
<view class="button" v-if='details.pageType !== 4 && details.pageType !== 2' |
|
|
|
|
@click="handleItemUp(item)"> |
|
|
|
|
上架 |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -224,7 +226,7 @@
|
|
|
|
|
<!-- 弹出层 -- 状态修改 --> |
|
|
|
|
<PopUp ref="popUp_EditState"> |
|
|
|
|
<view class="popUp_EditState_container"> |
|
|
|
|
<block v-for="item in details.stateArr" :key="item"> |
|
|
|
|
<block v-for="(item, index) in details.stateArr" :key="item"> |
|
|
|
|
<view class="popUp_row"> |
|
|
|
|
<view class="popUp_row_item" @click.stop="handleCheck(item)"> |
|
|
|
|
<!-- 被选中 --> |
|
|
|
@ -236,14 +238,14 @@
|
|
|
|
|
</view> |
|
|
|
|
<!-- 输入框 --> |
|
|
|
|
<template v-if="tabBarCode === 2 && item.code !== 10"> |
|
|
|
|
<input class="input" type="number" @blur="() => inputNum(item)" :disabled="item.disabled" |
|
|
|
|
v-model="item.value" /> |
|
|
|
|
<input class="input" type="number" @blur="() => inputNum(item, index)" |
|
|
|
|
:disabled="item.disabled || !item.isCheck" v-model="item.value" /> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<!-- 在库数 --> |
|
|
|
|
<template v-else-if="tabBarCode === 2 && item.code === 10"> |
|
|
|
|
<view class="input"> |
|
|
|
|
{{item.value - details.stateArr[2].value - details.stateArr[4].value - details.stateArr[5].value}} |
|
|
|
|
{{item.maxNum - details.stateArr[2].value - details.stateArr[4].value - details.stateArr[5].value}} |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
</view> |
|
|
|
@ -267,6 +269,19 @@
|
|
|
|
|
</view> |
|
|
|
|
</PopUp> |
|
|
|
|
|
|
|
|
|
<!-- 弹出层 -- 是否移库 --> |
|
|
|
|
<PopUp ref="popUp_RemoveAllocation"> |
|
|
|
|
<view class=""> |
|
|
|
|
包条码: {{details.removeTray.orderPackageCode}} |
|
|
|
|
</view> |
|
|
|
|
<view class=""> |
|
|
|
|
该包条绑定库位: {{details.removeTray.positionCode}} |
|
|
|
|
</view> |
|
|
|
|
<view class=""> |
|
|
|
|
本托盘: {{details.pageInfos.trayCode}} |
|
|
|
|
</view> |
|
|
|
|
</PopUp> |
|
|
|
|
|
|
|
|
|
<!-- 弹出层 -- 新增 --> |
|
|
|
|
<PopUp ref="popUp_Add"> |
|
|
|
|
<view class=""> |
|
|
|
@ -442,7 +457,7 @@
|
|
|
|
|
|
|
|
|
|
<view class="popUpDetails_row"> |
|
|
|
|
<view class=""> |
|
|
|
|
<text>库位:</text> <text>{{details.detailsInfo.allocation}}</text> |
|
|
|
|
<text>库位:</text> <text>{{details.detailsInfo.positionCode}}</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
@ -578,47 +593,57 @@
|
|
|
|
|
value: 1, |
|
|
|
|
code: 10, |
|
|
|
|
disabled: true, |
|
|
|
|
name: 'stockNum' |
|
|
|
|
name: 'stockNum', |
|
|
|
|
maxNum: 0, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '破损', |
|
|
|
|
isCheck: false, |
|
|
|
|
value: 0, |
|
|
|
|
code: 20, |
|
|
|
|
disabled: true, |
|
|
|
|
name: 'wornNum' |
|
|
|
|
disabled: false, |
|
|
|
|
name: 'wornNum', |
|
|
|
|
maxNum: 0, |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '丢失', |
|
|
|
|
isCheck: false, |
|
|
|
|
value: 0, |
|
|
|
|
code: 30, |
|
|
|
|
disabled: true, |
|
|
|
|
name: 'lossNum' |
|
|
|
|
disabled: false, |
|
|
|
|
name: 'lossNum', |
|
|
|
|
maxNum: 0, |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '不可修复', |
|
|
|
|
isCheck: false, |
|
|
|
|
value: 0, |
|
|
|
|
code: 40, |
|
|
|
|
disabled: true, |
|
|
|
|
name: 'noRepairNum' |
|
|
|
|
disabled: false, |
|
|
|
|
name: 'noRepairNum', |
|
|
|
|
maxNum: 0, |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '配送', |
|
|
|
|
isCheck: false, |
|
|
|
|
value: 0, |
|
|
|
|
code: 50, |
|
|
|
|
disabled: true, |
|
|
|
|
name: 'deliveNum' |
|
|
|
|
disabled: false, |
|
|
|
|
name: 'deliveNum', |
|
|
|
|
maxNum: 0, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '未入库', |
|
|
|
|
isCheck: false, |
|
|
|
|
value: 0, |
|
|
|
|
code: 60, |
|
|
|
|
disabled: true, |
|
|
|
|
name: 'noReceivedNum' |
|
|
|
|
disabled: false, |
|
|
|
|
name: 'noReceivedNum', |
|
|
|
|
maxNum: 0, |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
/** 盘点状态字典表 */ |
|
|
|
@ -670,7 +695,7 @@
|
|
|
|
|
/** 被移动的包条数据 */ |
|
|
|
|
removeTray: {}, |
|
|
|
|
/** 展示详情信息 */ |
|
|
|
|
detailsInfo: {} |
|
|
|
|
detailsInfo: {}, |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// 获取组件实例 |
|
|
|
@ -690,6 +715,8 @@
|
|
|
|
|
const popUp_AddStock = ref(null) |
|
|
|
|
/** 弹出层 -- 是否移托 */ |
|
|
|
|
const popUp_RemoveTary = ref(null) |
|
|
|
|
/** 弹出层 -- 是否移库 */ |
|
|
|
|
const popUp_RemoveAllocation = ref(null) |
|
|
|
|
/** 弹出层 -- 详情 */ |
|
|
|
|
const popUp_Details = ref(null) |
|
|
|
|
|
|
|
|
@ -766,7 +793,7 @@
|
|
|
|
|
else { |
|
|
|
|
// 盘点过的数据, 排查在库状态 |
|
|
|
|
val.questChildVOList.forEach(item => { |
|
|
|
|
if (item.questNum !== 0) val.cargoName = item.cargoName |
|
|
|
|
if (item.questNum !== 0) val.cargoName = Number(item.cargoName) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
// 记录所有已盘点的数量 |
|
|
|
@ -775,8 +802,33 @@
|
|
|
|
|
// 该条在系统中记录已盘点 |
|
|
|
|
val.isTask = true |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 按托盘盘点 |
|
|
|
|
if (details.pageType === 4) { |
|
|
|
|
// 是否属于本托盘 |
|
|
|
|
if (val.trayId !== details.pageInfos.trayId) { |
|
|
|
|
val.oldTrayId = val.trayId |
|
|
|
|
val.oldTrayCode = val.trayCode |
|
|
|
|
|
|
|
|
|
val.trayCode = details.pageInfos.trayCode |
|
|
|
|
val.trayId = details.pageInfos.trayId |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 按库位盘点 |
|
|
|
|
if (details.pageType === 2) { |
|
|
|
|
// 是否属于本托盘 |
|
|
|
|
if (val.allocationId !== details.pageInfos.allocationId) { |
|
|
|
|
val.oldAllocationId = val.allocationId |
|
|
|
|
val.oldAllocation = val.positionCode |
|
|
|
|
|
|
|
|
|
val.allocationId = details.pageInfos.allocationId |
|
|
|
|
val.positionCode = details.pageInfos.positionCode |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} catch (e) { |
|
|
|
|
} catch (err) { |
|
|
|
|
console.log('err :>> ', err); |
|
|
|
|
//TODO handle the exception |
|
|
|
|
} finally { |
|
|
|
|
return null |
|
|
|
@ -803,13 +855,41 @@
|
|
|
|
|
details.stockList = data.list || [] |
|
|
|
|
// 记录所有已盘点的数量 |
|
|
|
|
details.stockList.forEach(val => { |
|
|
|
|
val.maxNum = val.stockNum |
|
|
|
|
if (!val.cargoName) val.cargoName = 10 |
|
|
|
|
if (Number(val.questStatus) === 1) { |
|
|
|
|
details.scanNum++ |
|
|
|
|
val.isTask = true |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 按托盘盘点 |
|
|
|
|
if (details.pageType === 4) { |
|
|
|
|
// 是否属于本托盘 |
|
|
|
|
if (val.trayId !== details.pageInfos.trayId) { |
|
|
|
|
val.oldTrayId = val.trayId |
|
|
|
|
val.oldTrayCode = val.trayCode |
|
|
|
|
|
|
|
|
|
val.trayCode = details.pageInfos.trayCode |
|
|
|
|
val.trayId = details.pageInfos.trayId |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 按库位盘点 |
|
|
|
|
if (details.pageType === 2) { |
|
|
|
|
// 是否属于本库位 |
|
|
|
|
console.log('details.pageInfos :>> ', details.pageInfos); |
|
|
|
|
if (val.allocationId !== details.pageInfos.allocationId) { |
|
|
|
|
console.log('222 :>> ', 222); |
|
|
|
|
val.oldAllocationId = val.allocationId |
|
|
|
|
val.oldAllocation = val.positionCode |
|
|
|
|
|
|
|
|
|
val.allocationId = details.pageInfos.allocationId |
|
|
|
|
val.positionCode = details.pageInfos.positionCode |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} catch (e) { |
|
|
|
|
} catch (err) { |
|
|
|
|
console.log('err :>> ', err); |
|
|
|
|
//TODO handle the exception |
|
|
|
|
} finally { |
|
|
|
|
return null |
|
|
|
@ -848,7 +928,8 @@
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 扫到已有包条退出函数 || 合同号盘点时不支持新增 |
|
|
|
|
if (_flag || details.pageType === 3) return |
|
|
|
|
if (_flag) return utils.handleToast('重复扫码') |
|
|
|
|
else if (details.pageType === 3) return utils.handleToast('该数据不在本合同号内') |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
// uni.showLoading({ |
|
|
|
@ -883,6 +964,9 @@
|
|
|
|
|
val.isNew = true |
|
|
|
|
if (!val.cargoName) val.cargoName = 10 |
|
|
|
|
|
|
|
|
|
val.oldTrayCode = val.trayCode |
|
|
|
|
val.oldTrayId = val.trayId |
|
|
|
|
|
|
|
|
|
val.trayCode = details.pageInfos.trayCode |
|
|
|
|
val.trayId = details.pageInfos.trayId |
|
|
|
|
val.isChange = true |
|
|
|
@ -899,6 +983,37 @@
|
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 库位盘点 (判断该数据是否已上架) |
|
|
|
|
else if (details.pageType === 2 && val.allcationId) { |
|
|
|
|
details.removeAllocation = val |
|
|
|
|
popUp_RemoveAllocation.value.setDetails({ |
|
|
|
|
title: '是否移库', |
|
|
|
|
showPopUp: true, |
|
|
|
|
success() { |
|
|
|
|
val.questStatus = 1 |
|
|
|
|
details.scanNum++ |
|
|
|
|
val.isNew = true |
|
|
|
|
if (!val.cargoName) val.cargoName = 10 |
|
|
|
|
|
|
|
|
|
val.oldAllocationId = val.allocationId |
|
|
|
|
val.oldAllocation = val.positionCode |
|
|
|
|
|
|
|
|
|
val.trayCode = details.pageInfos.trayCode |
|
|
|
|
val.trayId = details.pageInfos.trayId |
|
|
|
|
val.isChange = true |
|
|
|
|
|
|
|
|
|
details.orderList.push(val) |
|
|
|
|
console.log('val :>> ', val); |
|
|
|
|
popUp_RemoveAllocation.value.details.showPopUp = false |
|
|
|
|
// #ifdef APP |
|
|
|
|
utils.ttsspke(details.scanNum + '件') |
|
|
|
|
// #endif |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
val.questStatus = 1 |
|
|
|
|
details.scanNum++ |
|
|
|
|
val.isNew = true |
|
|
|
@ -906,15 +1021,18 @@
|
|
|
|
|
if (!val.cargoName) val.cargoName = 10 |
|
|
|
|
if (details.pageType === 2) { |
|
|
|
|
val.allocationId = details.pageInfos.allocationId |
|
|
|
|
val.allocation = details.pageInfos.positionCode |
|
|
|
|
} |
|
|
|
|
else if (details.pageType === 3) { |
|
|
|
|
val.orderCode = details.pageInfos.orderCode |
|
|
|
|
val.orderId = details.pageInfos.orderId |
|
|
|
|
val.positionCode = details.pageInfos.positionCode |
|
|
|
|
|
|
|
|
|
val.oldAllocationId = '暂无数据' |
|
|
|
|
val.oldAllocation = '暂无数据' |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
else if (details.pageType === 4) { |
|
|
|
|
val.trayCode = details.pageInfos.trayCode |
|
|
|
|
val.trayId = details.pageInfos.trayId |
|
|
|
|
|
|
|
|
|
val.oldTrayCode = '暂无数据' |
|
|
|
|
val.oldTrayId = '暂无数据' |
|
|
|
|
} |
|
|
|
|
details.orderList.push(val) |
|
|
|
|
}) |
|
|
|
@ -944,11 +1062,11 @@
|
|
|
|
|
title: '新增', |
|
|
|
|
showPopUp: true, |
|
|
|
|
success() { |
|
|
|
|
const _order = { |
|
|
|
|
const _order : any = { |
|
|
|
|
orderPackageCode: details.scancode, |
|
|
|
|
questStatus: 1, |
|
|
|
|
orderCode: details.addInfo.orderCode, |
|
|
|
|
allocation: '', |
|
|
|
|
positionCode: '', |
|
|
|
|
cargoName: 10, |
|
|
|
|
isChoose: false, |
|
|
|
|
/** 为手动添加 */ |
|
|
|
@ -958,15 +1076,18 @@
|
|
|
|
|
} |
|
|
|
|
if (details.pageType === 2) { |
|
|
|
|
_order.allocationId = details.pageInfos.allocationId |
|
|
|
|
_order.allocation = details.pageInfos.positionCode |
|
|
|
|
} |
|
|
|
|
else if (details.pageType === 3) { |
|
|
|
|
_order.orderCode = details.pageInfos.orderCode |
|
|
|
|
_order.orderId = details.pageInfos.orderId |
|
|
|
|
_order.positionCode = details.pageInfos.positionCode |
|
|
|
|
|
|
|
|
|
_order.oldAllocationId = '暂无数据' |
|
|
|
|
_order.oldAllocation = '暂无数据' |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
else if (details.pageType === 4) { |
|
|
|
|
_order.trayCode = details.pageInfos.trayCode |
|
|
|
|
_order.trayId = details.pageInfos.trayId |
|
|
|
|
|
|
|
|
|
_order.oldTrayCode = '暂无数据' |
|
|
|
|
_order.oldTrayId = '暂无数据' |
|
|
|
|
} |
|
|
|
|
const _flag = details.addType.find(val => val.isCheck).title |
|
|
|
|
if (_flag === '定制品') _order.questTarget = 1 |
|
|
|
@ -1030,6 +1151,8 @@
|
|
|
|
|
|
|
|
|
|
/** 搜索 */ |
|
|
|
|
const handleSearch = () => { |
|
|
|
|
if (!details.searchCode) return utils.handleToast('请输入包条码') |
|
|
|
|
|
|
|
|
|
details.scancode = details.searchCode |
|
|
|
|
scandata() |
|
|
|
|
} |
|
|
|
@ -1138,7 +1261,7 @@
|
|
|
|
|
if (_item.questStatus === 1) { |
|
|
|
|
// 改变库位信息 |
|
|
|
|
_item.allocationId = allocationId |
|
|
|
|
_item.allocation = positionCode |
|
|
|
|
_item.positionCode = positionCode |
|
|
|
|
_item.isChange = true |
|
|
|
|
_number++ |
|
|
|
|
} |
|
|
|
@ -1203,6 +1326,11 @@
|
|
|
|
|
if (val.code === cargoName) { |
|
|
|
|
val.isCheck = true |
|
|
|
|
val.value = 1 |
|
|
|
|
|
|
|
|
|
if (cargoName === 20 || cargoName === 40) { |
|
|
|
|
details.stateArr[0].value = 1 |
|
|
|
|
details.stateArr[0].isCheck = true |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
val.isCheck = false |
|
|
|
|
val.value = 0 |
|
|
|
@ -1221,26 +1349,29 @@
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if ( |
|
|
|
|
cargoName.stockNum |
|
|
|
|
|| cargoName.wornNum |
|
|
|
|
if (!cargoName.questChildVOList |
|
|
|
|
|| cargoName.lossNum |
|
|
|
|
|| cargoName.noRepairNum |
|
|
|
|
|| cargoName.deliveNum |
|
|
|
|
|| cargoName.wornNum |
|
|
|
|
|| cargoName.noRepairNum |
|
|
|
|
|| cargoName.noReceivedNum) { |
|
|
|
|
details.stateArr.forEach((val) => { |
|
|
|
|
const _value = cargoName[val.name] |
|
|
|
|
console.log('val.name :>> ', val.name); |
|
|
|
|
console.log('_value :>> ', _value); |
|
|
|
|
val.maxNum = cargoName.maxNum |
|
|
|
|
if (_value > 0 && _value) val.value = _value |
|
|
|
|
else val.value = 0 |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
cargoName.questChildVOList.forEach((val, index) => { |
|
|
|
|
details.stateArr[index].maxNum = cargoName.maxNum |
|
|
|
|
details.stateArr[index].isCheck = val.questNum === 0 ? false : true |
|
|
|
|
details.stateArr[index].value = val.questNum |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
console.log('details.stateArr :>> ', details.stateArr); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -1375,8 +1506,6 @@
|
|
|
|
|
|
|
|
|
|
/** 关闭或显示下拉框 */ |
|
|
|
|
const handleShowSelect = (index) => { |
|
|
|
|
console.log('222 :>> ', 222); |
|
|
|
|
|
|
|
|
|
details.materialChooseIndex = index === details.materialChooseIndex ? 0 : index |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1452,40 +1581,30 @@
|
|
|
|
|
confirmText: '确认上架', |
|
|
|
|
success() { |
|
|
|
|
const { positionCode, allocationId } = details.positionInfo |
|
|
|
|
let content = '' |
|
|
|
|
let _number = 0 |
|
|
|
|
if (positionCode) { |
|
|
|
|
for (let i = 0; i <= details.renderList.length - 1; i++) { |
|
|
|
|
const _item = details.renderList[i] |
|
|
|
|
if (_item.isChoose) { |
|
|
|
|
// 改变库位信息 |
|
|
|
|
_item.allocationId = allocationId |
|
|
|
|
_item.allocation = positionCode |
|
|
|
|
_item.isChange = true |
|
|
|
|
|
|
|
|
|
_number++ |
|
|
|
|
|
|
|
|
|
if (_item.questStatus !== 1) { |
|
|
|
|
// 改变盘点状态 |
|
|
|
|
details.renderList[i].questStatus = 1 |
|
|
|
|
|
|
|
|
|
// 改变已盘点数 |
|
|
|
|
details.scanNum++ |
|
|
|
|
} |
|
|
|
|
if (!positionCode) return utils.handleToast('上架失败, 库位数据有误') |
|
|
|
|
for (let i = 0; i <= details.renderList.length - 1; i++) { |
|
|
|
|
const _item = details.renderList[i] |
|
|
|
|
if (_item.isChoose) { |
|
|
|
|
// 改变库位信息 |
|
|
|
|
_item.allocationId = allocationId |
|
|
|
|
_item.positionCode = positionCode |
|
|
|
|
_item.isChange = true |
|
|
|
|
|
|
|
|
|
_number++ |
|
|
|
|
|
|
|
|
|
if (_item.questStatus !== 1) { |
|
|
|
|
// 改变盘点状态 |
|
|
|
|
details.renderList[i].questStatus = 1 |
|
|
|
|
|
|
|
|
|
// 改变已盘点数 |
|
|
|
|
details.scanNum++ |
|
|
|
|
} |
|
|
|
|
// 重置选中状态 |
|
|
|
|
_item.isChoose = false |
|
|
|
|
} |
|
|
|
|
content = '上架成功' + _number + '件' |
|
|
|
|
} else content = '上架失败, 库位数据有误' |
|
|
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
title: content, |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
// #ifdef APP |
|
|
|
|
utils.ttsspke(content) |
|
|
|
|
// #endif |
|
|
|
|
// 重置选中状态 |
|
|
|
|
_item.isChoose = false |
|
|
|
|
} |
|
|
|
|
utils.handleToast('上架成功' + _number + '件') |
|
|
|
|
|
|
|
|
|
// 重置库位信息 |
|
|
|
|
details.positionInfo.allocationId = '' |
|
|
|
@ -1565,7 +1684,10 @@
|
|
|
|
|
} |
|
|
|
|
_item.isCheck = true |
|
|
|
|
_item.value = 1 |
|
|
|
|
if (_item.title === '破损' || _item.title === '不可修复') details.stateArr[0].value = 1 |
|
|
|
|
if (_item.title === '破损' || _item.title === '不可修复') { |
|
|
|
|
details.stateArr[0].value = 1 |
|
|
|
|
details.stateArr[0].isCheck = true |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
console.log('details.stateArr[0].value :>> ', details.stateArr[0].value); |
|
|
|
|
// 无数据 |
|
|
|
@ -1575,8 +1697,7 @@
|
|
|
|
|
if (details.stateArr[0].value === 0 && _item.title === '破损' || details.stateArr[0].value === 0 && _item.title === '不可修复') return |
|
|
|
|
|
|
|
|
|
_item.isCheck = !_item.isCheck |
|
|
|
|
_item.disabled = !_item.isCheck |
|
|
|
|
if (_item.disabled && _item.code !== details.stateArr[0].code) _item.value = 0 |
|
|
|
|
if (!_item.isCheck && _item.code !== details.stateArr[0].code) _item.value = 0 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1591,8 +1712,9 @@
|
|
|
|
|
showPopUp: true, |
|
|
|
|
success() { |
|
|
|
|
if (tabBarCode.value === 1) { |
|
|
|
|
const _value = details.stateArr.find(val => val.isCheck) |
|
|
|
|
_item.cargoName = _value.code |
|
|
|
|
for (let i = 0; i < details.stateArr.length; i++) { |
|
|
|
|
if (details.stateArr[i].isCheck) _item.cargoName = details.stateArr[i].code |
|
|
|
|
} |
|
|
|
|
// 改变盘点状态 |
|
|
|
|
} else { |
|
|
|
|
details.stateArr.forEach(val => { |
|
|
|
@ -1621,27 +1743,22 @@
|
|
|
|
|
confirmText: '确认上架', |
|
|
|
|
showPopUp: true, |
|
|
|
|
success() { |
|
|
|
|
let content = '' |
|
|
|
|
const { allocationId, positionCode } = details.positionInfo |
|
|
|
|
|
|
|
|
|
if (positionCode) { |
|
|
|
|
_item.allocationId = allocationId |
|
|
|
|
_item.allocation = positionCode |
|
|
|
|
// 改变已盘点数 |
|
|
|
|
if (_item.questStatue !== 1) details.scanNum++ |
|
|
|
|
// 更改上架状态 |
|
|
|
|
_item.questStatus = 1 |
|
|
|
|
_item.isChange = true |
|
|
|
|
content = '上架成功' |
|
|
|
|
} else content = '上架失败, 库位数据有误' |
|
|
|
|
if (!positionCode) return utils.handleToast('上架失败, 库位数据有误') |
|
|
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
title: content, |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
// #ifdef APP |
|
|
|
|
utils.ttsspke(content) |
|
|
|
|
// #endif |
|
|
|
|
_item.oldAllocationId = _item.allocationId |
|
|
|
|
_item.oldAllocation = _item.positionCode |
|
|
|
|
|
|
|
|
|
_item.allocationId = allocationId |
|
|
|
|
_item.positionCode = positionCode |
|
|
|
|
// 改变已盘点数 |
|
|
|
|
if (_item.questStatue !== 1) details.scanNum++ |
|
|
|
|
// 更改上架状态 |
|
|
|
|
_item.questStatus = 1 |
|
|
|
|
_item.isChange = true |
|
|
|
|
|
|
|
|
|
utils.handleToast('上架成功') |
|
|
|
|
|
|
|
|
|
// 重置库位数据 |
|
|
|
|
details.positionInfo.positionCode = '' |
|
|
|
@ -1685,6 +1802,7 @@
|
|
|
|
|
materialName: details.addInfo.materialName, |
|
|
|
|
cargoName: 10, |
|
|
|
|
stockNum: _number, |
|
|
|
|
maxNum: _number, |
|
|
|
|
isChoose: false, |
|
|
|
|
/** 为手动添加 */ |
|
|
|
|
isManuallyAdd: true, |
|
|
|
@ -1693,15 +1811,18 @@
|
|
|
|
|
} |
|
|
|
|
if (details.pageType === 2) { |
|
|
|
|
_order.allocationId = details.pageInfos.allocationId |
|
|
|
|
_order.allocation = details.pageInfos.positionCode |
|
|
|
|
} |
|
|
|
|
else if (details.pageType === 3) { |
|
|
|
|
_order.orderCode = details.pageInfos.orderCode |
|
|
|
|
_order.orderId = details.pageInfos.orderId |
|
|
|
|
_order.positionCode = details.pageInfos.positionCode |
|
|
|
|
|
|
|
|
|
_order.oldAllocationId = '暂无数据' |
|
|
|
|
_order.oldAllocation = '暂无数据' |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
else if (details.pageType === 4) { |
|
|
|
|
_order.trayCode = details.pageInfos.trayCode |
|
|
|
|
_order.trayId = details.pageInfos.trayId |
|
|
|
|
|
|
|
|
|
_order.oldTrayCode = '暂无数据' |
|
|
|
|
_order.oldTrayId = '暂无数据' |
|
|
|
|
} |
|
|
|
|
details.stockList.push(_order) |
|
|
|
|
details.scanNum++ |
|
|
|
@ -1755,6 +1876,7 @@
|
|
|
|
|
clientName: details.addInfo.clientName, |
|
|
|
|
cargoName: 10, |
|
|
|
|
stockNum: _number, |
|
|
|
|
maxNum: _number, |
|
|
|
|
isChoose: false, |
|
|
|
|
/** 为手动添加 */ |
|
|
|
|
isManuallyAdd: true, |
|
|
|
@ -1763,15 +1885,18 @@
|
|
|
|
|
} |
|
|
|
|
if (details.pageType === 2) { |
|
|
|
|
_order.allocationId = details.pageInfos.allocationId |
|
|
|
|
_order.allocation = details.pageInfos.positionCode |
|
|
|
|
} |
|
|
|
|
else if (details.pageType === 3) { |
|
|
|
|
_order.orderCode = details.pageInfos.orderCode |
|
|
|
|
_order.orderId = details.pageInfos.orderId |
|
|
|
|
_order.positionCode = details.pageInfos.positionCode |
|
|
|
|
|
|
|
|
|
_order.oldAllocationId = '暂无数据' |
|
|
|
|
_order.oldallocation = '暂无数据' |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
else if (details.pageType === 4) { |
|
|
|
|
_order.trayCode = details.pageInfos.trayCode |
|
|
|
|
_order.trayId = details.pageInfos.trayId |
|
|
|
|
|
|
|
|
|
_order.oldTrayCode = '暂无数据' |
|
|
|
|
_order.oldTrayId = '暂无数据' |
|
|
|
|
} |
|
|
|
|
details.stockList.push(_order) |
|
|
|
|
details.scanNum++ |
|
|
|
@ -1824,13 +1949,22 @@
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** 输入 */ |
|
|
|
|
const inputNum = (_item) => { |
|
|
|
|
let _maxNum = details.stateArr[0].value - details.stateArr[2].value - details.stateArr[4].value - details.stateArr[5].value |
|
|
|
|
const inputNum = (_item, index) => { |
|
|
|
|
console.log('index :>> ', index); |
|
|
|
|
console.log('_item :>> ', _item); |
|
|
|
|
const whiteArr = [2, 4, 5] |
|
|
|
|
|
|
|
|
|
let _maxNum = _item.maxNum - details.stateArr[2].value - details.stateArr[4].value - details.stateArr[5].value |
|
|
|
|
|
|
|
|
|
if (whiteArr.includes(index)) _maxNum += Number(details.stateArr[index].value) |
|
|
|
|
|
|
|
|
|
console.log('_maxNum :>> ', _maxNum); |
|
|
|
|
|
|
|
|
|
let _number = Number(_item.value) |
|
|
|
|
if (_number !== _number) return _item.value = 0 |
|
|
|
|
else if (_number <= 0) return _item.value = 0 |
|
|
|
|
else if (_maxNum < 0) _item.value = 0 |
|
|
|
|
else if (_item.value > _maxNum) _item.value = _maxNum |
|
|
|
|
else _item.value = _number |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1853,18 +1987,18 @@
|
|
|
|
|
questDetailList: [] |
|
|
|
|
} |
|
|
|
|
details.orderList.forEach(val => { |
|
|
|
|
if (Number(val.questStatus) !== 1) return |
|
|
|
|
// if (Number(val.questStatus) !== 1) return |
|
|
|
|
|
|
|
|
|
// 不是新增的且状态为在库 |
|
|
|
|
if (!val.isManuallyAdd |
|
|
|
|
// && !val.isNew |
|
|
|
|
// && !val.isChange |
|
|
|
|
&& Number(val.cargoName) === 10 |
|
|
|
|
) { |
|
|
|
|
console.log('1 :>> ', 1); |
|
|
|
|
submitData.questDetailIds.push(val.questDetailId) |
|
|
|
|
if (!val.isChange) return |
|
|
|
|
} |
|
|
|
|
// // 不是新增的且状态为在库 |
|
|
|
|
// if (!val.isManuallyAdd |
|
|
|
|
// // && !val.isNew |
|
|
|
|
// // && !val.isChange |
|
|
|
|
// && Number(val.cargoName) === 10 |
|
|
|
|
// ) { |
|
|
|
|
// console.log('1 :>> ', 1); |
|
|
|
|
// if (!val.isChange) return |
|
|
|
|
// } |
|
|
|
|
submitData.questDetailIds.push(val.questDetailId) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const _item = { |
|
|
|
@ -1881,9 +2015,6 @@
|
|
|
|
|
/** 未入库数量 */ |
|
|
|
|
noReceivedNum: 0, |
|
|
|
|
id: val.questDetailId, |
|
|
|
|
/** 上架修改后的库位id */ |
|
|
|
|
groundingAllocationId: val.allocationId, |
|
|
|
|
groundingPositionCode: val.allocation, |
|
|
|
|
questId: details.pageInfos.questId, |
|
|
|
|
questNum: details.pageInfos.questNum, |
|
|
|
|
orderCode: val.orderCode, |
|
|
|
@ -1894,24 +2025,43 @@
|
|
|
|
|
} |
|
|
|
|
_item.isNew = val.isManuallyAdd ? 1 : 0 |
|
|
|
|
|
|
|
|
|
if (val.isNew || val.isManuallyAdd) { |
|
|
|
|
if (details.pageType === 2) { |
|
|
|
|
_item.allocationId = details.pageInfos.allocationId |
|
|
|
|
_item.positionCode = details.pageInfos.allocation |
|
|
|
|
// 当修改前和修改后的Id一样时, 删除修改后的 |
|
|
|
|
// if (_item.groundingAllocationId === _item.allocationId) { |
|
|
|
|
// delete _item.groundingAllocationId |
|
|
|
|
// delete _item.groundingPositionCode |
|
|
|
|
// } |
|
|
|
|
// if (val.isNew || val.isManuallyAdd) { |
|
|
|
|
if (details.pageType === 2) { |
|
|
|
|
if (val.oldAllocationId) { |
|
|
|
|
// 上架后的新库位 |
|
|
|
|
_item.groundingPositionCode = val.positionCode |
|
|
|
|
_item.groundingAllocationId = val.allocationId |
|
|
|
|
} |
|
|
|
|
else if (details.pageType === 4) { |
|
|
|
|
_item.trayCode = val.trayCode |
|
|
|
|
_item.trayId = val.trayId |
|
|
|
|
|
|
|
|
|
// 库位盘点时, 不传托盘 |
|
|
|
|
delete _item.trayCode |
|
|
|
|
delete _item.trayId |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
else if (details.pageType === 3) { |
|
|
|
|
if (val.oldAllocationId) { |
|
|
|
|
_item.groundingPositionCode = val.positionCode |
|
|
|
|
_item.groundingAllocationId = val.allocationId |
|
|
|
|
} |
|
|
|
|
_item.orderPackageCode = val.orderPackageCode |
|
|
|
|
_item.orderPackageId = val.orderPackageId |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
else if (details.pageType === 4) { |
|
|
|
|
if (val.oldTrayCode) { |
|
|
|
|
_item.newTrayCode = val.trayCode |
|
|
|
|
_item.newTrayId = val.trayId |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 托盘盘点时, 不传库位 |
|
|
|
|
delete _item.groundingPositionCode |
|
|
|
|
delete _item.groundingAllocationId |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
console.log('val :>> ', val); |
|
|
|
|
// } |
|
|
|
|
_item.orderPackageCode = val.orderPackageCode |
|
|
|
|
_item.orderPackageId = val.orderPackageId |
|
|
|
|
|
|
|
|
|
// 不改变在库数的 |
|
|
|
|
const _whiteCodeArr = [10, 20, 40] |
|
|
|
|
|
|
|
|
@ -1925,19 +2075,19 @@
|
|
|
|
|
details.stockList.forEach(val => { |
|
|
|
|
if (Number(val.questStatus) !== 1) return |
|
|
|
|
|
|
|
|
|
if (!val.isManuallyAdd |
|
|
|
|
&& !val.isNew |
|
|
|
|
&& val.lossNum === 0 |
|
|
|
|
&& val.deliveNum === 0 |
|
|
|
|
&& val.wornNum === 0 |
|
|
|
|
&& val.noRepairNum === 0 |
|
|
|
|
&& val.noReceivedNum === 0 |
|
|
|
|
&& Number(val.cargoName) === 1 |
|
|
|
|
// && !val.isChange |
|
|
|
|
) { |
|
|
|
|
submitData.questDetailIds.push(val.questDetailId) |
|
|
|
|
if (!val.isChange) return |
|
|
|
|
} |
|
|
|
|
// if (!val.isManuallyAdd |
|
|
|
|
// && !val.isNew |
|
|
|
|
// && val.lossNum === 0 |
|
|
|
|
// && val.deliveNum === 0 |
|
|
|
|
// && val.wornNum === 0 |
|
|
|
|
// && val.noRepairNum === 0 |
|
|
|
|
// && val.noReceivedNum === 0 |
|
|
|
|
// && Number(val.cargoName) === 1 |
|
|
|
|
// // && !val.isChange |
|
|
|
|
// ) { |
|
|
|
|
// if (!val.isChange) return |
|
|
|
|
// } |
|
|
|
|
submitData.questDetailIds.push(val.questDetailId) |
|
|
|
|
const _item = { |
|
|
|
|
/** 在库数量 */ |
|
|
|
|
stockNum: val.stockNum || 0, |
|
|
|
@ -1951,9 +2101,6 @@
|
|
|
|
|
noRepairNum: val.noRepairNum || 0, |
|
|
|
|
/** 未入库数量 */ |
|
|
|
|
noReceivedNum: val.noReceivedNum || 0, |
|
|
|
|
/** 上架后的库位id */ |
|
|
|
|
groundingAllocationId: val.allocationId, |
|
|
|
|
groundingPositionCode: val.allocation, |
|
|
|
|
id: val.questDetailId, |
|
|
|
|
questId: details.pageInfos.questId, |
|
|
|
|
waybillNumber: val.waybillNumber, |
|
|
|
@ -1967,24 +2114,41 @@
|
|
|
|
|
isNew: 0 |
|
|
|
|
} |
|
|
|
|
// 计算在库数 |
|
|
|
|
_item.stockNum = _item.stockNum - _item.lossNum - _item.deliveNum - _item.noReceivedNum |
|
|
|
|
_item.stockNum = val.maxNum - _item.lossNum - _item.deliveNum - _item.noReceivedNum |
|
|
|
|
_item.quantity = _item.stockNum |
|
|
|
|
_item.isNew = val.isManuallyAdd ? 1 : 0 |
|
|
|
|
|
|
|
|
|
if (_item.isNew === 1) { |
|
|
|
|
if (details.pageType === 2) { |
|
|
|
|
_item.allocationId = details.pageInfos.allocationId |
|
|
|
|
_item.positionCode = details.pageInfos.allocation |
|
|
|
|
// 当修改前和修改后的Id一样时, 删除修改后的 |
|
|
|
|
// if (_item.groundingAllocationId === _item.allocationId) { |
|
|
|
|
// delete _item.groundingAllocationId |
|
|
|
|
// delete _item.groundingPositionCode |
|
|
|
|
// } |
|
|
|
|
// if (_item.isNew === 1) { |
|
|
|
|
if (details.pageType === 2) { |
|
|
|
|
if (val.oldAllocationId) { |
|
|
|
|
_item.groundingPositionCode = val.positionCode |
|
|
|
|
_item.groundingAllocationId = val.allocationId |
|
|
|
|
} |
|
|
|
|
else if (details.pageType === 4) { |
|
|
|
|
_item.trayCode = val.trayCode |
|
|
|
|
_item.trayId = val.trayId |
|
|
|
|
|
|
|
|
|
// 库位盘点时, 不传托盘 |
|
|
|
|
delete _item.trayCode |
|
|
|
|
delete _item.trayId |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
else if (details.pageType === 3) { |
|
|
|
|
if (val.oldAllocationId) { |
|
|
|
|
_item.groundingPositionCode = val.positionCode |
|
|
|
|
_item.groundingAllocationId = val.allocationId |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
else if (details.pageType === 4) { |
|
|
|
|
if (val.oldTrayId) { |
|
|
|
|
_item.newTrayCode = val.trayCode |
|
|
|
|
_item.newTrayId = val.trayId |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 托盘盘点时, 不传库位 |
|
|
|
|
delete _item.groundingPositionCode |
|
|
|
|
delete _item.groundingAllocationId |
|
|
|
|
} |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
submitData.questDetailList.push(_item) |
|
|
|
@ -1998,7 +2162,7 @@
|
|
|
|
|
utils.ttsspke('盘点成功') |
|
|
|
|
const timer = setTimeout(() => { |
|
|
|
|
// 提交成功返回上一级页面 |
|
|
|
|
uni.navigateBack() |
|
|
|
|
// uni.navigateBack() |
|
|
|
|
clearTimeout(timer) |
|
|
|
|
}, 1000) |
|
|
|
|
} |
|
|
|
|