登录方式更改
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>
|
<template>
|
||||||
<el-dialog :close-on-click-modal="false" v-dialogDrag rechargeTypeId="form" :title="title" :visible.sync="dialogFormVisible" :before-close="handleClose">
|
<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 :model="form" inline :rules="rules" ref="form" label-width="120px">
|
||||||
<el-form-item label="手机号码:" prop="mobilePhone">
|
<el-form-item label="手机号码:" prop="mobilePhone">
|
||||||
<div class="form-width-ms">
|
<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-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-button size="mini" slot="append" icon="el-icon-search" @click="openMember()"></el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="会员名称:" prop="memberName">
|
<el-form-item label="会员名称:" prop="memberName">
|
||||||
<div class="form-width-ms">
|
<div class="form-width-ms">
|
||||||
{{form.memberName}}
|
{{form.memberName}}
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<br>
|
<br>
|
||||||
<el-form-item label="帐户编码:" prop="outRechargeTypeNum">
|
<el-form-item label="帐户编码:" prop="outRechargeTypeNum">
|
||||||
<div class="form-width-ms">
|
<div class="form-width-ms">
|
||||||
<span v-if="form.outRechargeTypeNum" class="text-cyan" @click="openRec(0)">{{form.outRechargeTypeNum}}</span>
|
<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>
|
<el-button v-else type="text" :disabled="!form.memberName" @click="openRec(0)">选择充值帐户</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="充值编码:" prop="inRechargeTypeNum">
|
<el-form-item label="充值编码:" prop="inRechargeTypeNum">
|
||||||
<div class="form-width-ms">
|
<div class="form-width-ms">
|
||||||
<span v-if="form.inRechargeTypeNum" class="text-cyan" @click="openRec(1)">{{form.inRechargeTypeNum}}</span>
|
<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>
|
<el-button v-else type="text" :disabled="!form.outRechargeTypeNum" @click="openRec(1)">选择充值类别</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<br>
|
<br>
|
||||||
<el-form-item label="帐户名称:" prop="outRechargeTypeName">
|
<el-form-item label="帐户名称:" prop="outRechargeTypeName">
|
||||||
<div class="form-width-ms">
|
<div class="form-width-ms">
|
||||||
{{form.outRechargeTypeName}}
|
{{form.outRechargeTypeName}}
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="充值名称:" prop="inRechargeTypeName">
|
<el-form-item label="充值名称:" prop="inRechargeTypeName">
|
||||||
<div class="form-width-ms">
|
<div class="form-width-ms">
|
||||||
{{form.inRechargeTypeName}}
|
{{form.inRechargeTypeName}}
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<br>
|
<br>
|
||||||
<el-form-item label="可用金额:" prop="cardConsumeMoney">
|
<el-form-item label="可用金额:" prop="cardConsumeMoney">
|
||||||
<div class="form-width-ms">
|
<div class="form-width-ms">
|
||||||
{{form.cardConsumeMoney}}
|
{{form.cardConsumeMoney}}
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="转入金额:" prop="inMoney">
|
<el-form-item label="转入金额:" prop="inMoney">
|
||||||
<div class="form-width-ms">
|
<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>
|
<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>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<br>
|
<br>
|
||||||
<el-form-item label="可用赠送:" prop="giftConsumeMoney">
|
<el-form-item label="可用赠送:" prop="giftConsumeMoney">
|
||||||
<div class="form-width-ms">
|
<div class="form-width-ms">
|
||||||
{{form.giftConsumeMoney}}
|
{{form.giftConsumeMoney}}
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="转入赠送:" prop="inGiftMoney">
|
<el-form-item label="转入赠送:" prop="inGiftMoney">
|
||||||
<div class="form-width-ms">
|
<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>
|
<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>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div class="text-center margin-left-lg padding-left">
|
<div class="text-center margin-left-lg padding-left">
|
||||||
<staffsles ref="staffsles" @staffslesData="staffslesData"></staffsles>
|
<staffsles ref="staffsles" @staffslesData="staffslesData"></staffsles>
|
||||||
</div>
|
</div>
|
||||||
<member ref="member" @memberData="memberData"></member>
|
<member ref="member" @memberData="memberData"></member>
|
||||||
<rec ref="rec" @recTypeData="recData"></rec>
|
<rec ref="rec" @recTypeData="recData"></rec>
|
||||||
<rectype ref="rectype" @recTypeData="rectypeData"></rectype>
|
<rectype ref="rectype" @recTypeData="rectypeData"></rectype>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button size="mini" type="primary" plain @click="handleClose">取 消</el-button>
|
<el-button size="mini" type="primary" plain @click="handleClose">取 消</el-button>
|
||||||
<el-button size="mini" type="primary" @click="confirm">确 定</el-button>
|
<el-button size="mini" type="primary" @click="confirm">确 定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import rec from "@/components/recharge/index";
|
import rec from "@/components/recharge/index";
|
||||||
import rectype from "@/components/recharge/type/index";
|
import rectype from "@/components/recharge/type/index";
|
||||||
import staffsles from "@/components/staffList/staff/index";
|
import staffsles from "@/components/staffList/staff/index";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
addRechargeCardTransition,
|
addRechargeCardTransition,
|
||||||
updateRechargeCardTransition,
|
updateRechargeCardTransition,
|
||||||
} from "@/api/eashier.js";
|
} from "@/api/eashier.js";
|
||||||
import { partten } from "../../../../../partten/index.js";
|
import { partten } from "../../../../../partten/index.js";
|
||||||
import { storeMemberOne } from "@/api/eashier.js";
|
import { storeMemberOne } from "@/api/eashier.js";
|
||||||
import member from "@/components/member/index";
|
import member from "@/components/member/index";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
member,
|
member,
|
||||||
rec,
|
rec,
|
||||||
rectype,
|
rectype,
|
||||||
staffsles,
|
staffsles,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
rules: {
|
rules: {
|
||||||
rechargeTypeNum: {
|
rechargeTypeNum: {
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入充值类别编码",
|
message: "请输入充值类别编码",
|
||||||
trigger: ["blur", "change"],
|
trigger: ["blur", "change"],
|
||||||
},
|
},
|
||||||
rechargeMoney: {
|
rechargeMoney: {
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入赠送金额",
|
message: "请输入赠送金额",
|
||||||
trigger: ["blur", "change"],
|
trigger: ["blur", "change"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
staffList: [{ ratio: 100 }],
|
staffList: [{ ratio: 100 }],
|
||||||
form: {
|
form: {
|
||||||
type: 0,
|
type: 0,
|
||||||
},
|
},
|
||||||
rowForm: {},
|
rowForm: {},
|
||||||
listLoading: false, //list加载提示开启动画
|
listLoading: false, //list加载提示开启动画
|
||||||
elementLoadingText: "加载中...", //list加载提示文字
|
elementLoadingText: "加载中...", //list加载提示文字
|
||||||
title: "", //弹窗标题
|
title: "", //弹窗标题
|
||||||
dialogFormVisible: false, //弹窗开关
|
dialogFormVisible: false, //弹窗开关
|
||||||
editIndex: -1,
|
editIndex: -1,
|
||||||
memberNumber: 0,
|
memberNumber: 0,
|
||||||
memberForm: {}, //会员对象
|
memberForm: {}, //会员对象
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//关闭弹窗前的回调方法
|
//关闭弹窗前的回调方法
|
||||||
handleClose() {
|
handleClose() {
|
||||||
this.form = Object.assign({});
|
this.form = Object.assign({});
|
||||||
this.staffList = [{ ratio: 100 }];
|
this.staffList = [{ ratio: 100 }];
|
||||||
this.$refs.form.clearValidate();
|
this.$refs.form.clearValidate();
|
||||||
this.dialogFormVisible = false;
|
this.dialogFormVisible = false;
|
||||||
},
|
},
|
||||||
endPrice() {
|
endPrice() {
|
||||||
if (this.form.type == 0) {
|
if (this.form.type == 0) {
|
||||||
if (this.form.inMoney > this.form.cardConsumeMoney) {
|
if (this.form.inMoney > this.form.cardConsumeMoney) {
|
||||||
this.$alert("转出金额不能高于" + this.form.cardConsumeMoney, "提示", {
|
this.$alert("转出金额不能高于" + this.form.cardConsumeMoney, "提示", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
confirmButtonClass: "confirmbtnFalses",
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
center: true,
|
center: true,
|
||||||
callback: (action) => {},
|
callback: (action) => {},
|
||||||
});
|
});
|
||||||
this.form.inMoney = this.form.cardConsumeMoney;
|
this.form.inMoney = this.form.cardConsumeMoney;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
endGiftPrice() {
|
endGiftPrice() {
|
||||||
if (this.form.type == 0) {
|
if (this.form.type == 0) {
|
||||||
if (this.form.inGiftMoney > this.form.giftConsumeMoney) {
|
if (this.form.inGiftMoney > this.form.giftConsumeMoney) {
|
||||||
this.$alert(
|
this.$alert(
|
||||||
"转入赠送金额不能高于" + this.form.giftConsumeMoney,
|
"转入赠送金额不能高于" + this.form.giftConsumeMoney,
|
||||||
"提示",
|
"提示",
|
||||||
{
|
{
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
confirmButtonClass: "confirmbtnFalses",
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
center: true,
|
center: true,
|
||||||
callback: (action) => {},
|
callback: (action) => {},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
this.form.inGiftMoney = this.form.giftConsumeMoney;
|
this.form.inGiftMoney = this.form.giftConsumeMoney;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
endNumber() {
|
endNumber() {
|
||||||
if (this.form.type == 0) {
|
if (this.form.type == 0) {
|
||||||
if (this.form.courseRestCount > this.form.topNumber) {
|
if (this.form.courseRestCount > this.form.topNumber) {
|
||||||
this.$alert("转出次数不能高于" + this.form.topNumber, "提示", {
|
this.$alert("转出次数不能高于" + this.form.topNumber, "提示", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
confirmButtonClass: "confirmbtnFalses",
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
center: true,
|
center: true,
|
||||||
callback: (action) => {},
|
callback: (action) => {},
|
||||||
});
|
});
|
||||||
this.form.courseRestCount = this.form.topNumber;
|
this.form.courseRestCount = this.form.topNumber;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//打开选择会员弹窗
|
//打开选择会员弹窗
|
||||||
openMember() {
|
openMember() {
|
||||||
this.$refs.member.show();
|
this.$refs.member.show();
|
||||||
},
|
},
|
||||||
//选中会员返回方法
|
//选中会员返回方法
|
||||||
memberData(v) {
|
memberData(v) {
|
||||||
this.form.mobilePhone = v.mobilePhone;
|
this.form.mobilePhone = v.mobilePhone;
|
||||||
this.query();
|
this.query();
|
||||||
},
|
},
|
||||||
//查询方法
|
//查询方法
|
||||||
query() {
|
query() {
|
||||||
var number = partten.phoneNum;
|
var number = partten.phoneNum;
|
||||||
var form = { ...this.form };
|
var form = { ...this.form };
|
||||||
if (!number.test(this.form.mobilePhone)) {
|
if (!number.test(this.form.mobilePhone)) {
|
||||||
this.$message.info({
|
this.$message.info({
|
||||||
message: "请输入正确的手机号码 ! ",
|
message: "请输入正确的手机号码 ! ",
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
storeMemberOne({
|
storeMemberOne({
|
||||||
mobilePhone: this.form.mobilePhone,
|
mobilePhone: this.form.mobilePhone,
|
||||||
storeId: sessionStorage.getItem("parentId"),
|
storeId: sessionStorage.getItem("parentId"),
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.code == "000000") {
|
if (res.code == "000000") {
|
||||||
form.memberId = res.data.id;
|
form.memberId = res.data.id;
|
||||||
form.memberNum = res.data.memberNum;
|
form.memberNum = res.data.memberNum;
|
||||||
form.memberName = res.data.memberName;
|
form.memberName = res.data.memberName;
|
||||||
form.mobilePhone = res.data.mobilePhone;
|
form.mobilePhone = res.data.mobilePhone;
|
||||||
res.data.memberId = res.data.id;
|
res.data.memberId = res.data.id;
|
||||||
this.memberForm = res.data;
|
this.memberForm = res.data;
|
||||||
this.form = JSON.parse(JSON.stringify(form));
|
this.form = JSON.parse(JSON.stringify(form));
|
||||||
} else {
|
} else {
|
||||||
this.$alert(res.message, "提示", {
|
this.$alert(res.message, "提示", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
confirmButtonClass: "confirmbtnFalses",
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
center: true,
|
center: true,
|
||||||
callback: (action) => {},
|
callback: (action) => {},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
openRec(number) {
|
openRec(number) {
|
||||||
if (number == 0) {
|
if (number == 0) {
|
||||||
this.$refs.rec.show(this.memberForm);
|
this.$refs.rec.show(this.memberForm);
|
||||||
} else {
|
} else {
|
||||||
this.$refs.rectype.show(this.form.outType);
|
console.log(this.form.outType);
|
||||||
}
|
this.$refs.rectype.show(this.form.outType);
|
||||||
},
|
}
|
||||||
endEdit(row, index) {
|
},
|
||||||
this.editIndex = -1;
|
endEdit(row, index) {
|
||||||
},
|
this.editIndex = -1;
|
||||||
//选中会员充值卡包返回方法
|
},
|
||||||
recData(v) {
|
//选中会员充值卡包返回方法
|
||||||
let form = { ...this.form };
|
recData(v) {
|
||||||
form.outRechargeTypeNum = v.rechargeTypeNum;
|
let form = { ...this.form };
|
||||||
form.outRechargeTypeName = v.rechargeTypeName;
|
form.outRechargeTypeNum = v.rechargeTypeNum;
|
||||||
form.outRechargeTypeId = v.rechargeTypeId;
|
form.outRechargeTypeName = v.rechargeTypeName;
|
||||||
form.outAccountId = v.id;
|
form.outRechargeTypeId = v.rechargeTypeId;
|
||||||
form.outType = v.type;
|
form.outAccountId = v.id;
|
||||||
form.cardConsumeMoney = v.cardConsumeMoney;
|
form.outType = v.type;
|
||||||
form.giftConsumeMoney = v.giftConsumeMoney ? v.giftConsumeMoney : 0;
|
form.cardConsumeMoney = v.cardConsumeMoney;
|
||||||
this.form = JSON.parse(JSON.stringify(form));
|
form.giftConsumeMoney = v.giftConsumeMoney ? v.giftConsumeMoney : 0;
|
||||||
},
|
this.form = JSON.parse(JSON.stringify(form));
|
||||||
rectypeData(v) {
|
},
|
||||||
let form = { ...this.form };
|
rectypeData(v) {
|
||||||
form.inRechargeTypeNum = v.rechargeTypeNum;
|
let form = { ...this.form };
|
||||||
form.inRechargeTypeName = v.rechargeTypeName;
|
form.inRechargeTypeNum = v.rechargeTypeNum;
|
||||||
form.inRechargeTypeId = v.id;
|
form.inRechargeTypeName = v.rechargeTypeName;
|
||||||
form.inType = v.type;
|
form.inRechargeTypeId = v.id;
|
||||||
form.inMoney = form.cardConsumeMoney;
|
form.inType = v.type;
|
||||||
form.inGiftMoney = form.giftConsumeMoney;
|
form.inMoney = form.cardConsumeMoney;
|
||||||
this.form = JSON.parse(JSON.stringify(form));
|
form.inGiftMoney = form.giftConsumeMoney;
|
||||||
},
|
this.form = JSON.parse(JSON.stringify(form));
|
||||||
//组件传值
|
},
|
||||||
show(form, type) {
|
//组件传值
|
||||||
this.staffList = [{ ratio: 100 }];
|
show(form, type) {
|
||||||
this.form = Object.assign({});
|
this.staffList = [{ ratio: 100 }];
|
||||||
if (form == "添加") {
|
this.form = Object.assign({});
|
||||||
this.title = form;
|
if (form == "添加") {
|
||||||
} else {
|
this.title = form;
|
||||||
this.title = "修改";
|
} else {
|
||||||
this.form = { ...form };
|
this.title = "修改";
|
||||||
this.staffList = form.staffLists;
|
this.form = { ...form };
|
||||||
}
|
this.staffList = form.staffLists;
|
||||||
console.log(this.staffList);
|
}
|
||||||
|
console.log(this.staffList);
|
||||||
this.dialogFormVisible = true;
|
|
||||||
this.toStaff();
|
this.dialogFormVisible = true;
|
||||||
},
|
this.toStaff();
|
||||||
toStaff() {
|
},
|
||||||
this.staffList.forEach((item) => {
|
toStaff() {
|
||||||
if (item.id) {
|
this.staffList.forEach((item) => {
|
||||||
item.staffNames = item.brandNumber + "--" + item.staffName;
|
if (item.id) {
|
||||||
} else {
|
item.staffNames = item.brandNumber + "--" + item.staffName;
|
||||||
item.staffNames = "";
|
} else {
|
||||||
}
|
item.staffNames = "";
|
||||||
});
|
}
|
||||||
setTimeout(() => {
|
});
|
||||||
this.$refs.staffsles.show(this.staffList);
|
setTimeout(() => {
|
||||||
}, 500);
|
this.$refs.staffsles.show(this.staffList);
|
||||||
},
|
}, 500);
|
||||||
//员工占比返回方法
|
},
|
||||||
staffslesData(v) {
|
//员工占比返回方法
|
||||||
this.staffList = [...v];
|
staffslesData(v) {
|
||||||
},
|
this.staffList = [...v];
|
||||||
//确定返回方法
|
},
|
||||||
confirm() {
|
//确定返回方法
|
||||||
if (this.title == "添加") {
|
confirm() {
|
||||||
this.form.staffLists = this.staffList;
|
if (this.title == "添加") {
|
||||||
addRechargeCardTransition(this.form)
|
this.form.staffLists = this.staffList;
|
||||||
.then((res) => {
|
addRechargeCardTransition(this.form)
|
||||||
if (res.code == "000000") {
|
.then((res) => {
|
||||||
this.$emit("editData");
|
if (res.code == "000000") {
|
||||||
this.dialogFormVisible = false;
|
this.$emit("editData");
|
||||||
this.$message.success({
|
this.dialogFormVisible = false;
|
||||||
message: "数据添加成功!",
|
this.$message.success({
|
||||||
});
|
message: "数据添加成功!",
|
||||||
} else {
|
});
|
||||||
this.$alert(res.message, "提示", {
|
} else {
|
||||||
confirmButtonText: "确定",
|
this.$alert(res.message, "提示", {
|
||||||
confirmButtonClass: "confirmbtnFalses",
|
confirmButtonText: "确定",
|
||||||
type: "warning",
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
center: true,
|
type: "warning",
|
||||||
callback: (action) => {},
|
center: true,
|
||||||
});
|
callback: (action) => {},
|
||||||
}
|
});
|
||||||
})
|
}
|
||||||
.catch((err) => {
|
})
|
||||||
//console.log(err);
|
.catch((err) => {
|
||||||
});
|
//console.log(err);
|
||||||
} else {
|
});
|
||||||
updateRechargeCardTransition(this.form).then((res) => {
|
} else {
|
||||||
if (res.code == "000000") {
|
updateRechargeCardTransition(this.form).then((res) => {
|
||||||
this.$emit("editData");
|
if (res.code == "000000") {
|
||||||
this.dialogFormVisible = false;
|
this.$emit("editData");
|
||||||
this.$message.success({
|
this.dialogFormVisible = false;
|
||||||
message: res.message,
|
this.$message.success({
|
||||||
});
|
message: res.message,
|
||||||
} else {
|
});
|
||||||
this.$alert(res.message, "提示", {
|
} else {
|
||||||
confirmButtonText: "确定",
|
this.$alert(res.message, "提示", {
|
||||||
confirmButtonClass: "confirmbtnFalses",
|
confirmButtonText: "确定",
|
||||||
type: "warning",
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
center: true,
|
type: "warning",
|
||||||
callback: (action) => {},
|
center: true,
|
||||||
});
|
callback: (action) => {},
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
};
|
},
|
||||||
</script>
|
};
|
||||||
|
</script>
|
||||||
<style>
|
|
||||||
</style>
|
<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>
|
<template>
|
||||||
<el-dialog :close-on-click-modal="false" v-dialogDrag rechargeTypeId="form" :title="title" :visible.sync="dialogFormVisible" :before-close="handleClose">
|
<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 :model="form" :rules="rules" ref="form" label-width="120px">
|
||||||
<el-form-item label="等级编码:" prop="classNum">
|
<el-form-item label="等级编码:" prop="classNum">
|
||||||
<el-input ref="classNum" class="form-width" v-model="form.classNum" autocomplete="on"></el-input>
|
<el-input ref="classNum" class="form-width" v-model="form.classNum" autocomplete="on"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="等级名称:" prop="className">
|
<el-form-item label="等级名称:" prop="className">
|
||||||
<el-input class="form-width" v-model="form.className" autocomplete="on"></el-input>
|
<el-input class="form-width" v-model="form.className" autocomplete="on"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="充值标准:" prop="rechargeStandard">
|
<el-form-item label="制度:" prop="statisticsQuarter">
|
||||||
<el-input class="form-width" type="number" placeholder="请输入充值标准" pattern="[0-9]*\" v-model="form.rechargeStandard" autocomplete="on"></el-input>
|
<el-radio-group v-model="form.statisticsQuarter">
|
||||||
</el-form-item>
|
<el-radio :label="0">月度</el-radio>
|
||||||
<el-form-item label="疗程标准:" prop="courseStandard">
|
<el-radio :label="1">半年度</el-radio>
|
||||||
<el-input class="form-width" type="number" placeholder="请输入疗程标准" pattern="[0-9]*\" v-model="form.courseStandard" autocomplete="on"></el-input>
|
<el-radio :label="2">一年度</el-radio>
|
||||||
</el-form-item>
|
</el-radio-group>
|
||||||
<el-form-item label="收银标准:" prop="cashDecimal">
|
</el-form-item>
|
||||||
<el-input class="form-width" type="number" placeholder="请输入收银标准" pattern="[0-9]*\" v-model="form.cashDecimal" autocomplete="on"></el-input>
|
<el-form-item label="等级编号:" prop="classRow">
|
||||||
</el-form-item>
|
<el-input class="form-width" type="number" placeholder="请输入等级编号" pattern="[0-9]*\" v-model="form.classRow" autocomplete="on"></el-input>
|
||||||
</el-form>
|
</el-form-item>
|
||||||
<div slot="footer" class="dialog-footer">
|
<el-form-item label="充值标准:" prop="rechargeStandard">
|
||||||
<el-button size="mini" type="primary" plain @click="handleClose">取 消</el-button>
|
<el-input class="form-width" type="number" placeholder="请输入充值标准" pattern="[0-9]*\" v-model="form.rechargeStandard" autocomplete="on"></el-input>
|
||||||
<el-button size="mini" type="primary" @click="confirm">确 定</el-button>
|
</el-form-item>
|
||||||
</div>
|
<el-form-item label="疗程标准:" prop="courseStandard">
|
||||||
</el-dialog>
|
<el-input class="form-width" type="number" placeholder="请输入疗程标准" pattern="[0-9]*\" v-model="form.courseStandard" autocomplete="on"></el-input>
|
||||||
</template>
|
</el-form-item>
|
||||||
<script>
|
<el-form-item label="收银标准:" prop="cashDecimal">
|
||||||
import { addMemberClass, editMemberClass } from "@/api/storeManage.js";
|
<el-input class="form-width" type="number" placeholder="请输入收银标准" pattern="[0-9]*\" v-model="form.cashDecimal" autocomplete="on"></el-input>
|
||||||
export default {
|
</el-form-item>
|
||||||
data() {
|
</el-form>
|
||||||
return {
|
<div slot="footer" class="dialog-footer">
|
||||||
rules: {
|
<el-button size="mini" type="primary" plain @click="handleClose">取 消</el-button>
|
||||||
classNum: {
|
<el-button size="mini" type="primary" @click="confirm">确 定</el-button>
|
||||||
required: true,
|
</div>
|
||||||
message: "请输入等级编码",
|
</el-dialog>
|
||||||
trigger: ["blur", "change"],
|
</template>
|
||||||
},
|
<script>
|
||||||
className: {
|
import { addMemberClass, editMemberClass } from "@/api/storeManage.js";
|
||||||
required: true,
|
export default {
|
||||||
message: "请输入等级名称",
|
data() {
|
||||||
trigger: ["blur", "change"],
|
return {
|
||||||
},
|
rules: {
|
||||||
statisticsQuarter: {
|
classNum: {
|
||||||
required: true,
|
required: true,
|
||||||
message: "请选择等级制度",
|
message: "请输入等级编码",
|
||||||
trigger: ["blur", "change"],
|
trigger: ["blur", "change"],
|
||||||
},
|
},
|
||||||
|
className: {
|
||||||
rechargeStandard: {
|
required: true,
|
||||||
required: true,
|
message: "请输入等级名称",
|
||||||
message: "请输入充值标准",
|
trigger: ["blur", "change"],
|
||||||
trigger: ["blur", "change"],
|
},
|
||||||
},
|
statisticsQuarter: {
|
||||||
|
required: true,
|
||||||
courseStandard: {
|
message: "请选择等级制度",
|
||||||
required: true,
|
trigger: ["blur", "change"],
|
||||||
message: "请输入疗程标准",
|
},
|
||||||
trigger: ["blur", "change"],
|
|
||||||
},
|
rechargeStandard: {
|
||||||
|
required: true,
|
||||||
cashDecimal: {
|
message: "请输入充值标准",
|
||||||
required: true,
|
trigger: ["blur", "change"],
|
||||||
message: "请输入收银标准",
|
},
|
||||||
trigger: ["blur", "change"],
|
classRow: {
|
||||||
},
|
required: true,
|
||||||
},
|
message: "请输入等级编号",
|
||||||
form: {}, //主对象
|
trigger: ["blur", "change"],
|
||||||
title: "", //弹窗标题
|
},
|
||||||
dialogFormVisible: false, //弹窗开关
|
courseStandard: {
|
||||||
};
|
required: true,
|
||||||
},
|
message: "请输入疗程标准",
|
||||||
methods: {
|
trigger: ["blur", "change"],
|
||||||
//关闭弹窗前的回调方法
|
},
|
||||||
handleClose() {
|
|
||||||
this.form = {};
|
cashDecimal: {
|
||||||
this.dialogFormVisible = false;
|
required: true,
|
||||||
this.$refs.form.clearValidate();
|
message: "请输入收银标准",
|
||||||
},
|
trigger: ["blur", "change"],
|
||||||
//组件传值
|
},
|
||||||
show(text, form) {
|
},
|
||||||
this.title = text;
|
form: {}, //主对象
|
||||||
this.form = {};
|
title: "", //弹窗标题
|
||||||
if (text == "修改") {
|
dialogFormVisible: false, //弹窗开关
|
||||||
this.form = { ...form };
|
};
|
||||||
}
|
},
|
||||||
setTimeout(() => {
|
methods: {
|
||||||
this.$refs.classNum.focus();
|
//关闭弹窗前的回调方法
|
||||||
this.$refs.classNum.select();
|
handleClose() {
|
||||||
}, 300);
|
this.form = {};
|
||||||
this.dialogFormVisible = true;
|
this.dialogFormVisible = false;
|
||||||
},
|
this.$refs.form.clearValidate();
|
||||||
//确定返回方法
|
},
|
||||||
confirm() {
|
//组件传值
|
||||||
if (this.title == "添加") {
|
show(text, form) {
|
||||||
addMemberClass(this.form)
|
this.title = text;
|
||||||
.then((res) => {
|
this.form = {};
|
||||||
if (res.code == "000000") {
|
if (text == "修改") {
|
||||||
this.$emit("editData");
|
this.form = { ...form };
|
||||||
this.dialogFormVisible = false;
|
}
|
||||||
this.$message.success({
|
setTimeout(() => {
|
||||||
message: "数据添加成功!",
|
this.$refs.classNum.focus();
|
||||||
});
|
this.$refs.classNum.select();
|
||||||
} else {
|
}, 300);
|
||||||
this.$alert(res.message, "提示", {
|
this.dialogFormVisible = true;
|
||||||
confirmButtonText: "确定",
|
},
|
||||||
confirmButtonClass: "confirmbtnFalses",
|
//确定返回方法
|
||||||
type: "warning",
|
confirm() {
|
||||||
center: true,
|
if (this.title == "添加") {
|
||||||
callback: (action) => {},
|
addMemberClass(this.form)
|
||||||
});
|
.then((res) => {
|
||||||
}
|
if (res.code == "000000") {
|
||||||
})
|
this.$emit("editData");
|
||||||
.catch((err) => {
|
this.dialogFormVisible = false;
|
||||||
//console.log(err);
|
this.$message.success({
|
||||||
});
|
message: "数据添加成功!",
|
||||||
} else {
|
});
|
||||||
editMemberClass(this.form).then((res) => {
|
} else {
|
||||||
if (res.code == "000000") {
|
this.$alert(res.message, "提示", {
|
||||||
this.$emit("editData");
|
confirmButtonText: "确定",
|
||||||
this.dialogFormVisible = false;
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
this.$message.success({
|
type: "warning",
|
||||||
message: res.message,
|
center: true,
|
||||||
});
|
callback: (action) => {},
|
||||||
} else {
|
});
|
||||||
this.$alert(res.message, "提示", {
|
}
|
||||||
confirmButtonText: "确定",
|
})
|
||||||
confirmButtonClass: "confirmbtnFalses",
|
.catch((err) => {
|
||||||
type: "warning",
|
//console.log(err);
|
||||||
center: true,
|
});
|
||||||
callback: (action) => {},
|
} else {
|
||||||
});
|
editMemberClass(this.form).then((res) => {
|
||||||
}
|
if (res.code == "000000") {
|
||||||
});
|
this.$emit("editData");
|
||||||
}
|
this.dialogFormVisible = false;
|
||||||
},
|
this.$message.success({
|
||||||
},
|
message: res.message,
|
||||||
};
|
});
|
||||||
</script>
|
} else {
|
||||||
|
this.$alert(res.message, "提示", {
|
||||||
<style>
|
confirmButtonText: "确定",
|
||||||
</style>
|
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.
|
// A custom Nightwatch assertion.
|
||||||
// The assertion name is the filename.
|
// The assertion name is the filename.
|
||||||
// Example usage:
|
// Example usage:
|
||||||
//
|
//
|
||||||
// browser.assert.elementCount(selector, count)
|
// browser.assert.elementCount(selector, count)
|
||||||
//
|
//
|
||||||
// For more information on custom assertions see:
|
// For more information on custom assertions see:
|
||||||
// http://nightwatchjs.org/guide#writing-custom-assertions
|
// http://nightwatchjs.org/guide#writing-custom-assertions
|
||||||
|
|
||||||
exports.assertion = function (selector, count) {
|
exports.assertion = function (selector, count) {
|
||||||
this.message = 'Testing if element <' + selector + '> has count: ' + count
|
this.message = 'Testing if element <' + selector + '> has count: ' + count
|
||||||
this.expected = count
|
this.expected = count
|
||||||
this.pass = function (val) {
|
this.pass = function (val) {
|
||||||
return val === this.expected
|
return val === this.expected
|
||||||
}
|
}
|
||||||
this.value = function (res) {
|
this.value = function (res) {
|
||||||
return res.value
|
return res.value
|
||||||
}
|
}
|
||||||
this.command = function (cb) {
|
this.command = function (cb) {
|
||||||
var self = this
|
var self = this
|
||||||
return this.api.execute(function (selector) {
|
return this.api.execute(function (selector) {
|
||||||
return document.querySelectorAll(selector).length
|
return document.querySelectorAll(selector).length
|
||||||
}, [selector], function (res) {
|
}, [selector], function (res) {
|
||||||
cb.call(self, res)
|
cb.call(self, res)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,46 +1,46 @@
|
|||||||
require('babel-register')
|
require('babel-register')
|
||||||
var config = require('../../config')
|
var config = require('../../config')
|
||||||
|
|
||||||
// http://nightwatchjs.org/gettingstarted#settings-file
|
// http://nightwatchjs.org/gettingstarted#settings-file
|
||||||
module.exports = {
|
module.exports = {
|
||||||
src_folders: ['test/e2e/specs'],
|
src_folders: ['test/e2e/specs'],
|
||||||
output_folder: 'test/e2e/reports',
|
output_folder: 'test/e2e/reports',
|
||||||
custom_assertions_path: ['test/e2e/custom-assertions'],
|
custom_assertions_path: ['test/e2e/custom-assertions'],
|
||||||
|
|
||||||
selenium: {
|
selenium: {
|
||||||
start_process: true,
|
start_process: true,
|
||||||
server_path: require('selenium-server').path,
|
server_path: require('selenium-server').path,
|
||||||
host: '127.0.0.1',
|
host: '127.0.0.1',
|
||||||
port: 4444,
|
port: 4444,
|
||||||
cli_args: {
|
cli_args: {
|
||||||
'webdriver.chrome.driver': require('chromedriver').path
|
'webdriver.chrome.driver': require('chromedriver').path
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
test_settings: {
|
test_settings: {
|
||||||
default: {
|
default: {
|
||||||
selenium_port: 4444,
|
selenium_port: 4444,
|
||||||
selenium_host: 'localhost',
|
selenium_host: 'localhost',
|
||||||
silent: true,
|
silent: true,
|
||||||
globals: {
|
globals: {
|
||||||
devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port)
|
devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
chrome: {
|
chrome: {
|
||||||
desiredCapabilities: {
|
desiredCapabilities: {
|
||||||
browserName: 'chrome',
|
browserName: 'chrome',
|
||||||
javascriptEnabled: true,
|
javascriptEnabled: true,
|
||||||
acceptSslCerts: true
|
acceptSslCerts: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
firefox: {
|
firefox: {
|
||||||
desiredCapabilities: {
|
desiredCapabilities: {
|
||||||
browserName: 'firefox',
|
browserName: 'firefox',
|
||||||
javascriptEnabled: true,
|
javascriptEnabled: true,
|
||||||
acceptSslCerts: true
|
acceptSslCerts: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,48 +1,48 @@
|
|||||||
// 1. start the dev server using production config
|
// 1. start the dev server using production config
|
||||||
process.env.NODE_ENV = 'testing'
|
process.env.NODE_ENV = 'testing'
|
||||||
|
|
||||||
const webpack = require('webpack')
|
const webpack = require('webpack')
|
||||||
const DevServer = require('webpack-dev-server')
|
const DevServer = require('webpack-dev-server')
|
||||||
|
|
||||||
const webpackConfig = require('../../build/webpack.prod.conf')
|
const webpackConfig = require('../../build/webpack.prod.conf')
|
||||||
const devConfigPromise = require('../../build/webpack.dev.conf')
|
const devConfigPromise = require('../../build/webpack.dev.conf')
|
||||||
|
|
||||||
let server
|
let server
|
||||||
|
|
||||||
devConfigPromise.then(devConfig => {
|
devConfigPromise.then(devConfig => {
|
||||||
const devServerOptions = devConfig.devServer
|
const devServerOptions = devConfig.devServer
|
||||||
const compiler = webpack(webpackConfig)
|
const compiler = webpack(webpackConfig)
|
||||||
server = new DevServer(compiler, devServerOptions)
|
server = new DevServer(compiler, devServerOptions)
|
||||||
const port = devServerOptions.port
|
const port = devServerOptions.port
|
||||||
const host = devServerOptions.host
|
const host = devServerOptions.host
|
||||||
return server.listen(port, host)
|
return server.listen(port, host)
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
// 2. run the nightwatch test suite against it
|
// 2. run the nightwatch test suite against it
|
||||||
// to run in additional browsers:
|
// to run in additional browsers:
|
||||||
// 1. add an entry in test/e2e/nightwatch.conf.js under "test_settings"
|
// 1. add an entry in test/e2e/nightwatch.conf.js under "test_settings"
|
||||||
// 2. add it to the --env flag below
|
// 2. add it to the --env flag below
|
||||||
// or override the environment flag, for example: `npm run e2e -- --env chrome,firefox`
|
// or override the environment flag, for example: `npm run e2e -- --env chrome,firefox`
|
||||||
// For more information on Nightwatch's config file, see
|
// For more information on Nightwatch's config file, see
|
||||||
// http://nightwatchjs.org/guide#settings-file
|
// http://nightwatchjs.org/guide#settings-file
|
||||||
let opts = process.argv.slice(2)
|
let opts = process.argv.slice(2)
|
||||||
if (opts.indexOf('--config') === -1) {
|
if (opts.indexOf('--config') === -1) {
|
||||||
opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js'])
|
opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js'])
|
||||||
}
|
}
|
||||||
if (opts.indexOf('--env') === -1) {
|
if (opts.indexOf('--env') === -1) {
|
||||||
opts = opts.concat(['--env', 'chrome'])
|
opts = opts.concat(['--env', 'chrome'])
|
||||||
}
|
}
|
||||||
|
|
||||||
const spawn = require('cross-spawn')
|
const spawn = require('cross-spawn')
|
||||||
const runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' })
|
const runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' })
|
||||||
|
|
||||||
runner.on('exit', function (code) {
|
runner.on('exit', function (code) {
|
||||||
server.close()
|
server.close()
|
||||||
process.exit(code)
|
process.exit(code)
|
||||||
})
|
})
|
||||||
|
|
||||||
runner.on('error', function (err) {
|
runner.on('error', function (err) {
|
||||||
server.close()
|
server.close()
|
||||||
throw err
|
throw err
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"env": {
|
"env": {
|
||||||
"jest": true
|
"jest": true
|
||||||
},
|
},
|
||||||
"globals": {
|
"globals": {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,30 +1,30 @@
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
rootDir: path.resolve(__dirname, '../../'),
|
rootDir: path.resolve(__dirname, '../../'),
|
||||||
moduleFileExtensions: [
|
moduleFileExtensions: [
|
||||||
'js',
|
'js',
|
||||||
'json',
|
'json',
|
||||||
'vue'
|
'vue'
|
||||||
],
|
],
|
||||||
moduleNameMapper: {
|
moduleNameMapper: {
|
||||||
'^@/(.*)$': '<rootDir>/src/$1'
|
'^@/(.*)$': '<rootDir>/src/$1'
|
||||||
},
|
},
|
||||||
transform: {
|
transform: {
|
||||||
'^.+\\.js$': '<rootDir>/node_modules/babel-jest',
|
'^.+\\.js$': '<rootDir>/node_modules/babel-jest',
|
||||||
'.*\\.(vue)$': '<rootDir>/node_modules/vue-jest'
|
'.*\\.(vue)$': '<rootDir>/node_modules/vue-jest'
|
||||||
},
|
},
|
||||||
testPathIgnorePatterns: [
|
testPathIgnorePatterns: [
|
||||||
'<rootDir>/test/e2e'
|
'<rootDir>/test/e2e'
|
||||||
],
|
],
|
||||||
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
|
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
|
||||||
setupFiles: ['<rootDir>/test/unit/setup'],
|
setupFiles: ['<rootDir>/test/unit/setup'],
|
||||||
mapCoverage: true,
|
mapCoverage: true,
|
||||||
coverageDirectory: '<rootDir>/test/unit/coverage',
|
coverageDirectory: '<rootDir>/test/unit/coverage',
|
||||||
collectCoverageFrom: [
|
collectCoverageFrom: [
|
||||||
'src/**/*.{js,vue}',
|
'src/**/*.{js,vue}',
|
||||||
'!src/main.js',
|
'!src/main.js',
|
||||||
'!src/router/index.js',
|
'!src/router/index.js',
|
||||||
'!**/node_modules/**'
|
'!**/node_modules/**'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
|
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
|
|||||||
@ -1,13 +1,11 @@
|
|||||||
import Vue from "vue";
|
import Vue from 'vue'
|
||||||
import HelloWorld from "@/components/HelloWorld";
|
import HelloWorld from '@/components/HelloWorld'
|
||||||
|
|
||||||
describe("HelloWorld.vue", () => {
|
describe('HelloWorld.vue', () => {
|
||||||
|
it('should render correct contents', () => {
|
||||||
it("should render correct contents", () => {
|
const Constructor = Vue.extend(HelloWorld)
|
||||||
const Constructor = Vue.extend(HelloWorld);
|
const vm = new Constructor().$mount()
|
||||||
const vm = new Constructor().$mount();
|
expect(vm.$el.querySelector('.hello h1').textContent)
|
||||||
expect(vm.$el.querySelector(".hello h1").textContent).toEqual(
|
.toEqual('Welcome to Your Vue.js App')
|
||||||
"Welcome to Your Vue.js App"
|
})
|
||||||
);
|
})
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|||||||
Loading…
Reference in New Issue