shuishen
2023-12-23 8e357feadbb4720b99a3ab485e73cb72b66ea3ad
src/views/userHouse/houseHoldList.vue
@@ -149,7 +149,7 @@
import { lintOnSave } from "../../../vue.config"
export default {
    data() {
    data () {
        return {
            labelData: [],
            form: {},
@@ -170,7 +170,7 @@
                calcHeight: 80,
                tip: false,
                searchShow: true,
                searchMenuSpan: 6,
                searchMenuSpan: 3,
                border: true,
                index: true,
                selection: true,
@@ -187,15 +187,14 @@
                        prop: "name",
                        labelWidth: 120,
                        search: true,
                        searchSpan: 4,
                        searchSpan: 3,
                    },
                    {
                        width: 106,
                        width: 110,
                        label: "电话",
                        prop: "phoneNumber",
                        labelWidth: 120,
                        search: true,
                        searchSpan: 4,
                        searchSpan: 3,
                        slot: true,
                    },
                    {
@@ -267,6 +266,8 @@
                        width: 96,
                        label: "所属街道",
                        prop: "townStreetName",
                        search: true,
                        searchSpan: 4
                    },
                    {
                        addDisplay: false,
@@ -275,6 +276,8 @@
                        width: 160,
                        label: "所属社区",
                        prop: "neiName",
                        search: true,
                        searchSpan: 4
                    },
                    {
                        addDisplay: false,
@@ -323,12 +326,6 @@
                            label: "dictValue",
                            value: "dictKey",
                        },
                    },
                    {
                        label: "身份证号",
                        prop: "idCard",
                        labelWidth: 120,
                        hide: true,
                    },
                    {
                        label: "生日",
@@ -534,7 +531,7 @@
    watch: {},
    computed: {
        ...mapGetters(["userInfo", "permission"]),
        permissionList() {
        permissionList () {
            return {
                addBtn: this.vaildData(this.permission.household_add, false),
                viewBtn: this.vaildData(this.permission.household_view, true),
@@ -543,7 +540,7 @@
            }
        },
        textDispose() {
        textDispose () {
            return (row, flag, type) => {
                if (row[flag] || row[type] == null) {
                    return row[type]
@@ -557,15 +554,15 @@
            }
        },
        labelDispose() {
        labelDispose () {
            return (list) => {
                return list.map(item => item.labelName).join(',')
            }
        }
    },
    mounted() { },
    mounted () { },
    methods: {
        onsubmit() {
        onsubmit () {
            if (this.labelForm.color === '#EBEDF0') {
                let params = {
                    householdId: this.currentRow.id,
@@ -602,13 +599,13 @@
            }
        },
        changLabel(item) {
        changLabel (item) {
            this.editLabelFlge = true
            this.currentLabel = item
            this.labelForm.color = item.color
            this.labelForm.remark = item.remark
        },
        manageLabel(item) {
        manageLabel (item) {
            this.currentRow = item
            this.loading = true
            this.labelFlag = true
@@ -640,7 +637,7 @@
                })
            })
        },
        rowSave(row, done, loading) {
        rowSave (row, done, loading) {
            add(row).then(() => {
                this.initFlag = false
                this.onLoad(this.page)
@@ -654,7 +651,7 @@
                loading()
            })
        },
        rowUpdate(row, index, done, loading) {
        rowUpdate (row, index, done, loading) {
            update(row).then(() => {
                this.initFlag = false
                this.onLoad(this.page)
@@ -668,7 +665,7 @@
                loading()
            })
        },
        rowDel(row) {
        rowDel (row) {
            this.$confirm("确定将选择数据删除?", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
@@ -685,25 +682,25 @@
                    })
                })
        },
        searchReset() {
        searchReset () {
            this.query = {}
            this.treeDeptId = ''
            this.onLoad(this.page)
        },
        searchChange(params, done) {
        searchChange (params, done) {
            this.query = params
            this.page.currentPage = 1
            this.onLoad(this.page, params)
            done()
        },
        selectionChange(list) {
        selectionChange (list) {
            this.selectionList = list
        },
        selectionClear() {
        selectionClear () {
            this.selectionList = []
            // this.$refs.crud.toggleSelection();
        },
        handleDelete() {
        handleDelete () {
            if (this.selectionList.length === 0) {
                this.$message.warning("请选择至少一条数据")
                return
@@ -725,16 +722,16 @@
                    this.$refs.crud.toggleSelection()
                })
        },
        handleImport() {
        handleImport () {
            this.excelBox = true
        },
        uploadAfter(res, done, loading, column) {
        uploadAfter (res, done, loading, column) {
            window.console.log(column)
            this.excelBox = false
            this.refreshChange()
            done()
        },
        handleExport() {
        handleExport () {
            this.$confirm("是否导出住户数据?", "提示", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
@@ -753,12 +750,12 @@
                })
            })
        },
        handleTemplate() {
        handleTemplate () {
            exportBlob(`/api/blade-system/user/export-template?${this.website.tokenHeader}=${getToken()}`).then(res => {
                downloadXls(res.data, "住户数据模板.xlsx")
            })
        },
        beforeOpen(done, type) {
        beforeOpen (done, type) {
            if (["edit", "view"].includes(type)) {
                getDetatil(this.form.id).then(res => {
                    this.form = res.data.data
@@ -767,17 +764,17 @@
            this.initFlag = true
            done()
        },
        currentChange(currentPage) {
        currentChange (currentPage) {
            this.page.currentPage = currentPage
        },
        sizeChange(pageSize) {
        sizeChange (pageSize) {
            this.page.pageSize = pageSize
        },
        refreshChange() {
        refreshChange () {
            this.onLoad(this.page, this.query)
        },
        onLoad(page, params = {}) {
        onLoad (page, params = {}) {
            this.loading = true
            getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
                const data = {
@@ -798,7 +795,7 @@
            })
        },
        showStringDispose(row, type) {
        showStringDispose (row, type) {
            row[type] = !row[type]
        }
    }