diff --git a/src/views/modules/shequzhili/xiangmu/index.vue b/src/views/modules/shequzhili/xiangmu/index.vue index 886314332..2d7ba6e23 100644 --- a/src/views/modules/shequzhili/xiangmu/index.vue +++ b/src/views/modules/shequzhili/xiangmu/index.vue @@ -10,72 +10,126 @@ class="demo-form-inline" >
- - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - - + + - - - - - - + + - - 查询 - 重置 + 查询 + 重置
@@ -120,7 +174,7 @@ 导出导出 @@ -141,59 +195,115 @@ + + + + + + + + + + + {//这个关键属性我们一定要写在data的里面并且return的外面,这是动态改变区间的关键 + let nowData = Date.now() + if (this.fmData.startTime) { + let startTime = new Date(this.fmData.startTime) + return time.getTime() > nowData || time.getTime() < startTime || time.getTime() === startTime + } else { + return time.getTime() > nowData + } + + } + let startDisabledDate = (time) => {//这个关键属性我们一定要写在data的里面并且return的外面,这是动态改变区间的关键 + let nowData = Date.now() + return time.getTime() > nowData + } return { pageType: "list", // 列表list 处理dispose 详情info 议题详情issue-info @@ -288,25 +425,46 @@ export default { optionsStatus: [ { value: "pending", - label: "未结案", + label: "处理中", }, { value: "closed", label: "已结案", }, ], - - fmData: { - title: "", - status: "", - startDate: "", - endDate: "", - date: ["", ""], + qudaoArray: [ + { + value: "agency", + label: "网格上报", + }, + { + value: "ic_event", + label: "居民上报", + }, + { + value: "work_event", + label: "巡查上报", + }, + { + value: "issue", + label: "议题上报", + } + ], + orgId: '', + checkStaffId: false, + exportLoading: false, + cateOptions: [], + optionsA: [], + fmData: { ..._form }, + endPickerOptions: { + disabledDate: endDisabledDate + }, + startPickerOptions: { + disabledDate: startDisabledDate }, - importBtnTitle: "导入", importLoading: false, - + eventTypeCheck: [], currentProject: { projectId: "", userId: "", @@ -317,8 +475,8 @@ export default { computed: { maxTableHeight() { return this.$store.state.inIframe - ? this.clientHeight - 360 + this.iframeHeigh - : this.clientHeight - 360; + ? this.clientHeight - 410 + this.iframeHeigh + : this.clientHeight - 410; }, ...mapGetters(["clientHeight", "iframeHeight"]), }, @@ -335,6 +493,8 @@ export default { }, mounted() { this.getTableData(); + this.getGridList() + this.getCateOptions() }, methods: { async handleExportModule() { @@ -410,12 +570,12 @@ export default { message: "导入中,请到系统管理-导入记录中查看进度", duration: 0, }); - const formData = new FormData(); //FormData对象,添加参数只能通过append('key', value)的形式添加 - formData.append("file", file.file); //添加文件对象 + const fmData = new FormData(); //FormData对象,添加参数只能通过append('key', value)的形式添加 + fmData.append("file", file.file); //添加文件对象 await this.$http .post( "/heart/iccommunityselforganization/importcommunityselforganization", - formData + fmData ) .then((res) => { console.log("res-up", res); @@ -434,7 +594,7 @@ export default { // window.SITE_CONFIG["apiURL"] + // "/heart/iccommunityselforganization/importcommunityselforganization", // method: "post", - // data: formData, + // data: fmData, // // responseType: "blob", // }) // .then((res) => { @@ -456,7 +616,48 @@ export default { this.importBtnTitle = "导入"; this.$refs.upload.clearFiles(); }, + handleCalscChange(val) { + console.log('val-----', val) + const arr = val.split('-') + this.fmData.orgId = arr[1] + this.fmData.orgType = arr[0] + }, + handleCheckbox(val) { + const { user } = this.$store.state + console.log('val---', val) + if (val) this.fmData.staffId = user.id + else this.fmData.staffId = '' + }, + handleEventType(val) { + // console.log('val-----eee', val) + console.log('nodes---', this.$refs.cascaderEvent.getCheckedNodes()) + const nodes = this.$refs.cascaderEvent.getCheckedNodes() + this.fmData.firstIdList = [] + this.fmData.secondIdList = [] + let level1 = nodes.filter(item => item.level === 1) + let level2 = nodes.filter(item => item.level === 2) + console.log('level2----1', level2) + level1.forEach(item => { + console.log('level2----2', level2) + if (item.hasChildren) { + for (let i = level2.length - 1; i >= 0; i--) { + if (level2[i].parent.value === item.value) level2.splice(i, 1) + } + } + }) + this.fmData.firstIdList = level1.map(item => item.value) + this.fmData.secondIdList = level2.map(item => item.value) + }, + cascaderClick (node, nodeData) { + console.log('node---', node) + console.log('nodeData---', nodeData) + // this.fmData.agencyId = nodeData.objectId; + // this.fmData.level = nodeData.objectType + // this.$refs.cascaderUnit.checkedValue = nodeData.id; + // this.$refs.cascaderUnit.computePresentText(); + // this.$refs.cascaderUnit.toggleDropDownVisible(false); + }, handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pageSize = val; @@ -470,18 +671,26 @@ export default { }, handleSearch(val) { - console.log(this.fmData); + console.log(JSON.stringify(this.fmData)); this.pageNo = 1; this.getTableData(); }, resetForm(formName) { this.$refs[formName].resetFields(); + this.fmData = { + ..._form + } + this.eventTypeCheck = [] + this.orgId = '' + this.checkStaffId = false this.handleSearch(); }, async handleChu() { - const url = "/gov/project/project/project-list-export"; + // const url = "/gov/project/project/project-list-export"; + const url = '/gov/project/project/orgprojectexport' const { pageSize, pageNo, fmData } = this; + this.exportLoading = true axios({ url: window.SITE_CONFIG["apiURL"] + url, method: "post", @@ -507,8 +716,10 @@ export default { aLink.click(); document.body.removeChild(aLink); //下载完成移除元素 window.URL.revokeObjectURL(url); //释放掉blob对象 + this.exportLoading = false }) .catch((err) => { + this.exportLoading = false console.log("获取导出情失败", err); return this.$message.error("网络错误"); }); @@ -563,7 +774,8 @@ export default { async getTableData() { // const url = "http://yapi.elinkservice.cn/mock/245/gov/project/project/project-list"; - const url = "/gov/project/project/project-list"; + // const url = "/gov/project/project/project-list"; + const url ='/gov/project/project/orgprojectlist' const { pageSize, pageNo, fmData } = this; const { data, code, msg } = await requestPost(url, { pageSize, @@ -575,12 +787,67 @@ export default { this.total = data.total || 0; this.tableData = data.list ? data.list.map((item) => { - return item; + return { + ...item, + urlList: item.urlList && item.urlList.map(n => n.url) + }; }) : []; } else { } }, + async getCateOptions() { + const url = "/gov/issue/issueprojectcategorydict/list"; + + const { data, code, msg } = await requestPost(url, {}); + + if (code === 0) { + // this.cateOptions = data.map((item) => { + // item.subCategory.forEach((subitem) => { + // delete subitem.subCategory; + // }); + // return item; + // }); + this.cateOptions = this.deepTree(data, 'subCategory') + } else { + this.$message.error(msg); + } + }, + getGridList() { + const { user } = this.$store.state + this.dataListLoading = true + const params = { + agencyId: user.agencyId, + client: 'gov' + } + this.$http + // .post('/gov/org/userhouse/service/serviceScopeTree') + .post('/data/aggregator/org/agencytree', params) + // .post('/gov/org/customeragency/staffinagencylist') + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } else { + console.log('获取查询详情成功', res.data) + this.optionsA = this.deepTree(res.data, 'subOrgList') + console.log('optionsA----', this.optionsA) + } + }) + .catch(() => { + return this.$message.error('网络错误') + }) + }, + deepTree(arr, child) { + if (Array.isArray(arr) && arr.length > 0) { + return arr.map(item => { + if (child === 'subOrgList') item.value = item.orgType + '-' + item.orgId + return { + ...item, + [child]: item[child] && item[child].length > 0 && this.deepTree(item[child], child) || null + } + }) + } + } }, }; @@ -662,6 +929,13 @@ export default { .resi-cell-select:last-child { margin-right: 0; } + .item_width_2 { + width: 200px; + } +} + +.data-tag { + margin: 0 5px; } .mt10 {