耗材解决问题

This commit is contained in:
duan 2024-10-23 15:11:27 +08:00
parent 692ca30253
commit 0e05b3ea5a
14 changed files with 413 additions and 246 deletions

View File

@ -59,8 +59,8 @@ const $PermissionObj = {
key: 'yun_xu_guan_li_hui_yuan_xin_xi' key: 'yun_xu_guan_li_hui_yuan_xin_xi'
}, },
{ {
text: 'yun_xu_xiu_gai_hui_yuan_yu_e', key: 'yun_xu_xiu_gai_hui_yuan_yu_e',
key: '允许修改会员余额' text: '允许修改会员余额'
} }
], ],
stock:[ stock:[

View File

@ -62,9 +62,10 @@ const props = defineProps({
// //
async function clickFunc(nav) { async function clickFunc(nav) {
let res =await hasPermission('允许查看经营数据') if(nav.pageUrl=="PAGES_SALES_SUMMARY"){
console.log(res,'调试11111') let res =await hasPermission('允许查看经营数据')
if(!res) return if(!res) return
}
// //
if (nav.clickFunc) { if (nav.clickFunc) {
return nav.clickFunc(nav) return nav.clickFunc(nav)

View File

@ -25,7 +25,7 @@
耗材价格 耗材价格
</view> </view>
<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> </view>
</li> </li>
<li> <li>
@ -59,13 +59,16 @@
<up-button type="primary" style="background-color: #318AFE;color: #fff;" @tap="sumbit" :plain="true" <up-button type="primary" style="background-color: #318AFE;color: #fff;" @tap="sumbit" :plain="true"
text="保存"></up-button> text="保存"></up-button>
</view> </view>
<!-- 消息提示 -->
<up-toast ref="uToastRef"></up-toast>
</template> </template>
<script setup> <script setup>
import { import {
reactive, reactive,
computed, computed,
onMounted onMounted,
getCurrentInstance
} from 'vue'; } from 'vue';
import { import {
tbConsTypeList, tbConsTypeList,
@ -107,13 +110,29 @@
}) })
}) })
} }
const refs = getCurrentInstance()
let sumbit = () => { 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([{ tbConsInfoAddlist([{
...datas.form, ...datas.form,
shopId: uni.getStorageSync("shopId"), shopId: uni.getStorageSync("shopId"),
conTypeId: datas.list[datas.nowStatusIndex].id conTypeId: datas.list[datas.nowStatusIndex].id
}]).then(res => { }]).then(res => {
go.to('PAGES_SALES_CONSUMABLES') // go.to('PAGES_SALES_CONSUMABLES')
go.back()
}) })
} }
const statusHeight = computed(() => { const statusHeight = computed(() => {

View File

@ -6,7 +6,7 @@
</view> </view>
<view class=""> <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)" /> :modelValue="item.status" style="transform:scale(0.7)" />
</view> </view>
</li> </li>
@ -126,13 +126,13 @@
}) })
} }
</script> </script>
<style>
<style scoped lang="less">
page { page {
background-color: #f9f9f9; background-color: #f9f9f9;
padding: 0 28rpx; padding: 0 28rpx;
} }
</style>
<style scoped lang="less">
ul, ul,
li { li {
list-style: none; list-style: none;

BIN
pageConsumables/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@ -114,7 +114,7 @@
conTypeId: datas.list[datas.nowStatusIndex].id, conTypeId: datas.list[datas.nowStatusIndex].id,
id: datas.form.id id: datas.form.id
}]).then(res => { }]).then(res => {
go.to('PAGES_SALES_CONSUMABLES') go.back()
}) })
} }
const statusHeight = computed(() => { const statusHeight = computed(() => {
@ -126,11 +126,13 @@
datas.showStatus = false datas.showStatus = false
} }
</script> </script>
<style>
<style scoped lang="less">
page { page {
background-color: #f9f9f9; background-color: #f9f9f9;
} }
</style>
<style scoped lang="less">
ul, ul,
li { li {

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="ConsumablesTop"> <view class="ConsumablesTop">
<view @tap="showStatus = !showStatus"> <view @tap="showStatus = !showStatus" style="display: flex;align-items: center;">
{{datas.title}} {{datas.title}}<up-icon name="arrow-down" size="12"></up-icon>
</view> </view>
<view> <view>
<input v-model="datas.conName" @input="inputEvent" type="text" placeholder="请输入耗材名称" /> <input v-model="datas.conName" @input="inputEvent" type="text" placeholder="请输入耗材名称" />
@ -20,7 +20,7 @@
<view :style="{height: '14px'}"></view> <view :style="{height: '14px'}"></view>
</view> </view>
<ul class="ConsumablesConent"> <ul class="ConsumablesConent" v-if="datas.list.length">
<li v-for="(item,index) in datas.list" :key="index"> <li v-for="(item,index) in datas.list" :key="index">
<view> <view>
{{item.conName}} {{item.conName}}
@ -49,12 +49,18 @@
所属商品: {{ filtersSproductId(item.productId)}} 所属商品: {{ filtersSproductId(item.productId)}}
</view> </view>
<view class=""> <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> <up-button type="primary" @click="toggle(item)" :plain="true" text="更多操作"></up-button>
</view> </view>
</view> </view>
</li> </li>
<li style="background-color: rgba(0,0,0,0); height: 200rpx;"></li>
</ul> </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 class="ConsumablesBottom">
<view @tap="toUrl('PAGES_ADD_CONSUMABLES')"> <view @tap="toUrl('PAGES_ADD_CONSUMABLES')">
新增耗材 新增耗材
@ -76,8 +82,13 @@
reactive, reactive,
computed computed
} from 'vue'; } from 'vue';
import {onShow} from '@dcloudio/uni-app' import {
onShow
} from '@dcloudio/uni-app'
import go from '@/commons/utils/go.js'; import go from '@/commons/utils/go.js';
import {
hasPermission
} from '@/commons/utils/hasPermission.js';
import { import {
viewConInfoFlowget, viewConInfoFlowget,
tbConsType, tbConsType,
@ -120,6 +131,7 @@
// //
gettbConsTypeList() gettbConsTypeList()
}) })
function changeNowStatusIndex(i) { function changeNowStatusIndex(i) {
nowStatusIndex.value = i nowStatusIndex.value = i
showStatus.value = false showStatus.value = false
@ -162,46 +174,66 @@
let sheetClick = (index) => { let sheetClick = (index) => {
if (index == 0) { if (index == 0) {
//
hasPermission('允许提交报损').then(ele => {
if (ele) {
// //
reportDamage.value.open(actionSheet.activeId); reportDamage.value.open(actionSheet.activeId);
report.data.name = actionSheet.active.conName report.data.name = actionSheet.active.conName
report.data.unit = actionSheet.active.conUnit report.data.unit = actionSheet.active.conUnit
}
})
} else if (index == 1) { } else if (index == 1) {
toUrl('PAGES_EDIT_CONSUMABLES', { toUrl('PAGES_EDIT_CONSUMABLES', {
item: JSON.stringify(actionSheet.active) item: JSON.stringify(actionSheet.active)
}) })
} else if (index == 2) { } else if (index == 2) {
hasPermission('允许耗材盘点').then(ele => {
if (ele) {
toUrl('PAGES_SALES_INVENTORYCHECK', { toUrl('PAGES_SALES_INVENTORYCHECK', {
item: JSON.stringify(actionSheet.active) item: JSON.stringify(actionSheet.active)
}) })
}
})
} else if (index == 3) { } else if (index == 3) {
console.log(actionSheet.activeId,'调试1') hasPermission('允许耗材入库').then(ele => {
if (ele) {
toUrl('PAGES_SALES_WAREHOUSEENTRY', { toUrl('PAGES_SALES_WAREHOUSEENTRY', {
consId: actionSheet.activeId, consId: actionSheet.activeId,
item: JSON.stringify(actionSheet.active) item: JSON.stringify(actionSheet.active)
}) })
}
})
} else if (index == 4) { } else if (index == 4) {
hasPermission('允许耗材出库').then(ele => {
if (ele) {
toUrl('PAGES_SALES_OUTBOUND', { toUrl('PAGES_SALES_OUTBOUND', {
consId: actionSheet.activeId, consId: actionSheet.activeId,
item: JSON.stringify(actionSheet.active) item: JSON.stringify(actionSheet.active)
}) })
} }
})
} }
}
// async function viewpermission(d) {
// let res = await hasPermission(d)
// console.log(res,'1')
// return res
// }
async function getList(d = "") { async function getList(d = "") {
viewConInfoFlowget({ viewConInfoFlowget({
shopId: uni.getStorageSync("shopId"), shopId: uni.getStorageSync("shopId"),
conName: datas.conName, conName: datas.conName,
conTypeId: d, conTypeId: d,
size:100, size: 100,
page:0 page: 0
}).then(res => { }).then(res => {
datas.list = res.content datas.list = res.content
}) })
} }
function inputEvent(d) { function inputEvent(d) {
datas.conName = d.detail.value datas.conName = d.detail.value.replace(/\s*/g,"");
getList() getList()
} }

View File

@ -100,7 +100,8 @@
conInfoId: datas.form.id, conInfoId: datas.form.id,
lpNum: profitNumber._value lpNum: profitNumber._value
}).then(res => { }).then(res => {
go.to('PAGES_SALES_CONSUMABLES') // go.to('PAGES_SALES_CONSUMABLES')
go.back()
}) })
} }
/** /**
@ -129,11 +130,13 @@
showStatus.value = !showStatus.value showStatus.value = !showStatus.value
} }
</script> </script>
<style>
<style scoped lang="less">
page { page {
background-color: #f9f9f9; background-color: #f9f9f9;
} }
</style>
<style scoped lang="less">
.df() { .df() {
display: flex; display: flex;

View File

@ -185,7 +185,7 @@
supplierId: datas.list[nowStatusIndex.value].id, supplierId: datas.list[nowStatusIndex.value].id,
accountsPayable: datas.form.list[0].stockNumber * datas.form.list[0].price, accountsPayable: datas.form.list[0].stockNumber * datas.form.list[0].price,
}).then(res => { }).then(res => {
go.to('PAGES_SALES_CONSUMABLES') go.back()
}) })
} }
// //
@ -193,11 +193,13 @@
return 30 * datas.status.length + 14 + 'px' return 30 * datas.status.length + 14 + 'px'
}) })
</script> </script>
<style>
<style scoped lang="less">
page { page {
background-color: #f9f9f9; background-color: #f9f9f9;
} }
</style>
<style scoped lang="less">
.df() { .df() {
display: flex; display: flex;

View File

@ -49,6 +49,7 @@
}) })
onMounted(() => { onMounted(() => {
let items = JSON.parse(props.item) let items = JSON.parse(props.item)
console.log(items,'调试1')
getlist() getlist()
}) })
let getlist = () => { let getlist = () => {
@ -56,18 +57,21 @@
page: 0, page: 0,
shopId: uni.getStorageSync("shopId"), shopId: uni.getStorageSync("shopId"),
size: 30, size: 30,
sort: "createTime,desc" sort: "createTime,desc",
conTypeId:JSON.parse(props.item).conTypeId
}).then(res => { }).then(res => {
datas.list = res.content datas.list = res.content
}) })
} }
</script> </script>
<style>
<style scoped lang="less">
page { page {
background-color: #f9f9f9; background-color: #f9f9f9;
} }
</style>
<style scoped lang="less">
ul, ul,
li { li {
list-style: none; list-style: none;

View File

@ -22,7 +22,7 @@
<text style="color: red;">*</text> 入库数量 <text style="color: red;">*</text> 入库数量
</view> </view>
<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> </view>
</li> </li>
<li> <li>
@ -30,7 +30,7 @@
<text style="color: red;">*</text>单价 <text style="color: red;">*</text>单价
</view> </view>
<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> </view>
</li> </li>
<li> <li>
@ -132,6 +132,7 @@
datas.form = assign(datas.form, ...datas.item) datas.form = assign(datas.form, ...datas.item)
}) })
const refs = getCurrentInstance() const refs = getCurrentInstance()
function toggle() { function toggle() {
go.to('PAGES_ADD_SUPPLIER') go.to('PAGES_ADD_SUPPLIER')
} }
@ -167,7 +168,7 @@
}) })
return return
} }
if(!datas.form.list.price){ if (!datas.form.list.price) {
refs.ctx.$refs.uToastRef.show({ refs.ctx.$refs.uToastRef.show({
type: 'default', type: 'default',
message: "请输入必填项", message: "请输入必填项",
@ -182,7 +183,13 @@
supplierId: datas.list[nowStatusIndex.value].id, supplierId: datas.list[nowStatusIndex.value].id,
accountsPayable: datas.form.list[0].stockNumber * datas.form.list[0].price, accountsPayable: datas.form.list[0].stockNumber * datas.form.list[0].price,
}).then(res => { }).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' return 30 * datas.status.length + 14 + 'px'
}) })
</script> </script>
<style>
<style scoped lang="less">
page { page {
background-color: #f9f9f9; background-color: #f9f9f9;
} }
</style>
<style scoped lang="less">
.df() { .df() {
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -32,10 +32,28 @@
</view> </view>
</view> </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="u-flex-1 u-text-center" @tap="toUser">
<view class="font-bold color-000 pr-16">{{data.totalScore}}</view> <view class="font-bold color-000 pr-16">{{data.totalScore}}</view>
<view class="u-flex u-row-center"> <view class="u-flex u-row-center">
<view class="color-999">积分</view> <view class="color-999">已消费</view>
<view class="u-flex"> <view class="u-flex">
<uni-icons type="right" color="#999"></uni-icons> <uni-icons type="right" color="#999"></uni-icons>
</view> </view>

View File

@ -25,15 +25,15 @@
<view class="u-font-32">数据统计</view> <view class="u-font-32">数据统计</view>
<view class="u-m-t-40 u-flex u-row-between"> <view class="u-m-t-40 u-flex u-row-between">
<view class=" "> <view class=" ">
<view>会员数</view> <view>今日新增()</view>
<view class="u-m-t-10 u-font-36 font-bold">{{pageData.allShopInfo.userTotal}}</view> <view class="u-m-t-10 u-font-36 font-bold">{{pageData.allShopInfo.userTotal}}</view>
</view> </view>
<view class="line-l-r u-p-l-30 u-p-r-30"> <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 class="u-m-t-10 u-font-36 font-bold">{{pageData.allShopInfo.balanceTotal}}</view>
</view> </view>
<view class=""> <view class="">
<view>充值金额</view> <view>总余额()</view>
<view class="u-m-t-10 u-font-36 font-bold">{{pageData.allShopInfo.chageTotal}}</view> <view class="u-m-t-10 u-font-36 font-bold">{{pageData.allShopInfo.chageTotal}}</view>
</view> </view>
</view> </view>
@ -47,6 +47,9 @@
</view> </view>
<my-pagination @change="pageChange"></my-pagination> <my-pagination @change="pageChange"></my-pagination>
</view> </view>
<view class="fixed_b">
<my-button showShadow @tap="toAddUser" shape="circle">新建用户</my-button>
</view>
</template> </template>
<!-- 导入用户 --> <!-- 导入用户 -->
@ -83,7 +86,6 @@
</view> </view>
</view> </view>
</view> </view>
<view class="fixed_b"> <view class="fixed_b">
<my-button showShadow @tap="toAddUser" shape="circle">新建用户</my-button> <my-button showShadow @tap="toAddUser" shape="circle">新建用户</my-button>
</view> </view>
@ -166,6 +168,9 @@
import infoBox from "@/commons/utils/infoBox.js" import infoBox from "@/commons/utils/infoBox.js"
import * as $Api from '@/http/yskApi/shop-user.js' import * as $Api from '@/http/yskApi/shop-user.js'
import API from '../../http/classApi'; import API from '../../http/classApi';
import {
hasPermission
} from '@/commons/utils/hasPermission.js';
let tabsCurrent = ref(0) let tabsCurrent = ref(0)
const tabsList = ['用户列表', '导入用户'] const tabsList = ['用户列表', '导入用户']
const remarkModel = ref(null) const remarkModel = ref(null)
@ -185,14 +190,37 @@
const goodsStockModel = ref(null) const goodsStockModel = ref(null)
const moreOperateList = ['增减余额', '增减积分', '设为会员', '赠送券', '查看详情'] const moreOperateList = ['增减余额', '增减积分', '修改信息', ]
function moreOperateClick() { function moreOperateClick() {
moreOperate.value.open() moreOperate.value.open()
} }
function actionSheetClick(i) { 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>
<style lang="scss" scoped> <style lang="scss" scoped>
.after-r,.after-l { .after-r,
.after-l {
position: relative; position: relative;
} }
.line-l-r{
.line-l-r {
position: relative; position: relative;
&::after,&:before{
&::after,
&:before {
position: absolute; position: absolute;
content: ''; content: '';
top: 0; top: 0;
@ -381,13 +413,16 @@
border-radius: 2px; border-radius: 2px;
background-color: rgba(255, 255, 255, .3); background-color: rgba(255, 255, 255, .3);
} }
&::after{
&::after {
right: 0; right: 0;
} }
&::before{
&::before {
left: 0; left: 0;
} }
} }
.after-r::after { .after-r::after {
position: absolute; position: absolute;
content: ''; content: '';

View File

@ -3,7 +3,8 @@
<view class="index-selected"> <view class="index-selected">
<view class="index-time"> <view class="index-time">
<block v-for="v in timeList" :key="v.value"> <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 }} {{ v.title }}
</view> </view>
</block> </block>
@ -14,20 +15,20 @@
</view> </view>
<view class="receipts-money"> <view class="receipts-money">
<text class="money-title">成交金额 ()</text> <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>
<view class="money-list"> <view class="money-list">
<view class="money-item"> <view class="money-item">
<text class="money-title">消费笔数</text> <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>
<view class="money-item"> <view class="money-item">
<text class="money-title">退款金额 ()</text> <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>
<view class="money-item"> <view class="money-item">
<text class="money-title">消费金额</text> <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> </view>
<view class="money-list" v-if="vdata.memberIsShow"> <view class="money-list" v-if="vdata.memberIsShow">
@ -53,43 +54,62 @@
</template> </template>
<script setup> <script setup>
import { ref, reactive, onMounted } from 'vue'; import {
import { $indexStatistics, $memberInfoCount } from '@/http/apiManager.js'; ref,
import cal from '@/commons/utils/cal.js'; reactive,
import go from '@/commons/utils/go.js'; onMounted
import ak from '@/commons/utils/ak.js'; } from 'vue';
import ent from '@/commons/utils/ent.js'; import {
import unionScan from '@/commons/utils/unionScan.js'; $indexStatistics,
import storageManage from '@/commons/utils/storageManage.js'; $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 dayjs from 'dayjs' //
import { import {
summaryTrade, summaryTrade,
} from '@/http/yskApi/requestAll.js'; } from '@/http/yskApi/requestAll.js';
onMounted(() => { onMounted(() => {
vdata.memberIsShow = ent.has('ENT_MCH_MEMBER') && storageManage.userInfo().isHasMemberEnt; vdata.memberIsShow = ent.has('ENT_MCH_MEMBER') && storageManage.userInfo().isHasMemberEnt;
if (ent.has('ENT_MCH_MEMBER') && storageManage.userInfo().isHasMemberEnt) { if (ent.has('ENT_MCH_MEMBER') && storageManage.userInfo().isHasMemberEnt) {
getMemberData(); getMemberData();
} }
getList() getList()
}); });
const emits = defineEmits(['click']); const emits = defineEmits(['click']);
const timeList = [ const timeList = [{
{ title: '今天', value: 'today' }, title: '今天',
{ title: '昨天', value: 'yesterday' }, value: 'today'
{ title: '近7天', value: 'circumference' }, },
{ title: '近30天', value: 'moon' } {
]; title: '昨天',
let list = ref() value: 'yesterday'
const vdata = reactive({ },
{
title: '近7天',
value: 'circumference'
},
{
title: '近30天',
value: 'moon'
}
];
let list = ref()
const vdata = reactive({
timeSelected: 'today', // timeSelected: 'today', //
payAmount: -1, // payAmount: -1, //
payCount: -1, // payCount: -1, //
refundAmount: -1, // 退 refundAmount: -1, // 退
refundCount: -1, // 退 refundCount: -1, // 退
memberIsShow: false // memberIsShow: false //
}); });
const memberData = reactive({}); const memberData = reactive({});
function getList(){
function getList() {
let startTime, endTime; let startTime, endTime;
if (vdata.timeSelected == 'today') { if (vdata.timeSelected == 'today') {
startTime = dayjs().format('YYYY-MM-DD') + ' 00:00:00' startTime = dayjs().format('YYYY-MM-DD') + ' 00:00:00'
@ -114,9 +134,9 @@ function getList(){
}).then((res) => { }).then((res) => {
list.value = res list.value = res
}) })
} }
// //
function changeTimeFunc(val) { function changeTimeFunc(val) {
vdata.timeSelected = val; vdata.timeSelected = val;
getList() getList()
// console.log(vdata.timeSelected,'121') // console.log(vdata.timeSelected,'121')
@ -124,32 +144,38 @@ function changeTimeFunc(val) {
// if (vdata.memberIsShow) { // if (vdata.memberIsShow) {
// getMemberData(); // getMemberData();
// } // }
} }
// //
function refData() { function refData() {
// //
$indexStatistics(vdata.timeSelected).then(({ bizData }) => { $indexStatistics(vdata.timeSelected).then(({
bizData
}) => {
vdata.payAmount = bizData.totalSuccAmt; vdata.payAmount = bizData.totalSuccAmt;
vdata.payCount = bizData.totalSuccNum; vdata.payCount = bizData.totalSuccNum;
vdata.refundAmount = bizData.totalRefundAmt; vdata.refundAmount = bizData.totalRefundAmt;
vdata.refundCount = bizData.totalRefundNum; vdata.refundCount = bizData.totalRefundNum;
}); });
} }
// //
function scanFunc() { function scanFunc() {
unionScan.scan(true).then((res) => { unionScan.scan(true).then((res) => {
// //
if (res.type == unionScan.QR_TYPE_LOGIN) { if (res.type == unionScan.QR_TYPE_LOGIN) {
return go.to('PAGES_SCAN_LOGIN', { qrcodeNo: res.originQrVal }); return go.to('PAGES_SCAN_LOGIN', {
qrcodeNo: res.originQrVal
});
} }
// //
if (res.type == unionScan.QR_TYPE_QRC) { if (res.type == unionScan.QR_TYPE_QRC) {
return go.to('PAGES_APP_CODE_BIND', { qrcId: res.bizValue }); return go.to('PAGES_APP_CODE_BIND', {
qrcId: res.bizValue
});
} }
}); });
} }
// //
function getdate() { function getdate() {
const dt = new Date(); const dt = new Date();
@ -172,16 +198,22 @@ function scanFunc() {
let d = dateFormat.getDate().toString().padStart(2, '0') let d = dateFormat.getDate().toString().padStart(2, '0')
return `${y}-${m}-${d}` return `${y}-${m}-${d}`
} }
const getMemberData = () => { const getMemberData = () => {
$memberInfoCount({ queryDateRange: vdata.timeSelected }).then(({ bizData }) => { $memberInfoCount({
queryDateRange: vdata.timeSelected
}).then(({
bizData
}) => {
Object.assign(memberData, bizData); Object.assign(memberData, bizData);
}); });
}; };
defineExpose({ refData }); defineExpose({
refData
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.index-header { .index-header {
width: 680rpx; width: 680rpx;
margin: 0 auto; margin: 0 auto;
transform: translateY(30rpx); transform: translateY(30rpx);
@ -192,9 +224,11 @@ defineExpose({ refData });
background: $jeepay-bg-primary; background: $jeepay-bg-primary;
backdrop-filter: blur(20rpx); backdrop-filter: blur(20rpx);
box-shadow: 0 50rpx 70rpx -60rpx rgba(0, 65, 164, 0.5); box-shadow: 0 50rpx 70rpx -60rpx rgba(0, 65, 164, 0.5);
.index-selected { .index-selected {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.index-time { .index-time {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -204,6 +238,7 @@ defineExpose({ refData });
border-radius: 20rpx; border-radius: 20rpx;
padding: 10rpx; padding: 10rpx;
background-color: rgba($color: #fff, $alpha: 0.1); background-color: rgba($color: #fff, $alpha: 0.1);
.time-item { .time-item {
flex: 1; flex: 1;
// width: 120rpx; // width: 120rpx;
@ -212,34 +247,40 @@ defineExpose({ refData });
font-weight: 500; font-weight: 500;
color: rgba(255, 255, 255, 0.75); color: rgba(255, 255, 255, 0.75);
} }
.time-active { .time-active {
background-color: $J-bg-ff; background-color: $J-bg-ff;
color: $J-color-t21; color: $J-color-t21;
border-radius: 12rpx; border-radius: 12rpx;
} }
} }
.index-scan { .index-scan {
width: 110rpx; width: 110rpx;
height: 110rpx; height: 110rpx;
border-radius: 20rpx; border-radius: 20rpx;
background-color: rgba($color: #fff, $alpha: 0.1); background-color: rgba($color: #fff, $alpha: 0.1);
image { image {
width: 41rpx; width: 41rpx;
height: 35rpx; height: 35rpx;
} }
} }
} }
.receipts-money { .receipts-money {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
margin: 30rpx 0; margin: 30rpx 0;
color: $J-color-tff; color: $J-color-tff;
.money-num { .money-num {
font-size: 70rpx; font-size: 70rpx;
font-weight: 500; font-weight: 500;
} }
} }
.money-list { .money-list {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -247,6 +288,7 @@ defineExpose({ refData });
margin-bottom: 50rpx; margin-bottom: 50rpx;
text-align: center; text-align: center;
color: $J-color-tff; color: $J-color-tff;
.money-item { .money-item {
.money-num { .money-num {
font-size: 32rpx; font-size: 32rpx;
@ -254,16 +296,18 @@ defineExpose({ refData });
} }
} }
} }
.money-title { .money-title {
margin-bottom: 10rpx; margin-bottom: 10rpx;
font-size: 26rpx; font-size: 26rpx;
font-weight: 400; font-weight: 400;
color: $J-color-tSff; color: $J-color-tSff;
} }
.quick-money { .quick-money {
height: 110rpx; height: 110rpx;
border-radius: 20rpx; border-radius: 20rpx;
color: $J-color-t29; color: $J-color-t29;
} }
} }
</style> </style>