Преглед изворни кода

文件更新表记录id的添加

lidie пре 1 година
родитељ
комит
a6fa03f8af
1 измењених фајлова са 64 додато и 5 уклоњено
  1. 64 5
      src/views/infosManage/fileIE.vue

+ 64 - 5
src/views/infosManage/fileIE.vue

@@ -117,7 +117,13 @@
                 :visible="dialogVisible"
                 :file-infos="fileInfos"
             />
+            <!-- 本人修改 -->
+            <!-- <file-lookup
+                :visible="dialogVisible"
+                :file-infos="fileArray"
+            /> -->
         </div>
+        <!-- 文件更新的内容 -->
         <el-dialog
             :visible.sync="dialogVisible1"
             width="55%"
@@ -225,6 +231,8 @@ export default {
         const depArrs = []
         var fileDownloadAuthority = false
         const { deptList, role } = this.$store.getters
+        console.log('deptList', deptList)
+        console.log('role', role)
         for (var i of deptList) {
             depArrs.push(`wj.bian_zhi_bu_men_ like '${i.positionId}'`)
         }
@@ -236,6 +244,7 @@ export default {
             }
         }
         return {
+            fileLookShow: false,
             rules: {
                 fa_bu_shi_jian_: [{ required: true, message: this.$t('validate.required') }],
                 sheng_xiao_shi_: [{ required: true, message: this.$t('validate.required') }],
@@ -330,7 +339,9 @@ export default {
             openFilePng,
             wordPng,
             dialogVisible: false,
-            fileInfos: {}
+            fileInfos: {},
+            // 本人修改
+            fileArray: []
         }
     },
     watch: {
@@ -340,7 +351,6 @@ export default {
         showCaoZuoColumn (val) {
             this.showCaoZuoColumn = val
         }
-
     },
     created () {
         this.pageKey = this.$route.name
@@ -425,12 +435,14 @@ export default {
             this.dialogForm.wen_jian_lei_xing = data.row.wen_jian_xi_lei_
             this.dialogForm.wen_jian_bian_hao = data.row.wen_jian_bian_hao
             this.dialogForm.yuan_wen_jian_min = data.row.wen_jian_ming_che
+            this.dialogForm.yuan_wen_jian_id_ = data.row.id
             this.dialogForm.xin_wen_jian_ming = ''
             this.dialogForm.wen_jian_fu_jian_ = ''
             this.dialogForm.geng_xin_nei_rong = ''
             this.dialogForm.geng_xin_yuan_yin = ''
             this.dialogForm.fa_bu_shi_jian_ = ''
             this.dialogForm.sheng_xiao_shi_ = ''
+            this.dialogForm.ji_lu_id_ = data.row.id
         },
         handleClose (done) {
             this.$confirm('确认关闭?')
@@ -448,6 +460,7 @@ export default {
         },
         getDatas () {
             const { comAuthority, buMenAuthority, authority } = this.fileTypesDatas
+            // fileType存放点击文件id,如有孩子,则还有孩子id
             const { fileType, sorts } = this.sqlWhere
             this.listData = []
             let wheres1 = '' // 共用
@@ -481,7 +494,7 @@ export default {
                     wheres3 = wheres3 + ` and wj.${i} like '%${likeWhere}%'`
                 }
             }
-
+            // fileType存放文件的id和有孩子的id
             if (fileType) {
                 if (this.pageKey === 'nbwj') {
                     if (comAuthority.length !== 0) {
@@ -491,6 +504,8 @@ export default {
                         let orSql = ''
                         // eslint-disable-next-line no-redeclare
                         for (const i in positionsDatas) {
+                            console.log('i', i)
+                            console.log('i12121', positionsDatas[i])
                             if (i === '0') {
                                 orSql = `wj.quan_xian_xin_xi_ LIKE '%${positionsDatas[i].id}%'`
                             } else {
@@ -506,6 +521,7 @@ export default {
                     wheres1 = wheres1 + ` and FIND_IN_SET (wj.fen_lei_id_,'${fileType}')`
                 }
             }
+            // 没走
             if (sorts) {
                 if (JSON.stringify(sorts) !== '{}') {
                     wheres1 = wheres1 + ` order by  ${sorts.sortBy}  ${sorts.order === 'ascending' ? 'asc' : 'desc'}`
@@ -538,6 +554,7 @@ export default {
         WHERE wj.shi_fou_guo_shen_ ='有效' and ((sq.cha_yue_jie_zhi_s >DATE_FORMAT(NOW(), '%Y-%m-%d')) OR (sq.cha_yue_jie_zhi_s =DATE_FORMAT(NOW(), '%Y-%m-%d')))
         and wj.quan_xian_xin_xi_ like '%${this.userId}%'  ${wheres3} `
             const sqlArr = [comSql, buMenSql, authoritySql]
+            // console.log('sqlArr', sqlArr)
             let oldRecordSql = ''
             const buMenWhere = []
             if (this.pageKey !== 'nbwj') {
@@ -563,10 +580,13 @@ export default {
                     needSelType.push(`(${sqlArr[i]})`)
                 }
             }
+            // console.log('this.fileTypesDatas', this.fileTypesDatas)
             //   console.log('needSelType',needSelType)
             const fileSearchSql = needSelType.join('union all')
+            // console.log('fileSearchSql', fileSearchSql)
             const sql = this.pageKey === 'nbwj' ? `select sq.* from (${fileSearchSql}) sq ORDER BY sq.wen_jian_bian_hao DESC,sq.wen_jian_ming_che DESC` : oldRecordSql
             // console.log('sql------------:', sql)
+            // console.log('sql121', sql)
             curdPost('sql', sql).then(res => {
                 const tableDatas = res.variables.data
                 this.selectListData = JSON.parse(JSON.stringify(tableDatas))
@@ -610,10 +630,12 @@ export default {
                 this.showCaoZuoColumn = false
                 this.listConfig.columns = this.removeColumnByProp(this.listConfig.columns, 'cao_zuo')
             }
-
             this.show = 'detail'
+            console.log('nodeData', nodeData)
+            console.log('nodeId', nodeId)
             this.addDataCont = { fenLei: nodeData.name, fenLeiId: nodeId }
             const fileTypes = []
+            console.log(this.oldorgId === nodeId)
             if (this.oldorgId === nodeId && (nodeData.name !== '文件分类')) {
                 return
             }
@@ -621,6 +643,7 @@ export default {
             const noHadNext = nodeData.children === undefined
             if (noHadNext && this.pageKey === 'wjkzgl-ywyxjlsc') {
                 const chongfu = this.listConfig.toolbars.filter(el => {
+                    console.log('this.listConfig', this.listConfig)
                     return el.key === 'add'
                 })
                 if (chongfu.length === 0 && this.depth !== 0) {
@@ -638,9 +661,11 @@ export default {
                 shiJiSql: [],
                 sheBeiSql: []
             }
+            // 判断是否有下级菜单
             if (nodeData.children === undefined) {
                 const authorityName = JSON.parse(nodeData.authorityName)
                 fileTypes.push(nodeId)
+                // console.log('fileTypes', fileTypes)
                 if (authorityName.chaYue === '公用查阅') {
                     this.fileTypesDatas.comAuthority.push(nodeId)
                 }
@@ -672,6 +697,7 @@ export default {
             this.sqlWhere = {
                 fileType: fileTypes.join(',')
             }
+            console.log('this.sqlWhere', this.sqlWhere)
             this.getDatas()
         },
         // 开启表单页面
@@ -805,16 +831,49 @@ export default {
             this.refreshData()
         },
         handleClickTag (val) {
+            console.log('val', val)
             const sql = `select * from ibps_file_attachment where id_= '${val.fu_jian_}'`
             this.$common.request('sql', sql).then(res => {
+                console.log('res', res)
+                // this.fileInfos = {}// 本人添加
                 const { data = [] } = res.variables || {}
                 if (!data.length) {
                     this.$message.warning('没有可查阅的文件,请查明原因!')
                     return
                 }
-                this.fileInfos = { id: val.id, FILE_NAME_: val.wen_jian_ming_che, fileInfos: data[0], func: this.handleUpdate }
+                this.fileInfos = { id: val.id, FILE_NAME_: val.wen_jian_ming_che, fileInfos: data[0], func: this.handleUpdate, ban_ben_: val.ban_ben_ }
                 this.dialogVisible = true
             })
+            // 本人修改
+            // this.fileArray = []
+            // this.handleFileInfo(val)
+            // const sql1 = `select t_wjxxb.*, t_wjxzxdjlb.xiu_ding_ban_ben_, t_wjxzxdjlb.xiu_ding_nei_rong,t_wjxzxdjlb.yuan_yin_
+            // from  t_wjxxb
+            // INNER JOIN t_wjxzxdjlb ON  t_wjxxb.shu_ju_lai_yuan_ = t_wjxzxdjlb.id_ WHERE  tou_ban_wen_jian_='${val.id}' `
+            // // const sql1 = `select * from t_wjxxb WHERE tou_ban_wen_jian_='${val.id}'`
+            // this.$common.request('sql', sql1).then(res => {
+            //     console.log('res测试', res)
+            //     const list = res.variables.data
+            //     list.forEach(el => {
+            //         const obj = { id: el.id_, wen_jian_ming_che: el.wen_jian_ming_che, fu_jian_: el.wen_jian_fu_jian_, xiu_ding_nei_rong: el.xiu_ding_nei_rong, yuan_yin_: el.yuan_yin_, xiu_ding_ban_ben_: el.xiu_ding_ban_ben_ }
+            //         this.handleFileInfo(obj)
+            //     })
+            //     this.dialogVisible = true
+            // })
+        },
+        handleFileInfo (val) {
+            const sql = `select * from ibps_file_attachment where id_= '${val.fu_jian_}'`
+            this.$common.request('sql', sql).then(res => {
+                console.log('res', res)
+                // this.fileInfos = {}// 本人添加
+                const { data = [] } = res.variables || {}
+                if (!data.length) {
+                    this.$message.warning('没有可查阅的文件,请查明原因!')
+                    return
+                }
+                this.fileInfos = { id: val.id, FILE_NAME_: val.wen_jian_ming_che, fileInfos: data[0], func: this.handleUpdate, ban_ben_: val.ban_ben_ }
+                this.fileArray.push(this.fileInfos)
+            })
         },
         handleUpdate (fileId, time) {
             const addParams = {