فهرست منبع

系统设置左侧问题

Shannon_mu 3 سال پیش
والد
کامیت
4adfd0fcd2

+ 25 - 8
operationSupport/src/views/payService/systemSetup/stepPage/gateSetup.vue

@@ -42,6 +42,18 @@ export default {
                     category: 3,
                     amount: null
                 }
+            ],
+            initFormData: [
+                {
+                    type: 8,
+                    category: 3,
+                    amount: null
+                },
+                {
+                    type: 7,
+                    category: 3,
+                    amount: null
+                }
             ]
         };
     },
@@ -67,18 +79,23 @@ export default {
             this.$http
                 .post('/sc-community-web/systemConfig/page', instaData)
                 .then(({ data, msg, status }) => {
-                    data.list.forEach((item, index) => {
-                        if (item.type == '8') {
-                            Object.assign(this.formData[0], item);
-                        } else if (item.type == '7') {
-                            Object.assign(this.formData[1], item);
-                        }
-                    });
+                    if (data.total == 0) {
+                        this.formData = JSON.parse(JSON.stringify(this.initFormData));
+                    } else {
+                        data.list.forEach((item, index) => {
+                            if (item.type == '8') {
+                                Object.assign(this.formData[0], item);
+                            } else if (item.type == '7') {
+                                Object.assign(this.formData[1], item);
+                            }
+                        });
+                    }
+                    this.$refs.form.resetFields();
                 })
                 .catch(() => {});
         },
         currentOrganId(data) {
-            this.currentId = data.companyOrgId || '';
+            this.currentId = data.id || '';
             this.getData();
         }
     },

+ 43 - 14
operationSupport/src/views/payService/systemSetup/stepPage/paymentSetup.vue

@@ -88,6 +88,30 @@ export default {
                     enable: null,
                     amount: null
                 }
+            ],
+            initFormData: [
+                {
+                    type: 1,
+                    category: 1,
+                    enable: 0
+                },
+                {
+                    type: 2,
+                    category: 1,
+                    enable: 0
+                },
+                {
+                    type: 3,
+                    category: 1,
+                    enable: null,
+                    amount: null
+                },
+                {
+                    type: 4,
+                    category: 1,
+                    enable: null,
+                    amount: null
+                }
             ]
         };
     },
@@ -136,24 +160,29 @@ export default {
             this.$http
                 .post('/sc-community-web/systemConfig/page', instaData)
                 .then(({ data, msg, status }) => {
-                    data.list.forEach((item, index) => {
-                        if (item.type == '1') {
-                            Object.assign(this.formData[0], item);
-                        } else if (item.type == '2') {
-                            Object.assign(this.formData[1], item);
-                        } else if (item.type == '3') {
-                            Object.assign(this.formData[2], item);
-                            this.getInstallData('listCheckWater', item.enable);
-                        } else if (item.type == '4') {
-                            Object.assign(this.formData[3], item);
-                            this.getInstallData('listCheckElectric', item.enable);
-                        }
-                    });
+                    if (data.total == 0) {
+                        this.formData = JSON.parse(JSON.stringify(this.initFormData));
+                    } else {
+                        data.list.forEach((item, index) => {
+                            if (item.type == '1') {
+                                Object.assign(this.formData[0], item);
+                            } else if (item.type == '2') {
+                                Object.assign(this.formData[1], item);
+                            } else if (item.type == '3') {
+                                Object.assign(this.formData[2], item);
+                                this.getInstallData('listCheckWater', item.enable);
+                            } else if (item.type == '4') {
+                                Object.assign(this.formData[3], item);
+                                this.getInstallData('listCheckElectric', item.enable);
+                            }
+                        });
+                    }
+                    this.$refs.form.resetFields();
                 })
                 .catch(() => {});
         },
         currentOrganId(data) {
-            this.currentId = data.companyOrgId || '';
+            this.currentId = data.id || '';
             this.getData();
         }
     },

+ 25 - 8
operationSupport/src/views/payService/systemSetup/stepPage/valveSetup.vue

@@ -45,6 +45,18 @@ export default {
                     category: 2,
                     amount: null
                 }
+            ],
+            initFormData: [
+                {
+                    type: 6,
+                    category: 2,
+                    amount: null
+                },
+                {
+                    type: 5,
+                    category: 2,
+                    amount: null
+                }
             ]
         };
     },
@@ -69,18 +81,23 @@ export default {
             this.$http
                 .post('/sc-community-web/systemConfig/page', instaData)
                 .then(({ data, msg, status }) => {
-                    data.list.forEach((item, index) => {
-                        if (item.type == '6') {
-                            Object.assign(this.formData[0], item);
-                        } else if (item.type == '5') {
-                            Object.assign(this.formData[1], item);
-                        }
-                    });
+                    if (data.total == 0) {
+                        this.formData = JSON.parse(JSON.stringify(this.initFormData));
+                    } else {
+                        data.list.forEach((item, index) => {
+                            if (item.type == '6') {
+                                Object.assign(this.formData[0], item);
+                            } else if (item.type == '5') {
+                                Object.assign(this.formData[1], item);
+                            }
+                        });
+                    }
+                    this.$refs.form.resetFields();
                 })
                 .catch(() => {});
         },
         currentOrganId(data) {
-            this.currentId = data.companyOrgId || '';
+            this.currentId = data.id || '';
             this.getData();
         }
     },