补充内容

master
Wangxubin1999 3 years ago
parent be4baf6eb6
commit 8b42cd2108

@ -15,7 +15,7 @@ if (new Date().getMonth() + 1 < 10) {
month = "0" + (new Date().getMonth() + 1);
} else {
month = new Date().getMonth() + 1;
dabao;
// dabao;
}
var day = "";

@ -0,0 +1,297 @@
<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) {
item.staffNames = item.brandNumber + "-" + item.staffName;
} else {
item.staffNames = "";
}
});
console.log("🚀 ~ file: index.vue ~ line 202 ~ show ~ this.staffLists", this.staffLists)
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>

@ -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">
@ -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 {
@ -95,14 +101,24 @@ export default {
setStaff() {
var that = this;
this.$nextTick(() => {
console.log(that.$refs.staffsles);
// console.log(that.$refs.staffsles);
that.$refs.staffsles.show(that.form.staffLists);
});
},
setStaffs() {
var that = this;
this.$nextTick(() => {
// console.log(that.$refs.staffsles);
that.$refs.staffslesout.show(that.form.staffListsout);
});
},
//
staffslesData(v) {
this.form.staffLists = [...v];
},
staffslesDataout(v) {
this.form.staffListsout = [...v];
},
cancel() {
this.$emit("detailData");
this.form = Object.assign({});
@ -130,7 +146,7 @@ export default {
this.form = {
...item,
};
this.outList = this.form.coursePayLists;
this.outList = this.form.coursePayListRequests;
this.inList = [
{
rechargeTypeId: item.rechargeTypeId,
@ -143,6 +159,13 @@ export default {
typeRatio: item.typeRatio,
},
];
this.form.staffListsout=this.form.coursePayListRequests[0].staffLists
this.form.staffListsout.forEach((items) => {
items.staffNames = items.brandNumber + "--" + items.staffName;
});
if (this.form.staffListsout.length == 0) {
this.form.staffListsout.push({ ratio: 100 });
}
this.form.staffLists = this.form.entities;
this.form.staffLists.forEach((item) => {
item.id = item.saleStaffId;
@ -157,6 +180,7 @@ export default {
this.form.staffLists.push({ ratio: 100 });
}
this.setStaff();
this.setStaffs();
},
subStaffRatio() {
editRechargeTurnCourse(this.form).then((res) => {

@ -36,6 +36,34 @@
<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 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>
@ -112,6 +140,7 @@
<member ref="member" @memberData="memberData"></member>
<Branch ref="Branch" @BranchData="BranchData"></Branch>
<project ref="project" @projectData="projectData"></project>
<staffratio ref="staffratio" @staffratioData="staffratioData"></staffratio>
<recType ref="recType" @recTypeData="recTypeData"></recType>
</div>
</template>
@ -123,6 +152,7 @@ import {
addRechargeTurnCourse,
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,7 +168,8 @@ export default {
member,
project,
recType,
Branch
Branch,
staffratio
},
data() {
return {
@ -177,11 +208,32 @@ export default {
sessionStorageList: null,
isAddition: 0,
loading: false,
TransactionNum: 0,
StoreIds:"",
label:""
label:"",
staff:[]
};
},
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
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);
console.log("🚀 ~ file: index.vue ~ line 235 ~ staffratioData ~ this.outList", this.outList)
},
setStaffRatio() {
var that = this;
setTimeout(() => {
@ -220,7 +272,7 @@ export default {
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];
@ -264,7 +316,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;
@ -282,18 +334,25 @@ export default {
form.rollOffMoney = 0;
form.rollOffCountShow = false;
form.accountId = form.id;
form.staffLists=rows
form.cardAchievementAmount=rows[0].cardAchievementAmount
form.cardCommissionAmount=rows[0].cardCommissionAmount
form.cardSalesAchievement=rows[0].cardSalesAchievement
form.cardSalesCommission=rows[0].cardSalesCommission
let flag = true;
this.outList.forEach((item) => {
if (form.id == item.form.id) {
flag = false;
}
});
console.log("🚀 ~ file: index.vue ~ line 343 ~ this.outList.forEach ~ this.outList", this.outList)
if (flag) {
this.outList.push(form);
this.sumMoney();
} else {
this.$message({ message: "项目已存在 !" });
}
},
recTypeData(v) {
let form = {

@ -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>

@ -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>
@ -85,9 +89,11 @@ 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,
staffslesout,
manager,
admin,
},
@ -124,10 +130,21 @@ export default {
that.$refs.manager.show(that.form.managerList);
});
},
setStaffs() {
var that = this;
this.$nextTick(() => {
console.log(that.$refs.staffsles);
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];
@ -228,7 +245,13 @@ export default {
}).then((res) => {
if (res.code == "000000") {
this.outList = res.rows;
console.log(this.form);
console.log("🚀 ~ file: detail.vue ~ line 241 ~ getData ~ res.rows", res.rows)
this.form.staffListsout = res.rows[0].entities;
this.form.staffListsout.forEach((items) => {
items.staffNames = items.brandNumber + "--" + items.saleStaffName;
});
this.setStaffs();
} else {
this.$alert("加载转出列表 : " + res.message, "提示", {
confirmButtonText: "确定",

@ -1024,7 +1024,7 @@ export default {
if (form.offsetMoney > debtMoney) {
//
form.discoutMoney =
(form.spendMoney / form.discount / 100).toFixed(2) * 1;
(form.spendMoney / form.discount * 100).toFixed(2) * 1;
} else {
//
form.spendMoney = form.cardOver;

Loading…
Cancel
Save