Browse Source

feat(market): 添加客户信息修改记录功能

- 新增编辑客户信息记录页面,记录客户信息的修改历史
- 在客户详情页面添加修改记录按钮,跳转到修改记录页面
- 实现修改记录列表的加载和分页功能
master
liutong 10 months ago
parent
commit
fbbd254e58
  1. 9
      pages.json
  2. 15
      pages/market/clue/clue_info.vue
  3. 266
      pages/market/clue/edit_clues_log.vue
  4. 8
      pages/market/clue/index.vue

9
pages.json

@ -439,6 +439,15 @@
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/market/clue/edit_clues_log",
"style": {
"navigationBarTitleText": "修改记录",
"navigationStyle": "default",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/market/clue/clue_info",

15
pages/market/clue/clue_info.vue

@ -258,9 +258,9 @@
<!-- 底部按钮组-->
<view class="bottom-label">
<view @click="openEditClues()">编辑详情</view>
<view @click="openViewEditClues()">编辑详情</view>
<view @click="callTel(clientInfo.student_phone)">拨打电话</view>
<view @click="openViewNewTask()">修改记录</view>
<view @click="openViewEditCluesLog()">修改记录</view>
</view>
</view>
</view>
@ -359,12 +359,21 @@
})
},
//-
openEditClues(){
openViewEditClues(){
let resource_sharing_id = this.resource_sharing_id//id
uni.navigateTo({
url: `/pages/market/clue/edit_clues?resource_sharing_id=${resource_sharing_id}`
})
},
//-
openViewEditCluesLog() {
let resource_id = this.clientInfo.resource_id
uni.navigateTo({
url: `/pages/market/clue/edit_clues_log?resource_id=${resource_id}`
})
},
//-
openViewNewTask() {
uni.navigateTo({

266
pages/market/clue/edit_clues_log.vue

@ -0,0 +1,266 @@
<!--编辑客户-->
<template>
<view class="assemble">
<scroll-view
scroll-y="true"
:lower-threshold="lowerThreshold"
@scrolltolower="loadMoreData"
style="margin-top:40rpx;height: 88vh;"
>
<!--时间轴-->
<view class="table_list">
<fui-timeaxis background="#fff" :padding="['36rpx','16rpx']">
<fui-timeaxis-node
:lineColor="k<3?v.activeColor:'#ccc'"
:lined="k!==tableList.length-1"
v-for="(v,k) in tableList"
:key="k"
>
<!--inco-->
<view
class="fui-node"
:style="{borderColor:(k != tableList.length-1 ? '#465CFF' :'' ) }"
>
</view>
<template v-slot:right>
<view
class="fui-process__node table_itme"
:style="{paddingBottom:(k !== tableList.length-1 ? '50rpx' :'0rpx')}"
:class="{'fui-node__pb':k!==tableList.length-1}"
>
<view class="fui-title">
2025-04-01 23:05:05
</view>
<view class="itme_box">
<view class="title_name">修改人张三 修改了如下内容</view>
<table class="table_box">
<!-- 自定义表头 -->
<thead>
<tr>
<th style="width: 30%; border: 1px solid #ddd; padding: 12rpx;">字段名称</th>
<th style="width: 35%; border: 1px solid #ddd; padding: 12rpx;">原数据</th>
<th style="width: 35%; border: 1px solid #ddd; padding: 12rpx;">新数据</th>
</tr>
</thead>
<!-- 自定义每一行数据 -->
<tbody>
<tr v-for="(row, index) in customTableData" :key="index">
<td style="border: 1px solid #ddd; padding: 12rpx;">{{ row.field }}</td>
<td style="border: 1px solid #ddd; padding: 12rpx;">{{ row.oldValue }}</td>
<td style="border: 1px solid #ddd; padding: 12rpx;">{{ row.newValue }}</td>
</tr>
</tbody>
</table>
</view>
</view>
</template>
</fui-timeaxis-node>
</fui-timeaxis>
</view>
</scroll-view>
</view>
</template>
<script>
import apiRoute from '@/api/apiRoute.js';
export default {
data() {
return {
loading:false,//
lowerThreshold: 100,//
isReachedBottom: false,//|true=|false=
//
filteredData:{
page:1,//
limit:10,//
total:10,//
resource_id: '',//id
},
//
tableList:[{
title: '入场',
time: '07:00',
activeColor: '#465CFF'
}, {
title: '主场演讲',
time: '08:00',
descr: '马云(阿里巴巴)',
activeColor: '#465CFF'
}, {
title: '世界互联经济',
time: '08:30',
descr: '马云(阿里巴巴)',
activeColor: '#465CFF'
}, {
title: '打造自己的互联帝国',
time: '09:30',
descr: '马化腾(腾讯)',
activeColor: '#FFB703'
}, {
title: '散场',
time: '11:00',
descr: '请带走垃圾,有序散场。'
}],//
customTableData:[
{
field:'姓名',
oldValue:'张三',
newValue:'11李四李四李四李四李四李四李四李四李四李四李四123',
}
]
}
},
onLoad(options) {
this.filteredData.resource_id = options.resource_id//id
},
onShow() {
// this.init()
},
//
async onPullDownRefresh() {
//
await this.resetFilteredData()
await this.getList()
},
methods: {
//
async init() {
await this.getList()//
},
//()
loadMoreData() {
//
if (!this.isReachedBottom) {
this.isReachedBottom = true;//
this.getList();
}
},
//
async resetFilteredData() {
this.isReachedBottom = false; // 便
this.filteredData.page = 1//
this.filteredData.limit = 10//
this.filteredData.total = 10//
},
//-
async getList(){
this.loading = true
let data = {...this.filteredData}
//
if(this.filteredData.page * this.filteredData.limit > this.filteredData.total){
this.loading = false
uni.showToast({
title: '暂无更多',
icon: 'none'
})
return
}
if(data.page == 1){
this.tableList = []
}
let res = await apiRoute.xs_resourceSharingIndex(data)
this.loading = false
this.isReachedBottom = false;
if (res.code != 1){
uni.showToast({
title: res.msg,
icon: 'none'
})
return
}
this.tableList = this.tableList.concat(res.data.data); // 使 concat
console.log('列表1',this.tableList)
this.filteredData.total = res.data.total
this.filteredData.page++
},
}
}
</script>
<style lang="less" scoped>
.assemble{
width: 100%;
height: 100%;
//background-color: #292929;
overflow: auto;
.table_list{
border: 1px solid red;
.itme_box {
margin-top: 30rpx;
display: flex;
flex-direction: column;
gap: 20rpx;
.title_name{
font-size: 28rpx;
}
.table_box{
width: 100%;
border-collapse: collapse;
table-layout: fixed;
}
}
::v-deep .fui-timeaxis__wrap{
}
.fui-node {
width: 32rpx;
height: 32rpx;
border-radius: 50%;
background: #fff;
display: flex;
align-items: center;
justify-content: center;
border: 4px solid #ccc;
box-sizing: border-box;
}
.fui-process__node {
padding-left: 20rpx;
}
.fui-title {
font-size: 34rpx;
line-height: 34rpx;
font-weight: bold;
}
.fui-descr {
font-size: 28rpx;
padding-top: 12rpx;
color: #7F7F7F;
}
.fui-time__left {
font-size: 36rpx;
line-height: 36rpx;
text-align: right;
padding-right: 20rpx;
}
.fui-node__pbtm {
padding-bottom: 88rpx;
}
}
}
</style>

8
pages/market/clue/index.vue

@ -10,7 +10,7 @@
v-if="segmented_type == 1"
scroll-y="true"
:lower-threshold="lowerThreshold"
@scrolltolower="loadMoreData"
@scrolltolower="loadMoreData_1"
style="height: 100vh;"
>
<view class="search_section">
@ -75,7 +75,7 @@
v-if="segmented_type == 2"
scroll-y="true"
:lower-threshold="lowerThreshold"
@scrolltolower="loadMoreData"
@scrolltolower="loadMoreData_2"
style="height: 100vh;"
>
<view class="search_section">
@ -324,7 +324,7 @@ export default {
//
if (!this.isReachedBottom) {
this.isReachedBottom = true;//
this.getList();
this.getList_1();
}
},
//
@ -382,7 +382,7 @@ export default {
//
if (!this.isReachedBottom) {
this.isReachedBottom = true;//
this.getList();
this.getList_2();
}
},
//

Loading…
Cancel
Save