Browse Source

【吹哨流程·接口修改】 -刘绍文 -2020.5.25

master tagv1.0.5
liushaowen 5 years ago
parent
commit
afcfbf6b27
  1. 39
      api/issueDetail.js
  2. 32
      api/itemDetail.js
  3. 59
      components/event/handleSubmit/handleSubmit/handleSubmit.js
  4. 126
      components/event/handleSubmit/handleSubmitItem/handleSubmitItem.js

39
api/issueDetail.js

@ -5,10 +5,17 @@ module.exports = {
getIssueDetail, getIssueDetail,
getIssueProcessList, getIssueProcessList,
postIssueHandleSubmit, postIssueHandleSubmit,
response,
close,
toItem,
postIssueUpload, postIssueUpload,
getEvaluation, getEvaluation,
getCategoryList, getCategoryList,
postEventHandleSubmit postEventHandleSubmit,
reviewPass,
reviewNopass,
handleIssueSubmitV2,
getIssueWhistlingDeptV2
} }
// 获取事件详情 // 获取事件详情
@ -35,6 +42,18 @@ function getEvaluation(itemId) {
function postIssueHandleSubmit(params) { function postIssueHandleSubmit(params) {
return fly.post('work/event/issue/handleSubmit', 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) { function postIssueUpload(params) {
return fly.post('events/issue/upload', params) return fly.post('events/issue/upload', params)
@ -46,4 +65,22 @@ function getCategoryList(params) {
// 提交事件审核 // 提交事件审核
function postEventHandleSubmit(params) { function postEventHandleSubmit(params) {
return fly.post('work/event/event/review', 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)
} }

32
api/itemDetail.js

@ -5,9 +5,15 @@ module.exports = {
getIssueProcessList, getIssueProcessList,
getItemProcessList, getItemProcessList,
postItemHandleSubmit, postItemHandleSubmit,
response,
close,
whistle,
closeCase,
postUpload, postUpload,
getItemWhistlingDept, getItemWhistlingDept,
getItemEvaluationDept getItemEvaluationDept,
getItemWhistlingDeptV2,
getItemHandleCategoryV2
} }
// 获取议题详情 // 获取议题详情
function getItemDetail(id) { function getItemDetail(id) {
@ -23,6 +29,22 @@ function getIssueProcessList(issueId) {
function postItemHandleSubmit(params) { function postItemHandleSubmit(params) {
return fly.post('work/event/item/handleSubmit', 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) { function postUpload(params) {
return fly.post('events/issue/upload', params) return fly.post('events/issue/upload', params)
@ -43,4 +65,12 @@ function getItemEvaluationDept(itemId) {
return fly.get('work/event/item/evaluationDept', { return fly.get('work/event/item/evaluationDept', {
itemId: itemId itemId: itemId
}) })
}
// 获取可吹哨部门
function getItemWhistlingDeptV2 () {
return fly.get('work/event/item/v2/whistlingDept')
}
// 获取当前部门可做操作v2
function getItemHandleCategoryV2 () {
return fly.get('work/event/item/v2/handleCategory')
} }

59
components/event/handleSubmit/handleSubmit/handleSubmit.js

@ -2,6 +2,7 @@
import { import {
$wuxActionSheet $wuxActionSheet
} from '../../../../dist/index' } from '../../../../dist/index'
var api = require("../../../../api/issueDetail")
import { import {
BASEURL BASEURL
} from '../../../../utils/config' } from '../../../../utils/config'
@ -25,7 +26,11 @@ Component({
userTagKey: wx.getStorageSync('userTagKey'), userTagKey: wx.getStorageSync('userTagKey'),
isBlock: true, isBlock: true,
focus: false,//默认没获取焦点 focus: false,//默认没获取焦点
viewData: "" viewData: "",
selectImage: "../../../../images/select.png",
selectNoImage: "../../../../images/selectNo.png",
whistlingDeptList: [], // 可吹哨部门
timer: ''
}, },
/** /**
@ -60,6 +65,9 @@ Component({
state = 2 state = 2
} else if (item.text === "转项目") { } else if (item.text === "转项目") {
state = 4 state = 4
} else if (item.text === '转项目并吹哨') {
state = 6
that.getIssueWhistlingDeptV2()
} }
const handleSubmitData = Object.assign(that.data.handleSubmitData, { const handleSubmitData = Object.assign(that.data.handleSubmitData, {
@ -96,7 +104,34 @@ Component({
}, },
// 提交居民意见 // 提交居民意见
bindFormSubmit() { 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, current: file.url,
urls: fileList.map((n) => n.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
})
});
},
} }
}) })

126
components/event/handleSubmit/handleSubmitItem/handleSubmitItem.js

@ -1,14 +1,8 @@
// components/handleSubmit/handleSubmitItem.js // components/handleSubmit/handleSubmitItem.js
import { import { $wuxActionSheet } from '../../../../dist/index'
$wuxActionSheet import { BASEURL } from '../../../../utils/config'
} from '../../../../dist/index'
import {
BASEURL
} from '../../../../utils/config'
var api = require("../../../../api/itemDetail.js") var api = require("../../../../api/itemDetail.js")
import { import { $wuxToast } from '../../../../dist/index'
$wuxToast
} from '../../../../dist/index'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
@ -42,9 +36,15 @@ Component({
viewData: "", viewData: "",
_isBlock: true, _isBlock: true,
_focus: false,//默认没获取焦点 _focus: false,//默认没获取焦点
_viewData: "" _viewData: "",
handleOperationsList: [],
timer: ''
},
lifetimes: {
attached () {
this.getCategoryList()
}
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
@ -52,6 +52,8 @@ Component({
// 处理操作 // 处理操作
showActionSheet() { showActionSheet() {
/**
*
// 用户标签key(district_party-区党委, district_dept-区直部门, street_party-街道党工委, street_dept-街道部门, community_party-社区党工委, grid_party-网格党支部) // 用户标签key(district_party-区党委, district_dept-区直部门, street_party-街道党工委, street_dept-街道部门, community_party-社区党工委, grid_party-网格党支部)
// 处理结果:0 回应,1 吹哨,5 关闭,10 结案 // 处理结果:0 回应,1 吹哨,5 关闭,10 结案
let buttons = [] let buttons = []
@ -81,41 +83,46 @@ Component({
text: '回应' text: '回应'
}] }]
} }
*/
const that = this const that = this
$wuxActionSheet().showSheet({ if (this.data.handleOperationsList.length > 0) {
// titleText: '自定义操作', const buttonList = []
buttons: buttons, that.data.handleOperationsList.forEach(item => {
buttonClicked(index, item) { buttonList.push({
let state = "" text: item.processName,
const text = item.text state: item.processResult
// 项目状态: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
}) })
return true })
}, $wuxActionSheet().showSheet({
cancelText: '取消', // titleText: '自定义操作',
cancel() {}, 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() { getItemWhistlingDept() {
api.getItemWhistlingDept().then(res => { api.getItemWhistlingDept().then(res => {
console.log(res.data); 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() { getItemEvaluationDept() {
api.getItemEvaluationDept(this.data.itemId).then(res => { api.getItemEvaluationDept(this.data.itemId).then(res => {
@ -325,12 +344,25 @@ Component({
that.setData({ that.setData({
handleSubmitData handleSubmitData
}) })
return true return true
}, },
cancelText: '取消', cancelText: '取消',
cancel() {}, cancel() {},
}) })
}, },
// 获取处理操作选项
getCategoryList () {
api.getItemHandleCategoryV2().then(res => {
console.log('处理操作选项', res)
this.setData({
handleOperationsList: res.data
})
}).catch(() => {
console.log('获取处理操作选项出错')
this.setData({
handleOperationsList: []
})
})
}
} }
}) })
Loading…
Cancel
Save