Commit 3e620ed6 authored by huai.li's avatar huai.li

点击客户信息跳转页面

parent 9bf7aab3
...@@ -47,5 +47,9 @@ export default { ...@@ -47,5 +47,9 @@ export default {
fulfill: { fulfill: {
url: '/vue/schedule/fulfill' url: '/vue/schedule/fulfill'
},
getScheduleListByClient: {
url: '/vue/schedule/of-client'
} }
} }
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<el-col :span="4" :xs="24" class="obear-schedule-left" :style="{background: item.bgcolor}"> <el-col :span="4" :xs="24" class="obear-schedule-left" :style="{background: item.bgcolor}">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="24"> <el-col :span="24">
<router-link :to="{ app: 'client', name: 'viewClient', params: {id: item.client_id} }"> <router-link :to="{ path: '/scheduleView/' + item.client_id }">
<i class="fa fa-star" aria-hidden="true"></i>{{ isNullClient ? '客户名称(未设置)' : item.client.name }} <i class="fa fa-star" aria-hidden="true"></i>{{ isNullClient ? '客户名称(未设置)' : item.client.name }}
</router-link> </router-link>
</el-col> </el-col>
......
<template>
<section>
<div class="content">
<div>
<el-row :gutter="10" class="header-title">
<el-col :span="12">
<h2>客户名称:{{ result.list[0] && result.list[0].client.name }}</h2>
</el-col>
</el-row>
</div>
<div class="page-body-content">
<client-nav :trigger="addSchedule" trigger-text="新建待办事项"></client-nav>
<ScheduleItem
v-for="item in result.list"
:item="item"
: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="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>
</ScheduleItem>
<Pagenation
@update:pager="pager => {updatePage(pager)}"
:total="result.pagenation.totalcount">
</Pagenation>
<leave-message
ref="leaveMessage"
:lmTemplate="lmTemplate"
:type="9">
</leave-message>
</div>
</div>
<ScheduleModal
ref="scheduleModal">
</ScheduleModal>
</section>
</template>
<script>
import ScheduleModal from '../schedule/scheduleModal'
import ScheduleItem from './scheduleItem'
import LeaveMessage from './leaveMessage'
import Pagenation from '../schedule_list/schedulePagenation'
import {
requestAPI,
api
} from '@/lib/commonMixin'
export default {
components: {
ScheduleModal,
ScheduleItem,
LeaveMessage,
Pagenation
},
data () {
return {
id: '',
pagenation: {
thispage: 1,
pagesize: 10
},
lmTemplate: [
{
name: '客户名称',
value: 'client.name',
default: '未设置'
},
{
name: '内容',
value: 'description'
},
{
name: '待办时间',
value: 'schedule_week_display'
},
{
name: '状态',
value: 'schedule_status_display'
},
{
name: '开始时间',
value: 'start_at'
},
{
name: '结束时间',
value: 'end_at'
},
{
name: '重复',
value: 'repeat_type_display'
},
{
name: '负责人',
value: 'scheduleCreator.name'
},
{
name: '创建时间',
value: 'created_at'
}
],
result: {
list: [],
pagenation: {
totalcount: 1,
thispage: 1,
pagesize: 10
},
thisUser: {
id: '',
name: '',
sex: ''
}
}
}
},
created () {
this.init()
},
methods: {
init () {
let id = this.id = this.$route.params.id
this.getScheduleList({
id,
page: this.pagenation.thispage
})
},
reload () {
this.getScheduleList({
id: this.id
})
},
updatePage (pager) {
let ret = Object.assign({}, {
id: this.id,
page: this.pagenation.thispage
}, {page: pager.thispage})
this.getScheduleList(ret)
},
getScheduleList (ret) {
requestAPI(api.getScheduleListByClient, ret).then((res) => {
const {
list = [],
pagenation = {},
thisUser = {}
} = res
this.result.list = list
this.result.pagenation = pagenation
this.result.thisUser = thisUser
})
},
addSchedule () {
this.$refs.scheduleModal.show()
},
leaveMessageSch (item) {
this.$refs.leaveMessage.isShow(item)
},
editSch (item) {
this.$refs.scheduleModal.show(item)
},
reportSch (item) {
this.$refs.reportModal.show(item)
},
deleteSch (id) {
this.$confirm('删除该待办事项?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestAPI(api.deleteSchedule, { id })
.then((res) => {
this.$message.success('删除成功')
this.reload()
})
}).catch(() => {
this.$message.info('取消删除')
})
}
}
}
</script>
<style scoped lang="scss">
@include c('opearate-button') {
> .el-button {
margin-right:0px;
}
& .btn-primary .badge {
color: #333744;
background-color: #fff;
}
& .badge {
position: relative;
top: 0px;
left: -5px;
display: inline-block;
padding: 0px 5px;
font-size: 12px;
font-weight: 700;
line-height: 1;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: .25rem;
background:white;
color:#333744;
}
i {
display: inline-block;
padding-right: 3px;
}
}
</style>
...@@ -48,6 +48,7 @@ export default { ...@@ -48,6 +48,7 @@ export default {
data () { data () {
return { return {
rules: {},
diaVis: false, diaVis: false,
model: { model: {
id: '', id: '',
......
...@@ -66,8 +66,8 @@ export default { ...@@ -66,8 +66,8 @@ export default {
requestAPI(Object.assign(_apiUrl, { method: 'POST' }), _params) requestAPI(Object.assign(_apiUrl, { method: 'POST' }), _params)
.then((res) => { .then((res) => {
this.$refs.scheduleSidePopup.close() this.$refs.scheduleSidePopup.close()
this.$parent.reload()
this.$message.success('操作成功') this.$message.success('操作成功')
this.$parent.reload()
}) })
} }
} }
......
import ScheduleHome from '../components/schedule_list/scheduleHome' import ScheduleHome from '../components/schedule_list/scheduleHome'
import ScheduleView from '../components/common/scheduleView'
const routes = [{ const routes = [{
path: '/scheduleHome', path: '/scheduleHome',
name: 'scheduleHome', name: 'scheduleHome',
component: ScheduleHome component: ScheduleHome
}, {
path: '/scheduleView/:id',
name: 'scheduleView',
component: ScheduleView
}] }]
export default routes export default routes
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