代码合并,代客下单增加挂账支付
This commit is contained in:
parent
74bd8904ac
commit
b0868703a5
|
|
@ -29,4 +29,28 @@ export function $updatePrice(data) {
|
||||||
...data
|
...data
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 团购券-获取可使用团购券列表
|
||||||
|
|
||||||
|
export function $thirdPartyCoupon(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/thirdPartyCoupon/list',
|
||||||
|
method: "get",
|
||||||
|
params:{
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//核销团购券商品
|
||||||
|
export function $checkCoupon(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/place/checkCoupon',
|
||||||
|
method: "post",
|
||||||
|
data:{
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
|
|
@ -0,0 +1,181 @@
|
||||||
|
<template>
|
||||||
|
<el-dialog title="选择挂账人" width="850px" :visible.sync="show" top="20px">
|
||||||
|
<div class="app-container">
|
||||||
|
<div class="head-container filtration">
|
||||||
|
<div class="r">
|
||||||
|
<el-input
|
||||||
|
v-model="tableData.keywords"
|
||||||
|
placeholder="按挂账人或手机号"
|
||||||
|
style="width: 138px"
|
||||||
|
/>
|
||||||
|
<!-- <el-select
|
||||||
|
v-model="tableData.status"
|
||||||
|
placeholder="全部状态"
|
||||||
|
clearable
|
||||||
|
style="width: 123px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select> -->
|
||||||
|
<el-button type="primary" @click="getTableData()"> 查询 </el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="head-container content">
|
||||||
|
<el-table
|
||||||
|
v-loading="tableData.loading"
|
||||||
|
:data="tableData.data"
|
||||||
|
@cell-click="cellClick"
|
||||||
|
>
|
||||||
|
<el-table-column label="ID" prop="id" />
|
||||||
|
|
||||||
|
<el-table-column label="挂账人" prop="debtor" />
|
||||||
|
<el-table-column label="手机号" prop="mobile" />
|
||||||
|
<el-table-column label="已挂账金额(元)" prop="owedAmount" />
|
||||||
|
<el-table-column label="可用挂账额度(元)" prop="remainingAmount" />
|
||||||
|
<el-table-column label="操作">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-button type="text" @click="cellClick(scope.row)"
|
||||||
|
>选择</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<div class="head-container">
|
||||||
|
<el-pagination
|
||||||
|
:total="tableData.total"
|
||||||
|
:current-page="tableData.page"
|
||||||
|
:page-size="tableData.size"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
@current-change="paginationChange"
|
||||||
|
@size-change="sizeChange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getCreditBuyerList, delCreditBuyer } from "@/api/credit";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
show: false,
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
value: "1",
|
||||||
|
label: "启用",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "0",
|
||||||
|
label: "停用",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
tableData: {
|
||||||
|
keywords: "",
|
||||||
|
status: "1",
|
||||||
|
data: [],
|
||||||
|
page: 1,
|
||||||
|
size: 10,
|
||||||
|
loading: false,
|
||||||
|
total: 0,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
// this.getTableData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
cellClick(row) {
|
||||||
|
this.$emit("confirm", row);
|
||||||
|
this.show = false;
|
||||||
|
},
|
||||||
|
open() {
|
||||||
|
this.getTableData();
|
||||||
|
this.show = true;
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取挂账人列表
|
||||||
|
*/
|
||||||
|
async getTableData() {
|
||||||
|
this.tableData.loading = true;
|
||||||
|
try {
|
||||||
|
const res = await getCreditBuyerList({
|
||||||
|
page: this.tableData.page,
|
||||||
|
size: this.tableData.size,
|
||||||
|
keywords: this.tableData.keywords,
|
||||||
|
status: this.tableData.status,
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
});
|
||||||
|
this.tableData.loading = false;
|
||||||
|
this.tableData.data = res.content;
|
||||||
|
this.tableData.total = res.totalElements;
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除挂账人
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
async delTableHandle(id) {
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const res = await delCreditBuyer(id);
|
||||||
|
this.getTableData();
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作
|
||||||
|
*/
|
||||||
|
openDialog(row, type) {
|
||||||
|
if (type === "add") {
|
||||||
|
this.$refs.creditAdd.show();
|
||||||
|
} else if (type === "edit") {
|
||||||
|
this.$refs.creditAdd.show(row);
|
||||||
|
} else if (type === "repayment" && row.repaymentMethod === "total") {
|
||||||
|
this.$refs.creditRepayment.show(row);
|
||||||
|
} else if (type === "rePaymentRecord") {
|
||||||
|
this.$refs.creditRepaymentRecord.show(row);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 重置查询
|
||||||
|
resetHandle() {
|
||||||
|
this.page = 1;
|
||||||
|
this.getTableData();
|
||||||
|
},
|
||||||
|
// 分页大小改变
|
||||||
|
sizeChange(e) {
|
||||||
|
this.tableData.size = e;
|
||||||
|
this.getTableData();
|
||||||
|
},
|
||||||
|
// 分页回调
|
||||||
|
paginationChange(e) {
|
||||||
|
this.tableData.page = e;
|
||||||
|
this.getTableData();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.title {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #333333;
|
||||||
|
}
|
||||||
|
.filtration {
|
||||||
|
overflow: hidden;
|
||||||
|
.l {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
.r {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
<span> {{ number }}</span>
|
<span> {{ number }}</span>
|
||||||
</slot>
|
</slot>
|
||||||
</div>
|
</div>
|
||||||
|
<slot name="tips"></slot>
|
||||||
<div class="number_list_box">
|
<div class="number_list_box">
|
||||||
<div class="yd-keyboard">
|
<div class="yd-keyboard">
|
||||||
<div class="mini-number-box1">
|
<div class="mini-number-box1">
|
||||||
|
|
@ -79,13 +80,18 @@ export default {
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
max: {
|
max: {
|
||||||
type: Number,
|
type: [Number,String],
|
||||||
default: Infinity,
|
default: Infinity,
|
||||||
},
|
},
|
||||||
value: {
|
value: {
|
||||||
type: [String, Number],
|
type: [String, Number],
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
|
// 是否启用小数
|
||||||
|
isFloat: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -102,14 +108,21 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
clearFunction() {
|
clearFunction() {
|
||||||
|
if(this.isFloat){
|
||||||
|
return this.keyboradAdd('.')
|
||||||
|
}
|
||||||
this.$emit("clear", this.number);
|
this.$emit("clear", this.number);
|
||||||
},
|
},
|
||||||
keyboradAdd(n) {
|
keyboradAdd(n) {
|
||||||
|
if(n=='.'&& `${this.number}`.includes('.')){
|
||||||
|
return
|
||||||
|
}
|
||||||
if (Number(this.number) == 0) {
|
if (Number(this.number) == 0) {
|
||||||
return (this.number = n);
|
return (this.number = n);
|
||||||
}
|
}
|
||||||
const newval = this.number + n;
|
const newval = this.number + n;
|
||||||
if (newval > this.max) {
|
console.log(newval)
|
||||||
|
if (newval*1 > this.max*1) {
|
||||||
return this.$message( this.maxTips);
|
return this.$message( this.maxTips);
|
||||||
}
|
}
|
||||||
this.number = newval;
|
this.number = newval;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,355 @@
|
||||||
|
<template>
|
||||||
|
<div class="select_desk">
|
||||||
|
<el-dialog width="410px" title="挂账" :visible.sync="show">
|
||||||
|
<div class="guazhangren u-flex u-row-between" @click="guazhangShow">
|
||||||
|
<template v-if="guazhangRen">
|
||||||
|
<div>
|
||||||
|
<div class="name">
|
||||||
|
{{ guazhangRen.debtor }}/{{ guazhangRen.position }}
|
||||||
|
</div>
|
||||||
|
<div class="u-m-t-6">手机号:{{ guazhangRen.mobile }}</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div class="">可用额度</div>
|
||||||
|
<div class="u-m-t-6">{{ guazhangRen.remainingAmount }}</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<div class="color-999">选择挂账人/单位</div>
|
||||||
|
<span class="el-icon-caret-bottom"></span>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
<div class="select_desk_dialog u-p-b-20">
|
||||||
|
<key-board
|
||||||
|
isCanEmpty
|
||||||
|
v-model="number"
|
||||||
|
isFloat
|
||||||
|
@clear="clear"
|
||||||
|
:max="payMoney"
|
||||||
|
:maxTips="'超出未结账金额'"
|
||||||
|
>
|
||||||
|
<div slot="clear">.</div>
|
||||||
|
<div
|
||||||
|
|
||||||
|
slot="tips"
|
||||||
|
class="color-red w-full u-p-l-20 u-text-left u-m-t-10 u-m-b-30"
|
||||||
|
>
|
||||||
|
{{ tips }}
|
||||||
|
</div>
|
||||||
|
<div slot="input" class="u-p-l-20 u-p-r-20 u-flex w-full">
|
||||||
|
<div class="font-bold u-font-32">¥</div>
|
||||||
|
<el-input
|
||||||
|
placeholder="请输入挂账金额"
|
||||||
|
v-model="number"
|
||||||
|
@input="inputNumber"
|
||||||
|
@change="inputChange"
|
||||||
|
@focus="inputFocus"
|
||||||
|
@blur="inputBlur"
|
||||||
|
:type="focus ? 'number' : 'text'"
|
||||||
|
>
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
|
</key-board>
|
||||||
|
<div class="confirm_btns">
|
||||||
|
<el-button size="medium" @click="close">取消</el-button>
|
||||||
|
<el-button type="primary" size="medium" @click="confirm"
|
||||||
|
>确定</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<choose-guazhang
|
||||||
|
ref="refChooseGuazhang"
|
||||||
|
@confirm="chooseGuazhangConfirm"
|
||||||
|
></choose-guazhang>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import keyBoard from "./keyboard.vue";
|
||||||
|
import chooseGuazhang from "./choose-guazhang.vue";
|
||||||
|
export default {
|
||||||
|
components: { keyBoard, chooseGuazhang },
|
||||||
|
props: {
|
||||||
|
payMoney: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
guazhangRen: "",
|
||||||
|
number: "",
|
||||||
|
show: false,
|
||||||
|
hasOpen: false,
|
||||||
|
loading: false,
|
||||||
|
tips: "",
|
||||||
|
focus: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
number(newval) {
|
||||||
|
console.log(newval);
|
||||||
|
if (newval * 1 > this.payMoney * 1) {
|
||||||
|
this.number = this.payMoney;
|
||||||
|
this.number = newval;
|
||||||
|
}
|
||||||
|
if (newval * 1 > this.payMoney * 1) {
|
||||||
|
this.tips =
|
||||||
|
"已超出未结账金额";
|
||||||
|
} else {
|
||||||
|
const shengyu=this.payMoney - this.number
|
||||||
|
|
||||||
|
this.tips =shengyu>0?
|
||||||
|
"还需额外支付" + shengyu.toFixed(2) + "元":'';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
inputFocus() {
|
||||||
|
this.focus = true;
|
||||||
|
},
|
||||||
|
inputBlur() {
|
||||||
|
this.focus = false;
|
||||||
|
},
|
||||||
|
chooseGuazhangConfirm(e) {
|
||||||
|
this.guazhangRen = e;
|
||||||
|
},
|
||||||
|
guazhangShow() {
|
||||||
|
this.$refs.refChooseGuazhang.open();
|
||||||
|
},
|
||||||
|
|
||||||
|
inputNumber(e) {
|
||||||
|
console.log("inputNumber");
|
||||||
|
if (e * 1 > this.payMoney * 1) {
|
||||||
|
this.tips = "已超出未结账金额";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
inputChange(e) {
|
||||||
|
if (e * 1 > this.payMoney * 1) {
|
||||||
|
this.tips = "已超出未结账金额";
|
||||||
|
}
|
||||||
|
console.log(e);
|
||||||
|
},
|
||||||
|
clear(e) {
|
||||||
|
console.log(e);
|
||||||
|
this.number = "";
|
||||||
|
},
|
||||||
|
confirm() {
|
||||||
|
if (this.number*1 > this.payMoney*1) {
|
||||||
|
return this.$message("已超出未结账金额");
|
||||||
|
}
|
||||||
|
if (this.number * 1 <= 0) {
|
||||||
|
return this.$message("支付金额不正确");
|
||||||
|
}
|
||||||
|
console.log(this.number);
|
||||||
|
this.$emit("confirm", this.number);
|
||||||
|
this.close();
|
||||||
|
},
|
||||||
|
open(number) {
|
||||||
|
this.number = this.payMoney*1
|
||||||
|
this.show = true;
|
||||||
|
this.tips = "还需额外支付" + this.payMoney + "元";
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.show = false;
|
||||||
|
this.number = "";
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
::v-deep.el-button {
|
||||||
|
padding: 12px 20px;
|
||||||
|
}
|
||||||
|
::v-deep .carts .box_status {
|
||||||
|
margin-bottom: 0;
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
::v-deep .select_desk_dialog .el-input__inner {
|
||||||
|
border: none;
|
||||||
|
font-size: 32px;
|
||||||
|
}
|
||||||
|
::v-deep .el-input__inner::-webkit-inner-spin-button {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
::v-deep .el-input__inner::-webkit-outer-spin-button {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
::v-deep .el-button--success {
|
||||||
|
border-color: #22bf64;
|
||||||
|
background-color: #22bf64;
|
||||||
|
}
|
||||||
|
.select_desk .btn {
|
||||||
|
height: 34px;
|
||||||
|
}
|
||||||
|
.tags {
|
||||||
|
font-size: 16px;
|
||||||
|
&.using {
|
||||||
|
color: rgb(234, 64, 37);
|
||||||
|
}
|
||||||
|
&.wait {
|
||||||
|
color: rgb(252, 236, 79);
|
||||||
|
}
|
||||||
|
&.idle {
|
||||||
|
color: rgb(137, 234, 71);
|
||||||
|
}
|
||||||
|
&.closed {
|
||||||
|
color: rgb(221, 221, 221);
|
||||||
|
filter: grayscale(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
::v-deep .inputs .el-input__inner {
|
||||||
|
border-color: transparent !important;
|
||||||
|
color: rgba(0, 0, 0, 0.8);
|
||||||
|
letter-spacing: 1.25px;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.select_desk .select_desk_dialog {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .nav {
|
||||||
|
width: 286px;
|
||||||
|
height: 38px;
|
||||||
|
background: #dcf0e8;
|
||||||
|
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .nav .li,
|
||||||
|
.select_desk .select_desk_dialog .nav {
|
||||||
|
border-radius: 4px;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .nav .li {
|
||||||
|
width: 140px;
|
||||||
|
height: 34px;
|
||||||
|
color: #0fc161;
|
||||||
|
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 14px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .nav .lion {
|
||||||
|
background: #0fc161;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .inputs {
|
||||||
|
width: 370px;
|
||||||
|
line-height: 54px;
|
||||||
|
margin-top: 24px;
|
||||||
|
height: 54px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #dcdfe6;
|
||||||
|
border-radius: 4px;
|
||||||
|
color: rgba(0, 0, 0, 0.8);
|
||||||
|
letter-spacing: 1.25px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 20px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .inputs .close {
|
||||||
|
color: #aaa;
|
||||||
|
position: absolute;
|
||||||
|
right: 10px;
|
||||||
|
height: 30px;
|
||||||
|
width: 30px;
|
||||||
|
line-height: 30px;
|
||||||
|
top: 50%;
|
||||||
|
margin-top: -15px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.guazhangren {
|
||||||
|
padding: 12px 10px;
|
||||||
|
border: 1px solid #dcdfe6;
|
||||||
|
border-radius: 4px;
|
||||||
|
margin-top: 20px;
|
||||||
|
min-height: 58px;
|
||||||
|
color: #999;
|
||||||
|
cursor: pointer;
|
||||||
|
.name {
|
||||||
|
color: #3f9eff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .keyboard {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
flex-wrap: wrap;
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 20px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-right: 1px solid #dcdfe6;
|
||||||
|
border-bottom: 1px solid #dcdfe6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .keyboard .li {
|
||||||
|
height: 60px;
|
||||||
|
width: 33.333%;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
align-items: center;
|
||||||
|
font-size: 24px;
|
||||||
|
color: #212121;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
user-select: none;
|
||||||
|
border-left: 1px solid #dcdfe6;
|
||||||
|
border-top: 1px solid #dcdfe6;
|
||||||
|
|
||||||
|
transition: all 0.1s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .keyboard .li:hover {
|
||||||
|
background: #dcdfe6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .keyboard .li .icon {
|
||||||
|
font-size: 1.3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .keyboard .confirm {
|
||||||
|
height: 140px;
|
||||||
|
background: #ff9f2e;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select_desk .select_desk_dialog .keyboard .confirm:hover {
|
||||||
|
background: #f88502;
|
||||||
|
}
|
||||||
|
|
||||||
|
.confirm_btns {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.confirm_btns .el-button {
|
||||||
|
width: 175px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,165 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-dialog width="400px" :title="title" :visible.sync="show" @close="reset">
|
||||||
|
<div class="u-p-15">
|
||||||
|
<div class="u-m-t-20">
|
||||||
|
<el-alert
|
||||||
|
:closable="false"
|
||||||
|
v-if="tips"
|
||||||
|
:title="tips"
|
||||||
|
type="warning"
|
||||||
|
show-icon
|
||||||
|
>
|
||||||
|
</el-alert>
|
||||||
|
</div>
|
||||||
|
<div class="u-m-t-20">
|
||||||
|
<template>
|
||||||
|
<el-form label-width="90px" label-position="left">
|
||||||
|
<el-form-item label="团购代金券">
|
||||||
|
<el-input
|
||||||
|
v-model="form.code"
|
||||||
|
@change="codeInputChange"
|
||||||
|
placeholder="请扫码或者输入付款码"
|
||||||
|
ref="refInputCode"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<div class="u-flex u-row-center u-m-t-50">
|
||||||
|
<el-button size="medium" @click="close">取消</el-button>
|
||||||
|
<el-button size="medium" type="primary" @click="confirm"
|
||||||
|
>确定</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
<el-dialog width="400px" title="团购券商品" :visible.sync="tuanGoodsShow">
|
||||||
|
<tuan-quan-table
|
||||||
|
:data="canDikouGoods"
|
||||||
|
ref="refGoodsTable"
|
||||||
|
></tuan-quan-table>
|
||||||
|
<div class="u-flex u-row-center u-m-t-30 u-p-b-20">
|
||||||
|
<el-button size="medium" @click="tuanGoodsShow = false">取消</el-button>
|
||||||
|
<el-button size="medium" type="primary" @click="tuanGoodsConfirm"
|
||||||
|
>确定</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { $thirdPartyCoupon } from "@/api/Instead";
|
||||||
|
import tuanQuanTable from "./tuan-quan-table.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { tuanQuanTable },
|
||||||
|
props: {
|
||||||
|
cartGoods: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: "团购代金券核销",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filters: {
|
||||||
|
to2(n) {
|
||||||
|
return n.toFixed(2);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
canDikouGoods: [],
|
||||||
|
tuanQuan: {
|
||||||
|
goods: [],
|
||||||
|
},
|
||||||
|
tuanGoodsShow: false,
|
||||||
|
tips: "请使用扫码枪扫描团购代金券",
|
||||||
|
form: {
|
||||||
|
money: "",
|
||||||
|
code: "",
|
||||||
|
},
|
||||||
|
number: "0",
|
||||||
|
show: false,
|
||||||
|
timer: null,
|
||||||
|
payPar: {},
|
||||||
|
selGoodsArr: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
defaultTips(val) {
|
||||||
|
this.tips = val;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
codeInputChange(e) {
|
||||||
|
console.log(e);
|
||||||
|
// this.$emit("confirm", this.form.code);
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.tuanQuan = {
|
||||||
|
goods: [],
|
||||||
|
};
|
||||||
|
this.form.code = "";
|
||||||
|
this.selGoodsArr = [];
|
||||||
|
},
|
||||||
|
tuanGoodsConfirm() {
|
||||||
|
const selGoods = this.$refs.refGoodsTable.getSelectRows();
|
||||||
|
if (selGoods.length == 0) {
|
||||||
|
return this.$message.error("请选择商品");
|
||||||
|
}
|
||||||
|
this.$emit("confirm", {
|
||||||
|
...this.tuanQuan,
|
||||||
|
goods: selGoods,
|
||||||
|
});
|
||||||
|
this.tuanGoodsShow = false;
|
||||||
|
this.show = false;
|
||||||
|
},
|
||||||
|
async confirm() {
|
||||||
|
if (!this.form.code) {
|
||||||
|
return this.$message.error("请输入或扫团购代金券");
|
||||||
|
}
|
||||||
|
const res = await $thirdPartyCoupon({
|
||||||
|
code: this.form.code,
|
||||||
|
});
|
||||||
|
this.tuanQuan = res;
|
||||||
|
this.tuanGoodsShow = true;
|
||||||
|
console.log(res);
|
||||||
|
// this.close();
|
||||||
|
// this.$emit("confirm", this.form.code);
|
||||||
|
},
|
||||||
|
open(data) {
|
||||||
|
this.show = true;
|
||||||
|
this.canDikouGoods=this.cartGoods.filter(item=>item.productId!='-999')
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.refInputCode.focus();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.show = false;
|
||||||
|
},
|
||||||
|
numberInput(val) {
|
||||||
|
console.log(val);
|
||||||
|
this.number = `${Number(val)}`;
|
||||||
|
},
|
||||||
|
keyboradConfirm() {
|
||||||
|
this.$emit("confirm", this.number);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.number = `${this.value}`;
|
||||||
|
this.tips = this.defaultTips;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.codeImg {
|
||||||
|
width: 164px;
|
||||||
|
border: 1px solid rgb(220, 223, 230);
|
||||||
|
height: 164px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
:data="data"
|
||||||
|
style="width: 100%"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
@cell-click="cellClick"
|
||||||
|
>
|
||||||
|
<template v-if="type == 'edit'">
|
||||||
|
<el-table-column type="selection" width="55"> </el-table-column>
|
||||||
|
</template>
|
||||||
|
<el-table-column
|
||||||
|
prop="productName"
|
||||||
|
label="商品名称"
|
||||||
|
width="100"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column prop="price" label="商品单价"></el-table-column>
|
||||||
|
<el-table-column prop="num" label="商品数量"></el-table-column>
|
||||||
|
<el-table-column prop="priceAmount" label="商品总价"></el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
type: {
|
||||||
|
type: String, //edit show
|
||||||
|
default: "edit",
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
selArr: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch:{
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getSelectRows() {
|
||||||
|
return this.selArr;
|
||||||
|
},
|
||||||
|
handleSelectionChange(e) {
|
||||||
|
if (this.type == "edit") {
|
||||||
|
this.selArr = e;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
cellClick(row) {
|
||||||
|
if (this.type == "edit") {
|
||||||
|
this.$refs.table.toggleRowSelection(row);
|
||||||
|
}
|
||||||
|
console.log(row);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
@ -500,7 +500,7 @@
|
||||||
<el-button
|
<el-button
|
||||||
size="medium"
|
size="medium"
|
||||||
:disabled="
|
:disabled="
|
||||||
!order.list.length && !order.old.list.length
|
!order.list.length && order.old.list.length <= 0
|
||||||
"
|
"
|
||||||
@click="toCreateOrderDebounce(true)"
|
@click="toCreateOrderDebounce(true)"
|
||||||
>
|
>
|
||||||
|
|
@ -639,10 +639,13 @@
|
||||||
>
|
>
|
||||||
退菜
|
退菜
|
||||||
</div>
|
</div>
|
||||||
<div @click="refPopChangePriceShow"
|
<div
|
||||||
:class="{ disabled: order.selIndex < 0 }"
|
@click="refPopChangePriceShow"
|
||||||
|
:class="{ disabled: order.selIndex < 0 }"
|
||||||
class="btn">单品改价</div>
|
class="btn"
|
||||||
|
>
|
||||||
|
单品改价
|
||||||
|
</div>
|
||||||
<div class="btn">等叫</div>
|
<div class="btn">等叫</div>
|
||||||
<div class="btn no-wrap u-font-12">取消全部等叫</div>
|
<div class="btn no-wrap u-font-12">取消全部等叫</div>
|
||||||
|
|
||||||
|
|
@ -924,8 +927,35 @@
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="u-flex flex-wrap">
|
<div class="u-flex flex-wrap">
|
||||||
|
<span class="font-bold no-wrap">团购代金券</span>
|
||||||
|
<div
|
||||||
|
class="border u-p-l-20 cur-pointer u-m-r-20 u-flex no-wrap u-p-t-10 u-p-b-10 border-r-4 selQuan"
|
||||||
|
@click="shouwTuanQuan"
|
||||||
|
>
|
||||||
|
<span class="color-999 u-p-r-10">代金券名称</span>
|
||||||
|
<span
|
||||||
|
class="el-icon-arrow-down color-999 u-m-r-10"
|
||||||
|
></span>
|
||||||
|
</div>
|
||||||
|
<img
|
||||||
|
style="width: 30px; height: 30px"
|
||||||
|
class="cur-pointer"
|
||||||
|
@click="shouwTuanQuan"
|
||||||
|
src="@/assets/images/scan.png"
|
||||||
|
/>
|
||||||
|
<!-- <el-button size="medium " type="text">
|
||||||
|
查看不可用券
|
||||||
|
</el-button> -->
|
||||||
|
</div>
|
||||||
|
<template v-if="tuanQuan">
|
||||||
|
<tuan-quan-table
|
||||||
|
:data="tuanQuan.goods"
|
||||||
|
type="show"
|
||||||
|
ref="refGoodsTable"
|
||||||
|
></tuan-quan-table>
|
||||||
|
</template>
|
||||||
|
<div class="u-flex flex-wrap u-m-t-20">
|
||||||
<span class="font-bold no-wrap">优惠券</span>
|
<span class="font-bold no-wrap">优惠券</span>
|
||||||
<div
|
<div
|
||||||
class="border u-p-l-20 cur-pointer u-m-r-20 u-flex no-wrap u-p-t-10 u-p-b-10 border-r-4 selQuan"
|
class="border u-p-l-20 cur-pointer u-m-r-20 u-flex no-wrap u-p-t-10 u-p-b-10 border-r-4 selQuan"
|
||||||
|
|
@ -936,6 +966,7 @@
|
||||||
class="el-icon-arrow-down color-999 u-m-r-10"
|
class="el-icon-arrow-down color-999 u-m-r-10"
|
||||||
></span>
|
></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <el-button size="medium " type="text">
|
<!-- <el-button size="medium " type="text">
|
||||||
查看不可用券
|
查看不可用券
|
||||||
</el-button> -->
|
</el-button> -->
|
||||||
|
|
@ -1010,6 +1041,7 @@
|
||||||
:disabledPayType="disabledPayType"
|
:disabledPayType="disabledPayType"
|
||||||
>
|
>
|
||||||
</pay-type>
|
</pay-type>
|
||||||
|
<el-button @click="guazhangShow">挂账</el-button>
|
||||||
<div style="margin-top: 20px">
|
<div style="margin-top: 20px">
|
||||||
<el-button type="primary" size="medium" @click="payOrder">
|
<el-button type="primary" size="medium" @click="payOrder">
|
||||||
<span>立即支付</span>
|
<span>立即支付</span>
|
||||||
|
|
@ -1411,6 +1443,14 @@
|
||||||
:vipUser="vipUser"
|
:vipUser="vipUser"
|
||||||
@updateCart="updateCartItem"
|
@updateCart="updateCartItem"
|
||||||
></cart-change-price>
|
></cart-change-price>
|
||||||
|
<!-- 团购券 -->
|
||||||
|
<pop-tuan-quan
|
||||||
|
:cartGoods="createOrder.data.detailList || []"
|
||||||
|
ref="refPopTuanQuan"
|
||||||
|
@confirm="tuanQuanConfirm"
|
||||||
|
></pop-tuan-quan>
|
||||||
|
<!-- 挂账 -->
|
||||||
|
<popup-choose-guazhang ref="refGuaZhang" :payMoney="yinFuJinE"></popup-choose-guazhang>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -1429,6 +1469,10 @@ import returnCart from "./components/return-cart.vue";
|
||||||
import moneyKeyboard from "./components/money-keyboard.vue";
|
import moneyKeyboard from "./components/money-keyboard.vue";
|
||||||
import caiAdd from "./components/popup-linshiCai.vue";
|
import caiAdd from "./components/popup-linshiCai.vue";
|
||||||
import cartChangePrice from "./components/popup-cart-changePrice.vue";
|
import cartChangePrice from "./components/popup-cart-changePrice.vue";
|
||||||
|
import popTuanQuan from "./components/popup-tuan-quan.vue";
|
||||||
|
import tuanQuanTable from "./components/tuan-quan-table.vue";
|
||||||
|
import popupChooseGuazhang from "./components/popup-choose-guazhang.vue";
|
||||||
|
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { tbShopInfo } from "@/api/user";
|
import { tbShopInfo } from "@/api/user";
|
||||||
import { hasPermission } from "@/utils/limits.js";
|
import { hasPermission } from "@/utils/limits.js";
|
||||||
|
|
@ -1463,6 +1507,7 @@ import {
|
||||||
} from "@/api/table";
|
} from "@/api/table";
|
||||||
|
|
||||||
import { tbShopCategoryGet } from "@/api/shop";
|
import { tbShopCategoryGet } from "@/api/shop";
|
||||||
|
import { $checkCoupon } from "@/api/Instead";
|
||||||
import {
|
import {
|
||||||
isCanBuy,
|
isCanBuy,
|
||||||
arrayContainsAll,
|
arrayContainsAll,
|
||||||
|
|
@ -1479,11 +1524,15 @@ import { returnProductCoupAllPrice } from "./quan_util.js";
|
||||||
//商品数量从0到n每一个对应的价格
|
//商品数量从0到n每一个对应的价格
|
||||||
let $goodsPayPriceMap = {};
|
let $goodsPayPriceMap = {};
|
||||||
import { $status } from "@/utils/table.js";
|
import { $status } from "@/utils/table.js";
|
||||||
|
import PopupChooseGuazhang from './components/popup-choose-guazhang.vue';
|
||||||
|
|
||||||
let $originTableList = [];
|
let $originTableList = [];
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
popupChooseGuazhang,
|
||||||
cartChangePrice,
|
cartChangePrice,
|
||||||
|
popTuanQuan,
|
||||||
|
tuanQuanTable,
|
||||||
caiAdd,
|
caiAdd,
|
||||||
quansPop,
|
quansPop,
|
||||||
returnCart,
|
returnCart,
|
||||||
|
|
@ -1496,6 +1545,7 @@ export default {
|
||||||
moneyDiscount,
|
moneyDiscount,
|
||||||
cartItem,
|
cartItem,
|
||||||
chooseDinersNumber,
|
chooseDinersNumber,
|
||||||
|
PopupChooseGuazhang,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -1512,6 +1562,8 @@ export default {
|
||||||
value: 0,
|
value: 0,
|
||||||
toMoney: 0,
|
toMoney: 0,
|
||||||
},
|
},
|
||||||
|
//团购券
|
||||||
|
tuanQuan: "",
|
||||||
//选中可用优惠券
|
//选中可用优惠券
|
||||||
quansSelArr: [],
|
quansSelArr: [],
|
||||||
//台桌搜索文字
|
//台桌搜索文字
|
||||||
|
|
@ -2194,10 +2246,22 @@ export default {
|
||||||
this.open(this.$route.query);
|
this.open(this.$route.query);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//挂账
|
||||||
|
guazhangShow(){
|
||||||
|
this.$refs.refGuaZhang.open();
|
||||||
|
},
|
||||||
|
//团购券扫码弹窗
|
||||||
|
shouwTuanQuan() {
|
||||||
|
this.$refs.refPopTuanQuan.open();
|
||||||
|
},
|
||||||
|
tuanQuanConfirm(e) {
|
||||||
|
console.log(e);
|
||||||
|
this.tuanQuan = e;
|
||||||
|
},
|
||||||
//更新单品改价数据
|
//更新单品改价数据
|
||||||
updateCartItem(res){
|
updateCartItem(res) {
|
||||||
if(res){
|
if (res) {
|
||||||
this.order.list[this.order.selIndex]=res
|
this.order.list[this.order.selIndex] = res;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 单品改价
|
// 单品改价
|
||||||
|
|
@ -2923,6 +2987,15 @@ export default {
|
||||||
return prve;
|
return prve;
|
||||||
}, []);
|
}, []);
|
||||||
try {
|
try {
|
||||||
|
// 核销团购券商品
|
||||||
|
if (this.tuanQuan && this.tuanQuan.goods.length > 0) {
|
||||||
|
await $checkCoupon({
|
||||||
|
code: this.tuanQuan.couponCode,
|
||||||
|
num: this.tuanQuan.number,
|
||||||
|
orderId: this.createOrder.data.id,
|
||||||
|
cartId: this.tuanQuan.goods.map((v) => v.cartId),
|
||||||
|
});
|
||||||
|
}
|
||||||
const res = await $payOrder({
|
const res = await $payOrder({
|
||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
masterId: this.masterId,
|
masterId: this.masterId,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue