收银台

This commit is contained in:
cun-nan 2023-11-16 19:00:57 +08:00
parent 4ef7e1cdca
commit 6f1406f8c6
19 changed files with 954 additions and 326 deletions

View File

@ -427,61 +427,6 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- <el-row>-->
<!-- <el-col :span="24">-->
<!-- <el-form-item label="升级条件描述" prop="catchCondition">-->
<!-- <el-input v-model="form.catchCondition" placeholder="请输入升级条件描述" maxlength="200" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row>-->
<!-- <el-col :span="24">-->
<!-- <el-form-item label="升级权益描述" prop="userPrivilege">-->
<!-- <el-input v-model="form.userPrivilege" type="textarea" placeholder="请输入升级权益描述"></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row>-->
<!-- <el-col :span="24">-->
<!-- <el-form-item label="升级方式" prop="catchType">-->
<!-- <el-select-->
<!-- v-model="form.catchType"-->
<!-- clearable-->
<!-- placeholder="升级方式"-->
<!-- >-->
<!-- <el-option v-for="catchType in catchTypeList" :key="catchType.key" :label="catchType.name" :value="catchType.value"/>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row>-->
<!-- <el-col :span="24">-->
<!-- <el-form-item label="升级条件值" prop="catchValue">-->
<!-- <el-input v-model="form.catchValue" placeholder="请输入升级条件值,单位可能是元、次"></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row>-->
<!-- <el-col :span="24">-->
<!-- <el-form-item label="有效天数" prop="validDay">-->
<!-- <el-input v-model="form.validDay" placeholder="请输入有效天数如300表示永久有效"></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row>-->
<!-- <el-col :span="24">-->
<!-- <el-form-item label="支付折扣" prop="discount">-->
<!-- <el-input v-model="form.discount" placeholder="请输入支付折扣数字8.8"></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row>-->
<!-- <el-col :span="24">-->
<!-- <el-form-item label="积分加速" prop="speedPoint">-->
<!-- <el-input v-model="form.speedPoint" placeholder="请输入积分加速,积分加速倍数,数字"></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -588,6 +533,9 @@ export default {
name: [ name: [
{ required: true, message: "等级名称不能为空", trigger: "blur" }, { required: true, message: "等级名称不能为空", trigger: "blur" },
], ],
growthValue: [
{ required: true, message: "请填写会员升级所需成长值", trigger: "blur" },
],
gasoline: [ gasoline: [
{ required: true, message: "请填写汽油成长值", trigger: "blur" }, { required: true, message: "请填写汽油成长值", trigger: "blur" },
], ],

View File

@ -25,7 +25,7 @@ public class LJGoodsController extends BaseController {
private LJGoodsService goodsService; private LJGoodsService goodsService;
/** /**
* 根据条件查询商品信息 * 根据条件查询商品信息 传参pagepageSize商品是否在回收站isRecovery0不在1在
* @param goods * @param goods
* @param pageNo * @param pageNo
* @param pageSize * @param pageSize

View File

@ -37,6 +37,16 @@ public class OilOrderController extends BaseController {
return getSuccessResult(list); return getSuccessResult(list);
} }
/**
* 根据id查询油品订单信息
* @param id
* @return
*/
@GetMapping("/{id}")
public ResponseObject oilOrderInfo(@PathVariable Integer id){
return getSuccessResult(orderService.selectOilOrderById(id));
}
/** /**
* 批量添加订单信息 * 批量添加订单信息
* @param map * @param map

View File

@ -28,6 +28,13 @@ public interface OilOrderService extends IService<OilOrder> {
*/ */
public OilOrder selectOilOrderByOrderNo(String orderNo); public OilOrder selectOilOrderByOrderNo(String orderNo);
/**
* 根据id查询油品订单信息
* @param id
* @return
*/
public OilOrder selectOilOrderById(int id);
/** /**
* 根据订单号模糊查询商品订单信息 * 根据订单号模糊查询商品订单信息
* @param orderNo * @param orderNo

View File

@ -70,6 +70,11 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
return order; return order;
} }
@Override
public OilOrder selectOilOrderById(int id) {
return baseMapper.selectById(id);
}
@Override @Override
public List<OilOrderVo> queryOilOrderByOrderNo(String orderNo) { public List<OilOrderVo> queryOilOrderByOrderNo(String orderNo) {
List<OilOrderVo> oilOrderVos = baseMapper.selectOilOrderByOrderNo(orderNo); List<OilOrderVo> oilOrderVos = baseMapper.selectOilOrderByOrderNo(orderNo);
@ -92,6 +97,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
String oilOrder = map.get("oilOrder"); String oilOrder = map.get("oilOrder");
// 商品订单信息 // 商品订单信息
String goodsOrder = map.get("goodsOrder"); String goodsOrder = map.get("goodsOrder");
// 囤油卡变化之后的信息
String refuelMoney = map.get("refuelMoney");
// 支付类型 // 支付类型
String payType = map.get("payType"); String payType = map.get("payType");
// 油品订单金额 // 油品订单金额
@ -193,7 +200,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
} }
if (userId!=null){ if (userId!=null){
this.updateGrowthValue(oilActualPay, userId, Integer.valueOf(jsonObjects.get(i).get("oilName").toString())); this.updateGrowthValue(oilActualPay, userId, Integer.valueOf(jsonObjects.get(i).get("oilName").toString()),refuelMoney);
} }
order.setStoreId(storeId); order.setStoreId(storeId);
order.setUserId(userId); order.setUserId(userId);
@ -316,7 +323,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
/** /**
* 修改用户成长值信息 * 修改用户成长值信息
*/ */
private void updateGrowthValue(Double oilActualPay,Integer userid,Integer oilId){ private void updateGrowthValue(Double oilActualPay,Integer userid,Integer oilId,String refuelMoney){
if (oilId!=null){ if (oilId!=null){
OilName oilName = oilNameService.selectOilNameById(oilId); OilName oilName = oilNameService.selectOilNameById(oilId);
// 获取成长值增长数值 // 获取成长值增长数值
@ -327,6 +334,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
LJUser user = userService.selectUserById(userid); LJUser user = userService.selectUserById(userid);
UserBalance balance = userBalanceService.selectUserBalance(userid); UserBalance balance = userBalanceService.selectUserBalance(userid);
int growth = balance.getGrowthValue(); int growth = balance.getGrowthValue();
balance.setRefuelMoney(refuelMoney);
// 查询会员等级列表信息 // 查询会员等级列表信息
Page page = new Page(1,20); Page page = new Page(1,20);
LJUserGrade ljUserGrade1 = new LJUserGrade(); LJUserGrade ljUserGrade1 = new LJUserGrade();
@ -351,6 +359,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
Integer addVal = (int) (dieselGrowthValue * oilActualPay); Integer addVal = (int) (dieselGrowthValue * oilActualPay);
Integer growthAfter = growth + addVal; Integer growthAfter = growth + addVal;
// 如果会员成长值达到会员等级成长值则修改会员的会员等级信息 // 如果会员成长值达到会员等级成长值则修改会员的会员等级信息
System.out.println(records.size());
for (int i = 0; i < records.size(); i++){ for (int i = 0; i < records.size(); i++){
if ((growthAfter-records.get(i).getGrowthValue())<100 && (growthAfter-records.get(i).getGrowthValue())>0){ if ((growthAfter-records.get(i).getGrowthValue())<100 && (growthAfter-records.get(i).getGrowthValue())>0){
user.setGradeId(records.get(i).getId()); user.setGradeId(records.get(i).getId());

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fuint.business.userManager.mapper.LJUserMapper"> <mapper namespace="com.fuint.business.userManager.mapper.LJUserMapper">
<sql id="selectUser"> <sql id="selectUser">
select mu.*,mub.card_balance,mub.points from mt_user mu 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 inner join mt_user_balance mub on mu.id = mub.mt_user_id
</sql> </sql>

View File

@ -59,6 +59,7 @@ public class LJUserVo extends BaseEntity {
// 成长值 // 成长值
private Integer growthValue; private Integer growthValue;
// 油量
private String refuelMoney; private String refuelMoney;
// 出生日期 // 出生日期

View File

@ -0,0 +1,10 @@
import request from '@/utils/request'
// 查询优惠券信息列表
export function listCardFavorableRecord(cardValueRecord) {
return request({
url: '/business/marketingActivity/cardFavorableRecord',
method: 'get',
params: cardValueRecord
})
}

View File

@ -1,10 +1,18 @@
import request from '@/utils/request' import request from '@/utils/request'
// 查询挂账信息列表 // 查询挂账信息列表
export function listCardValueRecord(query) { export function listCardValueRecord(cardValueRecord) {
return request({ return request({
url: '/business/marketingActivity/cardValueRecord', url: '/business/marketingActivity/cardValueRecord',
method: 'get', method: 'get',
params: query params: cardValueRecord
})
}
// 查询挂账信息列表
export function cardValueRecordInfo(id) {
return request({
url: '/business/marketingActivity/cardValueRecord/'+id,
method: 'get',
}) })
} }

View File

@ -1,6 +1,6 @@
import request from '@/utils/request' import request from '@/utils/request'
// 查询油品订单列表 // 查询收银台订单列表
export function listCashierOrder(query) { export function listCashierOrder(query) {
return request({ return request({
url: '/business/cashierOrder/list', url: '/business/cashierOrder/list',
@ -9,7 +9,7 @@ export function listCashierOrder(query) {
}) })
} }
// 根据id查询油品订单列表 // 根据id查询收银台订单列表
export function cashierOrder(id) { export function cashierOrder(id) {
return request({ return request({
url: '/business/cashierOrder/'+id, url: '/business/cashierOrder/'+id,

View File

@ -0,0 +1,43 @@
import request from "@/utils/request";
// 查询油罐列表
export function getGunApi(data) {
return request({
url: '/business/petrolStationManagement/oilGun/selectByNumberTGUn',
method: 'get',
params: data
})
}
// 新增有关信息
export function insertGunApi(data) {
return request({
url: 'business/petrolStationManagement/oilGun',
method: 'post',
data: data
})
}
// 修改有关信息
export function updateGunApi(data) {
return request({
url: 'business/petrolStationManagement/oilGun',
method: 'put',
data: data
})
}
// 根据油号查询油罐
export function selectTankByNumberApi(data) {
return request({
url: 'business/petrolStationManagement/oilTank/selectList?numberId='+data,
method: 'get',
params: data
})
}
// 查询油罐列表
export function delGunApi(data) {
return request({
url: '/business/petrolStationManagement/oilGun/',
method: 'delete',
params: data
})
}

View File

@ -9,6 +9,14 @@ export function listOilOrder(query) {
}) })
} }
// 根据id查询油品订单信息
export function oilOrderInfo(id) {
return request({
url: '/business/oilOrder/'+id,
method: 'get',
})
}
// 新增油品订单信息 // 新增油品订单信息
export function addLJGoods(data) { export function addLJGoods(data) {
return request({ return request({

View File

@ -1,5 +1,6 @@
<template> <template>
<div class="app-center"> <div class="app-center">
<!-- 支付金额会员登录-->
<div class="center-left"> <div class="center-left">
<div class="center-vh"> <div class="center-vh">
<div class="center-left-top"> <div class="center-left-top">
@ -36,7 +37,7 @@
border-radius: 5px;text-align: center"> border-radius: 5px;text-align: center">
<el-tooltip placement="top"> <el-tooltip placement="top">
<div slot="content"> <div slot="content">
会员等级{{ getGrade(member.gradeId) }} 会员等级{{ gradeName }}
</div> </div>
<i class="el-icon-medal" style="font-size: 35px"></i> <i class="el-icon-medal" style="font-size: 35px"></i>
</el-tooltip> </el-tooltip>
@ -60,6 +61,17 @@
<div>充值优惠</div> <div>充值优惠</div>
<div>-0</div> <div>-0</div>
</div> </div>
<div class="center-left-hj" v-show="isMember && refuelMoney!=null">
<div>
囤油卡
<div style="margin: 5px 0" v-for="(item,index) in refuelMoney" :key="index">
{{ item.type }}
<span style="color: #00afff">{{ item.oilType }}</span>
余额{{ item.refuelMoney }}L
</div>
</div>
<div>- {{ consumeRefuelMoney }}L</div>
</div>
<div class="center-left-hj" v-show="isMember"> <div class="center-left-hj" v-show="isMember">
<div> <div>
储值卡 储值卡
@ -93,7 +105,7 @@
<div class="center-left-bottom"> <div class="center-left-bottom">
<div> <div>
<div class="bottom-price">{{ oilActualPay + goodsActualPay }}</div> <div class="bottom-price">{{ oilActualPay + goodsActualPay }}</div>
<div class="price-red">优惠合计{{ oilDiscount + goodsDiscount }}</div> <div class="price-red">优惠合计{{ oilDiscount + goodsDiscount }}/{{consumeRefuelMoney}}L</div>
</div> </div>
<div class="center-left-lv" @click="settlement">立即结算</div> <div class="center-left-lv" @click="settlement">立即结算</div>
</div> </div>
@ -101,6 +113,7 @@
</div> </div>
<!-- 油品选择-->
<div class="center-right"> <div class="center-right">
<div class="center-top"> <div class="center-top">
<div class="center-top-tab"> <div class="center-top-tab">
@ -108,19 +121,24 @@
<el-tab-pane label="全部" name="1"></el-tab-pane> <el-tab-pane label="全部" name="1"></el-tab-pane>
<el-tab-pane v-for="item in oilNameList" :key="item.id" <el-tab-pane v-for="item in oilNameList" :key="item.id"
:label="item.oilName" :name="item.id+''"></el-tab-pane> :label="item.oilName" :name="item.id+''"></el-tab-pane>
<!-- <el-tab-pane label="95#" name="third"></el-tab-pane>--> <!-- <el-tab-pane v-for="(item,index) in gunList" :key="index"-->
<!-- <el-tab-pane label="98#" name="fourth"></el-tab-pane>--> <!-- :label="item.oilName" :name="item.numberId+''"></el-tab-pane>-->
<!-- <el-tab-pane label="0#" name="one"></el-tab-pane>-->
<!-- <el-tab-pane label="京0#" name="two"></el-tab-pane>-->
<!-- <el-tab-pane label="京10#" name="three"></el-tab-pane>-->
<!-- <el-tab-pane label="CNG" name="frou"></el-tab-pane>-->
<!-- <el-tab-pane label="LNG" name="frous"></el-tab-pane>-->
</el-tabs> </el-tabs>
</div> </div>
<div class="center-top-data"> <div class="center-top-data">
<div class="center-top-of"> <div class="center-top-of">
<div class="wrap-wrap"> <div class="wrap-wrap">
<!-- <div class="of-box" v-for="(item,index) in oilNumGunList" :key="index"-->
<!-- :style="{'background-color': colorList[index%5].color}"-->
<!-- @click="refuel(item.id)">-->
<!-- <div>{{ getName(oilNameList,item.oilName) }}</div>-->
<!-- <div class="of-title" >{{item.oilGunNum}}号枪</div>-->
<!-- <div>-->
<!-- <img src="../../../assets/images/jya.png" style="width: 18px;height: 18px;">-->
<!-- </div>-->
<!-- </div>-->
<div class="of-box" v-for="(item,index) in oilNumGunList" :key="index" <div class="of-box" v-for="(item,index) in oilNumGunList" :key="index"
:style="{'background-color': colorList[index%5].color}" :style="{'background-color': colorList[index%5].color}"
@click="refuel(item.id)"> @click="refuel(item.id)">
@ -147,6 +165,7 @@
</div> </div>
</div> </div>
<!-- 商品选择-->
<div class="center-app"> <div class="center-app">
<div class="center-top"> <div class="center-top">
<div class="center-top-title">非油商品</div> <div class="center-top-title">非油商品</div>
@ -240,6 +259,7 @@
<!-- <el-button type="primary" @click="dialogVisible = false"> </el-button>--> <!-- <el-button type="primary" @click="dialogVisible = false"> </el-button>-->
</span> </span>
</el-dialog> </el-dialog>
<!-- 挂单--> <!-- 挂单-->
<el-dialog <el-dialog
title="挂单提示" title="挂单提示"
@ -266,6 +286,7 @@
<el-button type="primary" @click="registration"> </el-button> <el-button type="primary" @click="registration"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- 挂单成功提示--> <!-- 挂单成功提示-->
<el-dialog <el-dialog
title="挂单成功" title="挂单成功"
@ -279,6 +300,7 @@
<el-button type="primary" @click="dialogSuccess = false"> </el-button> <el-button type="primary" @click="dialogSuccess = false"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- 取单提示--> <!-- 取单提示-->
<el-dialog <el-dialog
title="取单" title="取单"
@ -321,6 +343,7 @@
</span> </span>
</span> </span>
</el-dialog> </el-dialog>
<!-- 立即结算--> <!-- 立即结算-->
<el-dialog <el-dialog
title="扫码支付" title="扫码支付"
@ -334,7 +357,7 @@
{{ oilActualPay + goodsActualPay }} {{ oilActualPay + goodsActualPay }}
</div> </div>
<div style="text-align: center;margin-bottom: 10px"> <div style="text-align: center;margin-bottom: 10px">
合计金额{{ oilAmount + goodsAmount }}优惠合计13.02 合计金额{{ oilAmount + goodsAmount }}优惠合计{{ oilDiscount + goodsDiscount }}
</div> </div>
<div> <div>
<el-input v-model="authCode" <el-input v-model="authCode"
@ -378,6 +401,7 @@
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
<!-- 会员登录--> <!-- 会员登录-->
<el-dialog <el-dialog
title="会员信息" title="会员信息"
@ -410,18 +434,17 @@
</el-descriptions> </el-descriptions>
<el-descriptions title="储值余额"> <el-descriptions title="储值余额">
<template slot="extra"> <template slot="extra">
<sapn style="color: red;margin-right: 20px">余额充值</sapn> <span style="color: red;margin-right: 20px">余额充值</span>
<sapn style="font-weight: bold">{{member.cardBalance ? member.cardBalance : "--"}}</sapn> <span style="font-weight: bold">{{member.cardBalance ? member.cardBalance : "--"}}</span>
</template> </template>
<el-descriptions-item v-if="member.cardBalance!=0" label="账户余额">{{member.cardBalance ? member.cardBalance : "--"}}</el-descriptions-item> <el-descriptions-item v-if="member.cardBalance!=0" label="账户余额">{{member.cardBalance ? member.cardBalance : "--"}}</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-row> </el-row>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogVisiblevip = false"> </el-button> <el-button @click="dialogVisiblevip = false"> </el-button>
<el-button type="primary" @click="chooseUser(member.mobile,member.id)"> </el-button> <el-button type="primary" @click="chooseUser(member)"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- 油号选择-->
<!-- 加油枪加油金额--> <!-- 加油枪加油金额-->
<el-dialog <el-dialog
@ -505,17 +528,25 @@
import {queryStaffs, staffInfo} from "@/api/cashier/staff"; import {queryStaffs, staffInfo} from "@/api/cashier/staff";
import {addLJGoods, goodsOrder, oilOrder} from "@/api/cashier/oilorder"; import {addLJGoods, goodsOrder, oilOrder} from "@/api/cashier/oilorder";
import {getUserGrade} from "@/api/cashier/usergrade"; import {getUserGrade} from "@/api/cashier/usergrade";
import {getGunApi} from "@/api/cashier/oilGuns";
import {listCardFavorableRecord} from "@/api/cashier/cardfavorablerecord";
export default { export default {
name: "homeindex", name: "homeindex",
data(){ data(){
return{ return{
//
couponList:[],
//
consumeRefuelMoney:0,
//
refuelMoney:null,
// //
consumeAmount:0, consumeAmount:0,
// //
balance:0, balance:0,
// //
amount:'', amount:0,
// //
loading:false, loading:false,
// //
@ -565,9 +596,7 @@
// //
goods:"", goods:"",
select:"元", select:"元",
form:{ form:{ amount : 0 },
amount : 0
},
oilNumGunList:[], oilNumGunList:[],
authCode:'', authCode:'',
// //
@ -608,9 +637,9 @@
], ],
restaurants:'', restaurants:'',
num: 1, num: 1,
// //
oilNameList:'', oilNameList:'',
// //
staffList:[], staffList:[],
isMember: false, isMember: false,
// //
@ -657,6 +686,8 @@
goodsNum:0, goodsNum:0,
// //
consumeAmount:0, consumeAmount:0,
// json
refuelMoney:"",
}, },
gradeName:"", gradeName:"",
menu:1, menu:1,
@ -666,6 +697,7 @@
orderNo:'', orderNo:'',
timer: null, timer: null,
isQuery:true, isQuery:true,
gunList:[],
} }
}, },
created() { created() {
@ -674,11 +706,11 @@
this.getGoods(); this.getGoods();
this.getStaffList(); this.getStaffList();
this.getStaff(); this.getStaff();
}, this.getList();
mounted(){ this.getCouponList();
// this.restaurants = this.goodsList;
}, },
methods:{ methods:{
//
querySearch(queryString, cb) { querySearch(queryString, cb) {
let _this = this; let _this = this;
let results = _this.goodsList; let results = _this.goodsList;
@ -743,44 +775,329 @@
this.isMember = false; this.isMember = false;
this.map.payUser == ""; this.map.payUser == "";
this.balance = 0; this.balance = 0;
this.oilDiscount = 0;
this.goodsDiscount = 0;
this.userNo = ""; this.userNo = "";
this.oilActualPay = this.oilAmount - this.oilDiscount
this.goodsActualPay = this.goodsAmount - this.goodsDiscount
this.handleChange(); this.handleChange();
}, },
// //
getGrade(id){ getGrade(id){
let _this = this;
this.oilDiscount = 0;
getUserGrade(id).then( response => { getUserGrade(id).then( response => {
this.gradeName = response.data.name; let gasolineDiscount = 0;
// if (this.oilType == ""){ let dieselDiscount = 0;
// let naturalGasDiscount = 0;
_this.oilOrder.forEach(item => {
if (item.oilType == "汽油"){
let gasolineRule = JSON.parse(response.data.gasolineRule);
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy'){
if (response.data.gasolineDiscount=="满减优惠"){
let oilDiscount = 0;
for (let i = 1; i <= gasolineRule.length; i++){
if (gasolineRule.length>1){
if (item.amount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
oilDiscount = (item.amount/gasolineRule[gasolineRule.length-1].gasolineRule1 *
gasolineRule[gasolineRule.length-1].gasolineRule2).toFixed(2);
break;
}
if (item.amount >= gasolineRule[i-1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1){
oilDiscount = (item.amount/gasolineRule[i-1].gasolineRule1 * gasolineRule[i-1].gasolineRule2).toFixed(2)
}
}else {
if (item.amount >= gasolineRule[i-1].gasolineRule1){
oilDiscount = (item.amount/gasolineRule[i-1].gasolineRule1 * gasolineRule[i-1].gasolineRule2).toFixed(2);
}
}
}
gasolineDiscount += +oilDiscount
}else if (response.data.gasolineDiscount=="每升优惠"){
let oilDiscount = 0;
for (let i = 1; i <= gasolineRule.length; i++){
if (gasolineRule.length>1){
if (item.amount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
oilDiscount = (item.liters * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2);
break;
}
if (item.amount >= gasolineRule[i-1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1){
oilDiscount = (item.liters * gasolineRule[i-1].gasolineRule3).toFixed(2)
}
}else {
if (item.amount >= gasolineRule[i-1].gasolineRule1){
oilDiscount = (item.liters * gasolineRule[i-1].gasolineRule3).toFixed(2)
}
}
}
gasolineDiscount += +oilDiscount
}else {
gasolineDiscount = 0;
}
}
}
if (item.oilType == "柴油"){
let dieselRule = JSON.parse(response.data.dieselRule);
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy'){
if (response.data.dieselDiscount=="满减优惠"){
let oilDiscount = 0;
for (let i = 1; i <= dieselRule.length; i++){
if (dieselRule.length>1){
if (item.amount >= dieselRule[dieselRule.length-1].dieselRule1){
oilDiscount = (item.amount/dieselRule[dieselRule.length-1].dieselRule1 *
dieselRule[dieselRule.length-1].dieselRule2).toFixed(2);
break;
}
if (item.amount >= dieselRule[i-1].dieselRule1 && item.amount < dieselRule[i].dieselRule1){
oilDiscount = (item.amount/dieselRule[i-1].dieselRule1 * dieselRule[i-1].dieselRule2).toFixed(2);
}
}else {
if (item.amount >= dieselRule[i-1].dieselRule1){
oilDiscount = (item.amount/dieselRule[i-1].dieselRule1 * dieselRule[i-1].dieselRule2).toFixed(2);
}
}
}
dieselDiscount += +oilDiscount
}else if (response.data.dieselDiscount=="每升优惠"){
let oilDiscount = 0;
for (let i = 1; i <= dieselRule.length; i++){
if (dieselRule.length>1){
if (item.amount >= dieselRule[dieselRule.length-1].dieselRule1){
oilDiscount = (item.liters * dieselRule[gasolineRule.length-1].dieselRule3).toFixed(2);
break;
}
if (item.amount >= dieselRule[i-1].dieselRule1 && item.amount < dieselRule[i].dieselRule1){
oilDiscount = (item.liters * dieselRule[i-1].dieselRule3).toFixed(2)
}
}else {
if (item.amount >= dieselRule[i-1].dieselRule1){
oilDiscount = (item.liters * dieselRule[i-1].dieselRule3).toFixed(2)
}
}
}
dieselDiscount += +oilDiscount
}else {
dieselDiscount = 0;
}
}
}
if (item.oilType == "天然气"){
let naturalGasRule = JSON.parse(response.data.naturalGasRule);
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy'){
if (response.data.naturalGasDiscount=="满减优惠"){
let oilDiscount = 0;
for (let i = 1; i <= naturalGasRule.length; i++){
if (naturalGasRule.length>1){
if (item.amount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
oilDiscount = (item.amount/naturalGasRule[naturalGasRule.length-1].naturalGasRule1 *
naturalGasRule[naturalGasRule.length-1].naturalGasRule2).toFixed(2);
break;
}
if (item.amount >= naturalGasRule[i-1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1){
oilDiscount = (item.amount/naturalGasRule[i-1].naturalGasRule1 * naturalGasRule[i-1].naturalGasRule2).toFixed(2);
}
}else {
if (item.amount >= naturalGasRule[i-1].naturalGasRule1){
oilDiscount = (item.amount/naturalGasRule[i-1].naturalGasRule1 * naturalGasRule[i-1].naturalGasRule2).toFixed(2);
}
}
}
naturalGasDiscount += +oilDiscount
}else if (response.data.naturalGasDiscount=="每单位优惠"){
let oilDiscount = 0;
for (let i = 1; i <= naturalGasRule.length; i++){
if (naturalGasRule.length>1){
if (item.amount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
oilDiscount = (item.liters * naturalGasRule[gasolineRule.length-1].naturalGasRule3).toFixed(2)
break;
}
if (item.amount >= naturalGasRule[i-1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1){
oilDiscount = (item.liters * naturalGasRule[i-1].naturalGasRule3).toFixed(2)
}
}else {
if (item.amount >= naturalGasRule[i-1].naturalGasRule1){
oilDiscount = (item.liters * naturalGasRule[i-1].naturalGasRule3).toFixed(2)
}
}
}
naturalGasDiscount += +oilDiscount
}else {
naturalGasDiscount = 0;
}
}
}
})
// if (_this.oilType == ""){
// let gasolineRule = JSON.parse(response.data.gasolineRule);
// if (response.data.preferential == '' && response.data.status == 'qy'){
// _this.oilOrder.forEach(item => {
// if (response.data.gasolineDiscount==""){
// let oilDiscount = 0;
// for (let i = 0; i < gasolineRule.length; i++){
// if (gasolineRule.length>1){
// if (item.amount >= gasolineRule[i].gasolineRule1 && item.amount < gasolineRule[i+1].gasolineRule1){
// oilDiscount = item.amount/gasolineRule[i].gasolineRule1 * gasolineRule[i].gasolineRule2
// }
// if (item.amount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
// oilDiscount = item.amount/gasolineRule[gasolineRule.length-1].gasolineRule1 * gasolineRule[gasolineRule.length-1].gasolineRule2
// }
// }else {
// if (item.amount >= gasolineRule[i].gasolineRule1){
// oilDiscount = item.amount/gasolineRule[i].gasolineRule1 * gasolineRule[i].gasolineRule2
// }
// }
// }
// gasolineDiscount += oilDiscount
// }else if (response.data.gasolineDiscount==""){
// let oilDiscount = 0;
// for (let i = 0; i < gasolineRule.length; i++){
// if (gasolineRule.length>1){
// if (item.amount >= gasolineRule[i].gasolineRule1 && item.amount < gasolineRule[i+1].gasolineRule1){
// oilDiscount = item.liters * gasolineRule[i].gasolineRule3
// }
// if (item.amount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
// oilDiscount = item.liters * gasolineRule[i].gasolineRule3
// }
// }else {
// if (item.amount >= gasolineRule[i].gasolineRule1){
// oilDiscount = item.liters * gasolineRule[i].gasolineRule3
// }
// }
// }
// gasolineDiscount += oilDiscount
// }else {
// gasolineDiscount = 0;
// }
// })
// }
// } // }
// if (this.oilType == ""){ // if (_this.oilType == ""){
// // let dieselRule = JSON.parse(response.data.dieselRule);
// if (response.data.preferential == '' && response.data.status == 'qy'){
// _this.oilOrder.forEach(item => {
// if (response.data.dieselDiscount==""){
// let oilDiscount = 0;
// for (let i = 0; i < dieselRule.length; i++){
// if (dieselRule.length>1){
// if (item.amount >= dieselRule[i].dieselRule1 && item.amount < dieselRule[i+1].dieselRule1){
// oilDiscount = item.amount/dieselRule[i].dieselRule1 * dieselRule[i].dieselRule2
// }
// if (item.amount >= dieselRule[dieselRule.length-1].dieselRule1){
// oilDiscount = item.amount/dieselRule[dieselRule.length-1].dieselRule1 * dieselRule[dieselRule.length-1].dieselRule2
// }
// }else {
// if (item.amount >= dieselRule[i].dieselRule1){
// oilDiscount = item.amount/dieselRule[i].dieselRule1 * dieselRule[i].dieselRule2
// }
// }
// }
// dieselDiscount += oilDiscount
// }else if (response.data.dieselDiscount==""){
// let oilDiscount = 0;
// for (let i = 0; i < dieselRule.length; i++){
// if (dieselRule.length>1){
// if (item.amount >= dieselRule[i].dieselRule1 && item.amount < dieselRule[i+1].dieselRule1){
// oilDiscount = item.liters * dieselRule[i].dieselRule3
// }
// if (item.amount >= dieselRule[dieselRule.length-1].dieselRule1){
// oilDiscount = item.liters * dieselRule[i].dieselRule3
// }
// }else {
// if (item.amount >= dieselRule[i].dieselRule1){
// oilDiscount = item.liters * dieselRule[i].dieselRule3
// }
// }
// }
// dieselDiscount += oilDiscount
// }else {
// dieselDiscount = 0;
// }
// })
// }
// } // }
// if (this.oilType == ""){ // if (_this.oilType == ""){
// // let naturalGasRule = JSON.parse(response.data.naturalGasRule);
// if (response.data.preferential == '' && response.data.status == 'qy'){
// _this.oilOrder.forEach(item => {
// if (response.data.naturalGasDiscount==""){
// let oilDiscount = 0;
// for (let i = 0; i < naturalGasRule.length; i++){
// if (naturalGasRule.length>1){
// if (item.amount >= naturalGasRule[i].naturalGasRule1 && item.amount < naturalGasRule[i+1].naturalGasRule1){
// oilDiscount = item.amount/naturalGasRule[i].naturalGasRule1 * naturalGasRule[i].naturalGasRule2
// }
// if (item.amount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
// oilDiscount = item.amount/naturalGasRule[naturalGasRule.length-1].naturalGasRule1 * naturalGasRule[naturalGasRule.length-1].naturalGasRule2
// }
// }else {
// if (item.amount >= naturalGasRule[i].naturalGasRule1){
// oilDiscount = item.amount/naturalGasRule[i].naturalGasRule1 * naturalGasRule[i].naturalGasRule2
// }
// }
// }
// naturalGasDiscount += oilDiscount
// }else if (response.data.naturalGasDiscount==""){
// let oilDiscount = 0;
// for (let i = 0; i < naturalGasRule.length; i++){
// if (naturalGasRule.length>1){
// if (item.amount >= naturalGasRule[i].naturalGasRule1 && item.amount < naturalGasRule[i+1].naturalGasRule1){
// oilDiscount = item.liters * naturalGasRule[i].naturalGasRule3
// }
// if (item.amount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
// oilDiscount = item.liters * naturalGasRule[i].naturalGasRule3
// }
// }else {
// if (item.amount >= naturalGasRule[i].naturalGasRule1){
// oilDiscount = item.liters * naturalGasRule[i].naturalGasRule3
// }
// }
// }
// naturalGasDiscount += oilDiscount
// }else {
// naturalGasDiscount = 0;
// }
// })
// }
// } // }
let oilActualPay = _this.oilActualPay;
_this.oilDiscount = gasolineDiscount + dieselDiscount + naturalGasDiscount
_this.oilActualPay = oilActualPay - _this.oilDiscount;
//
if (_this.balance>=(_this.oilAmount - _this.oilDiscount)){
_this.consumeAmount = _this.oilAmount - _this.oilDiscount;
_this.oilActualPay = 0;
}else {
_this.consumeAmount = _this.balance;
_this.oilActualPay = oilActualPay - _this.oilDiscount - _this.balance;
}
}) })
return this.gradeName;
}, },
// //
chooseUser(mobile,id){ chooseUser(data){
this.dialogVisiblevip = false this.dialogVisiblevip = false
this.isMember = true; this.isMember = true;
this.map.payUser = mobile; this.map.payUser = data.mobile;
this.map.userId = id; this.map.userId = data.id;
this.balance = this.member.cardBalance; this.balance = this.member.cardBalance;
if (this.balance>=(this.oilAmount - this.oilDiscount)){ this.getGrade(data.gradeId)
this.consumeAmount = this.oilAmount - this.oilDiscount; this.changeRefuelMoney();
this.oilActualPay = 0;
}else {
this.consumeAmount = this.balance;
this.oilActualPay = this.oilAmount - this.oilDiscount - this.balance;
}
this.handleChange(); this.handleChange();
this.queryCoupon(this.couponList,data.id);
},
// 使
queryCoupon(list,id){
let result = false;
list.forEach(item => {
if (item.mtUserId==id){
}
})
}, },
// //
handleChoose(data){ handleChoose(data){
this.member = data; this.member = data;
this.refuelMoney = JSON.parse(data.refuelMoney)
this.dialogVisibleMember = false; this.dialogVisibleMember = false;
}, },
// //
@ -789,6 +1106,7 @@
this.goodsTotal = 0; this.goodsTotal = 0;
this.goodsAmount = 0; this.goodsAmount = 0;
this.goodsActualPay = 0; this.goodsActualPay = 0;
this.goodsDiscount = 0;
}, },
// //
getStaff(){ getStaff(){
@ -857,7 +1175,11 @@
this.oilActualPay = 0; this.oilActualPay = 0;
this.oilTotal = 0; this.oilTotal = 0;
this.oilAmount = 0; this.oilAmount = 0;
this.amount = ""; this.oilDiscount = 0;
this.consumeAmount = 0;
this.consumeRefuelMoney = 0;
this.refuelMoney = JSON.parse(this.member.refuelMoney)
this.amount = 0;
}, },
// //
getStaffList(){ getStaffList(){
@ -868,7 +1190,19 @@
// //
getOilOrder(){ getOilOrder(){
this.dialogVisibleamount = false this.dialogVisibleamount = false
this.form.oilType = this.oilType;
//
if (this.select == "元"){
this.form.liters = (this.form.amount/this.form.oilPrice).toFixed(2)
}else {
this.form.liters = this.form.amount
this.form.amount = this.form.oilPrice * this.form.amount
}
//
let name1 = this.getName(this.oilNameList,this.form.oilName);
this.form.oilType = name1;
this.oilOrder.push(this.form) this.oilOrder.push(this.form)
if (this.select == "元"){ if (this.select == "元"){
this.oilAmount = +this.form.amount + this.oilAmount; this.oilAmount = +this.form.amount + this.oilAmount;
if (this.balance!=0){ if (this.balance!=0){
@ -883,11 +1217,47 @@
this.oilActualPay = this.oilAmount - this.oilDiscount; this.oilActualPay = this.oilAmount - this.oilDiscount;
} }
}else { }else {
this.oilAmount = +(this.form.oilPrice * this.form.amount) + this.oilAmount; this.oilAmount = this.form.amount + this.oilAmount;
this.oilActualPay = this.oilAmount - this.oilDiscount; this.oilActualPay = this.oilAmount - this.oilDiscount;
} }
this.oilTotal += 1; this.oilTotal += 1;
this.select = "元"; this.select = "元";
if (this.isMember){
this.getGrade(this.member.gradeId)
this.changeRefuelMoney();
}
},
changeRefuelMoney(){
let _this = this;
_this.consumeRefuelMoney = 0;
_this.oilActualPay = 0;
_this.oilOrder.forEach(item => {
let conRefMon = 0;
let oilActualPay = 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)
}
result = true;
}else {
if (result==false){
oilActualPay = item.amount
}
}
}
}
_this.consumeRefuelMoney += +conRefMon
_this.oilActualPay += +oilActualPay
})
}, },
// L // L
changeSelect(){ changeSelect(){
@ -962,6 +1332,7 @@
}, },
// //
refuel(id){ refuel(id){
this.select = "元";
this.amount = 0 this.amount = 0
this.dialogVisibleamount = true; this.dialogVisibleamount = true;
getOilNumGunById(id).then( response => { getOilNumGunById(id).then( response => {
@ -983,6 +1354,8 @@
this.map.authCode = this.authCode; this.map.authCode = this.authCode;
this.map.allAmount = this.oilActualPay + this.goodsActualPay; this.map.allAmount = this.oilActualPay + this.goodsActualPay;
this.map.consumeAmount = this.consumeAmount; this.map.consumeAmount = this.consumeAmount;
this.updateRefuelMoney();
this.map.refuelMoney = JSON.stringify(this.refuelMoney)
let _this = this; let _this = this;
addLJGoods(_this.map).then( response => { addLJGoods(_this.map).then( response => {
@ -1020,8 +1393,10 @@
_this.goodsActualPay = 0; _this.goodsActualPay = 0;
_this.goodsDiscount = 0; _this.goodsDiscount = 0;
_this.consumeAmount = 0; _this.consumeAmount = 0;
_this.consumeRefuelMoney = 0;
_this.oilTotal = 0; _this.oilTotal = 0;
_this.goodsTotal = 0; _this.goodsTotal = 0;
_this.isMember = false;
}; };
this.map = { this.map = {
allAmount:0, allAmount:0,
@ -1063,6 +1438,23 @@
consumeAmount:0, consumeAmount:0,
}; };
}, },
updateRefuelMoney(){
let _this = this;
_this.oilOrder.forEach(item => {
if (_this.refuelMoney!=null){
_this.refuelMoney.forEach(i => {
if (i.oilType==item.oilType){
if ((i.refuelMoney-item.liters)>=0){
let refuelMoney = i.refuelMoney;
i.refuelMoney = refuelMoney-item.liters
}else {
i.refuelMoney = 0
}
}
})
}
})
},
// //
queryPayStatus(){ queryPayStatus(){
let _this = this; let _this = this;
@ -1174,6 +1566,19 @@
gocomponents(index){ gocomponents(index){
this.leftindex = index this.leftindex = index
}, },
//
getCouponList(){
listCardFavorableRecord().then(response => {
this.couponList = response.data.records
})
},
//
getList(){
getGunApi().then(response => {
this.gunList = response.data;
// console.log(this.gunList)
})
},
}, },
} }

View File

@ -63,10 +63,10 @@
<el-card class="box-card"> <el-card class="box-card">
<div class="wgang"> <div class="wgang">
<div>收银台订单列表</div> <div>收银台订单列表</div>
<div style="display: flex "> <!-- <div style="display: flex ">-->
<el-button type="primary" size="mini" icon="el-icon-plus">新增会员</el-button> <!-- <el-button type="primary" size="mini" icon="el-icon-plus">新增会员</el-button>-->
</div> <!-- </div>-->
</div> </div>
<div class="table-box"> <div class="table-box">
<el-table <el-table
@ -78,21 +78,14 @@
<el-form-item label="收银员"> <el-form-item label="收银员">
<span>{{ getRealName(staffList,props.row.staffId) }}</span> <span>{{ getRealName(staffList,props.row.staffId) }}</span>
</el-form-item> </el-form-item>
<el-form-item label="收银员"> <el-form-item label="收银员手机号">
<span>{{ getMobile(staffList,props.row.staffId) }}</span> <span>{{ getMobile(staffList,props.row.staffId) }}</span>
</el-form-item> </el-form-item>
</el-form> </el-form>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="orderNo" label="订单号" width="180"> </el-table-column>
prop="orderNo" <el-table-column prop="amount" label="订单金额"> </el-table-column>
label="订单号"
width="180">
</el-table-column>
<el-table-column
prop="amount"
label="订单金额">
</el-table-column>
<el-table-column <el-table-column
prop="payAmount" prop="payAmount"
label="实付金额"> label="实付金额">
@ -138,7 +131,6 @@
<el-button style="width: 60px" size="mini" <el-button style="width: 60px" size="mini"
@click="handleRefund(scope.row.id)" @click="handleRefund(scope.row.id)"
type="danger" plain round>退款</el-button> type="danger" plain round>退款</el-button>
</template> </template>
</el-table-column> </el-table-column>

View File

@ -91,10 +91,10 @@
<el-card class="box-card"> <el-card class="box-card">
<div class="wgang"> <div class="wgang">
<div>商品交易列表</div> <div>商品交易列表</div>
<div style="display: flex "> <!-- <div style="display: flex ">-->
<el-button type="primary" size="mini" icon="el-icon-plus">新增会员</el-button> <!-- <el-button type="primary" size="mini" icon="el-icon-plus">新增会员</el-button>-->
</div> <!-- </div>-->
</div> </div>
<div class="table-box"> <div class="table-box">
<el-table <el-table

View File

@ -104,10 +104,10 @@
<el-card class="box-card"> <el-card class="box-card">
<div class="wgang"> <div class="wgang">
<div>油品订单列表</div> <div>油品订单列表</div>
<div style="display: flex "> <!-- <div style="display: flex ">-->
<el-button type="primary" size="mini" icon="el-icon-plus">新增会员</el-button> <!-- <el-button type="primary" size="mini" icon="el-icon-plus">新增会员</el-button>-->
</div> <!-- </div>-->
</div> </div>
<div class="table-box"> <div class="table-box">
<el-table <el-table
@ -191,20 +191,21 @@
width="220"> width="220">
</el-table-column> </el-table-column>
<el-table-column label="注册时间" align="center" width="160" prop="payTime"> <el-table-column label="交易时间" align="center" width="160" prop="payTime">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.payTime) }}</span> <span>{{ scope.row.payTime ? parseTime(scope.row.payTime):"--" }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <!-- <el-button size="mini" type="text" icon="el-icon-edit" >更多操作</el-button>-->
size="mini" <el-button style="width: 60px" size="mini"
type="text" @click="patchwork(scope.row)"
icon="el-icon-edit" type="primary" plain round>补打</el-button>
>更多操作</el-button> <el-button style="width: 60px" size="mini"
@click="handleRefund(scope.row.id)"
type="danger" plain round>退款</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -220,9 +221,36 @@
@current-change="getList"> @current-change="getList">
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
<!-- 订单退款-->
<el-dialog
title="订单退款"
width="25%"
:visible.sync="dialogRefund">
<div style="text-align: center;font-weight: bold">
<span style="font-size: 35px">{{ oilOrder.payAmount }}</span>
</div>
<div class="tk">退款金额</div>
<div class="tk">退款单号{{ oilOrder.orderNo }}</div>
<div style="margin: 10px 0">
退款原因<br/>
<el-radio-group v-model="radio1" style="margin: 10px 0">
<el-radio-button label="油号选错"></el-radio-button>
<el-radio-button label="金额错误"></el-radio-button>
<el-radio-button label="其他原因"></el-radio-button>
</el-radio-group>
</div>
<div>
<el-input placeholder="请输入密码" v-model="password" show-password></el-input>
<br/>
<span style="color: grey;font-size: 12px">退款仅支持全额退款,退款金额将按照支付信息原路退回优惠券储值卡等原路退回处理</span>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogRefund = false"> </el-button>
<el-button type="primary" @click="dialogRefund = false"> </el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
@ -230,13 +258,18 @@
import {queryStaffs} from "@/api/cashier/staff"; import {queryStaffs} from "@/api/cashier/staff";
import {getDicts} from "@/api/dict/data"; import {getDicts} from "@/api/dict/data";
import {getOilNameList, getOilNumGun } from "@/api/cashier/oilnumgun"; import {getOilNameList, getOilNumGun } from "@/api/cashier/oilnumgun";
import {listOilOrder} from "@/api/cashier/oilorder"; import {listOilOrder, oilOrderInfo} from "@/api/cashier/oilorder";
import {getUser} from "@/api/cashier/user/user"; import {getUser} from "@/api/cashier/user/user";
export default { export default {
name: "order_Cashier", name: "order_Cashier",
data(){ data(){
return{ return{
oilOrder:{},
// 退
password:"",
radio1:"油号选错",
dialogRefund:false,
// //
staffList:[], staffList:[],
// //
@ -315,6 +348,22 @@
this.getList(); this.getList();
}, },
methods:{ methods:{
//
patchwork(data){
const orderNo = data.orderNo
this.$modal.confirm('确定您要补打当前订单吗?当前订单号[' + orderNo + '],请确保云打印机正在运行中').then(function() {
// return delUser(row.id);
}).then(() => {
this.$modal.msgSuccess("打印指令已发送打印机,请查看打印结果");
}).catch(() => {});
},
// 退
handleRefund(id){
this.dialogRefund = true;
oilOrderInfo(id).then( response => {
this.oilOrder = response.data
})
},
// id // id
queryStaf(list,id){ queryStaf(list,id){
let name = ""; let name = "";
@ -462,6 +511,10 @@
.top-app-sou{ .top-app-sou{
width: 20%; width: 20%;
} }
.tk{
text-align: center;
color: grey;
margin: 10px 0;
}
</style> </style>

View File

@ -52,10 +52,10 @@
<el-card class="box-card"> <el-card class="box-card">
<div class="wgang"> <div class="wgang">
<div>小程序订单列表</div> <div>小程序订单列表</div>
<div style="display: flex "> <!-- <div style="display: flex ">-->
<el-button type="primary" size="mini" icon="el-icon-plus">新增会员</el-button> <!-- <el-button type="primary" size="mini" icon="el-icon-plus">新增会员</el-button>-->
</div> <!-- </div>-->
</div> </div>
<div class="table-box"> <div class="table-box">
<el-table <el-table
@ -335,7 +335,7 @@ import {queryStaffs} from "@/api/cashier/staff";
}, },
// //
getList(){ getList(){
listCashierOrder(this.queryParams).then( response => { listCashierOrder(this.addDateRange(this.queryParams, this.dateRange)).then( response => {
this.list = response.data.records; this.list = response.data.records;
this.total = response.data.total; this.total = response.data.total;
}) })
@ -418,6 +418,10 @@ import {queryStaffs} from "@/api/cashier/staff";
.top-app-sou{ .top-app-sou{
width: 20%; width: 20%;
} }
.tk{
text-align: center;
color: grey;
margin: 10px 0;
}
</style> </style>

View File

@ -27,19 +27,19 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="支付类型" prop="payType"> <!-- <el-form-item label="支付类型" prop="payType">-->
<el-select <!-- <el-select-->
v-model="queryParams.payType" <!-- v-model="queryParams.payType"-->
clearable <!-- clearable-->
placeholder="全部" <!-- placeholder="全部"-->
> <!-- >-->
<el-option v-for="item in payList" <!-- <el-option v-for="item in payList"-->
:key="item.id" <!-- :key="item.id"-->
:label="item.dictLabel" <!-- :label="item.dictLabel"-->
:value="item.dictValue"> <!-- :value="item.dictValue">-->
</el-option> <!-- </el-option>-->
</el-select> <!-- </el-select>-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="手机号"> <el-form-item label="手机号">
<el-input v-model="queryParams.payUser" placeholder="请输入手机号"></el-input> <el-input v-model="queryParams.payUser" placeholder="请输入手机号"></el-input>
</el-form-item> </el-form-item>
@ -62,18 +62,18 @@
<el-form-item label="订单号"> <el-form-item label="订单号">
<el-input v-model="queryParams.orderNo" placeholder="订单号、官方单号检索"></el-input> <el-input v-model="queryParams.orderNo" placeholder="订单号、官方单号检索"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="交易时间"> <!-- <el-form-item label="交易时间">-->
<el-date-picker <!-- <el-date-picker-->
v-model="dateRange" <!-- v-model="dateRange"-->
style="width: 240px" <!-- style="width: 240px"-->
size="medium" <!-- size="medium"-->
value-format="yyyy-MM-dd" <!-- value-format="yyyy-MM-dd"-->
type="daterange" <!-- type="daterange"-->
range-separator="-" <!-- range-separator="-"-->
start-placeholder="开始日期" <!-- start-placeholder="开始日期"-->
end-placeholder="结束日期" <!-- end-placeholder="结束日期"-->
></el-date-picker> <!-- ></el-date-picker>-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
@ -95,10 +95,10 @@
<el-card class="box-card"> <el-card class="box-card">
<div class="wgang"> <div class="wgang">
<div>未支付订单列表</div> <div>未支付订单列表</div>
<div style="display: flex "> <!-- <div style="display: flex ">-->
<el-button type="primary" size="mini" icon="el-icon-plus">新增会员</el-button> <!-- <el-button type="primary" size="mini" icon="el-icon-plus">新增会员</el-button>-->
</div> <!-- </div>-->
</div> </div>
<div class="table-box"> <div class="table-box">
<el-table <el-table
@ -106,57 +106,39 @@
style="width: 100%"> style="width: 100%">
<el-table-column type="expand"> <el-table-column type="expand">
<template slot-scope="props"> <template slot-scope="props">
<el-form label-position="left" inline class="demo-table-expand"> <el-form label-position="left" class="demo-table-expand" style="margin-left: 20px">
<el-form-item label="名称"> <el-form-item label="收银员">
<span>{{ props.row.name }}</span> <span>{{ getRealName(staffList,props.row.staffId) }}</span>
</el-form-item>
<el-form-item label="收银员手机号">
<span>{{ getMobile(staffList,props.row.staffId) }}</span>
</el-form-item> </el-form-item>
</el-form> </el-form>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="terminal" label="终端" align="center" width="80"></el-table-column>
prop="terminal" <el-table-column prop="oils" label="油品/油枪" align="center">
label="终端">
</el-table-column>
<el-table-column
prop="oils"
label="油品/油枪">
<template slot-scope="props"> <template slot-scope="props">
<span>{{ getName(oilNameList,props.row.oils) }}/{{ props.row.oilGunNum }}号枪</span> <span>{{ getName(oilNameList,props.row.oils) }}/{{ props.row.oilGunNum }}号枪</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="订单信息"> <el-table-column label="订单信息" align="center">
<el-table-column <el-table-column prop="orderNo" label="订单号" align="center"> </el-table-column>
prop="orderNo" <el-table-column prop="orderAmount" label="交易金额" align="center"> </el-table-column>
label="订单号">
</el-table-column>
<el-table-column
prop="orderAmount"
label="交易金额">
</el-table-column>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="payType" label="付款类型" align="center">
prop="payType"
label="付款类型">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{getPayType(payTypeList,scope.row.payType)}}</span> <span>{{getPayType(payTypeList,scope.row.payType)}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="payUser" label="付款用户" align="center">
prop="payUser"
label="付款用户">
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="createTime" label="交易时间" align="center"></el-table-column>
prop="createTime"
label="交易时间">
</el-table-column>
<el-table-column <el-table-column prop="orderStatus" label="支付状态">
prop="orderStatus"
label="支付状态">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.orderStatus == 'unpaid'">未支付</el-tag> <el-tag v-if="scope.row.orderStatus == 'unpaid'">未支付</el-tag>
<el-tag type="info" v-else>支付失败</el-tag> <el-tag type="info" v-else>支付失败</el-tag>
@ -197,6 +179,7 @@
import {listOilOrder} from "@/api/cashier/oilorder"; import {listOilOrder} from "@/api/cashier/oilorder";
import {getDicts} from "@/api/dict/data"; import {getDicts} from "@/api/dict/data";
import {getOilNameList, getOilNumGun} from "@/api/cashier/oilnumgun"; import {getOilNameList, getOilNumGun} from "@/api/cashier/oilnumgun";
import {queryStaffs} from "@/api/cashier/staff";
export default { export default {
name: "order_Cashier", name: "order_Cashier",
@ -285,6 +268,26 @@
this.getPayList(); this.getPayList();
}, },
methods:{ methods:{
//
getRealName(list,val){
let name = "";
list.forEach(item => {
if (item.id == val){
name = item.realName
}
})
return name;
},
//
getMobile(list,val){
let name = "";
list.forEach(item => {
if (item.id == val){
name = item.mobile
}
})
return name;
},
// //
getName(oilNameList,id){ getName(oilNameList,id){
let name = "" let name = ""
@ -323,6 +326,9 @@
getOilNumGun({oilNum : "全部"}).then( response => { getOilNumGun({oilNum : "全部"}).then( response => {
this.oilNumList = response.data this.oilNumList = response.data
}) })
queryStaffs().then( response => {
this.staffList = response.data;
})
}, },
// //
getList(val){ getList(val){

View File

@ -3,18 +3,64 @@
<div> <div>
<!-- 条件查询--> <!-- 条件查询-->
<el-card class="box-card"> <el-card class="box-card">
<div style="display: flex;"> <!-- <div style="display: flex;">-->
<div class="top-app-sou"> <!-- <div class="top-app-sou">-->
<el-form :label-position="labelPosition" label-width="40px" :model="formLabelAlign"> <!-- <el-form :label-position="labelPosition" label-width="40px" :model="formLabelAlign">-->
<el-form-item label="名称"> <!-- <el-form-item label="名称">-->
<el-input v-model="formLabelAlign.name" placeholder="请输入要搜索的内容"></el-input> <!-- <el-input v-model="formLabelAlign.name" placeholder="请输入要搜索的内容"></el-input>-->
</el-form-item> <!-- </el-form-item>-->
</el-form> <!-- </el-form>-->
</div> <!-- </div>-->
<div style="margin-left: 10px"> <!-- <div style="margin-left: 10px">-->
<el-button type="primary" icon="el-icon-search">搜索</el-button> <!-- <el-button type="primary" icon="el-icon-search">搜索</el-button>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
<el-form-item label="交易员工" prop="staffId">
<el-select
v-model="queryParams.mtStaffId"
clearable
placeholder="全部"
>
<el-option v-for="item in staffList" :key="item.id" :label="item.realName" :value="item.id">
<span style="float: left">{{ item.realName }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.mobile }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="支付类型" prop="paymentType">
<el-select
v-model="queryParams.paymentType"
clearable
placeholder="全部"
>
<el-option v-for="item in payList"
:key="item.id"
:label="item.dictLabel"
:value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="手机号">
<el-input v-model="queryParams.mobile" placeholder="请输入会员手机号"></el-input>
</el-form-item>
<!-- <el-form-item label="交易时间">-->
<!-- <el-date-picker-->
<!-- v-model="dateRange"-->
<!-- style="width: 240px"-->
<!-- size="medium"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- type="daterange"-->
<!-- range-separator="-"-->
<!-- start-placeholder="开始日期"-->
<!-- end-placeholder="结束日期"-->
<!-- ></el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-card> </el-card>
<!-- 统计--> <!-- 统计-->
<el-card class="box-card"> <el-card class="box-card">
@ -92,12 +138,13 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <!-- <el-button size="mini" type="text" icon="el-icon-edit">更多操作</el-button>-->
size="mini" <el-button style="width: 60px" size="mini"
type="text" @click="patchwork(scope.row)"
icon="el-icon-edit" type="primary" plain round>补打</el-button>
>更多操作</el-button> <el-button style="width: 60px" size="mini"
@click="handleRefund(scope.row.id)"
type="danger" plain round>退款</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -109,7 +156,7 @@
v-show="total>0" v-show="total>0"
layout="prev, pager, next" layout="prev, pager, next"
:total="total" :total="total"
:page.sync="queryParams.page" :page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@current-change="getList"> @current-change="getList">
</el-pagination> </el-pagination>
@ -117,117 +164,190 @@
</el-card> </el-card>
<!-- 订单退款-->
<el-dialog
title="订单退款"
width="25%"
:visible.sync="dialogRefund">
<div style="text-align: center;font-weight: bold">
<span style="font-size: 35px">{{ oilOrder.rechargeBalance }}</span>
</div>
<div class="tk">退款金额</div>
<div class="tk">会员手机号{{ oilOrder.mobile }}</div>
<div style="margin: 10px 0">
退款原因<br/>
<el-radio-group v-model="radio1" style="margin: 10px 0">
<el-radio-button label="充值类型选错"></el-radio-button>
<el-radio-button label="充值金额错误"></el-radio-button>
<el-radio-button label="其他原因"></el-radio-button>
</el-radio-group>
</div>
<div>
<el-input placeholder="请输入密码" v-model="password" show-password></el-input>
<br/>
<span style="color: grey;font-size: 12px">退款仅支持全额退款,退款金额将按照支付信息原路退回优惠券储值卡等原路退回处理</span>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogRefund = false"> </el-button>
<el-button type="primary" @click="dialogRefund = false"> </el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import {listCardValueRecord} from "@/api/cashier/cardvaluerecord"; import {cardValueRecordInfo, listCardValueRecord} from "@/api/cashier/cardvaluerecord";
import {getDicts} from "@/api/dict/data"; import {getDicts} from "@/api/dict/data";
import {queryStaffs} from "@/api/cashier/staff";
export default { export default {
name: "order_Cashier", name: "order_Cashier",
data(){ data(){
return{ return{
// //
payList:[], staffList:[],
// //
queryParams: { dateRange: [],
pageNo: 1, oilOrder:{},
pageSize: 10, // 退
}, password:"",
// radio1:"充值类型选错",
list:[], dialogRefund:false,
// //
total:0, payList:[],
//
queryParams: {
pageNo: 1,
pageSize: 10,
},
//
list:[],
//
total:0,
labelPosition: 'right', labelPosition: 'right',
formLabelAlign: { formLabelAlign: {
name: '', name: '',
},
tableData: [{
date: '2016-05-03',
name: '王小狼',
province: '上海',
city: '普陀区',
address: '上海市普陀区金沙江路 1518 弄',
zip: 200333
}, {
date: '2016-05-02',
name: '王小虎',
province: '上海',
city: '普陀区',
address: '上海市普陀区金沙江路 1518 弄',
zip: 200333
}, {
date: '2016-05-04',
name: '王小虎',
province: '上海',
city: '普陀区',
address: '上海市普陀区金沙江路 1518 弄',
zip: 200333
}, {
date: '2016-05-01',
name: '王小虎',
province: '上海',
city: '普陀区',
address: '上海市普陀区金沙江路 1518 弄',
zip: 200333
}, {
date: '2016-05-08',
name: '王小虎',
province: '上海',
city: '普陀区',
address: '上海市普陀区金沙江路 1518 弄',
zip: 200333
}, {
date: '2016-05-06',
name: '王小虎',
province: '上海',
city: '普陀区',
address: '上海市普陀区金沙江路 1518 弄',
zip: 200333
}, {
date: '2016-05-07',
name: '王小虎',
province: '上海',
city: '普陀区',
address: '上海市普陀区金沙江路 1518 弄',
zip: 200333
}]
}
},
created() {
this.getList();
this.getPayList();
},
methods:{
getType(list,val){
let name = "";
list.forEach(item => {
if (item.dictValue == val){
name = item.dictLabel
}
})
return name;
}, },
// // tableData: [{
getPayList(){ // date: '2016-05-03',
getDicts("payment_type").then( response => { // name: '',
this.payList = response.data; // province: '',
}) // city: '',
}, // address: ' 1518 ',
// // zip: 200333
getList(val){ // }, {
if (val!=undefined){ // date: '2016-05-02',
this.queryParams.pageNo = val // name: '',
} // province: '',
listCardValueRecord(this.queryParams).then( response => { // city: '',
this.list = response.data.records; // address: ' 1518 ',
this.total = response.data.total; // zip: 200333
}) // }, {
} // date: '2016-05-04',
// name: '',
// province: '',
// city: '',
// address: ' 1518 ',
// zip: 200333
// }, {
// date: '2016-05-01',
// name: '',
// province: '',
// city: '',
// address: ' 1518 ',
// zip: 200333
// }, {
// date: '2016-05-08',
// name: '',
// province: '',
// city: '',
// address: ' 1518 ',
// zip: 200333
// }, {
// date: '2016-05-06',
// name: '',
// province: '',
// city: '',
// address: ' 1518 ',
// zip: 200333
// }, {
// date: '2016-05-07',
// name: '',
// province: '',
// city: '',
// address: ' 1518 ',
// zip: 200333
// }]
} }
},
created() {
this.getList();
this.getPayList();
},
methods:{
//
patchwork(data){
const orderNo = data.name
this.$modal.confirm('确定您要补打当前订单吗?当前会员[' + orderNo + '],请确保云打印机正在运行中').then(function() {
// return delUser(row.id);
}).then(() => {
this.$modal.msgSuccess("打印指令已发送打印机,请查看打印结果");
}).catch(() => {});
},
// 退
handleRefund(id){
this.dialogRefund = true;
cardValueRecordInfo(id).then( response => {
this.oilOrder = response.data
})
},
getType(list,val){
let name = "";
list.forEach(item => {
if (item.dictValue == val){
name = item.dictLabel
}
})
return name;
},
//
getPayList(){
getDicts("payment_type").then( response => {
this.payList = response.data;
})
queryStaffs().then( response => {
this.staffList = response.data;
})
},
//
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
//
resetQuery() {
this.dateRange = [];
this.queryParams = {
pageNo: 1,
pageSize: 10,
}
// this.resetForm("queryForm");
this.handleQuery();
},
//
getList(val){
if (val!=undefined){
this.queryParams.pageNo = val
}
listCardValueRecord(this.queryParams).then( response => {
this.list = response.data.records;
this.total = response.data.total;
})
},
} }
}
</script> </script>
<style scoped> <style scoped>
@ -288,6 +408,10 @@
.top-app-sou{ .top-app-sou{
width: 20%; width: 20%;
} }
.tk{
text-align: center;
color: grey;
margin: 10px 0;
}
</style> </style>