Browse Source

Merge remote-tracking branch 'origin/develop' into develop

scorpioyq 2 years ago
parent
commit
1c3124203e

+ 1 - 1
src/api/common.js

@@ -9,7 +9,7 @@ export default {
     })
   },
   dicChildList(params) {
-    return fetch('/blade-system/dict-biz/child-list', {
+    return fetch('/blade-system/dict-biz/dictionary-tree', {
       clientId: website.clientId,
       ...params
     })

+ 0 - 1
src/components/area-picker/index.vue

@@ -60,7 +60,6 @@ export default {
       const tmps = res.map(ele => {
         return { key: ele.key, title: ele.title }
       })
-      console.log(this.area)
       this.$emit('change', tmps)
     }
   }

+ 67 - 0
src/components/industry-picker/index.vue

@@ -0,0 +1,67 @@
+<template>
+  <div class="full-width">
+    <el-cascader
+      :placeholder="placeholder"
+      clearable
+      class="full-width"
+      v-model="industry"
+      :options="industryList"
+      filterable
+      @change="change"
+    />
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    placeholder: {
+      type: String,
+      default: ''
+    }
+  },
+  data() {
+    return {
+      industry: '',
+      industryList: []
+    }
+  },
+  mounted() {
+    this.getList()
+  },
+  methods: {
+    getList() {
+      this.$api.common
+        .dicChildList({ code: 'industry-classification' })
+        .then(res => {
+          if (res.code === 200) {
+            this.industryList = res.data.map(item => this.mapTree(item))
+          }
+        })
+    },
+    mapTree(item) {
+      const haveChildren =
+        Array.isArray(item.children) && item.children.length > 0
+      return {
+        key: item,
+        value: item,
+        label: item.dictValue,
+        children: haveChildren ? item.children.map(i => this.mapTree(i)) : []
+      }
+    },
+    change(res) {
+      const tmps = res.map(ele => {
+        return {
+          id: ele.id,
+          title: ele.dictValue,
+          value: ele.dictKey,
+          code: ele.code
+        }
+      })
+      this.$emit('change', tmps)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 7 - 15
src/views/home/component/dash.vue

@@ -307,20 +307,8 @@
                 />
               </el-select>
             </el-form-item>
-            <el-form-item class="full-width" label="行业分类" prop="tags">
-              <el-select
-                v-model="projectForm.dictKey"
-                clearable
-                placeholder="选择行业分类"
-                style="width: 100%"
-              >
-                <el-option
-                  v-for="item in industryList"
-                  :key="item.dictKey"
-                  :label="item.dictValue"
-                  :value="item.dictKey"
-                />
-              </el-select>
+            <el-form-item class="full-width" label="所属行业" prop="dictKey">
+              <industry-picker @change="changeIndustry" />
             </el-form-item>
             <el-form-item class="full-width" label="建设内容">
               <el-input
@@ -411,10 +399,11 @@ import summaryDialog from '@/views/home/component/summary_dialog.vue'
 import { useStore } from '@/store/user.js'
 import confing from '@/config/website'
 import { ElMessageBox } from 'element-plus'
+import industryPicker from '@/components/industry-picker/index.vue'
 
 export default {
   name: 'dash',
-  components: { BaseButton, formDialog, summaryDialog },
+  components: { BaseButton, formDialog, summaryDialog, industryPicker },
   setup() {
     const permissions = permissionStore()
     const user = useStore()
@@ -1047,6 +1036,9 @@ export default {
       if (tmp) {
         this.projectForm.createDept = tmp.id
       }
+    },
+    changeIndustry(list) {
+      this.projectForm.dictKey = JSON.stringify(list)
     }
   }
 }

+ 1 - 1
src/views/home/component/params/params1.vue

@@ -109,7 +109,7 @@
             style="flex: 1"
           >
             <el-select
-              v-model="form.dict_value"
+              v-model="form.dict_key"
               placeholder="行业分类"
               class="full-width"
               @change="changeIndustry"

+ 43 - 33
src/views/project/componens/info1.vue

@@ -27,11 +27,13 @@
             <span class="title">地区:</span>
             <area-picker
               :placeholder="
-                form.province_name +
-                '/' +
-                form.city_name +
-                '/' +
-                form.district_name
+                form.province_name !== undefined
+                  ? form.province_name +
+                    '/' +
+                    form.city_name +
+                    '/' +
+                    form.district_name
+                  : ''
               "
               @change="changeArea"
             />
@@ -41,34 +43,34 @@
       <div class="flex flex-justify-center">
         <el-form-item class="full-width flex-child-average">
           <div class="flex flex-center full-width item">
-            <span class="title">责任单位:</span>
+            <span class="title">主管单位:</span>
             <el-select
-              v-model="form.responsible_unit"
+              v-model="form.competent_unit"
               placeholder="请选择项目标签"
               class="full-width"
             >
               <el-option
-                v-for="item in form.tags === 1 ? deptDic : compDic"
-                :key="item.dictValue"
-                :label="item.dictValue"
-                :value="item.dictKey"
+                v-for="item in deptDic"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
               />
             </el-select>
           </div>
         </el-form-item>
         <el-form-item class="full-width flex-child-average">
           <div class="flex flex-center full-width item">
-            <span class="title">主管单位:</span>
+            <span class="title">责任单位:</span>
             <el-select
-              v-model="form.competent_unit"
+              v-model="form.responsible_unit"
               placeholder="请选择项目标签"
               class="full-width"
             >
               <el-option
-                v-for="item in deptDic"
-                :key="item.dictValue"
-                :label="item.dictValue"
-                :value="item.dictKey"
+                v-for="item in form.tags === 1 ? deptDic : compDic"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
               />
             </el-select>
           </div>
@@ -96,7 +98,14 @@
         <el-form-item class="full-width flex-child-average">
           <div class="flex flex-center full-width item">
             <span class="title">所属行业:</span>
-            <el-input></el-input>
+            <industry-picker
+              :placeholder="
+                form.dict_key
+                  ? form.dict_key.map(ele => ele.title).join('/')
+                  : ''
+              "
+              @change="changeIndustry"
+            />
           </div>
         </el-form-item>
         <el-form-item class="full-width flex-child-average">
@@ -230,12 +239,14 @@ import wtCard from '@/components/wt-card/index.vue'
 import areaPicker from '@/components/area-picker/index.vue'
 import mapPicker from '@/views/project/componens/map-picker.vue'
 import { useStore } from '@/store/user.js'
+import industryPicker from '@/components/industry-picker/index.vue'
 
 export default {
   components: {
     wtCard,
     areaPicker,
-    mapPicker
+    mapPicker,
+    industryPicker
   },
   props: {
     info: {
@@ -258,10 +269,8 @@ export default {
           this.getCompList()
         }
         this.getDict('project-situation')
-        // fixme需要接口
-        this.getChildDict('industry-classification')
       },
-      immediate: true
+      immediate: false
     }
   },
   setup() {
@@ -292,25 +301,22 @@ export default {
     getDict(code) {
       this.$api.common.dicList({ code }).then(res => {
         if (res.code === 200) {
-          this.projectSituation = res.data
-        }
-      })
-    },
-    getChildDict(code) {
-      this.$api.common.dicChildList({ code }).then(res => {
-        if (res.code === 200) {
-          this.projectSituation = res.data
+          this.projectSituation = res.data.map(ele => {
+            ele.dictKey = Number.parseInt(ele.dictKey)
+            return ele
+          })
         }
       })
     },
     getDepList() {
       const local = {
-        label: this.user.info.deptName,
-        value: this.user.info.deptId
+        label: this.form.competent_unit_name,
+        value: this.form.competent_unit
       }
       this.deptDic.push(local)
+      console.log(this.deptDic)
       this.$api.system
-        .getDeptLazy({ parentId: this.user.info.deptId, deptCategory: 3 })
+        .getDeptLazy({ parentId: this.form.competent_unit, deptCategory: 3 })
         .then(res => {
           if (res.code === 200) {
             const tmp = res.data.map(ele => {
@@ -362,6 +368,10 @@ export default {
       this.form.longitude = res.longitude
       this.form.latitude = res.latitude
       this.photoList = list
+    },
+    changeIndustry(tmps) {
+      this.form.dict_key = tmps
+      this.$emit('industry', tmps[0])
     }
   }
 }

+ 6 - 1
src/views/project/componens/info2.vue

@@ -1,5 +1,6 @@
 <template>
   <wt-card title="前期情况" class="mt-10">
+    {{ industry }}
     <div class="flex flex-justify-start full-width mt-15">
       <avue-crud
         :option="option"
@@ -51,6 +52,10 @@ export default {
       required: true,
       type: String,
       default: ''
+    },
+    industry: {
+      type: String,
+      default: 'traffic'
     }
   },
   watch: {
@@ -117,7 +122,7 @@ export default {
         if (res.code === 200) {
           if (code === 'traffic') {
             this.dictList = res.data.map(e => {
-              return { label: e.dictValue, value: e.dictKey, code: code }
+              return { label: e.dictValue, value: e.dictKey, code }
             })
           }
         }

+ 11 - 10
src/views/project/componens/info4.vue

@@ -196,16 +196,17 @@ export default {
           if (res.code === 200) {
             if (type === 1) {
               res.data.forEach(item => {
-                this.t1 = this.t1 + item.investmentOfCentralBudget
-                this.t2 = this.t2 + item.bankLoans
-                this.t3 = this.t3 + item.specialBondFunds
-                this.t4 = this.t4 + item.antiEpidemicSpecialTreasuryBondFund
-                this.t5 = this.t5 + item.otherLocalFiscalConstructionFunds
+                this.t1 = this.t1 + (item.investmentOfCentralBudget - 0)
+                this.t2 = this.t2 + (item.bankLoans - 0)
+                this.t3 = this.t3 + (item.specialBondFunds - 0)
+                this.t4 =
+                  this.t4 + (item.antiEpidemicSpecialTreasuryBondFund - 0)
+                this.t5 = this.t5 + (item.otherLocalFiscalConstructionFunds - 0)
                 this.t6 =
-                  this.t6 + item.policyBasedDevelopmentFinancialInvestment
-                this.t7 = this.t7 + item.investmentWithinProvincialBudget
-                this.t8 = this.t8 + item.investmentWithinMunicipalBudget
-                this.t9 = this.t9 + item.investmentWithinCountyLevelBudget
+                  this.t6 + (item.policyBasedDevelopmentFinancialInvestment - 0)
+                this.t7 = this.t7 + (item.investmentWithinProvincialBudget - 0)
+                this.t8 = this.t8 + (item.investmentWithinMunicipalBudget - 0)
+                this.t9 = this.t9 + (item.investmentWithinCountyLevelBudget - 0)
               })
               this.data.investmentOfCentralBudget = this.t1
               this.data.bankLoans = this.t2
@@ -241,7 +242,7 @@ export default {
     openFundsList() {
       const data = this.$router.resolve({
         path: '/funds/detail',
-        query: { id: this.form.id }
+        query: { id: this.projectId }
       })
       window.open(data.href, '_blank')
     }

+ 4 - 1
src/views/project/componens/top.vue

@@ -55,7 +55,10 @@ export default {
         .then(res => {
           if (res.code === 200) {
             this.stages = res.data
-            this.stage = this.stages.find(ele => ele.isLastSelect === 1).id
+            const tmp = this.stages.find(ele => ele.isLastSelect === 1)
+            if (tmp) {
+              this.stage = tmp.id
+            }
             this.$emit('change', this.stage)
           }
         })

+ 8 - 2
src/views/project/index.vue

@@ -12,8 +12,8 @@
     </tips-custom>
     <!--    content-->
     <div style="margin-bottom: 65px">
-      <info1 :info="detail" />
-      <info2 :project-id="projectId" :stage-id="stageId" />
+      <info1 :info="detail" @industry="changeIndustry" />
+      <info2 :project-id="projectId" :stage-id="stageId" :industry="industry" />
       <info3 :project-id="projectId" :stage-id="stageId" />
       <info4 :project-id="projectId" />
       <info5 :info="detail" />
@@ -75,6 +75,7 @@ export default {
     return {
       projectId: '',
       stageId: '',
+      industry: null,
       detail: {}
     }
   },
@@ -94,6 +95,8 @@ export default {
           const status = confing.reportTypes.find(
             ele => ele.value === this.detail.report_type
           )
+          this.detail.dict_key = JSON.parse(this.detail.dict_key)
+          this.industry = this.detail.dict_key[0]
           if (status) {
             this.detail.report_type_name = status.label
           }
@@ -102,6 +105,9 @@ export default {
     },
     changeStage(res) {
       this.stageId = res
+    },
+    changeIndustry(industry) {
+      this.industry = industry
     }
   }
 }

+ 3 - 2
src/views/task/component/task.vue

@@ -78,7 +78,7 @@
           <div>
             <wt-label
               @submit="handleTags"
-              :ids="form.tags.split(',')"
+              :ids="[form.tags, form.category]"
               :disabled="!canEdit"
             />
           </div>
@@ -421,7 +421,8 @@ export default {
       this.form.executeUser = list.map(ele => ele.id).join(',')
     },
     handleTags(tags) {
-      this.form.tags = tags
+      this.form.tags = tags.find(ele => ele.type === 'tags').id
+      this.form.category = tags.find(ele => ele.type === 'category').id
     },
     /**
      * 成果文件上传成果

+ 9 - 4
src/views/task/component/wt-label.vue

@@ -80,7 +80,10 @@ export default {
     init() {
       this.$api.common.dicList({ code: 'edit_task_type' }).then(res => {
         if (res.code === 200) {
-          this.options = res.data
+          this.options = res.data.map(ele => {
+            ele.type = 'tags'
+            return ele
+          })
           if (this.ids.length > 0) {
             const tmp = this.options.find(ele => ele.id === this.ids[0])
             if (tmp) {
@@ -91,7 +94,10 @@ export default {
       })
       this.$api.common.dicList({ code: 'edit_task' }).then(res => {
         if (res.code === 200) {
-          this.options1 = res.data
+          this.options1 = res.data.map(ele => {
+            ele.type = 'category'
+            return ele
+          })
           if (this.ids.length > 1) {
             const tmp = this.options1.find(ele => ele.id === this.ids[1])
             this.tags.push(tmp)
@@ -106,8 +112,7 @@ export default {
       ]
       this.show = false
       this.form = {}
-      const tmps = this.tags.map(ele => ele.id).join(',')
-      this.$emit('submit', tmps)
+      this.$emit('submit', this.tags)
     },
     remove(res) {
       this.tags = this.tags.filter(ele => ele.id !== res.id)