fix: 出入库只有吨和公斤才能转换单位,其他单位不用转换。
| | |
| | | placeholder="请选择单位" |
| | | clearable |
| | | style="width: 100%" |
| | | :filterable="isConsumablesBranch" |
| | | :allow-create="isConsumablesBranch" |
| | | :default-first-option="isConsumablesBranch" |
| | | filterable |
| | | allow-create |
| | | default-first-option |
| | | > |
| | | <el-option |
| | | v-for="u in unitSelectOptions" |
| | |
| | | if (isConsumablesBranch.value) { |
| | | return ["吨", "公斤", "件", "个数",'桶']; |
| | | } |
| | | return ["吨", "公斤"]; |
| | | return ["吨", "公斤",'块','方','箱','袋','瓶','桶','盒','包','件','个数']; |
| | | }); |
| | | |
| | | // 查询产品树 |
| | |
| | | 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 = () => { |
| | |
| | | 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 = () => { |
| | |
| | | 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 showProductSelectDialog = ref(false); |
| | | const unitEditableValues = ['吨', '公斤']; |
| | | |
| | | const canEditUnit = computed(() => unitEditableValues.includes(formState.value?.unit)); |
| | | |
| | | const editableUnitOptions = computed(() => { |
| | | const options = [ |
| | | {label: '吨', value: '吨'}, |
| | | {label: '公斤', value: '公斤'}, |
| | | ]; |
| | | const currentUnit = formState.value?.unit; |
| | | if (currentUnit && !unitEditableValues.includes(currentUnit)) { |
| | | return [{label: currentUnit, value: currentUnit}]; |
| | | } |
| | | return options; |
| | | }); |
| | | |
| | | let { proxy } = getCurrentInstance() |
| | | |
| | |
| | | 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 showProductSelectDialog = ref(false); |
| | | const unitEditableValues = ['吨', '公斤']; |
| | | |
| | | const canEditUnit = computed(() => unitEditableValues.includes(formState.value?.unit)); |
| | | |
| | | const editableUnitOptions = computed(() => { |
| | | const options = [ |
| | | {label: '吨', value: '吨'}, |
| | | {label: '公斤', value: '公斤'}, |
| | | ]; |
| | | const currentUnit = formState.value?.unit; |
| | | if (currentUnit && !unitEditableValues.includes(currentUnit)) { |
| | | return [{label: currentUnit, value: currentUnit}]; |
| | | } |
| | | return options; |
| | | }); |
| | | |
| | | let { proxy } = getCurrentInstance() |
| | | |