Commit 8c437984 authored by huai.li's avatar huai.li

添加汇报功能

parent 8347f1ac
......@@ -43,5 +43,9 @@ export default {
// 留言删除
deleteComment: {
url: '/vue/comment/delete'
},
fulfill: {
url: '/vue/schedule/fulfill'
}
}
<template>
<section>
<sidePopup ref="reportSidePopup" title="汇报" :width="40">
<section class="ec-page-wrapper" style="overflow: hidden; padding-bottom: 0px;">
<el-form label-width="120px" ref="form" :rules="rules" :model="model" class="ec-create-form">
<el-form-item label="待办事项内容" prop="schedule_title" class="ec-clear-left ec-form-item-lg is-required">
{{ model.schedule_title }}
</el-form-item>
<el-form-item label="状态" prop="is_complete" class="ec-clear-left is-required">
<single-radio
:form-item="model.is_complete"
:options-list="is_public_array"
@update:item="val => {model.is_complete = val}">
</single-radio>
</el-form-item>
<el-form-item label="情况说明" prop="complete_description" class="ec-clear-left ec-form-item-lg is-required">
<el-input
class="ec-input-normal"
type="textarea"
:rows="2"
v-model.trim="model.complete_description">
</el-input>
</el-form-item>
</el-form>
</section>
<div class="mt20" style="margin-left: 150px;">
<el-button type="cancel" @click.stop.prevent="handleClose" size="mini">取 消</el-button>
<el-button type="confirm" @click.stop.prevent="save" size="mini">确 定</el-button>
</div>
</sidePopup>
</section>
</template>
<script>
import {
requestAPI,
api
} from '@/lib/commonMixin'
import { setModule } from '@/lib/viewHelper'
import singleRadio from '../common/singleRadio'
import settingMixin from '../common/settingMixin'
export default {
mixins: [settingMixin],
components: {
singleRadio
},
data () {
return {
diaVis: false,
model: {
id: '',
schedule_title: '',
is_complete: 'true',
complete_description: '' // 负责人
},
is_public_array: [
{
'name': '已完成',
'key': true
},
{
'name': '未完成',
'key': false
}
]
}
},
methods: {
show (model) {
this.model.id = model.id
this.model.schedule_title = model.schedule_title
this.$refs.reportSidePopup.show()
},
handleClose () {
Object.keys(this.model).forEach(item => {
this.model[item] = ''
})
this.model['is_complete'] = 'true'
this.$refs.reportSidePopup.close()
},
save () {
let _params = Object.assign({}, setModule(this.model, 'Schedules'))
delete _params['Schedules[schedule_title]']
requestAPI(Object.assign(api.fulfill, { method: 'POST' }), _params)
.then((res) => {
this.$refs.reportSidePopup.close()
this.$message.success('操作成功')
this.$parent.reload()
})
}
}
}
</script>
<style lang="scss" scoped>
</style>
......@@ -22,7 +22,7 @@
:key="item.id">
<span slot="opearate" class="obear-opearate-button">
<el-button type="primary" size="mini" @click.prevent.stop="leaveMessageSch(item)"><span class="badge" v-if="item.commentCount.comment">{{ item.commentCount.comment ? item.commentCount.comment : '' }}</span><i class="fa fa-commenting"></i>留言</el-button>
<el-button type="primary" size="mini" @click.prevent.stop="editSch(item)" :disabled="!item.can_report"><i class="fa fa-calendar-check-o"></i>汇报</el-button>
<el-button type="primary" size="mini" @click.prevent.stop="reportSch(item)" :disabled="!item.can_report"><i class="fa fa-calendar-check-o"></i>汇报</el-button>
<el-button type="primary" size="mini" @click.prevent.stop="editSch(item)" :disabled="!item.can_update"><i class="fa fa-edit animated"></i>编辑</el-button>
<el-button type="primary" size="mini" @click.prevent.stop="deleteSch(item.id)" :disabled="!item.can_delete"><i class="fa fa-trash-o animated-hove"></i>删除</el-button>
</span>
......@@ -43,6 +43,9 @@
ref="scheduleModal"
v-click-outside="scheduleClose">
</ScheduleModal>
<ReportModal
ref="reportModal">
</ReportModal>
</section>
</template>
......@@ -55,6 +58,7 @@ import LeaveMessage from '../common/leaveMessage'
import Pagenation from './schedulePagenation'
import clickOutside from '@/lib/bind'
import SetParams from '../common/setParams'
import ReportModal from '../schedule/reportModal'
import {
requestAPI,
api
......@@ -70,7 +74,8 @@ export default {
ScheduleItem,
ScheduleModal,
LeaveMessage,
Pagenation
Pagenation,
ReportModal
},
directives: {
......@@ -217,6 +222,10 @@ export default {
this.$refs.scheduleModal.show(item)
},
reportSch (item) {
this.$refs.reportModal.show(item)
},
deleteSch (id) {
this.$confirm('删除该待办事项?', '提示', {
confirmButtonText: '确定',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment