From 1fe8923ba0696dac6456c7e309541c70b9caa3db Mon Sep 17 00:00:00 2001
From: guanqb <18720758508@163.com>
Date: Tue, 06 Feb 2024 16:47:41 +0800
Subject: [PATCH] 公安安全监管-阵地管理-(档案管理+交易登记)页面档案

---
 src/views/publicSecurity/positionManage/TransactRegist.vue |  421 ++++++++++++++++++++++++++++
 src/views/publicSecurity/positionManage/fileManage.vue     |  421 ++++++++++++++++++++++++++++
 2 files changed, 842 insertions(+), 0 deletions(-)

diff --git a/src/views/publicSecurity/positionManage/TransactRegist.vue b/src/views/publicSecurity/positionManage/TransactRegist.vue
new file mode 100644
index 0000000..c167ba9
--- /dev/null
+++ b/src/views/publicSecurity/positionManage/TransactRegist.vue
@@ -0,0 +1,421 @@
+<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-scope="{row, size}" slot="principalIdCard">
+                <el-button :size="size" type="text" @click="showStringDispose(row, 'principalIdCardflag')">
+                    {{ textDispose(row, 'principalIdCardflag', 'principalIdCard') }}
+                </el-button>
+            </template>
+            <template slot-scope="{row, size}" slot="principalPhone">
+                <el-button :size="size" type="text" @click="showStringDispose(row, 'principalPhoneflag')"
+                    v-text="textDispose(row, 'principalPhoneflag', 'principalPhone')">
+                </el-button>
+            </template>
+            <template slot-scope="{row, size}" slot="policePhone">
+                <el-button :size="size" type="text" @click="showStringDispose(row, 'policePhoneflag')"
+                    v-text="textDispose(row, 'policePhoneflag', 'policePhone')">
+                </el-button>
+            </template>
+            <template slot="menuLeft">
+                <el-button type="warning" size="small" plain icon="el-icon-download" @click="handleExport">导出
+                </el-button>
+            </template>
+        </avue-crud>
+    </basic-container>
+</template>
+
+<script>
+import {
+    mapGetters
+} from "vuex"
+import {
+    getDAGLList
+} from "@/api/publicSecurity/ninePlaceManage"
+import NProgress from 'nprogress'
+import 'nprogress/nprogress.css'
+import Qs from "qs"
+import {
+    exportBlob
+} from "@/api/common"
+import {
+    getToken
+} from '@/util/auth'
+import {
+    downloadXls
+} from "@/util/util"
+import {
+    dateNow
+} from "@/util/date"
+
+export default {
+    data () {
+        return {
+            form: {},
+            query: {},
+            loading: true,
+
+            page: {
+                pageSize: 10,
+                currentPage: 1,
+                total: 0,
+            },
+            datetime: "",
+            selectionList: [],
+            option: {
+                height: "auto",
+                calcHeight: 54,
+                dialogWidth: 950,
+                tip: false,
+                searchShow: true,
+                searchMenuSpan: 3,
+                menu: false,
+                border: true,
+                index: true,
+                editBtn: false,
+                delBtn: false,
+                addBtn: false,
+                dialogClickModal: false,
+                column: [{
+                    label: "地区",
+                    prop: "townStreetName",
+                    align: 'center',
+                    search: true,
+                    searchSpan: 3,
+                    searchLabelWidth: 46,
+                    labelWidth: 120,
+                    width: 156
+                }, {
+                    label: "场所名称",
+                    prop: "placeName",
+                    align: 'center',
+                    search: true,
+                    searchSpan: 3,
+                    // searchLabelWidth: 96,
+                    width: 156
+                }, {
+                    label: "场所地址",
+                    prop: "location",
+                    align: 'center',
+                },
+                {
+                    label: "场所类别",
+                    prop: "nineType",
+                    align: 'center',
+                    dicUrl: "/api/blade-system/dict-biz/tree?code=nineType",
+                    props: {
+                        label: "title",
+                        value: "key",
+                    },
+                    type: 'select',
+                    search: true,
+                    searchSpan: 3,
+                    // searchLabelWidth: 96
+                }, {
+                    label: "场所负责人",
+                    prop: "principal",
+                    align: 'center',
+                    search: true,
+                    searchSpan: 4,
+                    searchLabelWidth: 96,
+                    width: 110
+                }, {
+                    label: "身份证信息",
+                    prop: "principalIdCard",
+                    align: 'center',
+                    slot: true,
+                    width: 160
+                }, {
+                    label: "联系方式",
+                    prop: "principalPhone",
+                    align: 'center',
+                    slot: true,
+                    width: 120
+                }, {
+                    label: "辖区派出所",
+                    prop: "deptName",
+                    align: 'center',
+                    search: true,
+                    searchSpan: 4,
+                    searchLabelWidth: 96
+                }, {
+                    label: "责任民警",
+                    prop: "policeName",
+                    align: 'center',
+                    search: true,
+                    searchSpan: 4,
+                    // searchLabelWidth: 96,
+                    width: 110
+                }, {
+                    label: "责任民警联系方式",
+                    prop: "policePhone",
+                    align: 'center',
+                    slot: true,
+                    width: 120
+                }],
+            },
+            data: []
+        }
+    },
+
+    computed: {
+        ...mapGetters(["permission", "userInfo"]),
+        permissionList () {
+            return {
+                addBtn: this.vaildData(this.permission.place_add, true),
+                viewBtn: this.vaildData(this.permission.place_view, true),
+                delBtn: this.vaildData(this.permission.place_delete, true),
+                editBtn: this.vaildData(this.permission.place_edit, true),
+            }
+        },
+        ids () {
+            let ids = []
+            this.selectionList.forEach((ele) => {
+                ids.push(ele.id)
+            })
+            return ids.join(",")
+        },
+
+        textDispose () {
+            return (row, flag, type) => {
+                if (row[flag] || row[type] == null) {
+                    return row[type]
+                } else {
+                    if (type == 'principalIdCard') {
+                        return row[type].replace(/^(.{6})(?:\d+)(.{4})$/, "$1******$2")
+                    } else {
+                        return row[type].replace(/^(.{3})(?:\d+)(.{4})$/, "$1****$2")
+                    }
+                }
+            }
+        }
+    },
+    methods: {
+        handleExport () {
+            this.$confirm("是否导出档案管理数据?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(() => {
+                NProgress.start()
+                var data = {
+                    ...this.query
+                }
+                data = Qs.stringify(data)
+                exportBlob(
+                    `/api/blade-place/place/exportNineType?${this.website.tokenHeader}=${getToken()}&` + data
+                ).then(res => {
+                    console.log('exportBlob', res)
+                    downloadXls(res.data, `档案管理${dateNow()}.xlsx`)
+                    NProgress.done()
+                })
+            })
+        },
+
+        showStringDispose (row, type) {
+            row[type] = !row[type]
+        },
+
+        rowSave (row, done, loading) {
+            if (row.imageUrls.length > 0) {
+                var urls = []
+                var split = row.imageUrls.split(",").filter(item => item != '')
+                split.forEach(url => {
+                    var names = url.split("jczz/")
+                    urls.push(names[1])
+                })
+                row.imageUrls = urls.join(",")
+            }
+
+            let label = row.label
+
+            if (row.smallLabel != '') {
+                label = label + ',' + row.smallLabel
+            }
+
+            delete row.smallLabel
+
+            add({
+                ...row,
+                label
+            }).then(
+                () => {
+                    this.onLoad(this.page)
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!",
+                    })
+                    done()
+                },
+                (error) => {
+                    window.console.log(error)
+                    loading()
+                }
+            )
+        },
+
+        rowUpdate (row, index, done, loading) {
+            if (row.imageUrls.length > 0) {
+                var urls = []
+                var split = row.imageUrls.split(",").filter(item => item != '')
+                split.forEach(url => {
+                    var names = url.split("jczz/")
+                    urls.push(names[1])
+                })
+                row.imageUrls = urls.join(",")
+            }
+
+            let label = row.label
+
+            if (row.smallLabel != '') {
+                label = label + ',' + row.smallLabel
+            }
+
+            delete row.smallLabel
+
+            update({
+                ...row,
+                label
+            }).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(() => {
+                    row.isDeleted = 1
+                    return removeTask(row)
+                })
+                .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.$nextTick(() => {
+                this.$refs.crud && 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)) {
+
+            // } else {
+            //     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
+            getDAGLList(page.currentPage, page.pageSize, { ...Object.assign(params, this.query), isNine: 1 }).then(res => {
+                console.log('getDAGLList', res.data.data.records)
+                const data = {
+                    ...res.data.data,
+                    records: res.data.data.records.map(item => {
+                        return {
+                            ...item,
+                            'principalIdCardflag': false,
+                            'principalPhoneflag': false,
+                            'policePhoneflag': false
+                        }
+                    })
+                }
+                this.page.total = data.total
+                this.data = data.records
+                this.loading = false
+                this.selectionClear()
+            })
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.avue-upload__icon {
+    line-height: 6;
+}
+
+// :deep(.el-form-item__content) {
+//     text-align: left !important;
+// }
+
+// :deep(.avue-form__menu--center .el-button) {
+//     margin: 0 5px 0 0;
+// }
+</style>
diff --git a/src/views/publicSecurity/positionManage/fileManage.vue b/src/views/publicSecurity/positionManage/fileManage.vue
new file mode 100644
index 0000000..c167ba9
--- /dev/null
+++ b/src/views/publicSecurity/positionManage/fileManage.vue
@@ -0,0 +1,421 @@
+<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-scope="{row, size}" slot="principalIdCard">
+                <el-button :size="size" type="text" @click="showStringDispose(row, 'principalIdCardflag')">
+                    {{ textDispose(row, 'principalIdCardflag', 'principalIdCard') }}
+                </el-button>
+            </template>
+            <template slot-scope="{row, size}" slot="principalPhone">
+                <el-button :size="size" type="text" @click="showStringDispose(row, 'principalPhoneflag')"
+                    v-text="textDispose(row, 'principalPhoneflag', 'principalPhone')">
+                </el-button>
+            </template>
+            <template slot-scope="{row, size}" slot="policePhone">
+                <el-button :size="size" type="text" @click="showStringDispose(row, 'policePhoneflag')"
+                    v-text="textDispose(row, 'policePhoneflag', 'policePhone')">
+                </el-button>
+            </template>
+            <template slot="menuLeft">
+                <el-button type="warning" size="small" plain icon="el-icon-download" @click="handleExport">导出
+                </el-button>
+            </template>
+        </avue-crud>
+    </basic-container>
+</template>
+
+<script>
+import {
+    mapGetters
+} from "vuex"
+import {
+    getDAGLList
+} from "@/api/publicSecurity/ninePlaceManage"
+import NProgress from 'nprogress'
+import 'nprogress/nprogress.css'
+import Qs from "qs"
+import {
+    exportBlob
+} from "@/api/common"
+import {
+    getToken
+} from '@/util/auth'
+import {
+    downloadXls
+} from "@/util/util"
+import {
+    dateNow
+} from "@/util/date"
+
+export default {
+    data () {
+        return {
+            form: {},
+            query: {},
+            loading: true,
+
+            page: {
+                pageSize: 10,
+                currentPage: 1,
+                total: 0,
+            },
+            datetime: "",
+            selectionList: [],
+            option: {
+                height: "auto",
+                calcHeight: 54,
+                dialogWidth: 950,
+                tip: false,
+                searchShow: true,
+                searchMenuSpan: 3,
+                menu: false,
+                border: true,
+                index: true,
+                editBtn: false,
+                delBtn: false,
+                addBtn: false,
+                dialogClickModal: false,
+                column: [{
+                    label: "地区",
+                    prop: "townStreetName",
+                    align: 'center',
+                    search: true,
+                    searchSpan: 3,
+                    searchLabelWidth: 46,
+                    labelWidth: 120,
+                    width: 156
+                }, {
+                    label: "场所名称",
+                    prop: "placeName",
+                    align: 'center',
+                    search: true,
+                    searchSpan: 3,
+                    // searchLabelWidth: 96,
+                    width: 156
+                }, {
+                    label: "场所地址",
+                    prop: "location",
+                    align: 'center',
+                },
+                {
+                    label: "场所类别",
+                    prop: "nineType",
+                    align: 'center',
+                    dicUrl: "/api/blade-system/dict-biz/tree?code=nineType",
+                    props: {
+                        label: "title",
+                        value: "key",
+                    },
+                    type: 'select',
+                    search: true,
+                    searchSpan: 3,
+                    // searchLabelWidth: 96
+                }, {
+                    label: "场所负责人",
+                    prop: "principal",
+                    align: 'center',
+                    search: true,
+                    searchSpan: 4,
+                    searchLabelWidth: 96,
+                    width: 110
+                }, {
+                    label: "身份证信息",
+                    prop: "principalIdCard",
+                    align: 'center',
+                    slot: true,
+                    width: 160
+                }, {
+                    label: "联系方式",
+                    prop: "principalPhone",
+                    align: 'center',
+                    slot: true,
+                    width: 120
+                }, {
+                    label: "辖区派出所",
+                    prop: "deptName",
+                    align: 'center',
+                    search: true,
+                    searchSpan: 4,
+                    searchLabelWidth: 96
+                }, {
+                    label: "责任民警",
+                    prop: "policeName",
+                    align: 'center',
+                    search: true,
+                    searchSpan: 4,
+                    // searchLabelWidth: 96,
+                    width: 110
+                }, {
+                    label: "责任民警联系方式",
+                    prop: "policePhone",
+                    align: 'center',
+                    slot: true,
+                    width: 120
+                }],
+            },
+            data: []
+        }
+    },
+
+    computed: {
+        ...mapGetters(["permission", "userInfo"]),
+        permissionList () {
+            return {
+                addBtn: this.vaildData(this.permission.place_add, true),
+                viewBtn: this.vaildData(this.permission.place_view, true),
+                delBtn: this.vaildData(this.permission.place_delete, true),
+                editBtn: this.vaildData(this.permission.place_edit, true),
+            }
+        },
+        ids () {
+            let ids = []
+            this.selectionList.forEach((ele) => {
+                ids.push(ele.id)
+            })
+            return ids.join(",")
+        },
+
+        textDispose () {
+            return (row, flag, type) => {
+                if (row[flag] || row[type] == null) {
+                    return row[type]
+                } else {
+                    if (type == 'principalIdCard') {
+                        return row[type].replace(/^(.{6})(?:\d+)(.{4})$/, "$1******$2")
+                    } else {
+                        return row[type].replace(/^(.{3})(?:\d+)(.{4})$/, "$1****$2")
+                    }
+                }
+            }
+        }
+    },
+    methods: {
+        handleExport () {
+            this.$confirm("是否导出档案管理数据?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(() => {
+                NProgress.start()
+                var data = {
+                    ...this.query
+                }
+                data = Qs.stringify(data)
+                exportBlob(
+                    `/api/blade-place/place/exportNineType?${this.website.tokenHeader}=${getToken()}&` + data
+                ).then(res => {
+                    console.log('exportBlob', res)
+                    downloadXls(res.data, `档案管理${dateNow()}.xlsx`)
+                    NProgress.done()
+                })
+            })
+        },
+
+        showStringDispose (row, type) {
+            row[type] = !row[type]
+        },
+
+        rowSave (row, done, loading) {
+            if (row.imageUrls.length > 0) {
+                var urls = []
+                var split = row.imageUrls.split(",").filter(item => item != '')
+                split.forEach(url => {
+                    var names = url.split("jczz/")
+                    urls.push(names[1])
+                })
+                row.imageUrls = urls.join(",")
+            }
+
+            let label = row.label
+
+            if (row.smallLabel != '') {
+                label = label + ',' + row.smallLabel
+            }
+
+            delete row.smallLabel
+
+            add({
+                ...row,
+                label
+            }).then(
+                () => {
+                    this.onLoad(this.page)
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!",
+                    })
+                    done()
+                },
+                (error) => {
+                    window.console.log(error)
+                    loading()
+                }
+            )
+        },
+
+        rowUpdate (row, index, done, loading) {
+            if (row.imageUrls.length > 0) {
+                var urls = []
+                var split = row.imageUrls.split(",").filter(item => item != '')
+                split.forEach(url => {
+                    var names = url.split("jczz/")
+                    urls.push(names[1])
+                })
+                row.imageUrls = urls.join(",")
+            }
+
+            let label = row.label
+
+            if (row.smallLabel != '') {
+                label = label + ',' + row.smallLabel
+            }
+
+            delete row.smallLabel
+
+            update({
+                ...row,
+                label
+            }).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(() => {
+                    row.isDeleted = 1
+                    return removeTask(row)
+                })
+                .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.$nextTick(() => {
+                this.$refs.crud && 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)) {
+
+            // } else {
+            //     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
+            getDAGLList(page.currentPage, page.pageSize, { ...Object.assign(params, this.query), isNine: 1 }).then(res => {
+                console.log('getDAGLList', res.data.data.records)
+                const data = {
+                    ...res.data.data,
+                    records: res.data.data.records.map(item => {
+                        return {
+                            ...item,
+                            'principalIdCardflag': false,
+                            'principalPhoneflag': false,
+                            'policePhoneflag': false
+                        }
+                    })
+                }
+                this.page.total = data.total
+                this.data = data.records
+                this.loading = false
+                this.selectionClear()
+            })
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.avue-upload__icon {
+    line-height: 6;
+}
+
+// :deep(.el-form-item__content) {
+//     text-align: left !important;
+// }
+
+// :deep(.avue-form__menu--center .el-button) {
+//     margin: 0 5px 0 0;
+// }
+</style>

--
Gitblit v1.9.3