shuishen
2024-01-24 d16d10d94fddff86bdfd87113e7fd2cebe8b7cd7
src/views/place/index.vue
@@ -17,8 +17,18 @@
                <span v-text="decimalProcessing(row.lat)"></span>
            </template>
            <template slot-scope="{row}" slot="confirmFlag">
                <el-tag size="small" :type="showConfirmFlag(row.confirmFlag).type">{{ showConfirmFlag(row.confirmFlag).text
            <template slot-scope="{row, size}" slot="confirmFlag">
                <el-tag :size="size" :type="showConfirmFlag(row.confirmFlag).type">{{ showConfirmFlag(row.confirmFlag).text
                }}</el-tag>
            </template>
            <template slot-scope="{row, size}" slot="confirmFlag">
                <el-tag :size="size" :type="showConfirmFlag(row.confirmFlag).type">{{ showConfirmFlag(row.confirmFlag).text
                }}</el-tag>
            </template>
            <template slot-scope="{row, size}" slot="source">
                <el-tag :size="size" :type="showSource(row.source).type">{{ showSource(row.source).text
                }}</el-tag>
            </template>
@@ -27,20 +37,18 @@
                </el-button>
            </template>
            <template slot-scope="scope" slot="menu">
                <el-button type="text" :disabled="scope.row.confirmFlag == 2" icon="el-icon-s-check" size="small"
                    v-if="permission.place_audit_cur && scope.row.confirmFlag != 4" @click="auditCur(scope.row)">审核
            <template slot-scope="{row, size}" slot="menu">
                <el-button :size="size" type="text" icon="el-icon-s-check" v-if="permission.place_audit_cur"
                    @click="auditCur({ ...row, confirmFlag: 1 })">审核
                </el-button>
                <el-button type="text" icon="el-icon-edit" size="small" v-if="permission.place_manage_tenants"
                    @click="ManageTenants(scope.row)">场所维护
                <el-button :size="size" type="text" icon="el-icon-edit" v-if="permission.place_manage_tenants"
                    @click="ManageTenants(row)">场所维护
                </el-button>
            </template>
        </avue-crud>
        <el-dialog class="place-info-box" title="场所维护" append-to-body :visible.sync="roleBox" center @close="roleBoxClose">
            <baseAllInfo></baseAllInfo>
        </el-dialog>
        <baseAllInfo ref="BaseAllInfo"></baseAllInfo>
        <el-dialog class="place-info-box audit-info-box" title="审核" append-to-body :visible.sync="auditBasePopup"
            width="30%">
@@ -69,10 +77,20 @@
export default {
    data () {
        return {
            curRow: {},
            roleBox: false,
        //手机号格式校验
        let validatorPhone = function (rule, value, callback) {
            if (value) {
                if (!/^1[3456789]\d{9}$/.test(value)) {
                    callback(new Error('手机号格式有误!'))
                } else {
                    callback()
                }
            }
            callback()
        }
        return {
            form: {},
            query: {},
            loading: true,
@@ -85,13 +103,16 @@
            datetime: "",
            selectionList: [],
            option: {
                labelWidth: 120,
                searchLabelWidth: 96,
                searchShow: true,
                searchMenuSpan: 3,
                menuWidth: 280,
                height: "auto",
                calcHeight: 54,
                dialogWidth: 950,
                tip: false,
                searchShow: true,
                searchMenuSpan: 3,
                menuWidth: 280,
                border: true,
                //stripe:true,
                index: true,
@@ -102,11 +123,12 @@
                menuFixed: 'right',
                column: [
                    {
                        width: 160,
                        span: 12,
                        width: 156,
                        overHidden: true,
                        label: "场所名称",
                        span: 12,
                        prop: "placeName",
                        searchSpan: 4,
                        searchSpan: 5,
                        search: true,
                        rules: [{
                            required: true,
@@ -116,44 +138,30 @@
                    },
                    {
                        span: 7,
                        label: "场所标签",
                        prop: "label",
                        type: "cascader",
                        dicUrl: "/api/blade-category/category/getCategory?level=2",
                        cascader: ["smallLabel"],
                        props: {
                            label: "categoryName",
                            value: "categoryNo"
                        },
                        width: 156,
                        overHidden: true,
                        slot: true,
                        label: "地址",
                        prop: "location",
                        type: 'map',
                        dataType: "string",
                        hide: true,
                        rules: [{
                            required: true,
                            message: "请输入场所标签",
                            trigger: "blur",
                        },],
                        span: 12,
                        value: [117.966460, 28.431002, ""],
                        rules: [
                            {
                                required: true,
                                message: "请选择地址",
                                trigger: "blur",
                            },
                        ],
                    },
                    {
                        span: 5,
                        label: "",
                        labelWidth: 20,
                        prop: "smallLabel",
                        type: "cascader",
                        dicUrl: "/api/blade-category/category/getCategory?parentNo={{label}}",
                        props: {
                            label: "categoryName",
                            value: "categoryNo"
                        },
                        dataType: "string",
                        hide: true,
                    },
                    {
                        label: "负责人",
                        width: 110,
                        label: "场所负责人",
                        prop: "principal",
                        searchSpan: 4,
                        searchSpan: 5,
                        searchLabelWidth: 110,
                        search: true,
                        rules: [{
                            required: false,
@@ -163,33 +171,41 @@
                    },
                    {
                        width: 110,
                        label: "电话",
                        width: 120,
                        overHidden: true,
                        label: "手机号码",
                        prop: "principalPhone",
                        search: true,
                        searchSpan: 3,
                        searchSpan: 4,
                        slot: true,
                        rules: [
                            {
                                validator: validatorPhone,
                                trigger: 'blur'
                            }
                        ],
                    },
                    {
                        width: 110,
                        label: "所属街道",
                        addDisplay: false,
                        editDisplay: false,
                        viewDisplay: false,
                        width: 96,
                        label: "所属街道",
                        prop: "townStreetName",
                        search: true,
                        searchSpan: 4
                    },
                    {
                        width: 156,
                        overHidden: true,
                        label: "所属社区",
                        addDisplay: false,
                        editDisplay: false,
                        viewDisplay: false,
                        label: "所属社区",
                        prop: "neiName",
                        search: true,
                        searchSpan: 4,
                        width: 150,
                        rules: [
                            {
                                required: true,
@@ -211,7 +227,7 @@
                            label: "name",
                            value: "id",
                        },
                        cascader: ["gridId"],
                        cascader: ["gridCode"],
                        rules: [
                            {
                                required: true,
@@ -222,12 +238,13 @@
                    },
                    {
                        width: 110,
                        overHidden: true,
                        label: "所属网格",
                        addDisplay: false,
                        editDisplay: false,
                        viewDisplay: false,
                        label: "所属网格",
                        prop: "gridName",
                        width: 150,
                        rules: [
                            {
                                required: true,
@@ -239,12 +256,12 @@
                    {
                        hide: true,
                        label: "所属网格",
                        prop: "gridId",
                        prop: "gridCode",
                        type: "tree",
                        cell: true,
                        props: {
                            label: "gridName",
                            value: "id",
                            value: "gridCode",
                        },
                        dicUrl:
                            "/api/blade-grid/grid/getGridList?communityCode={{neiCode}}",
@@ -256,10 +273,71 @@
                            },
                        ],
                    },
                    {
                        span: 7,
                        label: "场所标签",
                        prop: "label",
                        type: "select",
                        dicUrl: "/api/blade-category/category/getCategory?level=2",
                        cascader: ["smallLabel"],
                        props: {
                            label: "categoryName",
                            value: "categoryNo"
                        },
                        dataType: "string",
                        hide: true,
                        rules: [{
                            required: true,
                            message: "请输入场所标签",
                            trigger: "blur",
                        },],
                    },
                    {
                        span: 5,
                        label: "",
                        labelWidth: 20,
                        prop: "smallLabel",
                        type: "select",
                        dicUrl: "/api/blade-category/category/getCategory?parentNo={{label}}",
                        props: {
                            label: "categoryName",
                            value: "categoryNo"
                        },
                        dataType: "string",
                        hide: true,
                    },
                    {
                        span: 12,
                        label: "标签颜色",
                        prop: "color",
                        type: "select",
                        dicData: [
                            {
                                label: '绿',
                                value: 'green'
                            }, {
                                label: '黄',
                                value: 'yellow'
                            }, {
                                label: '红',
                                value: 'red'
                            }
                        ],
                        props: {
                            label: "label",
                            value: "value"
                        },
                        hide: true,
                    },
                    {
                        width: 110,
                        label: "场所照片",
                        prop: "imageUrls",
                        width: 80,
                        type: "upload",
                        listType: "picture-card",
                        dataType: "string",
@@ -273,24 +351,6 @@
                        span: 24,
                    },
                    {
                        width: 160,
                        overHidden: true,
                        slot: true,
                        label: "位置",
                        prop: "location",
                        type: 'map',
                        dataType: "string",
                        span: 24,
                        value: [117.966460, 28.431002, ""],
                        rules: [
                            {
                                required: true,
                                message: "请选择位置",
                                trigger: "blur",
                            },
                        ],
                    },
                    {
                        width: 96,
@@ -313,6 +373,7 @@
                    },
                    {
                        width: 100,
                        addDisplay: false,
                        editDisplay: false,
                        viewDisplay: false,
@@ -320,16 +381,18 @@
                        prop: 'confirmFlag',
                        type: 'radio',
                        slot: true,
                        dicData: [{
                            label: '待审核',
                            value: 1
                        }, {
                            label: '已审核',
                            value: 2
                        }, {
                            label: '未通过',
                            value: 3
                        }]
                        dicData: [
                            {
                                label: '待审核',
                                value: 1
                            }, {
                                label: '已审核',
                                value: 2
                            }, {
                                label: '未通过',
                                value: 3
                            }
                        ]
                    },
                    {
                        width: 120,
@@ -339,14 +402,17 @@
                        prop: 'source',
                        type: "select",
                        search: true,
                        searchSpan: 4,
                        dicData: [{
                            label: '是',
                            value: 1
                        }, {
                            label: '否',
                            value: 2
                        }]
                        searchSpan: 5,
                        slot: true,
                        dicData: [
                            {
                                label: '是',
                                value: 1
                            }, {
                                label: '否',
                                value: 2
                            }
                        ]
                    }
                ],
            },
@@ -416,6 +482,29 @@
            }
        },
        showSource () {
            return (data) => {
                let tags = {
                    text: '',
                    type: ''
                }
                if (data == 1) {
                    tags = {
                        text: '是',
                        type: 'success'
                    }
                } else if (data == 2) {
                    tags = {
                        text: '否',
                        type: 'info'
                    }
                }
                return tags
            }
        },
        showLocation () {
            return (data) => {
                if (data != null && data.indexOf(',') != -1) {
@@ -454,13 +543,8 @@
            this.auditBasePopup = true
        },
        roleBoxClose () {
            this.curRow = {}
        },
        ManageTenants (item) {
            this.curRow = item
            this.roleBox = true
            this.$refs.BaseAllInfo.initOpen(item)
        },
        rowSave (row, done, loading) {
@@ -644,23 +728,9 @@
            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) => {
            getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then((res) => {
                const data = res.data.data
                this.page.total = data.total