收银台

This commit is contained in:
cun-nan 2023-11-24 18:13:11 +08:00
parent f706797001
commit ec27a74ce8
22 changed files with 590 additions and 359 deletions

View File

@ -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
})
}

View File

@ -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"/>

View File

@ -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();

View File

@ -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>
@ -521,7 +521,7 @@
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openConfirm" width="500px" append-to-body>
<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,
@ -1247,7 +1247,7 @@ export default {
this.cardValueForm.giftBalance = 0
this.cardValueForm.growthValue = 0
this.cardValueForm.bidBalance = 0
// this.cardValueForm.bidBalance = 1
this.cardValueForm.amount = 0
@ -1301,7 +1301,7 @@ export default {
},
async collection(){
let userForm = this.form
if (this.flag === 1) {
@ -1325,7 +1325,7 @@ export default {
}
});
let this_ = this
//
//
let timer = setInterval(async () => {
getCheckTheStatusOfYourPaymentApi(id).then(response => {
if (response.data!=null){
@ -1436,14 +1436,14 @@ export default {
this.isQuery=true,
this.openConfirm = false
this.openRecharge = false
// this.isPaySuccess = false;
this.authCode = null
this.activeRecharge='balance',
this.cardValueForm = {}
this.cardFuelDieselForm = {}
},
},
//
submitForm: function() {
@ -1478,7 +1478,7 @@ export default {
this.isPay = true;
this.openConfirm = false
this.openRecharge = false
this.isPaySuccess = false;
this.authCode = null
this.activeRecharge='balance',

View File

@ -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',

View File

@ -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" }

View File

@ -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
//dataQRImgUrl
this.collectionImg= url
})
QRCode.toDataURL(this.qrcode[0].payment, opts , (err, url) => {
if (err) throw err
//dataQRImgUrl
this.paymentImg= url
})
if (this.qrcode.length > 0){
//this.QRlink url
QRCode.toDataURL(this.qrcode[0].collection, opts , (err, url) => {
if (err) throw err
//dataQRImgUrl
this.collectionImg= url
})
QRCode.toDataURL(this.qrcode[0].payment, opts , (err, url) => {
if (err) throw err
//dataQRImgUrl
this.paymentImg= url
})
}
},
// dom
handleDownloadqrCode(id) {

View File

@ -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();
// });
}
}
});

View File

@ -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);
}
/**

View File

@ -38,6 +38,10 @@ public class OilConfig extends BaseEntity implements Serializable {
* 交易占比
*/
private Integer proportion;
/**
* 规则周期
*/
private String ruleCycle;
/**
* key值
*/

View File

@ -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

View File

@ -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();

View File

@ -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");
}
}

View File

@ -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);

View File

@ -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>

View File

@ -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";

View File

@ -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') &gt;= date_format(#{user.params.beginTime},'%y%m%d')

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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>
@ -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">

View File

@ -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>