加价转疗程,疗程转充值添加转出人员提成占比

master
Wangxubin1999 3 years ago
parent 32a4658883
commit 64d76b2f19

@ -0,0 +1,296 @@
<template>
<div style="width: 300px;overflow: hidden;" class="border-radius-10 border margin-right-xs bg-white ">
<el-table :data="staffLists" max-height="300" class="margin-xs" style="width:280px" :row-class-name="rowClassName">
<el-table-column align="left" prop="brandNumber" label="水牌号--员工名字" min-width="180">
<template slot-scope="scope">
<el-select style="width:180px" v-model="scope.row.staffNames" clearable @clear="clear(scope.$index)"
no-match-text="重新选择员工" placeholder="请选择" @change="ratioChange($event, scope.$index)" filterable
default-first-option>
<el-option v-for="(item, index) in staffList" :key="index" :label="item.brandNumber + '--' + item.staffName"
:value="item.id">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column align="center" prop="ratio" label="占比(%)" width="80">
<template slot-scope="scope">
<div class="form-input-width" v-if="editIndex != scope.$index"
@click="openStaffRatio(scope.$index, scope.row)">
{{ scope.row.ratio }}
<i class="el-icon-edit text-cyan" v-if="scope.$index != 0"></i>
</div>
<el-input v-focus class="form-input-width-xs" size="samll" type="number" v-else v-model="scope.row.ratio" @blur="endStaffRatio(scope.row, scope.$index)"></el-input>
</template>
</el-table-column>
</el-table>
<div style="width: 150px;margin:10px auto;" class="flex justify-between align-center">
<el-button size="mini" type="info" :disabled="staffLists.length == 0" @click="delsalesman"></el-button>
<el-button size="mini" type="primary" plain :disabled='isTrue'
@click="handleadd">增加
</el-button>
</div>
</div>
</template>
<script>
import { selectList } from "@/api/eashier.js";
export default {
props:{
isTrue:{
type:Boolean,
default:false
}
},
data() {
return {
staffList: [], //
staffLists: [{ ratio: 100 }], // //
editIndex: -1, //
staffListCopy: [], //
storeId: null, //id
nums:"",
};
},
methods: {
//
handleadd(){
if(this.staffLists.length>=8)return this.$message({message: '最多只能添加八条', type: 'warning'});
this.staffLists.push({ brandNumber: '', staffName: '', ratio: 0 })
},
rowClassName({ row, rowIndex }) {
row.index = rowIndex;
},
//
ratioChange(v, index) {
this.staffList.forEach((item) => {
if (item.id == v) {
item.ratio = this.staffLists[index].ratio;
item.staffNames = item.brandNumber + "--" + item.staffName;
this.staffLists.splice(index, 1, item);
}
});
this.staffLists.forEach((item, indexs) => {
if (index != indexs && v == item.id) {
this.staffLists.splice(index, 1, { ratio: 0 });
this.setRatio();
this.$message.warning({ message: "员工已存在列表中" });
}
});
let length = this.staffLists.length - 1;
if (this.staffLists[length].id) {
this.staffLists.push({ ratio: 0 });
}
this.changeStaff();
this.confirm();
},
setRatio() {
let num = 0;
this.staffLists.forEach((item, i) => {
if (i != 0) {
num += item.ratio * 1;
}
});
this.nums=this.staffLists[0].ratio;
this.staffLists[0].ratio = 100 - num;
},
//
clear(index) {
this.staffLists.splice(index, 1);
this.setRatio();
this.changeStaff();
this.confirm();
},
//
openStaffRatio(index, row) {
if (index != 0 || row.ratio * 1 != 100) {
let form = { ...row };
this.editIndex = index;
this.staffLists.splice(index, 1, form);
}
},
//
endStaffRatio(row, index) {
if (index != 0) {
this.setRatio();
if (this.staffLists[0].ratio < 1) {
this.$message.error({
message: "第一位员工占比过低",
});
this.staffLists.forEach((item) => {
if (item.ratio >= this.nums) {
item.ratio = 0;
}
});
let number = 0;
this.staffLists.forEach((item, index) => {
if (index != 0) {
number += item.ratio * 1;
console.l
}
this.staffLists[0].ratio = 100 - number
});
} else if (this.staffLists[0].ratio > 100) {
this.$message.error({
message: "第一位员工占比过高",
});
this.staffLists.forEach((item) => {
if (item.ratio < 1) {
item.ratio = 0;
}
});
let number = 0;
this.staffLists.forEach((item, index) => {
if (index != 0) {
number += item.ratio * 1;
console.l
}
this.staffLists[0].ratio = 100 - number
});
}
else {
if (!row.ratio) {
row.ratio = 0;
} else {
if (row.ratio < 0) {
// this.staffLists.forEach((item, index) => {
this.$message.error({
message: "输入不能小于0",
});
row.ratio = 0;
// });
let number = 0;
this.staffLists.forEach((item, index) => {
if (index != 0) {
number += item.ratio * 1;
}
this.staffLists[0].ratio = 100 - number
});
} else {
row.ratio = row.ratio * 1;
}
}
let form = this.staffLists[index];
this.editIndex = -1;
this.staffLists.splice(index, 1, form);
}
}
this.changeStaff();
this.confirm();
},
//
delsalesman() {
let index = this.staffLists.length - 1;
if (index == 0) {
this.$message.warning({ message: "第一行员工只能修改" });
} else {
let ratio = this.staffLists[index].ratio;
this.staffLists[0].ratio += ratio;
this.staffLists.splice(index, 1);
}
this.changeStaff();
this.confirm();
},
//
show(list, storeId) {
this.staffLists = [...list];
this.staffLists.forEach((item) => {
if (item.id || item.saleStaffId) {
console.log("🚀 ~ file: index.vue ~ line 204 ~ this.staffLists.forEach ~ item.saleStaffId", item.saleStaffId)
item.staffNames = item.brandNumber + "-" + item.staffName;
} else {
item.staffNames = "";
}
});
if (storeId) {
this.storeId = storeId;
}
this.getData();
},
//
confirm() {
let list = [];
this.staffLists.forEach((item) => {
let items = {
id: item.id,
ratio: item.ratio,
brandNumber: item.brandNumber,
staffName: item.staffName,
identityCard: item.identityCard,
storeId: item.storeId,
storeName: item.storeName,
staffNames: item.brandNumber + "--" + item.staffName,
staffType: 2,
};
list.push(items);
});
this.$emit("staffslesData", list);
console.log("🚀 ~ file: index.vue ~ line 222 ~ confirm ~ list", list)
},
//
changeStaff() {
var that = this;
let arr = [];
this.staffLists.forEach((item) => {
let list = [];
this.staffListCopy.forEach((items) => {
if (item.id != items.id) {
list.push(items);
}
});
arr = list;
});
// var list = that.staffLists
// .concat(that.staffListCopy)
// .filter(function (v) {
// return (
// that.staffLists.indexOf(v) === -1 ||
// that.staffListCopy.indexOf(v) === -1
// );
// });
// list.forEach((item) => {
// if (item.id) {
// arr.push(item);
// }
// });
this.staffList = this.noRepeat(arr);
},
//
//
async getData() {
let form = { id: this.storeId };
if (this.storeId) {
form.storeId = this.storeId;
}
selectList(form).then((res) => {
if (res.code == "000000") {
res.rows.forEach((item) => {
item.editStaffRatioShow = false;
});
this.staffList = res.rows;
this.staffListCopy = res.rows;
this.changeStaff();
} else {
this.$alert(res.message, "加载员工提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => { },
});
}
});
},
},
};
</script>
<style>
</style>

@ -19,8 +19,8 @@
<el-table :data="outList" max-height="150" :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)' ,color:'#eeeeee'}" style="margin-top: 5px;">
<el-table-column label="项目编码" show-overflow-tooltip align="center" prop="courseProjectNum" min-width="80"></el-table-column>
<el-table-column label="账户名称" show-overflow-tooltip align="center" prop="courseProjectName" min-width="120"></el-table-column>
<el-table-column label="可用次数" align="center" prop="courseConsumeCount" min-width="70"></el-table-column>
<el-table-column label="疗程单价" align="center" prop="unitMoney" min-width="70"></el-table-column>
<el-table-column label="可用次数" align="center" prop="courseAfterUsableCount" min-width="70"></el-table-column>
<el-table-column label="疗程单价" align="center" prop="price" min-width="70"></el-table-column>
<el-table-column label="转前次数" align="center" prop="courseBeforeUsableCount" min-width="70"></el-table-column>
<el-table-column label="转出次数" align="center" prop="rollOffCount" min-width="70"></el-table-column>
<el-table-column label="转后次数" align="center" prop="courseAfterUsableCount" min-width="70"></el-table-column>
@ -28,6 +28,10 @@
<el-table-column label="转出金额" align="center" prop="rollOffMoney" min-width="70"></el-table-column>
<el-table-column label="转后金额" align="center" prop="courseAfterUsableMoney" min-width="70"></el-table-column>
</el-table>
<span class="padding-left-sm ">员工</span>
<div class=" flex align-start flex-wrap padding-top">
<staffslesout ref="staffslesout" @staffslesData="staffslesDataout" :is-true="true"></staffslesout>
</div>
</div>
<div class="raisetable bg-white margin-left-lg">
<div class="raisetable-sum">
@ -44,7 +48,7 @@
</el-table>
</div>
<span class="text-bold padding-xs">员工</span>
<div class="into-table-width flex justify-center align-start flex-wrap padding-top">
<div class="into-table-width flex align-start flex-wrap padding-top">
<staffsles ref="staffsles" @staffslesData="staffslesData" :is-true='true'></staffsles>
</div>
</el-form>
@ -67,9 +71,11 @@ import {
cardChangeOutPro,
} from "@/api/eashier.js";
import staffsles from "@/components/staffList/staff/index";
import staffslesout from "@/components/staffList/staffout/index";
export default {
components: {
staffsles,
staffslesout
},
data() {
return {
@ -99,6 +105,13 @@ export default {
that.$refs.staffsles.show(that.form.staffLists);
});
},
setStaffs() {
var that = this;
this.$nextTick(() => {
console.log(that.form.staffListsout);
that.$refs.staffslesout.show(that.form.staffListsout);
});
},
//
staffslesData(v) {
this.form.staffLists = [...v];
@ -130,7 +143,7 @@ export default {
this.form = {
...item,
};
this.outList = this.form.coursePayLists;
this.outList = this.form.coursePayListRequests;
this.inList = [
{
rechargeTypeId: item.rechargeTypeId,
@ -141,6 +154,8 @@ export default {
rechargeAfterMoney: item.rechargeAfterMoney,
rechargeAccountId: item.rechargeAccountId,
typeRatio: item.typeRatio,
cardConsumeMoney:item.cardConsumeMoney,
discount:item.discount
},
];
this.form.staffLists = this.form.entities;
@ -153,10 +168,16 @@ export default {
this.form.staffLists.forEach((items) => {
items.staffNames = items.brandNumber + "--" + items.staffName;
});
this.form.staffListsout = this.form.coursePayListRequests[0].staffLists;
this.form.staffListsout.forEach((items) => {
items.staffNames = items.brandNumber + "--" + items.staffName;
});
if (this.form.staffLists.length == 0) {
this.form.staffLists.push({ ratio: 100 });
}
this.setStaff();
this.setStaffs();
},
subStaffRatio() {
editRechargeTurnCourse(this.form).then((res) => {

@ -5,14 +5,31 @@
<el-form-item label="分店名称:" :label-width="labelWidth">
<div class="form-width-ms">
<el-input v-model="label">
<el-button size="mini" slot="append" icon="el-icon-search" @click="openBranch"></el-button>
<el-button
size="mini"
slot="append"
icon="el-icon-search"
@click="openBranch"
></el-button>
</el-input>
</div>
</el-form-item>
<el-form-item label="手机号:" :label-width="labelWidth">
<div class="form-width-ms">
<el-input oninput="this.value=this.value.replace(/\D/g,'')" pattern="[0-9]*" maxlength="11" v-model="proForm.mobilePhone" @blur="memberOne" @change="memberOne">
<el-button size="mini" slot="append" icon="el-icon-search" @click="openMember"></el-button>
<el-input
oninput="this.value=this.value.replace(/\D/g,'')"
pattern="[0-9]*"
maxlength="11"
v-model="proForm.mobilePhone"
@blur="memberOne"
@change="memberOne"
>
<el-button
size="mini"
slot="append"
icon="el-icon-search"
@click="openMember"
></el-button>
</el-input>
</div>
</el-form-item>
@ -21,78 +38,309 @@
{{ proForm.memberName }}
</div>
</el-form-item>
<el-form-item label="业务时间:" :label-width="labelWidth" v-show="isAddition==1">
<el-form-item
label="业务时间:"
:label-width="labelWidth"
v-show="isAddition == 1"
>
<div class="form-width-ms">
<span style="cursor: pointer;" @click="(recDateShow=true)" v-show="!recDateShow">{{proForm.additionDate }} <i class="el-icon-edit"></i> </span>
<el-date-picker size="medium" @blur='(recDateShow=false)' :picker-options="pickerOptions" v-show="recDateShow" ref="recDate" v-model="proForm.additionDate" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择日期">
<span
style="cursor: pointer;"
@click="recDateShow = true"
v-show="!recDateShow"
>{{ proForm.additionDate }} <i class="el-icon-edit"></i>
</span>
<el-date-picker
size="medium"
@blur="recDateShow = false"
:picker-options="pickerOptions"
v-show="recDateShow"
ref="recDate"
v-model="proForm.additionDate"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
placeholder="选择日期"
>
</el-date-picker>
</div>
</el-form-item>
<div class="raisetable bg-white margin-left-lg margin-bottom-xs">
<div class="raisetable-sum ">
<div>转出疗程 <el-button v-if="proForm.memberName" :disabled="!proForm.memberId" size="mini" type="primary" @click='openPro(1)'>添加
<div>
转出疗程
<el-button
v-if="proForm.memberName"
:disabled="!proForm.memberId"
size="mini"
type="primary"
@click="openPro(1)"
>添加
</el-button>
</div>
<div style="width: 150px;">总金额 : {{ outMoneys }}</div>
</div>
<el-table :data="outList" empty-text=' , ' max-height="200" :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)' ,color:'#eeeeee'}" style="margin-top: 5px;">
<el-table-column label="项目编码" show-overflow-tooltip align="center" prop="courseProjectNum" min-width="80"></el-table-column>
<el-table-column label="账户名称" show-overflow-tooltip align="center" prop="courseProjectName" min-width="120"></el-table-column>
<el-table-column label="可用次数" align="center" prop="courseConsumeCount" min-width="70"></el-table-column>
<el-table-column label="疗程单价" align="center" prop="price" min-width="70"></el-table-column>
<el-table-column label="转前次数" align="center" prop="courseBeforeUsableCount" min-width="70"></el-table-column>
<el-table-column label="转出次数" align="center" prop="rollOffCount" min-width="90">
<template slot-scope='scope'>
<div class="form-input-width" v-if="!scope.row.rollOffCountShow" @click="openEditOut(scope.row,scope.$index,scope.row.rollOffCountShow=true)">
<el-table
:data="outList"
empty-text="暂无数据 , 点击添加疗程"
max-height="200"
:header-cell-style="{
background: 'linear-gradient(#6cb3ff, #1873d4)',
color: '#eeeeee'
}"
style="margin-top: 5px;"
>
<el-table-column type="expand">
<template slot-scope="scope">
<div class="flex justify-start align-center flex-wrap ">
<el-form inline class="margin-top-xs margin-left-xs">
<el-form-item label="员工">
<div class="flex align-center form-width-m">
<el-select
filterable
default-first-option
clearable
v-model="scope.row.staffLists[0].staffName"
placeholder="请选择"
>
</el-select>
<!-- <div class="el-icon-circle-close text-xs text-cyan" @click.stop="scope.row.smallLists=null,scope.row.smallList.splice(0,1)"></div> -->
<div
class="el-icon-edit-outline text-xs text-cyan"
@click.stop="
openStaffRatio(scope.row.staffLists, scope.$index)
"
></div>
</div>
</el-form-item>
<br />
</el-form>
</div>
</template>
</el-table-column>
<el-table-column
label="项目编码"
show-overflow-tooltip
align="center"
prop="courseProjectNum"
min-width="80"
></el-table-column>
<el-table-column
label="账户名称"
show-overflow-tooltip
align="center"
prop="courseProjectName"
min-width="120"
></el-table-column>
<el-table-column
label="可用次数"
align="center"
prop="courseConsumeCount"
min-width="70"
></el-table-column>
<el-table-column
label="疗程单价"
align="center"
prop="price"
min-width="70"
></el-table-column>
<el-table-column
label="转前次数"
align="center"
prop="courseBeforeUsableCount"
min-width="70"
></el-table-column>
<el-table-column
label="转出次数"
align="center"
prop="rollOffCount"
min-width="90"
>
<template slot-scope="scope">
<div
class="form-input-width"
v-if="!scope.row.rollOffCountShow"
@click="
openEditOut(
scope.row,
scope.$index,
(scope.row.rollOffCountShow = true)
)
"
>
{{ scope.row.rollOffCount }}
<i class="el-icon-edit text-cyan"></i>
</div>
<el-input v-else v-focus class="form-input-width-xs" type='number' v-model="scope.row.rollOffCount" @blur="endrollOffCount(scope.row,scope.$index)"></el-input>
<el-input
v-else
v-focus
class="form-input-width-xs"
type="number"
v-model="scope.row.rollOffCount"
@blur="endrollOffCount(scope.row, scope.$index)"
></el-input>
</template>
</el-table-column>
<el-table-column label="转后次数" align="center" prop="courseAfterUsableCount" min-width="70"></el-table-column>
<el-table-column label="转前金额" align="center" prop="courseBeforeUsableMoney" min-width="70"></el-table-column>
<el-table-column label="转出金额" align="center" prop="rollOffMoney" min-width="90">
<template slot-scope='scope'>
<div class="form-input-width" v-if="outMoneyIndex!=scope.$index" @click="openEditOut(scope.row,scope.$index,outMoneyIndex=scope.$index)">
<el-table-column
label="转后次数"
align="center"
prop="courseAfterUsableCount"
min-width="70"
></el-table-column>
<el-table-column
label="转前金额"
align="center"
prop="courseBeforeUsableMoney"
min-width="70"
></el-table-column>
<el-table-column
label="转出金额"
align="center"
prop="rollOffMoney"
min-width="90"
>
<template slot-scope="scope">
<div
class="form-input-width"
v-if="outMoneyIndex != scope.$index"
@click="
openEditOut(
scope.row,
scope.$index,
(outMoneyIndex = scope.$index)
)
"
>
{{ scope.row.rollOffMoney }}
<i class="el-icon-edit text-cyan"></i>
</div>
<el-input v-else v-focus class="form-input-width-xs" type='number' v-model="scope.row.rollOffMoney" @blur="endOutMoney(scope.row)"></el-input>
<el-input
v-else
v-focus
class="form-input-width-xs"
type="number"
v-model="scope.row.rollOffMoney"
@blur="endOutMoney(scope.row)"
></el-input>
</template>
</el-table-column>
<el-table-column label="转后金额" align="center" prop="courseAfterUsableMoney" min-width="70"></el-table-column>
<el-table-column
label="转后金额"
align="center"
prop="courseAfterUsableMoney"
min-width="70"
></el-table-column>
<el-table-column align="center" fixed="right" min-width="80">
<template slot-scope='scope'>
<div @click="delOldPro(scope.$index)" class="el-icon-delete"></div>
<template slot-scope="scope">
<div
@click="delOldPro(scope.$index)"
class="el-icon-delete"
></div>
</template>
</el-table-column>
</el-table>
</div>
<div class="raisetable bg-white margin-left-lg">
<div class="raisetable-sum">
<div>转入充值 <el-button v-if="proForm.memberName" size="mini" type="primary" :disabled="inList.length==1" @click='openPro(0)'>添加</el-button>
<el-button size="mini" v-if="proForm.memberName" type="warning" :disabled="inList.length==0" @click='backout'>撤销</el-button>
<div>
转入充值
<el-button
v-if="proForm.memberName"
size="mini"
type="primary"
:disabled="inList.length == 1"
@click="openPro(0)"
>添加</el-button
>
<el-button
size="mini"
v-if="proForm.memberName"
type="warning"
:disabled="inList.length == 0"
@click="backout"
>撤销</el-button
>
</div>
<div style="width: 150px;">总金额 : {{ inMoneys }}</div>
</div>
<el-table :data="inList" max-height="150" empty-text=' , ' :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)' ,color:'#eeeeee'}" style="margin-top: 5px;">
<el-table-column label="充值编码" show-overflow-tooltip align="center" prop="rechargeTypeNum" min-width="100"></el-table-column>
<el-table-column label="充值名称" show-overflow-tooltip align="center" prop="rechargeTypeName" min-width="110"></el-table-column>
<el-table-column label="充值金额" align="center" prop="rechargeMoney" min-width="70"></el-table-column>
<el-table-column label="折扣(%)" align="center" prop="discount" min-width="70"></el-table-column>
<el-table-column label="转前金额" align="center" prop="rechargeBeforeMoney" min-width="70"></el-table-column>
<el-table-column label="转入金额" align="center" prop="rechargeInMoney" min-width="90">
<template slot-scope='scope'>
<div class="form-input-width" v-if="!scope.row.rechargeInMoneyShow" @click="openEdit(scope.row,scope.$index,scope.row.rechargeInMoneyShow=true)">
<el-table
:data="inList"
max-height="150"
empty-text="暂无数据 , 点击添加充值"
:header-cell-style="{
background: 'linear-gradient(#6cb3ff, #1873d4)',
color: '#eeeeee'
}"
style="margin-top: 5px;"
>
<el-table-column
label="充值编码"
show-overflow-tooltip
align="center"
prop="rechargeTypeNum"
min-width="100"
></el-table-column>
<el-table-column
label="充值名称"
show-overflow-tooltip
align="center"
prop="rechargeTypeName"
min-width="110"
></el-table-column>
<el-table-column
label="充值金额"
align="center"
prop="rechargeMoney"
min-width="70"
></el-table-column>
<el-table-column
label="折扣(%)"
align="center"
prop="discount"
min-width="70"
></el-table-column>
<el-table-column
label="转前金额"
align="center"
prop="rechargeBeforeMoney"
min-width="70"
></el-table-column>
<el-table-column
label="转入金额"
align="center"
prop="rechargeInMoney"
min-width="90"
>
<template slot-scope="scope">
<div
class="form-input-width"
v-if="!scope.row.rechargeInMoneyShow"
@click="
openEdit(
scope.row,
scope.$index,
(scope.row.rechargeInMoneyShow = true)
)
"
>
{{ scope.row.rechargeInMoney }}
<i class="el-icon-edit text-cyan"></i>
</div>
<el-input v-focus class="form-input-width-xs" type="number" v-else v-model="scope.row.rechargeInMoney" @blur="endEditPrice(scope.row,scope.$index)"></el-input>
<el-input
v-focus
class="form-input-width-xs"
type="number"
v-else
v-model="scope.row.rechargeInMoney"
@blur="endEditPrice(scope.row, scope.$index)"
></el-input>
</template>
</el-table-column>
<el-table-column label="转后金额" align="center" prop="rechargeAfterMoney" min-width="70"></el-table-column>
<el-table-column
label="转后金额"
align="center"
prop="rechargeAfterMoney"
min-width="70"
></el-table-column>
</el-table>
</div>
@ -102,17 +350,37 @@
<manager class="border padding-bottom-xs " ref="manager" @managerData="managerData"></manager> -->
</div>
<div class="flex justify-center padding-top ">
<el-button size="mini" type="info" @click='empty()' plain>清空</el-button>
<el-button size="mini" v-if="isAddition==0" type="primary" @click="isAddition = 1"></el-button>
<el-button size="mini" v-else type="success" @click="isAddition = 0">加价</el-button>
<el-button size="mini" type="primary" @click='raiseProList()' plain>列表</el-button>
<el-button size="mini" type="primary" @click='submit(true,loading=true)' :loading="loading" :disabled="outList.length==0&&inList.length==0">提交</el-button>
<el-button size="mini" type="info" @click="empty()" plain
>清空</el-button
>
<el-button
size="mini"
v-if="isAddition == 0"
type="primary"
@click="isAddition = 1"
>补单</el-button
>
<el-button size="mini" v-else type="success" @click="isAddition = 0"
>加价</el-button
>
<el-button size="mini" type="primary" @click="raiseProList()" plain
>列表</el-button
>
<el-button
size="mini"
type="primary"
@click="submit(true, (loading = true))"
:loading="loading"
:disabled="outList.length == 0 && inList.length == 0"
>提交</el-button
>
</div>
</el-form>
<member ref="member" @memberData="memberData"></member>
<Branch ref="Branch" @BranchData="BranchData"></Branch>
<project ref="project" @projectData="projectData"></project>
<recType ref="recType" @recTypeData="recTypeData"></recType>
<staffratio ref="staffratio" @staffratioData="staffratioData"></staffratio>
</div>
</template>
@ -121,8 +389,9 @@ import { propage } from "@/api/storeManage.js";
import {
storeMemberOne,
addRechargeTurnCourse,
recAccountOne,
recAccountOne
} from "@/api/eashier.js";
import staffratio from "./staffratio";
import member from "@/components/member/index";
import Branch from "@/components/Branch/index";
import project from "@/components/project/index";
@ -138,14 +407,15 @@ export default {
member,
project,
recType,
Branch
Branch,
staffratio
},
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
},
}
},
projectDialogVisible: false,
recDateShow: false,
@ -157,7 +427,7 @@ export default {
mobilePhone: null,
Branch: null,
staffLists: [{ ratio: 100 }],
payLists: [],
payLists: []
},
outList: [],
inList: [],
@ -166,7 +436,7 @@ export default {
total: 0,
pageNum: 1,
pageSize: 10,
list: [],
list: []
},
proRadio: null,
proRadioForm: null,
@ -182,6 +452,31 @@ export default {
};
},
methods: {
openStaffRatio(row, index, text) {
this.editIndex = index;
this.$refs.staffratio.show(row);
this.$refs.staffratio.showdetele();
localStorage.setItem("row", JSON.stringify(row));
localStorage.setItem("text", text);
},
staffratioData(v) {
let form = this.outList[this.editIndex];
form.rows = v.list;
form.staffLists = v.list;
console.log(
"🚀 ~ file: index.vue ~ line 228 ~ staffratioData ~ form.staffLists",
form.staffLists
);
form.cardAchievementAmount = v.list[0].cardAchievementAmount;
form.cardCommissionAmount = v.list[0].cardCommissionAmount;
form.cardSalesAchievement = v.list[0].cardSalesAchievement;
form.cardSalesCommission = v.list[0].cardSalesCommission;
console.log(
"🚀 ~ file: index.vue ~ line 302 ~ staffratioData ~ form",
form
);
this.outList.splice(this.editIndex, 1, form);
},
setStaffRatio() {
var that = this;
setTimeout(() => {
@ -191,7 +486,10 @@ export default {
that.$refs.staffsles.show(that.proForm.staffLists);
}
console.log("🚀 ~ file: index.vue ~ line 189 ~ setTimeout ~ that.proForm.staffLists", that.proForm.staffLists)
console.log(
"🚀 ~ file: index.vue ~ line 189 ~ setTimeout ~ that.proForm.staffLists",
that.proForm.staffLists
);
}, 800);
},
staffslesData(v) {
@ -201,26 +499,24 @@ export default {
this.$refs.member.show();
},
openBranch() {
this.$refs.Branch.show();
},
memberData(v) {
this.proForm.mobilePhone = v.mobilePhone;
this.memberOne();
},
BranchData(v) {
this.StoreIds=v.id
this.label=v.label
this.StoreIds = v.id;
this.label = v.label;
this.setStaffRatio();
console.log("🚀 ~ file: index.vue ~ line 217 ~ BranchData ~ " , 'aaaa')
console.log("🚀 ~ file: index.vue ~ line 217 ~ BranchData ~ ", "aaaa");
},
submit() {
this.proForm.rechargeInMoney = this.inMoneys;
this.proForm.courseOutMoney = this.outMoneys;
this.proForm.isAddition = this.isAddition;
this.proForm.coursePayLists = this.outList;
this.proForm.coursePayListRequests = this.outList;
this.proForm.staffLists;
this.proForm = Object.assign(this.proForm, this.inList[0]);
this.inList[0];
@ -233,7 +529,7 @@ export default {
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => {},
callback: action => {}
});
this.loading = false;
}
@ -243,11 +539,11 @@ export default {
},
addRechargeTurnCourse() {
var that = this;
addRechargeTurnCourse(this.proForm).then((res) => {
addRechargeTurnCourse(this.proForm).then(res => {
this.loading = false;
if (res.code == "000000") {
this.$message.success({
message: res.message,
message: res.message
});
this.empty();
} else {
@ -256,7 +552,7 @@ export default {
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => {},
callback: action => {}
});
}
});
@ -264,7 +560,7 @@ export default {
tableRowClassName({ row, rowIndex }) {
row.index = rowIndex;
},
projectData(form) {
projectData(form,rows) {
form.memberId = this.proForm.memberId;
form.memberName = this.proForm.memberName;
form.mobilePhone = this.proForm.mobilePhone;
@ -283,7 +579,13 @@ export default {
form.rollOffCountShow = false;
form.accountId = form.id;
let flag = true;
this.outList.forEach((item) => {
form.staffLists=rows
form.cardAchievementAmount=rows[0].cardAchievementAmount
form.cardCommissionAmount=rows[0].cardCommissionAmount
form.cardSalesAchievement=rows[0].cardSalesAchievement
form.cardSalesCommission=rows[0].cardSalesCommission
this.outList.forEach(item => {
if (form.id == item.form.id) {
flag = false;
}
@ -299,13 +601,13 @@ export default {
let form = {
storeId: this.proForm.storeId,
memberId: this.proForm.memberId,
rechargeTypeId: v.id,
rechargeTypeId: v.id
};
v.rechargeTypeId = v.id;
recAccountOne(form).then((res) => {
recAccountOne(form).then(res => {
if (res.data != undefined && res.data.state == 0) {
this.$message.error({
message: "账户已锁定, 不允许使用 ! ",
message: "账户已锁定, 不允许使用 ! "
});
} else {
if (res.code == "000000" || res.code == "200004") {
@ -330,7 +632,7 @@ export default {
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => {},
callback: action => {}
});
}
}
@ -346,15 +648,18 @@ export default {
let row = { ...this.proForm };
let form = {
mobilePhone: mobilePhone,
storeId: sessionStorage.getItem("parentId"),
storeId: sessionStorage.getItem("parentId")
};
if (mobilePhone) {
console.log("🚀 ~ file: index.vue ~ line 347 ~ memberOne ~ this.StoreIds", this.StoreIds)
console.log(
"🚀 ~ file: index.vue ~ line 347 ~ memberOne ~ this.StoreIds",
this.StoreIds
);
let form = {
mobilePhone: mobilePhone,
storeId: sessionStorage.getItem("parentId"),
storeId: sessionStorage.getItem("parentId")
};
storeMemberOne(form).then((res) => {
storeMemberOne(form).then(res => {
this.proForm.mobilePhone = mobilePhone;
if (res.code == "000000") {
row.memberId = res.data.id;
@ -372,7 +677,7 @@ export default {
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => {},
callback: action => {}
});
}
});
@ -390,12 +695,11 @@ export default {
}
if (num == 1) {
if (this.StoreIds) {
this.proForm.storeId=this.StoreIds
this.proForm.storeId = this.StoreIds;
} else {
this.proForm.storeId=""
this.proForm.storeId = "";
}
this.$refs.project.show(this.proForm)
this.$refs.project.show(this.proForm);
}
},
delOldPro(index) {
@ -408,13 +712,13 @@ export default {
},
openEdit(row, index) {
let form = {
...row,
...row
};
this.inList.splice(index, 1, form);
},
openEditOut(row, index) {
let form = {
...row,
...row
};
this.outList.splice(index, 1, form);
},
@ -429,7 +733,7 @@ export default {
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => {},
callback: action => {}
});
row.rollOffCount = row.courseConsumeCount;
} else {
@ -452,7 +756,7 @@ export default {
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => {},
callback: action => {}
});
row.rollOffMoney = money;
} else {
@ -464,13 +768,13 @@ export default {
sumMoney() {
let inMoneys = 0;
let outMoneys = 0;
this.inList.forEach((item) => {
this.inList.forEach(item => {
item.rechargeInMoney = this.outMoneys;
inMoneys += item.rechargeInMoney * 1;
item.rechargeAfterMoney =
(item.rechargeBeforeMoney + item.rechargeInMoney).toFixed(2) * 1;
});
this.outList.forEach((item) => {
this.outList.forEach(item => {
item.courseAfterUsableCount =
(item.courseBeforeUsableCount - item.rollOffCount).toFixed(0) * 1;
item.courseAfterUsableMoney =
@ -503,9 +807,9 @@ export default {
state: 1,
directConsumption: 0,
storeIds: JSON.parse(sessionStorage.getItem("storeIdLists")),
isCooperation: 0,
isCooperation: 0
};
propage(page).then((res) => {
propage(page).then(res => {
if (res.code == "000000") {
this.proPageInfo = res.pageInfo;
} else {
@ -514,7 +818,7 @@ export default {
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => {},
callback: action => {}
});
}
});
@ -526,9 +830,9 @@ export default {
pageSize: this.proPageInfo.pageSize,
state: 1,
directConsumption: 0,
storeIds: JSON.parse(sessionStorage.getItem("storeIdLists")),
storeIds: JSON.parse(sessionStorage.getItem("storeIdLists"))
};
propage(page).then((res) => {
propage(page).then(res => {
if (res.code == "000000") {
this.proPageInfo = res.pageInfo;
} else {
@ -537,7 +841,7 @@ export default {
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => {},
callback: action => {}
});
}
});
@ -548,11 +852,11 @@ export default {
sessionStorage.getItem("sessionStorageData")
);
this.proForm.additionDate = this.formatTime(new Date(), "YYYY-MM-DD");
},
}
},
created() {
this.setPage();
},
}
};
</script>

@ -0,0 +1,303 @@
<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) {
console.log("🚀 ~ file: staffratio.vue ~ line 284 ~ confirms ~ form", form)
this.$emit("staffratioData", form);
this.dialogVisible = false;
} else {
this.$alert("选择员工存在重复", "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => { },
});
}
},
},
};
</script>
<style>
</style>

@ -32,6 +32,10 @@
<el-table-column label="转出次数" align="center" prop="changeOutTime" min-width="100"></el-table-column>
<el-table-column label="转出金额" align="center" prop="changeOutMoney" min-width="100"></el-table-column>
</el-table>
<span class="padding-left-sm ">员工</span>
<div class=" flex align-start flex-wrap padding-top">
<staffslesout ref="staffslesout" @staffslesData="staffslesDataout" :is-true="true"></staffslesout>
</div>
</div>
<div class="raisetable-sum">
<span>转入疗程</span>
@ -58,7 +62,7 @@
</div>
</div>
<span class="padding-left-sm ">员工/门店管理层/高管业绩</span>
<div class=" flex justify-center align-start flex-wrap padding-top">
<div class=" flex align-start flex-wrap padding-top">
<staffsles ref="staffsles" @staffslesData="staffslesData" :is-true="true"></staffsles>
<admin ref="admin" @adminData="adminData" :is-true="true"></admin>
<manager ref="manager" @managerData="managerData" :is-true="true"></manager>
@ -85,11 +89,13 @@ import {
import admin from "@/components/staffList/admin/index";
import manager from "@/components/staffList/manager/index";
import staffsles from "@/components/staffList/staff/index";
import staffslesout from "@/components/staffList/staffout/index";
export default {
components: {
staffsles,
manager,
admin,
staffslesout
},
data() {
return {
@ -124,10 +130,20 @@ export default {
that.$refs.manager.show(that.form.managerList);
});
},
setStaffs() {
var that = this;
this.$nextTick(() => {
console.log(that.form.staffListsout);
that.$refs.staffslesout.show(that.form.staffListsout);
});
},
//
staffslesData(v) {
this.form.staffLists = [...v];
},
staffslesDataout(v) {
this.form.staffListsout = [...v];
},
//
managerData(v) {
this.form.managerList = [...v];
@ -202,6 +218,7 @@ export default {
this.form.managerList = managerList;
this.form.adminList = adminList;
this.setStaff();
} else {
this.$alert(res.message, "加载门店高管", {
confirmButtonText: "确定",
@ -228,7 +245,18 @@ export default {
}).then((res) => {
if (res.code == "000000") {
this.outList = res.rows;
res.rows[0].entities.forEach((item) => {
item.id = item.saleStaffId;
item.staffName = item.saleStaffName;
item.ratio = item.saleRatio;
item.identityCard = item.saleIdentityCard;
});
this.form.staffListsout = res.rows[0].entities;
this.form.staffListsout.forEach((items) => {
items.staffNames = items.brandNumber + "--" + items.staffName;
});
console.log(this.form);
this.setStaffs();
} else {
this.$alert("加载转出列表 : " + res.message, "提示", {
confirmButtonText: "确定",

Loading…
Cancel
Save