| | |
| | | width: 100 |
| | | }, |
| | | { |
| | | label: "合格数量", |
| | | prop: "qualifiedQuantity", |
| | | width: 100 |
| | | }, |
| | | { |
| | | label: "不合格数量", |
| | | prop: "unqualifiedQuantity", |
| | | width: 100 |
| | | }, |
| | | { |
| | | label: "合格率", |
| | | prop: "passRate", |
| | | width: 100, |
| | | dataType: "tag", |
| | | formatData: (params) => { |
| | | if (params == null || params === '') return '—'; |
| | | const n = Number(params); |
| | | if (Number.isNaN(n)) return '—'; |
| | | return `${n.toFixed(2)}%`; |
| | | }, |
| | | formatType: (params) => { |
| | | if (params == null || params === '') return 'info'; |
| | | const n = Number(params); |
| | | if (Number.isNaN(n)) return 'info'; |
| | | if (n >= 100) return 'success'; |
| | | if (n >= 90) return 'warning'; |
| | | return 'danger'; |
| | | }, |
| | | }, |
| | | { |
| | | label: "检测单位", |
| | | prop: "checkCompany", |
| | | width: 120 |
| | | }, |
| | | { |
| | | label: "检测结果", |
| | | prop: "checkResult", |
| | | dataType: "tag", |
| | | formatType: (params) => { |
| | | if (params == '不合格') { |
| | | return "danger"; |
| | | } else if (params == '合格') { |
| | | return "success"; |
| | | } else { |
| | | return null; |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | label: "提交状态", |
| | | prop: "inspectState", |
| | | formatData: (params) => { |
| | | if (params) { |
| | | return "已提交"; |
| | | } else { |
| | | return "未提交"; |
| | | } |
| | | }, |
| | | dataType: "tag", |
| | | formatData: (params) => (params == 1 || params === true ? '已提交' : '未提交'), |
| | | formatType: (params) => (params == 1 || params === true ? 'success' : 'info'), |
| | | }, |
| | | { |
| | | dataType: "action", |
| | |
| | | name: "提交", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | submit(row.id); |
| | | submit(row); |
| | | }, |
| | | disabled: (row) => { |
| | | // 已提交则禁用 |
| | |
| | | }; |
| | | |
| | | // 提价 |
| | | const submit = async (id) => { |
| | | const res = await submitQualityInspect({id: id}) |
| | | const submit = async (row) => { |
| | | const res = await submitQualityInspect({ |
| | | id: row.id, |
| | | qualifiedQuantity: row.qualifiedQuantity, |
| | | unqualifiedQuantity: row.unqualifiedQuantity |
| | | }) |
| | | if (res.code === 200) { |
| | | proxy.$modal.msgSuccess("提交成功"); |
| | | getList(); |