yuan
昨天 dc45a16c5779e249f45ff644a8c57c9c985c2c4f
检测页面加loading
已修改2个文件
31 ■■■■ 文件已修改
src/components/PIMTable/PIMTable.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/rawMaterialInspection/index.vue 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/PIMTable/PIMTable.vue
@@ -120,6 +120,7 @@
            <el-button v-show="o.type != 'upload'"
                       v-if="o.showHide ? o.showHide(scope.row) : true"
                       :disabled="isOperationDisabled(o, scope.row)"
                       :loading="isOperationLoading(o, scope.row)"
                       :plain="o.plain"
                       type="primary"
                       :style="{
@@ -373,6 +374,13 @@
      : !!operation.disabled;
  };
  const isOperationLoading = (operation, row) => {
    if (!operation?.loading) return false;
    return typeof operation.loading === "function"
      ? !!operation.loading(row)
      : !!operation.loading;
  };
  const parseHexToRgb = hex => {
    const normalized = String(hex || "")
      .trim()
src/views/qualityManagement/rawMaterialInspection/index.vue
@@ -227,6 +227,7 @@
        clickFun: (row) => {
          submit(row.id);
        },
        loading: (row) => submitLoadingId.value === row.id,
                disabled: (row) => {
                    // 已提交则禁用
                    if (row.inspectState == 1) return true;
@@ -257,6 +258,7 @@
        clickFun: (row) => {
          downLoadFile(row);
        },
        loading: (row) => downloadLoadingId.value === row.id,
      },
    ],
  },
@@ -264,6 +266,8 @@
const tableData = ref([]);
const selectedRows = ref([]);
const tableLoading = ref(false);
const submitLoadingId = ref(null);
const downloadLoadingId = ref(null);
const userList = ref([]);
const dialogFormVisible = ref(false);
const form = ref({
@@ -369,12 +373,17 @@
      });
};
// 提价
// 提交
const submit = async (id) => {
  const res = await submitQualityInspect({id: id})
  submitLoadingId.value = id;
  try {
    const res = await submitQualityInspect({ id });
  if (res.code === 200) {
    proxy.$modal.msgSuccess("提交成功");
    getList();
    }
  } finally {
    submitLoadingId.value = null;
  }
}
@@ -405,8 +414,10 @@
  dialogFormVisible.value = true
}
const downLoadFile = (row) => {
  downloadQualityInspect({ id: row.id }).then((blobData) => {
const downLoadFile = async (row) => {
  downloadLoadingId.value = row.id;
  try {
    const blobData = await downloadQualityInspect({ id: row.id });
    const blob = new Blob([blobData], {
      type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
    })
@@ -420,7 +431,9 @@
    document.body.removeChild(link)
    window.URL.revokeObjectURL(downloadUrl)
  })
  } finally {
    downloadLoadingId.value = null;
  }
};
onMounted(() => {