Browse Source

工程现场 x工程项目 后台界面调整

zhanghao 3 months ago
parent
commit
c3dd5ba575
2 changed files with 23 additions and 5 deletions
  1. 3 3
      src/views/zcustom/project/index.vue
  2. 20 2
      src/views/zcustom/public/index.vue

+ 3 - 3
src/views/zcustom/project/index.vue

@@ -56,8 +56,8 @@
       <el-table-column label="项目名称" align="center" prop="projectName" />
       <el-table-column label="项目分类" align="center">
         <template slot-scope="scope">
-          <span v-if="scope.row.subdivision <= 10">{{ typeListA[scope.row.subdivision - 1].name }}</span>
-          <span v-if="scope.row.subdivision > 10">{{ typeListB[scope.row.subdivision - 1].name }}</span>
+          <span v-if="scope.row.subdivision <= 10">{{ typeListA[Number(scope.row.subdivision) - 1].name }}</span>
+          <span v-if="scope.row.subdivision > 10">{{ typeListB[Number(scope.row.subdivision) - 10].name }}</span>
         </template>
       </el-table-column>
       <el-table-column label="创建时间" align="center">
@@ -280,7 +280,7 @@ export default {
     getList() {
       this.loading = true;
       listProject(this.queryParams).then(response => {
-        this.projectList =  response.data.records;
+        this.projectList = response.data.records;
         this.total = response.data.total;
         this.loading = false;
       });

+ 20 - 2
src/views/zcustom/public/index.vue

@@ -110,8 +110,12 @@
     <!-- 添加或修改公务用车对话框 -->
     <el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="800px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="150px">
-        <el-form-item label="所属单位" prop="appEncode">
-          <el-input v-model="form.appEncode" placeholder="请输入所属单位" />
+        <el-form-item label="具体单位" prop="appEncode">
+          <el-cascader :options="treeList" placeholder="请选择单位" v-model="form.appEncode" :props="props" style="width: 400px">
+            <template slot-scope="{ node, data }">
+              <span>{{ data.appName }}</span>
+            </template>
+          </el-cascader>
         </el-form-item>
         <el-form-item label="公务车实有总数" prop="totalCarNum">
           <el-input v-model="form.totalCarNum" placeholder="请输入公务车实有总数" />
@@ -226,11 +230,19 @@ import {
   updatePlatPublicCar,
   uploadJson
 } from '@/api/zcustom/public'
+import { getListTree } from '@/api/zcustom/platAppOrg'
 
 export default {
   name: "PlatPublicCar",
   data() {
     return {
+      treeList:[],
+      props:{
+        value: 'appEncode',
+        label: 'appName',
+        checkStrictly: true,
+        emitPath: false
+      },
       value: null,
       options:[
         {
@@ -411,8 +423,14 @@ export default {
   },
   created() {
     this.getList();
+    this.getListTree()
   },
   methods: {
+    getListTree(){
+      getListTree().then(res => {
+        this.treeList.push(res.data)
+      })
+    },
     sure(){
       const jsonString = JSON.parse(this.json)
       console.log(jsonString)