[FIX]客户管理-客户列表-事件列表内容显示更改

This commit is contained in:
yuweiqi
2020-01-14 13:28:00 +08:00
parent 4cce927327
commit 05a8c9f7c1

View File

@@ -1,175 +1,167 @@
<template>
<div class="milestone pb45">
<van-list
v-model="loading"
:immediate-check="false"
:finished="finished"
:finished-text="finishedText"
@load="onLoad"
v-if="list.length > 0"
>
<div >
<div class="bg-white radius5 mh15 pr15 pl10 mb20 mt5 pt10 fs14" v-for="(item,index) in list" :key="index">
<van-row class="card-row">
<van-col span="6" >提醒日期</van-col>
<van-col span="18" >{{item.noticeDate}} </van-col>
</van-row>
<van-row class="card-row">
<van-col span="6" >提醒时间</van-col>
<van-col span="18" >{{item.noticeTime}} </van-col>
</van-row>
<van-row class="card-row">
<van-col span="6" >时间内容</van-col>
<van-col span="18" class="product">{{item.eventContent}} </van-col>
</van-row>
<van-row class="card-row">
<van-col span="6" >提醒状态</van-col>
<van-col span="18" :class="item.noticeStatus=='01'?'remind':'not'">{{item.noticeStatus=='00'?'未到提醒时间':item.noticeStatus=='01'?'已提醒':'提醒异常'}} </van-col>
</van-row>
<van-row class="text-right pv5 card-title">
<van-button type="danger" @click="edit(item)" size="small" class="mr5" round>编辑</van-button>
<van-button type="danger" plain @click="del(item)" size="small" class="mr5" round>删除</van-button>
</van-row>
<van-list v-model="loading" :immediate-check="false" :finished="finished" :finished-text="finishedText" @load="onLoad" v-if="list.length > 0">
<div>
<div class="bg-white radius5 mh15 pr15 pl10 mb20 mt5 pt10 fs14" v-for="(item, index) in list" :key="index">
<van-row class="card-row">
<van-col span="6">提醒日期</van-col>
<van-col span="18">{{ item.noticeDate }} </van-col>
</van-row>
<van-row class="card-row">
<van-col span="6">提醒时间</van-col>
<van-col span="18">{{ item.noticeTime }} </van-col>
</van-row>
<van-row class="card-row">
<van-col span="6">事件内容</van-col>
<van-col span="18" class="product">{{ item.eventContent }} </van-col>
</van-row>
<van-row class="card-row">
<van-col span="6">提醒状态</van-col>
<van-col span="18" :class="item.noticeStatus == '01' ? 'remind' : 'not'"
>{{ item.noticeStatus == '00' ? '未到提醒时间' : item.noticeStatus == '01' ? '已提醒' : '提醒异常' }}
</van-col>
</van-row>
<van-row class="text-right pv5 card-title">
<van-button type="danger" @click="edit(item)" size="small" class="mr5" round>编辑</van-button>
<van-button type="danger" plain @click="del(item)" size="small" class="mr5" round>删除</van-button>
</van-row>
</div>
</div>
</div>
</van-list>
<div v-else class="text-center">
<img class="mt40" src="@/assets/images/pic_page-non.png" />
<div class="fs17 mt40">暂无重要事件</div>
</div>
<img class="mt40" src="@/assets/images/pic_page-non.png" />
<div class="fs17 mt40">暂无重要事件</div>
</div>
<van-button type="danger" @click="addMilestone" class="bottom-btn fs16">新增事件</van-button>
</div>
</template>
<script>
import { getEvent, deleteEvent} from '@/api/ebiz/milestone/milestone.js'
import { Dialog, List,Toast,Row, Col,} from 'vant'
export default {
name: 'milestoneList',
components: {
[List.name]: List,
[Row.name]: Row,
[Col.name]: Col,
},
data(){
return{
list:[],
loading: false,
finished: false,
pageNum:1,
finishedText: '没有更多了',
import { getEvent, deleteEvent } from '@/api/ebiz/milestone/milestone.js'
import { Dialog, List, Toast, Row, Col } from 'vant'
export default {
name: 'milestoneList',
components: {
[List.name]: List,
[Row.name]: Row,
[Col.name]: Col
},
data() {
return {
list: [],
loading: false,
finished: false,
pageNum: 1,
finishedText: '没有更多了'
}
},
mounted() {
this.onLoad()
},
methods: {
onLoad() {
let $this = this
let data = {
token: localStorage.getItem('token'),
pageSize: '10',
pageNum: $this.pageNum,
customerNumber: localStorage.getItem('customerNumber') //客户号
}
},
mounted(){
this.onLoad()
},
methods:{
onLoad() {
let $this = this
let data = {
token: localStorage.getItem('token'),
pageSize: '10',
pageNum: $this.pageNum,
customerNumber: localStorage.getItem('customerNumber'),//客户号
}
getEvent(data)
.then(res => {
if (res.result == 0) {
$this.pageNum++
let list = res.content.list
list.forEach(item => {
item.noticeTime=item.noticeTime.split(':')[0]+':'+item.noticeTime.split(':')[1]
});
$this.list = $this.list.concat(list)
if ($this.list.length < res.content.total) {
$this.loading = false
$this.finished = false
} else {
$this.finished = true
$this.loading = false
}
getEvent(data)
.then(res => {
if (res.result == 0) {
$this.pageNum++
let list = res.content.list
list.forEach(item => {
item.noticeTime = item.noticeTime.split(':')[0] + ':' + item.noticeTime.split(':')[1]
})
$this.list = $this.list.concat(list)
if ($this.list.length < res.content.total) {
$this.loading = false
$this.finished = false
} else {
$this.finished = true
$this.loading = false
}
})
.catch(err => {})
},
edit(item){
localStorage.setItem('milestone', JSON.stringify(item))
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/milestone/edit'
},
routerInfo: {
path: '/milestone/edit'
}
})
// item=encodeURIComponent(JSON.stringify(item))
// this.$jump({
// flag: 'h5',
// extra: {
// url: location.origin + `/#/milestone/edit?item=${item}`,
// needRefresh: '1'
// },
// routerInfo: {
// path: `/milestone/edit?item=${item}`
// }
// })
},
addMilestone() {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/milestone/add'
},
routerInfo: {
path: '/milestone/add'
}
})
},
del(item){
let data = {
token:localStorage.getItem('token'),
eventDTO:{
id : item.id
}
.catch(err => {})
},
edit(item) {
localStorage.setItem('milestone', JSON.stringify(item))
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/milestone/edit'
},
routerInfo: {
path: '/milestone/edit'
}
Dialog.confirm({
message: '是否确认删除?',
})
})
// item=encodeURIComponent(JSON.stringify(item))
// this.$jump({
// flag: 'h5',
// extra: {
// url: location.origin + `/#/milestone/edit?item=${item}`,
// needRefresh: '1'
// },
// routerInfo: {
// path: `/milestone/edit?item=${item}`
// }
// })
},
addMilestone() {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/milestone/add'
},
routerInfo: {
path: '/milestone/add'
}
})
},
del(item) {
let data = {
token: localStorage.getItem('token'),
eventDTO: {
id: item.id
}
}
Dialog.confirm({
message: '是否确认删除?'
})
.then(() => {
deleteEvent(data).then(res=>{
if(res.result==0){
deleteEvent(data).then(res => {
if (res.result == 0) {
this.pageNum = 1
this.list=[]
this.list = []
;[this.loading, this.finished] = [true, false]
this.onLoad()
}else{
} else {
this.$toast(res.resultMessage)
}
})
})
.catch(() => {})
}
}
}
}
</script>
<style scoped>
.card-row{
line-height: 8vw;
padding: 0 0.1rem;
box-sizing: border-box;
}
.not{
color: red;
}
.remind{
color: rgb(117, 184, 17)
}
.card-title{
border-top:1px solid #dfdfdf;
}
.card-row {
line-height: 8vw;
padding: 0 0.1rem;
box-sizing: border-box;
}
.not {
color: red;
}
.remind {
color: rgb(117, 184, 17);
}
.card-title {
border-top: 1px solid #dfdfdf;
}
</style>