scorpio 2 years ago
parent
commit
c18011717a

+ 276 - 185
src/views/home/component/dash.vue

@@ -3,168 +3,227 @@
     <div class="flex flex-col padding white-bg">
       <div class="flex flex-align-center tip">
         <el-icon class="ml-20" color="#BC002D">
-          <WarningFilled/>
+          <WarningFilled />
         </el-icon>
-        <span class="ml-5">项目总投资额<span
-            class="main-color bold">{{ num ? Number.parseFloat(num).toLocaleString() : '0' }}</span>万元</span>
+        <span class="ml-5"
+          >项目总投资额<span class="main-color bold">{{
+            num ? Number.parseFloat(num).toLocaleString() : '0'
+          }}</span
+          >万元</span
+        >
       </div>
-      <div class="flex ml-20 hide-scrollbar" style="overflow-x: scroll;width: 86vw;"
-           v-show='numList && numList.length > 0'>
-        <div v-for="(item,index) in numList" :key='item.id' :class="active === index ? 'total-s' : 'total'"
-             class="flex flex-center flex-justify-between mt-20 bold font-16 pointer" @click='switchTab(item,index)'
+      <div
+        class="flex ml-20 hide-scrollbar"
+        style="overflow-x: scroll; width: 86vw"
+        v-show="numList && numList.length > 0"
+      >
+        <div
+          v-for="(item, index) in numList"
+          :key="item.id"
+          :class="active === index ? 'total-s' : 'total'"
+          class="flex flex-center flex-justify-between mt-20 bold font-16 pointer"
+          @click="switchTab(item, index)"
         >
-          <span class=" sp">{{ item.name }}</span>
-          <span class=" sp1 ">{{ item.number }}<span class="grey font-13">个</span></span>
+          <span class="sp">{{ item.name }}</span>
+          <span class="sp1"
+            >{{ item.number }}<span class="grey font-13">个</span></span
+          >
         </div>
       </div>
-      <div class='flex flex-center flex-justify-start'>
-        <base-button class="ml-20 mt-20" icon="Plus" title="新增"
-                     @click="showAdd = true"/>
-        <base-button class="ml-20 mt-20" icon="el-icon-upload" title="数据导入"
-                     @click="diaType = 0"/>
-        <base-button class="ml-20 mt-20" icon="el-icon-download" title="数据导出"
-                     @click="diaType = 1"/>
-        <base-button class="ml-20 mt-20" type="0" icon="el-icon-download" title="汇总数据导出"
-                     @click="diaType = 2"/>
+      <div class="flex flex-center flex-justify-start">
+        <base-button
+          class="ml-20 mt-20"
+          icon="Plus"
+          title="新增"
+          @click="showAdd = true"
+        />
+        <base-button
+          class="ml-20 mt-20"
+          icon="el-icon-upload"
+          title="数据导入"
+          @click="diaType = 0"
+        />
+        <base-button
+          class="ml-20 mt-20"
+          icon="el-icon-download"
+          title="数据导出"
+          @click="diaType = 1"
+        />
+        <base-button
+          class="ml-20 mt-20"
+          type="0"
+          icon="el-icon-download"
+          title="汇总数据导出"
+          @click="diaType = 2"
+        />
       </div>
     </div>
-    <avue-crud ref="crud"
-               v-model="form"
-               v-model:page="page"
-               :before-open="beforeOpen"
-               :data="data"
-               :option="option"
-               :table-loading="loading"
-               class="curd"
-               @row-del="rowDel"
-               @tree-load="treeLoad"
-               @current-change="currentChange"
-               @size-change="sizeChange"
-               @refresh-change="refreshChange"
-               @selection-change="selectionChange"
-               @on-load="onLoad">
-      <template #menu="{row}">
-        <el-button v-if='user.info.viewStage !== 1' icon="Upload" type='primary' text @click="track(row)"> {{
-            row.is_report === 1 ? "项目已上报" : "项目上报"
-          }}
+    <avue-crud
+      ref="crud"
+      v-model="form"
+      v-model:page="page"
+      :before-open="beforeOpen"
+      :data="data"
+      :option="option"
+      :table-loading="loading"
+      class="curd"
+      @row-del="rowDel"
+      @tree-load="treeLoad"
+      @current-change="currentChange"
+      @size-change="sizeChange"
+      @refresh-change="refreshChange"
+      @selection-change="selectionChange"
+      @on-load="onLoad"
+    >
+      <template #menu="{ row }">
+        <el-button
+          v-if="user.info.viewStage !== 1"
+          icon="Upload"
+          type="primary"
+          text
+          @click="track(row)"
+        >
+          {{ row.is_report === 1 ? '项目已上报' : '项目上报' }}
         </el-button>
       </template>
-      <template #plan_storage_time-header="{column}">
-        <div class='flex flex-center'>
-          <div class='mr-5'>{{ (column || {}).label }}</div>
-          <el-tooltip content='红色为计划开工时间,蓝色为实际开工时间'>
+      <template #plan_storage_time-header="{ column }">
+        <div class="flex flex-center">
+          <div class="mr-5">{{ (column || {}).label }}</div>
+          <el-tooltip content="红色为计划开工时间,蓝色为实际开工时间">
             <el-icon>
-              <InfoFilled/>
+              <InfoFilled />
             </el-icon>
           </el-tooltip>
         </div>
       </template>
-      <template #plan_storage_time="{row}">
-        <div class='flex flex-center'>
-          <div class='mr-5 red' v-if='row.plan_storage_time !== undefined && row.is_storage === 0 '>
+      <template #plan_storage_time="{ row }">
+        <div class="flex flex-center">
+          <div
+            class="mr-5 red"
+            v-if="row.plan_storage_time !== undefined && row.is_storage === 0"
+          >
             {{ row.plan_storage_time.substring(0, 10) }}
           </div>
-          <div class='mr-5 blue' v-else>{{ row.storage_time ? row.storage_time.substring(0, 10) : '' }}</div>
+          <div class="mr-5 blue" v-else>
+            {{ row.storage_time ? row.storage_time.substring(0, 10) : '' }}
+          </div>
         </div>
       </template>
 
-      <template #plan_commencement_time-header="{column}">
-        <div class='flex flex-center'>
-          <div class='mr-5'>{{ (column || {}).label }}</div>
-          <el-tooltip content='红色为计划开工时间,蓝色为实际开工时间'>
+      <template #plan_commencement_time-header="{ column }">
+        <div class="flex flex-center">
+          <div class="mr-5">{{ (column || {}).label }}</div>
+          <el-tooltip content="红色为计划开工时间,蓝色为实际开工时间">
             <el-icon>
-              <InfoFilled/>
+              <InfoFilled />
             </el-icon>
           </el-tooltip>
         </div>
       </template>
-      <template #plan_commencement_time="{row}">
-        <div class='flex flex-center'>
-          <div class='mr-5 red'
-               v-if='row.plan_commencement_time !== undefined && (row.is_start === undefined ||row.is_start === 0 )'>{{
-              row.plan_commencement_time.substring(0, 10)
-            }}
+      <template #plan_commencement_time="{ row }">
+        <div class="flex flex-center">
+          <div
+            class="mr-5 red"
+            v-if="
+              row.plan_commencement_time !== undefined &&
+              (row.is_start === undefined || row.is_start === 0)
+            "
+          >
+            {{ row.plan_commencement_time.substring(0, 10) }}
+          </div>
+          <div class="mr-5 blue" v-else>
+            {{ row.start_time ? row.start_time.substring(0, 10) : '' }}
           </div>
-          <div class='mr-5 blue' v-else>{{ row.start_time ? row.start_time.substring(0, 10) : '' }}</div>
         </div>
       </template>
     </avue-crud>
     <!--    新增-->
-    <el-dialog v-model="showAdd"
-               append-to-body
-               center
-               title="新增项目"
-               width="35%">
-      <div v-loading='addLoading'>
-        <el-form ref='form' :model="projectForm" class="lab mt-20" label-width="100px" :rules="rules">
+    <el-dialog
+      v-model="showAdd"
+      append-to-body
+      center
+      title="新增项目"
+      width="35%"
+    >
+      <div v-loading="addLoading">
+        <el-form
+          ref="form"
+          :model="projectForm"
+          class="lab mt-20"
+          label-width="100px"
+          :rules="rules"
+        >
           <div class="flex flex-center flex-col mr-20">
-            <el-form-item class="full-width" label="项目名称" prop='name'>
+            <el-form-item class="full-width" label="项目名称" prop="name">
               <el-input
-                  v-model="projectForm.name"
-                  clearable
-                  placeholder="输入项目名称"
+                v-model="projectForm.name"
+                clearable
+                placeholder="输入项目名称"
               />
             </el-form-item>
-            <el-form-item class="full-width" label="项目总投" prop='totalAmount'>
+            <el-form-item
+              class="full-width"
+              label="项目总投"
+              prop="totalAmount"
+            >
               <el-input
-                  v-model="projectForm.totalAmount"
-                  clearable
-                  placeholder="输入项目总投(万元)"
+                v-model="projectForm.totalAmount"
+                clearable
+                placeholder="输入项目总投(万元)"
               >
                 <template #append>(万元)</template>
               </el-input>
             </el-form-item>
-            <!--            <el-form-item class="full-width" label="项目类型" prop='projectType'>-->
-            <!--              <el-select-->
-            <!--                  v-model="projectForm.projectType"-->
-            <!--                  clearable-->
-            <!--                  placeholder="选择项目类型"-->
-            <!--                  style="width: 100%"-->
-            <!--              >-->
-            <!--                <el-option-->
-            <!--                    v-for="item in typeList"-->
-            <!--                    :key="item.id"-->
-            <!--                    :label="item.name"-->
-            <!--                    :value="item.id"-->
-            <!--                />-->
-            <!--              </el-select>-->
-            <!--            </el-form-item>-->
-            <el-form-item class="full-width" label="项目标签" prop='tags'>
+            <el-form-item class="full-width" label="项目标签" prop="tags">
               <el-select
-                  v-model="projectForm.tags"
-                  clearable
-                  placeholder="选择项目标签"
-                  style="width: 100%"
+                v-model="projectForm.tags"
+                clearable
+                placeholder="选择项目标签"
+                style="width: 100%"
               >
                 <el-option
-                    v-for="item in tagsList"
-                    :key="item.dictKey"
-                    :label="item.dictValue"
-                    :value="item.dictKey"
+                  v-for="item in tagsList"
+                  :key="item.dictKey"
+                  :label="item.dictValue"
+                  :value="item.dictKey"
                 />
               </el-select>
             </el-form-item>
             <el-form-item class="full-width" label="建设内容">
               <el-input
-                  v-model="projectForm.introduction"
-                  :rows="6"
-                  clearable
-                  placeholder="输入项目建设内容"
-                  type="textarea"
+                v-model="projectForm.introduction"
+                :rows="6"
+                clearable
+                placeholder="输入项目建设内容"
+                type="textarea"
               />
             </el-form-item>
             <div class="flex flex-center mt-10">
-              <base-button class="mr-20" icon="Close" title="取消" type="0" @click="showAdd = false"/>
-              <base-button icon="Check" title="保存" @click="projectSave"/>
+              <base-button
+                class="mr-20"
+                icon="Close"
+                title="取消"
+                type="0"
+                @click="showAdd = false"
+              />
+              <base-button icon="Check" title="保存" @click="projectSave" />
             </div>
           </div>
         </el-form>
       </div>
     </el-dialog>
-    <form-dialog :dialogType="diaType" @close="formDialogClose" @export='exportExcel' :ids='selectList'/>
-    <summary-dialog :dialogType="diaType" @close="diaType = -1"
-                    :select-num='selectList.length === 0 ? page.total : selectList.length'
-                    @export='exportExcelTotal'/>
+    <form-dialog
+      :dialogType="diaType"
+      @close="formDialogClose"
+      @export="exportExcel"
+      :ids="selectList"
+    />
+    <summary-dialog
+      :dialogType="diaType"
+      @close="diaType = -1"
+      :select-num="selectList.length === 0 ? page.total : selectList.length"
+      @export="exportExcelTotal"
+    />
   </div>
 </template>
 
@@ -179,12 +238,12 @@ import { useStore } from '@/store/user.js'
 export default {
   name: 'dash',
   components: { BaseButton, formDialog, summaryDialog },
-  setup () {
+  setup() {
     const permissions = permissionStore()
     const user = useStore()
     return { permissions, user }
   },
-  data () {
+  data() {
     return {
       dialogLoading: false,
       disable: false,
@@ -228,7 +287,8 @@ export default {
             prop: 'project_stage',
             type: 'select',
             width: 120,
-            dicUrl: '/api/blade-system/dict-biz/dictionary?code=project-situation',
+            dicUrl:
+              '/api/blade-system/dict-biz/dictionary?code=project-situation',
             props: {
               label: 'dictValue',
               value: 'dictKey'
@@ -304,7 +364,8 @@ export default {
             label: '认定时间',
             prop: 'year',
             width: 160
-          }]
+          }
+        ]
       },
       page: {
         size: 10,
@@ -324,9 +385,7 @@ export default {
         introduction: ''
       },
       rules: {
-        name: [
-          { required: true, message: '请输入项目名称', trigger: 'blur' }
-        ],
+        name: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
         projectType: [
           {
             required: true,
@@ -351,12 +410,15 @@ export default {
       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')
+    const indexLabel = this.option.column.findIndex(
+      sub => sub.prop === 'responsible_unit'
+    )
     console.log(indexLabel)
-    if (this.user.info.viewStage === 1) { // 发改
+    if (this.user.info.viewStage === 1) {
+      // 发改
       this.option.column[index].hide = true
       this.option.column[indexLabel].label = '责任单位'
     } else {
@@ -375,40 +437,43 @@ 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.onLoad(Object.assign(this.owerQuery, this.projectStageQuery))
     },
-    onLoad (query = {}) {
+    onLoad(query = {}) {
       this.loading = true
       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
-        if (res.code === 200) {
-          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
-        }
-      }).finally(() => {
-        this.loading = false
-      })
+      this.$api.project
+        .projectList(this.page.currentPage, this.page.pageSize, this.queryData)
+        .then(res => {
+          this.loading = false
+          if (res.code === 200) {
+            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
+          }
+        })
+        .finally(() => {
+          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('暂未授权使用', {
@@ -419,7 +484,11 @@ 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') {
@@ -429,43 +498,44 @@ export default {
         })
       }
     },
-    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
-        resolve(res.data.data.childrenList.map(e => {
-          e.project_stage = e.project_stage.toString()
-          return e
-        }))
+        resolve(
+          res.data.data.childrenList.map(e => {
+            e.project_stage = e.project_stage.toString()
+            return e
+          })
+        )
       })
     },
-    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
@@ -473,27 +543,38 @@ export default {
         }
       })
     },
-    getTypeList () {
-      this.$api.project.typeList({ type: 1, size: 999, current: 1 }).then(res => {
-        this.typeList = res.data.records
-      })
+    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 => {
         if (res.code === 200) {
           this.tagsList = res.data
         }
       })
     },
-    track (res) {
+    track(res) {
       if (res.is_report === 1) {
         this.$message.error('该项目已经上报')
         return
       }
-      this.$confirm(res.project_stage === 1 ? '上报后该项目情况将更新为正式项目,请确认项目相关信息已经审核完成' : '是否确定进行项目上报', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        const data = { id: res.id, is_report: 1, project_stage: res.project_stage === 1 ? 2 : res.project_stage }
+      this.$confirm(
+        res.project_stage === 1
+          ? '上报后该项目情况将更新为正式项目,请确认项目相关信息已经审核完成'
+          : '是否确定进行项目上报',
+        {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }
+      ).then(() => {
+        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()
@@ -504,12 +585,12 @@ export default {
         })
       })
     },
-    projectSave () {
+    projectSave() {
       if (this.disable) {
         this.$message.error('正在处理,请稍后...')
         return
       }
-      this.$refs.form.validate((valid) => {
+      this.$refs.form.validate(valid => {
         if (valid) {
           this.disable = true
           this.addLoading = true
@@ -528,22 +609,32 @@ export default {
         }
       })
     },
-    formDialogClose () {
+    formDialogClose() {
       if (this.diaType === 0) {
         this.onLoad()
       }
       this.diaType = -1
     },
-    exportExcel (res) {
-      const data = Object.assign({ ...this.queryData }, {
-        columnName: res,
-        projectIds: this.selectList.join(','),
-        previewType: 1
-      })
+    exportExcel(res, year) {
+      console.log(year)
+      const data = Object.assign(
+        { ...this.queryData },
+        {
+          columnName: res,
+          projectIds: this.selectList.join(','),
+          previewType: 1,
+          year
+        }
+      )
       this.$router.push({ query: data, path: '/home/excel' })
     },
-    exportExcelTotal (item) {
-      const dataIds = { ...this.queryData, ...item, projectIds: this.selectList.join(','), previewType: 2 }
+    exportExcelTotal(item) {
+      const dataIds = {
+        ...this.queryData,
+        ...item,
+        projectIds: this.selectList.join(','),
+        previewType: 2
+      }
       this.$router.push({ query: dataIds, path: '/home/excel' })
     }
   }
@@ -554,7 +645,7 @@ export default {
 .tip {
   width: 260px;
   height: 38px;
-  background-color: #FBF6ED;
+  background-color: #fbf6ed;
   font-weight: 500;
   flex-wrap: nowrap;
   margin-left: 20px;
@@ -569,13 +660,13 @@ export default {
   box-shadow: 2px 2px 10px 2px rgba(113, 73, 39, 0.3);
 
   .sp {
-    color: #ECAB56;
+    color: #ecab56;
     white-space: nowrap;
     margin-left: 20px;
   }
 
   .sp1 {
-    color: #ECAB56;
+    color: #ecab56;
     margin-right: 20px;
   }
 }
@@ -585,7 +676,7 @@ export default {
   height: 50px;
   border-radius: 10px;
   margin-right: 20px;
-  background-color: #F0F2F7;
+  background-color: #f0f2f7;
 
   .sp {
     color: #707070;

+ 300 - 220
src/views/home/component/form_dialog.vue

@@ -1,91 +1,118 @@
 <template>
   <div>
     <!--    表格导入-->
-    <el-dialog v-model='showImport'
-               append-to-body
-               center
-               title="数据表格导入"
-               @close="close"
-               width="45%">
-      <div class='flex flex-center flex-col'>
+    <el-dialog
+      v-model="showImport"
+      append-to-body
+      center
+      title="数据表格导入"
+      @close="close"
+      width="45%"
+    >
+      <div class="flex flex-center flex-col">
         <div class="flex flex-center full-width flex-justify-start">
           <span class="bold mr-20">文件上传</span>
           <div>
-            <uploads ref='upload' max="9" btn-text="点击进行文件上传" @before="before" @success="upload"
-                     @error='loading = false'
-                     :loading='loading'
-                     :data='dept'
-                     :action='action'
-                     accept=".xlsx"/>
+            <uploads
+              ref="upload"
+              max="9"
+              btn-text="点击进行文件上传"
+              @before="before"
+              @success="upload"
+              @error="loading = false"
+              :loading="loading"
+              :data="dept"
+              :action="action"
+              accept=".xlsx"
+            />
           </div>
           <div>
-            <span class='bold ml-10 mr-10'>是否是汇总表</span>
-            <el-switch v-model='gather'/>
+            <span class="bold ml-10 mr-10">是否是汇总表</span>
+            <el-switch v-model="gather" />
           </div>
-          <div class='flex flex-center' v-if='gather === false'>
-            <span class='bold ml-10 mr-10'>项目所属机构:</span>
+          <div class="flex flex-center" v-if="gather === false">
+            <span class="bold ml-10 mr-10">项目所属机构:</span>
             <div>
               <el-autocomplete
-                  v-model='deptName'
-                  clearable
-                  placeholder="快速搜索机构"
-                  prefix-icon="Search"
-                  :trigger-on-focus="false"
-                  :fetch-suggestions="querySearchDept"
-                  @select="handleSelectDept"
+                v-model="deptName"
+                clearable
+                placeholder="快速搜索机构"
+                prefix-icon="Search"
+                :trigger-on-focus="false"
+                :fetch-suggestions="querySearchDept"
+                @select="handleSelectDept"
               />
             </div>
           </div>
         </div>
         <div class="flex flex-justify-start full-width">
-          <span class="font-12 mt-10"
-                style="color:#E24141">注意:文件格式需要为Excel表格,表格必须要有项目名称及责任单位名称两项内容,才能确保系统成功解析文件。</span>
+          <span class="font-12 mt-10" style="color: #e24141"
+            >注意:文件格式需要为Excel表格,表格必须要有项目名称及责任单位名称两项内容,才能确保系统成功解析文件。</span
+          >
         </div>
       </div>
-      <el-divider/>
-      <div class="hide-scrollbar full-width" style="height: 20vh;overflow-x: scroll" v-loading='loading'>
-        <div v-if='attaches.length === 0' class='full-width flex flex-center '>
-          <el-empty image-size='100'/>
+      <el-divider />
+      <div
+        class="hide-scrollbar full-width"
+        style="height: 20vh; overflow-x: scroll"
+        v-loading="loading"
+      >
+        <div v-if="attaches.length === 0" class="full-width flex flex-center">
+          <el-empty image-size="100" />
         </div>
-        <div class="flex flex-justify-between flex-center mt-5" v-for="item in attaches" :key="item">
+        <div
+          class="flex flex-justify-between flex-center mt-5"
+          v-for="item in attaches"
+          :key="item"
+        >
           <span class="blue">{{ item.name }}</span>
           <el-icon color="#DCAE64" size="16px" @click="removeFile(item)">
-            <CircleCloseFilled/>
+            <CircleCloseFilled />
           </el-icon>
         </div>
       </div>
       <div class="flex flex-center mt-20 mb-5">
-        <base-button title="重置" type="0" icon="Refresh"/>
-        <base-button class="ml-15" title="导入" icon="el-icon-upload" @click='importExcel'/>
+        <base-button title="重置" type="0" icon="Refresh" />
+        <base-button
+          class="ml-15"
+          title="导入"
+          icon="el-icon-upload"
+          @click="importExcel"
+        />
       </div>
     </el-dialog>
     <!--    表格导出-->
-    <el-dialog v-model='showExport'
-               append-to-body
-               center
-               @close="close"
-               title="数据表格导出"
-               width="75%">
+    <el-dialog
+      v-model="showExport"
+      append-to-body
+      center
+      @close="close"
+      title="数据表格导出"
+      width="75%"
+    >
       <div class="flex flex-col">
         <el-autocomplete
-            v-model="keyWords"
-            clearable
-            placeholder="字段信息快速搜索"
-            prefix-icon="Search"
-            :trigger-on-focus="false"
-            :fetch-suggestions="querySearch"
-            @select="handleSelect"
+          v-model="keyWords"
+          clearable
+          placeholder="字段信息快速搜索"
+          prefix-icon="Search"
+          :trigger-on-focus="false"
+          :fetch-suggestions="querySearch"
+          @select="handleSelect"
         />
         <div class="flex flex-wrap flex-align-center">
-          <div class="flex flex-center padding radius box-shadow mr-20 mt-20 pointer"
-               v-for="(item,index) in fieldType" :key='item.id'
-               :class="item.count > 0 ? 'box-s' : 'box'"
-               @click='switchTab(item,index)'>
+          <div
+            class="flex flex-center padding radius box-shadow mr-20 mt-20 pointer"
+            v-for="(item, index) in fieldType"
+            :key="item.id"
+            :class="item.count > 0 ? 'box-s' : 'box'"
+            @click="switchTab(item, index)"
+          >
             <div class="flex flex-col flex-center">
               <span class="bold font-16 text-center">{{ item.dictValue }}</span>
               <div class="flex flex-center">
                 <el-icon color="#81D0B2">
-                  <SuccessFilled/>
+                  <SuccessFilled />
                 </el-icon>
                 <span class="grey-9 font-12">已选{{ item.count }}项目</span>
               </div>
@@ -93,75 +120,84 @@
           </div>
         </div>
       </div>
-      <el-divider/>
-      <div v-loading='loading' class="hide-scrollbar full-width">
-        <!--        <div v-if='attaches.length === 0' class='full-width flex flex-center '>-->
-        <!--          <el-empty image-size='100'/>-->
-        <!--        </div>-->
+      <el-divider />
+      <div v-loading="loading" class="hide-scrollbar full-width">
         <div class="flex flex-justify-start flex-center">
-          <span class="bold grey ml-5 ">字段选择</span>
-          <el-checkbox v-if='fieldType[selectIndex]' class='ml-20' v-model='fieldType[selectIndex].checkAll'
-                       @change='allChange'>全 选
+          <span class="bold grey ml-5">字段选择</span>
+          <el-checkbox
+            v-if="fieldType[selectIndex]"
+            class="ml-20"
+            v-model="fieldType[selectIndex].checkAll"
+            @change="allChange"
+            >全 选
           </el-checkbox>
-          <div class='flex flex-center' v-if='selectIndex === 2'>
-            <div class='bold ml-10 text-right' style='width: 80px'>筛选:</div>
+          <div class="flex flex-center" v-if="selectIndex === 2">
+            <div class="bold ml-10 text-right" style="width: 80px">筛选:</div>
             <el-select
-                v-model="year"
-                clearable
-                placeholder="选择年份"
-                style="width: 200px"
+              v-model="year"
+              clearable
+              placeholder="选择年份"
+              style="width: 200px"
             >
               <el-option
-                  v-for="item in years"
-                  :key="item + `年`"
-                  :label="item + `年`"
-                  :value="item"
+                v-for="item in years"
+                :key="item + `年`"
+                :label="item + `年`"
+                :value="item"
               />
             </el-select>
 
             <el-select
-                v-model="season"
-                clearable
-                class='ml-20 mr-20'
-                placeholder="选择季度"
-                style="width: 200px"
+              v-model="month"
+              clearable
+              class="ml-10"
+              placeholder="选择月份"
+              style="width: 200px"
             >
               <el-option
-                  v-for="item in seasons"
-                  :key="item.value"
-                  :label="item.name"
-                  :value="item.value"
+                v-for="item in months"
+                :key="item.value"
+                :label="item.name"
+                :value="item.value"
               />
             </el-select>
 
-            <el-select
-                v-if='season === "" '
-                v-model="month"
-                clearable
-                placeholder="选择月份"
-                style="width: 200px"
+            <el-button
+              icon="el-icon-search"
+              class="ml-20"
+              type="primary"
+              @click="search(false)"
+              >搜 索</el-button
+            >
+            <el-button
+              icon="el-icon-delete"
+              class="ml-20"
+              type="primary"
+              plain
+              @click="resetKey"
+              >清 空</el-button
             >
-              <el-option
-                  v-for="item in months"
-                  :key="item.value"
-                  :label="item.name"
-                  :value="item.value"
-              />
-            </el-select>
-
-            <el-button icon='el-icon-search' class='ml-20' type='primary' @click='search(false)'>搜 索</el-button>
-            <el-button icon='el-icon-delete' class='ml-20' type='primary' plain @click='resetKey'>清 空</el-button>
           </div>
         </div>
-        <div style="height: 320px;overflow-x: scroll" v-if='selectIndex !== -1'>
-          <div class="flex flex-wrap ">
-
-            <div v-if='selectIndex ===2' class=' full-width'>
-              <div v-for='item in fieldType[selectIndex].groupList' :key='item.id' class='mt-10  full-width border'>
-                <div class='flex flex-wrap'>
-                  <div v-for='sub in item' :key='sub.id' class='pointer item'>
-                    <el-checkbox v-model='sub.checked' :label="sub.code" size="large"
-                                 @change='change(selectIndex,index)'>
+        <div
+          style="height: 320px; overflow-x: scroll"
+          v-if="selectIndex !== -1"
+        >
+          <div class="flex flex-wrap">
+            <div v-if="selectIndex === 2" class="full-width">
+              <div
+                v-for="item in fieldType[selectIndex].groupList"
+                :key="item.id"
+                class="mt-10 full-width border"
+              >
+                <div class="flex flex-wrap">
+                  <div v-for="sub in item" :key="sub.id" class="pointer item">
+                    <el-checkbox
+                      v-model="sub.checked"
+                      :label="sub.code"
+                      size="large"
+                      @change="change(selectIndex, index)"
+                    >
                       {{ sub.dictValue }}
                     </el-checkbox>
                   </div>
@@ -169,20 +205,45 @@
               </div>
             </div>
 
-            <div v-else v-for="(item,index) in fieldType[selectIndex].params" :key='item.id'
-                 class="pointer item" style='height: 30px'>
-              <el-checkbox v-model='item.checked' :label="item.code" size="large" @change='change(selectIndex,index)'>
+            <div
+              v-else
+              v-for="(item, index) in fieldType[selectIndex].params"
+              :key="item.id"
+              class="pointer item"
+              style="height: 30px"
+            >
+              <el-checkbox
+                v-model="item.checked"
+                :label="item.code"
+                size="large"
+                @change="change(selectIndex, index)"
+              >
                 {{ item.dictValue }}
               </el-checkbox>
             </div>
           </div>
         </div>
-        <el-empty v-else description='点击上方按钮,选择字段'/>
+        <el-empty v-else description="点击上方按钮,选择字段" />
       </div>
       <div class="flex flex-center mt-20 mb-5">
-        <base-button title="重置" @click='resetParams' type="0" icon="Refresh"/>
-        <base-button title="保存配置" @click='saveConfigParams' class='ml-15' icon="Upload"/>
-        <base-button class="ml-15" title="导出预览" icon="el-icon-download" @click='exportExcel'/>
+        <base-button
+          title="重置"
+          @click="resetParams"
+          type="0"
+          icon="Refresh"
+        />
+        <base-button
+          title="保存配置"
+          @click="saveConfigParams"
+          class="ml-15"
+          icon="Upload"
+        />
+        <base-button
+          class="ml-15"
+          title="导出预览"
+          icon="el-icon-download"
+          @click="exportExcel"
+        />
       </div>
     </el-dialog>
   </div>
@@ -197,19 +258,19 @@ import { unique } from '@/utils/tools.js'
 export default {
   name: 'form_dialog',
   components: { BaseButton, uploads },
-  setup () {
+  setup() {
     const user = useStore()
     return { user }
   },
   props: {
     dialogType: {
-      type: String,
+      type: Number,
       default: -1
     }
   },
   watch: {
     dialogType: {
-      handler (val) {
+      handler(val) {
         if (val === 0) {
           this.showImport = true
         } else if (val === 1) {
@@ -224,16 +285,9 @@ export default {
         }
       },
       immediate: true
-    },
-    season: {
-      handler (val) {
-        if (val.length > 0) {
-          this.month = ''
-        }
-      }
     }
   },
-  data () {
+  data() {
     return {
       deptName: '',
       deptList: [],
@@ -261,25 +315,6 @@ export default {
       },
       years: [],
       year: '',
-      seasons: [
-        {
-          name: '第一季度',
-          value: 1
-        },
-        {
-          name: '第二季度',
-          value: 2
-        },
-        {
-          name: '第三季度',
-          value: 3
-        },
-        {
-          name: '第四季度',
-          value: 4
-        }
-      ],
-      season: '',
       months: [
         {
           name: '1-2月',
@@ -329,11 +364,11 @@ export default {
       month: ''
     }
   },
-  created () {
+  created() {
     this.init()
   },
   methods: {
-    init () {
+    init() {
       const tmp = new Date().getFullYear()
       this.year = tmp
       for (let i = 0; i < tmp - 2017; i++) {
@@ -344,7 +379,7 @@ export default {
     /**
      * 获取督查情况
      */
-    getInspects (status) {
+    getInspects(status) {
       const data = { status }
       this.$api.inspect.list(Object.assign(this.page, data)).then(res => {
         if (res.code === 200) {
@@ -352,7 +387,7 @@ export default {
         }
       })
     },
-    getDict (code) {
+    getDict(code) {
       this.$api.common.dicList({ code }).then(res => {
         if (res.code === 200) {
           if (code === 'inspect_type') {
@@ -370,10 +405,10 @@ export default {
         }
       })
     },
-    close () {
+    close() {
       this.$emit('close')
     },
-    upload (res) {
+    upload(res) {
       this.attaches = res.fileList
       this.$message.success('操作成功')
       this.showImport = false
@@ -381,53 +416,69 @@ export default {
       this.deptName = ''
       this.close()
     },
-    before (files) {
+    before(files) {
       this.attaches = files
     },
-    removeFile (item) {
+    removeFile(item) {
       this.attaches = this.attaches.filter(sub => sub.uid !== item.uid)
     },
-    switchTab (item, index) {
+    switchTab(item, index) {
       this.fieldType[index].isSelect = !this.fieldType[index].isSelect
       this.selectIndex = index
-      if (index === 2) { // 年度投资情况
-        this.$api.params.paramsList({
-          type: this.fieldType[this.selectIndex].dictKey,
-          year: this.year,
-          season: this.season,
-          month: this.month
-        }).then(res => {
+      if (index === 2) {
+        // 年度投资情况
+        this.$api.params
+          .paramsList({
+            type: this.fieldType[this.selectIndex].dictKey,
+            year: this.year,
+            month: this.month
+          })
+          .then(res => {
+            if (res.code === 200) {
+              this.parseList(res.data, index, false)
+            }
+          })
+        return
+      }
+      this.$api.params
+        .paramsList({
+          type: this.fieldType[index].dictKey,
+          export: 1,
+          year: '',
+          month: ''
+        })
+        .then(res => {
           if (res.code === 200) {
             this.parseList(res.data, index, false)
           }
         })
-        return
-      }
-      this.$api.params.paramsList({
-        type: this.fieldType[index].dictKey,
-        export: 1,
-        year: '',
-        season: '',
-        month: ''
-      }).then(res => {
-        if (res.code === 200) {
-          this.parseList(res.data, index, false)
-        }
-      })
     },
     /**
      * 组装数据
      * @param list
      * @param index
      */
-    parseList (list, index, reset) {
-      const tmps = list.map(e => {
-        e.checked = e.checked === 1 ? true : reset ? false : this.fieldType[index].params === undefined ? false : this.fieldType[index].params.findIndex(sub => sub.id === e.id) > -1
-        return e
-      }).filter(sub => sub.code !== 'name')
+    parseList(list, index, reset) {
+      const tmps = list
+        .map(e => {
+          e.checked =
+            e.checked === 1
+              ? true
+              : reset
+              ? false
+              : this.fieldType[index].params === undefined
+              ? false
+              : this.fieldType[index].params.findIndex(sub => sub.id === e.id) >
+                -1
+          return e
+        })
+        .filter(sub => sub.code !== 'name')
       if (this.fieldType[index].params !== undefined && reset === false) {
         const d = tmps.filter(ele => {
-          return this.fieldType[index].params.findIndex(sub => sub.id === ele.id) === -1
+          return (
+            this.fieldType[index].params.findIndex(sub => sub.id === ele.id) ===
+            -1
+          )
         })
         for (let i = 0; i < d.length; i++) {
           this.fieldType[index].params.push(d[i])
@@ -437,26 +488,36 @@ export default {
       }
       // list to params
       // 排序 ,去重,返回type 关键词数组 list
-      const keys = unique(this.fieldType[index].params.sort((val1, val2) => {
-        if (val1.frontSort < val2.frontSort) return -1
-        if (val1.frontSort > val2.frontSort) return 0
-        return 0
-      }).map(sub => sub.type))
+      const keys = unique(
+        this.fieldType[index].params
+          .sort((val1, val2) => {
+            if (val1.frontSort < val2.frontSort) return -1
+            if (val1.frontSort > val2.frontSort) return 0
+            return 0
+          })
+          .map(sub => sub.type)
+      )
       // 分组数据
       this.fieldType[index].groupList = []
       keys.forEach(sub => {
-        this.fieldType[index].groupList.push(this.fieldType[index].params.filter(item => item.type === sub))
+        this.fieldType[index].groupList.push(
+          this.fieldType[index].params.filter(item => item.type === sub)
+        )
       })
-      this.fieldType[index].count = this.fieldType[index].params.filter(e => e.checked).length
-      this.fieldType[index].checkAll = this.fieldType[index].count === this.fieldType[index].params.length
+      this.fieldType[index].count = this.fieldType[index].params.filter(
+        e => e.checked
+      ).length
+      this.fieldType[index].checkAll =
+        this.fieldType[index].count === this.fieldType[index].params.length
     },
-    importExcel () {
+    importExcel() {
       if (this.attaches && this.attaches.length === 0) {
         this.$message.error('请选择要上传的文件')
         return
       }
       if (this.gather) {
-        this.action = '/api//wutong-parse-file/import-excel/v1/parse-summary-excel'
+        this.action =
+          '/api//wutong-parse-file/import-excel/v1/parse-summary-excel'
       } else {
         if (this.dept === null) {
           this.$message.error('请选择项目所属机构')
@@ -473,51 +534,64 @@ export default {
       }
       this.$refs.upload.submit()
     },
-    change (parentIndex, index) {
+    change(parentIndex, index) {
       const tmp = this.fieldType[parentIndex].params.filter(e => e.checked)
       this.fieldType[parentIndex].count = tmp.length
       for (let i = 0; i < tmp.length; i++) {
         this.resultParams.push(tmp[i])
       }
     },
-    allChange (res) {
-      this.fieldType[this.selectIndex].params = this.fieldType[this.selectIndex].params.map(sub => {
+    allChange(res) {
+      this.fieldType[this.selectIndex].params = this.fieldType[
+        this.selectIndex
+      ].params.map(sub => {
         sub.checked = res
         return sub
       })
       const tmp = this.fieldType[this.selectIndex].params.filter(e => e.checked)
       this.fieldType[this.selectIndex].count = tmp.length
     },
-    resetParams () {
-      this.fieldType[this.selectIndex].params = this.fieldType[this.selectIndex].params.map(sub => {
+    resetParams() {
+      this.fieldType[this.selectIndex].params = this.fieldType[
+        this.selectIndex
+      ].params.map(sub => {
         sub.checked = false
         return sub
       })
       this.fieldType[this.selectIndex].count = 0
     },
-    exportExcel () {
-      const params = this.fieldType.filter(sub => sub.params).map(sub => sub.params)
+    exportExcel() {
+      const params = this.fieldType
+        .filter(sub => sub.params)
+        .map(sub => sub.params)
       const tmps = [].concat.apply([], params)
       const tmpsList = tmps.filter(sub => sub.checked)
       if (tmpsList && tmpsList.length > 0) {
         const result = tmpsList.map(sub => sub.code).join(',')
         this.loading = true
-        this.$emit('export', 'name,' + result)
+        this.$emit('export', 'name,' + result, this.year)
       } else {
         this.$message.error('未选择任何字段进行导出')
       }
       this.attaches = []
     },
-    querySearchDept (key, cb) {
+    querySearchDept(key, cb) {
       if (key && key.length === 0) {
         return
       }
       setTimeout(() => {
-        const parentId = [0, 2].includes(this.user.info.viewStage) ? this.user.info.parentDeptId : this.user.info.deptId
+        const parentId = [0, 2].includes(this.user.info.viewStage)
+          ? this.user.info.parentDeptId
+          : this.user.info.deptId
         this.$api.system.getDeptLazy({ deptName: key, parentId }).then(res => {
           if (res.code === 200) {
             const tmp = res.data.map(sub => {
-              const item = { value: sub.deptName, label: sub.deptName, deptId: sub.id, areaCode: sub.areaCode }
+              const item = {
+                value: sub.deptName,
+                label: sub.deptName,
+                deptId: sub.id,
+                areaCode: sub.areaCode
+              }
               return item
             })
             cb(tmp)
@@ -525,7 +599,7 @@ export default {
         })
       }, 500)
     },
-    querySearch (string, cb) {
+    querySearch(string, cb) {
       if (string && string.length === 0) {
         return
       }
@@ -541,10 +615,10 @@ export default {
         })
       }, 500)
     },
-    handleSelectDept (item) {
+    handleSelectDept(item) {
       this.dept = item
     },
-    handleSelect (item) {
+    handleSelect(item) {
       const sub = item
       sub.search = true
       sub.checked = true
@@ -555,7 +629,9 @@ export default {
           this.fieldType[index].params = []
           this.fieldType[index].params.push(sub)
         } else {
-          const subIndex = this.fieldType[index].params.findIndex(ele => ele.id === sub.id)
+          const subIndex = this.fieldType[index].params.findIndex(
+            ele => ele.id === sub.id
+          )
           if (subIndex > -1) {
             this.fieldType[index].params[subIndex].checked = true
           } else {
@@ -563,29 +639,33 @@ export default {
           }
         }
         this.$message.success(item.dictValue + '已勾选成功')
-        this.fieldType[index].params.count = this.fieldType[index].params.filter(sub => sub.checked).length
+        this.fieldType[index].params.count = this.fieldType[
+          index
+        ].params.filter(sub => sub.checked).length
       }
     },
-    resetKey () {
+    resetKey() {
       this.year = ''
-      this.season = ''
       this.month = ''
       this.search(false)
     },
-    search (clean) {
-      this.$api.params.paramsList({
-        type: this.fieldType[this.selectIndex].dictKey,
-        year: this.year,
-        season: this.season,
-        month: this.month
-      }).then(res => {
-        if (res.code === 200) {
-          this.parseList(res.data, this.selectIndex, true)
-        }
-      })
+    search(clean) {
+      this.$api.params
+        .paramsList({
+          type: this.fieldType[this.selectIndex].dictKey,
+          year: this.year,
+          month: this.month
+        })
+        .then(res => {
+          if (res.code === 200) {
+            this.parseList(res.data, this.selectIndex, true)
+          }
+        })
     },
-    saveConfigParams () {
-      const tmp = this.fieldType.filter(sub => sub.params).map(sub => sub.params)
+    saveConfigParams() {
+      const tmp = this.fieldType
+        .filter(sub => sub.params)
+        .map(sub => sub.params)
       const tmps = [].concat.apply([], tmp)
       const tmpsList = tmps.filter(sub => sub.checked).map(sub => sub.id)
       this.$api.params.saveConfigParams(tmpsList).then(res => {
@@ -608,10 +688,10 @@ export default {
 }
 
 .box-s {
-  border: 1px solid #AC9A7C;
+  border: 1px solid #ac9a7c;
   width: 120px;
   height: 50px;
-  color: #D1A55F;
+  color: #d1a55f;
 }
 
 .item {
@@ -625,7 +705,7 @@ export default {
   width: 120px;
   height: 50px;
   border: 1px solid transparent;
-  background: #F1F2F7;
+  background: #f1f2f7;
   color: #707070;
 }
 </style>

+ 141 - 113
src/views/home/component/owner_serach.vue

@@ -1,42 +1,34 @@
 <template>
-  <div class="flex flex-center padding white-bg ">
+  <div class="flex flex-center padding white-bg">
     <el-form v-model="form" class="lab mt-20 full-width" label-width="160px">
       <div class="flex">
         <div class="flex flex-col mr-15">
           <el-form-item class="full-width" label="项目名称">
             <el-input
-                v-model="form.projectName"
-                placeholder="输入项目关键字"
-                prefix-icon="Search"
-                clearable
+              v-model="form.projectName"
+              placeholder="输入项目关键字"
+              prefix-icon="Search"
+              clearable
             />
           </el-form-item>
           <div class="flex flex-center">
             <el-form-item class="full-width" label="是否开工">
-              <el-select
-                  v-model="form.isStart"
-                  style="width: 100%"
-                  clearable
-              >
+              <el-select v-model="form.isStart" style="width: 100%" clearable>
                 <el-option
-                    v-for="item in start"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
+                  v-for="item in start"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
                 />
               </el-select>
             </el-form-item>
             <el-form-item class="full-width" label="是否入库">
-              <el-select
-                  v-model="form.isStorage"
-                  style="width: 100%"
-                  clearable
-              >
+              <el-select v-model="form.isStorage" style="width: 100%" clearable>
                 <el-option
-                    v-for="item in storage"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
+                  v-for="item in storage"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
                 />
               </el-select>
             </el-form-item>
@@ -44,15 +36,15 @@
           <div>
             <el-form-item class="full-width" label="计划(实际)开工时间">
               <el-date-picker
-                  v-model="time1"
-                  type="daterange"
-                  @visible-change="visibleTime($event,1)"
-                  range-separator="至"
-                  start-placeholder="开始时间"
-                  end-placeholder="结束时间"
-                  value-format='YYYY-MM-DD'
-                  format='YYYY-MM-DD'
-                  clearable
+                v-model="time1"
+                type="daterange"
+                @visible-change="visibleTime($event, 1)"
+                range-separator="至"
+                start-placeholder="开始时间"
+                end-placeholder="结束时间"
+                value-format="YYYY-MM-DD"
+                format="YYYY-MM-DD"
+                clearable
               />
             </el-form-item>
           </div>
@@ -75,46 +67,46 @@
           <div class="flex flex-center">
             <el-form-item class="full-width" label="省重点">
               <el-select
-                  v-model="form.isImportant"
-                  style="width: 100%"
-                  clearable
+                v-model="form.isImportant"
+                style="width: 100%"
+                clearable
               >
                 <el-option
-                    v-for="item in isimport"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
+                  v-for="item in isimport"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
                 />
               </el-select>
             </el-form-item>
             <el-form-item class="full-width" label="省集中开工">
               <el-select
-                  v-model="form.isFocusStart"
-                  style="width: 100%"
-                  clearable
+                v-model="form.isFocusStart"
+                style="width: 100%"
+                clearable
               >
                 <el-option
-                    v-for="item in isfocus"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
+                  v-for="item in isfocus"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
                 />
               </el-select>
             </el-form-item>
           </div>
           <div class="flex flex-center flex-justify-between">
-            <el-form-item class="full-width " label="总投资额">
+            <el-form-item class="full-width" label="总投资额">
               <el-select
-                  v-model="form.amount"
-                  @change="changeAmount"
-                  style="width: 100%"
-                  clearable
+                v-model="form.amount"
+                @change="changeAmount"
+                style="width: 100%"
+                clearable
               >
                 <el-option
-                    v-for="item in totalAmount"
-                    :key="item.value"
-                    :label="item.name"
-                    :value="item.value"
+                  v-for="item in totalAmount"
+                  :key="item.value"
+                  :label="item.name"
+                  :value="item.value"
                 />
               </el-select>
             </el-form-item>
@@ -124,20 +116,19 @@
               </div>
             </el-form-item>
           </div>
-          <div class="flex flex-center flex-justify-end">
-          </div>
+          <div class="flex flex-center flex-justify-end"></div>
           <div>
             <el-form-item class="full-width" label="计划(实际)入库时间">
               <el-date-picker
-                  v-model="time2"
-                  type="daterange"
-                  @visible-change="visibleTime($event,2)"
-                  range-separator="至"
-                  start-placeholder="开始时间"
-                  end-placeholder="结束时间"
-                  value-format='YYYY-MM-DD'
-                  format='YYYY-MM-DD'
-                  clearable
+                v-model="time2"
+                type="daterange"
+                @visible-change="visibleTime($event, 2)"
+                range-separator="至"
+                start-placeholder="开始时间"
+                end-placeholder="结束时间"
+                value-format="YYYY-MM-DD"
+                format="YYYY-MM-DD"
+                clearable
               />
             </el-form-item>
           </div>
@@ -146,59 +137,92 @@
           <div>
             <el-form-item class="full-width" label="认定时间">
               <el-select
-                  v-model="form.projectYear"
-                  style="width: 100%;margin-right: 60px"
+                v-model="form.projectYear"
+                style="width: 100%; margin-right: 60px"
               >
                 <el-option
-                    v-for="item in years"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
+                  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"/>
+          <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" />
           </div>
         </div>
       </div>
     </el-form>
     <!----机构选择----->
-    <el-dialog v-model='showOrg'
-               append-to-body
-               center
-               title="机构选择"
-               width="45%">
+    <el-dialog
+      v-model="showOrg"
+      append-to-body
+      center
+      title="机构选择"
+      width="45%"
+    >
       <div class="flex flex-col">
         <el-input
-            v-model="keyWords"
-            clearable
-            placeholder="机构快速搜索"
-            prefix-icon="Search"
-            @blur='change'
+          v-model="keyWords"
+          clearable
+          placeholder="机构快速搜索"
+          prefix-icon="Search"
+          @blur="change"
         />
       </div>
-      <el-divider/>
-      <div class="hide-scrollbar full-width" style="height: 40vh;overflow-x: scroll">
+      <el-divider />
+      <div
+        class="hide-scrollbar full-width"
+        style="height: 40vh; overflow-x: scroll"
+      >
         <!--        <div v-if='attaches.length === 0' class='full-width flex flex-center '>-->
         <!--          <el-empty image-size='100'/>-->
         <!--        </div>-->
         <div class="flex flex-justify-between flex-center">
-          <span class="bold font-15 grey ml-5 ">部门</span>
+          <span class="bold font-15 grey ml-5">部门</span>
         </div>
-        <div class="grid radius mt-15 padding" style="border: 1px solid #DDDFE6">
-          <div v-for="(item,index) in deptList" :key='item.id' class="flex flex-center  pointer padding"
-               :class="item.search ? 'org-search' : item.checked ? 'org-s' : 'org'" @click='changeChecked(index)'>
+        <div
+          class="grid radius mt-15 padding"
+          style="border: 1px solid #dddfe6"
+        >
+          <div
+            v-for="(item, index) in deptList"
+            :key="item.id"
+            class="flex flex-center pointer padding"
+            :class="item.search ? 'org-search' : item.checked ? 'org-s' : 'org'"
+            @click="changeChecked(index)"
+          >
             <div :class="item.checked ? 'dot-checked' : 'dot'"></div>
-            <div class='ml-5 full-width' :class="item.checked || item.search  ? 'white' : ''">{{ item.deptName }}</div>
+            <div
+              class="ml-5 full-width"
+              :class="item.checked || item.search ? 'white' : ''"
+            >
+              {{ item.deptName }}
+            </div>
           </div>
         </div>
       </div>
       <div class="flex flex-center mt-20 mb-5">
-        <base-button title="重置" type="0" icon="Refresh" @click="orgRefresh"/>
-        <base-button class="ml-20" title="确定" icon="Check" @click='orgCheck'/>
+        <base-button title="重置" type="0" icon="Refresh" @click="orgRefresh" />
+        <base-button
+          class="ml-20"
+          title="确定"
+          icon="Check"
+          @click="orgCheck"
+        />
       </div>
     </el-dialog>
   </div>
@@ -206,11 +230,11 @@
 
 <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) {
@@ -223,7 +247,7 @@ export default {
   },
   setup() {
     const user = useStore()
-    return {user}
+    return { user }
   },
   data() {
     return {
@@ -296,26 +320,26 @@ export default {
       ],
       years: [
         {
-          value: 2023,
+          value: 2023
         },
         {
-          value: 2022,
+          value: 2022
         },
         {
-          value: 2021,
+          value: 2021
         },
         {
-          value: 2020,
+          value: 2020
         },
         {
-          value: 2019,
+          value: 2019
         },
         {
-          value: 2018,
+          value: 2018
         },
         {
-          value: 2017,
-        },
+          value: 2017
+        }
       ],
       typeList: [],
       showOrg: false,
@@ -345,7 +369,8 @@ export default {
         return
       }
       if (this.form.isStart === 0) {
-        this.form.planCommencementTime = this.time1 === null ? '' : this.time1.join(',')
+        this.form.planCommencementTime =
+          this.time1 === null ? '' : this.time1.join(',')
         this.form.startTime = ''
       } else if (this.form.isStart === 1 && this.time1 !== null) {
         this.form.planCommencementTime = ''
@@ -356,7 +381,8 @@ export default {
       }
 
       if (this.form.isStorage === 0) {
-        this.form.planStorageTime = this.time2 === null ? '' : this.time2.join(',')
+        this.form.planStorageTime =
+          this.time2 === null ? '' : this.time2.join(',')
         this.form.storageTime = ''
       } else if (this.form.isStorage === 1 && this.time2 !== null) {
         this.form.planStorageTime = ''
@@ -446,10 +472,12 @@ export default {
     },
     change() {
       if (this.keyWords.length === 0) {
-        this.deptList.forEach(sub => sub.search = false)
+        this.deptList.forEach(sub => (sub.search = false))
         return
       }
-      const tmp = this.deptList.filter(sub => sub.deptName.indexOf(this.keyWords) > -1).map(sub => sub.id)
+      const tmp = this.deptList
+        .filter(sub => sub.deptName.indexOf(this.keyWords) > -1)
+        .map(sub => sub.id)
       tmp.forEach(sub => {
         const index = this.deptList.findIndex(ele => ele.id === sub)
         this.deptList[index].search = true
@@ -470,7 +498,7 @@ export default {
 
 .chose-box {
   width: 100%;
-  border: 1px solid #DDDFE6;
+  border: 1px solid #dddfe6;
   border-radius: 5px;
 }
 
@@ -496,7 +524,7 @@ export default {
   width: 10px;
   height: 10px;
   border-radius: 10px;
-  border: 4px solid #ECAB56;
+  border: 4px solid #ecab56;
 
   .title {
     color: white;
@@ -505,14 +533,14 @@ export default {
 
 .org-search {
   border-radius: 8px;
-  background: #4E637F;
+  background: #4e637f;
   width: 150px;
   margin: 10px;
 }
 
 .org-s {
   border-radius: 8px;
-  background: #4E637F;
+  background: #4e637f;
   width: 150px;
   margin: 10px;
 }

+ 50 - 35
src/views/home/component/summary_dialog.vue

@@ -1,45 +1,61 @@
 <template>
   <div>
     <!--    汇总数据导出-->
-    <el-dialog v-model='showSummary'
-               append-to-body
-               center
-               @close="close"
-               title="汇总数据导出"
-               width="45%">
+    <el-dialog
+      v-model="showSummary"
+      append-to-body
+      center
+      @close="close"
+      title="汇总数据导出"
+      width="45%"
+    >
       <div class="flex flex-col flex-center">
-        <span
-            class="bold mb-10">共找到符合条件的项目 <span class="blue font-15">{{ selectNum }}</span> 个,请选择下面的字段信息,系统将对已选项自动进行汇总累加</span>
+        <span class="bold mb-10"
+          >共找到符合条件的项目
+          <span class="blue font-15">{{ selectNum }}</span>
+          个,请选择下面的字段信息,系统将对已选项自动进行汇总累加</span
+        >
         <el-select
-            v-model="year"
-            clearable
-            placeholder="年份筛选"
-            prefix-icon="Search"
+          v-model="year"
+          clearable
+          placeholder="年份筛选"
+          prefix-icon="Search"
         >
           <el-option
-              v-for="item in yearList"
-              :key="item"
-              :label="item"
-              :value="item"
+            v-for="item in yearList"
+            :key="item"
+            :label="item"
+            :value="item"
           />
         </el-select>
       </div>
-      <div class="hide-scrollbar full-width mt-15" style="height: 20vh;overflow-x: scroll">
+      <div
+        class="hide-scrollbar full-width mt-15"
+        style="height: 20vh; overflow-x: scroll"
+      >
         <div class="flex flex-justify-between flex-center">
-          <span class="bold font-15 grey ml-5 ">字段选择</span>
+          <span class="bold font-15 grey ml-5">字段选择</span>
         </div>
         <div class="flex flex-wrap">
-          <div v-for="item in fieldType" :key='item.id'
-               class="flex flex-center padding pointer">
-            <el-checkbox v-model=item.checked :label="item.code" size="large">
+          <div
+            v-for="item in fieldType"
+            :key="item.id"
+            class="flex flex-center padding pointer"
+          >
+            <el-checkbox v-model="item.checked" :label="item.code" size="large">
               {{ item.dictValue }}
             </el-checkbox>
           </div>
         </div>
       </div>
       <div class="flex flex-center mt-20 mb-5">
-        <base-button title="重置" type="0" icon="Refresh"/>
-        <base-button class="ml-15" title="导出预览" icon="el-icon-download" @click='exportExcel'/>
+        <base-button title="重置" type="0" icon="Refresh" />
+        <base-button
+          class="ml-15"
+          title="导出预览"
+          icon="el-icon-download"
+          @click="exportExcel"
+        />
       </div>
     </el-dialog>
   </div>
@@ -53,7 +69,7 @@ export default {
   components: { BaseButton },
   props: {
     dialogType: {
-      type: String,
+      type: Number,
       default: -1
     },
     selectNum: {
@@ -63,7 +79,7 @@ export default {
   },
   watch: {
     dialogType: {
-      handler (val) {
+      handler(val) {
         if (val === 2) {
           this.showSummary = true
           this.getDict('summary_field')
@@ -74,7 +90,7 @@ export default {
       immediate: true
     }
   },
-  data () {
+  data() {
     return {
       year: '',
       loading: false,
@@ -85,18 +101,18 @@ export default {
       yearList: []
     }
   },
-  created () {
+  created() {
     this.init()
   },
   methods: {
-    init () {
+    init() {
       const year = new Date().getFullYear()
       for (let i = 0; i <= year - 2017; i++) {
         const res = Number.parseInt(year) - i
         this.yearList.push(res)
       }
     },
-    getDict (code) {
+    getDict(code) {
       this.$api.common.dicList({ code }).then(res => {
         if (res.code === 200) {
           this.fieldType = res.data.map(e => {
@@ -106,10 +122,10 @@ export default {
         }
       })
     },
-    close () {
+    close() {
       this.$emit('close')
     },
-    exportExcel () {
+    exportExcel() {
       const tmp = this.fieldType.filter(e => e.checked).map(sub => sub.dictKey)
       if (this.year.length === 0) {
         this.$message.error('请选择年份')
@@ -124,7 +140,6 @@ export default {
     }
   }
 }
-
 </script>
 
 <style lang="scss" scoped>
@@ -135,17 +150,17 @@ export default {
 }
 
 .box-s {
-  border: 1px solid #AC9A7C;
+  border: 1px solid #ac9a7c;
   width: 120px;
   height: 50px;
-  color: #D1A55F;
+  color: #d1a55f;
 }
 
 .box {
   width: 120px;
   height: 50px;
   border: 1px solid transparent;
-  background: #F1F2F7;
+  background: #f1f2f7;
   color: #707070;
 }
 </style>

+ 5 - 6
src/views/home/excel.vue

@@ -1,6 +1,6 @@
 <template>
   <el-container>
-    <basic-container class="mt-10 content">
+    <basic-container class="mt-10">
       <div class="full-width white-bg" style="width: 100vw">
         <div class="flex flex-center flex-justify-start">
           <el-button type="primary" plain @click="back">返回</el-button>
@@ -10,7 +10,7 @@
           >注:左右滑动,查看更多内容</span
         >
       </div>
-      <div class="content mt-10">
+      <div class="mt-10">
         <div class="header flex flex-center flex-justify-start full-width">
           <div
             class="flex flex-center"
@@ -41,9 +41,9 @@
                   class="item flex flex-center overflow-hide"
                   :class="index === 0 ? 'item' : 'sub'"
                 >
-                  <el-tooltip :content="sub" placement="top">
-                    {{ sub }}
-                  </el-tooltip>
+                  <!-- <el-tooltip :content="sub" placement="top"> -->
+                  {{ sub }}
+                  <!-- </el-tooltip> -->
                 </div>
               </div>
             </div>
@@ -75,7 +75,6 @@ export default {
   },
   created() {
     this.query = this.$route.query
-    console.log(this.query)
     this.getList()
   },
   methods: {