浏览代码

fix home2

scorpio 2 年之前
父节点
当前提交
33cb84f5a8

+ 9 - 9
src/layout/left.vue

@@ -44,11 +44,11 @@ export default {
           img: new URL('../assets/svg/icon1.svg', import.meta.url).href,
           path: '/home'
         },
-        {
-          name: '任务列表',
-          img: new URL('../assets/svg/icon1.svg', import.meta.url).href,
-          path: '/task'
-        },
+        // {
+        //   name: '任务列表',
+        //   img: new URL('../assets/svg/icon1.svg', import.meta.url).href,
+        //   path: '/task'
+        // },
         {
           name: '资 料 库',
           img: new URL('../assets/svg/icon2.svg', import.meta.url).href,
@@ -82,12 +82,12 @@ export default {
     init () {
       if (this.currentPage.indexOf('/invest') > -1) {
         this.active = 1
-      } else if (this.currentPage.indexOf('/task') > -1) {
-        this.active = 2
+      // } else if (this.currentPage.indexOf('/task') > -1) {
+      //   this.active = 2
       } else if (this.currentPage.indexOf('/database') > -1) {
-        this.active = 3
+        this.active = 2
       } else if (this.currentPage.indexOf('/recycle') > -1) {
-        this.active = 4
+        this.active = 3
       } else {
         this.active = 0
       }

+ 9 - 2
src/page/login.vue

@@ -85,10 +85,13 @@
                 <div class='flex flex-col mt-10 flex-center'>
                   <span class='grey-6'>由梧桐研究院提供技术支持</span>
                   <span class='grey-6 mt-5'>使用问题请咨询:13908866200</span>
-                  <el-button color='#558FF1' @click='download("https://wutong-1302848345.cos.ap-chengdu.myqcloud.com/wtzx/f1372710ca1f4245b1d2d54067b403c0.pdf")' style='width: 160px' plain class='mt-10 blockss'>
+                  <el-button color='#558FF1'
+                             @click='download("https://wutong-1302848345.cos.ap-chengdu.myqcloud.com/wtzx/f1372710ca1f4245b1d2d54067b403c0.pdf")'
+                             style='width: 160px' plain class='mt-10 blockss'>
                     点击下载用户指南
                   </el-button>
-                  <span class='grey-6 mt-5 font-12 mt-20'>为了获得最佳体验,您可以<span class='blue pointer' @click='download("https://www.google.cn/intl/zh-CN/chrome/")'>点击此处</span>获取Chrome 浏览器</span>
+                  <span class='grey-6 mt-5 font-12 mt-20'>为了获得最佳体验,您可以<span class='blue pointer'
+                                                                                       @click='download("https://www.google.cn/intl/zh-CN/chrome/")'>点击此处</span>获取Chrome 浏览器</span>
                 </div>
               </div>
             </div>
@@ -179,6 +182,10 @@ export default {
   },
   methods: {
     init () {
+      const dev =
+          window.location.href.indexOf('dash.wutongshucloud.com') > -1 ||
+          window.location.href.indexOf('localhost') > -1
+      sessionStorage.setItem('dev', dev)
       this.$api.login.captcha().then(res => {
         this.code = res.image
         this.header = res.key

+ 51 - 47
src/views/home/component/dash.vue

@@ -172,19 +172,19 @@
 import BaseButton from '../../../components/base-button.vue'
 import permissionStore from '@/store/permission.js'
 import formDialog from '@/views/home/component/form_dialog.vue'
-import {getLazyList} from '@/api/project/index.js'
+import { getLazyList } from '@/api/project/index.js'
 import summaryDialog from '@/views/home/component/summary_dialog.vue'
-import {useStore} from '@/store/user.js'
+import { useStore } from '@/store/user.js'
 
 export default {
   name: 'dash',
-  components: {BaseButton, formDialog, summaryDialog},
-  setup() {
+  components: { BaseButton, formDialog, summaryDialog },
+  setup () {
     const permissions = permissionStore()
     const user = useStore()
-    return {permissions, user}
+    return { permissions, user }
   },
-  data() {
+  data () {
     return {
       dialogLoading: false,
       disable: false,
@@ -303,7 +303,7 @@ export default {
           {
             label: '认定时间',
             prop: 'year',
-            width: 160,
+            width: 160
           }]
       },
       page: {
@@ -325,7 +325,7 @@ export default {
       },
       rules: {
         name: [
-          {required: true, message: '请输入项目名称', trigger: 'blur'}
+          { required: true, message: '请输入项目名称', trigger: 'blur' }
         ],
         projectType: [
           {
@@ -347,10 +347,12 @@ export default {
       queryData: null,
       owerQuery: {},
       projectStageQuery: {},
-      selectList: []
+      selectList: [],
+      dev: false
     }
   },
-  created() {
+  created () {
+    this.dev = sessionStorage.getItem('dev') === 'true'
     const index = this.option.column.findIndex(sub => sub.prop === 'lot')
     const indexLabel = this.option.column.findIndex(sub => sub.prop === 'responsible_unit')
     console.log(indexLabel)
@@ -373,19 +375,19 @@ export default {
     this.getTypeList()
     this.getNumList()
   },
-  unmounted() {
+  unmounted () {
     sessionStorage.removeItem('selectList')
   },
   methods: {
-    switchTab(item, index) {
+    switchTab (item, index) {
       this.active = index
       this.num = this.numList[index].totalAmount
-      this.projectStageQuery = {projectStage: item.dictKey}
+      this.projectStageQuery = { projectStage: item.dictKey }
       this.onLoad(Object.assign(this.owerQuery, this.projectStageQuery))
     },
-    onLoad(query = {}) {
+    onLoad (query = {}) {
       this.loading = true
-      const data = {...this.owerQuery, parentId: this.parentId}
+      const data = { ...this.owerQuery, parentId: this.parentId }
       this.queryData = data
       this.$api.project.projectList(this.page.currentPage, this.page.pageSize, this.queryData).then(res => {
         this.loading = false
@@ -393,6 +395,8 @@ export default {
           this.data = res.data.records.map(e => {
             e.projectStage = e.projectStage + ''
             e.selected = true
+            const xian = e.name.indexOf('县')
+            e.name = this.dev ? e.name.substring(xian + 1) : e.name
             return e
           })
           this.page.total = res.data.total
@@ -401,10 +405,10 @@ export default {
         this.loading = false
       })
     },
-    selectionChange(list) {
+    selectionChange (list) {
       this.selectList = list.map(sub => sub.id)
     },
-    beforeOpen(done, type) {
+    beforeOpen (done, type) {
       if (['edit'].includes(type)) {
         if (this.user.info.account !== '15368241401') {
           this.$confirm('暂未授权使用', {
@@ -415,26 +419,26 @@ export default {
         } else {
           this.$router.push({
             path: '/home/details',
-            query: {id: this.form.id, type: '0', ownerId: this.form.createUser}
+            query: { id: this.form.id, type: '0', ownerId: this.form.createUser }
           })
         }
       } else if (type === 'view') {
         this.$router.push({
           path: '/home/pro_detail',
-          query: {id: this.form.id, projectStage: this.form.project_stage}
+          query: { id: this.form.id, projectStage: this.form.project_stage }
         })
       }
     },
-    currentChange(currentPage) {
+    currentChange (currentPage) {
       this.page.current = currentPage
     },
-    sizeChange(pageSize) {
+    sizeChange (pageSize) {
       this.page.size = pageSize
     },
-    refreshChange() {
+    refreshChange () {
       this.onLoad()
     },
-    treeLoad(tree, treeNode, resolve) {
+    treeLoad (tree, treeNode, resolve) {
       this.loading = true
       getLazyList(tree.id).then(res => {
         this.loading = false
@@ -444,24 +448,24 @@ export default {
         }))
       })
     },
-    rowDel(row) {
+    rowDel (row) {
       this.$confirm('确定删除选择的项目?', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       })
-          .then(() => {
-            this.$api.project.projectRemove({ids: row.id}).then(res => {
-              if (res.code === 200) {
-                this.$message.success(res.msg)
-                this.onLoad()
-              } else {
-                this.$message.error(res.msg)
-              }
-            })
+        .then(() => {
+          this.$api.project.projectRemove({ ids: row.id }).then(res => {
+            if (res.code === 200) {
+              this.$message.success(res.msg)
+              this.onLoad()
+            } else {
+              this.$message.error(res.msg)
+            }
           })
+        })
     },
-    getNumList(data) {
+    getNumList (data) {
       this.$api.project.userNunList(data).then(res => {
         if (res.code === 200) {
           this.numList = res.data.projectStage
@@ -469,17 +473,17 @@ export default {
         }
       })
     },
-    getTypeList() {
-      this.$api.project.typeList({type: 1, size: 999, current: 1}).then(res => {
+    getTypeList () {
+      this.$api.project.typeList({ type: 1, size: 999, current: 1 }).then(res => {
         this.typeList = res.data.records
       })
-      this.$api.common.dicList({code: 'project-tags'}).then(res => {
+      this.$api.common.dicList({ code: 'project-tags' }).then(res => {
         if (res.code === 200) {
           this.tagsList = res.data
         }
       })
     },
-    track(res) {
+    track (res) {
       if (res.is_report === 1) {
         this.$message.error('该项目已经上报')
         return
@@ -489,7 +493,7 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        const data = {id: res.id, is_report: 1, project_stage: res.project_stage === 1 ? 2 : res.project_stage}
+        const data = { id: res.id, is_report: 1, project_stage: res.project_stage === 1 ? 2 : res.project_stage }
         this.$api.project.proUpdate(data).then(res => {
           if (res.code === 200) {
             this.onLoad()
@@ -500,7 +504,7 @@ export default {
         })
       })
     },
-    projectSave() {
+    projectSave () {
       if (this.disable) {
         this.$message.error('正在处理,请稍后...')
         return
@@ -524,23 +528,23 @@ export default {
         }
       })
     },
-    formDialogClose() {
+    formDialogClose () {
       if (this.diaType === 0) {
         this.onLoad()
       }
       this.diaType = -1
     },
-    exportExcel(res) {
-      const data = Object.assign({...this.queryData}, {
+    exportExcel (res) {
+      const data = Object.assign({ ...this.queryData }, {
         columnName: res,
         projectIds: this.selectList.join(','),
         previewType: 1
       })
-      this.$router.push({query: data, path: '/home/excel'})
+      this.$router.push({ query: data, path: '/home/excel' })
     },
-    exportExcelTotal(item) {
-      const dataIds = {...this.queryData, ...item, projectIds: this.selectList.join(','), previewType: 2}
-      this.$router.push({query: dataIds, path: '/home/excel'})
+    exportExcelTotal (item) {
+      const dataIds = { ...this.queryData, ...item, projectIds: this.selectList.join(','), previewType: 2 }
+      this.$router.push({ query: dataIds, path: '/home/excel' })
     }
   }
 }

+ 16 - 12
src/views/home/component/params/params1.vue

@@ -224,14 +224,14 @@ export default {
   },
   watch: {
     detail: {
-      handler(val) {
+      handler (val) {
         this.form = val
         this.form.construction_start_and_end_new = ''
       },
       immediate: true
     },
     disabled: {
-      handler(val) {
+      handler (val) {
         if (val) {
           this.updata()
         }
@@ -239,29 +239,33 @@ export default {
       immediate: false
     }
   },
-  data() {
+  data () {
     return {
       disabled: true,
       form: {},
       areaDic: [],
       yesOrNo: [
-        {label: '否', value: 0},
-        {label: '是', value: 1}
-      ]
+        { label: '否', value: 0 },
+        { label: '是', value: 1 }
+      ],
+      dev: false
     }
   },
-  created() {
+  created () {
+    this.dev = sessionStorage.getItem('dev') === 'true'
+    const xian = this.form.name.indexOf('县')
+    this.form.name = this.dev ? this.form.name.substring(xian + 1) : this.form.name
     this.areaList()
   },
   methods: {
-    areaList() {
-      this.$api.common.region({code: ''}).then(res => {
+    areaList () {
+      this.$api.common.region({ code: '' }).then(res => {
         if (res.code === 200) {
           this.areaDic = res.data.map(item => this.mapTree(item))
         }
       })
     },
-    mapTree(item) {
+    mapTree (item) {
       const haveChildren = Array.isArray(item.children) && item.children.length > 0
       return {
         key: item.id,
@@ -270,7 +274,7 @@ export default {
         children: haveChildren ? item.children.map(i => this.mapTree(i)) : []
       }
     },
-    updata() {
+    updata () {
       this.form.projectId = this.detail.id
       this.form.total_amount = Number.parseFloat(this.detail.total_amount)
       delete this.detail._id
@@ -282,7 +286,7 @@ export default {
         }
       })
     },
-    changeDate(res) {
+    changeDate (res) {
       this.form.construction_start_and_end = res.join(',')
     }
   }

+ 1 - 1
src/views/invest/components/amount.vue

@@ -92,7 +92,7 @@ export default {
             prop: 'totalCompleteAmount',
             sortable: true,
             formatter: (row, value) => {
-              return value.toLocaleString()
+              return Number.parseFloat(value).toLocaleString()
             }
           },
           {

+ 1 - 1
src/views/invest/components/chart.vue

@@ -115,7 +115,7 @@ export default {
               normal: {
                 label: {
                   show: true,
-                  color: 'red',
+                  color: '#528BEC',
                   fontSize: 12
                 }
               }

+ 24 - 21
src/views/invest/components/complete.vue

@@ -13,10 +13,12 @@
     </div>
     <avue-crud
         :option="option"
-        :data="data"
         :before-open="beforeOpen"
-        ref="crud"
-        v-model="form">
+        v-model="form"
+        :data="data">
+      <template #projectname='{row}'>
+        <div :class='row.yearlyCompleteAmount === "0" ? "red":"" '>{{ row.projectName }}</div>
+      </template>
     </avue-crud>
   </div>
 </template>
@@ -40,25 +42,25 @@ export default {
   },
   watch: {
     type: {
-      handler(val) {
+      handler (val) {
         this.initOption(val)
       },
       immediate: false
     },
     deptId: {
-      handler(val) {
+      handler (val) {
         this.onLoad()
       },
       immediate: true
     },
     year: {
-      handler(val) {
+      handler (val) {
         this.onLoad()
       },
       immediate: true
     }
   },
-  data() {
+  data () {
     return {
       month: '',
       quarter: '',
@@ -71,6 +73,7 @@ export default {
         viewBtn: true,
         viewBtnText: '填报',
         menu: true,
+        menuWidth: 100,
         size: 'mini',
         editBtn: false,
         addBtn: false,
@@ -89,8 +92,9 @@ export default {
             prop: 'yearlyPlanCompleteAmount'
           },
           {
-            label: '完成投资(万元)',
-            prop: 'yearlyCompleteAmount'
+            label: '完成投资(万元)',
+            prop: 'yearlyCompleteAmount',
+            slot: true
           },
           {
             label: '完成率',
@@ -102,7 +106,7 @@ export default {
     }
   },
   methods: {
-    onLoad() {
+    onLoad () {
       const data = {
         deptId: this.deptId === null ? '' : this.deptId,
         year: this.year === null ? '' : this.year,
@@ -115,42 +119,41 @@ export default {
         }
       })
     },
-    initOption(res) {
-      console.log('initOption')
+    initOption (res) {
       this.month = ''
       this.selectOption.length = 0
       switch (res.value) {
         case 1:
           for (let i = 1; i <= 3; i++) {
-            const item = {label: i + '月', value: i}
+            const item = { label: i + '月', value: i }
             this.selectOption.push(item)
           }
           this.quarter = 1
           break
         case 2:
           for (let i = 4; i <= 6; i++) {
-            const item = {label: i + '月', value: i}
+            const item = { label: i + '月', value: i }
             this.selectOption.push(item)
           }
           this.quarter = 2
           break
         case 3:
           for (let i = 7; i <= 9; i++) {
-            const item = {label: i + '月', value: i}
+            const item = { label: i + '月', value: i }
             this.selectOption.push(item)
           }
           this.quarter = 3
           break
         case 4:
           for (let i = 10; i <= 12; i++) {
-            const item = {label: i + '月', value: i}
+            const item = { label: i + '月', value: i }
             this.selectOption.push(item)
           }
           this.quarter = 4
           break
         default:
           for (let i = 1; i <= 12; i++) {
-            const item = {label: i + '月', value: i}
+            const item = { label: i + '月', value: i }
             this.selectOption.push(item)
             this.month = ''
             this.quarter = ''
@@ -159,19 +162,19 @@ export default {
       }
       this.onLoad()
     },
-    changeMonth(res) {
+    changeMonth (res) {
       console.log('changeMonth')
       this.month = res
       this.onLoad()
     },
-    beforeOpen(done, type) {
+    beforeOpen (done, type) {
       if (type === 'view') {
         this.$router.push({
           path: '/home/pro_detail',
-          query: {id: this.form.id, projectStage: this.form.project_stage}
+          query: { id: this.form.id, projectStage: this.form.project_stage }
         })
       }
-    },
+    }
   }
 }
 </script>