|
|
|
@ -19,7 +19,11 @@ |
|
|
|
<!-- 处理异常按钮 - 已审批状态显示 - rqrq --> |
|
|
|
<el-button type="danger" @click="openHandleExceptionDialog" |
|
|
|
v-if="headerData && headerData.status === 'APPROVED'" |
|
|
|
:disabled="headerLoading || handleExceptionLoading">处理异常</el-button> |
|
|
|
:disabled="headerLoading || handleExceptionLoading">选择处理方式</el-button> |
|
|
|
|
|
|
|
<el-button type="danger" @click="handleAutoAdjustment" |
|
|
|
v-if="headerData && headerData.status === 'APPROVED'" |
|
|
|
:disabled="headerLoading || autoAdjustLoading">{{ autoAdjustLoading ? '处理中...' : '自动处理盈亏' }}</el-button> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- Header信息展示区域 - 一行6个input框 --> |
|
|
|
@ -202,7 +206,7 @@ |
|
|
|
width="150" |
|
|
|
:label="'操作'"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a type="text" size="small" v-if="scope.row.handleFlag==='N'&&scope.row.handleType==='MANUAL'" @click="addOrUpdateHandle(scope.row.id)">{{'人工处理完成'}}</a> |
|
|
|
<a type="text" size="small" v-if="scope.row.handleFlag==='N'&&scope.row.handleType==='MANUAL'" @click="manualHandleCount(scope.row.id)">{{'人工处理完成'}}</a> |
|
|
|
<a type="text" size="small" @click="callPallet(scope.row)">{{'Call栈板'}}</a> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
@ -246,6 +250,54 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-tab-pane> |
|
|
|
<!-- 盘盈盘亏记录页签 - rqrq --> |
|
|
|
<el-tab-pane label="盘盈盘亏记录" name="adjustment"> |
|
|
|
<div style="display: flex; gap: 10px;"> |
|
|
|
<!-- 左边:事务明细 - rqrq --> |
|
|
|
<div style="flex: 1;"> |
|
|
|
<div style="font-weight: bold; margin-bottom: 5px; font-size: 12px;">事务明细</div> |
|
|
|
<el-table :data="adjustmentTransList" :height="height" border v-loading="adjustmentTransLoading" |
|
|
|
highlight-current-row @row-click="onAdjustmentTransRowClick" style="width: 100%;"> |
|
|
|
<el-table-column prop="transNo" label="事务号" min-width="120" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="transTypeDesc" label="事务类型" min-width="80" header-align="center" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span :style="{color: scope.row.transTypeDb === 'PY' ? '#67C23A' : '#F56C6C'}">{{ scope.row.transTypeDesc }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="itemNo" label="行号" min-width="60" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="partNo" label="物料号" min-width="120" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="transQty" label="事务数量" min-width="100" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="batchNo" label="批号" min-width="100" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="locationId" label="库位" min-width="100" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="directionDesc" label="方向" min-width="60" header-align="center" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span :style="{color: scope.row.direction === 'IN' ? '#67C23A' : '#F56C6C'}">{{ scope.row.directionDesc }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="warehouseId" label="仓库" min-width="80" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="userName" label="操作人" min-width="80" header-align="center" align="center"></el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
<!-- 右边:事务子明细 - rqrq --> |
|
|
|
<div style="flex: 1;"> |
|
|
|
<div style="font-weight: bold; margin-bottom: 5px; font-size: 12px;">事务子明细</div> |
|
|
|
<el-table :data="adjustmentTransSubList" :height="height" border v-loading="adjustmentTransSubLoading" style="width: 100%;"> |
|
|
|
<el-table-column prop="subNo" label="子行号" min-width="60" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="handlingUnitId" label="标签号" min-width="150" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="subQty" label="子数量" min-width="80" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="partNo" label="物料号" min-width="120" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="batchNo" label="批号" min-width="100" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="locationId" label="库位" min-width="100" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="palletId" label="栈板号" min-width="120" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column prop="directionDesc" label="方向" min-width="60" header-align="center" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span :style="{color: scope.row.direction === 'IN' ? '#67C23A' : '#F56C6C'}">{{ scope.row.directionDesc }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
|
|
|
|
<!-- 复核弹框 - rqrq --> |
|
|
|
@ -323,7 +375,8 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import {scanAndCallPalletForHetuo, getCurrentActiveCount, releaseCount, pushCountToWcs, continuePushCount, approveCount, completeCount, cancelCount, searchCountLabelList, searchCountPalletList, searchCountResultList, searchMaterialSummary, searchOrderTaskByCountNo, searchOrderTaskDetail, hasUncompletedTask, createReviewTask, searchUnhandledExceptionList, saveExceptionHandle ,} from '@/api/check/physicalInventory' |
|
|
|
import {scanAndCallPalletForHetuo, getCurrentActiveCount, releaseCount, pushCountToWcs, continuePushCount, approveCount, completeCount, cancelCount, searchCountLabelList, searchCountPalletList, searchCountResultList, searchMaterialSummary, searchOrderTaskByCountNo, searchOrderTaskDetail, hasUncompletedTask, createReviewTask, searchUnhandledExceptionList, saveExceptionHandle, checkSystemHandleCount, executeSystemAdjustment, queryAdjustmentTransList, queryAdjustmentTransSubList} from '@/api/check/physicalInventory' |
|
|
|
import {manualHandleCount} from '../../../api/check/physicalInventory' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'currentPhysicalInventory', |
|
|
|
@ -446,7 +499,17 @@ export default { |
|
|
|
handleExceptionDialogVisible: false, |
|
|
|
handleExceptionLoading: false, |
|
|
|
saveExceptionLoading: false, |
|
|
|
exceptionResultList: [] // 异常盘点结果列表 |
|
|
|
exceptionResultList: [], // 异常盘点结果列表 |
|
|
|
|
|
|
|
// 自动盘盈盘亏处理 - rqrq |
|
|
|
autoAdjustLoading: false, |
|
|
|
|
|
|
|
// 盘盈盘亏记录相关 - rqrq |
|
|
|
adjustmentTransList: [], // 事务明细列表 |
|
|
|
adjustmentTransLoading: false, |
|
|
|
adjustmentTransSubList: [], // 事务子明细列表 |
|
|
|
adjustmentTransSubLoading: false, |
|
|
|
currentAdjustmentTrans: null // 当前选中的事务 |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
@ -511,6 +574,8 @@ export default { |
|
|
|
this.loadSummaryList(params) |
|
|
|
} else if (this.activeName === 'task') { |
|
|
|
this.loadTaskList(params) |
|
|
|
} else if (this.activeName === 'adjustment') { |
|
|
|
this.loadAdjustmentTransList(params) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
@ -620,6 +685,52 @@ export default { |
|
|
|
this.taskDetailListLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 加载盘盈盘亏事务记录 - rqrq |
|
|
|
loadAdjustmentTransList(params) { |
|
|
|
this.adjustmentTransLoading = true |
|
|
|
this.adjustmentTransList = [] |
|
|
|
this.adjustmentTransSubList = [] |
|
|
|
this.currentAdjustmentTrans = null |
|
|
|
queryAdjustmentTransList(params).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.adjustmentTransList = data.rows || [] |
|
|
|
// 默认选中第一行 |
|
|
|
if (this.adjustmentTransList.length > 0) { |
|
|
|
this.currentAdjustmentTrans = this.adjustmentTransList[0] |
|
|
|
this.loadAdjustmentTransSubList() |
|
|
|
} |
|
|
|
} |
|
|
|
}).finally(() => { |
|
|
|
this.adjustmentTransLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 盘盈盘亏事务行点击 - rqrq |
|
|
|
onAdjustmentTransRowClick(row) { |
|
|
|
this.currentAdjustmentTrans = row |
|
|
|
this.loadAdjustmentTransSubList() |
|
|
|
}, |
|
|
|
|
|
|
|
// 加载盘盈盘亏事务子明细 - rqrq |
|
|
|
loadAdjustmentTransSubList() { |
|
|
|
if (!this.currentAdjustmentTrans) { |
|
|
|
this.adjustmentTransSubList = [] |
|
|
|
return |
|
|
|
} |
|
|
|
this.adjustmentTransSubLoading = true |
|
|
|
const params = { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
transNo: this.currentAdjustmentTrans.transNo |
|
|
|
} |
|
|
|
queryAdjustmentTransSubList(params).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.adjustmentTransSubList = data.rows || [] |
|
|
|
} |
|
|
|
}).finally(() => { |
|
|
|
this.adjustmentTransSubLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 下达盘点单 - rqrq |
|
|
|
handleRelease() { |
|
|
|
@ -1019,6 +1130,105 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
manualHandleCount(id){ |
|
|
|
this.$confirm(`确定要手动处理完成这个标签?`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
const params = { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
id: id, |
|
|
|
} |
|
|
|
manualHandleCount(params).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('处理完成') |
|
|
|
this.loadTabData() |
|
|
|
}else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// ==================== 自动盘盈盘亏处理 ==================== - rqrq |
|
|
|
|
|
|
|
// 自动处理盈亏 - rqrq |
|
|
|
handleAutoAdjustment() { |
|
|
|
// 1. 先检查是否有需要系统处理的记录 - rqrq |
|
|
|
const checkParams = { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
countNo: this.headerData.countNo |
|
|
|
} |
|
|
|
|
|
|
|
checkSystemHandleCount(checkParams).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
const count = data.count || 0 |
|
|
|
if (count === 0) { |
|
|
|
this.$alert('无异常结果需要系统处理', '提示', { confirmButtonText: '确定' }) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// 2. 有记录则弹框确认 - rqrq |
|
|
|
this.$confirm(`检测到${count}条异常结果需要系统处理,确定执行自动盘盈盘亏处理?\n\n处理后将:\n1. 生成盘盈/盘亏事务单据\n2. 更新库存数据\n3. 调整标签数量`, '确认自动处理', { |
|
|
|
confirmButtonText: '确定执行', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.executeAutoAdjustment() |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg || '检查失败', '错误', { confirmButtonText: '确定' }) |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.$alert('网络错误', '错误', { confirmButtonText: '确定' }) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 执行自动盘盈盘亏处理 - rqrq |
|
|
|
executeAutoAdjustment() { |
|
|
|
this.autoAdjustLoading = true |
|
|
|
|
|
|
|
const params = { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
countNo: this.headerData.countNo, |
|
|
|
username: this.$store.state.user.name |
|
|
|
} |
|
|
|
|
|
|
|
executeSystemAdjustment(params).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
const result = data.row |
|
|
|
if (result && result.success) { |
|
|
|
// 构建成功消息 - rqrq |
|
|
|
let msg = result.message || '处理完成' |
|
|
|
if (result.lossTransNoList && result.lossTransNoList.length > 0) { |
|
|
|
msg += '\n盘亏单据:' + result.lossTransNoList.join(', ') |
|
|
|
} |
|
|
|
if (result.profitTransNoList && result.profitTransNoList.length > 0) { |
|
|
|
msg += '\n盘盈单据:' + result.profitTransNoList.join(', ') |
|
|
|
} |
|
|
|
this.$alert(msg, '处理成功', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
type: 'success' |
|
|
|
}) |
|
|
|
|
|
|
|
// 刷新页面数据 - rqrq |
|
|
|
this.loadCurrentCount() |
|
|
|
this.loadTabData() |
|
|
|
} else { |
|
|
|
this.$alert(result.message || '处理失败', '错误', { confirmButtonText: '确定' }) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$alert(data.msg || '处理失败', '错误', { confirmButtonText: '确定' }) |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.$alert('网络错误', '错误', { confirmButtonText: '确定' }) |
|
|
|
}).finally(() => { |
|
|
|
this.autoAdjustLoading = false |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|