|
@ -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: [] |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |