From d6961ebf19bb84d6a3cdaf9ae6615833dbe746da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=AD=A6=E6=88=90?= <1274337408@qq.com> Date: Fri, 9 Oct 2026 09:41:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=97=E4=BA=AC=E7=90=86=E5=B7=A5=E6=8F=90?= =?UTF-8?q?=E6=A1=88=E4=BC=98=E5=8C=96=E6=95=B4=E6=94=B9:=20=E6=8F=90?= =?UTF-8?q?=E6=A1=88=E6=9F=A5=E8=AF=A2=E5=92=8C=E5=AF=BC=E5=87=BA=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=AD=97=E6=AE=B5=EF=BC=8C=E5=AF=BC=E5=87=BA=E5=89=8D?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E6=90=9C=E7=B4=A2=E6=9D=A1=E4=BB=B6=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../export/proposalExportCaseController.java | 30 +++- .../proposalExportSummaryController.java | 122 +++++++++++++++- .../export/proposalExportWholeController.java | 12 +- .../assets/platform/module/proposal/common.js | 127 ++++++++++++++++ .../views/platform/proposal/export/case.html | 68 +++++---- .../platform/proposal/export/single.html | 17 ++- .../platform/proposal/export/summary.html | 136 +++++++++++++++++- .../views/platform/proposal/export/whole.html | 61 ++++---- .../platform/proposal/include/searchCnd.html | 31 ++-- .../platform/proposal/statistics/history.html | 15 +- 10 files changed, 535 insertions(+), 84 deletions(-) diff --git a/src/main/java/io/v/nutz/proposal/controller/export/proposalExportCaseController.java b/src/main/java/io/v/nutz/proposal/controller/export/proposalExportCaseController.java index f7836bd..c5d5285 100644 --- a/src/main/java/io/v/nutz/proposal/controller/export/proposalExportCaseController.java +++ b/src/main/java/io/v/nutz/proposal/controller/export/proposalExportCaseController.java @@ -32,6 +32,8 @@ import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Param; import javax.servlet.http.HttpServletResponse; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -140,11 +142,19 @@ public class proposalExportCaseController { @Ok("void") @RequiresAuthentication public void exportAllProposal(String props, PageForm page, ProposalSearch search, String stateCode, String[] proposalTypes, String[] proposalResult, - String searchName2, String searchKeyword2, HttpServletResponse response) throws Exception { + String searchName2, String searchKeyword2, + @Param("undertakeId") String undertakeId, + String[] determineTypeOptions, + String exportCondition, + String exportFileCondition, + HttpServletResponse response) throws Exception { Cnd cnd = Cnd.NEW(); Sql sql = Sqls.create(SQL); + if (StrUtil.isNotBlank(undertakeId)) { + cnd.and(Cnd.exps("zbpr.replyUnitId", "=", undertakeId).or("xbpr.replyUnitId", "=", undertakeId)); + } cnd.andEX("info.stateCode", "=", stateCode); cnd.and("info.stateCode", ">", ProposalState.CASE); if (!ShiroUtil.hasAnyRoles(new String[]{"sysadmin", "A06", "tamange", "jdhdbt01"})) { @@ -160,6 +170,11 @@ public class proposalExportCaseController { } if (proposalResult != null && proposalResult.length > 0) { cnd.and("info.resultCode", "in", proposalResult); + if (ArrayUtil.contains(proposalResult, ProposalConstant.DETERMINE)) { + if (determineTypeOptions != null && determineTypeOptions.length > 0) { + cnd.and("info.determineTypeCode", "in", determineTypeOptions); + } + } } cnd.asc("info.resultCode"); proposalInfoService.sortAndSearch(cnd, page, search); @@ -189,8 +204,17 @@ public class proposalExportCaseController { } try { - ViTool.excelResponse(response, "提案立案汇总表.xlsx"); - ExportParams exportParams = new ExportParams(); + String exportTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + String fileCondition = StrUtil.blankToDefault(exportFileCondition, "全部立案提案") + .replaceAll("[\\\\/:*?\"<>|\\r\\n]+", "-") + .replaceAll("\\s+", ""); + if (fileCondition.length() > 80) { + fileCondition = fileCondition.substring(0, 80); + } + ViTool.excelResponse(response, "提案立案汇总表_" + fileCondition + "_" + + exportTime.replaceAll("[-: ]", "") + ".xlsx"); + ExportParams exportParams = new ExportParams("提案立案汇总表(查询条件:" + + StrUtil.blankToDefault(exportCondition, "无") + ";导出时间:" + exportTime + ")", "立案汇总"); exportParams.setType(ExcelType.XSSF); Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, proposalList); workbook.write(response.getOutputStream()); diff --git a/src/main/java/io/v/nutz/proposal/controller/export/proposalExportSummaryController.java b/src/main/java/io/v/nutz/proposal/controller/export/proposalExportSummaryController.java index f77fb77..5757664 100644 --- a/src/main/java/io/v/nutz/proposal/controller/export/proposalExportSummaryController.java +++ b/src/main/java/io/v/nutz/proposal/controller/export/proposalExportSummaryController.java @@ -11,6 +11,7 @@ import io.v.nutz.annontation.ViReturn; import io.v.nutz.base.utils.Vi; import io.v.nutz.modules.models.PageForm; import io.v.nutz.proposal.constants.ProposalConstant; +import io.v.nutz.proposal.constants.ProposalState; import io.v.nutz.proposal.models.ProposalSearch; import io.v.nutz.proposal.services.ProposalInfoService; import io.v.nutz.util.ShiroUtil; @@ -31,8 +32,12 @@ import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Param; import javax.servlet.http.HttpServletResponse; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * @author zhf @@ -151,12 +156,15 @@ public class proposalExportSummaryController { Sql sql = Sqls.create(""" SELECT + info.id, info.proposalCode, info.proposalName, info.brief, info.measures, + info.createTime, su.username, su.loginname, + creatorUnit.`name` creatorUnitName, state.stateName, state.stateColor, type.typeCode, @@ -170,16 +178,24 @@ public class proposalExportSummaryController { masterPu.unitCode AS pruMasterCode, masterPr.replyContent, masterPr.handleOpinion, - GROUP_CONCAT(slavePu.unitName) AS pruSlave, + masterPr.replyTime, + masterPr.implementState, + masterPr.leaderCheckTime, + masterPr.leaderCheckOpinion, + CASE WHEN masterPr.isReply = 1 THEN '已答复' ELSE '未答复' END replyStatus, + GROUP_CONCAT(DISTINCT slavePu.unitName) AS pruSlave, pf.feedbackCodeByUnderTake, - pfDict.`name` feedbackResult + pfDict.`name` feedbackResult, + pf.feedbackOpinion, + pf.feedbackTime FROM proposal_info info LEFT JOIN proposal_reply masterPr on masterPr.proposalId = info.id AND masterPr.undertakeType = 1 LEFT JOIN proposal_underTake masterPu on masterPu.id = masterPr.replyUnitId LEFT JOIN proposal_reply slavePr on slavePr.proposalId = info.id AND slavePr.undertakeType = 2 LEFT JOIN proposal_underTake slavePu on slavePu.id = slavePr.replyUnitId - LEFT JOIN `user` su ON su.id = info.createUser + LEFT JOIN sys_user su ON su.id = info.createUser + LEFT JOIN sys_unit creatorUnit ON creatorUnit.id = su.unitid LEFT JOIN proposal_state state ON state.stateCode = info.stateCode LEFT JOIN proposal_type type ON type.id = info.typeId LEFT JOIN jdh_jdhxx jdh ON jdh.id = info.teacherMeetingId @@ -207,20 +223,36 @@ public class proposalExportSummaryController { List proposalResult = mapCnd.getAsList("proposalResult", String.class); cnd.andEX("info.resultCode", "in", proposalResult); + if (proposalResult != null && proposalResult.contains(ProposalConstant.DETERMINE)) { + List determineTypeOptions = mapCnd.getAsList("proposalDetermineTypes", String.class); + cnd.andEX("info.determineTypeCode", "in", determineTypeOptions); + } + cnd.andEX("info.delegationId", "=", mapCnd.getString("delegationId")); cnd.andEX("info.stateCode", "=", mapCnd.getString("stateCode")); + if (Boolean.TRUE.equals(mapCnd.getBoolean("caseOnly"))) { + cnd.and("info.stateCode", ">", ProposalState.CASE); + } cnd.andEX("su.unionId", "=", mapCnd.getString("unionId")); cnd.andEX("su.unitId", "=", mapCnd.getString("unitId")); + if (!ShiroUtil.hasAnyRoles(new String[]{"sysadmin", "A06", "tamange", "jdhdbt01"})) { + if (ShiroUtil.hasRole("H04")) { + cnd.and("su.unionid", " in ", vi.getMangeUnionStr()); + } + } cnd.asc("info.proposalCode"); cnd.groupBy("info.id"); sql.setCondition(cnd); List list = proposalInfoService.listMap(sql); + fillExportDetails(list); list.forEach(v -> { v.put("brief", HtmlUtil.cleanHtmlTag(HtmlUtil.unescape(v.getString("brief")))); v.put("measures", HtmlUtil.cleanHtmlTag(HtmlUtil.unescape(v.getString("measures")))); v.put("replyContent", HtmlUtil.cleanHtmlTag(HtmlUtil.unescape(v.getString("replyContent", "")))); + v.put("leaderCheckOpinion", HtmlUtil.cleanHtmlTag(HtmlUtil.unescape(v.getString("leaderCheckOpinion", "")))); + v.put("feedbackOpinion", HtmlUtil.cleanHtmlTag(HtmlUtil.unescape(v.getString("feedbackOpinion", "")))); }); List excelExportEntities = new ArrayList(); @@ -230,8 +262,22 @@ public class proposalExportSummaryController { }); try { - ViTool.excelResponse(response, "提案表.xlsx"); - ExportParams exportParams = new ExportParams(); + String exportTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + String exportCondition = mapCnd.getString("exportCondition", "无").replaceAll("[\\r\\n]+", " "); + String exportFileCondition = mapCnd.getString("exportFileCondition", "") + .replaceAll("[\\\\/:*?\"<>|\\r\\n]+", "-") + .replaceAll("\\s+", ""); + String exportTitle = mapCnd.getString("exportTitle", "提案汇总表") + .replaceAll("[\\\\/:*?\"<>|\\r\\n]+", "-"); + if (exportFileCondition.length() > 80) { + exportFileCondition = exportFileCondition.substring(0, 80); + } + String fileName = exportTitle + + (StrUtil.isBlank(exportFileCondition) ? "" : "_" + exportFileCondition) + + "_" + exportTime.replaceAll("[-: ]", "") + ".xlsx"; + ViTool.excelResponse(response, fileName); + ExportParams exportParams = new ExportParams(exportTitle + "(查询条件:" + exportCondition + + ";导出时间:" + exportTime + ")", "提案汇总"); exportParams.setType(ExcelType.XSSF); Workbook workbook = ExcelExportUtil.exportExcel(exportParams, excelExportEntities, list); workbook.write(response.getOutputStream()); @@ -242,4 +288,70 @@ public class proposalExportSummaryController { } + /** + * 补充附议人和审核记录,避免数据库聚合长度限制导致导出内容不完整 + * + * @param list 提案数据 + */ + private void fillExportDetails(List list) { + if (list == null || list.isEmpty()) { + return; + } + + List proposalIds = new ArrayList<>(); + list.forEach(v -> proposalIds.add(v.getString("id"))); + + Sql secondedSql = Sqls.create(""" + SELECT + ps.proposalId, + su.username, + su.loginname + FROM proposal_seconded ps + LEFT JOIN sys_user su ON su.id = ps.seconderId + WHERE ps.proposalId IN (@proposalIds) + AND ps.isAgree = 1 + ORDER BY ps.secondedTime + """).setParam("proposalIds", proposalIds); + Map> secondedMap = new HashMap<>(); + proposalInfoService.listMap(secondedSql).forEach(v -> { + String username = v.getString("username", ""); + String loginname = v.getString("loginname", ""); + String seconderName = username + (StrUtil.isBlank(loginname) ? "" : "(" + loginname + ")"); + secondedMap.computeIfAbsent(v.getString("proposalId"), key -> new ArrayList<>()).add(seconderName); + }); + + Sql auditSql = Sqls.create(""" + SELECT + pa.proposalId, + pa.username, + pa.flag, + pa.opinion, + pa.auditTime, + dict.`name` auditTypeName + FROM proposal_audit pa + LEFT JOIN sys_dict dict ON dict.`code` = pa.other + WHERE pa.proposalId IN (@proposalIds) + ORDER BY pa.auditTime + """).setParam("proposalIds", proposalIds); + Map> auditMap = new HashMap<>(); + proposalInfoService.listMap(auditSql).forEach(v -> { + Boolean flag = v.getBoolean("flag"); + String auditResult = flag == null ? "" : (flag ? "通过" : "不通过"); + String auditTypeName = v.getString("auditTypeName", ""); + String auditTitle = StrUtil.isBlank(auditTypeName) ? auditResult + : auditTypeName + (StrUtil.isBlank(auditResult) ? "" : "/" + auditResult); + String opinion = HtmlUtil.cleanHtmlTag(HtmlUtil.unescape(v.getString("opinion", ""))); + String auditRecord = v.getString("username", "") + + (StrUtil.isBlank(auditTitle) ? "" : "【" + auditTitle + "】") + + (StrUtil.isBlank(opinion) ? "" : ":" + opinion) + + (StrUtil.isBlank(v.getString("auditTime")) ? "" : "(" + v.getString("auditTime") + ")"); + auditMap.computeIfAbsent(v.getString("proposalId"), key -> new ArrayList<>()).add(auditRecord); + }); + + list.forEach(v -> { + v.put("seconderNames", String.join("、", secondedMap.getOrDefault(v.getString("id"), new ArrayList<>()))); + v.put("auditRecords", String.join(";", auditMap.getOrDefault(v.getString("id"), new ArrayList<>()))); + }); + } + } diff --git a/src/main/java/io/v/nutz/proposal/controller/export/proposalExportWholeController.java b/src/main/java/io/v/nutz/proposal/controller/export/proposalExportWholeController.java index cc5e320..6bbe98f 100644 --- a/src/main/java/io/v/nutz/proposal/controller/export/proposalExportWholeController.java +++ b/src/main/java/io/v/nutz/proposal/controller/export/proposalExportWholeController.java @@ -133,7 +133,8 @@ public class proposalExportWholeController { @Ok("void") @RequiresAuthentication public void exportAllProposal(ProposalSearch search, String stateCode, String[] proposalTypes, String[] proposalResult, - String searchName2, String searchKeyword2, HttpServletResponse response) throws Exception { + String searchName2, String searchKeyword2, String exportFileCondition, + HttpServletResponse response) throws Exception { CndPlus cnd = CndPlus.create(); Sql sql = Sqls.create(""" SELECT @@ -171,7 +172,14 @@ public class proposalExportWholeController { response.reset(); response.setContentType("application/x-msdownload;charset=utf-8"); - String fileName = "提案汇总文件夹"; + String exportTime = DateFormatUtils.format(new Date(), "yyyyMMddHHmmss", Locale.CHINA); + String fileCondition = StrUtil.blankToDefault(exportFileCondition, "全部提案") + .replaceAll("[\\\\/:*?\"<>|\\r\\n]+", "-") + .replaceAll("\\s+", ""); + if (fileCondition.length() > 80) { + fileCondition = fileCondition.substring(0, 80); + } + String fileName = "提案汇总文件夹_" + fileCondition + "_" + exportTime; // 创建临时文件夹 diff --git a/src/main/resources/static/assets/platform/module/proposal/common.js b/src/main/resources/static/assets/platform/module/proposal/common.js index a66f661..09e2889 100644 --- a/src/main/resources/static/assets/platform/module/proposal/common.js +++ b/src/main/resources/static/assets/platform/module/proposal/common.js @@ -190,6 +190,133 @@ window.proposal = { async getProposalNextNode(stateCode) { const {data} = await $.get("/platform/proposal/common/getProposalNextNode", {stateCode}) return data + }, + + /** + * 生成提案导出的查询条件说明 + */ + buildExportCondition(app) { + const page = app.pageForm + const optionLabel = (options, value, valueKey, labelKey) => { + const option = (options || []).find(item => item[valueKey] === value) + return option ? option[labelKey] : value + } + const conditions = [] + const fileConditions = [] + if (page.meetingId) { + const meetingName = optionLabel(app.meetingOptions, page.meetingId, 'id', 'jdhallname') + conditions.push('届次:' + meetingName) + fileConditions.push(meetingName) + } else { + conditions.push('届次:全部届次') + fileConditions.push('全部届次') + } + if (page.stateCode) { + const stateName = optionLabel(app.stateOptions, page.stateCode, 'stateCode', 'stateName') + conditions.push('提案状态:' + stateName) + fileConditions.push(stateName) + } + if (page.proposalTypes.length) { + const typeNames = page.proposalTypes.map(value => + optionLabel(app.typeOptions, value, 'id', 'typeName')).join('、') + conditions.push('提案类型:' + typeNames) + fileConditions.push(typeNames) + } + if (page.proposalResult.length) { + const resultNames = page.proposalResult.map(value => + optionLabel(app.resultOptions, value, 'code', 'name')).join('、') + conditions.push('立案结果:' + resultNames) + fileConditions.push(resultNames) + } + if (page.proposalResult.includes('determine') && page.proposalDetermineTypes.length) { + conditions.push('是否重点:' + page.proposalDetermineTypes.map(value => + optionLabel(app.determineTypeOptions, value, 'code', 'name')).join('、')) + } + if (page.delegationId) { + conditions.push('代表团:' + optionLabel(app.delegationOptions, page.delegationId, 'id', 'dbtname')) + } + if (page.unionId) { + conditions.push('所属工会:' + optionLabel(app.unionOptions, page.unionId, 'id', 'unionname')) + } + if (page.unitId) { + conditions.push('所属单位:' + optionLabel(app.unitOptions, page.unitId, 'id', 'name')) + } + if (page.undertakeId) { + const undertakeName = optionLabel(app.undertakeOptions, page.undertakeId, 'id', 'unitName') + conditions.push('承办单位:' + undertakeName) + fileConditions.push(undertakeName) + } + if (page.searchKeyword) { + conditions.push((page.searchName === 'proposalCode' ? '提案编号:' : '提案名称:') + page.searchKeyword) + fileConditions.push(page.searchKeyword) + } + if (page.searchKeyword2) { + conditions.push('提案人:' + page.searchKeyword2) + fileConditions.push(page.searchKeyword2) + } + + return { + exportCondition: conditions.join(';'), + exportFileCondition: fileConditions.join('_') + } + }, + + /** + * 按当前页面查询条件导出完整提案数据 + */ + exportCompleteData(app, exportOptions = {}) { + const page = app.pageForm + const {exportCondition, exportFileCondition} = this.buildExportCondition(app) + const totalCount = page.totalCount || 0 + app.$confirm('将导出当前筛选条件下的全部 ' + totalCount + ' 条提案,不受当前分页影响。查询条件:' + + exportCondition, '导出确认', { + confirmButtonText: '确认导出', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + const exportForm = clone(page) + exportForm.exportCondition = exportCondition + exportForm.exportFileCondition = exportFileCondition + exportForm.exportTitle = exportOptions.title || '提案完整数据' + exportForm.caseOnly = exportOptions.caseOnly === true + const form = $('
') + form.attr('action', '/platform/proposal/export/summary/exportByCnd') + form.append($('').val(JSON.stringify(exportForm))) + form.append($('').val(JSON.stringify([ + {prop: 'proposalCode', label: '提案编号'}, + {prop: 'username', label: '提案人'}, + {prop: 'loginname', label: '提案人工号'}, + {prop: 'seconderNames', label: '附议人'}, + {prop: 'creatorUnitName', label: '所属单位'}, + {prop: 'proposalName', label: '提案标题'}, + {prop: 'brief', label: '案由'}, + {prop: 'measures', label: '建议措施'}, + {prop: 'createTime', label: '提案时间'}, + {prop: 'meetingName', label: '届次'}, + {prop: 'delegationName', label: '代表团'}, + {prop: 'typeName', label: '提案类型'}, + {prop: 'mannerName', label: '提案方式'}, + {prop: 'resultName', label: '立案结果'}, + {prop: 'stateName', label: '办理进度'}, + {prop: 'pruMaster', label: '主办单位'}, + {prop: 'pruSlave', label: '协办单位'}, + {prop: 'replyStatus', label: '答复状态'}, + {prop: 'replyTime', label: '答复时间'}, + {prop: 'replyContent', label: '答复内容'}, + {prop: 'handleOpinion', label: '处理意见'}, + {prop: 'implementState', label: '落实情况'}, + {prop: 'leaderCheckTime', label: '分管领导审批时间'}, + {prop: 'leaderCheckOpinion', label: '分管领导审批意见'}, + {prop: 'feedbackCodeByUnderTake', label: '对承办单位办理态度评价'}, + {prop: 'feedbackResult', label: '对办理结果评价'}, + {prop: 'feedbackOpinion', label: '反馈意见'}, + {prop: 'feedbackTime', label: '反馈时间'}, + {prop: 'auditRecords', label: '审核记录及时间'} + ]))) + $('body').append(form) + form.submit() + form.remove() + }).catch(() => {}) } } diff --git a/src/main/resources/views/platform/proposal/export/case.html b/src/main/resources/views/platform/proposal/export/case.html index b5179e2..62b2577 100644 --- a/src/main/resources/views/platform/proposal/export/case.html +++ b/src/main/resources/views/platform/proposal/export/case.html @@ -32,7 +32,8 @@ layout("/layouts/platform.html"){ @@ -121,6 +122,7 @@ layout("/layouts/platform.html"){ mixins: [initTableMixins], data() { return { + showStateSearch: true, resultOptions: [], determineTypeOptions: [], typeOptions: [], @@ -138,6 +140,7 @@ layout("/layouts/platform.html"){ meetingId: '', unionId: '', unitId: '', + undertakeId: '', delegationId: '', proposalResult: [], proposalTypes: [], @@ -166,42 +169,50 @@ layout("/layouts/platform.html"){ 'proposal-table': httpVueLoader('/components/proposal/ProposalTable.vue'), }, methods: { + exportCompleteData() { + proposal.exportCompleteData(this, {title: '立案提案完整数据', caseOnly: true}) + }, exportAllProposal() { - const proposalTypes = JSON.stringify(this.pageForm.proposalTypes) - const proposalResult = JSON.stringify(this.pageForm.proposalResult) - const searchName2 = this.pageForm.searchName2 - const searchKeyword2 = this.pageForm.searchKeyword2 - const stateCode = this.pageForm.stateCode - const searchKeyword = this.pageForm.searchKeyword - const searchName = this.pageForm.searchName - const delegationId = this.pageForm.delegationId - const unionId = this.pageForm.unionId - const unitId = this.pageForm.unitId - const meetingId = this.pageForm.meetingId + const {exportCondition, exportFileCondition} = proposal.buildExportCondition(this) let props = {} this.tableColumns.forEach(v => { props[v.prop] = v.label }) - window.open(loc() + "/exportAllProposal?proposalTypes=" + proposalTypes + - "&proposalResult=" + proposalResult + - "&searchName2=" + searchName2 + - "&searchKeyword2=" + searchKeyword2 + - "&stateCode=" + stateCode + - "&searchKeyword=" + searchKeyword + - "&searchName=" + searchName + - "&delegationId=" + delegationId + - "&unionId=" + unionId + - "&unitId=" + unitId + - "&meetingId=" + meetingId + - "&props=" + JSON.stringify(props)) + this.$confirm('将按当前条件导出全部 ' + (this.pageForm.totalCount || 0) + + ' 条立案汇总数据,不受当前分页影响。查询条件:' + exportCondition, '导出确认', { + confirmButtonText: '确认导出', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + const exportForm = $('
') + exportForm.attr('action', loc() + '/exportAllProposal') + const params = Object.assign({}, this.pageForm, { + proposalTypes: JSON.stringify(this.pageForm.proposalTypes), + proposalResult: JSON.stringify(this.pageForm.proposalResult), + determineTypeOptions: JSON.stringify(this.pageForm.proposalDetermineTypes), + props: JSON.stringify(props), + exportCondition, + exportFileCondition + }) + Object.keys(params).forEach(key => { + if (!Array.isArray(params[key])) { + exportForm.append($('').attr('name', key).val(params[key] || '')) + } + }) + $('body').append(exportForm) + exportForm.submit() + exportForm.remove() + }).catch(() => {}) }, oneProposalExport(id) { window.location.href = "/platform/proposal/statistics/summary/oneProposalExport?proposalId=" + id }, async meetingChange(val) { this.pageForm.delegationId = '' - this.delegationOptions = await proposal.getDelegation(val) - this.undertakeOptions = await proposal.getUndertakeByMeeting(val) + this.pageForm.undertakeId = '' + this.delegationOptions = val ? await proposal.getDelegation(val) : [] + this.undertakeOptions = val ? await proposal.getUndertakeByMeeting(val) + : await proposal.getAllProposalUndertake() this.doSearch() }, async delegationChange(val) { @@ -271,8 +282,9 @@ layout("/layouts/platform.html"){ async created() { this.meetingOptions = await getAllJdh() this.pageForm.meetingId = this.meetingOptions.length ? this.meetingOptions[0].id : '' + this.meetingOptions.unshift({id: '', jdhallname: '全部届次'}) - this.stateOptions = await proposal.getOpenProposalState() + this.stateOptions = await proposal.getProposalState() this.typeOptions = await proposal.getProposalType() this.resultOptions = await getDictOptions("proposal_result") this.determineTypeOptions = await getDictOptions("proposal_determine_type") @@ -287,4 +299,4 @@ layout("/layouts/platform.html"){ \ No newline at end of file +#--> diff --git a/src/main/resources/views/platform/proposal/export/single.html b/src/main/resources/views/platform/proposal/export/single.html index f63ff44..d77794d 100644 --- a/src/main/resources/views/platform/proposal/export/single.html +++ b/src/main/resources/views/platform/proposal/export/single.html @@ -31,7 +31,6 @@ layout("/layouts/platform.html"){ \ No newline at end of file +#--> diff --git a/src/main/resources/views/platform/proposal/export/summary.html b/src/main/resources/views/platform/proposal/export/summary.html index 8af85f7..f19f24c 100644 --- a/src/main/resources/views/platform/proposal/export/summary.html +++ b/src/main/resources/views/platform/proposal/export/summary.html @@ -121,7 +121,9 @@ layout("/layouts/platform.html"){ mixins: [initTableMixins], data() { return { + showStateSearch: true, resultOptions: [], + determineTypeOptions: [], typeOptions: [], meetingOptions: [], stateOptions: [], @@ -136,6 +138,9 @@ layout("/layouts/platform.html"){ stateCode: '', meetingId: '', delegationId: '', + unionId: '', + unitId: '', + undertakeId: '', proposalResult: [], proposalTypes: [], proposalDetermineTypes: [] @@ -161,6 +166,37 @@ layout("/layouts/platform.html"){ {prop: 'feedbackCodeByUnderTake', label: '对承办单位办理态度评价'}, {prop: 'feedbackResult', label: '对办理结果评价'}, ], + exportColumns: [ + {prop: 'proposalCode', label: '提案编号'}, + {prop: 'username', label: '提案人'}, + {prop: 'loginname', label: '提案人工号'}, + {prop: 'seconderNames', label: '附议人'}, + {prop: 'creatorUnitName', label: '所属单位'}, + {prop: 'proposalName', label: '提案标题'}, + {prop: 'brief', label: '案由'}, + {prop: 'measures', label: '建议措施'}, + {prop: 'createTime', label: '提案时间'}, + {prop: 'meetingName', label: '届次'}, + {prop: 'delegationName', label: '代表团'}, + {prop: 'typeName', label: '提案类型'}, + {prop: 'mannerName', label: '提案方式'}, + {prop: 'resultName', label: '立案结果'}, + {prop: 'stateName', label: '办理进度'}, + {prop: 'pruMaster', label: '主办单位'}, + {prop: 'pruSlave', label: '协办单位'}, + {prop: 'replyStatus', label: '答复状态'}, + {prop: 'replyTime', label: '答复时间'}, + {prop: 'replyContent', label: '答复内容'}, + {prop: 'handleOpinion', label: '处理意见'}, + {prop: 'implementState', label: '落实情况'}, + {prop: 'leaderCheckTime', label: '分管领导审批时间'}, + {prop: 'leaderCheckOpinion', label: '分管领导审批意见'}, + {prop: 'feedbackCodeByUnderTake', label: '对承办单位办理态度评价'}, + {prop: 'feedbackResult', label: '对办理结果评价'}, + {prop: 'feedbackOpinion', label: '反馈意见'}, + {prop: 'feedbackTime', label: '反馈时间'}, + {prop: 'auditRecords', label: '审核记录及时间'}, + ], } }, components: { @@ -169,8 +205,102 @@ layout("/layouts/platform.html"){ 'proposal-table': httpVueLoader('/components/proposal/ProposalTable.vue'), }, methods: { + getOptionLabel(options, value, valueKey, labelKey) { + const option = options.find(item => item[valueKey] === value) + return option ? option[labelKey] : value + }, + getExportCondition() { + const conditions = [] + const {meetingId, stateCode, proposalTypes, proposalResult, proposalDetermineTypes, + delegationId, unionId, unitId, undertakeId, searchKeyword, searchKeyword2} = this.pageForm + + if (meetingId) { + conditions.push('届次:' + this.getOptionLabel(this.meetingOptions, meetingId, 'id', 'jdhallname')) + } + if (stateCode) { + conditions.push('提案状态:' + this.getOptionLabel(this.stateOptions, stateCode, 'stateCode', 'stateName')) + } + if (proposalTypes.length) { + conditions.push('提案类型:' + proposalTypes.map(value => + this.getOptionLabel(this.typeOptions, value, 'id', 'typeName')).join('、')) + } + if (proposalResult.length) { + conditions.push('立案结果:' + proposalResult.map(value => + this.getOptionLabel(this.resultOptions, value, 'code', 'name')).join('、')) + } + if (proposalResult.includes('determine') && proposalDetermineTypes.length) { + conditions.push('是否重点:' + proposalDetermineTypes.map(value => + this.getOptionLabel(this.determineTypeOptions, value, 'code', 'name')).join('、')) + } + if (delegationId) { + conditions.push('代表团:' + this.getOptionLabel(this.delegationOptions, delegationId, 'id', 'dbtname')) + } + if (unionId) { + conditions.push('所属工会:' + this.getOptionLabel(this.unionOptions, unionId, 'id', 'unionname')) + } + if (unitId) { + conditions.push('所属单位:' + this.getOptionLabel(this.unitOptions, unitId, 'id', 'name')) + } + if (undertakeId) { + conditions.push('承办单位:' + this.getOptionLabel(this.undertakeOptions, undertakeId, 'id', 'unitName')) + } + if (searchKeyword) { + conditions.push((this.pageForm.searchName === 'proposalCode' ? '提案编号:' : '提案名称:') + searchKeyword) + } + if (searchKeyword2) { + conditions.push('提案人:' + searchKeyword2) + } + return conditions.length ? conditions.join(';') : '无' + }, + getExportFileCondition() { + const conditions = [] + const {meetingId, stateCode, proposalTypes, proposalResult, undertakeId, + searchKeyword, searchKeyword2} = this.pageForm + if (meetingId) { + conditions.push(this.getOptionLabel(this.meetingOptions, meetingId, 'id', 'jdhallname')) + } + if (stateCode) { + conditions.push(this.getOptionLabel(this.stateOptions, stateCode, 'stateCode', 'stateName')) + } + if (proposalTypes.length) { + conditions.push(proposalTypes.map(value => + this.getOptionLabel(this.typeOptions, value, 'id', 'typeName')).join('、')) + } + if (proposalResult.length) { + conditions.push(proposalResult.map(value => + this.getOptionLabel(this.resultOptions, value, 'code', 'name')).join('、')) + } + if (undertakeId) { + conditions.push(this.getOptionLabel(this.undertakeOptions, undertakeId, 'id', 'unitName')) + } + if (searchKeyword) { + conditions.push(searchKeyword) + } + if (searchKeyword2) { + conditions.push(searchKeyword2) + } + return conditions.join('_') + }, exportByCnd() { - window.open(loc() + '/exportByCnd?cnd=' + JSON.stringify(this.pageForm) + '&tableColumns=' + JSON.stringify(this.tableColumns)) + const exportCondition = this.getExportCondition() + const totalCount = this.pageForm.totalCount || 0 + this.$confirm('将导出当前筛选条件下的全部 ' + totalCount + ' 条提案,不受当前分页影响。查询条件:' + exportCondition, + '导出确认', { + confirmButtonText: '确认导出', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + const exportForm = clone(this.pageForm) + exportForm.exportCondition = exportCondition + exportForm.exportFileCondition = this.getExportFileCondition() + const form = $('
') + form.attr('action', loc() + '/exportByCnd') + form.append($('').val(JSON.stringify(exportForm))) + form.append($('').val(JSON.stringify(this.exportColumns))) + $('body').append(form) + form.submit() + form.remove() + }).catch(() => {}) }, oneProposalExport(id) { window.location.href = "/platform/proposal/statistics/summary/oneProposalExport?proposalId=" + id @@ -247,7 +377,7 @@ layout("/layouts/platform.html"){ this.meetingOptions = await getAllJdh() this.pageForm.meetingId = this.meetingOptions.length ? this.meetingOptions[0].id : '' - this.stateOptions = await proposal.getOpenProposalState() + this.stateOptions = await proposal.getProposalState() this.typeOptions = await proposal.getProposalType() this.resultOptions = await getDictOptions("proposal_result") this.determineTypeOptions = await getDictOptions("proposal_determine_type") @@ -262,4 +392,4 @@ layout("/layouts/platform.html"){ \ No newline at end of file +#--> diff --git a/src/main/resources/views/platform/proposal/export/whole.html b/src/main/resources/views/platform/proposal/export/whole.html index 00c2c88..05f7858 100644 --- a/src/main/resources/views/platform/proposal/export/whole.html +++ b/src/main/resources/views/platform/proposal/export/whole.html @@ -93,7 +93,9 @@ layout("/layouts/platform.html"){ mixins: [initTableMixins], data() { return { + showStateSearch: true, resultOptions: [], + determineTypeOptions: [], typeOptions: [], meetingOptions: [], stateOptions: [], @@ -110,6 +112,7 @@ layout("/layouts/platform.html"){ stateCode: '', meetingId: '', delegationId: '', + undertakeId: '', proposalResult: [], proposalTypes: [], proposalDetermineTypes: [] @@ -138,36 +141,39 @@ layout("/layouts/platform.html"){ }, methods: { exportAllProposal() { - const proposalTypes = JSON.stringify(this.pageForm.proposalTypes) - const proposalResult = JSON.stringify(this.pageForm.proposalResult) - const searchName2 = this.pageForm.searchName2 - const searchKeyword2 = this.pageForm.searchKeyword2 - const stateCode = this.pageForm.stateCode - const searchKeyword = this.pageForm.searchKeyword - const searchName = this.pageForm.searchName - const delegationId = this.pageForm.delegationId - const unionId = this.pageForm.unionId - const unitId = this.pageForm.unitId - const meetingId = this.pageForm.meetingId - window.location.href = loc() + "/exportAllProposal?proposalTypes=" + proposalTypes + - "&proposalResult=" + proposalResult + - "&searchName2=" + searchName2 + - "&searchKeyword2=" + searchKeyword2 + - "&stateCode=" + stateCode + - "&searchKeyword=" + searchKeyword + - "&searchName=" + searchName + - "&delegationId=" + delegationId + - "&unionId=" + unionId + - "&unitId=" + unitId + - "&meetingId=" + meetingId + const {exportCondition, exportFileCondition} = proposal.buildExportCondition(this) + this.$confirm('将按当前筛选条件导出全部 ' + (this.pageForm.totalCount || 0) + + ' 件提案,不受当前分页影响。查询条件:' + exportCondition, '导出确认', { + confirmButtonText: '确认导出', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + const exportForm = $('
') + exportForm.attr('action', loc() + '/exportAllProposal') + const params = Object.assign({}, this.pageForm, { + proposalTypes: JSON.stringify(this.pageForm.proposalTypes), + proposalResult: JSON.stringify(this.pageForm.proposalResult), + exportFileCondition + }) + Object.keys(params).forEach(key => { + if (!Array.isArray(params[key])) { + exportForm.append($('').attr('name', key).val(params[key] || '')) + } + }) + $('body').append(exportForm) + exportForm.submit() + exportForm.remove() + }).catch(() => {}) }, oneProposalExport(id) { window.location.href = "/platform/proposal/statistics/summary/oneProposalExport?proposalId=" + id }, async meetingChange(val) { this.pageForm.delegationId = null - this.delegationOptions = await getDelegation(val) - this.undertakeOptions = await proposal.getUndertakeByMeeting(val) + this.pageForm.undertakeId = '' + this.delegationOptions = val ? await proposal.getDelegation(val) : [] + this.undertakeOptions = val ? await proposal.getUndertakeByMeeting(val) + : await proposal.getAllProposalUndertake() this.doSearch() }, async delegationChange(val) { @@ -235,13 +241,14 @@ layout("/layouts/platform.html"){ async created() { this.meetingOptions = await getAllJdh() this.pageForm.meetingId = this.meetingOptions.length ? this.meetingOptions[0].id : '' + this.meetingOptions.unshift({id: '', jdhallname: '全部届次'}) - this.stateOptions = await getOpenProposalState() + this.stateOptions = await proposal.getProposalState() this.typeOptions = await getProposalType() this.resultOptions = await getDictOptions("proposal_result") this.determineTypeOptions = await getDictOptions("proposal_determine_type") - this.delegationOptions = await getDelegation(this.pageForm.meetingId) + this.delegationOptions = await proposal.getDelegation(this.pageForm.meetingId) this.undertakeOptions = await proposal.getUndertakeByMeeting(this.pageForm.meetingId) this.unionOptions = await getUnions(null) this.unitOptions = await getUnits(null) @@ -251,4 +258,4 @@ layout("/layouts/platform.html"){ \ No newline at end of file +#--> diff --git a/src/main/resources/views/platform/proposal/include/searchCnd.html b/src/main/resources/views/platform/proposal/include/searchCnd.html index c565213..7cc1b8f 100644 --- a/src/main/resources/views/platform/proposal/include/searchCnd.html +++ b/src/main/resources/views/platform/proposal/include/searchCnd.html @@ -146,15 +146,28 @@ 承办单位: - - - - + + + + + + + + + 提案状态: + + + + + + -
\ No newline at end of file + diff --git a/src/main/resources/views/platform/proposal/statistics/history.html b/src/main/resources/views/platform/proposal/statistics/history.html index 2950878..97714e6 100644 --- a/src/main/resources/views/platform/proposal/statistics/history.html +++ b/src/main/resources/views/platform/proposal/statistics/history.html @@ -190,6 +190,17 @@ layout("/layouts/platform.html"){ + + 提案状态: + + + + + + + @@ -433,7 +444,7 @@ layout("/layouts/platform.html"){ this.meetingOptions = await getAllJdh() // this.pageForm.meetingId = this.meetingOptions.length ? this.meetingOptions[0].id : '' - this.stateOptions = await proposal.getOpenProposalState() + this.stateOptions = await proposal.getProposalState() this.typeOptions = await proposal.getProposalType() this.resultOptions = await getDictOptions("proposal_result") @@ -453,4 +464,4 @@ layout("/layouts/platform.html"){ \ No newline at end of file +#-->