From ca70eec16d4ae666d2beb560319860d30a1c17cd Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 09 Jan 2024 20:16:43 +0800
Subject: [PATCH] api补充

---
 src/views/property/components/partyOrganizationMember.vue | 1104 +++++++++++++++++++++++++++++-----------------------------
 1 files changed, 551 insertions(+), 553 deletions(-)

diff --git a/src/views/property/components/partyOrganizationMember.vue b/src/views/property/components/partyOrganizationMember.vue
index 372046f..26d6766 100644
--- a/src/views/property/components/partyOrganizationMember.vue
+++ b/src/views/property/components/partyOrganizationMember.vue
@@ -1,574 +1,572 @@
 <template>
-  <basic-container>
-    <avue-crud :option="option" :search.sync="search" :table-loading="loading" :data="data" ref="crud" v-model="form"
-               :permission="permissionList" @row-del="rowDel" @row-update="rowUpdate" @row-save="rowSave"
-               :before-open="beforeOpen" :page.sync="page" @search-change="searchChange" @search-reset="searchReset"
-               @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
-               @refresh-change="refreshChange">
-      <template slot="menuLeft">
-        <el-button type="danger" size="small" plain icon="el-icon-delete" v-if="permission.household_delete"
-                   @click="handleDelete">删 除
-        </el-button>
-      </template>
+    <basic-container>
+        <avue-crud :option="option" :search.sync="search" :table-loading="loading" :data="data" ref="crud" v-model="form"
+            :permission="permissionList" @row-del="rowDel" @row-update="rowUpdate" @row-save="rowSave"
+            :before-open="beforeOpen" :page.sync="page" @search-change="searchChange" @search-reset="searchReset"
+            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
+            @refresh-change="refreshChange">
+            <template slot="menuLeft">
+                <el-button type="danger" size="small" plain icon="el-icon-delete" v-if="permission.household_delete"
+                    @click="handleDelete">删 除
+                </el-button>
+            </template>
 
-      <template slot="householdIdType" slot-scope="{item,value,label}">
-        <span>{{ item.name }}({{item.phoneNumber}})</span>
-      </template>
+            <template slot="householdIdType" slot-scope="{item,value,label}">
+                <span>{{ item.name }}({{ item.phoneNumber }})</span>
+            </template>
 
-      <template slot-scope="{row}" slot="phoneNumber">
-        <el-button type="text" @click="showStringDispose(row, 'phoneNumberflag')">
-          {{ textDispose(row, 'phoneNumberflag', 'phoneNumber') }}
-        </el-button>
-      </template>
-      <template slot-scope="{row}" slot="idCard">
-        <el-button type="text" @click="showStringDispose(row, 'idCardflag')"
-                   v-text="textDispose(row, 'idCardflag', 'idCard')"></el-button>
-      </template>
+            <template slot-scope="{row}" slot="phoneNumber">
+                <el-button type="text" @click="showStringDispose(row, 'phoneNumberflag')">
+                    {{ textDispose(row, 'phoneNumberflag', 'phoneNumber') }}
+                </el-button>
+            </template>
+            <template slot-scope="{row}" slot="idCard">
+                <el-button type="text" @click="showStringDispose(row, 'idCardflag')"
+                    v-text="textDispose(row, 'idCardflag', 'idCard')"></el-button>
+            </template>
 
 
-    </avue-crud>
-  </basic-container>
+        </avue-crud>
+    </basic-container>
 </template>
 
 <script>
-import {mapGetters} from "vuex";
-import {add, getDetail, getList, remove, update} from "@/api/partyOrganization/partyOrganizationMember";
-import {validatePhone} from "@/util/validate";
-import {getAllHouseHold,getDetatils as householdDetail} from "@/api/userHouse/list/houseHold";
-import func from "@/util/func";
-import website from "@/config/website";
-const labelWidth = 100;
-const searchSpan = 5;
+import { mapGetters } from "vuex"
+import { add, getDetail, getList, remove, update } from "@/api/partyOrganization/partyOrganizationMember"
+import { validatePhone } from "@/util/validate"
+import { getAllHouseHold, getDetatils as householdDetail } from "@/api/userHouse/list/houseHold"
+import func from "@/util/func"
+import website from "@/config/website"
+const labelWidth = 100
+const searchSpan = 5
 export default {
-  name: "partyOrganizationMember",
-  data () {
-    return {
-      row: {},
-      userList: [],
-      form: {},
-      search: {},
-      excelBox: false,
-      selectionList: [],
-      query: {},
-      loading: true,
-      page: {
-        pageSize: 10,
-        currentPage: 1,
-        total: 0
-      },
-      option: {
-        height: 680,
-        calcHeight: 54,
-        tip: false,
-        searchShow: true,
-        border: true,
-        index: true,
-        selection: true,
-        dialogClickModal: false,
-        searchMenuSpan: 6,
-        menuWidth: 280,
-        column: [
-          {
-            label:"姓名",
-            labelWidth: labelWidth,
-            prop: "houseHoldName",
-            display:false,
-            searchSpan: searchSpan,
-            search:true,
-          },
-          {
-            label: "姓名",
-            labelWidth:labelWidth,
-            prop: "householdId",
-            type: 'select',
-            remote: true,
-            hide:true,
-            dicUrl:"",
-            props: {
-              label: 'name',
-              value: 'id',
+    name: "partyOrganizationMember",
+    data () {
+        return {
+            row: {},
+            userList: [],
+            form: {},
+            search: {},
+            excelBox: false,
+            selectionList: [],
+            query: {},
+            loading: true,
+            page: {
+                pageSize: 10,
+                currentPage: 1,
+                total: 0
             },
-            dicData:[],
-            rules: [
-              {
-                required: true,
-                message: '请输入姓名',
-                trigger: 'blur'
-              }
-            ],
-          },
-          {
-            label: "手机号",
-            labelWidth:labelWidth,
-            prop: "phoneNumber",
-            search:true,
-            searchSpan: searchSpan,
-            rules: [{
-              required: false,
-              message: "请输入手机号",
-              validator: validatePhone,
-              trigger: ["blur","change"],
-            }],
-            disabled:true,
-          },
-          {
-            label: "性别",
-            labelWidth:labelWidth,
-            prop: "gender",
-            type: "select",
-            hide: true,
-            disabled:true,
-            dicUrl: "/api/blade-system/dict-biz/dictionary?code=sex",
-            dataType: "number",
-            props: {
-              label: "dictValue",
-              value: "dictKey",
+            option: {
+                height: 680,
+                calcHeight: 54,
+                tip: false,
+                searchShow: true,
+                border: true,
+                index: true,
+                selection: true,
+                dialogClickModal: false,
+                searchMenuSpan: 6,
+                menuWidth: 280,
+                column: [
+                    {
+                        label: "姓名",
+                        labelWidth: labelWidth,
+                        prop: "houseHoldName",
+                        display: false,
+                        searchSpan: searchSpan,
+                        search: true,
+                    },
+                    {
+                        label: "姓名",
+                        labelWidth: labelWidth,
+                        prop: "householdId",
+                        type: 'select',
+                        remote: true,
+                        hide: true,
+                        dicUrl: "",
+                        props: {
+                            label: 'name',
+                            value: 'id',
+                        },
+                        dicData: [],
+                        rules: [
+                            {
+                                required: true,
+                                message: '请输入姓名',
+                                trigger: 'blur'
+                            }
+                        ],
+                    },
+                    {
+                        label: "手机号",
+                        labelWidth: labelWidth,
+                        prop: "phoneNumber",
+                        search: true,
+                        searchSpan: searchSpan,
+                        rules: [{
+                            required: false,
+                            message: "请输入手机号",
+                            validator: validatePhone,
+                            trigger: ["blur", "change"],
+                        }],
+                        disabled: true,
+                    },
+                    {
+                        label: "性别",
+                        labelWidth: labelWidth,
+                        prop: "gender",
+                        type: "select",
+                        hide: true,
+                        disabled: true,
+                        dicUrl: "/api/blade-system/dict-biz/dictionary?code=sex",
+                        dataType: "number",
+                        props: {
+                            label: "dictValue",
+                            value: "dictKey",
+                        },
+                    },
+                    {
+                        label: "生日",
+                        labelWidth: labelWidth,
+                        prop: "birthday",
+                        type: "date",
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd",
+                        hide: true,
+                        disabled: true,
+                    },
+                    {
+                        label: "证件类型",
+                        labelWidth: labelWidth,
+                        prop: "cardType",
+                        type: "select",
+                        dicUrl: "/api/blade-system/dict-biz/dictionary?code=cardType",
+                        props: {
+                            label: "dictValue",
+                            value: "dictKey",
+                        },
+                        disabled: true
+                    },
+                    {
+                        label: "证件号码",
+                        labelWidth: labelWidth,
+                        prop: "idCard",
+                        disabled: true
+                    },
+                    {
+                        label: "党员类型",
+                        labelWidth: labelWidth,
+                        prop: "partyMemberType",
+                        type: "select",
+                        dicUrl: "/api/blade-label/label/getLabelList?parentId=104",
+                        props: {
+                            label: "name",
+                            value: "id",
+                        },
+                        hide: true,
+                        rules: [{
+                            required: true,
+                            message: "请选择党员类型",
+                            trigger: ["blur", "change"],
+                        },],
+                    },
+                    {
+                        label: "党员职务",
+                        labelWidth: labelWidth,
+                        prop: "partyMemberPost",
+                        type: "select",
+                        dicUrl: "/api/blade-system/dict-biz/dictionary?code=partyMemberPost",
+                        props: {
+                            label: "dictValue",
+                            value: "dictKey",
+                        },
+                        hide: true,
+                        rules: [{
+                            required: true,
+                            message: "请选择党员职务",
+                            trigger: ["blur", "change"],
+                        },],
+                    },
+                    {
+                        label: "入党日期",
+                        labelWidth: labelWidth,
+                        prop: "joinDate",
+                        type: "date",
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd",
+                        hide: true,
+                        rules: [{
+                            required: true,
+                            message: "请选择入党日期",
+                            trigger: ["blur", "change"],
+                        },],
+                    },
+                    {
+                        label: "转入日期",
+                        labelWidth: labelWidth,
+                        prop: "transferDate",
+                        type: "date",
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd",
+                        hide: true,
+                        rules: [{
+                            required: true,
+                            message: "请选择转入日期",
+                            trigger: ["blur", "change"],
+                        },],
+                    },
+                    {
+                        label: "签入社区日",
+                        labelWidth: labelWidth,
+                        prop: "signInDate",
+                        type: "date",
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd",
+                        hide: true,
+                        rules: [{
+                            required: true,
+                            message: "请选择签入社区日",
+                            trigger: ["blur", "change"],
+                        },],
+                    },
+                    {
+                        label: "是否先锋岗",
+                        labelWidth: labelWidth,
+                        prop: 'isPioneer',
+                        type: 'radio',
+                        button: true,
+                        value: 2,
+                        dicData: [
+                            {
+                                label: "是",
+                                value: 1
+                            },
+                            {
+                                label: "否",
+                                value: 2
+                            },
+                        ],
+                        hide: true,
+                        rules: [{
+                            required: true,
+                            message: "请选择是否先锋岗",
+                            trigger: ["blur", "change"],
+                        },],
+                    },
+                    {
+                        label: "家庭住址",
+                        labelWidth: labelWidth,
+                        prop: 'address',
+                        hide: true,
+                        span: 24,
+                    },
+                    {
+                        label: "图片",
+                        labelWidth: labelWidth,
+                        prop: "urls",
+                        hide: true,
+                        type: "upload",
+                        listType: "picture-img",
+                        action: "/api/blade-resource/oss/endpoint/put-file",
+                        propsHttp: {
+                            res: "data",
+                            name: 'name',
+                            url: "link",
+                        },
+                        row: true
+                    },
+                    {
+                        label: "排序",
+                        labelWidth: labelWidth,
+                        prop: "sort",
+                        hide: true,
+                        type: 'number',
+                        value: 999,
+                        rules: [{
+                            required: true,
+                            message: "请输入排序",
+                            trigger: ["blur", "change"],
+                        },],
+                    },
+                    {
+                        label: "状态",
+                        labelWidth: labelWidth,
+                        hide: true,
+                        prop: "status",
+                        type: 'radio',
+                        dicData: [
+                            {
+                                label: "正常",
+                                value: 1
+                            },
+                            {
+                                label: "关闭",
+                                value: 2
+                            },
+                        ],
+                        button: true,
+                        value: 1,
+                        rules: [{
+                            required: true,
+                            message: "请输入排序",
+                            trigger: ["blur", "change"]
+                        },],
+                    },
+                    {
+                        label: "简介",
+                        labelWidth: labelWidth,
+                        prop: "profile",
+                        span: 24,
+                        component: "AvueUeditor",
+                        options: {
+                            action: "/api/blade-resource/oss/endpoint/put-file",
+                            props: {
+                                res: "data",
+                                url: "link",
+                            },
+                        },
+                        hide: true,
+                        minRows: 6,
+                    },
+                ]
             },
-          },
-          {
-            label: "生日",
-            labelWidth:labelWidth,
-            prop: "birthday",
-            type: "date",
-            format: "yyyy-MM-dd",
-            valueFormat: "yyyy-MM-dd",
-            hide: true,
-            disabled: true,
-          },
-          {
-            label: "证件类型",
-            labelWidth:labelWidth,
-            prop: "cardType",
-            type: "select",
-            dicUrl: "/api/blade-system/dict-biz/dictionary?code=cardType",
-            props: {
-              label: "dictValue",
-              value: "dictKey",
-            },
-            disabled:true
-          },
-          {
-            label: "证件号码",
-            labelWidth:labelWidth,
-            prop: "idCard",
-            disabled: true
-          },
-          {
-            label: "党员类型",
-            labelWidth:labelWidth,
-            prop: "partyMemberType",
-            type: "select",
-            dicUrl: "/api/blade-label/label/getLabelList?parentId=104",
-            props: {
-              label: "name",
-              value: "id",
-            },
-            hide:true,
-            rules: [{
-              required: true,
-              message: "请选择党员类型",
-              trigger: ["blur","change"],
-            },],
-          },
-          {
-            label: "党员职务",
-            labelWidth:labelWidth,
-            prop: "partyMemberPost",
-            type: "select",
-            dicUrl: "/api/blade-system/dict-biz/dictionary?code=partyMemberPost",
-            props: {
-              label: "dictValue",
-              value: "dictKey",
-            },
-            hide:true,
-            rules: [{
-              required: true,
-              message: "请选择党员职务",
-              trigger: ["blur","change"],
-            },],
-          },
-          {
-            label: "入党日期",
-            labelWidth:labelWidth,
-            prop: "joinDate",
-            type: "date",
-            format: "yyyy-MM-dd",
-            valueFormat: "yyyy-MM-dd",
-            hide: true,
-            rules: [{
-              required: true,
-              message: "请选择入党日期",
-              trigger: ["blur","change"],
-            },],
-          },
-          {
-            label: "转入日期",
-            labelWidth:labelWidth,
-            prop: "transferDate",
-            type: "date",
-            format: "yyyy-MM-dd",
-            valueFormat: "yyyy-MM-dd",
-            hide: true,
-            rules: [{
-              required: true,
-              message: "请选择转入日期",
-              trigger: ["blur","change"],
-            },],
-          },
-          {
-            label: "签入社区日",
-            labelWidth:labelWidth,
-            prop: "signInDate",
-            type: "date",
-            format: "yyyy-MM-dd",
-            valueFormat: "yyyy-MM-dd",
-            hide: true,
-            rules: [{
-              required: true,
-              message: "请选择签入社区日",
-              trigger: ["blur","change"],
-            },],
-          },
-          {
-            label: "是否先锋岗",
-            labelWidth:labelWidth,
-            prop: 'isPioneer',
-            type: 'radio',
-            button:true,
-            value:2,
-            dicData: [
-              {
-                label: "是",
-                value: 1
-              },
-              {
-                label: "否",
-                value:2
-              },
-            ],
-            hide:true,
-            rules: [{
-              required: true,
-              message: "请选择是否先锋岗",
-              trigger: ["blur","change"],
-            },],
-          },
-          {
-            label: "家庭住址",
-            labelWidth:labelWidth,
-            prop: 'address',
-            hide:true,
-            span:24,
-          },
-          {
-            label: "图片",
-            labelWidth:labelWidth,
-            prop: "urls",
-            hide:true,
-            type: "upload",
-            listType: "picture-img",
-            action: "/api/blade-resource/oss/endpoint/put-file",
-            propsHttp: {
-              res: "data",
-              name: 'name',
-              url: "link",
-            },
-            row:true
-          },
-          {
-            label: "排序",
-            labelWidth:labelWidth,
-            prop: "sort",
-            hide:true,
-            type: 'number',
-            value:999,
-            rules: [{
-              required: true,
-              message: "请输入排序",
-              trigger: ["blur","change"],
-            },],
-          },
-          {
-            label: "状态",
-            labelWidth:labelWidth,
-            hide:true,
-            prop: "status",
-            type: 'radio',
-            dicData: [
-              {
-                label: "正常",
-                value: 1
-              },
-              {
-                label: "关闭",
-                value:2
-              },
-            ],
-            button:true,
-            value:1,
-            rules: [{
-              required: true,
-              message: "请输入排序",
-              trigger: ["blur","change"]
-            },],
-          },
-          {
-            label: "简介",
-            labelWidth:labelWidth,
-            prop: "profile",
-            span:24,
-            component: "AvueUeditor",
-            options: {
-              action: "/api/blade-resource/oss/endpoint/put-file",
-              props: {
-                res: "data",
-                url: "link",
-              },
-            },
-            hide: true,
-            minRows: 6,
-          },
-        ]
-      },
-      data: [],
-    }
-  },
-  watch: {
-    "form.householdId":{
-      handler(val){
-        if(val){
-          householdDetail(val).then(res=>{
-            let data = res.data.data
-
-            this.form.phoneNumber = data.phoneNumber
-            this.form.gender = data.gender
-            this.form.birthday = data.birthday
-            this.form.cardType = data.cardType
-            this.form.idCard = data.idCard
-            this.form.houseCode = data.houseCode
-          })
+            data: [],
         }
-      }
-    }
-  },
-  computed: {
-    ...mapGetters(["userInfo", "permission"]),
-    permissionList () {
-      return {
-        addBtn: this.vaildData(this.permission.household_add, true),
-        viewBtn: this.vaildData(this.permission.household_view, true),
-        delBtn: this.vaildData(this.permission.household_delete, true),
-        editBtn: this.vaildData(this.permission.household_edit, true)
-      }
     },
-    textDispose () {
-      return (row, flag, type) => {
-        if (row[flag] || row[type] == null) {
-          return row[type]
-        } else {
-          if (type == 'idCard') {
-            return row[type].replace(/^(.{6})(?:\d+)(.{4})$/, "$1******$2")
-          } else {
-            return row[type].replace(/^(.{3})(?:\d+)(.{4})$/, "$1****$2")
-          }
-        }
-      }
-    },
-    ids () {
-      let ids = []
-      this.selectionList.forEach(ele => {
-        ids.push(ele.id)
-      })
-      return ids.join(",")
-    },
-  },
-  mounted () { },
-  methods: {
-    showStringDispose (row, type) {
-      row[type] = !row[type]
-    },
+    watch: {
+        "form.householdId": {
+            handler (val) {
+                if (val) {
+                    householdDetail(val).then(res => {
+                        let data = res.data.data
 
-     init (data) {
-      this.row = data
-       this.getUserList()
-      this.onLoad(this.page)
-    },
-
-    getUserList(param){
-      let dicUrl =  `/api/blade-household/household/getAllHouseHold?name={{key}}&regionCode=${this.row.areaId}`
-      const column = this.findObject(this.option.column, "householdId");
-      column.dicUrl = dicUrl
-    },
-
-    rowSave (row, done, loading) {
-      row['organizationId'] = this.row.id
-
-      row.urls = func.join(row.urls)
-      if (row.urls.length > 0) {
-        var urls = []
-        var split = row.urls.split(",")
-        split.forEach(url => {
-          var names = url.split("jczz/")
-          urls.push(names[1])
-        })
-        row.urls = urls.join(",")
-      }
-      add(row).then(() => {
-        this.initFlag = false
-        this.onLoad(this.page)
-        this.$message({
-          type: "success",
-          message: "操作成功!"
-        })
-        done()
-      }, error => {
-        // window.console.log(error);
-        loading()
-      })
-    },
-    rowUpdate (row, index, done, loading) {
-      if (row.urls.length > 0) {
-        var urls = []
-        var split = row.urls.split(",")
-        split.forEach(url => {
-          var names = url.split("jczz/")
-          urls.push(names[1])
-        })
-        row.urls = urls.join(",")
-      }
-      update(row).then(() => {
-        this.initFlag = false
-        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.treeDeptId = ''
-      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()
-        })
-    },
-    handleImport () {
-      this.excelBox = true
-    },
-    uploadAfter (res, done, loading, column) {
-      this.excelBox = false
-      this.refreshChange()
-      done()
-    },
-    beforeOpen (done, type) {
-      const column = this.findObject(this.option.column, "householdId");
-      if (["edit", "view"].includes(type)) {
-        getDetail(this.form.id).then(res => {
-          this.form = res.data.data
-          this.form.urls = website.minioUrl + this.form.urls
-
-          let params = {
-            id:this.form.householdId
-          }
-          getAllHouseHold(params).then(res=>{
-            column.dicData = res.data.data
-          })
-
-        })
-      }else{
-        column.dicData = []
-      }
-      this.initFlag = true
-      done()
-    },
-    currentChange (currentPage) {
-      this.page.currentPage = currentPage
-    },
-    sizeChange (pageSize) {
-      this.page.pageSize = pageSize
-    },
-    refreshChange () {
-      this.onLoad(this.page, this.query)
-    },
-    onLoad (page, params = {}) {
-      this.loading = true
-      params.organizationId = this.row.id
-      getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
-        const data = {
-          ...res.data.data,
-          records: res.data.data.records.map(item => {
-            return {
-              ...item,
-              'phoneNumberflag': false,
-              'idCardflag': false
+                        this.form.phoneNumber = data.phoneNumber
+                        this.form.gender = data.gender
+                        this.form.birthday = data.birthday
+                        this.form.cardType = data.cardType
+                        this.form.idCard = data.idCard
+                        this.form.houseCode = data.houseCode
+                    })
+                }
             }
-          })
         }
+    },
+    computed: {
+        ...mapGetters(["userInfo", "permission"]),
+        permissionList () {
+            return {
+                addBtn: this.vaildData(this.permission.household_add, true),
+                viewBtn: this.vaildData(this.permission.household_view, true),
+                delBtn: this.vaildData(this.permission.household_delete, true),
+                editBtn: this.vaildData(this.permission.household_edit, true)
+            }
+        },
+        textDispose () {
+            return (row, flag, type) => {
+                if (row[flag] || row[type] == null) {
+                    return row[type]
+                } else {
+                    if (type == 'idCard') {
+                        return row[type].replace(/^(.{6})(?:\d+)(.{4})$/, "$1******$2")
+                    } else {
+                        return row[type].replace(/^(.{3})(?:\d+)(.{4})$/, "$1****$2")
+                    }
+                }
+            }
+        },
+        ids () {
+            let ids = []
+            this.selectionList.forEach(ele => {
+                ids.push(ele.id)
+            })
+            return ids.join(",")
+        },
+    },
+    mounted () { },
+    methods: {
+        showStringDispose (row, type) {
+            row[type] = !row[type]
+        },
 
-        this.page.total = data.total
-        this.data = data.records
-        this.loading = false
-        this.selectionClear()
-      })
+        init (data) {
+            this.row = data
+            this.getUserList()
+            this.onLoad(this.page)
+        },
+
+        getUserList (param) {
+            let dicUrl = `/api/blade-household/household/getAllHouseHold?name={{key}}&regionCode=${this.row.areaId}`
+            const column = this.findObject(this.option.column, "householdId")
+            column.dicUrl = dicUrl
+        },
+
+        rowSave (row, done, loading) {
+            row['organizationId'] = this.row.id
+
+            row.urls = func.join(row.urls)
+            if (row.urls.length > 0) {
+                var urls = []
+                var split = row.urls.split(",")
+                split.forEach(url => {
+                    var names = url.split("jczz/")
+                    urls.push(names[1])
+                })
+                row.urls = urls.join(",")
+            }
+            add(row).then(() => {
+                this.initFlag = false
+                this.onLoad(this.page)
+                this.$message({
+                    type: "success",
+                    message: "操作成功!"
+                })
+                done()
+            }, error => {
+                // window.console.log(error);
+                loading()
+            })
+        },
+        rowUpdate (row, index, done, loading) {
+            if (row.urls.length > 0) {
+                var urls = []
+                var split = row.urls.split(",")
+                split.forEach(url => {
+                    var names = url.split("jczz/")
+                    urls.push(names[1])
+                })
+                row.urls = urls.join(",")
+            }
+            update(row).then(() => {
+                this.initFlag = false
+                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.treeDeptId = ''
+            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()
+                })
+        },
+        handleImport () {
+            this.excelBox = true
+        },
+        uploadAfter (res, done, loading, column) {
+            this.excelBox = false
+            this.refreshChange()
+            done()
+        },
+        beforeOpen (done, type) {
+            const column = this.findObject(this.option.column, "householdId")
+            if (["edit", "view"].includes(type)) {
+                getDetail(this.form.id).then(res => {
+                    this.form = res.data.data
+                    this.form.urls = website.minioUrl + this.form.urls
+
+                    let params = {
+                        id: this.form.householdId
+                    }
+                    getAllHouseHold(params).then(res => {
+                        column.dicData = res.data.data
+                    })
+
+                })
+            } else {
+                column.dicData = []
+            }
+            this.initFlag = true
+            done()
+        },
+        currentChange (currentPage) {
+            this.page.currentPage = currentPage
+        },
+        sizeChange (pageSize) {
+            this.page.pageSize = pageSize
+        },
+        refreshChange () {
+            this.onLoad(this.page, this.query)
+        },
+        onLoad (page, params = {}) {
+            this.loading = true
+            params.organizationId = this.row.id
+            getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+                const data = {
+                    ...res.data.data,
+                    records: res.data.data.records.map(item => {
+                        return {
+                            ...item,
+                            'phoneNumberflag': false,
+                            'idCardflag': false
+                        }
+                    })
+                }
+
+                this.page.total = data.total
+                this.data = data.records
+                this.loading = false
+                this.selectionClear()
+            })
+        }
     }
-  }
 }
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

--
Gitblit v1.9.3