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.
485 lines
18 KiB
485 lines
18 KiB
<template>
|
|
<view class="">
|
|
<view style="width: 100%;position: fixed;top: 0;z-index: 99;">
|
|
<view v-if="popleType== 'khName' || popleType== 'gysName'" style="background:#fff;padding-top:20rpx;">
|
|
<button size="default" type="default" @tap="goAddPeople" hover-class="is-hover">{{popleType=='khName'?'新增客户':'新增供应商'}}</button>
|
|
</view>
|
|
<view class="title-box">
|
|
<uni-search-bar class="uni-mt-10" radius="5" placeholder="请输入名称查询" cancelButton="none"
|
|
@confirm="search" />
|
|
</view>
|
|
</view>
|
|
<view style="overflow:scroll;" :style="{'margin-top':popleType == 'khName' || popleType == 'gysName'?'230rpx':'110rpx'}">
|
|
<view v-if="popleType== 'khName' || popleType== 'gysName'" style="overflow:scroll;">
|
|
<!-- 供应商、客户走这一套 -->
|
|
<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="width:75%;font-size: 26rpx;color:#747474;height: auto;line-height: 30rpx;">{{item.name == '散客'?'-':item.address}}</text>
|
|
</view>
|
|
<view v-if="item.name != '散客' && popleType== 'khName'" style="color: red;position: absolute;top: 8px;right: 17px;font-size: 13px;">
|
|
欠款:{{item.noEarn?item.noEarn :0}}
|
|
</view>
|
|
<view v-if="item.name != '散客'" class="name-edit" @tap.stop="goAddPeople('edit',item)" style="bottom: 86rpx;">
|
|
编辑
|
|
</view>
|
|
<view v-if="item.name != '散客'" class="name-edit" @tap.stop="goDetail(item)" style="background: #FF9797;bottom:16rpx">
|
|
查看明细
|
|
</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,index) in popleList[0]" :key="index">
|
|
<!-- <view class="shop-mask" v-if="item.isOnLine == 0" @tap.stop="clickMask(item)">
|
|
<view style="width: 100%;height: 100%;line-height: 120rpx;text-align: center;color: red;" @tap.stop="clickPhone(item.mobile)">
|
|
此{{popleType== 'wlName'?'物流公司': popleType== 'fcName'?'厢货车': popleType== 'dbName'?'大巴车':'公司'}}已下线,点击可拨打电话
|
|
</view>
|
|
</view> -->
|
|
<view class="name-tel">
|
|
<text style="line-height: 75rpx;" v-if="item.companyName">{{item.companyName}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
|
|
<text style="line-height: 75rpx;" v-if="item.shippingMethod">{{item.shippingMethod}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
|
|
<text style="line-height: 75rpx;" v-if="item.workerName">{{item.workerName}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></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="shop-mask" v-if="item.isOnLine == 0" @tap.stop="clickMask(item)">
|
|
<view style="width: 100%;height: 100%;line-height: 120rpx;text-align: center;color: red;" @tap.stop="clickPhone(item.mobile)">
|
|
此{{popleType== 'wlName'?'物流公司': popleType== 'fcName'?'厢货车': popleType== 'dbName'?'大巴车':'公司'}}已下线,点击可拨打电话
|
|
</view>
|
|
</view> -->
|
|
<view class="name-tel">
|
|
<text style="line-height: 75rpx;" v-if="item.companyName">{{item.companyName}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
|
|
<text style="line-height: 75rpx;" v-if="item.shippingMethod">{{item.shippingMethod}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
|
|
<text style="line-height: 75rpx;" v-if="item.workerName">{{item.workerName}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></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' || popleType== 'kdyName'">
|
|
<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="shop-mask" v-if="item.isOnLine == 0" @tap.stop="clickMask(item)">
|
|
<view style="width: 100%;height: 100%;line-height: 120rpx;text-align: center;color: red;" @tap.stop="clickPhone(item.mobile)">
|
|
此{{popleType== 'wlName'?'物流公司': popleType== 'fcName'?'厢货车': popleType== 'dbName'?'大巴车':'公司'}}已下线,点击可拨打电话
|
|
</view>
|
|
</view> -->
|
|
<view class="name-tel">
|
|
<text style="line-height: 75rpx;" v-if="item.companyName">{{item.companyName}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
|
|
<text style="line-height: 75rpx;" v-if="item.shippingMethod">{{item.shippingMethod}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
|
|
<text style="line-height: 75rpx;" v-if="item.workerName">{{item.workerName}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></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>
|
|
<u-loadmore :status="status" />
|
|
</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,
|
|
status: 'loadmore',
|
|
remark:'',
|
|
khName:{},
|
|
searchName:'',
|
|
pages: 1,
|
|
totalPages: 0,
|
|
noClick:0
|
|
}
|
|
},
|
|
onReachBottom() {
|
|
if (this.pages >= this.totalPages) return;
|
|
this.status = 'loading';
|
|
this.pages = ++this.pages;
|
|
this.getPeopleType();
|
|
},
|
|
onShow(){
|
|
if(this.modelShow == true){
|
|
this.popleType = this.popleType
|
|
this.khOrGysList();
|
|
}
|
|
},
|
|
onLoad(options) {
|
|
this.popleType = options.popleType
|
|
this.noClick = options.noClick || 0
|
|
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: '供应商列表'
|
|
});
|
|
}
|
|
this.getPeopleType();
|
|
},
|
|
methods: {
|
|
getPeopleType(){
|
|
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)
|
|
} else {
|
|
this.kdyOrlbgList();
|
|
}
|
|
},
|
|
//客户、供应商列表
|
|
khOrGysList() {
|
|
this.status = 'loading';
|
|
if(this.popleType == 'gysName'){ //供应商
|
|
this.tui.request("/app/supplier/getByCondition", "post", {
|
|
searchStr:this.searchName,
|
|
pageNumber: this.pages,
|
|
pageSize: 10
|
|
}, false, true).then((res) => {
|
|
this.status = 'nomore';
|
|
if (res.code == 200) {
|
|
if (this.pages == 1) {
|
|
this.popleList = res.result.content
|
|
} else {
|
|
this.popleList = [...this.popleList, ...res.result.content]
|
|
}
|
|
this.totalPages = res.result.totalPages
|
|
}else{
|
|
this.tui.toast(res.message)
|
|
}
|
|
})
|
|
}else{ //客户
|
|
this.tui.request("/app/customer/list", "post", {
|
|
searchStr:this.searchName,
|
|
pageNum: this.pages,
|
|
pageSize: 10
|
|
}, false, false).then((res) => {
|
|
this.status = 'nomore';
|
|
if (res.code == 200) {
|
|
if (this.pages == 1) {
|
|
this.popleList = res.result.records
|
|
} else {
|
|
this.popleList = [...this.popleList, ...res.result.records]
|
|
}
|
|
this.totalPages = res.result.pages
|
|
}else{
|
|
this.tui.toast(res.message)
|
|
}
|
|
})
|
|
}
|
|
},
|
|
//物流或者快递列表
|
|
wlOrKdList(e,num) {
|
|
this.status = 'loading';
|
|
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) => {
|
|
this.status = 'nomore';
|
|
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)
|
|
}
|
|
})
|
|
},
|
|
//未入库遮罩
|
|
clickMask(item){
|
|
let title = ''
|
|
if(item.delFlag == 0){
|
|
title = '请将商品上架后再操作!'
|
|
}else{
|
|
title = '请将上次入库的采购价维护后再进行操作!'
|
|
}
|
|
uni.showToast({
|
|
title: title,
|
|
icon: 'none'
|
|
})
|
|
},
|
|
//点击选择列表,带参数 返回上一页
|
|
clickList(item) {
|
|
if(item.isOnLine ==0){
|
|
this.tui.toast(this.popleType== 'wlName'?'物流公司已下线': this.popleType== 'fcName'?'厢货车已下线': this.popleType== 'dbName'?'大巴车已下线':this.popleType== 'lbgName'?'拉包工已下线':this.popleType== 'kdyName'?'快递员已下线':'公司已下线')
|
|
return
|
|
}
|
|
if(this.noClick == 0){
|
|
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.pages = 1
|
|
this.searchName = res.value
|
|
this.popleList = []
|
|
this.getPeopleType()
|
|
},
|
|
//查询拉包工和快递人员的列表
|
|
kdyOrlbgList() {
|
|
this.status = 'loading';
|
|
this.tui.request("/worker/getByCondition", "post", {
|
|
ownerCompany: this.companyType, //公司id,如果是快递公司,才需要传
|
|
searchStr:this.searchName,
|
|
pageNum: this.pages,
|
|
pageSize: 10
|
|
}, false, false).then((res) => {
|
|
this.status = 'nomore';
|
|
if (res.code == 200) {
|
|
if (this.pages == 1) {
|
|
this.popleList = res.result.content
|
|
} else {
|
|
this.popleList = [...this.popleList, ...res.result.content]
|
|
}
|
|
this.totalPages = res.result.totalPages
|
|
}else{
|
|
this.tui.toast(res.message)
|
|
}
|
|
})
|
|
|
|
},
|
|
//新增人员
|
|
goAddPeople(type,data){
|
|
this.modelShow = true;
|
|
this.pages = 1
|
|
this.searchName = ""
|
|
this.popleList = []
|
|
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%;
|
|
}
|
|
|
|
.list-1 {
|
|
display: flex;
|
|
height: 150rpx;
|
|
border-bottom: 1px solid #eee;
|
|
background: #fff;
|
|
font-size: 32rpx;
|
|
margin: 20rpx auto 0;
|
|
width: 95%;
|
|
padding-left: 30rpx;
|
|
position: relative;
|
|
}
|
|
|
|
.name-tel {
|
|
width: 75%;
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: auto;
|
|
font-size: 15px;
|
|
}
|
|
.name-edit{
|
|
width: 110rpx;
|
|
height: 55rpx;
|
|
position: absolute;
|
|
right: 35rpx;
|
|
background: #088FEB;
|
|
color: #fff;
|
|
font-size: 22rpx;
|
|
line-height: 55rpx;
|
|
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;
|
|
}
|
|
.shop-mask {
|
|
width: 100%;
|
|
height: 120rpx;
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
background: rgba(0, 0, 0, 0.6);
|
|
}
|
|
</style>
|