Browse Source

feat(check): 添加盘点异常处理功能

- 在已审批状态显示处理异常按钮
- 新增处理异常弹框界面,支持异常结果处理方式选择
- 实现异常盘点结果查询和保存功能
- 为盘盈情况默认设置手工处理方式
- 添加异常处理相关的API接口
- 在搜索界面增加已审批状态选项
master
常熟吴彦祖 3 weeks ago
parent
commit
4a87a6778a
  1. 8
      src/api/check/physicalInventory.js
  2. 10
      src/assets/scss/global.scss
  3. 140
      src/views/modules/check/currentPhysicalInventory.vue
  4. 2
      src/views/modules/check/searchPhysicalInventory.vue

8
src/api/check/physicalInventory.js

@ -82,3 +82,11 @@ export const hasUncompletedTask = data => createAPI(`/check/physicalInventory/ha
// 创建复核任务单
export const createReviewTask = data => createAPI(`/check/physicalInventory/createReviewTask`, 'post', data)
// ==================== 异常处理 ==================== - rqrq
// 查询未处理的异常盘点结果
export const searchUnhandledExceptionList = data => createAPI(`/check/physicalInventory/searchUnhandledExceptionList`, 'post', data)
// 保存异常处理结果
export const saveExceptionHandle = data => createAPI(`/check/physicalInventory/saveExceptionHandle`, 'post', data)

10
src/assets/scss/global.scss

@ -431,3 +431,13 @@ a:hover{
.rred input {
color: red;
}
.rq .el-table .cell {
line-height: 20px;
font-size: 12px;
height: 20px;
}
.rq .auto /deep/ .el-form-item__content{
height: auto;
line-height: 1.5;
}

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

@ -16,6 +16,10 @@
<el-button type="primary" @click="openReviewDialog"
v-if="headerData && headerData.status === 'CHECKING' && headerData.checkedPalletCount >= headerData.totalPalletCount && headerData.totalPalletCount > 0"
:disabled="headerLoading || reviewLoading"> </el-button>
<!-- 处理异常按钮 - 已审批状态显示 - rqrq -->
<el-button type="danger" @click="openHandleExceptionDialog"
v-if="headerData && headerData.status === 'APPROVED'"
:disabled="headerLoading || handleExceptionLoading">处理异常</el-button>
</div>
<!-- Header信息展示区域 - 一行6个input框 -->
@ -191,6 +195,17 @@
<span v-else>{{ scope.row[item.columnProp] }}</span>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="100"
: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>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<!-- 任务单页签 - rqrq -->
@ -267,11 +282,48 @@
<el-button @click="reviewDialogVisible = false" :disabled="reviewLoading">取消</el-button>
</div>
</el-dialog>
<!-- 处理异常弹框 - rqrq -->
<el-dialog title="处理异常" :visible.sync="handleExceptionDialogVisible" :close-on-click-modal="false" v-drag width="85%">
<div class="rq">
<el-table :data="exceptionResultList" height="400" border v-loading="handleExceptionLoading" >
<el-table-column prop="unitId" label="标签号" min-width="150" 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="partDesc" label="物料名称" min-width="180" header-align="center" align="left"></el-table-column>
<el-table-column prop="diffQty" label="差异数量" min-width="80" header-align="center" align="center">
<template slot-scope="scope">
<span :style="{color: scope.row.diffQty != 0 ? '#F56C6C' : '#67C23A'}">{{ scope.row.diffQty }}</span>
</template>
</el-table-column>
<el-table-column prop="countResultDesc" label="盘点结果" min-width="80" header-align="center" align="center">
<template slot-scope="scope">
<span :style="{color: getResultColor(scope.row.countResult)}">{{ scope.row.countResultDesc }}</span>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" min-width="200" header-align="center" align="left" show-overflow-tooltip></el-table-column>
<el-table-column label="处理方式" min-width="100" header-align="center" align="center">
<template slot-scope="scope">
<el-select v-model="scope.row.handleType" placeholder="请选择处理方式" size="small" style="width: 100%;height: 11px;padding: 0px">
<!-- 盘盈SURPLUS只能选择手工处理 - rqrq -->
<el-option v-if="scope.row.countResult !== 'SURPLUS'" label="系统处理" value="SYSTEM"></el-option>
<el-option label="手工处理" value="MANUAL"></el-option>
</el-select>
</template>
</el-table-column>
</el-table>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="saveExceptionHandle" :disabled="saveExceptionLoading">
{{ saveExceptionLoading ? '保存中...' : '保 存' }}
</el-button>
<el-button @click="handleExceptionDialogVisible = false" :disabled="saveExceptionLoading"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getCurrentActiveCount, releaseCount, pushCountToWcs, continuePushCount, approveCount, 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, searchUnhandledExceptionList, saveExceptionHandle } from '@/api/check/physicalInventory'
export default {
name: 'currentPhysicalInventory',
@ -388,7 +440,13 @@ export default {
filteredReviewResultList: [], //
onlyShowAbnormal: true, //
reviewType: 'CYCLE', // MANUAL=CYCLE=
selectedReviewLabels: [] //
selectedReviewLabels: [], //
// - rqrq
handleExceptionDialogVisible: false,
handleExceptionLoading: false,
saveExceptionLoading: false,
exceptionResultList: [] //
}
},
mounted() {
@ -864,6 +922,81 @@ export default {
this.reviewLoading = false
})
}).catch(() => {})
},
// - rqrq
openHandleExceptionDialog() {
if (!this.headerData) return
this.handleExceptionLoading = true
const params = {
site: this.$store.state.user.site,
countNo: this.headerData.countNo
}
searchUnhandledExceptionList(params).then(({ data }) => {
if (data && data.code === 0) {
// - rqrq
this.exceptionResultList = (data.rows || []).map(item => {
return {
...item,
handleType: item.handleType!=null?item.handleType: item.countResult === 'SURPLUS' ? 'MANUAL' : 'SYSTEM'
}
})
if (this.exceptionResultList.length === 0) {
this.$message.error('没有需要处理的异常结果')
return
}
this.handleExceptionDialogVisible = true
} else {
this.$message.error('没有需要处理的异常结果')
}
}).catch(() => {
this.$message.error('没有需要处理的异常结果')
}).finally(() => {
this.handleExceptionLoading = false
})
},
// - rqrq
saveExceptionHandle() {
// - rqrq
const unhandledList = this.exceptionResultList.filter(item => !item.handleType)
if (unhandledList.length > 0) {
this.$message.warning('请为所有异常结果选择处理方式')
return
}
this.saveExceptionLoading = true
const params = {
site: this.$store.state.user.site,
countNo: this.headerData.countNo,
username: this.$store.state.user.name,
exceptionList: this.exceptionResultList.map(item => ({
id: item.id,
unitId: item.unitId,
palletId: item.palletId,
handleType: item.handleType
}))
}
saveExceptionHandle(params).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success('保存成功')
this.handleExceptionDialogVisible = false
// - rqrq
if (this.activeName === 'resultDiff') {
this.loadResultDiffList({
site: this.$store.state.user.site,
countNo: this.headerData.countNo
})
}
} else {
this.$alert(data.msg || '保存失败', '提示', { type: 'error' })
}
}).catch(() => {
this.$message.error('网络错误')
}).finally(() => {
this.saveExceptionLoading = false
})
}
}
}
@ -895,5 +1028,8 @@ export default {
/deep/ .el-table a:hover {
text-decoration: underline;
}
</style>

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

@ -15,9 +15,11 @@
</el-form-item>
<el-form-item label="状态" style="margin-right: 10px;">
<el-select v-model="queryForm.searchStatus" placeholder="请选择" clearable style="width: 120px;">
<el-option label="全部" value=""></el-option>
<el-option label="草稿" value="DRAFT"></el-option>
<el-option label="已下达" value="RELEASED"></el-option>
<el-option label="盘点中" value="CHECKING"></el-option>
<el-option label="已审批" value="APPROVED"></el-option>
<el-option label="已完成" value="COMPLETED"></el-option>
<el-option label="已取消" value="CANCELLED"></el-option>
</el-select>

Loading…
Cancel
Save