Browse Source

Merge remote-tracking branch 'origin/feature/projectProcessProgress'

master
liuchuang 4 years ago
parent
commit
7c0b005a25
  1. 338
      src/views/modules/events/edit-process-progress.vue
  2. 209
      src/views/modules/events/item-process-progress-list.vue

338
src/views/modules/events/edit-process-progress.vue

@ -0,0 +1,338 @@
<template>
<el-dialog :visible.sync="visible" title="处理进展" :close-on-click-modal="false" :close-on-press-escape="false">
<div v-for="(item,index) in processProgress" :key="index">
<el-form :model="item" ref="item" :label-width="$i18n.locale === 'en-US' ? '120px' : '120px'" style="padding-bottom: 60px">
<div style="padding-bottom: 20px">
<div
:style="{marginBottom: '10px', width: '35px', height: '20px', fontSize: '12px', borderRadius: '4px', background: item.handleType === 'project' || item.handleType === 'project-evaluation' ? '#009688': item.handleType === 'issue' || item.handleType === 'issue-project' || item.handleType === 'event-issue' ? '#ffa546' : item.handleType === 'event' || item.handleType === 'event-issue'? '#46A3FF' : '', color: '#fff', textAlign: 'center', lineHeight: '20px'}"
style="display: inline-block !important">
{{item.handleType === 'project' || item.handleType === 'project-evaluation' ? '项目': item.handleType === 'issue' || item.handleType === 'issue-project' || item.handleType === 'event-issue' ? '议题' : item.handleType === 'event' ? '事件' : ''}}
</div>
<span style="padding-left: 36px; font-weight: bold; color: rgb(96, 98, 102);">[ {{item | formatState}} ]</span>
<span v-if="item.handleType != 'event' && item.handleType != 'project-evaluation'" style="padding-left: 36px">处理部门 {{item.handlerDept}}</span>
<span v-if="item.handleType === 'event'" style="padding-left: 36px">事件内容 {{item.eventContent}}</span>
</div>
<el-form-item :label="item.handleType != 'event' ? '操作时间' : '发布时间'">
<el-date-picker v-model="item.createdTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd HH:mm:ss"
:clearable="false"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item label="评价得分" v-if="item.handleType === 'project-evaluation'">
<el-rate v-model="item.evaluationScore" show-text :texts="rateText" :max="3">
</el-rate>
</el-form-item>
<el-form-item :label="item.handleType === 'project' || item.handleType === 'issue-project' ? '项目处理意见' : item.handleType === 'project-evaluation' ? '评价内容' :'意见'" v-if="item.handleType != 'event'">
<el-input v-model="item.advice" maxlength="100" show-word-limit></el-input>
</el-form-item>
<el-form-item :label="item.handleType === 'project' || item.handleType === 'issue-project' ? '项目处理图片' : '图片'" v-if="item.handleType != 'event' && item.handleType != 'project-evaluation'">
<el-upload list-type="picture-card"
:limit=3
:action="uploadUrl"
:file-list="item.images"
:on-exceed="handleExceed"
:on-success="(res, file, fileList) => { return handlePicSuccess(res, file, fileList, index, 'image')}"
:on-remove="(file, fileList) => { return handleRemove(file, fileList, index, 'image')}">
<i slot="default" class="el-icon-plus"></i>
</el-upload>
</el-form-item>
<el-form-item label="回复居民意见" v-if="item.handleType != 'event' && item.handleType != 'event-issue' && item.handleType != 'issue' && item.handleType != 'project-evaluation'">
<el-input v-model="item.outAdvice" maxlength="500" show-word-limit></el-input>
</el-form-item>
<el-form-item label="回复居民图片" v-if="item.handleType != 'event' && item.handleType != 'event-issue' && item.handleType != 'issue' && item.handleType != 'project-evaluation'">
<el-upload list-type="picture-card"
:limit=3
:action="uploadUrl"
:file-list="item.outImages"
:on-exceed="handleExceed"
:on-success="(res, file, fileList) => { return handlePicSuccess(res, file, fileList, index, 'outImage')}"
:on-remove="(file, fileList) => { return handleRemove(file, fileList, index, 'outImage')}">
<i slot="default" class="el-icon-plus"></i>
</el-upload>
</el-form-item>
</el-form>
</div>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" :disabled = "isDisabled" :loading="isLoading" @click="validateTime()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import Cookies from 'js-cookie'
import 'element-ui/lib/theme-chalk/timeline.css'
import 'element-ui/lib/theme-chalk/timeline-item.css'
import 'element-ui/lib/theme-chalk/image.css'
import debounce from 'lodash/debounce'
export default {
data () {
return {
visible: false,
dataForm: {
id: ''
},
uploadUrl: '',
//
processProgress: [],
isDisabled: false,
isLoading: false,
rateText: [
'不满意',
'基本满意',
'非常满意'
],
iconClasses: ['icon-rate-face-1', 'icon-rate-face-2', 'icon-rate-face-3']
}
},
filters: {
formatState (item) {
if (item.handleType === 'project') {
if (item.state === 0 && item.itemDeptDTOS && item.itemDeptDTOS.length > 0) {
item.stateName = '吹哨'
return '吹哨'
} else if (item.state === 0 && item.itemDeptDTOS && item.itemDeptDTOS.length === 0) {
item.stateName = '回应'
return '回应'
} else if (item.state === 5) {
item.stateName = '关闭'
return '关闭'
} else if (item.state === 10) {
item.stateName = '结案'
return '结案'
}
} else if (item.handleType === 'issue' || item.handleType === 'event-issue') {
if (item.state === 0) {
item.stateName = '审核通过'
return '审核通过'
} else if (item.state === 1) {
item.stateName = '回应'
return '回应'
} else if (item.state === 2) {
item.stateName = '关闭'
return '关闭'
} else if (item.state === 3) {
item.stateName = '转议题'
return '转议题'
}
} else if (item.handleType === 'issue-project') {
item.stateName = '转项目'
return '转项目'
} else if (item.handleType === 'event') {
item.stateName = '事件发布'
return '事件发布'
} else if (item.handleType === 'project-evaluation') {
item.stateName = '满意度评价'
return '满意度评价'
}
}
},
methods: {
init () {
this.$nextTick(() => {
this.visible = true
//
this.isDisabled = false
this.isLoading = false
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
if (this.dataForm.id) {
this.getInfo()
}
})
},
validateTime () {
var flag = true
this.processProgress.forEach((item, index, arr) => {
if (index < arr.length - 1 && arr[index].createdTime <= arr[index + 1].createdTime) {
flag = false
return this.$message.error(' [' + arr[index].stateName + '] 的操作时间应在 [' + arr[index + 1].stateName + '] 的时间之后')
}
})
if (flag) {
this.dataFormSubmitHandle()
}
},
getInfo () {
this.$http.get(`/events/item/getProcessProgress/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.processProgress = res.data
}).catch(() => {})
},
//
handlePicSuccess (res, file, fileList, index, imgType) {
let image = {}
image.name = Math.round(Math.random() * 5)
image.url = res.data.url
if (imgType === 'outImage') {
this.processProgress[index].outImages.push(image)
} else if (imgType === 'image') {
this.processProgress[index].images.push(image)
}
},
handleRemove (file, fileList, index, imgType) {
if (imgType === 'outImage') {
this.processProgress[index].outImages = fileList
} else if (imgType === 'image') {
this.processProgress[index].images = fileList
}
},
handleExceed () {
this.$message({
showClose: true,
message: '只能上传三张图片',
type: 'warning'
})
},
dataFormSubmitHandle: debounce(function () {
this.isLoading = true
this.isDisabled = true
this.$http['post']('/events/item/editProcessProgressList/', this.processProgress).then(({ data: res }) => {
if (res.code !== 0) {
//
this.isDisabled = false
this.isLoading = false
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {})
}, 1000, { 'leading': true, 'trailing': false })
}
}
</script>
<style lang="scss">
.project-handle {
.el-timeline {
padding-left: 9px;
font-size: 13px;
}
}
.el-form-item__label {
font-weight: bold;
}
</style>
<style lang="scss" scoped>
.project-handle {
width: 100%;
height: calc(100vh - 120px);
background: #ffffff;
box-sizing: border-box;
padding: 10px;
.project-detail {
width: 79%;
height: 80%;
border: 2px solid #ccc;
box-sizing: border-box;
padding: 10px;
float:left;
margin-bottom: 1%;
position: relative;
padding-top: 20px;
.project-detail-tip {
position: absolute;
top: 0;
left:0;
width: 80px;
height: 30px;
line-height: 30px;
color: #ffffff;
background: #4ac38b;
text-align:center;
}
.el-form {
width: 58%;
height: 100%;
float:left;
overflow-y:auto;
&::-webkit-scrollbar {
width: 5px;
height: 1px;
}
&::-webkit-scrollbar-thumb {
border-radius: 5px;
background: #aaa;
}
&::-webkit-scrollbar-track {
border-radius: 10px;
background: #fff;
}
}
.container {
width: 40%;
height: 80%;
float: right;
.location {
height: 30px;
line-height: 30px;
}
#map {
width: 100%;
height: calc(100% - 30px);
}
}
}
.project-progress {
width: 20%;
height: 80%;
float: right;
border: 2px solid #ccc;
box-sizing: border-box;
margin-left: 1%;
padding-top: 20px;
overflow-y:auto;
position: relative;
padding-top: 40px;
.project-progress-tip {
position: absolute;
top: 0;
left:0;
width: 80px;
height: 30px;
line-height: 30px;
color: #ffffff;
background: #0098ff;
text-align:center;
}
&::-webkit-scrollbar {
width: 5px;
height: 1px;
}
&::-webkit-scrollbar-thumb {
border-radius: 5px;
background: #aaa;
}
&::-webkit-scrollbar-track {
border-radius: 10px;
background: #ccc;
}
}
.handle-operation {
width: 79%;
height: 49%;
box-sizing: border-box;
border: 2px solid #ccc;
float:left;
}
}
</style>
<style lang="scss" scoped>
/deep/ .el-rate__icon {
font-size: 34px;
margin-right: 40px;
}
</style>

209
src/views/modules/events/item-process-progress-list.vue

@ -0,0 +1,209 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-item__item}">
<el-form
:inline="true"
:model="dataForm"
@keyup.enter.native="getDataList()"
>
<el-form-item label="所属机构">
<el-cascader
v-model="ids"
:options="options"
:props="{ checkStrictly: true }"
clearable
>
</el-cascader>
</el-form-item>
<el-form-item label="项目内容" prop="itemContent">
<el-input
v-model="dataForm.itemContent"
placeholder="请输入项目内容"
clearable
></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
</el-form>
<el-table
v-loading="dataListLoading"
:data="dataList"
border
@selection-change="dataListSelectionChangeHandle"
style="width: 100%;"
>
<el-table-column
label="序号"
type="index"
show-overflow-tooltip
align="center"
width="50"
></el-table-column>
<el-table-column
prop="grid"
label="所属网格"
header-align="center"
min-width="400"
align="left"
></el-table-column>
<el-table-column
prop="itemState"
label="项目状态"
header-align="center"
min-width="400"
align="left"
:formatter="showItemStateNameFormatter"
></el-table-column>
<el-table-column
show-overflow-tooltip
prop="itemContent"
label="项目内容"
header-align="center"
min-width="400"
align="left"
></el-table-column>
<el-table-column
prop="nickName"
label="提交人"
header-align="center"
width="150"
align="center"
show-overflow-tooltip
></el-table-column>
<el-table-column
:label="$t('handle')"
fixed="right"
header-align="center"
align="center"
width="150"
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="editAction(scope.row.id)"
>编辑处理进展</el-button
>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle"
>
</el-pagination>
<edit-process-progress
v-if="editVisible"
ref="editProcessProgress"
@refreshDataList="getDataList"
></edit-process-progress>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import editProcessProgress from './edit-process-progress'
export default {
mixins: [mixinViewModule],
name: 'ItemCloseList',
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/events/item/page',
getDataListIsPage: true
},
dataForm: {
id: '',
itemState: '',
startTime: '',
endTime: '',
streetId: '',
communityId: '',
gridId: '',
itemCode: '',
itemContent: ''
},
ids: [],
options: [],
editVisible: false,
itemStateOptions: [{
value: '0',
label: '处理中'
},
{
value: '5',
label: '已关闭'
}, {
value: '10',
label: '已结案'
}]
}
},
components: {
editProcessProgress
},
created: function () {
this.getOptions()
},
watch: {
ids: function (val) {
if (val.length === 0) {
this.dataForm.streetId = ''
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (val.length === 1) {
this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = ''
this.dataForm.gridId = ''
}
if (val.length === 2) {
this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = ''
}
if (val.length === 3) {
this.dataForm.streetId = this.ids[0]
this.dataForm.communityId = this.ids[1]
this.dataForm.gridId = this.ids[2]
}
}
},
methods: {
showItemStateNameFormatter: function (row, column) {
if (row.itemState) {
let dict = this.itemStateOptions.filter(item => item.value === row.itemState)[0]
if (dict) {
return dict.label
}
}
return ''
},
editAction (id) {
this.editVisible = true
this.$nextTick(() => {
this.$refs.editProcessProgress.dataForm.id = id
this.$refs.editProcessProgress.init()
})
},
getOptions () {
this.$http
.get(`/sys/user/deptOptions/getByLoginUser`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data.options
})
.catch(() => {})
}
}
}
</script>
Loading…
Cancel
Save