scorpio 3 years ago
parent
commit
0f79c1d323

+ 1 - 1
src/api/login/index.js

@@ -33,7 +33,7 @@ export default {
    * @returns {Promise | Promise<unknown>}
    */
   getPermission () {
-    return fetch('/blade-system/menu/buttons')
+    return fetch('/blade-system/menu/buttons?clientId=project_web')
   },
   qrCode () {
     return fetch('/wutong-base/oauth/qrcodeLogin')

+ 25 - 5
src/components/basic-form/sub.vue

@@ -165,7 +165,8 @@
           </template>
           <div class='full-width flex  flex-align-center full-height text-left full-width'
                style='white-space: pre-wrap;text-overflow: ellipsis;'>
-            <input v-model='editData[item.prop]' :disabled='disable' type='number' class='full-width'
+            <div v-if='disable'> {{Number.parseFloat(editData[item.prop]).toLocaleString()}}</div>
+            <input v-else v-model='editData[item.prop]' :disabled='disable' type='number' class='full-width'
                              :placeholder='`请输入` + item.label' step='2'
                              @change='change($event,item)'/>
             <el-icon v-if='!disable' class="padding-right padding-top">
@@ -202,7 +203,6 @@ export default {
           this.getDic(val).then(res => {
             val.dict = res
           })
-          console.log(val.dict)
         } else if (val.type === 'area') {
           const tmp = {
             dict: '/blade-system/region/lazy-list',
@@ -217,8 +217,10 @@ export default {
             val.dict = res
           })
         } else if (val.type === 'select') {
+          console.log(val)
           this.getDic(val).then(res => {
             val.dict = res
+            console.log(val.dict)
           })
         }
       },
@@ -255,7 +257,13 @@ export default {
         localStorage.setItem('lazy-list', JSON.stringify(result))
       } else {
         const tmp = await this.$api.common.basicFormRequest(item.expand.dict)
-        result = tmp.data.map(sub => this.mapTree(sub, item.expand))
+        result = tmp.data.map(sub => {
+          const result = {}
+          console.log(item.expand)
+          result.label = sub[item.expand.prop.label]
+          result.value = sub[item.expand.prop.value]
+          return result
+        })
       }
       return result
     },
@@ -263,8 +271,8 @@ export default {
       const haveChildren = Array.isArray(item.children) && item.children.length > 0
       return {
         key: item.label,
-        value: item[expand.props.value],
-        label: item[expand.props.label],
+        value: item[expand.prop.value],
+        label: item[expand.prop.label],
         children: haveChildren ? item.children.map(i => this.mapTree(i, expand)) : []
       }
     },
@@ -289,6 +297,18 @@ export default {
           this.editData.provinceCode = res[0]
           this.editData.province = res[0]
         }
+      } else if (item.type === 'daterange') {
+        if (item.prop === 'buildDate') { // 建设期
+          this.editData.startDate = this.editData.buildDate[0]
+          this.editData.endDate = this.editData.buildDate[1]
+        } else if (item.prop === 'operationDate') {
+          this.editData.operationStartDate = this.editData.operationDate[0]
+          this.editData.operationEndDate = this.editData.operationDate[1]
+        }
+      } else if (item.type === 'select') {
+        const tmp = item.dict.find(sub => sub.value === this.editData.dictName.toString())
+        this.editData[item.prop] = tmp.label
+        this.editData[item.params] = tmp.value
       }
       this.$emit('change', this.editData)
     }

+ 2 - 2
src/page/404.vue

@@ -1,6 +1,6 @@
 <template>
-  <div class='full-width full-height flex flex-center'>
-    <el-empty description='404'/>
+  <div class='full-screen flex flex-center'>
+    <el-empty description='404 页面丢失'/>
   </div>
 </template>
 

+ 14 - 8
src/views/home/component/authorize.vue

@@ -16,7 +16,7 @@
       </div>
       <div style='overflow-y: scroll; height: 450px'>
         <div v-for='(item,index) in fileList' :key='item.id'>
-          <item1 :check='item.type' :data='item' :index='index' @change='change'/>
+          <item1 :check='item.check' :data='item' :index='index' @change='change'/>
         </div>
       </div>
     </div>
@@ -76,7 +76,7 @@ export default {
       handler (val) {
         this.fileList = val
         this.fileList.map(sub => {
-          sub.type = this.check
+          sub.check = this.check
           return sub
         })
       },
@@ -104,8 +104,10 @@ export default {
       }
       this.startTime = this.authorizeDate[0]
       this.endTime = this.authorizeDate[1]
-      const tmps = this.fileList.map(sub => {
-        const item = { fileId: sub.id, startTime: this.startTime, endTime: this.endTime, status: sub.type }
+      console.log(this.fileList[0])
+      console.log(this.fileList.filter(sub => sub.type === '1'))
+      const fileTmps = this.fileList.filter(sub => sub.type === '1').map(sub => {
+        const item = { fileId: sub.id, startTime: this.startTime, endTime: this.endTime, status: sub.check }
         return item
       })
       const folder = [{
@@ -114,7 +116,11 @@ export default {
         endTime: this.endTime,
         status: this.check
       }]
-      this.$api.project.initCode({ files: tmps, folders: folder, type: 1, projectId: this.projectId }).then(res => {
+      const folderTmp = this.fileList.filter(sub => sub.type === '2').map(sub => {
+        const item = { folderId: sub.id, startTime: this.startTime, endTime: this.endTime, status: sub.check }
+        return item
+      })
+      this.$api.project.initCode({ files: fileTmps, folders: folder.concat(folderTmp), type: 1, projectId: this.projectId }).then(res => {
         if (res.code === 200) {
           this.qrCodeText = 'https://dev.wutongresearch.club/apply?id=' + res.data.qrcode.qrcodeId + '&roleName=服务商'
           this.qrCodeShow = true
@@ -125,7 +131,7 @@ export default {
     },
     allChange (res) {
       this.fileList.forEach(sub => {
-        sub.type = res
+        sub.check = res
         return sub
       })
     },
@@ -135,9 +141,9 @@ export default {
       let editCount = 0
       let notCount = 0
       this.fileList.forEach(sub => {
-        if (sub.type === '1') {
+        if (sub.check === '1') {
           seeCount = seeCount + 1
-        } else if (sub.type === '2') {
+        } else if (sub.check === '2') {
           editCount = editCount + 1
         } else {
           notCount = notCount + 1

+ 19 - 18
src/views/home/component/current.vue

@@ -65,16 +65,16 @@ import baseButton from '../../../components/base-button.vue'
 import uploadFile from '../../../components/upload-file.vue'
 import authorize from '@/views/home/component/authorize.vue'
 import permissionStore from '@/store/permission.js'
-import {useStore} from '@/store/user.js'
+import { useStore } from '@/store/user.js'
 
 export default {
   name: 'current',
-  components: {filesList, baseButton, uploadFile, authorize},
+  components: { filesList, baseButton, uploadFile, authorize },
   props: {
     id: String,
     data: Object
   },
-  data() {
+  data () {
     return {
       authorizeShow: false,
       addShow: false,
@@ -98,30 +98,31 @@ export default {
       isAccess: ''
     }
   },
-  setup() {
+  setup () {
     const permissions = permissionStore()
     const user = useStore()
-    return {permissions, user}
+    return { permissions, user }
   },
-  created() {
+  created () {
     this.isAccess = this.$route.query.isAccess
-    console.log(this.sendParams)
+    this.projectId = this.$route.query.projectId
     this.folderInfo.dictKey = this.$route.query.dictKey
     this.folderInfo.projectStageId = this.$route.query.projectStageId
   },
   methods: {
-    showClick() {
+    showClick () {
       this.authorizeShow = true
     },
-    success(res) {
+    success (res) {
       this.fileList = res.fileList.map(res => {
         const item = {}
         item.title = res.response.data.originalFileName
         item.suffix = res.response.data.suffix
         item.volume = res.response.data.volume
         item.fileId = res.response.data.id
+        item.url = res.response.data.filePath
         item.fileFolderId = this.id
-        item.projectId = this.projectId
+        item.projectId = this.$route.query.projectId
         return item
       })
       this.fileList.forEach(sub => {
@@ -135,8 +136,8 @@ export default {
         }
       })
     },
-    saveLibrary(sub) {
-      const data = {category: 4, content: ''}
+    saveLibrary (sub) {
+      const data = { category: 4, content: '' }
       this.$api.common.submit(Object.assign(sub, data)).then(res => {
         if (res.code === 200) {
           this.saveCount++
@@ -146,7 +147,7 @@ export default {
         }
       })
     },
-    addFile() {
+    addFile () {
       this.$api.project.fileAdd(this.fileList).then(res => {
         if (res.code === 200) {
           this.show = false
@@ -158,9 +159,9 @@ export default {
               cancelButtonText: '取消',
               type: 'warning'
             })
-                .then(() => {
-                  this.SendMsg()
-                })
+              .then(() => {
+                this.SendMsg()
+              })
           }
         } else {
           this.show = false
@@ -168,7 +169,7 @@ export default {
         }
       })
     },
-    SendMsg() {
+    SendMsg () {
       this.sendParams.ids = this.fileList.map(e => e.fileId).join(',')
       this.sendParams.projectId = this.$route.query.projectId
       this.sendParams.ownerId = this.$route.query.ownerId
@@ -183,7 +184,7 @@ export default {
         }
       })
     },
-    folderAdd() {
+    folderAdd () {
       this.folderInfo.projectId = this.projectId
       this.folderInfo.parentId = this.id
       this.$api.project.folderAdd(this.folderInfo).then(res => {

+ 58 - 54
src/views/home/component/files_list.vue

@@ -19,9 +19,9 @@
           <img v-else class="icon" src="../../../assets/svg/folder/other.svg">
         </div>
         <div v-else class="flex-1">
-          <img v-if="item.IsAccess === '1'" src="../../../assets/svg/folder/see.svg" style="width: 50px;height: 46px">
-          <img v-if="item.IsAccess === '2'" src="../../../assets/svg/folder/edit.svg" style="width: 50px;height: 46px">
-          <img v-if="item.IsAccess === '3'" src="../../../assets/svg/folder/invisible.svg"
+          <img v-if="item.isAccess === '1'" src="../../../assets/svg/folder/see.svg" style="width: 50px;height: 46px">
+          <img v-if="item.isAccess === '2'" src="../../../assets/svg/folder/edit.svg" style="width: 50px;height: 46px">
+          <img v-if="item.isAccess === '3'" src="../../../assets/svg/folder/invisible.svg"
                style="width: 50px;height: 46px">
         </div>
         <span style="flex: 2;text-align: left">{{ item.title }}</span>
@@ -35,9 +35,9 @@
         <div class="flex flex-center" style="flex: 3">
           <main-button icon="View" title="详情" width="85" @click="View(item)"/>
           <main-button v-if="item.type === '1'" icon="Download" title="下载" width="85" @click="downFile(item)"/>
-          <main-button v-else-if="item.type === '2' && item.IsAccess === '2'" icon="Upload" title="上传文件" width="85"
+          <main-button v-else-if="item.type === '2' && item.isAccess === '2'" icon="Upload" title="上传文件" width="85"
                        @click="upload(item)"/>
-          <main-button v-else-if="item.type === '2' && item.IsAccess === '3'" icon="Position"
+          <main-button v-else-if="item.type === '2' && item.isAccess === '3'" icon="Position"
                        title="授权申请" width="85" @click="folderApply(item)"/>
           <main-button v-else='item.del' icon="Delete" title="删除" width="85" @click="removeFile(item)"/>
         </div>
@@ -91,20 +91,20 @@
 
 <script>
 import mainButton from '../../../components/main-button.vue'
-import {bytesToSize} from '@/utils/tools.js'
-import {useStore} from '@/store/user.js'
+import { bytesToSize } from '@/utils/tools.js'
+import { useStore } from '@/store/user.js'
 import permissionStore from '@/store/permission.js'
 import uploadFile from '../../../components/upload-file.vue'
 
 export default {
   name: 'files_list',
-  components: {mainButton, uploadFile},
+  components: { mainButton, uploadFile },
   props: {
     data: Object
   },
   watch: {
     data: {
-      handler(val) {
+      handler (val) {
         if (val === '' || val === null) {
           return
         }
@@ -131,12 +131,12 @@ export default {
       immediate: true
     }
   },
-  setup() {
+  setup () {
     const user = useStore()
     const permission = permissionStore()
-    return {user, permission}
+    return { user, permission }
   },
-  data() {
+  data () {
     return {
       show: false,
       applyShow: false,
@@ -154,14 +154,14 @@ export default {
         projectId: ''
       },
       currentFolder: null,
-      applyTime: [],
+      applyTime: []
     }
   },
-  created() {
+  created () {
     this.query = this.$route.query
   },
   methods: {
-    View(item) {
+    View (item) {
       if (item.type === '1') {
         if (['png', 'jpg'].includes(item.suffix)) {
           this.showImage = true
@@ -171,6 +171,7 @@ export default {
         this.$router.push('/home/file_detail?id=' + item.fileId)
       } else if (item.type === '2') {
         this.query.id = item.id
+        console.log(item)
         this.$router.push({
           path: '/home/files',
           query: {
@@ -178,18 +179,19 @@ export default {
             projectId: this.query.projectId,
             projectStageId: this.query.projectStageId,
             dictKey: this.query.dictKey,
-            parentId: item.id
+            parentId: item.id,
+            isAccess: item.isAccess
           }
         })
       }
     },
-    upload(item) {
+    upload (item) {
       this.show = true
       console.log(item)
       this.fileFolderId = item.id
       console.log(this.fileFolderId)
     },
-    success(res) {
+    success (res) {
       console.log(this.fileFolderId)
       this.fileList = res.fileList.map(res => {
         const item = {}
@@ -197,8 +199,9 @@ export default {
         item.suffix = res.response.data.suffix
         item.volume = res.response.data.volume
         item.fileId = res.response.data.id
+        item.url = res.response.data.filePath
         item.fileFolderId = this.fileFolderId
-        item.projectId = this.query.projectId
+        item.projectId = this.$route.query.projectId
         return item
       })
       this.fileList.forEach(sub => {
@@ -212,8 +215,8 @@ export default {
         }
       })
     },
-    saveLibrary(sub) {
-      const data = {category: 4, content: ''}
+    saveLibrary (sub) {
+      const data = { category: 4, content: '' }
       this.$api.common.submit(Object.assign(sub, data)).then(res => {
         if (res.code === 200) {
           this.saveCount++
@@ -223,7 +226,7 @@ export default {
         }
       })
     },
-    addFile() {
+    addFile () {
       this.$api.project.fileAdd(this.fileList).then(res => {
         if (res.code === 200) {
           this.show = false
@@ -235,9 +238,9 @@ export default {
               cancelButtonText: '取消',
               type: 'warning'
             })
-                .then(() => {
-                  this.SendMsg()
-                })
+              .then(() => {
+                this.SendMsg()
+              })
           }
         } else {
           this.show = false
@@ -245,9 +248,10 @@ export default {
         }
       })
     },
-    SendMsg() {
+    SendMsg () {
       this.sendParams.ids = this.fileList.map(e => e.fileId).join(',')
-      this.sendParams.projectId = this.projectId
+      this.sendParams.projectId = this.$route.query.projectId
+      this.sendParams.ownerId = this.$route.query.ownerId
       this.$api.project.send(this.sendParams).then(res => {
         if (res.code === 200) {
           this.$message.success('消息已经发送成功!')
@@ -258,61 +262,61 @@ export default {
         }
       })
     },
-    downFile(item) {
+    downFile (item) {
       window.open(item.url, '')
     },
-    viewerClose() {
+    viewerClose () {
       this.showImage = false
       this.imgList = []
     },
-    removeFile(item) {
+    removeFile (item) {
       if (item.type === '1') {
         this.$confirm('确认是否删除所选文件/文件夹?', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
         })
-            .then(() => {
-              this.$api.project.fileRemove({ids: item.id}).then(res => {
-                if (res.code === 200) {
-                  this.$bus.emit('delete')
-                  this.$message.success(res.msg)
-                } else {
-                  this.$message.error(res.msg)
-                }
-              })
+          .then(() => {
+            this.$api.project.fileRemove({ ids: item.id }).then(res => {
+              if (res.code === 200) {
+                this.$bus.emit('delete')
+                this.$message.success(res.msg)
+              } else {
+                this.$message.error(res.msg)
+              }
             })
+          })
       } else if (item.type === '2') {
         this.$confirm('确认是否删除所选文件/文件夹?', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
         })
-            .then(() => {
-              this.$api.project.folderRemove({ids: item.id}).then(res => {
-                if (res.code === 200) {
-                  this.$message.success(res.msg)
-                  this.$bus.emit('delete')
-                } else {
-                  this.$message.error(res.msg)
-                }
-              })
+          .then(() => {
+            this.$api.project.folderRemove({ ids: item.id }).then(res => {
+              if (res.code === 200) {
+                this.$message.success(res.msg)
+                this.$bus.emit('delete')
+              } else {
+                this.$message.error(res.msg)
+              }
             })
+          })
       }
     },
-    folderApply(item) {
+    folderApply (item) {
       this.currentFolder = item
       this.applyShow = true
     },
-    submit() {
+    submit () {
       if (this.applyTime.length !== 2) {
         this.$message.error('请选择授权时间')
         return
       }
-      const tmp = {projectId: this.projectId, ownerId: this.ownerId}
-      const item = {startTime: this.applyTime[0], endTime: this.applyTime[1], folderId: this.currentFolder.fileFolderId}
+      const tmp = { projectId: this.projectId, ownerId: this.ownerId }
+      const item = { startTime: this.applyTime[0], endTime: this.applyTime[1], folderId: this.currentFolder.fileFolderId }
       const list = [item]
-      this.$api.project.apply(Object.assign(tmp, {folders: list})).then(res => {
+      this.$api.project.apply(Object.assign(tmp, { folders: list })).then(res => {
         if (res.code === 200) {
           this.applyShow = false
           this.$confirm(res.data, {
@@ -324,7 +328,7 @@ export default {
           this.$message.error(res.msg)
         }
       })
-    },
+    }
 
   }
 }

+ 4 - 3
src/views/home/component/folder_list.vue

@@ -239,7 +239,8 @@ export default {
         item.suffix = res.response.data.suffix
         item.volume = res.response.data.volume
         item.fileId = res.response.data.id
-        item.projectId = this.projectId
+        item.url = res.response.data.filePath
+        item.projectId = this.$route.query.projectId
         if (this.type === 0) {
           item.fileFolderId = this.currentRow.fileFolderId
         } else {
@@ -291,9 +292,9 @@ export default {
       })
     },
     SendMsg () {
-      this.sendParams.ownerId = this.ownerId
       this.sendParams.ids = this.fileList.map(e => e.fileId).join(',')
-      this.sendParams.projectId = this.projectId
+      this.sendParams.projectId = this.$route.query.projectId
+      this.sendParams.ownerId = this.$route.query.ownerId
       this.$api.project.send(this.sendParams).then(res => {
         if (res.code === 200) {
           this.$message.success('消息已经发送成功!')

+ 4 - 1
src/views/home/component/item1.vue

@@ -1,6 +1,9 @@
 <template>
   <div class='full-width flex flex-center text-center border-bottom padding-top padding-bottom'>
-    <div class='flex-child-average text-left'>{{item.title}}</div>
+    <div class='flex-child-average flex flex-align-center'>
+      <el-tag class='mr-10 text-left'>{{item.type === '1' ?'文件':'文件夹'}}</el-tag>
+      <div class=' text-left'>{{item.title}}</div>
+    </div>
     <div class='flex-child-average'>{{item.updateTime}}</div>
     <div class='flex-child-average'>
       <el-radio-group v-model="check" @change='change'>

+ 21 - 18
src/views/home/component/proinfo.vue

@@ -83,7 +83,10 @@ export default {
         // eslint-disable-next-line no-prototype-builtins
         if (val && val.hasOwnProperty('property')) {
           const config = JSON.parse(val.property)
-          // this.option.column = config
+          this.option.column = config
+          val.buildDate = this.data.startDate + '至' + this.data.endDate
+          val.operationDate = this.data.operationStartDate + '至' + this.data.operationEndDate
+          val.area = this.data.provinceCode + this.data.cityCode + this.data.districtCode
         }
       },
       immediate: true
@@ -124,7 +127,7 @@ export default {
               {
                 label: '地区',
                 type: 'area',
-                prop: 'province',
+                prop: 'area',
                 expand: {
                   dict: '/blade-system/region/lazy-list',
                   prop: {
@@ -151,7 +154,8 @@ export default {
                 span: '24'
               },
               {
-                prop: 'debt',
+                prop: 'dictName',
+                params: 'dictKey',
                 id: 42,
                 label: '项目领域',
                 type: 'select',
@@ -181,7 +185,7 @@ export default {
                 span: '24'
               },
               {
-                prop: 'startDate',
+                prop: 'buildDate',
                 id: 62,
                 label: '建设期',
                 type: 'daterange',
@@ -204,7 +208,7 @@ export default {
                 span: '24'
               },
               {
-                prop: 'operationStartDate',
+                prop: 'operationDate',
                 id: 72,
                 label: '运营期',
                 type: 'daterange',
@@ -232,7 +236,6 @@ export default {
                 label: '成本',
                 type: 'number',
                 parentId: 8
-
               }
             ],
             id: 8,
@@ -264,7 +267,7 @@ export default {
                 prop: 'projectSubject',
                 id: 112,
                 label: '主管部门',
-                type: 'number',
+                type: 'input',
                 parentId: 11
 
               },
@@ -286,7 +289,7 @@ export default {
                 prop: 'accountingFirm',
                 id: 122,
                 label: '会计所',
-                type: 'number',
+                type: 'input',
                 parentId: 12
 
               },
@@ -294,7 +297,7 @@ export default {
                 prop: 'lawFirm',
                 id: 132,
                 label: '律所',
-                type: 'number',
+                type: 'input',
                 parentId: 13
 
               }
@@ -316,14 +319,6 @@ export default {
             id: 11,
             type: 'row'
           },
-          {
-            prop: 'sourceIncome',
-            id: 9,
-            label: '收入来源',
-            type: 'textarea',
-            rows: 3,
-            span: '24'
-          },
           {
             prop: 'introduction',
             id: 10,
@@ -333,7 +328,15 @@ export default {
             span: '24'
           },
           {
-            prop: 'portfolioFinancing',
+            prop: 'sourceIncome',
+            id: 9,
+            label: '收入来源',
+            type: 'textarea',
+            rows: 3,
+            span: '24'
+          },
+          {
+            prop: 'portfolioFinancingDescription',
             id: 111,
             label: '其他债务融资来源',
             type: 'textarea',