| | |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="销售订单:" prop="salesLedgerId"> |
| | | <el-select |
| | | v-model="form.salesLedgerId" |
| | | placeholder="请选择销售订单" |
| | | clearable |
| | | filterable |
| | | :disabled="isViewMode" |
| | | style="width: 100%" |
| | | @change="handleSalesLedgerChange" |
| | | > |
| | | <el-option |
| | | v-for="item in salesLedgerOptions" |
| | | :key="item.id" |
| | | :label="item.salesContractNo" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="产品名称:" prop="productId"> |
| | | <el-tree-select |
| | | v-model="form.productId" |
| | |
| | | import {userListNoPage} from "@/api/system/user.js"; |
| | | import {qualityInspectDetailByProductId, getQualityTestStandardParamByTestStandardId} from "@/api/qualityManagement/metricMaintenance.js"; |
| | | import {qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js"; |
| | | import {ledgerListNoPage} from "@/api/salesManagement/salesLedger.js"; |
| | | const { proxy } = getCurrentInstance() |
| | | const emit = defineEmits(['close']) |
| | | |
| | |
| | | unqualifiedQuantity: "", |
| | | checkCompany: "", |
| | | checkResult: "", |
| | | salesLedgerId: "", |
| | | salesContractNo: "", |
| | | }, |
| | | rules: { |
| | | checkTime: [{ required: true, message: "请输入", trigger: "blur" }], |
| | |
| | | const currentProductId = ref(0); |
| | | const testStandardOptions = ref([]); // 指标选择下拉框数据 |
| | | const modelOptions = ref([]); |
| | | const salesLedgerOptions = ref([]); // 销售订单下拉框数据 |
| | | |
| | | // 打开弹框 |
| | | const openDialog = async (type, row) => { |
| | |
| | | proxy.$refs.formRef?.clearValidate(); |
| | | |
| | | // 并行加载基础数据 |
| | | const [userListsRes] = await Promise.all([ |
| | | const [userListsRes, salesLedgerRes] = await Promise.all([ |
| | | userListNoPage(), |
| | | getProductOptions(), |
| | | getOptions().then((res) => { |
| | | supplierList.value = res.data; |
| | | }), |
| | | ledgerListNoPage({ current: -1, size: -1 }).then((res) => { |
| | | salesLedgerOptions.value = res.data || []; |
| | | }) |
| | | ]); |
| | | userList.value = userListsRes.data; |
| | |
| | | form.value.unit = modelOptions.value.find(item => item.id == value)?.unit || ''; |
| | | } |
| | | |
| | | // 销售订单选择变化处理 |
| | | const handleSalesLedgerChange = (value) => { |
| | | const selectedItem = salesLedgerOptions.value.find(item => item.id == value); |
| | | if (selectedItem) { |
| | | form.value.salesContractNo = selectedItem.salesContractNo || ''; |
| | | } else { |
| | | form.value.salesContractNo = ''; |
| | | } |
| | | } |
| | | |
| | | const handleQualifiedQuantityChange = (value) => { |
| | | if (value === null || value === undefined) { |
| | | form.value.qualifiedQuantity = 0; |