平板端快衣店
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.
 
 
 
 
 

854 lines
30 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: 10px;display: flex;">
<view @tap="goAddPeople" style="width: 65%;text-align: center;height: 100rpx;margin: 20rpx;background: #60F3FF;line-height: 100rpx;border-radius: 10px;color: #fff;">
{{popleType=='khName'?'新增客户':'新增供应商'}}
</view>
<view @tap="trigger" style="width: 25%;text-align: center;height: 100rpx;margin: 20rpx;background: #EEE;line-height: 100rpx;border-radius: 10px;color: #777;">
批量删除
</view>
</view>
<view class="title-box" v-if="popleType=='wlName' || popleType=='dbName' || popleType=='fcName'">
<uni-search-bar class="uni-mt-10" radius="5" placeholder="请输入名称或发货地查询" cancelButton="none"
@confirm="search" @clear="clearSearch" />
</view>
<view class="title-box" v-else>
<uni-search-bar class="uni-mt-10" radius="5" placeholder="请输入名称查询" cancelButton="none"
@confirm="search" @clear="clearSearch" />
</view>
<view v-if="popleType=='khName'">
<view class="shaixuan-box">
<view style="flex: 1;" @tap="changeSort('nahuo')">
拿货天数
<uni-icons type="down" size="11"></uni-icons>
</view>
<view style="flex: 1;border-left: 1px solid #eee;border-right: 1px solid #eee;" @tap="changeSort('paixu')">
排序
<uni-icons type="down" size="11" v-if="noDaysort == false"></uni-icons>
<uni-icons type="up" size="11" v-if="noDaysort"></uni-icons>
</view>
<view style="width: 100rpx;" @tap="clearSearch">
<uni-icons type="close" size="30" color="#777"></uni-icons>
</view>
</view>
<view class="nahuo-mask" v-if="nahuoDay">
<view style="width: 100%;margin: 0 auto;background: #fff;height: 600rpx;border: 1px solid #eee;border-bottom-left-radius: 10px;border-bottom-right-radius: 10px;">
<view style="height: 500rpx;width: 95%;margin: 0 auto;">
<view v-for="(item,index) in dayList" :key="index" class="nahuo-content" @tap="nahuoChange(item.value)">
{{item.name}}
</view>
</view>
<view style="width: 95%;height: 100rpx;line-height: 100rpx;margin: 0 auto;display: flex;">
<view style="height: 80rpx;flex: 1;border: 1px solid #eee;padding-left: 20rpx;">
<input type="number" v-model="notBuyDays" placeholder="自定义拿货天数" style="display: inline-block;" />
</view>
<view class="get-btn" @tap="nahuoChange(notBuyDays)">
查询
</view>
</view>
</view>
</view>
<view class="nahuo-mask" v-if="noDaysort">
<view style="width: 100%;margin: 0 auto;background: #fff;height: 300rpx;border: 1px solid #eee;border-bottom-left-radius: 10px;border-bottom-right-radius: 10px;">
<view @tap="paixuChange('no_earn')" class="paixu-content" style="border-bottom: 1px solid #eee;">
根据欠款金额倒序
</view>
<view @tap="paixuChange('balance')" class="paixu-content" style="border-bottom: 1px solid #eee;">
根据客户余额倒序
</view>
<view @tap="paixuChange('not_buy_days')" class="paixu-content">
根据未拿货天数倒序
</view>
</view>
</view>
</view>
</view>
<view style="overflow:scroll;" :style="{'margin-top':popleType == 'khName'? '350rpx':popleType == 'gysName'?'274rpx' :'110rpx'}">
<view v-if="popleType== 'khName' || popleType== 'gysName'" style="overflow:scroll;">
<view v-if="popleType== 'gysName'" style="display: flex;width: 100%;line-height: 50rpx;text-align: center;background: #C6E2FF;color: #777;">
<view style="width: 33%;display: flex;flex-direction: column;"><text style="color:red">{{allData.personCount?allData.personCount:0}}</text><text>欠款人数</text></view>
<view style="width: 33%;display: flex;flex-direction: column;"><text style="color:red">{{allData.amountOwed?allData.amountOwed:0}}</text><text>欠款总额</text></view>
<view style="width: 33%;display: flex;flex-direction: column;"><text style="color:red">{{allData.purchasingCount?allData.purchasingCount:0}}</text><text>今日入库件数</text></view>
</view>
<view v-if="popleType== 'khName'" style="display: flex;width: 100%;line-height: 100rpx;text-align: center;background: #C6E2FF;color: #777;">
<view style="width: 50%;">
欠款人数:<text style="margin-right: 10px;">{{allData.personCount?allData.personCount:0}} </text>
欠款总额:<text style="color: red;">{{allData.amountOwed?allData.amountOwed:0}}</text></view>
<view style="width: 50%;">
余额人数:<text style="margin-right: 10px;">{{allBalanceData.personCount?allBalanceData.personCount:0}} </text>
总余额:<text style="color: red;">{{allBalanceData.amountOwed?Math.abs(allBalanceData.amountOwed):0}}</text>
</view>
</view>
<!-- 供应商、客户走这一套 -->
<view class="list-1" v-for="item in popleList" :key="item" @tap="clickList(item)" :style="{'min-height': item.name == '散客' || item.consigneeName == '默认供应商' ?'80rpx':'240rpx'}"
style="display: flex;flex-direction: column;height: auto;min-height: 240rpx;padding-bottom: 20rpx;">
<view class="name-tel" style="width: 100%;" v-if="popleType=='gysName'">
<text style="width: 360rpx;margin: 10px 0;">{{item.consigneeName}}</text>
<text>{{item.consigneeMobile != 'undefined' &&item.consigneeMobile != null &&item.consigneeMobile != undefined ?item.consigneeMobile:'-'}}</text>
</view>
<view class="name-tel" style="width: 100%;" v-else>
<text style="width: 360rpx;margin: 10px 0;">
{{item.name}}
<text v-if="item.categoryName != null && item.categoryName != 'null'">({{item.categoryName }})</text>
</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.consigneeName == '默认供应商') && item.city != null && item.city != undefined?'-':item.province + item.city + item.area}}</text>
<text style="width:75%;font-size: 26rpx;color:#747474;height: auto;line-height: 30rpx;">{{(item.name == '散客' || item.consigneeName == '默认供应商')?'-':item.address}}</text>
</view>
<view v-if="popleType== 'khName' && item.noEarn > 0 && userType == 0" style="color: red;position: absolute;top: 70rpx;right: 180rpx;font-size: 28rpx;">
欠款:{{item.noEarn?item.noEarn :0}}
</view>
<view v-if="popleType== 'gysName' && item.noEarn > 0 && userType == 0" style="color: red;position: absolute;top: 70rpx;right: 180rpx;font-size: 28rpx;">
欠款:{{item.noEarn?item.noEarn :0}}
</view>
<view v-if="popleType== 'khName' && item.noEarn < 0 && userType == 0" style="color: red;position: absolute;top: 70rpx;right: 180rpx;font-size: 28rpx;">
余额:{{item.noEarn?Math.abs(item.noEarn) :0}}
</view>
<view v-if="popleType== 'gysName' && item.noEarn < 0 && userType == 0" style="color: red;position: absolute;top: 70rpx;right: 180rpx;font-size: 28rpx;">
余额:{{item.noEarn?Math.abs(item.noEarn) :0}}
</view>
<view v-if="item.notBuyDays!=null && item.name != '散客'" style="position: absolute;top: 20rpx;right: 180rpx;font-size: 28rpx;">
{{item.notBuyDays+'天未拿货'}}
</view>
<view class="name-edit" @tap.stop="toggle('huikuan',item)" style="top: 27rpx;">
充值
</view>
<view v-if="item.name != '散客' && item.consigneeName !='默认供应商'" class="name-edit" @tap.stop="goAddPeople('edit',item)" style="bottom: 86rpx;">
编辑
</view>
<view class="name-edit" v-if="userType==0" @tap.stop="goDetail(item)" style="background: #FF9797;bottom:16rpx">
查看明细
</view>
</view>
</view>
<!-- 物流、发车走这一套 -->
<view class="" v-if="popleType== 'wlName' || popleType== 'fcName'">
<view class="list-1" v-for="(item,index) in popleList[0]" :key="index" v-if="user!='13521030702' && item.shippingMethod != '测试勿选'" :style="{height:popleType == 'kdName'?'75rpx':'120rpx'}" style="display: flex;position: relative;" @tap="clickList(item)">
<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" v-if="user!='13521030702' && item.companyName != '测试勿选'">
<!-- <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' || 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" :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="" v-if="popleType !='kdyName' && popleType !='lbgName'">
<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" :style="{'line-height':(popleType !='kdyName' && popleType !='lbgName')?'':'80rpx'}" @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>
<!-- 回款金额输入框 -->
<uni-popup ref="inputDialog" type="dialog">
<!-- <uni-popup-dialog ref="inputClose" mode="input" inputType="digit" title="充值金额" placeholder="请输入充值金额"
@confirm="receivePay"></uni-popup-dialog> -->
<view style="background: #fff;width: 500rpx;height: 600rpx;border-radius: 10px;">
<view style="text-align: center;line-height: 80rpx;font-size: 36rpx;font-weight: 500;color: #777;">
充值金额
</view>
<view style="text-align: center;color: red;font-size: 12px;">
*如果想追加欠款,请输入负数
</view>
<view @tap="showPrice = true" style="width: 90%;border: 1px solid #eee;height: 70rpx;margin: 30rpx auto 0;">
<input type="number" v-model="keyboardNum" disabled placeholder="请输入充值金额" style="width: 100%;height: 100%;padding-left:20rpx;">
</view>
<view style="width: 90%;border: 1px solid #eee;height: 70rpx;margin: 30rpx auto 0;">
<uni-datetime-picker type="datetime" :clear-icon="false" v-model="single" />
</view>
<view style="width: 90%;border: 1px solid #eee;height: 140rpx;margin: 30rpx auto 0;">
<textarea maxlength="-1" @input='changeRemark($event)' v-model="rechargeRemark" placeholder="请输入充值备注" style='width: 100%;height: 100%;padding:5px' />
</view>
<view style="display: flex;border-top: 1px solid #eee;margin-top: 30rpx;text-align: center;font-size: 30rpx;line-height: 80rpx;">
<view style="flex: 1;" @tap='huicancel'>取消</view>
<view style="flex: 1;color: blue;border-left: 1px solid #eee;" @tap="receivePay()">确定</view>
</view>
</view>
</uni-popup>
<u-keyboard ref="uKeyboard" @confirm='keyboardConfirm' @cancel="keyCancel" @change="valChange" @backspace="backspace" :overlay='false' :closeOnClickOverlay='true' :defaultText="keyboardNum" mode="price" :show="showPrice"></u-keyboard>
</view>
</template>
<script>
export default {
data() {
return {
single: '',
popleType: '',
popleList: [],
showPrice:false,
keyboardNum:'',
horizontal: 'left',
goodsNum:'',
signCompany: '', // 1物流 2快递 3发车
people: '', //快递、物流、发车的id
radioType: '', //选择的是快递还是物流
companyType: '', //运输公司类型 快递公司有值 物流公司直接传空
modelShow:false,
status: 'loadmore',
remark:'',
rechargeRemark:'',
dayList:[{
name:'30天',
value:'30'
},{
name:'60天',
value:'60'
},{
name:'90天',
value:'90'
},{
name:'120天',
value:'120'
},{
name:'150天',
value:'150'
},{
name:'半年(180)',
value:'180'
},{
name:'210天',
value:'210'
},{
name:'240天',
value:'240'
},{
name:'270天',
value:'270'
},{
name:'300天',
value:'300'
},{
name:'330天',
value:'330'
},{
name:'一年以上',
value:'365'
}],
userId:'',
noDaysort:false,
allData:{},
allBalanceData:{},
sort:'',
notBuyDays:'',
nahuoDay:false,
khName:{},
isPrint:false,
userType:'',
content: [{
iconPath: '/static/images/tabbar/home.png',
selectedIconPath: '/static/images/tabbar/home-sel.png',
text: '批量删除',
active: false
}],
searchName:'',
pages: 1,
totalPages: 0,
noClick:0,
hour:0,
user:''
}
},
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();
}
this.getAllPeople()
},
onLoad(options) {
this.popleType = options.popleType
this.noClick = options.noClick || 0
this.companyType = options.companyType || ''
uni.setStorageSync('clearMsg','1')
this.user = uni.getStorageSync('username')
this.userType = uni.getStorageSync('type')
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: {
getMonth() {
this.single = Date.now()
},
changeRemark(e) {
this.rechargeRemark = e.detail.value
},
huicancel(){
this.$refs.inputDialog.close()
this.keyboardNum = ''
},
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,
sort:this.sort,
notBuyDays:this.notBuyDays
}, 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)
}
})
}
},
keyboardConfirm(){
// if(this.keyboardNum != ''){
// this.keyboardNum
// }
this.showPrice = false
// this.keyboardNum = ''
},
//悬浮按钮
trigger() {
this.modelShow = true
uni.navigateTo({
url: '/package1/index/delPeople?popleType=' + this.popleType
})
},
keyCancel(){
this.showPrice = false
this.keyboardNum = ''
},
// 按键被点击(点击退格键不会触发此事件)
valChange(val) {
// 将每次按键的值拼接到value变量中,注意+=写法
this.keyboardNum += val
},
// 退格键被点击
backspace(val) {
this.keyboardNum = val
this.goodsNum = val
},
clearSearch(){
this.popleList = []
this.pages = 1
this.searchName = ""
this.sort = ""
this.notBuyDays = ""
this.noDaysort = false
this.nahuoDay = false
this.getPeopleType()
},
changeSort(type){
if(type == 'nahuo'){
this.noDaysort = false
this.nahuoDay = !this.nahuoDay
}else{
this.nahuoDay = false
this.noDaysort = !this.noDaysort
}
},
nahuoChange(item){
if(!item){
this.tui.toast("请输入拿货天数")
}
this.notBuyDays = item
this.popleList = []
this.pages = 1
this.searchName = ""
this.sort = ""
this.noDaysort = false
this.nahuoDay = false
this.khOrGysList()
},
paixuChange(text){
this.sort = text
this.popleList = []
this.pages = 1
this.searchName = ""
this.notBuyDays = ""
this.noDaysort = false
this.nahuoDay = false
this.khOrGysList()
},
//物流或者快递列表
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 = false
url = '/app/logitics/getAll'
data = {
signCompany:5,
seachParams:this.searchName
}
}
this.tui.request(url, "post", data, false, isTrue).then((res) => {
this.status = 'nomore';
if (res.code == 200) {
if(e == 'kdName' || e == 'dbName'){
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.isAfterNoon() && this.popleType== 'dbName'){
this.tui.toast('大巴车已下线')
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
}
uni.navigateBack({
delta: 1
})
}
},
//大巴车判断是否超过了下午两点,超过不能选择
isAfterNoon() {
const now = new Date();
const hour = now.getHours();
return hour >= 14; // 下午2点对应的小时数是14(注意:JS中的getHours() 返回的是0到23的整数)
},
//拨打电话
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
})
},
//回款按钮
receivePay(e){
this.tui.request('/app/debt/recharge', "post", {
userId:this.userId,
amountOwed:this.keyboardNum,
dealingsTime:this.single,
remark:this.rechargeRemark,
userType:this.popleType == 'khName'?'0':this.popleType == 'gysName'?'1':''
}, false, false).then((res) => {
if (res.code == 200) {
this.pages = 1
this.popleList = []
this.khOrGysList()
this.getAllPeople()
this.tui.toast('充值成功')
this.keyboardNum = ''
this.$refs.inputDialog.close()
}else{
this.keyboardNum = ""
this.tui.toast(res.message)
}
})
},
getAllPeople(){
this.tui.request('/app/debt/getAllDebtByShopId', "post", {
shopId:uni.getStorageSync('shopId'),
userType:this.popleType == 'khName'?'0':this.popleType == 'gysName'?'1':""
}, false, false).then((res) => {
if (res.code == 200) {
this.allData = res.result
}else{
}
})
this.tui.request('/app/debt/getAllBalanceByShopId', "post", {
shopId:uni.getStorageSync('shopId'),
userType:this.popleType == 'khName'?'0':this.popleType == 'gysName'?'1':""
}, false, false).then((res) => {
if (res.code == 200) {
this.allBalanceData = res.result
}else{
}
})
},
goDetail(data){
uni.navigateTo({
url: "/package1/index/customAndSupplierProductDetail?popleType="+this.popleType+'&id='+data.id
})
},
//打开弹出层
toggle(type,item) {
if(type == 'huikuan'){
this.userId = item.id
this.getMonth()
this.$refs.inputDialog.open()
}else{
uni.setStorageSync("transCompany", item.shippingMethodId || item.id)
uni.navigateTo({
url: "/package2/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);
}
.shaixuan-box{
width: 100%;
height: 80rpx;
display: flex;
text-align: center;
line-height: 80rpx;
background: #fff;
border-top: 1px solid #eee;
}
.nahuo-content{
width: 30%;
height: 40px;
line-height: 40px;
text-align: center;
background: #eee;
border-radius: 5px;
margin: 10px 0 10px 20rpx;
float: left;
}
.nahuo-content:nth-child(1)
,.nahuo-content:nth-child(4)
,.nahuo-content:nth-child(7)
,.nahuo-content:nth-child(10){
margin: 10px 0 10px 10rpx;
}
.nahuo-mask{
height: 1500rpx;
background: rgba(0, 0, 0, 0.6);
}
.paixu-content{
height: 100rpx;
line-height: 100rpx;
text-align: center;
font-size: 30rpx;
font-weight: bold;
}
.get-btn{
height: 80rpx;
line-height: 80rpx;
width: 100rpx;
text-align: center;
border-radius: 5px;
background: #088FEB;
color: #fff;
}
.uni-easyinput__content,.is-input-border{
height: 80rpx;
}
.uni-easyinput{
height: 80rpx;
}
</style>