This commit is contained in:
cun-nan 2024-09-09 16:50:54 +08:00
parent e53c5ba986
commit c92f9d546f
13 changed files with 393 additions and 217 deletions

View File

@ -9,7 +9,7 @@ export function listCardCoupon(query) {
})
}
// 查询优惠券活动列表
// 根据id优惠券活动列表
export function getCardCoupon(id) {
return request({
url: 'cardCoupon/'+id,
@ -17,7 +17,7 @@ export function getCardCoupon(id) {
})
}
// 查询优惠券活动列表
// 添加优惠券活动信息
export function addCardCoupon(data) {
return request({
url: 'cardCoupon',
@ -26,7 +26,7 @@ export function addCardCoupon(data) {
})
}
// 查询优惠券活动列表
// 修改优惠券活动信息
export function editCardCoupon(data) {
return request({
url: 'cardCoupon',
@ -35,7 +35,7 @@ export function editCardCoupon(data) {
})
}
// 查询优惠券活动列表
// 删除优惠券活动信息
export function deleteCardCoupon(id) {
return request({
url: 'cardCoupon/'+id,

View File

@ -145,3 +145,11 @@ export function exportExcelDayApi(data) {
data: data // 通过 data 参数传递需要的数据
});
}
export function getTotalAmount() {
return request({
url: 'business/allOrderInfo/getTotalAmount',
method: 'get',
});
}

View File

@ -6,15 +6,18 @@
<div class="top-hang">
<div class="d-s">
<el-select v-model="queryParams.cardAmount" clearable style="margin-right: 10px" placeholder="请选择面值">
<el-option v-for="item in jglist" :key="item.cardAmount" :label="item.cardAmount" :value="item.cardAmount">
</el-option>
</el-select>
<el-select v-model="queryParams.activateStatus" clearable style="margin-right: 10px" placeholder="请选择激活状态">
<!-- <el-select v-model="queryParams.cardAmount" clearable style="margin-right: 10px" placeholder="请选择面值">-->
<!-- <el-option v-for="item in jglist" :key="item.cardAmount" :label="item.cardAmount" :value="item.cardAmount">-->
<!-- </el-option>-->
<!-- </el-select>-->
<el-input v-model="queryParams.cardAmount" clearable style="margin-right: 10px"
placeholder="请输入优惠券名称"></el-input>
<el-select v-model="queryParams.activateStatus" clearable style="margin-right: 10px"
placeholder="请选择优惠类型">
<el-option v-for="item in option" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
<el-select v-model="queryParams.sailStatus" clearable style="margin-right: 10px" placeholder="请选择出售状态">
<el-select v-model="queryParams.sailStatus" clearable style="margin-right: 10px" placeholder="请选择状态">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
@ -22,7 +25,7 @@
<div class="d-s">
<el-button type="primary" icon="el-icon-search" @click="getlist">查询</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
<el-button type="primary" icon="el-icon-search">下载模板</el-button>
<!-- <el-button type="primary" icon="el-icon-search">下载模板</el-button>-->
<el-button type="primary" @click="addCertificate">新增优惠券</el-button>
<!-- <el-upload-->
@ -39,35 +42,42 @@
</div>
</div>
<el-table border :data="tableData" style="width: 100%">
<el-table-column label="序号" type="index">
</el-table-column>
<el-table-column prop="number" label="优惠券编号">
</el-table-column>
<el-table-column prop="cardAmount" label="优惠券名称">
</el-table-column>
<el-table-column prop="useTime" label="优惠券类型">
</el-table-column>
<el-table-column prop="sailTime" label="投放类型">
</el-table-column>
<el-table-column prop="createTime" label="优惠内容">
</el-table-column>
<el-table-column prop="createTime" label="有效期">
</el-table-column>
<el-table-column prop="createTime" label="已领/投放数量">
</el-table-column>
<el-table-column prop="createTime" label="已核销">
</el-table-column>
<el-table-column prop="sailStatus" label="状态">
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column prop="number" label="优惠券编号"></el-table-column>
<el-table-column prop="name" label="优惠券名称"></el-table-column>
<el-table-column prop="type" label="优惠券类型">
<template slot-scope="scope">
<span v-if="scope.row.sailStatus == 1">已售</span>
<span v-if="scope.row.sailStatus != 1">未售</span>
<span v-if="scope.row.type==1">代金券</span>
<span v-if="scope.row.type==2">兑换券</span>
<span v-if="scope.row.type==3">折扣券</span>
<span v-if="scope.row.type==4">油品立减券</span>
<span v-if="scope.row.type==5">单品代金券</span>
</template>
</el-table-column>
<el-table-column prop="createBy" label="创建人">
<el-table-column prop="putType" label="投放类型">
<template slot-scope="scope">
<span v-if="scope.row.putType==1">营销投放</span>
<span v-if="scope.row.putType==2">免费领取</span>
<span v-if="scope.row.putType==3">积分兑换</span>
</template>
</el-table-column>
<el-table-column prop="createBy" label="创建时间">
<el-table-column prop="createTime" label="优惠内容"></el-table-column>
<el-table-column prop="createTime" label="有效期">
<template slot-scope="scope">
<span>{{ scope.row.effectiveDateStart }}~{{ scope.row.effectiveDateEnd }}</span>
</template>
</el-table-column>
<el-table-column prop="address" label="操作">
<el-table-column prop="createTime" label="已领/投放数量"></el-table-column>
<el-table-column prop="createTime" label="已核销"></el-table-column>
<el-table-column prop="status" label="状态">
<template slot-scope="scope">
<span v-if="scope.row.status == 1" style="color: #0DC291">上架</span>
<span v-if="scope.row.status != 1" style="color: #F44522">下架</span>
</template>
</el-table-column>
<el-table-column prop="createBy" label="创建人"></el-table-column>
<el-table-column prop="createTime" label="创建时间"></el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<div style="display: flex;">
<el-button type="text" @click="grounding">修改</el-button>
@ -82,7 +92,7 @@
width="280">
</el-table-column>-->
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="pageNo" :limit.sync="pageSize" @pagination="getlist" />
<pagination v-show="total > 0" :total="total" :page.sync="pageNo" :limit.sync="pageSize" @pagination="getlist"/>
</div>
<el-drawer title="订单记录" :visible.sync="orderShow" size="55%" :before-close="handleClose" center>
<div class="box-der">
@ -94,30 +104,21 @@
</el-option>
</el-select>
<el-date-picker v-model="value1" type="daterange" range-separator="" start-placeholder="开始日期"
end-placeholder="结束日期">
end-placeholder="结束日期">
</el-date-picker>
</div>
<el-button type="primary" icon="el-icon-search">搜索</el-button>
</div>
<el-table :data="orderData" border style="width: 100%">
<el-table-column label="序号" type="index">
</el-table-column>
<el-table-column prop="date" label="订单号">
</el-table-column>
<el-table-column prop="date" label="会员手机号">
</el-table-column>
<el-table-column prop="date" label="礼品卡面值(元)">
</el-table-column>
<el-table-column prop="date" label="数量">
</el-table-column>
<el-table-column prop="date" label="礼品卡金额">
</el-table-column>
<el-table-column prop="date" label="实收金额">
</el-table-column>
<el-table-column prop="date" label="订单状态">
</el-table-column>
<el-table-column prop="date" label="订单完成时间">
</el-table-column>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column prop="date" label="订单号"></el-table-column>
<el-table-column prop="date" label="会员手机号"></el-table-column>
<el-table-column prop="date" label="礼品卡面值(元)"></el-table-column>
<el-table-column prop="date" label="数量"></el-table-column>
<el-table-column prop="date" label="礼品卡金额"></el-table-column>
<el-table-column prop="date" label="实收金额"></el-table-column>
<el-table-column prop="date" label="订单状态"></el-table-column>
<el-table-column prop="date" label="订单完成时间"></el-table-column>
</el-table>
</div>
</el-drawer>
@ -125,7 +126,7 @@
<el-dialog title="新增/编辑优惠券" :visible.sync="centerDialogVisible" width="80%">
<!-- -->
<el-form :model="ruleForm" :rules="rules" :label-position="labelPosition" ref="ruleForm" label-width="120px"
class="demo-ruleForm">
class="demo-ruleForm">
<div class="d-s" style="justify-content: space-between">
<el-form-item label="优惠券编号" prop="number" style="width: 45%;">
<el-input v-model="ruleForm.number" placeholder="请输入优惠券编号" style="width: 300px"></el-input>
@ -139,22 +140,28 @@
<el-form-item label="投放类型" prop="putType" style="width: 45%;">
<el-select v-model="ruleForm.putType" placeholder="请选择投放类型" style="width: 300px">
<el-option v-for="dict in dict.type.putType_type" :key="dict.value" :label="dict.label"
:value="dict.value" />
:value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="优惠类型" prop="name" style="width: 45%;">
<el-select v-model="ruleForm.type" placeholder="请选择投放类型" style="width: 300px">
<el-form-item label="优惠券类型" prop="type" style="width: 45%;">
<el-select v-model="ruleForm.type" placeholder="请选择优惠券类型" style="width: 300px">
<el-option v-for="dict in dict.type.CardCoupon_type" :key="dict.value" :label="dict.label"
:value="dict.value" />
:value="dict.value"/>
</el-select>
</el-form-item>
</div>
<div class="d-s" style="justify-content: space-between">
<el-form-item label="消费条件" prop="name" style="width: 45%;">
<el-form-item label="消费条件" prop="useType" style="width: 45%;">
<div class="d-s">
<el-select v-model="ruleForm.useType" placeholder="请选择金额">
<el-option label="订单金额" value="1"/>
<el-option label="实收金额" value="2"/>
<el-option label="兑换券" value="3"/>
<el-option label="折扣券" value="4"/>
<el-option label="油品立减券" value="5"/>
<el-option label="单品代金券" value="6"/>
</el-select>
<div style="margin: 0px 5px;"></div>
<el-input placeholder="" v-model="ruleForm.reachAmount" style="width: 140px">
@ -168,43 +175,51 @@
</el-form-item>
<!-- 适用油品油号 oilNumber -->
<el-form-item label="适用油品油号" prop="name" style="width: 45%;">
<el-form-item label="适用油品油号" prop="oilLimit" style="width: 45%;">
<div class="d-s">
<el-radio-group v-model="ruleForm.oilLimit">
<el-radio :label="1">不限</el-radio>
<el-radio :label="2">自定义</el-radio>
</el-radio-group>
<el-select v-model="ruleForm.oilNumber" multiple placeholder="请选择" style="margin-left: 5px">
<el-option v-for="dict in dict.type.oilNumber_type" :key="dict.value" :label="dict.label"
:value="dict.value" />
<!-- <el-option v-for="dict in dict.type.oilNumber_type" :key="dict.value" :label="dict.label"-->
<!-- :value="dict.value"/>-->
<el-option v-for="(item,index) in oilNumberList" :key="index"
:label="getOilNamess(oilNameList,item.oilName)" :value="item.oilName"></el-option>
</el-select>
</div>
</el-form-item>
</div>
<div class="d-s" style="justify-content: space-between">
<el-form-item label="适用会员等级" prop="name" style="width: 30%;">
<el-form-item label="适用会员等级" prop="membershipLevel" style="width: 30%;">
<el-select v-model="ruleForm.membershipLevel" multiple placeholder="请选择">
<el-option v-for="item in membership" :key="item.value" :label="item.label" :value="item.value">
</el-option>
<el-option v-for="item in membership" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-option
v-for="(item,index) in membership"
:label="item.name"
:value="item.id.toString()"
:key="index"></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否允许收银台送券" label-width="160px" prop="name" style="width: 45%;">
<el-form-item label="是否允许收银台送券" label-width="160px" prop="sySend" style="width: 45%;">
<el-radio-group v-model="ruleForm.sySend">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
<el-radio-group v-model="ruleForm.sySend">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-radio-group>
</el-form-item>
</div>
<div class="d-s" style="justify-content: space-between">
<!-- 生效日期设置 timeType 字段 -->
<el-form-item label="生效日期设置" prop="name" style="width: 45%;">
<el-form-item label="生效日期设置" prop="timeType" style="width: 45%;">
<div class="d-s">
<el-radio-group v-model="ruleForm.timeType">
<el-radio :label="1">领取<el-input v-model="ruleForm.validityDay" placeholder="" style="width: 80px;margin: 0px 10px"></el-input>
<el-radio :label="1">领取
<el-input v-model="ruleForm.validityDay" placeholder=""
style="width: 80px;margin: 0px 10px"></el-input>
<span>天内有效</span></el-radio>
<el-radio :label="2">指定使用日期</el-radio>
@ -213,24 +228,24 @@
</div>
</el-form-item>
<!-- 生效日期 effectiveDateStart 字段 -->
<el-form-item label="生效日期" prop="name" style="width: 45%;">
<el-form-item label="生效日期" prop="effectiveDateStart" style="width: 45%;">
<el-date-picker v-model="ruleForm.effectiveDateStart" type="daterange" range-separator=""
start-placeholder="开始日期" end-placeholder="结束日期">
start-placeholder="开始日期" end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
</div>
<!-- 是否与其他优惠同时使用 useWithOther -->
<div class="d-s" style="justify-content: space-between">
<el-form-item label="是否与其他优惠同时使用" label-width="180px" prop="name" style="width: 45%;">
<el-form-item label="是否与其他优惠同时使用" label-width="180px" prop="useWithOther" style="width: 45%;">
<el-radio-group v-model="ruleForm.useWithOther">
<el-radio :label="0">不可以</el-radio>
<el-radio :label="1">可以</el-radio>
<el-radio-group v-model="ruleForm.useWithOther">
<el-radio :label="0">不可以</el-radio>
<el-radio :label="1">可以</el-radio>
</el-radio-group>
</el-radio-group>
</el-form-item>
<el-form-item label="使用次数限制" prop="name" style="width: 45%;">
<el-form-item label="使用次数限制" prop="limitTotalDay" style="width: 45%;">
<div class="d-s">
<div style="margin: 0px 5px;"></div>
<el-input placeholder="" v-model="ruleForm.limitTotalDay" style="width: 140px">
@ -246,16 +261,20 @@
</div>
<div class="d-s" style="justify-content: space-between">
<el-form-item label="适用时间段" prop="name" style="width: 45%;">
<el-form-item label="适用时间段" style="width: 45%;">
<el-radio-group v-model="ruleForm.availableType">
<el-radio :label="1" style="margin-bottom: 15px">每周 <el-select v-model="ruleForm.availableWeek" multiple placeholder="请选择周日期">
<el-option v-for="item in weekList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select></el-radio>
<el-radio :label="2" style="margin-bottom: 15px">每月 <el-select v-model="ruleForm.availableDay" multiple placeholder="请选择每月固定日期">
<el-option v-for="item in monthList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select></el-radio>
<el-radio :label="1" style="margin-bottom: 15px">每周
<el-select v-model="ruleForm.availableWeek" multiple placeholder="请选择周日期">
<el-option v-for="item in weekList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-radio>
<el-radio :label="2" style="margin-bottom: 15px">每月
<el-select v-model="ruleForm.availableDay" multiple placeholder="请选择每月固定日期">
<el-option v-for="item in monthList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-radio>
</el-radio-group>
@ -284,16 +303,20 @@
</div>
</el-form-item>
<el-form-item label="不适用时间段" prop="name" style="width: 45%;">
<el-form-item label="不适用时间段" style="width: 45%;">
<el-radio-group v-model="ruleForm.unAvailableType">
<el-radio :label="1" style="margin-bottom: 15px">每周 <el-select v-model="ruleForm.unAvailableWeek" multiple placeholder="请选择周日期">
<el-option v-for="item in weekList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select></el-radio >
<el-radio :label="2" style="margin-bottom: 15px">每月 <el-select v-model="ruleForm.unAvailableDay" multiple placeholder="请选择每月固定日期">
<el-option v-for="item in monthList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select></el-radio>
<el-radio :label="1" style="margin-bottom: 15px">每周
<el-select v-model="ruleForm.unAvailableWeek" multiple placeholder="请选择周日期">
<el-option v-for="item in weekList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-radio>
<el-radio :label="2" style="margin-bottom: 15px">每月
<el-select v-model="ruleForm.unAvailableDay" multiple placeholder="请选择每月固定日期">
<el-option v-for="item in monthList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-radio>
</el-radio-group>
@ -324,10 +347,10 @@
</el-form-item>
</div>
<div class="d-s" style="justify-content: space-between">
<el-form-item label="每人领券限制" prop="name" style="width: 45%;">
<el-form-item label="每人领券限制" prop="getNumLimit" style="width: 45%;">
<el-input v-model="ruleForm.getNumLimit" placeholder="请输入内容"></el-input>
</el-form-item>
<el-form-item label="每日领券限制" prop="name" style="width: 45%;">
<el-form-item label="每日领券限制" prop="dayGetLimit" style="width: 45%;">
<el-input v-model="ruleForm.dayGetLimit" placeholder="请输入内容"></el-input>
</el-form-item>
</div>
@ -356,10 +379,10 @@
</el-form-item>
</div>
</el-form>
<span slot="footer" class="dialog-footer">
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button @click="centerDialogVisible = false"> </el-button>
<el-button type="primary" @click="addBlock(ruleForm)">创建</el-button>
</span>
<el-button type="primary" @click="addBlock(ruleForm)">保存</el-button>
</div>
</el-dialog>
</div>
</template>
@ -379,9 +402,12 @@ import {
getsk
} from "@/api/EventMarketing/giftBlock";
import imgUpload from "@/components/ImageUpload/index.vue"
import { getToken } from "@/utils/auth";
import {getToken} from "@/utils/auth";
import imgUpload1 from "@/components/map/imgUpload.vue";
import { Row } from "element-ui";
import {Row} from "element-ui";
import {addCardCoupon, listCardCoupon} from "@/api/EventMarketing/cardCoupon";
import {getOilNameList, oilNumberList} from "@/api/order/oilnumgun";
import {listUserGrade} from "@/api/staff/user/usergrade";
export default {
name: 'index',
@ -415,135 +441,135 @@ export default {
twolist: [],
threelist: [],
orderShow: false,
weekList:[
weekList: [
{
label:"周一",
value:"1"
label: "周一",
value: "1"
},
{
label:"周二",
value:"2"
label: "周二",
value: "2"
},
{
label:"周三",
value:"3"
label: "周三",
value: "3"
},
{
label:"周四",
value:"4"
label: "周四",
value: "4"
},
{
label:"周五",
value:"5"
label: "周五",
value: "5"
}, {
label:"周六",
value:"6"
label: "周六",
value: "6"
}, {
label:"周天",
value:"7"
label: "周天",
value: "7"
}
],
monthList:[
monthList: [
{
label:"每月1号",
value:"01"
label: "每月1号",
value: "01"
},
{
label:"每月2号",
value:"02"
label: "每月2号",
value: "02"
},
{
label:"每月3号",
value:"03"
label: "每月3号",
value: "03"
},
{
label:"每月4号",
value:"04"
label: "每月4号",
value: "04"
},
{
label:"每月5号",
value:"05"
label: "每月5号",
value: "05"
}, {
label:"每月6号",
value:"06"
label: "每月6号",
value: "06"
}, {
label:"每月7号",
value:"07"
label: "每月7号",
value: "07"
}, {
label:"每月8号",
value:"08"
label: "每月8号",
value: "08"
}, {
label:"每月9号",
value:"09"
label: "每月9号",
value: "09"
}, {
label:"每月10号",
value:"10"
label: "每月10号",
value: "10"
}, {
label:"每月11号",
value:"11"
label: "每月11号",
value: "11"
}, {
label:"每月12号",
value:"12"
label: "每月12号",
value: "12"
}, {
label:"每月13号",
value:"13"
label: "每月13号",
value: "13"
}, {
label:"每月14号",
value:"14"
label: "每月14号",
value: "14"
}, {
label:"每月15号",
value:"15"
label: "每月15号",
value: "15"
}, {
label:"每月16号",
value:"16"
label: "每月16号",
value: "16"
}, {
label:"每月17号",
value:"17"
label: "每月17号",
value: "17"
}, {
label:"每月18号",
value:"18"
label: "每月18号",
value: "18"
}, {
label:"每月19号",
value:"19"
label: "每月19号",
value: "19"
}, {
label:"每月20号",
value:"20"
label: "每月20号",
value: "20"
}, {
label:"每月21号",
value:"21"
label: "每月21号",
value: "21"
}, {
label:"每月22号",
value:"22"
label: "每月22号",
value: "22"
}, {
label:"每月23号",
value:"23"
label: "每月23号",
value: "23"
}, {
label:"每月24号",
value:"24"
label: "每月24号",
value: "24"
}, {
label:"每月25号",
value:"25"
label: "每月25号",
value: "25"
}, {
label:"每月26号",
value:"26"
label: "每月26号",
value: "26"
}, {
label:"每月27号",
value:"27"
label: "每月27号",
value: "27"
}, {
label:"每月28号",
value:"28"
label: "每月28号",
value: "28"
}, {
label:"每月29号",
value:"29"
label: "每月29号",
value: "29"
}
, {
label:"每月30号",
value:"30"
label: "每月30号",
value: "30"
}
, {
label:"每月31号",
value:"31"
label: "每月31号",
value: "31"
}
],
@ -580,6 +606,7 @@ export default {
value: '1',
label: '未激活'
},],
value1: '',
options: [
{
value: '1',
@ -608,9 +635,11 @@ export default {
name: '王小虎',
address: '上海市普陀区金沙江路 1516 弄'
}],
oilNumberList:[],
oilNameList:[],
ruleForm: {
name:'',
number:'',
name: '',
number: '',
status: '',
quantity: '',
cardAmount: '',
@ -627,7 +656,7 @@ export default {
dayGetLimit: 0,
getNumLimit: 0,
useCondition: "",
validityDay:30
validityDay: 30
},
membership: [
@ -650,7 +679,7 @@ export default {
],
rules: {
name: [
{ required: true, message: '此为必填项', trigger: 'blur' },
{required: true, message: '此为必填项', trigger: 'blur'},
],
@ -662,11 +691,48 @@ export default {
this.getlist()
this.gettj()
},
created() {
this.getOilList()
this.listUserGrade()
},
components: {
imgUpload1,
imgUpload,
},
methods: {
listUserGrade() {
listUserGrade({page:1,pageSize:1000}).then(res => {
if (res.code == 200) {
this.membership = res.data.records
}
})
},
getOilList(){
getOilNameList().then(response => {
this.oilNameList = response.data;
})
oilNumberList().then(response => {
this.oilNumberList = response.data.records;
})
},
getOilNamess(list, id) {
let name = ""
if (list != null && list != "") {
list.forEach(item => {
if (item.id == id) {
name = item.oilName;
}
})
}
return name;
},
handleClose(done) {
// this.$confirm('')
// .then(_ => {
done();
// })
// .catch(_ => {});
},
Typeindex(index) {
this.tindex = index
},
@ -757,10 +823,14 @@ export default {
})
this.queryParams.pageNo = this.pageNo
this.queryParams.pageSize = this.pageSize
getList(this.queryParams).then(res => {
listCardCoupon(this.queryParams).then(res => {
this.tableData = res.data.records
this.total = res.data.total;
})
// getList(this.queryParams).then(res => {
// this.tableData = res.data.records
// this.total = res.data.total;
// })
},
//
remindOpen(row) {
@ -864,7 +934,8 @@ export default {
let data = this.ruleForm
console.log(data);
addList(data).then(res => {
// addList(data).then(res => {
addCardCoupon(data).then(res => {
if (res.code == 200) {
this.$message.success('添加成功');
this.gettj()
@ -873,7 +944,7 @@ export default {
this.$message.error('操作失败请稍后再试');
}
})
.catch().catch(error => {
.catch().catch(error => {
this.$message.error('操作失败请稍后再试');
});
this.centerDialogVisible = false

View File

@ -14,19 +14,19 @@
<div>核心数据</div>
<div style="display: flex;justify-content: space-between">
<div class="san-box">
<div class="r-title">{{ storeTotal.allTotal || 0 }}</div>
<div class="r-title">{{ storeTotal.allAmount || 0 }}</div>
<div class="r-size">总交易金额</div>
</div>
<div class="san-box" style="background: #fc6464">
<div class="r-title">{{ storeTotal.weekTotal || 0 }}</div>
<div class="r-title">{{ storeTotal.allNum || 0 }}</div>
<div class="r-size">总交易笔数</div>
</div>
<div class="san-box" style="background: #fcb12c">
<div class="r-title">{{ storeTotal.monthTotal || 0 }}</div>
<div class="r-title">{{ storeTotal.unitPrice || 0 }}</div>
<div class="r-size">笔均单价/</div>
</div>
<div class="san-box" style="background: #5bc557;">
<div class="r-title">{{ storeTotal.monthTotal || 0 }}</div>
<div class="r-title">{{ storeTotal.userBalance || 0 }}</div>
<div class="r-size">累计会员余额万元</div>
</div>
</div>
@ -58,16 +58,16 @@
@change="getStoreAmount">
</el-date-picker>
</div>
<div style="margin-right: 40px">
<el-select v-model="value" clearable placeholder="请选择" @change="chooseDept()">
<el-option
v-for="item in options"
:key="item.deptId"
:label="item.deptName"
:value="item.deptId">
</el-option>
</el-select>
</div>
<!-- <div style="margin-right: 40px">-->
<!-- <el-select v-model="value" clearable placeholder="请选择" @change="chooseDept()">-->
<!-- <el-option-->
<!-- v-for="item in options"-->
<!-- :key="item.deptId"-->
<!-- :label="item.deptName"-->
<!-- :value="item.deptId">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </div>-->
</div>
<div class="d-s" style="margin-top: 15px">
<div class="k-box">
@ -182,6 +182,7 @@ import {parseTime} from "@/utils/fuint";
import {getBannerListApi} from "@/api/sys/banner";
import {getNotificationlogList} from "@/api/sys/sysNotificationlog";
import {employeeSalesApi} from "@/api/indexStatistics";
import {getTotalAmount} from "@/api/allOrder";
export default {
props:["accountId"],
@ -233,7 +234,7 @@ export default {
let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000)
this.value1 = [parseTime(oneWeekAgo),parseTime(nowDate)]
this.getStoreTotal()
this.selectChildByDeptIdApi()
// this.selectChildByDeptIdApi()
this.getStoreAmount()
this.selectBannerList()
let start = new Date();
@ -268,7 +269,7 @@ export default {
})
},
getNoticeList(){
getNotificationlogList({pageNo: 1, pageSize: 4,sentTo:this.accountId}).then(res => {
getNotificationlogList({pageNo: 1, pageSize: 4}).then(res => {
this.noticeList = res.data.records
})
},
@ -297,11 +298,12 @@ export default {
})
this.getStoreAmount()
},
// banner
selectBannerList(){
let queryParams = {
pageNo:1,
pageSize:10,
system_position:"系统首页",
systemPosition:"首页",
bannerStatus:true
}
getBannerListApi(queryParams).then(res=>{
@ -314,8 +316,9 @@ export default {
this.options = res.data
})
},
//
getStoreTotal(){
storeTotalIndex().then(res => {
getTotalAmount().then(res => {
this.storeTotal = res.data
})
},

View File

@ -255,7 +255,7 @@ export default {
},
methods:{
goRoute(){
this.$router.push("system/notify/page/getNotify")
this.$router.push("system/notify/index")
},
getNoticeList(){
getNotificationlogList({pageNo: 1, pageSize: 4,sentTo:this.accountId}).then(res => {
@ -309,7 +309,7 @@ export default {
let queryParams = {
pageNo:1,
pageSize:10,
system_position:"系统首页",
systemPosition:"系统首页",
bannerStatus:true
}
getBannerListApi(queryParams).then(res=>{

View File

@ -43,7 +43,7 @@
<div class="right-box">
<div class="title_">
<div>通知中心</div>
<div style="font-size: 12px;color: #BBBBBB;display: flex;align-items: center">更多 <i class="el-icon-arrow-right"></i> </div>
<div style="font-size: 12px;color: #BBBBBB;display: flex;align-items: center" @click="goRoute">更多 <i class="el-icon-arrow-right"></i> </div>
</div>
<!-- <div class="hang_" v-for="(item,index) in 4" :key="index" >到期提醒百业兴智慧油站系统将于2024年07月10日到期...</div>-->
<div class="hang_" v-for="(item,index) in noticeList" :key="index" >{{ item.notificationType }}{{ item.templateContent }}</div>
@ -263,6 +263,9 @@ export default {
// this.initChart()
},
methods:{
goRoute(){
this.$router.push("system/notify/index")
},
getNoticeList(){
getNotificationlogList({pageNo: 1, pageSize: 4,sentTo:this.accountId}).then(res => {
this.noticeList = res.data.records
@ -324,7 +327,7 @@ export default {
let queryParams = {
pageNo:1,
pageSize:10,
system_position:"系统首页",
systemPosition:"系统首页",
bannerStatus:true
}
getBannerListApi(queryParams).then(res=>{

View File

@ -274,7 +274,7 @@ export default {
let queryParams = {
pageNo:1,
pageSize:10,
system_position:"系统首页",
systemPosition:"系统首页",
bannerStatus:true
}
getBannerListApi(queryParams).then(res=>{

View File

@ -181,6 +181,7 @@ public class PaymentRuleConfigServiceImpl extends ServiceImpl<PaymentRuleConfigM
PaymentRuleConfig paymentRuleConfig1 = baseMapper.selectOne(queryWrapper1);
for (PaymentRuleConfig paymentRuleConfig : list) {
if (ObjectUtil.isNotEmpty(paymentRuleConfig.getStartTime()) && paymentRuleConfig.getStartTime().before(new Date())
&& ObjectUtil.isNotEmpty(paymentRuleConfig1.getUpdateTime())
&& paymentRuleConfig.getStartTime().before(paymentRuleConfig1.getUpdateTime())) {
int i = 1;
if (paymentRuleConfig.getRuleType().equals("1")){

View File

@ -287,5 +287,8 @@ public class AllOrderInfoController extends BaseController {
return getSuccessResult(allOrderInfoService.getHandoverByOrderNo(allOrderInfo));
}
@GetMapping("getTotalAmount")
public ResponseObject getTotalAmount(){
return getSuccessResult(allOrderInfoService.getTotalAmount());
}
}

View File

@ -88,4 +88,5 @@ public interface AllOrderInfoMapper extends BaseMapper<AllOrderInfo> {
AllOrderInfoVo getPaymentChannelData(Integer storeId);
IPage<AllOrderInfoVo> runningWaterByInstituion2(Page page,@Param("order") AllOrderInfoDto allOrderInfo);
}

View File

@ -726,7 +726,7 @@
group by content
</select>
<!-- <where>-->
<!-- <where>-->
<!-- store_id = #{order.storeId}-->
<!-- <if test="order.params.beginTime != null and order.params.beginTime != ''">&lt;!&ndash; 开始时间检索 &ndash;&gt;-->
<!-- and date_format(create_time,'%y%m%d') &gt;= date_format(#{order.params.beginTime},'%y%m%d')-->

View File

@ -131,4 +131,23 @@ public interface AllOrderInfoService {
Map<String,Object> getAmount1(AllOrderInfoVo allOrderInfoVo);
Double selectAmount(Map<String,String> map, Integer storeId,List<String> types);
/**
* 根据条件查询订单总金额和订单数量
* @param allOrderInfo
* @return
*/
Map<String,Object> getSumAndNum(AllOrderInfo allOrderInfo,Map<String,String> map1);
/**
* 油站首页核心数据
* @return
*/
Map<String ,Object> getTotalAmount();
/**
* 油站首页数据看板
* @return
*/
Map<String ,Object> getDataBoard(Map<String,String> map);
}

View File

@ -1566,6 +1566,73 @@ public class AllOrderInfoServiceImpl extends ServiceImpl<AllOrderInfoMapper,AllO
return payMoney;
}
@Override
public Map<String, Object> getSumAndNum(AllOrderInfo allOrderInfo,Map<String,String> map1) {
String startTime = map1.get("startTime");
String endTime = map1.get("endTime");
Map<String, Object> map = new HashMap<>();
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("status","paid");
queryWrapper.eq("store_id",TokenUtil.getNowAccountInfo().getStoreId());
if (ObjectUtil.isNotEmpty(allOrderInfo.getType())){
queryWrapper.eq("type",allOrderInfo.getType());
}
if (ObjectUtil.isNotEmpty(startTime) && ObjectUtil.isNotEmpty(endTime)){
queryWrapper.apply(true,"create_time BETWEEN '" + startTime + "' and '" + endTime + "'");
}
Integer allNum = baseMapper.selectCount(queryWrapper);
queryWrapper.select("SUM(pay_money) as payMoney");
AllOrderInfo allOrderInfo1 = baseMapper.selectOne(queryWrapper);
Double payMoney = 0.0;
if (ObjectUtil.isNotEmpty(allOrderInfo1) && ObjectUtil.isNotEmpty(allOrderInfo1.getPayMoney())){
payMoney = allOrderInfo1.getPayMoney();
}
map.put("payMoney",payMoney);
map.put("allNum",allNum);
return map;
}
@Override
public Map<String, Object> getTotalAmount() {
Map<String, Object> map = new HashMap<>();
// 总交易金额
Double allAmount = 0.0;
// 总交易笔数
Integer allNum = 0;
// 笔均单价
Double unitPrice = 0.0;
// 累计会员余额
Double userBalance = 0.0;
Map<String, Object> sumAndNum = getSumAndNum(new AllOrderInfo(),new HashMap<>());
allAmount = Double.valueOf(sumAndNum.get("payMoney").toString());
allNum = Integer.valueOf(sumAndNum.get("allNum").toString());
BigDecimal bd = BigDecimal.valueOf(allAmount/allNum).setScale(2, RoundingMode.HALF_UP);
unitPrice = bd.doubleValue();
userBalance = userBalanceService.selectAllBalance(TokenUtil.getNowAccountInfo().getStoreId());
map.put("allAmount",allAmount);
map.put("allNum",allNum);
map.put("unitPrice",unitPrice);
map.put("userBalance",userBalance);
return map;
}
@Override
public Map<String, Object> getDataBoard(Map<String, String> map) {
Map<String, Object> map1 = new HashMap<>();
// 油品销售金额
// 油品交易笔数
// 会员充值金额
// 会员充值笔数
// 便利店销售金额
// 交易笔数
// 积分商城销售金额
// 兑换笔数
// 非油品交易占比
return map1;
}
private long dayCount(String beginTimeStr, String endTimeStr ) {
// 将字符串表示的时间转换成 LocalDate 对象