|
|
@ -48,7 +48,7 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { getMyInspectionList } from '@/api/inspection/inspectionRequestHeader.js' |
|
|
|
|
|
|
|
|
import { getMyInspectionList, createIqc, startInspection } from '@/api/inspection/inspectionRequestHeader.js' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
@ -135,8 +135,45 @@ export default { |
|
|
|
|
|
|
|
|
// 开始验货 |
|
|
// 开始验货 |
|
|
startInspection (row) { |
|
|
startInspection (row) { |
|
|
// TODO: 实现开始验货逻辑 |
|
|
|
|
|
console.log('开始验货:', row) |
|
|
|
|
|
|
|
|
this.$confirm(`确认开始验货?\n申请单号:${row.requestNo}\n供应商:${row.supplierName}`, '提示', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
type: 'warning' |
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
// 构建创建IQC的参数 |
|
|
|
|
|
const iqcData = { |
|
|
|
|
|
site: row.site, |
|
|
|
|
|
requestNo: row.requestNo, |
|
|
|
|
|
itemNo: row.itemNo |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 第一步:调用 createIqc 接口 |
|
|
|
|
|
createIqc(iqcData).then(({ data }) => { |
|
|
|
|
|
if (data.code === 0) { |
|
|
|
|
|
const inspectionNo = data.inspectionNo |
|
|
|
|
|
this.$message.success('IQC检验单创建成功:' + inspectionNo) |
|
|
|
|
|
|
|
|
|
|
|
// 第二步:调用 startInspection 接口 |
|
|
|
|
|
startInspection(row.requestNo).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) |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error((data && data.msg) || '创建IQC检验单失败') |
|
|
|
|
|
} |
|
|
|
|
|
}).catch((error) => { |
|
|
|
|
|
this.$message.error('创建IQC检验单失败:' + error.message) |
|
|
|
|
|
}) |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
// 用户取消操作 |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|