最近修改
parent
604eda206c
commit
97756eef9a
@ -0,0 +1,112 @@
|
||||
<template>
|
||||
<el-dialog :close-on-click-modal="false" v-dialogDrag rechargeTypeId="form" :title="title" :visible.sync="dialogFormVisible">
|
||||
<el-form :model="form" :rules="rules" ref="form" label-width="120px">
|
||||
<el-form-item label="编码:" prop="rechargeTypeNum">
|
||||
<div>
|
||||
{{form.courseProjectNum}}{{form.rechargeTypeNum}}
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="名称:" prop="rechargeTypeName">
|
||||
<div>
|
||||
{{form.courseProjectName}}{{form.rechargeTypeName}}
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="到期日期:" prop="discount">
|
||||
<el-date-picker v-model="form.endTime" type="date" value-format="yyyy-MM-dd" placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="mini" type="primary" plain @click="dialogFormVisible = false">取 消</el-button>
|
||||
<el-button size="mini" type="primary" @click="confirm">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { editCouAccount, editRecAccount } from "@/api/eashier.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
rules: {
|
||||
rechargeTypeName: {
|
||||
required: true,
|
||||
message: "请输入充值名称",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
rechargeTypeNum: {
|
||||
required: true,
|
||||
message: "请输入充值编码",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
rechargeMoney: {
|
||||
required: true,
|
||||
message: "请输入充值金额",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
},
|
||||
form: {}, //主对象
|
||||
title: "", //弹窗标题
|
||||
dialogFormVisible: false, //弹窗开关
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//组件传值
|
||||
show(form) {
|
||||
this.title = "帐户延期";
|
||||
this.form = { ...form };
|
||||
this.dialogFormVisible = true;
|
||||
},
|
||||
//确定返回方法
|
||||
confirm() {
|
||||
var form = {
|
||||
id: this.form.id,
|
||||
endTime: this.form.endTime,
|
||||
};
|
||||
if (this.form.rechargeTypeName) {
|
||||
editRecAccount(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 {
|
||||
editCouAccount(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,275 @@
|
||||
<template>
|
||||
<el-dialog :close-on-click-modal="false" v-dialogDrag rechargeTypeId="form" :title="title" :visible.sync="dialogFormVisible" width="75%">
|
||||
<div class="form-width-ms block">
|
||||
<span class="demonstration"></span>
|
||||
<el-date-picker v-model="queryForm.month" type="month" @change="getData" placeholder="选择月份">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<el-table border v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText" @row-dblclick="rowdbClick" max-height="650" :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)',color:'#eeeeee'}">
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="docTypeName" label="类别"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="orderStatu" label="状态">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.orderStatu==0?'success':scope.row.orderStatu==0?'danger':''">
|
||||
{{scope.row.orderStatu==0?'正常':scope.row.orderStatu==1?'作废':'反审核'}}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="inputBy" label="操作人"></el-table-column>
|
||||
|
||||
<el-table-column show-overflow-tooltip align="center" label="单据">
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="120" prop="docNum" label="单据号"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="115" prop="inputDate" label="时间"></el-table-column>
|
||||
<!-- <el-table-column show-overflow-tooltip align="center" min-width="160" prop="updatedTime" label="操作人"></el-table-column> -->
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="storeNum" label="门店编码"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="140" prop="storeName" label="门店名称"></el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" label="交易">
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="tradeName" label="成交金额"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="80" prop="price" label="单价">
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
{{scope.row.price?scope.row.price:'--'}}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="80" prop="tradeCount" label="数量">
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
{{scope.row.tradeCount?scope.row.tradeCount:'--'}}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="80" prop="tradeMoney" label="成交金额"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="80" prop="debtMoney" label="欠款金额"></el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" label="收入">
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="80" prop="accountInMoney" label="金额"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="80" prop="giftInMenoy" label="赠送金额"></el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" label="支出">
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="80" prop="accountSpendMoney" label="金额"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="80" prop="accountGiftSpendMoney" label="赠送金额"></el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" label="结余">
|
||||
<el-table-column show-overflow-tooltip align="center" label="剩余">
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="80" prop="accountRestMoney" label="金额"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="80" prop="accountGiftRestMoney" label="赠送金额"></el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" label="可用">
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="80" prop="accountConsumeMoney" label="金额"> </el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="80" prop="accountGiftConsumeMoney" label="赠送金额"></el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block margin-top-xs">
|
||||
<!-- 分页组件 -->
|
||||
<el-pagination align="left" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="queryForm.pageNum" :page-sizes="[10,20,30,40,50]" :page-size="queryForm.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"></el-pagination>
|
||||
</div>
|
||||
<orderdetail ref="orderdetail"></orderdetail>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button size="mini" type="primary" plain @click="dialogFormVisible = false">关闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import orderdetail from "@/components/order/detail.vue";
|
||||
import { listByMembers } from "@/api/eashier";
|
||||
export default {
|
||||
components: { orderdetail },
|
||||
data() {
|
||||
return {
|
||||
form: {}, //主对象
|
||||
title: "", //弹窗标题
|
||||
list: [], //主数组
|
||||
total: 0, //分页总条数
|
||||
listLoading: false, //list加载提示开启动画
|
||||
dialogFormVisible: false, //弹窗开关
|
||||
elementLoadingText: "加载中...", //list加载提示文字
|
||||
queryForm: {
|
||||
//查询对象
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
itemList: [
|
||||
//单据全部类型
|
||||
{
|
||||
docType: "store_room",
|
||||
docTypeName: "前台收银",
|
||||
},
|
||||
|
||||
{
|
||||
docType: "upgrade_out",
|
||||
docTypeName: "升级转出",
|
||||
},
|
||||
{
|
||||
docType: "upgrade_in",
|
||||
docTypeName: "升级充值",
|
||||
},
|
||||
{
|
||||
docType: "demotion_out",
|
||||
docTypeName: "降级转出",
|
||||
},
|
||||
{
|
||||
docType: "demotion_in",
|
||||
docTypeName: "降级充值",
|
||||
},
|
||||
{
|
||||
docType: "init",
|
||||
docTypeName: "初始化",
|
||||
},
|
||||
{
|
||||
docType: "card_recharge",
|
||||
docTypeName: "充值开卡",
|
||||
},
|
||||
|
||||
{
|
||||
docType: "recharge_roll_course",
|
||||
docTypeName: "疗程转充值卡",
|
||||
},
|
||||
{
|
||||
docType: "card_change",
|
||||
docTypeName: "加价转疗程",
|
||||
},
|
||||
{
|
||||
docType: "card_use",
|
||||
docTypeName: "疗程开卡",
|
||||
},
|
||||
{
|
||||
docType: "store_cash",
|
||||
docTypeName: "收银",
|
||||
},
|
||||
{
|
||||
docType: "card_repay",
|
||||
docTypeName: "还款",
|
||||
},
|
||||
{
|
||||
docType: "refund_recharge",
|
||||
docTypeName: "充值退款",
|
||||
},
|
||||
{
|
||||
docType: "refund_course",
|
||||
docTypeName: "疗程退款",
|
||||
},
|
||||
{
|
||||
docType: "refund_cash",
|
||||
docTypeName: "消费退款",
|
||||
},
|
||||
{
|
||||
docType: "promotion",
|
||||
docTypeName: "促销活动",
|
||||
},
|
||||
{
|
||||
docType: "promotion_card_repay",
|
||||
docTypeName: "促销还款",
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//列表数组双击方法
|
||||
rowdbClick(row) {
|
||||
this.$refs.orderdetail.show(row);
|
||||
},
|
||||
//组件传值
|
||||
show(form) {
|
||||
this.form = { ...form };
|
||||
this.title = form.rechargeTypeName;
|
||||
this.dialogFormVisible = true;
|
||||
this.getData();
|
||||
},
|
||||
//分页方法
|
||||
handleSizeChange(val) {
|
||||
this.queryForm.pageSize = val;
|
||||
this.getData();
|
||||
//console.log(val);
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.queryForm.pageNum = val;
|
||||
this.getData();
|
||||
//console.log(val);
|
||||
},
|
||||
//获取数据
|
||||
async getData() {
|
||||
if (this.queryForm.month) {
|
||||
this.queryForm.inputDate = this.formatTime(
|
||||
this.queryForm.month,
|
||||
"YYYY-MM-DD hh:mm:ss"
|
||||
);
|
||||
} else {
|
||||
this.queryForm.inputDate = this.formatTime(
|
||||
new Date(),
|
||||
"YYYY-MM-DD hh:mm:ss"
|
||||
);
|
||||
}
|
||||
this.queryForm.memberId = this.form.memberId;
|
||||
this.queryForm.memberName = this.form.memberName;
|
||||
this.queryForm.memberPhone = this.form.mobilePhone;
|
||||
this.queryForm.accountId = this.form.id;
|
||||
|
||||
listByMembers(this.queryForm).then((res) => {
|
||||
if (res.code == "000000") {
|
||||
res.pageInfo.list.forEach((item) => {
|
||||
this.itemList.forEach((items) => {
|
||||
if (item.docType == items.docType) {
|
||||
item.docTypeName = items.docTypeName;
|
||||
}
|
||||
});
|
||||
});
|
||||
res.pageInfo.list.forEach((item) => {
|
||||
if (item.type == "card_repay") {
|
||||
item.docTypeName = "还款";
|
||||
}
|
||||
if (item.type == "card_repay") {
|
||||
if (item.orderType == "course") {
|
||||
item.docTypeName = "疗程" + item.docTypeName;
|
||||
}
|
||||
if (item.orderType == "recharge") {
|
||||
item.docTypeName = "充值" + item.docTypeName;
|
||||
}
|
||||
}
|
||||
if (item.docType == "refund_cash_room") {
|
||||
if (item.accountType == "refund_cash_unaudit_room") {
|
||||
item.docTypeName = "房间退反审核";
|
||||
}
|
||||
if (item.accountType == "refund_cash_audit_room") {
|
||||
item.docTypeName = "房间消费退";
|
||||
}
|
||||
}
|
||||
if (item.docType == "recharge_Transition") {
|
||||
if (item.accountType == "recharge_Transition_out") {
|
||||
item.docTypeName = "充值卡内调转出";
|
||||
}
|
||||
if (item.accountType == "recharge_Transition_out_cancel") {
|
||||
item.docTypeName = "充值内调作废";
|
||||
}
|
||||
if (item.accountType == "recharge_Transition_in") {
|
||||
item.docTypeName = "充值卡内调转入";
|
||||
}
|
||||
if (item.accountType == "recharge_Transition_in_cancel") {
|
||||
item.docTypeName = "充值内调作废";
|
||||
}
|
||||
if (item.accountType == "recharge_Transition_out_cancel") {
|
||||
item.docTypeName = "充值转出反审核";
|
||||
}
|
||||
}
|
||||
});
|
||||
this.list = res.pageInfo.list;
|
||||
this.total = res.pageInfo.total;
|
||||
} else {
|
||||
this.$alert(res.message, "查询会员疗程", {
|
||||
confirmButtonText: "确定",
|
||||
confirmButtonClass: "confirmbtnFalses",
|
||||
type: "warning",
|
||||
center: true,
|
||||
callback: (action) => {},
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@ -0,0 +1,103 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-table border v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText" @row-dblclick="rowdbClick" max-height="650" :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)',color:'#eeeeee'}">
|
||||
<el-table-column type="index" width="40" align="center"></el-table-column>
|
||||
|
||||
<el-table-column show-overflow-tooltip align="center" label="充值类别">
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="rechargeTypeNum" label="编码"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="rechargeTypeName" label="名称"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="160" prop="cardRechargeMoney" label="金额"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="160" prop="discount" label="折扣"></el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" label="充值">
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="cardRestMoney" label="剩余"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="cardConsumeMoney" label="可用"></el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" label="赠送">
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="cardGiftMoney" label="剩余"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="giftConsumeMoney" label="可用"></el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" min-width="100" prop="endTime" sortable label="到期时间"></el-table-column>
|
||||
<el-table-column align="center" fixed="right" label="操作" width="100" v-role="50011003">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="edit(scope.row)" size="mini" type="primary">帐户延期</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<edit ref="edit" @editData="editData"></edit>
|
||||
<detail ref="detail"></detail>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { cashListalls } from "@/api/eashier.js";
|
||||
import edit from "./edit";
|
||||
import detail from "./recdetail";
|
||||
export default {
|
||||
components: { edit, detail },
|
||||
data() {
|
||||
return {
|
||||
form: {}, //主对象
|
||||
list: [], //主数组
|
||||
total: 0, //分页总条数
|
||||
listLoading: false, //list加载提示开启动画
|
||||
elementLoadingText: "加载中...", //list加载提示文字
|
||||
queryForm: {
|
||||
//查询对象
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//列表数组双击方法
|
||||
rowdbClick(row) {
|
||||
this.$refs.detail.show(row);
|
||||
},
|
||||
//组件传值
|
||||
show(form) {
|
||||
this.form = { ...form };
|
||||
this.getData();
|
||||
},
|
||||
//打开帐户延期弹窗
|
||||
edit(row) {
|
||||
this.$refs.edit.show(row);
|
||||
},
|
||||
//帐户延期返回方法
|
||||
editData() {
|
||||
this.getData();
|
||||
},
|
||||
//分页方法
|
||||
handleSizeChange(val) {
|
||||
this.queryForm.pageSize = val;
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.queryForm.pageNum = val;
|
||||
this.getData();
|
||||
//console.log(val);
|
||||
},
|
||||
//获取数据
|
||||
async getData() {
|
||||
cashListalls({
|
||||
memberId: this.form.id,
|
||||
}).then((res) => {
|
||||
if (res.code == "000000") {
|
||||
this.list = res.rows;
|
||||
} else {
|
||||
this.$alert(res.message, "查询会员卡包", {
|
||||
confirmButtonText: "确定",
|
||||
confirmButtonClass: "confirmbtnFalses",
|
||||
type: "warning",
|
||||
center: true,
|
||||
callback: (action) => {},
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@ -0,0 +1,164 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form inline :modal="form" label-width="100px">
|
||||
<el-form-item label="会员编码">
|
||||
<div class="form-width-ms">
|
||||
<el-input v-model="form.memberNum" readonly></el-input>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码:">
|
||||
<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="会员名称:">
|
||||
<div class="form-width-ms">
|
||||
<span>{{ form.memberName }} <i v-if="form.sex==1" class="el-icon-male text-blue"></i>
|
||||
<i v-else class="el-icon-female text-pink"></i></span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="月份:" v-if="activeName=='交易记录'">
|
||||
<div class="form-width-ms block">
|
||||
<span class="demonstration"></span>
|
||||
<el-date-picker v-model="form.month" type="month" @change="change" placeholder="选择月份">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-tabs disabled type="border-card" v-model="activeName" @tab-click="handleClick">
|
||||
<el-tab-pane label="充值延期" name="充值延期">
|
||||
<recs ref="recs"></recs>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<member ref="member" @memberData="memberData"></member>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { partten } from "../../../../partten/index";
|
||||
import member from "@/components/member/index";
|
||||
import recs from "./components/recs.vue";
|
||||
import { storeMemberOne } from "@/api/eashier";
|
||||
export default {
|
||||
components: {
|
||||
recs,
|
||||
member,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
month: new Date(),
|
||||
},
|
||||
activeName: "充值延期", //标签页默认标签
|
||||
};
|
||||
},
|
||||
created(){
|
||||
this.$refs.recs.show(this.form);
|
||||
this.activeName =" 充值延期";
|
||||
},
|
||||
|
||||
methods: {
|
||||
//时间改变方法
|
||||
change() {
|
||||
this.$refs.cash.show(this.form);
|
||||
},
|
||||
//标签页改变
|
||||
//切换标签页
|
||||
handleClick(tab, event) {
|
||||
if (this.form.memberName) {
|
||||
if (tab.name == "充值延期") {
|
||||
this.$refs.recs.show(this.form);
|
||||
}
|
||||
this.activeName = tab.name;
|
||||
} else {
|
||||
this.$message.error({ message: "请先选择会员!" });
|
||||
}
|
||||
},
|
||||
//打开选择会员弹窗
|
||||
openMember() {
|
||||
this.$refs.member.show(this.vip);
|
||||
},
|
||||
//选中会员返回方法
|
||||
memberData(v) {
|
||||
this.form.mobilePhone = v.mobilePhone;
|
||||
this.query();
|
||||
},
|
||||
//输入手机号是查询
|
||||
//查询方法
|
||||
query() {
|
||||
var number = partten.phoneNum;
|
||||
if (!number.test(this.form.mobilePhone)) {
|
||||
this.$message.info({
|
||||
message: "请输入正确的手机号 ! ",
|
||||
});
|
||||
} else {
|
||||
storeMemberOne({
|
||||
mobilePhone: this.form.mobilePhone,
|
||||
storeId: sessionStorage.getItem("parentId"),
|
||||
}).then((res) => {
|
||||
if (res.data != undefined && res.data.state == 0) {
|
||||
this.$message.error({
|
||||
message: "账户已锁定, 不允许使用 ! ",
|
||||
});
|
||||
this.$alert("账户已锁定, 不允许使用 !", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
confirmButtonClass: "confirmbtnFalses",
|
||||
type: "warning",
|
||||
center: true,
|
||||
callback: (action) => {},
|
||||
});
|
||||
} else {
|
||||
if (res.code == "000000" || res.code == "200004") {
|
||||
if (res.code == "000000") {
|
||||
this.form = res.data;
|
||||
if (this.activeName == "充值") {
|
||||
this.$refs.rec.show(this.form);
|
||||
}
|
||||
if (this.activeName == "疗程") {
|
||||
this.$refs.pro.show(this.form);
|
||||
}
|
||||
if (this.activeName == "交易记录") {
|
||||
this.$refs.cashAchi.show(this.form);
|
||||
}
|
||||
} else {
|
||||
if (res.code == "200004") {
|
||||
this.$confirm(res.message + ",请先注册!", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
cancelButtonClass: "cancelbtnFalses",
|
||||
confirmButtonClass: "confirmbtnFalses",
|
||||
type: "warning",
|
||||
}).then(() => {});
|
||||
} else {
|
||||
this.$alert(res.message, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
confirmButtonClass: "confirmbtnFalses",
|
||||
type: "warning",
|
||||
center: true,
|
||||
callback: (action) => {},
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$alert("查询会员信息 : " + res.message, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
confirmButtonClass: "confirmbtnFalses",
|
||||
type: "warning",
|
||||
center: true,
|
||||
callback: (action) => {},
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
||||
@ -0,0 +1,301 @@
|
||||
<template>
|
||||
<el-dialog :close-on-click-model="false" v-dialogDrag :title="staffTitle" :visible.sync="dialogVisible" width="500px"
|
||||
append-to-body :before-close="handleClose">
|
||||
<el-button size="mini" type="primary" @click="add()">添加</el-button>
|
||||
<el-button size="mini" type="primary" @click="del()">删除</el-button>
|
||||
<div class="flex">
|
||||
<el-table :data="list" max-height="600">
|
||||
<el-table-column align="center" :label="staffTitle">
|
||||
<el-table-column min-width="140" align="center" label="员工">
|
||||
<template slot-scope="scope">
|
||||
<el-select filterable default-first-option v-model="scope.row.label" placeholder="请选择"
|
||||
@click="editclick($event, scope.$index)" @change="editChange($event, scope.$index)">
|
||||
<el-option v-for="item in openList" :key="item.id" :label="item.label" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="100" align="center" label="占比">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-focus type="number" @blur="endEdit(scope.row, scope.$index)" :disabled="scope.$index == 0"
|
||||
size="samll" v-model="scope.row.ratio"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button size="mini" type="primary" plain @click="handleClose">取 消</el-button>
|
||||
<el-button size="mini" type="primary" @click="confirms()">确 定
|
||||
</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { selectList, selectListType, QuerCompetent } from "@/api/eashier.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false, //弹窗开关
|
||||
staffList: [],
|
||||
list: [], //主数组
|
||||
form: {}, //主对象
|
||||
openList: [],
|
||||
staffText: "",
|
||||
staffTexts: "",
|
||||
staffTitle: "",
|
||||
staffTitles: "",
|
||||
staffListCopy: [],
|
||||
lists: [],
|
||||
len: 0
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleClose() {
|
||||
|
||||
let forms = {
|
||||
// text: this.staffTexts,
|
||||
list: this.lists
|
||||
};
|
||||
|
||||
this.$emit("staffratioData", forms);
|
||||
this.dialogVisible = false;
|
||||
|
||||
},
|
||||
add() {
|
||||
this.list.push({ label: "", ratio: 0 });
|
||||
this.changeStaff();
|
||||
},
|
||||
endEdit(row, index) {
|
||||
console.log("🚀 ~ file: staffratio.vue ~ line 71 ~ endEdit ~ row", row)
|
||||
|
||||
if (row.ratio * 1 > 100) {
|
||||
this.$alert("输入值不能大于100", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
confirmButtonClass: "confirmbtnFalses",
|
||||
type: "warning",
|
||||
center: true,
|
||||
callback: (action) => { },
|
||||
});
|
||||
row.ratio = 0;
|
||||
} else if (row.ratio * 1 < 0) {
|
||||
this.$alert("输入值不能小于0", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
confirmButtonClass: "confirmbtnFalses",
|
||||
type: "warning",
|
||||
center: true,
|
||||
callback: (action) => { },
|
||||
});
|
||||
row.ratio = 0;
|
||||
}
|
||||
else {
|
||||
row.ratio = row.ratio * 1;
|
||||
}
|
||||
let number = 0;
|
||||
this.list.forEach((item, index) => {
|
||||
if (index != 0) {
|
||||
number += item.ratio * 1;
|
||||
}
|
||||
});
|
||||
this.list[0].ratio = 100 - number;
|
||||
if (this.list[0].ratio < 0) {
|
||||
this.$alert("第一个人员占比过低", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
confirmButtonClass: "confirmbtnFalses",
|
||||
type: "warning",
|
||||
center: true,
|
||||
callback: (action) => { },
|
||||
});
|
||||
this.list[0].ratio = this.list[0].ratio + row.ratio
|
||||
row.ratio = 0;
|
||||
|
||||
}
|
||||
this.changeStaff();
|
||||
},
|
||||
editChange(e, index) {
|
||||
let number = 0;
|
||||
let row = this.list[index];
|
||||
if (this.list.length == 1) {
|
||||
row.ratio = 100;
|
||||
} else {
|
||||
row.ratio = 0
|
||||
this.list.forEach((item, index) => {
|
||||
if (index != 0) {
|
||||
number += item.ratio * 1;
|
||||
}
|
||||
this.list[0].ratio = 100 - number;
|
||||
})
|
||||
|
||||
}
|
||||
let form = {};
|
||||
this.openList.forEach((item) => {
|
||||
if (e == item.id) {
|
||||
form = { ...item };
|
||||
}
|
||||
})
|
||||
form.ratio = row.ratio;
|
||||
this.list.splice(index, 1, form);
|
||||
|
||||
this.changeStaff();
|
||||
},
|
||||
editclick(index) {
|
||||
let row = this.list[index];
|
||||
row.ratio=0
|
||||
let number = 0;
|
||||
this.list.forEach((item, index) => {
|
||||
if (index != 0) {
|
||||
number += item.ratio * 1;
|
||||
}
|
||||
this.list[0].ratio = 100 - number;
|
||||
})
|
||||
|
||||
},
|
||||
del() {
|
||||
let index = this.list.length - 1;
|
||||
this.list[0].ratio += this.list[index].ratio;
|
||||
this.list.splice(index, 1);
|
||||
this.changeStaff();
|
||||
},
|
||||
showdetele() {
|
||||
setTimeout(() => {
|
||||
this.$nextTick(() => {
|
||||
let row = JSON.parse(localStorage.getItem('row'));
|
||||
this.lists = JSON.parse(JSON.stringify([]))
|
||||
this.lists = row;
|
||||
this.len = this.lists.length
|
||||
this.lists.forEach((item) => {
|
||||
if (item.id) {
|
||||
item.label = item.brandNumber + "-" + item.staffName;
|
||||
}
|
||||
});
|
||||
this.dialogVisible = true;
|
||||
this.getData();
|
||||
this.changeStaff();
|
||||
let number = 0;
|
||||
this.lists.forEach((item, index) => {
|
||||
if (index != 0) {
|
||||
number += item.sale_ratio * 1;
|
||||
}
|
||||
});
|
||||
if (this.lists.length > 0) {
|
||||
this.lists[0].sale_ratio = (100 - number).toFixed(2) * 1;
|
||||
}
|
||||
});
|
||||
}, 300);
|
||||
|
||||
},
|
||||
show(form) {
|
||||
setTimeout(() => {
|
||||
this.$nextTick(() => {
|
||||
this.list = JSON.parse(JSON.stringify([]));
|
||||
this.form = { ...form };
|
||||
this.list = form;
|
||||
this.list.forEach((item) => {
|
||||
if (item.id) {
|
||||
item.label = item.brandNumber + "-" + item.staffName;
|
||||
}
|
||||
});
|
||||
this.dialogVisible = true;
|
||||
this.getData();
|
||||
this.changeStaff();
|
||||
let number = 0;
|
||||
this.list.forEach((item, index) => {
|
||||
if (index != 0) {
|
||||
number += item.sale_ratio* 1;
|
||||
}
|
||||
});
|
||||
if (this.list.length > 0) {
|
||||
this.list[0].sale_ratio = (100 - number).toFixed(2) * 1;
|
||||
}
|
||||
this.list.push({ label: "", ratio: 0 });
|
||||
});
|
||||
}, 300);
|
||||
},
|
||||
changeStaff() {
|
||||
var that = this;
|
||||
let arr = [];
|
||||
// var list = that.list.concat(that.staffListCopy).filter(function (v) {
|
||||
// return (
|
||||
// that.list.indexOf(v) === -1 || that.staffListCopy.indexOf(v) === -1
|
||||
// );
|
||||
// });
|
||||
// list.forEach((item) => {
|
||||
// if (item.id) {
|
||||
// arr.push(item);
|
||||
// }
|
||||
// });
|
||||
// this.openList = arr;
|
||||
},
|
||||
//获取数据
|
||||
async getData() {
|
||||
|
||||
let form = { id: "" };
|
||||
if (this.staffName) {
|
||||
form.staffName = this.staffName;
|
||||
}
|
||||
selectList(form).then((res) => {
|
||||
if (res.code == "000000") {
|
||||
res.rows.forEach((item) => {
|
||||
item.label = item.brandNumber + "-" + item.staffName;
|
||||
item.ratio = 0;
|
||||
});
|
||||
this.openList = res.rows;
|
||||
this.staffListCopy = res.rows;
|
||||
} else {
|
||||
this.$alert(res.message, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
confirmButtonClass: "confirmbtnFalses",
|
||||
type: "warning",
|
||||
center: true,
|
||||
callback: (action) => { },
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
isRepeat(arr, key) {
|
||||
var obj = {};
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
if (obj[arr[i][key]]) {
|
||||
return false; // 存在
|
||||
} else {
|
||||
obj[arr[i][key]] = arr[i];
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
confirms() {
|
||||
let flag = this.isRepeat(this.list, "brandNumber");
|
||||
|
||||
|
||||
this.list.forEach((item,index)=>{
|
||||
if(item.staffName==""){
|
||||
this.list.splice(index,1)
|
||||
}
|
||||
})
|
||||
let form = {
|
||||
// text: this.staffText,
|
||||
list: this.list,
|
||||
};
|
||||
|
||||
if (flag) {
|
||||
this.$emit("staffratioData", form);
|
||||
|
||||
this.dialogVisible = false;
|
||||
} else {
|
||||
this.$alert("选择员工存在重复", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
confirmButtonClass: "confirmbtnFalses",
|
||||
type: "warning",
|
||||
center: true,
|
||||
callback: (action) => { },
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
Loading…
Reference in New Issue