耗材解决问题
This commit is contained in:
parent
692ca30253
commit
0e05b3ea5a
|
|
@ -59,8 +59,8 @@ const $PermissionObj = {
|
|||
key: 'yun_xu_guan_li_hui_yuan_xin_xi'
|
||||
},
|
||||
{
|
||||
text: 'yun_xu_xiu_gai_hui_yuan_yu_e',
|
||||
key: '允许修改会员余额'
|
||||
key: 'yun_xu_xiu_gai_hui_yuan_yu_e',
|
||||
text: '允许修改会员余额'
|
||||
}
|
||||
],
|
||||
stock:[
|
||||
|
|
|
|||
|
|
@ -62,9 +62,10 @@ const props = defineProps({
|
|||
|
||||
// 点击事件
|
||||
async function clickFunc(nav) {
|
||||
let res =await hasPermission('允许查看经营数据')
|
||||
console.log(res,'调试11111')
|
||||
if(!res) return
|
||||
if(nav.pageUrl=="PAGES_SALES_SUMMARY"){
|
||||
let res =await hasPermission('允许查看经营数据')
|
||||
if(!res) return
|
||||
}
|
||||
// 包含回调事件
|
||||
if (nav.clickFunc) {
|
||||
return nav.clickFunc(nav)
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
耗材价格
|
||||
</view>
|
||||
<view>
|
||||
<input type="text" placeholder="请输入耗材价格" v-model="datas.form.price" name="" id="">
|
||||
<input placeholder="请输入耗材价格" type="number" v-model="datas.form.price" name="" id="">
|
||||
</view>
|
||||
</li>
|
||||
<li>
|
||||
|
|
@ -59,13 +59,16 @@
|
|||
<up-button type="primary" style="background-color: #318AFE;color: #fff;" @tap="sumbit" :plain="true"
|
||||
text="保存"></up-button>
|
||||
</view>
|
||||
<!-- 消息提示 -->
|
||||
<up-toast ref="uToastRef"></up-toast>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
reactive,
|
||||
computed,
|
||||
onMounted
|
||||
onMounted,
|
||||
getCurrentInstance
|
||||
} from 'vue';
|
||||
import {
|
||||
tbConsTypeList,
|
||||
|
|
@ -107,13 +110,29 @@
|
|||
})
|
||||
})
|
||||
}
|
||||
const refs = getCurrentInstance()
|
||||
let sumbit = () => {
|
||||
if (!datas.form.conUnit) {
|
||||
refs.ctx.$refs.uToastRef.show({
|
||||
type: 'default',
|
||||
message: "单位不能为空"
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!datas.form.price) {
|
||||
refs.ctx.$refs.uToastRef.show({
|
||||
type: 'default',
|
||||
message: "价格不能为空"
|
||||
})
|
||||
return
|
||||
}
|
||||
tbConsInfoAddlist([{
|
||||
...datas.form,
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
conTypeId: datas.list[datas.nowStatusIndex].id
|
||||
}]).then(res => {
|
||||
go.to('PAGES_SALES_CONSUMABLES')
|
||||
// go.to('PAGES_SALES_CONSUMABLES')
|
||||
go.back()
|
||||
})
|
||||
}
|
||||
const statusHeight = computed(() => {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
</view>
|
||||
<view class="">
|
||||
是否启用
|
||||
<up-switch checked="true" activeValue="1" inactiveValue="0" @change="switchChangeEvent($event,item)"
|
||||
<up-switch checked="true" :activeValue="1" :inactiveValue="0" @change="switchChangeEvent($event,item)"
|
||||
:modelValue="item.status" style="transform:scale(0.7)" />
|
||||
</view>
|
||||
</li>
|
||||
|
|
@ -126,13 +126,13 @@
|
|||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
<style>
|
||||
page {
|
||||
background-color: #f9f9f9;
|
||||
padding: 0 28rpx;
|
||||
}
|
||||
|
||||
</style>
|
||||
<style scoped lang="less">
|
||||
ul,
|
||||
li {
|
||||
list-style: none;
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 9.0 KiB |
|
|
@ -114,7 +114,7 @@
|
|||
conTypeId: datas.list[datas.nowStatusIndex].id,
|
||||
id: datas.form.id
|
||||
}]).then(res => {
|
||||
go.to('PAGES_SALES_CONSUMABLES')
|
||||
go.back()
|
||||
})
|
||||
}
|
||||
const statusHeight = computed(() => {
|
||||
|
|
@ -126,11 +126,13 @@
|
|||
datas.showStatus = false
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
<style>
|
||||
page {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
</style>
|
||||
<style scoped lang="less">
|
||||
|
||||
|
||||
ul,
|
||||
li {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<view class="ConsumablesTop">
|
||||
<view @tap="showStatus = !showStatus">
|
||||
{{datas.title}}
|
||||
<view @tap="showStatus = !showStatus" style="display: flex;align-items: center;">
|
||||
{{datas.title}}<up-icon name="arrow-down" size="12"></up-icon>
|
||||
</view>
|
||||
<view>
|
||||
<input v-model="datas.conName" @input="inputEvent" type="text" placeholder="请输入耗材名称" />
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
<view :style="{height: '14px'}"></view>
|
||||
</view>
|
||||
|
||||
<ul class="ConsumablesConent">
|
||||
<ul class="ConsumablesConent" v-if="datas.list.length">
|
||||
<li v-for="(item,index) in datas.list" :key="index">
|
||||
<view>
|
||||
{{item.conName}}
|
||||
|
|
@ -49,12 +49,18 @@
|
|||
所属商品: {{ filtersSproductId(item.productId)}}
|
||||
</view>
|
||||
<view class="">
|
||||
<up-button type="primary" color="#999" @tap="toUrl('PAGES_VIEWRECORDS',{item:JSON.stringify(item)})" :plain="true" text="查看记录"></up-button>
|
||||
<up-button type="primary" color="#999" @tap="toUrl('PAGES_VIEWRECORDS',{item:JSON.stringify(item)})"
|
||||
:plain="true" text="查看记录"></up-button>
|
||||
<up-button type="primary" @click="toggle(item)" :plain="true" text="更多操作"></up-button>
|
||||
</view>
|
||||
</view>
|
||||
</li>
|
||||
<li style="background-color: rgba(0,0,0,0); height: 200rpx;"></li>
|
||||
</ul>
|
||||
<view v-else style="text-align: center;">
|
||||
<image src="./bg.png" style="width: 325rpx;height: 335rpx;" mode=""></image>
|
||||
<view style="font-size: 28rpx;color: #999;">暂无数据</view>
|
||||
</view>
|
||||
<view class="ConsumablesBottom">
|
||||
<view @tap="toUrl('PAGES_ADD_CONSUMABLES')">
|
||||
新增耗材
|
||||
|
|
@ -76,8 +82,13 @@
|
|||
reactive,
|
||||
computed
|
||||
} from 'vue';
|
||||
import {onShow} from '@dcloudio/uni-app'
|
||||
import {
|
||||
onShow
|
||||
} from '@dcloudio/uni-app'
|
||||
import go from '@/commons/utils/go.js';
|
||||
import {
|
||||
hasPermission
|
||||
} from '@/commons/utils/hasPermission.js';
|
||||
import {
|
||||
viewConInfoFlowget,
|
||||
tbConsType,
|
||||
|
|
@ -120,6 +131,7 @@
|
|||
// 获取分类列表
|
||||
gettbConsTypeList()
|
||||
})
|
||||
|
||||
function changeNowStatusIndex(i) {
|
||||
nowStatusIndex.value = i
|
||||
showStatus.value = false
|
||||
|
|
@ -159,49 +171,69 @@
|
|||
report.data.consId = d.id
|
||||
actionSheet.active = d
|
||||
}
|
||||
|
||||
|
||||
let sheetClick = (index) => {
|
||||
if (index == 0) {
|
||||
//打开报损弹窗
|
||||
reportDamage.value.open(actionSheet.activeId);
|
||||
report.data.name = actionSheet.active.conName
|
||||
report.data.unit = actionSheet.active.conUnit
|
||||
// 权限
|
||||
hasPermission('允许提交报损').then(ele => {
|
||||
if (ele) {
|
||||
//打开报损弹窗
|
||||
reportDamage.value.open(actionSheet.activeId);
|
||||
report.data.name = actionSheet.active.conName
|
||||
report.data.unit = actionSheet.active.conUnit
|
||||
}
|
||||
})
|
||||
} else if (index == 1) {
|
||||
toUrl('PAGES_EDIT_CONSUMABLES', {
|
||||
item: JSON.stringify(actionSheet.active)
|
||||
})
|
||||
} else if (index == 2) {
|
||||
toUrl('PAGES_SALES_INVENTORYCHECK', {
|
||||
item: JSON.stringify(actionSheet.active)
|
||||
hasPermission('允许耗材盘点').then(ele => {
|
||||
if (ele) {
|
||||
toUrl('PAGES_SALES_INVENTORYCHECK', {
|
||||
item: JSON.stringify(actionSheet.active)
|
||||
})
|
||||
}
|
||||
})
|
||||
} else if (index == 3) {
|
||||
console.log(actionSheet.activeId,'调试1')
|
||||
toUrl('PAGES_SALES_WAREHOUSEENTRY', {
|
||||
consId: actionSheet.activeId,
|
||||
item: JSON.stringify(actionSheet.active)
|
||||
hasPermission('允许耗材入库').then(ele => {
|
||||
if (ele) {
|
||||
toUrl('PAGES_SALES_WAREHOUSEENTRY', {
|
||||
consId: actionSheet.activeId,
|
||||
item: JSON.stringify(actionSheet.active)
|
||||
})
|
||||
}
|
||||
})
|
||||
} else if (index == 4) {
|
||||
toUrl('PAGES_SALES_OUTBOUND', {
|
||||
consId: actionSheet.activeId,
|
||||
item: JSON.stringify(actionSheet.active)
|
||||
hasPermission('允许耗材出库').then(ele => {
|
||||
if (ele) {
|
||||
toUrl('PAGES_SALES_OUTBOUND', {
|
||||
consId: actionSheet.activeId,
|
||||
item: JSON.stringify(actionSheet.active)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// async function viewpermission(d) {
|
||||
// let res = await hasPermission(d)
|
||||
// console.log(res,'调试1')
|
||||
// return res
|
||||
// }
|
||||
async function getList(d = "") {
|
||||
viewConInfoFlowget({
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
conName: datas.conName,
|
||||
conTypeId: d,
|
||||
size:100,
|
||||
page:0
|
||||
size: 100,
|
||||
page: 0
|
||||
}).then(res => {
|
||||
datas.list = res.content
|
||||
})
|
||||
}
|
||||
|
||||
function inputEvent(d) {
|
||||
datas.conName = d.detail.value
|
||||
datas.conName = d.detail.value.replace(/\s*/g,"");
|
||||
getList()
|
||||
}
|
||||
|
||||
|
|
@ -413,7 +445,7 @@
|
|||
background-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.df() {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
|
|||
|
|
@ -100,7 +100,8 @@
|
|||
conInfoId: datas.form.id,
|
||||
lpNum: profitNumber._value
|
||||
}).then(res => {
|
||||
go.to('PAGES_SALES_CONSUMABLES')
|
||||
// go.to('PAGES_SALES_CONSUMABLES')
|
||||
go.back()
|
||||
})
|
||||
}
|
||||
/**
|
||||
|
|
@ -129,11 +130,13 @@
|
|||
showStatus.value = !showStatus.value
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
<style>
|
||||
page {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
</style>
|
||||
<style scoped lang="less">
|
||||
|
||||
|
||||
.df() {
|
||||
display: flex;
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@
|
|||
supplierId: datas.list[nowStatusIndex.value].id,
|
||||
accountsPayable: datas.form.list[0].stockNumber * datas.form.list[0].price,
|
||||
}).then(res => {
|
||||
go.to('PAGES_SALES_CONSUMABLES')
|
||||
go.back()
|
||||
})
|
||||
}
|
||||
// 获取供应商
|
||||
|
|
@ -193,11 +193,13 @@
|
|||
return 30 * datas.status.length + 14 + 'px'
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
<style>
|
||||
page {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
</style>
|
||||
<style scoped lang="less">
|
||||
|
||||
|
||||
.df() {
|
||||
display: flex;
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@
|
|||
})
|
||||
onMounted(() => {
|
||||
let items = JSON.parse(props.item)
|
||||
console.log(items,'调试1')
|
||||
getlist()
|
||||
})
|
||||
let getlist = () => {
|
||||
|
|
@ -56,17 +57,20 @@
|
|||
page: 0,
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
size: 30,
|
||||
sort: "createTime,desc"
|
||||
sort: "createTime,desc",
|
||||
conTypeId:JSON.parse(props.item).conTypeId
|
||||
}).then(res => {
|
||||
datas.list = res.content
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
<style>
|
||||
page {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
</style>
|
||||
<style scoped lang="less">
|
||||
|
||||
ul,
|
||||
li {
|
||||
|
|
|
|||
|
|
@ -22,15 +22,15 @@
|
|||
<text style="color: red;">*</text> 入库数量
|
||||
</view>
|
||||
<view>
|
||||
<input type="text" placeholder="请输入数量" v-model="datas.form.list.stockNumber" name="" id="">
|
||||
<input type="number" placeholder="请输入数量" v-model="datas.form.list.stockNumber" name="" id="">
|
||||
</view>
|
||||
</li>
|
||||
<li>
|
||||
<view>
|
||||
<text style="color: red;">*</text>单价
|
||||
<text style="color: red;">*</text>单价
|
||||
</view>
|
||||
<view>
|
||||
<input type="text" placeholder="请输入单价(元)" v-model="datas.form.list.price" name="" id="">
|
||||
<input type="number" placeholder="请输入单价(元)" v-model="datas.form.list.price" name="" id="">
|
||||
</view>
|
||||
</li>
|
||||
<li>
|
||||
|
|
@ -132,6 +132,7 @@
|
|||
datas.form = assign(datas.form, ...datas.item)
|
||||
})
|
||||
const refs = getCurrentInstance()
|
||||
|
||||
function toggle() {
|
||||
go.to('PAGES_ADD_SUPPLIER')
|
||||
}
|
||||
|
|
@ -167,7 +168,7 @@
|
|||
})
|
||||
return
|
||||
}
|
||||
if(!datas.form.list.price){
|
||||
if (!datas.form.list.price) {
|
||||
refs.ctx.$refs.uToastRef.show({
|
||||
type: 'default',
|
||||
message: "请输入必填项",
|
||||
|
|
@ -182,7 +183,13 @@
|
|||
supplierId: datas.list[nowStatusIndex.value].id,
|
||||
accountsPayable: datas.form.list[0].stockNumber * datas.form.list[0].price,
|
||||
}).then(res => {
|
||||
go.to('PAGES_SALES_CONSUMABLES')
|
||||
refs.ctx.$refs.uToastRef.show({
|
||||
type: 'default',
|
||||
message: "保存成功",
|
||||
})
|
||||
setTimeout(() => {
|
||||
go.back()
|
||||
}, 1000)
|
||||
})
|
||||
}
|
||||
// 获取供应商
|
||||
|
|
@ -191,12 +198,12 @@
|
|||
return 30 * datas.status.length + 14 + 'px'
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
<style>
|
||||
page {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
</style>
|
||||
<style scoped lang="less">
|
||||
.df() {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
|
|||
|
|
@ -32,10 +32,28 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex-1 u-text-center" @tap="toYue">
|
||||
<view class="font-bold color-000 pr-16" >{{data.amount}}</view>
|
||||
<view class="u-flex u-row-center" >
|
||||
<view class="color-999">积分</view>
|
||||
<view class="u-flex">
|
||||
<uni-icons type="right" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex-1 u-text-center" @tap="toYue">
|
||||
<view class="font-bold color-000 pr-16" >{{data.amount}}</view>
|
||||
<view class="u-flex u-row-center" >
|
||||
<view class="color-999">优惠券</view>
|
||||
<view class="u-flex">
|
||||
<uni-icons type="right" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex-1 u-text-center" @tap="toUser">
|
||||
<view class="font-bold color-000 pr-16">{{data.totalScore}}</view>
|
||||
<view class="u-flex u-row-center">
|
||||
<view class="color-999">积分</view>
|
||||
<view class="color-999">已消费</view>
|
||||
<view class="u-flex">
|
||||
<uni-icons type="right" color="#999"></uni-icons>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -25,15 +25,15 @@
|
|||
<view class="u-font-32">数据统计</view>
|
||||
<view class="u-m-t-40 u-flex u-row-between">
|
||||
<view class=" ">
|
||||
<view>会员数</view>
|
||||
<view>今日新增(人)</view>
|
||||
<view class="u-m-t-10 u-font-36 font-bold">{{pageData.allShopInfo.userTotal}}</view>
|
||||
</view>
|
||||
<view class="line-l-r u-p-l-30 u-p-r-30">
|
||||
<view>会员余额</view>
|
||||
<view>总用户量(人)</view>
|
||||
<view class="u-m-t-10 u-font-36 font-bold">{{pageData.allShopInfo.balanceTotal}}</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view>充值金额</view>
|
||||
<view>总余额(元)</view>
|
||||
<view class="u-m-t-10 u-font-36 font-bold">{{pageData.allShopInfo.chageTotal}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -47,6 +47,9 @@
|
|||
</view>
|
||||
<my-pagination @change="pageChange"></my-pagination>
|
||||
</view>
|
||||
<view class="fixed_b">
|
||||
<my-button showShadow @tap="toAddUser" shape="circle">新建用户</my-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<!-- 导入用户 -->
|
||||
|
|
@ -83,7 +86,6 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="fixed_b">
|
||||
<my-button showShadow @tap="toAddUser" shape="circle">新建用户</my-button>
|
||||
</view>
|
||||
|
|
@ -166,6 +168,9 @@
|
|||
import infoBox from "@/commons/utils/infoBox.js"
|
||||
import * as $Api from '@/http/yskApi/shop-user.js'
|
||||
import API from '../../http/classApi';
|
||||
import {
|
||||
hasPermission
|
||||
} from '@/commons/utils/hasPermission.js';
|
||||
let tabsCurrent = ref(0)
|
||||
const tabsList = ['用户列表', '导入用户']
|
||||
const remarkModel = ref(null)
|
||||
|
|
@ -185,14 +190,37 @@
|
|||
|
||||
const goodsStockModel = ref(null)
|
||||
|
||||
const moreOperateList = ['增减余额', '增减积分', '设为会员', '赠送券', '查看详情']
|
||||
const moreOperateList = ['增减余额', '增减积分', '修改信息', ]
|
||||
|
||||
function moreOperateClick() {
|
||||
moreOperate.value.open()
|
||||
}
|
||||
|
||||
function actionSheetClick(i) {
|
||||
console.log(i);
|
||||
if (i == 0) {
|
||||
hasPermission('允许修改会员余额').then(ele => {
|
||||
if (ele) {
|
||||
toUrl('PAGES_SALES_WAREHOUSEENTRY', {
|
||||
consId: actionSheet.activeId,
|
||||
item: JSON.stringify(actionSheet.active)
|
||||
})
|
||||
}
|
||||
})
|
||||
} else if (i == 1) {
|
||||
toUrl('PAGES_SALES_WAREHOUSEENTRY', {
|
||||
consId: actionSheet.activeId,
|
||||
item: JSON.stringify(actionSheet.active)
|
||||
})
|
||||
} else if (i == 2) {
|
||||
hasPermission('允许管理会员信息').then(ele => {
|
||||
if (ele) {
|
||||
toUrl('PAGES_SALES_WAREHOUSEENTRY', {
|
||||
consId: actionSheet.activeId,
|
||||
item: JSON.stringify(actionSheet.active)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
//修改备注弹窗展示
|
||||
|
|
@ -367,12 +395,16 @@
|
|||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.after-r,.after-l {
|
||||
.after-r,
|
||||
.after-l {
|
||||
position: relative;
|
||||
}
|
||||
.line-l-r{
|
||||
|
||||
.line-l-r {
|
||||
position: relative;
|
||||
&::after,&:before{
|
||||
|
||||
&::after,
|
||||
&:before {
|
||||
position: absolute;
|
||||
content: '';
|
||||
top: 0;
|
||||
|
|
@ -381,13 +413,16 @@
|
|||
border-radius: 2px;
|
||||
background-color: rgba(255, 255, 255, .3);
|
||||
}
|
||||
&::after{
|
||||
|
||||
&::after {
|
||||
right: 0;
|
||||
}
|
||||
&::before{
|
||||
|
||||
&::before {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.after-r::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
<view class="index-selected">
|
||||
<view class="index-time">
|
||||
<block v-for="v in timeList" :key="v.value">
|
||||
<view class="time-item flex-center" :class="{ 'time-active': vdata.timeSelected == v.value }" @tap.stop="changeTimeFunc(v.value)">
|
||||
<view class="time-item flex-center" :class="{ 'time-active': vdata.timeSelected == v.value }"
|
||||
@tap.stop="changeTimeFunc(v.value)">
|
||||
{{ v.title }}
|
||||
</view>
|
||||
</block>
|
||||
|
|
@ -14,20 +15,20 @@
|
|||
</view>
|
||||
<view class="receipts-money">
|
||||
<text class="money-title">成交金额 (元)</text>
|
||||
<view class="money-num">{{ list.sale.incomeAmountAll||0}}</view>
|
||||
<view class="money-num">{{ list?list.sale.incomeAmountAll:0}}</view>
|
||||
</view>
|
||||
<view class="money-list">
|
||||
<view class="money-item">
|
||||
<text class="money-title">消费笔数</text>
|
||||
<view class="money-num">{{ list.vip.useNum||0 }}</view>
|
||||
<view class="money-num">{{ list?list.vip.useNum:0 }}</view>
|
||||
</view>
|
||||
<view class="money-item">
|
||||
<text class="money-title">退款金额 (元)</text>
|
||||
<view class="money-num">{{ list.sale.outAmount||0}}</view>
|
||||
<view class="money-num">{{ list?list.sale.outAmount:0}}</view>
|
||||
</view>
|
||||
<view class="money-item">
|
||||
<text class="money-title">消费金额</text>
|
||||
<view class="money-num">{{ list.vip.useAmount||0 }}</view>
|
||||
<view class="money-num">{{ list?list.vip.useAmount:0 }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="money-list" v-if="vdata.memberIsShow">
|
||||
|
|
@ -53,103 +54,128 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { $indexStatistics, $memberInfoCount } from '@/http/apiManager.js';
|
||||
import cal from '@/commons/utils/cal.js';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import ak from '@/commons/utils/ak.js';
|
||||
import ent from '@/commons/utils/ent.js';
|
||||
import unionScan from '@/commons/utils/unionScan.js';
|
||||
import storageManage from '@/commons/utils/storageManage.js';
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
onMounted
|
||||
} from 'vue';
|
||||
import {
|
||||
$indexStatistics,
|
||||
$memberInfoCount
|
||||
} from '@/http/apiManager.js';
|
||||
import cal from '@/commons/utils/cal.js';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import ak from '@/commons/utils/ak.js';
|
||||
import ent from '@/commons/utils/ent.js';
|
||||
import unionScan from '@/commons/utils/unionScan.js';
|
||||
import storageManage from '@/commons/utils/storageManage.js';
|
||||
import dayjs from 'dayjs' //时间格式库
|
||||
import {
|
||||
summaryTrade,
|
||||
} from '@/http/yskApi/requestAll.js';
|
||||
onMounted(() => {
|
||||
vdata.memberIsShow = ent.has('ENT_MCH_MEMBER') && storageManage.userInfo().isHasMemberEnt;
|
||||
if (ent.has('ENT_MCH_MEMBER') && storageManage.userInfo().isHasMemberEnt) {
|
||||
getMemberData();
|
||||
}
|
||||
getList()
|
||||
});
|
||||
const emits = defineEmits(['click']);
|
||||
const timeList = [
|
||||
{ title: '今天', value: 'today' },
|
||||
{ title: '昨天', value: 'yesterday' },
|
||||
{ title: '近7天', value: 'circumference' },
|
||||
{ title: '近30天', value: 'moon' }
|
||||
];
|
||||
let list = ref()
|
||||
const vdata = reactive({
|
||||
timeSelected: 'today', // 当前时间选择器的
|
||||
payAmount: -1, // 实收金额
|
||||
payCount: -1, // 交易笔数
|
||||
refundAmount: -1, // 退款金额
|
||||
refundCount: -1, // 退款笔数
|
||||
memberIsShow: false //是否开启会员模块
|
||||
});
|
||||
const memberData = reactive({});
|
||||
function getList(){
|
||||
let startTime, endTime;
|
||||
if (vdata.timeSelected == 'today') {
|
||||
startTime = dayjs().format('YYYY-MM-DD') + ' 00:00:00'
|
||||
endTime = dayjs().format('YYYY-MM-DD') + ' 23:59:59'
|
||||
} else if (vdata.timeSelected == 'yesterday') {
|
||||
startTime = formatTime() + ' 00:00:00'
|
||||
endTime = formatTime() + ' 23:59:59'
|
||||
} else if (vdata.timeSelected == 'circumference') {
|
||||
startTime = dayjs().add(-7, 'day').format('YYYY-MM-DD 00:00:00')
|
||||
endTime = dayjs().format('YYYY-MM-DD 23:59:59')
|
||||
} else if (vdata.timeSelected == 'moon') {
|
||||
startTime = dayjs().add(-30, 'day').format('YYYY-MM-DD 00:00:00')
|
||||
endTime = dayjs().format('YYYY-MM-DD 23:59:59')
|
||||
} else if (vdata.timeSelected == 'custom') {
|
||||
startTime = start
|
||||
endTime = end
|
||||
}
|
||||
summaryTrade({
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
startTime,
|
||||
endTime,
|
||||
}).then((res) => {
|
||||
list.value = res
|
||||
})
|
||||
}
|
||||
// 切换 时间卡片
|
||||
function changeTimeFunc(val) {
|
||||
vdata.timeSelected = val;
|
||||
getList()
|
||||
// console.log(vdata.timeSelected,'调试121')
|
||||
// refData();
|
||||
// if (vdata.memberIsShow) {
|
||||
// getMemberData();
|
||||
// }
|
||||
}
|
||||
// 根据选择请求数据
|
||||
function refData() {
|
||||
// 获取 统计数据
|
||||
$indexStatistics(vdata.timeSelected).then(({ bizData }) => {
|
||||
vdata.payAmount = bizData.totalSuccAmt;
|
||||
vdata.payCount = bizData.totalSuccNum;
|
||||
vdata.refundAmount = bizData.totalRefundAmt;
|
||||
vdata.refundCount = bizData.totalRefundNum;
|
||||
});
|
||||
}
|
||||
|
||||
// 扫码动作
|
||||
function scanFunc() {
|
||||
unionScan.scan(true).then((res) => {
|
||||
// 登录类型
|
||||
if (res.type == unionScan.QR_TYPE_LOGIN) {
|
||||
return go.to('PAGES_SCAN_LOGIN', { qrcodeNo: res.originQrVal });
|
||||
}
|
||||
|
||||
// 二维码
|
||||
if (res.type == unionScan.QR_TYPE_QRC) {
|
||||
return go.to('PAGES_APP_CODE_BIND', { qrcId: res.bizValue });
|
||||
onMounted(() => {
|
||||
vdata.memberIsShow = ent.has('ENT_MCH_MEMBER') && storageManage.userInfo().isHasMemberEnt;
|
||||
if (ent.has('ENT_MCH_MEMBER') && storageManage.userInfo().isHasMemberEnt) {
|
||||
getMemberData();
|
||||
}
|
||||
getList()
|
||||
});
|
||||
}
|
||||
const emits = defineEmits(['click']);
|
||||
const timeList = [{
|
||||
title: '今天',
|
||||
value: 'today'
|
||||
},
|
||||
{
|
||||
title: '昨天',
|
||||
value: 'yesterday'
|
||||
},
|
||||
{
|
||||
title: '近7天',
|
||||
value: 'circumference'
|
||||
},
|
||||
{
|
||||
title: '近30天',
|
||||
value: 'moon'
|
||||
}
|
||||
];
|
||||
let list = ref()
|
||||
const vdata = reactive({
|
||||
timeSelected: 'today', // 当前时间选择器的
|
||||
payAmount: -1, // 实收金额
|
||||
payCount: -1, // 交易笔数
|
||||
refundAmount: -1, // 退款金额
|
||||
refundCount: -1, // 退款笔数
|
||||
memberIsShow: false //是否开启会员模块
|
||||
});
|
||||
const memberData = reactive({});
|
||||
|
||||
function getList() {
|
||||
let startTime, endTime;
|
||||
if (vdata.timeSelected == 'today') {
|
||||
startTime = dayjs().format('YYYY-MM-DD') + ' 00:00:00'
|
||||
endTime = dayjs().format('YYYY-MM-DD') + ' 23:59:59'
|
||||
} else if (vdata.timeSelected == 'yesterday') {
|
||||
startTime = formatTime() + ' 00:00:00'
|
||||
endTime = formatTime() + ' 23:59:59'
|
||||
} else if (vdata.timeSelected == 'circumference') {
|
||||
startTime = dayjs().add(-7, 'day').format('YYYY-MM-DD 00:00:00')
|
||||
endTime = dayjs().format('YYYY-MM-DD 23:59:59')
|
||||
} else if (vdata.timeSelected == 'moon') {
|
||||
startTime = dayjs().add(-30, 'day').format('YYYY-MM-DD 00:00:00')
|
||||
endTime = dayjs().format('YYYY-MM-DD 23:59:59')
|
||||
} else if (vdata.timeSelected == 'custom') {
|
||||
startTime = start
|
||||
endTime = end
|
||||
}
|
||||
summaryTrade({
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
startTime,
|
||||
endTime,
|
||||
}).then((res) => {
|
||||
list.value = res
|
||||
})
|
||||
}
|
||||
// 切换 时间卡片
|
||||
function changeTimeFunc(val) {
|
||||
vdata.timeSelected = val;
|
||||
getList()
|
||||
// console.log(vdata.timeSelected,'调试121')
|
||||
// refData();
|
||||
// if (vdata.memberIsShow) {
|
||||
// getMemberData();
|
||||
// }
|
||||
}
|
||||
// 根据选择请求数据
|
||||
function refData() {
|
||||
// 获取 统计数据
|
||||
$indexStatistics(vdata.timeSelected).then(({
|
||||
bizData
|
||||
}) => {
|
||||
vdata.payAmount = bizData.totalSuccAmt;
|
||||
vdata.payCount = bizData.totalSuccNum;
|
||||
vdata.refundAmount = bizData.totalRefundAmt;
|
||||
vdata.refundCount = bizData.totalRefundNum;
|
||||
});
|
||||
}
|
||||
|
||||
// 扫码动作
|
||||
function scanFunc() {
|
||||
unionScan.scan(true).then((res) => {
|
||||
// 登录类型
|
||||
if (res.type == unionScan.QR_TYPE_LOGIN) {
|
||||
return go.to('PAGES_SCAN_LOGIN', {
|
||||
qrcodeNo: res.originQrVal
|
||||
});
|
||||
}
|
||||
|
||||
// 二维码
|
||||
if (res.type == unionScan.QR_TYPE_QRC) {
|
||||
return go.to('PAGES_APP_CODE_BIND', {
|
||||
qrcId: res.bizValue
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
// 获取当前时间
|
||||
function getdate() {
|
||||
const dt = new Date();
|
||||
|
|
@ -172,98 +198,116 @@ function scanFunc() {
|
|||
let d = dateFormat.getDate().toString().padStart(2, '0')
|
||||
return `${y}-${m}-${d}`
|
||||
}
|
||||
const getMemberData = () => {
|
||||
$memberInfoCount({ queryDateRange: vdata.timeSelected }).then(({ bizData }) => {
|
||||
Object.assign(memberData, bizData);
|
||||
const getMemberData = () => {
|
||||
$memberInfoCount({
|
||||
queryDateRange: vdata.timeSelected
|
||||
}).then(({
|
||||
bizData
|
||||
}) => {
|
||||
Object.assign(memberData, bizData);
|
||||
});
|
||||
};
|
||||
defineExpose({
|
||||
refData
|
||||
});
|
||||
};
|
||||
defineExpose({ refData });
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.index-header {
|
||||
width: 680rpx;
|
||||
margin: 0 auto;
|
||||
transform: translateY(30rpx);
|
||||
margin-bottom: 25rpx;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: $J-b-r32;
|
||||
background: $jeepay-bg-primary;
|
||||
backdrop-filter: blur(20rpx);
|
||||
box-shadow: 0 50rpx 70rpx -60rpx rgba(0, 65, 164, 0.5);
|
||||
.index-selected {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.index-time {
|
||||
.index-header {
|
||||
width: 680rpx;
|
||||
margin: 0 auto;
|
||||
transform: translateY(30rpx);
|
||||
margin-bottom: 25rpx;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: $J-b-r32;
|
||||
background: $jeepay-bg-primary;
|
||||
backdrop-filter: blur(20rpx);
|
||||
box-shadow: 0 50rpx 70rpx -60rpx rgba(0, 65, 164, 0.5);
|
||||
|
||||
.index-selected {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 490rpx;
|
||||
height: 90rpx;
|
||||
border-radius: 20rpx;
|
||||
padding: 10rpx;
|
||||
background-color: rgba($color: #fff, $alpha: 0.1);
|
||||
.time-item {
|
||||
flex: 1;
|
||||
// width: 120rpx;
|
||||
height: 100%;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(255, 255, 255, 0.75);
|
||||
|
||||
.index-time {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 490rpx;
|
||||
height: 90rpx;
|
||||
border-radius: 20rpx;
|
||||
padding: 10rpx;
|
||||
background-color: rgba($color: #fff, $alpha: 0.1);
|
||||
|
||||
.time-item {
|
||||
flex: 1;
|
||||
// width: 120rpx;
|
||||
height: 100%;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(255, 255, 255, 0.75);
|
||||
}
|
||||
|
||||
.time-active {
|
||||
background-color: $J-bg-ff;
|
||||
color: $J-color-t21;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
}
|
||||
.time-active {
|
||||
background-color: $J-bg-ff;
|
||||
color: $J-color-t21;
|
||||
border-radius: 12rpx;
|
||||
|
||||
.index-scan {
|
||||
width: 110rpx;
|
||||
height: 110rpx;
|
||||
border-radius: 20rpx;
|
||||
background-color: rgba($color: #fff, $alpha: 0.1);
|
||||
|
||||
image {
|
||||
width: 41rpx;
|
||||
height: 35rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.index-scan {
|
||||
width: 110rpx;
|
||||
|
||||
.receipts-money {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin: 30rpx 0;
|
||||
color: $J-color-tff;
|
||||
|
||||
.money-num {
|
||||
font-size: 70rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.money-list {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0 72rpx;
|
||||
margin-bottom: 50rpx;
|
||||
text-align: center;
|
||||
color: $J-color-tff;
|
||||
|
||||
.money-item {
|
||||
.money-num {
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.money-title {
|
||||
margin-bottom: 10rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 400;
|
||||
color: $J-color-tSff;
|
||||
}
|
||||
|
||||
.quick-money {
|
||||
height: 110rpx;
|
||||
border-radius: 20rpx;
|
||||
background-color: rgba($color: #fff, $alpha: 0.1);
|
||||
image {
|
||||
width: 41rpx;
|
||||
height: 35rpx;
|
||||
}
|
||||
color: $J-color-t29;
|
||||
}
|
||||
}
|
||||
.receipts-money {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin: 30rpx 0;
|
||||
color: $J-color-tff;
|
||||
.money-num {
|
||||
font-size: 70rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
.money-list {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0 72rpx;
|
||||
margin-bottom: 50rpx;
|
||||
text-align: center;
|
||||
color: $J-color-tff;
|
||||
.money-item {
|
||||
.money-num {
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
.money-title {
|
||||
margin-bottom: 10rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 400;
|
||||
color: $J-color-tSff;
|
||||
}
|
||||
.quick-money {
|
||||
height: 110rpx;
|
||||
border-radius: 20rpx;
|
||||
color: $J-color-t29;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
Loading…
Reference in New Issue