更新
This commit is contained in:
@@ -2,10 +2,10 @@ import http from '@/http/http.js'
|
|||||||
const request = http.request
|
const request = http.request
|
||||||
// 商品----------------------------------------------------------------------------------------------------
|
// 商品----------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* 获取商品列表
|
* 获取商品分页
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function getProductList(data, urlType = 'product' ,showLoading) {
|
export function getProductPage(data, urlType = 'product' ,showLoading) {
|
||||||
return request({
|
return request({
|
||||||
url: `${urlType}/admin/product/page`,
|
url: `${urlType}/admin/product/page`,
|
||||||
method: "GET",
|
method: "GET",
|
||||||
@@ -16,6 +16,22 @@ export function getProductList(data, urlType = 'product' ,showLoading) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取商品列表
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function getProductList(data, urlType = 'product' ,showLoading) {
|
||||||
|
return request({
|
||||||
|
url: `${urlType}/admin/product/list`,
|
||||||
|
method: "GET",
|
||||||
|
data: {
|
||||||
|
...data
|
||||||
|
},
|
||||||
|
showLoading
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取商品详情
|
* 获取商品详情
|
||||||
* @returns
|
* @returns
|
||||||
@@ -59,7 +75,7 @@ export function delProduct(id, urlType = 'product') {
|
|||||||
*/
|
*/
|
||||||
export function productOnOff (data, urlType = 'product') {
|
export function productOnOff (data, urlType = 'product') {
|
||||||
return request({
|
return request({
|
||||||
url: `${urlType}/admin/product/on-off`,
|
url: `${urlType}/admin/product/onOff`,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
data: {
|
data: {
|
||||||
...data
|
...data
|
||||||
|
|||||||
@@ -1,6 +1,20 @@
|
|||||||
import http from '@/http/http.js'
|
import http from '@/http/http.js'
|
||||||
const request = http.request
|
const request = http.request
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 营业板块
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function getTrade(data, urlType = 'order') {
|
||||||
|
return request({
|
||||||
|
url: `${urlType}/admin/data/summary/trade`,
|
||||||
|
method: "GET",
|
||||||
|
data: {
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品销售汇总
|
* 商品销售汇总
|
||||||
* @returns
|
* @returns
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export function canComputedPackFee(v) {
|
export function canComputedPackFee(v) {
|
||||||
return v.pack && v.status != 'return' && v.status != 'refund' && v.status != 'refunding'
|
return v.pack && v.status != 'return' && v.status != 'refund' && v.status != 'part_refund'
|
||||||
}
|
}
|
||||||
export function returnCanComputedGoodsArr(arr) {
|
export function returnCanComputedGoodsArr(arr) {
|
||||||
return arr.filter(v => canComputedPackFee(v))
|
return arr.filter(v => canComputedPackFee(v))
|
||||||
@@ -18,7 +18,8 @@ export function canTuicai(orderInfo, item) {
|
|||||||
}
|
}
|
||||||
export function canTuiKuan(orderInfo, item) {
|
export function canTuiKuan(orderInfo, item) {
|
||||||
if( item ){
|
if( item ){
|
||||||
return orderInfo.status == 'done' && item.status != 'return' && item.status != 'refund' && item.status != 'refunding'
|
return (orderInfo.status == 'done' || orderInfo.status == 'part_refund')
|
||||||
|
&& item.status != 'return' && item.status != 'refund' && item.status != 'refunding'
|
||||||
} else {
|
} else {
|
||||||
let goodsList = []
|
let goodsList = []
|
||||||
let data = false;
|
let data = false;
|
||||||
@@ -29,7 +30,7 @@ export function canTuiKuan(orderInfo, item) {
|
|||||||
console.log("goodsList===",goodsList)
|
console.log("goodsList===",goodsList)
|
||||||
goodsList.some((v,i)=>{
|
goodsList.some((v,i)=>{
|
||||||
console.log(v)
|
console.log(v)
|
||||||
if( orderInfo.status == 'done' && v.status != 'return' && v.status != 'refund' && v.status != 'refunding' ){
|
if( (orderInfo.status == 'done' || orderInfo.status == 'part_refund') && v.status != 'return' && v.status != 'refund' && v.status != 'refunding' ){
|
||||||
data = true
|
data = true
|
||||||
console.log(data)
|
console.log(data)
|
||||||
return data
|
return data
|
||||||
@@ -44,7 +45,7 @@ export function isTuiCai(item) {
|
|||||||
return item.status == 'return' || item.status == 'part_refund'
|
return item.status == 'return' || item.status == 'part_refund'
|
||||||
}
|
}
|
||||||
export function isTui(item) {
|
export function isTui(item) {
|
||||||
return item.status == 'return' || item.status == 'refund' || item.status == 'refunding'
|
return item.status == 'return' || item.status == 'refund' || item.status == 'part_refund'
|
||||||
}
|
}
|
||||||
export function isGift(item) {
|
export function isGift(item) {
|
||||||
return !isTui(item) && item.isGift == 1
|
return !isTui(item) && item.isGift == 1
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ class WebsocketUtil {
|
|||||||
|
|
||||||
this.socketTask.onOpen((res) => {
|
this.socketTask.onOpen((res) => {
|
||||||
console.log('WebSocket连接正常!==',res);
|
console.log('WebSocket连接正常!==',res);
|
||||||
|
this.send(JSON.stringify({"type": "ping_interval22"}));
|
||||||
this.isOpen = true;
|
this.isOpen = true;
|
||||||
// 连接成功后启动心跳和消息监听
|
// 连接成功后启动心跳和消息监听
|
||||||
this.startHeartbeat();
|
this.startHeartbeat();
|
||||||
|
|||||||
@@ -33,9 +33,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive,ref,onMounted } from 'vue';
|
import { reactive,ref,onMounted } from 'vue';
|
||||||
import { $tbShopCategory, $tbProductV2 } from "@/http/yskApi/goods.js"
|
import { $tbShopCategory, $tbProductV2 } from "@/http/yskApi/goods.js"
|
||||||
import { getProductList, getCategoryList } from '@/api/product.js'
|
import { getProductPage, getCategoryList } from '@/api/product.js'
|
||||||
const props=defineProps({
|
const props=defineProps({
|
||||||
show:{
|
show:{
|
||||||
type:Boolean,
|
type:Boolean,
|
||||||
@@ -78,7 +78,7 @@ import { $tbShopCategory, $tbProductV2 } from "@/http/yskApi/goods.js"
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
function getGoodsList () {
|
function getGoodsList () {
|
||||||
getProductList(category.query).then(res => {
|
getProductPage(category.query).then(res => {
|
||||||
category.goodsList = res.records.map(v => {
|
category.goodsList = res.records.map(v => {
|
||||||
return {
|
return {
|
||||||
...v,
|
...v,
|
||||||
|
|||||||
@@ -196,7 +196,12 @@
|
|||||||
let delConfirm = () => {
|
let delConfirm = () => {
|
||||||
pageData.delShow = false;
|
pageData.delShow = false;
|
||||||
delCreditBuyer(pageData.delItem.id).then(res => {
|
delCreditBuyer(pageData.delItem.id).then(res => {
|
||||||
|
if( pageData.query.page > 1 && pageData.list.length == 1){
|
||||||
|
pageData.query.page--
|
||||||
getList()
|
getList()
|
||||||
|
} else {
|
||||||
|
getList()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
*/
|
*/
|
||||||
function inputEvent(d) {
|
function inputEvent(d) {
|
||||||
pageData.query.paymentMethod = pageData.query.paymentMethod.replace(/\s*/g, "");
|
pageData.query.paymentMethod = pageData.query.paymentMethod.replace(/\s*/g, "");
|
||||||
pageData.query.size = 1;
|
pageData.query.page = 1;
|
||||||
pageData.list = [];
|
pageData.list = [];
|
||||||
getList()
|
getList()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
import { hasPermission } from '@/commons/utils/hasPermission.js';
|
import { hasPermission } from '@/commons/utils/hasPermission.js';
|
||||||
|
|
||||||
import { categoryPage } from '@/api/cateGory.js'
|
import { categoryPage } from '@/api/cateGory.js'
|
||||||
import { getProductList,getProdGroupDetail,updateProdGroup } from '@/api/product.js'
|
import { getProductPage,getProdGroupDetail,updateProdGroup } from '@/api/product.js'
|
||||||
|
|
||||||
const pageData = reactive({
|
const pageData = reactive({
|
||||||
stateCurrent: 0,
|
stateCurrent: 0,
|
||||||
@@ -161,7 +161,7 @@
|
|||||||
* 获取商品列表
|
* 获取商品列表
|
||||||
*/
|
*/
|
||||||
function getGoodsList() {
|
function getGoodsList() {
|
||||||
getProductList(pageData.query).then(res => {
|
getProductPage(pageData.query).then(res => {
|
||||||
pageData.hasAjax = true
|
pageData.hasAjax = true
|
||||||
let goodsList = res.records.map(v => {
|
let goodsList = res.records.map(v => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -291,7 +291,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<template v-if="FormData.type == 'weigh'">
|
<template v-if="FormData.type == 'weight'">
|
||||||
<view class="block u-p-t-32 u-p-b-32">
|
<view class="block u-p-t-32 u-p-b-32">
|
||||||
<view class="font-bold">
|
<view class="font-bold">
|
||||||
<text class="color-red">*</text>
|
<text class="color-red">*</text>
|
||||||
@@ -543,7 +543,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '称重商品',
|
name: '称重商品',
|
||||||
value: 'weigh'
|
value: 'weight'
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// name: '团购券',
|
// name: '团购券',
|
||||||
@@ -1126,7 +1126,7 @@
|
|||||||
FormData.proGroupVo[0].number = null
|
FormData.proGroupVo[0].number = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (type == 'weigh') {
|
if (type == 'weight') {
|
||||||
if (!FormData.weight) {
|
if (!FormData.weight) {
|
||||||
return infoBox.showToast('请输入重量')
|
return infoBox.showToast('请输入重量')
|
||||||
}
|
}
|
||||||
@@ -1408,6 +1408,7 @@
|
|||||||
left: 110rpx;
|
left: 110rpx;
|
||||||
right: 110rpx;
|
right: 110rpx;
|
||||||
bottom: 60px;
|
bottom: 60px;
|
||||||
|
z-index: 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.minus {}
|
.minus {}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { reactive, onMounted, ref, watch, computed } from 'vue';
|
import { reactive, onMounted, ref, watch, computed } from 'vue';
|
||||||
import { getProductList} from '@/api/product.js';
|
import { getProductPage} from '@/api/product.js';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: {
|
modelValue: {
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '称重',
|
name: '称重',
|
||||||
value: 'weigh'
|
value: 'weight'
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// name: '团购券',
|
// name: '团购券',
|
||||||
@@ -152,7 +152,7 @@
|
|||||||
*/
|
*/
|
||||||
function getGoods() {
|
function getGoods() {
|
||||||
const arr=selArr
|
const arr=selArr
|
||||||
getProductList(goods.query).then(res => {
|
getProductPage(goods.query).then(res => {
|
||||||
let selLen=0;
|
let selLen=0;
|
||||||
goods.list = res.records.map(v => {
|
goods.list = res.records.map(v => {
|
||||||
const checked=$selGoodsMap[v.id]?true:false
|
const checked=$selGoodsMap[v.id]?true:false
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-t-24">
|
<view class="u-m-t-24">
|
||||||
<template v-if="data.skuList.length>=1">
|
<template v-if="data.type == 'sku' && data.skuList.length>=1">
|
||||||
<view class="u-flex u-flex-wrap w-full gap-10 u-col-top" :style="skuStyle">
|
<view class="u-flex u-flex-wrap w-full gap-10 u-col-top" :style="skuStyle">
|
||||||
<view class="u-font-24 info-p-l u-m-t-6">规格:</view>
|
<view class="u-font-24 info-p-l u-m-t-6">规格:</view>
|
||||||
<view class="skd" v-for="(item,index) in data.skuList" :key="index"
|
<view class="skd" v-for="(item,index) in data.skuList" :key="index"
|
||||||
|
|||||||
@@ -135,7 +135,7 @@
|
|||||||
$updateProductData
|
$updateProductData
|
||||||
} from "@/http/yskApi/goods.js"
|
} from "@/http/yskApi/goods.js"
|
||||||
import {
|
import {
|
||||||
getProductList,
|
getProductPage,
|
||||||
getCategoryList,
|
getCategoryList,
|
||||||
updateProduct
|
updateProduct
|
||||||
} from '@/api/product.js'
|
} from '@/api/product.js'
|
||||||
@@ -223,7 +223,7 @@
|
|||||||
*/
|
*/
|
||||||
function getGoodsList() {
|
function getGoodsList() {
|
||||||
pageData.hasAjax = false
|
pageData.hasAjax = false
|
||||||
getProductList(pageData.query).then(res => {
|
getProductPage(pageData.query).then(res => {
|
||||||
pageData.hasAjax = true
|
pageData.hasAjax = true
|
||||||
pageData.goodsList = res.records.map(v => {
|
pageData.goodsList = res.records.map(v => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -10,36 +10,20 @@
|
|||||||
|
|
||||||
<view class="pageSalesSummaryContent">
|
<view class="pageSalesSummaryContent">
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class="">
|
<view class=""> 实收金额(元) </view>
|
||||||
实收金额(元)
|
<view class=""> {{list.sale?list.sale.incomeAmountAll:0}} </view>
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
{{list.sale?list.sale.incomeAmountAll:0}}
|
<view class=""> 优惠金额(元) </view>
|
||||||
</view>
|
<view class=""> {{list.count?list.count.saveAmount:0}} </view>
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class="">
|
<view class=""> 客单价(元) </view>
|
||||||
优惠金额(元)
|
<view class=""> {{list.count?list.count.unitPrice:0}} </view>
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
{{list.count?list.count.saveAmount:0}}
|
<view class=""> 会员消费(元) </view>
|
||||||
</view>
|
<view class=""> {{list.vip?list.vip.useAmount:0}} </view>
|
||||||
</view>
|
|
||||||
<view class="">
|
|
||||||
<view class="">
|
|
||||||
客单价(元)
|
|
||||||
</view>
|
|
||||||
<view class="">
|
|
||||||
{{list.count?list.count.unitPrice:0}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="">
|
|
||||||
<view class="">
|
|
||||||
会员消费(元)
|
|
||||||
</view>
|
|
||||||
<view class="">
|
|
||||||
{{list.vip?list.vip.useAmount:0}}
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
<view class="">
|
<view class="">
|
||||||
@@ -59,34 +43,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="table-scroll">
|
<view class="table-scroll">
|
||||||
<!-- <table class="table" cellspacing="0">
|
|
||||||
<thead class="thead">
|
|
||||||
<tr style="background-color: #aebad2;color: #fff;" height='41'>
|
|
||||||
<th style="width: 540rpx;">商品名称</th>
|
|
||||||
<th style="width: 215rpx;">总数量</th>
|
|
||||||
<th>金额</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody class="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>
|
|
||||||
{{item.productName}}
|
|
||||||
</td>
|
|
||||||
<td style="padding-left: 16rpx;">{{item.num}}</td>
|
|
||||||
<td style="padding-left: 16rpx;">{{item.salesAmount}}</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<view class="color-333 u-font-28 bg-gray default-box-padding" style="padding-top:80px;">
|
<view class="color-333 u-font-28 bg-gray default-box-padding" style="padding-top:80px;">
|
||||||
<scroll-view :scroll-x="true" class="bg-fff table u-text-center">
|
<scroll-view :scroll-x="true" class="bg-fff table u-text-center">
|
||||||
@@ -114,7 +70,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<!-- <view style="height: 100px;"></view> -->
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
@@ -125,20 +80,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { onMounted, getCurrentInstance, ref } from 'vue';
|
||||||
import datePickerview from './components/my-date-pickerview.vue'
|
import datePickerview from './components/my-date-pickerview.vue'
|
||||||
import {
|
|
||||||
summaryTrade,
|
|
||||||
dateProduct
|
|
||||||
} from '@/http/yskApi/requestAll.js';
|
|
||||||
import {
|
|
||||||
onMounted,
|
|
||||||
getCurrentInstance,
|
|
||||||
ref
|
|
||||||
} from 'vue';
|
|
||||||
import dayjs from 'dayjs' //时间格式库
|
import dayjs from 'dayjs' //时间格式库
|
||||||
import go from '@/commons/utils/go.js'
|
import go from '@/commons/utils/go.js'
|
||||||
import { productSaleDate } from '@/api/summary.js'
|
import { getTrade, productSaleDate } from '@/api/summary.js'
|
||||||
|
|
||||||
|
|
||||||
const timeList = [{
|
const timeList = [{
|
||||||
label: '今天',
|
label: '今天',
|
||||||
@@ -165,13 +111,16 @@
|
|||||||
const currentInstance = getCurrentInstance()
|
const currentInstance = getCurrentInstance()
|
||||||
let tableList = ref([])
|
let tableList = ref([])
|
||||||
let day = ref(1)
|
let day = ref(1)
|
||||||
|
onMounted(() => {
|
||||||
function toUrl() {
|
getlist()
|
||||||
go.to('PAGES_PRODUCT_SALES_RANKING', {
|
gettableData()
|
||||||
day: day.value
|
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取营业数据
|
||||||
|
* @param {Object} start
|
||||||
|
* @param {Object} end
|
||||||
|
*/
|
||||||
function getlist(start, end) {
|
function getlist(start, end) {
|
||||||
let startTime, endTime;
|
let startTime, endTime;
|
||||||
if (selected.value == 'today') {
|
if (selected.value == 'today') {
|
||||||
@@ -200,37 +149,17 @@
|
|||||||
startTime = s + ' 00:00:00'
|
startTime = s + ' 00:00:00'
|
||||||
endTime = e + ' 23:59:59'
|
endTime = e + ' 23:59:59'
|
||||||
}
|
}
|
||||||
summaryTrade({
|
getTrade({
|
||||||
shopId: uni.getStorageSync('shopId'),
|
beginTime: startTime,
|
||||||
startTime,
|
endTime: endTime,
|
||||||
endTime,
|
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
list.value = res
|
list.value = res
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
|
||||||
getlist()
|
|
||||||
gettableData()
|
|
||||||
})
|
|
||||||
|
|
||||||
function datePickerConfirm(e) {
|
/**
|
||||||
getlist(e.start, e.end)
|
* 获取销售数据
|
||||||
// gettableData() day如日期不能是1 7 30 就回报错
|
*/
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function changeTime(e) {
|
|
||||||
|
|
||||||
selected.value = e
|
|
||||||
if (e == 'custom') {
|
|
||||||
currentInstance.ctx.$refs.datePicker.toggle()
|
|
||||||
} else {
|
|
||||||
getlist()
|
|
||||||
gettableData()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取表格数据
|
|
||||||
function gettableData() {
|
function gettableData() {
|
||||||
if (selected.value == 'today') {
|
if (selected.value == 'today') {
|
||||||
day.value = 1
|
day.value = 1
|
||||||
@@ -248,11 +177,14 @@
|
|||||||
page: 1,
|
page: 1,
|
||||||
size: 5
|
size: 5
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
tableList.value = res.productList.content
|
tableList.value = res.productList.records
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
// 获取当前时间
|
|
||||||
|
/**
|
||||||
|
* 获取当前时间
|
||||||
|
*/
|
||||||
function getdate() {
|
function getdate() {
|
||||||
const dt = new Date();
|
const dt = new Date();
|
||||||
const y = dt.getFullYear();
|
const y = dt.getFullYear();
|
||||||
@@ -263,7 +195,10 @@
|
|||||||
const ss = (dt.getSeconds() + "").padStart(2, "0");
|
const ss = (dt.getSeconds() + "").padStart(2, "0");
|
||||||
return `${y}-${m}-${d}`;
|
return `${y}-${m}-${d}`;
|
||||||
}
|
}
|
||||||
// 获取昨天时间
|
|
||||||
|
/**
|
||||||
|
* 获取昨天时间
|
||||||
|
*/
|
||||||
const formatTime = () => {
|
const formatTime = () => {
|
||||||
let strDate = getdate()
|
let strDate = getdate()
|
||||||
let dateFormat = new Date(strDate);
|
let dateFormat = new Date(strDate);
|
||||||
@@ -274,6 +209,39 @@
|
|||||||
let d = dateFormat.getDate().toString().padStart(2, '0')
|
let d = dateFormat.getDate().toString().padStart(2, '0')
|
||||||
return `${y}-${m}-${d}`
|
return `${y}-${m}-${d}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间切换
|
||||||
|
* @param {Object} e
|
||||||
|
*/
|
||||||
|
function changeTime(e) {
|
||||||
|
selected.value = e
|
||||||
|
if (e == 'custom') {
|
||||||
|
currentInstance.ctx.$refs.datePicker.toggle()
|
||||||
|
} else {
|
||||||
|
getlist()
|
||||||
|
gettableData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义确认
|
||||||
|
* @param {Object} e
|
||||||
|
*/
|
||||||
|
function datePickerConfirm(e) {
|
||||||
|
getlist(e.start, e.end)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更多
|
||||||
|
*/
|
||||||
|
function toUrl() {
|
||||||
|
go.to('PAGES_PRODUCT_SALES_RANKING', {
|
||||||
|
day: day.value
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
page {
|
page {
|
||||||
|
|||||||
@@ -1,22 +1,4 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- <view class="table-scroll">
|
|
||||||
<table cellspacing="0">
|
|
||||||
<thead>
|
|
||||||
<tr style="background-color: #aebad2;color: #fff;" height='41'>
|
|
||||||
<th>商品名称</th>
|
|
||||||
<th>数量</th>
|
|
||||||
<th>金额</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr v-for="(item,index) in tableList" :key="item.productId">
|
|
||||||
<td style="padding-left: 16rpx;">{{item.productName}}</td>
|
|
||||||
<td style="padding-left: 16rpx;">{{item.num}}</td>
|
|
||||||
<td style="padding-left: 16rpx;">{{item.salesAmount}}</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</view> -->
|
|
||||||
<template>
|
<template>
|
||||||
<view class="color-333 u-font-28 bg-gray default-box-padding" >
|
<view class="color-333 u-font-28 bg-gray default-box-padding" >
|
||||||
<scroll-view :scroll-x="true" class="bg-fff table u-text-center">
|
<scroll-view :scroll-x="true" class="bg-fff table u-text-center">
|
||||||
@@ -36,40 +18,36 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<!-- <view style="height: 100px;"></view> -->
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import { onMounted, ref } from 'vue';
|
||||||
onMounted,
|
import { productSaleDate } from '@/api/summary.js'
|
||||||
ref
|
|
||||||
} from 'vue';
|
|
||||||
import {
|
|
||||||
summaryTrade,
|
|
||||||
dateProduct
|
|
||||||
} from '@/http/yskApi/requestAll.js';
|
|
||||||
let tableList = ref([])
|
let tableList = ref([])
|
||||||
let props = defineProps({
|
let props = defineProps({
|
||||||
day: {
|
day: {
|
||||||
type: Number
|
type: Number
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
gettableData()
|
gettableData()
|
||||||
})
|
})
|
||||||
// 获取表格数据
|
|
||||||
|
/**
|
||||||
|
* 获取销售数据
|
||||||
|
*/
|
||||||
function gettableData() {
|
function gettableData() {
|
||||||
dateProduct({
|
productSaleDate({
|
||||||
shopId: uni.getStorageSync('shopId'),
|
|
||||||
day: props.day,
|
day: props.day,
|
||||||
page: 0,
|
page: 0,
|
||||||
size: 50
|
size: 50
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
tableList.value = res.productList.content
|
tableList.value = res.productList.records
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -35,18 +35,16 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { getCurrentInstance, ref } from 'vue';
|
||||||
|
import { onShow } from '@dcloudio/uni-app';
|
||||||
import {
|
import {
|
||||||
summaryTrade,
|
summaryTrade,
|
||||||
} from '@/http/yskApi/requestAll.js';
|
} from '@/http/yskApi/requestAll.js';
|
||||||
import dayjs from 'dayjs' //时间格式库
|
import dayjs from 'dayjs' //时间格式库
|
||||||
import {
|
|
||||||
getCurrentInstance,
|
|
||||||
ref
|
|
||||||
} from 'vue';
|
|
||||||
import datePickerview from './my-date-pickerview.vue'
|
import datePickerview from './my-date-pickerview.vue'
|
||||||
import {
|
|
||||||
onShow
|
import { getTrade } from '@/api/summary.js'
|
||||||
} from '@dcloudio/uni-app';
|
|
||||||
let selected = ref('today')
|
let selected = ref('today')
|
||||||
let showAll = ref(false);
|
let showAll = ref(false);
|
||||||
let $list = []
|
let $list = []
|
||||||
@@ -121,10 +119,9 @@
|
|||||||
startTime = s + ' 00:00:00'
|
startTime = s + ' 00:00:00'
|
||||||
endTime = e + ' 23:59:59'
|
endTime = e + ' 23:59:59'
|
||||||
}
|
}
|
||||||
summaryTrade({
|
getTrade({
|
||||||
shopId: uni.getStorageSync('shopId'),
|
beginTime: startTime,
|
||||||
startTime,
|
endTime: endTime,
|
||||||
endTime,
|
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
$list = res.sale.payCount
|
$list = res.sale.payCount
|
||||||
setList()
|
setList()
|
||||||
|
|||||||
@@ -47,45 +47,27 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import { reactive, ref, onMounted, nextTick } from 'vue';
|
||||||
reactive,
|
import { onPullDownRefresh, onLoad, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app';
|
||||||
ref,
|
|
||||||
onMounted,
|
|
||||||
nextTick
|
|
||||||
} from 'vue';
|
|
||||||
import {
|
|
||||||
onShareAppMessage,
|
|
||||||
onShareTimeline
|
|
||||||
} from '@dcloudio/uni-app';
|
|
||||||
import {
|
|
||||||
reqLoad,
|
|
||||||
API_URL_SYS_ARTICLES,
|
|
||||||
$indexStatistics,
|
|
||||||
$getSiteInfos
|
|
||||||
} from '@/http/apiManager.js';
|
|
||||||
import go from '@/commons/utils/go.js';
|
import go from '@/commons/utils/go.js';
|
||||||
import Stats from './components/Stats.vue';
|
import Stats from './components/Stats.vue';
|
||||||
import statistics from './components/statistics.vue'
|
import statistics from './components/statistics.vue'
|
||||||
import {
|
|
||||||
onPullDownRefresh,
|
|
||||||
onLoad
|
|
||||||
} from '@dcloudio/uni-app';
|
|
||||||
import storageManage from '@/commons/utils/storageManage.js';
|
import storageManage from '@/commons/utils/storageManage.js';
|
||||||
import {
|
import {
|
||||||
hasPermission
|
hasPermission
|
||||||
} from '@/commons/utils/hasPermission.js'
|
} from '@/commons/utils/hasPermission.js'
|
||||||
|
|
||||||
|
|
||||||
uni.hideTabBar()
|
uni.hideTabBar()
|
||||||
let shopName = ref()
|
let shopName = ref()
|
||||||
onLoad((options) => {
|
|
||||||
shopName.value = uni.getStorageSync('shopName');
|
|
||||||
});
|
|
||||||
let totalRevenuedata = ref()
|
let totalRevenuedata = ref()
|
||||||
let totalRevenue = (d) => {
|
let totalRevenue = (d) => {
|
||||||
totalRevenuedata.value = d
|
totalRevenuedata.value = d
|
||||||
}
|
}
|
||||||
|
|
||||||
let showTips = ref(false)
|
let showTips = ref(false)
|
||||||
|
|
||||||
function toggleTips() {
|
function toggleTips() {
|
||||||
showTips.value = !showTips.value
|
showTips.value = !showTips.value
|
||||||
}
|
}
|
||||||
@@ -282,6 +264,22 @@
|
|||||||
|
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const vdata = reactive({
|
||||||
|
noticeList: [], // 公告列表
|
||||||
|
adList: [],
|
||||||
|
shareImgUrl: '' //分享图片
|
||||||
|
});
|
||||||
|
|
||||||
|
onLoad((options) => {
|
||||||
|
shopName.value = uni.getStorageSync('shopName');
|
||||||
|
});
|
||||||
|
|
||||||
|
// 启动加载
|
||||||
|
onMounted(() => {
|
||||||
|
// refData();
|
||||||
|
});
|
||||||
|
|
||||||
// 如果不是超管 删除 刷脸广告菜单
|
// 如果不是超管 删除 刷脸广告菜单
|
||||||
if (storageManage.userInfo().userType != 1) {
|
if (storageManage.userInfo().userType != 1) {
|
||||||
const index = navList.findIndex((v) => v.entId == 'ENT_ADVERT_CONTROL');
|
const index = navList.findIndex((v) => v.entId == 'ENT_ADVERT_CONTROL');
|
||||||
@@ -290,36 +288,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const vdata = reactive({
|
|
||||||
noticeList: [], // 公告列表
|
|
||||||
adList: [],
|
|
||||||
shareImgUrl: '' //分享图片
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// 刷新数据 async 异步函数, 每个查询需要返回promise对象,并标识await
|
|
||||||
async function refData() {
|
async function refData() {
|
||||||
// 查询公告列表
|
|
||||||
|
|
||||||
// 调用子组件方法 , 避免组件没有加载完成。
|
// 调用子组件方法 , 避免组件没有加载完成。
|
||||||
|
|
||||||
// nextTick(() => statsRef.value.refData());
|
// nextTick(() => statsRef.value.refData());
|
||||||
// 停止刷新
|
// 停止刷新
|
||||||
uni.stopPullDownRefresh();
|
uni.stopPullDownRefresh();
|
||||||
}
|
}
|
||||||
// 获取 统计数据
|
|
||||||
const getIndexStat = (time) => {
|
|
||||||
$indexStatistics(time).then(({
|
|
||||||
bizData
|
|
||||||
}) => {
|
|
||||||
vdata.statInfo = bizData.dayCount;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 启动加载
|
/**
|
||||||
onMounted(() => {
|
* 微信分享
|
||||||
// refData();
|
*/
|
||||||
});
|
|
||||||
// 微信分享
|
|
||||||
onShareAppMessage((res) => {
|
onShareAppMessage((res) => {
|
||||||
if (res.from == 'menu')
|
if (res.from == 'menu')
|
||||||
return {
|
return {
|
||||||
@@ -328,7 +307,10 @@
|
|||||||
imageUrl: vdata.shareImgUrl
|
imageUrl: vdata.shareImgUrl
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
// 分享到朋友圈
|
|
||||||
|
/**
|
||||||
|
* 分享到朋友圈
|
||||||
|
*/
|
||||||
onShareTimeline(() => {
|
onShareTimeline(() => {
|
||||||
return {
|
return {
|
||||||
title: uni.$appName,
|
title: uni.$appName,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
<view class="u-m-t-24 border discount u-relative u-flex input-box">
|
<view class="u-m-t-24 border discount u-relative u-flex input-box">
|
||||||
<view class="u-flex-1">
|
<view class="u-flex-1">
|
||||||
<input @input="discountMoneyInput" v-model="form.discountMoney" type="digit"
|
<input @input="discountMoneyInput" v-model="form.discountMoney" type="digit"
|
||||||
placeholder-class="placeholder-class" placeholder="减8.55元请输入8.55" />
|
placeholder-class="placeholder-class" placeholder="请输入最终优惠金额" />
|
||||||
</view>
|
</view>
|
||||||
<view class="color-999 u-p-l-48 u-p-r-48 u-flex u-row-center u-col-center">
|
<view class="color-999 u-p-l-48 u-p-r-48 u-flex u-row-center u-col-center">
|
||||||
<view>元</view>
|
<view>元</view>
|
||||||
|
|||||||
@@ -302,7 +302,7 @@
|
|||||||
import { getNowCart } from '@/pagesCreateOrder/util.js'
|
import { getNowCart } from '@/pagesCreateOrder/util.js'
|
||||||
import { getShopInfo } from '@/api/shop.js'
|
import { getShopInfo } from '@/api/shop.js'
|
||||||
import { getShopTableDetail } from '@/api/table.js'
|
import { getShopTableDetail } from '@/api/table.js'
|
||||||
import { getProductList } from '@/api/product.js'
|
import { getProductPage } from '@/api/product.js'
|
||||||
import { createOrder,getHistoryOrder } from '@/api/order.js'
|
import { createOrder,getHistoryOrder } from '@/api/order.js'
|
||||||
import { number } from 'uview-plus/libs/function/test';
|
import { number } from 'uview-plus/libs/function/test';
|
||||||
|
|
||||||
@@ -568,7 +568,7 @@
|
|||||||
* 获取商品列表
|
* 获取商品列表
|
||||||
*/
|
*/
|
||||||
function getGoods() {
|
function getGoods() {
|
||||||
return getProductList({
|
return getProductPage({
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 300
|
size: 300
|
||||||
},'product', false)
|
},'product', false)
|
||||||
@@ -871,6 +871,7 @@
|
|||||||
|
|
||||||
let vipPrice = isVip.value ? 1 : 0
|
let vipPrice = isVip.value ? 1 : 0
|
||||||
let placeNum = pageData.shopInfo.registerType == 'after'&&pageData.orderInfo ? pageData.orderInfo.placeNum + 1 : 1;
|
let placeNum = pageData.shopInfo.registerType == 'after'&&pageData.orderInfo ? pageData.orderInfo.placeNum + 1 : 1;
|
||||||
|
let originAmount = goodsPrice.value*1+youhui.value*1
|
||||||
let par = {
|
let par = {
|
||||||
shopId: pageData.shopInfo.id, //店铺Id
|
shopId: pageData.shopInfo.id, //店铺Id
|
||||||
userId: pageData.user.userId, //用户Id
|
userId: pageData.user.userId, //用户Id
|
||||||
@@ -879,7 +880,7 @@
|
|||||||
remark: pageData.form.note, //备注
|
remark: pageData.form.note, //备注
|
||||||
seatNum: 0, //用餐人数
|
seatNum: 0, //用餐人数
|
||||||
packFee: $packFee.value, //打包费
|
packFee: $packFee.value, //打包费
|
||||||
originAmount: goodsPrice.value, //订单原金额(包含打包费+餐位费) 不含折扣价格
|
originAmount: originAmount, //订单原金额(包含打包费+餐位费) 不含折扣价格
|
||||||
placeNum: placeNum, //当前订单下单次数
|
placeNum: placeNum, //当前订单下单次数
|
||||||
waitCall: 0, //是否等叫 0 否 1 等叫
|
waitCall: 0, //是否等叫 0 否 1 等叫
|
||||||
vipPrice: vipPrice, //是否使用会员价
|
vipPrice: vipPrice, //是否使用会员价
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<view class="u-font-32 font-bold u-m-t-16">
|
<view class="u-font-32 font-bold u-m-t-16">
|
||||||
¥{{data.lowPrice}}
|
¥{{data.lowPrice}}
|
||||||
</view>
|
</view>
|
||||||
<template v-if="data.type=='weigh'">
|
<template v-if="data.type=='weight'">
|
||||||
<view class="btnweigh">称重</view>
|
<view class="btnweigh">称重</view>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<view class="u-flex icon-btn">
|
<view class="u-flex icon-btn">
|
||||||
<view class="u-flex" @tap.stop="emitEvent(data.type=='weigh'?'tapweigh':'add')">
|
<view class="u-flex" @tap.stop="emitEvent(data.type=='weight'?'tapweigh':'add')">
|
||||||
<image src="/pagesCreateOrder/static/images/icon-add.svg" class="icon" mode=""></image>
|
<image src="/pagesCreateOrder/static/images/icon-add.svg" class="icon" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
<template v-if="data.chooseNumber">
|
<template v-if="data.chooseNumber">
|
||||||
|
|||||||
@@ -178,7 +178,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
table: {
|
table: {
|
||||||
id: ""
|
id: "",
|
||||||
},
|
},
|
||||||
socketData: {
|
socketData: {
|
||||||
type:'onboc',
|
type:'onboc',
|
||||||
@@ -218,6 +218,9 @@
|
|||||||
if (JSON.stringify(opt) == '{}') {
|
if (JSON.stringify(opt) == '{}') {
|
||||||
isCreateOrderToDetail.value = true
|
isCreateOrderToDetail.value = true
|
||||||
}
|
}
|
||||||
|
if(uni.getStorageSync("table_code")){
|
||||||
|
data.table.tableCode = uni.getStorageSync("table_code")
|
||||||
|
}
|
||||||
init()
|
init()
|
||||||
xiadanClick()
|
xiadanClick()
|
||||||
})
|
})
|
||||||
@@ -273,7 +276,7 @@
|
|||||||
$category = categoryRes.records
|
$category = categoryRes.records
|
||||||
// 获取商品数据
|
// 获取商品数据
|
||||||
const goodsRes = await getGoods()
|
const goodsRes = await getGoods()
|
||||||
const goods = goodsRes.records.filter((v) => {
|
const goods = goodsRes.filter((v) => {
|
||||||
let isShow = true;
|
let isShow = true;
|
||||||
if (v.type != "sku") {
|
if (v.type != "sku") {
|
||||||
isShow = v.skuList.length >= 1;
|
isShow = v.skuList.length >= 1;
|
||||||
@@ -326,23 +329,28 @@
|
|||||||
cars.length = 0
|
cars.length = 0
|
||||||
data.isCars = true;
|
data.isCars = true;
|
||||||
console.log("购物车信息onboc_init===",msg)
|
console.log("购物车信息onboc_init===",msg)
|
||||||
|
if( !data.table.tableCode ){
|
||||||
|
data.table.tableCode = msg.table_code
|
||||||
|
uni.setStorageSync("table_code",msg.table_code)
|
||||||
|
}
|
||||||
msg.data.map(item=>{
|
msg.data.map(item=>{
|
||||||
cartItem = getNowCart(item,cartArr)
|
cartItem = getNowCart(item,cartArr)
|
||||||
cartControls(cartItem,'add')
|
cartControls(cartItem,'add')
|
||||||
})
|
})
|
||||||
|
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
break;
|
break;
|
||||||
case 'onboc_add':
|
case 'onboc_add':
|
||||||
case 'add':
|
case 'add':
|
||||||
cartItem = getNowCart(msg.data,cartArr)
|
cartItem = getNowCart(msg.data,cartArr)
|
||||||
cartControls(cartItem,'add')
|
cartControls(cartItem,'add')
|
||||||
infoBox.showToast('添加成功')
|
infoBox.showToast('操作成功')
|
||||||
break;
|
break;
|
||||||
case 'onboc_edit':
|
case 'onboc_edit':
|
||||||
case 'edit':
|
case 'edit':
|
||||||
cartItem = getNowCart(msg.data,cartArr)
|
cartItem = getNowCart(msg.data,cartArr)
|
||||||
cartControls(cartItem,'edit')
|
cartControls(cartItem,'edit')
|
||||||
infoBox.showToast('添加成功')
|
infoBox.showToast('操作成功')
|
||||||
break;
|
break;
|
||||||
case 'onboc_del':
|
case 'onboc_del':
|
||||||
case 'del':
|
case 'del':
|
||||||
@@ -390,6 +398,7 @@
|
|||||||
*/
|
*/
|
||||||
function editCart (par,operate_type) {
|
function editCart (par,operate_type) {
|
||||||
console.log('购物车添加菜品',par)
|
console.log('购物车添加菜品',par)
|
||||||
|
console.log("data.table==",data.table)
|
||||||
if( !data.isGoodsAdd ){ return; }
|
if( !data.isGoodsAdd ){ return; }
|
||||||
let params = {
|
let params = {
|
||||||
...data.socketData,
|
...data.socketData,
|
||||||
@@ -437,10 +446,7 @@
|
|||||||
*/
|
*/
|
||||||
function getGoods() {
|
function getGoods() {
|
||||||
const showLoading = data.tabbar.length <= 0 ? true : false
|
const showLoading = data.tabbar.length <= 0 ? true : false
|
||||||
return getProductList({
|
return getProductList({},'product', showLoading)
|
||||||
page: 1,
|
|
||||||
size: 300
|
|
||||||
},'product', showLoading)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -511,8 +517,9 @@
|
|||||||
}
|
}
|
||||||
if( cars.length > 0){
|
if( cars.length > 0){
|
||||||
websocketUtil.send(JSON.stringify(params))
|
websocketUtil.send(JSON.stringify(params))
|
||||||
|
} else{
|
||||||
|
initCart()
|
||||||
}
|
}
|
||||||
// initCart()
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (item.status == "unbind") {
|
if (item.status == "unbind") {
|
||||||
@@ -569,7 +576,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 不影响之前的代码 称重number单独处理
|
// 不影响之前的代码 称重number单独处理
|
||||||
if ($goods.type == 'weigh' && showCurrentInput) {
|
if ($goods.type == 'weight' && showCurrentInput) {
|
||||||
number = cartItem.number * 1 + Number(showCurrentInput)
|
number = cartItem.number * 1 + Number(showCurrentInput)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -583,7 +590,7 @@
|
|||||||
setSearchGoods(searchGoodsIndex, number)
|
setSearchGoods(searchGoodsIndex, number)
|
||||||
} else {
|
} else {
|
||||||
// 不影响之前的代码 称重suit单独处理
|
// 不影响之前的代码 称重suit单独处理
|
||||||
if ($goods.type == 'weigh' && showCurrentInput) {
|
if ($goods.type == 'weight' && showCurrentInput) {
|
||||||
suitNum = showCurrentInput
|
suitNum = showCurrentInput
|
||||||
}
|
}
|
||||||
// 套餐和单规格
|
// 套餐和单规格
|
||||||
@@ -652,6 +659,8 @@
|
|||||||
if( !data.isGoodsAdd ){ return; }
|
if( !data.isGoodsAdd ){ return; }
|
||||||
let $sku;
|
let $sku;
|
||||||
let $goods;
|
let $goods;
|
||||||
|
|
||||||
|
if( e.goods.is_temporary != 1){
|
||||||
data.tabbar.map(tabbarItem=>{
|
data.tabbar.map(tabbarItem=>{
|
||||||
if(tabbarItem.foods.find(v => v.id == e.goods.product_id)){
|
if(tabbarItem.foods.find(v => v.id == e.goods.product_id)){
|
||||||
$goods = !e.goods.product_id ? undefined : tabbarItem.foods.find(v => v.id == e.goods.product_id)
|
$goods = !e.goods.product_id ? undefined : tabbarItem.foods.find(v => v.id == e.goods.product_id)
|
||||||
@@ -668,6 +677,14 @@
|
|||||||
delCart(e.goods.id)
|
delCart(e.goods.id)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (e.num === 0) {
|
||||||
|
//移除
|
||||||
|
delCart(e.goods.id)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
editCart({
|
editCart({
|
||||||
number: e.num,
|
number: e.num,
|
||||||
id: e.goods.id,
|
id: e.goods.id,
|
||||||
@@ -684,32 +701,6 @@
|
|||||||
*/
|
*/
|
||||||
async function taocanConfirm(d, item) {
|
async function taocanConfirm(d, item) {
|
||||||
console.log(d)
|
console.log(d)
|
||||||
let carGoods = null;
|
|
||||||
cars.some(item=>{
|
|
||||||
if(item.product_id == data.goodsData.id){
|
|
||||||
let arr = []
|
|
||||||
JSON.parse(item.pro_group_info).some((v,i)=>{
|
|
||||||
if( JSON.stringify(v.selectData) == JSON.stringify(d[i].selectData) ){
|
|
||||||
arr.push(v)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if( arr.length == d.length ) {
|
|
||||||
carGoods = item
|
|
||||||
return carGoods;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if (carGoods) {
|
|
||||||
//更新
|
|
||||||
let newNumber = carGoods.number * 1 + 1
|
|
||||||
editCart({
|
|
||||||
id: carGoods.id,
|
|
||||||
number: newNumber,
|
|
||||||
product_id: carGoods.product_id,
|
|
||||||
sku_id: carGoods.sku_id,
|
|
||||||
},'edit')
|
|
||||||
data.isGoodsAdd = false;
|
|
||||||
} else {
|
|
||||||
//添加
|
//添加
|
||||||
editCart({
|
editCart({
|
||||||
number: item.skuList[0].suitNum,
|
number: item.skuList[0].suitNum,
|
||||||
@@ -720,10 +711,6 @@
|
|||||||
data.isGoodsAdd = false;
|
data.isGoodsAdd = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const instance = getCurrentInstance();
|
const instance = getCurrentInstance();
|
||||||
let selGoods = ref({});
|
let selGoods = ref({});
|
||||||
/**
|
/**
|
||||||
@@ -1310,7 +1297,7 @@
|
|||||||
uni.$on('add:cashCai', async (data) => {
|
uni.$on('add:cashCai', async (data) => {
|
||||||
console.log('add:cashCai',data);
|
console.log('add:cashCai',data);
|
||||||
$originGoods.push(data)
|
$originGoods.push(data)
|
||||||
|
data.isGoodsAdd = false;
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
<view class="">
|
<view class="">
|
||||||
<view class="u-flex">
|
<view class="u-flex">
|
||||||
<view class="tui" v-if="isTui(item)">
|
<view class="tui" v-if="isTui(item)">
|
||||||
{{item.status=='refunding'?'退款中':'已退'}}
|
{{item.status=='part_refund'?'部分已退':'全部已退'}}
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
:class="{'line-th':item.status=='return'||item.status=='refund'||item.status=='refunding'}">
|
:class="{'line-th':item.status=='return'||item.status=='refund'||item.status=='refunding'}">
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="u-m-r-20 u-font-24 u-flex" v-if="item.returnAmount">
|
<view class="u-m-r-20 u-font-24 u-flex" v-if="item.returnAmount">
|
||||||
<view class="color-666">退款金额:</view>
|
<view class="color-666">退款金额:</view>
|
||||||
<view class="color-999 u-m-l-6">{{item.returnAmount*item.returnNum}}</view>
|
<view class="color-999 u-m-l-6">{{item.returnAmount*item.refundNum}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-r-20 u-font-24 u-flex" v-if="item.returnNum">
|
<view class="u-m-r-20 u-font-24 u-flex" v-if="item.returnNum">
|
||||||
<view class="color-666">退菜数量:</view>
|
<view class="color-666">退菜数量:</view>
|
||||||
@@ -70,8 +70,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-text-right u-m-t-28">
|
<view class="u-text-right u-m-t-28">
|
||||||
<template v-if="isTui(item)">
|
<template v-if="item.refundNum>0">
|
||||||
<view>¥0.00</view>
|
<view>¥{{(returnTotalMoney(item)-item.refundNum*item.returnAmount).toFixed(2)}}</view>
|
||||||
<view class="line-th color-666 ">¥{{returnTotalMoney(item)}}</view>
|
<view class="line-th color-666 ">¥{{returnTotalMoney(item)}}</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.userCouponId">
|
<template v-else-if="item.userCouponId">
|
||||||
|
|||||||
@@ -43,7 +43,6 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import * as Api from '@/http/yskApi/Instead.js'
|
|
||||||
import userVue from './components/user.vue';
|
import userVue from './components/user.vue';
|
||||||
import orderVue from './components/order.vue';
|
import orderVue from './components/order.vue';
|
||||||
import goodsList from './components/list.vue';
|
import goodsList from './components/list.vue';
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
<view class="no-wrap u-m-r-32">打包费</view>
|
<view class="no-wrap u-m-r-32">打包费</view>
|
||||||
<view>¥{{data.packFee||0}}</view>
|
<view>¥{{data.packFee||0}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="height: 32rpx;" v-if="data.packFee>0&&data.seatInfo&&data.seatInfo.priceAmount>0"></view>
|
<view style="height: 32rpx;" ></view>
|
||||||
<view class="u-flex u-row-between u-col-top" v-if="data.seatInfo&&data.seatInfo.priceAmount>0">
|
<view class="u-flex u-row-between u-col-top" v-if="data.seatInfo&&data.seatInfo.priceAmount>0">
|
||||||
<view class="no-wrap u-m-r-32">{{data.seatInfo.productName}}</view>
|
<view class="no-wrap u-m-r-32">{{data.seatInfo.productName}}</view>
|
||||||
<view>¥{{data.seatInfo.priceAmount}}</view>
|
<view>¥{{data.seatInfo.priceAmount}}</view>
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
})
|
})
|
||||||
onShow(init)
|
onShow(init)
|
||||||
onPullDownRefresh(()=>{
|
onPullDownRefresh(()=>{
|
||||||
pageData.page = 1
|
pageData.query.page = 1
|
||||||
init()
|
init()
|
||||||
})
|
})
|
||||||
watch(()=>pageData.createdAt,(newval)=>{
|
watch(()=>pageData.createdAt,(newval)=>{
|
||||||
@@ -107,7 +107,8 @@
|
|||||||
* @param {Object} e
|
* @param {Object} e
|
||||||
*/
|
*/
|
||||||
function pageChange(e){
|
function pageChange(e){
|
||||||
pageData.page = e
|
pageData.query.page = e
|
||||||
|
console.log(e)
|
||||||
init()
|
init()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,7 +119,7 @@
|
|||||||
*/
|
*/
|
||||||
function updateQuery(key,e){
|
function updateQuery(key,e){
|
||||||
pageData.query[key] = e
|
pageData.query[key] = e
|
||||||
pageData.page = 1
|
pageData.query.page = 1
|
||||||
init()
|
init()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,7 +127,7 @@
|
|||||||
* 搜索监听
|
* 搜索监听
|
||||||
*/
|
*/
|
||||||
function searchConfirm(){
|
function searchConfirm(){
|
||||||
pageData.page = 1
|
pageData.query.page = 1
|
||||||
init()
|
init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -373,7 +373,8 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
pageData.seatNum = order.tableId!=null&&order.tableId!="undefined" ? order.seatNum : 0;
|
console.log("order==",order)
|
||||||
|
pageData.seatNum = order.seatNum;
|
||||||
}
|
}
|
||||||
const coupAllPrice = computed(() => {
|
const coupAllPrice = computed(() => {
|
||||||
const n = pays.quan.reduce((prve, cur) => {
|
const n = pays.quan.reduce((prve, cur) => {
|
||||||
@@ -429,7 +430,7 @@
|
|||||||
const discountSaleAmount = computed(() => {
|
const discountSaleAmount = computed(() => {
|
||||||
if(pageData.goodsList){
|
if(pageData.goodsList){
|
||||||
let price = pageData.goodsList.filter(v => v.discountSaleAmount > 0 && v.status !== "return").reduce((a, b) => {
|
let price = pageData.goodsList.filter(v => v.discountSaleAmount > 0 && v.status !== "return").reduce((a, b) => {
|
||||||
return a + (b.num * b.discountSaleAmount)
|
return a + ((b.num * b.price) - (b.num * b.discountSaleAmount))
|
||||||
}, 0)
|
}, 0)
|
||||||
return price
|
return price
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -194,11 +194,12 @@
|
|||||||
if (!noteResult) {
|
if (!noteResult) {
|
||||||
return infoBox.showToast('请输入或选择退款原因!')
|
return infoBox.showToast('请输入或选择退款原因!')
|
||||||
}
|
}
|
||||||
|
let refundAmount = orderDetail.goodsList.reduce((prve, cur) => {
|
||||||
|
return prve + (cur.number * 1 * cur.unitPrice)
|
||||||
|
}, 0)
|
||||||
let params = {
|
let params = {
|
||||||
orderId: option.orderId,
|
orderId: option.orderId,
|
||||||
refundAmount: orderDetail.goodsList.reduce((prve, cur) => {
|
refundAmount: refundAmount.toFixed(2),
|
||||||
return prve + (cur.number * 1 * cur.unitPrice)
|
|
||||||
}, 0),
|
|
||||||
refundReason: noteResult,
|
refundReason: noteResult,
|
||||||
refundDetails: orderDetail.goodsList.filter(v=>v.number*1).map(v=>{
|
refundDetails: orderDetail.goodsList.filter(v=>v.number*1).map(v=>{
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user