gongchunyi
2026-08-08 8fb21c6343dcb703fb504fac6d5b2a0b7a584c36
fix: 添加loading
已修改4个文件
43 ■■■■■ 文件已修改
src/views/productionManagement/workOrderManagement/index.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/finalInspection/components/formDia.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/processInspection/components/formDia.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/rawMaterialInspection/components/formDia.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/workOrderManagement/index.vue
@@ -172,6 +172,7 @@
      <template #footer>
        <span class="dialog-footer">
          <el-button type="primary"
                     :loading="reportSubmitting"
                     @click="handleReport">确定</el-button>
          <el-button @click="reportDialogVisible = false">取消</el-button>
        </span>
@@ -316,6 +317,7 @@
  const transferCardQrUrl = ref("");
  const transferCardRowData = ref(null);
  const reportDialogVisible = ref(false);
  const reportSubmitting = ref(false);
  const workOrderFilesRef = ref(null);
  const reportFormRef = ref(null);
  const userOptions = ref([]);
@@ -575,6 +577,9 @@
  };
  const handleReport = () => {
    if (reportSubmitting.value) {
      return;
    }
    reportFormRef.value?.validate(valid => {
      if (!valid) {
        return false;
@@ -642,6 +647,8 @@
        productMainId: reportForm.productMainId,
      };
      reportSubmitting.value = true;
      addProductMain(params)
        .then(res => {
          proxy.$modal.msgSuccess("报工成功");
@@ -652,6 +659,9 @@
          // ElMessageBox.alert("报工失败", "提示", {
          //   confirmButtonText: "确定",
          // });
        })
        .finally(() => {
          reportSubmitting.value = false;
        });
    });
  };
src/views/qualityManagement/finalInspection/components/formDia.vue
@@ -114,7 +114,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>
@@ -134,6 +134,7 @@
const emit = defineEmits(['close'])
const dialogFormVisible = ref(false);
const submitting = ref(false);
const operationType = ref('')
const data = reactive({
  form: {
@@ -343,6 +344,9 @@
}
// 提交产品表单
const submitForm = () => {
  if (submitting.value) {
    return;
  }
  proxy.$refs.formRef.validate(valid => {
    if (valid) {
      form.value.inspectType = 2
@@ -352,15 +356,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;
        })
      }
    }
src/views/qualityManagement/processInspection/components/formDia.vue
@@ -123,7 +123,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>
@@ -146,6 +146,7 @@
const dialogFormVisible = ref(false);
const submitting = ref(false);
const operationType = ref('')
const data = reactive({
  form: {
@@ -373,6 +374,9 @@
// 工序变化处理
// 提交产品表单
const submitForm = () => {
  if (submitting.value) {
    return;
  }
  proxy.$refs.formRef.validate(valid => {
    if (valid) {
      form.value.inspectType = 1
@@ -387,15 +391,20 @@
                process: processName, // 保留 process 字段以兼容后端
                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;
        })
      }
    }
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;
        })
      }
    }