| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- <template>
- <view class="mainBox">
- <view v-for="(item, index) in tableList" :key="index" style="position: relative;">
- <myCard @del="del(index,item)" @add="add('edit',item,index)" :item="item" :btnList="btnList"
- :index="index+1" :columns="columns">
- </myCard>
- </view>
- <view style='margin-top: 20vh;' v-if="tableList.length==0">
- <u-empty iconSize='150' textSize='32' text='暂无数据'>
- </u-empty>
- </view>
- <view class="add" @click="add('add')">
- <u-icon name="plus" color="#fff"></u-icon>
- </view>
- </view>
- </template>
- <script>
- import myCard from '../../components/myCard.vue'
- export default {
- data() {
- return {
- columns: [
- [{
- label: '跟进内容:',
- prop: 'content',
- type: 'title',
- className: 'perce100',
- }],
- [{
- label: '跟进阶段:',
- prop: 'stageName'
- }, {
- label: '客户联系人:',
- prop: 'linkName',
- }],
- [{
- label: '跟进时间:',
- prop: 'followupTime',
- className: 'perce100',
- }],
- [{
- label: '达成共识:',
- prop: 'agreement',
- className: 'perce100',
- }],
- [{
- label: '下一步计划:',
- prop: 'nextPlan',
- className: 'perce100',
- }],
- [{
- label: '操作:',
- prop: 'action',
- type: 'action',
- className: 'perce100',
- }],
- ],
- btnList: [{
- name: '修改',
- apiName: 'add',
- btnType: 'primary',
- type: '2',
- }, {
- name: '删除',
- apiName: 'del',
- btnType: 'error',
- type: '2',
- pageUrl: '',
- }],
- tableList: [],
- form: {},
- }
- },
- props: {
- isDrawer: {
- default: false
- },
- linkList: {
- default: []
- },
- pageName: ''
- },
- components: {
- myCard
- },
- created() {
- uni.$off('updateFollowList')
- uni.$on('updateFollowList', ({
- type,
- data
- }) => {
- if (type == 'add') {
- this.tableList.unshift(data)
- } else {
- this.$set(this.tableList, data.index, data)
- }
- if (this.pageName == 'businessOpportunity') {
- uni.$emit('savefollowList', data)
- return
- }
- this.form.opportunityFollowupList = JSON.parse(JSON.stringify(this.tableList))
- if (this.isDrawer) {
- uni.$emit('setContact', {
- key: 'form',
- data: this.form
- })
- }
- })
- },
- methods: {
- init(data) {
- if (this.pageName == 'businessOpportunity') {
- this.tableList = JSON.parse(JSON.stringify(data))
- return
- }
- if (data) {
- this.form = data
- this.tableList = JSON.parse(JSON.stringify(data.opportunityFollowupList))
- }
- },
- del(index, item) {
- this.tableList.splice(index, 1);
- if (this.pageName == 'businessOpportunity') {
- uni.$emit('delFollowList', item)
- return
- }
- this.form.opportunityFollowupList = JSON.parse(JSON.stringify(this.tableList))
- if (this.isDrawer) {
- uni.$emit('setContact', {
- key: 'form',
- data: this.form
- })
- }
- },
- add(type, data, index) {
- if (type == 'edit') {
- data['index'] = index
- }
- uni.navigateTo({
- url: '/pages/saleManage/contact/components/followListAdd?type=' + type + '&linkList=' + JSON
- .stringify(this.linkList) + (type == 'edit' ?
- '&data=' + JSON.stringify(data) : '')
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .add {
- width: 96rpx;
- height: 96rpx;
- border-radius: 48rpx;
- background: #3c9cff;
- position: fixed;
- bottom: 100rpx;
- right: 24rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- z-index: 99;
- }
- /deep/.u-cell__body,
- /deep/.u-cell__title-text {
- font-size: 26rpx;
- }
- </style>
|