Browse Source

feat(check): 新增盘点审批流程及差异展示功能

- 新增审批按钮,支持盘点中状态进入审批状态
- 修改完成按钮逻辑,仅在已审批状态可用
- 更新取消按钮状态控制,已审批状态下不可取消
- 调整复核按钮显示条件,已审批状态不显示
- 新增盘点结果差异页签,展示非OK结果数据
- 物料汇总页签位置调整并优化列配置
- 新增差异数量和处理标识的颜色区分显示
- 增加盘点结果颜色映射,支持QTY_DIFF类型
- 复核弹窗根据盘点类型默认选择复核方式
- 新增审批接口调用及状态转换逻辑
- 更新状态颜色标识,已审批状态使用蓝色显示
master
常熟吴彦祖 3 weeks ago
parent
commit
db97f18e78
  1. 5
      src/api/check/physicalInventory.js
  2. 140
      src/views/modules/check/currentPhysicalInventory.vue
  3. 78
      src/views/modules/check/searchPhysicalInventory.vue

5
src/api/check/physicalInventory.js

@ -32,7 +32,10 @@ export const pushCountToWcs = data => createAPI(`/check/physicalInventory/pushCo
// 继续推送盘点单到WCS(推后续10个栈板,由其他交互调用)- rqrq // 继续推送盘点单到WCS(推后续10个栈板,由其他交互调用)- rqrq
export const continuePushCount = data => createAPI(`/check/physicalInventory/continuePushCount`, 'post', data) export const continuePushCount = data => createAPI(`/check/physicalInventory/continuePushCount`, 'post', data)
// 完成盘点单
// 审批盘点单(盘点中 -> 已审批)- rqrq
export const approveCount = data => createAPI(`/check/physicalInventory/approveCount`, 'post', data)
// 完成盘点单(已审批 -> 已完成)
export const completeCount = data => createAPI(`/check/physicalInventory/completeCount`, 'post', data) export const completeCount = data => createAPI(`/check/physicalInventory/completeCount`, 'post', data)
// 取消盘点单 // 取消盘点单

140
src/views/modules/check/currentPhysicalInventory.vue

@ -7,11 +7,14 @@
<el-button type="success" @click="handleRelease" v-if="headerData && headerData.status === 'DRAFT'" :disabled="headerLoading"> </el-button> <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="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="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 -->
<el-button type="primary" @click="openReviewDialog"
v-if="headerData && headerData.status === 'CHECKING' && headerData.checkedPalletCount >= headerData.totalPalletCount && headerData.totalPalletCount > 0"
<!-- 审批按钮 - 盘点中状态显示 - 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> :disabled="headerLoading || reviewLoading"> </el-button>
</div> </div>
@ -104,6 +107,25 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-tab-pane> </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"> <el-tab-pane label="栈板明细" name="pallet">
<!-- 栈板明细表格 - rqrq --> <!-- 栈板明细表格 - rqrq -->
<el-table :data="palletList" :height="height" border v-loading="palletListLoading" style="width: 100%;"> <el-table :data="palletList" :height="height" border v-loading="palletListLoading" style="width: 100%;">
@ -140,17 +162,19 @@
:label="item.columnLabel"> :label="item.columnLabel">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="item.columnProp === 'countResultDesc'" :style="{color: getResultColor(scope.row.countResult)}">{{ scope.row.countResultDesc }}</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-if="item.columnProp === 'countDate'">{{ formatDateTime(scope.row.countDate) }}</span>
<span v-else>{{ scope.row[item.columnProp] }}</span> <span v-else>{{ scope.row[item.columnProp] }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-tab-pane> </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 <el-table-column
v-for="(item,index) in summaryColumnList" :key="index"
v-for="(item,index) in resultColumnList2" :key="index"
:sortable="item.columnSortable" :sortable="item.columnSortable"
:prop="item.columnProp" :prop="item.columnProp"
:header-align="item.headerAlign" :header-align="item.headerAlign"
@ -160,7 +184,11 @@
:min-width="item.columnWidth" :min-width="item.columnWidth"
:label="item.columnLabel"> :label="item.columnLabel">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -171,7 +199,7 @@
<!-- 左边任务单主表 - rqrq --> <!-- 左边任务单主表 - rqrq -->
<div style="flex: 1;"> <div style="flex: 1;">
<div style="font-weight: bold; margin-bottom: 5px; font-size: 12px;">任务单</div> <div style="font-weight: bold; margin-bottom: 5px; font-size: 12px;">任务单</div>
<el-table :data="taskList" :height="height" border v-loading="taskListLoading"
<el-table :data="taskList" :height="height" border v-loading="taskListLoading"
highlight-current-row @row-click="onTaskRowClick" style="width: 100%;"> highlight-current-row @row-click="onTaskRowClick" style="width: 100%;">
<el-table-column prop="taskNo" label="任务号" min-width="120" header-align="center" align="center"></el-table-column> <el-table-column prop="taskNo" label="任务号" min-width="120" header-align="center" align="center"></el-table-column>
<el-table-column prop="sourceType" label="来源类型" min-width="140" header-align="center" align="center"></el-table-column> <el-table-column prop="sourceType" label="来源类型" min-width="140" header-align="center" align="center"></el-table-column>
@ -204,7 +232,7 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<!-- 复核弹框 - rqrq --> <!-- 复核弹框 - rqrq -->
<el-dialog title="盘点复核" :visible.sync="reviewDialogVisible" :close-on-click-modal="false" v-drag width="80%"> <el-dialog title="盘点复核" :visible.sync="reviewDialogVisible" :close-on-click-modal="false" v-drag width="80%">
<div style="margin-bottom: 10px;"> <div style="margin-bottom: 10px;">
@ -215,8 +243,8 @@
<el-radio label="CYCLE">循环复核</el-radio> <el-radio label="CYCLE">循环复核</el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
<el-table :data="filteredReviewResultList" height="400" border
<el-table :data="filteredReviewResultList" height="400" border
@selection-change="handleReviewSelectionChange" ref="reviewTable"> @selection-change="handleReviewSelectionChange" ref="reviewTable">
<el-table-column type="selection" width="50" header-align="center" align="center"></el-table-column> <el-table-column type="selection" width="50" header-align="center" align="center"></el-table-column>
<el-table-column prop="unitId" label="标签号" min-width="150" header-align="center" align="center"></el-table-column> <el-table-column prop="unitId" label="标签号" min-width="150" header-align="center" align="center"></el-table-column>
@ -231,7 +259,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="remark" label="备注" min-width="150" header-align="center" align="left"></el-table-column> <el-table-column prop="remark" label="备注" min-width="150" header-align="center" align="left"></el-table-column>
</el-table> </el-table>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmReview" :disabled="reviewLoading"> <el-button type="primary" @click="confirmReview" :disabled="reviewLoading">
{{ reviewLoading ? '提交中...' : '确认复核' }} {{ reviewLoading ? '提交中...' : '确认复核' }}
@ -243,7 +271,7 @@
</template> </template>
<script> <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 { export default {
name: 'currentPhysicalInventory', name: 'currentPhysicalInventory',
@ -262,6 +290,8 @@ export default {
palletListLoading: false, palletListLoading: false,
resultList: [], resultList: [],
resultListLoading: false, resultListLoading: false,
resultDiffList: [], // OK- rqrq
resultDiffListLoading: false,
summaryList: [], summaryList: [],
summaryListLoading: false, summaryListLoading: false,
@ -303,14 +333,32 @@ export default {
{ columnProp: "partNo", headerAlign: "center", align: "center", columnLabel: "物料号", columnWidth: 120, 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: "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: "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: "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: "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: "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: "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: "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 // - rqrq
summaryColumnList: [ summaryColumnList: [
{ columnProp: "partNo", headerAlign: "center", align: "center", columnLabel: "物料号", columnWidth: 120, columnSortable: false, showOverflowTooltip: true, fixed: "" }, { columnProp: "partNo", headerAlign: "center", align: "center", columnLabel: "物料号", columnWidth: 120, columnSortable: false, showOverflowTooltip: true, fixed: "" },
@ -367,6 +415,7 @@ export default {
this.labelList = [] this.labelList = []
this.palletList = [] this.palletList = []
this.resultList = [] this.resultList = []
this.resultDiffList = []
this.summaryList = [] this.summaryList = []
} }
} else { } else {
@ -398,6 +447,8 @@ export default {
this.loadPalletList(params) this.loadPalletList(params)
} else if (this.activeName === 'result') { } else if (this.activeName === 'result') {
this.loadResultList(params) this.loadResultList(params)
} else if (this.activeName === 'resultDiff') {
this.loadResultDiffList(params)
} else if (this.activeName === 'summary') { } else if (this.activeName === 'summary') {
this.loadSummaryList(params) this.loadSummaryList(params)
} else if (this.activeName === 'task') { } 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 // - rqrq
loadSummaryList(params) { loadSummaryList(params) {
this.summaryListLoading = true this.summaryListLoading = true
@ -577,7 +641,33 @@ export default {
}).catch(() => {}) }).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() { handleComplete() {
if (!this.headerData) return if (!this.headerData) return
this.$confirm('确认完成盘点单 ' + this.headerData.countNo + '?', '提示', { this.$confirm('确认完成盘点单 ' + this.headerData.countNo + '?', '提示', {
@ -647,6 +737,7 @@ export default {
'DRAFT': '#909399', 'DRAFT': '#909399',
'RELEASED': '#409EFF', 'RELEASED': '#409EFF',
'CHECKING': '#E6A23C', 'CHECKING': '#E6A23C',
'APPROVED': '#409EFF', // - - rqrq
'COMPLETED': '#67C23A', 'COMPLETED': '#67C23A',
'CANCELLED': '#F56C6C' 'CANCELLED': '#F56C6C'
} }
@ -658,7 +749,8 @@ export default {
const colorMap = { const colorMap = {
'OK': '#67C23A', 'OK': '#67C23A',
'MISSING': '#F56C6C', 'MISSING': '#F56C6C',
'SURPLUS': '#E6A23C'
'SURPLUS': '#E6A23C',
'QTY_DIFF': '#F56C6C'
} }
return colorMap[result] || '#909399' return colorMap[result] || '#909399'
}, },
@ -666,7 +758,7 @@ export default {
// - rqrq // - rqrq
openReviewDialog() { openReviewDialog() {
if (!this.headerData) return if (!this.headerData) return
// //
const checkParams = { const checkParams = {
site: this.$store.state.user.site, site: this.$store.state.user.site,
@ -698,6 +790,12 @@ export default {
if (data && data.code === 0) { if (data && data.code === 0) {
this.reviewResultList = data.rows || [] this.reviewResultList = data.rows || []
this.filterReviewResult() this.filterReviewResult()
// ->-> - rqrq
if (this.headerData.countType === 'MANUAL') {
this.reviewType = 'MANUAL'
} else if (this.headerData.countType === 'CYCLE') {
this.reviewType = 'CYCLE'
}
this.reviewDialogVisible = true this.reviewDialogVisible = true
} else { } else {
this.$message.error('加载盘点结果失败') this.$message.error('加载盘点结果失败')

78
src/views/modules/check/searchPhysicalInventory.vue

@ -96,6 +96,25 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-tab-pane> </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"> <el-tab-pane label="栈板明细" name="pallet">
<!-- 栈板明细表格 - rqrq --> <!-- 栈板明细表格 - rqrq -->
<el-table :data="palletList" :height="height" border v-loading="palletListLoading" style="width: 100%;"> <el-table :data="palletList" :height="height" border v-loading="palletListLoading" style="width: 100%;">
@ -132,17 +151,19 @@
:label="item.columnLabel"> :label="item.columnLabel">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="item.columnProp === 'countResultDesc'" :style="{color: getResultColor(scope.row.countResult)}">{{ scope.row.countResultDesc }}</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-if="item.columnProp === 'countDate'">{{ formatDateTime(scope.row.countDate) }}</span>
<span v-else>{{ scope.row[item.columnProp] }}</span> <span v-else>{{ scope.row[item.columnProp] }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-tab-pane> </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 <el-table-column
v-for="(item,index) in summaryColumnList" :key="index"
v-for="(item,index) in resultColumnList2" :key="index"
:sortable="item.columnSortable" :sortable="item.columnSortable"
:prop="item.columnProp" :prop="item.columnProp"
:header-align="item.headerAlign" :header-align="item.headerAlign"
@ -152,7 +173,11 @@
:min-width="item.columnWidth" :min-width="item.columnWidth"
:label="item.columnLabel"> :label="item.columnLabel">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -330,6 +355,8 @@ export default {
palletListLoading: false, palletListLoading: false,
resultList: [], resultList: [],
resultListLoading: false, resultListLoading: false,
resultDiffList: [], // OK- rqrq
resultDiffListLoading: false,
summaryList: [], summaryList: [],
summaryListLoading: false, summaryListLoading: false,
@ -371,14 +398,32 @@ export default {
{ columnProp: "partNo", headerAlign: "center", align: "center", columnLabel: "物料号", columnWidth: 120, 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: "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: "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: "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: "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: "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: "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: "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 // - rqrq
summaryColumnList: [ summaryColumnList: [
{ columnProp: "partNo", headerAlign: "center", align: "center", columnLabel: "物料号", columnWidth: 120, columnSortable: false, showOverflowTooltip: true, fixed: "" }, { columnProp: "partNo", headerAlign: "center", align: "center", columnLabel: "物料号", columnWidth: 120, columnSortable: false, showOverflowTooltip: true, fixed: "" },
@ -503,6 +548,7 @@ export default {
this.labelList = [] this.labelList = []
this.palletList = [] this.palletList = []
this.resultList = [] this.resultList = []
this.resultDiffList = []
this.summaryList = [] this.summaryList = []
} }
} else { } else {
@ -540,6 +586,8 @@ export default {
this.loadPalletList(params) this.loadPalletList(params)
} else if (this.activeName === 'result') { } else if (this.activeName === 'result') {
this.loadResultList(params) this.loadResultList(params)
} else if (this.activeName === 'resultDiff') {
this.loadResultDiffList(params)
} else if (this.activeName === 'summary') { } else if (this.activeName === 'summary') {
this.loadSummaryList(params) this.loadSummaryList(params)
} else if (this.activeName === 'task') { } else if (this.activeName === 'task') {
@ -583,6 +631,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 // - rqrq
loadSummaryList(params) { loadSummaryList(params) {
this.summaryListLoading = true this.summaryListLoading = true
@ -970,7 +1031,8 @@ export default {
const colorMap = { const colorMap = {
'OK': '#67C23A', 'OK': '#67C23A',
'MISSING': '#F56C6C', 'MISSING': '#F56C6C',
'SURPLUS': '#E6A23C'
'SURPLUS': '#E6A23C',
'QTY_DIFF': '#F56C6C'
} }
return colorMap[result] || '#909399' return colorMap[result] || '#909399'
} }

Loading…
Cancel
Save