| | |
| | | // 不合格管理 |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="search_form"> |
| | | <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: 240px" @change="handleQuery"> |
| | | <el-select v-model="searchForm.inspectType" clearable style="width: 200px" @change="handleQuery"> |
| | | <el-option label="原材料检验" :value="0" /> |
| | | <el-option label="过程检验" :value="1" /> |
| | | <el-option label="出厂检验" :value="2" /> |
| | |
| | | </div> |
| | | <div style="margin-left: 10px"> |
| | | <span class="search_title">状态:</span> |
| | | <el-select v-model="searchForm.inspectState" clearable style="width: 240px" @change="handleQuery"> |
| | | <el-select v-model="searchForm.inspectState" clearable style="width: 200px" @change="handleQuery"> |
| | | <el-option label="待处理" :value="0" /> |
| | | <el-option label="已处理" :value="1" /> |
| | | </el-select> |
| | |
| | | <span class="search_title">产品名称:</span> |
| | | <el-input |
| | | v-model="searchForm.productName" |
| | | style="width: 240px" |
| | | style="width: 200px" |
| | | placeholder="请输入产品名称搜索" |
| | | @change="handleQuery" |
| | | clearable |
| | | :prefix-icon="Search" |
| | | /> |
| | | </div> |
| | | <span style="margin-left: 10px" class="search_title">检测日期:</span> |
| | | <el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange" |
| | | style="width: 300px" |
| | | placeholder="请选择" clearable @change="changeDaterange" /> |
| | | <el-button type="primary" @click="handleQuery" style="margin-left: 10px">搜索</el-button> |
| | | </div> |
| | | <div> |
| | |
| | | :tableLoading="tableLoading" |
| | | @pagination="pagination" |
| | | :total="page.total" |
| | | ></PIMTable> |
| | | > |
| | | <template #reasonAnalysis="{ row }"> |
| | | <el-button |
| | | link |
| | | type="primary" |
| | | @click="openTextPreviewDialog('原因分析', row?.reasonAnalysis)" |
| | | > |
| | | {{ row?.reasonAnalysis}} |
| | | </el-button> |
| | | </template> |
| | | <template #preventiveCorrective="{ row }"> |
| | | <el-button |
| | | link |
| | | type="primary" |
| | | @click="openTextPreviewDialog('预防与纠正措施', row?.preventiveCorrective)" |
| | | > |
| | | {{ row?.preventiveCorrective}} |
| | | </el-button> |
| | | </template> |
| | | <template #lossWorking="{ row }"> |
| | | <span>{{ row?.lossWorking ?? '-' }}</span> |
| | | </template> |
| | | <template #lossMaterial="{ row }"> |
| | | <span>{{ row?.lossMaterial ?? '-' }}</span> |
| | | </template> |
| | | </PIMTable> |
| | | </div> |
| | | <el-dialog v-model="textPreviewDialogVisible" :title="textPreviewTitle" width="600px"> |
| | | <div class="text-preview-content">{{ textPreviewContent || "暂无内容" }}</div> |
| | | </el-dialog> |
| | | <FormDia ref="formDia" @close="handleQuery"></FormDia> |
| | | <InspectionFormDia ref="inspectionFormDia" @close="handleQuery"></InspectionFormDia> |
| | | </div> |
| | |
| | | |
| | | <script setup> |
| | | import { Search } from "@element-plus/icons-vue"; |
| | | import {onMounted, ref} from "vue"; |
| | | import {onMounted, ref, reactive, toRefs, nextTick, getCurrentInstance} 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"; |
| | | |
| | | const data = reactive({ |
| | | searchForm: { |
| | | inspectType: "", |
| | | inspectState: "", |
| | | productName: "", |
| | | entryDate: undefined, // 录入日期 |
| | | entryDateStart: undefined, |
| | | entryDateEnd: undefined, |
| | | }, |
| | | }); |
| | | const { searchForm } = toRefs(data); |
| | |
| | | width: 120 |
| | | }, |
| | | { |
| | | label: "原因分析", |
| | | prop: "reasonAnalysis", |
| | | dataType: "slot", |
| | | slot: "reasonAnalysis", |
| | | width: 160 |
| | | }, |
| | | { |
| | | label: "预防与纠正措施", |
| | | prop: "preventiveCorrective", |
| | | dataType: "slot", |
| | | slot: "preventiveCorrective", |
| | | width: 180 |
| | | }, |
| | | { |
| | | label: "工时损失", |
| | | prop: "lossWorking", |
| | | width: 140 |
| | | }, |
| | | { |
| | | label: "材料费损失", |
| | | prop: "lossMaterial", |
| | | width: 140 |
| | | }, |
| | | { |
| | | dataType: "action", |
| | | label: "操作", |
| | | align: "center", |
| | | fixed: "right", |
| | | width: 120, |
| | | width: 100, |
| | | operation: [ |
| | | { |
| | | name: "编辑", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | openForm("edit", row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "处理", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | openInspectionForm("edit", row); |
| | | }, |
| | | disabled: (row) => row.inspectState === 1, |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | const tableData = ref([]); |
| | | const selectedRows = ref([]); |
| | | const tableLoading = ref(false); |
| | | const textPreviewDialogVisible = ref(false); |
| | | const textPreviewTitle = ref(""); |
| | | const textPreviewContent = ref(""); |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 100, |
| | |
| | | const inspectionFormDia = ref() |
| | | const { proxy } = getCurrentInstance() |
| | | |
| | | const changeDaterange = (value) => { |
| | | searchForm.value.entryDateStart = undefined; |
| | | searchForm.value.entryDateEnd = undefined; |
| | | if (value) { |
| | | searchForm.value.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD"); |
| | | searchForm.value.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD"); |
| | | } |
| | | getList(); |
| | | }; |
| | | // 查询列表 |
| | | /** 搜索按钮操作 */ |
| | | const handleQuery = () => { |
| | |
| | | }; |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | qualityUnqualifiedListPage({...page, ...searchForm.value}).then(res => { |
| | | const params = { ...searchForm.value, ...page }; |
| | | params.entryDate = undefined |
| | | qualityUnqualifiedListPage(params).then(res => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records |
| | | page.total = res.data.total; |
| | |
| | | |
| | | // 打开弹框 |
| | | const openForm = (type, row) => { |
| | | if (type !== 'add' && row?.inspectState === 1) { |
| | | proxy.$modal.msgWarning("已处理的数据不能再编辑"); |
| | | return; |
| | | } |
| | | nextTick(() => { |
| | | formDia.value?.openDialog(type, row) |
| | | }) |
| | | }; |
| | | // 打开处理弹框 |
| | | const openInspectionForm = (type, row) => { |
| | | if (row?.inspectState === 1) { |
| | | proxy.$modal.msgWarning("已处理的数据不能再处理"); |
| | | return; |
| | | } |
| | | nextTick(() => { |
| | | inspectionFormDia.value?.openDialog(type, row) |
| | | }) |
| | | }; |
| | | // 查看字段详情 |
| | | const openTextPreviewDialog = (title, content) => { |
| | | textPreviewTitle.value = title; |
| | | textPreviewContent.value = content || ""; |
| | | textPreviewDialogVisible.value = true; |
| | | }; |
| | | |
| | | // 删除 |
| | |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped></style> |
| | | <style scoped> |
| | | .text-preview-content { |
| | | white-space: pre-wrap; |
| | | line-height: 1.6; |
| | | color: #606266; |
| | | word-break: break-word; |
| | | max-height: 60vh; |
| | | overflow-y: auto; |
| | | } |
| | | </style> |