| | |
| | | placeholder="请选择单位" |
| | | style="width: 100%" |
| | | clearable |
| | | :disabled="!canEditUnit" |
| | | > |
| | | <el-option label="吨" value="吨" /> |
| | | <el-option label="公斤" value="公斤" /> |
| | | <el-option |
| | | v-for="item in editableUnitOptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item |
| | |
| | | const isShowEditModal = ref(false); |
| | | const editFormRef = ref(null); |
| | | const editForm = ref({}); |
| | | const unitEditableValues = ['吨', '公斤']; |
| | | |
| | | const canEditUnit = computed(() => unitEditableValues.includes(editForm.value?.unit)); |
| | | |
| | | const editableUnitOptions = computed(() => { |
| | | const options = [ |
| | | { label: '吨', value: '吨' }, |
| | | { label: '公斤', value: '公斤' }, |
| | | ]; |
| | | const currentUnit = editForm.value?.unit; |
| | | if (currentUnit && !unitEditableValues.includes(currentUnit)) { |
| | | return [{ label: currentUnit, value: currentUnit }]; |
| | | } |
| | | return options; |
| | | }); |
| | | |
| | | // 毛重 - 皮重 计算净重(保留两位小数,且不为负) |
| | | const computeNetWeightEdit = () => { |