Shannon_mu před 3 roky
rodič
revize
5a6d80c8fb

+ 2 - 0
operationSupport/src/views/businessManagement/contractManagement/stepPage/add.vue

@@ -66,10 +66,12 @@ export default {
             timesTwo: [],
             pictureArr: [],
             relationTable: {},
+            tegyArr:[],
             formRules: {
                 customerName: [this.$valid.inputRequired('客户名称')],
                 customerPhone: [this.$valid.patternPhone('客户手机')],
                 customerAddress: [this.$valid.inputRequired('联系地址')],
+                customerType:[this.$valid.selectRequired('客户类型')],
                 idCardNo:this.$valid.patternCard(),
                 communityId: [this.$valid.selectRequired('社区')],
                 signTime: [this.$valid.selectRequired('签订时间')],

+ 24 - 6
operationSupport/src/views/businessManagement/contractManagement/stepPage/firstStep.vue

@@ -11,7 +11,7 @@
         >
         <div class="formContent-item_title">客户信息</div>
         <el-col :span="24"
-            ><el-form-item label="客户类型" required>
+            ><el-form-item label="客户类型" prop="customerType">
                 <el-radio v-model="$parent.formData.customerType" :label="1">企业</el-radio>
                 <el-radio v-model="$parent.formData.customerType" :label="2">个人</el-radio>
 
@@ -162,11 +162,29 @@ export default {
                 .catch(() => {});
         },
         communityChange(val) {
-            this.$parent.communityTree.map((item) => {
-                if (item.id == val) {
-                    this.$parent.communityTreeArr = item.children;
-                }
-            });
+            this.getCommunityArr(val);
+            this.getTegy(val);
+        },
+        getTegy(val) {
+            this.$http
+                .get('/sc-charge/scChargeStrategy/page', {
+                    pageNum: 1,
+                    pageSize: 15,
+                    chargeType: 8,
+                    communityId: val
+                })
+                .then(({ data }) => {
+                    this.$parent.tegyArr = data.list;
+                })
+                .catch(function () {});
+        },
+        getCommunityArr(val) {
+            this.$http
+                .get('/sc-community/assets/tree/community/find', { filterType: val })
+                .then(({ data }) => {
+                    this.$parent.communityTreeArr = data[0].children;
+                })
+                .catch(function () {});
         },
         effectiveDateToggle(e) {
             this.$parent.formData.startTime = `${!!e ? e[0] : ''}`;

+ 2 - 12
operationSupport/src/views/businessManagement/contractManagement/stepPage/stepTwo.vue

@@ -20,7 +20,7 @@
                 <el-col :span="12" style="clear: both">
                     <el-form-item label="租金规则" :rules="rulesFun('租金规则', item.ruleId)">
                         <el-select v-model="item.ruleId" placeholder="请选择租金规则" clearable @change="ruleIdChange(index, item.ruleId)">
-                            <el-option v-for="(item, index) in tegyArr" :key="index" :label="item.chargeName" :value="item.id"></el-option>
+                            <el-option v-for="(item, index) in $parent.tegyArr" :key="index" :label="item.chargeName" :value="item.id"></el-option>
                         </el-select>
                     </el-form-item>
                 </el-col>
@@ -92,7 +92,6 @@ export default {
     data() {
         return {
             times: [],
-            tegyArr: [],
             thisRule: []
         };
     },
@@ -120,7 +119,7 @@ export default {
             } else {
                 this.thisRule[index] = 1;
             }
-            this.tegyArr.map((item) => {
+            this.$parent.tegyArr.map((item) => {
                 if (item.id == id) {
                     this.$parent.idsObj[index].thisArr = [item];
                     this.$parent.idsObj[index].chargePrice = item.chargePrice;
@@ -156,14 +155,6 @@ export default {
                 })
                 .catch(function () {});
         },
-        getTegy() {
-            this.$http
-                .get('/sc-charge/scChargeStrategy/page', { pageNum: 1, pageSize: 15, chargeType: 8 })
-                .then(({ data }) => {
-                    this.tegyArr = data.list;
-                })
-                .catch(function () {});
-        },
         chanIndexSumit(resolve) {
             if (!!this.thisRule.length) {
                 let len = 0;
@@ -183,7 +174,6 @@ export default {
         }
     },
     created() {
-        this.getTegy();
     }
 };
 </script>