Merge remote-tracking branch 'origin/master'

This commit is contained in:
齐天大圣 2023-11-21 09:45:37 +08:00
commit 3c916cb22b
31 changed files with 1207 additions and 202 deletions

View File

@ -17,6 +17,15 @@ export function addList(data) {
})
}
export function mmc(id) {
return request({
url: 'business/marketingActivity/cardValue/selectById/'+id,
method: 'get',
})
}
export function listUserGrade(data) {
return request({
url: '/business/userManager/userGrade/list',

View File

@ -4,6 +4,7 @@
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
<!-- <h1 v-else class="sidebar-title" style="color: #00ff80" >{{ title }} </h1>-->
</router-link>
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo" />

View File

@ -10,7 +10,7 @@
<el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
<template slot="title">
<item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
<item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
</template>
<sidebar-item
v-for="child in item.children"
@ -20,6 +20,7 @@
:base-path="resolvePath(child.path)"
class="nest-menu"
/>
</el-submenu>
</div>
</template>

View File

@ -10,9 +10,9 @@
:default-active="activeMenu"
:collapse="false"
:background-color="settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground"
:text-color="settings.sideTheme === 'theme-dark' ? variables.menuColor : variables.menuLightColor"
text-color="#ffffff"
:unique-opened="true"
:active-text-color="settings.theme"
active-text-color="#409eff"
:collapse-transition="false"
mode="vertical"
style="margin-bottom: 80px;"

View File

@ -83,7 +83,6 @@ export const constantRoutes = [
}
]
},
{
path: '/oilPurchase',
component: Layout,

View File

@ -30,7 +30,6 @@
<span v-if="scope.row.groupOriented == 1">普通群体</span>
<span v-if="scope.row.groupOriented == 2">等级会员</span>
</template>
</el-table-column>
<el-table-column label="活动信息">
<el-table-column
@ -53,8 +52,6 @@
label="赠送成长值"
width="120">
</el-table-column>
</el-table-column>
<el-table-column
prop="activeTime"
@ -176,7 +173,7 @@
</el-radio-group>
</el-form-item>
<el-form-item label="会员等级" prop="region" v-if="form.groupOriented == '2' " >
<el-select v-model="form.membershipLevel" placeholder="请选择会员等级" >
<el-select v-model="form.membershipLevel" placeholder="会员等级" >
<el-option v-for="(item,index) in vipname" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
</el-form-item>
@ -274,39 +271,135 @@
</el-form-item>
</el-form>
<!-- 赠送卡券-->
<div class="box-popup">
<div class="dis-bit"><div>赠送卡券(选填)</div> <el-button type="primary" icon="el-icon-plus" round>添加卡券</el-button> </div>
<el-table
:data="tableDatas"
border
style="width: 100%">
<el-table-column
prop="date"
label="卡券名称"
width="180">
</el-table-column>
<el-table-column
prop="name"
label="券类型"
width="180">
</el-table-column>
<el-table-column
prop="address"
label="券详情">
</el-table-column>
<el-table-column
prop="address"
label="有效期">
</el-table-column>
<el-table-column
prop="address"
label="赠送数量">
</el-table-column>
<el-table-column
prop="address"
label="操作">
</el-table-column>
</el-table>
<!-- 选择优惠券-->
<div class="xh-box" >
<div class="box-bt"> <div >选择优惠券</div> <el-button type="primary" icon="el-icon-plus" @click="getlistFavorable()" >新增</el-button> </div>
<div style="margin: 10px 0px">
<el-table
:data="youhuiquanlist"
border
style="width: 100%">
<el-table-column
prop="giftCardName"
label="卡券名称"
width="0">
</el-table-column>
<el-table-column
prop="giftCardType"
label="券类型"
width="80">
<template slot-scope="scope">
<span v-if="scope.row.giftCardType == 0" >油品券</span>
<span v-if="scope.row.giftCardType == 1" >商品券</span>
<span v-if="scope.row.giftCardType == 2" >通用券</span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="券详情"
width="80">
<template slot-scope="scope">
<span>{{scope.row.giftCardDetail}}</span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="有效期(天)"
width="240">
<template slot-scope="scope">
<span v-if="scope.row.timeType == 0" > <el-input-number v-model="scope.row.validityZero" controls-position="right" :min="1" :max="9999"></el-input-number> </span>
<span v-if="scope.row.timeType == 1" > <el-input-number v-model="scope.row.validityOne" controls-position="right" :min="1" :max="9999"></el-input-number> </span>
<span v-if="scope.row.timeType == 2" > <el-input-number v-model="scope.row.validityTwo" controls-position="right" :min="1" :max="9999"></el-input-number> </span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="数量"
width="240">
<template slot-scope="scope">
<el-input-number v-model="scope.row.giftCardTotal" controls-position="right" :min="1" :max="9999"></el-input-number>
</template>
</el-table-column>
<el-table-column
prop="address"
label="操作">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="deletedata(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
<!-- 选择兑换券-->
<div class="xh-box" >
<div class="box-bt"> <div >选择兑换券</div> <el-button type="primary" icon="el-icon-plus" @click="getlistExchange()" >新增</el-button> </div>
<div style="margin: 10px 0px">
<el-table
:data="duihuanquanlist"
border
style="width: 100%">
<el-table-column
prop="giftCardName"
label="卡券名称"
width="80">
</el-table-column>
<el-table-column
prop="date"
label="券类型"
width="80">
<template slot-scope="scope">
<span v-if="scope.row.giftCardType == 0" >油品券</span>
<span v-if="scope.row.giftCardType == 1" >商品券</span>
<span v-if="scope.row.giftCardType == 2" >通用券</span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="券详情"
width="80">
<template slot-scope="scope">
<span>{{scope.row.giftCardDetail}}</span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="有效期(天)"
width="240">
<template slot-scope="scope">
<span > <el-input-number v-model="scope.row.giftCardTime" controls-position="right" :min="1" :max="9999"></el-input-number> </span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="数量"
width="240">
<template slot-scope="scope">
<el-input-number v-model="scope.row.giftCardTotal" controls-position="right" :min="1" :max="9999"></el-input-number>
</template>
</el-table-column>
<el-table-column
prop="address"
label="操作"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="deletedhdata(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
<!-- 附加特权-->
<div class="box-popup">
@ -315,6 +408,7 @@
type="textarea"
placeholder="请输入内容"
maxlength="225"
v-model="form.fringeBenefit"
show-word-limit
>
</el-input>
@ -327,18 +421,168 @@
</div>
</div>
</el-drawer>
<!-- 弹窗-->
<el-dialog title="优惠券列表" :visible.sync="dialogTableVisible">
<div style="display: flex;align-items: center; margin-bottom: 20px ">
<el-input v-model="youhuiquan.name" placeholder="优惠券名称"></el-input>
<el-button type="primary" icon="el-icon-search" @click="getlistFavorable" >搜索</el-button>
</div>
<el-table
:data="tableDatayh"
border
style="width: 100%">
<el-table-column
prop="name"
label="卡券名称"
width="100">
</el-table-column>
<el-table-column
prop="date"
label="券类型"
width="100">
<template slot-scope="scope">
<span v-if="scope.row.type == 0" >油品券</span>
<span v-if="scope.row.type == 1" >商品券</span>
<span v-if="scope.row.type == 2" >通用券</span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="券详情"
width="100">
<template slot-scope="scope">
<span>{{scope.row.fullDeduction}} {{scope.row.discountAmount}} </span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="有效期(天)"
width="180">
<template slot-scope="scope">
<span v-if="scope.row.timeType == 0" >{{scope.row.validityZero}} </span>
<span v-if="scope.row.timeType == 1" >{{scope.row.validityOne}} </span>
<span v-if="scope.row.timeType == 2" >{{scope.row.validityTwo}} </span>
</template>
</el-table-column>
<el-table-column
prop="address"
label="操作">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="chosedata(scope.row)"
>选择</el-button>
</template>
</el-table-column>
</el-table>
<div><pagination
v-show="ytotal>0"
:total="ytotal"
:page.sync="youhuiquan.pageNum"
:limit.sync="youhuiquan.pageSize"
@pagination="getlistFavorable"
/></div>
</el-dialog>
<!-- 兑换券列表-->
<el-dialog title="兑换券列表" :visible.sync="dialogTableVisibledh">
<div style="display: flex;align-items: center; margin-bottom: 20px ">
<el-input v-model="duihuanquan.name" placeholder="兑换券名称"></el-input>
<el-button type="primary" icon="el-icon-search" @click="getlistExchange" >搜索</el-button>
</div>
<el-table
:data="tableDatadh"
border
style="width: 100%">
<el-table-column
prop="name"
label="卡券名称"
width="100">
</el-table-column>
<el-table-column
prop="date"
label="券类型"
width="100">
<template slot-scope="scope">
<span v-if="scope.row.type == 0" >油品券</span>
<span v-if="scope.row.type == 1" >商品券</span>
<span v-if="scope.row.type == 2" >通用券</span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="使用说明"
width="100">
<template slot-scope="scope">
<span>{{scope.row.useInstructions}}</span>
</template>
</el-table-column>
<el-table-column
prop="date"
label="有效期(天)"
width="180">
<template slot-scope="scope">
<span >{{scope.row.validity}} </span>
</template>
</el-table-column>
<el-table-column
prop="address"
label="操作">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="Favorabledata(scope.row)"
>选择</el-button>
</template>
</el-table-column>
</el-table>
<div><pagination
v-show="dtotal>0"
:total="dtotal"
:page.sync="duihuanquan.pageNum"
:limit.sync="duihuanquan.pageSize"
@pagination="getlistExchange"
/></div>
</el-dialog>
</div>
</template>
<script>
import { getList,addList,eitList,deleteList,listUserGrade } from "@/api/EventMarketing/SaveBlock";
import { getList,addList,eitList,deleteList,listUserGrade,mmc } from "@/api/EventMarketing/SaveBlock";
import {getActiveConsumption, listExchange, listFavorable} from "@/api/EventMarketing/activeConsumption";
export default {
name: 'index',
data(){
return{
pdidlist:[],//id
pddhidlist:[],//id
youhuiquanlist:[],
duihuanquanlist:[],
dialogTableVisible:false,//
dialogTableVisibledh:false,//
tableDatadh:[],//
tableDatayh:[],//
//
youhuiquan:{
name:'',
pageNum: 1,
pageSize: 10,
},
ytotal:0,
//
duihuanquan:{
name:'',
pageNum: 1,
pageSize: 10,
total:0
},
dtotal:0,
isonline: '0',
dialog: false,
rules: {
@ -415,6 +659,8 @@
amountCommission:'',
membershipLevel:'',
percentageCommissions:'',
fringeBenefit:'',
cardValueChildList:[],
},
tableDatas: [],
formLabelWidth: '160px',
@ -433,6 +679,118 @@
this.getlist()
},
methods:{
//
getlistExchange(){
this.tableDatadh = []
listExchange(this.duihuanquan).then(res=>{
if(res.code==200){
this.dialogTableVisibledh = true
this.tableDatadh = res.data.records
this.dtotal = res.data.total
}
})
},
//
getlistFavorable(){
this.tableDatayh = []
listFavorable(this.youhuiquan).then(res=>{
if(res.code == 200){
this.dialogTableVisible = true
this.tableDatayh = res.data.records
this.ytotal = res.data.total
}
})
},
//
Favorabledata(row){
this.dialogTableVisibledh = false
if(this.pddhidlist.indexOf(row.id)>-1 ){
this.$message.error("该兑换卡券已存在")
return
}
this.pddhidlist.push(row.id)
console.log(row)
let data ={
activeGift: 2, // 01 2. 3 4.
goodsIds: "", //id
goodsName:"" , //
goodsTotal: "", //
vouchersId:row.id, //id
giftCardName:row.name, //
giftCardType: row.type, //
validityZero: null,
validityOne: null,
validityTwo:null,
validity:row.validity,
giftCardDetail: row.useInstructions , //
giftCardTime: row.validity, //
giftCardTotal: 1 //
}
this.duihuanquanlist.push(data)
this.$message.success("新增成功")
},
//
chosedata(row){
this.dialogTableVisible = false
if(this.pdidlist.indexOf(row.id)>-1 ){
this.$message.error("该优惠卡券已存在")
return
}
this.pdidlist.push(row.id)
let data ={
activeGift: 1, // 01 2. 3 4.
goodsIds: "", //id
goodsName:"" , //
goodsTotal: "", //
vouchersId:row.id, //id
giftCardName:row.name, //
giftCardType: row.type, //
timeType: row.timeType,
validityZero: row.validityZero,
validityOne: row.validityOne,
validityTwo:row.validityTwo,
giftCardDetail: "满"+ row.fullDeduction+"减 "+row.discountAmount+"元" , //
giftCardTime: "", //
giftCardTotal: 1//
}
this.youhuiquanlist.push(data)
this.$message.success("新增成功")
},
//
deletedata(row){
if(this.youhuiquanlist&&this.youhuiquanlist.length>0){
let delIdx=-1;
for ( let item of this.youhuiquanlist) {
delIdx++;
if (item.id===row.id){
break
}
}
this.pdidlist.splice(delIdx,1);
this.youhuiquanlist.splice(delIdx,1);
}
},
//
deletedhdata(row){
if(this.duihuanquanlist&&this.duihuanquanlist.length>0){
let delIdx=-1;
for ( let item of this.duihuanquanlist) {
delIdx++;
if (item.id===row.id){
break
}
}
this.pddhidlist.splice(delIdx,1);
this.duihuanquanlist.splice(delIdx,1);
}
},
getlist(){
let data = {
@ -445,11 +803,23 @@
this.total = res.data.total;
})
},
handleUpdate(data){
console.log(data)
this.form = data
this.dialog = true
handleUpdate(row) {
this.chongzhi();
const id = row.id || this.ids
mmc(id).then(response => {
this.form = response.data;
this.youhuiquanlist = response.data.cardValueChildList.filter(item => item.activeGift == '1')
this.duihuanquanlist = response.data.cardValueChildList.filter(item => item.activeGift == '2')
this.dialog = true
});
},
// handleUpdate(data){
// console.log(data)
// this.form = data
// this.dialog = true
// },
chongzhi(){
this.form = {
sort:1,
@ -467,9 +837,12 @@
activeTime:'1',
activeStatus:'1',
paymentValue:'1',
cardValueChildList:[],
fringeBenefit:'',
isonline:0
}
console.log('归零')
this.youhuiquanlist =[]
this.duihuanquanlist =[]
},
addblock(){
this.vipname = []
@ -512,7 +885,11 @@
})
},
// this.form.tableDatas = response.data.activeConsumptionChildList.filter(item => item.activeGift == '1')
// this.tableDatas = response.data.activeConsumptionChildList.filter(item => item.activeGift == '2')
submitForm(){
this.form.cardValueChildList = this.youhuiquanlist.concat(this.duihuanquanlist);
if(this.form.id){
eitList(this.form).then(res=>{
if (res.code == 200){
@ -561,6 +938,8 @@
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
padding: 15px;
}
.box-popup{
width: 90%;
@ -573,4 +952,17 @@
justify-content: space-between;
margin-bottom: 15px;
}
.box-bt{
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 18px;
}
.xh-box{
width: 90%;
margin: 10px auto;
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<div class="">
<div class="app-container">
<el-card style="margin-bottom: 20px">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
@ -44,6 +44,12 @@
<el-table v-loading="loading" :data="activeConsumptionList" @selection-change="handleSelectionChange">
<el-table-column
type="index"
align="center"
label="排序"
>
</el-table-column>
<el-table-column label="活动编号" align="center" prop="id" />
<el-table-column label="活动名称" align="center" prop="name" />
@ -137,7 +143,6 @@
<div class="xh-box" v-if="form.activeGift && form.activeGift.indexOf('1')>-1 " >
<div class="box-bt"> <div >赠送卡券</div> <el-button type="primary" icon="el-icon-plus" @click="getlistFavorable()" >新增</el-button> </div>
<div style="margin: 10px 0px">
<el-table
:data="form.tableDatas"
border
@ -305,24 +310,34 @@
</el-table>
</div>
</div>
<el-form-item label="活动开始时间" prop="activeStartTime">
<el-date-picker clearable
v-model="form.activeStartTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择活动开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="活动结束时间" prop="activeEndTime">
<el-date-picker clearable
v-model="form.activeEndTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择活动结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="请选择会员等级" prop="dieselUserLevel" v-if="form.adaptUserType == 2" >
<el-select v-model="form.dieselUserLevel" multiple clearable placeholder="请选择会员等级">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="活动开始时间" prop="activeStartTime">
<el-date-picker clearable
v-model="form.activeStartTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择活动开始时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="活动结束时间" prop="activeEndTime">
<el-date-picker clearable
v-model="form.activeEndTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择活动结束时间">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="会员等级" prop="dieselUserLevel" v-if="form.adaptUserType == 2" >
<el-select v-model="form.dieselUserLevel" multiple clearable placeholder="会员等级">
<el-option :label="item.name" :value="item.id.toString()" v-for="(item,index) in userGradeList" :key="index" > </el-option>
</el-select>
</el-form-item>
@ -621,7 +636,7 @@ export default {
activeStartTime: [
{ required: true, message: '必填项不能为空', trigger: 'blur' },
],
activeEndTime00: [
activeEndTime: [
{ required: true, message: '必填项不能为空', trigger: 'blur' },
],
adaptUserType: [
@ -666,6 +681,9 @@ export default {
this.listUserGrade()
},
methods: {
indexMethod(index) {
return index * 2;
},
/** 查询消费有礼活动列表 */
getList() {
this.loading = true;
@ -1044,5 +1062,6 @@ export default {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 18px;
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<div class="">
<div class="app-container">
<el-card style="margin-bottom: 20px">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="活动名称" prop="name">
@ -43,7 +43,12 @@
</el-row>
<el-table v-loading="loading" :data="activeDiscountList" @selection-change="handleSelectionChange">
<el-table-column
type="index"
align="center"
label="排序"
>
</el-table-column>
<el-table-column label="活动编号" align="center" prop="id" />
<el-table-column label="活动名称" align="center" prop="name" />
<el-table-column label="会员等级" align="center" prop="dieselUserLevel" >
@ -90,7 +95,7 @@
</el-card>
<!-- 添加或修改折扣营销对话框 -->
<el-dialog :title="title" :visible.sync="open" width="45%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="活动名称" prop="name">
<el-input v-model="form.name" placeholder="请输入活动名称" />
</el-form-item>
@ -113,30 +118,42 @@
</div>
</el-form-item>
<el-form-item label="活动开始时间" prop="activeStartTime">
<el-date-picker clearable
v-model="form.activeStartTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择活动开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="活动结束时间" prop="activeEndTime">
<el-date-picker clearable
v-model="form.activeEndTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择活动结束时间">
</el-date-picker>
</el-form-item>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="活动开始时间" prop="activeStartTime">
<el-date-picker clearable
v-model="form.activeStartTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择活动开始时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="活动结束时间" prop="activeEndTime">
<el-date-picker clearable
v-model="form.activeEndTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择活动结束时间">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="可用油品" prop="adaptOil" >
<el-checkbox-group v-model="form.adaptOil">
<el-checkbox v-for="(item,index) in oillist" :label="item.id" :key="index">{{item.oilType}}{{item.oilName}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="请选择会员等级" prop="dieselUserLevel" >
<el-select v-model="form.dieselUserLevel" multiple clearable placeholder="请选择会员等级">
<el-form-item label="会员等级" prop="dieselUserLevel" >
<el-select v-model="form.dieselUserLevel" multiple clearable placeholder="会员等级">
<el-option :label="item.name" :value="item.id.toString()" v-for="(item,index) in userGradeList" :key="index" > </el-option>
</el-select>
</el-form-item>

View File

@ -1,5 +1,5 @@
<template>
<div class="">
<div class="app-container">
<el-card style="margin-bottom: 20px">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="活动名称" prop="name">
@ -43,7 +43,12 @@
</el-row>
<el-table v-loading="loading" :data="activeFullminusList" @selection-change="handleSelectionChange">
<el-table-column
type="index"
align="center"
label="排序"
>
</el-table-column>
<el-table-column label="活动编号" align="center" prop="id" />
<el-table-column label="活动名称" align="center" prop="name" />
<el-table-column label="会员等级" align="center" prop="dieselUserLevel" >
@ -120,29 +125,41 @@
</div>
</el-form-item>
<el-form-item label="活动开始时间" prop="activeStartTime">
<el-date-picker clearable
v-model="form.activeStartTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择活动开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="活动结束时间" prop="activeEndTime">
<el-date-picker clearable
v-model="form.activeEndTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择活动结束时间">
</el-date-picker>
</el-form-item>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="活动开始时间" prop="activeStartTime">
<el-date-picker clearable
v-model="form.activeStartTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择活动开始时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="活动结束时间" prop="activeEndTime">
<el-date-picker clearable
v-model="form.activeEndTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择活动结束时间">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="可用油品" prop="adaptOil" >
<el-checkbox-group v-model="form.adaptOil">
<el-checkbox v-for="(item,index) in oillist" :label="item.id" :key="index">{{item.oilType}}{{item.oilName}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="请选择会员等级" prop="dieselUserLevel" >
<el-select v-model="form.dieselUserLevel" multiple clearable placeholder="请选择会员等级">
<el-form-item label="会员等级" prop="dieselUserLevel" >
<el-select v-model="form.dieselUserLevel" multiple clearable placeholder="会员等级">
<el-option :label="item.name" :value="item.id.toString()" v-for="(item,index) in userGradeList" :key="index" > </el-option>
</el-select>
</el-form-item>

View File

@ -1,5 +1,5 @@
<template>
<div class="">
<div class="app-container">
<el-card style="margin-bottom: 20px">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="活动名称" prop="name">
@ -44,7 +44,12 @@
</el-row>
<el-table v-loading="loading" :data="activeNewlywedsList" @selection-change="handleSelectionChange">
<el-table-column
type="index"
align="center"
label="排序"
>
</el-table-column>
<el-table-column label="活动编号" align="center" prop="id" />
<el-table-column label="活动名称" align="center" prop="name" />
<el-table-column label="活动开始时间" align="center" prop="activeStartTime" width="180">
@ -116,22 +121,28 @@
<el-form-item label="活动名称" prop="name">
<el-input v-model="form.name" placeholder="请输入活动名称" />
</el-form-item>
<el-form-item label="活动开始时间" prop="activeStartTime">
<el-date-picker clearable
v-model="form.activeStartTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择活动开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="活动结束时间" prop="activeEndTime">
<el-date-picker clearable
v-model="form.activeEndTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择活动结束时间">
</el-date-picker>
</el-form-item>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="活动开始时间" prop="activeStartTime">
<el-date-picker clearable
v-model="form.activeStartTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择活动开始时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="活动结束时间" prop="activeEndTime">
<el-date-picker clearable
v-model="form.activeEndTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择活动结束时间">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="有礼奖励" prop="courtesyReward" >
<el-checkbox-group v-model="form.courtesyReward">
@ -813,3 +824,12 @@ export default {
}
};
</script>
<style scoped>
.box-bt{
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 18px;
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<div class="">
<div class="app-container">
<el-card class="box-card">
<div slot="header" class="clearfix">

View File

@ -144,10 +144,6 @@
<!-- 添加或修改优惠券对话框 -->
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<!-- <el-form-item label="是否在线 0在线 1 下线" prop="isonline">-->
<!-- <el-input v-model="form.isonline" placeholder="请输入是否在线 0在线 1 下线" />-->
<!-- </el-form-item>-->
<el-form-item label="优惠券名称" prop="name">
<el-input v-model="form.name" placeholder="请输入优惠券名称" />
</el-form-item>
@ -186,16 +182,36 @@
</el-form-item>
<el-form-item label="生效日期" prop="timeType">
<el-radio-group v-model="form.timeType">
<el-radio label="0">领券后立即生效有效期 <el-input placeholder="有效天数" style="width: 200px" v-model="form.validityZero"><template slot="append"></template></el-input></el-radio>
<el-radio label="1">固定有效周期固定开始日期 <el-date-picker
<!-- 0 -->
<el-radio label="0" style="display: flex;align-items: center" >
<div class="h-box"> <span>领券后立即生效有效期</span> <el-input placeholder="有效天数" style="width: 200px" v-model="form.validityZero">
<template slot="append"></template>
</el-input> </div>
</el-radio>
<!-- 1 -->
<el-radio label="1" style="display: flex;align-items: center" >
<div class="h-box">
<span> 固定有效周期固定开始日期</span>
<el-date-picker
v-model="form.effectiveDate"
type="date"
placeholder="选择日期">
</el-date-picker>
有效期
<el-input placeholder="有效天数" style="width: 200px" v-model="form.validityOne"><template slot="append"></template></el-input>
<span>有效期</span>
<el-input placeholder="有效天数" style="width: 200px" v-model="form.validityOne"><template slot="append"></template></el-input>
</div>
</el-radio>
<el-radio label="2">领券后第 <el-input style="width: 200px" placeholder="1" v-model="form.validityDay"><template slot="append">天生效</template></el-input> <el-input placeholder="" style="width: 200px" v-model="form.validityTwo"><template slot="append"></template></el-input></el-radio>
<!-- 2-->
<el-radio label="2" style="display: flex;align-items: center">
<div class="h-box">
领券后第 <el-input style="width: 200px" placeholder="1" v-model="form.validityDay">
<template slot="append">天生效</template>
</el-input> <el-input placeholder="" style="width: 200px" v-model="form.validityTwo"><template slot="append"></template></el-input>
</div>
</el-radio>
</el-radio-group>
</el-form-item>
@ -287,7 +303,6 @@
<div style="display: flex;align-items: center">
<div class="qr-code" id="qrCode" ref="qrCodeUrl"></div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="centerDialogVisible = false"> </el-button>
<el-button type="primary" @click="centerDialogVisible = false"> </el-button>
@ -442,6 +457,7 @@ export default {
count: null,
qrCodeLink: null,
status: null,
effectiveDateType:'0'
},
tongji:{
id:'',
@ -572,8 +588,8 @@ export default {
storeId: null,
isonline: 0,
name: null,
type: null,
discountType: null,
type: "0",
discountType: "0",
oilType: [],
fullDeduction: null,
discountAmount: null,
@ -709,6 +725,10 @@ export default {
};
</script>
<style scoped>
/deep/.el-radio{
//display: flex !important;
//align-items: center !important;
}
.hui-box{
width: 150px ;
height: 80px;
@ -722,5 +742,12 @@ export default {
font-weight: bold;
margin: 5px 0px;
}
.h-box{
height: 60px;
display: flex;
align-items: center;
}
</style>

View File

@ -1,20 +1,55 @@
<template>
<!-- 活动中心-->
<div class="app-container">
<el-card style="margin-bottom: 20px">
<el-radio-group v-model="value">
<el-radio-button label="1">消费有礼</el-radio-button>
<el-radio-button label="2">折扣营销</el-radio-button>
<el-radio-button label="3">满减营销</el-radio-button>
<el-radio-button label="4">新人有礼</el-radio-button>
<el-radio-button label="5">推荐有礼</el-radio-button>
</el-radio-group>
</el-card>
<activeConsumption v-if="value == 1"></activeConsumption>
<activeDiscount v-if="value == 2"></activeDiscount>
<activeFullminus v-if="value == 3"></activeFullminus>
<activeNewlyweds v-if="value == 4" ></activeNewlyweds>
<activeRecommend v-if="value == 5"></activeRecommend>
<!-- <el-card style="margin-bottom: 20px">-->
<!-- <el-radio-group v-model="value">-->
<!-- <el-radio-button label="1">消费有礼</el-radio-button>-->
<!-- <el-radio-button label="2">折扣营销</el-radio-button>-->
<!-- <el-radio-button label="3">满减营销</el-radio-button>-->
<!-- <el-radio-button label="4">新人有礼</el-radio-button>-->
<!-- <el-radio-button label="5">推荐有礼</el-radio-button>-->
<!-- </el-radio-group>-->
<!-- </el-card>-->
<div class="fji" >
<div class="wrap-box" @click="gobox(1)" >
<img src="../../../assets/images/xfyl.png" style="width: 260px;height: 260px;margin: 0 auto " >
<div class="bottom-box">
<div>消费有礼</div>
</div>
</div>
<div class="wrap-box" @click="gobox(2)" >
<img src="../../../assets/images/zkyx.png" style="width: 260px;height: 260px;margin: 0 auto " >
<div class="bottom-box">
<div>折扣营销</div>
</div>
</div>
<div class="wrap-box" @click="gobox(3)" >
<img src="../../../assets/images/mjyx.png" style="width: 260px;height: 260px;margin: 0 auto " >
<div class="bottom-box">
<div>满减营销</div>
</div>
</div>
<div class="wrap-box" @click="gobox(4)" >
<img src="../../../assets/images/xryl.png" style="width: 260px;height: 260px;margin: 0 auto " >
<div class="bottom-box">
<div>新人有礼</div>
</div>
</div>
<div class="wrap-box" @click="gobox(5)" >
<img src="../../../assets/images/tjyl.png" style="width: 260px;height: 260px;margin: 0 auto " >
<div class="bottom-box">
<div>推荐有礼</div>
</div>
</div>
</div>
<!-- <activeConsumption v-if="value == 1"></activeConsumption>-->
<!-- <activeDiscount v-if="value == 2"></activeDiscount>-->
<!-- <activeFullminus v-if="value == 3"></activeFullminus>-->
<!-- <activeNewlyweds v-if="value == 4" ></activeNewlyweds>-->
<!-- <activeRecommend v-if="value == 5"></activeRecommend>-->
<!-- 添加或修改兑换券对话框 -->
</div>
</template>
@ -41,7 +76,23 @@ export default {
},
methods: {
gobox(id){
if(id == 1){
this.$router.push('/EventMarketing/activeConsumption/index')
}
if(id == 2){
this.$router.push('/EventMarketing/activeDiscount/index')
}
if(id == 3){
this.$router.push('/EventMarketing/activeFullminus/index')
}
if(id == 4){
this.$router.push('/EventMarketing/activeNewlyweds/index')
}
if(id == 5){
this.$router.push('/EventMarketing/activeRecommend/index')
}
},
}
}
@ -49,9 +100,30 @@ export default {
<style scoped lang="scss">
.app-container{
width: 100%;
height: 100%;
height: 100vh;
}
.qr-code{
margin: 0px auto;
}
.wrap-box{
width: 260px;
text-align: center;
background: #FFFFFF;
border-radius: 8px;
overflow: hidden;
box-shadow: 0px 2px 4px rgb(31 30 47 / 10%);
margin-right: 15px;
cursor: pointer;
}
.fji{
display: flex;
flex-wrap: wrap;
}
.bottom-box{
box-sizing: border-box;
padding: 0px 15px;
font-size: 18px;
font-weight: bold;
padding-bottom: 15px;
}
</style>

View File

@ -10,7 +10,6 @@
name: 'index',
data(){
return{
queryParams:{
name:""
},

View File

@ -549,7 +549,7 @@ export default {
{ required: true, message: "会员名称不能为空", trigger: "blur" },
{ min: 2, max: 200, message: '会员名称长度必须介于2 和 100 之间', trigger: 'blur' }
],
gradeId: [{ required: true, message: "请选择会员等级", trigger: "blur" }],
gradeId: [{ required: true, message: "会员等级", trigger: "blur" }],
mobile: [
{ required: true, message: "请输入手机号", trigger: "blur" },
],

View File

@ -549,7 +549,7 @@ export default {
{ required: true, message: "请选择优惠类型", trigger: "blur" },
],
status: [
{ required: true, message: "请选择会员等级状态", trigger: "blur" },
{ required: true, message: "会员等级状态", trigger: "blur" },
],
discount: [
{ required: true, message: "请输入支付折扣", trigger: "blur" },

View File

@ -165,10 +165,10 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
MaxoutVO maxoutVO = new MaxoutVO();
BeanUtils.copyProperties(activeFullminus,maxoutVO);
LambdaQueryWrapper<ActiveDiscountChild> queryWrappers = new LambdaQueryWrapper<>();
queryWrappers.eq(ActiveDiscountChild::getActiveDiscountId,activeFullminus.getId());
queryWrappers.eq(ActiveDiscountChild::getActiveFullminusId,activeFullminus.getId());
//判断符合金额
queryWrappers.le(ActiveDiscountChild::getAmount,transferDTO.getOilPrice() * transferDTO.getOilLiters());
queryWrappers.orderByDesc(ActiveDiscountChild::getCreateTime);
queryWrappers.orderByDesc(ActiveDiscountChild::getAmount);
maxoutVO.setActiveDiscountChildList(activeDiscountChildService.list(queryWrappers));
maxoutVOArrayList.add(maxoutVO);
}
@ -192,7 +192,7 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
queryWrappers.eq(ActiveDiscountChild::getActiveDiscountId,activeDiscount.getId());
//判断符合金额
queryWrappers.le(ActiveDiscountChild::getAmount,transferDTO.getOilPrice() * transferDTO.getOilLiters());
queryWrappers.orderByDesc(ActiveDiscountChild::getCreateTime);
queryWrappers.orderByDesc(ActiveDiscountChild::getAmount);
maxoutVO.setActiveDiscountChildList(activeDiscountChildService.list(queryWrappers));
maxoutVOArrayList.add(maxoutVO);
}

View File

@ -64,7 +64,7 @@ public class HangBillController extends BaseController {
* @return
*/
@PostMapping
public ResponseObject add(@Validated @RequestBody HangBill hangBill){
public ResponseObject add(@Validated @RequestBody HangBillVo hangBill){
return getSuccessResult(hangBillService.insertHangBill(hangBill));
}

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuint.business.order.mapper.HangBillMapper">
<sql id="selectHangBill">
select hb.*,ms.real_name,ms.mobile,cu.unit_name,cu.person_credit,cu.contact_mobile
select hb.*,ms.real_name,ms.mobile,cu.unit_name,cu.person_credit,cu.contact_mobile,cu.credit_limit
from hang_bill hb
inner join mt_staff ms on hb.staff_id = ms.id
inner join credit_unit cu on hb.credit_unit_id = cu.id

View File

@ -15,10 +15,23 @@ public interface CreditUnitService extends IService<CreditUnit> {
*/
public List<CreditUnit> selectCreditUnitList();
/**
* 根据id查询挂账单位信息
* @return
*/
public CreditUnit selectCreditUnitListById(int id);
/**
* 添加挂账单位信息
* @param creditUnit
* @return
*/
public int insertCreditUnit(CreditUnit creditUnit);
/**
* 修改挂账单位信息
* @param creditUnit
* @return
*/
public int updateCreditUnit(CreditUnit creditUnit);
}

View File

@ -46,7 +46,7 @@ public interface HangBillService extends IService<HangBill> {
* @param hangBill
* @return
*/
public int insertHangBill(HangBill hangBill);
public int insertHangBill(HangBillVo hangBill);
/**
* 修改挂账记录 并收款

View File

@ -19,9 +19,21 @@ public class CreditUnitServiceImpl extends ServiceImpl<CreditUnitMapper, CreditU
return list;
}
@Override
public CreditUnit selectCreditUnitListById(int id) {
CreditUnit creditUnit = baseMapper.selectById(id);
return creditUnit;
}
@Override
public int insertCreditUnit(CreditUnit creditUnit) {
int row = baseMapper.insert(creditUnit);
return row;
}
@Override
public int updateCreditUnit(CreditUnit creditUnit) {
int row = baseMapper.updateById(creditUnit);
return row;
}
}

View File

@ -11,8 +11,10 @@ import com.fuint.api.fuyou.entity.MerchantConfig;
import com.fuint.api.fuyou.service.FyPayService;
import com.fuint.api.fuyou.service.MerchantConfigService;
import com.fuint.api.fuyou.service.OilConfigService;
import com.fuint.business.order.entity.CreditUnit;
import com.fuint.business.order.entity.HangBill;
import com.fuint.business.order.mapper.HangBillMapper;
import com.fuint.business.order.service.CreditUnitService;
import com.fuint.business.order.service.HangBillService;
import com.fuint.business.order.vo.HangBillVo;
import com.fuint.common.dto.AccountInfo;
@ -28,6 +30,9 @@ import java.util.*;
*/
@Service
public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> implements HangBillService {
@Autowired
private CreditUnitService creditUnitService;
@Override
public IPage<HangBillVo> selectHangBillList(Page page, HangBillVo hangBill) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
@ -60,9 +65,25 @@ public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> i
}
@Override
public int insertHangBill(HangBill hangBill) {
public int insertHangBill(HangBillVo hangBillVo) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
// 根据挂账单位id查询挂账单位信息
CreditUnit creditUnit = creditUnitService.selectCreditUnitListById(hangBillVo.getCreditUnitId());
// 挂账单位限额的数据删减
if (creditUnit.getCreditLimit()!=0){
Double creditLimit = creditUnit.getCreditLimit();
// 判断修改之后的挂账单位限额金额是否小于0
if (creditLimit-hangBillVo.getAmount()>=0){
creditUnit.setCreditLimit(creditLimit-hangBillVo.getAmount());
creditUnitService.updateCreditUnit(creditUnit);
}else {
return 0;
}
}
// 创建挂账记录对象
HangBill hangBill = new HangBill();
hangBill.setStoreId(storeId);
// 根据日期生成订单号
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
@ -70,10 +91,17 @@ public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> i
String randomString = UUID.randomUUID().toString().replace("-","").substring(0,6);
String orderNo = timestamp+randomString;
Integer staffId = nowAccountInfo.getStaffId();
hangBill.setStaffId(staffId);
hangBill.setOrderNo(orderNo);
hangBill.setOutstandAmount(hangBill.getAmount());
hangBill.setOutstandAmount(hangBillVo.getAmount());
hangBill.setRepaidAmount(0.0);
hangBill.setCreditUnitId(hangBillVo.getCreditUnitId());
hangBill.setStatus("0");
hangBill.setReturnType("0");
hangBill.setAmount(hangBillVo.getAmount());
hangBill.setRemark(hangBillVo.getRemark());
hangBill.setPayStatus("unpaid");
int row = baseMapper.insert(hangBill);
return row;
}
@ -96,6 +124,14 @@ public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> i
if (payType.equals("CASH")){
hangBill.setPayStatus("paid");
}
// 根据挂账单位id查询挂账单位信息
CreditUnit creditUnit = creditUnitService.selectCreditUnitListById(hangBill.getCreditUnitId());
if (creditUnit.getCreditLimit()!=0){
Double creditLimit = creditUnit.getCreditLimit();
creditUnit.setCreditLimit(creditLimit+Double.valueOf(map.get("repaidAmount")));
}
int row = 0;
hangBill.setRemark(map.get("remark"));
// 支付成功后修改挂账信息
@ -114,6 +150,8 @@ public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> i
}else {
hangBill.setStatus("2");
}
// 修改挂账单位余额信息
creditUnitService.updateCreditUnit(creditUnit);
}
row = baseMapper.updateById(hangBill);
return baseMapper.selectById(Integer.parseInt(map.get("id")));
@ -127,6 +165,7 @@ public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> i
for (JSONObject jsonObject : jsonObjects) {
// 现将需要修改的支付状态改为未支付
HangBill hangBill1 = baseMapper.selectById((Integer) jsonObject.get("id"));
hangBill1.setPayStatus("unpaid");
baseMapper.updateById(hangBill1);
HangBill hangBill = baseMapper.selectById((Integer) jsonObject.get("id"));
@ -196,6 +235,14 @@ public class HangBillServiceImpl extends ServiceImpl<HangBillMapper, HangBill> i
}else {
hangBill.setStatus("2");
}
// 根据挂账单位id查询挂账单位信息
CreditUnit creditUnit = creditUnitService.selectCreditUnitListById(hangBill.getCreditUnitId());
if (creditUnit.getCreditLimit()!=0){
Double creditLimit = creditUnit.getCreditLimit();
creditUnit.setCreditLimit(creditLimit+repaidAmount1);
}
// 修改挂账单位余额信息
creditUnitService.updateCreditUnit(creditUnit);
return hangBill;
}
}

View File

@ -15,4 +15,6 @@ public class HangBillVo extends HangBill {
private String personCredit;
// 联系电话
private String contactMobile;
// 挂账额度
private String creditLimit;
}

View File

@ -358,7 +358,7 @@ export default {
{ required: true, message: "会员名称不能为空", trigger: "blur" },
{ min: 2, max: 200, message: '会员名称长度必须介于2 和 100 之间', trigger: 'blur' }
],
gradeId: [{ required: true, message: "请选择会员等级", trigger: "blur" }]
gradeId: [{ required: true, message: "会员等级", trigger: "blur" }]
}
};
},

View File

@ -1,6 +1,6 @@
import request from '@/utils/request'
// 扫码支付接口
// 优惠活动信息
export function selectPreferential(data) {
return request({
url: '/business/marketingActivity/activeExchange/selectConsumptionList',

View File

@ -75,7 +75,7 @@ export default {
this.couponList = response.data.records;
this.total = response.data.total
if( response.data.total == 0){
this.$message.error("未找到兑换券")
}else{
}
@ -98,9 +98,6 @@ export default {
this.getList()
}
})
}).catch(() => {
this.$message({
type: 'info',

View File

@ -270,6 +270,11 @@
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
</el-form-item>
</el-form>
<div>
<el-tag style="width: 100%;height: 40px;line-height: 40px;padding-left: 30px" type="info">
当前挂账为普通挂账方式,如需挂账油品交易等信息的账目,请前往收银台挂账
</el-tag>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="open = false"> </el-button>
<el-button type="primary" @click="addHangbill"> </el-button>
@ -825,9 +830,13 @@ import {getDicts} from "@/api/dict/data";
_this.form2.repaidAmount = _this.payAmount;
_this.form2.authCode = _this.authCode;
editHangBill(this.form2).then(response => {
if (response.data.payStatus == 'paid'){
_this.isPaySuccess = true;
_this.isPay = false;
if (response.data==null){
}else {
if (response.data.payStatus == 'paid'){
_this.isPaySuccess = true;
_this.isPay = false;
}
}
})
_this.loading = true;

View File

@ -61,12 +61,13 @@
trigger="click">
<div>
<el-checkbox-group v-model="checkedCities1" @change="handleCheckedCitiesChange1">
<el-checkbox v-for="city in cities1" :label="city" :key="city">
<el-checkbox v-for="(item,index) in fullReduceDiscount" :label="item.type" :key="index">
<div style="display: flex;justify-content: space-between;height: 40px;line-height: 40px;">
<div style="width: 200px">{{city}}</div>
<div style="width: 200px">{{item.type}}</div>
<div style="line-height: 20px;width:150px;font-size: 12px;text-align: right">
<div style="color: red">-1.56</div>
<div style="color: grey">满100元每升优惠0.2</div>
<div style="color: red">-{{ fullReduction }}</div>
<div style="color: grey" v-if="item.discount!=0">{{ item.full }}{{ item.discount }}</div>
<div style="color: grey" v-else>{{ item.full }}{{ item.reduce }}</div>
</div>
</div>
</el-checkbox>
@ -232,6 +233,9 @@
:value="item.dictValue">
<span @click="payMethod(item.dictValue)">{{ item.dictLabel }}</span>
</div>
<div class="wrap-box" >
<span @click="addCredits">挂账</span>
</div>
</div>
<div class="center-left-bottom">
<div>
@ -665,12 +669,125 @@
</el-table>
</div>
</el-dialog>
<!-- 新增挂账信息-->
<el-dialog
title="挂账" width="700px"
:visible.sync="dialogVisibleCredit"
:close-on-click-modal="false">
<el-form ref="form" :model="form1" :rules="rules" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item label="挂账单位" prop="unitName" style="width: 420px">
<el-autocomplete
popper-class="my-autocomplete"
v-model="form1.unitName"
style="width: 180%"
:fetch-suggestions="querySearch1"
placeholder="请选择挂账单位"
@select="changeUnit">
<template slot-scope="{ item }">
<div style="display: flex;justify-content: space-between">
{{item.unitName}}{{item.personCredit}} {{item.contactMobile}}
</div>
</template>
<el-button slot="append" @click="open1 = true">新增挂账单位</el-button>
</el-autocomplete>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="可用额度" prop="creditLimit">
<el-input v-model="form1.creditLimit" placeholder="请先选择挂账单位" disabled>
<template slot="append"></template>
</el-input>
<span style="font-size: 12px;color: grey;">
可用额度为挂账人的最大可用额度,如挂账金额大于可用额度,将无法进行挂账,0为不限额
</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="挂账金额" prop="amount">
<el-input v-model="form1.amount" placeholder="请输入挂账金额" maxlength="30" >
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注信息" prop="remark">
<el-input v-model="form1.remark" type="textarea" placeholder="请输入内容"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisibleCredit = false"> </el-button>
<el-button type="primary" @click="addHangbill"> </el-button>
</span>
</el-dialog>
<!-- 新增挂账单位信息-->
<el-dialog title="新增挂账单位" :visible.sync="open1" width="700px" append-to-body>
<el-form ref="formName" :model="form2" :rules="rules1" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item label="挂账单位" prop="unitName">
<el-input v-model="form2.unitName" show-word-limit placeholder="请输入挂账单位名称" maxlength="50" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="负责人" prop="personCredit">
<el-input v-model="form2.personCredit" show-word-limit placeholder="请输入挂账单位负责人姓名" maxlength="10" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="联系电话" prop="contactMobile">
<el-input v-model="form2.contactMobile" show-word-limit placeholder="请输入挂账单位联系电话" maxlength="15" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="挂账额度" prop="creditLimit">
<el-input v-model="form2.creditLimit" placeholder="请输入挂账额度为0则不限额" maxlength="30">
<template slot="append"></template>
</el-input>
<span style="font-size: 12px;color: grey;">
0为不限额,额度为当前单位最大可挂账金额,如已挂账金额归还,额度将也同步返还
</span>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注信息" prop="remark">
<el-input v-model="form2.remark" type="textarea" placeholder="请输入内容"></el-input>
</el-form-item>
<el-row>
<el-col :span="24">
<el-form-item label="单位状态" prop="status">
<el-radio-group v-model="form2.status">
<el-radio label="qy" value="qy">启用</el-radio>
<el-radio label="jy" value="jy">禁用</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="open1 = false"> </el-button>
<el-button type="primary" @click="addCredit"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {getDicts} from "@/api/dict/data";
import {getOilNameList, getOilNumGun, getOilNumGunById, listOilNumGun} from "@/api/cashier/oilnumgun";
import {getOilNameList, getOilNumGun, listOilNumGun} from "@/api/cashier/oilnumgun";
import {listgoods} from "@/api/cashier/ljgoods";
import {getUserVoMobile, getUserVoName} from "@/api/cashier/user";
import {queryStaffs, staffInfo} from "@/api/cashier/staff";
@ -679,6 +796,9 @@
import {getOilGun} from "@/api/cashier/oilGuns";
import {listCardFavorableRecord} from "@/api/cashier/cardfavorablerecord";
import {getOilNumberById} from "@/api/cashier/oilnumber";
import {selectPreferential} from "@/api/cashier/preferential";
import {addHangBill} from "@/api/cashier/hangbill";
import {addCreditUnit, listCreditUnit} from "@/api/cashier/creditunit";
const cityOptions = ['上海', '北京'];
export default {
@ -688,8 +808,9 @@
//
checkAll1: false,
isIndeterminate1: true,
checkedCities1: ['上海'],
checkedCities1: [],
cities1: cityOptions,
fullReduceDiscount: [],
//
checkAll2: false,
isIndeterminate2: true,
@ -777,6 +898,15 @@
goods:"",
select:"元",
form:{ amount : 0 },
form1:{},
form2:{
unitName:"",
personCredit:"",
contactMobile:"",
creditLimit:0,
remark:'',
status:'qy',
},
oilNumGunList:[],
authCode:'',
//
@ -795,6 +925,8 @@
dialogRegistration:false,
dialogSuccess:false,
dialogTakeOrder:false,
dialogVisibleCredit:false,
open1:false,
activeName: '1',
tabarr:[
{name:'收银台',icon:'el-icon-s-platform'},
@ -891,6 +1023,30 @@
isSure:true,
//
couponAmount:0,
//
preferentialData:{
userId:"",
storeId:"",
gradeId:"",
oilName:"",
oilPrice:"",
oilLiters:"",
},
//
unitList:[],
//
rules: {
unitName: [ { required: true, message: "请选择挂账单位", trigger: "blur" }, ],
amount: [{ required: true, message: "请输入挂账金额", trigger: "blur" }],
creditLimit: [{ required: true, message: "可用额度不可为空", trigger: "blur" }],
},
rules1: {
unitName: [ { required: true, message: "请填写挂账单位名称", trigger: "blur" }, ],
personCredit: [{ required: true, message: "请填写挂账单位负责人姓名", trigger: "blur" }],
contactMobile: [ { required: true, message: "请填写挂账单位联系电话", trigger: "blur" }, ],
creditLimit: [ { required: true, message: "请填写挂账额度", trigger: "blur" }, ],
status: [ { required: true, message: "请选择挂账单位状态", trigger: "blur" }, ],
},
}
},
created() {
@ -901,8 +1057,92 @@
this.getStaff();
this.getList();
this.getCouponList();
this.getUnitList();
},
methods:{
//
addCredits(){
this.dialogVisibleCredit = true
this.form1.amount = this.oilAmount + this.goodsAmount
},
//
getUnitList(){
let obj = {};
let _this = this;
listCreditUnit().then( response => {
response.data.forEach(item => {
obj = item;
obj.value = `${item.unitName}${item.personCredit} ${item.contactMobile}`
_this.unitList.push(obj)
})
})
},
//
addCredit(){
this.$refs["formName"].validate((valid) => {
if (valid) {
addCreditUnit(this.form2).then( response => {
this.$modal.msgSuccess("挂账单位信息创建成功");
this.open1 = false;
this.getUnitList();
})
}else {
return false;
}
})
},
//
addHangbill(){
this.$refs["form"].validate((valid) => {
if (valid) {
addHangBill(this.form1).then( response => {
if (response.data==0){
this.$modal.msgError("挂账单位可用额度不足,无法进行挂账");
}else {
this.$modal.msgSuccess("挂账记录添加成功");
this.dialogVisibleCredit = false;
this.resetMember();
this.resetting();
this.empty();
}
})
}else {
return false;
}
})
},
//
changeUnit(val){
this.form1.creditUnitId = val.id;
this.form1.creditLimit = val.creditLimit
return val.id
},
querySearch1(queryString, cb) {
let _this = this;
let obj = {};
let results = _this.unitList
if (queryString != "" && queryString!=undefined){
results = [];
_this.unitList.forEach(item => {
if (item.unitName.includes(queryString)){
obj = item;
obj.value = `${item.unitName}${item.personCredit} ${item.contactMobile}`
results.push(obj)
}
if (item.personCredit.includes(queryString)){
obj = item;
obj.value = `${item.unitName}${item.personCredit} ${item.contactMobile}`
results.push(obj)
}
if (item.contactMobile.includes(queryString)){
obj = item;
obj.value = `${item.unitName}${item.personCredit} ${item.contactMobile}`
results.push(obj)
}
})
}
cb(results);
},
//
changeSeekZero(){
this.seekZero = this.authCode - this.oilActualPay - this.goodsActualPay
@ -920,13 +1160,17 @@
},
//
handleCheckAllChange1(val) {
this.checkedCities1 = val ? cityOptions : [];
let list = []
this.fullReduceDiscount.forEach(item => {
list.push(item.type)
})
this.checkedCities1 = val ? list : [];
this.isIndeterminate1 = false;
},
handleCheckedCitiesChange1(value) {
let checkedCount = value.length;
this.checkAll1 = checkedCount === this.cities1.length;
this.isIndeterminate1 = checkedCount > 0 && checkedCount < this.cities1.length;
this.checkAll1 = checkedCount === this.fullReduceDiscount.length;
this.isIndeterminate1 = checkedCount > 0 && checkedCount < this.fullReduceDiscount.length;
},
handleCheckAllChange2(val) {
let list = []
@ -1041,7 +1285,7 @@
this.isSure = true;
this.handleChange();
},
//
//
getGrade(id){
let _this = this;
this.oilDiscount = 0;
@ -1080,6 +1324,7 @@
}
if (discount.reduce!=0){
_this.gradeDiscount.push(discount)
_this.checkedCities2 = ['满减优惠']
}
gasolineDiscount += +oilDiscount
}else if (response.data.gasolineDiscount=="每升优惠"){
@ -1107,6 +1352,7 @@
}
if (discount.reduce!=0){
_this.gradeDiscount.push(discount)
_this.checkedCities2 = ['每升优惠']
}
gasolineDiscount += +oilDiscount
}else {
@ -1172,6 +1418,7 @@
}
if (discount.reduce!=0){
_this.gradeDiscount.push(discount)
_this.checkedCities2 = ['每升优惠']
}
dieselDiscount += +oilDiscount
}else {
@ -1208,6 +1455,7 @@
}
if (discount.reduce!=0){
_this.gradeDiscount.push(discount)
_this.checkedCities2 = ['满减优惠']
}
naturalGasDiscount += +oilDiscount
}else if (response.data.naturalGasDiscount=="每单位优惠"){
@ -1235,6 +1483,7 @@
}
if (discount.reduce!=0){
_this.gradeDiscount.push(discount)
_this.checkedCities2 = ['每单位优惠']
}
naturalGasDiscount += +oilDiscount
}else {
@ -1271,23 +1520,114 @@
this.getGrade(data.gradeId)
this.changeRefuelMoney();
this.handleChange();
this.preferentialData.storeId = data.storeId;
this.preferentialData.userId = data.id;
this.preferentialData.gradeId = data.gradeId;
if (this.oilOrder.length>0){
// this.oilOrder.forEach(item => {
// this.preferentialData.oilName = item.oilName;
// this.preferentialData.oilPrice = item.oilPrice;
// this.preferentialData.oilLiters = item.liters;
// })
this.preferential();
}
},
//
preferential(){
let _this = this;
// _this.fullReduction = 0;
let fullReduction = 0;
let oilActualPay = _this.oilActualPay
_this.fullReduction = 0;
_this.oilOrder.forEach(item1 => {
_this.preferentialData.oilName = item1.oilName;
_this.preferentialData.oilPrice = item1.oilPrice;
_this.preferentialData.oilLiters = item1.liters;
selectPreferential(_this.preferentialData).then( response => {
if (response.data.length>0){
response.data.forEach(item => {
let discount = {type:item.name,full:0,reduce:0,discount:0}
let activeList = item.activeDiscountChildList;
for (let i = 1;i<=activeList.length;i++){
if (activeList.length>0){
if (activeList[0].discount != null){
//
if (item1.amount>=activeList[0].amount){
discount.full = activeList[0].amount;
discount.discount = activeList[0].discount;
fullReduction = item1.amount - item1.amount * (activeList[0].discount / 10);
}else {
fullReduction = 0
}
}else {
//
if (item1.amount>=activeList[0].amount){
discount.full = activeList[0].amount;
discount.reduce = activeList[0].deductionAmount;
fullReduction = activeList[0].deductionAmount;
}else {
fullReduction = 0
}
}
}else {
_this.fullReduction = 0;
_this.oilActualPay = oilActualPay - _this.oilDiscount - _this.fullReduction - _this.balance
}
}
if (discount.reduce!=0 || discount.discount!=0){
_this.fullReduceDiscount.push(discount)
_this.checkedCities1 = [item.name]
}
})
}
_this.fullReduction += +fullReduction
_this.oilActualPay = oilActualPay - _this.oilDiscount - _this.fullReduction - _this.balance
})
})
// selectPreferential(data).then( response => {
// _this.oilOrder.forEach(item1 => {
// if (response.data.length>0){
// response.data.forEach(item => {
// let discount = {type:item.name,full:0,reduce:0,discount:0}
// let activeList = item.activeDiscountChildList;
// for (let i = 1;i<=activeList.length;i++){
// if (activeList.length>0){
// if (activeList[0].discount != null){
// //
// if (item1.amount>=activeList[0].amount){
// discount.full = activeList[0].amount;
// discount.discount = activeList[0].discount;
// fullReduction = item1.amount - item1.amount * (activeList[0].discount / 10);
// }else {
// fullReduction = 0
// }
// }else {
// //
// if (item1.amount>=activeList[0].amount){
// discount.full = activeList[0].amount;
// discount.reduce = activeList[0].deductionAmount;
// fullReduction = activeList[0].deductionAmount;
// }else {
// fullReduction = 0
// }
// }
// }
// }
// if (discount.reduce!=0 || discount.discount!=0){
// _this.fullReduceDiscount.push(discount)
// _this.checkedCities1 = [item.name]
// }
// })
// }
// _this.fullReduction += +fullReduction
// })
// let oilActualPay = _this.oilActualPay
// _this.oilActualPay = oilActualPay - _this.oilDiscount - _this.fullReduction
// })
},
// 使
queryCoupon(list,id){
// let result = false;
// list.forEach(item => {
// if (item.mtUserId==id){
// let startTime = item.startTime;
// let endTime = item.endTime;
// let date = new Date();
// let sysDate = `${date.getFullYear()}-${date.getMonth() - 1}-${date.getDate()}`
// }
// })
},
//
handleChoose(data){
@ -1367,7 +1707,7 @@
this.isPay = true
this.dialogVisiblej = true
},
//
//
resetting(){
this.oilOrder = [];
this.oilActualPay = 0;
@ -1376,7 +1716,10 @@
this.oilDiscount = 0;
this.consumeAmount = 0;
this.consumeRefuelMoney = 0;
this.refuelMoney = JSON.parse(this.member.refuelMoney)
this.fullReduction = 0;
if (this.member.refuelMoney!=null){
this.refuelMoney = JSON.parse(this.member.refuelMoney)
}
this.amount = 0;
},
//
@ -1391,7 +1734,8 @@
this.form.oilType = this.oilType;
//
if (this.select == "元"){
this.form.liters = (this.form.amount/this.form.oilPrice).toFixed(2)
let num = this.form.amount/this.form.oilPrice
this.form.liters = (Math.ceil(num*100)/100).toFixed(2)
}else {
this.form.liters = this.form.amount
this.form.amount = this.form.oilPrice * this.form.amount
@ -1424,6 +1768,14 @@
if (this.isMember){
this.getGrade(this.member.gradeId)
this.changeRefuelMoney();
if (this.oilOrder.length>0){
// this.oilOrder.forEach(item => {
// this.preferentialData.oilName = item.oilName;
// this.preferentialData.oilPrice = item.oilPrice;
// this.preferentialData.oilLiters = item.liters;
// })
this.preferential();
}
}
},
//

View File

@ -358,7 +358,7 @@ export default {
{ required: true, message: "会员名称不能为空", trigger: "blur" },
{ min: 2, max: 200, message: '会员名称长度必须介于2 和 100 之间', trigger: 'blur' }
],
gradeId: [{ required: true, message: "请选择会员等级", trigger: "blur" }]
gradeId: [{ required: true, message: "会员等级", trigger: "blur" }]
}
};
},

View File

@ -608,7 +608,7 @@
{ required: true, message: "会员名称不能为空", trigger: "blur" },
{ min: 2, max: 200, message: '会员名称长度必须介于2 和 100 之间', trigger: 'blur' }
],
gradeId: [{ required: true, message: "请选择会员等级", trigger: "blur" }],
gradeId: [{ required: true, message: "会员等级", trigger: "blur" }],
mobile: [
{ required: true, message: "请输入手机号", trigger: "blur" },
],