gaoluyang
昨天 38b988786c085310aa08eb95536212ee8d1cf816
src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
@@ -4,6 +4,7 @@
        v-model="dialogFormVisible"
        :title="operationType === 'add' ? '新增原材料检验' : '编辑原材料检验'"
        width="70%"
            draggable
        @close="closeDia"
    >
      <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
@@ -212,7 +213,13 @@
   userListNoPageByTenantId().then((res) => {
      userList.value = res.data;
   });
   form.value = {}
   // 初始化表单(新增给默认值)
   form.value = {
      checkTime: getToday(),
      unit: "g",
      quantity: 1000,
      checkName: "张培",
   }
  getProductOptions();
  if (operationType.value === 'edit' && row) {
    form.value = {...row}
@@ -229,13 +236,11 @@
    }
    getQualityInspectParamList(row.id)
  }
  // 默认检验员为当前登录人,检测日期默认为当天(空时填充)
  if (currentUserName.value && !form.value.checkName) {
    form.value.checkName = currentUserName.value;
  }
  if (!form.value.checkTime) {
    form.value.checkTime = getToday();
  }
  // 新增:默认单位 g、默认检验员张培、默认数量 1000(为空时才填充,避免覆盖编辑回显)
  if (!form.value.unit) form.value.unit = "g";
  if (form.value.quantity === "" || form.value.quantity == null) form.value.quantity = 1000;
  if (!form.value.checkName) form.value.checkName = "张培";
  if (!form.value.checkTime) form.value.checkTime = getToday();
}
const getProductOptions = () => {
  productTreeList({productName: '质量'}).then((res) => {