<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>
|