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

1334 lines
48 KiB

<template>
<view class="page1">
<view style="position: fixed;top: 0;z-index: 99;height: 70px;width: 100%;display: flex;background: #fff;padding-top: 30px;">
<uni-icons type="left" size='10' @tap="backPage"></uni-icons>
</view>
<view style="width: 100%;position: fixed;top: 70px;z-index: 99;background: #fff;">
<view style="width: 100%;display:flex;padding: 0 10px 10px;">
<view v-if="popleType== 'khName'" style="display: flex;width: 50%;line-height: 40px;text-align: center;">
<view style="width: 50%;">
欠款:<text style="margin-right: 20px;">{{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: 20px;">{{allBalanceData.personCount?allBalanceData.personCount:0}}人 </text>
共<text style="color: red;">{{allBalanceData.amountOwed?Math.abs(allBalanceData.amountOwed):0}}元</text>
</view>
</view>
<view v-if="popleType== 'gysName'" style="display: flex;width: 50%;line-height: 40px;text-align: center;">
<view style="width: 33%;"><text>欠款人数</text><text style="color:red">{{allData.personCount?allData.personCount:0}}</text></view>
<view style="width: 33%;"><text>欠款总额</text><text style="color:red">{{allData.amountOwed?allData.amountOwed:0}}</text></view>
<view style="width: 33%;"><text>今日入库件数</text><text style="color:red">{{allData.purchasingCount?allData.purchasingCount:0}}</text></view>
</view>
<view style="width: 50%;display: flex;">
<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' || popleType== 'gysName'" style="background: #fff;display: flex;width:50%;">
<view @tap="goAddPeople" style="text-align: center;height: 40px;margin: 0 10px;padding: 0 5px;background: #60F3FF;line-height: 40px;border-radius: 10px;color: #fff;">
{{popleType=='khName'?'新增客户':'新增供应商'}}
</view>
<view @tap="trigger" style="text-align: center;height: 40px;margin: 0 10px;padding: 0 5px;background: #EEE;line-height: 40px;border-radius: 10px;color: #777;">
批量删除
</view>
</view>
</view>
</view>
<view v-if="popleType=='khName'">
<view class="shaixuan-box">
<view style="flex: 1;" @tap="changeSort('nahuo')">
拿货天数
<uni-icons type="down" size="5"></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="5" v-if="noDaysort == false"></uni-icons>
<uni-icons type="up" size="5" v-if="noDaysort"></uni-icons>
</view>
<view style="width: 100px;" @tap="clearSearch">
<uni-icons type="close" size="11" color="#777"></uni-icons>
</view>
</view>
<view class="nahuo-mask" v-if="nahuoDay">
<view style="width: 100%;margin: 0 auto;background: #fff;height: auto;border: 1px solid #eee;border-bottom-left-radius: 10px;border-bottom-right-radius: 10px;">
<view style="height: auto;min-height: 120px;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 style="width:150px;height: 40px;line-height:40px;border: 1px solid #eee;padding-left: 20px;float: left;margin: 10px 0 10px 10px;">
<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: auto;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'? '160px':popleType == 'gysName'?'120px' :'100px'}">
<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="{'height': item.name == '散客' ?'80px':'85px'}" style="display: flex;flex-direction: column;">
<view class="name-tel" style="width: 100%;display: flex;flex-direction: row;" v-if="popleType=='gysName'">
<text style="width: 70%;margin: 10px 0;">{{item.consigneeName}} ({{item.consigneeMobile != 'undefined' &&item.consigneeMobile != null &&item.consigneeMobile != undefined ?item.consigneeMobile:'-'}})</text>
<view style="float:right;width: 30%;text-align: right;padding-right: 20px;">
<view v-if="item.noEarn > 0 && userType == 0" style="color: red;">
欠款:{{item.noEarn?item.noEarn :0}}
</view>
<view v-if="item.noEarn < 0 && userType == 0" style="color: red;">
余额:{{item.noEarn?Math.abs(item.noEarn) :0}}
</view>
</view>
</view>
<view class="name-tel" style="width: 100%;" v-else>
<view style="width: 100%;margin: 10px 0 0;display: flex;height: 60px;">
<view v-if="item.miniProgramOpenid != null && item.miniProgramOpenid != ''" @tap.stop="attentionWx('1',item)" style="width:30px;height: 30px;">
<uni-icons type="weixin" size="11" color="green"></uni-icons>
</view>
<view v-else @tap.stop="attentionWx('2',item)" style="width:30px;height: 30px;">
<uni-icons type="weixin" size="11" color="#777"></uni-icons>
</view>
<view v-if="item.officialAccountOpenid != null && item.officialAccountOpenid != ''" @tap.stop="attentionWx('3',item)" style="width:30px;height: 30px;">
<uni-icons type="email-filled" size="11" color="#FFEC8B"></uni-icons>
</view>
<view v-else @tap.stop="attentionWx('4',item)" style="width:30px;height: 30px;">
<uni-icons type="email-filled" size="11" color="#777"></uni-icons>
</view>
<view style="width: 30%;line-height: 30px;">
{{item.name}}
<text v-if="item.name != '散客'">
({{item.phone }})
</text>
</view>
<view style="width: 30%;height: 40px;">
<text v-if="item.categoryName != null && item.categoryName != 'null'">客户分类:{{item.categoryName }}</text>
</view>
<view style="width:30%;">
<view style="float:right;">
<view v-if="popleType== 'khName' && item.noEarn > 0 && userType == 0" style="color: red;">
欠款:{{item.noEarn?item.noEarn :0}}
</view>
<view v-if="popleType== 'gysName' && item.noEarn > 0 && userType == 0" style="color: red;">
欠款:{{item.noEarn?item.noEarn :0}}
</view>
<view v-if="popleType== 'khName' && item.noEarn < 0 && userType == 0" style="color: red;">
余额:{{item.noEarn?Math.abs(item.noEarn) :0}}
</view>
<view v-if="popleType== 'gysName' && item.noEarn < 0 && userType == 0" style="color: red;">
余额:{{item.noEarn?Math.abs(item.noEarn) :0}}
</view>
</view>
<view v-if="item.notBuyDays!=null && item.name != '散客'" style="float:right;margin-right: 20px;">
{{item.notBuyDays+'天未拿货'}}
</view>
</view>
</view>
</view>
<view style="width:100%;">
<view class="name-tel" style="width: 64%;height:60px;font-size: 14px;color:#747474;line-height: 30px;float: left;">
{{(item.name == '散客' || item.consigneeName == '默认供应商') && item.city != null && item.city != undefined?'-':item.province + item.city + item.area}}
{{(item.name == '散客' || item.consigneeName == '默认供应商')?'-':item.address}}
</view>
<view style="width:36%;float: left;margin-top: 5px;">
<view class="name-edit" @tap.stop="toggle('huikuan',item)">
充值
</view>
<view v-if="item.name != '散客' && item.consigneeName !='默认供应商'" class="name-edit" @tap.stop="goAddPeople('edit',item)">
编辑
</view>
<view class="name-edit" v-if="userType==0" @tap.stop="goDetail(item)" style="background: #FF9797;bottom:16px">
查看明细
</view>
<view class="name-edit" v-if="popleType== 'gysName' && item.supplierNotConfirmPurductCount > 0" @tap.stop="toggle('daiqueren',item)" style="padding:0 5px;background: #FF9797;width: auto;">
欠货数({{item.supplierNotConfirmPurductCount}})
</view>
</view>
</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'?'75px':'120px'}" style="display: flex;position: relative;" @tap="clickList(item)">
<view class="name-tel">
<text style="line-height: 75px;" v-if="item.companyName">{{item.companyName}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
<text style="line-height: 75px;" v-if="item.shippingMethod">{{item.shippingMethod}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
<text style="line-height: 75px;" 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:40px;">线路查询</text>
<uni-icons type="info" color='#088FEB' size="16" style="line-height: 75px;"></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: 40px;" v-if="popleType == 'fcName' || popleType == 'lbgName' || popleType == 'wlName'">
<text style="line-height: 45px;color:red;font-size: 14px;" 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'?'75px':'120px'}" 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: 120px;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: 75px;" v-if="item.companyName">{{item.companyName}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
<text style="line-height: 75px;" v-if="item.shippingMethod">{{item.shippingMethod}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
<text style="line-height: 75px;" 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:40px;">线路查询</text>
<uni-icons type="info" color='#088FEB' size="16" style="line-height: 75px;"></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: 40px;" v-if="popleType == 'fcName' || popleType == 'lbgName' || popleType == 'wlName'">
<text style="line-height: 45px;color:red;font-size: 14px;" 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'?'75px':'120px'}" 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: 120px;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: 75px;" v-if="item.companyName">{{item.companyName}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
<text style="line-height: 75px;" v-if="item.shippingMethod">{{item.shippingMethod}} <text v-if="item.isOnLine == 0" style="color: red;">(已下线)</text></text>
<text style="line-height: 75px;" 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:40px;">收费标准</text>
<uni-icons type="info" color='#088FEB' size="16" style="line-height: 75px;"></uni-icons>
</view>
<view class="phone-btn" :style="{'line-height':(popleType !='kdyName' && popleType !='lbgName')?'':'80px'}" @tap.stop="clickPhone(item.mobile)" v-if="popleType != 'kdName'">拨打电话</view>
</view>
<!-- <view style="position: absolute;bottom: 0;left: 40px;" v-if="popleType == 'fcName' || popleType == 'lbgName' || popleType == 'wlName'">
<text style="line-height: 45px;color:red;font-size: 24px;" 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:40px;line-height: 40px;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" @change="huiPopup" type="dialog">
<!-- <uni-popup-dialog ref="inputClose" mode="input" inputType="digit" title="充值金额" placeholder="请输入充值金额"
@confirm="receivePay"></uni-popup-dialog> -->
<view style="background: #fff;width: 300px;height: 300px;border-radius: 10px;">
<view style="text-align: center;line-height: 40px;font-weight: 500;color: #777;">
充值金额
</view>
<view style="text-align: center;color: red;">
*如果想追加欠款,请输入负数
</view>
<view @tap="showPrice = true" style="width: 90%;border: 1px solid #eee;height: 40px;margin: 10px auto 0;">
<input type="text" v-model="keyboardNum" @blur="handleNum" placeholder="请输入充值金额" style="width: 100%;height: 100%;padding-left:20px;">
</view>
<view style="width: 90%;border: 1px solid #eee;height: 40px;margin: 10px auto 0;">
<uni-datetime-picker type="datetime" :clear-icon="false" v-model="single" />
</view>
<view style="width: 90%;border: 1px solid #eee;height: 80px;margin: 10px 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: 10px;text-align: center;line-height: 40px;">
<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>
<!-- 待确认列表 -->
<uni-popup ref="waitConfrimPopup" background-color="#fff">
<view style="background: #fff;border-radius: 10px;overflow: scroll;" :style="{'height':screenHeight*0.8+'px !important'}">
<view style="background: #fff;border: 1px solid #eee;">
<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="text"
activeColor="#007aff"></uni-segmented-control>
</view>
<view class="content">
<view v-show="current === 0">
<ul>
<li v-for="(item,index) in inventoryList" @tap="goInventoryDetail(item)" :key="index">
<view style="box-shadow: 0px 0px 3px 1px rgba(0, 0, 0, 0.08);height: 40px;width: 95%;border-radius: 5px;margin: 10px auto;padding: 10px 20px;display: flex;">
<view style="flex: 1;">时间:{{item.purchaseTime == null ?'暂无':item.purchaseTime}}</view>
<view style="flex: 1;">入库人:{{item.createByName == null ?'暂无':item.createByName}}</view>
<view>欠货:{{item.totalUnshippedCount}}</view>
</view>
</li>
</ul>
</view>
<view v-show="current === 1">
<uni-table border stripe emptyText="暂无更多数据">
<!-- 表头行 -->
<uni-tr style="background: #eee;">
<uni-th align="center" width="60">货号</uni-th>
<uni-th align="center" width="50">名称</uni-th>
<uni-th align="center" width="70">欠货</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<!-- <uni-tr v-for="(item1,index) in item.saleDetailDTOList" :key="index" @tap="$refs.waitListPopup.open()"> -->
<uni-tr @tap="getProductDetail(item)" v-for="(item,index) in inventoryList" :key="index">
<uni-td align="center">{{item.productSn == null ? '' : item.productSn}}</uni-td>
<uni-td align="center">{{item.productName == null ? '' : item.productName}}</uni-td>
<uni-td align="center">{{item.totalUnshippedCount == null ? '' : item.totalUnshippedCount}}</uni-td>
</uni-tr>
</uni-table>
</view>
</view>
</view>
</uni-popup>
<!-- 欠货列表弹窗 -->
<uni-popup ref="waitListPopup" background-color="#fff">
<view style="width: 500px;height:400px;background: #fff;border-radius: 10px;position: relative;overflow: scroll;padding: 0 20px;">
<view style="text-align: center;line-height: 40px;font-weight: 500;color: #000;border-bottom: 1px solid #eee;">
修改欠货数
</view>
<view>
<view style="border-bottom: 1px solid #eee;display: flex;" v-if='detailType == 1' v-for="(item,index) in storeProductDetailList" :key="index">
<view style="height: 40px;line-height: 40px;">时间:{{item.purchaseTime == null ? '' : item.purchaseTime}}</view>
<view style="height: 40px;line-height: 40px;flex: 1;padding-left: 20px;overflow: hidden;">入库人:{{item.createByName == null ? '' : item.createByName}}</view>
<view style="height: 40px;line-height: 30px;display: flex;padding-top: 5px;">
<text>欠</text>
<input type="text" v-model= "item.totalUnshippedCount" @focus="getOldCount($event)" @blur="changeStoreCount($event,item)" style="height: 30px;line-height: 30px;width: 50%;border: 1px solid #eee;text-align: center;">
<text>件</text>
</view>
</view>
<view style="border-bottom: 1px solid #eee;display: flex;" v-if = 'detailType == 0' v-for="(item,index) in storeProductDetailList" :key="index">
<view style="height: 40px;line-height: 40px;flex: 1;">货号:{{item.productSn == null ? '' : item.productSn}}</view>
<view style="height: 40px;line-height: 40px;flex: 1;">
名称:{{item.productName == null ? '' : item.productName}}
</view>
<view style="height: 40px;line-height: 30px;display: flex;padding-top: 5px;">
<text>欠</text>
<input type="text" v-model= "item.productCount" @focus="getOldCount($event)" @blur="changePurStoreCount($event,item)" style="height: 30px;line-height: 30px;width: 50%;border: 1px solid #eee;text-align: center;">
<text>件</text>
</view>
</view>
</view>
</view>
</uni-popup>
<!-- 分享确认弹窗 -->
<uni-popup ref="sharePopup" background-color="#fff">
<view class="type-popup">
<view style="height: 40px;font-size: 14px;font-weight: bold;line-height: 40px;text-align: center;">
提示
</view>
<view style="height: 60px;font-size: 14px;text-align: center;font-weight: bold;line-height:40px;">
该客户暂未注册使用快衣店,是否邀请注册?
</view>
<view
style="font-size:14px;width: 100%;height: 40px;line-height: 40px;text-align: center;border-radius: 0;background: linear-gradient(90deg, #60F3FF, #088FEB);color: #fff;display: flex;position: absolute;bottom: 0;">
<view style="width:50%;" @tap="$refs.sharePopup.close()">取消</view>
<view style="width:50%;">
<button open-type="share" style="background: linear-gradient(90deg, #FF9797, #FFC1E0);color:#fff;border-radius: 0;font-size: 14px;height:40px;line-height: 40px;width: 100%;">
确认
</button>
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
export default {
data() {
return {
items: ['按入库单查看', '按商品查看'],
current: 0,
single: '',
popleType: '',
oldCount:0,
popleList: [],
FWHPic:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/f2ba2080aaa54c618c2e47df4f220087.png',
showPrice:false,
keyboardNum:'',
storeProductDetailList:[],
horizontal: 'left',
sendUserId:'',
detailType:0,
goodsNum:'',
inventoryList:[],
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,
upNewItem:{},
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:'',
screenHeight:0,
supplierId:''
}
},
onReachBottom() {
if (this.pages >= this.totalPages) return;
this.status = 'loading';
this.pages = ++this.pages;
this.getPeopleType();
},
async onShareAppMessage() {
this.$refs.sharePopup.close()
return {
title: uni.getStorageSync('shopName') + '邀请你注册快衣店!',
imageUrl:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/3c50b6541b2d4780bab4b3fd0c0af490.jpg',
path: '/package2/login/login?customId=' + this.userId
}
},
onShow(){
if(this.modelShow == true){
this.popleType = this.popleType
this.khOrGysList();
}
this.getAllPeople()
},
onLoad(options) {
// 同步方式获取屏幕信息
const systemInfo = uni.getSystemInfoSync();
this.screenWidth = systemInfo.screenWidth
this.screenHeight = systemInfo.windowHeight
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: {
handleNum(){
this.keyboardNum = this.handleNumber(this.keyboardNum)
},
handleNumber(num) {
console.log('处理数字',num)
num = num.toString()
// 1. 过滤非法字符(只保留数字、负号、小数点)
let str = num.replace(/[^0-9.-]/g, '');
if (str === '') return '0';
let sign = '';
// 2. 处理负号:只保留开头的负号
if (str.startsWith('-')) {
sign = '-';
str = str.substring(1).replace(/-/g, ''); // 移除其他负号
} else {
str = str.replace(/-/g, ''); // 移除所有负号
}
// 3. 处理小数点:只保留第一个
let parts = str.split('.');
if (parts.length > 1) {
str = parts[0] + '.' + parts.slice(1).join('');
}
let integerPart = '';
let decimalPart = '';
// 4. 分割整数和小数部分
if (str.includes('.')) {
[integerPart, decimalPart] = str.split('.');
} else {
integerPart = str;
}
// 5. 处理整数部分:删除前导零
integerPart = integerPart.replace(/^0+/, '');
if (integerPart === '') integerPart = '0'; // 如 "." → "0"
// 6. 组合数字
let numberStr = decimalPart === '' ? integerPart : `${integerPart}.${decimalPart}`;
// 7. 处理负零:数值为0时移除负号
if (integerPart === '0' && (decimalPart === '' || /^0*$/.test(decimalPart))) {
numberStr = '0';
sign = '';
}
return sign + numberStr;
},
onClickItem(e) {
if (this.current !== e.currentIndex) {
this.current = e.currentIndex
}
if (e.currentIndex == 0) {
this.inventoryList = []
this.orderOrGoodsToConfirm('0')
} else if (e.currentIndex == 1) {
this.inventoryList = []
this.orderOrGoodsToConfirm('1')
}
},
orderOrGoodsToConfirm(type){
this.tui.request("/app/purchase/notConfirmPurductCountGroup", "post", {
supplierId:this.supplierId,
type:type
}, false, true).then((res) => {
if (res.code == 200) {
this.inventoryList = res.result
}else{
this.tui.toast(res.message)
}
})
},
getMonth() {
this.single = Date.now()
},
changeRemark(e) {
this.rechargeRemark = e.detail.value
},
huicancel(){
this.$refs.inputDialog.close()
this.keyboardNum = ''
this.rechargeRemark = ""
},
//引导关注公众号按钮
attentionWx(type,item){
var that = this;
if(type == '1' || type == '3'){
if(type == '1'){
uni.showModal({
title: "提示",
content: "该用户已使用微信登录,是否解绑?",
success: function(res) {
if (res.confirm) {
// that.tui.request("/user/updateMiniProgramAndUnionid", "post", {
// id:item.userId,
// miniProgramOpenid:""
// }, false, false).then((res) => {
that.tui.request("/app/customer/updateUserId", "post", {
customerId:item.id,
userId:""
}, false, true).then((res) => {
that.khOrGysList();
})
// })
}
}
})
}else{
uni.showModal({
title: "提示",
content: "该用户已关注公众号,是否解绑?",
success: function(res) {
if (res.confirm) {
// that.tui.request("/user/updateMiniProgramAndUnionid", "post", {
// id:item.userId,
// officialAccountOpenid:""
// }, false, false).then((res) => {
that.tui.request("/app/customer/updateUserId", "post", {
customerId:item.id,
userId:""
}, false, true).then((res) => {
})
// })
}
}
})
}
}else if(type == '2'){
this.userId = item.id
this.$refs.sharePopup.open()
}else{
uni.showModal({
title: "提示",
content: "是否邀请客户关注服务号?",
success: function(res) {
if (res.confirm) {
uni.previewImage({
urls: [that.FWHPic]
})
}
}
})
}
},
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()
},
huiPopup(e){
if(e.show == false){
this.rechargeRemark = ""
}
},
//物流或者快递列表
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: "/package1/billing/addUser?type="+type+'&data='+JSON.stringify(data) + '&popleType=' + this.popleType
})
},
//回款按钮
receivePay(e){
let that = this
if(this.keyboardNum == '' || this.keyboardNum==0)return
if(this.popleType == 'khName'){
if(Number(this.keyboardNum) > 0){
this.rechargeRemark = '客户充值:' + this.rechargeRemark
}else{
this.rechargeRemark = '客户追加欠款:' + this.rechargeRemark
}
}else{
if(Number(this.keyboardNum) > 0){
this.rechargeRemark = '供应商充值:' + this.rechargeRemark
}else{
this.rechargeRemark = '供应商追加欠款:' + this.rechargeRemark
}
}
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('充值成功')
if(this.popleType == 'khName'){
if((this.upNewItem.officialAccountOpenid == null || this.upNewItem.officialAccountOpenid == '' || this.upNewItem.officialAccountOpenid == undefined || this.upNewItem.officialAccountOpenid == 'null') && this.upNewItem.name !='散客'){
uni.showModal({
title: "提示",
content: "该客户没有关注公众号,无法接收消息通知,是否邀请用户关注?",
success: function(res) {
if (res.confirm) {
uni.previewImage({
urls: [that.FWHPic]
})
}
}
})
}else{
this.rechargeMsgPush(this.keyboardNum,res.result)
}
}
this.keyboardNum = ''
this.rechargeRemark = ""
this.$refs.inputDialog.close()
}else{
this.keyboardNum = ""
this.rechargeRemark = ""
this.tui.toast(res.message)
}
})
},
//充值消息推送
rechargeMsgPush(e,res){
console.log(this.upNewItem)
let amount = 0
this.upNewItem.noEarn = this.upNewItem.noEarn > 0 ? Number(this.upNewItem.noEarn) * -1 : Math.abs(Number(this.upNewItem.noEarn))
amount = this.upNewItem.noEarn + Number(res.amountOwed)
let content = {
thing11:uni.getStorageSync('shopName') + '的动账提醒', //店铺名称
time2:res.dealingsTime, //充值时间
thing4:this.upNewItem.name, //顾客姓名
amount1:res.amountOwed, //充值金额
amount3:amount //账户总额
}
let oneShareData = {
shopAddress:uni.getStorageSync('shopAddress'),
shopRemark:uni.getStorageSync('shopRemark'),
shopMoblie:uni.getStorageSync('username'),
shopName:uni.getStorageSync('shopName'),
userName:this.upNewItem.name,
createByName:uni.getStorageSync('nickname'),
createTime:res.dealingsTime,
lastDebtAmount:this.upNewItem.noEarn> 0 ?this.upNewItem.noEarn * -1 :Math.abs(this.upNewItem.noEarn), //之前欠款
amount:res.amountOwed,
balanceDue:amount> 0 ?amount * -1 :Math.abs(amount), //本单后欠款
}
this.tui.request("/social/wechat/sendWechatTempMessage", "post", {
tempId:'WKCcMlr0UoXvulrhX-cBUeEELAd_ar_NnAnw30DjnQE',
title:'动账提醒',
content:JSON.stringify(content),
pagePath:'package1/index/rechargeRecord?oneShareData='+ JSON.stringify(oneShareData) + '&mini_program_openid=' + this.miniProgramOpenid + '&unionid=' + this.unionid +'&official_account_openid='+ this.officialAccountOpenid + '&userId='+ this.userId,
upNewType:"",
userId:this.sendUserId,
categoryId:""
}, false, false).then((res) => {
if (res.code == 200) {
console.log("成功")
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
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{
}
})
},
//根据入库单id查询详情
goInventoryDetail(item){
this.tui.request('/app/purchaseConfirm/getPurchaseConfirmByPurchaseId', "post", {
purchaseId:item.purchaseId
}, false, true).then((res) => {
if (res.code == 200) {
this.detailType = 0
this.storeProductDetailList = []
for(let i = 0;i<res.result.length;i++){
for(let j = 0;j<res.result[i].purchaseConfirmDetailsList.length;j++){
res.result[i].purchaseConfirmDetailsList[j].purId = res.result[i].purchaseId
this.storeProductDetailList.push(res.result[i].purchaseConfirmDetailsList[j])
}
}
this.$refs.waitListPopup.open()
}else{
}
})
},
getOldCount(e){
this.oldCount = e.target.value
},
getProductDetail(item){
this.tui.request('/app/purchaseConfirm/getPurchaseConfirmDetailsByProductId', "post", {
productId:item.productId
}, false, true).then((res) => {
if (res.code == 200) {
this.detailType = 1
this.storeProductDetailList = res.result
this.$refs.waitListPopup.open()
}
})
},
changeStoreCount(e,item){
this.tui.request('/app/purchaseConfirmDetails/updateProductCount', "post", {
id:item.purchaseConfirmDetailsId,
productCount:e.target.value
}, false, true).then((res) => {
if (res.code == 200) {
for(let i = 0;i<this.inventoryList.length;i++){
if(this.inventoryList[i].productId == item.productId){
this.inventoryList[i].totalUnshippedCount = Number(this.inventoryList[i].totalUnshippedCount) - (Number(this.oldCount) - Number(e.target.value))
}
}
for(let i = 0;i<this.popleList.length;i++){
if(this.popleList[i].id == this.supplierId){
this.popleList[i].supplierNotConfirmPurductCount = Number(this.popleList[i].supplierNotConfirmPurductCount) - (Number(this.oldCount) - Number(e.target.value))
}
}
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2];
prevPage.$vm.getSaleInfo()
this.$refs.waitListPopup.close()
}
})
},
backPage(){
uni.navigateBack()
},
changePurStoreCount(e,item){
this.tui.request('/app/purchaseConfirmDetails/updateProductCount', "post", {
id:item.id,
productCount:e.target.value
}, false, true).then((res) => {
if (res.code == 200) {
for(let i = 0;i<this.inventoryList.length;i++){
if(this.inventoryList[i].purchaseId == item.purId){
this.inventoryList[i].totalUnshippedCount = Number(this.inventoryList[i].totalUnshippedCount) - (Number(this.oldCount) - Number(e.target.value))
}
}
for(let i = 0;i<this.popleList.length;i++){
if(this.popleList[i].id == this.supplierId){
this.popleList[i].supplierNotConfirmPurductCount = Number(this.popleList[i].supplierNotConfirmPurductCount) - (Number(this.oldCount) - Number(e.target.value))
}
}
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2];
prevPage.$vm.getSaleInfo()
this.$refs.waitListPopup.close()
}
})
},
goDetail(data){
uni.navigateTo({
url: "/package1/index/customAndSupplierProductDetail?popleType="+this.popleType+'&id='+data.id + '&miniProgramOpenid='+data.miniProgramOpenid + '&officialAccountOpenid='+data.officialAccountOpenid + '&unionid='+data.unionid + '&userId=' + data.userId + '&name=' + data.name
})
},
//打开弹出层
toggle(type,item) {
if(type == 'huikuan'){
this.upNewItem = item
this.userId = item.id
this.sendUserId = item.userId
this.getMonth()
this.$refs.inputDialog.open()
}else if(type == 'daiqueren'){
this.supplierId = item.id
this.current = 0
this.$refs.waitConfrimPopup.open('bottom')
this.orderOrGoodsToConfirm('0')
}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>
page,.page1{
font-size: 14px;
}
button {
color: #ffffff;
background: #5fd9ee;
width: 90%;
}
.list-1 {
display: flex;
height: 150px;
border-bottom: 1px solid #eee;
background: #fff;
font-size: 14px;
margin: 10px auto 0;
width: 95%;
padding-left: 30px;
position: relative;
}
.name-tel {
width: 75%;
display: flex;
flex-direction: column;
height: 40px;
line-height: 30px;
font-size: 14px;
}
.name-edit{
width: 60px;
height: 30px;
background: #088FEB;
color: #fff;
font-size: 14px;
line-height: 30px;
text-align: center;
border-radius: 5px;
float: right;
margin-right: 10px;
}
.standard-box {
color: #088FEB;
width: 30%;
font-size: 14px;
}
.popup-content {
align-items: center;
justify-content: center;
padding: 30px;
width: 500px;
height: 700px;
background-color: #fff;
}
.title-box {
background: #fff;
width:50%;
}
.popup-title {
font-size: 14px;
font-weight: bold;
text-align: center;
position: relative;
}
.popup-container {
margin-top: 20px;
}
.phone-btn {
width: 150px;
color: #088FEB;
font-size: 14px;
padding-left:40px;
}
.no-more{
text-align: center;
color: #BEBEBE;
margin-top:20px;
}
.shop-mask {
width: 100%;
height: 120px;
position: absolute;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.6);
}
.shaixuan-box{
width: 100%;
height: 40px;
display: flex;
text-align: center;
line-height: 40px;
background: #fff;
border-top: 1px solid #eee;
}
.nahuo-content{
width: 85px;
height: 40px;
line-height: 40px;
text-align: center;
background: #eee;
border-radius: 5px;
margin: 10px 0 10px 10px;
float: left;
}
.nahuo-content:nth-child(11){
margin: 10px 0 10px 10px;
}
.nahuo-mask{
height: 1500px;
background: rgba(0, 0, 0, 0.6);
}
.paixu-content{
height: 40px;
line-height: 40px;
text-align: center;
font-size: 14px;
font-weight: bold;
}
.get-btn{
height: 40px;
line-height: 40px;
width: 80px;
text-align: center;
border-radius: 5px;
background: #088FEB;
color: #fff;
float: left;
margin-top:10px;
}
.uni-easyinput__content,.is-input-border{
height: 80px;
}
.uni-easyinput{
height: 80px;
}
.type-popup {
width: 300px;
height: 140px;
background: #fff;
border-radius: 10px;
position: relative;
}
</style>