Ver Fonte

fix bugs

scorpio há 2 anos atrás
pai
commit
9a1c7bb945

+ 2 - 2
src/views/home/component/dash.vue

@@ -447,7 +447,7 @@ export default {
           },
           {
             label: '责任单位',
-            prop: 'responsible_unit'
+            prop: 'unit_name'
           },
           {
             label: '子项目数量',
@@ -572,7 +572,7 @@ export default {
     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'
+      sub => sub.prop === 'unit_name'
     )
     this.dataType = localStorage.getItem('data-type')
     if (this.user.info.viewStage === 1) {

+ 45 - 2
src/views/home/component/params/params1.vue

@@ -48,13 +48,29 @@
             </div>
           </el-form-item>
           <el-form-item label="责任单位" style="flex: 1" class="ml-20">
-            <el-input v-model="form.responsible_unit" placeholder="责任单位" />
+            <div class="full-width">
+              <avue-input-tree
+                default-expand-all
+                v-model="form.responsible_unit"
+                placeholder="责任单位"
+                :dic="deptDic"
+                class="full-width"
+              ></avue-input-tree>
+            </div>
           </el-form-item>
         </div>
 
         <div class="full-width flex">
           <el-form-item label="主管单位" style="flex: 1">
-            <el-input v-model="form.competent_unit" placeholder="主管单位" />
+            <div class="full-width">
+              <avue-input-tree
+                default-expand-all
+                v-model="form.competent_unit"
+                placeholder="责任单位"
+                :dic="deptDic"
+                class="full-width"
+              ></avue-input-tree>
+            </div>
           </el-form-item>
           <el-form-item label="责任领导" style="flex: 1" class="ml-20">
             <el-input
@@ -303,6 +319,8 @@
 </template>
 
 <script>
+import { useStore } from '@/store/user.js'
+
 export default {
   name: 'params1',
   props: {
@@ -315,11 +333,16 @@ export default {
       default: null
     }
   },
+  setup() {
+    const user = useStore()
+    return { user }
+  },
   watch: {
     detail: {
       handler(val) {
         this.form = val
         this.form.construction_start_and_end_new = ''
+        this.form.competent_unit = val.competent_unit ? val.competent_unit : ''
         if (this.form.name) {
           const xian = this.form.name.indexOf('县')
           this.form.name = this.dev
@@ -347,14 +370,34 @@ export default {
         { label: '否', value: 0 },
         { label: '是', value: 1 }
       ],
+      deptDic: [],
       dev: false
     }
   },
   mounted() {
     this.dev = sessionStorage.getItem('dev') === 'true'
     this.areaList()
+    this.getDepList()
   },
   methods: {
+    getDepList() {
+      const local = {
+        label: this.user.info.deptName,
+        value: this.user.info.deptId
+      }
+      this.deptDic.push(local)
+      this.$api.system
+        .getDeptLazy({ parentId: this.user.info.deptId })
+        .then(res => {
+          if (res.code === 200) {
+            const tmp = res.data.map(ele => {
+              const item = { label: ele.deptName, value: ele.id }
+              return item
+            })
+            this.deptDic = this.deptDic.concat(tmp)
+          }
+        })
+    },
     areaList() {
       this.$api.common.region({ code: '' }).then(res => {
         if (res.code === 200) {