| | |
| | | <div style="display: flex;flex-direction: row;align-items: center;"> |
| | | <div> |
| | | <span class="search_title">类型:</span> |
| | | <el-select v-model="searchForm.inspectType" clearable style="width: 200px" @change="handleQuery"> |
| | | <el-select v-model="searchForm.checkType" clearable style="width: 200px" @change="handleQuery"> |
| | | <el-option label="入厂检" :value="0" /> |
| | | <el-option label="车间检" :value="1" /> |
| | | <el-option label="出厂检" :value="2" /> |
| | | </el-select> |
| | | </div> |
| | | <div style="margin-left: 10px"> |
| | | <!-- <div style="margin-left: 10px"> |
| | | <span class="search_title">状态:</span> |
| | | <el-select v-model="searchForm.inspectState" clearable style="width: 200px" @change="handleQuery"> |
| | | <el-option label="待处理" :value="0" /> |
| | | <el-option label="已处理" :value="1" /> |
| | | </el-select> |
| | | </div> |
| | | </div> --> |
| | | <div style="margin-left: 10px"> |
| | | <span class="search_title">产品名称:</span> |
| | | <el-input |
| | |
| | | <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> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | @click="handleDelete" |
| | | v-if="hasNonconformingCancel" |
| | | >删除</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | |
| | | |
| | | <script setup> |
| | | import { Search } from "@element-plus/icons-vue"; |
| | | import {onMounted, ref} from "vue"; |
| | | import { onMounted, ref, computed } from "vue"; |
| | | import FormDia from "@/views/qualityManagement/nonconformingManagement/components/formDia.vue"; |
| | | import {ElMessageBox} from "element-plus"; |
| | | import {qualityUnqualifiedDel, qualityUnqualifiedListPage} from "@/api/qualityManagement/nonconformingManagement.js"; |
| | | import InspectionFormDia from "@/views/qualityManagement/nonconformingManagement/components/inspectionFormDia.vue"; |
| | | import dayjs from "dayjs"; |
| | | import { checkPermi } from "@/utils/permission.js"; |
| | | |
| | | const data = reactive({ |
| | | searchForm: { |
| | | inspectType: "", |
| | | checkType: "", |
| | | inspectState: "", |
| | | productName: "", |
| | | entryDate: undefined, // 录入日期 |
| | |
| | | }, |
| | | }); |
| | | const { searchForm } = toRefs(data); |
| | | |
| | | const hasNonconformingEdit = computed(() => checkPermi(["nonconforming_edit"])); |
| | | const hasNonconformingCancel = computed(() => checkPermi(["nonconforming_cancel"])); |
| | | |
| | | const tableColumn = ref([ |
| | | { |
| | | label: "状态", |
| | | prop: "inspectState", |
| | | dataType: "tag", |
| | | formatData: (params) => { |
| | | if (params == 0) { |
| | | return "待处理"; |
| | | } else if (params == 1) { |
| | | return "已处理"; |
| | | } else { |
| | | return null; |
| | | } |
| | | }, |
| | | formatType: (params) => { |
| | | if (params == '不合格') { |
| | | return "danger"; |
| | | } else if (params == '合格') { |
| | | return "success"; |
| | | } else { |
| | | return null; |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | label: "检测日期", |
| | | prop: "checkTime", |
| | | width: 120 |
| | | }, |
| | | { |
| | | label: "类别", |
| | | prop: "inspectType", |
| | | label: "批号", |
| | | prop: "batchNo", |
| | | width: 120 |
| | | }, |
| | | { |
| | | label: "检测类型", |
| | | prop: "checkType", |
| | | dataType: "tag", |
| | | width: 120, |
| | | formatData: (params) => { |
| | | if (params == 0) { |
| | | if (params === 0) { |
| | | return "入厂检"; |
| | | } else if (params == 1) { |
| | | } else if (params === 1) { |
| | | return "车间检"; |
| | | } else { |
| | | return '出厂检'; |
| | | } |
| | | }, |
| | | formatType: (params) => { |
| | | if (params == '不合格') { |
| | | if (params === '不合格') { |
| | | return "info"; |
| | | } else if (params == '合格') { |
| | | return "success"; |
| | |
| | | label: "单位", |
| | | prop: "unit", |
| | | }, |
| | | { |
| | | label: "数量", |
| | | prop: "quantity", |
| | | width: 100 |
| | | }, |
| | | // { |
| | | // label: "数量", |
| | | // prop: "quantity", |
| | | // width: 100 |
| | | // }, |
| | | { |
| | | label: "不合格现象", |
| | | prop: "defectivePhenomena", |
| | |
| | | label: "操作", |
| | | align: "center", |
| | | fixed: "right", |
| | | width: 100, |
| | | width: 180, |
| | | operation: [ |
| | | { |
| | | name: "处理", |
| | | name: "编辑", |
| | | type: "text", |
| | | showHide: (row) => hasNonconformingEdit.value, |
| | | clickFun: (row) => { |
| | | openInspectionForm("edit", row); |
| | | openForm("edit", row); |
| | | }, |
| | | disabled: (row) => row.inspectState === 1, |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | |
| | | // 打开弹框 |
| | | const openForm = (type, row) => { |
| | | if (type !== 'add' && row?.inspectState === 1) { |
| | | proxy.$modal.msgWarning("已处理的数据不能再编辑"); |
| | | return; |
| | | } |
| | | nextTick(() => { |
| | | formDia.value?.openDialog(type, row) |
| | | }) |