| | |
| | | placeholder="--" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="出库吨位(吨)"> |
| | | <el-input :model-value="outTonnage === null ? '--' : outTonnage" |
| | | readonly /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="8"> |
| | |
| | | </el-row> |
| | | <div class="form-section-title">装油操作信息</div> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="8"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="车体/铅封检验是否正常" |
| | | prop="loadingInspectionStatus" |
| | | :rules="[{ required: true, message: '请选择车体/铅封检验是否正常', trigger: 'change' }]"> |
| | |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="装车鹤位" |
| | | prop="loadingCranePosition" |
| | | :rules="[{ required: true, message: '请选择装车鹤位', trigger: 'change' }]"> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="密度" |
| | | prop="density" |
| | | :rules="[ |
| | | { required: true, message: '请输入密度', trigger: 'blur' }, |
| | | { pattern: /^\d+(\.\d{1,2})?$/, message: '请输入数字,最多保留两位小数', trigger: 'blur' }, |
| | | ]"> |
| | | <el-input v-model="formState.density" |
| | | placeholder="请输入数字,最多保留两位小数" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="24"> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <div class="form-section-title">过磅数据</div> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="出库吨位(吨)" |
| | | prop="outTonnage" |
| | | :rules="[{ required: true, message: '请输入出库吨位', trigger: 'blur' }]"> |
| | | <el-input-number v-model="formState.outTonnage" |
| | | :min="0" |
| | | :precision="2" |
| | | :controls="false" |
| | | placeholder="请输入数字,最多保留两位小数" |
| | | style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="密度" |
| | | prop="density" |
| | | :rules="[{ required: true, message: '请输入密度', trigger: 'blur' }]"> |
| | | <el-input-number v-model="formState.density" |
| | | :min="0" |
| | | :precision="3" |
| | | :controls="false" |
| | | placeholder="请输入数字,最多保留三位小数" |
| | | style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="毛重(吨)" |
| | |
| | | tankNo: "", |
| | | outDate: "", |
| | | oilProduct: undefined, |
| | | // 出库吨位(出厂吨位)手填,后端拿它当出库数量 |
| | | outTonnage: null, |
| | | customerId: undefined, |
| | | customerName: "", |
| | | contactPerson: "", |
| | |
| | | return Number((Number(g) - Number(t)).toFixed(2)); |
| | | }); |
| | | |
| | | // 亏量(吨) = 净重的负数,保留两位小数 |
| | | // 亏量(吨) = 净重 − 出厂吨位(出厂吨位就是手填的「出库吨位」),保留两位小数 |
| | | const lossQuantity = computed(() => { |
| | | if (netWeight.value === null) { |
| | | const out = formState.value.outTonnage; |
| | | if (netWeight.value === null || out === null || out === undefined || out === "") { |
| | | return null; |
| | | } |
| | | return Number((-netWeight.value).toFixed(2)); |
| | | return Number((netWeight.value - Number(out)).toFixed(2)); |
| | | }); |
| | | |
| | | // 实际入库体积(升) = 实际净重(kg) ÷ 密度(kg/L),净重吨 × 1000 转 kg |
| | | // 实际入库体积(升) = 净重(吨) × 密度,保留两位小数 |
| | | const actualVolume = computed(() => { |
| | | const d = formState.value.density; |
| | | if (netWeight.value === null || d === null || d === undefined || d === "" || Number(d) <= 0) { |
| | | if (netWeight.value === null || d === null || d === undefined || d === "") { |
| | | return 0; |
| | | } |
| | | return Math.round(((netWeight.value * 1000) / Number(d)) * 100) / 100; |
| | | return Number((netWeight.value * Number(d)).toFixed(2)); |
| | | }); |
| | | |
| | | // 出库吨位(吨) = 净重(需求未给公式,暂按净重带出) |
| | | const outTonnage = computed(() => netWeight.value); |
| | | |
| | | let { proxy } = getCurrentInstance(); |
| | | |
| | |
| | | proxy.$modal.msgError("请选择产品规格"); |
| | | return; |
| | | } |
| | | // 计算结果随表单提交 |
| | | formState.value.outTonnage = outTonnage.value; |
| | | // 计算结果随表单提交(出库吨位是手填的,不再覆盖) |
| | | formState.value.netWeight = netWeight.value; |
| | | formState.value.lossQuantity = lossQuantity.value; |
| | | formState.value.actualVolume = actualVolume.value; |