| | |
| | | @click="handleQuery" |
| | | style="margin-left: 10px">搜索</el-button> |
| | | </div> |
| | | <div> |
| | | <el-button type="primary" |
| | | @click="openForm('add')">新增</el-button> |
| | | <el-button @click="handleOut">导出</el-button> |
| | | <el-button type="danger" |
| | | plain |
| | | @click="handleDelete">删除</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | | <div style="margin-bottom: 20px; text-align: right;"> |
| | | <el-button type="primary" @click="openQuickCheck">快速检验</el-button> |
| | | <el-button type="primary" @click="openForm('add')">新增</el-button> |
| | | <el-button @click="handleOut">导出</el-button> |
| | | <el-button type="danger" plain @click="handleDelete">删除</el-button> |
| | | </div> |
| | | <PIMTable rowKey="id" |
| | | :column="tableColumn" |
| | | :tableData="tableData" |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | qualityInspectListPage, |
| | | qualityInspectUpdate, |
| | | submitQualityInspect, |
| | | batchQuickInspect, |
| | | } from "@/api/qualityManagement/rawMaterialInspection.js"; |
| | | import FilesDia from "@/views/qualityManagement/processInspection/components/filesDia.vue"; |
| | | import dayjs from "dayjs"; |
| | |
| | | }, |
| | | }); |
| | | const { searchForm } = toRefs(data); |
| | | |
| | | const tableColumn = ref([ |
| | | { |
| | | label: "检测日期", |
| | | prop: "checkTime", |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "生产工单号", |
| | | prop: "workOrderNo", |
| | | width: 120, |
| | | }, |
| | | { |
| | |
| | | formDia.value?.openDialog(type, row); |
| | | }); |
| | | }; |
| | | |
| | | // 打开快速检验确认框 |
| | | const openQuickCheck = () => { |
| | | // 检查是否选择了数据 |
| | | if (!selectedRows.value || selectedRows.value.length === 0) { |
| | | proxy.$modal.msgWarning("请先选择要检验的数据"); |
| | | return; |
| | | } |
| | | |
| | | // 过滤出未提交的数据 |
| | | const unSubmittedRows = selectedRows.value.filter(item => item.inspectState !== 1); |
| | | if (unSubmittedRows.length === 0) { |
| | | proxy.$modal.msgWarning("选中的数据已全部提交,无需重复检验"); |
| | | return; |
| | | } |
| | | |
| | | const totalCount = selectedRows.value.length; |
| | | const submittedCount = totalCount - unSubmittedRows.length; |
| | | |
| | | let confirmMessage = `已选择 ${totalCount} 条检验单`; |
| | | if (submittedCount > 0) { |
| | | confirmMessage += `(其中 ${submittedCount} 条已提交,将自动跳过)`; |
| | | } |
| | | confirmMessage += `\n\n确认后将自动:\n· 检验结果设为"合格"\n· 合格数量设为总数\n· 不合格数量设为 0\n· 提交并入库`; |
| | | |
| | | ElMessageBox.confirm(confirmMessage, "快速检验", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | dangerouslyUseHTMLString: false, |
| | | }) |
| | | .then(() => { |
| | | // 调用批量快速检验接口 |
| | | const ids = unSubmittedRows.map(item => item.id); |
| | | batchQuickInspect(ids).then(res => { |
| | | proxy.$modal.msgSuccess(res.msg || "快速检验完成"); |
| | | getList(); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消"); |
| | | }); |
| | | }; |
| | | |
| | | // 打开新增检验弹框 |
| | | const openInspectionForm = (type, row) => { |
| | | nextTick(() => { |