From 79cb59ffb77be5849e69fb80bbdeb478e9b95a9f Mon Sep 17 00:00:00 2001 From: "wangxubin@yeah.net" Date: Sat, 20 Aug 2022 09:10:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/storeManage.js | 7 + src/components/repayment/index.vue | 60 ++++++++ src/components/staffList/admin/index.vue | 59 ++++++- src/components/staffList/manager/index.vue | 73 +++++++-- src/components/staffList/staff/index.vue | 76 +++++++-- src/layout/components/asider.vue | 12 +- .../raiseReatment/components/index.vue | 27 +++- src/pages/eashier/reatment/reatment.vue | 1 + .../eashier/refundCourse/refundCourse.vue | 2 +- .../eashier/refundRecharge/refundRecharge.vue | 4 +- src/pages/eashier/service/service.vue | 45 +++--- src/pages/eashier/service/staffratio.vue | 144 +++++------------- src/pages/promotion/components/memberSuit.vue | 8 +- .../staffBrokerage/staffBrokerage.vue | 4 +- .../baseProject/components/edit.vue | 4 +- src/router/index.js | 4 +- 16 files changed, 342 insertions(+), 188 deletions(-) diff --git a/src/api/storeManage.js b/src/api/storeManage.js index 9da4b6c..405267b 100644 --- a/src/api/storeManage.js +++ b/src/api/storeManage.js @@ -464,6 +464,13 @@ export function storeMemberpage(params) { data: params }); } +export function storeMemberpages(params) { + return service({ + url: "/api" + "/demay/ssm/storeMember/selectListNew", + method: "post", + data: params + }); +} export function pageassign(params) { return service({ url: "/api" + "/demay/ssm/storeMember/pageassign", diff --git a/src/components/repayment/index.vue b/src/components/repayment/index.vue index e384be9..784e86e 100644 --- a/src/components/repayment/index.vue +++ b/src/components/repayment/index.vue @@ -164,6 +164,8 @@ import { addCancelDebtList, couAccountList, recAccountCashList, + selectListType, + QuerCompetent, } from "@/api/eashier.js"; import cancel from "./components/cancel.vue"; import admin from "@/components/staffList/admin/index"; @@ -406,6 +408,64 @@ export default { //获取数据 async getData() { this.getPage(); + //获取员工列表 + selectList({ id: "" }).then((res) => { + if (res.code == "000000") { + res.rows.forEach((item) => { + item.label = item.brandNumber + "-" + item.staffName; + delete item.state; + item.ratio = 100; + }); + this.options = Array.from(new Set(res.rows)); + } else { + this.$alert(res.message, "加载员工列表", { + confirmButtonText: "确定", + confirmButtonClass: "confirmbtnFalses", + type: "warning", + center: true, + callback: (action) => {}, + }); + } + }); + //获取员工列表 + selectListType({ type: 0 }).then((res) => { + if (res.code == "000000") { + res.rows.forEach((item) => { + item.label = item.brandNumber + "-" + item.staffName; + item.ratio = 100; + delete item.state; + }); + + this.adminOptions = res.rows; + } else { + this.$alert(res.message, "加载员工提示", { + confirmButtonText: "确定", + confirmButtonClass: "confirmbtnFalses", + type: "warning", + center: true, + callback: (action) => {}, + }); + } + }); + //获取高管列表 + QuerCompetent({ type: 0, pageSize: 999 }).then((res) => { + if (res.code == "000000") { + res.pageInfo.list.forEach((item) => { + item.label = item.brandNumber + "-" + item.staffName; + item.ratio = 100; + delete item.state; + }); + this.managerOptions = res.pageInfo.list; + } else { + this.$alert(res.message, "加载高管提示", { + confirmButtonText: "确定", + confirmButtonClass: "confirmbtnFalses", + type: "warning", + center: true, + callback: (action) => {}, + }); + } + }); //获取现付列表 ctlist({ id: "" }).then((res) => { if (res.code == "000000") { diff --git a/src/components/staffList/admin/index.vue b/src/components/staffList/admin/index.vue index dffbbd7..d60d24b 100644 --- a/src/components/staffList/admin/index.vue +++ b/src/components/staffList/admin/index.vue @@ -35,6 +35,7 @@ export default { editIndex: -1, //员工占比修改下标 staffListCopy: [], //复制选择员工数组 storeId: null, //当前门店id + nums:'', }; }, methods: { @@ -48,6 +49,7 @@ export default { num += item.ratio * 1; } }); + this.nuns=this.staffLists[0].ratio this.staffLists[0].ratio = 100 - num; }, //删除当前选择 @@ -91,26 +93,73 @@ export default { //关闭员工修改输入框 endStaffRatio(row, index) { if (index != 0) { - this.setRatio(); + this.setRatio(); if (this.staffLists[0].ratio < 1) { this.$message.error({ message: "第一位员工占比过低", }); this.staffLists.forEach((item) => { - if (item.ratio > 100) { + if (item.ratio >= this.nums) { item.ratio = 0; + } }); - } else { + 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 < 0) { + 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 { - row.ratio = row.ratio * 1; + 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.editIndex = -1; } this.confirm(); this.changeStaff(); diff --git a/src/components/staffList/manager/index.vue b/src/components/staffList/manager/index.vue index e1a5832..623ca7f 100644 --- a/src/components/staffList/manager/index.vue +++ b/src/components/staffList/manager/index.vue @@ -3,25 +3,32 @@
撤销 - 增加 + 增加 +
@@ -34,6 +41,7 @@ export default { staffLists: [{ ratio: 100 }], //员工占比初始化 //主员工数组 editIndex: -1, //员工占比修改下标 staffListCopy: [], //复制选择员工数组 + nums:"", }; }, methods: { @@ -47,6 +55,7 @@ export default { num += item.ratio * 1; } }); + this.nums=this.staffLists[0].ratio; this.staffLists[0].ratio = 100 - num; }, //删除当前选择 @@ -93,18 +102,60 @@ export default { this.setRatio(); if (this.staffLists[0].ratio < 1) { this.$message.error({ - message: "第一位占比过低", + message: "第一位员工占比过低", }); this.staffLists.forEach((item) => { - if (item.ratio > 100) { + if (item.ratio >= this.nums) { item.ratio = 0; } }); - } else { + let number = 0; + this.staffLists.forEach((item, index) => { + if (index != 0) { + number += item.ratio * 1; + } + }); + this.staffLists[0].ratio = 100 - number + } else if (this.staffLists[0].ratio > 100) { + this.$message.error({ + message: "第一位员工占比过高", + }); + this.staffLists.forEach((item) => { + if (item.ratio < 0) { + item.ratio = 0; + } + }); + let number = 0; + this.staffLists.forEach((item, index) => { + if (index != 0) { + number += item.ratio * 1; + } + }); + this.staffLists[0].ratio = 100 - number + } + else { if (!row.ratio) { row.ratio = 0; } else { - row.ratio = row.ratio * 1; + 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; @@ -199,7 +250,7 @@ export default { confirmButtonClass: "confirmbtnFalses", type: "warning", center: true, - callback: (action) => {}, + callback: (action) => { }, }); } }); diff --git a/src/components/staffList/staff/index.vue b/src/components/staffList/staff/index.vue index 1292199..cbcad04 100644 --- a/src/components/staffList/staff/index.vue +++ b/src/components/staffList/staff/index.vue @@ -3,25 +3,32 @@
撤销 - 增加 + 增加 +
@@ -36,6 +43,7 @@ export default { editIndex: -1, //员工占比修改下标 staffListCopy: [], //复制选择员工数组 storeId: null, //当前门店id + nums:"", }; }, methods: { @@ -73,6 +81,7 @@ export default { num += item.ratio * 1; } }); + this.nums=this.staffLists[0].ratio; this.staffLists[0].ratio = 100 - num; }, //删除当前选择 @@ -99,15 +108,62 @@ export default { message: "第一位员工占比过低", }); this.staffLists.forEach((item) => { - if (item.ratio > 100) { + if (item.ratio >= this.nums) { item.ratio = 0; + } }); - } else { + 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 { - row.ratio = row.ratio * 1; + 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; @@ -214,7 +270,7 @@ export default { confirmButtonClass: "confirmbtnFalses", type: "warning", center: true, - callback: (action) => {}, + callback: (action) => { }, }); } }); diff --git a/src/layout/components/asider.vue b/src/layout/components/asider.vue index cb96687..85359f9 100644 --- a/src/layout/components/asider.vue +++ b/src/layout/components/asider.vue @@ -353,14 +353,14 @@ export default { icon: "el-icon-sort", route: "/transfer", index: "transfer", - number: "4001500", + number: "5001500", }, { - name: "会员转门店", + name: "疗程转门店", icon: "el-icon-sort", route: "/transferstore", index: "transferstore", - number: "4001600", + number: "5001600", }, // { // name: "收款", @@ -588,14 +588,14 @@ export default { icon: "el-icon-s-order", route: "/managers", index: "managers", - number: "4001200", + number: "6001200", }, { name: "管理层业绩", icon: "el-icon-s-order", route: "/admins", index: "admins", - number: "4001300", + number: "6001300", }, { @@ -603,7 +603,7 @@ export default { icon: "el-icon-s-finance", route: "/dept", index: "dept", - number: "4001400", + number: "6001400", }, // { // name: "员工工资", diff --git a/src/pages/eashier/raiseReatment/components/index.vue b/src/pages/eashier/raiseReatment/components/index.vue index 901725d..e5f9193 100644 --- a/src/pages/eashier/raiseReatment/components/index.vue +++ b/src/pages/eashier/raiseReatment/components/index.vue @@ -113,7 +113,7 @@
- + -
- - - 取 消 确 定 - + - + + \ No newline at end of file diff --git a/src/pages/promotion/components/memberSuit.vue b/src/pages/promotion/components/memberSuit.vue index cf47d7d..f6303b9 100644 --- a/src/pages/promotion/components/memberSuit.vue +++ b/src/pages/promotion/components/memberSuit.vue @@ -16,7 +16,7 @@