| | |
| | | <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="policemanPhone"> |
| | | <el-button :size="size" type="text" @click="showStringDispose(row, 'policemanPhoneflag')" |
| | | v-text="textDispose(row, 'policemanPhoneflag', 'policemanPhone')"> |
| | | </el-button> |
| | | </template> |
| | | <!-- <template slot="menuLeft"> |
| | | <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="policemanPhone"> |
| | | <el-button :size="size" type="text" @click="showStringDispose(row, 'policemanPhoneflag')" |
| | | v-text="textDispose(row, 'policemanPhoneflag', 'policemanPhone')"> |
| | | </el-button> |
| | | </template> |
| | | |
| | | <template slot="menuLeft"> |
| | | <el-button type="warning" size="small" plain v-if="permission.household_export" icon="el-icon-download" |
| | | @click="handleExport">导出 |
| | | </el-button> |
| | | </template> |
| | | |
| | | <template slot-scope="{row, size,index}" slot="peopleForm"> |
| | | <el-table :data="form.backblastPubPersonEntityList" v-if="form.backblastPubPersonEntityList"> |
| | | <el-table-column width="100" property="name" label="姓名" label-class-name="workOrderStyle"></el-table-column> |
| | | <el-table-column width="150" property="telephone" label="手机号" label-class-name="workOrderStyle"> |
| | | </el-table-column> |
| | | <el-table-column width="160" property="idCard" label="身份证号" label-class-name="workOrderStyle"> |
| | | </el-table-column> |
| | | <el-table-column width="150" property="occupation" label="职业" label-class-name="workOrderStyle"> |
| | | </el-table-column> |
| | | <el-table-column width="160" property="address" label="居住地" label-class-name="workOrderStyle"> |
| | | </el-table-column> |
| | | </el-table> |
| | | </template> |
| | | <!-- <template slot="menuLeft"> |
| | | <el-button type="warning" size="small" plain icon="el-icon-download" @click="handleExport">导出 |
| | | </el-button> |
| | | </template> --> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | import { |
| | | mapGetters |
| | | } from "vuex" |
| | | import { |
| | | } from "vuex" |
| | | import { |
| | | getList, |
| | | add, |
| | | update, |
| | | remove, |
| | | getDetail |
| | | } from "@/api/baskblast/BackblastPubRecord" |
| | | import NProgress from 'nprogress' |
| | | import 'nprogress/nprogress.css' |
| | | import Qs from "qs" |
| | | import website from '@/config/website' |
| | | import { |
| | | } from "@/api/baskblast/BackblastPubRecord" |
| | | import NProgress from 'nprogress' |
| | | import 'nprogress/nprogress.css' |
| | | import Qs from "qs" |
| | | import website from '@/config/website' |
| | | import { |
| | | exportBlob |
| | | } from "@/api/common" |
| | | import { |
| | | } from "@/api/common" |
| | | import { |
| | | getToken |
| | | } from '@/util/auth' |
| | | import { |
| | | } from '@/util/auth' |
| | | import { |
| | | downloadXls |
| | | } from "@/util/util" |
| | | import { |
| | | } from "@/util/util" |
| | | import { |
| | | dateNow |
| | | } from "@/util/date" |
| | | } from "@/util/date" |
| | | |
| | | export default { |
| | | export default { |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | loading: true, |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | loading: true, |
| | | |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | datetime: "", |
| | | selectionList: [], |
| | | option: { |
| | | height: "auto", |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | menuWidth: 200, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 3, |
| | | border: true, |
| | | index: true, |
| | | viewBtn: true, |
| | | editBtn: false, |
| | | delBtn: true, |
| | | addBtn: false, |
| | | refreshBtn: false, |
| | | searchShowBtn: false, |
| | | columnBtn: false, |
| | | dialogClickModal: false, |
| | | column: [{ |
| | | searchLabelWidth: 60, |
| | | label: "地址", |
| | | prop: "address", |
| | | minWidth: 100, |
| | | labelWidth: 120, |
| | | search: true, |
| | | searchSpan: 5, |
| | | overHidden: true, |
| | | row: true, |
| | | span: 24, |
| | | }, { |
| | | label: "所属社区", |
| | | prop: "communityName", |
| | | align: 'center', |
| | | labelWidth: 120, |
| | | search: true, |
| | | searchSpan: 4, |
| | | searchLabelWidth: 96, |
| | | width: 160, |
| | | }, { |
| | | label: "小区名称", |
| | | prop: "aoiName", |
| | | labelWidth: 120, |
| | | overHidden: true, |
| | | }, { |
| | | label: "户室信息", |
| | | prop: "houseName", |
| | | labelWidth: 120, |
| | | overHidden: true, |
| | | }, { |
| | | label: "宣防内容", |
| | | prop: "pubContent", |
| | | labelWidth: 120, |
| | | type: "textarea", |
| | | row: true, |
| | | span: 24, |
| | | overHidden: true, |
| | | }, |
| | | datetime: "", |
| | | selectionList: [], |
| | | option: { |
| | | height: "auto", |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | menuWidth: 100, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 3, |
| | | border: true, |
| | | index: true, |
| | | viewBtn: true, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | addBtn: false, |
| | | refreshBtn: false, |
| | | searchShowBtn: false, |
| | | columnBtn: false, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "地址", |
| | | prop: "address", |
| | | // align: 'center', |
| | | minWidth: 180, |
| | | labelWidth: 120, |
| | | search: true, |
| | | searchSpan: 5, |
| | | overHidden: true, |
| | | row: true, |
| | | span: 24, |
| | | }, { |
| | | label: "宣防内容", |
| | | prop: "pubContent", |
| | | labelWidth: 120, |
| | | // align: 'center', |
| | | type: "textarea", |
| | | row: true, |
| | | span: 24, |
| | | overHidden: true, |
| | | }, |
| | | |
| | | { |
| | | label: "是否下载国家反诈app", |
| | | prop: "isFzApp", |
| | | labelWidth: 120, |
| | | // align: 'center', |
| | | type: "select", |
| | | row: true, |
| | | span: 24, |
| | | overHidden: true, |
| | | hide: true, |
| | | dicData: [{ |
| | | label: "是", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "否", |
| | | value: 2 |
| | | } |
| | | ], |
| | | }, |
| | | { |
| | | label: "是否打开预警共能", |
| | | prop: "isOpenAlarm", |
| | | labelWidth: 120, |
| | | // align: 'center', |
| | | type: "select", |
| | | row: true, |
| | | span: 24, |
| | | overHidden: true, |
| | | hide: true, |
| | | dicData: [{ |
| | | label: "是", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "否", |
| | | value: 2 |
| | | } |
| | | ], |
| | | }, |
| | | { |
| | | label: "宣防佐证照片", |
| | | prop: "pubUrls", |
| | | // align: 'center', |
| | | fileType: 'img', |
| | | labelWidth: 120, |
| | | type: "upload", |
| | | listType: "picture-card", |
| | | dataType: "string", |
| | | width: 110, |
| | | row: true, |
| | | span: 24, |
| | | }, { |
| | | label: "时间", |
| | | prop: "createTime", |
| | | align: 'center', |
| | | labelWidth: 120, |
| | | width: 156, |
| | | row: true, |
| | | }, { |
| | | label: "民警姓名", |
| | | prop: "policeman", |
| | | align: 'center', |
| | | labelWidth: 120, |
| | | search: true, |
| | | searchSpan: 4, |
| | | // searchLabelWidth: 96, |
| | | width: 110, |
| | | searchPlaceholder: '请输入民警姓名' |
| | | }, { |
| | | label: "民警联系方式", |
| | | prop: "policemanPhone", |
| | | align: 'center', |
| | | slot: true, |
| | | labelWidth: 120, |
| | | search: true, |
| | | searchLabelWidth: 110, |
| | | searchSpan: 4, |
| | | width: 120 |
| | | }, { |
| | | label: "所属街道", |
| | | prop: "townName", |
| | | align: 'center', |
| | | search: true, |
| | | searchSpan: 4, |
| | | searchLabelWidth: 46, |
| | | labelWidth: 120, |
| | | width: 156, |
| | | searchPlaceholder: '请输入街道' |
| | | }, { |
| | | label: "辖区派出所", |
| | | prop: "pcsName", |
| | | align: 'center', |
| | | labelWidth: 120, |
| | | search: false, |
| | | searchSpan: 4, |
| | | searchLabelWidth: 96, |
| | | searchPlaceholder: '请输入辖区派出所', |
| | | hide:true |
| | | } |
| | | ], |
| | | { |
| | | label: "是否下载国家反诈app", |
| | | prop: "isFzApp", |
| | | labelWidth: 120, |
| | | type: "select", |
| | | overHidden: true, |
| | | hide: true, |
| | | dicData: [{ |
| | | label: "是", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "否", |
| | | value: 2 |
| | | } |
| | | ], |
| | | }, |
| | | data: [] |
| | | } |
| | | { |
| | | label: "是否打开预警共能", |
| | | prop: "isOpenAlarm", |
| | | labelWidth: 120, |
| | | type: "select", |
| | | overHidden: true, |
| | | hide: true, |
| | | dicData: [{ |
| | | label: "是", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "否", |
| | | value: 2 |
| | | } |
| | | ], |
| | | }, |
| | | { |
| | | label: "宣防佐证照片", |
| | | prop: "pubUrls", |
| | | fileType: 'img', |
| | | labelWidth: 120, |
| | | type: "upload", |
| | | listType: "picture-card", |
| | | dataType: "string", |
| | | width: 110, |
| | | row: true, |
| | | span: 24, |
| | | }, { |
| | | label: "宣防时间", |
| | | prop: "createTime", |
| | | align: 'center', |
| | | labelWidth: 120, |
| | | width: 156, |
| | | }, |
| | | { |
| | | label: "宣防人姓名", |
| | | prop: "policeman", |
| | | align: 'center', |
| | | labelWidth: 120, |
| | | search: true, |
| | | searchSpan: 4, |
| | | searchLabelWidth: 96, |
| | | width: 110, |
| | | searchPlaceholder: '请输入宣防人姓名' |
| | | }, |
| | | { |
| | | label: "宣防人电话", |
| | | prop: "policemanPhone", |
| | | align: 'center', |
| | | slot: true, |
| | | labelWidth: 120, |
| | | search: true, |
| | | searchLabelWidth: 120, |
| | | searchSpan: 4, |
| | | width: 120 |
| | | }, |
| | | { |
| | | label: "所属街道", |
| | | parent: false, |
| | | search: true, |
| | | searchSpan: 4, |
| | | prop: "townName", |
| | | type: "tree", |
| | | dicUrl: "/api/blade-system/region/getTownTree", |
| | | props: { |
| | | label: "name", |
| | | value: "name" |
| | | }, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择所属街道", |
| | | trigger: "blur", |
| | | }, ], |
| | | }, |
| | | { |
| | | searchLabelWidth: 40, |
| | | label: "宣防单位", |
| | | prop: "deptName", |
| | | align: 'center', |
| | | labelWidth: 120, |
| | | search: true, |
| | | searchSpan: 4, |
| | | searchLabelWidth: 96, |
| | | searchPlaceholder: '请输入宣防单位', |
| | | }, |
| | | { |
| | | label: "宣防对象", |
| | | prop: "people", |
| | | align: 'center', |
| | | labelWidth: 120, |
| | | search: false, |
| | | searchSpan: 4, |
| | | searchLabelWidth: 96, |
| | | searchPlaceholder: '请输入辖区派出所', |
| | | hide: true, |
| | | span: 24, |
| | | slot: true, |
| | | formslot: true |
| | | }, { |
| | | label: "宣防时间", |
| | | prop: "dateTime", |
| | | type: "daterange", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | searchSpan: 6, |
| | | searchRange: true, |
| | | hide: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | search: true, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择事发时间", |
| | | trigger: "blur", |
| | | }, ], |
| | | }, |
| | | ], |
| | | }, |
| | | 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") |
| | | } |
| | | } |
| | | } |
| | | ...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.isNine = 1 |
| | | 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() |
| | | }) |
| | | }) |
| | | }, |
| | | handleExport() { |
| | | this.$confirm("是否导出入户宣传数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }).then(() => { |
| | | NProgress.start() |
| | | var data = { |
| | | ...this.query |
| | | } |
| | | data.isNine = 1 |
| | | data = Qs.stringify(data) |
| | | exportBlob( |
| | | `/api/blade-backblastPubRecord/backblastPubRecord/export?${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] |
| | | }, |
| | | 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)) { |
| | | getDetail(this.form.id).then(res => { |
| | | |
| | | }) |
| | | 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, 'policemanPhoneflag', false) |
| | | if (item.pubUrls && item.pubUrls != '' && item.pubUrls != null && item.pubUrls.length) { |
| | | var urls = [] |
| | | var names = item.pubUrls.split(",").filter(item => item != '') |
| | | names.forEach(name => { |
| | | urls.push(this.website.minioUrl + name) |
| | | }) |
| | | item.pubUrls = urls.join(",") |
| | | } |
| | | }) |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | 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(() => { |
| | | 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)) { |
| | | getDetail(this.form.id).then(res => { |
| | | console.log("===>", res); |
| | | this.$set(this.form, "backblastPubPersonEntityList", res.data.data.backblastPubPersonEntityList) |
| | | }) |
| | | 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 = {}) { |
| | | const { |
| | | dateTime |
| | | } = this.query |
| | | if (dateTime) { |
| | | params['startTime'] = dateTime[0] |
| | | params['endTime'] = dateTime[1] |
| | | } |
| | | 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, 'policemanPhoneflag', false) |
| | | if (item.pubUrls && item.pubUrls != '' && item.pubUrls != null && item.pubUrls.length) { |
| | | var urls = [] |
| | | var names = item.pubUrls.split(",").filter(item => item != '') |
| | | names.forEach(name => { |
| | | urls.push(this.website.minioUrl + name) |
| | | }) |
| | | item.pubUrls = urls.join(",") |
| | | } |
| | | }) |
| | | this.loading = false |
| | | this.selectionClear() |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .avue-upload__icon { |
| | | .avue-upload__icon { |
| | | line-height: 6; |
| | | } |
| | | </style> |
| | | } |
| | | |
| | | .workOrderStyle { |
| | | font-weight: normal; |
| | | } |
| | | </style> |