登录方式更改
parent
f588163560
commit
7f095251f2
@ -0,0 +1,69 @@
|
||||
<template>
|
||||
<el-dialog :close-on-click-modal="false" class="text-center" v-dialogDrag title="选择门店" center :visible.sync="dialogVisible" width="500px">
|
||||
<el-table v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText" style="width: 500px;margin-top:5px" max-height="650" @current-change="rowClick" @row-dblclick="confirm">
|
||||
<el-table-column label="选择" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-radio v-model="rowIndex" :label="scope.row.id" @change.native="scope.row">
|
||||
{{ "" }}
|
||||
</el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="门店编码" align="center" min-width="100" prop="storeNum"></el-table-column>
|
||||
<el-table-column label="门店名称" align="center" min-width="180" prop="storeName"></el-table-column>
|
||||
<el-table-column label="属性" align="center" min-width="80">
|
||||
<template slot-scope="scope">
|
||||
<div class="padding-xs">
|
||||
<span v-if="scope.row.parentId" class="text-blue text-bold">(分店)</span>
|
||||
<span v-else class="text-red text-bold">(总店)</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button class="margin-left-lg" size="mini" type="primary" @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button size="mini" type="primary" :disabled="rowIndex == -1" @click="confirm()">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
listLoading: false, //list加载提示开启动画
|
||||
elementLoadingText: "正在加载中...",
|
||||
dialogVisible: false, //弹窗开关
|
||||
form: {}, //主对象
|
||||
list: [], //主数组
|
||||
radio: "",
|
||||
rowIndex: "",
|
||||
rowForm: {},
|
||||
storeNum: "",
|
||||
storeName: "",
|
||||
passText: "",
|
||||
showNumber: -1,
|
||||
storeId: "",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//组件传值
|
||||
show(list) {
|
||||
this.dialogVisible = true;
|
||||
this.list = [...list];
|
||||
this.rowIndex = -1;
|
||||
this.rowForm = {};
|
||||
},
|
||||
//点击选中
|
||||
rowClick(row) {
|
||||
this.rowIndex = row.id;
|
||||
this.rowForm = row;
|
||||
},
|
||||
//确定返回方法
|
||||
confirm() {
|
||||
this.dialogVisible = false;
|
||||
this.$emit("hiddensData", this.rowForm);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
@ -1,333 +1,334 @@
|
||||
<template>
|
||||
<el-dialog :close-on-click-modal="false" v-dialogDrag rechargeTypeId="form" :title="title" :visible.sync="dialogFormVisible" :before-close="handleClose">
|
||||
<el-form :model="form" inline :rules="rules" ref="form" label-width="120px">
|
||||
<el-form-item label="手机号码:" prop="mobilePhone">
|
||||
<div class="form-width-ms">
|
||||
<el-input style="padding-left:0px;" ref="" oninput="this.value=this.value.replace(/\D/g,'')" pattern="[0-9]*" maxlength="11" v-model="form.mobilePhone" @blur="query()" @change="query()">
|
||||
<el-button size="mini" slot="append" icon="el-icon-search" @click="openMember()"></el-button>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="会员名称:" prop="memberName">
|
||||
<div class="form-width-ms">
|
||||
{{form.memberName}}
|
||||
</div>
|
||||
</el-form-item>
|
||||
<br>
|
||||
<el-form-item label="帐户编码:" prop="outRechargeTypeNum">
|
||||
<div class="form-width-ms">
|
||||
<span v-if="form.outRechargeTypeNum" class="text-cyan" @click="openRec(0)">{{form.outRechargeTypeNum}}</span>
|
||||
<el-button v-else type="text" :disabled="!form.memberName" @click="openRec(0)">选择充值帐户</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="充值编码:" prop="inRechargeTypeNum">
|
||||
<div class="form-width-ms">
|
||||
<span v-if="form.inRechargeTypeNum" class="text-cyan" @click="openRec(1)">{{form.inRechargeTypeNum}}</span>
|
||||
<el-button v-else type="text" :disabled="!form.outRechargeTypeNum" @click="openRec(1)">选择充值类别</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<br>
|
||||
<el-form-item label="帐户名称:" prop="outRechargeTypeName">
|
||||
<div class="form-width-ms">
|
||||
{{form.outRechargeTypeName}}
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="充值名称:" prop="inRechargeTypeName">
|
||||
<div class="form-width-ms">
|
||||
{{form.inRechargeTypeName}}
|
||||
</div>
|
||||
</el-form-item>
|
||||
<br>
|
||||
<el-form-item label="可用金额:" prop="cardConsumeMoney">
|
||||
<div class="form-width-ms">
|
||||
{{form.cardConsumeMoney}}
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="转入金额:" prop="inMoney">
|
||||
<div class="form-width-ms">
|
||||
<el-input @blur="endPrice" @change="endPrice" v-model="form.inMoney" type="number" oninput="this.value=this.value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3')" pattern="[0-9]*\.?[0-9]{0,2}" autocomplete="on"></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<br>
|
||||
<el-form-item label="可用赠送:" prop="giftConsumeMoney">
|
||||
<div class="form-width-ms">
|
||||
{{form.giftConsumeMoney}}
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="转入赠送:" prop="inGiftMoney">
|
||||
<div class="form-width-ms">
|
||||
<el-input @blur="endGiftPrice" @change="endGiftPrice" v-model="form.inGiftMoney" type="number" oninput="this.value=this.value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3')" pattern="[0-9]*\.?[0-9]{0,2}" autocomplete="on"></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="text-center margin-left-lg padding-left">
|
||||
<staffsles ref="staffsles" @staffslesData="staffslesData"></staffsles>
|
||||
</div>
|
||||
<member ref="member" @memberData="memberData"></member>
|
||||
<rec ref="rec" @recTypeData="recData"></rec>
|
||||
<rectype ref="rectype" @recTypeData="rectypeData"></rectype>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="mini" type="primary" plain @click="handleClose">取 消</el-button>
|
||||
<el-button size="mini" type="primary" @click="confirm">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import rec from "@/components/recharge/index";
|
||||
import rectype from "@/components/recharge/type/index";
|
||||
import staffsles from "@/components/staffList/staff/index";
|
||||
|
||||
import {
|
||||
addRechargeCardTransition,
|
||||
updateRechargeCardTransition,
|
||||
} from "@/api/eashier.js";
|
||||
import { partten } from "../../../../../partten/index.js";
|
||||
import { storeMemberOne } from "@/api/eashier.js";
|
||||
import member from "@/components/member/index";
|
||||
export default {
|
||||
components: {
|
||||
member,
|
||||
rec,
|
||||
rectype,
|
||||
staffsles,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
rules: {
|
||||
rechargeTypeNum: {
|
||||
required: true,
|
||||
message: "请输入充值类别编码",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
rechargeMoney: {
|
||||
required: true,
|
||||
message: "请输入赠送金额",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
},
|
||||
staffList: [{ ratio: 100 }],
|
||||
form: {
|
||||
type: 0,
|
||||
},
|
||||
rowForm: {},
|
||||
listLoading: false, //list加载提示开启动画
|
||||
elementLoadingText: "加载中...", //list加载提示文字
|
||||
title: "", //弹窗标题
|
||||
dialogFormVisible: false, //弹窗开关
|
||||
editIndex: -1,
|
||||
memberNumber: 0,
|
||||
memberForm: {}, //会员对象
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//关闭弹窗前的回调方法
|
||||
handleClose() {
|
||||
this.form = Object.assign({});
|
||||
this.staffList = [{ ratio: 100 }];
|
||||
this.$refs.form.clearValidate();
|
||||
this.dialogFormVisible = false;
|
||||
},
|
||||
endPrice() {
|
||||
if (this.form.type == 0) {
|
||||
if (this.form.inMoney > this.form.cardConsumeMoney) {
|
||||
this.$alert("转出金额不能高于" + this.form.cardConsumeMoney, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
confirmButtonClass: "confirmbtnFalses",
|
||||
type: "warning",
|
||||
center: true,
|
||||
callback: (action) => {},
|
||||
});
|
||||
this.form.inMoney = this.form.cardConsumeMoney;
|
||||
}
|
||||
}
|
||||
},
|
||||
endGiftPrice() {
|
||||
if (this.form.type == 0) {
|
||||
if (this.form.inGiftMoney > this.form.giftConsumeMoney) {
|
||||
this.$alert(
|
||||
"转入赠送金额不能高于" + this.form.giftConsumeMoney,
|
||||
"提示",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
confirmButtonClass: "confirmbtnFalses",
|
||||
type: "warning",
|
||||
center: true,
|
||||
callback: (action) => {},
|
||||
}
|
||||
);
|
||||
this.form.inGiftMoney = this.form.giftConsumeMoney;
|
||||
}
|
||||
}
|
||||
},
|
||||
endNumber() {
|
||||
if (this.form.type == 0) {
|
||||
if (this.form.courseRestCount > this.form.topNumber) {
|
||||
this.$alert("转出次数不能高于" + this.form.topNumber, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
confirmButtonClass: "confirmbtnFalses",
|
||||
type: "warning",
|
||||
center: true,
|
||||
callback: (action) => {},
|
||||
});
|
||||
this.form.courseRestCount = this.form.topNumber;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//打开选择会员弹窗
|
||||
openMember() {
|
||||
this.$refs.member.show();
|
||||
},
|
||||
//选中会员返回方法
|
||||
memberData(v) {
|
||||
this.form.mobilePhone = v.mobilePhone;
|
||||
this.query();
|
||||
},
|
||||
//查询方法
|
||||
query() {
|
||||
var number = partten.phoneNum;
|
||||
var form = { ...this.form };
|
||||
if (!number.test(this.form.mobilePhone)) {
|
||||
this.$message.info({
|
||||
message: "请输入正确的手机号码 ! ",
|
||||
});
|
||||
} else {
|
||||
storeMemberOne({
|
||||
mobilePhone: this.form.mobilePhone,
|
||||
storeId: sessionStorage.getItem("parentId"),
|
||||
}).then((res) => {
|
||||
if (res.code == "000000") {
|
||||
form.memberId = res.data.id;
|
||||
form.memberNum = res.data.memberNum;
|
||||
form.memberName = res.data.memberName;
|
||||
form.mobilePhone = res.data.mobilePhone;
|
||||
res.data.memberId = res.data.id;
|
||||
this.memberForm = res.data;
|
||||
this.form = JSON.parse(JSON.stringify(form));
|
||||
} else {
|
||||
this.$alert(res.message, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
confirmButtonClass: "confirmbtnFalses",
|
||||
type: "warning",
|
||||
center: true,
|
||||
callback: (action) => {},
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
openRec(number) {
|
||||
if (number == 0) {
|
||||
this.$refs.rec.show(this.memberForm);
|
||||
} else {
|
||||
this.$refs.rectype.show(this.form.outType);
|
||||
}
|
||||
},
|
||||
endEdit(row, index) {
|
||||
this.editIndex = -1;
|
||||
},
|
||||
//选中会员充值卡包返回方法
|
||||
recData(v) {
|
||||
let form = { ...this.form };
|
||||
form.outRechargeTypeNum = v.rechargeTypeNum;
|
||||
form.outRechargeTypeName = v.rechargeTypeName;
|
||||
form.outRechargeTypeId = v.rechargeTypeId;
|
||||
form.outAccountId = v.id;
|
||||
form.outType = v.type;
|
||||
form.cardConsumeMoney = v.cardConsumeMoney;
|
||||
form.giftConsumeMoney = v.giftConsumeMoney ? v.giftConsumeMoney : 0;
|
||||
this.form = JSON.parse(JSON.stringify(form));
|
||||
},
|
||||
rectypeData(v) {
|
||||
let form = { ...this.form };
|
||||
form.inRechargeTypeNum = v.rechargeTypeNum;
|
||||
form.inRechargeTypeName = v.rechargeTypeName;
|
||||
form.inRechargeTypeId = v.id;
|
||||
form.inType = v.type;
|
||||
form.inMoney = form.cardConsumeMoney;
|
||||
form.inGiftMoney = form.giftConsumeMoney;
|
||||
this.form = JSON.parse(JSON.stringify(form));
|
||||
},
|
||||
//组件传值
|
||||
show(form, type) {
|
||||
this.staffList = [{ ratio: 100 }];
|
||||
this.form = Object.assign({});
|
||||
if (form == "添加") {
|
||||
this.title = form;
|
||||
} else {
|
||||
this.title = "修改";
|
||||
this.form = { ...form };
|
||||
this.staffList = form.staffLists;
|
||||
}
|
||||
console.log(this.staffList);
|
||||
|
||||
this.dialogFormVisible = true;
|
||||
this.toStaff();
|
||||
},
|
||||
toStaff() {
|
||||
this.staffList.forEach((item) => {
|
||||
if (item.id) {
|
||||
item.staffNames = item.brandNumber + "--" + item.staffName;
|
||||
} else {
|
||||
item.staffNames = "";
|
||||
}
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$refs.staffsles.show(this.staffList);
|
||||
}, 500);
|
||||
},
|
||||
//员工占比返回方法
|
||||
staffslesData(v) {
|
||||
this.staffList = [...v];
|
||||
},
|
||||
//确定返回方法
|
||||
confirm() {
|
||||
if (this.title == "添加") {
|
||||
this.form.staffLists = this.staffList;
|
||||
addRechargeCardTransition(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 {
|
||||
updateRechargeCardTransition(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" inline :rules="rules" ref="form" label-width="120px">
|
||||
<el-form-item label="手机号码:" prop="mobilePhone">
|
||||
<div class="form-width-ms">
|
||||
<el-input style="padding-left:0px;" ref="" oninput="this.value=this.value.replace(/\D/g,'')" pattern="[0-9]*" maxlength="11" v-model="form.mobilePhone" @blur="query()" @change="query()">
|
||||
<el-button size="mini" slot="append" icon="el-icon-search" @click="openMember()"></el-button>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="会员名称:" prop="memberName">
|
||||
<div class="form-width-ms">
|
||||
{{form.memberName}}
|
||||
</div>
|
||||
</el-form-item>
|
||||
<br>
|
||||
<el-form-item label="帐户编码:" prop="outRechargeTypeNum">
|
||||
<div class="form-width-ms">
|
||||
<span v-if="form.outRechargeTypeNum" class="text-cyan" @click="openRec(0)">{{form.outRechargeTypeNum}}</span>
|
||||
<el-button v-else type="text" :disabled="!form.memberName" @click="openRec(0)">选择充值帐户</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="充值编码:" prop="inRechargeTypeNum">
|
||||
<div class="form-width-ms">
|
||||
<span v-if="form.inRechargeTypeNum" class="text-cyan" @click="openRec(1)">{{form.inRechargeTypeNum}}</span>
|
||||
<el-button v-else type="text" :disabled="!form.outRechargeTypeNum" @click="openRec(1)">选择充值类别</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<br>
|
||||
<el-form-item label="帐户名称:" prop="outRechargeTypeName">
|
||||
<div class="form-width-ms">
|
||||
{{form.outRechargeTypeName}}
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="充值名称:" prop="inRechargeTypeName">
|
||||
<div class="form-width-ms">
|
||||
{{form.inRechargeTypeName}}
|
||||
</div>
|
||||
</el-form-item>
|
||||
<br>
|
||||
<el-form-item label="可用金额:" prop="cardConsumeMoney">
|
||||
<div class="form-width-ms">
|
||||
{{form.cardConsumeMoney}}
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="转入金额:" prop="inMoney">
|
||||
<div class="form-width-ms">
|
||||
<el-input @blur="endPrice" @change="endPrice" v-model="form.inMoney" type="number" oninput="this.value=this.value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3')" pattern="[0-9]*\.?[0-9]{0,2}" autocomplete="on"></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<br>
|
||||
<el-form-item label="可用赠送:" prop="giftConsumeMoney">
|
||||
<div class="form-width-ms">
|
||||
{{form.giftConsumeMoney}}
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="转入赠送:" prop="inGiftMoney">
|
||||
<div class="form-width-ms">
|
||||
<el-input @blur="endGiftPrice" @change="endGiftPrice" v-model="form.inGiftMoney" type="number" oninput="this.value=this.value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3')" pattern="[0-9]*\.?[0-9]{0,2}" autocomplete="on"></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="text-center margin-left-lg padding-left">
|
||||
<staffsles ref="staffsles" @staffslesData="staffslesData"></staffsles>
|
||||
</div>
|
||||
<member ref="member" @memberData="memberData"></member>
|
||||
<rec ref="rec" @recTypeData="recData"></rec>
|
||||
<rectype ref="rectype" @recTypeData="rectypeData"></rectype>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="mini" type="primary" plain @click="handleClose">取 消</el-button>
|
||||
<el-button size="mini" type="primary" @click="confirm">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import rec from "@/components/recharge/index";
|
||||
import rectype from "@/components/recharge/type/index";
|
||||
import staffsles from "@/components/staffList/staff/index";
|
||||
|
||||
import {
|
||||
addRechargeCardTransition,
|
||||
updateRechargeCardTransition,
|
||||
} from "@/api/eashier.js";
|
||||
import { partten } from "../../../../../partten/index.js";
|
||||
import { storeMemberOne } from "@/api/eashier.js";
|
||||
import member from "@/components/member/index";
|
||||
export default {
|
||||
components: {
|
||||
member,
|
||||
rec,
|
||||
rectype,
|
||||
staffsles,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
rules: {
|
||||
rechargeTypeNum: {
|
||||
required: true,
|
||||
message: "请输入充值类别编码",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
rechargeMoney: {
|
||||
required: true,
|
||||
message: "请输入赠送金额",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
},
|
||||
staffList: [{ ratio: 100 }],
|
||||
form: {
|
||||
type: 0,
|
||||
},
|
||||
rowForm: {},
|
||||
listLoading: false, //list加载提示开启动画
|
||||
elementLoadingText: "加载中...", //list加载提示文字
|
||||
title: "", //弹窗标题
|
||||
dialogFormVisible: false, //弹窗开关
|
||||
editIndex: -1,
|
||||
memberNumber: 0,
|
||||
memberForm: {}, //会员对象
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//关闭弹窗前的回调方法
|
||||
handleClose() {
|
||||
this.form = Object.assign({});
|
||||
this.staffList = [{ ratio: 100 }];
|
||||
this.$refs.form.clearValidate();
|
||||
this.dialogFormVisible = false;
|
||||
},
|
||||
endPrice() {
|
||||
if (this.form.type == 0) {
|
||||
if (this.form.inMoney > this.form.cardConsumeMoney) {
|
||||
this.$alert("转出金额不能高于" + this.form.cardConsumeMoney, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
confirmButtonClass: "confirmbtnFalses",
|
||||
type: "warning",
|
||||
center: true,
|
||||
callback: (action) => {},
|
||||
});
|
||||
this.form.inMoney = this.form.cardConsumeMoney;
|
||||
}
|
||||
}
|
||||
},
|
||||
endGiftPrice() {
|
||||
if (this.form.type == 0) {
|
||||
if (this.form.inGiftMoney > this.form.giftConsumeMoney) {
|
||||
this.$alert(
|
||||
"转入赠送金额不能高于" + this.form.giftConsumeMoney,
|
||||
"提示",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
confirmButtonClass: "confirmbtnFalses",
|
||||
type: "warning",
|
||||
center: true,
|
||||
callback: (action) => {},
|
||||
}
|
||||
);
|
||||
this.form.inGiftMoney = this.form.giftConsumeMoney;
|
||||
}
|
||||
}
|
||||
},
|
||||
endNumber() {
|
||||
if (this.form.type == 0) {
|
||||
if (this.form.courseRestCount > this.form.topNumber) {
|
||||
this.$alert("转出次数不能高于" + this.form.topNumber, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
confirmButtonClass: "confirmbtnFalses",
|
||||
type: "warning",
|
||||
center: true,
|
||||
callback: (action) => {},
|
||||
});
|
||||
this.form.courseRestCount = this.form.topNumber;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//打开选择会员弹窗
|
||||
openMember() {
|
||||
this.$refs.member.show();
|
||||
},
|
||||
//选中会员返回方法
|
||||
memberData(v) {
|
||||
this.form.mobilePhone = v.mobilePhone;
|
||||
this.query();
|
||||
},
|
||||
//查询方法
|
||||
query() {
|
||||
var number = partten.phoneNum;
|
||||
var form = { ...this.form };
|
||||
if (!number.test(this.form.mobilePhone)) {
|
||||
this.$message.info({
|
||||
message: "请输入正确的手机号码 ! ",
|
||||
});
|
||||
} else {
|
||||
storeMemberOne({
|
||||
mobilePhone: this.form.mobilePhone,
|
||||
storeId: sessionStorage.getItem("parentId"),
|
||||
}).then((res) => {
|
||||
if (res.code == "000000") {
|
||||
form.memberId = res.data.id;
|
||||
form.memberNum = res.data.memberNum;
|
||||
form.memberName = res.data.memberName;
|
||||
form.mobilePhone = res.data.mobilePhone;
|
||||
res.data.memberId = res.data.id;
|
||||
this.memberForm = res.data;
|
||||
this.form = JSON.parse(JSON.stringify(form));
|
||||
} else {
|
||||
this.$alert(res.message, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
confirmButtonClass: "confirmbtnFalses",
|
||||
type: "warning",
|
||||
center: true,
|
||||
callback: (action) => {},
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
openRec(number) {
|
||||
if (number == 0) {
|
||||
this.$refs.rec.show(this.memberForm);
|
||||
} else {
|
||||
console.log(this.form.outType);
|
||||
this.$refs.rectype.show(this.form.outType);
|
||||
}
|
||||
},
|
||||
endEdit(row, index) {
|
||||
this.editIndex = -1;
|
||||
},
|
||||
//选中会员充值卡包返回方法
|
||||
recData(v) {
|
||||
let form = { ...this.form };
|
||||
form.outRechargeTypeNum = v.rechargeTypeNum;
|
||||
form.outRechargeTypeName = v.rechargeTypeName;
|
||||
form.outRechargeTypeId = v.rechargeTypeId;
|
||||
form.outAccountId = v.id;
|
||||
form.outType = v.type;
|
||||
form.cardConsumeMoney = v.cardConsumeMoney;
|
||||
form.giftConsumeMoney = v.giftConsumeMoney ? v.giftConsumeMoney : 0;
|
||||
this.form = JSON.parse(JSON.stringify(form));
|
||||
},
|
||||
rectypeData(v) {
|
||||
let form = { ...this.form };
|
||||
form.inRechargeTypeNum = v.rechargeTypeNum;
|
||||
form.inRechargeTypeName = v.rechargeTypeName;
|
||||
form.inRechargeTypeId = v.id;
|
||||
form.inType = v.type;
|
||||
form.inMoney = form.cardConsumeMoney;
|
||||
form.inGiftMoney = form.giftConsumeMoney;
|
||||
this.form = JSON.parse(JSON.stringify(form));
|
||||
},
|
||||
//组件传值
|
||||
show(form, type) {
|
||||
this.staffList = [{ ratio: 100 }];
|
||||
this.form = Object.assign({});
|
||||
if (form == "添加") {
|
||||
this.title = form;
|
||||
} else {
|
||||
this.title = "修改";
|
||||
this.form = { ...form };
|
||||
this.staffList = form.staffLists;
|
||||
}
|
||||
console.log(this.staffList);
|
||||
|
||||
this.dialogFormVisible = true;
|
||||
this.toStaff();
|
||||
},
|
||||
toStaff() {
|
||||
this.staffList.forEach((item) => {
|
||||
if (item.id) {
|
||||
item.staffNames = item.brandNumber + "--" + item.staffName;
|
||||
} else {
|
||||
item.staffNames = "";
|
||||
}
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$refs.staffsles.show(this.staffList);
|
||||
}, 500);
|
||||
},
|
||||
//员工占比返回方法
|
||||
staffslesData(v) {
|
||||
this.staffList = [...v];
|
||||
},
|
||||
//确定返回方法
|
||||
confirm() {
|
||||
if (this.title == "添加") {
|
||||
this.form.staffLists = this.staffList;
|
||||
addRechargeCardTransition(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 {
|
||||
updateRechargeCardTransition(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>
|
||||
|
||||
@ -0,0 +1,281 @@
|
||||
<template>
|
||||
<el-dialog :title="title+'方案'" :visible.sync="dialogFormVisible" width="1000px" :before-close="handleClose">
|
||||
<div class="packing">
|
||||
<el-form ref="form" :model="packingForm" inline :rules="rules" label-width="100px">
|
||||
<el-form-item label="方案名称:" prop="promotionName">
|
||||
<div class="form-width-m">
|
||||
{{packingForm.promotionName}}
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目总数:" prop="projectTotal">
|
||||
<div class="form-width-sm">
|
||||
{{packingForm.projectTotal}}
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="可选项目数:" prop="projectCount">
|
||||
<div class="form-width-sm">
|
||||
{{packingForm.projectCount}}
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="打包价:">
|
||||
<div class="form-width-sm">{{ packingForm.saleMoney }}</div>
|
||||
</el-form-item>
|
||||
<br />
|
||||
<el-form-item label="开始日期:" prop="beginDate">
|
||||
<div class="block form-width-m">
|
||||
{{packingForm.beginDate}}
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束日期:" prop="endDate">
|
||||
<div class="block form-width-m">
|
||||
{{packingForm.endDate}}
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="现付提成:" prop="salesCommission">
|
||||
{{packingForm.salesCommission}}
|
||||
</el-form-item>
|
||||
<el-form-item label="卡付提成:" prop="cardSalesCommission">
|
||||
{{packingForm.cardSalesCommission}}
|
||||
</el-form-item><br />
|
||||
<el-form-item label="适用对象:" rop="suitableObject">
|
||||
<div>
|
||||
<el-radio-group disabled v-model="packingForm.suitableObject" style="font-size:14px">
|
||||
<el-radio class="margin-bottom" :label="0">所有会员</el-radio>
|
||||
<el-radio class="margin-top" :label="2">指定会员</el-radio>
|
||||
<el-button :disabled="!(packingForm.suitableObject === 2)" size="mini" type="text" @click="openSuitMember(packingForm)"><span>会员列表</span></el-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否限购:" rop="limitBuy">
|
||||
<div style="width:280px;padding-top:5px">
|
||||
<el-radio-group disabled v-model="packingForm.limitBuy" style="font-size:14px">
|
||||
<el-radio :label="0">不限购</el-radio>
|
||||
<el-radio class="margin-bottom" :label="1">限购</el-radio>
|
||||
<input oninput="this.value=this.value.replace(/\D/g,'')" pattern="[0-9]*" v-show="packingForm.limitBuy == 1" type="number" v-model="packingForm.limitCount" class="form-width-xss" style="border:none;border-bottom:1px solid #333;margin-right:10px" /><span v-show="packingForm.limitBuy == 1">包</span>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="适用门店:" rop="suitableObject">
|
||||
<el-radio-group disabled v-model="packingForm.suitableStore" style="font-size:14px">
|
||||
<el-radio class="margin-bottom" :label="0">所有门店</el-radio>
|
||||
<el-radio class="margin-top" :label="1">指定门店</el-radio>
|
||||
<el-button :disabled="!(packingForm.suitableStore === 1)" size="mini" type="text" @click="openSuitStore(packingForm)"><span>门店列表</span></el-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="允许卡付:" rop="limitBuy">
|
||||
<el-radio-group disabled v-model="packingForm.cardBuy" style="font-size:14px">
|
||||
<el-radio :label="1">允许卡付</el-radio>
|
||||
<el-radio :label="0">不允许卡付</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<div style="width:840px;margin-left:30px">
|
||||
<el-table :data="promotionProjectLists" :header-cell-style="{
|
||||
background: 'linear-gradient(#6cb3ff, #1873d4)',
|
||||
color: '#eeeeee'
|
||||
}" style="margin-top:10px">
|
||||
<el-table-column prop="projectNum" label="项目编码" align="center" min-width="90"></el-table-column>
|
||||
<el-table-column prop="projectName" label="项目名称" :show-overflow-tooltip="true" align="center" min-width="120"></el-table-column>
|
||||
<el-table-column prop="priceMember" label="标准价" align="center" width="80"></el-table-column>
|
||||
<el-table-column prop="required" label="必选" align="center" min-width="80">
|
||||
<template slot-scope="scope">{{scope.row.required==0?'是':"否"}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="times" label="次数" align="center" min-width="80"></el-table-column>
|
||||
<el-table-column prop="projectTotalMoney" label="总金额" align="center" min-width="100" fixed="right"></el-table-column>
|
||||
</el-table>
|
||||
<div style="width:100%;background:#eee;display: flex;justify-content:space-between;font-size:14px;line-height:40px">
|
||||
<div class="padding-left">合计</div>
|
||||
<div class="padding-right-lg">
|
||||
<span>最高价: <span class="text-red text-price">{{topPrice}}</span></span>
|
||||
<span class="padding-left-xs">总价值: <span class="text-red text-price">{{projectPriceSum}}</span></span>
|
||||
<span class="padding-left-xs">最低价: <span class="text-red text-price">{{minumumPrice}}</span></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
<suit ref="suit" @suitData="suitData"></suit>
|
||||
<membersuit ref="membersuit" @membersuitData="membersuitData"></membersuit>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleClose" size="mini">关闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
addPromotion,
|
||||
promotionPage,
|
||||
editPromotion,
|
||||
promotionAudit,
|
||||
promotionRevokeAudit,
|
||||
promotionSendAudit,
|
||||
promotionUnAudit,
|
||||
promotionPush,
|
||||
promotionProList,
|
||||
promotionShutDown,
|
||||
} from "@/api/promotion.js";
|
||||
import suit from "../../components/suit";
|
||||
import membersuit from "../../components/memberSuit";
|
||||
export default {
|
||||
components: { suit, membersuit },
|
||||
data() {
|
||||
return {
|
||||
rules: {},
|
||||
title: "", //弹窗标题
|
||||
dialogFormVisible: false, //弹窗开关
|
||||
packingForm: {
|
||||
//方案表单
|
||||
promotionName: "",
|
||||
saleMoney: 0,
|
||||
beginDate: "",
|
||||
endDate: "",
|
||||
suitableObject: 0,
|
||||
limitBuy: 0,
|
||||
limitCount: 100,
|
||||
salesCommission: null,
|
||||
cardSalesCommission: null,
|
||||
cardBuy: 1,
|
||||
cardLimit: 0,
|
||||
suitableStore: 0,
|
||||
},
|
||||
promotionProjectLists: [],
|
||||
projectPriceSum: 0, //方案总价
|
||||
minumumPrice: 0, //最低价
|
||||
topPrice: 0, //最高价
|
||||
editIndex: -1, //编辑行的内容下标
|
||||
sumIndex: -1, //是否重新合计总价
|
||||
date: [], //时间组件默认
|
||||
totalMoneyIndex: -1, //修改总金额:下标
|
||||
timesIndex: -1, //修改次数:下标
|
||||
projectText: "添加", //添加修改项目标识
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
show(form, title) {
|
||||
Object.assign(this.$data, this.$options.data.call(this));
|
||||
if (form) {
|
||||
this.packingForm = { ...form };
|
||||
this.promotionProjectLists = form.promotionProjectLists;
|
||||
}
|
||||
this.title = title;
|
||||
this.dialogFormVisible = true;
|
||||
this.sumsNUmber();
|
||||
},
|
||||
//关闭弹窗前的回调方法
|
||||
handleClose() {
|
||||
this.packingForm = {};
|
||||
this.dialogFormVisible = false;
|
||||
this.$refs.form.clearValidate();
|
||||
},
|
||||
|
||||
//打开指定门店弹窗
|
||||
openSuitStore(row) {
|
||||
this.$refs.suit.show(row);
|
||||
},
|
||||
//指定门店返回
|
||||
suitData(v) {
|
||||
let list = [];
|
||||
v.forEach((item) => {
|
||||
if (item.id) {
|
||||
item.storeId = item.id;
|
||||
list.push(item);
|
||||
}
|
||||
});
|
||||
this.packingForm.promotionStores = list;
|
||||
},
|
||||
//打开指定会员弹窗
|
||||
openSuitMember(row) {
|
||||
this.$refs.membersuit.show(row);
|
||||
},
|
||||
//指定会员返回
|
||||
membersuitData(v) {
|
||||
let list = [];
|
||||
v.forEach((item) => {
|
||||
if (item.id) {
|
||||
item.memberId = item.id;
|
||||
list.push(item);
|
||||
}
|
||||
});
|
||||
this.packingForm.promotionMemberLists = list;
|
||||
},
|
||||
|
||||
//合计计算
|
||||
sumsNUmber(number) {
|
||||
let num = 0;
|
||||
let totalMoney = 0;
|
||||
var bigList = [];
|
||||
var topPrice = 0;
|
||||
var minumumPrice = 0;
|
||||
if (this.promotionProjectLists.length > 0) {
|
||||
this.promotionProjectLists.forEach((item, index) => {
|
||||
num += item.priceMember * 1 * item.times * 1;
|
||||
item.projectTotalMoney =
|
||||
(item.priceMember * item.times * 1).toFixed(2) * 1;
|
||||
totalMoney += item.projectTotalMoney * 1;
|
||||
if (item.required == 0) {
|
||||
item.required = 0;
|
||||
item.check = true;
|
||||
} else {
|
||||
item.check = false;
|
||||
item.required = 1;
|
||||
}
|
||||
});
|
||||
|
||||
bigList = this.promotionProjectLists.sort(function (a, b) {
|
||||
return a.projectTotalMoney - b.projectTotalMoney;
|
||||
});
|
||||
var samlList = [];
|
||||
|
||||
for (var i = bigList.length - 1; i >= 0; i--) {
|
||||
samlList.push(bigList[i]);
|
||||
}
|
||||
console.log(bigList);
|
||||
console.log(samlList);
|
||||
|
||||
bigList.forEach((item, index) => {
|
||||
if (index < this.packingForm.projectCount) {
|
||||
topPrice += item.projectTotalMoney;
|
||||
console.log(item.projectTotalMoney);
|
||||
}
|
||||
});
|
||||
samlList.forEach((item, index) => {
|
||||
if (index < this.packingForm.projectCount) {
|
||||
minumumPrice += item.projectTotalMoney;
|
||||
console.log(item.projectTotalMoney);
|
||||
}
|
||||
});
|
||||
this.topPrice = topPrice;
|
||||
this.minumumPrice = minumumPrice;
|
||||
this.projectPriceSum = totalMoney.toFixed(2) * 1;
|
||||
this.packingForm.saleMoney = 0;
|
||||
this.packingForm.totalMoney = 0;
|
||||
this.packingForm.saleMoney = totalMoney.toFixed(2) * 1;
|
||||
this.packingForm.totalMoney = num.toFixed(2) * 1;
|
||||
}
|
||||
},
|
||||
//保存确定方法
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.packing .el-date-editor.el-input,
|
||||
.packing .el-date-editor.el-input__inner {
|
||||
width: 150px;
|
||||
}
|
||||
.changeDate .el-date-editor.el-input,
|
||||
.changeDate .el-date-editor.el-input__inner {
|
||||
width: 240px;
|
||||
}
|
||||
.packing .el-radio-group input {
|
||||
height: 100%;
|
||||
padding-left: 5px;
|
||||
}
|
||||
.packing .el-table th {
|
||||
padding: 12px 0;
|
||||
}
|
||||
.packingRadioTable .el-radio__label {
|
||||
display: none;
|
||||
}
|
||||
.schemeListDiv .el-radio__label {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
@ -1,140 +1,154 @@
|
||||
<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="classNum">
|
||||
<el-input ref="classNum" class="form-width" v-model="form.classNum" autocomplete="on"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="等级名称:" prop="className">
|
||||
<el-input class="form-width" v-model="form.className" autocomplete="on"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="充值标准:" prop="rechargeStandard">
|
||||
<el-input class="form-width" type="number" placeholder="请输入充值标准" pattern="[0-9]*\" v-model="form.rechargeStandard" autocomplete="on"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="疗程标准:" prop="courseStandard">
|
||||
<el-input class="form-width" type="number" placeholder="请输入疗程标准" pattern="[0-9]*\" v-model="form.courseStandard" autocomplete="on"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="收银标准:" prop="cashDecimal">
|
||||
<el-input class="form-width" type="number" placeholder="请输入收银标准" pattern="[0-9]*\" v-model="form.cashDecimal" autocomplete="on"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="mini" type="primary" plain @click="handleClose">取 消</el-button>
|
||||
<el-button size="mini" type="primary" @click="confirm">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { addMemberClass, editMemberClass } from "@/api/storeManage.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
rules: {
|
||||
classNum: {
|
||||
required: true,
|
||||
message: "请输入等级编码",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
className: {
|
||||
required: true,
|
||||
message: "请输入等级名称",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
statisticsQuarter: {
|
||||
required: true,
|
||||
message: "请选择等级制度",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
|
||||
rechargeStandard: {
|
||||
required: true,
|
||||
message: "请输入充值标准",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
|
||||
courseStandard: {
|
||||
required: true,
|
||||
message: "请输入疗程标准",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
|
||||
cashDecimal: {
|
||||
required: true,
|
||||
message: "请输入收银标准",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
},
|
||||
form: {}, //主对象
|
||||
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 };
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.$refs.classNum.focus();
|
||||
this.$refs.classNum.select();
|
||||
}, 300);
|
||||
this.dialogFormVisible = true;
|
||||
},
|
||||
//确定返回方法
|
||||
confirm() {
|
||||
if (this.title == "添加") {
|
||||
addMemberClass(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 {
|
||||
editMemberClass(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="classNum">
|
||||
<el-input ref="classNum" class="form-width" v-model="form.classNum" autocomplete="on"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="等级名称:" prop="className">
|
||||
<el-input class="form-width" v-model="form.className" autocomplete="on"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="制度:" prop="statisticsQuarter">
|
||||
<el-radio-group v-model="form.statisticsQuarter">
|
||||
<el-radio :label="0">月度</el-radio>
|
||||
<el-radio :label="1">半年度</el-radio>
|
||||
<el-radio :label="2">一年度</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="等级编号:" prop="classRow">
|
||||
<el-input class="form-width" type="number" placeholder="请输入等级编号" pattern="[0-9]*\" v-model="form.classRow" autocomplete="on"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="充值标准:" prop="rechargeStandard">
|
||||
<el-input class="form-width" type="number" placeholder="请输入充值标准" pattern="[0-9]*\" v-model="form.rechargeStandard" autocomplete="on"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="疗程标准:" prop="courseStandard">
|
||||
<el-input class="form-width" type="number" placeholder="请输入疗程标准" pattern="[0-9]*\" v-model="form.courseStandard" autocomplete="on"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="收银标准:" prop="cashDecimal">
|
||||
<el-input class="form-width" type="number" placeholder="请输入收银标准" pattern="[0-9]*\" v-model="form.cashDecimal" autocomplete="on"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="mini" type="primary" plain @click="handleClose">取 消</el-button>
|
||||
<el-button size="mini" type="primary" @click="confirm">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { addMemberClass, editMemberClass } from "@/api/storeManage.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
rules: {
|
||||
classNum: {
|
||||
required: true,
|
||||
message: "请输入等级编码",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
className: {
|
||||
required: true,
|
||||
message: "请输入等级名称",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
statisticsQuarter: {
|
||||
required: true,
|
||||
message: "请选择等级制度",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
|
||||
rechargeStandard: {
|
||||
required: true,
|
||||
message: "请输入充值标准",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
classRow: {
|
||||
required: true,
|
||||
message: "请输入等级编号",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
courseStandard: {
|
||||
required: true,
|
||||
message: "请输入疗程标准",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
|
||||
cashDecimal: {
|
||||
required: true,
|
||||
message: "请输入收银标准",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
},
|
||||
form: {}, //主对象
|
||||
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 };
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.$refs.classNum.focus();
|
||||
this.$refs.classNum.select();
|
||||
}, 300);
|
||||
this.dialogFormVisible = true;
|
||||
},
|
||||
//确定返回方法
|
||||
confirm() {
|
||||
if (this.title == "添加") {
|
||||
addMemberClass(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 {
|
||||
editMemberClass(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>
|
||||
|
||||
@ -1,66 +0,0 @@
|
||||
<template>
|
||||
<el-table border :data="list" max-height="600" ref="list" v-loading="listLoading" :element-loading-text="elementLoadingText" @row-click="getCurrentRow" :row-class-name="rowName" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip min-width="120" align="left" prop="courseProjectName" label="项目名称"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip min-width="75" align="center" prop="price" label="项目单价"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip min-width="75" align="center" prop="courseRestCount" label="剩余次数"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip min-width="75" align="center" prop="courseRestPrice" label="剩余金额"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip min-width="75" align="center" prop="courseConsumeCount" label="可用次数"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip min-width="75" align="center" prop="courseConsumePrice" label="可用金额"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip min-width="105" align="center" prop="endTime" label="到期日期"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip min-width="75" align="center" prop="storeName" label="所属门店"></el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
listLoading: false,
|
||||
dialogFormVisible: false,
|
||||
layout: "total, sizes, prev, pager, next, jumper",
|
||||
form: {}, //主对象
|
||||
elementLoadingText: "正在加载...",
|
||||
list: [], //主数组
|
||||
selection: [],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//多选方法
|
||||
getCurrentRow(row) {
|
||||
this.$refs["list"].toggleRowSelection(row);
|
||||
},
|
||||
//多选变动方法
|
||||
handleSelectionChange(selection) {
|
||||
selection.forEach((item) => {
|
||||
item.isShow = true;
|
||||
});
|
||||
this.selection = selection;
|
||||
console.log(this.selection);
|
||||
this.$emit("proData", this.selection);
|
||||
},
|
||||
//列表返回方法
|
||||
rowName({ row, rowIndex }) {
|
||||
row.index = rowIndex;
|
||||
},
|
||||
//保存确定方法
|
||||
save() {
|
||||
this.$emit("proData", this.selection);
|
||||
},
|
||||
//组件传值
|
||||
show(list) {
|
||||
this.list = [...list];
|
||||
this.list.forEach((item) => {
|
||||
if (item.isShow) {
|
||||
this.$refs["list"].toggleRowSelection(item);
|
||||
}
|
||||
});
|
||||
this.selection = [];
|
||||
this.dialogFormVisible = true;
|
||||
},
|
||||
},
|
||||
created: function () {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
@ -1,27 +1,27 @@
|
||||
// A custom Nightwatch assertion.
|
||||
// The assertion name is the filename.
|
||||
// Example usage:
|
||||
//
|
||||
// browser.assert.elementCount(selector, count)
|
||||
//
|
||||
// For more information on custom assertions see:
|
||||
// http://nightwatchjs.org/guide#writing-custom-assertions
|
||||
|
||||
exports.assertion = function (selector, count) {
|
||||
this.message = 'Testing if element <' + selector + '> has count: ' + count
|
||||
this.expected = count
|
||||
this.pass = function (val) {
|
||||
return val === this.expected
|
||||
}
|
||||
this.value = function (res) {
|
||||
return res.value
|
||||
}
|
||||
this.command = function (cb) {
|
||||
var self = this
|
||||
return this.api.execute(function (selector) {
|
||||
return document.querySelectorAll(selector).length
|
||||
}, [selector], function (res) {
|
||||
cb.call(self, res)
|
||||
})
|
||||
}
|
||||
}
|
||||
// A custom Nightwatch assertion.
|
||||
// The assertion name is the filename.
|
||||
// Example usage:
|
||||
//
|
||||
// browser.assert.elementCount(selector, count)
|
||||
//
|
||||
// For more information on custom assertions see:
|
||||
// http://nightwatchjs.org/guide#writing-custom-assertions
|
||||
|
||||
exports.assertion = function (selector, count) {
|
||||
this.message = 'Testing if element <' + selector + '> has count: ' + count
|
||||
this.expected = count
|
||||
this.pass = function (val) {
|
||||
return val === this.expected
|
||||
}
|
||||
this.value = function (res) {
|
||||
return res.value
|
||||
}
|
||||
this.command = function (cb) {
|
||||
var self = this
|
||||
return this.api.execute(function (selector) {
|
||||
return document.querySelectorAll(selector).length
|
||||
}, [selector], function (res) {
|
||||
cb.call(self, res)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,46 +1,46 @@
|
||||
require('babel-register')
|
||||
var config = require('../../config')
|
||||
|
||||
// http://nightwatchjs.org/gettingstarted#settings-file
|
||||
module.exports = {
|
||||
src_folders: ['test/e2e/specs'],
|
||||
output_folder: 'test/e2e/reports',
|
||||
custom_assertions_path: ['test/e2e/custom-assertions'],
|
||||
|
||||
selenium: {
|
||||
start_process: true,
|
||||
server_path: require('selenium-server').path,
|
||||
host: '127.0.0.1',
|
||||
port: 4444,
|
||||
cli_args: {
|
||||
'webdriver.chrome.driver': require('chromedriver').path
|
||||
}
|
||||
},
|
||||
|
||||
test_settings: {
|
||||
default: {
|
||||
selenium_port: 4444,
|
||||
selenium_host: 'localhost',
|
||||
silent: true,
|
||||
globals: {
|
||||
devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port)
|
||||
}
|
||||
},
|
||||
|
||||
chrome: {
|
||||
desiredCapabilities: {
|
||||
browserName: 'chrome',
|
||||
javascriptEnabled: true,
|
||||
acceptSslCerts: true
|
||||
}
|
||||
},
|
||||
|
||||
firefox: {
|
||||
desiredCapabilities: {
|
||||
browserName: 'firefox',
|
||||
javascriptEnabled: true,
|
||||
acceptSslCerts: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
require('babel-register')
|
||||
var config = require('../../config')
|
||||
|
||||
// http://nightwatchjs.org/gettingstarted#settings-file
|
||||
module.exports = {
|
||||
src_folders: ['test/e2e/specs'],
|
||||
output_folder: 'test/e2e/reports',
|
||||
custom_assertions_path: ['test/e2e/custom-assertions'],
|
||||
|
||||
selenium: {
|
||||
start_process: true,
|
||||
server_path: require('selenium-server').path,
|
||||
host: '127.0.0.1',
|
||||
port: 4444,
|
||||
cli_args: {
|
||||
'webdriver.chrome.driver': require('chromedriver').path
|
||||
}
|
||||
},
|
||||
|
||||
test_settings: {
|
||||
default: {
|
||||
selenium_port: 4444,
|
||||
selenium_host: 'localhost',
|
||||
silent: true,
|
||||
globals: {
|
||||
devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port)
|
||||
}
|
||||
},
|
||||
|
||||
chrome: {
|
||||
desiredCapabilities: {
|
||||
browserName: 'chrome',
|
||||
javascriptEnabled: true,
|
||||
acceptSslCerts: true
|
||||
}
|
||||
},
|
||||
|
||||
firefox: {
|
||||
desiredCapabilities: {
|
||||
browserName: 'firefox',
|
||||
javascriptEnabled: true,
|
||||
acceptSslCerts: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,48 +1,48 @@
|
||||
// 1. start the dev server using production config
|
||||
process.env.NODE_ENV = 'testing'
|
||||
|
||||
const webpack = require('webpack')
|
||||
const DevServer = require('webpack-dev-server')
|
||||
|
||||
const webpackConfig = require('../../build/webpack.prod.conf')
|
||||
const devConfigPromise = require('../../build/webpack.dev.conf')
|
||||
|
||||
let server
|
||||
|
||||
devConfigPromise.then(devConfig => {
|
||||
const devServerOptions = devConfig.devServer
|
||||
const compiler = webpack(webpackConfig)
|
||||
server = new DevServer(compiler, devServerOptions)
|
||||
const port = devServerOptions.port
|
||||
const host = devServerOptions.host
|
||||
return server.listen(port, host)
|
||||
})
|
||||
.then(() => {
|
||||
// 2. run the nightwatch test suite against it
|
||||
// to run in additional browsers:
|
||||
// 1. add an entry in test/e2e/nightwatch.conf.js under "test_settings"
|
||||
// 2. add it to the --env flag below
|
||||
// or override the environment flag, for example: `npm run e2e -- --env chrome,firefox`
|
||||
// For more information on Nightwatch's config file, see
|
||||
// http://nightwatchjs.org/guide#settings-file
|
||||
let opts = process.argv.slice(2)
|
||||
if (opts.indexOf('--config') === -1) {
|
||||
opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js'])
|
||||
}
|
||||
if (opts.indexOf('--env') === -1) {
|
||||
opts = opts.concat(['--env', 'chrome'])
|
||||
}
|
||||
|
||||
const spawn = require('cross-spawn')
|
||||
const runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' })
|
||||
|
||||
runner.on('exit', function (code) {
|
||||
server.close()
|
||||
process.exit(code)
|
||||
})
|
||||
|
||||
runner.on('error', function (err) {
|
||||
server.close()
|
||||
throw err
|
||||
})
|
||||
})
|
||||
// 1. start the dev server using production config
|
||||
process.env.NODE_ENV = 'testing'
|
||||
|
||||
const webpack = require('webpack')
|
||||
const DevServer = require('webpack-dev-server')
|
||||
|
||||
const webpackConfig = require('../../build/webpack.prod.conf')
|
||||
const devConfigPromise = require('../../build/webpack.dev.conf')
|
||||
|
||||
let server
|
||||
|
||||
devConfigPromise.then(devConfig => {
|
||||
const devServerOptions = devConfig.devServer
|
||||
const compiler = webpack(webpackConfig)
|
||||
server = new DevServer(compiler, devServerOptions)
|
||||
const port = devServerOptions.port
|
||||
const host = devServerOptions.host
|
||||
return server.listen(port, host)
|
||||
})
|
||||
.then(() => {
|
||||
// 2. run the nightwatch test suite against it
|
||||
// to run in additional browsers:
|
||||
// 1. add an entry in test/e2e/nightwatch.conf.js under "test_settings"
|
||||
// 2. add it to the --env flag below
|
||||
// or override the environment flag, for example: `npm run e2e -- --env chrome,firefox`
|
||||
// For more information on Nightwatch's config file, see
|
||||
// http://nightwatchjs.org/guide#settings-file
|
||||
let opts = process.argv.slice(2)
|
||||
if (opts.indexOf('--config') === -1) {
|
||||
opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js'])
|
||||
}
|
||||
if (opts.indexOf('--env') === -1) {
|
||||
opts = opts.concat(['--env', 'chrome'])
|
||||
}
|
||||
|
||||
const spawn = require('cross-spawn')
|
||||
const runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' })
|
||||
|
||||
runner.on('exit', function (code) {
|
||||
server.close()
|
||||
process.exit(code)
|
||||
})
|
||||
|
||||
runner.on('error', function (err) {
|
||||
server.close()
|
||||
throw err
|
||||
})
|
||||
})
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"env": {
|
||||
"jest": true
|
||||
},
|
||||
"globals": {
|
||||
}
|
||||
}
|
||||
{
|
||||
"env": {
|
||||
"jest": true
|
||||
},
|
||||
"globals": {
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,30 +1,30 @@
|
||||
const path = require('path')
|
||||
|
||||
module.exports = {
|
||||
rootDir: path.resolve(__dirname, '../../'),
|
||||
moduleFileExtensions: [
|
||||
'js',
|
||||
'json',
|
||||
'vue'
|
||||
],
|
||||
moduleNameMapper: {
|
||||
'^@/(.*)$': '<rootDir>/src/$1'
|
||||
},
|
||||
transform: {
|
||||
'^.+\\.js$': '<rootDir>/node_modules/babel-jest',
|
||||
'.*\\.(vue)$': '<rootDir>/node_modules/vue-jest'
|
||||
},
|
||||
testPathIgnorePatterns: [
|
||||
'<rootDir>/test/e2e'
|
||||
],
|
||||
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
|
||||
setupFiles: ['<rootDir>/test/unit/setup'],
|
||||
mapCoverage: true,
|
||||
coverageDirectory: '<rootDir>/test/unit/coverage',
|
||||
collectCoverageFrom: [
|
||||
'src/**/*.{js,vue}',
|
||||
'!src/main.js',
|
||||
'!src/router/index.js',
|
||||
'!**/node_modules/**'
|
||||
]
|
||||
}
|
||||
const path = require('path')
|
||||
|
||||
module.exports = {
|
||||
rootDir: path.resolve(__dirname, '../../'),
|
||||
moduleFileExtensions: [
|
||||
'js',
|
||||
'json',
|
||||
'vue'
|
||||
],
|
||||
moduleNameMapper: {
|
||||
'^@/(.*)$': '<rootDir>/src/$1'
|
||||
},
|
||||
transform: {
|
||||
'^.+\\.js$': '<rootDir>/node_modules/babel-jest',
|
||||
'.*\\.(vue)$': '<rootDir>/node_modules/vue-jest'
|
||||
},
|
||||
testPathIgnorePatterns: [
|
||||
'<rootDir>/test/e2e'
|
||||
],
|
||||
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
|
||||
setupFiles: ['<rootDir>/test/unit/setup'],
|
||||
mapCoverage: true,
|
||||
coverageDirectory: '<rootDir>/test/unit/coverage',
|
||||
collectCoverageFrom: [
|
||||
'src/**/*.{js,vue}',
|
||||
'!src/main.js',
|
||||
'!src/router/index.js',
|
||||
'!**/node_modules/**'
|
||||
]
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
import Vue from 'vue'
|
||||
|
||||
Vue.config.productionTip = false
|
||||
import Vue from 'vue'
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
@ -1,13 +1,11 @@
|
||||
import Vue from "vue";
|
||||
import HelloWorld from "@/components/HelloWorld";
|
||||
import Vue from 'vue'
|
||||
import HelloWorld from '@/components/HelloWorld'
|
||||
|
||||
describe("HelloWorld.vue", () => {
|
||||
|
||||
it("should render correct contents", () => {
|
||||
const Constructor = Vue.extend(HelloWorld);
|
||||
const vm = new Constructor().$mount();
|
||||
expect(vm.$el.querySelector(".hello h1").textContent).toEqual(
|
||||
"Welcome to Your Vue.js App"
|
||||
);
|
||||
});
|
||||
});
|
||||
describe('HelloWorld.vue', () => {
|
||||
it('should render correct contents', () => {
|
||||
const Constructor = Vue.extend(HelloWorld)
|
||||
const vm = new Constructor().$mount()
|
||||
expect(vm.$el.querySelector('.hello h1').textContent)
|
||||
.toEqual('Welcome to Your Vue.js App')
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue