From 949699007c792959ba6b001bd51cb91265e8eb37 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期三, 19 二月 2025 14:33:26 +0800
Subject: [PATCH] Merge branch 'dev' of http://114.132.189.42:9002/r/lims-ruoyi-before into dev

---
 src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue |  172 ++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 110 insertions(+), 62 deletions(-)

diff --git a/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue b/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue
index 2ab086f..c28c5b0 100644
--- a/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue
+++ b/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue
@@ -16,13 +16,10 @@
           <el-button size="small" type="primary" style="height: 38px">闄勪欢涓婁紶</el-button>
         </el-upload>
       </div>
-      <div style="height: 70vh;overflow-y: auto;" v-if="filesDialogVisible">
-        <ValueTable ref="fileList"
-                    :url="$api.insOrderPlan.getFileList"
-                    :delUrl="$api.insOrderPlan.delfile"
-                    class="value-table"
-                    :key="upIndex"
-                    :componentData="componentData"/>
+      <div v-if="filesDialogVisible">
+        <lims-table :tableData="tableData" :column="column"
+                    @pagination="pagination" height="500px" key="tableData"
+                    :page="page" :tableLoading="tableLoading"></lims-table>
       </div>
     </el-dialog>
   </div>
@@ -31,11 +28,13 @@
 <script>
 import ValueTable from "@/components/Table/value-table.vue";
 import file from "@/utils/file";
+import limsTable from "@/components/Table/lims-table.vue";
+import {delfile, downFile, getFileList} from "@/api/business/rawMaterialOrder";
 
 export default {
   name: "filesLookVisible",
   // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
-  components: {ValueTable},
+  components: {limsTable, ValueTable},
   props: {
     filesDialogVisible: {
       type: Boolean,
@@ -49,7 +48,67 @@
   data() {
     // 杩欓噷瀛樻斁鏁版嵁
     return {
-      upIndex: 0,
+      tableData: [],
+      tableLoading: false,
+      column: [
+        {
+          dataType: 'tag',
+          label: '绫诲瀷',
+          prop: 'type',
+          formatData: (params) => {
+            if (params == 1) {
+              return '鍚堟牸'
+            } else if (params == 0) {
+              return '涓嶅悎鏍�'
+            } else if (params == 3) {
+              return '涓嶅垽瀹�'
+            } else {
+              return ''
+            }
+          },
+          formatType: (params) => {
+            if (params == 1) {
+              return 'success'
+            } else if (params == 0) {
+              return 'danger'
+            } else if (params == 3) {
+              return ''
+            }  else {
+              return ''
+            }
+          }
+        },
+        {label: '闄勪欢鍚嶇О', prop: 'fileName'},
+        {label: '涓婁紶浜�', prop: 'name'},
+        {label: '涓婁紶鏃堕棿', prop: 'createTime'},
+        {
+          dataType: 'action',
+          fixed: 'right',
+          label: '鎿嶄綔',
+          width: '170px',
+          operation: [
+            {
+              name: '涓嬭浇',
+              type: 'text',
+              clickFun: (row) => {
+                this.handleDown(row);
+              }
+            },
+            {
+              name: '鍒犻櫎',
+              type: 'text',
+              clickFun: (row) => {
+                this.delete(row);
+              }
+            },
+          ]
+        }
+      ],
+      page: {
+        total:0,
+        size:10,
+        current:1
+      },
       isShow: this.filesDialogVisible,
       dataVisibleTitle: [
         {
@@ -62,50 +121,9 @@
         },
       ],
       dataVisibleIndex: 0, // tab鏍忛�夋嫨鍊�
-      componentData: {
-        entity: {
-          insOrderId:''
-        },
-        isIndex: true,
-        showSelect: false,
-        select: false,
-        sort: false,
-        init:false,
-        do: [
-          {
-            id: 'parent',
-            font: '涓嬭浇',
-            type: 'text',
-            method: 'handleDown'
-          },{
-            id: 'delete',
-            font: '鍒犻櫎',
-            type: 'text',
-            method: 'doDiy',
-          }
-        ],
-        isPage: false,
-        linkEvent: {},
-        tagField: {
-          type:{
-            select:[
-              {
-                value: 1,
-                label: '鍥剧墖'
-              },
-              {
-                value: 2,
-                label: '鏂囦欢'
-              }
-            ]
-          }
-        },
-        currentId: '',
-        selectField: {},
-        requiredAdd: [],
-        requiredUp: []
+      entity: {
+        insOrderId:''
       },
-
     }
   },
   mounted() {
@@ -119,20 +137,31 @@
       this.refreshTable()
     },
     // 鏌ヨ鍥炶皟
-    refreshTable(e) {
+    refreshTable() {
       if (this.dataVisibleIndex === 0) {
-        this.componentData.entity.insOrderId = this.filesLookInfo.enterOrderId
+        this.entity.insOrderId = this.filesLookInfo.enterOrderId
       } else {
-        this.componentData.entity.insOrderId = this.filesLookInfo.quarterOrderId
+        this.entity.insOrderId = this.filesLookInfo.quarterOrderId
       }
-      this.$nextTick(() => {
-        this.$refs['fileList'].selectList(e)
+      this.tableLoading = true
+      const params = {...this.entity}
+      getFileList(params).then(res => {
+        this.tableLoading = false
+        if (res.code === 200) {
+          this.tableData = res.data.records
+          this.page.total = res.data.total
+        }
+      }).catch(err => {
+        this.tableLoading = false
       })
     },
+    pagination (page) {
+      this.page.size = page.limit
+      this.refreshTable()
+    },
+    // 涓嬭浇
     handleDown(row){
-      this.$axios.post(this.$api.insOrderPlan.downFile, {
-        id: row.id,
-      }).then(res => {
+      downFile({id: row.id,}).then(res => {
         if (res.code === 200) {
           let url = '';
           if(res.data.type==1){
@@ -179,6 +208,24 @@
       this.$message.error('涓婁紶澶辫触')
       this.$refs.upload.clearFiles()
     },
+    // 鍒犻櫎
+    delete (row) {
+      this.$confirm('鏄惁鍒犻櫎褰撳墠鏁版嵁?', "璀﹀憡", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
+      }).then(() => {
+        delfile({id: row.id}).then(res => {
+          if (res.code === 500) {
+            return
+          }
+          this.$message.success('鍒犻櫎鎴愬姛')
+          this.getList()
+        }).catch(e => {
+          this.$message.error('鍒犻櫎澶辫触')
+        })
+      }).catch(() => {})
+    }
   },
   computed: {
     headers() {
@@ -187,7 +234,7 @@
       }
     },
     action() {
-      return this.javaApi + this.$api.insOrderPlan.uploadFile
+      return this.javaApi + '/insOrderPlan/uploadFile'
     }
   },
 }
@@ -197,7 +244,8 @@
 .tab {
   list-style-type: none;
   display: flex;
-  margin-bottom: 12px;
+  margin-top: 0 !important;
+  padding-left: 0 !important;
 }
 
 .tab li {

--
Gitblit v1.9.3