| | |
| | | <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-form-item label="订单号:" prop="salesLedgerId"> |
| | | <el-select |
| | | v-model="form.salesLedgerId" |
| | | placeholder="请选择销售订单" |
| | | placeholder="请选择订单号" |
| | | clearable |
| | | filterable |
| | | :disabled="isViewMode" |
| | |
| | | const currentProductId = ref(0); |
| | | const testStandardOptions = ref([]); // 指标选择下拉框数据 |
| | | const modelOptions = ref([]); |
| | | const salesLedgerOptions = ref([]); // 销售订单下拉框数据 |
| | | const salesLedgerOptions = ref([]); // 订单号下拉框数据 |
| | | |
| | | // 打开弹框 |
| | | const openDialog = async (type, row) => { |
| | |
| | | form.value.unit = modelOptions.value.find(item => item.id == value)?.unit || ''; |
| | | } |
| | | |
| | | // 销售订单选择变化处理 |
| | | // 订单号选择变化处理 |
| | | const handleSalesLedgerChange = async (value) => { |
| | | const selectedItem = salesLedgerOptions.value.find(item => item.id == value); |
| | | if (selectedItem) { |
| | | form.value.salesContractNo = selectedItem.salesContractNo || ''; |
| | | // 根据销售订单ID查询产品信息,只赋值数量 |
| | | // 根据订单号ID查询产品信息,只赋值数量 |
| | | try { |
| | | const res = await productList({ salesLedgerId: value, type: 1 }); |
| | | const productData = res.data && res.data.length > 0 ? res.data[0] : null; |
| | |
| | | calcSampleQuantity(); |
| | | } |
| | | } catch (e) { |
| | | console.error('查询销售订单产品信息失败', e); |
| | | proxy.$modal.msgError('查询销售订单产品信息失败'); |
| | | console.error('查询订单号产品信息失败', e); |
| | | proxy.$modal.msgError('查询订单号产品信息失败'); |
| | | } |
| | | } else { |
| | | form.value.salesContractNo = ''; |