From 9b0aed26bc400fdb1b6d62084346df06993a6ebf Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期二, 13 一月 2026 17:53:27 +0800
Subject: [PATCH] 开票登记后,下拉框展示的数据有误

---
 src/views/basicData/supplierManage/filesDia.vue |  328 ++++++++++++++++++++++++++----------------------------
 1 files changed, 160 insertions(+), 168 deletions(-)

diff --git a/src/views/basicData/supplierManage/filesDia.vue b/src/views/basicData/supplierManage/filesDia.vue
index 6284d6b..c894bd1 100644
--- a/src/views/basicData/supplierManage/filesDia.vue
+++ b/src/views/basicData/supplierManage/filesDia.vue
@@ -1,45 +1,35 @@
 <template>
   <div>
-    <el-dialog
-        v-model="dialogFormVisible"
-        title="涓婁紶闄勪欢"
-        width="50%"
-        @close="closeDia"
-    >
+    <el-dialog v-model="dialogFormVisible"
+               title="涓婁紶闄勪欢"
+               width="50%"
+               @close="closeDia">
       <div style="margin-bottom: 10px;text-align: right">
-        <el-upload
-            v-model:file-list="fileList"
-            class="upload-demo"
-            :action="uploadUrl"
-            :on-success="handleUploadSuccess"
-            :on-error="handleUploadError"
-            name="file"
-            :show-file-list="false"
-            :headers="headers"
-            style="display: inline;margin-right: 10px"
-        >
+        <el-upload v-model:file-list="fileList"
+                   class="upload-demo"
+                   :action="uploadUrl"
+                   :on-success="handleUploadSuccess"
+                   :on-error="handleUploadError"
+                   name="file"
+                   :show-file-list="false"
+                   :headers="headers"
+                   style="display: inline;margin-right: 10px">
           <el-button type="primary">涓婁紶闄勪欢</el-button>
         </el-upload>
-        <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
+        <el-button type="danger"
+                   plain
+                   @click="handleDelete">鍒犻櫎</el-button>
       </div>
-      <PIMTable
-          rowKey="id"
-          :column="tableColumn"
-          :tableData="tableData"
-          :tableLoading="tableLoading"
-          :isSelection="true"
-          @selection-change="handleSelectionChange"
-          height="500"
-      >
+      <PIMTable rowKey="id"
+                :column="tableColumn"
+                :tableData="tableData"
+                :tableLoading="tableLoading"
+                :isSelection="true"
+                :page="page"
+                @pagination="paginationSearch"
+                @selection-change="handleSelectionChange"
+                height="500">
       </PIMTable>
-			<pagination
-				style="margin: 10px 0"
-				v-show="total > 0"
-				@pagination="paginationSearch"
-				:total="total"
-				:page="page.current"
-				:limit="page.size"
-			/>
       <template #footer>
         <div class="dialog-footer">
           <el-button @click="closeDia">鍙栨秷</el-button>
@@ -51,149 +41,151 @@
 </template>
 
 <script setup>
-import {ref} from "vue";
-import {ElMessageBox} from "element-plus";
-import {getToken} from "@/utils/auth.js";
-import filePreview from '@/components/filePreview/index.vue'
-import {
-  fileAdd,
-  fileDel,
-  fileListPage
-} from "@/api/basicData/supplierManageFile.js";
-import Pagination from "@/components/PIMTable/Pagination.vue";
-const { proxy } = getCurrentInstance()
-const emit = defineEmits(['close'])
+  import { ref } from "vue";
+  import { ElMessageBox } from "element-plus";
+  import { getToken } from "@/utils/auth.js";
+  import filePreview from "@/components/filePreview/index.vue";
+  import {
+    fileAdd,
+    fileDel,
+    fileListPage,
+  } from "@/api/basicData/supplierManageFile.js";
+  import Pagination from "@/components/PIMTable/Pagination.vue";
+  const { proxy } = getCurrentInstance();
+  const emit = defineEmits(["close"]);
 
-const dialogFormVisible = ref(false);
-const currentId = ref('')
-const selectedRows = ref([]);
-const filePreviewRef = ref()
-const tableColumn = ref([
-  {
-    label: "鏂囦欢鍚嶇О",
-    prop: "name",
-  },
-  {
-    dataType: "action",
-    label: "鎿嶄綔",
-    align: "center",
-    operation: [
-      {
-        name: "涓嬭浇",
-        type: "text",
-        clickFun: (row) => {
-          downLoadFile(row);
+  const dialogFormVisible = ref(false);
+  const currentId = ref("");
+  const selectedRows = ref([]);
+  const filePreviewRef = ref();
+  const tableColumn = ref([
+    {
+      label: "鏂囦欢鍚嶇О",
+      prop: "name",
+    },
+    {
+      dataType: "action",
+      label: "鎿嶄綔",
+      align: "center",
+      operation: [
+        {
+          name: "涓嬭浇",
+          type: "text",
+          clickFun: row => {
+            downLoadFile(row);
+          },
         },
-      },
-      {
-        name: "棰勮",
-        type: "text",
-        clickFun: (row) => {
-          lookFile(row);
+        {
+          name: "棰勮",
+          type: "text",
+          clickFun: row => {
+            lookFile(row);
+          },
         },
-      }
-    ],
-  },
-]);
-const page = reactive({
-	current: 1,
-	size: 100,
-});
-const total = ref(0);
-const tableData = ref([]);
-const fileList = ref([]);
-const tableLoading = ref(false);
-const headers = ref({
-  Authorization: "Bearer " + getToken(),
-});
-const uploadUrl = ref(import.meta.env.VITE_APP_BASE_API + "/file/upload"); // 涓婁紶鐨勫浘鐗囨湇鍔″櫒鍦板潃
+      ],
+    },
+  ]);
+  const page = reactive({
+    current: 1,
+    size: 100,
+    total: 0,
+  });
+  // const total = ref(0);
+  const tableData = ref([]);
+  const fileList = ref([]);
+  const tableLoading = ref(false);
+  const headers = ref({
+    Authorization: "Bearer " + getToken(),
+  });
+  const uploadUrl = ref(import.meta.env.VITE_APP_BASE_API + "/file/upload"); // 涓婁紶鐨勫浘鐗囨湇鍔″櫒鍦板潃
 
-// 鎵撳紑寮规
-const openDialog = (row) => {
-  dialogFormVisible.value = true;
-  currentId.value = row.id;
-  getList()
-}
-const paginationSearch = (obj) => {
-	page.current = obj.page;
-	page.size = obj.limit;
-	getList();
-};
-const getList = () => {
-  fileListPage({supplierId: currentId.value, ...page}).then(res => {
-    tableData.value = res.data.records;
-		total.value = res.data.total;
-  })
-}
-// 琛ㄦ牸閫夋嫨鏁版嵁
-const handleSelectionChange = (selection) => {
-  selectedRows.value = selection;
-};
+  // 鎵撳紑寮规
+  const openDialog = row => {
+    dialogFormVisible.value = true;
+    currentId.value = row.id;
+    getList();
+  };
+  const paginationSearch = obj => {
+    page.current = obj.page;
+    page.size = obj.limit;
+    getList();
+  };
+  const getList = () => {
+    fileListPage({ supplierId: currentId.value, ...page }).then(res => {
+      tableData.value = res.data.records;
+      page.total = res.data.total;
+    });
+  };
+  // 琛ㄦ牸閫夋嫨鏁版嵁
+  const handleSelectionChange = selection => {
+    selectedRows.value = selection;
+  };
 
-// 鍏抽棴寮规
-const closeDia = () => {
-  dialogFormVisible.value = false;
-  emit('close')
-};
-// 涓婁紶鎴愬姛澶勭悊
-function handleUploadSuccess(res, file) {
-  // 濡傛灉涓婁紶鎴愬姛
-  if (res.code == 200) {
-    const fileRow = {}
-    fileRow.name = res.data.originalName
-    fileRow.url = res.data.tempPath
-    uploadFile(fileRow)
-  } else {
-    proxy.$modal.msgError("鏂囦欢涓婁紶澶辫触");
+  // 鍏抽棴寮规
+  const closeDia = () => {
+    dialogFormVisible.value = false;
+    emit("close");
+  };
+  // 涓婁紶鎴愬姛澶勭悊
+  function handleUploadSuccess(res, file) {
+    // 濡傛灉涓婁紶鎴愬姛
+    if (res.code == 200) {
+      const fileRow = {};
+      fileRow.name = res.data.originalName;
+      fileRow.url = res.data.tempPath;
+      uploadFile(fileRow);
+    } else {
+      proxy.$modal.msgError("鏂囦欢涓婁紶澶辫触");
+    }
   }
-}
-function uploadFile(file) {
-  file.supplierId = currentId.value;
-  fileAdd(file).then(res => {
-    proxy.$modal.msgSuccess("鏂囦欢涓婁紶鎴愬姛");
-    getList()
-  })
-}
-// 涓婁紶澶辫触澶勭悊
-function handleUploadError() {
-  proxy.$modal.msgError("鏂囦欢涓婁紶澶辫触");
-}
-// 涓嬭浇闄勪欢
-const downLoadFile = (row) => {
-  proxy.$download.name(row.url);
-}
-// 鍒犻櫎
-const handleDelete = () => {
-  let ids = [];
-  if (selectedRows.value.length > 0) {
-    ids = selectedRows.value.map((item) => item.id);
-  } else {
-    proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
-    return;
-  }
-  ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
-    confirmButtonText: "纭",
-    cancelButtonText: "鍙栨秷",
-    type: "warning",
-  }).then(() => {
-    fileDel(ids).then((res) => {
-      proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+  function uploadFile(file) {
+    file.supplierId = currentId.value;
+    fileAdd(file).then(res => {
+      proxy.$modal.msgSuccess("鏂囦欢涓婁紶鎴愬姛");
       getList();
     });
-  }).catch(() => {
-    proxy.$modal.msg("宸插彇娑�");
-  });
-};
-// 棰勮闄勪欢
-const lookFile = (row) => {
-  filePreviewRef.value.open(row.url)
-}
+  }
+  // 涓婁紶澶辫触澶勭悊
+  function handleUploadError() {
+    proxy.$modal.msgError("鏂囦欢涓婁紶澶辫触");
+  }
+  // 涓嬭浇闄勪欢
+  const downLoadFile = row => {
+    proxy.$download.name(row.url);
+  };
+  // 鍒犻櫎
+  const handleDelete = () => {
+    let ids = [];
+    if (selectedRows.value.length > 0) {
+      ids = selectedRows.value.map(item => item.id);
+    } else {
+      proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+      return;
+    }
+    ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
+      confirmButtonText: "纭",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    })
+      .then(() => {
+        fileDel(ids).then(res => {
+          proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+          getList();
+        });
+      })
+      .catch(() => {
+        proxy.$modal.msg("宸插彇娑�");
+      });
+  };
+  // 棰勮闄勪欢
+  const lookFile = row => {
+    filePreviewRef.value.open(row.url);
+  };
 
-defineExpose({
-  openDialog,
-});
+  defineExpose({
+    openDialog,
+  });
 </script>
 
 <style scoped>
-
 </style>
\ No newline at end of file

--
Gitblit v1.9.3