| | |
| | | weightItem.value = Number(((qty * coeff) / 1000).toFixed(4)); |
| | | }; |
| | | |
| | | /** 非成型:投入重量取工单 bomInputQty */ |
| | | const syncBomInputWeight = () => { |
| | | /** 非成型:投入重量取工单 bomInputQty(仅回显,不覆盖用户已编辑的值) */ |
| | | const syncBomInputWeight = (force = false) => { |
| | | if (props.isFormingProcess) return; |
| | | const weightItem = formData.list.find(isInputWeightItem); |
| | | if (!weightItem) return; |
| | | const bom = props.bomInputQty; |
| | | if (bom === null || bom === undefined || Number.isNaN(Number(bom))) { |
| | | return; |
| | | } |
| | | const current = weightItem.value; |
| | | const isEmpty = |
| | | current === null || current === undefined || current === ""; |
| | | if (!force && !isEmpty) { |
| | | return; |
| | | } |
| | | weightItem.value = Number(bom); |
| | |
| | | } |
| | | }; |
| | | |
| | | const cloneParamList = (list) => |
| | | JSON.parse(JSON.stringify(list || [])); |
| | | |
| | | const initData = () => { |
| | | formData.list = props.list || []; |
| | | formData.list = cloneParamList(props.list); |
| | | formData.list.forEach(item => { |
| | | if (item.value === undefined) { |
| | | item.value = null; |
| | | } |
| | | }); |
| | | loadDeviceName(); |
| | | syncInputWeight(); |
| | | if (props.isFormingProcess) { |
| | | syncFormingInputWeight(); |
| | | } else { |
| | | syncBomInputWeight(true); |
| | | } |
| | | }; |
| | | |
| | | const submitData = async () => { |
| | |
| | | () => { |
| | | initData(); |
| | | }, |
| | | {immediate: true, deep: true} |
| | | {immediate: true} |
| | | ); |
| | | |
| | | watch( |