Browse Source

feat(inspection): 添加验货申请删除功能并优化IQC结果处理

- 新增deleteMyInspectionDetail接口用于删除验货申请明细
- 在验货列表页面添加删除操作按钮,支持已排程和验货中状态的记录删除
- 移除不再使用的refreshInspectionResult和rollbackInspectionResult接口
- 优化IQC结果录入页面的消息提示,区分保存和保存审核操作
- 简化审核和取消审核后的处理逻辑,移除前端手动刷新验货结果的调用
- 更新IQC结果录入页面的导入映射,移除已废弃的函数引用
master
qiankanghui 2 weeks ago
parent
commit
db876fa411
  1. 3
      src/api/inspection/inspectionRequestHeader.js
  2. 5
      src/api/qc/qc.js
  3. 30
      src/views/modules/inspection/myInspectionList.vue
  4. 79
      src/views/modules/qc/IQCResultEntry.vue

3
src/api/inspection/inspectionRequestHeader.js

@ -79,6 +79,9 @@ export const updateInspectionRequest = (data) => createAPI(`/inspection/update`,
// 查询我的验货清单
export const getMyInspectionList = (data) => createAPI(`/inspection/getMyInspectionList`, 'post', data)
// 我的验货清单删除明细(仅已排程/验货中状态,一并删除关联IQC检验单)
export const deleteMyInspectionDetail = (data) => createAPI(`/inspection/deleteMyInspectionDetail`, 'post', data)
// 创建IQC检验单
export const createIqc = (data) => createAPI(`/qms/qc/createIqc`, 'post', data)

5
src/api/qc/qc.js

@ -232,11 +232,6 @@ export const dataAcquisitionByItem = data => createAPI(`/qms/qc/dataAcquisitionB
export const getSiteAndBuByUserName2 = data => createAPI(`/qms/qc/getSiteAndBuByUserName2`,'post',data)
export const cancelApproval = data => createAPI(`/qms/qc/cancelApproval`,'post',data)
// 刷新验货结果(将明细状态改为验货完成)
export const refreshInspectionResult = data => createAPI(`/inspection/refreshInspectionResult`,'post',data)
// 回滚验货结果(将明细状态从验货完成回滚到验货中)
export const rollbackInspectionResult = data => createAPI(`/inspection/rollbackInspectionResult`,'post',data)
export const goUpItemQC = data => createAPI(`/qms/qc/goUpItemQC`,'post',data)
export const goDownItemQC = data => createAPI(`/qms/qc/goDownItemQC`,'post',data)
export const cancelApproval2 = data => createAPI(`/qms/qc/cancelApproval2`,'post',data)

30
src/views/modules/inspection/myInspectionList.vue

@ -34,10 +34,11 @@
<el-table-column prop="inspectAddress" label="验货地址" header-align="center" align="left" min-width="150" show-overflow-tooltip/>
<el-table-column prop="inspectCityShort" label="城市简称" header-align="center" align="left" width="120" show-overflow-tooltip/>
<el-table-column prop="inspectContract" label="联系人" header-align="center" align="center" width="100"/>
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
<el-table-column fixed="right" header-align="center" align="center" width="180" label="操作">
<template slot-scope="scope">
<a v-if="scope.row.statusDb === 'Scheduled'" class="customer-a" @click="startInspection(scope.row)">开始验货</a>
<a v-if="scope.row.statusDb === 'Inspecting'" class="customer-a" @click="goToIQCResult(scope.row)">跳转</a>
<a v-if="scope.row.statusDb === 'Scheduled' || scope.row.statusDb === 'Inspecting'" class="customer-a" style="color: #f56c6c;" @click="deleteInspection(scope.row)">删除</a>
<span v-if="scope.row.statusDb === 'ChangeApplying'" style="color: #f56c6c;">等待变更审核</span>
</template>
</el-table-column>
@ -58,7 +59,7 @@
</template>
<script>
import { getMyInspectionList, createIqc, startInspection } from '@/api/inspection/inspectionRequestHeader.js'
import { getMyInspectionList, createIqc, startInspection, deleteMyInspectionDetail } from '@/api/inspection/inspectionRequestHeader.js'
import { actionIQCInspection, qcIQCInspectionSearch } from '@/api/qc/qc.js'
@ -170,6 +171,31 @@ export default {
})
},
//
deleteInspection (row) {
this.$confirm(`确认删除该验货申请?\n申请单号:${row.requestNo}\n供应商:${row.supplierName}`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteMyInspectionDetail({
requestNo: row.requestNo,
itemNo: row.itemNo
}).then(({ data }) => {
if (data.code === 0) {
this.$message.success('删除成功')
this.getList()
} else {
this.$message.error((data && data.msg) || '删除失败')
}
}).catch((error) => {
this.$message.error('删除失败:' + error.message)
})
}).catch(() => {
//
})
},
//
startInspection (row) {
this.$confirm(`确认开始验货?\n申请单号:${row.requestNo}\n供应商:${row.supplierName}`, '提示', {

79
src/views/modules/qc/IQCResultEntry.vue

@ -788,9 +788,7 @@
overLoadSearchPartInfo, //
getEamPropertiesItemByItemNo,
getCollectorDataByItem,
getResponsibleOperatorList,
refreshInspectionResult, //
rollbackInspectionResult, //
getResponsibleOperatorList
} from "@/api/qc/qc.js"
import { buildQcBu } from './qcBuUtils'
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
@ -2752,7 +2750,8 @@
this.getDataList()
this.detailInformationFlag = false
this.$message({
message: '操作成功',
//
message: type === '2' ? '保存并审核成功' : '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
@ -3211,34 +3210,14 @@
this.submitData.submitList = this.IQCSelections
saveIQCSubmitResult(this.submitData).then(({data}) => {
if (data && data.code === 0) {
//
const refreshPromises = this.IQCSelections.map(selection => {
return refreshInspectionResult({
poOrderNo: selection.poOrderNo,
poItemNo: selection.poItemNo,
site: selection.site
})
})
Promise.all(refreshPromises).then(() => {
this.getDataList()
this.IQCSelections = []
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
}).catch(error => {
console.error('刷新验货结果失败:', error)
// 使
this.getDataList()
this.IQCSelections = []
this.$message({
message: '审核成功,但刷新验货结果失败',
type: 'warning',
duration: 2000
})
//
this.getDataList()
this.IQCSelections = []
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
@ -3283,34 +3262,14 @@
this.submitData.submitList = this.IQCSelections
cancelApproval(this.submitData).then(({data}) => {
if (data && data.code === 0) {
//
const rollbackPromises = this.IQCSelections.map(selection => {
return rollbackInspectionResult({
poOrderNo: selection.poOrderNo,
poItemNo: selection.poItemNo,
site: selection.site
})
})
Promise.all(rollbackPromises).then(() => {
this.getDataList()
this.IQCSelections = []
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
}).catch(error => {
console.error('回滚验货结果失败:', error)
// 使
this.getDataList()
this.IQCSelections = []
this.$message({
message: '取消审核成功,但回滚验货结果失败',
type: 'warning',
duration: 2000
})
//
this.getDataList()
this.IQCSelections = []
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {

Loading…
Cancel
Save