Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
1088d21953
@ -9,10 +9,11 @@ export function listOilConfig() {
|
||||
}
|
||||
|
||||
// 是否开启支付规则
|
||||
export function isOpenOilConfig(isOpen) {
|
||||
export function isOpenOilConfig(data) {
|
||||
return request({
|
||||
url: '/api/oilConfig/'+isOpen,
|
||||
method: 'get',
|
||||
url: '/api/oilConfig/isOpen',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -85,12 +85,12 @@
|
||||
<span v-if="scope.row.timeType == 2" >领券后第{{ scope.row.validityDay}}天生效</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="生效时间" align="center" prop="effectiveDateType" >
|
||||
<!-- <el-table-column label="生效时间" align="center" prop="effectiveDateType" >
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.effectiveDateType == 0" >领取时间</span>
|
||||
<span v-if="scope.row.effectiveDateType == 1" >指定{{scope.row. effectiveDateStart}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>-->
|
||||
<el-table-column label="发放数量" align="center" prop="count" />
|
||||
<el-table-column label="满足金额" align="center" prop="satisfiedAmount" />
|
||||
<el-table-column label="二维码链接" align="center" prop="qrCodeLink" >
|
||||
@ -218,20 +218,20 @@
|
||||
<!-- <el-form-item label="满减金额" prop="fullDeduction">-->
|
||||
<!-- <el-input v-model="form.fullDeduction" placeholder="请输入满减金额" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="生效时间" prop="effectiveDateType">
|
||||
<!-- <el-form-item label="生效时间" prop="effectiveDateType">
|
||||
<el-radio-group v-model="form.effectiveDateType">
|
||||
<el-radio label="0">领取时间</el-radio>
|
||||
<el-radio label="1">指定时间</el-radio>
|
||||
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="生效时间" v-if="form.effectiveDateType == 1" prop="effectiveDateStart">
|
||||
</el-form-item>-->
|
||||
<!-- <el-form-item label="生效时间" v-if="form.effectiveDateType == 1" prop="effectiveDateStart">
|
||||
<el-time-picker
|
||||
arrow-control
|
||||
v-model="form.effectiveDateStart"
|
||||
placeholder="任意时间点">
|
||||
</el-time-picker>
|
||||
</el-form-item>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="可用时段" prop="availablePeriod">
|
||||
<el-checkbox-group v-model="form.availablePeriod" size="mini" >
|
||||
<el-checkbox-button v-for="city in cities" :label="city" :key="city">{{city}}</el-checkbox-button>
|
||||
|
@ -48,7 +48,7 @@
|
||||
<el-button type="primary" v-if="state=='await'" :disabled="saveFlag" @click="save()">保存</el-button>
|
||||
<el-button type="success" v-if="state=='await'" :disabled="auditFlag" @click="audit()">保存并审核</el-button>
|
||||
<el-button type="success" v-if="state=='ysh'" :disabled="storageFlag" @click="storage">退货处理库存</el-button>
|
||||
<el-button type="warning" v-if="state =='await' || state=='ysh'" :disabled="voidFlag" @click="abolition()">作废</el-button>
|
||||
<el-button type="warning" v-if="state !='await' || state=='ysh'" :disabled="voidFlag" @click="abolition()">作废</el-button>
|
||||
<el-button type="warning" v-if="state !='await'" @click="exportExcel()">导出</el-button>
|
||||
|
||||
</div>
|
||||
|
@ -49,7 +49,7 @@
|
||||
<el-button type="primary" v-if="state=='await'" :disabled="saveFlag" @click="save()">保存</el-button>
|
||||
<el-button type="success" v-if="state=='await'" :disabled="auditFlag" @click="audit()">生成差异单</el-button>
|
||||
<el-button type="success" v-if="state=='ysh'" :disabled="storageFlag" @click="storage">退货处理库存</el-button>
|
||||
<el-button type="warning" v-if="state =='await' || state=='ysh'" :disabled="voidFlag" @click="abolition()">作废</el-button>
|
||||
<el-button type="warning" v-if="state !='await' || state=='ysh'" :disabled="voidFlag" @click="abolition()">作废</el-button>
|
||||
<el-button type="warning" v-if="state !='await'" @click="exportExcel()">导出</el-button>
|
||||
|
||||
</div>
|
||||
|
@ -73,7 +73,7 @@
|
||||
<el-tag v-if ="scope.row.approvalStatus == 'await'" size="medium">待审核</el-tag>
|
||||
<el-tag v-if ="scope.row.approvalStatus == 'qrts'" type="success" size="medium">已审核入库</el-tag>
|
||||
<el-tag v-if ="scope.row.approvalStatus == 'yzf'" type="danger" size="medium">已作废</el-tag>
|
||||
<el-tag v-if ="scope.row.approvalStatus == 'ysh'" type="danger" size="medium">已审核</el-tag>
|
||||
<el-tag v-if ="scope.row.approvalStatus == 'ysh'" type="success" size="medium">已审核</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -246,6 +246,8 @@ export default {
|
||||
// 重置
|
||||
resetQuery() {
|
||||
this.queryParams = {}
|
||||
this.getList();
|
||||
|
||||
},
|
||||
// 删除
|
||||
handleDel(data) {
|
||||
|
@ -50,7 +50,7 @@
|
||||
<el-button type="primary" v-if="state=='await'" :disabled="saveFlag" @click="save()">保存</el-button>
|
||||
<el-button type="success" v-if="state=='await'" :disabled="auditFlag" @click="audit">保存并审核</el-button>
|
||||
<el-button type="success" v-if="state=='ysh'" :disabled=" storageFlag" @click="storage()">进货并入库</el-button>
|
||||
<el-button type="warning" v-if="state =='await' || state=='ysh'" :disabled="voidFlag" @click="abolition()">作废</el-button>
|
||||
<el-button type="warning" v-if="state =='!await' || state=='ysh'" :disabled="voidFlag" @click="abolition()">作废</el-button>
|
||||
<el-button type="warning" v-if="state !='await'" @click="exportExcel()">导出</el-button>
|
||||
</div>
|
||||
|
||||
|
@ -123,10 +123,15 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="姓名" align="center" prop="name" />
|
||||
<el-table-column label="车牌号" align="center" prop="carNumber"/>
|
||||
<el-table-column label="车牌号" align="center" prop="carNumber">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.carNumber ? scope.row.carNumber:"--"}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="认证资料" align="center" prop="attestationData">
|
||||
<template slot-scope="scope">
|
||||
<!-- <p v-for="(item,index) in scope.row.imgUrlList" :key="index">{{item.imageUrl1}}</p>-->
|
||||
<span v-if="scope.row.imgUrlList==null || scope.row.imgUrlList==''">--</span>
|
||||
<span v-for="(item,index) in scope.row.imgUrlList" :key="index">
|
||||
<img v-if="item.imageUrl1" :src="'/dev-api'+item.imageUrl1" class="attImg">
|
||||
<img v-if="item.imageUrl2" :src="'/dev-api'+item.imageUrl2" class="attImg">
|
||||
@ -134,7 +139,11 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark"/>
|
||||
<el-table-column label="备注" align="center" prop="remark">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.remark ? scope.row.remark:"--"}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.rzzt" :value="scope.row.status"/>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<el-card >
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="来源油站" prop="storeIds">
|
||||
<el-select v-model="storeIds" filterable clearable placeholder="来源油站" style="width: 100%;">
|
||||
<el-select v-model="queryParams.storeId" filterable clearable placeholder="来源油站" style="width: 100%;">
|
||||
<el-option v-for="item in storeList" :key="item.id+''" :label="item.name" :value="item.id+''"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -623,7 +623,9 @@ export default {
|
||||
resetQuery() {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.queryParams.storeIds = '';
|
||||
this.queryParams.storeId = '';
|
||||
this.queryParams.official = "";
|
||||
this.ifBalance = ""
|
||||
this.storeIds = [];
|
||||
this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order);
|
||||
this.handleQuery();
|
||||
|
@ -320,7 +320,7 @@
|
||||
</el-col>
|
||||
|
||||
<el-col :span="22">
|
||||
|
||||
|
||||
<div v-if="cardValueList.length>0" style="display: flex;margin: 13px 5px;box-sizing: border-box;flex-wrap: wrap; ">
|
||||
<div class="mon"
|
||||
v-for="(item,index) in cardValueList" :key="index"
|
||||
@ -359,7 +359,7 @@
|
||||
<span class="bom">赠送金额 仅自定义金额模式下可手动输入赠送、活动充值赠送金额不可手动更改</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="jine">
|
||||
<div class="zeng">赠送积分</div>
|
||||
<div>
|
||||
@ -433,7 +433,7 @@
|
||||
<div style="display: flex">
|
||||
<div style="width: 7%;line-height: 40px">油品类型</div>
|
||||
<el-radio-group v-model="tabOilType" style="margin-bottom: 30px;">
|
||||
<el-radio-button v-for="item,index in oilTypeList" :label="item.oilType" @click.native="tabOilTypeClick(item.status)">{{ item.type }}</el-radio-button>
|
||||
<el-radio-button v-for="(item,index) in oilTypeList" :label="item.oilType" @click.native="tabOilTypeClick(item.status)">{{ item.type }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</el-col>
|
||||
@ -467,14 +467,14 @@
|
||||
<span class="bom">升数卡充值不支持自定义积分,选择对应充值活动获得对应积分[需开启积分活动有效]</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div style="display:flex;margin-left: 20px">
|
||||
<div style="display:flex;margin-left: 20px">
|
||||
<div style="line-height: 40px;width: 20%">提成员工</div>
|
||||
<div>
|
||||
<el-input :readonly="true" placeholder="请选择提成员工" v-model="cardFuelDieselForm.realName">
|
||||
<el-button slot="append" @click="chooseStaff">选择员工</el-button>
|
||||
</el-input>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -519,9 +519,9 @@
|
||||
</el-dialog>
|
||||
<!-- 确认充值-->
|
||||
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openConfirm" width="500px" append-to-body>
|
||||
<div v-if="isPay == true"
|
||||
<div v-if="isPay"
|
||||
v-loading="loading">
|
||||
|
||||
|
||||
<div style="text-align: center;font-size: 15px;font-weight: bold">付款金额</div>
|
||||
<div style="text-align: center;font-size: 30px;font-weight: bold;color: red;margin: 10px 0">
|
||||
¥{{ realyPayBills }}
|
||||
@ -833,7 +833,7 @@ export default {
|
||||
cardValueList:[],
|
||||
cardValueForm: {
|
||||
cardValueId:'', // 储值卡id
|
||||
mtStaffId: '', //
|
||||
mtStaffId: '', //
|
||||
realName: '',
|
||||
staffMobile: '',
|
||||
amount:'', // 自定义充值字段
|
||||
@ -859,7 +859,7 @@ export default {
|
||||
staffMobile: '',
|
||||
points:'',
|
||||
remark:'',
|
||||
rechargeBalance:'', //实际支付
|
||||
rechargeBalance:'', //实际支付
|
||||
paymentType:'',
|
||||
oilType:'',
|
||||
type:'',
|
||||
@ -873,7 +873,7 @@ export default {
|
||||
|
||||
realyPayBills:0,
|
||||
|
||||
|
||||
|
||||
oilTypeList: {},
|
||||
|
||||
isPay:true,
|
||||
@ -1021,7 +1021,11 @@ export default {
|
||||
},
|
||||
|
||||
valueAmoutChange(data) {
|
||||
if(data == '' || data == null) {
|
||||
data = 0
|
||||
this.cardValueForm.amount = 0
|
||||
|
||||
}
|
||||
|
||||
this.cardValueForm.points = ''
|
||||
this.cardValueForm.bidBalance =''
|
||||
@ -1105,6 +1109,15 @@ export default {
|
||||
this.cardValueForm.staffMobile= data.staffMobile
|
||||
|
||||
},
|
||||
refStaff() {
|
||||
this.cardFuelDieselForm.mtStaffId= ''
|
||||
this.cardFuelDieselForm.realName= ''
|
||||
this.cardFuelDieselForm.staffMobile= ''
|
||||
|
||||
this.cardValueForm.mtStaffId= ''
|
||||
this.cardValueForm.realName= ''
|
||||
this.cardValueForm.staffMobile= ''
|
||||
},
|
||||
// 查询参加存油卡油品
|
||||
getCountOilType() {
|
||||
getCountOilTypeApi().then(res => {
|
||||
@ -1172,8 +1185,12 @@ export default {
|
||||
|
||||
this.realyPayBills = this.cardFuelDieselForm.rechargeBalance
|
||||
}
|
||||
this.isPay = true
|
||||
this.openConfirm = true;
|
||||
this.isPay = true
|
||||
|
||||
console.log("11111",this.isPay)
|
||||
// this.isPaySuccess=false
|
||||
|
||||
this.title = this.payment
|
||||
},
|
||||
// 支付方式
|
||||
@ -1230,8 +1247,9 @@ export default {
|
||||
this.cardValueForm.giftBalance = 0
|
||||
this.cardValueForm.growthValue = 0
|
||||
this.cardValueForm.bidBalance = 0
|
||||
|
||||
// this.cardValueForm.bidBalance = 1
|
||||
// this.cardValueForm.amount = 0
|
||||
this.cardValueForm.amount = 0
|
||||
|
||||
}else {
|
||||
let file={}
|
||||
@ -1283,7 +1301,7 @@ export default {
|
||||
},
|
||||
|
||||
async collection(){
|
||||
|
||||
|
||||
let userForm = this.form
|
||||
|
||||
if (this.flag === 1) {
|
||||
@ -1307,7 +1325,7 @@ export default {
|
||||
}
|
||||
});
|
||||
let this_ = this
|
||||
|
||||
//
|
||||
let timer = setInterval(async () => {
|
||||
getCheckTheStatusOfYourPaymentApi(id).then(response => {
|
||||
if (response.data!=null){
|
||||
@ -1331,10 +1349,12 @@ export default {
|
||||
this_.loading = false;
|
||||
this_.isPay = false;
|
||||
clearInterval(timer);
|
||||
clearTimeout(timer3);
|
||||
|
||||
}
|
||||
},500)
|
||||
|
||||
setTimeout(function (){
|
||||
var timer3 = setTimeout(function (){
|
||||
clearInterval(timer2);
|
||||
clearInterval(timer);
|
||||
this_.loading = false;
|
||||
@ -1411,17 +1431,19 @@ export default {
|
||||
|
||||
// 关闭支付窗口
|
||||
handClose(){
|
||||
this.isPay = true;
|
||||
this.isPay=true,
|
||||
this.isPaySuccess=false,
|
||||
this.isQuery=true,
|
||||
this.openConfirm = false
|
||||
this.openRecharge = false
|
||||
|
||||
this.isPaySuccess = false;
|
||||
|
||||
// this.isPaySuccess = false;
|
||||
this.authCode = null
|
||||
this.activeRecharge='balance',
|
||||
|
||||
this.cardValueForm = {}
|
||||
this.cardFuelDieselForm = {}
|
||||
},
|
||||
},
|
||||
|
||||
// 提交按钮
|
||||
submitForm: function() {
|
||||
@ -1456,7 +1478,7 @@ export default {
|
||||
this.isPay = true;
|
||||
this.openConfirm = false
|
||||
this.openRecharge = false
|
||||
|
||||
|
||||
this.isPaySuccess = false;
|
||||
this.authCode = null
|
||||
this.activeRecharge='balance',
|
||||
@ -1469,6 +1491,7 @@ export default {
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
// console.log(tab, event);
|
||||
this.refStaff()
|
||||
this.realyPayBills = 0
|
||||
},
|
||||
handleChange(value) {
|
||||
|
@ -144,7 +144,7 @@ import {cleanTankApi} from "@/api/oilConfig/oilTank";
|
||||
},
|
||||
rules: {
|
||||
gunName: [
|
||||
{ required: true, message: '请输入油罐名称', trigger: 'blur' },
|
||||
{ required: true, message: '请输入油枪名称', trigger: 'blur' },
|
||||
],
|
||||
|
||||
tankId: [
|
||||
|
@ -54,9 +54,9 @@
|
||||
|
||||
<div style="display: flex;align-items: center">
|
||||
<div class="mingc">规则周期</div>
|
||||
<el-radio-group v-model="labelPosition" size="small">
|
||||
<el-radio-button label="left">永久</el-radio-button>
|
||||
<el-radio-button label="right">单日</el-radio-button>
|
||||
<el-radio-group v-model="labelPosition" @input="ruleCycle == labelPosition" size="small">
|
||||
<el-radio-button label="permanent">永久</el-radio-button>
|
||||
<el-radio-button label="singleDay">单日</el-radio-button>
|
||||
</el-radio-group>
|
||||
<div class="mingc">功能状态</div>
|
||||
<el-switch
|
||||
@ -79,8 +79,8 @@
|
||||
<!-- <div> 交易满 </div>-->
|
||||
<div> 交易占比 </div>
|
||||
<div class="jiaong"> {{ item.proportion }} </div>
|
||||
<div> %更换支付通道 参与次数 </div>
|
||||
<div class="jiaong"> 不固定次数 </div>
|
||||
<div style="margin-right: 20px"> %更换支付通道 </div>
|
||||
<!-- <div class="jiaong"> 参与次数不固定次数 </div>-->
|
||||
|
||||
<el-button type="primary" icon="el-icon-edit" @click="editOilConfig(item.id)">编辑</el-button>
|
||||
<el-button type="danger" icon="el-icon-close" @click="deleteOilConfig(item.id)">删除</el-button>
|
||||
@ -101,7 +101,9 @@
|
||||
<!-- </div>-->
|
||||
<div class="hsize">注:规则按照顺序进行处理并自动更换支付通道,新增或变更规则后需要发布当前规则才生效,发布生效后的规则将从序号1的配置生效</div>
|
||||
|
||||
<el-dialog title="编辑通道规则" :visible.sync="dialogFormVisible">
|
||||
<!-- 编辑通道规则-->
|
||||
<el-dialog title="编辑通道规则" :visible.sync="dialogFormVisible"
|
||||
width="30%">
|
||||
<el-form :model="form" ref="form">
|
||||
|
||||
<el-form-item label="支付通道" :label-width="formLabelWidth" width="300px">
|
||||
@ -116,24 +118,24 @@
|
||||
<el-form-item label="商户号" :label-width="formLabelWidth">
|
||||
<el-input v-model="form.mchntCd" disabled autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="消费满笔数" :label-width="formLabelWidth">
|
||||
<el-form-item label="交易占比" :label-width="formLabelWidth">
|
||||
<el-input v-model="form.proportion" autocomplete="off">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
<div>消费笔数满足后切换到下一个支付通道</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="参与次数" :label-width="formLabelWidth">
|
||||
<el-radio-group v-model="form.resource" >
|
||||
<el-radio label="不固定次数"></el-radio>
|
||||
<el-radio label="固定次数"></el-radio>
|
||||
</el-radio-group>
|
||||
<div>是否限制当前配置在生效期间内的参与次数</div>
|
||||
<div>交易占比满足规则后切换到下一个支付通道</div>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="参与次数" :label-width="formLabelWidth">-->
|
||||
<!-- <el-radio-group v-model="form.resource" >-->
|
||||
<!-- <el-radio label="不固定次数"></el-radio>-->
|
||||
<!-- <el-radio label="固定次数"></el-radio>-->
|
||||
<!-- </el-radio-group>-->
|
||||
<!-- <div>是否限制当前配置在生效期间内的参与次数</div>-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
<el-form-item label="排序" :label-width="formLabelWidth">
|
||||
<el-input-number v-model="form.num" controls-position="right" :min="1" :max="100"></el-input-number>
|
||||
<div>数值越大顺序越在前</div>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="排序" :label-width="formLabelWidth">-->
|
||||
<!-- <el-input-number v-model="form.num" controls-position="right" :min="1" :max="100"></el-input-number>-->
|
||||
<!-- <div>数值越大顺序越在前</div>-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
|
||||
</el-form>
|
||||
@ -168,6 +170,8 @@ export default {
|
||||
merchantList:[],
|
||||
// 商品规则配置信息
|
||||
oilConfigList:[],
|
||||
// 规则周期
|
||||
ruleCycle:"singleDay",
|
||||
form: {
|
||||
name: '',
|
||||
region: '',
|
||||
@ -179,11 +183,11 @@ export default {
|
||||
resource: '',
|
||||
desc: ''
|
||||
},
|
||||
formLabelWidth: '120px',
|
||||
formLabelWidth: '70px',
|
||||
dialogFormVisible:false,
|
||||
value:false,
|
||||
value1:true,
|
||||
labelPosition: 'right',
|
||||
labelPosition: 'singleDay',
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@ -197,12 +201,15 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
delOilConfig(id).then( response => {})
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '规则数据删除成功'
|
||||
});
|
||||
this.getList();
|
||||
delOilConfig(id).then( response => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '规则数据删除成功'
|
||||
});
|
||||
this.getList();
|
||||
this.value1 = true;
|
||||
this.changeStatus1();
|
||||
})
|
||||
}).catch(() => {});
|
||||
},
|
||||
// 添加商户信息
|
||||
@ -270,20 +277,50 @@ export default {
|
||||
// 修改启用状态
|
||||
changeStatus(){
|
||||
if (this.value){
|
||||
this.value1 = false;
|
||||
isOpenOilConfig(1).then( response => {})
|
||||
isOpenOilConfig({isOpen:1,ruleCycle:this.ruleCycle}).then( response => {
|
||||
if (response.data!=1){
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '支付通道切换失败,请确保交易占比相加满足百分之百'
|
||||
});
|
||||
this.value = false;
|
||||
this.value1 = true;
|
||||
}else {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '发布成功!'
|
||||
});
|
||||
this.value1 = false;
|
||||
}
|
||||
})
|
||||
}else {
|
||||
this.value1 = true;
|
||||
isOpenOilConfig(0).then( response => {})
|
||||
isOpenOilConfig({isOpen:0,ruleCycle:this.ruleCycle}).then( response => {
|
||||
this.value1 = true;
|
||||
})
|
||||
}
|
||||
},
|
||||
changeStatus1(){
|
||||
if (this.value1){
|
||||
this.value = false;
|
||||
isOpenOilConfig(0).then( response => {})
|
||||
isOpenOilConfig({isOpen:0,ruleCycle:this.ruleCycle}).then( response => {
|
||||
this.value = false;
|
||||
})
|
||||
}else {
|
||||
this.value = true;
|
||||
isOpenOilConfig(1).then( response => {})
|
||||
isOpenOilConfig({isOpen:1,ruleCycle:this.ruleCycle}).then( response => {
|
||||
if (response.data!=1){
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '支付通道切换失败,请确保交易占比相加满足百分之百'
|
||||
});
|
||||
this.value = false;
|
||||
this.value1 = true;
|
||||
}else {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '发布成功!'
|
||||
});
|
||||
this.value = true;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
// 修改商户使用状态
|
||||
@ -294,12 +331,13 @@ export default {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
data.isUse = isUse
|
||||
editMerchant(data).then( response => {})
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '支付通道切换成功,已实时切换为商户号('+data.mchntCd+')'
|
||||
});
|
||||
this.getList();
|
||||
editMerchant(data).then( response => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '支付通道切换成功,已实时切换为商户号('+data.mchntCd+')'
|
||||
});
|
||||
})
|
||||
}).catch(() => {});
|
||||
},
|
||||
// 获取商户列表信息
|
||||
@ -323,10 +361,8 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '发布成功!'
|
||||
});
|
||||
this.value1 = false;
|
||||
this.changeStatus1()
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
|
@ -642,7 +642,7 @@ export default {
|
||||
],
|
||||
mobile: [
|
||||
{ required: true, message: "手机号不能为空", trigger: "blur" },
|
||||
{ min: 11, max: 20, message: '手机号长度必须11', trigger: 'blur' },
|
||||
{ min: 6, max: 13, message: '手机号不正确', trigger: 'blur' }
|
||||
],
|
||||
roleId: [
|
||||
{ required: true, message: "请选择员工角色", trigger: "blur" }
|
||||
|
@ -2,7 +2,7 @@
|
||||
<div class="app-container">
|
||||
<el-card class="card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{{ store.oilStationName }}({{ store.description }})</span>
|
||||
<span>{{ store.name }}{{store.description? "("+store.description+")":"" }}</span>
|
||||
</div>
|
||||
|
||||
<map-componment :pform="form" ref="mapRef" @pform="getForm"></map-componment>
|
||||
@ -116,7 +116,9 @@ export default {
|
||||
this.form.lat = this.store.latitude;
|
||||
this.form.lng = this.store.longitude;
|
||||
this.form.address = this.store.address;
|
||||
this.welfare = this.store.welfare.split(",")
|
||||
if (this.store.welfare!=null){
|
||||
this.welfare = this.store.welfare.split(",")
|
||||
}
|
||||
this.$refs.mapRef.initAMap();
|
||||
})
|
||||
},
|
||||
@ -157,17 +159,19 @@ export default {
|
||||
light: "#fff"//背景色
|
||||
}
|
||||
};
|
||||
//this.QRlink 生成的二维码地址url
|
||||
QRCode.toDataURL(this.qrcode[0].collection, opts , (err, url) => {
|
||||
if (err) throw err
|
||||
//将生成的二维码路径复制给data的QRImgUrl
|
||||
this.collectionImg= url
|
||||
})
|
||||
QRCode.toDataURL(this.qrcode[0].payment, opts , (err, url) => {
|
||||
if (err) throw err
|
||||
//将生成的二维码路径复制给data的QRImgUrl
|
||||
this.paymentImg= url
|
||||
})
|
||||
if (this.qrcode.length > 0){
|
||||
//this.QRlink 生成的二维码地址url
|
||||
QRCode.toDataURL(this.qrcode[0].collection, opts , (err, url) => {
|
||||
if (err) throw err
|
||||
//将生成的二维码路径复制给data的QRImgUrl
|
||||
this.collectionImg= url
|
||||
})
|
||||
QRCode.toDataURL(this.qrcode[0].payment, opts , (err, url) => {
|
||||
if (err) throw err
|
||||
//将生成的二维码路径复制给data的QRImgUrl
|
||||
this.paymentImg= url
|
||||
})
|
||||
}
|
||||
},
|
||||
// 根据dom生成图片并下载到本地
|
||||
handleDownloadqrCode(id) {
|
||||
|
@ -456,6 +456,8 @@ export default {
|
||||
return {
|
||||
level1:true,
|
||||
level2:false,
|
||||
// 是否开启等级功能
|
||||
isEnableLevel:"",
|
||||
// 优惠值
|
||||
gasolinePreferential:[
|
||||
{
|
||||
@ -564,16 +566,21 @@ export default {
|
||||
this.getList();
|
||||
this.getClearConfig();
|
||||
this.getRule();
|
||||
this.getISEnableLevel();
|
||||
},
|
||||
methods: {
|
||||
checkName(rule, value, callback){
|
||||
queryUserGrade({name:this.form.name}).then( response => {
|
||||
if(response.data!=null){
|
||||
callback(new Error("会员等级名称已存在"))
|
||||
// 是否开启等级功能
|
||||
getISEnableLevel(){
|
||||
getSysConfig('is_enable_level').then(response => {
|
||||
this.isEnableLevel = response.data
|
||||
if (response.data=="no"){
|
||||
this.level1 = true;
|
||||
this.level2 = false;
|
||||
}else {
|
||||
callback();
|
||||
this.level1 = false;
|
||||
this.level2 = true;
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
editLevel1(){
|
||||
this.level1 = false;
|
||||
@ -744,7 +751,7 @@ export default {
|
||||
this.reset();
|
||||
},
|
||||
// 提交按钮
|
||||
submitForm: function() {
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.form.gasolineRule = JSON.stringify(this.gasolinePreferential)
|
||||
@ -761,19 +768,17 @@ export default {
|
||||
if(response.data!=null){
|
||||
this.$modal.msgError("会员等级名称已存在");
|
||||
}else {
|
||||
addUserGrade(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
addUserGrade(this.form).then(res => {
|
||||
if (res.data==1){
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}else {
|
||||
this.$modal.msgError("新增失败,最多支持20个等级");
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
// saveUserGrade(this.form).then(response => {
|
||||
// this.$modal.msgSuccess("新增成功");
|
||||
// this.open = false;
|
||||
// this.getList();
|
||||
// });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -165,6 +165,18 @@
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 阿里云手机验证码-->
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-core</artifactId>
|
||||
<version>4.5.16</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
|
||||
<version>2.1.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -10,6 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 支付配置信息 controller层
|
||||
*/
|
||||
@ -32,17 +34,28 @@ public class OilConfigController extends BaseController {
|
||||
|
||||
/**
|
||||
* 查看支付配置规则是否开启
|
||||
* @param isOpen
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{isOpen}")
|
||||
public ResponseObject isOpen(@PathVariable String isOpen){
|
||||
@PostMapping("/isOpen")
|
||||
public ResponseObject isOpen(@Validated @RequestBody Map<String,String> map){
|
||||
String isOpen = map.get("isOpen");
|
||||
String ruleCycle = map.get("ruleCycle");
|
||||
// 2 代表不启用规则
|
||||
int result = 2;
|
||||
// isOpen=1开启规则
|
||||
if (isOpen.equals("1")){
|
||||
oilConfigService.oilRule();
|
||||
result = oilConfigService.judgmentProportion();
|
||||
if (result==1){
|
||||
oilConfigService.oilRule();
|
||||
// 开启定时关闭规则
|
||||
oilConfigService.ruleCycle(ruleCycle);
|
||||
}
|
||||
}else {
|
||||
// 不开启规则
|
||||
merchantConfigService.updateMerchIsOpen("0");
|
||||
}
|
||||
return getSuccessResult(0);
|
||||
return getSuccessResult(result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -38,6 +38,10 @@ public class OilConfig extends BaseEntity implements Serializable {
|
||||
* 交易占比
|
||||
*/
|
||||
private Integer proportion;
|
||||
/**
|
||||
* 规则周期
|
||||
*/
|
||||
private String ruleCycle;
|
||||
/**
|
||||
* key值
|
||||
*/
|
||||
|
@ -15,6 +15,17 @@ public interface OilConfigService extends IService<OilConfig> {
|
||||
*/
|
||||
public void oilRule();
|
||||
|
||||
/**
|
||||
* 判断占比相加是否为100% 是返回1 不是返回0
|
||||
* @return
|
||||
*/
|
||||
public int judgmentProportion();
|
||||
|
||||
/**
|
||||
* 规则周期是否为当日
|
||||
*/
|
||||
public void ruleCycle(String ruleCycle);
|
||||
|
||||
/**
|
||||
* 查询油品配置信息
|
||||
* @return
|
||||
|
@ -12,6 +12,7 @@ import com.fuint.api.fuyou.vo.OilConfigVo;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -59,6 +60,28 @@ public class OilConfigServiceImpl extends ServiceImpl<OilConfigMapper, OilConfig
|
||||
merchantConfigService.updateMerch(merchantConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int judgmentProportion() {
|
||||
int result = 0;
|
||||
int percentage = 0;
|
||||
List<OilConfig> list = baseMapper.selectList(null);
|
||||
for (OilConfig config : list) {
|
||||
percentage += config.getProportion();
|
||||
}
|
||||
if (percentage==100){
|
||||
result = 1;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ruleCycle(String ruleCycle) {
|
||||
// 如果是单日的话则开启定时任务
|
||||
if (ruleCycle.equals("singleDay")){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OilConfigVo> selectOilConfigList() {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
|
@ -0,0 +1,17 @@
|
||||
package com.fuint.api.fuyou.util;
|
||||
|
||||
import com.fuint.api.fuyou.service.MerchantConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class SchudelUtil {
|
||||
@Autowired
|
||||
private MerchantConfigService merchantConfigService;
|
||||
|
||||
@Scheduled(fixedDelay=86400000)
|
||||
public void teak1(){
|
||||
merchantConfigService.updateMerchIsOpen("0");
|
||||
}
|
||||
}
|
@ -32,14 +32,16 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
|
||||
commission.setStoreId(storeId);
|
||||
IPage<StaffCommission> staffCommissionIPage = baseMapper.selectCommissionList(page, commission);
|
||||
for (StaffCommission record : staffCommissionIPage.getRecords()) {
|
||||
String substring = record.getTakeEffect().substring(24, 43);
|
||||
Date date = new Date();
|
||||
SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String now = dateFormat.format(date);
|
||||
int row = substring.compareTo(now);
|
||||
if (row == -1){
|
||||
record.setStatus("jy");
|
||||
baseMapper.updateById(record);
|
||||
if (record.getTakeEffect()!=null && record.getTakeEffect().equals("")){
|
||||
String substring = record.getTakeEffect().substring(24, 43);
|
||||
Date date = new Date();
|
||||
SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String now = dateFormat.format(date);
|
||||
int row = substring.compareTo(now);
|
||||
if (row == -1){
|
||||
record.setStatus("jy");
|
||||
baseMapper.updateById(record);
|
||||
}
|
||||
}
|
||||
}
|
||||
IPage<StaffCommission> commissionIPage = baseMapper.selectCommissionList(page, commission);
|
||||
|
@ -108,7 +108,7 @@ public class MtPurchaseController extends BaseController {
|
||||
|
||||
|
||||
/**
|
||||
* 盘点审核
|
||||
* 进货审核
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ -117,11 +117,21 @@ public class MtPurchaseController extends BaseController {
|
||||
return getSuccessResult(this.mtPurchaseService.audit(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 进货废除
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("abolition")
|
||||
public ResponseObject abolition(Integer id) {
|
||||
return getSuccessResult(this.mtPurchaseService.abolition(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 进货入库
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("storage")
|
||||
public ResponseObject storage(Integer id) {
|
||||
return getSuccessResult(this.mtPurchaseService.storage(id));
|
||||
|
@ -144,6 +144,7 @@
|
||||
left join mt_goods mg ON md.goods_id = mg.id
|
||||
where
|
||||
damage_id = #{mtDamageDetails.damageId}
|
||||
|
||||
</select>
|
||||
<select id="getListByExcel"
|
||||
resultType="com.fuint.business.convenienceSore.vo.excel.MtDamageDetailsExcel">
|
||||
|
@ -151,15 +151,14 @@
|
||||
mg.supplier_id supplierId,
|
||||
mg.id goodsId,
|
||||
mg.stock stock,
|
||||
mg.store_id storeId,
|
||||
mp.order_number orderNumber
|
||||
from mt_purchase_details md
|
||||
left join mt_purchase mp ON md.purchase_id = mp.id
|
||||
left join mt_goods mg ON md.goods_id = mg.id
|
||||
<where>
|
||||
purchase_id = #{mtPurchaseDetails.purchaseId}
|
||||
<if test="mtPurchaseDetails.storeId != null">
|
||||
and md.store_id = #{mtPurchaseDetails.storeId}
|
||||
</if>
|
||||
and md.store_id = #{mtPurchaseDetails.storeId}
|
||||
</where>
|
||||
</select>
|
||||
<select id="getListByExcel"
|
||||
|
@ -191,7 +191,7 @@ public class MtDamageServiceImpl implements MtDamageService {
|
||||
StockStatistic stockStatistic = stockStatisticService.selectStockByGoodsId(mtReturnsDetailsVO.getGoodsId());
|
||||
StockTrack stockTrack = new StockTrack();
|
||||
stockTrack.setStockId(stockStatistic.getId());
|
||||
stockTrack.setStoreId(mtReturnsDetailsVO.getStoreId());
|
||||
stockTrack.setStoreId(nowAccountInfo.getStoreId());
|
||||
stockTrack.setDocument("商品报损");
|
||||
stockTrack.setChangeNumber(-mtReturnsDetailsVO.getDamageQuantity());
|
||||
stockTrack.setOddNumber(mtReturnsDetailsVO.getOrderNumber());
|
||||
|
@ -169,7 +169,7 @@ public class MtInventoryServiceImpl implements MtInventoryService {
|
||||
StockStatistic stockStatistic = stockStatisticService.selectStockByGoodsId(mtReturnsDetailsVO.getGoodsId());
|
||||
StockTrack stockTrack = new StockTrack();
|
||||
stockTrack.setStockId(stockStatistic.getId());
|
||||
stockTrack.setStoreId(mtReturnsDetailsVO.getStoreId());
|
||||
stockTrack.setStoreId(nowAccountInfo.getStoreId());
|
||||
stockTrack.setDocument("商品盘点");
|
||||
stockTrack.setChangeNumber(mtReturnsDetailsVO.getInventoryDiscrepancy().intValue());
|
||||
stockTrack.setOddNumber(mtReturnsDetailsVO.getOrderNumber());
|
||||
|
@ -186,11 +186,13 @@ public class MtPurchaseServiceImpl implements MtPurchaseService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean storage(Integer id) {
|
||||
String oilIntake = "进货入库";
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
int audit = iljStaffService.auditPrem(oilIntake);
|
||||
if (audit>0) {
|
||||
// 1.查询所有的数据
|
||||
MtPurchaseDetails mtPurchaseDetails = new MtPurchaseDetails();
|
||||
mtPurchaseDetails.setPurchaseId(id);
|
||||
mtPurchaseDetails.setStoreId(nowAccountInfo.getStoreId());
|
||||
List<MtPurchaseDetailsVO> allList2 = detailsMapper.getAllList2(mtPurchaseDetails);
|
||||
for (MtPurchaseDetailsVO mtPurchaseDetailsVO : allList2) {
|
||||
// 修改库存
|
||||
@ -200,7 +202,7 @@ public class MtPurchaseServiceImpl implements MtPurchaseService {
|
||||
StockStatistic stockStatistic = stockStatisticService.selectStockByGoodsId(mtPurchaseDetailsVO.getGoodsId());
|
||||
StockTrack stockTrack = new StockTrack();
|
||||
stockTrack.setStockId(stockStatistic.getId());
|
||||
stockTrack.setStoreId(mtPurchaseDetailsVO.getStoreId());
|
||||
stockTrack.setStoreId(nowAccountInfo.getStoreId());
|
||||
stockTrack.setDocument("商品进货");
|
||||
stockTrack.setChangeNumber(mtPurchaseDetailsVO.getQuantityPurchased());
|
||||
stockTrack.setOddNumber(mtPurchaseDetailsVO.getOrderNumber());
|
||||
|
@ -192,7 +192,7 @@ public class MtReturnsServiceImpl implements MtReturnsService {
|
||||
StockStatistic stockStatistic = stockStatisticService.selectStockByGoodsId(mtReturnsDetailsVO.getGoodsId());
|
||||
StockTrack stockTrack = new StockTrack();
|
||||
stockTrack.setStockId(stockStatistic.getId());
|
||||
stockTrack.setStoreId(mtReturnsDetailsVO.getStoreId());
|
||||
stockTrack.setStoreId(nowAccountInfo.getStoreId());
|
||||
stockTrack.setDocument("商品退货");
|
||||
stockTrack.setChangeNumber(-mtReturnsDetailsVO.getReturnQuantity());
|
||||
stockTrack.setOddNumber(mtReturnsDetailsVO.getOrderNumber());
|
||||
|
@ -28,6 +28,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@ -161,7 +162,9 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
|
||||
MaxoutVO maxoutVO = new MaxoutVO();
|
||||
// 会员等级判断、符合油号判断
|
||||
if (activeFullminus.getDieselUserLevel().contains(String.valueOf(userGradeService.selectUserGradeById(transferDTO.getGradeId()).getId())) &&
|
||||
activeFullminus.getAdaptOil().contains(String.valueOf(transferDTO.getOilName()))){
|
||||
activeFullminus.getAdaptOil().contains(String.valueOf(transferDTO.getOilName())) &&
|
||||
activeFullminus.getActiveStartTime().getTime()<=new Date().getTime() &&
|
||||
new Date().getTime()<=activeFullminus.getActiveEndTime().getTime()){
|
||||
BeanUtils.copyProperties(activeFullminus,maxoutVO);
|
||||
LambdaQueryWrapper<ActiveDiscountChild> queryWrappers = new LambdaQueryWrapper<>();
|
||||
queryWrappers.eq(ActiveDiscountChild::getActiveFullminusId,activeFullminus.getId());
|
||||
@ -186,7 +189,9 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
|
||||
MaxoutVO maxoutVO = new MaxoutVO();
|
||||
// 会员等级判断、符合油号判断
|
||||
if (activeDiscount.getDieselUserLevel().contains(String.valueOf(userGradeService.selectUserGradeById(transferDTO.getGradeId()).getId())) &&
|
||||
activeDiscount.getAdaptOil().contains(String.valueOf(transferDTO.getOilName()))){
|
||||
activeDiscount.getAdaptOil().contains(String.valueOf(transferDTO.getOilName()))&&
|
||||
activeDiscount.getActiveStartTime().getTime()<=new Date().getTime() &&
|
||||
new Date().getTime()<=activeDiscount.getActiveEndTime().getTime()){
|
||||
BeanUtils.copyProperties(activeDiscount,maxoutVO);
|
||||
LambdaQueryWrapper<ActiveDiscountChild> queryWrappers = new LambdaQueryWrapper<>();
|
||||
queryWrappers.eq(ActiveDiscountChild::getActiveDiscountId,activeDiscount.getId());
|
||||
@ -218,7 +223,23 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
|
||||
cardFavorableLambdaQueryWrapper.le(CardFavorable::getSatisfiedAmount,transferDTO.getOilPrice() * transferDTO.getOilLiters());
|
||||
List<CardFavorable> list1 = cardFavorableService.list(cardFavorableLambdaQueryWrapper);
|
||||
if (list1.size()>0){
|
||||
BeanUtils.copyProperties(list1.get(0), exchangeFavorableVO);
|
||||
CardFavorable cardFavorable = list1.get(0);
|
||||
if (cardFavorable.getTimeType().equals("0") &&
|
||||
new Date().getTime()<=cardFavorable.getCreateTime().getTime()+ 86400000L * cardFavorable.getValidityZero() ){
|
||||
BeanUtils.copyProperties(cardFavorable, exchangeFavorableVO);
|
||||
}
|
||||
if (cardFavorable.getTimeType().equals("1") &&
|
||||
new Date().getTime()<=cardFavorable.getEffectiveDate().getTime()+ 86400000L * cardFavorable.getValidityOne() ){
|
||||
BeanUtils.copyProperties(cardFavorable, exchangeFavorableVO);
|
||||
}
|
||||
if (cardFavorable.getTimeType().equals("2") &&
|
||||
new Date().getTime() >= cardFavorable.getCreateTime().getTime() + Integer.parseInt(cardFavorable.getValidityDay()) * 86400000L &&
|
||||
new Date().getTime() <= cardFavorable.getCreateTime().getTime() + Integer.parseInt(cardFavorable.getValidityDay()) * 86400000L + 86400000L * cardFavorable.getValidityTwo()){
|
||||
BeanUtils.copyProperties(cardFavorable, exchangeFavorableVO);
|
||||
}
|
||||
/*if (){
|
||||
|
||||
}*/
|
||||
exchangeFavorableVOArrayList.add(exchangeFavorableVO);
|
||||
}
|
||||
}
|
||||
|
@ -7,9 +7,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.marketingActivity.cardExchange.mapper.CardExchangeRecordMapper;
|
||||
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
|
||||
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService;
|
||||
import com.fuint.business.store.service.StoreService;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 兑换券领取记录表(CardExchangeRecord)表服务实现类
|
||||
*
|
||||
@ -18,7 +22,8 @@ import org.springframework.stereotype.Service;
|
||||
*/
|
||||
@Service("cardExchangeRecordService")
|
||||
public class CardExchangeRecordServiceImpl extends ServiceImpl<CardExchangeRecordMapper, CardExchangeRecord> implements CardExchangeRecordService {
|
||||
|
||||
@Resource
|
||||
private StoreService storeService;
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page
|
||||
@ -27,6 +32,11 @@ public class CardExchangeRecordServiceImpl extends ServiceImpl<CardExchangeRecor
|
||||
*/
|
||||
@Override
|
||||
public IPage select(Page page, CardExchangeRecord cardExchangeRecord) {
|
||||
//获取当前店铺的id和连锁店id
|
||||
if (ObjectUtils.isNotEmpty(TokenUtil.getNowAccountInfo().getStoreId())) {
|
||||
cardExchangeRecord.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
|
||||
cardExchangeRecord.setChainStorId(storeService.getById(TokenUtil.getNowAccountInfo().getStoreId()).getChainStoreId());
|
||||
}
|
||||
//构建查询条件
|
||||
LambdaQueryWrapper<CardExchangeRecord> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if(ObjectUtils.isNotEmpty(cardExchangeRecord.getExchangeName())){
|
||||
@ -41,6 +51,7 @@ public class CardExchangeRecordServiceImpl extends ServiceImpl<CardExchangeRecor
|
||||
if(ObjectUtils.isNotEmpty(cardExchangeRecord.getTicketCode())) {
|
||||
queryWrapper.eq(CardExchangeRecord::getTicketCode,cardExchangeRecord.getTicketCode());
|
||||
}
|
||||
queryWrapper.eq(CardExchangeRecord::getStoreId,cardExchangeRecord.getStoreId());
|
||||
queryWrapper.orderByDesc(CardExchangeRecord::getCreateTime);
|
||||
return page(page, queryWrapper);
|
||||
}
|
||||
@ -53,6 +64,11 @@ public class CardExchangeRecordServiceImpl extends ServiceImpl<CardExchangeRecor
|
||||
*/
|
||||
@Override
|
||||
public IPage selectIsUsed(Page page, CardExchangeRecord cardExchangeRecord) {
|
||||
//获取当前店铺的id和连锁店id
|
||||
if (ObjectUtils.isNotEmpty(TokenUtil.getNowAccountInfo().getStoreId())) {
|
||||
cardExchangeRecord.setStoreId(TokenUtil.getNowAccountInfo().getStoreId());
|
||||
cardExchangeRecord.setChainStorId(storeService.getById(TokenUtil.getNowAccountInfo().getStoreId()).getChainStoreId());
|
||||
}
|
||||
//构建查询条件
|
||||
LambdaQueryWrapper<CardExchangeRecord> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if(ObjectUtils.isNotEmpty(cardExchangeRecord.getExchangeName())){
|
||||
@ -70,6 +86,7 @@ public class CardExchangeRecordServiceImpl extends ServiceImpl<CardExchangeRecor
|
||||
if (ObjectUtils.isNotEmpty(cardExchangeRecord.getStartTime()) && ObjectUtils.isNotEmpty(cardExchangeRecord.getEndTime()) ) {
|
||||
queryWrapper.between(CardExchangeRecord::getCancelTime,cardExchangeRecord.getStartTime(),cardExchangeRecord.getEndTime());
|
||||
}
|
||||
queryWrapper.eq(CardExchangeRecord::getStoreId,cardExchangeRecord.getStoreId());
|
||||
queryWrapper.orderByDesc(CardExchangeRecord::getCreateTime);
|
||||
return page(page, queryWrapper);
|
||||
}
|
||||
|
@ -160,6 +160,7 @@ public class CardFuelRecordServiceImpl implements CardFuelRecordService {
|
||||
Double theAmountToBePaid = 0.0;
|
||||
|
||||
boolean flag = false;
|
||||
System.out.println("cardFuelRecordDTO.getRechargeBalance():"+cardFuelRecordDTO.getRechargeBalance());
|
||||
|
||||
double epsilon = 1e-10; // 阈值
|
||||
if (!ObjectUtil.isEmpty(cardFuelRecordDTO.getRechargeBalance())
|
||||
|
@ -106,6 +106,9 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
|
||||
double epsilon = 1e-10; // 阈值
|
||||
|
||||
Double theAmountToBePaid = 0.0;
|
||||
|
||||
System.out.println("cardFuelRecordDTO.getRechargeBalance():"+cardValueRecordDTO.getRealyPayBills());
|
||||
|
||||
boolean flag = false;
|
||||
// 先判断是否为自定义金额
|
||||
if (!ObjectUtil.isEmpty(cardValueRecordDTO.getRealyPayBills())
|
||||
|
@ -9,6 +9,9 @@
|
||||
<include refid="selectOrders"></include>
|
||||
<where>
|
||||
store_id = #{order.storeId}
|
||||
<if test="order.userId != null and order.userId != ''">
|
||||
and user_id = #{order.userId}
|
||||
</if>
|
||||
<if test="order.staffId != null and order.staffId != ''">
|
||||
and staff_id = #{order.staffId}
|
||||
</if>
|
||||
|
@ -147,7 +147,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
|
||||
// 支付状态
|
||||
String payStatus = "unpaid";
|
||||
if (payType.equals("CASH")){
|
||||
if (payType.equals("CASH") && map.get("allAmount").equals("0")){
|
||||
payStatus = "paid";
|
||||
}else {
|
||||
payStatus = "unpaid";
|
||||
|
@ -3,7 +3,9 @@ package com.fuint.business.petrolStationManagement.service.impl;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilTank;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilTracking;
|
||||
import com.fuint.business.petrolStationManagement.mapper.OilTankMapper;
|
||||
import com.fuint.business.petrolStationManagement.mapper.OilTrackingMapper;
|
||||
import com.fuint.business.petrolStationManagement.service.OilTankService;
|
||||
import com.fuint.business.petrolStationManagement.vo.OilTankExcel;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
@ -27,7 +29,8 @@ import java.util.List;
|
||||
public class OilTankServiceImpl implements OilTankService {
|
||||
@Resource
|
||||
private OilTankMapper oilTankDao;
|
||||
|
||||
@Resource
|
||||
OilTrackingMapper oilTrackingMapper;
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
@ -80,6 +83,17 @@ public class OilTankServiceImpl implements OilTankService {
|
||||
oilTank.setStoreId(nowAccountInfo.getStoreId());
|
||||
oilTank.setCreateBy(nowAccountInfo.getStaffId().toString());
|
||||
this.oilTankDao.insert(oilTank);
|
||||
|
||||
// 添加到库存跟踪 (初始化时)
|
||||
OilTracking oilTracking = new OilTracking();
|
||||
oilTracking.setStoreId(nowAccountInfo.getStoreId());
|
||||
oilTracking.setCreateBy(nowAccountInfo.getStaffId().toString());
|
||||
oilTracking.setDocument("油罐库存初始化");
|
||||
oilTracking.setQuantityChange(oilTank.getStoredQuantity());
|
||||
oilTracking.setTankId(oilTank.getId());
|
||||
oilTracking.setOrderNumber("-");
|
||||
oilTrackingMapper.insert(oilTracking);
|
||||
|
||||
return oilTank;
|
||||
}
|
||||
|
||||
|
@ -3,13 +3,15 @@
|
||||
<mapper namespace="com.fuint.business.userManager.mapper.LJUserMapper">
|
||||
<sql id="selectUser">
|
||||
select mu.*,mub.card_balance,mub.points,mub.growth_value,mub.refuel_money from mt_user mu
|
||||
inner join mt_user_balance mub on mu.id = mub.mt_user_id
|
||||
left join mt_user_balance mub on mu.id = mub.mt_user_id
|
||||
</sql>
|
||||
|
||||
<select id="selectUserList" resultType="com.fuint.business.userManager.vo.LJUserVo">
|
||||
<include refid="selectUser"></include>
|
||||
<where>
|
||||
mu.store_id = #{user.storeId}
|
||||
<if test="user.storeId != null and user.storeId != ''">
|
||||
and mu.store_id = #{user.storeId}
|
||||
</if>
|
||||
<if test="user.mobile != null and user.mobile != ''">
|
||||
and mu.mobile like concat('%', #{user.mobile}, '%')
|
||||
</if>
|
||||
@ -26,10 +28,10 @@
|
||||
and mu.official = #{user.official}
|
||||
</if>
|
||||
<if test="user.cardBalance != null and user.cardBalance != '' and user.cardBalance == 2">
|
||||
and mub.cardBalance = 0
|
||||
and mub.card_balance = 0
|
||||
</if>
|
||||
<if test="user.cardBalance != null and user.cardBalance != '' and user.cardBalance == 1">
|
||||
and mub.cardBalance != 0
|
||||
and mub.card_balance != 0
|
||||
</if>
|
||||
<if test="user.params.beginTime != null and user.params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(mu.create_time,'%y%m%d') >= date_format(#{user.params.beginTime},'%y%m%d')
|
||||
|
@ -59,7 +59,16 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
|
||||
|
||||
@Override
|
||||
public int insertUserGrade(LJUserGrade userGrade) {
|
||||
int row = baseMapper.insert(userGrade);
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer storeId = nowAccountInfo.getStoreId();
|
||||
Integer num = baseMapper.selectCount(null);
|
||||
int row = 0;
|
||||
if (num<20){
|
||||
userGrade.setStoreId(storeId);
|
||||
row = baseMapper.insert(userGrade);
|
||||
}else {
|
||||
row = 0;
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
|
@ -37,9 +37,9 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
||||
*/
|
||||
@Override
|
||||
public IPage<LJUserVo> selectUserList(Page page, LJUserVo user) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
Integer storeId = nowAccountInfo.getStoreId();
|
||||
user.setStoreId(storeId);
|
||||
// AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
// Integer storeId = nowAccountInfo.getStoreId();
|
||||
// user.setStoreId(storeId);
|
||||
IPage<LJUserVo> ljUserIPage = baseMapper.selectUserList(page, user);
|
||||
return ljUserIPage;
|
||||
}
|
||||
|
@ -31,7 +31,9 @@ public class ShiroConfig {
|
||||
filter.setFilters(filters);
|
||||
LinkedHashMap<String,String> filterMap=new LinkedHashMap<>();
|
||||
filterMap.put("/backendApi/login/doLogin","anon");
|
||||
filterMap.put("/backendApi/login/sendMsg","anon");
|
||||
filterMap.put("/clientApi/captcha/getCode","anon");
|
||||
filterMap.put("/backendApi/login/loginByPhone","anon");
|
||||
filterMap.put("/static/**","anon");
|
||||
//会员模板导出
|
||||
filterMap.put("/excel/export","anon");
|
||||
|
@ -0,0 +1,38 @@
|
||||
package com.fuint.common.util;
|
||||
|
||||
import com.aliyuncs.DefaultAcsClient;
|
||||
import com.aliyuncs.IAcsClient;
|
||||
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest;
|
||||
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
|
||||
import com.aliyuncs.exceptions.ClientException;
|
||||
import com.aliyuncs.profile.DefaultProfile;
|
||||
|
||||
/**
|
||||
* 短信发送工具类
|
||||
*/
|
||||
public class SMSUtils {
|
||||
/**
|
||||
* 发送短信
|
||||
* @param signName 签名
|
||||
* @param templateCode 模板
|
||||
* @param phoneNumbers 手机号
|
||||
* @param param 参数
|
||||
*/
|
||||
public static void sendMessage(String signName, String templateCode,String phoneNumbers,String param){
|
||||
DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", "", "");
|
||||
IAcsClient client = new DefaultAcsClient(profile);
|
||||
|
||||
SendSmsRequest request = new SendSmsRequest();
|
||||
request.setSysRegionId("cn-hangzhou");
|
||||
request.setPhoneNumbers(phoneNumbers);
|
||||
request.setSignName(signName);
|
||||
request.setTemplateCode(templateCode);
|
||||
request.setTemplateParam("{\"code\":\""+param+"\"}");
|
||||
try {
|
||||
SendSmsResponse response = client.getAcsResponse(request);
|
||||
System.out.println("短信发送成功"+response);
|
||||
}catch (ClientException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.fuint.common.util;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class ValidateCodeUtils {
|
||||
|
||||
/**
|
||||
* 随机生成验证码
|
||||
* @param a
|
||||
* @return
|
||||
*/
|
||||
public static String verificationCode(int a) {
|
||||
// 定义一个空字符串
|
||||
String verification_code = "";
|
||||
// 创建Random对象
|
||||
Random r = new Random();
|
||||
for (int i = 0; i < a; i++) {
|
||||
// 确定字符类型(0代表数字,1代表大写字母,2代表小写字母)
|
||||
int type = r.nextInt(3);
|
||||
switch (type) {
|
||||
case 0:
|
||||
// 随机生成一个0~9数字
|
||||
verification_code += r.nextInt(10);
|
||||
break;
|
||||
case 1:
|
||||
// 随机生成一个65~90的数字,然后强转为大写字母
|
||||
verification_code += (char) (r.nextInt(26) + 65);
|
||||
break;
|
||||
case 2:
|
||||
// 随机生成一个97~122的数字,然后强转为小写字母
|
||||
verification_code += (char) (r.nextInt(26) + 97);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return verification_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 随机生成指定长度字符串验证码
|
||||
* @param length 长度
|
||||
* @return
|
||||
*/
|
||||
public static String generateValidateCode4String(int length){
|
||||
Random rdm = new Random();
|
||||
String hash1 = Integer.toHexString(rdm.nextInt());
|
||||
String capstr = hash1.substring(0, length);
|
||||
return capstr;
|
||||
}
|
||||
}
|
@ -1,15 +1,17 @@
|
||||
package com.fuint.module.backendApi.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.api.R;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.dto.UserDto;
|
||||
import com.fuint.common.enums.AdminRoleEnum;
|
||||
import com.fuint.common.service.*;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import com.fuint.common.util.TreeUtil;
|
||||
import com.fuint.common.util.*;
|
||||
import com.fuint.common.vo.RouterVo;
|
||||
import com.fuint.framework.annoation.OperationServiceLog;
|
||||
import com.fuint.framework.exception.BusinessCheckException;
|
||||
import com.fuint.module.backendApi.request.LoginRequest;
|
||||
import com.fuint.common.util.Constants;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import com.fuint.module.backendApi.response.LoginResponse;
|
||||
@ -23,11 +25,15 @@ import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authc.UsernamePasswordToken;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.fuint.common.domain.TreeNode;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 后台登录接口
|
||||
@ -64,6 +70,9 @@ public class BackendLoginController extends BaseController {
|
||||
@Resource
|
||||
private CaptchaService captchaService;
|
||||
|
||||
@Autowired
|
||||
public RedisTemplate redisTemplate;
|
||||
|
||||
/**
|
||||
* 后台登录
|
||||
* */
|
||||
@ -110,8 +119,50 @@ public class BackendLoginController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登录信息接口
|
||||
* 后台登录
|
||||
* */
|
||||
@ApiOperation(value = "发送手机验证码")
|
||||
@RequestMapping(value="/sendMsg", method = RequestMethod.POST)
|
||||
@OperationServiceLog(description = "发送手机验证码")
|
||||
public ResponseObject sendMsg(@RequestBody UserDto userDto) {
|
||||
//获取手机号
|
||||
String phone = userDto.getMobile();
|
||||
if(StringUtils.isNotEmpty(phone)){
|
||||
//生成随机的四位验证码
|
||||
String code = ValidateCodeUtils.verificationCode(4);
|
||||
//调用阿里云提供的短信服务API完成发送短信
|
||||
SMSUtils.sendMessage("蓝鲸智慧油站","SMS_154950909",phone,code);
|
||||
//需要将生成的验证码保存到redis,过期时间60s
|
||||
redisTemplate.opsForValue().set(phone,code,60, TimeUnit.SECONDS);
|
||||
return getSuccessResult("手机验证码发送成功");
|
||||
}
|
||||
return getFailureResult("短信发送失败");
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param map
|
||||
* @param session
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/loginByPhone")
|
||||
public ResponseObject loginByPhone(@RequestBody Map map) {
|
||||
//获取手机号 1234
|
||||
String phone = map.get("mobile").toString();
|
||||
//获取验证码
|
||||
String code = map.get("code").toString();
|
||||
//从redis中获取保存的验证码
|
||||
Object codeInRedis = redisTemplate.opsForValue().get(phone);
|
||||
//进行验证码的比对
|
||||
if (codeInRedis != null && codeInRedis.equals(code)) {
|
||||
//如果能够比对成功,说明登录成功
|
||||
return getSuccessResult("登录成功!");
|
||||
}
|
||||
return getFailureResult("登录失败,请输入正确的验证码");
|
||||
}
|
||||
/**
|
||||
* 获取登录信息接口
|
||||
* */
|
||||
@ApiOperation(value = "获取登录信息")
|
||||
@RequestMapping(value = "/getInfo", method = RequestMethod.GET)
|
||||
public ResponseObject getInfo(HttpServletRequest request) throws BusinessCheckException {
|
||||
|
@ -218,7 +218,7 @@
|
||||
<div class="bottom-price">¥{{ oilActualPay + goodsActualPay }}</div>
|
||||
<div class="price-red">优惠合计:{{ oilDiscount + goodsDiscount }}元/{{consumeRefuelMoney}}L</div>
|
||||
</div>
|
||||
<el-button class="center-left-lv" :disabled="(oilActualPay + goodsActualPay)==0" @click="settlement">立即结算</el-button>
|
||||
<el-button class="center-left-lv" :disabled="(oilAmount + goodsAmount)==0" @click="settlement">立即结算</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -789,6 +789,7 @@
|
||||
import {selectCoupon, selectPreferential} from "@/api/cashier/preferential";
|
||||
import {addHangBill} from "@/api/cashier/hangbill";
|
||||
import {addCreditUnit, listCreditUnit} from "@/api/cashier/creditunit";
|
||||
import {getSysConfig} from "@/api/staff/user/sysconfig";
|
||||
|
||||
const cityOptions = ['上海', '北京'];
|
||||
export default {
|
||||
@ -808,7 +809,7 @@
|
||||
cities2: cityOptions,
|
||||
gradeDiscount: [],
|
||||
// 囤油卡全选
|
||||
checkAll3: true,
|
||||
checkAll3: false,
|
||||
isIndeterminate3: true,
|
||||
checkedCities3: [],
|
||||
cities3: cityOptions,
|
||||
@ -863,8 +864,10 @@
|
||||
oilActualPay:0,
|
||||
// 油品优惠金额
|
||||
oilDiscount:0,
|
||||
// 囤油卡消费金额
|
||||
// 扣除升数后需要消费的金额
|
||||
hoardAmount:0,
|
||||
// 是否使用囤油卡
|
||||
isOilStorageCard:false,
|
||||
// 商品优惠金额
|
||||
goodsDiscount:0,
|
||||
// 商品实付金额
|
||||
@ -954,7 +957,7 @@
|
||||
// 优惠券id
|
||||
couponIds:[],
|
||||
// 使用的优惠券id
|
||||
useCouponIds:[],
|
||||
useCouponIds:"",
|
||||
map:{
|
||||
allAmount:0,
|
||||
// 用户支付条码信息
|
||||
@ -1194,7 +1197,7 @@
|
||||
if (val){
|
||||
this.fullReduction = 0;
|
||||
this.fullReduceDiscount.forEach(item => {
|
||||
this.fullReduction += item.reduce
|
||||
this.fullReduction += +item.reduce
|
||||
})
|
||||
this.isUseFull = false;
|
||||
}else {
|
||||
@ -1214,7 +1217,7 @@
|
||||
reduces = item.reduce
|
||||
}
|
||||
}
|
||||
this.fullReduction += reduces
|
||||
this.fullReduction += +reduces
|
||||
})
|
||||
let checkedCount = value.length;
|
||||
this.checkAll1 = checkedCount === this.fullReduceDiscount.length;
|
||||
@ -1256,8 +1259,10 @@
|
||||
handleCheckAllChange3(val) {
|
||||
if (val==false){
|
||||
this.consumeRefuelMoney = 0;
|
||||
this.hoardAmount = 0;
|
||||
// this.hoardAmount = 0;
|
||||
this.isOilStorageCard = false;
|
||||
}else {
|
||||
this.isOilStorageCard = true;
|
||||
this.changeRefuelMoney()
|
||||
}
|
||||
this.isExclusion();
|
||||
@ -1363,9 +1368,9 @@
|
||||
list.forEach(item => {
|
||||
num += item.num;
|
||||
if (_this.isMember){
|
||||
amount += item.memberPrice;
|
||||
amount += +item.memberPrice;
|
||||
}else {
|
||||
amount += item.retailPrice;
|
||||
amount += +item.retailPrice;
|
||||
}
|
||||
})
|
||||
this.goodsTotal = num;
|
||||
@ -1414,231 +1419,235 @@
|
||||
let _this = this;
|
||||
this.oilDiscount = 0;
|
||||
this.gradeDiscount = [];
|
||||
getUserGrade(id).then( response => {
|
||||
let gasolineDiscount = 0;
|
||||
let dieselDiscount = 0;
|
||||
let naturalGasDiscount = 0;
|
||||
_this.gradeDiscount = [];
|
||||
_this.oilOrder.forEach(item => {
|
||||
let discount = {type:"",full:0,reduce:0,liters:0}
|
||||
if (item.type == "汽油"){
|
||||
let gasolineRule = JSON.parse(response.data.gasolineRule);
|
||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy'){
|
||||
if (response.data.gasolineDiscount=="满减优惠"){
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= gasolineRule.length; i++){
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (gasolineRule.length>1){
|
||||
if (item.amount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
|
||||
discount.full = gasolineRule[gasolineRule.length-1].gasolineRule1
|
||||
oilDiscount = gasolineRule[gasolineRule.length-1].gasolineRule2
|
||||
discount.reduce = gasolineRule[gasolineRule.length-1].gasolineRule2
|
||||
break;
|
||||
getSysConfig('is_enable_level').then(res => {
|
||||
if (res.data=="yes") {
|
||||
getUserGrade(id).then(response => {
|
||||
let gasolineDiscount = 0;
|
||||
let dieselDiscount = 0;
|
||||
let naturalGasDiscount = 0;
|
||||
_this.gradeDiscount = [];
|
||||
_this.oilOrder.forEach(item => {
|
||||
let discount = {type: "", full: 0, reduce: 0, liters: 0}
|
||||
if (item.type == "汽油") {
|
||||
let gasolineRule = JSON.parse(response.data.gasolineRule);
|
||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
||||
if (response.data.gasolineDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= gasolineRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (gasolineRule.length > 1) {
|
||||
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.amount >= gasolineRule[i-1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1){
|
||||
discount.full = gasolineRule[i-1].gasolineRule1
|
||||
oilDiscount = gasolineRule[i-1].gasolineRule2
|
||||
discount.reduce = gasolineRule[i-1].gasolineRule2
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
}else {
|
||||
if (item.amount >= gasolineRule[i-1].gasolineRule1){
|
||||
discount.full = gasolineRule[i-1].gasolineRule1
|
||||
oilDiscount = gasolineRule[i-1].gasolineRule2
|
||||
discount.reduce = gasolineRule[i-1].gasolineRule2
|
||||
gasolineDiscount += +oilDiscount
|
||||
} else if (response.data.gasolineDiscount == "每升优惠") {
|
||||
discount.type = "每升优惠"
|
||||
let oilDiscount = 0;
|
||||
for (let i = 1; i <= gasolineRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (gasolineRule.length > 1) {
|
||||
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
|
||||
discount.reduce = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
break;
|
||||
}
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每升优惠')
|
||||
}
|
||||
gasolineDiscount += +oilDiscount
|
||||
} else {
|
||||
gasolineDiscount = 0;
|
||||
}
|
||||
}
|
||||
if (discount.reduce!=0){
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
gasolineDiscount += +oilDiscount
|
||||
}else if (response.data.gasolineDiscount=="每升优惠"){
|
||||
discount.type = "每升优惠"
|
||||
let oilDiscount = 0;
|
||||
for (let i = 1; i <= gasolineRule.length; i++){
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (gasolineRule.length>1){
|
||||
if (item.amount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
|
||||
discount.full = gasolineRule[gasolineRule.length-1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2);
|
||||
discount.reduce = (item.liters * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2);
|
||||
discount.liters = gasolineRule[i-1].gasolineRule3
|
||||
break;
|
||||
}
|
||||
if (item.amount >= gasolineRule[i-1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1){
|
||||
discount.full = gasolineRule[i-1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[i-1].gasolineRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * gasolineRule[i-1].gasolineRule3).toFixed(2)
|
||||
discount.liters = gasolineRule[i-1].gasolineRule3
|
||||
}
|
||||
}else {
|
||||
if (item.amount >= gasolineRule[i-1].gasolineRule1){
|
||||
discount.full = gasolineRule[i-1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[i-1].gasolineRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * gasolineRule[i-1].gasolineRule3).toFixed(2)
|
||||
discount.liters = gasolineRule[i-1].gasolineRule3
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce!=0){
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每升优惠')
|
||||
}
|
||||
gasolineDiscount += +oilDiscount
|
||||
}else {
|
||||
gasolineDiscount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == "柴油"){
|
||||
let dieselRule = JSON.parse(response.data.dieselRule);
|
||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy'){
|
||||
if (response.data.dieselDiscount=="满减优惠"){
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= dieselRule.length; i++){
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (dieselRule.length>1){
|
||||
if (item.amount >= dieselRule[dieselRule.length-1].dieselRule1){
|
||||
discount.full = dieselRule[dieselRule.length-1].dieselRule1
|
||||
oilDiscount = dieselRule[dieselRule.length-1].dieselRule2
|
||||
discount.reduce = dieselRule[dieselRule.length-1].dieselRule2
|
||||
break;
|
||||
if (item.type == "柴油") {
|
||||
let dieselRule = JSON.parse(response.data.dieselRule);
|
||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
||||
if (response.data.dieselDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= dieselRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (dieselRule.length > 1) {
|
||||
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
||||
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
||||
oilDiscount = dieselRule[dieselRule.length - 1].dieselRule2
|
||||
discount.reduce = dieselRule[dieselRule.length - 1].dieselRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
oilDiscount = dieselRule[i - 1].dieselRule2
|
||||
discount.reduce = dieselRule[i - 1].dieselRule2
|
||||
}
|
||||
} else {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1) {
|
||||
oilDiscount = dieselRule[i - 1].dieselRule2
|
||||
discount.reduce = dieselRule[i - 1].dieselRule2
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.amount >= dieselRule[i-1].dieselRule1 && item.amount < dieselRule[i].dieselRule1){
|
||||
discount.full = dieselRule[i-1].dieselRule1
|
||||
oilDiscount = dieselRule[i-1].dieselRule2
|
||||
discount.reduce = dieselRule[i-1].dieselRule2
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
}else {
|
||||
discount.full = dieselRule[i-1].dieselRule1
|
||||
if (item.amount >= dieselRule[i-1].dieselRule1){
|
||||
oilDiscount = dieselRule[i-1].dieselRule2
|
||||
discount.reduce = dieselRule[i-1].dieselRule2
|
||||
dieselDiscount += +oilDiscount
|
||||
} else if (response.data.dieselDiscount == "每升优惠") {
|
||||
let oilDiscount = 0;
|
||||
for (let i = 1; i <= dieselRule.length; i++) {
|
||||
discount.type = "每升优惠"
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (dieselRule.length > 1) {
|
||||
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
||||
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
||||
oilDiscount = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
|
||||
discount.reduce = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
|
||||
discount.liters = dieselRule[dieselRule.length - 1].dieselRule3
|
||||
break;
|
||||
}
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.liters = dieselRule[i - 1].dieselRule3
|
||||
}
|
||||
} else {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1) {
|
||||
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.liters = dieselRule[i - 1].dieselRule3
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每升优惠')
|
||||
}
|
||||
dieselDiscount += +oilDiscount
|
||||
} else {
|
||||
dieselDiscount = 0;
|
||||
}
|
||||
}
|
||||
if (discount.reduce!=0){
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
dieselDiscount += +oilDiscount
|
||||
}else if (response.data.dieselDiscount=="每升优惠"){
|
||||
let oilDiscount = 0;
|
||||
for (let i = 1; i <= dieselRule.length; i++){
|
||||
discount.type = "每升优惠"
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (dieselRule.length>1){
|
||||
if (item.amount >= dieselRule[dieselRule.length-1].dieselRule1){
|
||||
discount.full = dieselRule[dieselRule.length-1].dieselRule1
|
||||
oilDiscount = (item.liters * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2);
|
||||
discount.reduce = (item.liters * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2);
|
||||
discount.liters = dieselRule[dieselRule.length-1].dieselRule3
|
||||
break;
|
||||
}
|
||||
if (item.amount >= dieselRule[i-1].dieselRule1 && item.amount < dieselRule[i].dieselRule1){
|
||||
discount.full = dieselRule[i-1].dieselRule1
|
||||
oilDiscount = (item.liters * dieselRule[i-1].dieselRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * dieselRule[i-1].dieselRule3).toFixed(2)
|
||||
discount.liters = dieselRule[i-1].dieselRule3
|
||||
}
|
||||
}else {
|
||||
discount.full = dieselRule[i-1].dieselRule1
|
||||
if (item.amount >= dieselRule[i-1].dieselRule1){
|
||||
oilDiscount = (item.liters * dieselRule[i-1].dieselRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * dieselRule[i-1].dieselRule3).toFixed(2)
|
||||
discount.liters = dieselRule[i-1].dieselRule3
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce!=0){
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每升优惠')
|
||||
}
|
||||
dieselDiscount += +oilDiscount
|
||||
}else {
|
||||
dieselDiscount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == "天然气"){
|
||||
let naturalGasRule = JSON.parse(response.data.naturalGasRule);
|
||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy'){
|
||||
if (response.data.naturalGasDiscount=="满减优惠"){
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= naturalGasRule.length; i++){
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (naturalGasRule.length>1){
|
||||
if (item.amount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
|
||||
discount.full = naturalGasRule[naturalGasRule.length-1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[naturalGasRule.length-1].naturalGasRule2;
|
||||
discount.reduce = naturalGasRule[naturalGasRule.length-1].naturalGasRule2
|
||||
break;
|
||||
if (item.type == "天然气") {
|
||||
let naturalGasRule = JSON.parse(response.data.naturalGasRule);
|
||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
||||
if (response.data.naturalGasDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= naturalGasRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (naturalGasRule.length > 1) {
|
||||
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2;
|
||||
discount.reduce = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
||||
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
||||
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.amount >= naturalGasRule[i-1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1){
|
||||
discount.full = naturalGasRule[i-1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[i-1].naturalGasRule2
|
||||
discount.reduce = naturalGasRule[i-1].naturalGasRule2
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
}else {
|
||||
if (item.amount >= naturalGasRule[i-1].naturalGasRule1){
|
||||
discount.full = naturalGasRule[i-1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[i-1].naturalGasRule2
|
||||
discount.reduce = naturalGasRule[i-1].naturalGasRule2
|
||||
naturalGasDiscount += +oilDiscount
|
||||
} else if (response.data.naturalGasDiscount == "每单位优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "每单位优惠"
|
||||
for (let i = 1; i <= naturalGasRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (naturalGasRule.length > 1) {
|
||||
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[naturalGasRule.length - 1].naturalGasRule3
|
||||
break;
|
||||
}
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[i - 1].naturalGasRule3
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[i - 1].naturalGasRule3
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每单位优惠')
|
||||
}
|
||||
naturalGasDiscount += +oilDiscount
|
||||
} else {
|
||||
naturalGasDiscount = 0;
|
||||
}
|
||||
}
|
||||
if (discount.reduce!=0){
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
naturalGasDiscount += +oilDiscount
|
||||
}else if (response.data.naturalGasDiscount=="每单位优惠"){
|
||||
let oilDiscount = 0;
|
||||
discount.type = "每单位优惠"
|
||||
for (let i = 1; i <= naturalGasRule.length; i++){
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (naturalGasRule.length>1){
|
||||
if (item.amount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
|
||||
discount.full = naturalGasRule[naturalGasRule.length-1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[gasolineRule.length-1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[gasolineRule.length-1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[naturalGasRule.length-1].naturalGasRule3
|
||||
break;
|
||||
}
|
||||
if (item.amount >= naturalGasRule[i-1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1){
|
||||
discount.full = naturalGasRule[i-1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[i-1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[i-1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[i-1].naturalGasRule3
|
||||
}
|
||||
}else {
|
||||
if (item.amount >= naturalGasRule[i-1].naturalGasRule1){
|
||||
discount.full = naturalGasRule[i-1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[i-1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[i-1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[i-1].naturalGasRule3
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce!=0){
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每单位优惠')
|
||||
}
|
||||
naturalGasDiscount += +oilDiscount
|
||||
}else {
|
||||
naturalGasDiscount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
_this.oilDiscount = gasolineDiscount + dieselDiscount + naturalGasDiscount
|
||||
_this.checkAll2 = true;
|
||||
_this.isExclusion();
|
||||
_this.oilDiscount = gasolineDiscount + dieselDiscount + naturalGasDiscount
|
||||
_this.checkAll2 = true;
|
||||
_this.isExclusion();
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 选择会员
|
||||
@ -1748,15 +1757,29 @@
|
||||
})
|
||||
})
|
||||
},
|
||||
// 使用囤油卡 囤油卡不参与任何优惠
|
||||
countOilCard(){
|
||||
if (this.hoardAmount!=0){
|
||||
if (this.balance!=0 && this.balance >= (this.oilAmount - this.hoardAmount)){
|
||||
this.oilActualPay = 0
|
||||
this.consumeAmount = this.hoardAmount
|
||||
}else {
|
||||
this.oilActualPay = this.oilAmount - this.hoardAmount -this.balance
|
||||
}
|
||||
}else {
|
||||
this.oilActualPay = 0
|
||||
this.consumeAmount = 0
|
||||
}
|
||||
},
|
||||
// 使用优惠券不使用满减
|
||||
countAmountFull(){
|
||||
if (this.isMember){
|
||||
// 满减互斥
|
||||
if (this.balance >= (this.oilAmount - this.oilDiscount - this.couponAmount)){
|
||||
this.oilActualPay = 0
|
||||
this.consumeAmount = this.oilAmount - this.oilDiscount - this.couponAmount - this.hoardAmount
|
||||
this.consumeAmount = this.oilAmount - this.oilDiscount - this.couponAmount
|
||||
}else {
|
||||
this.oilActualPay = this.oilAmount -this.balance - this.oilDiscount - this.couponAmount - this.hoardAmount
|
||||
this.oilActualPay = this.oilAmount -this.balance - this.oilDiscount - this.couponAmount
|
||||
this.consumeAmount = this.balance
|
||||
}
|
||||
}else {
|
||||
@ -1766,7 +1789,7 @@
|
||||
// 使用优惠券和满减不使用储值卡
|
||||
countAmountUnBalance(){
|
||||
if (this.isMember){
|
||||
this.oilActualPay = this.oilAmount - this.fullReduction - this.oilDiscount - this.couponAmount - this.hoardAmount
|
||||
this.oilActualPay = this.oilAmount - this.fullReduction - this.oilDiscount - this.couponAmount
|
||||
}else {
|
||||
this.oilActualPay = this.oilAmount - this.oilDiscount
|
||||
}
|
||||
@ -1777,9 +1800,9 @@
|
||||
if (this.isMember){
|
||||
if (this.balance >= (this.oilAmount - this.oilDiscount - this.fullReduction)){
|
||||
this.oilActualPay = 0
|
||||
this.consumeAmount = this.oilAmount - this.oilDiscount - this.fullReduction - this.hoardAmount
|
||||
this.consumeAmount = this.oilAmount - this.oilDiscount - this.fullReduction
|
||||
}else {
|
||||
this.oilActualPay = this.oilAmount -this.balance - this.oilDiscount - this.fullReduction - this.hoardAmount
|
||||
this.oilActualPay = this.oilAmount -this.balance - this.oilDiscount - this.fullReduction
|
||||
this.consumeAmount = this.balance
|
||||
}
|
||||
}else {
|
||||
@ -1828,6 +1851,18 @@
|
||||
this.countAmountFull()
|
||||
return;
|
||||
}
|
||||
// 使用囤油卡
|
||||
if (this.isOilStorageCard){
|
||||
this.checkAll1 = false;
|
||||
this.fullReduction = 0;
|
||||
this.checkAll2 = false;
|
||||
this.checkedCities2 = [],
|
||||
this.oilDiscount = 0;
|
||||
this.checkAll5 = false;
|
||||
this.couponAmount = 0;
|
||||
this.countOilCard();
|
||||
return;
|
||||
}
|
||||
this.countAmountBalance();
|
||||
}
|
||||
},
|
||||
@ -1845,7 +1880,7 @@
|
||||
if (response.data.length>0){
|
||||
_this.fullReduceDiscount = []
|
||||
response.data.forEach(item => {
|
||||
let discount = {type:item.name,full:0,reduce:0,discount:0}
|
||||
let discount = {type:item.name,full:0,reduce:0,discount:0,exclusion:item.participationCondition}
|
||||
let activeList = item.activeDiscountChildList;
|
||||
for (let i = 1;i<=activeList.length;i++){
|
||||
if (activeList.length>0){
|
||||
@ -1927,9 +1962,9 @@
|
||||
let amount = 0;
|
||||
for (let i = 0; i<goods.length; i++){
|
||||
if (_this.isMember){
|
||||
amount += (goods[i].memberPrice * goods[i].num).toFixed(2)
|
||||
amount += +(goods[i].memberPrice * goods[i].num).toFixed(2)
|
||||
}else {
|
||||
amount += (goods[i].retailPrice * goods[i].num).toFixed(2)
|
||||
amount += +(goods[i].retailPrice * goods[i].num).toFixed(2)
|
||||
}
|
||||
if (goods[i].id == val.id){
|
||||
goods[i].num = goods[i].num + 1;
|
||||
@ -1948,9 +1983,9 @@
|
||||
if (result){
|
||||
val.num = 1;
|
||||
if (_this.isMember){
|
||||
this.goodsAmount += val.memberPrice
|
||||
this.goodsAmount += +val.memberPrice
|
||||
}else {
|
||||
this.goodsAmount += val.retailPrice
|
||||
this.goodsAmount += +val.retailPrice
|
||||
}
|
||||
this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
|
||||
this.goodsOrder.push(val);
|
||||
@ -2036,35 +2071,30 @@
|
||||
let _this = this;
|
||||
_this.consumeRefuelMoney = 0;
|
||||
_this.oilActualPay = 0;
|
||||
let oilActPay = 0;
|
||||
_this.hoardAmount = 0;
|
||||
_this.oilOrder.forEach(item => {
|
||||
let conRefMon = 0;
|
||||
let oilActualPay = 0;
|
||||
let hoardAmount = 0;
|
||||
if (_this.refuelMoney!=null){
|
||||
let result = false;
|
||||
for (let i = 0;i < _this.refuelMoney.length;i++){
|
||||
// 囤油卡升数变化
|
||||
if (_this.refuelMoney[i].oilType==item.oilType){
|
||||
if ((_this.refuelMoney[i].refuelMoney-item.liters)>=0){
|
||||
conRefMon = item.liters
|
||||
oilActualPay = 0;
|
||||
}else {
|
||||
conRefMon = _this.refuelMoney[i].refuelMoney
|
||||
oilActualPay = item.amount - (_this.refuelMoney[i].refuelMoney * item.oilPrice).toFixed(2)
|
||||
hoardAmount = (_this.refuelMoney[i].refuelMoney * item.oilPrice).toFixed(2)
|
||||
}
|
||||
result = true;
|
||||
}else {
|
||||
if (result==false){
|
||||
oilActualPay = item.amount
|
||||
// 扣除升数后需要消费的金额
|
||||
hoardAmount = item.amount - (_this.refuelMoney[i].refuelMoney * item.oilPrice).toFixed(2)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_this.consumeRefuelMoney += +conRefMon
|
||||
oilActPay += +oilActualPay
|
||||
if (_this.consumeRefuelMoney!=0){
|
||||
_this.isOilStorageCard = true;
|
||||
_this.checkAll3 = true;
|
||||
_this.consumeAmount = 0;
|
||||
}
|
||||
_this.hoardAmount += +hoardAmount
|
||||
})
|
||||
_this.isExclusion();
|
||||
@ -2381,9 +2411,9 @@
|
||||
goods.forEach(item => {
|
||||
num += item.num
|
||||
if (_this.isMember){
|
||||
amount += (item.memberPrice*item.num).toFixed(2);
|
||||
amount += +(item.memberPrice*item.num).toFixed(2);
|
||||
}else {
|
||||
amount += (item.retailPrice*item.num).toFixed(2);
|
||||
amount += +(item.retailPrice*item.num).toFixed(2);
|
||||
}
|
||||
})
|
||||
this.goodsTotal = num;
|
||||
|
@ -493,7 +493,7 @@
|
||||
</el-row>
|
||||
<div style="margin: 20px 0;text-align: center">
|
||||
<el-button type="primary" @click="confirm(1)">确认充值</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button @click="openRecharge = false">取 消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
@ -537,14 +537,14 @@
|
||||
<span class="bom">升数卡充值不支持自定义积分,选择对应充值活动获得对应积分[需开启积分活动有效]</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div style="display:flex;margin-left: 20px">
|
||||
<div style="display:flex;margin-left: 20px">
|
||||
<div style="line-height: 40px;width: 20%">提成员工</div>
|
||||
<div>
|
||||
<el-input :readonly="true" placeholder="请选择提成员工" v-model="cardFuelDieselForm.realName">
|
||||
<el-button slot="append" @click="chooseStaff">选择员工</el-button>
|
||||
</el-input>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -575,12 +575,13 @@
|
||||
</el-row>
|
||||
<div style="margin: 20px 0;text-align: center">
|
||||
<el-button type="primary" @click="confirm(2)">确认充值</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button @click="openRecharge = false">取 消</el-button>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 选择员工-->
|
||||
<el-dialog :close-on-click-modal="false" width="50%" height="50%" title="选择员工" :visible.sync="openStaff" append-to-body>
|
||||
<select-staff @send-data="handleDataFromChild">
|
||||
@ -1217,6 +1218,15 @@ export default {
|
||||
this.cardValueForm.staffMobile= data.staffMobile
|
||||
|
||||
},
|
||||
refStaff() {
|
||||
this.cardFuelDieselForm.mtStaffId= ''
|
||||
this.cardFuelDieselForm.realName= ''
|
||||
this.cardFuelDieselForm.staffMobile= ''
|
||||
|
||||
this.cardValueForm.mtStaffId= ''
|
||||
this.cardValueForm.realName= ''
|
||||
this.cardValueForm.staffMobile= ''
|
||||
},
|
||||
// 查询参加存油卡油品
|
||||
getCountOilType() {
|
||||
getCountOilTypeApi().then(res => {
|
||||
@ -1448,11 +1458,13 @@ export default {
|
||||
|
||||
// 关闭支付窗口
|
||||
handClose(){
|
||||
this.isPay = true;
|
||||
this.isPay=true,
|
||||
this.isPaySuccess=false,
|
||||
this.isQuery=true,
|
||||
this.openConfirm = false
|
||||
this.openRecharge = false
|
||||
|
||||
this.isPaySuccess = false;
|
||||
// this.isPaySuccess = false;
|
||||
this.authCode = null
|
||||
this.activeRecharge='balance',
|
||||
|
||||
@ -1533,6 +1545,9 @@ export default {
|
||||
this.openConfirm = false;
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
this.refStaff();
|
||||
this.realyPayBills = 0
|
||||
|
||||
// console.log(tab, event);
|
||||
},
|
||||
handleChange(value) {
|
||||
|
@ -0,0 +1,59 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-table ref="tables" v-loading="loading" :data="list">
|
||||
<el-table-column label="所属油站" prop="id" align="center"/>
|
||||
<el-table-column label="订单时间" align="center"/>
|
||||
<el-table-column label="交易终端" align="center" prop="userNo"/>
|
||||
<el-table-column label="油品/油枪" align="center" prop="name" />
|
||||
<el-table-column label="订单金额" align="center" prop="mobile"/>
|
||||
<el-table-column label="优惠金额" align="center" prop="gradeId"/>
|
||||
<el-table-column label="实付金额" align="center" prop="balance"/>
|
||||
<el-table-column label="付款类型" align="center" prop="balance"/>
|
||||
<el-table-column label="订单号" align="center" prop="balance"/>
|
||||
<el-table-column label="订单类型" align="center" prop="point"/>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="queryParams.page"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listOilOrder} from "@/api/cashier/oilorder";
|
||||
|
||||
export default {
|
||||
props:["pid"],
|
||||
data(){
|
||||
return {
|
||||
loading:false,
|
||||
list:[],
|
||||
total:0,
|
||||
queryParams:{
|
||||
page:1,
|
||||
pageSize:10,
|
||||
userId:"",
|
||||
},
|
||||
// 会员id
|
||||
userId:"",
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods:{
|
||||
getList(){
|
||||
listOilOrder(this.queryParams).then(res => {
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user