| | |
| | | <el-button type="primary" @click="openStandardDialog('add')">新增</el-button> |
| | | <el-button type="success" plain @click="handleBatchAudit(1)">批准</el-button> |
| | | <el-button type="warning" plain @click="handleBatchAudit(2)">撤销</el-button> |
| | | <el-button type="danger" plain @click="handleBatchDelete">删除</el-button> |
| | | <el-button type="danger" plain @click="handleBatchDelete" v-hasPermi="['qualityManagement:metricMaintenance:remove']">删除</el-button> |
| | | </div> |
| | | </div> |
| | | <PIMTable |
| | |
| | | </div> |
| | | |
| | | <div class="right-toolbar"> |
| | | <el-button type="primary" :disabled="!currentStandard || isStandardReadonly" @click="openParamDialog('add')"> |
| | | <el-button type="primary" :disabled="!currentStandard" @click="openParamDialog('add')"> |
| | | 新增 |
| | | </el-button> |
| | | <el-button type="danger" plain :disabled="!currentStandard || isStandardReadonly" @click="handleParamBatchDelete"> |
| | | <el-button type="danger" plain :disabled="!currentStandard" @click="handleParamBatchDelete" v-hasPermi="['qualityManagement:metricMaintenance:remove']"> |
| | | 删除 |
| | | </el-button> |
| | | </div> |
| | |
| | | <el-table-column type="index" label="序号" width="60" align="center" /> |
| | | <el-table-column prop="parameterItem" label="参数项" min-width="120" /> |
| | | <el-table-column prop="unit" label="单位" width="80" /> |
| | | <el-table-column prop="standardValue" label="标准值" min-width="120" /> |
| | | <el-table-column prop="standardValue" label="厂家标准值" min-width="120" /> |
| | | <el-table-column prop="controlValue" label="内控值" min-width="120" /> |
| | | <el-table-column label="判断类型" width="100"> |
| | | <template #default="{ row }"> |
| | | <el-tag v-if="row.judgeType === '≥'" type="success">≥</el-tag> |
| | | <el-tag v-else-if="row.judgeType === '≤'" type="warning">≤</el-tag> |
| | | <el-tag v-else-if="row.judgeType === '范围'" type="info">范围</el-tag> |
| | | <el-tag v-else-if="row.judgeType === '文字描述'">文字</el-tag> |
| | | <span v-else>-</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="必要判断" width="80"> |
| | | <template #default="{ row }"> |
| | | <el-tag v-if="row.isRequired === 1" type="danger">是</el-tag> |
| | | <el-tag v-else type="info">否</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="minValue" label="范围下限" width="100" /> |
| | | <el-table-column prop="maxValue" label="范围上限" width="100" /> |
| | | <el-table-column prop="defaultValue" label="默认值" min-width="120" /> |
| | | <el-table-column label="操作" width="140" fixed="right" align="center"> |
| | | <template #default="{ row }"> |
| | | <el-button link type="primary" :disabled="isStandardReadonly" @click="openParamDialog('edit', row)"> |
| | | <el-button link type="primary" @click="openParamDialog('edit', row)"> |
| | | 编辑 |
| | | </el-button> |
| | | <el-button link type="danger" :disabled="isStandardReadonly" @click="handleParamDelete(row)"> |
| | | <el-button link type="danger" @click="handleParamDelete(row)" v-hasPermi="['qualityManagement:metricMaintenance:remove']"> |
| | | 删除 |
| | | </el-button> |
| | | </template> |
| | |
| | | |
| | | <script setup> |
| | | import { Search } from '@element-plus/icons-vue' |
| | | import { ref, reactive, toRefs, onMounted, getCurrentInstance, computed } from 'vue' |
| | | import { ref, reactive, toRefs, onMounted, getCurrentInstance } from 'vue' |
| | | import { ElMessageBox } from 'element-plus' |
| | | import { |
| | | qualityTestStandardListPage, |
| | |
| | | // 左侧标准列表:整行内容居中(配合样式) |
| | | const rowClassNameCenter = () => 'row-center' |
| | | |
| | | // 标准状态为“通过(1)”时,右侧参数禁止增删改 |
| | | const isStandardReadonly = computed(() => { |
| | | const state = currentStandard.value?.state |
| | | return state === 1 || state === '1' |
| | | }) |
| | | |
| | | // 搜索条件 |
| | | const data = reactive({ |
| | |
| | | remark: '', |
| | | state: '0', |
| | | inspectType: '', |
| | | processId: '' |
| | | processId: '', |
| | | inspectRule: 0, |
| | | sampleRatio: undefined |
| | | }, |
| | | standardRules: { |
| | | standardNo: [{ required: true, message: '请输入标准编号', trigger: 'blur' }], |
| | |
| | | unit: '', |
| | | standardValue: '', |
| | | controlValue: '', |
| | | defaultValue: '' |
| | | defaultValue: '', |
| | | judgeType: null, |
| | | isRequired: 0, |
| | | minValue: null, |
| | | maxValue: null |
| | | }) |
| | | |
| | | // 弹窗 |
| | |
| | | align: 'center' |
| | | }, |
| | | { |
| | | label: '检验规则', |
| | | prop: 'inspectRule', |
| | | minWidth: 100, |
| | | align: 'center', |
| | | formatData: (val) => val === 0 ? '全检' : val === 1 ? '抽检' : '' |
| | | }, |
| | | { |
| | | label: '抽检比例(%)', |
| | | prop: 'sampleRatio', |
| | | minWidth: 120, |
| | | align: 'center' |
| | | }, |
| | | { |
| | | dataType: 'action', |
| | | label: '操作', |
| | | align: 'center', |
| | |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | handleDelete(row) |
| | | } |
| | | }, |
| | | hasPermi: ['qualityManagement:metricMaintenance:remove'] |
| | | } |
| | | ] |
| | | } |
| | |
| | | |
| | | const openParamDialog = (type, row) => { |
| | | if (!currentStandard.value?.id) return |
| | | if (isStandardReadonly.value) { |
| | | proxy.$message.warning('该标准已通过,参数不可编辑') |
| | | return |
| | | } |
| | | paramOperationType.value = type |
| | | if (type === 'add') { |
| | | Object.assign(paramForm, { |
| | |
| | | unit: '', |
| | | standardValue: '', |
| | | controlValue: '', |
| | | defaultValue: '' |
| | | defaultValue: '', |
| | | judgeType: null, |
| | | isRequired: 0, |
| | | minValue: null, |
| | | maxValue: null |
| | | }) |
| | | } else if (type === 'edit' && row) { |
| | | Object.assign(paramForm, row) |
| | |
| | | const submitParamForm = async () => { |
| | | const testStandardId = currentStandard.value?.id |
| | | if (!testStandardId) return |
| | | if (isStandardReadonly.value) { |
| | | proxy.$message.warning('该标准已通过,参数不可编辑') |
| | | return |
| | | } |
| | | const payload = { ...paramForm, testStandardId } |
| | | if (paramOperationType.value === 'edit') { |
| | | await qualityTestStandardParamUpdate(payload) |
| | |
| | | |
| | | const handleParamDelete = async (row) => { |
| | | if (!row?.id) return |
| | | if (isStandardReadonly.value) { |
| | | proxy.$message.warning('该标准已通过,参数不可编辑') |
| | | return |
| | | } |
| | | try { |
| | | await ElMessageBox.confirm('确认删除该参数?', '提示', { type: 'warning' }) |
| | | } catch { |
| | |
| | | } |
| | | |
| | | const handleParamBatchDelete = async () => { |
| | | if (isStandardReadonly.value) { |
| | | proxy.$message.warning('该标准已通过,参数不可编辑') |
| | | return |
| | | } |
| | | if (!paramSelectedRows.value.length) { |
| | | proxy.$message.warning('请选择数据') |
| | | return |
| | |
| | | remark: '', |
| | | state: '0', |
| | | inspectType: '', |
| | | processId: '' |
| | | processId: '', |
| | | inspectRule: 0, |
| | | sampleRatio: undefined |
| | | }) |
| | | } else if (type === 'edit' && row) { |
| | | Object.assign(standardForm.value, { |