平板端快衣店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

399 lines
13 KiB

<template>
<view class="">
<view class="title-box">
<uni-search-bar class="uni-mt-10" radius="5" placeholder="请输入名称查询" cancelButton="none"
@confirm="search" />
</view>
<view class="">
<view class="" v-if="popleType== 'khName' || popleType== 'gysName'" @tap="">
<!-- 供应商、客户走这一套 -->
<view>
<button size="default" type="default" @tap="goAddPeople" hover-class="is-hover">{{popleType=='khName'?'新增客户':'新增供应商'}}</button>
</view>
<view class="list-1" v-for="item in popleList" :key="item" @tap="clickList(item)"
style="display: flex;flex-direction: column;height: auto;padding-bottom: 20rpx;">
<view class="name-tel" style="width: 100%;" v-if="popleType=='gysName'">
<text style="line-height: 75rpx;">{{item.consigneeName}}</text>
<text>{{item.consigneeMobile}}</text>
</view>
<view class="name-tel" style="width: 100%;" v-else>
<text style="line-height: 75rpx;">{{item.name}}</text>
<text v-if="item.name != '散客'">{{item.phone}}</text>
</view>
<view class="name-tel" style="width: 100%;display: flex;flex-direction: column;height:auto;font-size: 30rpx;">
<text>{{item.name == '散客'?'-':item.province + item.city + item.area}}</text>
<text style="font-size: 26rpx;color:#747474;height: auto;line-height: 30rpx;">{{item.name == '散客'?'-':item.address}}</text>
</view>
<view v-if="item.name != '散客'" class="name-edit" @tap.stop="goAddPeople('edit',item)" style="top: 25rpx;">
编辑
</view>
<view v-if="item.name != '散客'" class="name-edit" @tap.stop="goDetail(item)" style="background: #FF9797;bottom:25rpx">
查看明细
</view>
</view>
</view>
<!-- 物流、发车、大巴走这一套 -->
<view class="" v-if="popleType== 'wlName' || popleType== 'fcName' || popleType== 'dbName'">
<view class="list-1" :style="{height:popleType == 'kdName'?'75rpx':'120rpx'}" style="display: flex;position: relative;" @tap="clickList(item)" v-for="item in popleList[0]" :key="item">
<view class="name-tel">
<text style="line-height: 75rpx;">{{item.companyName}}</text>
<text style="line-height: 75rpx;">{{item.shippingMethod}}</text>
<text style="line-height: 75rpx;">{{item.workerName}}</text>
</view>
<view class="standard-box" @tap.stop="toggle('center',item)">
<view class="">
<text style="padding-left:40rpx;">线路查询</text>
<uni-icons type="info" color='#088FEB' size="16" style="line-height: 75rpx;"></uni-icons>
</view>
<view class="phone-btn" @tap.stop="clickPhone(item.mobile)" v-if="popleType != 'kdName'">拨打电话</view>
</view>
<view style="position: absolute;bottom: 0;left: 40rpx;" v-if="popleType == 'fcName' || popleType == 'lbgName' || popleType == 'wlName'">
<text style="line-height: 45rpx;color:red;font-size: 24rpx;" v-if="item.rebateAmount">本单返佣{{item.rebateAmount}}元</text>
</view>
</view>
<view class="no-more" v-if="searchName == ''">
<view>以上结果根据客户地址自动匹配得出</view>
<view>↓↓下方为区域内所有物流公司↓↓</view>
</view>
<view class="list-1" :style="{height:popleType == 'kdName'?'75rpx':'120rpx'}" style="display: flex;position: relative;" @tap="clickList(item)" v-for="item in popleList[1]" :key="item">
<view class="name-tel">
<text style="line-height: 75rpx;">{{item.companyName}}</text>
<text style="line-height: 75rpx;">{{item.shippingMethod}}</text>
<text style="line-height: 75rpx;">{{item.workerName}}</text>
</view>
<view class="standard-box" @tap.stop="toggle('center',item)">
<view class="">
<text style="padding-left:40rpx;">线路查询</text>
<uni-icons type="info" color='#088FEB' size="16" style="line-height: 75rpx;"></uni-icons>
</view>
<view class="phone-btn" @tap.stop="clickPhone(item.mobile)" v-if="popleType != 'kdName'">拨打电话</view>
</view>
<view style="position: absolute;bottom: 0;left: 40rpx;" v-if="popleType == 'fcName' || popleType == 'lbgName' || popleType == 'wlName'">
<text style="line-height: 45rpx;color:red;font-size: 24rpx;" v-if="item.rebateAmount">本单返佣{{item.rebateAmount}}元</text>
</view>
</view>
</view>
<!--快递、拉包工 -->
<view class="" v-if="popleType== 'kdName' || popleType== 'lbgName'">
<view class="list-1" :style="{height:popleType == 'kdName'?'75rpx':'120rpx'}" style="display: flex;position: relative;" @tap="clickList(item)" v-for="item in popleList" :key="item">
<view class="name-tel">
<text style="line-height: 75rpx;">{{item.companyName}}</text>
<text style="line-height: 75rpx;">{{item.shippingMethod}}</text>
<text style="line-height: 75rpx;">{{item.workerName}}</text>
</view>
<view class="standard-box" @tap.stop="toggle('center',item)">
<view class="">
<text style="padding-left:40rpx;">收费标准</text>
<uni-icons type="info" color='#088FEB' size="16" style="line-height: 75rpx;"></uni-icons>
</view>
<view class="phone-btn" @tap.stop="clickPhone(item.mobile)" v-if="popleType != 'kdName'">拨打电话</view>
</view>
<!-- <view style="position: absolute;bottom: 0;left: 40rpx;" v-if="popleType == 'fcName' || popleType == 'lbgName' || popleType == 'wlName'">
<text style="line-height: 45rpx;color:red;font-size: 24rpx;" v-if="item.rebateAmount">本单返佣{{item.rebateAmount}}元</text>
</view> -->
</view>
</view>
</view>
<view>
<uni-popup ref="popup" background-color="#fff">
<view class="popup-content">
<view class="popup-title">
<text>收费标准</text>
<uni-icons @tap='close' type="closeempty" color='red' size="16"
style="height:40rpx;line-height: 40rpx;position: absolute;right: 0;"></uni-icons>
</view>
<view class="popup-container">
<text style="display: inline-block;text-indent: 2em;">{{remark}}</text>
</view>
</view>
</uni-popup>
</view>
</view>
</template>
<script>
export default {
data() {
return {
popleType: '',
popleList: [],
signCompany: '', // 1物流 2快递 3发车
people: '', //快递、物流、发车的id
radioType: '', //选择的是快递还是物流
companyType: '', //运输公司类型 快递公司有值 物流公司直接传空
modelShow:false,
remark:'',
khName:{},
searchName:''
}
},
onShow(){
if(this.modelShow == true){
this.popleType = this.popleType
this.khOrGysList();
}
},
onLoad(options) {
this.popleType = options.popleType
this.companyType = options.companyType || ''
if(options.khName){
this.khName = JSON.parse(options.khName) || ''
}
if(options.popleType == 'khName'){
uni.setNavigationBarTitle({
title: '客户列表'
});
}else if(options.popleType == 'gysName'){
uni.setNavigationBarTitle({
title: '供应商列表'
});
}
if (options.popleType == 'khName' || options.popleType == 'gysName') { //供应商或者客户
this.khOrGysList();
} else if (options.popleType == 'wlName' || options.popleType == 'kdName' || options.popleType == 'fcName' || options.popleType == 'dbName') { //物流快递
this.wlOrKdList(options.popleType)
} else {
this.kdyOrlbgList();
}
},
methods: {
//客户、供应商列表
khOrGysList() {
if(this.popleType == 'gysName'){ //供应商
this.tui.request("/app/supplier/getbyShopId", "post", {
searchStr:this.searchName
}, false, true).then((res) => {
if (res.code == 200) {
this.popleList = res.result;
}else{
this.tui.toast(res.message)
}
})
}else{ //客户
this.tui.request("/app/customer/list", "get", {
searchStr:this.searchName
}, false, true).then((res) => {
if (res.code == 200) {
this.popleList = res.result;
}else{
this.tui.toast(res.message)
}
})
}
},
//物流或者快递列表
wlOrKdList(e,num) {
let url,
data = {},
isTrue
//物流:1 快递:2 发车3
if (e == 'wlName') {
url = '/app/operatingArea/getByArea'
isTrue = true
data = {
province:this.searchName == '' ? this.khName.province : '',
city:this.searchName == '' ? this.khName.city : '',
area:this.searchName == '' ? this.khName.area : '',
shippingType:0,
seachParams:this.searchName
}
} else if (e == 'kdName') {
isTrue = false
url = '/app/logitics/getAll'
data = {
signCompany:1
}
} else if (e == 'fcName') {
isTrue = true
data = {
province:this.searchName == '' ? this.khName.province : '',
city:this.searchName == '' ? this.khName.city : '',
area:this.searchName == '' ? this.khName.area : '',
shippingType:4,
seachParams:this.searchName
}
url = '/app/operatingArea/getByArea'
}else if (e == 'dbName') {
isTrue = true
data = {
province:this.khName.province,
city:this.khName.city,
area:this.khName.area,
shippingType:5
}
url = '/app/operatingArea/getByArea'
}
this.tui.request(url, "post", data, false, isTrue).then((res) => {
if (res.code == 200) {
if(e == 'kdName'){
this.popleList = res.result;
}else{
this.popleList.push(res.result.operatingAreaList)
this.popleList.push(res.result.logiticsCompanyList)
}
}else{
this.tui.toast(res.message)
}
})
},
//点击选择列表,带参数 返回上一页
clickList(item) {
let pages = getCurrentPages(); // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。
let prevPage = pages[pages.length - 2]; //上一页页面实例
//客户和供应商用一个名字
if (this.popleType == 'khName' || this.popleType == 'gysName') {
prevPage.$vm.khName = item
} else if (this.popleType == 'kdName' || this.popleType == 'wlName' || this.popleType == 'fcName' ||this.popleType == 'dbName') {
prevPage.$vm.wlName = item
} else if (this.popleType == 'lbgName') {
prevPage.$vm.lbgName = item
} else if (this.popleType == 'kdyName') {
prevPage.$vm.kdyName = item
}
prevPage.$vm.clearMsg = '1'
uni.navigateBack({
delta: 1
})
},
//拨打电话
clickPhone(phone) {
uni.makePhoneCall({
phoneNumber: phone
});
},
//顶部搜索框
search(res) {
this.searchName = res.value
this.popleList = []
if (this.popleType == 'khName' || this.popleType == 'gysName') { //供应商或者客户
this.khOrGysList();
} else if (this.popleType == 'wlName' || this.popleType == 'kdName' || this.popleType == 'fcName' || this.popleType == 'dbName') { //物流快递
this.wlOrKdList(this.popleType,'1')
} else {
this.kdyOrlbgList();
}
},
//查询拉包工和快递人员的列表
kdyOrlbgList() {
this.tui.request("/worker/getWXByCondition", "post", {
ownerCompany: this.companyType, //公司id,如果是快递公司,才需要传
searchStr:this.searchName,
pageNum: 1,
pageSize: 10
}, false, false).then((res) => {
if (res.code == 200) {
this.popleList = res.result;
}else{
this.tui.toast(res.message)
}
})
},
//新增人员
goAddPeople(type,data){
this.modelShow = true;
uni.navigateTo({
url: "/pages/billing/addUser?type="+type+'&data='+JSON.stringify(data) + '&popleType=' + this.popleType
})
},
goDetail(data){
uni.navigateTo({
url: "/pages/index/customAndSupplierProductDetail?popleType="+this.popleType+'&id='+data.id
})
},
//打开弹出层
toggle(type,item) {
uni.setStorageSync("transCompany", item.shippingMethodId || item.id)
uni.navigateTo({
url: "/package1/other/logisticsAddress?type=kaidan"
})
},
//关闭弹出层
close() {
this.$refs.popup.close()
},
}
}
</script>
<style lang="scss" scoped>
button {
color: #ffffff;
background: #5fd9ee;
width: 90%;
margin-top: 20rpx;
}
.list-1 {
display: flex;
height: 150rpx;
border-bottom: 1px solid #eee;
background: #fff;
font-size: 32rpx;
margin: 20rpx auto 0;
width: 95%;
padding-left: 10rpx;
position: relative;
}
.name-tel {
width: 75%;
display: flex;
flex-direction: column;
height: auto;
font-size: 15px;
}
.name-edit{
width: 120rpx;
height: 60rpx;
position: absolute;
right: 35rpx;
background: #088FEB;
color: #fff;
font-size: 24rpx;
line-height: 60rpx;
text-align: center;
border-radius: 5px;
}
.standard-box {
color: #088FEB;
width: 30%;
font-size: 26rpx;
}
.popup-content {
align-items: center;
justify-content: center;
padding: 15px;
width: 500rpx;
height: 700rpx;
background-color: #fff;
}
.title-box {
background: #fff;
}
.popup-title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
position: relative;
}
.popup-container {
margin-top: 20rpx;
}
.phone-btn {
width: 150rpx;
color: #088FEB;
font-size: 26rpx;
padding-left:40rpx;
}
.no-more{
text-align: center;
color: #BEBEBE;
margin-top:20rpx;
}
</style>