819527061@qq.com
2024-05-11 f73ed7862edc9c3cb78a2610486643a2fa079fde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<template>
    <view class="signerManagement-wrap">
        <view class="signerManagement-line">
            <u-swipe-action :show="item.show" :index="index"
                v-for="(item, index) in list" :key="item.id" 
                @click="click(item.id)" @open="open"
                :options="options"
            >
                <view class="item u-border-bottom">
                    <view class="qianshou-box">
                        <view class="qianshou-line">
                            <view>姓名:{{item.name}}</view>
                            <view>状态:{{item.status == 0 ? '待审核': (item.status == 1 ? '审核通过' : '审核未通过')}}</view>
                        </view>
                        <view class="qianshou-line">
                            <view>手机:{{item.phone}}</view>
                        </view>
                    </view>
                </view>
            </u-swipe-action>
        </view>
        <view class="signerManagement-btn">
            <u-button @click="addQinshouren" class="addQianshou">新增签收人</u-button>
        </view>
        
        <addSigner v-if="addSignerVisiable" ref="addSigner" @refeshSignerList="getCustomerReceive()"></addSigner>
    </view>
</template>
 
<script>
    import addSigner from '../components/addSigner/addSigner.vue'
    export default {
        components:{
            addSigner
        },
        data() {
            return {
                addSignerVisiable:false,  //新增签收人弹框
                list: [],
                disabled: false,
                btnWidth: 180,
                show: false,
                options: [
                            {
                                text: '删除',
                                style: {
                                    backgroundColor: '#dd524d'
                                }
                            }
                        ]
            }
        },
        onShow() {
            this.getCustomerReceive()
        },
        methods: {
            getCustomerReceive() {  //获取签收人列表
                let customerId = this.$store.state.customerId
                this.$u.api.getCustomerReceive({customerId:customerId}).then(res => {
                    if(res.code == 200) {
                        this.list = res.result
                    }
                })
            },
            addQinshouren() {
                this.addSignerVisiable = true
                this.$nextTick(() => {
                    this.$refs.addSigner.init()
                })
            },
            click(id) {
                this.$u.api.deleteReceive({id:id}).then(res => {
                    if(res.code == 200) {
                        this.$u.toast(res.message)
                        this.getCustomerReceive()
                    }
                })
            },
            // 如果打开一个的时候,不需要关闭其他,则无需实现本方法
            open(index) {
                // 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制,
                // 原本为'false',再次设置为'false'会无效
                this.list[index].show = true;
                this.list.map((val, idx) => {
                    if(index != idx) this.list[idx].show = false;
                })
            }
        }
    }
</script>
 
<style lang="scss" scoped>
    .signerManagement-btn {
        margin-top: 80rpx;
        /deep/ .u-btn--default{
            background-color: #1F9F4C;
            width: 280rpx;
            height: 76rpx;
            color: #fff;
        }
    }
    .signerManagement-wrap{
        width: 100%;
        padding: 0 32rpx;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        .u-border-bottom{
            margin-top: 48rpx;
            border-bottom: 1px dashed #CCCCCC;
            padding: 20rpx 0;
        }
    }
  .qianshou-line{
      display: flex;
      font-size: 28rpx;
      color:#111111;
      font-weight: light;
      line-height: 2.5;
      view{
        flex:1;  
      }
  }
  .addQianshou{
      margin-top: 80rpx;
  }
</style>