From 61985d6f294a8db7d4a69ec05df2aaea9f52d802 Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Tue, 16 Jan 2024 17:01:37 +0800
Subject: [PATCH] 物业评分

---
 src/views/article/components/deitDiscussion.vue |  237 ++++++++---
 src/views/property/propertyCompany.vue          |  996 ++++++++++++++++++++++++-----------------------
 2 files changed, 675 insertions(+), 558 deletions(-)

diff --git a/src/views/article/components/deitDiscussion.vue b/src/views/article/components/deitDiscussion.vue
index 44369ec..8d81e53 100644
--- a/src/views/article/components/deitDiscussion.vue
+++ b/src/views/article/components/deitDiscussion.vue
@@ -10,11 +10,38 @@
 -->
 <template>
   <div>
+    <el-dialog title="" append-to-body :visible.sync="popupTableShow" width="80%" :before-close="handleClose">
+      <span slot="title" class="dialog-footer">
+        {{ ontitle }}
+      </span>
 
+      <div id="" v-if="editFlag">
+        <avue-form @submit="handleSubmit" :option="optionDiscuss" @reset-change="handleReset" v-model="disCussFrom">
+        </avue-form>
+      </div>
 
-    <el-dialog title="" append-to-body :visible.sync="popupTableUserShow" width="80%" :before-close="userHandleClose">
-      <avue-crud :data="userData" @search-change="searchChange" @row-del="rowDel" @search-reset="searchReset"
-        :page="userPage" :option="userOption"></avue-crud>
+      <div id="" v-if="!editFlag">
+        <avue-crud :table-loading="loading" :option="optionList" :data="data" v-model="form" ref="crud"
+          @row-update="rowUpdate" @row-del="rowDel">
+          <template slot="menuLeft" v-if="!editFlag">
+            <el-button type="primary" size="small" plain icon="el-icon-circle-plus-outline" @click="add()">添加
+            </el-button>
+          </template>
+          <template #icon="scope">
+            <i :class="scope.row.icon" style="font-size:14px"></i>
+          </template>
+          <template #menu="{ row, size }">
+            <el-button v-if="row.level === 1" :size="size" text type="primary" @click="edit(row)">编辑</el-button>
+            <el-button v-if="row.level === 1" :size="size" text type="danger" @click="deletes(row)">删除</el-button>
+            <el-button v-if="row.level === 2" :size="size" text type="primary" @click="openUser(row, 1)">
+              选择此项人数:{{ row.number }} 详情</el-button>
+          </template>
+        </avue-crud>
+      </div>
+    </el-dialog>
+
+    <el-dialog title="" append-to-body :visible.sync="popupTableUserShow" width="50%" :before-close="userHandleClose">
+      <avue-crud :data="userData" :page="userPage" :option="userOption"></avue-crud>
     </el-dialog>
   </div>
 </template>
@@ -29,12 +56,8 @@
   } from "@/api/discuss/publicDiscuss"
 
   import {
-    getPage,
-    remove
+    getPage
   } from "@/api/discuss/userTopics"
-
-
-  import website from '@/config/website'
 
 
   import {
@@ -43,6 +66,7 @@
     getDetail,
     add,
     update,
+    remove
   } from "@/api/discuss/topics"
 
   export default {
@@ -50,56 +74,135 @@
       return {
         popupTableShow: false,
         popupTableUserShow: false,
+
         loading: true,
+
+        ontitle: '编辑议题',
+        editFlag: false,
+
+        disCussFrom: {
+          discussContent: '',
+          optionRange: 0,
+          sort: 1,
+          optionContent: '',
+          optionDetail: '',
+          number: '',
+          createTime: '',
+          updateTime: '',
+          deleteFlag: '',
+          articleId: '',
+          parentId: '',
+          level: '',
+          children: [{
+            optionContent: '',
+            optionDetail: '',
+            number: '',
+            createTime: '',
+            updateTime: '',
+            deleteFlag: '',
+            articleId: '',
+            parentId: '',
+            level: '',
+          }]
+        },
+        optionDiscuss: {
+          emptyText: '取消',
+          column: [{
+              label: '议题',
+              prop: 'discussContent',
+              type: 'input',
+              row: true,
+            },
+            {
+              label: '选项范围',
+              prop: 'optionRange',
+              type: 'radio',
+              button: true,
+              row: true,
+              dicData: [{
+                label: '多选',
+                value: 1
+              }, {
+                label: '单选',
+                value: 0
+              }]
+            },
+            {
+              label: '排序',
+              prop: 'sort',
+              controlsPosition: '',
+              type: 'number'
+            },
+            {
+              label: '选项内容',
+              prop: 'children',
+              type: 'dynamic',
+              span: 24,
+              children: {
+                column: [{
+                  label: '选项标题',
+                  prop: 'optionContent',
+                  type: 'input',
+                  rules: [{
+                    required: true,
+                    message: '请输入选项标题',
+                    trigger: 'blur'
+                  }]
+                }, {
+                  label: '选项说明',
+                  prop: 'optionDetail',
+                  type: 'input',
+                }]
+              }
+            },
+          ]
+        },
+
         // 表单数据
         form: {},
         data: [],
+        optionList: {
+          headerAlign: 'center',
+          align: 'center',
+          border: true,
+          addBtn: false,
+          editBtn: false,
+          delBtn: false,
+          defaultExpandAll: true,
+          rowKey: 'id',
+          rowParentKey: 'parentId',
+          column: [{
+              label: '标题',
+              prop: 'discussContent',
+            },
+            {
+              label: '选项内容',
+              prop: 'optionContent',
+            }
+          ]
+        },
+
         articleId: '',
+
         userData: [],
         userOption: {
-          labelWidth: 96,
-          searchLabelWidth: 96,
-          searchShow: true,
-          searchMenuSpan: 3,
-          // menuWidth: 500,
-
-          height: "auto",
-          calcHeight: 54,
-          dialogWidth: 950,
-          tip: false,
-          border: false,
-          //stripe:true,
-          index: true,
-          editBtn: false,
           addBtn: false,
-          viewBtn: false,
-          selection: true,
-          excelBtn: true,
-          dialogClickModal: false,
+          menu: false,
           column: [{
             label: '姓名',
-            prop: 'name',
-            searchSpan: 4,
-            search: true,
+            prop: 'name'
           }, {
             label: '头像',
             prop: 'avatar'
           }, {
             label: '手机',
-            prop: 'phone',
-            searchSpan: 4,
-            search: true,
+            prop: 'phone'
           }, {
             label: '小区',
             prop: 'aoiName'
           }, {
             label: '地址',
             prop: 'addressName'
-          }, {
-            label: '签名',
-            type: 'upload',
-            listType: "picture-img",
-            prop: 'signaturePath'
           }, {
             label: '时间',
             prop: 'createTime'
@@ -118,31 +221,12 @@
     watch: {},
 
     methods: {
-
-
-      userHandleClose() {
-
-        this.popupTableUserShow = false
-      },
-
-      searchReset() {
-        this.query = {}
-        this.getUserPage(this.userPage)
-      },
-
-      searchChange(params, done) {
-        this.query = params
-        this.userPage.currentPage = 1
-        this.getUserPage(this.userPage, params)
-        done()
-      },
       initData(newData) {
         this.editFlag = false
         this.popupTableShow = true
         this.articleId = newData.id
-        this.query.level = 1
-        this.query.articleId = this.articleId
-        this.onLoad(this.userPage, this.query)
+
+        this.onLoad()
       },
 
       handleClose() {
@@ -217,7 +301,8 @@
             return remove(row.id)
           })
           .then(() => {
-            this.getUserPage(this.userPage)
+            this.onLoad()
+
             this.$message({
               type: "success",
               message: "操作成功!"
@@ -234,10 +319,28 @@
         this.editFlag = true
       },
 
+      deletes(row) {
+        this.$confirm("确定将选择数据删除?", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          })
+          .then(() => {
+            return remove(row.id)
+          })
+          .then(() => {
+            this.onLoad()
+
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            })
+          })
+      },
 
       openUser(row, type = 0) {
         this.popupTableUserShow = true
-        this.query = {}
+
         if (type == 0) {
           this.userParams = {
             articleId: row.id
@@ -259,17 +362,19 @@
             if (item.avatar.length > 0) {
               item.avatar = website.minioUrl + item.avatar
             }
-            if (item.signaturePath && item.signaturePath.length > 0) {
-              item.signaturePath = website.minioUrl + item.signaturePath
-              // console.log("=====>", item.signaturePath)
-            }
           })
         })
       },
 
-      onLoad(page, params = {}) {
+      onLoad() {
         this.loading = true
-        getLists(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+
+        let params = {
+          level: 1,
+          articleId: this.articleId
+        }
+
+        getLists(1, 100, Object.assign(params, this.query)).then(res => {
           const data = res.data.data
           this.data = data
           this.loading = false
diff --git a/src/views/property/propertyCompany.vue b/src/views/property/propertyCompany.vue
index 039f539..63fe3f4 100644
--- a/src/views/property/propertyCompany.vue
+++ b/src/views/property/propertyCompany.vue
@@ -1,535 +1,547 @@
 <!-- 物业公司管理 -->
 <template>
-    <basic-container>
-        <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
-            v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
-            :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset"
-            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
-            @refresh-change="refreshChange" @on-load="onLoad">
-            <template slot="menuLeft">
-                <el-button size="small" icon="el-icon-delete" plain v-if="permission.propertyCompany_delete"
-                    @click="handleDelete">删 除
-                </el-button>
-            </template>
+  <basic-container>
+    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
+      v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
+      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
+      @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
+      <template slot="menuLeft">
+        <el-button size="small" icon="el-icon-delete" plain v-if="permission.propertyCompany_delete"
+          @click="handleDelete">删 除
+        </el-button>
 
-            <template slot-scope="{row, size, index}" slot="menu">
-                <el-button :size="size" v-if="permission.payInfo" type="text" icon="el-icon-circle-plus-outline"
-                    @click="openPayConfig(row)">商户配置
-                </el-button>
-            </template>
-        </avue-crud>
 
-        <el-dialog title="商户配置" append-to-body :visible.sync="payInfoVisible" top="10vh" width="70%">
-            <el-tabs v-model="currentTab">
-                <el-tab-pane label="微信商户配置" name="wxInfo">
-                    <avue-form ref="wxForm" :option="wxPayOption" v-model="wxPayForm" @submit="wxSubmit">
-                    </avue-form>
-                </el-tab-pane>
-                <el-tab-pane label="支付宝商户配置" name="second">
-                    <avue-form ref="aliForm" :option="aliPayOption" v-model="aliPayForm" @submit="aliSubmit">
-                    </avue-form>
-                </el-tab-pane>
+      </template>
 
-            </el-tabs>
+      <template slot-scope="{row, size, index}" slot="menu">
+        <el-button :size="size" v-if="permission.payInfo" type="text" icon="el-icon-circle-plus-outline"
+          @click="openPayConfig(row)">商户配置
+        </el-button>
 
-            <!--      <div slot="footer" class="dialog-footer">-->
-            <!--        <el-button @click="payInfoVisible = false">取 消</el-button>-->
-            <!--        <el-button type="primary"@click="submit">提 交</el-button>-->
-            <!--      </div>-->
+        <el-button :size="size" icon="el-icon-circle-plus-outline" type="text" @click="addProperty()">新 增
+        </el-button>
+      </template>
+    </avue-crud>
 
-        </el-dialog>
-    </basic-container>
+    <el-dialog title="商户配置" append-to-body :visible.sync="payInfoVisible" top="10vh" width="70%">
+      <el-tabs v-model="currentTab">
+        <el-tab-pane label="微信商户配置" name="wxInfo">
+          <avue-form ref="wxForm" :option="wxPayOption" v-model="wxPayForm" @submit="wxSubmit">
+          </avue-form>
+        </el-tab-pane>
+        <el-tab-pane label="支付宝商户配置" name="second">
+          <avue-form ref="aliForm" :option="aliPayOption" v-model="aliPayForm" @submit="aliSubmit">
+          </avue-form>
+        </el-tab-pane>
+
+      </el-tabs>
+
+      <!--      <div slot="footer" class="dialog-footer">-->
+      <!--        <el-button @click="payInfoVisible = false">取 消</el-button>-->
+      <!--        <el-button type="primary"@click="submit">提 交</el-button>-->
+      <!--      </div>-->
+
+    </el-dialog>
+
+    <propertyEdit ref="propertyEdit"></propertyEdit>
+
+
+  </basic-container>
 </template>
 
 <script>
-import {
+  import {
     getList,
     remove,
     update,
     add,
     getPropertyCompany,
     getPayConfig,
-    saveOrUpdateWx, saveOrUpdateAli
-} from "@/api/property/propertyCompany"
-import { mapGetters } from "vuex"
-import website from '@/config/website'
-import func from "@/util/func"
+    saveOrUpdateWx,
+    saveOrUpdateAli
+  } from "@/api/property/propertyCompany"
+  import {
+    mapGetters
+  } from "vuex"
+  import website from '@/config/website'
+  import func from "@/util/func"
 
-const labelWidth = 120
-export default {
-    data () {
-        return {
-            currentTab: "wxInfo",
-            payInfoVisible: false,
-            currentRow: {},
+  import propertyEdit from './components/propertyEdit.vue'
 
-            form: {},
-            query: {},
-            loading: true,
-            page: {
-                pageSize: 10,
-                currentPage: 1,
-                total: 0,
+  const labelWidth = 120
+  export default {
+    components: {
+      propertyEdit
+    },
+    data() {
+      return {
+        currentTab: "wxInfo",
+        payInfoVisible: false,
+        currentRow: {},
+
+        form: {},
+        query: {},
+        loading: true,
+        page: {
+          pageSize: 10,
+          currentPage: 1,
+          total: 0,
+        },
+        datetime: "",
+        selectionList: [],
+        option: {
+          labelWidth: 120,
+          searchLabelWidth: 96,
+          searchShow: true,
+          searchMenuSpan: 3,
+          menuWidth: 280,
+
+          height: "auto",
+          calcHeight: 54,
+          dialogWidth: 1150,
+          tip: false,
+          border: true,
+          //stripe:true,
+          index: true,
+          // viewBtn: true,
+          delBtn: false,
+          selection: true,
+          dialogClickModal: false,
+          column: [{
+              overHidden: true,
+              label: "物业公司名称",
+              prop: "name",
+              searchSpan: 5,
+              searchLabelWidth: 124,
+              search: true,
+              span: 18,
+              row: true,
+              width: 260,
+              rules: [{
+                required: true,
+                message: "请输入物业公司名称",
+                trigger: "blur",
+              }, ],
             },
-            datetime: "",
-            selectionList: [],
-            option: {
-                labelWidth: 120,
-                searchLabelWidth: 96,
-                searchShow: true,
-                searchMenuSpan: 3,
-                menuWidth: 280,
-
-                height: "auto",
-                calcHeight: 54,
-                dialogWidth: 1150,
-                tip: false,
-                border: true,
-                //stripe:true,
-                index: true,
-                viewBtn: true,
-                selection: true,
-                dialogClickModal: false,
-                column: [
-                    {
-                        overHidden: true,
-                        label: "物业公司名称",
-                        prop: "name",
-                        searchSpan: 5,
-                        searchLabelWidth: 124,
-                        search: true,
-                        span: 18,
-                        row: true,
-                        width: 260,
-                        rules: [
-                            {
-                                required: true,
-                                message: "请输入物业公司名称",
-                                trigger: "blur",
-                            },
-                        ],
-                    },
-                    {
-                        label: '省份',
-                        prop: 'province',
-                        type: 'select',
-                        props: {
-                            label: 'name',
-                            value: 'code'
-                        },
-                        hide: true,
-                        span: 6,
-                        cascader: ['city'],
-                        dicUrl: `/api/blade-system/region/select`,
-                        rules: [
-                            {
-                                required: true,
-                                message: '请选择省份',
-                                trigger: 'blur'
-                            }
-                        ]
-                    },
-                    {
-                        label: '城市',
-                        prop: 'city',
-                        type: 'select',
-                        span: 6,
-                        labelWidth: 60,
-                        cascader: ['area'],
-                        props: {
-                            label: 'name',
-                            value: 'code'
-                        },
-                        hide: true,
-                        dicUrl: `/api/blade-system/region/select?code={{key}}`,
-                        rules: [
-                            {
-                                required: true,
-                                message: '请选择城市',
-                                trigger: 'blur'
-                            }
-                        ]
-                    },
-                    {
-                        label: '地区',
-                        prop: 'area',
-                        type: 'select',
-                        span: 6,
-                        labelWidth: 60,
-                        props: {
-                            label: 'name',
-                            value: 'code'
-                        },
-                        hide: true,
-                        dicUrl: `/api/blade-system/region/select?code={{key}}`,
-                        rules: [
-                            {
-                                required: true,
-                                message: '请选择地区',
-                                trigger: 'blur'
-                            }
-                        ]
-                    },
-                    {
-                        overHidden: true,
-                        label: "地址",
-                        prop: "address",
-                        span: 18,
-                        row: true,
-                    },
-                    {
-                        label: "社会信用代码",
-                        prop: "socialCreditCode",
-                    },
-
-                    {
-                        label: "简介",
-                        prop: "remark",
-                        component: "AvueUeditor",
-                        options: {
-                            action: "/api/blade-resource/oss/endpoint/put-file-attach",
-                            props: {
-                                res: "data",
-                                url: "link",
-                            },
-                        },
-                        hide: true,
-                        minRows: 6,
-                        span: 24,
-                    },
-                ],
+            {
+              label: '省份',
+              prop: 'province',
+              type: 'select',
+              props: {
+                label: 'name',
+                value: 'code'
+              },
+              hide: true,
+              span: 6,
+              cascader: ['city'],
+              dicUrl: `/api/blade-system/region/select`,
+              rules: [{
+                required: true,
+                message: '请选择省份',
+                trigger: 'blur'
+              }]
             },
-            data: [],
-
-            wxPayForm: {},
-            wxPayOption: {
-                emptyBtn: false,
-                height: "auto",
-                calcHeight: 180,
-                //stripe:true,
-                column: [
-                    {
-                        label: "appId",
-                        labelWidth: labelWidth,
-                        prop: "appId",
-                        span: 24,
-                        rules: [{
-                            required: true,
-                            message: "请输入appId",
-                            trigger: ["blur", "change"]
-                        },],
-                    },
-                    {
-                        label: "mch-id",
-                        labelWidth: labelWidth,
-                        prop: "mchId",
-                        span: 24,
-                        rules: [{
-                            required: true,
-                            message: "请输入mch-id",
-                            trigger: ["blur", "change"]
-                        },],
-                    },
-                    {
-                        label: "mchKey",
-                        labelWidth: labelWidth,
-                        prop: "mchKey",
-                        rules: [{
-                            required: true,
-                            message: "请输入mchKey",
-                            trigger: ["blur", "change"]
-                        },],
-                        span: 24,
-                    },
-                    {
-                        label: "appSecret",
-                        labelWidth: labelWidth,
-                        prop: "appSecret",
-                        rules: [{
-                            required: true,
-                            message: "请输入appSecret",
-                            trigger: ["blur", "change"]
-                        },],
-                        span: 24,
-                    },
-                    {
-                        label: '安全证书',
-                        labelWidth: labelWidth,
-                        prop: 'keyPath',
-                        type: 'upload',
-                        drag: true,
-                        limit: 1,
-                        loadText: '上传中,请稍等',
-                        span: 24,
-                        action: "/api/blade-resource/oss/endpoint/put-file",
-                        propsHttp: {
-                            res: "data",
-                            name: 'name',
-                            url: "link",
-                        },
-                        rules: [{
-                            required: true,
-                            message: "请上传安全证书",
-                            trigger: ["blur", "change"]
-                        },],
-                    },
-                ],
+            {
+              label: '城市',
+              prop: 'city',
+              type: 'select',
+              span: 6,
+              labelWidth: 60,
+              cascader: ['area'],
+              props: {
+                label: 'name',
+                value: 'code'
+              },
+              hide: true,
+              dicUrl: `/api/blade-system/region/select?code={{key}}`,
+              rules: [{
+                required: true,
+                message: '请选择城市',
+                trigger: 'blur'
+              }]
+            },
+            {
+              label: '地区',
+              prop: 'area',
+              type: 'select',
+              span: 6,
+              labelWidth: 60,
+              props: {
+                label: 'name',
+                value: 'code'
+              },
+              hide: true,
+              dicUrl: `/api/blade-system/region/select?code={{key}}`,
+              rules: [{
+                required: true,
+                message: '请选择地区',
+                trigger: 'blur'
+              }]
+            },
+            {
+              overHidden: true,
+              label: "地址",
+              prop: "address",
+              span: 18,
+              row: true,
+            },
+            {
+              label: "社会信用代码",
+              prop: "socialCreditCode",
             },
 
-            aliPayForm: {},
-            aliPayOption: {
-                emptyBtn: false,
-                height: "auto",
-                calcHeight: 180,
-                //stripe:true,
-                column: [
-                    {
-                        label: "appId",
-                        labelWidth: labelWidth,
-                        prop: "appId",
-                        span: 24,
-                        rules: [{
-                            required: true,
-                            message: "请输入appId",
-                            trigger: ["blur", "change"]
-                        },],
-                    },
-                    {
-                        label: "privateKey",
-                        labelWidth: labelWidth,
-                        prop: "privateKey",
-                        span: 24,
-                        rules: [{
-                            required: true,
-                            message: "请输入privateKey",
-                            trigger: ["blur", "change"]
-                        },],
-                    },
-                    {
-                        label: "publicKey",
-                        labelWidth: labelWidth,
-                        prop: "publicKey",
-                        span: 24,
-                        rules: [{
-                            required: true,
-                            message: "请输入publicKey",
-                            trigger: ["blur", "change"]
-                        },],
-                    },
-                ],
-            }
+            {
+              label: "简介",
+              prop: "remark",
+              component: "AvueUeditor",
+              options: {
+                action: "/api/blade-resource/oss/endpoint/put-file-attach",
+                props: {
+                  res: "data",
+                  url: "link",
+                },
+              },
+              hide: true,
+              minRows: 6,
+              span: 24,
+            },
+          ],
+        },
+        data: [],
 
+        wxPayForm: {},
+        wxPayOption: {
+          emptyBtn: false,
+          height: "auto",
+          calcHeight: 180,
+          //stripe:true,
+          column: [{
+              label: "appId",
+              labelWidth: labelWidth,
+              prop: "appId",
+              span: 24,
+              rules: [{
+                required: true,
+                message: "请输入appId",
+                trigger: ["blur", "change"]
+              }, ],
+            },
+            {
+              label: "mch-id",
+              labelWidth: labelWidth,
+              prop: "mchId",
+              span: 24,
+              rules: [{
+                required: true,
+                message: "请输入mch-id",
+                trigger: ["blur", "change"]
+              }, ],
+            },
+            {
+              label: "mchKey",
+              labelWidth: labelWidth,
+              prop: "mchKey",
+              rules: [{
+                required: true,
+                message: "请输入mchKey",
+                trigger: ["blur", "change"]
+              }, ],
+              span: 24,
+            },
+            {
+              label: "appSecret",
+              labelWidth: labelWidth,
+              prop: "appSecret",
+              rules: [{
+                required: true,
+                message: "请输入appSecret",
+                trigger: ["blur", "change"]
+              }, ],
+              span: 24,
+            },
+            {
+              label: '安全证书',
+              labelWidth: labelWidth,
+              prop: 'keyPath',
+              type: 'upload',
+              drag: true,
+              limit: 1,
+              loadText: '上传中,请稍等',
+              span: 24,
+              action: "/api/blade-resource/oss/endpoint/put-file",
+              propsHttp: {
+                res: "data",
+                name: 'name',
+                url: "link",
+              },
+              rules: [{
+                required: true,
+                message: "请上传安全证书",
+                trigger: ["blur", "change"]
+              }, ],
+            },
+          ],
+        },
+
+        aliPayForm: {},
+        aliPayOption: {
+          emptyBtn: false,
+          height: "auto",
+          calcHeight: 180,
+          //stripe:true,
+          column: [{
+              label: "appId",
+              labelWidth: labelWidth,
+              prop: "appId",
+              span: 24,
+              rules: [{
+                required: true,
+                message: "请输入appId",
+                trigger: ["blur", "change"]
+              }, ],
+            },
+            {
+              label: "privateKey",
+              labelWidth: labelWidth,
+              prop: "privateKey",
+              span: 24,
+              rules: [{
+                required: true,
+                message: "请输入privateKey",
+                trigger: ["blur", "change"]
+              }, ],
+            },
+            {
+              label: "publicKey",
+              labelWidth: labelWidth,
+              prop: "publicKey",
+              span: 24,
+              rules: [{
+                required: true,
+                message: "请输入publicKey",
+                trigger: ["blur", "change"]
+              }, ],
+            },
+          ],
         }
+
+      }
     },
     watch: {},
     computed: {
-        ...mapGetters(["permission", "userInfo"]),
-        permissionList () {
-            return {
-                addBtn: this.vaildData(this.permission.propertyCompany_add, true),
-                viewBtn: this.vaildData(this.permission.propertyCompany_view, true),
-                delBtn: this.vaildData(this.permission.propertyCompany_delete, true),
-                editBtn: this.vaildData(this.permission.propertyCompany_edit, true),
-            }
-        },
-        ids () {
-            let ids = []
-            this.selectionList.forEach((ele) => {
-                ids.push(ele.id)
-            })
-            return ids.join(",")
-        },
+      ...mapGetters(["permission", "userInfo"]),
+      permissionList() {
+        return {
+          addBtn: this.vaildData(this.permission.propertyCompany_add, true),
+          viewBtn: this.vaildData(this.permission.propertyCompany_view, true),
+          delBtn: this.vaildData(this.permission.propertyCompany_delete, true),
+          editBtn: this.vaildData(this.permission.propertyCompany_edit, true),
+        }
+      },
+      ids() {
+        let ids = []
+        this.selectionList.forEach((ele) => {
+          ids.push(ele.id)
+        })
+        return ids.join(",")
+      },
     },
-    created () {
-    },
+    created() {},
     methods: {
 
-        aliSubmit (form, done) {
 
-            console.log("支付宝商户配置", this.aliPayForm)
+      addProperty() {
+        this.$refs.propertyEdit.init();
+      },
 
-            this.aliPayForm.propertyCompanyId = this.currentRow.id
-            saveOrUpdateAli(this.aliPayForm).then(res => {
-                this.$message({
-                    type: "success",
-                    message: "操作成功!",
-                })
-                done()
-            })
+      aliSubmit(form, done) {
 
-        },
+        console.log("支付宝商户配置", this.aliPayForm)
 
-        wxSubmit (form, done) {
-            this.wxPayForm.propertyCompanyId = this.currentRow.id
+        this.aliPayForm.propertyCompanyId = this.currentRow.id
+        saveOrUpdateAli(this.aliPayForm).then(res => {
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          })
+          done()
+        })
 
-            this.wxPayForm.keyPath = func.join(this.wxPayForm.keyPath)
-            if (this.wxPayForm.keyPath.length > 0) {
-                var urls = []
-                var split = this.wxPayForm.keyPath.split(",")
-                split.forEach(url => {
-                    var names = url.split("jczz/")
-                    urls.push(names[1])
-                })
-                this.wxPayForm.keyPath = urls.join(",")
-            }
+      },
 
-            console.log("微信商户配置", this.wxPayForm)
-            saveOrUpdateWx(this.wxPayForm).then(res => {
-                this.$message({
-                    type: "success",
-                    message: "操作成功!",
-                })
-                done()
-            })
-        },
+      wxSubmit(form, done) {
+        this.wxPayForm.propertyCompanyId = this.currentRow.id
 
-        openPayConfig (row) {
-            this.currentRow = row
-            //调接口获取商户数据
-            getPayConfig(row.id).then(res => {
-                let data = res.data.data
-                this.wxPayForm = data.wxPayInfo ? data.wxPayInfo : {}
-                this.aliPayForm = data.aliPayInfo ? data.aliPayInfo : {}
-            })
-            this.payInfoVisible = !this.payInfoVisible
-        },
-
-        rowSave (row, done, loading) {
-            row.userid = this.userInfo.user_id
-            add(row).then(
-                () => {
-                    this.onLoad(this.page)
-                    this.$message({
-                        type: "success",
-                        message: "操作成功!",
-                    })
-                    done()
-                },
-                (error) => {
-                    window.console.log(error)
-                    loading()
-                }
-            )
-        },
-        rowUpdate (row, index, done, loading) {
-            update(row).then(
-                () => {
-                    this.onLoad(this.page)
-                    this.$message({
-                        type: "success",
-                        message: "操作成功!",
-                    })
-                    done()
-                },
-                (error) => {
-                    window.console.log(error)
-                    loading()
-                }
-            )
-        },
-        rowDel (row) {
-            this.$confirm("确定将选择数据删除?", {
-                confirmButtonText: "确定",
-                cancelButtonText: "取消",
-                type: "warning",
-            })
-                .then(() => {
-                    return remove(row.id)
-                })
-                .then(() => {
-                    this.onLoad(this.page)
-                    this.$message({
-                        type: "success",
-                        message: "操作成功!",
-                    })
-                })
-        },
-        searchReset () {
-            this.query = {}
-            this.onLoad(this.page)
-        },
-        searchChange (params, done) {
-            this.query = params
-            this.page.currentPage = 1
-            this.onLoad(this.page, params)
-            done()
-        },
-        selectionChange (list) {
-            this.selectionList = list
-        },
-        selectionClear () {
-            this.selectionList = []
-            this.$refs.crud.toggleSelection()
-        },
-        handleDelete () {
-            if (this.selectionList.length === 0) {
-                this.$message.warning("请选择至少一条数据")
-                return
-            }
-            this.$confirm("确定将选择数据删除?", {
-                confirmButtonText: "确定",
-                cancelButtonText: "取消",
-                type: "warning",
-            })
-                .then(() => {
-                    return remove(this.ids)
-                })
-                .then(() => {
-                    this.onLoad(this.page)
-                    this.$message({
-                        type: "success",
-                        message: "操作成功!",
-                    })
-                    this.$refs.crud.toggleSelection()
-                })
-        },
-        beforeOpen (done, type) {
-            if (["edit", "view"].includes(type)) {
-                getPropertyCompany(this.form.id).then((res) => {
-                    this.form = res.data.data
-                })
-            }
-            // con
-            done()
-        },
-        currentChange (currentPage) {
-            this.page.currentPage = currentPage
-        },
-        sizeChange (pageSize) {
-            this.page.pageSize = pageSize
-        },
-        refreshChange () {
-            this.onLoad(this.page, this.query)
-        },
-        onLoad (page, params = {}) {
-            const { dateTime } = this.query
-            let values = {
-                ...params,
-            }
-            if (dateTime) {
-                values = {
-                    ...params,
-                    startTime: dateTime[0],
-                    endTime: dateTime[1],
-                    ...this.query,
-                }
-                values.dateTime = null
-            }
-            this.loading = true
-            getList(page.currentPage, page.pageSize, values).then((res) => {
-                const data = res.data.data
-                this.page.total = data.total
-                this.data = data.records
-                this.loading = false
-                this.selectionClear()
-            })
+        this.wxPayForm.keyPath = func.join(this.wxPayForm.keyPath)
+        if (this.wxPayForm.keyPath.length > 0) {
+          var urls = []
+          var split = this.wxPayForm.keyPath.split(",")
+          split.forEach(url => {
+            var names = url.split("jczz/")
+            urls.push(names[1])
+          })
+          this.wxPayForm.keyPath = urls.join(",")
         }
+
+        console.log("微信商户配置", this.wxPayForm)
+        saveOrUpdateWx(this.wxPayForm).then(res => {
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          })
+          done()
+        })
+      },
+
+      openPayConfig(row) {
+        this.currentRow = row
+        //调接口获取商户数据
+        getPayConfig(row.id).then(res => {
+          let data = res.data.data
+          this.wxPayForm = data.wxPayInfo ? data.wxPayInfo : {}
+          this.aliPayForm = data.aliPayInfo ? data.aliPayInfo : {}
+        })
+        this.payInfoVisible = !this.payInfoVisible
+      },
+
+      rowSave(row, done, loading) {
+        row.userid = this.userInfo.user_id
+        add(row).then(
+          () => {
+            this.onLoad(this.page)
+            this.$message({
+              type: "success",
+              message: "操作成功!",
+            })
+            done()
+          },
+          (error) => {
+            window.console.log(error)
+            loading()
+          }
+        )
+      },
+      rowUpdate(row, index, done, loading) {
+        update(row).then(
+          () => {
+            this.onLoad(this.page)
+            this.$message({
+              type: "success",
+              message: "操作成功!",
+            })
+            done()
+          },
+          (error) => {
+            window.console.log(error)
+            loading()
+          }
+        )
+      },
+      rowDel(row) {
+        this.$confirm("确定将选择数据删除?", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning",
+          })
+          .then(() => {
+            return remove(row.id)
+          })
+          .then(() => {
+            this.onLoad(this.page)
+            this.$message({
+              type: "success",
+              message: "操作成功!",
+            })
+          })
+      },
+      searchReset() {
+        this.query = {}
+        this.onLoad(this.page)
+      },
+      searchChange(params, done) {
+        this.query = params
+        this.page.currentPage = 1
+        this.onLoad(this.page, params)
+        done()
+      },
+      selectionChange(list) {
+        this.selectionList = list
+      },
+      selectionClear() {
+        this.selectionList = []
+        this.$refs.crud.toggleSelection()
+      },
+      handleDelete() {
+        if (this.selectionList.length === 0) {
+          this.$message.warning("请选择至少一条数据")
+          return
+        }
+        this.$confirm("确定将选择数据删除?", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning",
+          })
+          .then(() => {
+            return remove(this.ids)
+          })
+          .then(() => {
+            this.onLoad(this.page)
+            this.$message({
+              type: "success",
+              message: "操作成功!",
+            })
+            this.$refs.crud.toggleSelection()
+          })
+      },
+      beforeOpen(done, type) {
+        if (["edit", "view"].includes(type)) {
+          getPropertyCompany(this.form.id).then((res) => {
+            this.form = res.data.data
+          })
+        }
+        // con
+        done()
+      },
+      currentChange(currentPage) {
+        this.page.currentPage = currentPage
+      },
+      sizeChange(pageSize) {
+        this.page.pageSize = pageSize
+      },
+      refreshChange() {
+        this.onLoad(this.page, this.query)
+      },
+      onLoad(page, params = {}) {
+        const {
+          dateTime
+        } = this.query
+        let values = {
+          ...params,
+        }
+        if (dateTime) {
+          values = {
+            ...params,
+            startTime: dateTime[0],
+            endTime: dateTime[1],
+            ...this.query,
+          }
+          values.dateTime = null
+        }
+        this.loading = true
+        getList(page.currentPage, page.pageSize, values).then((res) => {
+          const data = res.data.data
+          this.page.total = data.total
+          this.data = data.records
+          this.loading = false
+          this.selectionClear()
+        })
+      }
     }
-}
+  }
 </script>
 
 <style>
-.avue-upload__icon {
+  .avue-upload__icon {
     line-height: 6;
-}
-</style>
+  }
+</style>
\ No newline at end of file

--
Gitblit v1.9.3