Browse Source

feat(inspection): 添加IQC检验单创建和验货启动功能

- 在API接口文件中新增createIqc和startInspection方法
- 在我的验货清单页面引入新的API方法
- 实现开始验货的确认对话框功能
- 添加创建IQC检验单的业务逻辑
- 集成验货启动的完整流程处理
- 实现操作成功后的列表刷新机制
master
qiankanghui 3 weeks ago
parent
commit
e279fb216e
  1. 6
      src/api/inspection/inspectionRequestHeader.js
  2. 43
      src/views/modules/inspection/myInspectionList.vue

6
src/api/inspection/inspectionRequestHeader.js

@ -54,3 +54,9 @@ export const updateInspectionRequest = (data) => createAPI(`/inspection/update`,
// 查询我的验货清单
export const getMyInspectionList = (data) => createAPI(`/inspection/getMyInspectionList`, 'post', data)
// 创建IQC检验单
export const createIqc = (data) => createAPI(`/qms/qc/createIqc`, 'post', data)
// 开始验货
export const startInspection = (requestNo) => createAPI(`/inspection/startInspection/${requestNo}`, 'post')

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

@ -48,7 +48,7 @@
</template>
<script>
import { getMyInspectionList } from '@/api/inspection/inspectionRequestHeader.js'
import { getMyInspectionList, createIqc, startInspection } from '@/api/inspection/inspectionRequestHeader.js'
export default {
@ -135,8 +135,45 @@ export default {
//
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(() => {
//
})
}
}
}

Loading…
Cancel
Save