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

1232 lines
44 KiB

<template>
<view class="page1">
<cmd-nav-bar iconOne="menu" @iconOne="goToInfo" :title="shopName" background-color="#fff"></cmd-nav-bar>
<view class="IndexContent">
<view v-if="enDayShow" style="width:100%;height:60rpx;">
<u-notice-bar mode='horizontal' bgColor="#088FEB" color="#eee" :text="textArr"></u-notice-bar>
</view>
<view class="contentPadding" style="color: #000;padding: 10px 10px 0;">
<view class="title-btn-d">
<view class="title-btn-sbtn" @tap="goSonPage('/package1/index/order?listStatus=6')">
<view style="position: relative;display: flex;width:80%;margin: 0 auto;">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/15211be8bbf74600ba90e040c57e2f45.jpg"
alt="" class="title-img" style="margin-left: 15%;" />
<text style="display: inline-block;line-height: 40px;height: 40px;">待配货</text>
<text v-if="waitCount.waitAddProductCount > 0"
class="red-circle">{{waitCount.waitAddProductCount > 99 ? '99+' :waitCount.waitAddProductCount}}</text>
</view>
</view>
<view class="title-btn-sbtn" @tap="goSonPage('/package1/AI/AIHangOrderList')">
<view style="position: relative;display: flex;width:80%;margin: 0 auto;">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/750b982236234011a959d1afe68a8069.jpg"
alt="" class="title-img" style="margin-left: 20%;" />
<text style="display: inline-block;line-height: 40px;height: 40px;">挂单</text>
<text v-if="waitCount.registrationCount > 0"
class="red-circle" style="right:30px;">{{waitCount.registrationCount > 99 ? '99+' :waitCount.registrationCount}}</text>
</view>
</view>
<view class="title-btn-sbtn" @tap="goSonPage('/package2/inventory/goodsList1HENG')">
<view style="position: relative;display: flex;width:80%;margin: 0 auto;">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/83b7267c23b242d888385d7397542122.jpg"
alt="" class="title-img" style="margin-left: 20%;" />
<text style="display: inline-block;line-height: 40px;height: 40px;">开单</text>
</view>
</view>
<view class="title-btn-sbtn" @tap="goSonPage('/package1/AI/waitStorageHeng?inStorageStatus=8')">
<view style="position: relative;display: flex;width:80%;margin: 0 auto;">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/b46f57fed2604228bcd1801a156fafbc.jpg"
alt="" class="title-img" />
<text style="display: inline-block;line-height: 40px;height: 40px;">AI图片入库</text>
</view>
</view>
<view class="title-btn-sbtn" @tap="goSonPage('/package1/AI/waitStorageHeng?inStorageStatus=1')">
<view style="position: relative;display: flex;width:100%;margin: 0 auto;">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/01c48cc06cfb4f44aa304fbc26df048c.jpg"
alt="" class="title-img" style="margin-left: 15%;" />
<text style="display: inline-block;line-height: 40px;height: 40px;">Ai语音入库</text>
</view>
</view>
</view>
</view>
<view class="waimai" :style="{'right':waimaiRight}" @tap="quwaimai"></view>
<view class="contentPadding">
<view class="title" style="display: flex;">
<i class="iconfont icon-xiaoshouyuce" style="flex: 1;font-size: 18px;font-weight: bold;"> 今日营收详情</i>
<i @tap="goInventory" v-if="warehouseKeeperFlag == 1 && storeFlag == 1 &&shopInfo.notConfirmPurductCount>0" style="height: 40px;line-height: 40px;font-size: 18px;font-weight: bold;">
{{shopInfo.notConfirmPurductCount==undefined?'0':shopInfo.notConfirmPurductCount}}笔待确认入库
</i>
</view>
<view style="display: flex;text-align: center;font-size: 14px;">
<view class="title-four">
<view style="line-height: 30px;font-size: 20px;">{{type==0?shopInfo.totalAmount:0}}</view>
<view>销售总金额</view>
</view>
<view class="title-four" @tap="showPayType" style="position: relative;">
<view style="line-height: 30px;font-size: 20px;">{{type==0?shopInfo.totalAlreadyEarn:0}}</view>
<view>
今日实收
<uni-icons type="help" size="7" v-if="type==0"
style="position: absolute;bottom: 0;right: 10px;height:30px;"></uni-icons>
</view>
</view>
<view class="title-four" @tap='shijiPrice = true' style="position: relative;">
<view style="line-height: 30px;font-size: 20px;">{{type==0?(shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost).toFixed(2):0}}</view>
<view>
今日利润
<uni-icons type="help" size="7" v-if="type==0"
style="position: absolute;bottom: 0;right: 10px;height:30px;"></uni-icons>
</view>
</view>
<view class="title-four">
<view style="line-height: 30px;font-size: 20px;">{{shopInfo.totalCCount}}</view>
<view>下单客户</view>
</view>
<view class="title-four">
<view style="line-height: 30px;font-size: 20px;">{{shopInfo.totalJCount}}</view>
<view>销售件数</view>
</view>
<view class="title-four">
<view style="line-height: 30px;font-size: 20px;">{{shopInfo.returnTotalAmount}}</view>
<view>退货金额</view>
</view>
<view class="title-four">
<view style="line-height: 30px;font-size: 20px;">{{shopInfo.returnTotalCount}}</view>
<view>退货数</view>
</view>
</view>
</view>
<view class="contentPadding" v-if="type==0">
<view class="title">
<i class="iconfont icon-huaban" style="font-size: 18px;font-weight: bold;"> 本周营收统计
<view class="btn" @tap="gotoSearchData">
数据统计 >
</view>
</i>
</view>
<qiun-data-charts type="column" :opts="opts" :chartData="chartData" canvas2d="true"
canvasId="canvsaId1" />
</view>
<view class="contentPadding">
<view class="title">
<i class="iconfont icon-wenjianliebiao" style="font-size: 18px;font-weight: bold;"> 近期订单列表</i>
</view>
<ul class="inventoryList" v-if="inventoryList.length > 0" style="padding: 0 20px;">
<li v-for="item in inventoryList" :key="item.id" @tap="gotoDetail(item.id,item.userId)" style="display: flex;border-radius: 10px;margin: 10px 0;flex-direction: column;box-shadow:0 0px 6px 1px rgba(165, 165, 165, 0.2)">
<view style="display: flex;border-bottom: 1px solid #eee;">
<view style="flex: 1;display: flex;padding: 10px 20px;font-size: 18px;font-weight: bold;color: #777;">
<view style="width: 60px;height: 40px;margin-top: 5px;">
<img :src="item.img" alt="" mode="aspectFit" style="width: 60px;height: 40px;" />
</view>
<view>
<view>{{item.userName == null ?'暂无':item.userName}}</view>
<view>{{'销售金额:¥'+(item.totalAmount == null ?'暂无':item.totalAmount)}} <text v-if='item.returnSaleTotalAmount != null'>{{' _ 退货金额:¥'+(item.returnSaleTotalAmount == null ?'暂无':item.returnSaleTotalAmount)}}</text></view>
</view>
</view>
<view style="flex: 1;padding: 10px 20px;text-align: right;">
<view style="">
<text class="cardText">
订单状态:
</text>
{{item.status == '0' ?'待抢单' :item.status == '2' ?'作废' :item.status == '1' ?'待取货' :item.status == '3' ?'待送达' :item.status == '4' ?'已完成' :item.status == '5' ?'下游客户待退货' :item.status == '00' ?'退货待抢单' :item.status == '01' ?'退货待取货' :item.status == '03' ?'退货待送达' :item.status == '04' ?'待确认退货' :item.status == '6' ?'待配货':item.status == '8' ?'待物流上门':item.status == '9' ?'已完成' :'挂单'}}
</view>
<view style="">
<text class="cardText">
操作人:
</text>
{{ item.createByName == null ?'暂无':item.createByName}}
<text style="padding-left: 20px;">{{ item.createTime }}</text>
</view>
</view>
</view>
<view>
<view class="floatRight" v-if="item.status == 4 || item.status == 1 || item.status == 0" @tap.stop="cancelOrder(item)">撤销</view>
<view class="floatRight" v-if="item.status == 4 || item.status == 1 || item.status == 0" @tap.stop="cancelOrder(item,'goPay')">撤销并复制</view>
<view class="floatRight" v-if="item.status == 4 || item.status == 1 || item.status == 2" @tap.stop="copyOrder(item,'')">复制</view>
</view>
</li>
</ul>
<u-empty v-else mode="order" text="暂无订单,快去开单吧!"></u-empty>
</view>
</view>
<u-popup :show="settingShow" @close="settingShow = false" closeOnClickOverlay mode="left" safeAreaInsetTop>
<view class="popup-content">
<view style="z-index:999;height: 100%;padding-bottom:100px;overflow: scroll;font-size: 14px;">
<view class="menu-box" @tap="clickMenu('/package2/index/checkShop')">
<u-icon name="grid-fill" size="18"></u-icon>
<view class="menu-title">切换当前店铺</view>
<u-icon name="arrow-right" color="info" size="16"></u-icon>
</view>
<view class="border-line"></view>
<view class="menu-box" @tap="clickMenu('/package1/index/peopleList?popleType=gysName&noClick=1')">
<u-icon name="man-add-fill" size="18"></u-icon>
<view class="menu-title">供货商管理</view>
<u-icon name="arrow-right" color="info" size="16"></u-icon>
</view>
<view class="menu-box" @tap="clickMenu('/package1/AI/waitStorageHeng?inStorageStatus=1')">
<u-icon name="man-add-fill" size="18"></u-icon>
<view class="menu-title">采购单历史</view>
<u-icon name="arrow-right" color="info" size="16"></u-icon>
</view>
<view class="menu-box" @tap="clickMenu('/package1/inventory/inventoryReturnList')">
<u-icon name="man-add-fill" size="18"></u-icon>
<view class="menu-title">采购退货</view>
<u-icon name="arrow-right" color="info" size="16"></u-icon>
</view>
<view class="menu-box" @tap="clickMenu('/package2/stock/goodsStock')">
<u-icon name="man-add-fill" size="18"></u-icon>
<view class="menu-title">盘点管理</view>
<u-icon name="arrow-right" color="info" size="16"></u-icon>
</view>
<view class="border-line"></view>
<view class="menu-box" @tap="clickMenu('/package1/index/peopleList?popleType=khName&noClick=1')">
<u-icon name="man-add-fill" size="18"></u-icon>
<view class="menu-title">客户管理</view>
<u-icon name="arrow-right" color="info" size="16"></u-icon>
</view>
<view class="menu-box" @tap="clickMenu('/package1/index/customClassList')">
<u-icon name="man-add-fill" size="18"></u-icon>
<view class="menu-title">客户分类</view>
<u-icon name="arrow-right" color="info" size="16"></u-icon>
</view>
<view class="menu-box" @tap="clickMenu('/package1/index/shareStyle')">
<u-icon name="man-add-fill" size="18"></u-icon>
<view class="menu-title">推款</view>
<u-icon name="arrow-right" color="info" size="16"></u-icon>
</view>
<view class="menu-box" @tap="clickMenu('/package1/index/order?type=dingdan')">
<u-icon name="man-add-fill" size="18"></u-icon>
<view class="menu-title">销售单历史</view>
<u-icon name="arrow-right" color="info" size="16"></u-icon>
</view>
<view class="menu-box" @tap="clickMenu('/package1/index/returnOrder')">
<u-icon name="man-add-fill" size="18"></u-icon>
<view class="menu-title">退货单历史</view>
<u-icon name="arrow-right" color="info" size="16"></u-icon>
</view>
<view class="border-line"></view>
<!-- <view @tap="clickMenu('/package1/index/warehouseList')">
<u-icon name="home-fill" size="18"></u-icon>
<view class="menu-title">仓库管理</view>
<u-icon name="arrow-right" color="info" size="16"></u-icon>
</view>
<view @tap="clickMenu('/package1/index/shopAssociation')">
<u-icon name="home-fill" size="18"></u-icon>
<view class="menu-title">店铺关联组</view>
<u-icon name="arrow-right" color="info" size="16"></u-icon>
</view> -->
<!-- <view class="border-line"></view> -->
<view class="menu-box" @tap="clickMenu('/package1/AI/addAiList')" v-if="shopName == '炘钱' || shopName == '炘玩' || shopName == '测试库新店' || shopName == '王浩伟测试8.1' || shopName == '提钱退休'">
<u-icon name="integral-fill" size="18"></u-icon>
<view class="menu-title">管理员登录</view>
<u-icon name="arrow-right" color="info" size="16"></u-icon>
</view>
<!-- <view @tap="clickMenu('')" v-if="shopName == '炘钱' || shopName == '炘玩' || shopName == '测试库新店' || shopName == '王浩伟测试8.1' || shopName == '提钱退休'">
<u-icon name="integral-fill" size="18"></u-icon>
<view class="menu-title">电费缴纳</view>
<u-icon name="arrow-right" color="info" size="16"></u-icon>
</view>
<view @tap="clickMenu('')" v-if="shopName == '炘钱' || shopName == '炘玩' || shopName == '测试库新店' || shopName == '王浩伟测试8.1' || shopName == '提钱退休'">
<u-icon name="integral-fill" size="18"></u-icon>
<view class="menu-title">租金缴纳</view>
<u-icon name="arrow-right" color="info" size="16"></u-icon>
</view> -->
<view class="menu-box" @tap="clickMenu('/pages/rebate/rebateShare')">
<u-icon name="rewind-right-fill" size="18"></u-icon>
<view class="menu-title">邀请返佣</view>
<u-icon name="arrow-right" color="info" size="16"></u-icon>
</view>
<!-- <view @tap="clickMenu('/package1/index/publicWelfare')">
<u-icon name="heart-fill" size="18"></u-icon>
<view class="menu-title">公益公示</view>
<u-icon name="arrow-right" color="info" size="16"></u-icon>
</view> -->
<view class="menu-box" @tap="clickMenu('/package1/index/setUp')">
<u-icon name="setting-fill" size="18"></u-icon>
<view class="menu-title">设置</view>
<u-icon name="arrow-right" color="info" size="16"></u-icon>
</view>
<view class="menu-box" @tap="outLogin">
<u-icon name="rewind-left-fill" size="18"></u-icon>
<view class="menu-title">退出登录</view>
<u-icon name="arrow-right" color="info" size="16"></u-icon>
</view>
</view>
</view>
</u-popup>
<!-- 宣传页 -->
<view class="xuanchuan-desk" v-if="xuanchuan">
<view class="publicize-content" >
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/baa8e7c7b38d4feabeed8cf43f49ccfb.png"
alt="宣传图">
<view class="pop-close" @tap="popClose">X</view>
</view>
</view>
<view v-if="showDayPrice && type ==0" :style="{height:(80 + shopInfo.totalAlreadyEarnDetail.length * 80)+ 'px'}"
style="position: fixed;margin:auto;left:0;right:0;top:0;bottom:0;width:400rpx;background: rgba(0,0,0,0.7);border-radius: 10px;color: #eee;">
<view style="width:100%;height:40px;font-size: 18px;text-align: center;line-height: 40px;">
今日收款方式统计
</view>
<view v-for="(item,index) in shopInfo.totalAlreadyEarnDetail" :key="index"
style="text-align: center;line-height: 40px;">
<view>
{{item.payType == 0?'现金收款:':item.payType == 1?'微信收款:':item.payType == 2?'支付宝收款:':item.payType == 3?'银行卡收款:':item.payType == 4?'收款码收款:':''}}{{item.payAmount}}元
</view>
</view>
<view v-if="zongAmount > 0" style="text-align: center;line-height: 40px;">客户充值:{{zongAmount}}</view>
</view> <!-- -->
<view v-if="showFormula && type ==0"
style="height: 180px;position: fixed;z-index: 999;margin: auto;left: 0;right: 0;top: 0;bottom: 0;width: 340px;background: rgba(0,0,0,0.7);border-radius: 10px;color: #eee;">
<view style="width:100%;height:40px;font-size: 14px;text-align: center;line-height: 40px;">
{{showDan == 0?'销售利润':showDan == 1?'实际利润':showDan == 2?'实际利润率':showDan == 3?'销售利润率':''}}计算公式
</view>
<view style="text-align: center;line-height: 10px;">
<view v-if="showDan == 3" style="margin-top: 20px;">
<view>公式:销售利润/销售金额*100</view>
<view>{{shopInfo.totalProfit}}/{{shopInfo.totalAmount}}*100={{(shopInfo.totalProfit == 0 && shopInfo.totalAmount == 0)?0:((shopInfo.totalProfit/shopInfo.totalAmount)*100).toFixed(2)}}%</view>
</view>
<view v-if="showDan == 2" style="margin-top: 20px;">
<view>公式:实际利润/(销售金额-退货金额)</view>
<view>{{(shopInfo.totalAmount-(shopInfo.totalAmount-shopInfo.totalProfit)-shopInfo.returnTotalAmount+shopInfo.saleReturnCost).toFixed(2)}}/{{shopInfo.totalAmount - shopInfo.returnTotalAmount}} * 100={{(shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)==0?0:(((shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)/(shopInfo.totalAmount-shopInfo.returnTotalAmount))*100).toFixed(2)}}%</view>
</view>
<view v-if="showDan == 1" style="margin-top: 20px;">
<view>公式:销售利润-(退货金额-退货成本)</view>
<view>{{shopInfo.totalProfit}}-({{shopInfo.returnTotalAmount}}-{{shopInfo.saleReturnCost}})={{(shopInfo.totalAmount-(shopInfo.totalAmount-shopInfo.totalProfit)-shopInfo.returnTotalAmount+shopInfo.saleReturnCost).toFixed(2)}}</view>
</view>
<view v-if="showDan == 0" style="margin-top: 20px;">
<view>公式:销售金额-销售成本</view>
<view>{{shopInfo.totalAmount}}-{{shopInfo.totalAmount - shopInfo.totalProfit}}={{shopInfo.totalProfit}}</view>
</view>
</view>
</view>
<view v-if="shijiPrice && type ==0" @tap="shijiPrice = false" style="width:100%;height:100%;position: fixed;top: 0;background: rgba(0,0,0,0.7);">
<view
style="position: fixed;margin:auto;height:320px;left:0;right:0;top:100px;bottom:0;width:400px;background:#fff;border-radius: 10px;color: #000;">
<view style="width:100%;height:40px;font-size: 14px;text-align: center;line-height: 40px;font-weight: bold;">
利润明细
</view>
<view style="display: flex;">
<view style="width: 25%;display: flex;flex-direction: column;text-align: center;">
<text style="font-weight: bold;">{{shopInfo.totalAmount}}</text>
<text>销售金额</text>
</view>
<view style="width: 25%;display: flex;flex-direction: column;text-align: center;">
<text style="font-weight: bold;">{{(shopInfo.totalAmount - shopInfo.totalProfit).toFixed(2)}}</text>
<text>销售成本</text>
</view>
<view style="width: 25%;display: flex;flex-direction: column;text-align: center;">
<text style="font-weight: bold;">{{shopInfo.returnTotalAmount}}</text>
<text>退货金额</text>
</view>
<view style="width: 25%;display: flex;flex-direction: column;text-align: center;">
<text style="font-weight: bold;">{{shopInfo.saleReturnCost}}</text>
<text>退货成本</text>
</view>
</view>
<view style="width: 95%;height:190px;margin: 0 auto;margin-top: 10px;border-top: 1px solid #eee;">
<view style="background: #ecf5ff;width: 100%;color: #5fd9ee;height: 40px;line-height: 40px;padding-left: 10px;">
点击↓↓↓可查看计算公式
</view>
<view class="tan-lirun" @tap.stop="changeFormula('0')">
<text style="font-weight: bold;margin-top: 10px;">{{shopInfo.totalProfit}}</text>
<text>销售利润</text>
</view>
<view @tap.stop="changeFormula('1')" class="tan-lirun" style="float: right;" >
<text style="font-weight: bold;margin-top: 10px;">{{(shopInfo.totalAmount-(shopInfo.totalAmount-shopInfo.totalProfit)-shopInfo.returnTotalAmount+shopInfo.saleReturnCost).toFixed(2)}}</text>
<text>实际利润</text>
</view>
<view @tap.stop="changeFormula('3')" class="tan-lirun">
<text style="font-weight: bold;margin-top: 10px;">{{(shopInfo.totalProfit == 0 || shopInfo.totalProfit == null) ?0:(shopInfo.totalAmount == 0 || shopInfo.totalAmount == null) ?0:((shopInfo.totalProfit/shopInfo.totalAmount)*100).toFixed(2)}}%</text>
<text>销售利润率</text>
</view>
<view @tap.stop="changeFormula('2')" class="tan-lirun" style="float: right;">
<text style="font-weight: bold;margin-top: 10px;">{{((shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)==0 || (shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)==null)?0:((shopInfo.totalAmount-shopInfo.returnTotalAmount) == 0 || (shopInfo.totalAmount-shopInfo.returnTotalAmount) == null) ?0:(((shopInfo.totalProfit-shopInfo.returnTotalAmount+shopInfo.saleReturnCost)/(shopInfo.totalAmount-shopInfo.returnTotalAmount))*100).toFixed(2)}}%</text>
<text>实际利润率</text>
</view>
</view>
<view @tap="shijiPrice = false" style="height: 40px;width: 100%;line-height: 40px;text-align: center;border-top: 1px solid #eee;">
确定
</view>
</view>
</view>
</view>
</template>
<!-- cmd-nav-bar.vue index.vue pages.json -->
<script>
import cmdNavBar from "@/components/cmd-nav-bar/cmd-nav-bar.vue";
import {
mapState
} from 'vuex';
export default {
computed: mapState(['userId', 'shopIndex', 'avatar']),
data() {
return {
menu:[{
}],
type: '',
xuanchuan:false,
src: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg',
inventoryList: [],
settingShow: false,
isCancel:false,
showFormula: false,
chartData: {},
showDan:'',
warehouseKeeperFlag:uni.getStorageSync('warehouseKeeperFlag'),
storeFlag:uni.getStorageSync('storeFlag'),
returnList:new Map(),
shopName: '',
zongAmount:0,
waimaiRight:'-40px',
showDayPrice: false,
shijiPrice:false,
opts: {
padding: [15, 10, 0, 15],
dataLabel: true,
dataPointShape: false,
enableScroll: false,
legend: {},
xAxis: {
disableGrid: true
},
yAxis: {
gridType: "dash",
dashLength: 2,
data: [{
min: 0
}]
},
extra: {
column: {
type: "group",
width: 30,
customColor: ["#44fd6d", "#91CB74"],
activeBgColor: "#000000",
activeBgOpacity: 0.08,
seriesGap: 10,
barBorderCircle: true,
barBorderRadius: [20,20,0,0],
linearType: "custom"
}
},
},
shopInfo: {
totalAmount: 0,
totalAlreadyEarn: 0,
totalPayAmount: 0,
totalCCount: 0,
totalCount: 0,
totalJCount: 0,
totalProfit: 0,
saleReturnCost:0,
returnTotalAmount: 0,
returnTotalCount: 0,
totalAlreadyEarnDetail: 0
},
waitCount: {},
enDayShow:false,
endDay:'',
textArr:[]
}
},
components: {
cmdNavBar
},
filters: {
spliceMsg(val) {
val == null || undefined ? '暂无' : val
return val;
}
},
onLoad() {
let that = this;
wx.getLocation({
type: 'gcj02',
success(res) {
}
})
uni.getStorage({
key: 'shopName',
success: function(res) {
that.shopName = res.data
}
});
uni.getStorage({
key: 'type',
success: function(res) {
that.type = res.data
}
});
var today = new Date();
var day = today.getDate();
//宣传页
if (uni.getStorageSync('publicize') == day) {
} else {
uni.setStorageSync("publicize", day)
this.xuanchuan = true
}
this.getEndTime()
},
onShow(){
this.getSaleInfo()
},
onTabItemTap(e) {
this.warehouseKeeperFlag = uni.getStorageSync('warehouseKeeperFlag')
this.storeFlag = uni.getStorageSync('storeFlag')
},
methods: {
getAmount(){
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 da1 = date.getDate()+ 1 < 10 ? '0' + (date.getDate()+ 1).toString() : (date.getDate() + 1).toString() //'日'
let start = year + '-' + month + '-' + da //当天
let end = year + '-' + month + '-' + da1 //当天+1
this.tui.request("/app/dealingRecord/getDealingsRecordListByTimeRange", "post", {
startTime: start,
endTime: end
}, false, true).then((res) => {
this.zongAmount = 0
for(let i=0;i<res.result.length;i++){
if(res.result[i].amount > 0 && res.result[i].dealingsType == 4 && res.result[i].delFlag == 0 && res.result[i].remark.indexOf('客户充值:') != -1){
this.zongAmount += res.result[i].amount
this.shopInfo.totalAlreadyEarn += res.result[i].amount
}
}
})
},
goOrderDetail(){
uni.navigateTo({
url: '/package1/index/order?listStatus=8'
})
},
goInventory(){
uni.navigateTo({
url: '/package1/AI/waitStorageHeng?inStorageStatus=1&storeFlag=1'
})
},
//获取店铺到期时间
getEndTime(){
this.textArr = []
this.tui.request("/app/shop/getShopInfoById", "post", {
id: uni.getStorageSync('shopId')
}, false, true).then((res) => {
uni.setStorageSync('endTime',res.result.endTime)
this.endTime = res.result.endTime
this.endDay = this.daysUntil(res.result.endTime)
if(this.endDay < 7){
this.enDayShow = true
}
})
setTimeout(res1=>{
if(this.endTime != undefined){
let text = '您的店铺有效期至'+this.endTime+',还有'+this.endDay+'天到期,请及时联系管理员续费或开通'
this.textArr.push(text)
console.log(this.textArr)
}
},500)
},
daysUntil(dateStr) {
const targetDate = new Date(dateStr);
const currentDate = new Date();
const differenceInMs = targetDate - currentDate;
const daysDifference = Math.ceil(differenceInMs / (1000 * 60 * 60 * 24));
return daysDifference;
},
changeFormula(type){
console.log(type)
this.showFormula = true
this.showDan = type
setTimeout(res=>{
this.showFormula = false
},2000)
},
popClose() {
this.xuanchuan = false
},
//退款接口
async getReturnOrder(id) {
},
async copyOrder(item1){
let that = this;
await this.tui.request("/app/return/list", "post", {
remark: 3,
saleId: item1.id
}, false, false).then((res) => {
if (res.code == 200 && res.result != null && res.result != undefined) {
if (res.result != '') {
res.result.forEach(item => {
this.tui.request("/app/return/get/" + item.id, "GET", null, false,false).then((res) => {
if (res.code == 200 && res.result != null && res.result != undefined) {
for(let i=0;i<res.result.saleDetailDTOList.length;i++){
res.result.saleDetailDTOList[i].returnPrice = res.result.saleDetailDTOList[i].discountAmount
res.result.saleDetailDTOList[i].stockLogList = new Map()
that.returnList.set(res.result.saleDetailDTOList[i].productId,res.result.saleDetailDTOList[i])
for(let m=0;m<res.result.saleDetailDTOList[i].stockLogList1.length;m++){
// res.result.saleDetailDTOList[i].stockLogList1[m].stockCount = res.result.saleDetailDTOList[i].stockLogList1[m].stockCount - res.result.saleDetailDTOList[i].stockLogList1[m].productCount
res.result.saleDetailDTOList[i].stockLogList1[m].productCount = 0-res.result.saleDetailDTOList[i].stockLogList1[m].productCount
that.returnList.get(res.result.saleDetailDTOList[i].productId).stockLogList.set(res.result.saleDetailDTOList[i].stockLogList1[m].attributeList,res.result.saleDetailDTOList[i].stockLogList1[m])
}
}
}
this.$nextTick(() => {
this.tui.modal("提示", "您确定要复制订单并重新开单吗?", true, (res) => {
if (res) {
this.goSaleGoods(item1,'copy')
}else{
that.returnList = new Map()
}
})
})
}).catch((res) => {})
})
}else{
this.$nextTick(() => {
this.tui.modal("提示", "您确定要复制订单并重新开单吗?", true, (res) => {
if (res) {
this.goSaleGoods(item1,'copy')
}else{
that.returnList = new Map()
}
})
})
}
} else {
this.tui.toast(res.message)
}
})
},
// 取消订单
async cancelOrder(item1, type) {
let that = this;
await this.tui.request("/app/return/list", "post", {
remark: 3,
saleId: item1.id
}, false, false).then((res) => {
if (res.code == 200 && res.result != null && res.result != undefined) {
if (res.result != '') {
res.result.forEach(item => {
this.tui.request("/app/return/get/" + item.id, "GET", null, false,false).then((res) => {
if (res.code == 200 && res.result != null && res.result != undefined) {
for(let i=0;i<res.result.saleDetailDTOList.length;i++){
res.result.saleDetailDTOList[i].returnPrice = res.result.saleDetailDTOList[i].discountAmount
res.result.saleDetailDTOList[i].stockLogList = new Map()
that.returnList.set(res.result.saleDetailDTOList[i].productId,res.result.saleDetailDTOList[i])
for(let m=0;m<res.result.saleDetailDTOList[i].stockLogList1.length;m++){
// res.result.saleDetailDTOList[i].stockLogList1[m].stockCount = res.result.saleDetailDTOList[i].stockLogList1[m].stockCount - res.result.saleDetailDTOList[i].stockLogList1[m].productCount
res.result.saleDetailDTOList[i].stockLogList1[m].productCount = 0-res.result.saleDetailDTOList[i].stockLogList1[m].productCount
that.returnList.get(res.result.saleDetailDTOList[i].productId).stockLogList.set(res.result.saleDetailDTOList[i].stockLogList1[m].attributeList,res.result.saleDetailDTOList[i].stockLogList1[m])
}
}
}
this.$nextTick(() => {
this.tui.modal("提示", type=='goPay'?"您确定要撤销订单并重新开单吗?":"您确定要撤销订单吗?", true, (res) => {
if (res) {
that.cancelSale(item1,type)
}else{
that.returnList = new Map()
}
})
})
}).catch((res) => {})
})
}else{
this.$nextTick(() => {
this.tui.modal("提示", type=='goPay'?"您确定要撤销订单并重新开单吗?":"您确定要撤销订单吗?", true, (res) => {
if (res) {
that.cancelSale(item1,type)
}else{
that.returnList = new Map()
}
})
})
}
} else {
this.tui.toast(res.message)
}
})
},
cancelSale(item,type){
this.tui.request('/app/sale/cancelSale', "POST", {
id:item.id
}, true, true).then((res1) => {
if (res1.code == 200) {
if (type == 'goPay') {
this.isCancel = true
this.goSaleGoods(item,'cancel')
} else {
this.getSaleInfo()
}
} else {
this.tui.toast(res.message)
}
}).catch((res1) => {})
},
// 取消订单
getOrderInfoList(item,type) {
let that = this;
if(item.status == 0 || item.status == 1){
this.tui.request('/app/sale/status', "POST", {
status: 4,
orderId: item.id
}, true, true).then((res1) => {
if (res1.code == 200) {
this.cancelSale(item,type)
} else {
this.tui.toast(res.message)
}
}).catch((res1) => {})
}else{
this.cancelSale(item,type)
}
},
sliceMsg(val) {
var name = ''
if (typeof(val) == 'string') {
let newObj = JSON.parse(val)
for (let as in newObj) {
name += newObj[as] + '/'
}
}
return name;
},
//带参数跳转到开单页
goSaleGoods(item,type) {
let dataList = []
if(item.saleDetailDTOList == null || item.saleDetailDTOList == ''){
item.saleDetailDTOList = []
}
this.returnList.forEach(function(value, key) {
item.saleDetailDTOList.push(value)
})
if (item.saleDetailDTOList) {
for (let i = 0; i < item.saleDetailDTOList.length; i++) {
let obj = {}
let attrMap = new Map()
let newSaleDetailDTOList = []
let num = 0
for (let m = 0; m < item.saleDetailDTOList[i].stockLogList1.length; m++) {
if (attrMap.has(item.saleDetailDTOList[i].stockLogList1[m].attributeList) == true) {
let hasCount = attrMap.get(item.saleDetailDTOList[i].stockLogList1[m].attributeList)
newSaleDetailDTOList[hasCount].productCount = Number(newSaleDetailDTOList[hasCount]
.productCount) + Number(item.saleDetailDTOList[i].stockLogList1[m].productCount)
if(this.isCancel == true){
newSaleDetailDTOList[hasCount].stockCount = newSaleDetailDTOList[hasCount].stockCount + newSaleDetailDTOList[hasCount].productCount
}
} else {
item.saleDetailDTOList[i].stockLogList1[m].name = this.sliceMsg(item.saleDetailDTOList[i]
.stockLogList1[m].attributeList)
if(this.isCancel == true){
item.saleDetailDTOList[i].stockLogList1[m].stockCount = item.saleDetailDTOList[i].stockLogList1[m].stockCount + item.saleDetailDTOList[i].stockLogList1[m].productCount
}
newSaleDetailDTOList.push(item.saleDetailDTOList[i].stockLogList1[m])
attrMap.set(item.saleDetailDTOList[i].stockLogList1[m].attributeList, num)
num++
}
}
obj.saleDetailQueryDTO = newSaleDetailDTOList
obj.num = 0
obj.id = item.saleDetailDTOList[i].productId
obj.attrId = item.saleDetailDTOList[i].attrId
obj.buyCount = item.saleDetailDTOList[i].buyCount - 1
obj.price = item.saleDetailDTOList[i].price
obj.lsprice = item.saleDetailDTOList[i].price
obj.discount = item.saleDetailDTOList[i].discount
obj.categoryId = item.saleDetailDTOList[i].categoryId
obj.zPrice = item.saleDetailDTOList[i].discountAmount
obj.customerCategoryRule = item.saleDetailDTOList[i].customerCategoryRule != null ?JSON.parse(item.saleDetailDTOList[i].customerCategoryRule):null
obj.productName = item.saleDetailDTOList[i].productName
if(item.saleDetailDTOList[i].productPicture != null && item.saleDetailDTOList[i].productPicture != ''){
obj.productPicture = item.saleDetailDTOList[i].productPicture + '?time=' + new Date().getTime()
}else{
obj.productPicture = ""
}
obj.productSn = item.saleDetailDTOList[i].productSn
obj.wholesalePrice = item.saleDetailDTOList[i].wholesalePrice
obj.discountAmount = item.saleDetailDTOList[i].discountAmount
obj.returnPrice = item.saleDetailDTOList[i].returnPrice
if(type == 'copy'){
obj.saleId = ''
}else{
obj.saleId = item.id
}
obj.remark = item.remark
obj.xsyId = item.createBy
obj.createByName = item.createByName
if(type == 'cancel'){
obj.unitPrice = this.getUnitPrice(item,item.saleDetailDTOList[i])
}else{
obj.unitPrice = item.saleDetailDTOList[i].discountAmount
}
dataList.push(obj)
}
} else {
let obj = {}
obj.num = 0
obj.price = 0
if(type == 'copy'){
obj.saleId = ''
}else{
obj.saleId = item.id
}
obj.remark = item.remark
obj.xsyId = item.createBy
obj.createByName = item.createByName
dataList.push(obj)
}
this.$nextTick(()=>{
this.tui.request("/app/debt/selectByUserId", "post", {
shopId:uni.getStorageSync('shopId'),
userId:item.userId
}, false, true).then((res) => {
if (res.code == 200) {
this.returnList = new Map()
res.result.noEarn = res.result.amountOwed
res.result.name = res.result.userName
res.result.id = item.userId
uni.setStorageSync('khName', JSON.stringify(res.result))
uni.setStorageSync('carList1', JSON.stringify(dataList))
uni.setStorageSync('discountAll', item.discount != null ?item.discount:10)
uni.setStorageSync('hangOrder', true)
uni.navigateTo({
url: '/package2/inventory/goodsList1HENG'
})
}
})
})
},
getUnitPrice(item,items){
if(item.discount != 10){
if(item.discount == null || item.discount == 0 || item.discount ==undefined){
return items.discountAmount
}else{
return ((items.discountAmount * 10000) / (item.discount * 100) / 10).toFixed(2)
}
}else if(items.discount!= 10){
if(items.discount == null || items.discount == 0 || items.discount ==undefined){
return items.discountAmount
}else{
return ((items.discountAmount * 10000) / (items.discount * 100) / 10).toFixed(2)
}
}else{
return items.discountAmount || items.wholesalePrice
}
},
getSaleInfo() {
this.shopInfo = {
totalAmount: 0,
totalAlreadyEarn: 0,
totalPayAmount: 0,
totalCCount: 0,
totalCount: 0,
totalJCount: 0,
totalProfit: 0,
saleReturnCost:0,
returnTotalAmount: 0,
returnTotalCount: 0,
totalAlreadyEarnDetail: 0
}
this.inventoryList = []
this.tui.request("/app/sale/getShopAll", "POST", {
pageVo: {
pageSize: 5,
pageNumber: 1
},
}, false, false).then((res) => {
if (res.code == 200) {
this.shopInfo = {
totalAmount: res.result.totalAmount,
totalAlreadyEarn: res.result.totalAlreadyEarn,
totalPayAmount: res.result.totalPayAmount,
totalCCount: res.result.totalCCount,
totalCount: res.result.totalCount,
totalJCount: res.result.totalJCount,
totalProfit: res.result.totalProfit,
saleReturnCost:res.result.saleReturnCost,
returnTotalAmount: res.result.returnTotalAmount,
returnTotalCount: res.result.returnTotalCount,
notConfirmPurductCount: res.result.notConfirmPurductCount,
totalAlreadyEarnDetail: res.result.totalAlreadyEarnDetail
}
this.getAmount()
let dataList = {
categories: this.getWeek(),
series: [{
name: "七天营收统计",
linearColor: [
[0, "#1890FF"],
[0.33, "#00B5FF"],
[0.66, "#00D1ED"],
[1, "#00E6BB"],
[1, "#90F489"]
],
setShadow: [3, 8, 10, "#00E6BB"],
data: res.result.weekSale
}]
};
this.chartData = JSON.parse(JSON.stringify(dataList));
this.waitCount = res.result.countMap
for (var i = 0; i < res.result.salePage.records.length; i++) {
res.result.salePage.records[i].img = '/static/images/dingdan/dd' + i + '.png'
this.inventoryList = res.result.salePage.records
}
} else {
this.tui.toast(res.message)
}
})
},
goToInfo() {
this.settingShow = true
},
//跳转外卖小程序
quwaimai() {
if(this.waimaiRight == '-70rpx'){
this.waimaiRight = '20rpx'
}else{
uni.openEmbeddedMiniProgram({
appId: 'wxf5362b6e97ecee2f'
})
}
setTimeout(res=>{
this.waimaiRight = '-70rpx'
},2000)
},
gotoSearchData() {
uni.navigateTo({
url: '/package1/index/dataStatistics'
})
},
clickMenu(url) {
uni.navigateTo({
url: url
})
},
showPayType() {
this.showDayPrice = true
setTimeout(res => {
this.showDayPrice = false
}, 2000)
},
outLogin(e) {
let that = this;
uni.showModal({
title: "提示",
content: "确定退出登录吗?",
success: function(res) {
if (res.confirm) {
that.tui.request("/oauth2/logout", "POST", {}, false, false).then((res) => {
if (res.code == 200) {
that.tui.toast("退出登录成功")
// uni.clearStorage();
uni.removeStorage({
key: 'hiver_token'
});
uni.navigateTo({
url: '/package2/login/login'
})
} else {
that.tui.toast(res.message)
}
})
}
}
})
},
getWeek() {
let days = 7
let week = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
let dateList = Array.from({
length: days
}, (v, i) => i).map(day => {
let date = new Date();
date.setDate(date.getDate() - day);
return week[date.getDay()]
})
return dateList.reverse()
},
//跳转订单详情
gotoDetail(id,userId) {
uni.navigateTo({
url: '/package1/index/orderDetail?id=' + id + '&userId=' + userId
})
},
//首页头部五个按钮的菜单
goSonPage(url) {
if (url == '/package1/AI/waitStorageHeng?inStorageStatus=0') {
if (this.type != 0) {
this.tui.toast('暂无查看权限!')
return;
}
}
uni.navigateTo({
url: url
})
}
}
}
</script>
<style lang="scss">
page,.page1{
font-size:14px;
}
.IndexContent {
padding-top: 90px;
.contentPadding {
padding: 10px 10px;
background-color: #fff;
color: #909399;
.title {
padding-left: 10px;
color: #303133;
margin-bottom: 10px;
line-height: 40px;
image {
display: inline-block;
width: 40rpx;
vertical-align: middle;
}
.btn {
text-align: right;
width: 24%;
float: right;
font-size: 18px;
color: $u-primary;
}
}
.grid-text {
font-size: 18px;
margin-bottom: 26rpx;
}
}
}
.content-avatar {
display: flex;
align-items: center;
margin: 25rpx 15rpx;
}
.shop-name {
margin-left: 15upx;
}
.title-dianpu {
margin-top: 14upx;
border-bottom: 1px solid #fff;
padding-bottom: 20upx;
}
.title-btn-d {
height: auto;
display: flex;
}
.menu-title{
width: 80%;
padding-left: 10px;
}
.dianpu-img {
width: 60upx;
height: 60upx;
float: left;
margin-left: 20upx;
}
.dianpu-text {
font-size: 40upx;
height: 60upx;
line-height: 65upx;
padding-left: 20upx;
}
.title-btn-sbtn {
text-align: center;
font-size: 14px;
width: 20%;
}
.title-btn-sbtn:hover {
color: #B22222;
}
.title-btn-sbtn:nth-child(1),
.title-btn-sbtn:nth-child(2) {
border-right: 1px solid #fff;
}
.red-circle {
position: absolute;
top: 0;
right: 25px;
width: 20px;
height: 20px;
line-height: 20px;
font-size: 12rpx;
border-radius: 50%;
background: red;
color: #fff;
text-align: center;
}
.popup-content{
width:250px;
height:100%;
padding-right:10px;
overflow-y:scroll;
}
.status-bar {
height: 42px !important;
}
.u-icon {
padding: 0 0 0 8px !important;
}
.uni-popup__wrapper {
background: rgba(255, 255, 255, 0) !important;
}
.xuanchuan-desk{
width: 100%;
height:100%;
position: absolute;
top:0;
left: 0;
background: rgba(0,0,0,0.2);
z-index:998;
}
.publicize-content {
width: 200px;
height: 300px;
z-index: 999;
position: fixed;
top: 35%;
left: 50%;
margin-left: -100px;
}
.publicize-content img {
width: 200px;
height: 200px;
border-radius: 50px;
}
.pop-close {
border: 1px solid #eee;
color: #eee;
border-radius: 50%;
width: 30px;
height: 30px;
line-height: 30px;
text-align: center;
margin: 30px auto;
}
.border-line {
width: 100%;
height: 10px;
background: #eee;
}
.uni-tooltip-popup {
width: 180rpx;
}
.waimai {
position: fixed;
bottom: 0;
background: url(https://jewel-shop.oss-cn-beijing.aliyuncs.com/cda1b75affd349118081f3880f815a0f.jpg) no-repeat;
background-size: 100%;
width: 80px;
height: 80px;
margin: 0 auto 10rpx;
z-index: 999;
}
.title-img {
width: 40px;
height: 40px;
}
.floatRight {
float: right;
padding: 10px;
color: #5fd9ee;
font-size: 18px;
}
.title-four{
width: 14% !important;
height: 60px;
background-image: linear-gradient(#84C1FF, #C4E1FF) !important;
margin-left: 2%;
border-radius: 10px;
margin-top: 10px !important;
color: #fff !important;
line-height: 30px;
}
.u-notice-bar{
height: 60rpx;
line-height: 60rpx;
font-size: 30rpx;
}
.tan-lirun{
margin-top: 10px;
width: 45%;
height: 60px;
display: flex;
flex-direction: column;
text-align: center;
float: left;
background-image: linear-gradient(#84C1FF, #C4E1FF) !important;
color: #fff;
border-radius: 10px;
}
.u-count-num{
color: #FFF !important
}
.menu-box{
height: 40px;
display: flex;
line-height: 40px;
border-bottom: 1px solid #eee;
}
</style>