门店参数新增

master
十七 4 years ago
parent 17be547c16
commit 97852140a9

@ -1,89 +1,89 @@
<template>
<el-dialog :close-on-click-modal="false" v-dialogDrag :title="title" :visible.sync="dialogVisible" width="1000px" append-to-body>
<el-table @row-dblclick="confirms" :data="list" @row-click="rowClick" max-height="600" v-loading="listLoading" :element-loading-text="elementLoadingText" class="margin-top-xs" :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)' ,color:'#eeeeee'}">
<el-table-column label="选择" width="60">
<template slot-scope="scope">
<el-radio v-model="radio" :label="scope.row.id" @change.native="scope.row;">
{{ "" }}
</el-radio>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip min-width="120" align="left" prop="rechargeTypeNum" label="充值编码"></el-table-column>
<el-table-column show-overflow-tooltip min-width="120" align="left" prop="rechargeTypeName" label="充值卡"></el-table-column>
<el-table-column show-overflow-tooltip min-width="80" align="left" prop="type" label="类别">
<template slot-scope="scope">
{{scope.row.type==0?'赠送卡':scope.row.type==1?'折扣卡':'活动卡'}}
</template>
</el-table-column>
<el-table-column show-overflow-tooltip min-width="80" align="center" prop="cardRestMoney" label="剩余金额"></el-table-column>
<el-table-column show-overflow-tooltip min-width="80" align="center" prop="cardConsumeMoney" label="可用金额"></el-table-column>
<el-table-column show-overflow-tooltip min-width="100" align="center" prop="discount" label="享受优惠(%)"></el-table-column>
<el-table-column show-overflow-tooltip min-width="80" align="center" prop="cardGiftMoney" label="赠送金额"></el-table-column>
<el-table-column show-overflow-tooltip min-width="100" align="center" prop="discountFreeAmount" label="赠送折扣(%)"></el-table-column>
<el-table-column show-overflow-tooltip min-width="105" align="center" prop="endTime" label="到期日期"></el-table-column>
</el-table>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button size="mini" type="primary" plain @click="dialogVisible = false"> </el-button>
<el-button size="mini" type="primary" @click="confirms()"> </el-button>
</span>
</el-dialog>
</template>
<script>
import { recAccountList } from "@/api/eashier.js";
export default {
data() {
return {
radio: null, //
radioForm: {}, //
list: [], //
dialogVisible: false, //
title: "选择会员充值帐户",
elementLoadingText: "数据加载中...", //list
listLoading: false, //list
};
},
methods: {
//
show(form) {
this.form = { ...form };
this.list = [];
this.dialogVisible = true;
this.getData();
},
//
rowClick(row) {
this.radio = row.id;
this.radioForm = row;
},
//
async getData() {
this.listLoading = true;
recAccountList({ memberId: this.form.memberId }).then((res) => {
this.listLoading = false;
if (res.code === "000000") {
this.listLoading = false;
this.list = res.rows;
} else {
this.$alert("查询会员充值帐户 : " + res.message, "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => {},
});
}
});
},
//
confirms() {
this.$emit("recTypeData", this.radioForm);
this.dialogVisible = false;
},
},
};
</script>
<style>
</style>
<template>
<el-dialog :close-on-click-modal="false" v-dialogDrag :title="title" :visible.sync="dialogVisible" width="1000px" append-to-body>
<el-table @row-dblclick="confirms" :data="list" @row-click="rowClick" max-height="600" v-loading="listLoading" :element-loading-text="elementLoadingText" class="margin-top-xs" :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)' ,color:'#eeeeee'}">
<el-table-column label="选择" width="60">
<template slot-scope="scope">
<el-radio v-model="radio" :label="scope.row.id" @change.native="scope.row;">
{{ "" }}
</el-radio>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip min-width="120" align="left" prop="rechargeTypeNum" label="充值编码"></el-table-column>
<el-table-column show-overflow-tooltip min-width="120" align="left" prop="rechargeTypeName" label="充值卡"></el-table-column>
<el-table-column show-overflow-tooltip min-width="80" align="left" prop="type" label="类别">
<template slot-scope="scope">
{{scope.row.type==0?'赠送卡':scope.row.type==1?'折扣卡':'活动卡'}}
</template>
</el-table-column>
<el-table-column show-overflow-tooltip min-width="80" align="center" prop="cardRestMoney" label="剩余金额"></el-table-column>
<el-table-column show-overflow-tooltip min-width="80" align="center" prop="cardConsumeMoney" label="可用金额"></el-table-column>
<el-table-column show-overflow-tooltip min-width="100" align="center" prop="discount" label="享受优惠(%)"></el-table-column>
<el-table-column show-overflow-tooltip min-width="80" align="center" prop="cardGiftMoney" label="赠送金额"></el-table-column>
<el-table-column show-overflow-tooltip min-width="100" align="center" prop="discountFreeAmount" label="赠送折扣(%)"></el-table-column>
<el-table-column show-overflow-tooltip min-width="105" align="center" prop="endTime" label="到期日期"></el-table-column>
</el-table>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button size="mini" type="primary" plain @click="dialogVisible = false"> </el-button>
<el-button size="mini" type="primary" @click="confirms()"> </el-button>
</span>
</el-dialog>
</template>
<script>
import { recAccountList } from "@/api/eashier.js";
export default {
data() {
return {
radio: null, //
radioForm: {}, //
list: [], //
dialogVisible: false, //
title: "选择会员充值帐户",
elementLoadingText: "数据加载中...", //list
listLoading: false, //list
};
},
methods: {
//
show(form) {
this.form = { ...form };
this.list = [];
this.dialogVisible = true;
this.getData();
},
//
rowClick(row) {
this.radio = row.id;
this.radioForm = row;
},
//
async getData() {
this.listLoading = true;
recAccountList({ memberId: this.form.memberId }).then((res) => {
this.listLoading = false;
if (res.code === "000000") {
this.listLoading = false;
this.list = res.rows;
} else {
this.$alert("查询会员充值帐户 : " + res.message, "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => {},
});
}
});
},
//
confirms() {
this.$emit("recTypeData", this.radioForm);
this.dialogVisible = false;
},
},
};
</script>
<style>
</style>

@ -1,124 +1,129 @@
<template>
<el-dialog :close-on-click-modal="false" v-dialogDrag :title="title" :visible.sync="dialogVisible" width="1000px" append-to-body>
<el-table @row-dblclick="confirms" :data="list" @row-click="rowClick" max-height="600" v-loading="listLoading" :element-loading-text="elementLoadingText" class="margin-top-xs" :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)' ,color:'#eeeeee'}">
<el-table-column label="选择" width="60">
<template slot-scope="scope">
<el-radio v-model="radio" :label="scope.row.id" @change.native="scope.row;">
{{ "" }}
</el-radio>
</template>
</el-table-column>
<el-table-column align="center" show-overflow-tooltip min-width="100" prop="rechargeTypeNum" label="编码"></el-table-column>
<el-table-column align="center" show-overflow-tooltip min-width="120" prop="rechargeTypeName" label="名称"></el-table-column>
<el-table-column show-overflow-tooltip min-width="75" align="left" prop="type" label="类别">
<template slot-scope="scope">
{{scope.row.type==0?'赠送卡':scope.row.type==1?'折扣卡':'活动卡'}}
</template>
</el-table-column>
<el-table-column align="center" min-width="75" prop="firstAmount" label="首充金额">
<template slot-scope="scope">{{scope.row.firstAmount?scope.row.firstAmount:'无首充'}}</template>
</el-table-column>
<el-table-column align="center" min-width="75" prop="rechargeMoney" label="续充金额"></el-table-column>
<el-table-column align="center" min-width="80" prop="discount" label="享受折扣(%)"></el-table-column>
<el-table-column align="center" min-width="75" prop="giftMoney" label="赠送金额">
<template slot-scope="scope">{{scope.row.giftMoney?scope.row.giftMoney:'无赠送'}}</template>
</el-table-column>
<el-table-column align="center" min-width="80" prop="discountFreeAmount" label="赠送折扣(%)">
<template slot-scope="scope">{{scope.row.discountFreeAmount?scope.row.discountFreeAmount:'无折扣'}}</template>
</el-table-column>
<el-table-column align="center" min-width="80" prop="validTime" label="有效期限(月)"></el-table-column>
<el-table-column align="center" show-overflow-tooltip min-width="115" prop="stopDates" label="到期日期"></el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button size="mini" type="primary" plain @click="dialogVisible = false"> </el-button>
<el-button size="mini" type="primary" @click="confirms()"> </el-button>
</span>
</el-dialog>
</template>
<script>
import { recTypeList } from "@/api/eashier.js";
export default {
data() {
return {
radio: null, //
radioForm: {}, //
list: [], //
dialogVisible: false, //
title: "选择充值类别", //
elementLoadingText: "数据加载中...", //list
listLoading: false, //list
selectNumber: null, //0 1 2
selcetList: [], //
};
},
methods: {
//
show(number, list) {
console.log(number);
console.log(list);
if (list) {
this.selcetList = list;
}
if (number) {
this.selectNumber = number;
}
this.list = [];
this.radio = null;
this.radioForm = {};
this.dialogVisible = true;
this.getData();
},
//
rowClick(row) {
this.radio = row.id;
this.radioForm = row;
},
//
async getData() {
this.listLoading = true;
let form = {
id: "",
storeId: sessionStorage.getItem("parentId"),
};
if (this.selectNumber) {
form.type = this.selectNumber;
}
recTypeList(form).then((res) => {
this.listLoading = false;
if (res.code === "000000") {
if (this.selcetList.length == 0) {
this.list = res.rows;
} else {
var list = [];
this.selcetList.forEach((item) => {
res.rows.forEach((items) => {
if (item.newRechargeTypeId == items.id) {
list.push(items);
}
});
});
this.list = list;
}
} else {
this.$alert("查询充值列表 : " + res.message, "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => {},
});
}
});
},
//
confirms() {
this.$emit("recTypeData", this.radioForm);
this.dialogVisible = false;
},
},
};
</script>
<style>
</style>
<template>
<el-dialog :close-on-click-modal="false" v-dialogDrag :title="title" :visible.sync="dialogVisible" width="1000px" append-to-body>
<el-table @row-dblclick="confirms" :data="list" @row-click="rowClick" max-height="600" v-loading="listLoading" :element-loading-text="elementLoadingText" class="margin-top-xs" :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)' ,color:'#eeeeee'}">
<el-table-column label="选择" width="60">
<template slot-scope="scope">
<el-radio v-model="radio" :label="scope.row.id" @change.native="scope.row;">
{{ "" }}
</el-radio>
</template>
</el-table-column>
<el-table-column align="center" show-overflow-tooltip min-width="100" prop="rechargeTypeNum" label="编码"></el-table-column>
<el-table-column align="center" show-overflow-tooltip min-width="120" prop="rechargeTypeName" label="名称"></el-table-column>
<el-table-column show-overflow-tooltip min-width="75" align="left" prop="type" label="类别">
<template slot-scope="scope">
{{scope.row.type==0?'赠送卡':scope.row.type==1?'折扣卡':'活动卡'}}
</template>
</el-table-column>
<el-table-column align="center" min-width="75" prop="firstAmount" label="首充金额">
<template slot-scope="scope">{{scope.row.firstAmount?scope.row.firstAmount:'无首充'}}</template>
</el-table-column>
<el-table-column align="center" min-width="75" prop="rechargeMoney" label="续充金额"></el-table-column>
<el-table-column align="center" min-width="80" prop="discount" label="享受折扣(%)"></el-table-column>
<el-table-column align="center" min-width="75" prop="giftMoney" label="赠送金额">
<template slot-scope="scope">
<span v-if="scope.row.donateType==0"></span>
<span v-if="scope.row.donateType==1"></span>
<span>{{scope.row.giftMoney}}</span>
<span v-if="scope.row.donateType==1">%</span>
</template>
</el-table-column>
<el-table-column align="center" min-width="80" prop="discountFreeAmount" label="赠送折扣(%)">
<template slot-scope="scope">{{scope.row.discountFreeAmount?scope.row.discountFreeAmount:'无折扣'}}</template>
</el-table-column>
<el-table-column align="center" min-width="80" prop="validTime" label="有效期限(月)"></el-table-column>
<el-table-column align="center" show-overflow-tooltip min-width="115" prop="stopDates" label="到期日期"></el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button size="mini" type="primary" plain @click="dialogVisible = false"> </el-button>
<el-button size="mini" type="primary" @click="confirms()"> </el-button>
</span>
</el-dialog>
</template>
<script>
import { recTypeList } from "@/api/eashier.js";
export default {
data() {
return {
radio: null, //
radioForm: {}, //
list: [], //
dialogVisible: false, //
title: "选择充值类别", //
elementLoadingText: "数据加载中...", //list
listLoading: false, //list
selectNumber: null, //0 1 2
selcetList: [], //
};
},
methods: {
//
show(number, list) {
console.log(number);
console.log(list);
if (list) {
this.selcetList = list;
}
if (number) {
this.selectNumber = number;
}
this.list = [];
this.radio = null;
this.radioForm = {};
this.dialogVisible = true;
this.getData();
},
//
rowClick(row) {
this.radio = row.id;
this.radioForm = row;
},
//
async getData() {
this.listLoading = true;
let form = {
id: "",
storeId: sessionStorage.getItem("parentId"),
};
if (this.selectNumber) {
form.type = this.selectNumber;
}
recTypeList(form).then((res) => {
this.listLoading = false;
if (res.code === "000000") {
if (this.selcetList.length == 0) {
this.list = res.rows;
} else {
var list = [];
this.selcetList.forEach((item) => {
res.rows.forEach((items) => {
if (item.newRechargeTypeId == items.id) {
list.push(items);
}
});
});
this.list = list;
}
} else {
this.$alert("查询充值列表 : " + res.message, "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => {},
});
}
});
},
//
confirms() {
this.$emit("recTypeData", this.radioForm);
this.dialogVisible = false;
},
},
};
</script>
<style>
</style>

@ -75,7 +75,7 @@
</el-form-item> -->
<el-form-item prop="summation" label="退款金额:">
<div class="form-width-ms">
<el-input oninput="this.value=this.value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3')" pattern="[0-9]*\.?[0-9]{0,2}" @change="endRefundMoney" @blur="endRefundMoney" v-model="refund.courseRefundMoney"></el-input>
<el-input :disabled="refund.refundNumber==refund.courseConsumeCount" oninput="this.value=this.value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3')" pattern="[0-9]*\.?[0-9]{0,2}" @change="endRefundMoney" @blur="endRefundMoney" v-model="refund.courseRefundMoney"></el-input>
</div>
</el-form-item>
<br />
@ -643,37 +643,17 @@ export default {
detailData(v) {
this.getOrder();
},
endRefundMoney() {
let money =
(this.refund.courseConsumeCount * this.refund.price).toFixed(2) * 1;
if (this.refund.courseRefundMoney * 1 > money) {
this.$alert("退款金额不能大于: " + money, "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => {},
});
this.refund.courseRefundMoney = money;
endRefundMoney() {},
endNum() {
if (this.refund.refundNumber > this.refund.courseConsumeCount) {
this.refund.refundNumber = this.refund.courseConsumeCount;
this.refund.courseRefundMoney = this.refund.courseConsumePrice;
} else {
this.refund.refundNumber =
(this.refund.courseRefundMoney / this.refund.price).toFixed(2) * 1;
this.refund.refundNumber = parseInt(this.refund.refundNumber);
this.upNum = this.refund.refundNumber;
let form = { ...this.refund };
this.refund = JSON.parse(JSON.stringify(form));
this.refund.courseRefundMoney =
(this.refund.price * this.refund.refundNumber).toFixed(2) * 1;
}
},
endNum() {
this.refund.refundNumber =
(this.refund.courseRefundMoney / this.refund.price).toFixed(2) * 1;
this.refund.refundNumber = parseInt(this.refund.refundNumber);
this.upNum = this.refund.refundNumber;
},
endMoney() {
let money =
(this.refund.courseConsumeCount * this.refund.price).toFixed(2) * 1;
},
close() {
this.refDialogVisible = false;
this.openCollNumber = 0;
@ -969,7 +949,6 @@ export default {
);
that.refund = Object.assign(that.refund, that.radioValueList);
that.refund.refundNumber = null;
let page = {
memberId: that.radioValueList.memberId,
storeId: that.radioValueList.storeId,

@ -1,205 +1,213 @@
<template>
<el-dialog :close-on-click-modal="false" v-dialogDrag rechargeTypeId="form" :title="title" :visible.sync="dialogFormVisible" :before-close="handleClose">
<el-form :model="form" :rules="rules" ref="form" label-width="120px">
<el-form-item label="充值编码:" prop="rechargeTypeNum">
<el-input ref="rechargeTypeNum" class="form-width" v-model="form.rechargeTypeNum" autocomplete="on"></el-input>
</el-form-item>
<el-form-item label="充值类型:" prop="type">
<el-radio-group v-model="form.type">
<el-radio :label="1">折扣卡</el-radio>
<el-radio :label="0">赠送卡</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="充值名称:" prop="rechargeTypeName">
<el-input class="form-width" v-model="form.rechargeTypeName" autocomplete="on"></el-input>
</el-form-item>
<el-form-item label="充值提成:" title="数值大于1为固定金额 小于等于1位百分比" prop="typeRatio">
<el-input class="form-width" oninput="this.value=this.value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" pattern="[0-9]*\.?[0-9]{0,4}" v-model="form.typeRatio" autocomplete="on" placeholder="请输入充值提成"></el-input>
</el-form-item>
<el-form-item label="首充金额:" prop="firstAmount">
<el-input placeholder="请输入首充金额" class="form-width" oninput="this.value=this.value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3')" pattern="[0-9]*\.?[0-9]{0,2}" v-model="form.firstAmount" autocomplete="on"></el-input>
</el-form-item>
<el-form-item label="续充金额:" prop="rechargeMoney">
<el-input class="form-width" oninput="this.value=this.value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3')" pattern="[0-9]*\.?[0-9]{0,2}" v-model="form.rechargeMoney" autocomplete="on"></el-input>
</el-form-item>
<el-form-item label="享受折扣(%)" prop="discount">
<el-input class="form-width" :disabled="form.type == 0" placeholder="赠送卡默认100%" oninput="this.value=this.value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3')" pattern="[0-9]*\.?[0-9]{0,2}" v-model="form.discount" autocomplete="on"></el-input>
</el-form-item>
<el-form-item label="赠送金额:" prop="giftMoney">
<el-input class="form-width" oninput="this.value=this.value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3')" pattern="[0-9]*\.?[0-9]{0,2}" v-model="form.giftMoney" autocomplete="on" :disabled="form.type === 1">
</el-input>
</el-form-item>
<el-form-item label="有效期限(月)" prop="validTime" v-show="sessionStorageData.allowValid == 1">
<el-input class="form-width" oninput="this.value=this.value.replace(/\D/g,'')" pattern="[0-9]*" v-model="form.validTime" autocomplete="on"></el-input>
</el-form-item>
<el-form-item label="到期日期:" prop="unifiedDue">
<div class="block" style="min-width:50px">
<el-date-picker style="min-width:50px" v-model="form.unifiedDue" type="date" value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="选择卡包统一到期日期"></el-date-picker>
</div>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="mini" type="primary" plain @click="dialogFormVisible = false"> </el-button>
<el-button size="mini" type="primary" @click="confirm"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { addrecType, editrecType } from "@/api/storeManage.js";
export default {
data() {
return {
rules: {
rechargeTypeName: {
required: true,
message: "请输入充值名称",
trigger: ["blur", "change"],
},
rechargeTypeNum: {
required: true,
message: "请输入充值编码",
trigger: ["blur", "change"],
},
type: {
required: true,
message: "请选择充值类型",
trigger: ["blur", "change"],
},
validTime: {
required: true,
message: "请设置有效期(月)",
trigger: ["blur", "change"],
},
typeRatio: {
required: true,
message: "请设置充值提成",
trigger: ["blur", "change"],
},
firstAmount: {
required: true,
message: "请输入首充金额",
trigger: ["blur", "change"],
},
rechargeMoney: {
required: true,
message: "请输入续充金额",
trigger: ["blur", "change"],
},
discount: {
required: true,
message: "请输入享受折扣",
trigger: ["blur", "change"],
},
},
sessionStorageData: JSON.parse(
sessionStorage.getItem("sessionStorageData")
), //
form: {}, //
rowForm: {}, //
title: "", //
dialogFormVisible: false, //
};
},
methods: {
//
handleClose() {
this.form = {};
this.dialogFormVisible = false;
this.$refs.form.clearValidate();
},
//
show(text, form) {
this.title = text;
this.form = {};
if (text == "修改") {
this.form = { ...form };
this.rowForm = { ...form };
}
setTimeout(() => {
this.$refs.rechargeTypeNum.focus();
this.$refs.rechargeTypeNum.select();
}, 300);
this.dialogFormVisible = true;
},
//
confirm() {
if (this.form.type == 0) {
this.form.discount = 100;
}
if (this.form.type == 1) {
this.form.giftMoney = null;
}
this.form.validTime = this.form.validTime * 1;
if (this.title == "添加") {
let flag = false;
if (this.sessionStorageData.allowValid == 1) {
if (this.form.validTime >= 0) {
} else {
flag = true;
}
}
if (flag == false) {
addrecType(this.form)
.then((res) => {
if (res.code == "000000") {
this.$emit("editData");
this.dialogFormVisible = false;
this.$message.success({
message: "数据添加成功!",
});
} else {
this.$alert(res.message, "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => {},
});
}
})
.catch((err) => {
//console.log(err);
});
} else {
this.$alert("请设置有效期", "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => {},
});
}
} else {
delete this.form.rechargeTypeNum;
if (this.form.rechargeTypeName == this.rowForm.rechargeTypeName) {
delete this.form.rechargeTypeName;
}
if (this.form.giftMoney == 0) {
this.form.giftMoney = null;
}
editrecType(this.form).then((res) => {
if (res.code == "000000") {
this.$emit("editData");
this.dialogFormVisible = false;
this.$message.success({
message: res.message,
});
} else {
this.$alert(res.message, "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => {},
});
}
});
}
},
},
};
</script>
<style>
</style>
<template>
<el-dialog :close-on-click-modal="false" v-dialogDrag rechargeTypeId="form" :title="title" :visible.sync="dialogFormVisible" :before-close="handleClose">
<el-form :model="form" :rules="rules" ref="form" label-width="120px">
<el-form-item label="充值编码:" prop="rechargeTypeNum">
<el-input ref="rechargeTypeNum" class="form-width" v-model="form.rechargeTypeNum" autocomplete="on"></el-input>
</el-form-item>
<el-form-item label="充值类型:" prop="type">
<el-radio-group v-model="form.type">
<el-radio :label="1">折扣卡</el-radio>
<el-radio :label="0">赠送卡</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="充值名称:" prop="rechargeTypeName">
<el-input class="form-width" v-model="form.rechargeTypeName" autocomplete="on"></el-input>
</el-form-item>
<el-form-item label="充值提成:" title="数值大于1为固定金额 小于等于1位百分比" prop="typeRatio">
<el-input class="form-width" oninput="this.value=this.value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" pattern="[0-9]*\.?[0-9]{0,4}" v-model="form.typeRatio" autocomplete="on" placeholder="请输入充值提成"></el-input>
</el-form-item>
<el-form-item label="首充金额:" prop="firstAmount">
<el-input placeholder="请输入首充金额" class="form-width" oninput="this.value=this.value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3')" pattern="[0-9]*\.?[0-9]{0,2}" v-model="form.firstAmount" autocomplete="on"></el-input>
</el-form-item>
<el-form-item label="续充金额:" prop="rechargeMoney">
<el-input class="form-width" oninput="this.value=this.value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3')" pattern="[0-9]*\.?[0-9]{0,2}" v-model="form.rechargeMoney" autocomplete="on"></el-input>
</el-form-item>
<el-form-item label="享受折扣(%)" prop="discount">
<el-input class="form-width" :disabled="form.type == 0" placeholder="赠送卡默认100%" oninput="this.value=this.value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3')" pattern="[0-9]*\.?[0-9]{0,2}" v-model="form.discount" autocomplete="on"></el-input>
</el-form-item>
<el-form-item label="赠送方式:" v-if="form.type==0" prop="donateType">
<el-radio-group v-model="form.donateType">
<el-radio :label="0">固定赠送</el-radio>
<el-radio :label="1">比例赠送</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="赠送金额:" prop="giftMoney">
<el-input type="number" :placeholder="form.donateType==0?'固定金额':form.donateType==1?'比例赠送(%)':''" class="form-width" oninput="this.value=this.value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3')" pattern="[0-9]*\.?[0-9]{0,2}" v-model="form.giftMoney" autocomplete="on" :disabled="form.type === 1">
</el-input>
</el-form-item>
<el-form-item label="有效期限(月)" prop="validTime" v-show="sessionStorageData.allowValid == 1">
<el-input class="form-width" oninput="this.value=this.value.replace(/\D/g,'')" pattern="[0-9]*" v-model="form.validTime" autocomplete="on"></el-input>
</el-form-item>
<el-form-item label="到期日期:" prop="unifiedDue">
<div class="block" style="min-width:50px">
<el-date-picker style="min-width:50px" v-model="form.unifiedDue" type="date" value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="选择卡包统一到期日期"></el-date-picker>
</div>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="mini" type="primary" plain @click="dialogFormVisible = false"> </el-button>
<el-button size="mini" type="primary" @click="confirm"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { addrecType, editrecType } from "@/api/storeManage.js";
export default {
data() {
return {
rules: {
rechargeTypeName: {
required: true,
message: "请输入充值名称",
trigger: ["blur", "change"],
},
rechargeTypeNum: {
required: true,
message: "请输入充值编码",
trigger: ["blur", "change"],
},
type: {
required: true,
message: "请选择充值类型",
trigger: ["blur", "change"],
},
validTime: {
required: true,
message: "请设置有效期(月)",
trigger: ["blur", "change"],
},
typeRatio: {
required: true,
message: "请设置充值提成",
trigger: ["blur", "change"],
},
firstAmount: {
required: true,
message: "请输入首充金额",
trigger: ["blur", "change"],
},
rechargeMoney: {
required: true,
message: "请输入续充金额",
trigger: ["blur", "change"],
},
discount: {
required: true,
message: "请输入享受折扣",
trigger: ["blur", "change"],
},
},
sessionStorageData: JSON.parse(
sessionStorage.getItem("sessionStorageData")
), //
form: {}, //
rowForm: {}, //
title: "", //
dialogFormVisible: false, //
};
},
methods: {
//
handleClose() {
this.form = {};
this.dialogFormVisible = false;
this.$refs.form.clearValidate();
},
//
show(text, form) {
this.title = text;
this.form = {};
if (text == "修改") {
this.form = { ...form };
this.rowForm = { ...form };
}
setTimeout(() => {
this.$refs.rechargeTypeNum.focus();
this.$refs.rechargeTypeNum.select();
}, 300);
this.dialogFormVisible = true;
},
//
confirm() {
if (this.form.type == 0) {
this.form.discount = 100;
}
if (this.form.type == 1) {
this.form.giftMoney = null;
}
this.form.validTime = this.form.validTime * 1;
if (this.title == "添加") {
let flag = false;
if (this.sessionStorageData.allowValid == 1) {
if (this.form.validTime >= 0) {
} else {
flag = true;
}
}
if (flag == false) {
addrecType(this.form)
.then((res) => {
if (res.code == "000000") {
this.$emit("editData");
this.dialogFormVisible = false;
this.$message.success({
message: "数据添加成功!",
});
} else {
this.$alert(res.message, "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => {},
});
}
})
.catch((err) => {
//console.log(err);
});
} else {
this.$alert("请设置有效期", "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => {},
});
}
} else {
delete this.form.rechargeTypeNum;
if (this.form.rechargeTypeName == this.rowForm.rechargeTypeName) {
delete this.form.rechargeTypeName;
}
if (this.form.giftMoney == 0) {
this.form.giftMoney = null;
}
editrecType(this.form).then((res) => {
if (res.code == "000000") {
this.$emit("editData");
this.dialogFormVisible = false;
this.$message.success({
message: res.message,
});
} else {
this.$alert(res.message, "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => {},
});
}
});
}
},
},
};
</script>
<style>
</style>

@ -35,7 +35,14 @@
<el-table-column align="center" prop="typeRatio" label="充值提成" min-width="80" sortable></el-table-column>
<el-table-column align="center" prop="firstAmount" label="首充金额" min-width="80" sortable></el-table-column>
<el-table-column align="center" prop="rechargeMoney" label="充值金额" min-width="80" sortable></el-table-column>
<el-table-column align="center" prop="giftMoney" label="赠送金额" min-width="80" sortable></el-table-column>
<el-table-column align="center" prop="giftMoney" label="赠送金额" min-width="80" sortable>
<template slot-scope="scope">
<span v-if="scope.row.donateType==0"></span>
<span v-if="scope.row.donateType==1"></span>
<span>{{scope.row.giftMoney}}</span>
<span v-if="scope.row.donateType==1">%</span>
</template>
</el-table-column>
<el-table-column align="center" prop="validTime" label="有效期(月)" min-width="100" sortable></el-table-column>
<el-table-column align="center" prop="founderStaff" label="创建人" min-width="80" sortable></el-table-column>
<el-table-column align="center" prop="storeName" label="所属门店" min-width="120" :show-overflow-tooltip="true" sortable></el-table-column>

@ -33,7 +33,6 @@
</el-radio-group>
</div>
</el-form-item>
<br />
<el-form-item class="memberUsing" label="会员启用:" prop="useRecharge">
<el-radio-group v-model="dataList.memberUsing" :disabled="!editInput">
@ -61,6 +60,14 @@
</div>
</el-radio-group>
</el-form-item><br />
<el-form-item class="pay_pays" label="补单业绩计算:">
<el-radio-group v-model="dataList.replacementOderChia" :disabled="!editInput">
<div class="pay1">
<el-radio :label="0">补单日期</el-radio>
<el-radio :label="1">录单日期</el-radio>
</div>
</el-radio-group>
</el-form-item><br />
<el-form-item class="pay_pays" label="充值/疗程账户时效控制:" prop="useRecharge">
<el-radio-group v-model="dataList.allowValid" :disabled="!editInput">
<el-radio :label="0">不控制有效时间</el-radio><br />
@ -341,6 +348,7 @@ export default {
allowdebt: false, //
debtUsable: null, //
memberPay: null, //
replacementOderChia: null, //
useRecharge: null, //
memberIntegral: false, //
cashier: false, //使
@ -491,6 +499,10 @@ export default {
if (item.paramentName == "memberPay") {
dataList.memberPay = item.paramentValue * 1;
}
if (item.paramentName == "replacementOderChia") {
dataList.replacementOderChia = item.paramentValue * 1;
}
if (item.paramentName == "expMoneyByIntegral") {
dataList.expMoneyByIntegral = item.paramentValue;
}
@ -901,6 +913,9 @@ export default {
dataList.memberPay +
"|" +
"0确认支付密码,1签名确认,2支付密码加签名确认";
dataList.replacementOderChia =
dataList.replacementOderChia + "|" + "0补单日期计算,1录单日期计算";
dataList.serviceTicke =
dataList.serviceTicke + "|" + "数字服务单可以作废控制的天数";
dataList.editOrderNum =

Loading…
Cancel
Save