| | |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="工序:" prop="process"> |
| | | <el-input v-model="form.process" placeholder="请输入工序" clearable :disabled="processQuantityDisabled" /> |
| | | <el-select v-model="form.process" placeholder="请选择工序" clearable :disabled="processQuantityDisabled" style="width: 100%"> |
| | | <el-option v-for="item in processList" :key="item.name" :label="item.name" :value="item.name"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="检验员:" prop="checkName"> |
| | | <el-select v-model="form.checkName" placeholder="请选择" clearable> |
| | | <el-select v-model="form.checkName" placeholder="请选择" clearable filterable> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" |
| | | :value="item.nickName"/> |
| | | </el-select> |
| | |
| | | import {qualityInspectDetailByProductId, getQualityTestStandardParamByTestStandardId} from "@/api/qualityManagement/metricMaintenance.js"; |
| | | import {userListNoPage} from "@/api/system/user.js"; |
| | | import {qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js"; |
| | | import { list } from "@/api/productionManagement/productionProcess"; |
| | | const { proxy } = getCurrentInstance() |
| | | const emit = defineEmits(['close']) |
| | | |
| | | |
| | | |
| | | const dialogFormVisible = ref(false); |
| | | const operationType = ref('') |
| | |
| | | }, |
| | | rules: { |
| | | checkTime: [{ required: true, message: "请输入", trigger: "blur" },], |
| | | process: [{ required: true, message: "请输入工序", trigger: "blur" }], |
| | | process: [{ required: true, message: "请选择工序", trigger: "change" }], |
| | | checkName: [{ required: false, message: "请输入", trigger: "blur" }], |
| | | productId: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | productModelId: [{ required: true, message: "请选择", trigger: "change" }], |
| | |
| | | const v = form.value || {}; |
| | | return !!(v.productMainId != null || v.purchaseLedgerId != null); |
| | | }); |
| | | const processList = ref([]); // 工序下拉列表(工序名称 name) |
| | | const supplierList = ref([]); |
| | | const productOptions = ref([]); |
| | | const tableColumn = ref([ |
| | |
| | | const modelOptions = ref([]); |
| | | |
| | | // 打开弹框 |
| | | const openDialog = async (type, row) => { |
| | | const openDialog = async (type, row, defaultCheckResult = "", defaultCheckName = "", defaultTestStandardId = "", defaultCheckCompany = "", defaultQualityInspectParams = []) => { |
| | | operationType.value = type; |
| | | getOptions().then((res) => { |
| | | supplierList.value = res.data; |
| | | }); |
| | | // 加载工序下拉列表 |
| | | try { |
| | | const res = await list(); |
| | | processList.value = res.data || []; |
| | | } catch (e) { |
| | | console.error("加载工序列表失败", e); |
| | | processList.value = []; |
| | | } |
| | | let userLists = await userListNoPage(); |
| | | userList.value = userLists.data; |
| | | // 先重置表单数据(保持字段完整,避免弹窗首次渲染时触发必填红框“闪一下”) |
| | | // 筛选 roleIds 包含 106 的用户 |
| | | userList.value = (userLists.data || []).filter(user => { |
| | | const roleIds = user.roleIds || []; |
| | | return roleIds.includes(106) || roleIds.includes('106'); |
| | | }); |
| | | // 先重置表单数据(保持字段完整,避免弹窗首次渲染时触发必填红框"闪一下") |
| | | form.value = { |
| | | checkTime: "", |
| | | process: "", |
| | | checkName: "", |
| | | checkName: defaultCheckName || "", |
| | | productName: "", |
| | | productId: "", |
| | | productModelId: "", |
| | |
| | | unit: "", |
| | | quantity: "", |
| | | checkCompany: "", |
| | | checkResult: "", |
| | | checkResult: defaultCheckResult || "", |
| | | } |
| | | testStandardOptions.value = []; |
| | | tableData.value = []; |
| | |
| | | const savedTestStandardId = row.testStandardId; |
| | | // 先设置表单数据,但暂时清空 testStandardId,等选项加载完成后再设置 |
| | | form.value = {...row, testStandardId: ''} |
| | | // 如果传入了默认检测结果,覆盖row中的值 |
| | | if (defaultCheckResult) { |
| | | form.value.checkResult = defaultCheckResult; |
| | | } |
| | | // 如果传入了默认检验员,覆盖row中的值(优先使用传入的检验员) |
| | | console.log('formDia checkName debug:', { defaultCheckName, rowCheckName: row.checkName }); |
| | | form.value.checkName = defaultCheckName || row.checkName || ""; |
| | | currentProductId.value = row.productId || 0 |
| | | // 关键:编辑时加载规格型号下拉选项,才能反显 productModelId |
| | | if (currentProductId.value) { |