| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="规格型号:" prop="productModelId"> |
| | | <el-select v-model="form.productModelId" placeholder="请选择" clearable :disabled="operationType === 'edit'" |
| | | <el-select v-model="form.productModelId" placeholder="请选择" clearable |
| | | :disabled="operationType === 'edit'" |
| | | filterable readonly @change="handleChangeModel"> |
| | | <el-option v-for="item in modelOptions" :key="item.id" :label="item.model" :value="item.id" /> |
| | | </el-select> |
| | |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="检品数量:" prop="inspectedQuantity"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.inspectedQuantity" placeholder="请输入" clearable :precision="2"/> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.inspectedQuantity" |
| | | placeholder="请输入" clearable :precision="2"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="总数量:" prop="quantity"> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.quantity" placeholder="请输入" clearable :precision="2" :disabled="quantityDisabled"/> |
| | | <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.quantity" placeholder="请输入" |
| | | clearable :precision="2" :disabled="quantityDisabled"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="生产日期:" prop="productionDate"> |
| | | <el-date-picker |
| | |
| | | <el-input v-model="form.inspectValidityDate" placeholder="自动计算" disabled/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="请检部门:" prop="manufacturingTeam"> |
| | | <el-input v-model="form.manufacturingTeam" placeholder="请输入" clearable/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <PIMTable |
| | |
| | | import {qualityInspectAdd, qualityInspectUpdate} from "@/api/qualityManagement/rawMaterialInspection.js"; |
| | | import {userListNoPage} from "@/api/system/user.js"; |
| | | import { getStockInventoryAll } from "@/api/inventoryManagement/stockInventory.js"; |
| | | import {qualityInspectDetailByProductId, getQualityTestStandardParamByTestStandardId} from "@/api/qualityManagement/metricMaintenance.js"; |
| | | import { |
| | | qualityInspectDetailByProductId, |
| | | getQualityTestStandardParamByTestStandardId |
| | | } from "@/api/qualityManagement/metricMaintenance.js"; |
| | | import {qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js"; |
| | | import {deviceList as qualityInspectParamDeviceList} from "@/api/energyManagement/index.js"; |
| | | |
| | | const { proxy } = getCurrentInstance() |
| | | const emit = defineEmits(['close']) |
| | | |
| | |
| | | inspectProductionDate: "", |
| | | inspectValidityDate: "", |
| | | inspectValidityPeriod: "", |
| | | manufacturingTeam: "", |
| | | }, |
| | | rules: { |
| | | checkTime: [{ required: true, message: "请输入", trigger: "blur" },], |
| | |
| | | if (currentProductId.value) { |
| | | // 设置产品名称 |
| | | form.value.productName = findNodeById(productOptions.value, currentProductId.value); |
| | | syncInspectDeptByProductName(form.value.productName); |
| | | |
| | | // 并行加载规格型号和指标选项 |
| | | const params = { |
| | |
| | | inspectProductOptions.value = filterInspectTreeForPowderSelect(inspectStockInventoryAllTree); |
| | | return inspectProductOptions.value; |
| | | }; |
| | | |
| | | const getInspectDeptByProductName = (productName) => { |
| | | const name = String(productName ?? "").trim(); |
| | | if (!name) return ""; |
| | | const match = name.match(/^成品-([一三])类产品-/); |
| | | if (!match) return ""; |
| | | return `${match[1]}类车间`; |
| | | }; |
| | | |
| | | const syncInspectDeptByProductName = (productName, force = false) => { |
| | | const dept = getInspectDeptByProductName(productName); |
| | | if (!dept) return; |
| | | if (force || !String(form.value.inspectDept ?? "").trim()) { |
| | | form.value.inspectDept = dept; |
| | | } |
| | | }; |
| | | |
| | | const getModels = (value) => { |
| | | form.value.productModelId = undefined; |
| | | form.value.unit = undefined; |
| | |
| | | modelOptions.value = []; |
| | | currentProductId.value = value |
| | | form.value.productName = findNodeById(productOptions.value, value); |
| | | syncInspectDeptByProductName(form.value.productName, true); |
| | | modelList({ id: value }).then((res) => { |
| | | modelOptions.value = res; |
| | | }) |
| | |
| | | } |
| | | return null; // 没有找到节点,返回null |
| | | }; |
| | | |
| | | function convertIdToValue(data) { |
| | | return data.map((item) => { |
| | | const { id, children, ...rest } = item; |
| | |
| | | return newItem; |
| | | }); |
| | | } |
| | | |
| | | // 提交产品表单 |
| | | const submitForm = () => { |
| | | proxy.$refs.formRef.validate(valid => { |