diff --git a/api/issueDetail.js b/api/issueDetail.js index c2202f6..268d13f 100644 --- a/api/issueDetail.js +++ b/api/issueDetail.js @@ -5,10 +5,17 @@ module.exports = { getIssueDetail, getIssueProcessList, postIssueHandleSubmit, + response, + close, + toItem, postIssueUpload, getEvaluation, getCategoryList, - postEventHandleSubmit + postEventHandleSubmit, + reviewPass, + reviewNopass, + handleIssueSubmitV2, + getIssueWhistlingDeptV2 } // 获取事件详情 @@ -35,6 +42,18 @@ function getEvaluation(itemId) { function postIssueHandleSubmit(params) { return fly.post('work/event/issue/handleSubmit', params) } +// 回应 v2 +function response(params) { + return fly.post('work/event/issue/response', params) +} +// 关闭 v2 +function close(params) { + return fly.post('work/event/issue/close', params) +} +// 转项目 v2 +function toItem(params) { + return fly.post('work/event/issue/toItem', params) +} // 上传图片 function postIssueUpload(params) { return fly.post('events/issue/upload', params) @@ -46,4 +65,22 @@ function getCategoryList(params) { // 提交事件审核 function postEventHandleSubmit(params) { return fly.post('work/event/event/review', params) +} +// 审核通过 v2 +function reviewPass(params) { + return fly.post('work/event/event/reviewPass', params) +} + +// 审核不通过 v2 +function reviewNopass(params) { + return fly.post('work/event/event/reviewNopass', params) +} + +// 议题处理v2 +function handleIssueSubmitV2 (params) { + return fly.post('work/event/v2/issue/handleSubmit', params) +} +// 获取可吹哨部门 +function getIssueWhistlingDeptV2 (params) { + return fly.get('work/event/item/v2/whistlingDept', params) } \ No newline at end of file diff --git a/api/itemDetail.js b/api/itemDetail.js index f936c0a..cf7de20 100644 --- a/api/itemDetail.js +++ b/api/itemDetail.js @@ -5,9 +5,15 @@ module.exports = { getIssueProcessList, getItemProcessList, postItemHandleSubmit, + response, + close, + whistle, + closeCase, postUpload, getItemWhistlingDept, - getItemEvaluationDept + getItemEvaluationDept, + getItemWhistlingDeptV2, + getItemHandleCategoryV2 } // 获取议题详情 function getItemDetail(id) { @@ -23,6 +29,22 @@ function getIssueProcessList(issueId) { function postItemHandleSubmit(params) { return fly.post('work/event/item/handleSubmit', params) } +// 回应 v2 +function response(params) { + return fly.post('work/event/item/response', params) +} +// 关闭 v2 +function close(params) { + return fly.post('work/event/item/close', params) +} +// 吹哨 v2 +function whistle(params) { + return fly.post('work/event/item/whistle', params) +} +// 结案 v2 +function closeCase(params) { + return fly.post('work/event/item/closeCase', params) +} // 上传图片 function postUpload(params) { return fly.post('events/issue/upload', params) @@ -43,4 +65,12 @@ function getItemEvaluationDept(itemId) { return fly.get('work/event/item/evaluationDept', { itemId: itemId }) +} +// 获取可吹哨部门 +function getItemWhistlingDeptV2 () { + return fly.get('work/event/item/v2/whistlingDept') +} +// 获取当前部门可做操作v2 +function getItemHandleCategoryV2 () { + return fly.get('work/event/item/v2/handleCategory') } \ No newline at end of file diff --git a/components/event/handleSubmit/handleSubmit/handleSubmit.js b/components/event/handleSubmit/handleSubmit/handleSubmit.js index ffdb062..203d38f 100644 --- a/components/event/handleSubmit/handleSubmit/handleSubmit.js +++ b/components/event/handleSubmit/handleSubmit/handleSubmit.js @@ -2,6 +2,7 @@ import { $wuxActionSheet } from '../../../../dist/index' +var api = require("../../../../api/issueDetail") import { BASEURL } from '../../../../utils/config' @@ -25,7 +26,11 @@ Component({ userTagKey: wx.getStorageSync('userTagKey'), isBlock: true, focus: false,//默认没获取焦点 - viewData: "" + viewData: "", + selectImage: "../../../../images/select.png", + selectNoImage: "../../../../images/selectNo.png", + whistlingDeptList: [], // 可吹哨部门 + timer: '' }, /** @@ -60,6 +65,9 @@ Component({ state = 2 } else if (item.text === "转项目") { state = 4 + } else if (item.text === '转项目并吹哨') { + state = 6 + that.getIssueWhistlingDeptV2() } const handleSubmitData = Object.assign(that.data.handleSubmitData, { @@ -96,7 +104,34 @@ Component({ }, // 提交居民意见 bindFormSubmit() { - this.triggerEvent('bindFormSubmit', this.data.handleSubmitData) // 触发父组件事件 + if (this.data.handleSubmitData.state == 6) { + const isSelect = this.data.whistlingDeptList.some(item => item.selected) + if (!isSelect) { + wx.showToast({ + title: '吹哨部门不能为空', + duration: 2000, + icon: 'none' + }) + return false + } + } + const deptResultDTOS = [] + this.data.whistlingDeptList.forEach(item => { + if (item.selected) { + deptResultDTOS.push({ + deptId: item.deptId, + deptName: item.deptName, + typeKey: item.typeKey + }) + } + }) + this.data.handleSubmitData = Object.assign(this.data.handleSubmitData, { + deptResultDTOS: deptResultDTOS + }) + clearTimeout(this.data.timer) + this.data.timer = setTimeout(() => { + this.triggerEvent('bindFormSubmit', this.data.handleSubmitData) // 触发父组件事件 + }, 500) }, // 上传图片 @@ -154,8 +189,24 @@ Component({ current: file.url, urls: fileList.map((n) => n.url), }) - } - + }, + // 改变吹哨部门 + onChangeDeptResultDTOS(e) { + // console.log(e) + let temp = 'whistlingDeptList[' + e.currentTarget.dataset.index + '].selected' + this.setData({ + [temp]: !e.currentTarget.dataset.item.selected + }) + }, + // 获取可吹哨部门v2 + getIssueWhistlingDeptV2 () { + api.getIssueWhistlingDeptV2().then(res => { + console.log(res.data); + this.setData({ + whistlingDeptList: res.data + }) + }); + }, } }) \ No newline at end of file diff --git a/components/event/handleSubmit/handleSubmitItem/handleSubmitItem.js b/components/event/handleSubmit/handleSubmitItem/handleSubmitItem.js index f1cc760..6725320 100644 --- a/components/event/handleSubmit/handleSubmitItem/handleSubmitItem.js +++ b/components/event/handleSubmit/handleSubmitItem/handleSubmitItem.js @@ -1,14 +1,8 @@ // components/handleSubmit/handleSubmitItem.js -import { - $wuxActionSheet -} from '../../../../dist/index' -import { - BASEURL -} from '../../../../utils/config' +import { $wuxActionSheet } from '../../../../dist/index' +import { BASEURL } from '../../../../utils/config' var api = require("../../../../api/itemDetail.js") -import { - $wuxToast -} from '../../../../dist/index' +import { $wuxToast } from '../../../../dist/index' Component({ /** * 组件的属性列表 @@ -42,9 +36,15 @@ Component({ viewData: "", _isBlock: true, _focus: false,//默认没获取焦点 - _viewData: "" + _viewData: "", + handleOperationsList: [], + timer: '' + }, + lifetimes: { + attached () { + this.getCategoryList() + } }, - /** * 组件的方法列表 */ @@ -52,6 +52,8 @@ Component({ // 处理操作 showActionSheet() { + /** + * // 用户标签key(district_party-区党委, district_dept-区直部门, street_party-街道党工委, street_dept-街道部门, community_party-社区党工委, grid_party-网格党支部) // 处理结果:0 回应,1 吹哨,5 关闭,10 结案 let buttons = [] @@ -81,41 +83,46 @@ Component({ text: '回应' }] } - + */ const that = this - $wuxActionSheet().showSheet({ - // titleText: '自定义操作', - buttons: buttons, - buttonClicked(index, item) { - let state = "" - const text = item.text - - // 项目状态:0 回应,1 吹哨,5 关闭,10 结案 - if (item.text === "回应") { - state = 0 - } else if (item.text === "吹哨部门") { - state = 1 - that.getItemWhistlingDept() // 获取可吹哨部门 - } else if (item.text === "关闭") { - state = 5 - } else if (item.text === "结案") { - state = 10 - that.getItemEvaluationDept() // 获取满意度评价部门 - } - - const handleSubmitData = Object.assign(that.data.handleSubmitData, { - state: state, - text: text - }) - that.setData({ - handleSubmitData, - state: state + if (this.data.handleOperationsList.length > 0) { + const buttonList = [] + that.data.handleOperationsList.forEach(item => { + buttonList.push({ + text: item.processName, + state: item.processResult }) - return true - }, - cancelText: '取消', - cancel() {}, - }) + }) + $wuxActionSheet().showSheet({ + // titleText: '自定义操作', + buttons: buttonList, + buttonClicked(index, item) { + // 项目状态:0 回应,1 吹哨,5 关闭,10 结案 + if (item.state == 1) { + that.getItemHandleCategoryV2() // 获取可吹哨部门 + } else if (item.state == 10) { + that.getItemEvaluationDept() // 获取满意度评价部门 + } + const handleSubmitData = Object.assign(that.data.handleSubmitData, { + state: item.state, + text: item.text + }) + that.setData({ + handleSubmitData, + state: item.state + }) + return true + }, + cancelText: '取消', + cancel() {}, + }) + } else { + wx.showToast({ + title: '暂无处理操作选项', + icon: 'none', + duration: 2000 + }) + } }, // 回复居民意见 @@ -186,7 +193,10 @@ Component({ } } } - this.triggerEvent('bindFormSubmit', this.data.handleSubmitData) // 触发父组件事件 + clearTimeout(this.data.timer) + this.data.timer = setTimeout(() => { + this.triggerEvent('bindFormSubmit', this.data.handleSubmitData) // 触发父组件事件 + }, 500) }, // 上传图片 @@ -250,7 +260,7 @@ Component({ }) }, - // 获取可吹哨部门 + // 获取可吹哨部门 v1 getItemWhistlingDept() { api.getItemWhistlingDept().then(res => { console.log(res.data); @@ -259,6 +269,15 @@ Component({ }) }); }, + // 获取可吹哨部门v2 + getItemHandleCategoryV2 () { + api.getItemWhistlingDeptV2().then(res => { + console.log(res.data); + this.setData({ + whistlingDeptList: res.data + }) + }); + }, // 获取满意度评价部门 getItemEvaluationDept() { api.getItemEvaluationDept(this.data.itemId).then(res => { @@ -325,12 +344,25 @@ Component({ that.setData({ handleSubmitData }) - return true }, cancelText: '取消', cancel() {}, }) }, + // 获取处理操作选项 + getCategoryList () { + api.getItemHandleCategoryV2().then(res => { + console.log('处理操作选项', res) + this.setData({ + handleOperationsList: res.data + }) + }).catch(() => { + console.log('获取处理操作选项出错') + this.setData({ + handleOperationsList: [] + }) + }) + } } }) \ No newline at end of file