|
@@ -5,7 +5,7 @@
|
|
|
<text class="title">客户管理</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="t-btn">+添加客户</view>
|
|
|
+ <view class="t-btn" @click="addCustomer()">+添加客户</view>
|
|
|
<u-sticky offset-top="-90">
|
|
|
<u-tabs :list="tabs" @change="change" :current="current" :is-scroll="false"></u-tabs>
|
|
|
</u-sticky>
|
|
@@ -13,12 +13,12 @@
|
|
|
<view class="card" v-for="(customerItem,index) in customerItemList" :key="index">
|
|
|
<view class="t">
|
|
|
<image class="icon" src="../../static/home-icon-01.png"></image>
|
|
|
- <text class="title">{{customerItem.companyName}}</text>
|
|
|
+ <text class="title">{{customerItem.name}}</text>
|
|
|
</view>
|
|
|
<view class="c">
|
|
|
<view class="item">
|
|
|
<text class="p1">联系人:</text>
|
|
|
- <text class="p2">{{customerItem.user}}</text>
|
|
|
+ <text class="p2">{{customerItem.dutyPeople}}</text>
|
|
|
</view>
|
|
|
<view class="item">
|
|
|
<text class="p1">联系电话:</text>
|
|
@@ -26,22 +26,29 @@
|
|
|
</view>
|
|
|
<view class="item">
|
|
|
<text class="p1">营业执照:</text>
|
|
|
- <text class="p2">{{customerItem.license}}</text>
|
|
|
+ <text class="p2">
|
|
|
+ <image class="licence" :src="customerItem.businessLicence"></image>
|
|
|
+ </text>
|
|
|
</view>
|
|
|
<view class="item">
|
|
|
<text class="p1">状态:</text>
|
|
|
- <text class="p2">{{customerItem.state}}</text>
|
|
|
+ <text class="p2">
|
|
|
+ <text v-if="customerItem.judgeStatus==1">未审核</text>
|
|
|
+ <text v-if="customerItem.judgeStatus==2">审核通过</text>
|
|
|
+ <text v-if="customerItem.judgeStatus==3">审核不通过</text>
|
|
|
+ </text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="b">
|
|
|
- <view class="btn b1" v-if="customerItem.btnShow==1" @click="sh(index)">审核</view>
|
|
|
+ <view class="btn b1" v-if="customerItem.btnShow==1 " @click="sh(customerItem.id)">审核</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<u-loadmore style="margin: 30rpx;" :status="status"/>
|
|
|
- <uni-popup ref="shpopup" type="dialog">
|
|
|
+ <uni-popup ref="shpopup" type="center">
|
|
|
<uni-popup-dialog type="success" title="确定审核吗?" :duration="2000" @confirm="shconfirm"></uni-popup-dialog>
|
|
|
</uni-popup>
|
|
|
+
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -68,80 +75,92 @@
|
|
|
],
|
|
|
customerItemList:[
|
|
|
{
|
|
|
- companyName:'广西医科大一附院',
|
|
|
- user:'张三',
|
|
|
- phone:'18888888888',
|
|
|
- license:'有',
|
|
|
- state:'未审核',
|
|
|
- btnShow:1
|
|
|
- },
|
|
|
- {
|
|
|
- companyName:'广西医科大一附院',
|
|
|
- user:'张三',
|
|
|
- phone:'18888888888',
|
|
|
- license:'有',
|
|
|
- state:'审核通过',
|
|
|
- btnShow:0
|
|
|
- },
|
|
|
- {
|
|
|
- companyName:'广西医科大一附院',
|
|
|
- user:'张三',
|
|
|
- phone:'18888888888',
|
|
|
- license:'有',
|
|
|
- state:'禁用',
|
|
|
+ name:'',
|
|
|
+ dutyPeople:'',
|
|
|
+ phone:'',
|
|
|
+ businessLicence:'',
|
|
|
+ judgeStatus:'',
|
|
|
btnShow:0
|
|
|
},
|
|
|
- {
|
|
|
- companyName:'广西医科大一附院',
|
|
|
- user:'张三',
|
|
|
- phone:'18888888888',
|
|
|
- license:'有',
|
|
|
- state:'禁用',
|
|
|
- btnShow:0
|
|
|
- }
|
|
|
- ]
|
|
|
+ ],
|
|
|
+ confirmCustomerId: '',
|
|
|
+ judgeContent: '',
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ getCustomerList(){
|
|
|
+ this.$api.getCustomerList({
|
|
|
+ current: this.current,
|
|
|
+ }).then(resp => {
|
|
|
+ let customerList = resp.data;
|
|
|
+ //todo 还要判断当前用户是否为admin
|
|
|
+ for (let i in customerList) {
|
|
|
+ if(customerList[i].judgeStatus == 1){
|
|
|
+ customerList[i].btnShow = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.customerItemList = customerList;
|
|
|
+ console.log(customerList);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ confirmCustomer(){
|
|
|
+ this.$api.confirmCustomer({
|
|
|
+ customerId: this.confirmCustomerId
|
|
|
+ }).then(resp =>{
|
|
|
+ if(resp.code == 200){
|
|
|
+ this.getCustomerList();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
//点击上方切换栏,根据点击项重新加载数据
|
|
|
change(index) {
|
|
|
this.current = index;
|
|
|
- if(index==0){
|
|
|
- //加载全部
|
|
|
- }
|
|
|
- if(index==1){
|
|
|
- //加载未审核
|
|
|
- }
|
|
|
- if(index==2){
|
|
|
- //只加载审核通过
|
|
|
- }
|
|
|
- if(index==3){
|
|
|
- //只加载禁用
|
|
|
- }
|
|
|
+ this.getCustomerList();
|
|
|
+ // if(index==0){
|
|
|
+ // //加载全部
|
|
|
+ // }
|
|
|
+ // if(index==1){
|
|
|
+ // //加载未审核
|
|
|
+ // }
|
|
|
+ // if(index==2){
|
|
|
+ // //只加载审核通过
|
|
|
+ // }
|
|
|
+ // if(index==3){
|
|
|
+ // //只加载禁用
|
|
|
+ // }
|
|
|
},
|
|
|
//点击按钮
|
|
|
//------------------------------------------
|
|
|
- sh(){
|
|
|
+ sh(id){
|
|
|
+ this.confirmCustomerId = id;
|
|
|
this.$refs.shpopup.open('center')
|
|
|
},
|
|
|
shconfirm(index) {
|
|
|
- console.log('审核')
|
|
|
+ this.confirmCustomer();
|
|
|
this.$refs.shpopup.close()
|
|
|
},
|
|
|
|
|
|
+ addCustomer() {
|
|
|
+ this.$common.to("/pages/enterprise-reg/enterprise-reg");
|
|
|
+ },
|
|
|
+
|
|
|
//------------------------------------------
|
|
|
//上拉加载更多,分页模拟数据
|
|
|
onReachBottom() {
|
|
|
- if(this.page >= 3) return ;
|
|
|
- this.status = 'loading';
|
|
|
- this.page = ++ this.page;
|
|
|
- setTimeout(() => {
|
|
|
- this.customerItemList += 5;//接接口后把数据加上,懒得写假数据了
|
|
|
- if(this.page >= 3) this.status = 'nomore';
|
|
|
- else this.status = 'loading';
|
|
|
- }, 2000)
|
|
|
+ // if(this.page >= 3) return ;
|
|
|
+ // this.status = 'loading';
|
|
|
+ // this.page = ++ this.page;
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.customerItemList += 5;//接接口后把数据加上,懒得写假数据了
|
|
|
+ // if(this.page >= 3) this.status = 'nomore';
|
|
|
+ // else this.status = 'loading';
|
|
|
+ // }, 2000)
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
+ this.getCustomerList();
|
|
|
+
|
|
|
+ },
|
|
|
}
|
|
|
</script>
|
|
|
|
|
@@ -205,6 +224,10 @@
|
|
|
font-weight: bold;
|
|
|
margin-left: 20rpx;
|
|
|
flex: 7;
|
|
|
+ .licence{
|
|
|
+ width: 80%;
|
|
|
+ height: 100rpx;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.car-num-item{
|
|
@@ -261,5 +284,12 @@
|
|
|
background-color: #fff;
|
|
|
border: 1px solid #eee;
|
|
|
}
|
|
|
+ .popup-box {
|
|
|
+ text-align: center;
|
|
|
+ background-color: #fff;
|
|
|
+ height: 280rpx;
|
|
|
+ width: 560rpx;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ }
|
|
|
@import '@/common/common.scss'
|
|
|
</style>
|