| | |
| | | <basic-container> |
| | | <avue-crud |
| | | :option="tableOption" |
| | | :data="tableData" |
| | | :page.sync="tablePage" |
| | | :table-loading="loading" |
| | | :data="tableData" |
| | | :page.sync="page" |
| | | :permission="permissionList" |
| | | :before-open="beforeOpen" |
| | | @date-change="dateChange" |
| | | ref="crud" |
| | | @row-update="rowUpdates" |
| | | @row-save="rowSave" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | @cell-click="handleRowClick" |
| | | :cell-style="cellStyle" |
| | | class="businessStatisticsStyle" |
| | |
| | | import XLSX from "xlsx"; |
| | | import { mapGetters } from "vuex"; |
| | | import { selectYw } from "../../api/statisticalQueryManagement/statisticalQueryManagement"; |
| | | import { lazyTreeJu } from "../../api/index/index"; |
| | | export default { |
| | | name: "业务情况统计", |
| | | data() { |
| | | return { |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | value1: "", |
| | | value2: "", |
| | | tableData: [ |
| | |
| | | // num: "974" |
| | | // } |
| | | ], |
| | | tablePage: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | tableOption: { |
| | | excelBtn: true, |
| | | delBtn: false, |
| | |
| | | searchSpan: 4, |
| | | type: "select", |
| | | props: { |
| | | label: "label", |
| | | value: "value" |
| | | label: "title", |
| | | value: "id" |
| | | }, |
| | | // cascaderItem: ["city", "area"], |
| | | // dicUrl:subofficeOptions, |
| | | dicData: [ |
| | | { |
| | | value: "0", |
| | | label: "南昌市公安局" |
| | | }, |
| | | { |
| | | value: "2", |
| | | label: "东湖分局" |
| | | }, |
| | | { |
| | | value: "3", |
| | | label: "西湖分局" |
| | | }, |
| | | { |
| | | value: "4", |
| | | label: "青云谱分局" |
| | | }, |
| | | { |
| | | value: "5", |
| | | label: "青山湖分局" |
| | | } |
| | | ], |
| | | dicData: [], |
| | | search: true, |
| | | rules: [ |
| | | { |
| | |
| | | } |
| | | ] |
| | | }, |
| | | loading:true, |
| | | loading: true |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | getSubOfficeData() { |
| | | lazyTreeJu().then(res => { |
| | | if (res.data.code === 200) { |
| | | this.tableOption.column.forEach(item => { |
| | | if (item.label == "所属辖区") { |
| | | item.dicData = res.data.data; |
| | | } |
| | | }); |
| | | } else { |
| | | this.$message.error(res.msg); |
| | | } |
| | | }); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | 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; |
| | | let param = {}; |
| | | param["jurisdiction"] = params["jurname"] ? params["jurname"] : ""; |
| | | param["deptid"] = ""; |
| | | param["current"] = page.currentPage; |
| | | param["size"] = page.pageSize; |
| | | selectYw(param).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.tableData = res.data.data; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | handleRowClick(row, column, cell, event) { |
| | | if (column.label == "服务对象数量" || column.label == "保安员人数") { |
| | | this.$router.push({ |
| | |
| | | // if (columnIndex == 4 || columnIndex == 5) { |
| | | // } |
| | | }, |
| | | dateChange() {}, |
| | | getTableData() { |
| | | selectYw({current: 1, size: 10 }).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.tableData = res.data.data; |
| | | this.loading = false; |
| | | } |
| | | }); |
| | | } |
| | | // downExcel() { |
| | | // let et = XLSX.utils.table_to_book(document.getElementById("table")); |
| | | // let etout = XLSX.write(et, { |
| | | // bookType: "xlsx", |
| | | // bookSST: true, |
| | | // type: "array" |
| | | // }); |
| | | // try { |
| | | // FileSaver.saveAs( |
| | | // new Blob([etout], { |
| | | // type: "application/octet-stream" |
| | | // }), |
| | | // `表.xlsx` |
| | | // ); //导出的文件名 |
| | | // } catch (e) { |
| | | // console.log(e, etout); |
| | | // } |
| | | // return etout; |
| | | // } |
| | | }, |
| | | mounted() { |
| | | this.getTableData(); |
| | | this.getSubOfficeData(); |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | :page.sync="page" |
| | | :permission="permissionList" |
| | | ref="crud" |
| | | @row-update="rowUpdates" |
| | | @row-save="rowSave" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @current-change="currentChange" |
| | |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "保安员姓名", |
| | | label: "保安姓名", |
| | | searchLabelWidth: 110, |
| | | prop: "real_name", |
| | | search: true, |
| | |
| | | }, |
| | | |
| | | { |
| | | label: "保安员编号", |
| | | label: "保安证编号", |
| | | prop: "securitynumber", |
| | | display: false |
| | | }, |
| | |
| | | display: false |
| | | }, |
| | | { |
| | | label: "联系电话", |
| | | label: "联系方式", |
| | | prop: "phone", |
| | | display: false |
| | | }, |
| | |
| | | // dicUrl:subofficeOptions, |
| | | dicData: [ |
| | | { |
| | | value: "0", |
| | | value: "1", |
| | | label: "是" |
| | | }, |
| | | { |
| | | value: "2", |
| | | label: "否" |
| | | }, |
| | | { |
| | | value: "3", |
| | | label: "吊销" |
| | | } |
| | | ], |
| | | search: true, |
| | |
| | | label: "是" |
| | | }, |
| | | { |
| | | value: "2", |
| | | value: "1", |
| | | label: "否" |
| | | } |
| | | ], |
| | |
| | | label: "是" |
| | | }, |
| | | { |
| | | value: "2", |
| | | value: "1", |
| | | label: "否" |
| | | } |
| | | ], |
| | |
| | | dicData: [ |
| | | { |
| | | value: "0", |
| | | label: "通过" |
| | | label: "正常" |
| | | }, |
| | | { |
| | | value: "2", |
| | | value: "1", |
| | | label: "异常" |
| | | } |
| | | ], |
| | |
| | | label: "是" |
| | | }, |
| | | { |
| | | value: "2", |
| | | value: "1", |
| | | label: "否" |
| | | } |
| | | ], |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | adddata(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | }, |
| | | rowUpdates(row, index, done, loading) { |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | |
| | | // params = { current: page.currentPage, size: page.pageSize }; |
| | | // } |
| | | let param = {}; |
| | | param["deptid"] = "1412222709480509442"; |
| | | param["deptid"] = params["deptid"] || ""; |
| | | param["name"] = params["real_name"] || ""; |
| | | param["hold"] = params["hold"] || ""; |
| | | param["photo"] = params["photo"] || ""; |
| | | param["examinationtype"] = params["examination_type"] || ""; |
| | | param["dispatch"] = params["dispatch"] || ""; |
| | | param["soil"] = params["soil"] || ""; |
| | | param["current"] = page.currentPage; |
| | | param["size"] = page.pageSize; |
| | | selectUIn(param).then(res => { |
| | |
| | | this.loading = false; |
| | | // this.selectionClear(); |
| | | }); |
| | | } |
| | | }, |
| | | // getTableData() { |
| | | // selectUIn(param).then(res => { |
| | | // if (res.data.code === 200) { |
| | |
| | | // } |
| | | // return etout; |
| | | // } |
| | | getLocationParams() { |
| | | let url = window.location.href; |
| | | let urlArr = url.split("?")[1].split("&"); |
| | | var object = new Object(); |
| | | for (var i = 0; i < urlArr.length; i++) { |
| | | let mm = urlArr[i].split("="); |
| | | object[decodeURIComponent(mm[0])] = decodeURIComponent(mm[1]); |
| | | } |
| | | let deptid = object["deptid"] || ""; |
| | | let obj = { deptid: deptid }; |
| | | this.onLoad(this.page, obj); |
| | | } |
| | | }, |
| | | mounted() { |
| | | // this.getTableData(); |
| | | this.getLocationParams(); |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | :page.sync="page" |
| | | :permission="permissionList" |
| | | ref="crud" |
| | | @row-update="rowUpdates" |
| | | @row-save="rowSave" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @current-change="currentChange" |
| | |
| | | } |
| | | }); |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | adddata(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | }, |
| | | rowUpdates(row, index, done, loading) { |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | // if (!params) { |
| | | // params = { current: page.currentPage, size: page.pageSize }; |
| | | // } |
| | | let param = {}; |
| | | param["jurisdiction"] = params["jurname"] ? params["jurname"] : ""; |
| | | param["deptid"] = ""; |
| | | param["deptid"] = ""; |
| | | param["current"] = page.currentPage; |
| | | param["size"] = page.pageSize; |
| | | selectLi(param).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.tableData = res.data.data; |
| | | // this.data = data.records; |
| | | console.log(this.data); |
| | | this.loading = false; |
| | | // this.selectionClear(); |
| | | }); |
| | | }, |
| | | // toCompanyDetails() { |
| | | // this.$router.push({ path: "/statisticalQueryManagement/companyDetails" }); |
| | | // }, |
| | | handleRowClick(row, event, column) { |
| | | this.$router.push({ path: "/statisticalQueryManagement/companyDetails" }); |
| | | }, |
| | | // getTableData() { |
| | | // selectLi({ current: 1, size: 10 }).then(res => { |
| | | // if (res.data.code === 200) { |
| | | // this.tableData = res.data.data; |
| | | // this.loading = false; |
| | | // } |
| | | // }); |
| | | // } |
| | | // downExcel() { |
| | | // let et = XLSX.utils.table_to_book(document.getElementById("table")); |
| | | // let etout = XLSX.write(et, { |
| | | // bookType: "xlsx", |
| | | // bookSST: true, |
| | | // type: "array" |
| | | // }); |
| | | // try { |
| | | // FileSaver.saveAs( |
| | | // new Blob([etout], { |
| | | // type: "application/octet-stream" |
| | | // }), |
| | | // `表.xlsx` |
| | | // ); //导出的文件名 |
| | | // } catch (e) { |
| | | // console.log(e, etout); |
| | | // } |
| | | // return etout; |
| | | // } |
| | | this.$router.push({ |
| | | path: "/statisticalQueryManagement/companyDetails?deptid=" + row.dept_id |
| | | }); |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getSubOfficeData(); |