|
|
|
@ -38,6 +38,7 @@ |
|
|
|
<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 === 'Scheduled'" class="customer-a" @click="handleEditQty(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> |
|
|
|
@ -60,7 +61,7 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { getMyInspectionList, createIqc, startInspection, deleteMyInspectionDetail } from '@/api/inspection/inspectionRequestHeader.js' |
|
|
|
import { getMyInspectionList, createIqc, startInspection, deleteMyInspectionDetail, updateMyInspectionQty } from '@/api/inspection/inspectionRequestHeader.js' |
|
|
|
import { actionIQCInspection, qcIQCInspectionSearch } from '@/api/qc/qc.js' |
|
|
|
|
|
|
|
|
|
|
|
@ -197,6 +198,44 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 修改验货数量(仅未创建IQC检验单前) |
|
|
|
handleEditQty (row) { |
|
|
|
if (row.statusDb !== 'Scheduled') { |
|
|
|
this.$message.warning('只有已排程且未开始验货的申请可以修改验货数量,请刷新列表后重试') |
|
|
|
this.getList() |
|
|
|
return |
|
|
|
} |
|
|
|
this.$prompt('请输入新的验货数量', '修改验货数量', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
inputValue: row.qty == null ? '' : String(row.qty), |
|
|
|
inputPattern: /^\d+(\.\d+)?$/, |
|
|
|
inputErrorMessage: '请输入有效的正数', |
|
|
|
inputValidator: (val) => { |
|
|
|
if (val === '' || val === null) return '验货数量不能为空' |
|
|
|
if (Number(val) <= 0) return '验货数量必须大于0' |
|
|
|
return true |
|
|
|
} |
|
|
|
}).then(({ value }) => { |
|
|
|
updateMyInspectionQty({ |
|
|
|
requestNo: row.requestNo, |
|
|
|
itemNo: row.itemNo, |
|
|
|
qty: Number(value) |
|
|
|
}).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) { |
|
|
|
// 校验单子状态是否为已排程(防止页面数据滞后) |
|
|
|
|