| | |
| | | <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="menuLeft"> |
| | | <el-button size="small" icon="el-icon-delete" plain v-if="permission.place_delete" @click="handleDelete">删 除 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | <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}" slot="location"> |
| | | <span v-text="showLocation(row.location)"></span> |
| | | </template> |
| | | |
| | | <template slot-scope="{row}" slot="lng"> |
| | | <span v-text="decimalProcessing(row.lng)"></span> |
| | | </template> |
| | | |
| | | <template slot-scope="{row}" slot="lat"> |
| | | <span v-text="decimalProcessing(row.lat)"></span> |
| | | </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> |
| | | |
| | | <template slot="menuLeft"> |
| | | <el-button size="small" icon="el-icon-delete" plain v-if="permission.place_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | </template> |
| | | |
| | | <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 :size="size" type="text" icon="el-icon-edit" v-if="permission.place_manage_tenants" |
| | | @click="ManageTenants(row)">场所维护 |
| | | </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="principalIdCard"> |
| | | <el-button :size="size" type="text" @click="showStringDispose(row, 'principalIdCardflag')" |
| | | v-text="textDispose(row, 'principalIdCardflag', 'principalIdCard')"> |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | |
| | | <baseAllInfo ref="BaseAllInfo"></baseAllInfo> |
| | | |
| | | <el-dialog class="place-info-box audit-info-box" title="审核" append-to-body :visible.sync="auditBasePopup" |
| | | width="30%"> |
| | | <auditBase></auditBase> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getList, remove, update, add, getPlace } from "@/api/place/place"; |
| | | import { mapGetters } from "vuex"; |
| | | import website from '@/config/website'; |
| | | import { |
| | | getList, |
| | | remove, |
| | | update, |
| | | add, |
| | | getPlace, |
| | | } from "@/api/place/place" |
| | | |
| | | import { |
| | | mapGetters |
| | | } from "vuex" |
| | | |
| | | import website from '@/config/website' |
| | | |
| | | import auditBase from './components/auditBase' |
| | | import baseAllInfo from './components/baseAllInfo' |
| | | |
| | | 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, |
| | | menuWidth: 350, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: true, |
| | | selection: true, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "场所名称", |
| | | prop: "placeName", |
| | | searchSpan: 4, |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入场所名称", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "场所标签", |
| | | prop: "label", |
| | | type:"tree", |
| | | dicUrl:"/api/blade-categoryLabel/categoryLabel/getAllList", |
| | | props: { |
| | | label: "categoryName", |
| | | value: "categoryNo" |
| | | }, |
| | | multiple:true, |
| | | dataType:"string", |
| | | hide:true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入场所标签", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "负责人", |
| | | prop: "principal", |
| | | searchSpan: 4, |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: false, |
| | | message: "请输入负责人", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "联系电话", |
| | | prop: "principalPhone", |
| | | searchSpan: 4, |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: false, |
| | | message: "请输入联系电话", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "场所照片", |
| | | prop: "imageUrls", |
| | | width:80, |
| | | type: "upload", |
| | | listType: "picture-card", |
| | | dataType:"string", |
| | | multiple: true, |
| | | action: "/api/blade-resource/oss/endpoint/put-file", |
| | | propsHttp: { |
| | | res: "data", |
| | | name: 'name', |
| | | url: "link", |
| | | }, |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "位置", |
| | | prop: "localtion", |
| | | span:24, |
| | | minWidth:220, |
| | | overHidden:true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入区域", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | } |
| | | ], |
| | | }, |
| | | data: [], |
| | | }; |
| | | }, |
| | | watch: { |
| | | }, |
| | | 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(","); |
| | | }, |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | if (row.imageUrls.length > 0) { |
| | | var urls = [] |
| | | var split = row.imageUrls.split(","); |
| | | split.forEach(url => { |
| | | var names = url.split("jczz/"); |
| | | urls.push(names[1]) |
| | | }) |
| | | row.imageUrls = urls.join(",") |
| | | } |
| | | add(row).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(","); |
| | | split.forEach(url => { |
| | | var names = url.split("jczz/"); |
| | | urls.push(names[1]) |
| | | }) |
| | | row.imageUrls = urls.join(",") |
| | | } |
| | | update(row).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(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .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.$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)) { |
| | | getPlace(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | if (this.form.imageUrls) { |
| | | if (this.form.imageUrls.length > 0) { |
| | | var urls = [] |
| | | var names = this.form.imageUrls.split(","); |
| | | names.forEach(name => { |
| | | urls.push(website.minioUrl + name) |
| | | }) |
| | | this.form.imageUrls = urls.join(",") |
| | | data() { |
| | | |
| | | //手机号格式校验 |
| | | let validatorPhone = function (rule, value, callback) { |
| | | if (value) { |
| | | if (!/^1[3456789]\d{9}$/.test(value)) { |
| | | callback(new Error('手机号格式有误!')) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | } |
| | | if(this.form.placePoiLabelVOList){ |
| | | var arr = [] |
| | | this.form.placePoiLabelVOList.forEach(item=>{ |
| | | arr.push(item.poiCode); |
| | | callback() |
| | | } |
| | | |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | loading: true, |
| | | |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | datetime: "", |
| | | selectionList: [], |
| | | option: { |
| | | labelWidth: 120, |
| | | searchLabelWidth: 96, |
| | | searchShow: true, |
| | | searchMenuSpan: 3, |
| | | menuWidth: 280, |
| | | |
| | | height: "auto", |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | border: true, |
| | | //stripe:true, |
| | | index: true, |
| | | viewBtn: true, |
| | | editBtn: false, |
| | | selection: true, |
| | | dialogClickModal: false, |
| | | menuFixed: 'right', |
| | | column: [ |
| | | { |
| | | width: 156, |
| | | overHidden: true, |
| | | label: "场所名称", |
| | | span: 12, |
| | | prop: "placeName", |
| | | searchSpan: 5, |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入场所名称", |
| | | trigger: "blur", |
| | | },], |
| | | }, |
| | | { |
| | | width: 110, |
| | | label: "场所负责人", |
| | | prop: "principal", |
| | | searchSpan: 5, |
| | | searchLabelWidth: 110, |
| | | search: true, |
| | | rules: [{ |
| | | required: false, |
| | | message: "请输入负责人", |
| | | trigger: "blur", |
| | | },], |
| | | }, |
| | | { |
| | | width: 120, |
| | | overHidden: true, |
| | | label: "手机号码", |
| | | prop: "principalPhone", |
| | | search: true, |
| | | searchSpan: 4, |
| | | slot: true, |
| | | rules: [ |
| | | { |
| | | validator: validatorPhone, |
| | | trigger: 'blur' |
| | | } |
| | | ], |
| | | }, |
| | | { |
| | | width: 120, |
| | | overHidden: true, |
| | | label: "身份证号", |
| | | prop: "principalIdCard", |
| | | // search: true, |
| | | searchSpan: 4, |
| | | slot: true, |
| | | rules: [ |
| | | { |
| | | required: false, |
| | | message: "请输身份证号", |
| | | trigger: "blur", |
| | | } |
| | | ], |
| | | }, |
| | | { |
| | | width: 110, |
| | | label: "所属街道", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | prop: "townStreetName", |
| | | search: true, |
| | | searchSpan: 4 |
| | | }, |
| | | { |
| | | width: 156, |
| | | overHidden: true, |
| | | label: "所属社区", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | prop: "neiName", |
| | | search: true, |
| | | searchSpan: 4, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择所属社区", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | hide: true, |
| | | parent: false, |
| | | label: "所属社区", |
| | | prop: "neiCode", |
| | | search: false, |
| | | width: 150, |
| | | type: "tree", |
| | | dicUrl: "/api/blade-system/region/tree", |
| | | props: { |
| | | label: "name", |
| | | value: "id", |
| | | }, |
| | | cascader: ["gridCode"], |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择所属社区", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | width: 110, |
| | | overHidden: true, |
| | | label: "所属网格", |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | prop: "gridName", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择所属网格", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | hide: true, |
| | | label: "所属网格", |
| | | prop: "gridCode", |
| | | type: "tree", |
| | | cell: true, |
| | | props: { |
| | | label: "gridName", |
| | | value: "gridCode", |
| | | }, |
| | | dicUrl: |
| | | "/api/blade-grid/grid/getGridList?communityCode={{neiCode}}", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择所属网格", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | 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, |
| | | }, |
| | | { |
| | | span: 12, |
| | | label: "九小场所", |
| | | prop: "isNine", |
| | | type: "select", |
| | | dicData: [ |
| | | { |
| | | label: "是", |
| | | value: 1, |
| | | }, |
| | | { |
| | | label: "否", |
| | | value: 2, |
| | | } |
| | | ], |
| | | hide: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择九小场所", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | span: 12, |
| | | label: "九小分类", |
| | | prop: "nineType", |
| | | type: "select", |
| | | display: false, |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=nineType", |
| | | dataType: "number", |
| | | hide: true, |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | }, |
| | | { |
| | | span: 12, |
| | | label: "阵地", |
| | | prop: "isFront", |
| | | type: "select", |
| | | dicData: [ |
| | | { |
| | | label: "是", |
| | | value: 1, |
| | | }, |
| | | { |
| | | label: "否", |
| | | value: 2, |
| | | } |
| | | ], |
| | | hide: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择阵地", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | span: 12, |
| | | label: "阵地类型", |
| | | prop: "frontType", |
| | | type: "select", |
| | | display: false, |
| | | row: true, |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=frontType", |
| | | dataType: "number", |
| | | hide: true, |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | }, |
| | | }, |
| | | { |
| | | span: 12, |
| | | label: "三级消防单位", |
| | | prop: "threeFireProtection", |
| | | labelWidth: 120, |
| | | type: "select", |
| | | dicData: [{ |
| | | label: "是", |
| | | value: 1, |
| | | }, |
| | | { |
| | | label: "否", |
| | | value: 2, |
| | | } |
| | | ], |
| | | hide: true, |
| | | rules: [{ |
| | | required: false, |
| | | message: "请选择三级消防单位", |
| | | trigger: "blur", |
| | | },], |
| | | }, |
| | | { |
| | | width: 110, |
| | | label: "场所照片", |
| | | prop: "imageUrls", |
| | | type: "upload", |
| | | listType: "picture-card", |
| | | dataType: "string", |
| | | multiple: true, |
| | | action: "/api/blade-resource/oss/endpoint/put-file", |
| | | propsHttp: { |
| | | res: "data", |
| | | name: 'name', |
| | | url: "link", |
| | | }, |
| | | span: 24, |
| | | }, |
| | | { |
| | | width: 156, |
| | | overHidden: true, |
| | | slot: true, |
| | | label: "地址", |
| | | prop: "location", |
| | | type: 'map', |
| | | dataType: "string", |
| | | minWidth: 250, |
| | | span: 24, |
| | | value: [117.966460, 28.431002, ""], |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择地址", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "备注", |
| | | prop: "remark", |
| | | type: 'textarea', |
| | | hide: true, |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | | required: false, |
| | | message: "请输入场所备注", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | width: 96, |
| | | slot: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | label: "经度", |
| | | hide: true, |
| | | prop: "lng", |
| | | }, |
| | | { |
| | | width: 96, |
| | | slot: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | label: "纬度", |
| | | hide: true, |
| | | prop: "lat", |
| | | }, |
| | | { |
| | | width: 100, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | label: '审核状态', |
| | | prop: 'confirmFlag', |
| | | type: 'radio', |
| | | slot: true, |
| | | dicData: [ |
| | | { |
| | | label: '待审核', |
| | | value: 1 |
| | | }, { |
| | | label: '已审核', |
| | | value: 2 |
| | | }, { |
| | | label: '未通过', |
| | | value: 3 |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | width: 120, |
| | | display: false, |
| | | label: '是否有二维码', |
| | | searchLabelWidth: 104, |
| | | prop: 'source', |
| | | type: "select", |
| | | search: true, |
| | | searchSpan: 5, |
| | | slot: true, |
| | | dicData: [ |
| | | { |
| | | label: '是', |
| | | value: 1 |
| | | }, { |
| | | label: '否', |
| | | value: 2 |
| | | } |
| | | ] |
| | | } |
| | | ], |
| | | }, |
| | | data: [], |
| | | |
| | | auditBasePopup: false, |
| | | } |
| | | }, |
| | | |
| | | provide() { |
| | | return { |
| | | placeElement: this, |
| | | } |
| | | }, |
| | | |
| | | components: { auditBase, baseAllInfo }, |
| | | |
| | | watch: { |
| | | 'form.isNine': { |
| | | handler(newData) { |
| | | if (newData) { |
| | | let nineTypeColumn = this.findObject( |
| | | this.option.column, |
| | | 'nineType' |
| | | ) |
| | | |
| | | if (newData == 1) { |
| | | nineTypeColumn.display = true |
| | | } else { |
| | | nineTypeColumn.display = false |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | 'form.isFront': { |
| | | handler(newData) { |
| | | if (newData) { |
| | | let frontTypeColumn = this.findObject( |
| | | this.option.column, |
| | | 'frontType' |
| | | ) |
| | | |
| | | if (newData == 1) { |
| | | frontTypeColumn.display = true |
| | | } else { |
| | | frontTypeColumn.display = false |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | }, |
| | | |
| | | 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) |
| | | }) |
| | | this.form.label = arr.join(",") |
| | | } |
| | | console.log(this.form,888888) |
| | | }); |
| | | } |
| | | // con |
| | | done(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | 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) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.data.forEach(item => { |
| | | if (item.imageUrls) { |
| | | if (item.imageUrls.length > 0) { |
| | | var urls = [] |
| | | var names = item.imageUrls.split(","); |
| | | names.forEach(name => { |
| | | urls.push(website.minioUrl + name) |
| | | }) |
| | | item.imageUrls = urls.join(",") |
| | | return ids.join(",") |
| | | }, |
| | | |
| | | showConfirmFlag() { |
| | | return (data) => { |
| | | let tags = { |
| | | text: '', |
| | | type: '' |
| | | } |
| | | if (data == 1) { |
| | | tags = { |
| | | text: '待审核', |
| | | type: 'warning' |
| | | } |
| | | } else if (data == 2) { |
| | | tags = { |
| | | text: '已审核', |
| | | type: 'success' |
| | | } |
| | | } else if (data == 3) { |
| | | tags = { |
| | | text: '未通过', |
| | | type: 'danger' |
| | | } |
| | | } else if (data == 4) { |
| | | tags = { |
| | | text: '待完善', |
| | | type: 'info' |
| | | } |
| | | } |
| | | |
| | | return tags |
| | | } |
| | | } |
| | | }) |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | |
| | | 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) { |
| | | data = data.split(',') |
| | | |
| | | return data[2] |
| | | } else { |
| | | return data || '' |
| | | } |
| | | } |
| | | }, |
| | | |
| | | decimalProcessing() { |
| | | return (data) => { |
| | | if (data != null) { |
| | | return Number(data).toFixed(6) |
| | | } else { |
| | | return '' |
| | | } |
| | | } |
| | | }, |
| | | |
| | | 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: { |
| | | showStringDispose(row, type) { |
| | | row[type] = !row[type] |
| | | }, |
| | | |
| | | locationDispose(data) { |
| | | data = data.split(',') |
| | | |
| | | return { |
| | | longitude: data[0], |
| | | latitude: data[1], |
| | | location: data[2] |
| | | } |
| | | }, |
| | | |
| | | auditCur(row) { |
| | | this.curAuditRow = row |
| | | this.auditBasePopup = true |
| | | }, |
| | | |
| | | ManageTenants(item) { |
| | | this.$refs.BaseAllInfo.initOpen(item) |
| | | }, |
| | | |
| | | 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, |
| | | ...this.locationDispose(row.location) |
| | | }).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, |
| | | ...this.locationDispose(row.location) |
| | | }).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(() => { |
| | | return remove(row.id) |
| | | }) |
| | | .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)) { |
| | | getPlace(this.form.id).then((res) => { |
| | | this.form = res.data.data |
| | | |
| | | this.form.location = [this.form.lng, this.form.lat, this.form.location].join(',') |
| | | |
| | | if (this.form.imageUrls.length) { |
| | | this.form.imageUrls = this.form.imageUrls.split(",").filter(item => item != '').map(item => website.minioUrl + item).join(',') |
| | | } |
| | | |
| | | if (this.form.placePoiLabelVOList.length) { |
| | | let lebelTwo = this.form.placePoiLabelVOList.find(item => { |
| | | return item.type == 2 |
| | | }) |
| | | |
| | | if (lebelTwo) this.form.label = String(lebelTwo.poiCode) |
| | | |
| | | let lebelThree = this.form.placePoiLabelVOList.find(item => { |
| | | return item.type == 3 |
| | | }) |
| | | |
| | | if (lebelThree) this.form.smallLabel = String(lebelThree.poiCode) |
| | | } |
| | | |
| | | done() |
| | | }) |
| | | } 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 |
| | | |
| | | getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then((res) => { |
| | | const data = res.data.data |
| | | |
| | | this.page.total = data.total |
| | | |
| | | this.data = data.records |
| | | |
| | | this.data.forEach(item => { |
| | | this.$set(item, 'principalPhoneflag', false) |
| | | this.$set(item, 'principalIdCardflag', false) |
| | | if (item.imageUrls && item.imageUrls != '' && item.imageUrls != null && item.imageUrls.length) { |
| | | var urls = [] |
| | | var names = item.imageUrls.split(",").filter(item => item != '') |
| | | names.forEach(name => { |
| | | urls.push(website.minioUrl + name) |
| | | }) |
| | | item.imageUrls = urls.join(",") |
| | | } |
| | | }) |
| | | |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | .avue-upload__icon { |
| | | line-height: 6; |
| | | line-height: 6; |
| | | } |
| | | </style> |