Kaynağa Gözat

fix:更改文件查阅

liujiayin 2 yıl önce
ebeveyn
işleme
1055d8ee46

+ 28 - 25
src/views/infosManage/externalFiles/externalFiles.vue

@@ -7,14 +7,12 @@
         <el-input placeholder="输入关键字进行过滤"
                   v-model="filterText">
         </el-input>
-        <div class="treeDiv">
-          <el-tree ref="tree"
-                   :width="width"
-                   :data="typeData"
-                   :props="defaultProps"
-                   @node-click="handleNodeClick"
-                   :filter-node-method="filterNode"></el-tree>
-        </div>
+        <el-tree ref="tree"
+                 :width="width"
+                 :data="typeData"
+                 :props="defaultProps"
+                 @node-click="handleNodeClick"
+                 :filter-node-method="filterNode"></el-tree>
       </div>
       <ibps-container :margin-left="width + 'px'"
                       class="page">
@@ -27,7 +25,7 @@
         <template v-else>
           <ibps-crud key="istree"
                      ref="crud"
-                     :data="tableData"
+                     :data="selectListData"
                      :toolbars="listConfig.toolbars"
                      :search-form="listConfig.searchForm"
                      :pk-key="pkKey"
@@ -87,7 +85,7 @@ export default {
       },
       pkKey: 'id', // 主键  如果主键不是pk需要传主键
       loading: false,
-      tableData: [],
+      selectListData: [],
       listTreeData: [],
       bianlistData: {
         dataResult: [],
@@ -117,7 +115,7 @@ export default {
           { prop: 'wen_jian_bian_hao', label: '文件编号', sortable: 'custom', width: 150 },
           { prop: 'wen_jian_ming_che', label: '文件名称', width: 400 },
           { prop: 'ban_ben_hao_', label: '版本号', sortable: 'custom', width: 100 },
-          { prop: 'fa_bu_ri_qi_', label: '发日期', sortable: 'custom', width: 100 },
+          { prop: 'fa_bu_ri_qi_', label: '发日期', sortable: 'custom', width: 100 },
           { prop: 'wen_jian_id_', label: '查阅', slotName: "wenjinachayue", width: 400 }
         ]
       },
@@ -125,15 +123,6 @@ export default {
         border: true,
         stripe: true
       },
-      bianlistData: {
-        dataResult: [],
-        pageResult: {
-          limit: 0,
-          page: 0,
-          totalCount: 0,
-          totalPages: 0
-        }
-      },
       pagination: {
         limit: 20, page: 1
       },
@@ -162,12 +151,13 @@ export default {
     getDatas(sorts) {
       this.listData = []
       let wheres = ''
+      let sql = ''
       if (sorts.fileCode) {
         wheres = wheres + ` and wj.wen_jian_bian_hao like '%${sorts.fileCode}%'`
       }
 
       if (sorts.fileType) {
-        wheres = wheres + ` and wj.wen_jian_lie_xing = '${sorts.fileType}'`
+        wheres = wheres + ` and wj.wai_bu_wen_jian_l = '${sorts.fileType}'`
       }
       if (sorts.fileName) {
         wheres = wheres + ` and wj.wen_jian_ming_che like '%${sorts.fileName}%'`
@@ -177,10 +167,13 @@ export default {
           wheres = wheres + ` order by  ${Object.keys(sorts.sorts)}  ${Object.values(sorts.sorts)}`
         }
       }
+      if (sorts.fileType == '参考技术文献(受限)' || sorts.fileType == '客户技术资料(受限)') {
+        sql = `select  wj.wen_jian_bian_hao,wj.wen_jian_ming_che,wj.ban_ben_hao_,wj.wen_jian_id_,wj.fa_bu_ri_qi_ FROM  t_wjcysqb qx 
+      LEFT JOIN t_wjgl wj ON qx.wen_jian_id_=wj.id_ WHERE qx.yong_hu_id_='${sorts.userId}' ${wheres}`
+      } else {
+        sql = `select wj.* FROM t_wjgl wj WHERE wj.wen_jian_zhuang_t = '已发放' AND wj.yi_gai_zuo_fei_ = '否' ${wheres}`
+      }
       // 重复发放的文件,在权限表会存在重复的文件信息
-      let sql = `select  wj.wen_jian_bian_hao,wj.wen_jian_ming_che,wj.ban_ben_hao_,qx.create_time_,wj.wen_jian_id_,qx.fa_bu_ri_qi_ FROM  t_wjcysqb qx 
-      LEFT JOIN t_wjgl wj ON qx.wen_jian_id_=wj.wen_jian_id_ WHERE qx.yong_hu_id_='${sorts.userId}' ${wheres}`
-
       curdPost('sql', sql).then(res => {
         let tableDatas = res.variables.data
         this.selectListData = JSON.parse(JSON.stringify(tableDatas))
@@ -208,9 +201,18 @@ export default {
       this.getDatas(this.getSearcFormData())
     },
 
+    /**
+    * 处理排序
+    */
+    handleSortChange(sort) {
+      ActionUtils.setSorts(this.sorts, sort)
+      this.getDatas(this.getSearcFormData())
+    },
+
     handleNodeClick(data) {
       this.oldorgId = data
       this.show = 'detail'
+      ActionUtils.setPagination(this.pagination, { limit: 20, page: 1 })
       if (this.oldorgId == data.id) {
         return
       } else {
@@ -222,6 +224,7 @@ export default {
       }
     },
 
+
     /**
       * 获取格式化参数
       */
@@ -274,7 +277,7 @@ export default {
 </script>
 <style lang="less" scoped>
 .box {
-  width: 210px;
+  width: 230px;
 }
 
 .title {

+ 8 - 13
src/views/infosManage/internalFiles/internalFiles.vue

@@ -7,14 +7,12 @@
         <el-input placeholder="输入关键字进行过滤"
                   v-model="filterText">
         </el-input>
-        <div class="treeDiv">
-          <el-tree ref="tree"
-                   :width="width"
-                   :data="typeData"
-                   :props="defaultProps"
-                   @node-click="handleNodeClick"
-                   :filter-node-method="filterNode"></el-tree>
-        </div>
+        <el-tree ref="tree"
+                 :width="width"
+                 :data="typeData"
+                 :props="defaultProps"
+                 @node-click="handleNodeClick"
+                 :filter-node-method="filterNode"></el-tree>
       </div>
       <ibps-container :margin-left="width + 'px'"
                       class="page">
@@ -128,7 +126,7 @@ export default {
           { prop: 'wen_jian_bian_hao', label: '文件编号', sortable: 'custom', width: 150 },
           { prop: 'wen_jian_ming_che', label: '文件名称', width: 400 },
           { prop: 'ban_ben_hao_', label: '版本号', sortable: 'custom', width: 100 },
-          { prop: 'fa_bu_ri_qi_', label: '发日期', sortable: 'custom', width: 100 },
+          { prop: 'fa_bu_ri_qi_', label: '发日期', sortable: 'custom', width: 100 },
           { prop: 'wen_jian_id_', label: '查阅', slotName: "wenjinachayue", width: 400 }
         ]
       },
@@ -190,10 +188,7 @@ export default {
           wheres = wheres + ` order by  ${Object.keys(sorts.sorts)}  ${Object.values(sorts.sorts)}`
         }
       }
-
-      let sql = `select * FROM t_wjgl
-      WHERE wen_jian_zhuang_t = '已发放' AND yi_gai_zuo_fei_ = '否' ${wheres}`
-
+      let sql = `select * FROM t_wjgl WHERE wen_jian_zhuang_t = '已发放' AND yi_gai_zuo_fei_ = '否' ${wheres}`
       curdPost('sql', sql).then(res => {
         let tableDatas = res.variables.data
         this.tableData = JSON.parse(JSON.stringify(tableDatas))