scorpioyq il y a 2 ans
Parent
commit
6ba96109ee
2 fichiers modifiés avec 105 ajouts et 71 suppressions
  1. 48 51
      src/views/home/component/dash.vue
  2. 57 20
      src/views/home/component/owner_serach.vue

+ 48 - 51
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,
@@ -301,12 +301,9 @@ export default {
             }
           },
           {
-            label: '创建时间',
-            prop: 'create_time',
-            width: 120,
-            formatter: (val, value, label) => {
-              return value.substring(0, 10)
-            }
+            label: '认定时间',
+            prop: 'year',
+            width: 160,
           }]
       },
       page: {
@@ -328,7 +325,7 @@ export default {
       },
       rules: {
         name: [
-          { required: true, message: '请输入项目名称', trigger: 'blur' }
+          {required: true, message: '请输入项目名称', trigger: 'blur'}
         ],
         projectType: [
           {
@@ -353,7 +350,7 @@ export default {
       selectList: []
     }
   },
-  created () {
+  created() {
     const index = this.option.column.findIndex(sub => sub.prop === 'lot')
     const indexLabel = this.option.column.findIndex(sub => sub.prop === 'responsible_unit')
     console.log(indexLabel)
@@ -376,19 +373,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
@@ -404,10 +401,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('暂未授权使用', {
@@ -418,26 +415,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
@@ -447,24 +444,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
@@ -472,17 +469,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
@@ -492,7 +489,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()
@@ -503,7 +500,7 @@ export default {
         })
       })
     },
-    projectSave () {
+    projectSave() {
       if (this.disable) {
         this.$message.error('正在处理,请稍后...')
         return
@@ -527,23 +524,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'})
     }
   }
 }

+ 57 - 20
src/views/home/component/owner_serach.vue

@@ -72,7 +72,7 @@
           <!--              />-->
           <!--            </el-select>-->
           <!--          </el-form-item>-->
-          <div class="flex flex-center ">
+          <div class="flex flex-center">
             <el-form-item class="full-width" label="省重点">
               <el-select
                   v-model="form.isImportant"
@@ -143,7 +143,22 @@
           </div>
         </div>
         <div class="flex flex-col flex-justify-between">
-          <div></div>
+          <div>
+            <el-form-item class="full-width" label="认定时间">
+              <el-select
+                  v-model="form.projectYear"
+                  style="width: 100%;margin-right: 60px"
+                  clearable
+              >
+                <el-option
+                    v-for="item in years"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                />
+              </el-select>
+            </el-form-item>
+          </div>
           <div class="flex  flex-align-center  flex-justify-end ml-10" style="margin-bottom: 18px">
             <base-button class="pointer " icon="Delete" title="清空" type="0" width="130" @click="clear"/>
             <base-button class="pointer ml-20" width="130" @click="sure"/>
@@ -192,14 +207,14 @@
 
 <script>
 import baseButton from '../../../components/base-button.vue'
-import { useStore } from '@/store/user.js'
+import {useStore} from '@/store/user.js'
 
 export default {
   name: 'owner_serach',
-  components: { baseButton },
+  components: {baseButton},
   watch: {
     keyWords: {
-      handler (val) {
+      handler(val) {
         setTimeout(() => {
           this.change()
         }, 500)
@@ -207,11 +222,11 @@ export default {
       immediate: true
     }
   },
-  setup () {
+  setup() {
     const user = useStore()
-    return { user }
+    return {user}
   },
-  data () {
+  data() {
     return {
       deptList: [],
       form: {
@@ -223,7 +238,8 @@ export default {
         isImportant: '', // 是否省重点
         isFocusStart: '', // 是否集中开工
         deptIds: '', // 机构id,多选
-        type: true
+        type: true,
+        projectYear: ''
       },
       totalAmount: [
         {
@@ -279,6 +295,26 @@ export default {
           value: 1
         }
       ],
+      years: [
+        {
+          value: 2023,
+        },
+        {
+          value: 2022,
+        },
+        {
+          value: 2021,
+        },
+        {
+          value: 2020,
+        },
+        {
+          value: 2019,
+        },
+        {
+          value: 2018,
+        },
+      ],
       typeList: [],
       showOrg: false,
       keyWords: '',
@@ -288,16 +324,16 @@ export default {
       deptName: '机构选择'
     }
   },
-  created () {
+  created() {
     this.getTypeList()
   },
   methods: {
-    getTypeList () {
+    getTypeList() {
       this.$api.project.typeList().then(res => {
         this.typeList = res.data.records
       })
     },
-    sure () {
+    sure() {
       if (this.time1 !== null && this.form.isStart.length === 0) {
         this.$message.error('请先选择是否开工')
         return
@@ -328,7 +364,7 @@ export default {
       }
       this.$bus.emit('serach', this.form)
     },
-    visibleTime (event, type) {
+    visibleTime(event, type) {
       if (event) {
         console.log(this.form.isStart)
         if (type === 1) {
@@ -344,7 +380,7 @@ export default {
         }
       }
     },
-    clear () {
+    clear() {
       this.form.projectName = ''
       this.form.typeId = ''
       this.form.isStorage = ''
@@ -358,17 +394,18 @@ export default {
       this.form.startTime = ''
       this.form.planStorageTime = ''
       this.form.storageTime = ''
+      this.form.projectYear = ''
       this.time1 = null
       this.time2 = null
       this.deptName = '机构选择'
       this.$bus.emit('serach', this.form)
     },
-    changeAmount () {
+    changeAmount() {
       const tmps = this.form.amount.split(',')
       this.form.totalAmountMin = tmps[0] === '-' ? '' : tmps[0]
       this.form.totalAmountMax = tmps[1] === '-' ? '' : tmps[1]
     },
-    getOrg () {
+    getOrg() {
       if (this.deptList.length > 0) {
         this.showOrg = true
         return
@@ -386,10 +423,10 @@ export default {
         }
       })
     },
-    changeChecked (index) {
+    changeChecked(index) {
       this.deptList[index].checked = !this.deptList[index].checked
     },
-    orgCheck () {
+    orgCheck() {
       const checked = this.deptList.filter(sub => sub.checked)
       this.form.deptIds = checked.map(sub => sub.id).join(',')
       const tmp = checked.map(e => e.deptName)
@@ -398,13 +435,13 @@ export default {
       }
       this.showOrg = false
     },
-    orgRefresh () {
+    orgRefresh() {
       this.deptList = this.deptList.map(sub => {
         sub.checked = false
         return sub
       })
     },
-    change () {
+    change() {
       if (this.keyWords.length === 0) {
         this.deptList.forEach(sub => sub.search = false)
         return