From e13b3e65beb76c56c8e182083ef6f0e69009b0e2 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 30 六月 2025 12:04:59 +0800
Subject: [PATCH] 最新版本541200007

---
 admin/src/components/business/OperaCategoryFileWindow.vue                                       |   71 +++++++++++
 admin/src/components/business/OperaCompanyDocumentsWindow.vue                                   |  133 +++++++++++++++++++--
 server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/CompanyDocuments.java |    2 
 server/db/business.company_documents.permissions.sql                                            |   11 +
 admin/src/views/operation/danger/areaSet.vue                                                    |    2 
 admin/src/views/business/categoryFile.vue                                                       |   84 ++++++++++++++
 6 files changed, 279 insertions(+), 24 deletions(-)

diff --git a/admin/src/components/business/OperaCategoryFileWindow.vue b/admin/src/components/business/OperaCategoryFileWindow.vue
new file mode 100644
index 0000000..9104287
--- /dev/null
+++ b/admin/src/components/business/OperaCategoryFileWindow.vue
@@ -0,0 +1,71 @@
+<template>
+  <GlobalWindow :title="title" :visible.sync="visible" :confirm-working="isWorking" width="600px" @close="close" @confirm="confirm">
+    <el-form :model="form" ref="form" :rules="rules">
+      <el-form-item label="鍒嗙被鍚嶇О" prop="name">
+        <el-input v-model="form.name" placeholder="璇疯緭鍏ュ垎绫诲悕绉�" v-trim />
+      </el-form-item>
+      <el-form-item label="鎺掑簭鐮侊紙闄嶅簭锛�" prop="sortnum">
+        <el-input type="number" v-model="form.sortnum" placeholder="璇疯緭鍏ユ帓搴忕爜" v-trim />
+      </el-form-item>
+      <el-form-item label="澶囨敞" prop="remark">
+        <el-input type="textarea" v-model="form.remark" placeholder="璇疯緭鍏ュ娉�" v-trim />
+      </el-form-item>
+    </el-form>
+  </GlobalWindow>
+</template>
+
+<script>
+import BaseOpera from '@/components/base/BaseOpera'
+import GlobalWindow from '@/components/common/GlobalWindow'
+export default {
+  name: 'OperaCategoryFileWindow',
+  extends: BaseOpera,
+  components: { GlobalWindow },
+  data () {
+    return {
+      // 琛ㄥ崟鏁版嵁
+      form: {
+        name: '',
+        type: 2,
+        sortnum: null,
+        remark: null
+      },
+      // 楠岃瘉瑙勫垯
+      rules: {
+        name: [
+          { required: true, message: '璇疯緭鍏ュ垎绫诲悕绉�', trigger: 'blur' }
+        ]
+      },
+      dataList: []
+    }
+  },
+  created () {
+    this.config({
+      api: '/business/category',
+      'field.id': 'id'
+    })
+  },
+  methods: {
+    open (title, target) {
+      this.title = title
+      this.visible = true
+      // 鏂板缓缁勭粐
+      if (target == null) {
+        this.$nextTick(() => {
+          this.$refs.form.resetFields()
+          this.form[this.configData['field.id']] = null
+          this.form.type = 2
+        })
+
+        return
+      }
+      // 缂栬緫
+      this.$nextTick(() => {
+        for (const key in this.form) {
+          this.form[key] = target[key]
+        }
+      })
+    },
+  }
+}
+</script>
diff --git a/admin/src/components/business/OperaCompanyDocumentsWindow.vue b/admin/src/components/business/OperaCompanyDocumentsWindow.vue
index 7e70f3a..84fb7ad 100644
--- a/admin/src/components/business/OperaCompanyDocumentsWindow.vue
+++ b/admin/src/components/business/OperaCompanyDocumentsWindow.vue
@@ -10,19 +10,32 @@
         <el-input v-model="form.name" placeholder="璇疯緭鍏ヨ祫鏂欏悕绉�" v-trim/>
       </el-form-item>
       <el-form-item label="璧勬枡绫诲瀷" prop="categoryId">
-        <el-input v-model="form.categoryId" placeholder="璇疯緭鍏ヨ矗浠婚儴闂ㄧ紪鐮�(鍏宠仈company)" v-trim/>
+        <el-select v-model="form.categoryId" clearable filterable placeholder="璇烽�夋嫨">
+          <el-option v-for="item in cateList" :key="item.id" :label="item.name" :value="item.id">
+          </el-option>
+        </el-select>
       </el-form-item>
       <el-form-item label="璐d换閮ㄩ棬" prop="companyId">
-        <el-input v-model="form.companyId" placeholder="璇疯緭鍏ヨ矗浠婚儴闂ㄧ紪鐮�(鍏宠仈company)" v-trim/>
-      </el-form-item>
-      <el-form-item label="鎺掑簭鐮�" prop="sortnum">
-        <el-input v-model="form.sortnum" placeholder="璇疯緭鍏ユ帓搴忕爜" v-trim/>
+        <treeselect
+            v-model="form.companyId"
+            placeholder="璇烽�夋嫨"
+            :options="companyList"
+            :normalizer="normalizeOptions"
+            :default-expand-level="1"
+            noChildrenText="娌℃湁瀛愰�夐」"
+            noOptionsText="娌℃湁鍙�夐」"
+            noResultsText="娌℃湁鍖归厤鐨勭粨鏋�" />
       </el-form-item>
       <el-form-item label="闄勪欢鍦板潃" prop="fileurl">
-        <el-input v-model="form.fileurl" placeholder="璇疯緭鍏ラ檮浠跺湴鍧�" v-trim/>
+        <UploadFile :uploadData="{ folder: 'company_documents',fileType:'' }" :fileList="fileList" @uploadSuccess="uploadFileBiz" />
+
+<!--        <UploadFile width="100px" height="100px" :list="[]"  folder="company_documents" @success="uploadFileBiz($event, 2)" />-->
       </el-form-item>
       <el-form-item label="闄勪欢鎻忚堪" prop="content">
         <el-input type="textarea" v-model="form.content" placeholder="璇疯緭鍏ラ檮浠舵弿杩�" v-trim/>
+      </el-form-item>
+      <el-form-item label="鎺掑簭鐮侊紙闄嶅簭锛�" prop="sortnum">
+        <el-input v-model="form.sortnum" placeholder="璇疯緭鍏ユ帓搴忕爜" v-trim/>
       </el-form-item>
     </el-form>
   </GlobalWindow>
@@ -31,33 +44,38 @@
 <script>
 import BaseOpera from '@/components/base/BaseOpera'
 import GlobalWindow from '@/components/common/GlobalWindow'
+import { fetchList as companyList } from '@/api/business/company'
+import UploadFile from '@/components/common/UploadFile'
+import { fetchList } from '@/api/business/category'
 export default {
   name: 'OperaCompanyDocumentsWindow',
   extends: BaseOpera,
-  components: { GlobalWindow },
+  components: { GlobalWindow, UploadFile },
   data () {
     return {
       // 琛ㄥ崟鏁版嵁
       form: {
         id: null,
-        creator: '',
-        createDate: '',
-        editor: '',
-        editDate: '',
-        isdeleted: '',
         name: '',
-        remark: '',
-        status: '',
+        status: '0',
         sortnum: '',
         fileurl: '',
         fileName: '',
         fileSize: '',
-        categoryId: '',
-        companyId: '',
-        content: ''
+        categoryId: null,
+        companyId: null,
+        content: '',
+        fileurlFull: ''
       },
+      fileList:[],
+      cateList: [],
+      companyList: [],
       // 楠岃瘉瑙勫垯
       rules: {
+        name: [{ required: true, message: '璇疯緭鍏ヨ祫鏂欏悕绉�', trigger: 'blur' }],
+        companyId: [{ required: true, message: '璇烽�夋嫨璐d换閮ㄩ棬' }],
+        categoryId: [{ required: true, message: '璇烽�夋嫨璧勬枡绫诲瀷' }],
+        fileurl: [{ required: true, message: '璇蜂笂浼犺祫鏂欐枃浠�' }]
       }
     }
   },
@@ -66,6 +84,87 @@
       api: '/business/companyDocuments',
       'field.id': 'id'
     })
+  },
+  methods: {
+
+    // 瑙勮寖鍖栭�夐」鏁版嵁鐨勬柟娉�
+    normalizeOptions (node) {
+      // node: 鍘熷鐨勯�夐」鏁版嵁
+      // 鍦ㄨ繖閲屾牴鎹渶瑕佽繘琛岄�夐」鏁版嵁鐨勮鑼冨寲鎿嶄綔锛屽苟杩斿洖瑙勮寖鍖栧悗鐨勯�夐」鏁版嵁
+      // 渚嬪锛屽彲浠ュ皢鍘熷鐨勯�夐」鏁版嵁杞崲涓虹鍚堟彃浠惰姹傜殑缁撴瀯
+      if (node.childList && !node.childList.length) {
+        // 鍘绘帀children=[]鐨刢hildren灞炴��
+        delete node.childList
+      }
+      return {
+        id: node.id,
+        label: node.name,
+        children: node.childList
+      }
+    },
+    open (title, target) {
+      this.title = title
+      this.visible = true
+      this.getCate()
+      this.getCompany()
+      // 鏂板缓缁勭粐
+      if (target == null) {
+        this.$nextTick(() => {
+          this.$refs.form.resetFields()
+          this.form[this.configData['field.id']] = null
+        })
+        return
+      }
+      // 缂栬緫
+      this.$nextTick(() => {
+        for (const key in this.form) {
+          this.form[key] = target[key]
+        }
+      })
+    },
+    uploadFileBiz (file) {
+      // this.$emit('uploadSuccess', { fileurl: data.imgaddr, fileurlFull: data.url, name: data.originname })
+      this.form.fileurl = file.fileurl
+      this.form.fileName = file.name
+      this.form.fileurlFull = file.fileurlFull
+      this.form.fileSize = file.fileSize
+    },
+    getCate () {
+      fetchList({
+        model: { type: 2 },
+        capacity: 1000,
+        page: 1
+      }).then(res => {
+        if (res && res.records && res.records.length > 0) {
+          this.cateList = res.records || []
+        }
+      })
+    },
+    getCompany () {
+      companyList()
+        .then(res => {
+          if (res && res.length > 0) {
+            this.companyList = this.getDepartmentTree(res)
+          }
+        })
+    },
+    getDepartmentTree (tree) {
+      if (tree == null) {
+        return []
+      }
+      return tree.map(item => {
+        const newItem = { ...item }
+        if (newItem) {
+          newItem.children = newItem.childList
+        }
+        if (item.children && item.children.length == 0) {
+          this.$delete(newItem, 'children')
+        } else {
+          newItem.children = this.getDepartmentTree(newItem.children)
+        }
+        return newItem
+      })
+    }
   }
 }
 </script>
diff --git a/admin/src/views/business/categoryFile.vue b/admin/src/views/business/categoryFile.vue
new file mode 100644
index 0000000..a1f800e
--- /dev/null
+++ b/admin/src/views/business/categoryFile.vue
@@ -0,0 +1,84 @@
+<template>
+  <TableLayout :permissions="['business:category:query']">
+    <!-- 鎼滅储琛ㄥ崟 -->
+    <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="120px" inline>
+      <el-form-item label="鍒嗙被鍚嶇О" prop="name">
+        <el-input v-model="searchForm.name" clearable placeholder="璇疯緭鍏ュ垎绫诲悕绉�" @keypress.enter.native="search"></el-input>
+      </el-form-item>
+      <section>
+        <el-button type="primary" @click="search">鎼滅储</el-button>
+        <el-button @click="reset">閲嶇疆</el-button>
+      </section>
+    </el-form>
+    <!-- 琛ㄦ牸鍜屽垎椤� -->
+    <template v-slot:table-wrap>
+      <ul class="toolbar" v-permissions="['business:category:create','business:category:delete']">
+        <li><el-button type="primary" @click="$refs.OperaCategoryFileWindow.open('鏂板缓璧勬枡鍒嗙被')" icon="el-icon-plus" v-permissions="['business:category:create']">鏂板缓</el-button></li>
+        <li><el-button type="danger" @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:category:delete']">鎵归噺鍒犻櫎</el-button></li>
+      </ul>
+      <el-table
+          :height="tableHeightNew"
+          v-loading="isWorking.search"
+          :data="tableData.list"
+          stripe
+          @selection-change="handleSelectionChange"
+      >
+        <el-table-column type="selection" width="55"></el-table-column>
+        <el-table-column prop="name" show-overflow-tooltip label="璧勬枡鍒嗙被" min-width="120px"></el-table-column>
+        <el-table-column prop="sortnum" label="鎺掑簭鐮�"  min-width="70px"></el-table-column>
+        <el-table-column prop="editDate" label="鎿嶄綔鏃堕棿" width="160px"></el-table-column>
+        <el-table-column
+            v-if="containPermissions(['business:category:update', 'business:category:delete' ])"
+            label="鎿嶄綔"
+            min-width="140"
+            fixed="right"
+        >
+          <template slot-scope="{row}">
+            <el-button type="text" icon="el-icon-edit" @click="$refs.OperaCategoryFileWindow.open('缂栬緫璧勬枡鍒嗙被',row)" v-permissions="['business:category:update']">缂栬緫</el-button>
+            <el-button  type="text"  icon="el-icon-delete" @click="deleteById(row)" style="color: red" v-permissions="['business:category:delete']">鍒犻櫎</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+          @size-change="handleSizeChange"
+          @current-change="handlePageChange"
+          :pagination="tableData.pagination"
+      >
+      </pagination>
+    </template>
+    <!-- 鏂板缓/淇敼 -->
+    <OperaCategoryFileWindow ref="OperaCategoryFileWindow" @success="handlePageChange"/>
+  </TableLayout>
+</template>
+
+<script>
+import BaseTable from '@/components/base/BaseTable'
+import TableLayout from '@/layouts/TableLayout'
+import Pagination from '@/components/common/Pagination'
+import OperaCategoryFileWindow from '@/components/business/OperaCategoryFileWindow'
+export default {
+  name: 'areaSet',
+  extends: BaseTable,
+  components: { TableLayout, Pagination, OperaCategoryFileWindow },
+  data () {
+    return {
+      // 鎼滅储
+      searchForm: {
+        name: '',
+        type: 2
+      }
+    }
+  },
+  created () {
+    this.config({
+      module: '璧勬枡鍒嗙被',
+      api: '/business/category',
+      'field.id': 'id',
+      'field.main': 'id'
+    })
+    this.search()
+  },
+  methods: {
+  }
+}
+</script>
diff --git a/admin/src/views/operation/danger/areaSet.vue b/admin/src/views/operation/danger/areaSet.vue
index 1d4c384..8d309c6 100644
--- a/admin/src/views/operation/danger/areaSet.vue
+++ b/admin/src/views/operation/danger/areaSet.vue
@@ -1,5 +1,5 @@
 <template>
-  <TableLayout :permissions="['business:member:query']">
+  <TableLayout :permissions="['business:hiddendangerparam:query']">
     <!-- 鎼滅储琛ㄥ崟 -->
     <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="120px" inline>
       <el-form-item label="闅愭偅鍖哄煙" prop="name">
diff --git a/server/db/business.company_documents.permissions.sql b/server/db/business.company_documents.permissions.sql
index ccc3ff1..009120b 100644
--- a/server/db/business.company_documents.permissions.sql
+++ b/server/db/business.company_documents.permissions.sql
@@ -1,6 +1,7 @@
-INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:companydocuments:create', '鏂板缓闅愭偅鍖哄煙閰嶇疆绫诲瀷淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
-INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:companydocuments:delete', '鍒犻櫎闅愭偅鍖哄煙閰嶇疆绫诲瀷淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
-INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:companydocuments:update', '淇敼闅愭偅鍖哄煙閰嶇疆绫诲瀷淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
-INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:companydocuments:query', '鏌ヨ闅愭偅鍖哄煙閰嶇疆绫诲瀷淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
-INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:companydocuments:exportExcel', '瀵煎嚭闅愭偅鍖哄煙閰嶇疆绫诲瀷淇℃伅琛�(Excel)', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:companydocuments:create', '鏂板缓璧勬枡鏂囦欢', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:companydocuments:delete', '鍒犻櫎璧勬枡鏂囦欢', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:companydocuments:update', '淇敼璧勬枡鏂囦欢', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:companydocuments:query', '鏌ヨ璧勬枡鏂囦欢', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:companydocuments:exportExcel', '瀵煎嚭璧勬枡鏂囦欢(Excel)', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+
 
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/CompanyDocuments.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/CompanyDocuments.java
index 7185b47..c71ee1d 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/CompanyDocuments.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/CompanyDocuments.java
@@ -18,7 +18,7 @@
  * @date 2025/06/27 16:01
  */
 @Data
-@ApiModel("闅愭偅鍖哄煙閰嶇疆绫诲瀷淇℃伅琛�")
+@ApiModel("璧勬枡绠$悊淇℃伅琛�")
 @TableName("`company_documents`")
 public class CompanyDocuments  extends LoginUserModel {
 

--
Gitblit v1.9.3