zhongrj
2024-01-06 7fb7367930e6961ec515726559b1c2f59cd62b68
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,13 +37,13 @@
                </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" :disabled="row.confirmFlag == 2 || row.confirmFlag == 4"
                    icon="el-icon-s-check" v-if="permission.place_audit_cur" @click="auditCur(row)">审核
                </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>
@@ -69,6 +79,19 @@
export default {
    data () {
        //手机号格式校验
        let validatorPhone = function (rule, value, callback) {
            if (value) {
                if (!/^1[3456789]\d{9}$/.test(value)) {
                    callback(new Error('手机号格式有误!'))
                } else {
                    callback()
                }
            }
            callback()
        }
        return {
            curRow: {},
            roleBox: false,
@@ -85,13 +108,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 +128,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,
@@ -151,9 +178,11 @@
                    },
                    {
                        label: "负责人",
                        width: 110,
                        label: "场所负责人",
                        prop: "principal",
                        searchSpan: 4,
                        searchSpan: 5,
                        searchLabelWidth: 110,
                        search: true,
                        rules: [{
                            required: false,
@@ -163,33 +192,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,
@@ -222,12 +259,13 @@
                    },
                    {
                        width: 110,
                        overHidden: true,
                        label: "所属网格",
                        addDisplay: false,
                        editDisplay: false,
                        viewDisplay: false,
                        label: "所属网格",
                        prop: "gridName",
                        width: 150,
                        rules: [
                            {
                                required: true,
@@ -257,9 +295,9 @@
                        ],
                    },
                    {
                        width: 110,
                        label: "场所照片",
                        prop: "imageUrls",
                        width: 80,
                        type: "upload",
                        listType: "picture-card",
                        dataType: "string",
@@ -274,7 +312,7 @@
                    },
                    {
                        width: 160,
                        width: 156,
                        overHidden: true,
                        slot: true,
                        label: "位置",
@@ -313,6 +351,7 @@
                    },
                    {
                        width: 100,
                        addDisplay: false,
                        editDisplay: false,
                        viewDisplay: false,
@@ -320,16 +359,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 +380,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
                            }
                        ]
                    }
                ],
            },
@@ -408,6 +452,29 @@
                } else if (data == 4) {
                    tags = {
                        text: '待完善',
                        type: 'info'
                    }
                }
                return tags
            }
        },
        showSource () {
            return (data) => {
                let tags = {
                    text: '',
                    type: ''
                }
                if (data == 1) {
                    tags = {
                        text: '是',
                        type: 'success'
                    }
                } else if (data == 2) {
                    tags = {
                        text: '否',
                        type: 'info'
                    }
                }
@@ -644,23 +711,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