From 65f6e3cd1da25d21c79168f0f766c1e9a2878cfd Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期二, 11 六月 2024 22:21:39 +0800
Subject: [PATCH] 工艺文件

---
 src/views/dnc/craft/document/index.vue |  130 ++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 115 insertions(+), 15 deletions(-)

diff --git a/src/views/dnc/craft/document/index.vue b/src/views/dnc/craft/document/index.vue
index 7d18af2..3b6bec3 100644
--- a/src/views/dnc/craft/document/index.vue
+++ b/src/views/dnc/craft/document/index.vue
@@ -1,7 +1,7 @@
 <!--
  * @Date: 2024-05-26 16:12:09
  * @LastEditors: Sneed
- * @LastEditTime: 2024-06-11 20:07:17
+ * @LastEditTime: 2024-06-11 22:18:42
  * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/dnc/craft/document/index.vue
 -->
 <!--
@@ -31,7 +31,7 @@
                             <template #prefix>
                                 鏌ヨ鐩爣
                             </template>
-                            <el-option v-for="item in options.fileType" :key="item.value" :label="item.label"
+                            <el-option v-for="item in options.type" :key="item.value" :label="item.label"
                                 :value="item.value" />
                         </el-select>
                         <el-input style="width: 240px;margin-left: 8px;" v-model="params.keyword"
@@ -62,19 +62,20 @@
                                 </scTable>
                             </el-col>
                             <el-col :span="12">
-                                <h2>宸ヨ壓鍖呰鎯�</h2>
-                                <el-row>
+                                <h2 style="background-color: var(--el-color-primary);color: #fff;padding: 4px 20px;">
+                                    宸ヨ壓鍖呰鎯�</h2>
+                                <el-row style="margin: 14px 0;">
                                     <el-col :span="12">
-                                        宸ヨ壓鍖呭悕绉帮細
+                                        宸ヨ壓鍖呭悕绉帮細{{ info.name }}
                                     </el-col>
                                     <el-col :span="12">
-                                        宸ヨ壓鍖呯紪鍙凤細
+                                        宸ヨ壓鍖呯紪鍙凤細{{ info.code }}
                                     </el-col>
                                     <el-col :span="12">
-                                        宸ヨ壓鍖呮墍鍦ㄧ洰褰曪細
+                                        宸ヨ壓鍖呮墍鍦ㄧ洰褰曪細{{ info.sourcePath }}
                                     </el-col>
-                                    <el-col :span="24">
-                                        <Children></Children>
+                                    <el-col :span="24" style="margin: 14px 0;">
+                                        <Children :list="list" @delete="deleteItem"></Children>
                                     </el-col>
                                 </el-row>
                             </el-col>
@@ -99,19 +100,29 @@
                         <template #prefix>
                             鏂囦欢绫诲瀷
                         </template>
-                        <el-option v-for="item in options.fileType" :key="item.value" :label="item.label"
+                        <el-option v-for="item in options.fileClass" :key="item.value" :label="item.label"
                             :value="item.value" />
                     </el-select>
                     <el-select v-model="searchParams.fileType" style="width: 240px;margin-left: 8px;">
                         <template #prefix>
-                            鏂囦欢绫诲瀷
+                            鏂囦欢灞炴��
                         </template>
                         <el-option v-for="item in options.fileType" :key="item.value" :label="item.label"
                             :value="item.value" />
                     </el-select>
                 </el-header>
                 <el-main>
-
+                    <scTable highlight-current-row ref="table1" :apiObj="apiObj1" @selection-change="selectionChange"
+                        stripe>
+                        <el-table-column label="鏂囦欢鍚嶇О" prop="fileName" width="160">
+                        </el-table-column>
+                        <el-table-column label="鐗堟湰鍙�" prop="version" width="160"></el-table-column>
+                        <el-table-column label="鏂囦欢绫诲瀷" prop="suffix" width="160"></el-table-column>
+                        <el-table-column label="鏂囦欢灞炴��" prop="fileType" width="160"></el-table-column>
+                        <el-table-column label="鎿嶄綔绫诲瀷" prop="operationType" width="160"></el-table-column>
+                        <el-table-column label="鎿嶄綔浜哄憳" prop="operatorName" width="160"></el-table-column>
+                        <el-table-column label="鎿嶄綔鏃堕棿" prop="operationTime" width="160"></el-table-column>
+                    </scTable>
                 </el-main>
             </el-container>
         </scDialog>
@@ -124,11 +135,21 @@
     components: {
         Children
     },
+    watch: {
+        searchParams: {
+            handler() {
+                this.$refs?.table1?.reload()
+            },
+            deep: true
+        }
+    },
     data() {
         return {
             treeData: [],
             selection: [],
-            params: {},
+            params: {
+                type: 'BAG_OR_PROCESS'
+            },
             selectNode: {
                 // id: 0
             },
@@ -137,9 +158,21 @@
                     let params = {
                         ...data,
                         catalogueId: this.selectNode.id,
-                        ...this.params
+                        // ...this.params
                     }
                     return await this.$HTTP.get(`/api/blade-dnc/dnc-art-bag/cur-sub-page`, {}, { params }).then(res => {
+                        return res
+                    })
+                }
+            },
+            apiObj1: {
+                get: async (data) => {
+                    let params = {
+                        ...data,
+                        catalogueId: this.selectNode.id,
+                        // ...this.params
+                    }
+                    return await this.$HTTP.post(`/api/blade-dnc/dnc-art-bag-log/page`, {}, { params, data: { ...this.searchParams } }).then(res => {
                         return res
                     })
                 }
@@ -183,13 +216,54 @@
             logVisible: false,
             row: {},
             options: {
-
+                type: [
+                    {
+                        value: 'BAG_OR_PROCESS',
+                        label: '宸ヨ壓鍖呭拰绋嬪簭鏂囨。'
+                    },
+                    {
+                        value: 'ONLY_BAG',
+                        label: '浠呭伐鑹哄寘'
+                    },
+                    {
+                        value: 'ONLY_PROCESS',
+                        label: '浠呯▼搴忔枃妗�'
+                    },
+                ],
+                fileType: [
+                    {
+                        value: 1,
+                        label: '绋嬪簭'
+                    },
+                    {
+                        value: 2,
+                        label: '鏂囨。'
+                    },
+                ]
             },
+            searchParams: {
+                fileName: '',
+                fileClass: '',
+                fileType: '',
+            },
+            info: {},
+            list: []
         }
     },
     created() {
+        this.init()
     },
     methods: {
+        init() {
+            this.$HTTP.get(`/api/blade-system/param/detail?paramKey=dnc.support.file.suffix.list`).then(res => {
+                this.options.fileClass = res.data.paramValue.split(',').map(v => {
+                    return {
+                        value: v,
+                        label: v
+                    }
+                })
+            })
+        },
         loadNode(node, resolve) {
             console.log(node, '>>>>>>')
             let id = node.level === 0 ? '' : node.data.id
@@ -271,6 +345,32 @@
             this.logVisible = true
             this.row = row
         },
+        dataChange(data) {
+            console.log(data)
+            this.rowClick(data.data.records[0])
+        },
+        rowClick(row) {
+            if (!row) return this.info = {}
+            this.$HTTP.get(`/api/blade-dnc/dnc-art-bag/get/${row.id}`).then(res => {
+                if (res.success) {
+                    this.info = res.data
+                } else {
+                    this.info = {}
+                }
+            })
+            this.$HTTP.get(`/api/blade-dnc/dnc-art-file/list?artBagId=${row.id}`).then(res => {
+                if (res.success) {
+                    this.list = res.data
+                }
+            })
+        },
+        deleteItem() {
+            this.$HTTP.get(`/api/blade-dnc/dnc-art-file/list?artBagId=${this.info.id}`).then(res => {
+                if (res.success) {
+                    this.list = res.data
+                }
+            })
+        },
         exportExcel() {
 
         },

--
Gitblit v1.9.3