|
|
|
@ -7,9 +7,12 @@ |
|
|
|
<el-button type="success" @click="handleRelease" v-if="headerData && headerData.status === 'DRAFT'" :disabled="headerLoading">下 达</el-button> |
|
|
|
<el-button type="warning" @click="handlePush" v-if="headerData && headerData.status === 'RELEASED'" :disabled="headerLoading">推 送</el-button> |
|
|
|
<!-- <el-button type="info" @click="handleContinuePush" v-if="headerData && headerData.status === 'CHECKING'" :disabled="headerLoading">继续推送</el-button> 自动触发--> |
|
|
|
<el-button type="success" @click="handleComplete" v-if="headerData && headerData.status === 'CHECKING'" :disabled="headerLoading">完 成</el-button> |
|
|
|
<el-button type="danger" @click="handleCancel" v-if="headerData && headerData.status !== 'COMPLETED' && headerData.status !== 'CANCELLED'" :disabled="headerLoading">取 消</el-button> |
|
|
|
<!-- 复核按钮 - 当栈板盘点进度满了后显示 - rqrq --> |
|
|
|
<!-- 审批按钮 - 盘点中状态显示 - rqrq --> |
|
|
|
<el-button type="warning" @click="handleApprove" v-if="headerData && headerData.status === 'CHECKING'" :disabled="headerLoading">审 批</el-button> |
|
|
|
<!-- 完成按钮 - 已审批状态显示 - rqrq --> |
|
|
|
<el-button type="success" @click="handleComplete" v-if="headerData && headerData.status === 'APPROVED'" :disabled="headerLoading">完 成</el-button> |
|
|
|
<el-button type="danger" @click="handleCancel" v-if="headerData && headerData.status !== 'COMPLETED' && headerData.status !== 'CANCELLED' && headerData.status !== 'APPROVED'" :disabled="headerLoading">取 消</el-button> |
|
|
|
<!-- 复核按钮 - 盘点中状态且栈板盘点进度满了后显示(已审批状态不显示)- rqrq --> |
|
|
|
<el-button type="primary" @click="openReviewDialog" |
|
|
|
v-if="headerData && headerData.status === 'CHECKING' && headerData.checkedPalletCount >= headerData.totalPalletCount && headerData.totalPalletCount > 0" |
|
|
|
:disabled="headerLoading || reviewLoading">复 核</el-button> |
|
|
|
@ -104,6 +107,25 @@ |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-tab-pane> |
|
|
|
<el-tab-pane label="物料汇总" name="summary"> |
|
|
|
<!-- 物料汇总表格 - rqrq --> |
|
|
|
<el-table :data="summaryList" :height="height" border v-loading="summaryListLoading" style="width: 100%;"> |
|
|
|
<el-table-column |
|
|
|
v-for="(item,index) in summaryColumnList" :key="index" |
|
|
|
:sortable="item.columnSortable" |
|
|
|
:prop="item.columnProp" |
|
|
|
:header-align="item.headerAlign" |
|
|
|
:show-overflow-tooltip="item.showOverflowTooltip" |
|
|
|
:align="item.align" |
|
|
|
:fixed="item.fixed==''?false:item.fixed" |
|
|
|
:min-width="item.columnWidth" |
|
|
|
:label="item.columnLabel"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row[item.columnProp] }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-tab-pane> |
|
|
|
<el-tab-pane label="栈板明细" name="pallet"> |
|
|
|
<!-- 栈板明细表格 - rqrq --> |
|
|
|
<el-table :data="palletList" :height="height" border v-loading="palletListLoading" style="width: 100%;"> |
|
|
|
@ -140,17 +162,19 @@ |
|
|
|
:label="item.columnLabel"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="item.columnProp === 'countResultDesc'" :style="{color: getResultColor(scope.row.countResult)}">{{ scope.row.countResultDesc }}</span> |
|
|
|
<span v-else-if="item.columnProp === 'diffQty'" :style="{color: scope.row.diffQty != 0 ? '#F56C6C' : '#67C23A'}">{{ scope.row.diffQty }}</span> |
|
|
|
<span v-else-if="item.columnProp === 'handleFlagDesc'" :style="{color: scope.row.handleFlag === 'Y' ? '#67C23A' : '#F56C6C'}">{{ scope.row.handleFlagDesc }}</span> |
|
|
|
<span v-else-if="item.columnProp === 'countDate'">{{ formatDateTime(scope.row.countDate) }}</span> |
|
|
|
<span v-else>{{ scope.row[item.columnProp] }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-tab-pane> |
|
|
|
<el-tab-pane label="物料汇总" name="summary"> |
|
|
|
<!-- 物料汇总表格 - rqrq --> |
|
|
|
<el-table :data="summaryList" :height="height" border v-loading="summaryListLoading" style="width: 100%;"> |
|
|
|
<!-- 盘点结果差异页签 - rqrq --> |
|
|
|
<el-tab-pane label="盘点结果差异" name="resultDiff"> |
|
|
|
<el-table :data="resultDiffList" :height="height" border v-loading="resultDiffListLoading" style="width: 100%;"> |
|
|
|
<el-table-column |
|
|
|
v-for="(item,index) in summaryColumnList" :key="index" |
|
|
|
v-for="(item,index) in resultColumnList2" :key="index" |
|
|
|
:sortable="item.columnSortable" |
|
|
|
:prop="item.columnProp" |
|
|
|
:header-align="item.headerAlign" |
|
|
|
@ -160,7 +184,11 @@ |
|
|
|
:min-width="item.columnWidth" |
|
|
|
:label="item.columnLabel"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row[item.columnProp] }}</span> |
|
|
|
<span v-if="item.columnProp === 'countResultDesc'" :style="{color: getResultColor(scope.row.countResult)}">{{ scope.row.countResultDesc }}</span> |
|
|
|
<span v-else-if="item.columnProp === 'diffQty'" :style="{color: scope.row.diffQty != 0 ? '#F56C6C' : '#67C23A'}">{{ scope.row.diffQty }}</span> |
|
|
|
<span v-else-if="item.columnProp === 'handleFlagDesc'" :style="{color: scope.row.handleFlag === 'Y' ? '#67C23A' : '#F56C6C'}">{{ scope.row.handleFlagDesc }}</span> |
|
|
|
<span v-else-if="item.columnProp === 'countDate'">{{ formatDateTime(scope.row.countDate) }}</span> |
|
|
|
<span v-else>{{ scope.row[item.columnProp] }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
@ -243,7 +271,7 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { getCurrentActiveCount, releaseCount, pushCountToWcs, continuePushCount, completeCount, cancelCount, searchCountLabelList, searchCountPalletList, searchCountResultList, searchMaterialSummary, searchOrderTaskByCountNo, searchOrderTaskDetail, hasUncompletedTask, createReviewTask } from '@/api/check/physicalInventory' |
|
|
|
import { getCurrentActiveCount, releaseCount, pushCountToWcs, continuePushCount, approveCount, completeCount, cancelCount, searchCountLabelList, searchCountPalletList, searchCountResultList, searchMaterialSummary, searchOrderTaskByCountNo, searchOrderTaskDetail, hasUncompletedTask, createReviewTask } from '@/api/check/physicalInventory' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'currentPhysicalInventory', |
|
|
|
@ -262,6 +290,8 @@ export default { |
|
|
|
palletListLoading: false, |
|
|
|
resultList: [], |
|
|
|
resultListLoading: false, |
|
|
|
resultDiffList: [], // 盘点结果差异列表(非OK的结果)- rqrq |
|
|
|
resultDiffListLoading: false, |
|
|
|
summaryList: [], |
|
|
|
summaryListLoading: false, |
|
|
|
|
|
|
|
@ -303,14 +333,32 @@ export default { |
|
|
|
{ columnProp: "partNo", headerAlign: "center", align: "center", columnLabel: "物料号", columnWidth: 120, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
{ columnProp: "partDesc", headerAlign: "center", align: "left", columnLabel: "物料描述", columnWidth: 180, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
{ columnProp: "qty", headerAlign: "center", align: "center", columnLabel: "数量", columnWidth: 80, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
{ columnProp: "diffQty", headerAlign: "center", align: "center", columnLabel: "差异数量", columnWidth: 80, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
{ columnProp: "batchNo", headerAlign: "center", align: "center", columnLabel: "批号", columnWidth: 100, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
{ columnProp: "palletId", headerAlign: "center", align: "center", columnLabel: "栈板号", columnWidth: 120, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
{ columnProp: "countResultDesc", headerAlign: "center", align: "center", columnLabel: "盘点结果", columnWidth: 80, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
// { columnProp: "handleFlagDesc", headerAlign: "center", align: "center", columnLabel: "是否处理", columnWidth: 80, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
{ columnProp: "handleTypeDesc", headerAlign: "center", align: "center", columnLabel: "处理方式", columnWidth: 80, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
{ columnProp: "countUser", headerAlign: "center", align: "center", columnLabel: "盘点人", columnWidth: 100, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
{ columnProp: "countDate", headerAlign: "center", align: "center", columnLabel: "盘点时间", columnWidth: 140, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
{ columnProp: "remark", headerAlign: "center", align: "left", columnLabel: "备注", columnWidth: 150, columnSortable: false, showOverflowTooltip: true, fixed: "" } |
|
|
|
{ columnProp: "remark", headerAlign: "center", align: "left", columnLabel: "备注", columnWidth: 300, columnSortable: false, showOverflowTooltip: true, fixed: "" } |
|
|
|
], |
|
|
|
// 盘点结果差异配置 - rqrq |
|
|
|
resultColumnList2: [ |
|
|
|
{ columnProp: "unitId", headerAlign: "center", align: "center", columnLabel: "标签号", columnWidth: 150, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
{ columnProp: "partNo", headerAlign: "center", align: "center", columnLabel: "物料号", columnWidth: 120, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
{ columnProp: "partDesc", headerAlign: "center", align: "left", columnLabel: "物料描述", columnWidth: 180, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
{ columnProp: "qty", headerAlign: "center", align: "center", columnLabel: "数量", columnWidth: 80, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
{ columnProp: "diffQty", headerAlign: "center", align: "center", columnLabel: "差异数量", columnWidth: 80, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
{ columnProp: "batchNo", headerAlign: "center", align: "center", columnLabel: "批号", columnWidth: 100, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
{ columnProp: "palletId", headerAlign: "center", align: "center", columnLabel: "栈板号", columnWidth: 120, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
{ columnProp: "countResultDesc", headerAlign: "center", align: "center", columnLabel: "盘点结果", columnWidth: 80, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
{ columnProp: "handleFlagDesc", headerAlign: "center", align: "center", columnLabel: "是否处理", columnWidth: 80, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
{ columnProp: "handleTypeDesc", headerAlign: "center", align: "center", columnLabel: "处理方式", columnWidth: 80, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
{ columnProp: "countUser", headerAlign: "center", align: "center", columnLabel: "盘点人", columnWidth: 100, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
{ columnProp: "countDate", headerAlign: "center", align: "center", columnLabel: "盘点时间", columnWidth: 140, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
{ columnProp: "remark", headerAlign: "center", align: "left", columnLabel: "备注", columnWidth: 300, columnSortable: false, showOverflowTooltip: true, fixed: "" } |
|
|
|
], |
|
|
|
|
|
|
|
// 物料汇总列配置 - rqrq |
|
|
|
summaryColumnList: [ |
|
|
|
{ columnProp: "partNo", headerAlign: "center", align: "center", columnLabel: "物料号", columnWidth: 120, columnSortable: false, showOverflowTooltip: true, fixed: "" }, |
|
|
|
@ -367,6 +415,7 @@ export default { |
|
|
|
this.labelList = [] |
|
|
|
this.palletList = [] |
|
|
|
this.resultList = [] |
|
|
|
this.resultDiffList = [] |
|
|
|
this.summaryList = [] |
|
|
|
} |
|
|
|
} else { |
|
|
|
@ -398,6 +447,8 @@ export default { |
|
|
|
this.loadPalletList(params) |
|
|
|
} else if (this.activeName === 'result') { |
|
|
|
this.loadResultList(params) |
|
|
|
} else if (this.activeName === 'resultDiff') { |
|
|
|
this.loadResultDiffList(params) |
|
|
|
} else if (this.activeName === 'summary') { |
|
|
|
this.loadSummaryList(params) |
|
|
|
} else if (this.activeName === 'task') { |
|
|
|
@ -441,6 +492,19 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 加载盘点结果差异(只显示非OK的结果)- rqrq |
|
|
|
loadResultDiffList(params) { |
|
|
|
this.resultDiffListLoading = true |
|
|
|
searchCountResultList(params).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
// 过滤出非OK的结果 - rqrq |
|
|
|
this.resultDiffList = (data.rows || []).filter(item => item.countResult !== 'OK') |
|
|
|
} |
|
|
|
}).finally(() => { |
|
|
|
this.resultDiffListLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 加载物料汇总 - rqrq |
|
|
|
loadSummaryList(params) { |
|
|
|
this.summaryListLoading = true |
|
|
|
@ -577,7 +641,33 @@ export default { |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 完成盘点单 - rqrq |
|
|
|
// 审批盘点单(盘点中 -> 已审批)- rqrq |
|
|
|
handleApprove() { |
|
|
|
if (!this.headerData) return |
|
|
|
this.$confirm('审批后将进入异常处理阶段,无法再创建复核任务。确认审批盘点单 ' + this.headerData.countNo + '?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
const params = { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
countNo: this.headerData.countNo, |
|
|
|
username: this.$store.state.user.name |
|
|
|
} |
|
|
|
approveCount(params).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('审批成功') |
|
|
|
this.loadCurrentCount() |
|
|
|
} else { |
|
|
|
this.$alert(data.msg || '审批失败', '提示', { type: 'error' }) |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 完成盘点单(已审批 -> 已完成)- rqrq |
|
|
|
handleComplete() { |
|
|
|
if (!this.headerData) return |
|
|
|
this.$confirm('确认完成盘点单 ' + this.headerData.countNo + '?', '提示', { |
|
|
|
@ -647,6 +737,7 @@ export default { |
|
|
|
'DRAFT': '#909399', |
|
|
|
'RELEASED': '#409EFF', |
|
|
|
'CHECKING': '#E6A23C', |
|
|
|
'APPROVED': '#409EFF', // 已审批 - 蓝色 - rqrq |
|
|
|
'COMPLETED': '#67C23A', |
|
|
|
'CANCELLED': '#F56C6C' |
|
|
|
} |
|
|
|
@ -658,7 +749,8 @@ export default { |
|
|
|
const colorMap = { |
|
|
|
'OK': '#67C23A', |
|
|
|
'MISSING': '#F56C6C', |
|
|
|
'SURPLUS': '#E6A23C' |
|
|
|
'SURPLUS': '#E6A23C', |
|
|
|
'QTY_DIFF': '#F56C6C' |
|
|
|
} |
|
|
|
return colorMap[result] || '#909399' |
|
|
|
}, |
|
|
|
@ -698,6 +790,12 @@ export default { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.reviewResultList = data.rows || [] |
|
|
|
this.filterReviewResult() |
|
|
|
// 根据单据的盘点类型设置复核类型默认值:人工盘点->人工复核,循环盘点->循环复核 - rqrq |
|
|
|
if (this.headerData.countType === 'MANUAL') { |
|
|
|
this.reviewType = 'MANUAL' |
|
|
|
} else if (this.headerData.countType === 'CYCLE') { |
|
|
|
this.reviewType = 'CYCLE' |
|
|
|
} |
|
|
|
this.reviewDialogVisible = true |
|
|
|
} else { |
|
|
|
this.$message.error('加载盘点结果失败') |
|
|
|
|