src/views/qualityManagement/rawMaterialInspection/components/formDia.vue
@@ -136,7 +136,7 @@
      </PIMTable>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="submitForm">确认</el-button>
          <el-button type="primary" :loading="submitting" @click="submitForm">确认</el-button>
          <el-button @click="closeDia">取消</el-button>
        </div>
      </template>
@@ -157,6 +157,7 @@
const emit = defineEmits(['close'])
const dialogFormVisible = ref(false);
const submitting = ref(false);
const operationType = ref('')
const data = reactive({
  form: {
@@ -382,6 +383,9 @@
// 提交产品表单
const submitForm = () => {
  if (submitting.value) {
    return;
  }
  proxy.$refs.formRef.validate(valid => {
    if (valid) {
      form.value.inspectType = 0
@@ -391,15 +395,20 @@
            })
         }
      const data = {...form.value, qualityInspectParams: tableData.value}
      submitting.value = true;
      if (operationType.value === "add") {
        qualityInspectAdd(data).then(res => {
          proxy.$modal.msgSuccess("提交成功");
          closeDia();
        }).catch(() => {}).finally(() => {
          submitting.value = false;
        })
      } else {
        qualityInspectUpdate(data).then(res => {
          proxy.$modal.msgSuccess("提交成功");
          closeDia();
        }).catch(() => {}).finally(() => {
          submitting.value = false;
        })
      }
    }