Merge branch 'test' of https://e.coding.net/g-cphe0354/cashier_front/cashier_admin_app into gh
This commit is contained in:
commit
865e1780db
3
App.vue
3
App.vue
|
|
@ -3,10 +3,7 @@
|
|||
App.vue本身不是页面,这里不能编写视图元素,也就是没有<template>
|
||||
-->
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import appConfig from '@/config/appConfig.js';
|
||||
import { onLaunch } from '@dcloudio/uni-app';
|
||||
import { checkCurrVersion, getExtStoreId } from '@/commons/utils/versionManage.js';
|
||||
|
||||
onLaunch(() => {
|
||||
// console.log(uni.getExtConfigSync(),'uni.getExtConfigSync()')
|
||||
|
|
|
|||
|
|
@ -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:[
|
||||
|
|
|
|||
|
|
@ -34,9 +34,11 @@ const model = {
|
|||
// 1. 清空app级别缓存。
|
||||
Object.keys(appCache).forEach(k => appCache[k] = null)
|
||||
const merchantName=uni.getStorageSync('merchantName')
|
||||
const MerchantId=uni.getStorageSync('MerchantId')
|
||||
let envName = model.env() // 获取到当前的环境变量
|
||||
uni.clearStorageSync() // 清除所有的缓存信息
|
||||
uni.setStorageSync('merchantName',merchantName)
|
||||
uni.setStorageSync('MerchantId',MerchantId)
|
||||
model.env(envName) // 重置env
|
||||
},
|
||||
|
||||
|
|
@ -124,6 +126,48 @@ const model = {
|
|||
return appCache.useType
|
||||
}
|
||||
},
|
||||
// 缓存代客下单商品
|
||||
cacheGoods: (val, isDelete = false) => {
|
||||
if (isDelete) {
|
||||
appCache.cacheGoods = ""
|
||||
return uni.removeStorageSync('cacheGoods')
|
||||
}
|
||||
|
||||
if (val) {
|
||||
// 有值,为放置
|
||||
appCache.cacheGoods = val
|
||||
uni.setStorageSync('cacheGoods', val)
|
||||
} else {
|
||||
// 否则为获取
|
||||
|
||||
if (!appCache.cacheGoods) {
|
||||
//缓存取不到,获取应用本地信息
|
||||
appCache.cacheGoods = uni.getStorageSync('cacheGoods')
|
||||
}
|
||||
return appCache.cacheGoods
|
||||
}
|
||||
},
|
||||
// 缓存代客下单商品节点信息缓存
|
||||
cacheGoodsNode: (val, isDelete = false) => {
|
||||
if (isDelete) {
|
||||
appCache.cacheGoodsNode = ""
|
||||
return uni.removeStorageSync('cacheGoodsNode')
|
||||
}
|
||||
|
||||
if (val) {
|
||||
// 有值,为放置
|
||||
appCache.cacheGoodsNode = val
|
||||
uni.setStorageSync('cacheGoodsNode', val)
|
||||
} else {
|
||||
// 否则为获取
|
||||
|
||||
if (!appCache.cacheGoodsNode) {
|
||||
//缓存取不到,获取应用本地信息
|
||||
appCache.cacheGoodsNode = uni.getStorageSync('cacheGoodsNode')
|
||||
}
|
||||
return appCache.cacheGoodsNode
|
||||
}
|
||||
},
|
||||
// 已经登录的用户记录
|
||||
loggedInUser: (addUserName = null, removeUserName = null) => {
|
||||
let key = "loggedInUserList"
|
||||
|
|
|
|||
|
|
@ -32,7 +32,9 @@
|
|||
<view class="bg-img-view" :style="vdata.bgImgStyle">
|
||||
|
||||
<!-- 背景颜色view -->
|
||||
<view class="bg-color-view" :style="vdata.bgColorStyle">
|
||||
<view class="bg-color-view" :style="vdata.bgColorStyle" style="border-radius:0;background-color: #318AFE!important;">
|
||||
<view class="bgbottomStyle">
|
||||
</view>
|
||||
</view>
|
||||
<!-- 解决定位层级问题 -->
|
||||
<view class="bg-main">
|
||||
|
|
@ -93,7 +95,7 @@ onMounted(() => {
|
|||
right: 0,
|
||||
height: '550rpx',
|
||||
borderRadius: '0 0 32rpx 32rpx',
|
||||
background: 'linear-gradient(270deg, rgba(72, 192, 255, 1) 0%, rgba(51, 157, 255, 1) 100%)',
|
||||
// background: 'linear-gradient(270deg, rgba(72, 192, 255, 1) 0%, rgba(51, 157, 255, 1) 100%)',
|
||||
}
|
||||
vdata.bgColorStyle = Object.assign(defStyle, props.bgColorStyle)
|
||||
}
|
||||
|
|
@ -104,4 +106,13 @@ onMounted(() => {
|
|||
position: relative;
|
||||
z-index: 10;
|
||||
}
|
||||
.bgbottomStyle{
|
||||
position: absolute;
|
||||
bottom: -2rpx;
|
||||
left: 0;
|
||||
|
||||
width: 750rpx;
|
||||
height: 74rpx;
|
||||
background: linear-gradient( 180deg, rgba(195,215,235,0) 0%, #F9F9F9 100%);
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -42,7 +42,9 @@
|
|||
import { reactive, ref, computed } from "vue"
|
||||
import go from "@/commons/utils/go.js"
|
||||
import ent from '@/commons/utils/ent.js'
|
||||
|
||||
import {
|
||||
hasPermission
|
||||
} from '@/commons/utils/hasPermission.js';
|
||||
// 定义组件参数
|
||||
const props = defineProps({
|
||||
//显示类型: 支持 grid-宫格 list-列表
|
||||
|
|
@ -59,7 +61,11 @@ const props = defineProps({
|
|||
})
|
||||
|
||||
// 点击事件
|
||||
function clickFunc(nav) {
|
||||
async function clickFunc(nav) {
|
||||
if(nav.pageUrl=="PAGES_SALES_SUMMARY"){
|
||||
let res =await hasPermission('允许查看经营数据')
|
||||
if(!res) return
|
||||
}
|
||||
// 包含回调事件
|
||||
if (nav.clickFunc) {
|
||||
return nav.clickFunc(nav)
|
||||
|
|
|
|||
|
|
@ -38,14 +38,15 @@ export function getCart(params) {
|
|||
* 已上架商品列表
|
||||
* @returns
|
||||
*/
|
||||
export function getGoodsLists(params) {
|
||||
export function getGoodsLists(params,showLoading=true) {
|
||||
return request({
|
||||
url: `/api/place/activate`,
|
||||
method: "get",
|
||||
params:{
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
...params
|
||||
}
|
||||
},
|
||||
showLoading
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
import http from './http.js'
|
||||
const request = http.request
|
||||
|
||||
|
||||
/**
|
||||
* 商品报损
|
||||
* @returns
|
||||
*/
|
||||
export function get(params) {
|
||||
return request({
|
||||
url: `/freeDine`,
|
||||
method: 'get',
|
||||
params: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 耗材报损
|
||||
* @returns
|
||||
*/
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: `/freeDine`,
|
||||
method: 'put',
|
||||
params: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -16,12 +16,16 @@ import {
|
|||
import infoBox from "@/commons/utils/infoBox.js"
|
||||
import go from '@/commons/utils/go.js';
|
||||
// 测试服
|
||||
let baseUrl = 'https://admintestpapi.sxczgkj.cn'
|
||||
// let baseUrl = 'http://192.168.1.15:8000'
|
||||
// let baseUrl = 'https://admintestpapi.sxczgkj.cn'
|
||||
|
||||
//预发布
|
||||
let baseUrl = 'https://pre-cashieradmin.sxczgkj.cn'
|
||||
|
||||
// 王伟本地测
|
||||
// let baseUrl = '/ww'
|
||||
// let baseUrl = 'http://192.168.1.15:8000'
|
||||
|
||||
// 巩
|
||||
// let baseUrl = 'http://192.168.1.9:8000'
|
||||
// 多少 ms 以内, 不提示loading
|
||||
const loadingShowTime = 200
|
||||
|
||||
|
|
@ -127,6 +131,12 @@ function commonsProcess(showLoading, httpReqCallback) {
|
|||
go.to("PAGES_LOGIN", {}, go.GO_TYPE_RELAUNCH)
|
||||
})
|
||||
}
|
||||
// if(res.status==400){
|
||||
// storageManage.token(null, true)
|
||||
// infoBox.showErrorToast('').then(() => {
|
||||
// go.to("PAGES_LOGIN", {}, go.GO_TYPE_RELAUNCH)
|
||||
// })
|
||||
// }
|
||||
if(res.status==500){
|
||||
storageManage.token(null, true)
|
||||
infoBox.showErrorToast('请登录').then(() => {
|
||||
|
|
@ -180,7 +190,6 @@ function request(args) {
|
|||
} = args
|
||||
let headerObject = {}
|
||||
// headerObject[appConfig.tokenKey] = storageManage.token()
|
||||
|
||||
return commonsProcess(showLoading, () => {
|
||||
return uni.request(
|
||||
Object.assign({
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
import http from './http.js'
|
||||
const request=http.request
|
||||
|
||||
|
||||
/**
|
||||
* 获取订阅二维码
|
||||
* @returns
|
||||
*/
|
||||
export function getSubQrCode(params) {
|
||||
return request({
|
||||
url: `/api/msg/subQrCode`,
|
||||
method: 'get',
|
||||
params: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -10,6 +10,13 @@ export function summaryTrade(data) {
|
|||
}
|
||||
})
|
||||
}
|
||||
export function tbConsInfoFlowcount(data) {
|
||||
return request({
|
||||
url: '/api/tbConsInfoFlow/count',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 供应商列表
|
||||
export function tbShopPurveyorTransact(params) {
|
||||
return request({
|
||||
|
|
@ -196,7 +203,34 @@ export function callTabletakeNumber(data) {
|
|||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 增减余额
|
||||
export function midfiyAccount(data) {
|
||||
return request({
|
||||
url: '/api/tbShopUser/midfiyAccount',
|
||||
method: 'post',
|
||||
data: {
|
||||
...data
|
||||
}
|
||||
})
|
||||
}
|
||||
// 新增会员
|
||||
export function member(data) {
|
||||
return request({
|
||||
url: '/api/member',
|
||||
method: 'post',
|
||||
data: {
|
||||
...data
|
||||
}
|
||||
})
|
||||
}
|
||||
// 修改会员
|
||||
export function tbShopUser(data) {
|
||||
return request({
|
||||
url: `/api/tbShopUser`,
|
||||
method: "put",
|
||||
data
|
||||
});
|
||||
}
|
||||
export function callTablecallRecord(params) {
|
||||
return request({
|
||||
url: '/callTable/callRecord',
|
||||
|
|
@ -220,10 +254,11 @@ export function callTablecall(data) {
|
|||
});
|
||||
}
|
||||
// 获取员工列表
|
||||
export function rolesGet() {
|
||||
export function rolesGet(params) {
|
||||
return request({
|
||||
url: `/api/tbPlussShopStaff`,
|
||||
method: "get"
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
// 删除员工
|
||||
|
|
@ -249,6 +284,12 @@ export function getroles() {
|
|||
method: "get"
|
||||
});
|
||||
}
|
||||
export function tbConsTypes() {
|
||||
return request({
|
||||
url: `/api/tbConsType`,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
export function tbPlussShopStaff(data) {
|
||||
return request({
|
||||
url: `/api/tbPlussShopStaff`,
|
||||
|
|
@ -263,4 +304,12 @@ export function viewConInfoFlowget(data) {
|
|||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
// 耗材记录
|
||||
export function tbConsInfoFlowstock(data) {
|
||||
return request({
|
||||
url: `/api/tbConsInfoFlow/stock`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
// 桌台管理
|
||||
import http from './http.js'
|
||||
const request=http.request
|
||||
import $API from '@/http/classApi.js'
|
||||
import appConfig from '@/config/appConfig.js'
|
||||
import {
|
||||
|
|
@ -11,4 +12,15 @@ import infoBox from '@/commons/utils/infoBox.js'
|
|||
export const $tableArea=new $API('/api/tbShopArea',http.req)
|
||||
/* 台桌 */
|
||||
export const $table=new $API('/api/tbShopTable',http.req)
|
||||
|
||||
/* 绑定 */
|
||||
// export const $bind=new $API('/api/tbShopTable/bind',http.req)
|
||||
export function $bind(data) {
|
||||
return request({
|
||||
url: "/api/tbShopTable/bind",
|
||||
method: "post",
|
||||
data: {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name" : "银收客",
|
||||
"appid" : "__UNI__66E7BD0",
|
||||
"appid" : "__UNI__02A31D8",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : 100,
|
||||
|
|
@ -150,12 +150,12 @@
|
|||
"unipush" : {
|
||||
"enable" : true
|
||||
},
|
||||
"plugins" : {
|
||||
"WechatSI" : {
|
||||
"version" : "0.3.5",
|
||||
"provider" : "wx069ba97219f66d99"
|
||||
}
|
||||
},
|
||||
// "plugins" : {
|
||||
// "WechatSI" : {
|
||||
// "version" : "0.3.5",
|
||||
// "provider" : "wx069ba97219f66d99"
|
||||
// }
|
||||
// },
|
||||
"requiredBackgroundModes" : [ "audio", "location" ],
|
||||
"__usePrivacyCheck__" : true,
|
||||
"libVersion" : "latest"
|
||||
|
|
@ -213,6 +213,15 @@
|
|||
"/ysk" : ""
|
||||
}
|
||||
},
|
||||
"/yufabu" : {
|
||||
// 需要被代理的后台地址
|
||||
"target" : "https://pre-cashier.sxczgkj.cn",
|
||||
"changeOrigin" : true,
|
||||
"secure" : false,
|
||||
"pathRewrite" : {
|
||||
"/yufabu" : ""
|
||||
}
|
||||
},
|
||||
"/ww" : {
|
||||
// 需要被代理的后台地址
|
||||
"target" : "http://192.168.1.15:8000",
|
||||
|
|
|
|||
|
|
@ -4,17 +4,7 @@
|
|||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
<script setup>
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,169 @@
|
|||
<template>
|
||||
<view class="boxconstant">
|
||||
<view class="boxconstantbox"
|
||||
style="border-radius: 18px 18px 0 0;padding:32rpx 24rpx 0 24rpx;border-bottom: 2rpx solid #E5E5E5;">
|
||||
<view class="boxconstantbox_one">
|
||||
充值设置
|
||||
</view>
|
||||
<view class="boxconstantbox_tow">
|
||||
<text>用户消费结账时,成功充值成功</text>
|
||||
<input class="text" v-model="form.rechargeTimes"></input>
|
||||
<text>倍的金额本单即可享受免单</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="boxconstantbox" style="padding:32rpx 24rpx 0 24rpx; border-radius: 0 0 18px 18px;">
|
||||
<view class="boxconstantbox_one">
|
||||
充值门槛
|
||||
</view>
|
||||
<view class="boxconstantbox_tow">
|
||||
<text>订单支付金额需满</text>
|
||||
<input class="text" v-model="form.rechargeThreshold"></input>
|
||||
<text> 元,才能使用</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="oneboxconstant">
|
||||
<view class="oneboxconstant_one">
|
||||
功能启用
|
||||
</view>
|
||||
<up-switch v-model="form.enable" size="18"></up-switch>
|
||||
</view>
|
||||
<view class="boxconstantbox"
|
||||
style="margin-top:24rpx; padding:32rpx 24rpx 0 24rpx; border-radius: 0 0 18px 18px;">
|
||||
<view class="boxconstantbox_one">
|
||||
充值说明
|
||||
</view>
|
||||
<view class="boxconstantbox_tow">
|
||||
<up-textarea v-model="form.rechargeDesc" placeholder="请输入内容"></up-textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="save" @click="editlist">
|
||||
保存
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
onLoad,
|
||||
onShow,
|
||||
} from '@dcloudio/uni-app';
|
||||
import {
|
||||
computed,
|
||||
reactive,
|
||||
ref,
|
||||
watch
|
||||
} from 'vue';
|
||||
|
||||
import {
|
||||
get,
|
||||
edit
|
||||
} from '@/http/yskApi/bwc.js'
|
||||
|
||||
const form = reactive({
|
||||
id: '',
|
||||
enable: '',
|
||||
rechargeTimes: '',
|
||||
rechargeThreshold: '',
|
||||
withCoupon: '',
|
||||
withPoints: '',
|
||||
rechargeDesc: '',
|
||||
useTypeList: [],
|
||||
childShopIdList: '',
|
||||
});
|
||||
|
||||
const getlist = async () => {
|
||||
let res = await get()
|
||||
console.log(res)
|
||||
Object.assign(form, res)
|
||||
}
|
||||
const editlist = async () => {
|
||||
let res = await edit(form)
|
||||
uni.showToast({
|
||||
title: '保存成功'
|
||||
})
|
||||
Object.assign(form, res)
|
||||
}
|
||||
onShow(() => {
|
||||
getlist()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.boxconstant {
|
||||
padding: 32rpx 28rpx;
|
||||
|
||||
.boxconstantbox {
|
||||
padding: 32rpx 24rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
|
||||
.boxconstantbox_one {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.boxconstantbox_tow {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
padding-bottom: 24rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
box-sizing: border-box;
|
||||
|
||||
.text {
|
||||
margin: 0 12rpx;
|
||||
width: 118rpx;
|
||||
height: 48rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
border: 2rpx solid #E5E5E5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.oneboxconstant {
|
||||
margin-top: 32rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
padding: 32rpx 24rpx;
|
||||
|
||||
.oneboxconstant_one {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.save {
|
||||
margin: 100rpx auto 50rpx auto;
|
||||
width: 530rpx;
|
||||
height: 80rpx;
|
||||
background: #318AFE;
|
||||
border-radius: 56rpx 56rpx 56rpx 56rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -207,14 +207,15 @@
|
|||
</view>
|
||||
<view class="">
|
||||
<uni-forms-item label="分类名称" required name="name">
|
||||
<uni-easyinput padding-none :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
v-model="categoryChild.name" placeholder="输入分类名称" />
|
||||
<uni-easyinput padding-none :placeholderStyle="placeholderStyle"
|
||||
:inputBorder="inputBorder" v-model="categoryChild.name" placeholder="输入分类名称" />
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
<template v-if="option.type==='edit'">
|
||||
<uni-forms-item label="排序" required name="sort">
|
||||
<uni-easyinput padding-none :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
v-model="categoryChild.sort" type="number" placeholder="排序越小越靠前" />
|
||||
<uni-easyinput padding-none :placeholderStyle="placeholderStyle"
|
||||
:inputBorder="inputBorder" v-model="categoryChild.sort" type="number"
|
||||
placeholder="排序越小越靠前" />
|
||||
</uni-forms-item>
|
||||
</template>
|
||||
<uni-forms-item label="">
|
||||
|
|
@ -241,9 +242,11 @@
|
|||
</view>
|
||||
</template>
|
||||
</my-model>
|
||||
|
||||
<up-modal title="提示" content="确认删除该分类吗?" :show="modal.del" showCancelButton closeOnClickOverlay
|
||||
@confirm="confirmModelConfirm" @cancel="setModalShow('del',false)" @close="setModalShow('del',false)"
|
||||
width="300px"></up-modal>
|
||||
</view>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
|
@ -269,7 +272,28 @@
|
|||
onBeforeMount,
|
||||
watch
|
||||
} from 'vue';
|
||||
const modal = reactive({
|
||||
key: '',
|
||||
del: false
|
||||
})
|
||||
|
||||
function confirmModelConfirm() {
|
||||
if (modal.key == 'del') {
|
||||
$productCategory.del([selItem.data.id]).then(res => {
|
||||
category.childrenList.splice(selItem.index, 1)
|
||||
infoBox.showToast('删除成功')
|
||||
uni.setStorageSync('cateItem', category)
|
||||
})
|
||||
modal.del=false
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
function setModalShow(key = 'show', show = true) {
|
||||
modal.key = key
|
||||
modal[key] = show
|
||||
console.log(modal);
|
||||
}
|
||||
|
||||
const refAddChilCate = ref(null)
|
||||
const refAddChilCateTitle = ref('添加子分类')
|
||||
|
|
@ -339,19 +363,21 @@
|
|||
return
|
||||
}
|
||||
if (index === 1) {
|
||||
return uni.showModal({
|
||||
title: '提示',
|
||||
content: '确认删除该分类吗?',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
$productCategory.del([selItem.data.id]).then(res => {
|
||||
category.childrenList.splice(selItem.index, 1)
|
||||
infoBox.showToast('删除成功')
|
||||
uni.setStorageSync('cateItem', category)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
setModalShow('del', true)
|
||||
return
|
||||
// return uni.showModal({
|
||||
// title: '提示',
|
||||
// content: '确认删除该分类吗?',
|
||||
// success(res) {
|
||||
// if (res.confirm) {
|
||||
// $productCategory.del([selItem.data.id]).then(res => {
|
||||
// category.childrenList.splice(selItem.index, 1)
|
||||
// infoBox.showToast('删除成功')
|
||||
// uni.setStorageSync('cateItem', category)
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -676,13 +702,16 @@
|
|||
$icon-line-width: 20rpx;
|
||||
$icon-line-height: 4rpx;
|
||||
@import '@/commons/style/reset-uni-form.scss';
|
||||
::v-deep .uni-forms-item--border{
|
||||
padding-top: 24rpx ;
|
||||
padding-bottom: 24rpx ;
|
||||
|
||||
::v-deep .uni-forms-item--border {
|
||||
padding-top: 24rpx;
|
||||
padding-bottom: 24rpx;
|
||||
}
|
||||
::v-deep .uni-forms-item.is-direction-top .uni-forms-item__label{
|
||||
|
||||
::v-deep .uni-forms-item.is-direction-top .uni-forms-item__label {
|
||||
padding-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.category-icon {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
|
|
@ -697,9 +726,11 @@
|
|||
.my-switch {
|
||||
transform: scale(0.7);
|
||||
}
|
||||
::v-deep .uni-forms-item__content{
|
||||
|
||||
::v-deep .uni-forms-item__content {
|
||||
min-height: inherit;
|
||||
}
|
||||
|
||||
::v-deep .uni-forms-item__error {
|
||||
display: none !important;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 |
|
|
@ -86,7 +86,7 @@
|
|||
})
|
||||
let show = ref(props.show)
|
||||
let type = ref(props.type)
|
||||
let itemData = ref(props.item)
|
||||
let consId = ref()
|
||||
watch(() => props.show, (newval) => {
|
||||
show.value = newval
|
||||
})
|
||||
|
|
@ -104,7 +104,10 @@
|
|||
/**
|
||||
* 打开报损弹窗
|
||||
*/
|
||||
function open() {
|
||||
function open(d) {
|
||||
if(d){
|
||||
consId.value = d
|
||||
}
|
||||
show.value = true;
|
||||
emits('open')
|
||||
}
|
||||
|
|
@ -179,9 +182,10 @@
|
|||
* 确认
|
||||
*/
|
||||
function affirm() {
|
||||
console.log(consId.value,'调试1')
|
||||
let params = {
|
||||
coverImg: vdata.imgUrlList,
|
||||
consId: itemData.value.consId,
|
||||
consId: consId.value,
|
||||
amount: vdata.stockNumber,
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,9 +112,9 @@
|
|||
...datas.form,
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
conTypeId: datas.list[datas.nowStatusIndex].id,
|
||||
id: datas.form.consId
|
||||
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')">
|
||||
新增耗材
|
||||
|
|
@ -74,10 +80,15 @@
|
|||
import {
|
||||
ref,
|
||||
reactive,
|
||||
onMounted,
|
||||
computed
|
||||
} from 'vue';
|
||||
import {
|
||||
onShow
|
||||
} from '@dcloudio/uni-app'
|
||||
import go from '@/commons/utils/go.js';
|
||||
import {
|
||||
hasPermission
|
||||
} from '@/commons/utils/hasPermission.js';
|
||||
import {
|
||||
viewConInfoFlowget,
|
||||
tbConsType,
|
||||
|
|
@ -115,7 +126,7 @@
|
|||
})
|
||||
let showStatus = ref(false)
|
||||
let nowStatusIndex = ref(0)
|
||||
onMounted(() => {
|
||||
onShow(() => {
|
||||
getList()
|
||||
// 获取分类列表
|
||||
gettbConsTypeList()
|
||||
|
|
@ -156,52 +167,73 @@
|
|||
|
||||
let toggle = (d) => {
|
||||
refMoreSheet.value.open()
|
||||
actionSheet.activeId = d.consId
|
||||
report.data.consId = d.consId
|
||||
actionSheet.activeId = d.id
|
||||
report.data.consId = d.id
|
||||
actionSheet.active = d
|
||||
}
|
||||
|
||||
|
||||
let sheetClick = (index) => {
|
||||
if (index == 0) {
|
||||
//打开报损弹窗
|
||||
reportDamage.value.open();
|
||||
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) {
|
||||
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()
|
||||
}
|
||||
|
||||
|
|
@ -296,7 +328,8 @@
|
|||
.df;
|
||||
|
||||
>view {
|
||||
width: 90rpx;
|
||||
// width: 90rpx;
|
||||
padding: 2rpx 10rpx;
|
||||
height: 36rpx;
|
||||
line-height: 36rpx;
|
||||
background: #EBF4FC;
|
||||
|
|
@ -413,7 +446,7 @@
|
|||
background-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.df() {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
|
|||
|
|
@ -97,10 +97,11 @@
|
|||
function toggle() {
|
||||
tbConsInfotbConCheck({
|
||||
stockNumber: datas.item.balance,
|
||||
conInfoId: datas.form.consId,
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
</li>
|
||||
<li>
|
||||
<view>
|
||||
出库数量
|
||||
<text style="color: red;">*</text>出库数量
|
||||
</view>
|
||||
<view>
|
||||
<input type="text" placeholder="请输入数量" v-model="datas.form.list.stockNumber" name="" id="">
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
</li>
|
||||
<li>
|
||||
<view>
|
||||
单价
|
||||
<text style="color: red;">*</text>单价
|
||||
</view>
|
||||
<view>
|
||||
<input type="text" placeholder="请输入单价(元)" v-model="datas.form.list.price" name="" id="">
|
||||
|
|
@ -84,6 +84,8 @@
|
|||
<!-- <up-button type="text" style="background-color: #f9f9f9;color: #999;" @tap="toggle" :plain="true"
|
||||
text="取消"></up-button> -->
|
||||
</view>
|
||||
<!-- 消息提示 -->
|
||||
<up-toast ref="uToastRef"></up-toast>
|
||||
</template>
|
||||
|
||||
|
||||
|
|
@ -92,7 +94,8 @@
|
|||
ref,
|
||||
computed,
|
||||
reactive,
|
||||
onMounted
|
||||
onMounted,
|
||||
getCurrentInstance
|
||||
} from 'vue';
|
||||
import color from '@/commons/color.js';
|
||||
import go from '@/commons/utils/go.js';
|
||||
|
|
@ -102,6 +105,7 @@
|
|||
tbShopPurveyor
|
||||
} from '@/http/yskApi/requestAll.js';
|
||||
let showStatus = ref(false)
|
||||
const refs = getCurrentInstance()
|
||||
let datas = reactive({
|
||||
// 供应商列表
|
||||
list: [],
|
||||
|
|
@ -156,15 +160,32 @@
|
|||
}
|
||||
|
||||
function sumbit() {
|
||||
|
||||
if (!datas.form.list.stockNumber) {
|
||||
refs.ctx.$refs.uToastRef.show({
|
||||
type: 'default',
|
||||
message: "请输入必填项",
|
||||
})
|
||||
return
|
||||
}
|
||||
if(!datas.form.list.price){
|
||||
refs.ctx.$refs.uToastRef.show({
|
||||
type: 'default',
|
||||
message: "请输入必填项",
|
||||
})
|
||||
return
|
||||
}
|
||||
datas.form.list.conInfoId = props.consId
|
||||
datas.form.list = [datas.form.list]
|
||||
|
||||
|
||||
tbConsInfostockInOut({
|
||||
...datas.form,
|
||||
// 供应商id
|
||||
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()
|
||||
})
|
||||
}
|
||||
// 获取供应商
|
||||
|
|
@ -172,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;
|
||||
|
|
|
|||
|
|
@ -1,25 +1,101 @@
|
|||
<template>
|
||||
<view class="viewrecordsType">
|
||||
<view style="display: flex;align-items: center;" @tap="popPu">
|
||||
筛选时间<up-icon style="transform: rotate(90deg);" name="play-right-fill" size="12"></up-icon>
|
||||
</view>
|
||||
<view @tap="showStatus = !showStatus" style="display: flex;align-items: center;">
|
||||
{{datas.statusTitle}} <up-icon style="transform: rotate(90deg);" name="play-right-fill" size="12"></up-icon>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view :style="{height:showStatus?statusHeight:0}" class="tranistion status overflow-hide">
|
||||
<view @tap="changeNowStatusIndex(index)" class="u-flex u-p-l-30 lh30 u-p-r-30 u-row-between"
|
||||
v-for="(item,index) in datas.status" :key="index">
|
||||
<view :class="{'color-main':nowStatusIndex===index}">{{item.conTypeName}}</view>
|
||||
<uni-icons v-if="nowStatusIndex===index" type="checkmarkempty" :color="color.ColorMain"></uni-icons>
|
||||
</view>
|
||||
<view :style="{height: '14px'}"></view>
|
||||
</view>
|
||||
<view class="viewrecordsTop">
|
||||
<view style="padding:32rpx 16rpx;">
|
||||
<view class="">
|
||||
增加数量 <text
|
||||
style="color: #76ACF0;font-weight: bold;">{{datas.countList?datas.countList.addCountNumber:''}}</text>
|
||||
</view>
|
||||
<view class="df viewdf">
|
||||
<view style="font-size: 24rpx;border-right: 1px solid #999; width: 142rpx;text-align: center;">
|
||||
<view style="color: #999999;">
|
||||
入库
|
||||
</view>
|
||||
<view class="">
|
||||
{{datas.countList?datas.countList.stockInNumber:''}}
|
||||
</view>
|
||||
</view>
|
||||
<view style="font-size: 24rpx;width: 178rpx;text-align: center;">
|
||||
<view style="color: #999999;">
|
||||
手动增加
|
||||
</view>
|
||||
<view class="">
|
||||
{{datas.countList?datas.countList.addNumber:''}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="padding:32rpx 16rpx;">
|
||||
<view class="">
|
||||
减少数量 <text
|
||||
style="color: #52BDA4;font-weight: bold;">{{datas.countList?datas.countList.subCountNumber:0}}</text>
|
||||
</view>
|
||||
<view class="df viewdf">
|
||||
<view style="font-size: 24rpx;border-right: 1px solid #999; width: 112rpx;text-align: center;">
|
||||
<view style="color: #999999;">
|
||||
手动减少
|
||||
</view>
|
||||
<view class="">
|
||||
{{datas.countList?datas.countList.subNumber:0}}
|
||||
</view>
|
||||
</view>
|
||||
<view style="font-size: 24rpx;border-right: 1px solid #999; width: 82rpx;text-align: center;">
|
||||
<view style="color: #999999;">
|
||||
出库
|
||||
</view>
|
||||
<view class="">
|
||||
{{datas.countList?datas.countList.stockOutNumber:0}}
|
||||
</view>
|
||||
</view>
|
||||
<view style="font-size: 24rpx;width: 112rpx;text-align: center;">
|
||||
<view style="color: #999999;">
|
||||
商品消耗
|
||||
</view>
|
||||
<view class="">
|
||||
{{datas.countList?datas.countList.saleNumber:0}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<ul class="viewrecords">
|
||||
<li v-for="item in datas.list" :key="item.id">
|
||||
<view class="">
|
||||
<view class="">
|
||||
{{item.conName}}
|
||||
{{item.createTime}}
|
||||
</view>
|
||||
<view class="">
|
||||
{{item.createTime}}
|
||||
{{item.operator}} {{item.bizName}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="">
|
||||
<view class="">
|
||||
{{item.balance}}
|
||||
<view style="font-size: 24rpx;color: #666666;">
|
||||
库存 {{ inventory(item.balance,item.bizType,item.amount)}} <text
|
||||
:style="{color:item.bizType=='+'?'#1bca72':'red'}"> - {{ item.amount|0 }}</text>
|
||||
</view>
|
||||
<view style="font-size: 24rpx;color: #666666;">
|
||||
现有库存
|
||||
剩余库存 {{item.balance}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="">
|
||||
<view :style="{color:item.bizType=='+'?'#1bca72':'red'}" style="font-weight: 400;">
|
||||
{{ item.bizType }}{{ item.amount|0 }}
|
||||
</view>
|
||||
<view style="font-size: 24rpx;color: #666666;">
|
||||
|
|
@ -29,51 +105,153 @@
|
|||
</view>
|
||||
</li>
|
||||
</ul>
|
||||
<datePickerview @confirm="datePickerConfirm" ref="datePicker"></datePickerview>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
onMounted,
|
||||
reactive
|
||||
reactive,
|
||||
ref,
|
||||
computed,
|
||||
getCurrentInstance
|
||||
} from 'vue';
|
||||
import datePickerview from './components/my-date-pickerview.vue'
|
||||
import color from '@/commons/color.js';
|
||||
import {
|
||||
viewConInfoFlowget
|
||||
tbConsInfoFlowstock,
|
||||
tbConsInfoFlowcount,
|
||||
tbConsTypes
|
||||
} from '@/http/yskApi/requestAll.js';
|
||||
let props = defineProps({
|
||||
item: {
|
||||
type: String
|
||||
}
|
||||
})
|
||||
|
||||
let datas = reactive({
|
||||
list: []
|
||||
list: [],
|
||||
countList: null,
|
||||
// 类型
|
||||
status: [],
|
||||
statusTitle: "类型"
|
||||
})
|
||||
let showStatus = ref(false)
|
||||
onMounted(() => {
|
||||
let items = JSON.parse(props.item)
|
||||
// console.log(items, '调试1')
|
||||
getlist()
|
||||
})
|
||||
let getlist = () => {
|
||||
viewConInfoFlowget({
|
||||
const refs = getCurrentInstance()
|
||||
let popPu = () => {
|
||||
refs.ctx.$refs.datePicker.toggle()
|
||||
}
|
||||
|
||||
function datePickerConfirm(e) {
|
||||
getlist("", e.start, e.end)
|
||||
}
|
||||
|
||||
function inventory(a, b, c) {
|
||||
let data = 0
|
||||
if (b == '-') {
|
||||
data = a + c
|
||||
} else {
|
||||
data = a - c
|
||||
}
|
||||
return data
|
||||
}
|
||||
let nowStatusIndex = ref(0)
|
||||
|
||||
function changeNowStatusIndex(i) {
|
||||
nowStatusIndex.value = i
|
||||
showStatus.value = false
|
||||
datas.statusTitle = datas.status[i].conTypeName
|
||||
getlist(datas.status[i].id)
|
||||
}
|
||||
const statusHeight = computed(() => {
|
||||
return 30 * datas.status.length + 14 + 'px'
|
||||
})
|
||||
let getlist = (conTypeId = "", start, end) => {
|
||||
// 列表
|
||||
tbConsInfoFlowstock({
|
||||
page: 0,
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
size: 30,
|
||||
sort: "createTime,desc"
|
||||
consId: JSON.parse(props.item).conTypeId,
|
||||
column: "addCountNumber",
|
||||
conTypeId,
|
||||
|
||||
|
||||
}).then(res => {
|
||||
datas.list = res.content
|
||||
})
|
||||
// 顶部数据
|
||||
tbConsInfoFlowcount({
|
||||
page: 0,
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
size: 30,
|
||||
sort: "createTime,desc",
|
||||
conTypeId,
|
||||
startTime: start,
|
||||
endTime: end,
|
||||
}).then(res => {
|
||||
datas.countList = res
|
||||
})
|
||||
|
||||
// 获取顶部类型/
|
||||
tbConsTypes({
|
||||
page: 0,
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
size: 100,
|
||||
}).then(res => {
|
||||
datas.status = res.content
|
||||
})
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
<style>
|
||||
page {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
</style>
|
||||
<style scoped lang="less">
|
||||
ul,
|
||||
li {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.viewrecordsType {
|
||||
height: 100rpx;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.viewrecordsTop {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
// justify-content: space-between;
|
||||
margin-top: 32rpx;
|
||||
margin-left: 32rpx;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
|
||||
.viewdf {
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
>view {
|
||||
background-color: #fff;
|
||||
width: 336rpx;
|
||||
height: 220rpx;
|
||||
}
|
||||
|
||||
>view:last-child {
|
||||
margin-left: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.viewrecords {
|
||||
padding: 0 28rpx;
|
||||
|
||||
|
|
@ -109,4 +287,19 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.status {
|
||||
margin: 0 32rpx;
|
||||
position: absolute;
|
||||
// top: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 10;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.df {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -19,18 +19,18 @@
|
|||
</li>
|
||||
<li>
|
||||
<view>
|
||||
入库数量
|
||||
<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>单价
|
||||
</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>
|
||||
|
|
@ -84,6 +84,8 @@
|
|||
<!-- <up-button type="text" style="background-color: #f9f9f9;color: #999;" @tap="toggle" :plain="true"
|
||||
text="取消"></up-button> -->
|
||||
</view>
|
||||
<!-- 消息提示 -->
|
||||
<up-toast ref="uToastRef"></up-toast>
|
||||
</template>
|
||||
|
||||
|
||||
|
|
@ -92,7 +94,8 @@
|
|||
ref,
|
||||
computed,
|
||||
reactive,
|
||||
onMounted
|
||||
onMounted,
|
||||
getCurrentInstance
|
||||
} from 'vue';
|
||||
import color from '@/commons/color.js';
|
||||
import go from '@/commons/utils/go.js';
|
||||
|
|
@ -126,7 +129,9 @@
|
|||
onMounted(() => {
|
||||
getList()
|
||||
datas.item = JSON.parse(props.item)
|
||||
datas.form = assign(datas.form, ...datas.item)
|
||||
})
|
||||
const refs = getCurrentInstance()
|
||||
|
||||
function toggle() {
|
||||
go.to('PAGES_ADD_SUPPLIER')
|
||||
|
|
@ -156,7 +161,21 @@
|
|||
}
|
||||
|
||||
function sumbit() {
|
||||
datas.form.list.conInfoId = props.consId
|
||||
if (!datas.form.list.stockNumber) {
|
||||
refs.ctx.$refs.uToastRef.show({
|
||||
type: 'default',
|
||||
message: "请输入必填项",
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!datas.form.list.price) {
|
||||
refs.ctx.$refs.uToastRef.show({
|
||||
type: 'default',
|
||||
message: "请输入必填项",
|
||||
})
|
||||
return
|
||||
}
|
||||
datas.form.list.conInfoId = datas.item.id
|
||||
datas.form.list = [datas.form.list]
|
||||
tbConsInfostockInOut({
|
||||
...datas.form,
|
||||
|
|
@ -164,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)
|
||||
})
|
||||
}
|
||||
// 获取供应商
|
||||
|
|
@ -173,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;
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@
|
|||
// value=2完成
|
||||
callTableput({
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
state: 1,
|
||||
state: 2,
|
||||
callQueueId: datas.dialId
|
||||
}).then((res) => {
|
||||
getList()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,197 @@
|
|||
<template>
|
||||
<view class="page-wrapper">
|
||||
<view class="content">
|
||||
<view class="title">消息订阅码</view>
|
||||
<view ref="qrcode" class="qrcode">
|
||||
<image :src="vdata.QrcodeUrl" style="width: 100%;height: 100%;" mode="scaleToFill" />
|
||||
</view>
|
||||
<view class="bom">
|
||||
<view @click="saveImage">保存订阅码</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, onMounted } from 'vue';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
import qrCode from '@/commons/utils/qrCode.js'
|
||||
import { getSubQrCode } from '@/http/yskApi/pageNotification.js'
|
||||
import { saveHeadImgFile } from '@/commons/utils/saveImg.js'
|
||||
const vdata = reactive({
|
||||
size: 20,
|
||||
QrcodeUrl: "",
|
||||
|
||||
});
|
||||
|
||||
onLoad((options) => {
|
||||
|
||||
})
|
||||
|
||||
|
||||
onShow(() => {
|
||||
getSubQrCode().then((res) => {
|
||||
vdata.QrcodeUrl = res;
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
const saveImage = () => {
|
||||
// #ifdef APP-PLUS
|
||||
saveQrcodeImg()
|
||||
uni.downloadFile({
|
||||
url: vdata.QrcodeUrl,
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
if (res.statusCode == 200) {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: res.tempFilePath,
|
||||
success: (r) => {
|
||||
infoBox.showSuccessToast('保存成功')
|
||||
uni.vibrateShort()
|
||||
},
|
||||
fail: (er) => {
|
||||
console.log(er)
|
||||
infoBox.showErrorToast('保存失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log(err)
|
||||
infoBox.showErrorToast('保存失败')
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
//#ifdef MP-WEIXIN
|
||||
downloadQR()
|
||||
//#endif
|
||||
}
|
||||
//#ifdef MP-WEIXIN
|
||||
function downloadQR() {
|
||||
wx.getSetting({
|
||||
//获取权限
|
||||
success(res) {
|
||||
console.log(res)
|
||||
if (res.authSetting['scope.writePhotosAlbum']) {
|
||||
saveWxQrcodeImg(vdata.QrcodeUrl)
|
||||
} else {
|
||||
wx.authorize({
|
||||
scope: 'scope.writePhotosAlbum',
|
||||
success() {
|
||||
saveWxQrcodeImg(vdata.QrcodeUrl)
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
//#endif
|
||||
const saveQrcodeImg = () => {
|
||||
saveHeadImgFile(vdata.QrcodeUrl, 80)
|
||||
.then((success) => {
|
||||
infoBox.showSuccessToast('保存成功')
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
infoBox.showErrorToast('保存失败')
|
||||
})
|
||||
}
|
||||
|
||||
const saveWxQrcodeImg = (data) => {
|
||||
const fileManager = wx.getFileSystemManager()
|
||||
console.log( )
|
||||
const filePath = wx.env.USER_DATA_PATH + '/qrCode'+new Date().getTime()+'.png'
|
||||
//这块是定义图片的名称,可自定义其他
|
||||
fileManager.writeFile({
|
||||
filePath: filePath,
|
||||
data: data.slice(22),
|
||||
encoding: 'base64',
|
||||
success: (res) => {
|
||||
wx.saveImageToPhotosAlbum({
|
||||
filePath: filePath,
|
||||
success: function (res) {
|
||||
//保存成功
|
||||
infoBox.showSuccessToast('保存成功')
|
||||
},
|
||||
fail: function (err) {
|
||||
console.log(err)
|
||||
//保存失败
|
||||
infoBox.showErrorToast('保存失败')
|
||||
},
|
||||
})
|
||||
},
|
||||
fail: (err) => {
|
||||
infoBox.showErrorToast('保存失败')
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.page-wrapper {
|
||||
min-height: calc(100vh - 90rpx);
|
||||
padding: 48rpx 52rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.content{
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
border-radius: 40rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 64rpx 0;
|
||||
box-sizing: border-box;
|
||||
.title{
|
||||
font-weight: bold;
|
||||
font-size: 40rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.qrcode{
|
||||
width: 416rpx;
|
||||
height: 416rpx;
|
||||
margin-top: 50rpx;
|
||||
border: 2rpx solid #333;
|
||||
padding: 15rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
::v-deep .u-qrcode,::v-deep .u-qrcode__content,::v-deep .u-qrcode__canvas{
|
||||
width: 100%!important;
|
||||
height: 100%!important;
|
||||
|
||||
}
|
||||
.bom{
|
||||
display: flex;
|
||||
margin-top: 110rpx;
|
||||
view{
|
||||
width: 218rpx;
|
||||
height: 64rpx;
|
||||
line-height: 64rpx;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
font-size: 28rpx;
|
||||
color: #318AFE;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
view:nth-child(1){
|
||||
color: #318AFE;
|
||||
border: 2rpx solid #318AFE;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="u-p-b-24 u-m-b-24 border-bottom">
|
||||
<view class="title">分类打印</view>
|
||||
<view class="title">分类打印(仅打印制作单[厨房])</view>
|
||||
<view class="u-m-t-16">
|
||||
<radio-group class="u-flex u-flex-wrap" @change="sizeChange($event,'classifyPrint')">
|
||||
<label class="radio u-m-r-60">
|
||||
|
|
|
|||
|
|
@ -99,9 +99,6 @@
|
|||
import {
|
||||
formatPrice
|
||||
} from "@/commons/utils/format.js";
|
||||
import {
|
||||
TRUE
|
||||
} from 'sass';
|
||||
|
||||
function priceFormat(item, key, val) {
|
||||
let min = 0;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,9 @@
|
|||
@click="guigeClick(index)">
|
||||
<text>{{item.specSnap||item.name}}</text>
|
||||
<view class="tag-primary tag" v-if="item.isGrounding">上架中</view>
|
||||
<view class="tag-gray tag" v-else>已下架</view>
|
||||
<view class="tag-gray tag" v-if="item.isPauseSale">已售罄</view>
|
||||
<view class="tag-gray tag" v-if="!item.isGrounding">已下架</view>
|
||||
|
||||
<!-- <template v-if="item.isPauseSale">
|
||||
<view class="tag-gray tag" >已售罄</view>
|
||||
</template>
|
||||
|
|
@ -113,9 +115,6 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@
|
|||
<edit-stock :category="pageData.categoryList" v-model:show="popup.stock.show" @save="changeStockConfirm"
|
||||
:goods="pageData.selGoods"></edit-stock>
|
||||
<!-- 规格弹窗 -->
|
||||
<edit-guige @isGroundingChange="isGroundingChange" v-model:show="popup.guige.show"
|
||||
<edit-guige @isGroundingChange="isGroundingChange" v-model:show="popup.guige.show" @isPauseSaleChange="isPauseSaleChange"
|
||||
:goods="popup.guige.data"></edit-guige>
|
||||
<!-- 报损 -->
|
||||
<baosun-vue :category="pageData.categoryList" v-model:show="popup.baosun.show"
|
||||
|
|
|
|||
|
|
@ -69,11 +69,14 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(item,index) in tableList" :key="item.productId">
|
||||
<td style="width: 500rpx;padding-left: 16rpx;">
|
||||
<image v-if="index==0" src="../pageTable/index/images/1.png" style="width: 22rpx;height: 30rpx;" mode=""></image>
|
||||
<image v-else-if="index==1" src="../pageTable/index/images/2.png" style="width: 22rpx;height: 30rpx;" mode=""></image>
|
||||
<image v-else-if="index==2" src="../pageTable/index/images/3.png" style="width: 22rpx;height: 30rpx;" mode=""></image>
|
||||
<span v-else>{{index}}</span>
|
||||
<td style="width: 500rpx;padding-left: 16rpx;">
|
||||
<image v-if="index==0" src="../pageTable/index/images/1.png" style="width: 22rpx;height: 30rpx;"
|
||||
mode=""></image>
|
||||
<image v-else-if="index==1" src="../pageTable/index/images/2.png"
|
||||
style="width: 22rpx;height: 30rpx;" mode=""></image>
|
||||
<image v-else-if="index==2" src="../pageTable/index/images/3.png"
|
||||
style="width: 22rpx;height: 30rpx;" mode=""></image>
|
||||
<span v-else>{{index}}</span>
|
||||
{{item.productName}}
|
||||
</td>
|
||||
<td style="padding-left: 16rpx;">{{item.num}}</td>
|
||||
|
|
@ -142,11 +145,19 @@
|
|||
startTime = formatTime() + ' 00:00:00'
|
||||
endTime = formatTime() + ' 23:59:59'
|
||||
} else if (selected.value == 'circumference') {
|
||||
startTime = dayjs().add(-7, 'day').format('YYYY-MM-DD 00:00:00')
|
||||
endTime = dayjs().format('YYYY-MM-DD 23:59:59')
|
||||
var now = new Date();
|
||||
var nowTime = now.getTime();
|
||||
var day = now.getDay();
|
||||
var oneDayTime = 24 * 60 * 60 * 1000;
|
||||
//显示周一
|
||||
var MondayTime = nowTime - (day - 1) * oneDayTime;
|
||||
//显示周日
|
||||
var SundayTime = nowTime + (7 - day) * oneDayTime;
|
||||
startTime = dayjs(MondayTime).format('YYYY-MM-DD 00:00:00')
|
||||
endTime = dayjs(SundayTime).format('YYYY-MM-DD 23:59:59')
|
||||
} else if (selected.value == 'moon') {
|
||||
startTime = dayjs().add(-30, 'day').format('YYYY-MM-DD 00:00:00')
|
||||
endTime = dayjs().format('YYYY-MM-DD 23:59:59')
|
||||
startTime = dayjs().startOf('month').format('YYYY-MM-DD') + ' 00:00:00'
|
||||
endTime = dayjs().endOf('month').format('YYYY-MM-DD') + ' 23:59:59'
|
||||
} else if (selected.value == 'custom') {
|
||||
startTime = start
|
||||
endTime = end
|
||||
|
|
@ -171,6 +182,7 @@
|
|||
}
|
||||
|
||||
function changeTime(e) {
|
||||
|
||||
selected.value = e
|
||||
if (e == 'custom') {
|
||||
currentInstance.ctx.$refs.datePicker.toggle()
|
||||
|
|
@ -196,7 +208,7 @@
|
|||
dateProduct({
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
day: day.value,
|
||||
page: 1,
|
||||
page: 0,
|
||||
size: 5
|
||||
}).then((res) => {
|
||||
tableList.value = res.productList.content
|
||||
|
|
|
|||
|
|
@ -3,14 +3,14 @@
|
|||
<view class="content">
|
||||
<view>
|
||||
<view>
|
||||
员工姓名
|
||||
<text style="color: red;">*</text>员工姓名
|
||||
</view>
|
||||
<input type="text" v-model="datas.formData.name" placeholder="请填写员工名称" />
|
||||
<hr />
|
||||
</view>
|
||||
<view>
|
||||
<view>
|
||||
手机号
|
||||
<text style="color: red;">*</text>手机号
|
||||
</view>
|
||||
<input type="text" v-model="datas.formData.phone" placeholder="请填写手机号" />
|
||||
<hr />
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
<view>
|
||||
<view>
|
||||
员工编号
|
||||
<text style="color: red;">*</text>员工编号
|
||||
</view>
|
||||
<input type="text" v-model="datas.formData.code" placeholder="请填写员工编号" />
|
||||
<hr />
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
<view>
|
||||
<view>
|
||||
员工账号
|
||||
<text style="color: red;">*</text>员工账号
|
||||
</view>
|
||||
<input type="text" v-model="datas.formData.account" placeholder="请填写员工账号,建议使用手机号" />
|
||||
<hr />
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
</view>
|
||||
<view>
|
||||
<view>
|
||||
角色
|
||||
<text style="color: red;">*</text> 角色
|
||||
</view>
|
||||
<view @tap="show=true" style="height: 50rpx;font-size: 28rpx;color: #999999;">{{datas.rolesdata }}</view>
|
||||
<hr />
|
||||
|
|
@ -78,9 +78,11 @@
|
|||
<view class="bottomBotton" @tap="sumbitEvent">
|
||||
保存
|
||||
</view>
|
||||
<view class="bottomBotton2" @tap="toUrl">
|
||||
<!-- <view class="bottomBotton2" @tap="toUrl">
|
||||
取消
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- 消息提示 -->
|
||||
<up-toast ref="uToastRef"></up-toast>
|
||||
<!-- 角色选择器 -->
|
||||
<up-picker :show="show" @confirm="confirm" @cancel="show = false" :columns="columns"></up-picker>
|
||||
<!-- 弹窗 -->
|
||||
|
|
@ -149,6 +151,15 @@
|
|||
}
|
||||
|
||||
function sumbitEvent() {
|
||||
// 效验
|
||||
if(!datas.formData.name||!datas.formData.phone||!datas.formData.code||!datas.formData.account){
|
||||
currentInstance.ctx.$refs.uToastRef.show({
|
||||
message: "请填写必填项",
|
||||
type: 'default',
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
let rolesId = datas.rolesList.filter(ele => ele.name == datas.rolesdata)
|
||||
if (rolesId.length == 0) {
|
||||
currentInstance.ctx.$refs.message.open()
|
||||
|
|
@ -166,7 +177,7 @@
|
|||
shopId: uni.getStorageSync("shopId"),
|
||||
...datas.formData
|
||||
}).then(res => {
|
||||
toUrl()
|
||||
go.back()
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -195,12 +206,14 @@
|
|||
go.to('PAGES_STAFF')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
<style>
|
||||
page {
|
||||
background-color: #f9f9f9;
|
||||
padding: 32rpx 28rpx;
|
||||
}
|
||||
</style>
|
||||
<style scoped lang="less">
|
||||
|
||||
|
||||
.h7 {
|
||||
margin: 32rpx 0;
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 9.0 KiB |
|
|
@ -3,7 +3,7 @@
|
|||
<li v-for="item in datas.list " :key="item.id">
|
||||
<view class="">
|
||||
<view class="">
|
||||
<span style="font-size: 28rpx;color: #333333; ">{{item.name}}</span>
|
||||
<span style="font-size: 28rpx;color: #333333; ">{{item.name}} </span>
|
||||
<span style="font-size: 24rpx;color: #999; ">{{item.code}}</span>
|
||||
</view>
|
||||
<view class="" style="font-size: 24rpx;color: #666666;">
|
||||
|
|
@ -25,7 +25,12 @@
|
|||
</view>
|
||||
</view>
|
||||
</li>
|
||||
<li style="background-color: rgba(0,0,0,0);"></li>
|
||||
</ul>
|
||||
<view v-if="datas.list.length==0" 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="bottomBotton" @tap="toUrl">
|
||||
添加员工
|
||||
</view>
|
||||
|
|
@ -41,6 +46,9 @@
|
|||
watch,
|
||||
onMounted
|
||||
} from 'vue';
|
||||
import {
|
||||
onShow
|
||||
} from '@dcloudio/uni-app';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import {
|
||||
rolesGet,
|
||||
|
|
@ -53,7 +61,7 @@
|
|||
// 删除员工id
|
||||
rolesId: ""
|
||||
})
|
||||
onMounted(() => {
|
||||
onShow(() => {
|
||||
getList()
|
||||
})
|
||||
|
||||
|
|
@ -94,25 +102,27 @@
|
|||
function getList() {
|
||||
rolesGet({
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
page: 1,
|
||||
page: 0,
|
||||
size: 100
|
||||
}).then((res) => {
|
||||
datas.list = res.content
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
* {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
</style>
|
||||
<style lang="less" scoped>
|
||||
// * {
|
||||
// padding: 0;
|
||||
// margin: 0;
|
||||
// text-decoration: none;
|
||||
// outline: none;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
ul,
|
||||
li {
|
||||
|
|
@ -133,7 +143,7 @@
|
|||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 96rpx;
|
||||
|
||||
|
||||
}
|
||||
|
||||
>view:first-child {
|
||||
|
|
|
|||
|
|
@ -39,6 +39,11 @@
|
|||
<template v-else>
|
||||
<view class="u-flex u-row-center u-m-t-16">
|
||||
<template v-if="data.tableId">
|
||||
<template v-if="data.status =='unbind' ">
|
||||
<my-button color="#333" :width="200" :height="56" type="default" @click="bind">
|
||||
绑定码牌
|
||||
</my-button>
|
||||
</template>
|
||||
<template v-if="data.status=='idle'||(data.status=='using'&&!data.orderId) ">
|
||||
<my-button color="#333" :width="150" :height="56" type="default" @click="diancan">
|
||||
选择
|
||||
|
|
@ -80,7 +85,7 @@
|
|||
} from '@/http/yskApi/table.js'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
const status = $status
|
||||
const emits = defineEmits(['more', 'update'])
|
||||
const emits = defineEmits(['more', 'update', 'bind'])
|
||||
|
||||
function returnStutasText(key) {
|
||||
key = returnIsUseing(key)
|
||||
|
|
@ -146,6 +151,10 @@
|
|||
}
|
||||
emits('more')
|
||||
}
|
||||
|
||||
function bind() {
|
||||
emits('bind',props.data)
|
||||
}
|
||||
|
||||
|
||||
async function diancan() {
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
|
||||
<view class="u-m-t-30 u-flex u-flex-wrap u-row-between">
|
||||
<view class="u-m-b-30" v-for="(item,index) in tables.list" :key="index">
|
||||
<table-item @update="getTable" :areaMap="areaMap" @more="moreShow(item)" :data="item"></table-item>
|
||||
<table-item @bind="unBind" @update="getTable" :areaMap="areaMap" @more="moreShow(item)" :data="item"></table-item>
|
||||
</view>
|
||||
<my-img-empty v-if="tables.hasAjax&&!tables.list.length" tips="未找到相关桌台"></my-img-empty>
|
||||
</view>
|
||||
|
|
@ -80,7 +80,8 @@
|
|||
} from '@/commons/table-status.js'
|
||||
import {
|
||||
$table,
|
||||
$tableArea
|
||||
$tableArea,
|
||||
$bind
|
||||
} from '@/http/yskApi/table.js'
|
||||
import {
|
||||
objToArrary
|
||||
|
|
@ -111,7 +112,7 @@
|
|||
import {hasPermission} from '@/commons/utils/hasPermission.js'
|
||||
const refMoreSheet = ref(null)
|
||||
const actionSheet = reactive({
|
||||
list: ['结账', '清台', '增减菜', '换台', '打印订单', '历史订单'],
|
||||
list: ['结账', '清台', '增减菜', '换台', '打印订单', '历史订单','绑定码牌'],
|
||||
title: '',
|
||||
selTable: ''
|
||||
})
|
||||
|
|
@ -175,10 +176,51 @@
|
|||
//打印订单
|
||||
const res = await $fun.printOrder(actionSheet.selTable.tableId)
|
||||
return
|
||||
}
|
||||
if (index == 6) {
|
||||
//打印订单
|
||||
scanCode(item)
|
||||
// const res = await $fun.printOrder(actionSheet.selTable.tableId)
|
||||
return
|
||||
}
|
||||
infoBox.showToast('待开放,请敬请期待!')
|
||||
}
|
||||
|
||||
|
||||
function unBind (item) {
|
||||
scanCode(item)
|
||||
}
|
||||
|
||||
function scanCode(item) {
|
||||
if ( item.status != 'unbind') {
|
||||
infoBox.showToast('当前桌台已绑定')
|
||||
return;
|
||||
}
|
||||
uni.scanCode({
|
||||
onlyFromCamera: true,
|
||||
success: function(res) {
|
||||
console.log('条码类型:' + res.scanType);
|
||||
console.log('条码内容:' + res.result);
|
||||
let params = getQueryString(res.result);
|
||||
$bind({
|
||||
"code": params.code,
|
||||
"id": item.id,
|
||||
}).then(res => {
|
||||
getTable()
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getQueryString(url) { //解码
|
||||
let params = {};
|
||||
// 正则表达式来匹配URL中的查询字符串
|
||||
let reg = /(?:\?|#|&){1}([^=]*)=([^&]*)/g;
|
||||
url.replace(reg, (match, key, value) => {
|
||||
params[key] = value;
|
||||
});
|
||||
return params;
|
||||
|
||||
}
|
||||
|
||||
const refTable = ref(null)
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
<uni-forms :model="userForm" :rules="rules" err-show-type="toast" validateTrigger="submit" ref="form"
|
||||
:border="true" label-position="top" label-width="350">
|
||||
<view class="block">
|
||||
<uni-forms-item label="用户名" required name="name">
|
||||
<uni-forms-item label="用户名" required name="nickName">
|
||||
<uni-easyinput paddingNone :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
v-model="userForm.name" placeholder="填写用户名" />
|
||||
v-model="userForm.nickName" placeholder="填写用户名" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="手机号" required name="phone">
|
||||
<uni-easyinput paddingNone :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
|
|
@ -20,36 +20,53 @@
|
|||
|
||||
</uni-forms-item> -->
|
||||
|
||||
<uni-forms-item label="生日" required name="birthday">
|
||||
<uni-forms-item label="生日" required name="birthDay">
|
||||
<view style="display: none;">
|
||||
<uni-easyinput paddingNone :inputBorder="inputBorder" v-model="userForm.birthday"
|
||||
<uni-easyinput paddingNone :inputBorder="inputBorder" v-model="userForm.birthDay"
|
||||
placeholder="选择日期" />
|
||||
</view>
|
||||
<picker mode="date" :value="date" :start="startDate" :end="endDate"
|
||||
@change="bindDateChange">
|
||||
<view class="u-flex u-row-between u-p-b-10 lh40">
|
||||
<view class="color-333">{{userForm.birthday||'选择日期'}}</view>
|
||||
<view class="color-333">{{userForm.birthDay||'选择日期'}}</view>
|
||||
<uni-icons type="right"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="用户余额" required name="balance">
|
||||
|
||||
<uni-forms-item label="性别" required name="birthDay">
|
||||
<radio-group class="u-flex u-flex-wrap" @change="sizeChange($event,'sex')">
|
||||
<label class="radio u-m-r-60">
|
||||
<radio value="1" :checked="userForm.sex == '1'" class="scale7" />
|
||||
<text>男</text>
|
||||
</label>
|
||||
<label class="radio u-m-r-60">
|
||||
<radio value="2" :checked="userForm.sex == '2'" class="scale7" />
|
||||
<text>女</text>
|
||||
</label>
|
||||
</radio-group>
|
||||
</uni-forms-item>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <uni-forms-item label="用户余额" required name="balance">
|
||||
<uni-easyinput paddingNone :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
v-model="userForm.balance" placeholder="填写余额" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="用户积分" required name="integral">
|
||||
<uni-easyinput paddingNone :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
v-model="userForm.integral" placeholder="填写积分" />
|
||||
</uni-forms-item>
|
||||
</uni-forms-item> -->
|
||||
</view>
|
||||
<view class="block border-top-0">
|
||||
<!-- <view class="block border-top-0">
|
||||
<uni-forms-item label="" required>
|
||||
<view class="u-flex u-row-between lh40">
|
||||
<view class="label-title">会员</view>
|
||||
<view class="label-title">状态</view>
|
||||
<my-switch v-model="userForm.isVip"></my-switch>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
</uni-forms>
|
||||
</view>
|
||||
|
|
@ -67,6 +84,13 @@
|
|||
import infoBox from '@/commons/utils/infoBox.js';
|
||||
import mySwitch from '@/components/my-components/my-switch.vue'
|
||||
import myButton from '@/components/my-components/my-button.vue'
|
||||
import {
|
||||
member,
|
||||
tbShopUser
|
||||
} from '@/http/yskApi/requestAll.js';
|
||||
|
||||
|
||||
|
||||
import {
|
||||
onLoad,
|
||||
onReady
|
||||
|
|
@ -87,7 +111,7 @@
|
|||
const bottom = ref(null)
|
||||
//表单验证
|
||||
const rules = {
|
||||
name: {
|
||||
nickName: {
|
||||
rules: [{
|
||||
required: true,
|
||||
errorMessage: '请填写用户名'
|
||||
|
|
@ -140,20 +164,22 @@
|
|||
|
||||
function bindDateChange(e) {
|
||||
console.log(e);
|
||||
userForm.birthday = e.detail.value
|
||||
userForm.birthDay = e.detail.value
|
||||
}
|
||||
|
||||
function onFieldChange(e) {
|
||||
console.log(e);
|
||||
}
|
||||
// 用户表单
|
||||
const userForm = reactive({
|
||||
name: '',
|
||||
let userForm = reactive({
|
||||
nickName: '',
|
||||
phone: '',
|
||||
birthday: '',
|
||||
birthDay: '',
|
||||
balance: '',
|
||||
integral: '',
|
||||
isVip: false,
|
||||
level: 1,
|
||||
sex: 1
|
||||
})
|
||||
|
||||
|
||||
|
|
@ -173,23 +199,48 @@
|
|||
|
||||
|
||||
onLoad(params => {
|
||||
|
||||
if (isEmpty(params)) {
|
||||
option.type = params.type ? params.type : 'add'
|
||||
if (params.item) {
|
||||
let items = JSON.parse(params.item)
|
||||
uni.setNavigationBarTitle({
|
||||
title: '编辑用户'
|
||||
})
|
||||
items.phone = items.telephone
|
||||
items.sex = items.sex == '男' ? 1 : 2
|
||||
userForm = items
|
||||
option.type = 'edit'
|
||||
} else {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '新增用户'
|
||||
})
|
||||
option.type = 'add'
|
||||
}
|
||||
console.log(option.type);
|
||||
uni.setNavigationBarTitle({
|
||||
title: option.type === 'add' ? '添加用户' : '编辑用户'
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
function sizeChange(e, name) {
|
||||
userForm[name] = e.detail.value
|
||||
}
|
||||
|
||||
|
||||
function save() {
|
||||
form.value.validate().then(res => {
|
||||
console.log(res)
|
||||
form.value.validate().then(async res => {
|
||||
let obj = {
|
||||
...userForm,
|
||||
name: userForm.nickName,
|
||||
telephone: userForm.phone,
|
||||
birthday:userForm.birthDay,
|
||||
status:1,
|
||||
levelConsume:0,
|
||||
shopId: uni.getStorageSync("shopId"),
|
||||
}
|
||||
if (res) {
|
||||
if (option.type == 'add') {
|
||||
const ele = await member(obj)
|
||||
} else {
|
||||
const ele = await tbShopUser(obj)
|
||||
}
|
||||
go.back()
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 429 B |
|
|
@ -5,19 +5,24 @@
|
|||
<image v-if="data.headImg" :src="data.headImg" class="img"></image>
|
||||
<view class="img" v-else></view>
|
||||
</view>
|
||||
<view class="u-p-l-30 u-flex-1">
|
||||
<view class="u-p-l-30 u-flex-1" style="position: relative;">
|
||||
<view class="u-flex">
|
||||
<view class="color-000 font-bold">{{data.nickName}}</view>
|
||||
<image style="width: 24rpx;height: 24rpx;" v-if="data.sex=='男'" src="./men.png" mode=""></image>
|
||||
<image style="width: 24rpx;height: 24rpx;" v-if="data.sex=='女'" src="./women.png" mode=""></image>
|
||||
<view class="color-999 u-m-l-40" @click="remark">备注</view>
|
||||
</view>
|
||||
<view class="u-m-t-6 u-flex u-row-between">
|
||||
<!-- <view class="u-m-t-6 u-flex u-row-between">
|
||||
<view class="vip isvip" v-if="data.isVip">会员</view>
|
||||
<view class=" vip noVip" v-else>非会员</view>
|
||||
<view class="color-main" @click="bindMoblie">绑定号码</view>
|
||||
</view>
|
||||
<view class="u-m-t-6 color-666 ">
|
||||
</view> -->
|
||||
<view class="u-m-t-30 color-666 ">
|
||||
{{data.telephone||''}}
|
||||
</view>
|
||||
<view style="position: absolute;right: 0;top: 0;border-radius: 4rpx 4rpx 4rpx 4rpx;background: #EAF4FD;font-weight: 400;font-size: 20rpx;color: #318AFE;">
|
||||
会员等级{{data.isVip}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
|
@ -32,15 +37,33 @@
|
|||
</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="u-flex-1 u-text-center" @tap="toYue">
|
||||
<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="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" >{{0}}</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="u-flex">
|
||||
<uni-icons type="right" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- <view class="u-flex-1 u-text-center">
|
||||
<view class="font-bold color-000 pr-16">0</view>
|
||||
<view class="u-flex u-row-center">
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 425 B |
|
|
@ -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>
|
||||
|
|
@ -152,6 +154,94 @@
|
|||
|
||||
<my-action-sheet @itemClick="actionSheetClick" ref="moreOperate" :list="moreOperateList"></my-action-sheet>
|
||||
</view>
|
||||
<!-- 增减余额 -->
|
||||
<up-popup :show="datas.show" :round="18" mode="center" @close="close">
|
||||
<view class="zhezhaopop">
|
||||
<view class="">
|
||||
<span></span>
|
||||
<span>增减余额</span>
|
||||
<up-icon @tap="confirm" name="close-circle-fill"></up-icon>
|
||||
</view>
|
||||
<view style="display: flex;align-items: center;padding: 24rpx;">
|
||||
<image v-if="datas.activeUser.headImg" :src="datas.activeUser.headImg"
|
||||
style="width: 52rpx;height: 52rpx;;background-color: #eee;"></image>
|
||||
<view style="width: 52rpx;height: 52rpx;;background-color: #eee;" v-else>
|
||||
</view>
|
||||
<view style="margin-left: 12rpx;">
|
||||
<view style="font-weight: 400;font-size: 28rpx;color: #333333;">
|
||||
{{datas.activeUser.nickName}}
|
||||
</view>
|
||||
<view style="font-weight: 400;font-size: 24rpx;color: #999999;">
|
||||
当前余额:{{datas.activeUser.amount}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zhezhaopopthree">
|
||||
<view style="font-weight: 400;font-size: 28rpx;color: #333333;">
|
||||
增减
|
||||
</view>
|
||||
<view class="u-m-t-16">
|
||||
<radio-group class="u-flex u-flex-wrap" @change="sizeChange($event,'operationType')">
|
||||
<label class="radio u-m-r-60">
|
||||
<radio value="in" :checked="datas.form.operationType == 'in'" class="scale7" />
|
||||
<text>增加</text>
|
||||
</label>
|
||||
<label class="radio u-m-r-60">
|
||||
<radio value="out" :checked="datas.form.operationType == 'out'" class="scale7" />
|
||||
<text>扣除</text>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zhezhaopopthree" v-if="datas.form.operationType=='in'">
|
||||
<view style="font-weight: 400;font-size: 28rpx;color: #333333;">
|
||||
类型
|
||||
</view>
|
||||
<view class="u-m-t-16">
|
||||
<radio-group class="u-flex u-flex-wrap" @change="sizeChange($event,'type')">
|
||||
<label class="radio u-m-r-60">
|
||||
<radio value="inMoney" :checked="datas.form.type == 'inMoney'" class="scale7" />
|
||||
<text>充值</text>
|
||||
</label>
|
||||
<label class="radio u-m-r-60">
|
||||
<radio value="consumeIn" :checked="datas.form.type == 'consumeIn'" class="scale7" />
|
||||
<text>消费退款</text>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zhezhaopopthree" v-else>
|
||||
<view style="font-weight: 400;font-size: 28rpx;color: #333333;">
|
||||
类型
|
||||
</view>
|
||||
<view class="u-m-t-16">
|
||||
<radio-group class="u-flex u-flex-wrap" @change="sizeChange($event,'type')">
|
||||
<label class="radio u-m-r-60">
|
||||
<radio value="consumeOut" :checked="datas.form.type == 'consumeOut'" class="scale7" />
|
||||
<text>消费</text>
|
||||
</label>
|
||||
<label class="radio u-m-r-60">
|
||||
<radio value="inMoneyOut" :checked="datas.form.type == 'inMoneyOut'" class="scale7" />
|
||||
<text>充值退款</text>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zhezhaopopfour">
|
||||
<view style="font-weight: 400;font-size: 28rpx;color: #333333;">
|
||||
充值余额
|
||||
</view>
|
||||
<view class="">
|
||||
<input type="number" v-model="datas.form.amount" placeholder="请输入充值余额" />
|
||||
<view class="">
|
||||
元
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<up-button text="确认" @tap="callTabletakeNumberEvent" type="primary" class="buttomStyle"
|
||||
shape="circle"></up-button>
|
||||
</view>
|
||||
</up-popup>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
|
@ -166,16 +256,47 @@
|
|||
import infoBox from "@/commons/utils/infoBox.js"
|
||||
import * as $Api from '@/http/yskApi/shop-user.js'
|
||||
import API from '../../http/classApi';
|
||||
|
||||
import {
|
||||
midfiyAccount
|
||||
} from '@/http/yskApi/requestAll.js';
|
||||
|
||||
import {
|
||||
onReachBottom
|
||||
} from '@dcloudio/uni-app';
|
||||
import {
|
||||
hasPermission
|
||||
} from '@/commons/utils/hasPermission.js';
|
||||
let tabsCurrent = ref(0)
|
||||
const tabsList = ['用户列表', '导入用户']
|
||||
const remarkModel = ref(null)
|
||||
const phoneModel = ref(null)
|
||||
const moreOperate = ref(null)
|
||||
let datas = reactive({
|
||||
show: false,
|
||||
form: {
|
||||
operationType: 'in'
|
||||
},
|
||||
activeUser: null
|
||||
})
|
||||
let close = () => {
|
||||
datas.form = {}
|
||||
}
|
||||
const confirm = () => {
|
||||
datas.show = false;
|
||||
};
|
||||
|
||||
function toAddUser() {
|
||||
go.to('PAGES_USER_ADD')
|
||||
}
|
||||
|
||||
let callTabletakeNumberEvent = async () => {
|
||||
let res = await midfiyAccount({
|
||||
id: datas.activeUser.id,
|
||||
...datas.form
|
||||
})
|
||||
datas.show = false;
|
||||
getUser()
|
||||
}
|
||||
const remarModelData = reactive({
|
||||
remark: ''
|
||||
})
|
||||
|
|
@ -183,16 +304,41 @@
|
|||
phone: ''
|
||||
})
|
||||
|
||||
function sizeChange(e, name) {
|
||||
datas.form[name] = e.detail.value
|
||||
}
|
||||
const goodsStockModel = ref(null)
|
||||
|
||||
const moreOperateList = ['增减余额', '增减积分', '设为会员', '赠送券', '查看详情']
|
||||
const moreOperateList = ['增减余额', '修改信息', ]
|
||||
|
||||
function moreOperateClick() {
|
||||
function moreOperateClick(d) {
|
||||
datas.activeUser = pageData.userList[d]
|
||||
moreOperate.value.open()
|
||||
}
|
||||
|
||||
|
||||
onReachBottom(() => {
|
||||
++page.value
|
||||
getUser()
|
||||
});
|
||||
|
||||
|
||||
function actionSheetClick(i) {
|
||||
console.log(i);
|
||||
if (i == 0) {
|
||||
hasPermission('允许修改会员余额').then(ele => {
|
||||
if (ele) {
|
||||
datas.show = true
|
||||
}
|
||||
})
|
||||
} else if (i == 1) {
|
||||
hasPermission('允许管理会员信息').then(ele => {
|
||||
if (ele) {
|
||||
go.to('PAGES_USER_ADD', {
|
||||
item: JSON.stringify(datas.activeUser)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
//修改备注弹窗展示
|
||||
|
|
@ -304,7 +450,8 @@
|
|||
}
|
||||
|
||||
function searchFunc() {
|
||||
console.log('searchFunc');
|
||||
page.value = 0
|
||||
getUser()
|
||||
}
|
||||
|
||||
let showChecked = ref(false)
|
||||
|
|
@ -343,17 +490,26 @@
|
|||
function cateClick(cate) {
|
||||
console.log(cate);
|
||||
}
|
||||
|
||||
let page = ref(0)
|
||||
async function getUser() {
|
||||
const {
|
||||
content
|
||||
} = await $Api.queryAllShopUser()
|
||||
pageData.userList = content
|
||||
} = await $Api.queryAllShopUser({
|
||||
isVip: 1,
|
||||
size: 10,
|
||||
page: page.value,
|
||||
name: pageData.search.value
|
||||
})
|
||||
if (page.value == 0) {
|
||||
pageData.userList = content
|
||||
} else {
|
||||
pageData.userList.push(...content)
|
||||
|
||||
}
|
||||
}
|
||||
async function getAllShopInfo() {
|
||||
const res = await $Api.queryAllShopInfo()
|
||||
pageData.allShopInfo = res
|
||||
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
|
@ -367,12 +523,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 +541,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: '';
|
||||
|
|
@ -497,6 +660,99 @@
|
|||
}
|
||||
}
|
||||
|
||||
.zhezhaopop {
|
||||
padding: 34rpx 32rpx;
|
||||
width: 594rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||
|
||||
>view:first-child {
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
>span:nth-child(2) {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
>view:nth-child(2) {
|
||||
margin: 48rpx auto;
|
||||
width: 492rpx;
|
||||
height: 124rpx;
|
||||
background: #FAFAFA;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
}
|
||||
|
||||
.zhezhaopopthree {
|
||||
>view:nth-child(2) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 24rpx;
|
||||
|
||||
>view {
|
||||
width: 186rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
text-align: center;
|
||||
background: #FFFFFF;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
border: 2rpx solid #E5E5E5;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.selectvalue {
|
||||
color: #318AFE;
|
||||
border: 2rpx solid #318AFE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.zhezhaopopfour {
|
||||
margin-top: 32rpx;
|
||||
|
||||
>view:nth-child(2) {
|
||||
margin-top: 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
>input {
|
||||
width: 372rpx;
|
||||
height: 84rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 8rpx 0rpx 0rpx 8rpx;
|
||||
border: 2rpx solid #E5E5E5;
|
||||
padding-left: 24rpx;
|
||||
}
|
||||
|
||||
>view {
|
||||
width: 124rpx;
|
||||
height: 86rpx;
|
||||
line-height: 84rpx;
|
||||
text-align: center;
|
||||
background: #F7F7FA;
|
||||
border-radius: 0rpx 8rpx 8rpx 0rpx;
|
||||
border: 2rpx solid #E5E5E5;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.buttomStyle {
|
||||
margin-top: 48rpx;
|
||||
width: 506rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.input-icon {
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
|
|
|
|||
455
pages.json
455
pages.json
|
|
@ -9,22 +9,6 @@
|
|||
}
|
||||
},
|
||||
"pages": [
|
||||
// {
|
||||
// "path": "pages/adStart/adStart",
|
||||
// "style": {
|
||||
// "navigationBarTitleText": "开屏广告",
|
||||
// "navigationStyle": "custom"
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// "pageId": "PAGES_INDEX",
|
||||
// "path": "pages/index/indexCopy",
|
||||
// "style": {
|
||||
// "navigationBarTitleText": "首页",
|
||||
// "navigationStyle": "custom",
|
||||
// "enablePullDownRefresh": true
|
||||
// }
|
||||
// },
|
||||
{
|
||||
"pageId": "PAGES_INDEX",
|
||||
"path": "pages/index/index",
|
||||
|
|
@ -44,58 +28,10 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_REGISTER",
|
||||
"path": "pages/login/register",
|
||||
"pageId": "PAGES_ME",
|
||||
"path": "pages/user/user",
|
||||
"style": {
|
||||
"navigationBarTitleText": "注册(自定义导航)",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_STATIC_AGREEMENT",
|
||||
"path": "pages/login/serviceAgreement",
|
||||
"style": {
|
||||
"navigationBarTitleText": "服务协议"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_STATIC_POLICY",
|
||||
"path": "pages/login/privacyPolicy",
|
||||
"style": {
|
||||
"navigationBarTitleText": "隐私政策"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_SCAN_LOGIN",
|
||||
"path": "pages/index/scan",
|
||||
"style": {
|
||||
"navigationBarTitleText": "扫码登录中间页(自定义导航)",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"pageId": "PAGES_PAY_ORDER",
|
||||
"path": "pages/order/order",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单(自定义导航)",
|
||||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_PAY_ORDER_DETAIL",
|
||||
"path": "pages/order/orderDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单详情(自定义导航)",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_REFUND_ORDER",
|
||||
"path": "pages/order/refund",
|
||||
"style": {
|
||||
"navigationBarTitleText": "退款(自定义导航)",
|
||||
"navigationBarTitleText": "我的(自定义导航)",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
|
|
@ -126,323 +62,6 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "选择门店"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"pageId": "PAGES_USER_SETUP",
|
||||
"path": "pages/userSetUp/userSetUp",
|
||||
"style": {
|
||||
"navigationBarTitleText": "设置"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_RESET_PAYPWD",
|
||||
"path": "pages/userSetUp/payPassword",
|
||||
"style": {
|
||||
"navigationBarTitleText": "支付密码"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_RESET_PWD",
|
||||
"path": "pages/userSetUp/accountPwd",
|
||||
"style": {
|
||||
"navigationBarTitleText": "账号密码"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_SYS_CONFIG",
|
||||
"path": "pages/userSetUp/systemSetUp",
|
||||
"style": {
|
||||
"navigationBarTitleText": "系统设置"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_SAFE_CONFIG",
|
||||
"path": "pages/userSetUp/safeSetUp",
|
||||
"style": {
|
||||
"navigationBarTitleText": "安全设置"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_ACCOUNTSETUP",
|
||||
"path": "pages/userSetUp/accountSetUp",
|
||||
"style": {
|
||||
"navigationBarTitleText": "账号设置(自定义导航)",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_ME",
|
||||
"path": "pages/user/user",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的(自定义导航)",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_ABOUTMCH",
|
||||
"path": "pages/aboutMch/aboutMch",
|
||||
"style": {
|
||||
"navigationBarTitleText": "关于我们(自定义导航)",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_QUICK_PAY",
|
||||
"path": "pages/quickMoney/quickMoney",
|
||||
"style": {
|
||||
"navigationBarTitleText": "快捷收银"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_QR_CASHIER",
|
||||
"path": "pages/quickMoney/qrCashier",
|
||||
"style": {
|
||||
"navigationBarTitleText": "聚合收款码"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_MCH_INFO",
|
||||
"path": "pages/mchInfo/mchInfo",
|
||||
"style": {
|
||||
"navigationBarTitleText": "商户信息"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_NOTICE_USER",
|
||||
"path": "pages/noticeManage/noticeManage",
|
||||
"style": {
|
||||
"navigationBarTitleText": "通知人管理(自定义导航)",
|
||||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_NOTICE_BING_USER",
|
||||
"path": "pages/noticeManage/bindUser",
|
||||
"style": {
|
||||
"navigationBarTitleText": "通知接收人管理",
|
||||
"navigationBarBackgroundColor": "#fff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_STAT",
|
||||
"path": "pages/statPage/statPage",
|
||||
"style": {
|
||||
"navigationBarTitleText": "统计报表(自定义导航)",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_NOTICE_LIST",
|
||||
"path": "pages/noticePage/noticeList",
|
||||
"style": {
|
||||
"navigationBarTitleText": "全部公告",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_NOTICE_DETAIL",
|
||||
"path": "pages/noticePage/noticeDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "公告详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_APPLYMENT",
|
||||
"path": "pages/applyment/list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "进件管理",
|
||||
"navigationBarBackgroundColor": "#f7f7f7",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_ADDAPP",
|
||||
"path": "pages/applyment/addApp",
|
||||
"style": {
|
||||
"navigationBarTitleText": "添加应用",
|
||||
"navigationBarBackgroundColor": "#f7f7f7"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_APPLYMENT_BUSINESS",
|
||||
"path": "pages/applyment/business",
|
||||
"style": {
|
||||
"navigationBarTitleText": "商户管理",
|
||||
"navigationBarBackgroundColor": "#f7f7f7",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_APPLYMENT_SELECETDPAY",
|
||||
"path": "pages/applyment/selectedPay",
|
||||
"style": {
|
||||
"navigationBarTitleText": "选择进件渠道",
|
||||
"navigationBarBackgroundColor": "#f7f7f7"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_APPLYMENT_H5_DETAIL",
|
||||
"path": "pages/applyment/h5/applyDetail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "进件详情",
|
||||
"navigationBarBackgroundColor": "#F5F6FC"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_APPLYMENT_H5_OPTION",
|
||||
"path": "pages/applyment/h5/applyOption",
|
||||
"style": {
|
||||
"navigationBarTitleText": "进件配置/签约开通",
|
||||
"navigationBarBackgroundColor": "#F5F6FC"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_FORGET_PASSWORD",
|
||||
"path": "pages/login/forgetPassword",
|
||||
"style": {
|
||||
"navigationBarTitleText": "找回密码"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_SET_NEW_PASSWORD",
|
||||
"path": "pages/login/setNewPassword",
|
||||
"style": {
|
||||
"navigationBarTitleText": "设置新密码"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_EDIT_FORM",
|
||||
"path": "pages/userSetUp/editForm",
|
||||
"style": {
|
||||
"navigationBarTitleText": "修改用户姓名",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_AD_H5",
|
||||
"path": "pages/adH5/adH5",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_AD_ALIOPERATION",
|
||||
"path": "pages/aliOperation/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "支付宝代运营授权(自定义)",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_MEMBER_CENTER",
|
||||
"path": "pages/memberCenter/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_MEMBER",
|
||||
"path": "pages/memberCenter/member/member",
|
||||
"style": {
|
||||
"navigationBarTitleText": "会员管理(自定义导航)",
|
||||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_MEMBER_EDIT",
|
||||
"path": "pages/memberCenter/member/edit",
|
||||
"style": {
|
||||
"navigationBarTitleText": "会员编辑(自定义导航)",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_MEMBER_DETAIL",
|
||||
"path": "pages/memberCenter/member/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "会员详情(自定义导航)",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_RECHARGE_RULE",
|
||||
"path": "pages/memberCenter/rechargeRule/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "充值规则管理(自定义导航)",
|
||||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_RECHARGE_RULE_EDIT",
|
||||
"path": "pages/memberCenter/rechargeRule/edit",
|
||||
"style": {
|
||||
"navigationBarTitleText": "充值规则编辑(自定义导航)",
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_MEMBER_ACCOUNT_HISTORY",
|
||||
"path": "pages/memberCenter/accountHistory/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "会员账户流水(自定义导航)",
|
||||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_MEMBER_ACCOUNT_HISTORY_DETAIL",
|
||||
"path": "pages/memberCenter/accountHistory/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "流水详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_MEMBER_RECHARGE_RECORD",
|
||||
"path": "pages/memberCenter/rechargeRecord/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "会员充值记录(自定义导航)",
|
||||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_MEMBER_RECHARGE_RECORD_DETAIL",
|
||||
"path": "pages/memberCenter/rechargeRecord/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "充值记录详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_MEMBER_RECHARGE_MEMBERMANUAL",
|
||||
"path": "pages/memberCenter/member/memberManual",
|
||||
"style": {
|
||||
"navigationBarTitleText": "会员调账"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pageId": "PAGES_LIST_SEARCH",
|
||||
"path": "pages/list/search",
|
||||
"style": {
|
||||
"navigationBarTitleText": "搜索"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/release/release",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}, {
|
||||
"pageId": "PAGES_WEBVIEW",
|
||||
"path": "pages/webview/webview"
|
||||
}, {
|
||||
"pageId": "PAGES_INVOICE",
|
||||
"path": "pages/invoice/invoice"
|
||||
}
|
||||
],
|
||||
"subPackages": [{
|
||||
|
|
@ -1138,6 +757,17 @@
|
|||
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pageBwc",
|
||||
"pages": [{
|
||||
"pageId": "PAGES_BWC",
|
||||
"path": "index/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "霸王餐"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pageBooking",
|
||||
"pages": [{
|
||||
|
|
@ -1274,19 +904,18 @@
|
|||
{
|
||||
"root": "pageSalesSummary",
|
||||
"pages": [{
|
||||
"pageId": "PAGES_SALES_SUMMARY",
|
||||
"path": "index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "销售汇总"
|
||||
}
|
||||
}, {
|
||||
"pageId": "PAGES_PRODUCT_SALES_RANKING",
|
||||
"path": "productSalesRanking",
|
||||
"style": {
|
||||
"navigationBarTitleText": "商品销售排行"
|
||||
}
|
||||
"pageId": "PAGES_SALES_SUMMARY",
|
||||
"path": "index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "销售汇总"
|
||||
}
|
||||
]
|
||||
}, {
|
||||
"pageId": "PAGES_PRODUCT_SALES_RANKING",
|
||||
"path": "productSalesRanking",
|
||||
"style": {
|
||||
"navigationBarTitleText": "商品销售排行"
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
"root": "pageLineUp",
|
||||
|
|
@ -1400,10 +1029,8 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "账单付款记录"
|
||||
}
|
||||
}
|
||||
]
|
||||
}]
|
||||
},
|
||||
|
||||
{
|
||||
"root": "pagePrinter",
|
||||
"pages": [{
|
||||
|
|
@ -1417,7 +1044,7 @@
|
|||
"pageId": "PAGES_PRINTER_ADD",
|
||||
"path": "add-printer/add-printer",
|
||||
"style": {
|
||||
"navigationBarTitleText" : "添加/编辑云打印机"
|
||||
"navigationBarTitleText": "添加/编辑云打印机"
|
||||
// "navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
|
|
@ -1449,10 +1076,20 @@
|
|||
},
|
||||
{
|
||||
"pageId": "PAGES_GOODS_GROUP_EDIT_GOODS",
|
||||
"path" : "edit-group-goods/edit-group-goods",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "管理商品"
|
||||
"path": "edit-group-goods/edit-group-goods",
|
||||
"style": {
|
||||
"navigationBarTitleText": "管理商品"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "pageNotification",
|
||||
"pages": [{
|
||||
"pageId": "PAGES_NOTIFICATION_INDEX",
|
||||
"path": "index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订阅通知"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -1485,15 +1122,7 @@
|
|||
"iconPath": "static/tabImg/index.png",
|
||||
"selectedIconPath": "static/tabImg/index-select.png",
|
||||
"text": "首页"
|
||||
}
|
||||
// ,
|
||||
// {
|
||||
// "pagePath": "pages/order/order",
|
||||
// "iconPath": "static/tabImg/order.png",
|
||||
// "selectedIconPath": "static/tabImg/order-select.png",
|
||||
// "text": "订单"
|
||||
// }
|
||||
,
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/user/user",
|
||||
"iconPath": "static/tabImg/user.png",
|
||||
|
|
|
|||
|
|
@ -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}}</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 }}</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}}</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.count.useNum }}</view>
|
||||
<text class="money-title">消费金额</text>
|
||||
<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>
|
||||
|
|
@ -0,0 +1,448 @@
|
|||
<template>
|
||||
<view class="mask" v-if="show" @tap="close">
|
||||
<view class="box" @tap.stop="nullFunction">
|
||||
<view class="u-flex u-relative u-row-center u-p-30 top">
|
||||
<view class="font-bold u-font-32">筛选日期时间</view>
|
||||
<view class="close" @tap="close">
|
||||
<uni-icons type="closeempty" size="24"></uni-icons>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<!-- <view class="u-p-30 u-flex u-flex-wrap gap-20 fastTime">
|
||||
<view class="item" v-for="(item,index) in fastTime" :key="index" @tap="changeTime(item.key)">
|
||||
{{item.title}}
|
||||
</view>
|
||||
</view> -->
|
||||
<picker-view :immediate-change="true" @pickend="pickend" :value="value" @change="bindChange"
|
||||
class="picker-view">
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in years" :key="index">{{item}}年</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in months" :key="index">{{item}}月</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in days" :key="index">{{item}}日</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in hours" :key="index">{{item}}时</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in minutes" :key="index">{{item}}分</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in seconds" :key="index">{{item}}秒</view>
|
||||
</picker-view-column>
|
||||
</picker-view>
|
||||
<view class="u-text-center color-999">至</view>
|
||||
<picker-view :immediate-change="true" :value="value1" @pickend="pickend1" @change="bindChange1"
|
||||
class="picker-view">
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in years" :key="index">{{item}}年</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in months" :key="index">{{item}}月</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in days1" :key="index">{{item}}日</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in hours" :key="index">{{item}}时</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in minutes" :key="index">{{item}}分</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="item" v-for="(item,index) in seconds" :key="index">{{item}}秒</view>
|
||||
</picker-view-column>
|
||||
</picker-view>
|
||||
|
||||
<!-- 站位 -->
|
||||
<view style="height: 80px;"></view>
|
||||
<view class="fixed_b">
|
||||
<my-button shape="circle" @tap="confirm">确定</my-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import myButton from "@/components/my-components/my-button.vue"
|
||||
import {
|
||||
reactive,
|
||||
ref
|
||||
} from 'vue';
|
||||
const $nowDate = new Date()
|
||||
const nowDate = {
|
||||
year: $nowDate.getFullYear(),
|
||||
month: $nowDate.getMonth() + 1,
|
||||
day: $nowDate.getDate(),
|
||||
hours: $nowDate.getHours(),
|
||||
minutes: $nowDate.getMinutes(),
|
||||
seconds: $nowDate.getSeconds()
|
||||
}
|
||||
const yearsLen = 30
|
||||
const years = new Array(yearsLen).fill(1).map((v, index) => {
|
||||
return nowDate.year - index
|
||||
}).reverse()
|
||||
const months = new Array(12).fill(1).map((v, index) => {
|
||||
return index + 1
|
||||
})
|
||||
const days = ref(new Array(getMonthArea($nowDate, 'end').getDate()).fill(1).map((v, index) => {
|
||||
return index + 1
|
||||
}))
|
||||
const days1 = ref(new Array(getMonthArea($nowDate, 'end').getDate()).fill(1).map((v, index) => {
|
||||
return index + 1
|
||||
}))
|
||||
const hours = new Array(24).fill(1).map((v, index) => {
|
||||
return index
|
||||
})
|
||||
const minutes = new Array(60).fill(1).map((v, index) => {
|
||||
return index
|
||||
})
|
||||
const seconds = new Array(60).fill(1).map((v, index) => {
|
||||
return index
|
||||
})
|
||||
const fastTime = reactive([{
|
||||
title: '今日',
|
||||
key: 'now'
|
||||
},
|
||||
{
|
||||
title: '昨日',
|
||||
key: 'prve'
|
||||
},
|
||||
{
|
||||
title: '本月',
|
||||
key: 'nowMonth'
|
||||
},
|
||||
{
|
||||
title: '上月',
|
||||
key: 'prveMonth'
|
||||
}
|
||||
])
|
||||
|
||||
|
||||
|
||||
function setPrveDay() {
|
||||
|
||||
}
|
||||
|
||||
function setNowMoneth() {
|
||||
|
||||
}
|
||||
|
||||
function setprveMoneth() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
function setDay(start, end) {
|
||||
value.value = [
|
||||
start.year,
|
||||
start.month,
|
||||
start.day,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
]
|
||||
value1.value = [
|
||||
end.year,
|
||||
end.month,
|
||||
end.day,
|
||||
23,
|
||||
59,
|
||||
59,
|
||||
]
|
||||
}
|
||||
|
||||
function changeTime(key) {
|
||||
const yearIndex = years.findIndex(v => v == nowDate.year)
|
||||
const prveyearIndex = years.findIndex(v => v == nowDate.year) - 1
|
||||
const nowMonthIndex = nowDate.month - 1
|
||||
const nowDayIndex = nowDate.day - 1
|
||||
const dataMap = {
|
||||
now: function() {
|
||||
return {
|
||||
start: {
|
||||
year: yearIndex,
|
||||
month: nowMonthIndex,
|
||||
day: nowDayIndex
|
||||
},
|
||||
end: {
|
||||
year: yearIndex,
|
||||
month: nowMonthIndex,
|
||||
day: nowDayIndex
|
||||
}
|
||||
}
|
||||
},
|
||||
prve: function() {
|
||||
const oneDay=1000*60*60*24
|
||||
const date=new Date(new Date(nowDate.year,nowDate.month,nowDate.day,0,0,0).getTime()-oneDay)
|
||||
return {
|
||||
start: {
|
||||
year:years.findIndex(v=>v==date.getFullYear()),
|
||||
month:date.getMonth()-1<0?11:date.getMonth()-1,
|
||||
day: date.getDate()-1
|
||||
},
|
||||
end: {
|
||||
year:years.findIndex(v=>v==date.getFullYear()),
|
||||
month:date.getMonth()-1<0?11:date.getMonth()-1,
|
||||
day: date.getDate()-1
|
||||
}
|
||||
}
|
||||
},
|
||||
nowMonth: function() {
|
||||
return {
|
||||
start: {
|
||||
year:yearIndex,
|
||||
month:nowMonthIndex,
|
||||
day: 0
|
||||
},
|
||||
end: {
|
||||
year:yearIndex,
|
||||
month:nowMonthIndex,
|
||||
day:new Date(nowDate.year, nowDate.month , 0).getDate() - 1
|
||||
}
|
||||
}
|
||||
},
|
||||
prveMonth: function() {
|
||||
const oneDay=1000*60*60*24
|
||||
const date=new Date(new Date(nowDate.year, nowDate.month-1,0,0,0).getTime()-oneDay)
|
||||
console.log(date.getMonth());
|
||||
return {
|
||||
start: {
|
||||
year:years.findIndex(v=>v==date.getFullYear()),
|
||||
month:date.getMonth(),
|
||||
day: 0
|
||||
},
|
||||
end: {
|
||||
year:years.findIndex(v=>v==date.getFullYear()),
|
||||
month:date.getMonth(),
|
||||
day: date.getDate()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const data = dataMap[key]()
|
||||
setDay(data.start, data.end)
|
||||
changeDays(false,value.value)
|
||||
changeDays(true,value1.value)
|
||||
|
||||
console.log(value1.value);
|
||||
const start = returnDateString(value.value)
|
||||
const end = returnDateString(value1.value)
|
||||
|
||||
emits('confirm', {
|
||||
text: `${start}——${end}`,
|
||||
start,
|
||||
end
|
||||
})
|
||||
close()
|
||||
}
|
||||
let value = ref([
|
||||
years.length - 1,
|
||||
nowDate.month - 1,
|
||||
nowDate.day - 1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
])
|
||||
let value1 = ref([
|
||||
years.length - 1,
|
||||
nowDate.month - 1,
|
||||
nowDate.day - 1,
|
||||
23,
|
||||
59,
|
||||
59,
|
||||
])
|
||||
|
||||
let show = ref(false)
|
||||
const emits = defineEmits('close', 'open', 'confirm')
|
||||
|
||||
function toggle() {
|
||||
show.value = !show.value
|
||||
if (show.value) {
|
||||
emits('open', true)
|
||||
} else {
|
||||
emits('close', false)
|
||||
}
|
||||
}
|
||||
|
||||
function close() {
|
||||
show.value = false
|
||||
emits('close', false)
|
||||
}
|
||||
|
||||
function open() {
|
||||
show.value = true
|
||||
emits('open', true)
|
||||
}
|
||||
|
||||
function returnDateString(arr) {
|
||||
const year = years[arr[0]]
|
||||
const month = arr[1] + 1
|
||||
const day = arr[2] + 1
|
||||
const hour = ('0' + arr[3]).slice(-2)
|
||||
const min = ('0' + arr[4]).slice(-2)
|
||||
const sen = ('0' + arr[5]).slice(-2)
|
||||
return `${year}-${month}-${day} ${hour}:${min}:${sen}`
|
||||
}
|
||||
|
||||
|
||||
function confirm(e) {
|
||||
const start = returnDateString(value.value)
|
||||
const end = returnDateString(value1.value)
|
||||
console.log(start);
|
||||
console.log(end);
|
||||
emits('confirm', {
|
||||
text: `${start}——${end}`,
|
||||
start,
|
||||
end
|
||||
})
|
||||
close()
|
||||
}
|
||||
|
||||
function returnMonthStart(arr) {
|
||||
return new Date(years[arr[0]], months[arr[1]] - 1, 1).getDate();
|
||||
}
|
||||
|
||||
function returnMonthEnd(arr) {
|
||||
return new Date(years[arr[0]], months[arr[1]], 0).getDate();
|
||||
}
|
||||
|
||||
function changeDays(isDays1,arr){
|
||||
const end = returnMonthEnd(arr)
|
||||
if (end) {
|
||||
if(isDays1){
|
||||
days1.value= new Array(end).fill(1).map((v,
|
||||
index) => {
|
||||
return index + 1
|
||||
})
|
||||
}else{
|
||||
days.value= new Array(end).fill(1).map((v,
|
||||
index) => {
|
||||
return index + 1
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function bindChange(e) {
|
||||
value.value = e.detail.value
|
||||
changeDays(false, e.detail.value)
|
||||
}
|
||||
|
||||
function bindChange1(e) {
|
||||
value1.value = e.detail.value
|
||||
changeDays(true, e.detail.value)
|
||||
}
|
||||
|
||||
function getDayDate(date = new Date(), type) {
|
||||
const now = date
|
||||
if (type === 'start') {
|
||||
const startOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
||||
return startOfDay
|
||||
}
|
||||
if (type === 'end') {
|
||||
const endOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
||||
return endOfDay;
|
||||
}
|
||||
}
|
||||
|
||||
function getMonthArea(date = new Date(), type) {
|
||||
let now = date
|
||||
let currentMonthStart = new Date(now.getFullYear(), now.getMonth(), 1);
|
||||
let currentMonthEnd = new Date(now.getFullYear(), now.getMonth() + 1, 0, 23, 59, 59, 999);
|
||||
if (type === 'start') {
|
||||
return currentMonthStart
|
||||
}
|
||||
if (type === 'end') {
|
||||
return currentMonthEnd;
|
||||
}
|
||||
return {
|
||||
start: currentMonthStart,
|
||||
end: currentMonthEnd
|
||||
};
|
||||
}
|
||||
|
||||
function nullFunction() {
|
||||
|
||||
}
|
||||
|
||||
function pickend(e) {
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
function pickend1(e) {
|
||||
console.log(e);
|
||||
}
|
||||
defineExpose({
|
||||
close,
|
||||
open,
|
||||
confirm,
|
||||
toggle
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.fastTime {
|
||||
.item {
|
||||
background-color: rgb(247, 247, 247);
|
||||
padding: 6rpx 40rpx;
|
||||
border-radius: 6rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.top {
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
.close {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
right: 30rpx;
|
||||
}
|
||||
|
||||
.mask {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
background-color: rgba(0, 0, 0, .7);
|
||||
|
||||
.box {
|
||||
position: absolute;
|
||||
background-color: #fff;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
border-radius: 16rpx 16rpx 0 0;
|
||||
}
|
||||
}
|
||||
|
||||
.fixed_b {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 30rpx;
|
||||
z-index: 100;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.picker-view {
|
||||
width: 750rpx;
|
||||
height: 300rpx;
|
||||
}
|
||||
|
||||
.item {
|
||||
line-height: 34px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,214 @@
|
|||
<template>
|
||||
<view class="statistics">
|
||||
<view class="statisticsBox">
|
||||
|
||||
<view class="time-wrapper">
|
||||
<view v-for="(v, i) in timeList" :key="i" class="timelistbox">
|
||||
<view class="time-item" @tap="changeTime(v.value)" :class="{ 'time-selected':v.value==selected }">
|
||||
{{v.label}}
|
||||
</view>
|
||||
<view class="xian" v-if="v.value==selected "> </view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<ul class="payList">
|
||||
<li v-for="item in list" :key="item.id">
|
||||
<view class="">
|
||||
{{item.payType}}
|
||||
</view>
|
||||
<view class="">
|
||||
{{item.payAmount}}
|
||||
</view>
|
||||
</li>
|
||||
</ul>
|
||||
</view>
|
||||
</view>
|
||||
<datePickerview @confirm="datePickerConfirm" ref="datePicker" style="z-index: 999;"></datePickerview>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
summaryTrade,
|
||||
} from '@/http/yskApi/requestAll.js';
|
||||
import dayjs from 'dayjs' //时间格式库
|
||||
import {
|
||||
getCurrentInstance,
|
||||
ref
|
||||
} from 'vue';
|
||||
import datePickerview from './my-date-pickerview.vue'
|
||||
import {
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app';
|
||||
let selected = ref('today')
|
||||
let list = ref()
|
||||
const emit = defineEmits(['totalRevenue'])
|
||||
const timeList = [{
|
||||
label: '今天',
|
||||
value: 'today'
|
||||
},
|
||||
{
|
||||
label: '昨天',
|
||||
value: 'yesterday'
|
||||
},
|
||||
{
|
||||
label: '本周',
|
||||
value: 'circumference'
|
||||
}, {
|
||||
label: '本月',
|
||||
value: 'moon'
|
||||
},
|
||||
{
|
||||
label: '自定义',
|
||||
value: 'custom'
|
||||
}
|
||||
]
|
||||
const currentInstance = getCurrentInstance()
|
||||
onLoad((options) => {
|
||||
getlist()
|
||||
});
|
||||
|
||||
function getlist(start, end) {
|
||||
let startTime, endTime;
|
||||
if (selected.value == 'today') {
|
||||
startTime = dayjs().format('YYYY-MM-DD') + ' 00:00:00'
|
||||
endTime = dayjs().format('YYYY-MM-DD') + ' 23:59:59'
|
||||
} else if (selected.value == 'yesterday') {
|
||||
startTime = formatTime() + ' 00:00:00'
|
||||
endTime = formatTime() + ' 23:59:59'
|
||||
} else if (selected.value == 'circumference') {
|
||||
var now = new Date();
|
||||
var nowTime = now.getTime();
|
||||
var day = now.getDay();
|
||||
var oneDayTime = 24 * 60 * 60 * 1000;
|
||||
//显示周一
|
||||
var MondayTime = nowTime - (day - 1) * oneDayTime;
|
||||
//显示周日
|
||||
var SundayTime = nowTime + (7 - day) * oneDayTime;
|
||||
startTime = dayjs(MondayTime).format('YYYY-MM-DD 00:00:00')
|
||||
endTime = dayjs(SundayTime).format('YYYY-MM-DD 23:59:59')
|
||||
} else if (selected.value == 'moon') {
|
||||
startTime = dayjs().startOf('month').format('YYYY-MM-DD') + ' 00:00:00'
|
||||
endTime = dayjs().endOf('month').format('YYYY-MM-DD') + ' 23:59:59'
|
||||
} else if (selected.value == 'custom') {
|
||||
startTime = start
|
||||
endTime = end
|
||||
}
|
||||
summaryTrade({
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
startTime,
|
||||
endTime,
|
||||
}).then((res) => {
|
||||
list.value = res.sale.payCount.slice(0, 4)
|
||||
emit('totalRevenue',res.sale.incomeAmountAll)
|
||||
})
|
||||
}
|
||||
|
||||
function datePickerConfirm(e) {
|
||||
getlist(e.start, e.end)
|
||||
}
|
||||
// 获取当前时间
|
||||
function getdate() {
|
||||
const dt = new Date();
|
||||
const y = dt.getFullYear();
|
||||
const m = (dt.getMonth() + 1 + "").padStart(2, "0");
|
||||
const d = (dt.getDate() + "").padStart(2, "0");
|
||||
const hh = (dt.getHours() + "").padStart(2, "0");
|
||||
const mm = (dt.getMinutes() + "").padStart(2, "0");
|
||||
const ss = (dt.getSeconds() + "").padStart(2, "0");
|
||||
return `${y}-${m}-${d}`;
|
||||
}
|
||||
// 获取昨天时间
|
||||
const formatTime = () => {
|
||||
let strDate = getdate()
|
||||
let dateFormat = new Date(strDate);
|
||||
dateFormat = dateFormat.setDate(dateFormat.getDate() - 1);
|
||||
dateFormat = new Date(dateFormat);
|
||||
let y = dateFormat.getFullYear()
|
||||
let m = (dateFormat.getMonth() + 1).toString().padStart(2, '0')
|
||||
let d = dateFormat.getDate().toString().padStart(2, '0')
|
||||
return `${y}-${m}-${d}`
|
||||
}
|
||||
|
||||
function changeTime(e) {
|
||||
selected.value = e
|
||||
if (e == 'custom') {
|
||||
currentInstance.ctx.$refs.datePicker.toggle()
|
||||
} else {
|
||||
getlist()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
ul,
|
||||
li {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.statistics {
|
||||
padding: 0 28rpx;
|
||||
|
||||
.statisticsBox {
|
||||
width: 694rpx;
|
||||
height: 260rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
||||
|
||||
.time-wrapper {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
padding-bottom: 16rpx;
|
||||
padding-top: 16rpx;
|
||||
margin-top: 54rpx;
|
||||
|
||||
.timelistbox {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.time-item {
|
||||
font-size: 28rpx;
|
||||
text-align: center;
|
||||
padding-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.xian {
|
||||
width: 40rpx;
|
||||
height: 3rpx;
|
||||
background-color: #318AFE;
|
||||
// position: absolute;
|
||||
// left: 16rpx;
|
||||
// bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.time-selected {
|
||||
color: #318afe;
|
||||
font-size: 32rpx !important;
|
||||
}
|
||||
}
|
||||
|
||||
.payList {
|
||||
display: flex;
|
||||
// justify-content: space-around;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 32rpx;
|
||||
|
||||
>li {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
width: 170rpx;
|
||||
|
||||
>view {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -2,18 +2,22 @@
|
|||
<template>
|
||||
<JeepayBackground :bgColorStyle="{}">
|
||||
<!-- 导航条 -->
|
||||
<JeepayCustomNavbar title="首页" textColor="#fff"
|
||||
bgDefaultColor="linear-gradient(270deg, rgba(72, 192, 255, 1) 0%, rgba(51, 157, 255, 1) 100%)" />
|
||||
|
||||
<JeepayCustomNavbar title="首页" textColor="#fff" bgDefaultColor="#318AFE" />
|
||||
<view class="income">
|
||||
<view>总收入</view>
|
||||
<view>¥{{totalRevenuedata}}</view>
|
||||
<view>后海&双屿</view>
|
||||
</view>
|
||||
<!-- 统计 or 快捷扫码 -->
|
||||
<Stats ref="statsRef" />
|
||||
|
||||
<!-- <Stats ref="statsRef" /> -->
|
||||
<statistics @totalRevenue="totalRevenue"></statistics>
|
||||
<!-- 导航栅格 -->
|
||||
<JeepayNavigation :navList="navList" type="grid" />
|
||||
</JeepayBackground>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
import {
|
||||
reactive,
|
||||
ref,
|
||||
|
|
@ -32,20 +36,22 @@
|
|||
} from '@/http/apiManager.js';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import Stats from './components/Stats.vue';
|
||||
import registerPush from '@/commons/utils/pushmsg/registerPush.js';
|
||||
import pushMsgManage from '@/commons/utils/pushmsg/pushMsgManage.js';
|
||||
|
||||
import statistics from './components/statistics.vue'
|
||||
import {
|
||||
onPullDownRefresh,
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app';
|
||||
import storageManage from '@/commons/utils/storageManage.js';
|
||||
import {
|
||||
$adList
|
||||
} from '@/http/apiManager.js';
|
||||
import {hasPermission} from '@/commons/utils/hasPermission.js'
|
||||
hasPermission
|
||||
} from '@/commons/utils/hasPermission.js'
|
||||
uni.hideTabBar()
|
||||
onLoad((options) => {});
|
||||
onLoad((options) => {
|
||||
});
|
||||
let totalRevenuedata = ref()
|
||||
let totalRevenue= (d)=>{
|
||||
totalRevenuedata.value=d
|
||||
}
|
||||
// 导航列表
|
||||
const navList = [
|
||||
// {
|
||||
|
|
@ -62,9 +68,9 @@
|
|||
title: '代客下单',
|
||||
icon: '/static/indexImg/icon-substitute-ordering.svg',
|
||||
pageUrl: 'PAGES_CREATE_ORDER',
|
||||
clickFunc:()=>{
|
||||
hasPermission('允许下单').then(res=>{
|
||||
if(res){
|
||||
clickFunc: () => {
|
||||
hasPermission('允许下单').then(res => {
|
||||
if (res) {
|
||||
go.to('PAGES_CREATE_ORDER')
|
||||
}
|
||||
})
|
||||
|
|
@ -94,7 +100,7 @@
|
|||
title: '会员管理',
|
||||
icon: '/static/indexImg/icon-user.svg',
|
||||
pageUrl: 'PAGES_USER_CONTROL',
|
||||
},{
|
||||
}, {
|
||||
title: '员工管理',
|
||||
icon: '/static/indexImg/icon-staff.svg',
|
||||
pageUrl: 'PAGES_STAFF'
|
||||
|
|
@ -119,11 +125,11 @@
|
|||
icon: '/static/indexImg/icon-work.svg',
|
||||
pageUrl: 'PAGES_WORK_INDEX',
|
||||
},
|
||||
{
|
||||
title: '极速开票',
|
||||
icon: '/static/indexImg/red-envelope.svg',
|
||||
pageUrl: 'PAGES_INVOICE'
|
||||
},
|
||||
// {
|
||||
// title: '极速开票',
|
||||
// icon: '/static/indexImg/red-envelope.svg',
|
||||
// pageUrl: 'PAGES_INVOICE'
|
||||
// },
|
||||
{
|
||||
title: '排队',
|
||||
icon: '/static/indexImg/icon-line-up.svg',
|
||||
|
|
@ -144,6 +150,11 @@
|
|||
icon: '/static/coupon/icon_coupon.svg',
|
||||
pageUrl: 'PAGES_COUPON_INDEX',
|
||||
},
|
||||
{
|
||||
title: '订阅通知',
|
||||
icon: '/static/indexImg/icon-notification.svg',
|
||||
pageUrl: 'PAGES_NOTIFICATION_INDEX',
|
||||
},
|
||||
// // // {
|
||||
// // // title: '进销存',
|
||||
// // // icon: '/static/indexImg/icon-invoicing.svg',
|
||||
|
|
@ -219,26 +230,25 @@
|
|||
// pageUrl: 'PAGES_AD_LIST',
|
||||
// entId: 'ENT_ADVERT_CONTROL'
|
||||
// },
|
||||
// {
|
||||
// title: '营销红包',
|
||||
// icon: '/static/indexImg/red-envelope.svg',
|
||||
// pageUrl: 'PAGES_RED_INDEX',
|
||||
// entId: 'ENT_MCH_MEMBER'
|
||||
// },
|
||||
|
||||
|
||||
|
||||
|
||||
// {
|
||||
// title: '优惠券',
|
||||
// icon: '/static/indexImg/red-envelope.svg',
|
||||
// pageUrl: 'PAGES_COUPON_INDEX'
|
||||
// },
|
||||
|
||||
// {
|
||||
// title: '营销红包',
|
||||
// icon: '/static/indexImg/red-envelope.svg',
|
||||
// pageUrl: 'PAGES_RED_INDEX',
|
||||
// entId: 'ENT_MCH_MEMBER'
|
||||
// },
|
||||
|
||||
|
||||
{
|
||||
title: '退出登录',
|
||||
icon: '/static/indexImg/PAGE_SALES_SUMMARY.svg',
|
||||
icon: '/static/indexImg/icon-login-out.svg',
|
||||
pageUrl: 'PAGES_LOGIN',
|
||||
clickFunc:()=>{
|
||||
clickFunc: () => {
|
||||
storageManage.cleanByLogout()
|
||||
go.to('PAGES_LOGIN',{},'redirect')
|
||||
go.to('PAGES_LOGIN', {}, 'redirect')
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -250,14 +260,13 @@
|
|||
navList.splice(index, 1);
|
||||
}
|
||||
}
|
||||
const statsRef = ref();
|
||||
|
||||
const vdata = reactive({
|
||||
noticeList: [], // 公告列表
|
||||
adList: [],
|
||||
shareImgUrl: '' //分享图片
|
||||
});
|
||||
|
||||
|
||||
// 公告的点击事件。
|
||||
const listviewClickFunc = (isClickMore, record) => {
|
||||
if (isClickMore) {
|
||||
|
|
@ -313,4 +322,30 @@
|
|||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
<style lang="scss" scoped>
|
||||
.income {
|
||||
>view {
|
||||
text-align: center;
|
||||
color: #FFFFFF;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
}
|
||||
|
||||
>view:nth-child(1) {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
margin-top: 84rpx;
|
||||
}
|
||||
|
||||
>view:nth-child(2) {
|
||||
margin-top: 20rpx;
|
||||
font-weight: 500;
|
||||
font-size: 64rpx;
|
||||
}
|
||||
|
||||
>view:nth-child(3) {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
margin-top: 50rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -14,7 +14,8 @@
|
|||
<!-- 不需要label, 需要修改: label-width="0" -->
|
||||
<uni-forms ref="loginFormRef" label-width="0" :model="vdata.formData" :rules="rules">
|
||||
<view class="u-p-b-30">
|
||||
<my-tabs size="large" @change="accountTypeChange" v-model="accountType.sel" :list="accountType.list" textKey="label"></my-tabs>
|
||||
<my-tabs size="large" @change="accountTypeChange" v-model="accountType.sel" :list="accountType.list"
|
||||
textKey="label"></my-tabs>
|
||||
</view>
|
||||
<view v-if="vdata.loginType == 'pwd' ">
|
||||
<template v-if="accountType.sel==1">
|
||||
|
|
@ -27,7 +28,7 @@
|
|||
</uni-easyinput>
|
||||
</uni-forms-item>
|
||||
</template>
|
||||
|
||||
|
||||
<uni-forms-item name="username">
|
||||
<uni-easyinput class='jeepay-easyinput' placeholder="请输入登录名/手机号"
|
||||
v-model="vdata.formData.username" :clearable="false">
|
||||
|
|
@ -173,26 +174,25 @@
|
|||
login,
|
||||
getCodeImg
|
||||
} from '@/http/yskApi/login.js';
|
||||
|
||||
const accountType=reactive({
|
||||
list:[
|
||||
{label:'商户',value:'merchant'},
|
||||
{label:'员工',value:'staff'},
|
||||
|
||||
const accountType = reactive({
|
||||
list: [{
|
||||
label: '商户',
|
||||
value: 'merchant'
|
||||
},
|
||||
{
|
||||
label: '员工',
|
||||
value: 'staff'
|
||||
},
|
||||
],
|
||||
sel:0
|
||||
sel: 0
|
||||
})
|
||||
|
||||
|
||||
const loginFormRef = ref()
|
||||
const envChangeTipsRef = ref()
|
||||
const refAgr = ref()
|
||||
// #ifdef MP-WEIXIN
|
||||
// 控制 音乐播放 和暂停
|
||||
import {
|
||||
getPushStatus
|
||||
} from "@/commons/utils/pushmsg/wxTextToSpeach.js"
|
||||
// #endif
|
||||
const rules = {
|
||||
merchantName:{
|
||||
merchantName: {
|
||||
rules: [formUtil.rules.requiredInputShowToast('商户号')],
|
||||
},
|
||||
username: {
|
||||
|
|
@ -239,21 +239,26 @@
|
|||
|
||||
})
|
||||
// #ifdef H5
|
||||
// vdata.formData.username = '18049104914'
|
||||
// vdata.formData.username = '15699991111'
|
||||
// vdata.formData.pwd = '123456'
|
||||
vdata.formData.username = '15699991111'
|
||||
vdata.formData.pwd = 'qwer1234'
|
||||
vdata.formData.username = ''
|
||||
vdata.formData.pwd = ''
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
vdata.formData.username = '15699991111'
|
||||
vdata.formData.pwd = 'qwer1234'
|
||||
vdata.formData.username = ''
|
||||
vdata.formData.pwd = ''
|
||||
// vdata.formData.username = '15699991111'
|
||||
// vdata.formData.pwd = 'qwer1234'
|
||||
// #endif
|
||||
|
||||
function accountTypeChange(e){
|
||||
|
||||
function accountTypeChange(e) {
|
||||
// #ifdef H5
|
||||
if(e==1){
|
||||
vdata.formData.merchantName = '18049104914'
|
||||
vdata.formData.username = '13666666666'
|
||||
vdata.formData.pwd = '123456'
|
||||
}else{
|
||||
vdata.formData.pwd = 'qwer1234'
|
||||
}
|
||||
// #endif
|
||||
}
|
||||
|
|
@ -277,7 +282,13 @@
|
|||
// vdata.siteInfos = storageManage.siteInfos(bizData)
|
||||
// })
|
||||
// }
|
||||
|
||||
// 获取商户信息,有就回显
|
||||
let info = uni.getStorageSync('MerchantId')
|
||||
// console.log(info.merchantName,'调试121')
|
||||
if (info.merchantName) {
|
||||
vdata.formData.merchantName = info.merchantName
|
||||
vdata.formData.username = info.username
|
||||
}
|
||||
})
|
||||
|
||||
// 切换登录方式
|
||||
|
|
@ -297,7 +308,7 @@
|
|||
// loginPromise = $loginByPwd(vdata.formData.username, vdata.formData.pwd, vdata.formData.safetyCode)
|
||||
loginPromise = login({
|
||||
username: vdata.formData.username,
|
||||
password: encrypt(vdata.formData.pwd) ,
|
||||
password: encrypt(vdata.formData.pwd),
|
||||
rememberMe: false,
|
||||
code: vdata.formData.code,
|
||||
uuid: vdata.formData.uuid,
|
||||
|
|
@ -312,13 +323,18 @@
|
|||
if (loginPromise == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// 请求后的操作
|
||||
loginPromise.then(res=> {
|
||||
console.log(res);
|
||||
loginPromise.then(res => {
|
||||
// 登录成功
|
||||
loginFinishFunc(res)
|
||||
|
||||
}).catch(e=>{
|
||||
// 保存商户号
|
||||
uni.setStorageSync('MerchantId', {
|
||||
merchantName: vdata.formData.merchantName,
|
||||
username: vdata.formData.username,
|
||||
})
|
||||
}).catch(e => {
|
||||
getCode()
|
||||
})
|
||||
})
|
||||
|
|
@ -340,11 +356,11 @@
|
|||
})
|
||||
// #endif
|
||||
}
|
||||
watch(()=>accountType.sel,(newval)=>{
|
||||
if(newval==1){
|
||||
vdata.formData.merchantName=uni.getStorageSync('merchantName')||''
|
||||
}else{
|
||||
vdata.formData.username=''
|
||||
watch(() => accountType.sel, (newval) => {
|
||||
if (newval == 1) {
|
||||
vdata.formData.merchantName = uni.getStorageSync('merchantName') || ''
|
||||
} else {
|
||||
vdata.formData.username = ''
|
||||
}
|
||||
})
|
||||
// 封装登录成功后的操作
|
||||
|
|
@ -355,6 +371,7 @@
|
|||
storageManage.shopId(loginBizData.shopId)
|
||||
storageManage.shopUserId(loginBizData.user.user.id)
|
||||
storageManage.userInfo(loginBizData)
|
||||
|
||||
// 跳转到首页
|
||||
go.to("PAGES_INDEX", {
|
||||
isGetCid: true
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<view class="page-cell">
|
||||
<view class="label">头像</view>
|
||||
<view class="right" @tap="uploadImg.preview()">
|
||||
<up-avatar class="fileImg" :src="vdata.shopInfo.coverImg?vdata.shopInfo.coverImg:''"></up-avatar>
|
||||
<up-avatar class="fileImg" :src="vdata.shopInfo.coverImg?vdata.shopInfo.coverImg:''" mode="aspectFill"></up-avatar>
|
||||
<view class="file" @tap="chooseAndUploadAvatar('coverImg')"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -1,74 +1,83 @@
|
|||
<template>
|
||||
<view class="mask" @tap="hideGoods" v-if="switchGoods"></view>
|
||||
<view class="car border-top u-flex u-row-between u-col-bottom u-relative">
|
||||
<view class="u-absolute goods bg-fff">
|
||||
<view
|
||||
class="u-p-t-32 color-666 border-bottom bg-fff u-absolute total u-p-r-28 u-p-b-32 u-p-l-28 u-flex u-row-between">
|
||||
<view>已添加{{goodsNumber}}件商品</view>
|
||||
<view class="color-666">
|
||||
<uni-icons color="#666" type="trash"></uni-icons>
|
||||
<text class="u-m-l-10" @tap="clear">清空</text>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view scroll-y="true" class="tranistion" :style="{height:switchGoods?'50vh':0 }">
|
||||
<!-- 占位 -->
|
||||
<view class="u-p-t-32 color-666 border-bottom u-p-r-28 u-p-b-32 u-p-l-28 u-flex u-row-between"
|
||||
style="opacity: 0;">
|
||||
<view>
|
||||
|
||||
<view class="mask" @tap="hideGoods" v-if="switchGoods"></view>
|
||||
<view class="car border-top u-flex u-row-between u-col-bottom u-relative">
|
||||
<view class="u-absolute goods bg-fff">
|
||||
<view
|
||||
class="u-p-t-32 color-666 border-bottom bg-fff u-absolute total u-p-r-28 u-p-b-32 u-p-l-28 u-flex u-row-between">
|
||||
<view>已添加{{goodsNumber}}件商品</view>
|
||||
<view class="color-666">
|
||||
<uni-icons color="#666" type="trash"></uni-icons>
|
||||
<text class="u-m-l-10">清空</text>
|
||||
<text class="u-m-l-10" @tap="setModalShow('clear',true)">清空</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 占位 -->
|
||||
<view class="color-333 item border-top u-flex u-row-center u-row-between" v-for="(item,index) in data"
|
||||
:key="index">
|
||||
<view class="">
|
||||
<view>{{item.name}}</view>
|
||||
<view class="u-m-t-10 u-font-24 color-666">{{item.specSnap||''}}</view>
|
||||
<scroll-view scroll-y="true" class="tranistion" :style="{height:switchGoods?'50vh':0 }">
|
||||
<!-- 占位 -->
|
||||
<view class="u-p-t-32 color-666 border-bottom u-p-r-28 u-p-b-32 u-p-l-28 u-flex u-row-between"
|
||||
style="opacity: 0;">
|
||||
<view>已添加{{goodsNumber}}件商品</view>
|
||||
<view class="color-666">
|
||||
<uni-icons color="#666" type="trash"></uni-icons>
|
||||
<text class="u-m-l-10">清空</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex">
|
||||
<view class="font-bold red u-m-r-32">¥{{formatPrice(item.salePrice*item.number) }}</view>
|
||||
<view class="u-flex" @tap="updateNumber(false,index,item)">
|
||||
<image src="/pagesCreateOrder/static/images/icon-reduce-black.svg" class="icon" mode="">
|
||||
</image>
|
||||
</view>
|
||||
<view class="u-m-l-30 u-m-r-30 color-333">
|
||||
{{item.number}}
|
||||
</view>
|
||||
<view class="u-flex" @tap="updateNumber(true,index,item)">
|
||||
<image src="/pagesCreateOrder/static/images/icon-add-black.svg" class="icon" mode="">
|
||||
</image>
|
||||
<!-- 占位 -->
|
||||
<view class="color-333 item border-top u-flex u-row-center u-row-between"
|
||||
v-for="(item,index) in data" :key="index">
|
||||
<view class="">
|
||||
<view class="u-line-1">{{item.name}}</view>
|
||||
<view class="u-m-t-10 u-font-24 color-666 u-line-1">{{item.specSnap||''}}</view>
|
||||
</view>
|
||||
<view class="u-flex">
|
||||
<view class="font-bold red u-m-r-32">¥{{formatPrice(item.salePrice*item.number) }}</view>
|
||||
<view class="u-flex" @tap="updateNumber(false,index,item)">
|
||||
<image src="/pagesCreateOrder/static/images/icon-reduce-black.svg" class="icon" mode="">
|
||||
</image>
|
||||
</view>
|
||||
<view class="u-m-l-30 u-m-r-30 color-333">
|
||||
{{item.number}}
|
||||
</view>
|
||||
<view class="u-flex" @tap="updateNumber(true,index,item)">
|
||||
<image src="/pagesCreateOrder/static/images/icon-add-black.svg" class="icon" mode="">
|
||||
</image>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<my-empty v-if="!data.length" text="暂未有添加商品"></my-empty>
|
||||
</scroll-view>
|
||||
<my-empty v-if="!data.length" text="暂未有添加商品"></my-empty>
|
||||
</scroll-view>
|
||||
|
||||
</view>
|
||||
<view class="icon-car-box" @tap="toggleGoods">
|
||||
<image src="/pagesCreateOrder/static/images/icon-car.svg" class="icon-car" />
|
||||
<view class="dot">{{goodsNumber}}</view>
|
||||
</view>
|
||||
<view class="price font-bold u-flex">
|
||||
<view>¥</view>
|
||||
<view>{{allPrice}}</view>
|
||||
</view>
|
||||
<my-button shape="circle" height="80" width="220" @tap="toConfimOrder">
|
||||
<text class="u-font-32 font-bold">{{table.type=='add'?'确认加菜':'去下单'}} </text>
|
||||
</my-button>
|
||||
|
||||
|
||||
</view>
|
||||
<view class="icon-car-box" @tap="toggleGoods">
|
||||
<image src="/pagesCreateOrder/static/images/icon-car.svg" class="icon-car" />
|
||||
<view class="dot">{{goodsNumber}}</view>
|
||||
</view>
|
||||
<view class="price font-bold u-flex">
|
||||
<view>¥</view>
|
||||
<view>{{allPrice}}</view>
|
||||
</view>
|
||||
<my-button shape="circle" height="80" width="220" @tap="toConfimOrder">
|
||||
<text class="u-font-32 font-bold">{{table.type=='add'?'确认加菜':'去下单'}} </text>
|
||||
</my-button>
|
||||
|
||||
<up-modal title="提示" content="是否清空全部已添加的商品?" :show="modal.clear" showCancelButton closeOnClickOverlay @confirm="confirmModelConfirm"
|
||||
@cancel="setModalShow('clear',false)" @close="setModalShow('clear',false)" width="300px"></up-modal>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import go from '@/commons/utils/go.js';
|
||||
import infoBox from '@/commons/utils/infoBox.js';
|
||||
import {formatPrice} from '@/commons/utils/format.js';
|
||||
|
||||
import {
|
||||
formatPrice
|
||||
} from '@/commons/utils/format.js';
|
||||
|
||||
import {
|
||||
computed,
|
||||
reactive,
|
||||
ref
|
||||
} from 'vue';
|
||||
const props = defineProps({
|
||||
|
|
@ -78,10 +87,11 @@
|
|||
return []
|
||||
}
|
||||
},
|
||||
isCreateOrderToDetail:{
|
||||
type:Boolean,default:false
|
||||
isCreateOrderToDetail: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
user:{
|
||||
user: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
|
|
@ -89,20 +99,41 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
table:{
|
||||
table: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
tableId:''
|
||||
tableId: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
masterId:{
|
||||
type: [String,Number],
|
||||
default:''
|
||||
masterId: {
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
}
|
||||
})
|
||||
const modal = reactive({
|
||||
key: '',
|
||||
clear:false
|
||||
})
|
||||
|
||||
function confirmModelConfirm() {
|
||||
if (modal.key == 'clear') {
|
||||
clear()
|
||||
}
|
||||
}
|
||||
|
||||
function setModalShow(key = 'show', show = true) {
|
||||
if (key == 'clear'&&show&&props.data.length<=0) {
|
||||
return infoBox.showToast('购物车是空的!')
|
||||
}
|
||||
modal.key = key
|
||||
modal[key] = show
|
||||
console.log(modal);
|
||||
}
|
||||
|
||||
|
||||
|
||||
const edmits = defineEmits(['clear', 'updateNumber'])
|
||||
|
||||
// mask
|
||||
|
|
@ -122,20 +153,31 @@
|
|||
|
||||
function toConfimOrder() {
|
||||
console.log(props.user);
|
||||
if(props.data.length<=0){
|
||||
if (props.data.length <= 0) {
|
||||
return infoBox.showToast('还没有选择商品')
|
||||
}
|
||||
const {tableId,name,maxCapacity,status,type}=props.table
|
||||
go.to('PAGES_CONFIRM_ORDER',{
|
||||
masterId:props.masterId,type,
|
||||
tableId,name,maxCapacity,status,isCreateOrderToDetail:props.isCreateOrderToDetail?1:0
|
||||
const {
|
||||
tableId,
|
||||
name,
|
||||
maxCapacity,
|
||||
status,
|
||||
type
|
||||
} = props.table
|
||||
go.to('PAGES_CONFIRM_ORDER', {
|
||||
masterId: props.masterId,
|
||||
type,
|
||||
tableId,
|
||||
name,
|
||||
maxCapacity,
|
||||
status,
|
||||
isCreateOrderToDetail: props.isCreateOrderToDetail ? 1 : 0
|
||||
})
|
||||
}
|
||||
|
||||
const allPrice = computed(() => {
|
||||
return props.data.reduce((prve,cur)=>{
|
||||
return prve+cur.salePrice*cur.number
|
||||
},0).toFixed(2)
|
||||
return props.data.reduce((prve, cur) => {
|
||||
return prve + cur.salePrice * cur.number
|
||||
}, 0).toFixed(2)
|
||||
})
|
||||
|
||||
const goodsNumber = computed(() => {
|
||||
|
|
@ -158,16 +200,9 @@
|
|||
}
|
||||
|
||||
function clear() {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否清空全部已添加的商品?',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
edmits('clear')
|
||||
hideGoods()
|
||||
}
|
||||
}
|
||||
})
|
||||
setModalShow('clear',false)
|
||||
edmits('clear')
|
||||
hideGoods()
|
||||
}
|
||||
|
||||
import myButton from '@/components/my-components/my-button.vue'
|
||||
|
|
@ -249,6 +284,7 @@
|
|||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 2;
|
||||
|
||||
.dot {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
|
|
|
|||
|
|
@ -111,21 +111,17 @@
|
|||
console.log(props.goodsData.isStock);
|
||||
number.value = newval.suit || 1
|
||||
})
|
||||
|
||||
|
||||
const isCanBuy=computed(()=>{
|
||||
if(!goods.value) {
|
||||
|
||||
|
||||
const isCanBuy = computed(() => {
|
||||
if (!goods.value) {
|
||||
return false
|
||||
}
|
||||
console.log(util.isCanBuy({
|
||||
...goods.value,
|
||||
isStock: props.goodsData.isStock
|
||||
}));
|
||||
return util.isCanBuy({
|
||||
...goods.value,
|
||||
isStock: props.goodsData.isStock
|
||||
})
|
||||
|
||||
return util.isCanBuy(
|
||||
goods.value,
|
||||
props.goodsData
|
||||
)
|
||||
|
||||
})
|
||||
|
||||
//全部规格是否都无法使用
|
||||
|
|
@ -169,11 +165,11 @@
|
|||
function close() {
|
||||
model.value.close()
|
||||
}
|
||||
|
||||
const isDisabled=computed(()=>{
|
||||
return isAllDisabled.value || !isCanBuy.value
|
||||
|
||||
const isDisabled = computed(() => {
|
||||
return isAllDisabled.value || !isCanBuy.value
|
||||
})
|
||||
|
||||
|
||||
function reduce() {
|
||||
if (isDisabled.value) {
|
||||
return
|
||||
|
|
@ -194,7 +190,7 @@
|
|||
number.value = newval
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function confirm() {
|
||||
close()
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
<template>
|
||||
<view class="u-relative u-flex item">
|
||||
<image lazy-load class="img" :src="data.coverImg" mode="" :style="computedImgStyle()"></image>
|
||||
|
||||
<up-image :src="data.coverImg" mode="aspectFill" :width="img.width" :height="img.height"></up-image>
|
||||
<!-- <image lazy-load class="img" :src="data.coverImg" mode="aspectFill" :style="computedImgStyle()"></image> -->
|
||||
<view class="info u-flex u-row-between u-col-top u-flex-col" @tap="emitEvent('add')">
|
||||
<view>
|
||||
<view>{{data.name}}</view>
|
||||
<view>
|
||||
<text class="u-line-2">{{data.name}}</text>
|
||||
</view>
|
||||
<view class="u-font-32 font-bold u-m-t-16">
|
||||
¥{{data.price}}
|
||||
</view>
|
||||
|
|
@ -131,7 +135,7 @@
|
|||
.btn-hover-class {
|
||||
opacity: .6;
|
||||
}
|
||||
|
||||
image{will-change: transform}
|
||||
.item {
|
||||
// width: 250rpx;
|
||||
// height: 272rpx;
|
||||
|
|
@ -52,7 +52,7 @@
|
|||
:scroll-top="data.scrollTop" :scroll-into-view="data.itemId">
|
||||
<view v-for="(item,index) in data.tabbar" :key="index" class="u-tab-item"
|
||||
:class="[data.current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)">
|
||||
<text class="u-line-1">{{item.name}}</text>
|
||||
<text class="u-line-3">{{item.name}}</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<scroll-view :scroll-top="data.scrollRightTop" scroll-y scroll-with-animation class="right-box"
|
||||
|
|
@ -76,9 +76,9 @@
|
|||
</view>
|
||||
<view class="item-container">
|
||||
<view class="thumb-box" v-for="(goodsItem, goodsIndex) in item.foods" :key="goodsIndex">
|
||||
<goods-item @chooseGuige="chooseGuige($event,index)"
|
||||
<list-goods-item @chooseGuige="chooseGuige($event,index)"
|
||||
@add="goodsUpdate($event,index,true)" @reduce="goodsUpdate($event,index,false)"
|
||||
:index="goodsIndex" :data="goodsItem"></goods-item>
|
||||
:index="goodsIndex" :data="goodsItem"></list-goods-item>
|
||||
|
||||
</view>
|
||||
<!-- <template v-if="item.name==='附加费'">
|
||||
|
|
@ -100,11 +100,11 @@
|
|||
<view class="u-font-28 color-666 ">搜索</view>
|
||||
<view class="u-flex u-m-t-20 u-flex-wrap u-row-between">
|
||||
<view class="u-m-b-30" v-for="(goodsItem, goodsIndex) in searchResult" :key="goodsIndex">
|
||||
<goods-item :img="{width:'330rpx',height:'330rpx'}"
|
||||
<list-goods-item :img="{width:'330rpx',height:'330rpx'}"
|
||||
@chooseGuige="chooseGuige(goodsItem.goodsIndex,goodsItem.index)"
|
||||
@add="searchGoodsUpdate(goodsItem,goodsIndex,true)"
|
||||
@reduce="searchGoodsUpdate(goodsItem,goodsIndex,false)" :index="goodsItem.goodsIndex"
|
||||
:data="goodsItem"></goods-item>
|
||||
:data="goodsItem"></list-goods-item>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -143,7 +143,7 @@
|
|||
import util from './util.js';
|
||||
import color from '@/commons/color.js';
|
||||
import guigeModel from './components/guige'
|
||||
import goodsItem from './components/goods-item'
|
||||
import listGoodsItem from './components/list-goods-item.vue'
|
||||
import mySurcharge from './components/surcharge'
|
||||
import {
|
||||
onLoad,
|
||||
|
|
@ -158,8 +158,7 @@
|
|||
reactive,
|
||||
ref,
|
||||
nextTick,
|
||||
getCurrentInstance,
|
||||
watch
|
||||
watch,getCurrentInstance
|
||||
} from 'vue';
|
||||
import myCar from './components/car'
|
||||
import go from '@/commons/utils/go.js';
|
||||
|
|
@ -167,6 +166,7 @@
|
|||
import {
|
||||
getNowCart
|
||||
} from '@/pagesCreateOrder/util.js'
|
||||
import storageManage from '@/commons/utils/storageManage.js'
|
||||
import {
|
||||
$returnUseType
|
||||
} from './util.js'
|
||||
|
|
@ -174,12 +174,12 @@
|
|||
tbShopInfo
|
||||
} from '@/http/yskApi/user.js'
|
||||
import {hasPermission} from '@/commons/utils/hasPermission.js'
|
||||
const instance = getCurrentInstance();
|
||||
let canXiadan=ref(false)
|
||||
async function xiadanClick(){
|
||||
canXiadan.value=await hasPermission('允许下单')
|
||||
}
|
||||
xiadanClick()
|
||||
const instance = getCurrentInstance();
|
||||
//临时菜
|
||||
const lingshi = reactive({
|
||||
show: false
|
||||
|
|
@ -198,9 +198,9 @@
|
|||
menuHeight: 0, // 左边菜单的高度
|
||||
menuItemHeight: 0, // 左边菜单item的高度
|
||||
itemId: '', // 栏目右边scroll-view用于滚动的id
|
||||
tabbar: [],
|
||||
tabbar: storageManage.cacheGoods()||[],
|
||||
menuItemPos: [],
|
||||
arr: [],
|
||||
arr: storageManage.cacheGoodsNode()||[],//左右联动布局节点信息
|
||||
scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度
|
||||
timer: null, // 定时器
|
||||
topZhanwei: 136 + 24,
|
||||
|
|
@ -287,6 +287,8 @@
|
|||
return v.foods.length
|
||||
})
|
||||
data.tabbar = tabbar
|
||||
storageManage.cacheGoods(data.tabbar)
|
||||
getMenuItemTop()
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -303,7 +305,8 @@
|
|||
page: 0,
|
||||
size: 300
|
||||
}) {
|
||||
return Api.getGoodsLists(par)
|
||||
const showLoading=data.tabbar.length<=0?true:false
|
||||
return Api.getGoodsLists(par,showLoading)
|
||||
}
|
||||
//获取购物车数据
|
||||
async function getCart(par = {
|
||||
|
|
@ -397,12 +400,14 @@
|
|||
|
||||
//获取桌台信息
|
||||
async function getTableInfo() {
|
||||
const res = await $table.get({
|
||||
qrcode: data.table.tableId
|
||||
})
|
||||
console.log(res);
|
||||
if (res && res.content[0]) {
|
||||
// data.table=res.content[0]
|
||||
if(data.table.tableId){
|
||||
const res = await $table.get({
|
||||
qrcode: data.table.tableId
|
||||
})
|
||||
console.log(res);
|
||||
if (res && res.content[0]) {
|
||||
// data.table=res.content[0]
|
||||
}
|
||||
}
|
||||
}
|
||||
let $originGoods = []
|
||||
|
|
@ -435,6 +440,10 @@
|
|||
$originGoods = goods
|
||||
if (!data.table.tableId) {
|
||||
//无桌台
|
||||
const {
|
||||
masterId
|
||||
} = await getMasterId()
|
||||
data.masterId = masterId
|
||||
setTabBar(category, goods, [])
|
||||
return
|
||||
}
|
||||
|
|
@ -582,7 +591,7 @@
|
|||
return prve;
|
||||
}, {});
|
||||
const canBudyGoods = specList
|
||||
.filter((v) => util.isCanBuy(v))
|
||||
.filter((v) => util.isCanBuy(v,guigeModelData.chooseGoods.item))
|
||||
.sort((a, b) => {
|
||||
const aNumber = a.specSnap.split(",").reduce((prve, cur) => {
|
||||
return prve + skuMapNumber[cur];
|
||||
|
|
@ -671,7 +680,7 @@
|
|||
prve[i] = matchArr
|
||||
.filter((v) => v.specSnap.match(i))
|
||||
.every((v) => {
|
||||
return !util.isCanBuy(v)
|
||||
return !util.isCanBuy(v,guigeModelData.chooseGoods.item)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -796,7 +805,8 @@
|
|||
}
|
||||
|
||||
function canAddGoods() {
|
||||
return data.table.tableId
|
||||
// return data.table.tableId
|
||||
return true
|
||||
}
|
||||
|
||||
function searchGoodsUpdate(goodsItem,goodsIndex, isAdd) {
|
||||
|
|
@ -808,11 +818,11 @@
|
|||
}
|
||||
}
|
||||
async function goodsUpdate(foodsindex, index, isAdd,searchGoodsIndex) {
|
||||
if (!canAddGoods()) {
|
||||
return infoBox.showToast('请先选择桌台', 0.5).then(res => {
|
||||
chooseTable()
|
||||
})
|
||||
}
|
||||
// if (!canAddGoods()) {
|
||||
// return infoBox.showToast('请先选择桌台', 0.5).then(res => {
|
||||
// chooseTable()
|
||||
// })
|
||||
// }
|
||||
const $goods = data.tabbar[index].foods[foodsindex]
|
||||
if ($goods.isDan) {
|
||||
//单规格
|
||||
|
|
@ -963,6 +973,7 @@
|
|||
rects.forEach((rect) => {
|
||||
// 这里减去rects[0].top,是因为第一项顶部可能不是贴到导航栏(比如有个搜索框的情况)
|
||||
data.arr.push(rect.top - rects[0].top);
|
||||
storageManage.cacheGoodsNode(data.arr)
|
||||
resolve();
|
||||
})
|
||||
}).exec()
|
||||
|
|
@ -1002,7 +1013,7 @@
|
|||
return;
|
||||
}
|
||||
}
|
||||
}, 10)
|
||||
}, 100)
|
||||
}
|
||||
|
||||
function watchChooseuser() {
|
||||
|
|
@ -1171,6 +1182,8 @@
|
|||
color: #444;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
box-sizing: border-box;
|
||||
padding-left: 12rpx;
|
||||
}
|
||||
|
||||
.u-tab-item-active {
|
||||
|
|
|
|||
|
|
@ -18,8 +18,15 @@ export function $returnUseType(shop, useType) {
|
|||
return result
|
||||
}
|
||||
//判断商品是否可以下单
|
||||
export function isCanBuy(goods, isStock) {
|
||||
return goods.isGrounding && goods.isPauseSale == 0 && (isStock ? goods.stockNumber > 0 : true);
|
||||
export function isCanBuy(skuGoods,goods) {
|
||||
if(goods.typeEnum=='normal'){
|
||||
//单规格
|
||||
return goods.isGrounding&&goods.isPauseSale==0&&(goods.isStock?goods.stockNumber>0:true);
|
||||
}else{
|
||||
//多规格
|
||||
return goods.isGrounding&&goods.isPauseSale==0&&skuGoods.isGrounding&&skuGoods.isPauseSale==0&&(goods.isStock?goods.stockNumber>0:true);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<template v-if="orderInfo.status=='unpaid'&&data.status!='return'">
|
||||
<my-button plain shape="circle" :width="160" :height="56" @click="tuicai">退菜</my-button>
|
||||
</template>
|
||||
<template v-if="orderInfo.status=='closed'">
|
||||
<template v-if="orderInfo.status=='closed'&&data.status!='return'">
|
||||
<my-button plain shape="circle" :width="160" :height="56" @click="tuikuan">退款</my-button>
|
||||
</template>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -40,7 +40,13 @@
|
|||
<view class="line-th color-666 ">¥{{item.salePrice||item.price}}</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view>¥{{item.salePrice||item.price}}</view>
|
||||
<template v-if="item.priceAmount<=0">
|
||||
<view>¥0.00</view>
|
||||
<view class="line-th color-666 ">¥{{returnTotalMoney(item)}}</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view>¥{{item.priceAmount}}</view>
|
||||
</template>
|
||||
</template>
|
||||
<view class="u-m-t-22 color-999 u-font-24">X{{item.number||item.num}}</view>
|
||||
</view>
|
||||
|
|
@ -54,12 +60,15 @@
|
|||
@tap="tuicai(item,index)"><text class="no-wrap">退菜</text></my-button>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="orderInfo.status=='closed'">
|
||||
<view class="u-flex u-row-right gap-20 u-m-t-20" v-if="item.status!='return'">
|
||||
<my-button :width="128" :height="48" plain shape="circle"
|
||||
@tap="tuikuan(item,index)"><text class="no-wrap">退款</text> </my-button>
|
||||
</view>
|
||||
<template v-if="item.status!='refund'">
|
||||
<template v-if="orderInfo.status=='closed'||orderInfo.status=='refund'">
|
||||
<view class="u-flex u-row-right gap-20 u-m-t-20" v-if="item.status!='return'">
|
||||
<my-button :width="128" :height="48" plain shape="circle"
|
||||
@tap="tuikuan(item,index)"><text class="no-wrap">退款</text> </my-button>
|
||||
</view>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="bg-gray u-p-20 u-m-t-20" v-if="orderInfo.remark">
|
||||
|
|
@ -128,8 +137,12 @@
|
|||
computed
|
||||
} from 'vue';
|
||||
import color from '@/commons/color.js'
|
||||
import {hasPermission} from '@/commons/utils/hasPermission.js'
|
||||
const emits = defineEmits(['tuicai', 'tuikuan', 'printOrder'])
|
||||
|
||||
function returnTotalMoney(item){
|
||||
return (item.price*item.num).toFixed(2)
|
||||
}
|
||||
function to2(n){
|
||||
if(!n){
|
||||
return 0
|
||||
|
|
@ -142,7 +155,11 @@
|
|||
}
|
||||
|
||||
function tuikuan(item, index) {
|
||||
emits('tuikuan', item, index)
|
||||
hasPermission('允许退款').then(res=>{
|
||||
if(res){
|
||||
emits('tuikuan', item, index)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function printOrder() {
|
||||
|
|
@ -175,7 +192,7 @@
|
|||
const goodsPrice = props.data.reduce((prve, cur) => {
|
||||
const curTotal = cur.info.filter(v => v.isGift !== "true" && v.status !== "return").reduce((a,
|
||||
b) => {
|
||||
return a + (b.salePrice || b.price) * (b.number || b.num)
|
||||
return a + b.priceAmount*1
|
||||
}, 0)
|
||||
return prve + curTotal
|
||||
}, 0)
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
</view>
|
||||
<view class="u-flex u-flex-1 u-row-right">
|
||||
<view>×{{item.num}}</view>
|
||||
<view class="u-text-right" :style="computedPriceStyle()">¥{{item.price}}</view>
|
||||
<view class="u-text-right" :style="computedPriceStyle()">¥{{item.priceAmount}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -177,8 +177,8 @@
|
|||
function setUser(par) {
|
||||
console.log(option);
|
||||
const submitPar = {
|
||||
masterId: option.masterId,
|
||||
tableId: option.tableId,
|
||||
tableId: order.tableId,
|
||||
masterId: order.masterId,
|
||||
vipUserId: user.value.id ? user.value.id : '',
|
||||
type: user.value.id ? 0 : 1 //0 设置 1 取消
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1729662523365" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4294" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M512 493.568c-32.256 0-58.88-26.112-58.88-58.88V58.88C453.12 26.112 479.744 0 512 0s58.88 26.112 58.88 58.88v375.808c0 32.256-26.624 58.88-58.88 58.88z" fill="#318AFE" p-id="4295"></path><path d="M512 1024c-273.92 0-496.64-222.72-496.64-496.64 0-202.752 121.344-382.976 309.248-459.776 30.208-12.288 64.512 2.048 76.8 32.256 12.288 30.208-2.048 64.512-32.256 76.8C225.792 235.008 133.12 372.736 133.12 527.36c0 208.896 169.984 378.88 378.88 378.88s378.88-169.984 378.88-378.88c0-154.624-92.672-292.352-236.032-351.232-30.208-12.288-44.544-46.592-32.256-76.8 12.288-30.208 46.592-44.544 76.8-32.256 187.904 76.8 309.248 257.024 309.248 459.776 0 274.432-222.72 497.152-496.64 497.152z" fill="#318AFE" p-id="4296"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32" viewBox="0 0 32 32"><defs><style>.a{fill:#80bcff;}.b{clip-path:url(#a);}.c{fill:#4c99fe;}.d{fill:#197dff;}</style><clipPath id="a"><rect class="a" width="32" height="32" transform="translate(329 962)"/></clipPath></defs><g class="b" transform="translate(-329 -962)"><g transform="translate(202.143 843.263)"><path class="c" d="M286.412,444.28m-9.08,0a9.08,9.08,0,1,0,9.08-9.08,9.08,9.08,0,0,0-9.08,9.08Z" transform="translate(-143.555 -303.517)"/><path class="d" d="M450.476,127.721A2.432,2.432,0,0,1,448,125.245v-3.3a2.476,2.476,0,1,1,4.953,0v3.3A2.483,2.483,0,0,1,450.476,127.721Z" transform="translate(-307.619)"/><path class="c" d="M213.791,210.185h-18.82A2.959,2.959,0,0,1,192,207.213v-7.1a12.381,12.381,0,1,1,24.763,0v7.1A2.959,2.959,0,0,1,213.791,210.185Z" transform="translate(-61.524 -65.625)"/><path class="d" d="M155.239,644.953H130.476a2.476,2.476,0,1,1,0-4.953h24.763a2.476,2.476,0,1,1,0,4.953Z" transform="translate(0 -500.393)"/></g></g></svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
Loading…
Reference in New Issue