Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

billisme 4 lat temu
rodzic
commit
a8937d5c5d
2 zmienionych plików z 42 dodań i 27 usunięć
  1. 29 23
      src/views/estate/parkingspace.vue
  2. 13 4
      src/views/party/branch.vue

+ 29 - 23
src/views/estate/parkingspace.vue

@@ -27,6 +27,10 @@
                    @click="handleDelete">删 除
                    @click="handleDelete">删 除
         </el-button>
         </el-button>
       </template>
       </template>
+      <template slot="residentialId" slot-scope="scope">{{scope.row.residentialName}}</template>
+      <template slot="residentialIdForm" slot-scope="scope">
+        <select-dialog-residential :disabled="residentialDisabled" :id="form.residentialId" :name="form.residentialName" :callback="selectCallback"></select-dialog-residential>
+      </template>
     </avue-crud>
     </avue-crud>
   </basic-container>
   </basic-container>
 </template>
 </template>
@@ -35,8 +39,10 @@
   import {getList, getDetail, add, update, remove} from "@/api/estate/parkingspace";
   import {getList, getDetail, add, update, remove} from "@/api/estate/parkingspace";
   import {getList as getResidentialList} from "@/api/community/residential";
   import {getList as getResidentialList} from "@/api/community/residential";
   import {mapGetters} from "vuex";
   import {mapGetters} from "vuex";
+  import SelectDialogResidential from "../../components/select-dialog/select-dialog-residential";
 
 
   export default {
   export default {
+    components: {SelectDialogResidential},
     data() {
     data() {
       return {
       return {
         form: {},
         form: {},
@@ -48,6 +54,7 @@
           total: 0
           total: 0
         },
         },
         selectionList: [],
         selectionList: [],
+        residentialDisabled: false,
         option: {
         option: {
           height:'auto',
           height:'auto',
           calcHeight: 30,
           calcHeight: 30,
@@ -134,38 +141,28 @@
                 trigger: "blur"
                 trigger: "blur"
               }],
               }],
             },
             },
-            {
-              label: "所属小区",
-              prop: "residentialName",
-              editDisplay: false,
-              addDisplay: false,
-              viewDisplay: false,
-            },
             {
             {
               label: "所属小区",
               label: "所属小区",
               prop: "residentialId",
               prop: "residentialId",
               type: "select",
               type: "select",
-              search: true,
-              searchFilterable: true,
-              remote: true,
-              cascaderItem: ['parkingLotId'],
-              // dicUrl: "/api/cyzh-community/residential/list?agencyId={{key}}",
-              dicUrl: "/api/cyzh-community/residential/select?size=500&name={{key}}",
-              // dicFormatter:(res)=>{
-              //   return res.data.records;//返回字典的层级结构
-              // },
+              slot:true,
+              formslot:true,
+              // dicUrl: "/api/cyzh-community/residential/list?agencyId={{key}}&&size=9999",
+              dicUrl: "/api/cyzh-community/residential/list?size=500",
+              dicFormatter:(res)=>{
+                return res.data.records;//返回字典的层级结构
+              },
+              // dicFlag: false,
               filterable: true,
               filterable: true,
               props: {
               props: {
                 label: "name",
                 label: "name",
                 value: "id"
                 value: "id"
               },
               },
               rules: [{
               rules: [{
-                required: true,
+                required: false,
                 message: "请选择所属小区",
                 message: "请选择所属小区",
                 trigger: "blur"
                 trigger: "blur"
-              }],
-              hide: true,
-              // viewDisplay: false
+              }]
             },
             },
             // {
             // {
             //   label: "机构路径",
             //   label: "机构路径",
@@ -183,7 +180,7 @@
               search: true,
               search: true,
               // dicFlag: false,
               // dicFlag: false,
               // remote: true,
               // remote: true,
-              dicUrl: "/api/cyzh-estate/parkinglot/list?size=100&residentialId={{key}}",
+              dicUrl: "/api/cyzh-estate/parkinglot/list",
               props: {
               props: {
                 label: 'parkName',
                 label: 'parkName',
                 value: 'id'
                 value: 'id'
@@ -249,13 +246,20 @@
       }
       }
     },
     },
     watch: {
     watch: {
-      "form.residentialId"() {
+      /*"form.residentialId"() {
         getResidentialList(1, 10, {id: this.form.residentialId}).then(res => {
         getResidentialList(1, 10, {id: this.form.residentialId}).then(res => {
           this.form.residentialName = res.data.data.records[0].name;
           this.form.residentialName = res.data.data.records[0].name;
         })
         })
-      }
+      }*/
     },
     },
     methods: {
     methods: {
+      selectCallback(row){
+        this.form.residentialId = row.id;
+        this.form.residentialName = row.name;
+        if (this.option.column[5].prop == 'parkingLotId' && this.option.column[5].dicUrl.indexOf('residentialId') == -1){
+          this.option.column[5].dicUrl += '?residentialId=' + this.form.residentialId + '&size=100';
+        }
+      },
       rowSave(row, done, loading) {
       rowSave(row, done, loading) {
         add(row).then(() => {
         add(row).then(() => {
           this.onLoad(this.page);
           this.onLoad(this.page);
@@ -322,7 +326,9 @@
           });
           });
       },
       },
       beforeOpen(done, type) {
       beforeOpen(done, type) {
+        this.residentialDisabled = false;
         if (["edit", "view"].includes(type)) {
         if (["edit", "view"].includes(type)) {
+          this.residentialDisabled = type == "view";
           getDetail(this.form.id).then(res => {
           getDetail(this.form.id).then(res => {
             this.form = res.data.data;
             this.form = res.data.data;
           });
           });

+ 13 - 4
src/views/party/branch.vue

@@ -200,7 +200,7 @@
               span:24,
               span:24,
               // dicUrl: "/api/cyzh-community/residential/list?agencyId={{key}}",
               // dicUrl: "/api/cyzh-community/residential/list?agencyId={{key}}",
               // dicUrl: "/api/cyzh-community/residential/list?size=500",
               // dicUrl: "/api/cyzh-community/residential/list?size=500",
-              dicUrl: "/api/cyzh-community/residential/select?size=1000",
+              dicUrl: "/api/cyzh-community/agency/list?size=1000",
               dicFormatter:(res)=>{
               dicFormatter:(res)=>{
                 return res.data.records;//返回字典的层级结构
                 return res.data.records;//返回字典的层级结构
               },
               },
@@ -214,7 +214,7 @@
                 message: "请选择所属小区",
                 message: "请选择所属小区",
                 trigger: "blur"
                 trigger: "blur"
               }]
               }]
-            }
+            },
           ]
           ]
         },
         },
         data: []
         data: []
@@ -271,11 +271,20 @@
     watch: {
     watch: {
       'form.resourceType': {
       'form.resourceType': {
         handler(val) {
         handler(val) {
+          console.log(val,"val")
           let resourceIds = this.findObject(this.option.column, "resourceIds");
           let resourceIds = this.findObject(this.option.column, "resourceIds");
           if (val == 1) {
           if (val == 1) {
+            this.option.column[7].props.label="name"
+            resourceIds.dicUrl = `/api/cyzh-community/agency/list?size=500&name={{key}}`
+          } else if (val==2){
+            this.option.column[7].props.label="name"
+            resourceIds.dicUrl = "/api/cyzh-community/residentail/list?size=9999";
+          }else if(val==3){
+            this.option.column[7].props.label="name"
             resourceIds.dicUrl = `/api/cyzh-community/agency/list?size=500&name={{key}}`
             resourceIds.dicUrl = `/api/cyzh-community/agency/list?size=500&name={{key}}`
-          } else {
-            resourceIds.dicUrl = "/api/cyzh-community/residential/list?size=99999";
+          }else{
+            resourceIds.dicUrl = "/api/cyzh-enterprise/enterprise/list?size=500";
+            this.option.column[7].props.label="enterpriseName"
           }
           }
         }
         }
       }
       }