Commit 55179ae6 authored by huai.li's avatar huai.li

留言更新数据绑定

parent b4de2c0e
......@@ -27,5 +27,20 @@ export default {
// 删除待办事项
deleteSchedule: {
url: '/vue/schedule/delete' + urlEnd
},
// 留言
getCommentList: {
url: '/vue/comment/list' + urlEnd
},
// 留言新建
saveNewComment: {
url: '/vue/comment/save-new' + urlEnd
},
// 留言删除
deleteComment: {
url: '/vue/comment/delete' + urlEnd
}
}
......@@ -4,7 +4,7 @@
<div class="content">
<el-row>
<el-col :span="24">
<i class="fa fa-angle-double-right" @click.prevent="isShow"></i>
<i class="fa fa-angle-double-right" @click.prevent="isClose"></i>
</el-col>
<el-col :span="24" class="lm-content-leaveMessage">
<span>留言</span>
......@@ -15,48 +15,16 @@
<div class="titleBox">
<div class="commentText">
<div class="date sub-text">
<el-row :gutter="20">
<el-col :span="6"><span>客户名称:</span></el-col>
<el-col :span="18"><span>北京爱思泰尔技术开发有限责任公司</span></el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6"><span>内容:</span></el-col>
<el-col :span="18"><span>北京爱思泰尔技术开发有限责任公司</span></el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6"><span>待办时间:</span></el-col>
<el-col :span="18"><span>北京爱思泰尔技术开发有限责任公司</span></el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6"><span>状态:</span></el-col>
<el-col :span="18"><span>北京爱思泰尔技术开发有限责任公司</span></el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6"><span>开始时间:</span></el-col>
<el-col :span="18"><span>北京爱思泰尔技术开发有限责任公司</span></el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6"><span>结束时间:</span></el-col>
<el-col :span="18"><span>北京爱思泰尔技术开发有限责任公司</span></el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6"><span>重复:</span></el-col>
<el-col :span="18"><span>北京爱思泰尔技术开发有限责任公司</span></el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6"><span>负责人:</span></el-col>
<el-col :span="18"><span>北京爱思泰尔技术开发有限责任公司</span></el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6"><span>创建时间:</span></el-col>
<el-col :span="18"><span>北京爱思泰尔技术开发有限责任公司</span></el-col>
<el-row :gutter="20" v-for="(item, index) in lmTemplate">
<el-col :span="6"><span>{{ item.name }}</span></el-col>
<el-col :span="18"><span>{{ model[item.value] ? model[item.value] : item.default }}</span></el-col>
</el-row>
</div>
<form class="form-inline form-comment" role="form">
<div class="input-group">
<input type="text" class="form-control form-control-sm comment-input" placeholder="">
<input type="text" v-model="sendText" class="form-control form-control-sm comment-input" placeholder="">
<span class="input-group-btn">
<el-button size="mini">发送</el-button>
<el-button size="mini" @click.prevent="send">发送</el-button>
</span>
</div>
</form>
......@@ -64,13 +32,13 @@
</div>
<div class="actionBox">
<ul class="commentList">
<li>
<li v-for="item in result.list">
<div class="commenterImage">
<img />
</div>
<div class="commentText">
<div class="comment-title">
曹永生 2019-03-19 18:26:02
{{ item.created_by }} {{ item.created_at }}
<a href="#" class="addcomment">
<i class="fa fa-fw fa-commenting-o pull-right"></i>
</a>
......@@ -79,46 +47,30 @@
</a>
</div>
<div class="date sub-text">
1
{{ item.description }}
<form class="form-inline form-comment" role="form">
<div class="input-group">
<input type="text" class="form-control form-control-sm comment-input" placeholder="">
<span class="input-group-btn">
<el-button size="mini">回复</el-button>
<el-button size="mini" @click.prevent="send">回复</el-button>
</span>
</div>
</form>
</div>
<ul>
<li>
<li v-for="sItem in item.comments">
<div class="commenterImage">
<img />
</div>
<div class="commentText">
<div class="comment-title">
曹永生 2019-03-19 18:26:02
{{ sItem.created_by }} {{ sItem.created_at }}
<a href="#" class="addcomment">
<i class="fa fa-fw fa-commenting-o pull-right"></i>
</a>
</div>
<div class="date sub-text">
1
</div>
</div>
</li>
<li>
<div class="commenterImage">
<img />
</div>
<div class="commentText">
<div class="comment-title">
曹永生 2019-03-19 18:26:02
<a href="#" class="addcomment">
<i class="fa fa-fw fa-commenting-o pull-right"></i>
</a>
</div>
<div class="date sub-text">
1
{{ sItem.description }}
</div>
</div>
</li>
......@@ -134,18 +86,67 @@
</transition>
</template>
<script>
export default {
import {
requestWithJsonAPI,
api
} from '@/lib/commonMixin'
export default {
data () {
return {
is: false
is: false,
sendText: '',
model: {},
result: {}
}
},
props: {
lmTemplate: Array
},
mounted () {
},
methods: {
isShow () {
this.is = !this.is
isClose () {
this.is = false
},
isShow (item) {
this.is = true
this.model = Object.assign({}, item)
if (this.is) {
this.init()
}
},
send () {
requestWithJsonAPI(api.saveNewComment)
.then((res) => {
console.log(res)
})
},
del () {
requestWithJsonAPI(api.deleteComment)
.then((res) => {
console.log(res)
})
},
init () {
let params = {
object_type: 9,
object_id: 7578
}
requestWithJsonAPI(api.getCommentList, params)
.then((res) => {
this.result = res
console.log(res)
})
}
}
}
</script>
<style scoped lang="scss">
.pull-right {
......@@ -243,7 +244,8 @@
position: fixed;
top: 100px;
right: 0;
height: 100%;
bottom:0;
// height: 100%;
width: 60%;
background-color:#333744;
color: white;
......
......@@ -20,7 +20,7 @@
:item="item"
:key="item.id">
<span slot="opearate" class="obear-opearate-button">
<el-button type="primary" size="mini" @click="leaveMessageSch"><i class="fa fa-commenting"></i>留言</el-button>
<el-button type="primary" size="mini" @click="leaveMessageSch(item)"><i class="fa fa-commenting"></i>留言</el-button>
<el-button type="primary" size="mini"><i class="fa fa-calendar-check-o"></i>汇报</el-button>
<el-button type="primary" size="mini" @click="editSch(item)"><i class="fa fa-edit animated"></i>编辑</el-button>
<el-button type="primary" size="mini" @click="deleteSch(item.id)"><i class="fa fa-trash-o animated-hove"></i>删除</el-button>
......@@ -30,7 +30,10 @@
:pager.sync="result.pagenation"
:total="result.pagenation.totalcount">
</Pagenation>
<leave-message ref="leaveMessage"></leave-message>
<leave-message
ref="leaveMessage"
:lmTemplate="lmTemplate">
</leave-message>
</div>
</div>
<ScheduleModal ref="scheduleModal"></ScheduleModal>
......@@ -62,6 +65,45 @@ export default {
data () {
return {
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: 'repeatSchedule'
},
{
name: '负责人',
value: 'repeatSchedule'
},
{
name: '创建时间',
value: 'created_at'
}
],
filter: [],
result: {
list: [],
......@@ -104,8 +146,8 @@ export default {
})
},
leaveMessageSch () {
this.$refs.leaveMessage.isShow()
leaveMessageSch (item) {
this.$refs.leaveMessage.isShow(item)
},
addSch () {
......
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