From d8fead89b61acd2b1462559c2fa634b05f73c5d1 Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期一, 09 六月 2025 09:16:04 +0800
Subject: [PATCH] 提交修改新增加工 增加煤质方案和煤质字段模块

---
 src/views/basicInformation/index.vue |  415 ++++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 337 insertions(+), 78 deletions(-)

diff --git a/src/views/basicInformation/index.vue b/src/views/basicInformation/index.vue
index e2007e9..336ae2c 100644
--- a/src/views/basicInformation/index.vue
+++ b/src/views/basicInformation/index.vue
@@ -1,12 +1,13 @@
 <template>
-  <div>
-    <el-form :inline="true" :model="queryParams" class="search-form">
-      <el-form-item label="渚涘簲鍟嗗悕绉�">
-        <el-input v-model="queryParams.searchAll" placeholder="璇疯緭鍏ュ叧閿瘝" clearable />
+  <div> <el-form :inline="true" :model="queryParams" class="search-form">
+      <el-form-item label="鎼滅储" v-if="tabName === 'supplier' || tabName === 'customer'">
+        <el-input v-model="queryParams.searchAll" placeholder="渚涘簲鍟�/璇嗗埆鐮�/璇︾粏鍦板潃" clearable />
       </el-form-item>
-  
+      <el-form-item label="鎼滅储" v-if="tabName === 'coal' || tabName === 'coalQualityMaintenance'">
+        <el-input v-model="queryParams.searchAll" placeholder="璇疯緭鍏ユ悳绱俊鎭�" clearable />
+      </el-form-item>
       <el-form-item>
-        <el-button type="primary" @click="getList">鏌ヨ</el-button>
+        <el-button type="primary" @click="search">鏌ヨ</el-button>
         <el-button @click="resetQuery">閲嶇疆</el-button>
       </el-form-item>
     </el-form>
@@ -15,35 +16,40 @@
       <el-tabs v-model="activeTab" class="info-tabs" @tab-click="handleTabClick">
         <el-tab-pane v-for="tab in tabs" :key="tab.name" :label="tab.label" :name="tab.name" />
       </el-tabs>
-  
+
       <!-- 鎿嶄綔鎸夐挳鍖� -->
       <el-row :gutter="24" class="table-toolbar">
         <el-button type="primary" :icon="Plus" @click="handleAdd">鏂板缓</el-button>
         <el-button type="danger" :icon="Delete" @click="handleDelete">鍒犻櫎</el-button>
-        <el-button type="info" :icon="Download" @click="handleExport">瀵煎嚭</el-button>
+        <el-button type="info" :icon="Download" @click="handleExport" v-show="tabName === 'supplier' || tabName === 'customer'">瀵煎嚭</el-button>
       </el-row>
       <!-- 琛ㄦ牸缁勪欢 -->
       <div>
         <data-table :loading="loading" :table-data="tableData" :columns="columns"
           @selection-change="handleSelectionChange" @edit="handleEdit" :show-selection="true" :border="true" />
-      </div>      <pagination v-if="total>0" :page="pageNum" :limit="pageSizes" :total="total" @pagination="handPagination"
+      </div>
+      <pagination v-if="total > 0" :page="pageNum" :limit="pageSizes" :total="total" @pagination="handPagination"
         :layout="'total, prev, pager, next, jumper'" />
-      <Supplier v-if="tabName === 'supplier'" v-model:supplierDialogFormVisible="dialogFormVisible" :form="form"
-        :title="title" @submit="handleSubmit" @beforeClose="handleBeforeClose"
-        @update:dialogFormVisible="handleDialogFormVisible" :addOrEdit="addOrEdit" />
-      <Customer v-if="tabName === 'customer'" v-model:customerDialogFormVisible="dialogFormVisible" :form="form"
-        :title="title" @submit="handleSubmit" :addOrEdit="addOrEdit" @beforeClose="handleBeforeClose" />
-      <Coal v-if="tabName === 'coal'" v-model:coalDialogFormVisible="dialogFormVisible" :form="form" :title="title"
-        :addOrEdit="addOrEdit" @submit="handleSubmit" />
+      <Supplier v-if="tabName === 'supplier'" v-model:copyForm="copyForm"
+        v-model:supplierDialogFormVisible="dialogFormVisible" :form="form" :title="title" @submit="handleSubmit"
+        @beforeClose="handleBeforeClose" @update:dialogFormVisible="handleDialogFormVisible" :addOrEdit="addOrEdit" />
+      <Customer v-if="tabName === 'customer'" v-model:copyForm="copyForm"
+        v-model:customerDialogFormVisible="dialogFormVisible" :form="form" :title="title" @submit="handleSubmit"
+        :addOrEdit="addOrEdit" @beforeClose="handleBeforeClose" />
+      <Coal v-if="tabName === 'coal'" v-model:copyForm="copyForm" v-model:coalDialogFormVisible="dialogFormVisible"
+        :form="form" :title="title" :addOrEdit="addOrEdit" @submit="handleSubmit" />
       <coalQualityMaintenance v-if="tabName === 'coalQualityMaintenance'"
         v-model:coalQualityMaintenanceDialogFormVisible="dialogFormVisible" :form="form" :title="title"
+        :addOrEdit="addOrEdit" @submit="handleSubmit" />
+      <coalMeiZhiZiDuanWeiHu v-if="tabName === 'coalMeiZhiZiDuanWeiHu'"
+        v-model:coalMaintenanceFieldDialogVisible="dialogFormVisible" :form="form" :title="title"
         :addOrEdit="addOrEdit" @submit="handleSubmit" />
     </el-card>
   </div>
 </template>
 
 <script setup>
-import { ref, reactive, onMounted } from "vue";
+import { ref, reactive, onMounted, computed } from "vue";
 import { ElMessage, ElMessageBox } from "element-plus";
 import { Plus, Edit, Delete, Download } from "@element-plus/icons-vue";
 import DataTable from "@/components/Table/ETable.vue";
@@ -52,11 +58,17 @@
 import Customer from "./mould/customer.vue";
 import Coal from "./mould/coal.vue";
 import coalQualityMaintenance from "./mould/coalQualityMaintenance.vue";
+import coalMeiZhiZiDuanWeiHu from "./mould/coalMeiZhiZiDuanWeiHu.vue";
 const { proxy } = getCurrentInstance()
 import { getSupply, addOrEditSupply, delSupply } from "@/api/basicInformation/supplier.js";
-import { getCoalInfo, addOrEditCoalInfo } from "@/api/basicInformation/coal.js";
-import { getCoalQuality, addOrEditCoalQuality } from "@/api/basicInformation/coalQualityMaintenance.js";
+import { getCoalInfo, delCoalInfo } from "@/api/basicInformation/coal.js";
+import { getCoalQuality, delCoalQuality } from "@/api/basicInformation/coalQualityMaintenance.js";
+import { testUserList } from "@/api/tool/publicInterface.js";
+import { getAreaOptions } from "@/api/system/area.js";
+import { getCustomerList, delCustomer } from "@/api/basicInformation/customer.js";
+
 // 寮圭獥
+const coalMaintenanceFieldDialogVisible = ref(false);
 const coalQualityMaintenanceDialogFormVisible = ref(false);
 const customerDialogFormVisible = ref(false);
 const coalDialogFormVisible = ref(false);
@@ -65,6 +77,12 @@
 const form = ref({});
 const title = ref("");
 const copyForm = ref({});
+// 鐢ㄦ埛鍒楄〃鏁版嵁
+const userList = ref([]);
+// 鐢ㄦ埛鏄犲皠琛紝鐢ㄤ簬蹇�熸煡鎵�
+const userMap = ref({});
+// 鍦板潃鏄犲皠琛紝鐢ㄤ簬蹇�熸煡鎵惧湴鍧�鍚嶇О
+const addressMap = ref({});
 // 褰撳墠鏍囩
 const tabName = ref("supplier");
 // 鐘舵�佸彉閲�
@@ -76,13 +94,68 @@
 const selectedRows = ref([]);
 // 鏌ヨ鍙傛暟
 const queryParams = reactive({
-  searchText: "",
-  supplierName: "",
-  identifyNumber: "",
-  address: "",
 });
-onMounted(() => {
-  handleTabClick({ props: { name: "supplier" } });
+// 鍦板潃閫夋嫨鏁版嵁
+const addressSelectOptions = ref([]);
+const fetchAreaOptions = async () => {
+  addressSelectOptions.value = [];
+  const res = await getAreaOptions();
+  if (res.code === 200) {
+    addressSelectOptions.value = res.data;
+    buildAddressMap(res.data); // 鏋勫缓鍦板潃鏄犲皠琛�
+  }
+}
+
+// 鏋勫缓鍦板潃鏄犲皠琛紝鐢ㄤ簬蹇�熸煡鎵惧湴鍧�鍚嶇О
+const buildAddressMap = (areaData) => {
+  const buildMap = (list, pathList = []) => {
+    list.forEach(item => {
+      const currentPath = [...pathList, item.label];
+      addressMap.value[item.id] = {
+        name: item.label,
+        fullPath: currentPath.join(' / ')
+      };
+      if (item.children && item.children.length > 0) {
+        buildMap(item.children, currentPath);
+      }
+    });
+  };
+  buildMap(areaData);
+};
+
+// 鍦板潃鏍煎紡鍖栧嚱鏁�
+const formatAddressArray = (addressIds) => {
+  // 濡傛灉鍦板潃鏄犲皠琛ㄨ繕娌℃湁鍑嗗濂斤紝鏄剧ず --
+  if (!addressMap.value || Object.keys(addressMap.value).length === 0 || !addressIds || !Array.isArray(addressIds) || addressIds.length === 0 || addressIds.every(id => !id)) {
+    return '--';
+  }
+  const addressNames = addressIds.map(id => {
+    return addressMap.value[id]?.name || '--';
+  });
+  // 濡傛灉鎵�鏈夊湴鍧�鍚嶇О閮芥槸 '--'锛屽垯杩斿洖 '--'
+  if (addressNames.every(name => name === '--')) {
+    return '--';
+  }
+  return addressNames.filter(name => name !== '--').join(' / ');
+};
+// 鑾峰彇鐢ㄦ埛鍒楄〃鏁版嵁
+const getUserList = async () => {
+  try {
+    const res = await testUserList();
+    if (res && res.data) {
+      userList.value = res.data;
+      userList.value.forEach(user => {
+        userMap.value[user.userId] = user.username;
+      });
+    }
+  } catch (error) {
+    console.error('鑾峰彇鐢ㄦ埛鍒楄〃澶辫触:', error);
+  }
+};
+onMounted(async () => {
+  await handleTabClick({ props: { name: "supplier" } });
+  await fetchAreaOptions(); // 鍏堣幏鍙栧湴鍧�閫夋嫨鏁版嵁骞舵瀯寤烘槧灏勮〃
+  await getUserList(); // 鑾峰彇鐢ㄦ埛鍒楄〃
 });
 const columns = ref();
 // 鏍囩椤垫暟鎹�
@@ -90,58 +163,150 @@
   { name: "supplier", label: "渚涘簲鍟嗕俊鎭�" },
   { name: "customer", label: "瀹㈡埛淇℃伅" },
   { name: "coal", label: "鐓ょ淇℃伅" },
-  { name: "coalQualityMaintenance", label: "鐓よ川缁存姢" },
+  { name: "coalQualityMaintenance", label: "鐓よ川鏂规" },
+  { name: "coalMeiZhiZiDuanWeiHu", label: "鐓よ川瀛楁" }
 ]);
 // 鏄惁缂栬緫
 const addOrEdit = ref("add");
 // 琛ㄦ牸鏁版嵁
 const tableData = ref([]);
-// 鏌ヨ鏂规硶
-const handleQuery = () => {
-
-};
 // supplier 渚涘簲鍟嗘暟鎹�
 const supplierColumns = ref([
-  { prop: "supplierName", label: "渚涘簲鍟嗗悕绉�", minWidth: 200 },
-  { prop: "taxpayerId", label: "缁熶竴浜鸿瘑鍒彿", minWidth: 120 },
-  { prop: "businessAddress", label: "缁忚惀鍦板潃", minWidth: 150 },
-  { prop: "bids", label: "璇︾粏鍦板潃", minWidth: 150 },
+  { prop: "supplierName", label: "渚涘簲鍟嗗悕绉�", minWidth: 100 },
+  { prop: "taxpayerId", label: "缁熶竴浜鸿瘑鍒彿", minWidth: 170 }, {
+    prop: "bids",
+    label: "缁忚惀鍦板潃",
+    minWidth: 150,
+    showOverflowTooltip: true,
+    formatter: (row, column, cellValue) => {
+      let arr = [
+        row.bprovinceId,
+        row.bcityId,
+        row.bdistrictId,
+      ]
+      return formatAddressArray(arr);
+    }
+  },
+  { prop: "businessAddress", label: "缁忚惀璇︾粏鍦板潃", minWidth: 150 },
   { prop: "bankAccount", label: "寮�鎴疯", minWidth: 120 },
   { prop: "bankName", label: "閾惰璐﹀彿", minWidth: 150 },
   { prop: "contactPerson", label: "鑱旂郴浜�", minWidth: 100 },
-  { prop: "contactAddress", label: "鑱旂郴鍦板潃", minWidth: 150 },
-  { prop: "maintainer", label: "缁存姢浜�", minWidth: 100 },
-  { prop: "createTime", label: "缁存姢鏃ユ湡", minWidth: 100 },
+  {
+    prop: "cids",
+    label: "鑱旂郴浜哄湴鍧�",
+    minWidth: 150,
+    showOverflowTooltip: true,
+    formatter: (row, column, cellValue) => {
+      let arr = [
+        row.cprovinceId,
+        row.ccityId,
+        row.cdistrictId,
+      ]
+      return formatAddressArray(arr);
+    }
+  }, { prop: "contactAddress", label: "鑱旂郴浜鸿缁嗗湴鍧�", minWidth: 120 },
+  // { 
+  //   prop: "maintainerId", 
+  //   label: "缁存姢浜�", 
+  //   minWidth: 80,
+  //   formatter: (row, column, cellValue) => {
+  //     // 濡傛灉鐢ㄦ埛鏄犲皠琛ㄨ繕娌℃湁鍑嗗濂斤紝鏄剧ず --
+  //     if (!userMap.value || Object.keys(userMap.value).length === 0) {
+  //       return '--';
+  //     }
+  //     // 濡傛灉鍊间负绌烘垨null锛屾樉绀� --
+  //     if (cellValue === null || cellValue === undefined || cellValue === '') {
+  //       return '--';
+  //     }
+  //     // 濡傛灉鐢ㄦ埛鏄犲皠琛ㄤ腑鏈夊搴旂殑鐢ㄦ埛鍚嶏紝杩斿洖鐢ㄦ埛鍚�
+  //     if (userMap.value[cellValue]) {
+  //       return userMap.value[cellValue];
+  //     }
+  //     // 濡傛灉娌℃湁鍖归厤鐨勭敤鎴凤紝鏄剧ず --
+  //     return '--';
+  //   }
+  // },
+  { prop: "createTime", label: "缁存姢鏃ユ湡", minWidth: 120 },
 ]);
 // customer 瀹㈡埛鏁版嵁
 const customerColumns = ref([
-  { prop: "customerName", label: "瀹㈡埛鍚嶇О", minWidth: 200 },
-  { prop: "identifyNumber", label: "缁熶竴浜鸿瘑鍒彿", minWidth: 120 },
-  { prop: "address", label: "缁忚惀鍦板潃", minWidth: 150 },
-  { prop: "detailedaddress", label: "璇︾粏鍦板潃", minWidth: 150 },
-  { prop: "bank", label: "寮�鎴疯", minWidth: 120 },
+  { prop: "customerName", label: "瀹㈡埛鍚嶇О", minWidth: 100 },
+  { prop: "taxpayerId", label: "缁熶竴浜鸿瘑鍒彿", minWidth: 120 },
+  {
+    prop: "bids",
+    label: "缁忚惀鍦板潃",
+    minWidth: 150,
+    showOverflowTooltip: true,
+    formatter: (row, column, cellValue) => {
+      let arr = [
+        row.businessProvinceId,
+        row.businessCityId,
+        row.businessDistrictId,
+      ]
+      return formatAddressArray(arr);
+    }
+  },
+  { prop: "businessAddress", label: "璇︾粏鍦板潃", minWidth: 150 },
+  { prop: "bankName", label: "寮�鎴疯", minWidth: 120 },
   { prop: "bankAccount", label: "閾惰璐﹀彿", minWidth: 150 },
-  { prop: "contacts", label: "鑱旂郴浜�", minWidth: 100 },
-  { prop: "contactAddress", label: "鑱旂郴鍦板潃", minWidth: 150 },
-  { prop: "maintainer", label: "缁存姢浜�", minWidth: 100 },
-  { prop: "maintainDate", label: "缁存姢鏃ユ湡", minWidth: 100 },
+  { prop: "contactPerson", label: "鑱旂郴浜�", minWidth: 100 },
+  { prop: "contactPhone", label: "鑱旂郴浜虹數璇�", minWidth: 100 },
+  {
+    prop: "cids",
+    label: "鑱旂郴浜哄湴鍧�",
+    minWidth: 150,
+    showOverflowTooltip: true,
+    formatter: (row, column, cellValue) => {
+      let arr = [
+        row.provinceId,
+        row.cityId,
+        row.districtId,
+      ]
+      return formatAddressArray(arr);
+    }
+  },
+  { prop: "contactAddress", label: "鑱旂郴浜鸿缁嗗湴鍧�", minWidth: 150 },
+  { prop: "updateTime", label: "缁存姢鏃ユ湡", minWidth: 100 },
 ]);
 // coal 鐓ょ鏁版嵁
 const coalColumns = ref([
-  { prop: "coalName", label: "鐓ょ鍚嶇О", minWidth: 200 },
-  { prop: "maintainerId", label: "缁存姢浜�", minWidth: 120 },
+  { prop: "coal", label: "鐓ょ鍚嶇О", minWidth: 200 }, {
+    prop: "maintainerId",
+    label: "缁存姢浜�",
+    minWidth: 120,
+    formatter: (row, column, cellValue) => {
+      // 濡傛灉鐢ㄦ埛鏄犲皠琛ㄨ繕娌℃湁鍑嗗濂斤紝鏄剧ず --
+      if (!userMap.value || Object.keys(userMap.value).length === 0) {
+        return '--';
+      }
+      // 濡傛灉鍊间负绌烘垨null锛屾樉绀� --
+      if (cellValue === null || cellValue === undefined || cellValue === '') {
+        return '--';
+      }
+      // 濡傛灉鐢ㄦ埛鏄犲皠琛ㄤ腑鏈夊搴旂殑鐢ㄦ埛鍚嶏紝杩斿洖鐢ㄦ埛鍚�
+      if (userMap.value[cellValue]) {
+        return userMap.value[cellValue];
+      }
+      // 濡傛灉娌℃湁鍖归厤鐨勭敤鎴凤紝鏄剧ず --
+      return '--';
+    }
+  },
   { prop: "maintenanceDate", label: "缁存姢鏃ユ湡", minWidth: 150 },
 ]);
 // coalQualityMaintenance 鐓よ川缁存姢鏁版嵁
 const coalQualityMaintenanceColumns = ref([
-  { prop: "supplierName", label: "鍏ㄦ按(<)", minWidth: 200 },
-  { prop: "identifyNumber", label: "姘村垎鏋�(<)", minWidth: 120 },
-  { prop: "address", label: "鐏板垎", minWidth: 150 },
-  { prop: "bank", label: "鎸ュ彂(>)", minWidth: 100 },
-  { prop: "bankAccount", label: "纭�(<)", minWidth: 100 },
-  { prop: "contacts", label: "鍥哄畾纰�", minWidth: 100 },
+  { prop: "coal", label: "鐓ょ鍚嶇О", minWidth: 200 },
+  { prop: "totalMoisture", label: "鍏ㄦ按鍚噺鐧惧垎姣� (%)", minWidth: 200 },
+  { prop: "analysisMoisture", label: "鍒嗘瀽姘村惈閲忕櫨鍒嗘瘮 (%)", minWidth: 200 },
+  { prop: "volatileMatter", label: "鎸ュ彂鍒嗙櫨鍒嗘瘮 (%)", minWidth: 100 },
+  { prop: "sulfurContent", label: "纭惈閲忕櫨鍒嗘瘮 (%)", minWidth: 100 },
+  { prop: "contacts", label: "鍥哄畾纰崇櫨鍒嗘瘮 (%)", minWidth: 100 },
   { prop: "contactAddress", label: "楂樹綅鍙戠儹閲�", minWidth: 100 },
   { prop: "maintainer", label: "浣庝綅鍙戠儹閲�", minWidth: 100 },
+]);
+const coalMeiZhiZiDuanWeiHuColumns = ref([
+  { prop: "fieldName", label: "瀛楁鍚嶇О", minWidth: 200 },
+  { prop: "fieldDescription", label: "瀛楁鎻忚堪", minWidth: 200 },
 ]);
 // 鏍囩椤电偣鍑�
 const handleTabClick = (tab) => {
@@ -160,7 +325,6 @@
       columns.value = customerColumns.value;
       dialogFormVisible.value = customerDialogFormVisible.value;
       getList("customer");
-
       break;
     case "coal":
       columns.value = coalColumns.value;
@@ -172,6 +336,11 @@
       dialogFormVisible.value = coalQualityMaintenanceDialogFormVisible.value;
       getList("coalQualityMaintenance");
       break;
+    case "coalMeiZhiZiDuanWeiHu":
+      columns.value = coalMeiZhiZiDuanWeiHuColumns.value;
+      dialogFormVisible.value = coalMaintenanceFieldDialogVisible.value;
+      getList("coalMeiZhiZiDuanWeiHu");
+      break;
   }
 };
 // 閲嶇疆鏌ヨ
@@ -181,6 +350,7 @@
       queryParams[key] = "";
     }
   });
+  getList()
 };
 // 鏂板
 const handleAdd = () => {
@@ -204,7 +374,11 @@
     openDialog();
   } else if (tabName === "coalQualityMaintenance") {
     dialogFormVisible.value = true;
-    title.value = title.value + "鐓よ川缁存姢";
+    title.value = title.value + "鐓よ川鏂规缁存姢";
+    openDialog();
+  } else if (tabName === "coalMeiZhiZiDuanWeiHu") {
+    dialogFormVisible.value = true;
+    title.value = title.value + "鐓よ川瀛楁缁存姢";
     openDialog();
   }
 };
@@ -220,20 +394,19 @@
 };
 // 鍒嗛〉
 const handPagination = (val) => {
-  console.log("鍒嗛〉鍙傛暟锛�", val);
   pageNum.value = val.page;
   pageSizes.value = val.limit;
   getList();
 };
 // 鎻愪氦琛ㄥ崟
 const handleSubmit = async (val) => {
-  console.log(val)
-  if (val.code !== 200) {
-    ElMessage.error("鎿嶄綔澶辫触锛�" + result.msg);
+  if (val.result.code !== 200) {
+    ElMessage.error("鎿嶄綔澶辫触锛�" + val.result.msg);
     return;
   }
-  ElMessage.success("鏂板鎴愬姛锛�" + result.msg);
+  ElMessage.success(val.title + val.result.msg);
   dialogFormVisible.value = false;
+  getList();
 };
 const handleDialogFormVisible = (value) => {
   dialogFormVisible.value = value;
@@ -245,6 +418,34 @@
 // 缂栬緫
 const handleEdit = (row) => {
   form.value = JSON.parse(JSON.stringify(row));
+  if (form.value.bprovinceId && form.value.bdistrictId && form.value.bcityId) {
+    form.value.bids = [
+      row.bprovinceId,
+      row.bcityId,
+      row.bdistrictId,
+    ];
+  }
+  if (form.value.cprovinceId && form.value.cdistrictId && form.value.ccityId) {
+    form.value.cids = [
+      row.cprovinceId,
+      row.ccityId,
+      row.cdistrictId,
+    ];
+  }
+  if (form.value.businessCityId && form.value.businessDistrictId && form.value.businessProvinceId) {
+    form.value.bids = [
+      row.businessProvinceId,
+      row.businessCityId,
+      row.businessDistrictId,
+    ];
+  }
+  if (form.value.cityId && form.value.districtId && form.value.provinceId) {
+    form.value.cids = [
+      row.provinceId,
+      row.cityId,
+      row.districtId,
+    ];
+  }
   addOrEdit.value = "edit";
   handleAddEdit(tabName.value);
 };
@@ -258,7 +459,6 @@
   selectedRows.value.forEach(element => {
     return arr.push(element.id);
   });
-  console.log("閫変腑鐨勬暟鎹甀D锛�", arr);
   ElMessageBox.confirm("纭畾鍒犻櫎閫変腑鐨勬暟鎹悧锛�", "鎻愮ず", {
     confirmButtonText: "纭畾",
     cancelButtonText: "鍙栨秷",
@@ -266,13 +466,27 @@
   })
     .then(async () => {
       try {
-        let res = await delSupply(arr)
-        console.log(res)
-        selectedRows.value = [];
-        getlist()
-      } catch {
+        let res;
+        if (tabName.value === "supplier") {
+          res = await delSupply(arr);
+        } else if (tabName.value === "coal") {
+          res = await delCoalInfo(arr);
+        } else if (tabName.value === "coalQualityMaintenance") {
+          res = await delCoalQuality(arr);
+        } else if (tabName.value === "customer") {
+          res = await delCustomer(arr);
+        }
+        if (res.code !== 200 && res.meg == "鎿嶄綔鎴愬姛") {
+          ElMessage.error("鍒犻櫎澶辫触锛�" + res.msg);
+          return;
+        }
+        ElMessage.success("鍒犻櫎鎴愬姛");
+        await getList();
+      } catch (e) {
+        console.error(e);
         ElMessage.error("鍒犻櫎澶辫触锛岃绋嶅悗鍐嶈瘯");
-        return;
+      } finally {
+        selectedRows.value = [];
       }
     }).catch(() => {
       ElMessage.info("宸插彇娑堝垹闄ゆ搷浣�");
@@ -283,11 +497,23 @@
   dialogFormVisible.value = false;
   form.value = {};
 };
-const handleExport = (row) => {
-  proxy.download("system/post/export", {
+const handleExport = () => {
+  if (tabName.value === "supplier") {
+    Export("/supply/export", "渚涘簲鍟嗕俊鎭�");
+  } else if (tabName.value === "customer") {
+    Export("/customer/export", "瀹㈡埛淇℃伅");
+  } else if (tabName.value === "coal") {
+    Export("/supply/export", "鐓ょ淇℃伅");
+  } else if (tabName.value === "coalQualityMaintenance") {
+    Export("/supply/export", "鐓よ川缁存姢淇℃伅");
+
+  }
+}
+const Export = (api, name) => {
+  proxy.download(api, {
     ...queryParams.value
-  }, `post_${new Date().getTime()}.xlsx`)
-  ElMessage.success("瀵煎嚭鏁版嵁锛�" + row.supplierName);
+  }, `${name}${new Date().getTime()}.xlsx`)
+  ElMessage.success("瀵煎嚭鏁版嵁锛�" + name);
 };
 // 閫夋嫨鎺ュ彛
 const selectInterface = () => {
@@ -298,26 +524,59 @@
       searchAll: queryParams.searchAll,
     });
   } else if (tabName.value === "customer") {
-    return getSupply({
+    return getCustomerList({
       current: pageNum.value,
       pageSize: pageSizes.value,
-      ...queryParams
+      searchAll: queryParams.searchAll,
     });
   } else if (tabName.value === "coal") {
-    console.log(addOrEdit.value)
-    return getCoalInfo();
+    return getCoalInfo({
+      current: pageNum.value,
+      pageSize: pageSizes.value,
+      searchAll: queryParams.searchAll,
+    });
   } else if (tabName.value === "coalQualityMaintenance") {
     return getCoalQuality({
       current: pageNum.value,
       pageSize: pageSizes.value,
-      ...queryParams
+      searchAll: queryParams.searchAll,
     });
+  } else if (tabName.value === "coalMeiZhiZiDuanWeiHu") {
+    return {
+      code: 200,
+          data: {
+          records: [
+            { fieldName: "瀛楁1", fieldDescription: "鎻忚堪1" },
+            { fieldName: "瀛楁2", fieldDescription: "鎻忚堪2" },
+            { fieldName: "瀛楁3", fieldDescription: "鎻忚堪3" }
+          ],
+            total: 10
+        }
+    };
+    // return getCoalQuality({
+    //   current: pageNum.value,
+    //   pageSize: pageSizes.value,
+    //   searchAll: queryParams.searchAll,
+    // });
   }
 }
+const search = () => {
+  pageNum.value = 1; // 閲嶇疆椤电爜
+  getList();
+};
+// 鑾峰彇鍒楄〃鏁版嵁
 const getList = async () => {
   loading.value = true;
+  /* if (Object.keys(addressMap.value).length === 0) {
+    await fetchAreaOptions();
+  } */
   let { data, code } = await selectInterface()
-  console.log(data)
+  console.log("鑾峰彇鏁版嵁锛�", code, data);
+  if (code !== 200) {
+    ElMessage.error("鑾峰彇鏁版嵁澶辫触锛�" + data.msg);
+    loading.value = false;
+    return;
+  }
   tableData.value = data.records;
   total.value = data.total;
   loading.value = false;

--
Gitblit v1.9.3