取单
挂单
@@ -160,38 +224,30 @@
:close-on-click-modal="false">
-
{{ item.name }}
-
{{ item.mobile }}
+
{{ item.realName }}
+
{{ item.mobile }}
-
-
-
-
-
-
-
- 付款金额
+ 应收金额
- ¥300.00
-
- 汽油
-
+ ¥{{ oilAmount + goodsAmount }}
+
+
+ 合计金额:{{ oilAmount + goodsAmount }}元、优惠合计13.02元
- 赠送金额
-
@@ -255,7 +313,7 @@
@@ -298,7 +356,38 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ parseTime(scope.row.createTime) }}
+
+
+
+
+ 选择
+
+
+
+
+
@@ -306,9 +395,11 @@
import {getDicts} from "@/api/dict/data";
import {getOilNameList, getOilNumGun, getOilNumGunById, listOilNumGun} from "@/api/cashier/oilnumgun";
import {fyPay} from "@/api/cashier/pay";
- import {listLJGoods} from "@/api/cashier/ljgoods";
- import {getUserVoMobile} from "@/api/cashier/user";
- import {queryStaffs} from "@/api/cashier/staff";
+ import {getLJGoods, listgoods} from "@/api/cashier/ljgoods";
+ import {getUserVoMobile, getUserVoName} from "@/api/cashier/user";
+ import {queryStaffs, staffInfo} from "@/api/cashier/staff";
+ import {addLJGoods} from "@/api/cashier/oilorder";
+ import {getUserGrade} from "@/api/cashier/usergrade";
export default {
name: "homeindex",
@@ -316,8 +407,16 @@
return{
// 油品订单
oilOrder:[],
+ // 油品金额
+ oilAmount:0,
// 油品订单数
oilTotal:0,
+ // 商品订单
+ goodsOrder:[],
+ // 商品金额
+ goodsAmount:0,
+ // 商品订单数
+ goodsTotal:0,
// 加油金额
rise:[
{value:"¥100"},
@@ -327,6 +426,8 @@
],
// 会员信息
member:{},
+ // 会员列表信息
+ memberList:[],
select1:'会员手机号',
// 会员信息
userNo:"",
@@ -350,6 +451,7 @@
dialogVisiblej: false,
dialogVisiblevip:false,
dialogVisibleamount:false,
+ dialogVisibleMember:false,
activeName: '1',
tabarr:[
{name:'收银台',icon:'el-icon-s-platform'},
@@ -371,28 +473,146 @@
{color:'#ecfae5'},
{color:'#fafafa'}
],
+ restaurants:'',
num: 1,
// 油号名称
oilNameList:'',
// 员工列表
staffList:[],
+ isMember: false,
+ // 员工信息
+ staff:"",
+ map:{
+ // 油品订单
+ oilOrder:"",
+ // 商品订单
+ goodsOrder:"",
+ // 支付方式
+ payType:"",
+ // 油品订单金额
+ oilAmount:"",
+ // 商品订单金额
+ goodsAmount:"",
+ // 油品实付金额
+ oilActualPay:"",
+ // 商品实付金额
+ goodsActualPay:"",
+ // 付款用户
+ payUser:"",
+ // 油品优惠金额
+ oilDiscount:"",
+ // 商品优惠金额
+ goodsDiscount:"",
+ },
+ gradeName:"",
}
},
created() {
this.getPayList();
- this.queryGoods();
this.getOilName();
+ this.getGoods();
+ this.getStaffList();
+ this.getStaff();
},
methods:{
+ // 重置会员
+ resetMember(){
+ this.member = {};
+ this.isMember = false;
+ },
+ // 获取会员等级信息
+ getGrade(id){
+ getUserGrade(id).then( response => {
+ this.gradeName = response.data.name;
+ })
+ return this.gradeName;
+ },
+ // 选择会员
+ chooseUser(){
+ this.dialogVisiblevip = false
+ this.isMember = true;
+ },
+ // 选择会员信息
+ handleChoose(data){
+ this.member = data;
+ this.dialogVisibleMember = false;
+ },
+ // 清空商品订单列表
+ empty(){
+ this.goodsOrder = [];
+ this.goodsTotal = 0;
+ this.goodsAmount = 0;
+ },
+ // 获取当前账户信息
+ getStaff(){
+ staffInfo().then( response => {
+ this.staff = response.data
+ })
+ },
+ // 选择员工信息
+ chooseStaff(data){
+ this.staff = data;
+ },
+ // 删除商品列表信息
+ delGoods(index){
+ this.goodsOrder.splice(index,1)
+ },
+ // 添加商品列表信息
+ changeGoods(val){
+ let result = true;
+ let goods = this.goodsOrder
+ if (this.goodsOrder.length>0){
+ let amount = 0;
+ for (let i = 0; i {
+ response.data.num = 1
+ this.goodsAmount += response.data.retailPrice
+ this.goodsOrder.push(response.data);
+ this.goodsTotal += 1;
+ })
+ }
+ this.goods = ""
+ },
+ // 立即结算
+ settlement(){
+ this.dialogVisiblej = true
+ },
+ // 新增订单(重置)
+ resetting(){
+ this.oilOrder = [];
+ this.oilTotal = 0;
+ this.oilAmount = 0;
+ },
+ // 获取员工列表
getStaffList(){
queryStaffs().then( response => {
this.staffList = response.data
})
},
- // 订单信息
+ // 油品订单信息
getOilOrder(){
this.dialogVisibleamount = false
this.oilOrder.push(this.form)
+ if (this.select == "元"){
+ this.oilAmount = +this.form.amount + this.oilAmount;
+ }else {
+ this.oilAmount = +(this.form.oilPrice * this.form.amount) + this.oilAmount;
+ }
this.oilTotal += 1;
},
// 选择“元”或“L”
@@ -439,48 +659,24 @@
this.oilNameList = response.data;
})
},
+ // 根据手机号查询会员信息
getUser(){
- getUserVoMobile({mobile:this.userNo}).then( response => {
- this.member = response.data
- // console.log(this.member)
- })
- },
- querySearchAsync(queryString, cb) {
- var restaurants = this.goodsList;
- // console.log(queryString)
- this.goodsList.forEach(item => {
- item.indexOf(queryString)
- })
- },
- handleSelect(item) {
- // console.log(item);
- },
- // 查询商品信息
- queryGoods(val){
- // console.log(this.goods)
- let map = {
- page:1,
- pageSize:40,
- name:this.goods,
- isRecovery:0,
+ if(this.select1=="会员手机号"){
+ getUserVoMobile({mobile:this.userNo}).then( response => {
+ this.member = response.data
+ })
+ }else {
+ getUserVoName({name:this.userNo}).then( response => {
+ this.memberList = response.data
+ })
+ this.dialogVisibleMember = true;
}
- let map1 = {
- page:1,
- pageSize:40,
- goodsNo:this.goods,
- isRecovery:0,
- }
- listLJGoods(map).then( response => {
- if(response.data.records!=null){
- this.goodsList = response.data.records
- }
+ },
+ // 查询所有商品信息
+ getGoods(){
+ listgoods().then( response => {
+ this.goodsList = response.data
})
- listLJGoods(map1).then( response => {
- if(response.data.records!=null){
- this.goodsList = response.data.records
- }
- })
- // console.log(this.goodsList)
},
// 加油金额
refuel(id){
@@ -492,17 +688,24 @@
},
// 确定收款
collection(){
- let map = {
- authCode : this.authCode,
- orderNo : "0000055"
- }
- // console.log(map)
- fyPay(map).then( response => {
- // console.log(response)
+ // JSON.parse()
+ this.map.oilOrder = JSON.stringify(this.oilOrder);
+ this.map.goodsOrder = JSON.stringify(this.goodsOrder);
+ addLJGoods(this.map).then( response => {
+ console.log(response)
})
+ // let map = {
+ // authCode : this.authCode,
+ // orderNo : "0000055"
+ // }
+ // // console.log(map)
+ // fyPay(map).then( response => {
+ // // console.log(response)
+ // })
},
+ // 支付方式
payMethod(payType){
- // console.log(payType)
+ this.map.payType = payType;
},
// 获取支付方式
getPayList(){
@@ -526,7 +729,15 @@
.catch(_ => {});
},
handleChange(value) {
- // console.log(value);
+ let goods = this.goodsOrder;
+ let num = 0;
+ let amount = 0;
+ goods.forEach(item => {
+ num += item.num
+ amount += item.retailPrice*item.num
+ })
+ this.goodsTotal = num;
+ this.goodsAmount = amount;
},
handleClick(tab, event) {
let oilNum = ""
@@ -545,7 +756,7 @@
gocomponents(index){
this.leftindex = index
},
- }
+ },
}