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.
 
 
 
 
 

1230 lines
40 KiB

<template>
<view class="container">
<cmd-nav-bar iconOne="chevron-left" @iconOne="goToInfo" :title="shopName" background-color="#fff"></cmd-nav-bar>
<view v-if="enDayShow" @tap="bigFWHPic" style="width:100%;height:60rpx;margin-top: 180rpx;">
<u-notice-bar mode='horizontal' bgColor="#088FEB" color="#eee" :text="textArr"></u-notice-bar>
</view>
<view :style="{'margin-top':enDayShow?'0':'180rpx'}">
<uni-datetime-picker style="margin-bottom:10px;" v-model="range" type="daterange" @change="searchList" />
</view>
<view class="tui-order-item boxbg" v-if="type=='khName'">
<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 === 1">
<view class="shop-box" v-for="(item,index4) in list" :key="index4"
style="background: #fff;display: block;overflow: hidden;margin: 0 auto 10px;">
<view>
<view style="width: 100%;height: 80rpx;line-height: 80rpx;">
<text
style="display:inline-block;width: 55%;text-align: center;font-weight: bold;font-size: 30rpx;">
日期:{{item.createTime | removeStr}}
</text>
<text
style="display:inline-block;width: 45%;text-align: center;border-left: 1px solid #eee;">
操作:{{item.createByName}}
</text>
</view>
<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-th align="center" width="70">总价</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr v-for="(item1,index) in item.saleDetailDTOList" :key="index"
@tap="xiaoshouDetail('1',item1)">
<uni-td align="center">{{item1.productSn}}</uni-td>
<uni-td
align="center">{{item1.productCount == null ?'0':item1.productCount}}</uni-td>
<uni-td align="center">{{item1.discountAmount}}</uni-td>
<uni-td align="center">{{item1.discountAmount * item1.productCount}}</uni-td>
</uni-tr>
<uni-tr>
<uni-td align="center">
<text style="font-weight: bold;">总数量:</text>
</uni-td>
<uni-td align="center">
<text style="font-weight: bold;">{{item.productCount}}</text>
</uni-td>
<uni-td align="center">
<text style="font-weight: bold;">拿货总价:</text>
</uni-td>
<uni-td align="center">
<text style="font-weight: bold;">{{item.totalAmount}}</text>
</uni-td>
</uni-tr>
</uni-table>
</view>
</view>
</view>
<view v-show="current === 0">
<view
style="background: linear-gradient(90deg, #6484fa 0%, #66e8ff 100%);overflow: hidden;color:#eee;">
<view class="top" ref="top">
<view class="top1">
<view class="hello-box">
<view class="hello-left">
<text
style="font-size: 40rpx;font-weight: 800;line-height: 56rpx;color: rgba(86, 132, 255, 1);">
Hi
</text>
</view>
<view class="hello-name">
{{shopName+'对账单'}}
</view>
<view class="hello-right"></view>
</view>
<view class="hello-text">
欢迎查看客户:{{duizhangList.userName == null ?"" : duizhangList.userName}}的对账单
</view>
<view
style="text-align: center;display: flex;border-top: 1px solid #eee;padding: 10px 0;color: #7E5E60;position: absolute;top: 225rpx;width: 100%;font-weight: bold;">
<view style="display: flex;flex-direction: column;width: 20%;">
<text>{{duizhangList.initialArrears >= 0?'期初欠款':'期初余额'}}</text>
<text>{{duizhangList.initialArrears == null ?"0" :Math.abs(duizhangList.initialArrears)}}</text>
</view>
<view
style="display: flex;flex-direction: column;width: 20%;border-left: 1px solid #eee;">
<text>{{duizhangList.endArrears >= 0?'期末欠款':'期末余额'}}</text>
<text>{{duizhangList.endArrears == null ?"0" :Math.abs(duizhangList.endArrears)}}</text>
</view>
<view
style="display: flex;flex-direction: column;width: 20%;border-left: 1px solid #eee;">
<text>{{duizhangList.arrears >= 0?'本期欠款':'本期余额'}}</text>
<text>{{duizhangList.arrears == null ?"0" :Math.abs(duizhangList.arrears)}}</text>
</view>
<view
style="display: flex;flex-direction: column;width: 20%;border-left: 1px solid #eee;">
<text>拿货总额</text>
<text>{{duizhangList.totalSale == null ?"0" :duizhangList.totalSale}}</text>
</view>
<view
style="display: flex;flex-direction: column;width: 20%;border-left: 1px solid #eee;">
<text>退货总额</text>
<text>{{duizhangList.totalReturn == null ?"0" :duizhangList.totalReturn}}</text>
</view>
</view>
</view>
</view>
</view>
<view v-if="duizhangList" v-for="(item,index) in duizhangRecords" :key="index"
style="background: #fff;display: block;overflow: hidden;margin: 20rpx auto;width: 95%;border-radius: 10px;position: relative;">
<view style="display: flex;">
<view
style="margin-top: 40rpx;width: 100rpx;height: 100rpx;border-radius: 80rpx;background: #8470FF;color: #fff;font-size: 26rpx;padding: 17rpx 24rpx;margin: 35rpx 0 0 35rpx;">
{{item.dealingsType == 0 ?"销售开单" :item.dealingsType == 1 ?"退货" :item.dealingsType == 2 ?"回款" :item.dealingsType == 3 && item.amount< 0?"初始余额" :item.dealingsType == 3 && item.amount>= 0?"初始欠款" :item.dealingsType == 4 ?"充值金额" :item.dealingsType == 5 ?"追加欠款" :item.dealingsType == 6 ?"撤销订单":item.dealingsType == 99 ?"撤销充值" :""}}
</view>
<view style="height: 170rpx;line-height: 50rpx;padding-left: 30rpx;">
<view
style="color: #747474;font-size: 28rpx;font-weight: bold;font-size: 32rpx;color: #000;margin-top:36rpx;">
{{item.createTime | removeStr}}
</view>
<view style="color: #747474;font-size: 28rpx;">
操作人:{{item.createByName == null ?"" :item.createByName}}
</view>
<img v-if="item.delFlag == 1 && item.dealingsType == 0 && item.billSaleDetailVos != null" src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/7650e962bef14f529406866888eeff24.png" alt="" style="position: absolute;top: 0;right:0;width: 300rpx;height: 150rpx;" />
<img v-if="item.delFlag == 1 && (item.dealingsType == 4 || item.dealingsType == 5)" src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/7650e962bef14f529406866888eeff24.png" alt="" style="position: absolute;top: 0;right:0;width: 300rpx;height: 150rpx;" />
<img v-if="item.delFlag == 1 && item.dealingsType == 0 && item.billSaleDetailVos == null" src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/7517e15b5cf843d59b5b69c3a06a5d7b.png" alt="" style="position: absolute;top: 0;right:0;width: 200rpx;height: 110rpx;" />
<img v-if="item.dealingsType == 6 || item.dealingsType == 99" src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/862680ecfe5a48b1a410287fb45987ef.png" alt="" style="position: absolute;top: 0;right:0;width: 300rpx;height: 150rpx;" />
</view>
</view>
<view v-if="item.billSaleDetailVos != null || item.billReturnSaleDetailVos != null"
style="height: 60rpx;line-height: 60rpx;padding-left: 20rpx;font-size: 28rpx;background: #FFF0F5;color: #F08080;margin-bottom: 20rpx;width: 95%;margin: 0 auto 20rpx;border-radius: 5px;">
拿货数据~请查收
</view>
<view v-if="item.billSaleDetailVos != null"
style="width: 95%;margin: 0 auto;border: 1.5px solid #000;border-radius: 10px;">
<uni-table stripe>
<uni-tr style="background: #FFBF00;">
<uni-th align="center" width="120">
<text style="font-weight: bold;">
【销】
</text>
货号
</uni-th>
<uni-th align="center" width="55">数量</uni-th>
<uni-th align="center" width="70">销售价</uni-th>
<uni-th align="center" width="80">总价</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr v-for="(item1,index1) in item.billSaleDetailVos" :key="index1"
@tap="clickDetail(item1)">
<uni-td align="center">
<text>
{{item1.productSn == null ?"" :item1.productSn}}
</text>
</uni-td>
<uni-td
align="center">{{item1.productCount == null ?"0" :item1.productCount}}</uni-td>
<uni-td
align="center">{{item1.discountAmount == null ?"0" :item1.discountAmount}}</uni-td>
<uni-td
align="center">{{item1.totalAmount == null ?"0" :item1.totalAmount}}</uni-td>
</uni-tr>
</uni-table>
</view>
<view v-if="item.billReturnSaleDetailVos != null"
style="width: 95%;margin: 20rpx auto 0;border: 1.5px solid #000;border-radius: 10px;">
<uni-table stripe>
<uni-tr style="background: #FFBF00;">
<uni-th align="center" width="120">
<text style="font-weight: bold;color:#F08080;">
【退】
</text>
货号
</uni-th>
<!-- <uni-th align="center">规格</uni-th> -->
<uni-th align="center" width="55">数量</uni-th>
<uni-th align="center" width="70">退货价</uni-th>
<uni-th align="center" width="80">总价</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr v-for="(item1,index1) in item.billReturnSaleDetailVos" :key="index1"
@tap="clickDetail(item1)">
<uni-td align="center">
<text>
{{item1.productSn == null ?"" :item1.productSn}}
</text>
</uni-td>
<uni-td
align="center">{{item1.productCount == null ?"0" :item1.productCount}}</uni-td>
<uni-td
align="center">{{item1.discountAmount == null ?"0" :item1.discountAmount}}</uni-td>
<uni-td
align="center">{{item1.totalAmount == null ?"0" :item1.totalAmount}}</uni-td>
</uni-tr>
</uni-table>
</view>
<view style="border-bottom: 2px solid #eee;" v-if="item.billSaleDetailVos != null">
<view style="font-weight: bold;padding: 20rpx;">
付款明细:
</view>
<view>
<view>
<view style="padding-left: 20rpx;">
<text>销售金额:{{item.totalAmount == null ?"0" :item.totalAmount}}</text>
</view>
<view style="padding-left: 20rpx;">
<text>退货金额:{{item.returnSaleTotalAmount == null ?"0" :item.returnSaleTotalAmount}}</text>
</view>
</view>
<view style="padding-left: 20rpx;margin-top: 40rpx;">
<view>欠款抵退货:{{item.debtDeductionAmount == null ?"0" :item.debtDeductionAmount}}
</view>
<view>销售抵退货:{{item.saleDeductionAmount == null ?"0" :item.saleDeductionAmount}}
</view>
<view>
余额抵销售:{{item.balanceDeductionAmount == null ?"0" :item.balanceDeductionAmount}}
</view>
</view>
<view v-if="item.remark != '' && item.remark !=undefined && item.remark != null"
style="padding-left: 20rpx;margin-top: 40rpx;">
<view>备注:{{item.remark}}</view>
</view>
</view>
<view
style="padding-left: 10px;margin: 20px 0 10px;height: 60rpx;line-height: 60rpx;text-align: center;font-size: 30rpx;font-weight: bold;display: flex;">
<text style="flex: 1;">本单应收:{{item.realAmount == null ?"0" :item.realAmount}}</text>
<text
style="display: inline-block;padding-left: 20rpx;flex: 1;">本单实收:{{item.alreadyEarn == null ?"0" :item.alreadyEarn}}</text>
</view>
</view>
<view style="text-align: center;display: flex;padding: 10px 0;color: #000;">
<view v-if="item.lastDebtAmount >= 0" style="flex: 1;display: flex;flex-direction: column;">
<text>之前欠款</text>
<text>{{item.lastDebtAmount == null ?"0" :item.lastDebtAmount}}</text>
</view>
<view v-if="item.lastDebtAmount < 0" style="flex: 1;display: flex;flex-direction: column;">
<text>之前余额</text>
<text>{{item.lastDebtAmount == null ?"0" :Math.abs(item.lastDebtAmount)}}</text>
</view>
<view v-if="item.dealingsType == 5 || item.amount >= 0"
style="flex: 1;border-left: 1px solid #eee;display: flex;flex-direction: column;">
<text>{{item.dealingsType == 5?'追加欠款':item.dealingsType == 4?'充值金额':item.dealingsType == 6?'撤销余额':item.dealingsType == 10?'本单退款':'本单欠款'}}</text>
<text>{{item.amount == null ?"0" :item.dealingsType == 5?Math.abs(item.amount):item.amount}}</text>
</view>
<view v-if="item.amount < 0 && item.dealingsType != 5"
style="flex: 1;border-left: 1px solid #eee;display: flex;flex-direction: column;">
<text>{{item.dealingsType == 4?'充值金额':item.dealingsType == 6?'撤销欠款':'本单余额'}}</text>
<text>{{item.amount == null ?"0" :Math.abs(item.amount)}}</text>
</view>
<view v-if="item.balanceDue >= 0"
style="flex: 1;border-left: 1px solid #eee;display: flex;flex-direction: column;">
<text>{{item.dealingsType == 6?'撤销后欠款':'本单后欠款'}}</text>
<text>{{item.balanceDue == null ?"0" :item.balanceDue}}</text>
</view>
<view v-if="item.balanceDue < 0"
style="flex: 1;border-left: 1px solid #eee;display: flex;flex-direction: column;">
<text>{{item.dealingsType == 6?'撤销后余额':'本单后余额'}}</text>
<text>{{item.balanceDue == null ?"0" :Math.abs(item.balanceDue)}}</text>
</view>
</view>
</view>
<view style="text-align: center;margin-bottom:20rpx;">
<text>对账时间:{{duizhangList.queryDate == null ?"" :duizhangList.queryDate}}</text>
</view>
<view
style="text-align: center;height: 100rpx;line-height: 100rpx;border-top: 1px solid #eee;color: #777;">
<text>用快衣店AI,入库、开单更方便</text>
</view>
</view>
<view v-show="current === 2">
<view class="shop-box" v-for="(item,index4) in list" :key="index4"
style="background: #fff;display: block;overflow: hidden;margin: 0 auto 10px;">
<view>
<view
style="padding-left: 20rpx;margin: 40rpx 0; font-weight: bold;font-size: 36rpx;text-align: center;">
<text>货号:{{item.productSn == null?'':item.productSn}}</text>
</view>
<view style="text-align: center;margin-bottom:20rpx;">
<text>名称:{{item.productName == null?'':item.productName}}</text>
<text
style="padding: 0 20rpx;">总数量:{{item.productCount == undefined ?'0':item.productCount}}</text>
</view>
<uni-table border stripe emptyText="暂无更多数据">
<!-- 表头行 -->
<uni-tr style="background: #eee;">
<uni-th align="center" width="100">日期</uni-th>
<uni-th align="center" width="50">数量</uni-th>
<uni-th align="center" width="70">单价</uni-th>
<uni-th align="center" width="70">总价</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr v-for="(item1,index1) in item.customerBuySaleVoList" :key="index1"
@tap="xiaoshouDetail('2',item1)">
<uni-td align="center">{{item1.createTime | removeStr}}</uni-td>
<uni-td align="center">{{item1.productCount}}</uni-td>
<uni-td
align="center">{{item1.customerBuyProductDetailLogVos[0].realPrice}}</uni-td>
<uni-td
align="center">{{item1.customerBuyProductDetailLogVos[0].realPrice * item1.productCount}}</uni-td>
</uni-tr>
</uni-table>
</view>
</view>
</view>
<view v-show="current === 3">
<view v-for="(item,index) in list" :key="index"
style="background: #fff;display: block;overflow: hidden;margin: 0 auto 10px;">
<view style="width: 100%;height: 80rpx;line-height: 80rpx;">
<text
style="display:inline-block;width: 55%;text-align: center;font-weight: bold;font-size: 30rpx;">
日期:{{item.createTime | removeStr}}
</text>
<text
style="display:inline-block;width: 45%;text-align: center;border-left: 1px solid #eee;">
操作:{{item.createByName == null?'':item.createByName}}
</text>
</view>
<uni-table border stripe emptyText="暂无更多数据">
<!-- 表头行 -->
<uni-tr style="background: #eee;">
<uni-th align="center" width="85">货号</uni-th>
<uni-th align="center" width="50">数量</uni-th>
<uni-th align="center" width="70">退货价</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr v-for="(items,index1) in item.returnSaleDetailList" :key="index1"
@tap="xiaoshouDetail('3',items)">
<uni-td align="center">{{items.productSn == null ? '': items.productSn}}</uni-td>
<uni-td align="center">{{items.productCount}}</uni-td>
<uni-td align="center">{{items.discountAmount}}</uni-td>
</uni-tr>
</uni-table>
</view>
</view>
</view>
<view class="shop-box" v-if="type==1" v-for="(item,index3) in list" :key="index3">
<uni-card :title="'供应商:'+ (item.purchase.supplierName?item.purchase.supplierName:'暂无')"
:sub-title="item.purchase.createTime?item.purchase.createTime:'暂无'">
<view class="uni-body" style="text-align: center;">
总数量:{{item.purchase.totalAmount?item.purchase.totalAmount:'暂无'}}</view>
<view style="margin: 5px 0;height: 1px;background: #eee;"></view>
<view style="display: flex;border-bottom: 1px solid #eee;height: 50rpx;line-height: 50rpx;">
<view style="width: 49%;text-align: center;border-right: 1px solid #eee;">商品规格</view>
<view style="width: 50%;text-align: center;">总数量</view>
</view>
<view v-for="(items,index1) in item.purchaseDetails" :key="index1">
<view v-for="(data,index2) in items.stockLogList1" :key="index2"
style='height: 50rpx;line-height: 50rpx;'>
<view style="width: 49%;text-align: center;border-right: 1px solid #eee;float: left;">
{{data.attributeList | sliceMsg}}
</view>
<view style="width: 50%;text-align: center;float: left;">
{{data.productCount}}
</view>
</view>
</view>
</uni-card>
</view>
</view>
<u-loadmore :status="status" />
<!-- 弹出销售商品规格 -->
<uni-popup ref="xsdetailPopup" background-color="#fff">
<view class="detail-popup">
<view @tap="$refs.xsdetailPopup.close()"
style='width: 50rpx;height: 50rpx;position: absolute;right: 20rpx;top: 25rpx;'>
<uni-icons type="closeempty" color="red" size="22"></uni-icons>
</view>
<view style="height: 100rpx;line-height: 100rpx;font-weight: bold;font-size: 36rpx;text-align: center;">
规格数量详情
</view>
<uni-table border stripe emptyText="暂无更多数据" style="margin-bottom: 20rpx;border-radius: 10px;">
<!-- 表头行 -->
<uni-tr style="background: #eee;">
<uni-th align="center" width="80">规格</uni-th>
<uni-th align="center" width="55">数量</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr v-for="(item,index) in GDList" :key="index">
<uni-td align="center">{{item.attributeList | sliceMsg}}</uni-td>
<uni-td align="center">{{item.productCount}}</uni-td>
</uni-tr>
</uni-table>
</view>
</uni-popup>
<!-- 弹出商品规格 -->
<uni-popup ref="detailPopup" background-color="#fff">
<view style="width: 250px;min-height: 250px;max-height: 1000rpx;overflow: scroll;">
<view @tap="$refs.detailPopup.close()"
style='width: 50rpx;height: 50rpx;position: absolute;right: 20rpx;top: 25rpx;'>
<uni-icons type="closeempty" color="red" size="22"></uni-icons>
</view>
<view style="height: 100rpx;line-height: 100rpx;font-weight: bold;font-size: 36rpx;text-align: center;">
{{detailList.productName}}({{detailList.productSn}})
</view>
<uni-table border stripe emptyText="暂无更多数据" style="margin-bottom: 20rpx;">
<!-- 表头行 -->
<uni-tr style="background: #eee;">
<uni-th align="center" width="80">规格</uni-th>
<uni-th align="center" width="55">数量</uni-th>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr v-for="(item,index) in detailList.billAttributeListVos" :key="index">
<uni-td align="center">{{item.attributeList | sliceMsg}}</uni-td>
<uni-td align="center">{{item.productCount}}</uni-td>
</uni-tr>
</uni-table>
</view>
</uni-popup>
<!-- 分享确认弹窗 -->
<uni-popup ref="sharePopup" background-color="#fff">
<view class="type-popup">
<view style="height: 120rpx;font-size: 36rpx;font-weight: bold;line-height: 120rpx;text-align: center;">
提示
</view>
<view style="height: 80rpx;font-size: 28rpx;text-align: center;font-weight: bold;">
确认要将此条对账单分享给微信好友吗
</view>
<view
style="font-size:30rpx;width: 100%;height: 90rpx;line-height: 90rpx;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" class="btn-biankuang"
style="background: linear-gradient(90deg, #FF9797, #FFC1E0);color:#fff;border-radius: 0;">
确认
</button>
</view>
</view>
</view>
</uni-popup>
<!-- <view v-if="isSelfOrder == false" style="width: 100%;height: 100%;position: fixed;top: 0;background: #fff;text-align: center;padding-top: 45%;z-index: 120;">
暂无查看权限
</view> -->
</view>
</template>
<script>
import cmdNavBar from "@/components/cmd-nav-bar/cmd-nav-bar.vue";
import {
wxLogin
} from '@/utils/global.js'
export default {
components: {
cmdNavBar
},
data() {
return {
enDayShow:false,
textArr:['您还未关注快衣店服务号,暂无法接收充值及上新提醒,点击关注'],
FWHPic:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/f2ba2080aaa54c618c2e47df4f220087.png',
isSelfOrder:false,
list: [],
range: [],
GDList: [],
status: 'loadmore',
isDetail: '2',
pages: 1,
pageNum: 1,
userId: '',
customId:'',
shopId: '',
duizhangRecords: [],
detailList: {},
duizhangList: {},
type: '',
userType: uni.getStorageSync('type'),
items: ['对账单', '拿货(按订单)', '拿货(按商品)', '退货明细'],
current: 0,
shopName: "",
userName:''
}
},
filters: {
sliceMsg(val) {
var name = ''
if (typeof(val) == 'string') {
let newObj = JSON.parse(val)
for (let as in newObj) {
name += newObj[as] + '/'
}
}
return name;
},
removeStr(val) {
if (val == null) {
return "";
} else {
var dotIndex = val.indexOf('.');
if (dotIndex !== -1) {
return val.substring(0, dotIndex);
}
return val;
}
}
},
onShow(){
if(!uni.getStorageSync('officialAccountOpenid') && !uni.getStorageSync('shopId') && this.userName != '散客'){
this.getUserInfo()
}
},
onLoad(option) {
let that = this;
this.userId = option.userId
this.customId = option.customId
this.type = option.popleType
this.userName = option.userName
this.shopName = option.shopName ? option.shopName : uni.getStorageSync('shopName')
this.shopId = option.shopId ? option.shopId : uni.getStorageSync('shopId')
this.mini_program_openid = option.mini_program_openid
if (option.range) {
this.$nextTick(()=>{
this.range = JSON.parse(option.range)
this.$forceUpdate()
})
} else {
this.getMonth();
}
uni.setNavigationBarTitle({
title: this.shopName
});
/*
微信登录判断开始
*/
if(!uni.getStorageSync('shopId') && this.userName != '散客'){
this.contrastOpneId()
/*
微信登录判断结束
*/
}else{
this.isSelfOrder = true
}
this.duizhangdan()
/* if(uni.getStorageSync('mini_program_openid')){
this.getToken()
} */
},
onReachBottom() {
if (this.pageNum >= this.pages) return;
this.status = 'loading';
this.pageNum++;
if (this.current == 0) {
this.duizhangdan()
} else {
this.getList();
}
},
methods: {
async contrastOpneId() {
let openid1 = uni.getStorageSync('miniProgramOpenid')
let openid2 = this.mini_program_openid
if (openid1 != '' && openid1 != undefined && openid1 != null) {
if (openid2 != undefined &&openid2 != "undefined" && openid2 != 'null' && openid2 != '' && openid2 !=
null) {
if (openid1 != openid2) {
//缓存和分享的openid不一致
// this.tui.toast('暂无查看权限', 1000)
// return
} else {
this.isSelfOrder = true
this.$forceUpdate()
}
} else {
//调接口传customId更新userid
this.updateUserId()
this.isSelfOrder = true
this.$forceUpdate()
}
} else {
if(!uni.getStorageSync('shopId')){
await this.getOpenId(this.customId, uni.getStorageSync('id') ? uni.getStorageSync('id') : this.userId)
}
openid1 = uni.getStorageSync('miniProgramOpenid')
if (openid2 != undefined &&openid2 != "undefined" && openid2 != 'null' && openid2 != '' && openid2 != null) {
if (openid1 != openid2) {
//缓存和分享的openid不一致
// this.tui.toast('暂无查看权限', 1000)
// return
} else {
this.isSelfOrder = true
this.$forceUpdate()
}
} else {
//调接口传customId更新userid
this.updateUserId()
this.isSelfOrder = true
this.$forceUpdate()
}
}
},
//获取小程序openid
getOpenId(customId, userId) {
let that = this;
return new Promise((resolve, reject) => {
uni.login({
provider: 'weixin',
success(res) {
uni.getUserInfo({
provider: 'weixin',
success: function(infoRes) {
that.tui.request("/user/login", "post", {
jsCode: res.code,
customId: customId,
userId: userId,
wechatName: infoRes.userInfo.nickName,
userType: "2"
}, false, false).then((res) => {
if (res.code == 200) {
uni.setStorageSync("hiver_token", res
.result.accessToken)
uni.setStorageSync("wayValue", "2")
uni.setStorageSync("nickname", res.result
.user.nickname)
uni.setStorageSync("id", res.result.user
.id)
uni.setStorageSync('unionid', res.result
.user.unionid)
uni.setStorageSync('miniProgramOpenid', res
.result.user
.miniProgramOpenid)
uni.setStorageSync('officialAccountOpenid',
res.result.user
.officialAccountOpenid)
if(res.result.user.officialAccountOpenid == 'null' || res.result.user.officialAccountOpenid == null || res.result.user.officialAccountOpenid == undefined || res.result.user.officialAccountOpenid == ''){
that.enDayShow = true
that.$forceUpdate()
}
return resolve(res.result)
} else {
tui.toast(res.message)
}
}).catch((res) => {})
},
fail(err1) {
}
});
},
fail(err) {
}
});
});
},
updateUserId(){
this.tui.request("/app/customer/updateUserId", "post", {
customerId:this.customId,
userId:uni.getStorageSync('id')
}, false, true).then((res) => {
if (res.code != 200) {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
getUserInfo(){
this.tui.request("/user/getUserInfo", "post", {
miniProgramOpenid:uni.getStorageSync('miniProgramOpenid')
}, false, true).then((res) => {
if (res.code == 200) {
if(res.result.officialAccountOpenid == null || res.result.officialAccountOpenid == '' || res.result.officialAccountOpenid == 'null' || res.result.officialAccountOpenid == undefined){
this.enDayShow = true
}else{
uni.setStorageSync('officialAccountOpenid',res.result.officialAccountOpenid)
this.enDayShow = false
}
}
}).catch((res) => {})
},
bigFWHPic(){
uni.previewImage({
urls: [this.FWHPic]
})
},
goToInfo() {
uni.reLaunch({
url: '/pages/index/home'
})
},
//获取当月1日到当前时间
getMonth() {
let date = new Date()
let year = date.getFullYear().toString() //'年'
let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : (date.getMonth() + 1)
.toString() //'月'
let da = date.getDate() < 10 ? '0' + date.getDate().toString() : date.getDate().toString() //'日'
let end = year + '-' + month + '-' + da //当天
let beg = '2024-01-01' //当月第一天
this.range = [beg, end]
},
duizhangdan() {
var url, data
url = "/app/bill/getCustomerBill"
data = {
customerId: this.customId,
pageNum: this.pageNum,
pageSize: '10',
startDate: this.range[0],
endDate: this.range[1],
shopId: this.shopId
}
this.tui.request(url, "post", data, false, false).then((res) => {
if (res.code == 200) {
this.status = 'nomore';
if (this.pages == 1) {
this.duizhangList = res.result
this.duizhangRecords = res.result.customerBillSaleVos.records
} else {
for (let i = 0; i < res.result.customerBillSaleVos.records.length; i++) {
this.duizhangRecords.push(res.result.customerBillSaleVos.records[i])
}
}
this.pages = res.result.customerBillSaleVos.pages
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
xiaoshouDetail(type, item) {
if (item) {
if (type == '1') {
this.GDList = item.stockLogList1
this.$refs.xsdetailPopup.open()
} else if (type == '2') {
this.GDList = item.customerBuyProductDetailLogVos
this.$refs.xsdetailPopup.open()
} else if (type == '3') {
this.GDList = item.stockLogList1
this.$refs.xsdetailPopup.open()
}
}
},
getList(id) {
this.status = 'loading';
var url, data
if (this.current == 1) {
url = "/app/sale/listPages"
data = {
userId: this.customId,
pageVo: {
pageSize: 10,
pageNumber: this.pageNum
},
searchStr: "",
startTime: this.range[0],
endTime: this.range[1],
shopId: this.shopId,
fromWhere: 1
}
} else if (this.current == 2) {
url = "/app/sale/getCustomerBuyProductLog"
data = {
userId: this.customId,
pageSize: 10,
startDate: this.range[0],
endDate: this.range[1],
pageNum: this.pageNum,
shopId: this.shopId
}
} else if (this.current == 3) {
url = "/app/return/getReturnSaleListByUserId"
data = {
userId: this.customId,
startDate: this.range[0],
endDate: this.range[1],
pageNum: this.pageNum,
pageSize: "10",
shopId: this.shopId
}
}
this.tui.request(url, "post", data, false, false).then((res) => {
this.status = 'nomore';
if (res.code == 200) {
// this.list = res.result.records
if (this.pages == 1) {
this.list = res.result.records
} else {
this.list = [...this.list, ...res.result.records]
}
this.pages = res.result.pages
if (this.current == 1) {
for (let i = 0; i < this.list.length; i++) {
this.list[i].productCount = 0
for (let j = 0; j < this.list[i].saleDetailDTOList.length; j++) {
this.list[i].saleDetailDTOList[j].productCount = 0
for (let m = 0; m < this.list[i].saleDetailDTOList[j].stockLogList1
.length; m++) {
this.list[i].productCount += this.list[i]
.saleDetailDTOList[j].stockLogList1[m].productCount
this.list[i].saleDetailDTOList[j].productCount += this.list[i]
.saleDetailDTOList[j].stockLogList1[m].productCount
}
}
}
this.$forceUpdate()
} else if (this.current == 2) {
for (let i = 0; i < this.list.length; i++) {
this.list[i].productCount = 0
for (let j = 0; j < this.list[i].customerBuySaleVoList.length; j++) {
this.list[i].customerBuySaleVoList[j].productCount = 0
for (let m = 0; m < this.list[i].customerBuySaleVoList[j]
.customerBuyProductDetailLogVos.length; m++) {
this.list[i].productCount += this.list[i].customerBuySaleVoList[j]
.customerBuyProductDetailLogVos[m].productCount
this.list[i].customerBuySaleVoList[j].productCount += this.list[i]
.customerBuySaleVoList[j].customerBuyProductDetailLogVos[m]
.productCount
}
}
}
this.$forceUpdate()
} else if (this.current == 3) {
for (let i = 0; i < this.list.length; i++) {
for (let j = 0; j < this.list[i].returnSaleDetailList.length; j++) {
this.list[i].returnSaleDetailList[j].productCount = 0
for (let m = 0; m < this.list[i].returnSaleDetailList[j]
.stockLogList1.length; m++) {
this.list[i].returnSaleDetailList[j].productCount += this.list[i]
.returnSaleDetailList[j].stockLogList1[m]
.productCount
}
}
}
this.$forceUpdate()
}
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
clickDetail(item) {
this.detailList = item
this.$refs.detailPopup.open()
},
onClickItem(e) {
if (this.current !== e.currentIndex) {
this.current = e.currentIndex
}
if (e.currentIndex == 0) {
this.duizhangList = []
this.pageNum = 1
this.pages = 1
this.duizhangdan()
} else if (e.currentIndex == 1) {
this.list = []
this.pageNum = 1
this.getList()
} else if (e.currentIndex == 2) {
this.list = []
this.pageNum = 1
this.getList()
} else if (e.currentIndex == 3) {
this.list = []
this.pageNum = 1
this.getList()
}
},
searchList() {
if (this.current == 0) {
this.duizhangList = []
this.pageNum = 1
this.pages = 1
this.duizhangdan()
} else if (this.current == 1) {
this.list = []
this.pageNum = 1
this.getList()
} else if (this.current == 2) {
this.list = []
this.pageNum = 1
this.getList()
} else if (this.current == 3) {
this.list = []
this.pageNum = 1
this.getList()
}
},
},
}
</script>
<style lang="scss">
.uni-card__header-box {
text-align: center !important;
}
.uni-card__header-content-title {
font-weight: bold;
}
.container {
.boxbg {
padding-top: 10rpx;
background-color: #FAF7F7;
}
.tui-order-item {
.u-collapse-content {
display: flex;
justify-content: space-between;
line-height: 30px;
}
.tui-goods-info {
width: 100%;
box-sizing: border-box;
background: #fff;
line-height: 26px;
border-top: 10px solid #eee;
.tui-price-flex {
display: flex;
align-items: center;
justify-content: space-between;
}
.tui-size32 {
font-size: 32rpx;
font-weight: 500;
}
.tui-size-24 {
font-size: 24rpx;
}
.tui-price-large {
font-size: 32rpx;
.lineText {
text-decoration: line-through;
font-size: 12px;
color: #888;
}
}
.tui-flex-shrink {
flex-shrink: 0;
}
.tui-goods-price {
width: 100%;
display: flex;
align-items: flex-end;
justify-content: flex-end;
font-size: 24rpx;
}
.tui-primary-color {
color: #EB0909;
}
.tui-pbtm20 {
padding-bottom: 20rpx;
}
}
}
}
.tui-tabbar {
width: 100%;
height: 98rpx;
background: #fff;
position: fixed;
left: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 26rpx;
box-shadow: 0 0 1px rgba(0, 0, 0, .3);
padding-bottom: env(safe-area-inset-bottom);
z-index: 996;
}
.tui-btn-mr {
width: 130rpx;
height: 60rpx;
background: #088FEB;
color: #fff;
border-radius: 10px;
line-height: 60rpx;
text-align: center;
margin-right: 30rpx;
}
.shop-box {
margin: 0 auto;
position: relative;
}
.shop-name {
width: 100%;
height: 200rpx;
line-height: 80rpx;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
font-size: 28rpx;
font-weight: bold;
display: flex;
.uni-icons {
color: #088FEB !important;
}
}
.shop-productName {
flex: 1;
display: flex;
flex-direction: column;
padding-left: 20rpx;
}
.shop-productName view {
height: 55rpx;
}
.type-popup {
width: 500rpx;
height: 360rpx;
background: #fff;
border-radius: 10px;
position: relative;
border-radius: 10px;
}
.shop-collapse {
display: flex;
height: 80rpx;
font-size: 26rpx;
line-height: 80rpx;
}
.shop-collapse text {
flex: 1;
text-align: center;
padding-right: 40rpx;
border-right: 1px solid #eee;
}
.content-list {
width: 95%;
margin: 0 auto;
display: flex;
height: 80rpx;
border-bottom: 1px solid #eee;
}
.content-list:last-child {
border-bottom: none;
height: auto;
}
.list-name {
width: 200rpx;
text-align: left;
line-height: 40px;
height: 80rpx;
padding-left: 20rpx;
}
.list-val {
width: 560rpx;
height: 80rpx;
line-height: 80rpx;
}
.list-val input {
width: 400rpx;
height: 60rpx;
display: inline-block;
line-height: 60rpx;
float: left;
margin-top: 10rpx;
padding-left: 20rpx;
border-bottom: 1px solid #088FEB;
}
.shareBtn {
background: rgba(255, 255, 255, 0);
width: 90rpx;
height: 50;
height: 80rpx;
line-height: 80rpx;
border: 1px solid #f3f4f6;
background-color: rgba(255, 255, 255, 0);
}
.shareBtn::after {
border: none;
}
.btn-biankuang::after {
border: none;
}
textarea {
margin: 20rpx;
border: 1px solid #eee;
height: 150rpx;
width: 500rpx;
}
.uni-table-scroll {
width: 100%;
overflow-x: auto;
border-radius: 10px;
}
.uni-table-th {
background: #FAE7B5 !important;
color: #000 !important;
}
.top1 {
width: 780rpx;
height: 390rpx;
opacity: 1;
background: linear-gradient(360deg, #FAF7F7 0%, rgba(255, 255, 255, 0) 100%);
position: relative;
}
.hello-box {
position: absolute;
left: 42rpx;
top: 40rpx;
width: 220rpx;
height: 56rpx;
.hello-left {
width: 102rpx;
height: 56rpx;
opacity: 1;
background: #fff;
border-radius: 3px;
text-align: center;
transform: skewX(8deg);
}
.hello-right {
position: absolute;
left: 5px;
bottom: 0rpx;
width: 220rpx;
height: 2px;
opacity: 1;
background: linear-gradient(270deg, rgba(255, 255, 255, 0) 0%, #ffffff 100%);
}
.hello-name {
position: absolute;
left: 118rpx;
top: 0;
width: 400rpx;
height: 55rpx;
font-size: 32rpx;
line-height: 55rpx;
color: white;
overflow: hidden;
}
}
.hello-text {
position: absolute;
top: 115rpx;
left: 50rpx;
color: #fff;
font-size: 28rpx;
}
.top {
width: 780rpx;
height: 330rpx;
opacity: 1;
background: linear-gradient(90deg, #6484fa 0%, #66e8ff 100%);
overflow: hidden;
}
.detail-popup{
width: 500rpx;
min-height: 500rpx;
max-height: 1000rpx;
overflow: scroll;
}
@media screen and (min-width: 760px) {
.detail-popup{
max-height: 750px;
}
}
</style>