| | |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="检验规则" prop="inspectRule"> |
| | | <el-radio-group v-model="form.inspectRule"> |
| | | <el-radio :label="0">全检</el-radio> |
| | | <el-radio :label="1">抽检</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6" v-if="form.inspectRule === 1"> |
| | | <el-form-item label="抽检比例(%)" prop="sampleRatio"> |
| | | <el-input-number v-model="form.sampleRatio" :min="0.01" :max="100" :precision="2" placeholder="请输入抽检比例" style="width: 100%" @change="calcSampleQuantity" :disabled="isViewMode" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6" v-if="form.inspectRule === 1"> |
| | | <el-form-item label="抽检数量" prop="sampleQuantity"> |
| | | <el-input-number v-model="form.sampleQuantity" :min="0" :precision="2" style="width: 100%" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="检测单位:" |
| | | prop="checkCompany"> |
| | | <el-input v-model="form.checkCompany" |
| | |
| | | checkCompany: "", |
| | | checkResult: "", |
| | | purchaseContractNo: "", |
| | | inspectRule: 0, |
| | | sampleRatio: undefined, |
| | | sampleQuantity: undefined, |
| | | }, |
| | | rules: { |
| | | checkTime: [{ required: false, message: "请输入", trigger: "blur" }], |
| | |
| | | prop: "unit", |
| | | }, |
| | | { |
| | | label: "标准值", |
| | | label: "厂家标准值", |
| | | prop: "standardValue", |
| | | }, |
| | | { |
| | |
| | | checkCompany: "", |
| | | checkResult: "", |
| | | purchaseContractNo: "", |
| | | inspectRule: 0, |
| | | sampleRatio: undefined, |
| | | sampleQuantity: undefined, |
| | | }; |
| | | testStandardOptions.value = []; |
| | | tableData.value = []; |
| | |
| | | form.value.qualifiedQuantity = Math.max(0, quantity - unqualified); |
| | | }; |
| | | |
| | | const calcSampleQuantity = () => { |
| | | const q = parseFloat(form.value.quantity) || 0; |
| | | const r = parseFloat(form.value.sampleRatio) || 0; |
| | | if (q > 0 && r > 0) { |
| | | form.value.sampleQuantity = Number((q * r / 100).toFixed(2)); |
| | | } else { |
| | | form.value.sampleQuantity = undefined; |
| | | } |
| | | }; |
| | | |
| | | const findNodeById = (nodes, productId) => { |
| | | for (let i = 0; i < nodes.length; i++) { |
| | | if (nodes[i].value === productId) { |