From 807df6dedd5078e0dd9f6515a8e1ea93e19a6f52 Mon Sep 17 00:00:00 2001 From: zhang_12370 <z2864490065@outlook.com> Date: 星期三, 25 六月 2025 15:21:51 +0800 Subject: [PATCH] 文档管理 树形菜单 新增修改优化 生产加工模块的 数据tags 显示 生产人的匹配 --- src/views/basicInformation/index.vue | 391 ++++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 266 insertions(+), 125 deletions(-) diff --git a/src/views/basicInformation/index.vue b/src/views/basicInformation/index.vue index f399bc0..4f47266 100644 --- a/src/views/basicInformation/index.vue +++ b/src/views/basicInformation/index.vue @@ -1,7 +1,12 @@ <template> - <div> <el-form :inline="true" :model="queryParams" class="search-form"> - <el-form-item label="鎼滅储" v-if="shouldShowSearch"> - <el-input v-model="queryParams.searchAll" :placeholder="searchPlaceholder" clearable /> + <div class="app-container"> + <el-form :inline="true" :model="queryParams" class="search-form"> + <el-form-item v-if="shouldShowSearch" label="鎼滅储"> + <el-input + v-model="queryParams.searchAll" + :placeholder="searchPlaceholder" + clearable + /> </el-form-item> <el-form-item> <el-button type="primary" @click="search">鏌ヨ</el-button> @@ -10,59 +15,152 @@ </el-form> <el-card> <!-- 鏍囩椤� --> - <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 + 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" v-show="canExport">瀵煎嚭</el-button> - </el-row> <!-- 琛ㄦ牸缁勪欢 --> + <el-button :icon="Plus" type="primary" @click="handleAdd" + >鏂板缓</el-button + > + <el-button :icon="Delete" type="danger" @click="handleDelete" + >鍒犻櫎</el-button + > + <el-button + v-show="canExport" + :icon="Download" + type="info" + @click="handleExport" + >瀵煎嚭</el-button + > + </el-row> + <!-- 琛ㄦ牸缁勪欢 --> <div> - <data-table :loading="loading" :table-data="tableData" :columns="columns" - @selection-change="handleSelectionChange" @edit="handleEdit" :show-selection="true" :border="true"> <!-- 瀛楁鍚嶇О鍒楃殑鑷畾涔夋彃妲� - 鏄剧ず涓烘爣绛� --> - <template v-if="tabName === 'coalQualityMaintenance'" #fieldIds="{ row }"> - <template v-if="typeof row.fieldIds === 'string' && row.fieldIds.includes(',')"> - <el-tag v-for="(field, index) in row.fieldIds.split(',')" :key="index" type="primary" size="small" - style="margin-right: 4px; margin-bottom: 2px;"> + <data-table + :border="true" + :columns="columns" + :loading="loading" + style="width: 100%; height: calc(100vh - 29em)" + :show-selection="true" + :table-data="tableData" + @edit="handleEdit" + @viewRow="handleView" + @selection-change="handleSelectionChange" + :showOperations="true" + :showIndex="true" + :showPagination="false" + :operations="['edit', 'viewRow']" + :operationsWidth="200" + > + <!-- 瀛楁鍚嶇О鍒楃殑鑷畾涔夋彃妲� - 鏄剧ず涓烘爣绛� --> + <template + v-if="tabName === 'coalQualityMaintenance'" + #fieldIds="{ row }" + > + <template + v-if=" + typeof row.fieldIds === 'string' && row.fieldIds.includes(',') + " + > + <el-tag + v-for="(field, index) in row.fieldIds.split(',')" + :key="index" + size="small" + style="margin-right: 4px; margin-bottom: 2px" + type="primary" + > {{ getFieldDisplayName(field.trim()) }} </el-tag> </template> <template v-else> - <el-tag type="primary" size="small"> - {{ getFieldDisplayName(row.fieldIds) || '--' }} + <el-tag size="small" type="primary"> + {{ getFieldDisplayName(row.fieldIds) || "--" }} </el-tag> </template> </template> </data-table> </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: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:copyForm="copyForm" - v-model:coalQualityMaintenanceDialogFormVisible="dialogFormVisible" :form="form" :title="title" - :addOrEdit="addOrEdit" @submit="handleSubmit" /> - <coalMeiZhiZiDuanWeiHu v-if="tabName === 'coalMeiZhiZiDuanWeiHu'" v-model:copyForm="copyForm" - v-model:coalMaintenanceFieldDialogVisible="dialogFormVisible" :form="form" :title="title" :addOrEdit="addOrEdit" - @submit="handleSubmit" /> + <pagination + v-if="total > 0" + :layout="'total, prev, pager, next, jumper'" + :limit="pageSizes" + :page="pageNum" + :total="total" + @pagination="handPagination" + /> + <Supplier + v-if="tabName === 'supplier'" + v-model:copyForm="copyForm" + v-model:supplierDialogFormVisible="dialogFormVisible" + :addOrEdit="addOrEdit" + :form="form" + :title="title" + @beforeClose="handleBeforeClose" + @submit="handleSubmit" + @update:dialogFormVisible="handleDialogFormVisible" + /> + <Customer + v-if="tabName === 'customer'" + v-model:copyForm="copyForm" + v-model:customerDialogFormVisible="dialogFormVisible" + :addOrEdit="addOrEdit" + :form="form" + :title="title" + @beforeClose="handleBeforeClose" + @submit="handleSubmit" + /> + <Coal + v-if="tabName === 'coal'" + v-model:coalDialogFormVisible="dialogFormVisible" + v-model:copyForm="copyForm" + :addOrEdit="addOrEdit" + :form="form" + :title="title" + @submit="handleSubmit" + /> + <coalQualityMaintenance + v-if="tabName === 'coalQualityMaintenance'" + v-model:coalQualityMaintenanceDialogFormVisible="dialogFormVisible" + v-model:copyForm="copyForm" + :addOrEdit="addOrEdit" + :form="form" + :title="title" + @submit="handleSubmit" + /> + <coalMeiZhiZiDuanWeiHu + v-if="tabName === 'coalMeiZhiZiDuanWeiHu'" + v-model:coalMaintenanceFieldDialogVisible="dialogFormVisible" + v-model:copyForm="copyForm" + :addOrEdit="addOrEdit" + :form="form" + :title="title" + @submit="handleSubmit" + /> </el-card> </div> </template> <script setup> -// ===== 鏍稿績渚濊禆瀵煎叆 ===== -import { ref, reactive, onMounted, computed, getCurrentInstance } from "vue"; +import { + computed, + getCurrentInstance, + onMounted, + reactive, + ref, + nextTick, +} from "vue"; import { ElMessage, ElMessageBox } from "element-plus"; -import { Plus, Edit, Delete, Download } from "@element-plus/icons-vue"; +import { Delete, Download, Plus } from "@element-plus/icons-vue"; // ===== 缁勪欢瀵煎叆 ===== import DataTable from "@/components/Table/ETable.vue"; @@ -72,21 +170,34 @@ import Coal from "./mould/coal.vue"; import coalQualityMaintenance from "./mould/coalQualityMaintenance.vue"; import coalMeiZhiZiDuanWeiHu from "./mould/coalMeiZhiZiDuanWeiHu.vue"; +import Descriptions from "@/components/dialog/Descriptions.vue"; // ===== API 鏈嶅姟瀵煎叆 ===== -import { getSupply, delSupply } from "@/api/basicInformation/supplier.js"; -import { getCoalInfo, delCoalInfo } from "@/api/basicInformation/coal.js"; +import { delSupply, getSupply } from "@/api/basicInformation/supplier.js"; +import { delCoalInfo, getCoalInfo } from "@/api/basicInformation/coal.js"; import { testUserList } from "@/api/tool/publicInterface.js"; import { getAreaOptions } from "@/api/system/area.js"; -import { getCustomerList, delCustomer } from "@/api/basicInformation/customer.js"; -import { coalField, deleteCoalField } from "@/api/basicInformation/coalFieldMaintenance.js"; -import { getCoalFieldList, getCoalPlanList } from "@/api/basicInformation/coalQualityMaintenance"; +import { + delCustomer, + getCustomerList, +} from "@/api/basicInformation/customer.js"; +import { + coalField, + deleteCoalField, +} from "@/api/basicInformation/coalFieldMaintenance.js"; +import { + getCoalFieldList, + getCoalPlanList, +} from "@/api/basicInformation/coalQualityMaintenance"; const { proxy } = getCurrentInstance(); // ===== 鍝嶅簲寮忕姸鎬佺鐞� ===== - // 寮圭獥鎺у埗鐘舵�� +const showDialog = ref(false); +const currentViewData = ref({}); // 褰撳墠鏌ョ湅鐨勬暟鎹� + + const dialogFormVisible = ref(false); const form = ref({}); const title = ref(""); @@ -128,7 +239,7 @@ { name: "customer", label: "瀹㈡埛淇℃伅" }, { name: "coal", label: "鐓ょ淇℃伅" }, { name: "coalQualityMaintenance", label: "鐓よ川鏂规" }, - { name: "coalMeiZhiZiDuanWeiHu", label: "鐓よ川瀛楁" } + { name: "coalMeiZhiZiDuanWeiHu", label: "鐓よ川瀛楁" }, ]); // ===== 宸ュ叿鍑芥暟 ===== @@ -146,7 +257,7 @@ buildAddressMap(res.data); } } catch (error) { - console.error('鑾峰彇鍦板潃閫夐」澶辫触:', error); + console.error("鑾峰彇鍦板潃閫夐」澶辫触:", error); } }; @@ -157,11 +268,11 @@ */ const buildAddressMap = (areaData) => { const buildMap = (list, pathList = []) => { - list.forEach(item => { + list.forEach((item) => { const currentPath = [...pathList, item.label]; addressMap.value[item.id] = { name: item.label, - fullPath: currentPath.join(' / ') + fullPath: currentPath.join(" / "), }; if (item.children && item.children.length > 0) { buildMap(item.children, currentPath); @@ -178,19 +289,26 @@ * @description 灏嗗湴鍧�ID鏁扮粍杞崲涓哄彲璇荤殑鍦板潃瀛楃涓� */ const formatAddressArray = (addressIds) => { - if (!addressMap.value || Object.keys(addressMap.value).length === 0 || - !addressIds || !Array.isArray(addressIds) || addressIds.length === 0 || - addressIds.every(id => !id)) { - return '--'; + 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 => addressMap.value[id]?.name || '--'); - - if (addressNames.every(name => name === '--')) { - return '--'; + + const addressNames = addressIds.map( + (id) => addressMap.value[id]?.name || "--" + ); + + if (addressNames.every((name) => name === "--")) { + return "--"; } - - return addressNames.filter(name => name !== '--').join(' / '); + + return addressNames.filter((name) => name !== "--").join(" / "); }; /** @@ -202,12 +320,12 @@ const res = await testUserList(); if (res && res.data) { userList.value = res.data; - userList.value.forEach(user => { + userList.value.forEach((user) => { userMap.value[user.userId] = user.username; }); } } catch (error) { - console.error('鑾峰彇鐢ㄦ埛鍒楄〃澶辫触:', error); + console.error("鑾峰彇鐢ㄦ埛鍒楄〃澶辫触:", error); } }; @@ -222,7 +340,7 @@ coalFieldList.value = data; } } catch (error) { - console.error('鑾峰彇鐓よ川瀛楁鏁版嵁澶辫触:', error); + console.error("鑾峰彇鐓よ川瀛楁鏁版嵁澶辫触:", error); } }; @@ -233,21 +351,19 @@ * @description 閫氳繃瀛楁ID鍖归厤瀵瑰簲鐨勫瓧娈靛悕绉� */ const getFieldDisplayName = (fieldId) => { - if (!fieldId) return '--'; - + if (!fieldId) return "--"; + const numId = parseInt(fieldId); - const matchedField = coalFieldList.value.find(item => item.id === numId); - + const matchedField = coalFieldList.value.find((item) => item.id === numId); + return matchedField ? matchedField.fieldName : numId; }; - -// ===== 璁$畻灞炴�� ===== /** * 褰撳墠鏍囩椤垫槸鍚︽敮鎸佸鍑哄姛鑳� */ const canExport = computed(() => { - return ['supplier', 'customer'].includes(tabName.value); + return ["supplier", "customer"].includes(tabName.value); }); /** @@ -256,10 +372,10 @@ const searchPlaceholder = computed(() => { const placeholderMap = { supplier: "渚涘簲鍟�/璇嗗埆鐮�/璇︾粏鍦板潃", - customer: "渚涘簲鍟�/璇嗗埆鐮�/璇︾粏鍦板潃", + customer: "渚涘簲鍟�/璇嗗埆鐮�/璇︾粏鍦板潃", coal: "璇疯緭鍏ユ悳绱俊鎭�", coalQualityMaintenance: "璇疯緭鍏ユ悳绱俊鎭�", - coalMeiZhiZiDuanWeiHu: "璇疯緭鍏ユ悳绱俊鎭�" + coalMeiZhiZiDuanWeiHu: "璇疯緭鍏ユ悳绱俊鎭�", }; return placeholderMap[tabName.value] || "璇疯緭鍏ユ悳绱俊鎭�"; }); @@ -268,18 +384,19 @@ * 鏄惁鏄剧ず鎼滅储妗� */ const shouldShowSearch = computed(() => { - return ['supplier', 'customer', 'coal', 'coalQualityMaintenance','coalMeiZhiZiDuanWeiHu'].includes(tabName.value); + return [ + "supplier", + "customer", + "coal", + "coalQualityMaintenance", + "coalMeiZhiZiDuanWeiHu", + ].includes(tabName.value); }); /** * 褰撳墠閫変腑琛屾暟閲� */ const selectedCount = computed(() => selectedRows.value.length); - -/** - * 鏄惁鏈夐�変腑鐨勮 - */ -const hasSelectedRows = computed(() => selectedCount.value > 0); // ===== 琛ㄦ牸鍒楅厤缃� ===== @@ -297,11 +414,10 @@ formatter: (row) => { const addressIds = [row.bprovinceId, row.bcityId, row.bdistrictId]; return formatAddressArray(addressIds); - } + }, }, { prop: "businessAddress", label: "缁忚惀璇︾粏鍦板潃", minWidth: 150 }, { prop: "bankAccount", label: "寮�鎴疯", minWidth: 120 }, - { prop: "bankName", label: "閾惰璐﹀彿", minWidth: 150 }, { prop: "contactPerson", label: "鑱旂郴浜�", minWidth: 100 }, { prop: "cids", @@ -311,10 +427,9 @@ formatter: (row) => { const addressIds = [row.cprovinceId, row.ccityId, row.cdistrictId]; return formatAddressArray(addressIds); - } + }, }, { prop: "contactAddress", label: "鑱旂郴浜鸿缁嗗湴鍧�", minWidth: 120 }, - { prop: "createTime", label: "缁存姢鏃ユ湡", minWidth: 120 }, ]); /** @@ -329,9 +444,13 @@ minWidth: 150, showOverflowTooltip: true, formatter: (row) => { - const addressIds = [row.businessProvinceId, row.businessCityId, row.businessDistrictId]; + const addressIds = [ + row.businessProvinceId, + row.businessCityId, + row.businessDistrictId, + ]; return formatAddressArray(addressIds); - } + }, }, { prop: "businessAddress", label: "璇︾粏鍦板潃", minWidth: 150 }, { prop: "bankName", label: "寮�鎴疯", minWidth: 120 }, @@ -346,7 +465,7 @@ formatter: (row) => { const addressIds = [row.provinceId, row.cityId, row.districtId]; return formatAddressArray(addressIds); - } + }, }, { prop: "contactAddress", label: "鑱旂郴浜鸿缁嗗湴鍧�", minWidth: 150 }, { prop: "updateTime", label: "缁存姢鏃ユ湡", minWidth: 100 }, @@ -363,13 +482,13 @@ minWidth: 120, formatter: (row, column, cellValue) => { if (!userMap.value || Object.keys(userMap.value).length === 0) { - return '--'; + return "--"; } - if (cellValue === null || cellValue === undefined || cellValue === '') { - return '--'; + if (cellValue === null || cellValue === undefined || cellValue === "") { + return "--"; } - return userMap.value[cellValue] || '--'; - } + return userMap.value[cellValue] || "--"; + }, }, { prop: "maintenanceDate", label: "缁存姢鏃ユ湡", minWidth: 150 }, ]); @@ -387,10 +506,10 @@ slot: true, formatter: (row, column, cellValue) => { if (Array.isArray(cellValue)) { - return cellValue.map(item => item); + return cellValue.map((item) => item); } - return cellValue || '--'; - } + return cellValue || "--"; + }, }, { prop: "schemeDesc", label: "瀛楁鎻忚堪", minWidth: 100 }, ]); @@ -442,7 +561,7 @@ coalMeiZhiZiDuanWeiHu: () => { columns.value = coalMeiZhiZiDuanWeiHuColumns.value; getList(); - } + }, }; // 鎵ц瀵瑰簲鐨勯厤缃嚱鏁� @@ -488,17 +607,22 @@ * @description 鏍规嵁鏍囩椤电被鍨嬭缃脊绐楁爣棰樺苟鎵撳紑寮圭獥 */ const handleAddEdit = (currentTabName) => { - const actionText = addOrEdit.value === "add" ? "鏂板" : "缂栬緫"; - + const actionText = + addOrEdit.value === "add" + ? "鏂板" + : addOrEdit.value === "edit" + ? "缂栬緫" + : "鏌ョ湅"; + const tabTitleMap = { supplier: "渚涘簲鍟嗕俊鎭�", - customer: "瀹㈡埛淇℃伅", + customer: "瀹㈡埛淇℃伅", coal: "鐓ょ淇℃伅", coalQualityMaintenance: "鐓よ川鏂规缁存姢", - coalMeiZhiZiDuanWeiHu: "鐓よ川瀛楁缁存姢" + coalMeiZhiZiDuanWeiHu: "鐓よ川瀛楁缁存姢", }; - title.value = `${actionText}${tabTitleMap[currentTabName] || ''}`; + title.value = `${actionText}${tabTitleMap[currentTabName] || ""}`; openDialog(); }; @@ -507,7 +631,7 @@ * @description 鏍规嵁缂栬緫鐘舵�佸喅瀹氭槸鍚﹀鍒惰〃鍗曟暟鎹� */ const openDialog = () => { - if (addOrEdit.value === "edit") { + if (addOrEdit.value === "edit" || addOrEdit.value === "viewRow") { copyForm.value = JSON.parse(JSON.stringify(form.value)); } else { form.value = {}; @@ -561,30 +685,39 @@ */ 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.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); }; + /** * 鎵归噺鍒犻櫎澶勭悊 @@ -596,8 +729,8 @@ return; } - const deleteIds = selectedRows.value.map(item => item.id); - + const deleteIds = selectedRows.value.map((item) => item.id); + try { await ElMessageBox.confirm("纭畾鍒犻櫎閫変腑鐨勬暟鎹悧锛�", "鎻愮ず", { confirmButtonText: "纭畾", @@ -608,9 +741,11 @@ const deleteApiMap = { supplier: delSupply, coal: delCoalInfo, - coalQualityMaintenance: () => { throw new Error('delCoalQuality API not imported'); }, + coalQualityMaintenance: () => { + throw new Error("delCoalQuality API not imported"); + }, customer: delCustomer, - coalMeiZhiZiDuanWeiHu: deleteCoalField + coalMeiZhiZiDuanWeiHu: deleteCoalField, }; const deleteApi = deleteApiMap[tabName.value]; @@ -618,19 +753,19 @@ ElMessage.error("鍒犻櫎鎺ュ彛鏈厤缃�"); return; } - console.log(deleteIds) + console.log(deleteIds); const res = await deleteApi(deleteIds); - + if (res.code !== 200 && res.msg !== "鎿嶄綔鎴愬姛") { ElMessage.error("鍒犻櫎澶辫触锛�" + res.msg); return; } - + ElMessage.success("鍒犻櫎鎴愬姛"); await getList(); } catch (error) { - if (error.message !== 'cancel') { - console.error('鍒犻櫎鎿嶄綔澶辫触:', error); + if (error.message !== "cancel") { + console.error("鍒犻櫎鎿嶄綔澶辫触:", error); ElMessage.error("鍒犻櫎澶辫触锛岃绋嶅悗鍐嶈瘯"); } else { ElMessage.info("宸插彇娑堝垹闄ゆ搷浣�"); @@ -656,7 +791,7 @@ supplier: { api: "/supply/export", name: "渚涘簲鍟嗕俊鎭�" }, customer: { api: "/customer/export", name: "瀹㈡埛淇℃伅" }, coal: { api: "/supply/export", name: "鐓ょ淇℃伅" }, - coalQualityMaintenance: { api: "/supply/export", name: "鐓よ川缁存姢淇℃伅" } + coalQualityMaintenance: { api: "/supply/export", name: "鐓よ川缁存姢淇℃伅" }, }; const config = exportConfig[tabName.value]; @@ -671,7 +806,11 @@ * @param {string} name - 瀵煎嚭鏂囦欢鍚嶅墠缂� */ const exportData = (api, name) => { - proxy.download(api, { ...queryParams }, `${name}${new Date().getTime()}.xlsx`); + proxy.download( + api, + { ...queryParams }, + `${name}${new Date().getTime()}.xlsx` + ); ElMessage.success("瀵煎嚭鏁版嵁锛�" + name); }; // ===== 鏁版嵁鑾峰彇鍑芥暟 ===== @@ -693,11 +832,13 @@ customer: () => getCustomerList(apiParams), coal: () => getCoalInfo(apiParams), coalQualityMaintenance: () => getCoalPlanList(apiParams), - coalMeiZhiZiDuanWeiHu: () => coalField(apiParams) + coalMeiZhiZiDuanWeiHu: () => coalField(apiParams), }; const apiFunction = apiMap[tabName.value]; - return apiFunction ? apiFunction() : Promise.reject(new Error('鏈壘鍒板搴旂殑API鎺ュ彛')); + return apiFunction + ? apiFunction() + : Promise.reject(new Error("鏈壘鍒板搴旂殑API鎺ュ彛")); }; /** @@ -708,16 +849,16 @@ try { loading.value = true; const { data, code } = await selectInterface(); - + if (code !== 200) { - ElMessage.error("鑾峰彇鏁版嵁澶辫触锛�" + (data?.msg || '鏈煡閿欒')); + ElMessage.error("鑾峰彇鏁版嵁澶辫触锛�" + (data?.msg || "鏈煡閿欒")); return; } - + tableData.value = data.records || []; total.value = data.total || 0; } catch (error) { - console.error('鑾峰彇鍒楄〃鏁版嵁澶辫触:', error); + console.error("鑾峰彇鍒楄〃鏁版嵁澶辫触:", error); ElMessage.error("鑾峰彇鏁版嵁澶辫触锛岃绋嶅悗鍐嶈瘯"); } finally { loading.value = false; @@ -735,10 +876,10 @@ await Promise.all([ handleTabClick({ props: { name: "supplier" } }), fetchAreaOptions(), - getUserList() + getUserList(), ]); } catch (error) { - console.error('缁勪欢鍒濆鍖栧け璐�:', error); + console.error("缁勪欢鍒濆鍖栧け璐�:", error); ElMessage.error("椤甸潰鍒濆鍖栧け璐ワ紝璇峰埛鏂伴噸璇�"); } }); @@ -778,7 +919,7 @@ /* 琛ㄦ牸宸ュ叿鏍� */ .table-toolbar, -.table-toolbar>* { +.table-toolbar > * { margin: 0 0 0 0 !important; } @@ -793,4 +934,4 @@ .main-container { background: red !important; } -</style> \ No newline at end of file +</style> -- Gitblit v1.9.3