spring
10 天以前 2a92b8a223d4875737b8062d177505263abcb6a3
src/views/productionManagement/workOrder/components/ProductionRecordForm.vue
@@ -93,13 +93,19 @@
  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);
@@ -113,15 +119,22 @@
  }
};
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 () => {
@@ -139,7 +152,7 @@
    () => {
      initData();
    },
    {immediate: true, deep: true}
    {immediate: true}
);
watch(