部分bug修复
parent
25748231ff
commit
17be547c16
@ -1,140 +1,124 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :close-on-click-modal="false" v-dialogDrag :title="title" :visible.sync="dialogVisible" width="600px">
|
<el-dialog :close-on-click-modal="false" v-dialogDrag :title="title" :visible.sync="dialogVisible" width="600px">
|
||||||
<el-table @row-dblclick="confirms" :data="list" @row-click="rowClick" max-height="600" v-loading="listLoading" :element-loading-text="elementLoadingText">
|
<el-table @row-dblclick="confirms" :data="list" @row-click="rowClick" max-height="600" v-loading="listLoading" :element-loading-text="elementLoadingText">
|
||||||
<el-table-column label="选择" width="60">
|
<el-table-column label="选择" width="60">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-radio v-model="radio" :label="scope.row.id" @change.native="scope.row;">
|
<el-radio v-model="radio" :label="scope.row.id" @change.native="scope.row;">
|
||||||
{{ "" }}
|
{{ "" }}
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" width="100" prop="brandNumber" label="水牌号"></el-table-column>
|
<el-table-column align="center" width="100" prop="brandNumber" label="水牌号"></el-table-column>
|
||||||
<el-table-column align="center" min-width="120" prop="staffName" label="名字"></el-table-column>
|
<el-table-column align="center" min-width="120" prop="staffName" label="名字"></el-table-column>
|
||||||
<el-table-column align="center" min-width="100" prop="jobName" label="工种">
|
<el-table-column align="center" min-width="100" prop="wordTypeName" label="工种"></el-table-column>
|
||||||
<template slot-scope="scope">
|
</el-table>
|
||||||
{{
|
<span slot="footer" class="dialog-footer">
|
||||||
scope.row.job == 1
|
<el-button size="mini" type="primary" plain @click="dialogVisible = false">取 消</el-button>
|
||||||
? "美发师"
|
<el-button size="mini" type="primary" @click="confirms()">确 定
|
||||||
: scope.row.job == 2
|
</el-button>
|
||||||
? "技师"
|
</span>
|
||||||
: scope.row.job == 3
|
</el-dialog>
|
||||||
? "助理"
|
</template>
|
||||||
: scope.row.job == 4
|
|
||||||
? "收银员"
|
<script>
|
||||||
: scope.row.job == 5
|
import { selectList } from "@/api/eashier.js";
|
||||||
? "美容师"
|
export default {
|
||||||
: "暂无"
|
data() {
|
||||||
}}
|
return {
|
||||||
</template>
|
radio: null, //单选值
|
||||||
</el-table-column>
|
radioForm: {}, //单选对象
|
||||||
</el-table>
|
list: [], //主数组
|
||||||
<span slot="footer" class="dialog-footer">
|
dialogVisible: false, //弹窗开关 //弹窗开关
|
||||||
<el-button size="mini" type="primary" plain @click="dialogVisible = false">取 消</el-button>
|
elementLoadingText: "数据加载中...", //list加载提示文字 //列表加载提示文字
|
||||||
<el-button size="mini" type="primary" @click="confirms()">确 定
|
listLoading: false, //list加载提示开启动画 //列表加载提示动画
|
||||||
</el-button>
|
title: "选择员工", //弹窗标题
|
||||||
</span>
|
selectNumber: 0, //员工类型 0正常员工 1业务人员 2管理者
|
||||||
</el-dialog>
|
staffList: [], //员工数据数组
|
||||||
</template>
|
};
|
||||||
|
},
|
||||||
<script>
|
methods: {
|
||||||
import { selectList } from "@/api/eashier.js";
|
//组件传值
|
||||||
export default {
|
show(number, title, list) {
|
||||||
data() {
|
//number 0正常 1 业务 2管理者
|
||||||
return {
|
//list 有值需要说明需要列表去除
|
||||||
radio: null, //单选值
|
this.staffList = [];
|
||||||
radioForm: {}, //单选对象
|
if (title) {
|
||||||
list: [], //主数组
|
this.title = title;
|
||||||
dialogVisible: false, //弹窗开关 //弹窗开关
|
}
|
||||||
elementLoadingText: "数据加载中...", //list加载提示文字 //列表加载提示文字
|
if (list) {
|
||||||
listLoading: false, //list加载提示开启动画 //列表加载提示动画
|
this.staffList = list;
|
||||||
title: "选择员工", //弹窗标题
|
}
|
||||||
selectNumber: 0, //员工类型 0正常员工 1业务人员 2管理者
|
this.selectNumber = number;
|
||||||
staffList: [], //员工数据数组
|
this.list = [];
|
||||||
};
|
this.radio = null;
|
||||||
},
|
this.radioForm = {};
|
||||||
methods: {
|
this.dialogVisible = true;
|
||||||
//组件传值
|
console.log(this.staffList);
|
||||||
show(number, title, list) {
|
this.getData();
|
||||||
//number 0正常 1 业务 2管理者
|
},
|
||||||
//list 有值需要说明需要列表去除
|
//单击选中员工
|
||||||
this.staffList = [];
|
//点击选中
|
||||||
if (title) {
|
rowClick(row) {
|
||||||
this.title = title;
|
this.radio = row.id;
|
||||||
}
|
this.radioForm = row;
|
||||||
if (list) {
|
},
|
||||||
this.staffList = list;
|
//获取员工数据
|
||||||
}
|
//获取数据
|
||||||
this.selectNumber = number;
|
async getData() {
|
||||||
this.list = [];
|
this.listLoading = true;
|
||||||
this.radio = null;
|
let form = { id: "" };
|
||||||
this.radioForm = {};
|
if (this.staffName) {
|
||||||
this.dialogVisible = true;
|
form.staffName = this.staffName;
|
||||||
console.log(this.staffList);
|
}
|
||||||
this.getData();
|
selectList(form).then((res) => {
|
||||||
},
|
this.listLoading = false;
|
||||||
//单击选中员工
|
if (res.code == "000000") {
|
||||||
//点击选中
|
if (this.staffList.length == 0) {
|
||||||
rowClick(row) {
|
this.list = res.rows;
|
||||||
this.radio = row.id;
|
} else {
|
||||||
this.radioForm = row;
|
var list = [];
|
||||||
},
|
res.rows.forEach((item) => {
|
||||||
//获取员工数据
|
this.staffList.forEach((items) => {
|
||||||
//获取数据
|
if (item.id == items.id) {
|
||||||
async getData() {
|
} else {
|
||||||
this.listLoading = true;
|
list.push(item);
|
||||||
let form = { id: "" };
|
}
|
||||||
if (this.staffName) {
|
});
|
||||||
form.staffName = this.staffName;
|
});
|
||||||
}
|
this.list = Array.from(new Set(list));
|
||||||
selectList(form).then((res) => {
|
}
|
||||||
this.listLoading = false;
|
} else {
|
||||||
if (res.code == "000000") {
|
this.$alert(res.message, "提示", {
|
||||||
if (this.staffList.length == 0) {
|
confirmButtonText: "确定",
|
||||||
this.list = res.rows;
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
} else {
|
type: "warning",
|
||||||
var list = [];
|
center: true,
|
||||||
res.rows.forEach((item) => {
|
callback: (action) => {},
|
||||||
this.staffList.forEach((items) => {
|
});
|
||||||
if (item.id == items.id) {
|
}
|
||||||
} else {
|
});
|
||||||
list.push(item);
|
},
|
||||||
}
|
//确定返回方法
|
||||||
});
|
confirms() {
|
||||||
});
|
if (this.selectNumber == 1) {
|
||||||
this.list = Array.from(new Set(list));
|
this.radioForm.saleStaffName = this.radioForm.staffName;
|
||||||
}
|
this.radioForm.saleStaffId = this.radioForm.id;
|
||||||
} else {
|
this.radioForm.saleIdentityCard = this.radioForm.identityCard;
|
||||||
this.$alert(res.message, "提示", {
|
this.radioForm.saleRatio = 0;
|
||||||
confirmButtonText: "确定",
|
}
|
||||||
confirmButtonClass: "confirmbtnFalses",
|
if (this.selectNumber == 2) {
|
||||||
type: "warning",
|
this.radioForm.manageStaffName = this.radioForm.staffName;
|
||||||
center: true,
|
this.radioForm.manageStaffId = this.radioForm.id;
|
||||||
callback: (action) => {},
|
this.radioForm.manageIdentityCard = this.radioForm.identityCard;
|
||||||
});
|
this.radioForm.manageBrandNumber = this.radioForm.brandNumber;
|
||||||
}
|
}
|
||||||
});
|
this.radioForm.ratioShow = false;
|
||||||
},
|
this.$emit("staffData", this.radioForm);
|
||||||
//确定返回方法
|
this.dialogVisible = false;
|
||||||
confirms() {
|
},
|
||||||
if (this.selectNumber == 1) {
|
},
|
||||||
this.radioForm.saleStaffName = this.radioForm.staffName;
|
};
|
||||||
this.radioForm.saleStaffId = this.radioForm.id;
|
</script>
|
||||||
this.radioForm.saleIdentityCard = this.radioForm.identityCard;
|
|
||||||
this.radioForm.saleRatio = 0;
|
<style>
|
||||||
}
|
</style>
|
||||||
if (this.selectNumber == 2) {
|
|
||||||
this.radioForm.manageStaffName = this.radioForm.staffName;
|
|
||||||
this.radioForm.manageStaffId = this.radioForm.id;
|
|
||||||
this.radioForm.manageIdentityCard = this.radioForm.identityCard;
|
|
||||||
this.radioForm.manageBrandNumber = this.radioForm.brandNumber;
|
|
||||||
}
|
|
||||||
this.radioForm.ratioShow = false;
|
|
||||||
this.$emit("staffData", this.radioForm);
|
|
||||||
this.dialogVisible = false;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
</style>
|
|
||||||
|
|||||||
@ -1,178 +1,180 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="width: 300px;overflow: hidden;" class="border-radius-10 border margin-right-xs bg-white">
|
<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">
|
<el-table :data="staffLists" max-height="300" class="margin-xs" style="width:280px">
|
||||||
<el-table-column align="left" prop="brandNumber" label="水牌号--管理员名字" min-width="180">
|
<el-table-column align="left" prop="brandNumber" label="水牌号--管理员名字" min-width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-select style="width:180px" v-model="scope.row.staffNames" clearable @clear="clear" no-match-text="重新选择管理员" placeholder="请选择" @change="ratioChange($event,scope.$index)" filterable default-first-option>
|
<el-select style="width:180px" v-model="scope.row.staffNames" clearable @clear="clear" 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 v-for="(item,index) in staffList" :key="index" :label="item.brandNumber+'--'+ item.staffName" :value="item.id">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" prop="ratio" label="占比(%)" width="80">
|
<el-table-column align="center" prop="ratio" label="占比(%)" width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div class="form-input-width" v-if="editIndex!=scope.$index" @click="openStaffRatio(scope.$index, scope.row)">
|
<div class="form-input-width" v-if="editIndex!=scope.$index" @click="openStaffRatio(scope.$index, scope.row)">
|
||||||
{{ scope.row.ratio }}
|
{{ scope.row.ratio }}
|
||||||
<i class="el-icon-edit text-cyan" v-if="scope.$index!=0"></i>
|
<i class="el-icon-edit text-cyan" v-if="scope.$index!=0"></i>
|
||||||
</div>
|
</div>
|
||||||
<el-input v-focus class="form-input-width-xs" size="samll" type="number" oninput="this.value=this.value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3')" pattern="[0-9]*\.?[0-9]{0,2}" v-else v-model="scope.row.ratio" @blur="endStaffRatio(scope.row, scope.$index)"></el-input>
|
<el-input v-focus class="form-input-width-xs" size="samll" type="number" oninput="this.value=this.value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3')" pattern="[0-9]*\.?[0-9]{0,2}" v-else v-model="scope.row.ratio" @blur="endStaffRatio(scope.row, scope.$index)"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div style="width: 150px;margin:10px auto;" class="flex justify-between align-center">
|
<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="info" :disabled="staffLists.length == 0" @click="delsalesman">撤销</el-button>
|
||||||
<el-button size="mini" type="primary" plain @click="(staffLists.push({brandNumber:'',staffName:'',ratio:0}))">增加</el-button>
|
<el-button size="mini" type="primary" plain @click="(staffLists.push({brandNumber:'',staffName:'',ratio:0}))">增加</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { selectListType } from "@/api/eashier.js";
|
import { selectListType } from "@/api/eashier.js";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
staffList: [], //选择员工数组
|
staffList: [], //选择员工数组
|
||||||
staffLists: [{ ratio: 100 }], //员工占比初始化 //主员工数组
|
staffLists: [{ ratio: 100 }], //员工占比初始化 //主员工数组
|
||||||
editIndex: -1, //员工占比修改下标
|
editIndex: -1, //员工占比修改下标
|
||||||
staffListCopy: [], //复制选择员工数组
|
staffListCopy: [], //复制选择员工数组
|
||||||
storeId: null, //当前门店id
|
storeId: null, //当前门店id
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//删除当前选择
|
//删除当前选择
|
||||||
clear() {
|
clear() {
|
||||||
this.staffLists = [{ ratio: 100 }];
|
this.staffLists = [
|
||||||
this.changeStaff();
|
{ staffNames: "", brandNumber: "", staffName: "", ratio: 100 },
|
||||||
this.confirm();
|
];
|
||||||
},
|
this.changeStaff();
|
||||||
//下拉选择方法
|
this.confirm();
|
||||||
ratioChange(v, index) {
|
},
|
||||||
this.staffList.forEach((item) => {
|
//下拉选择方法
|
||||||
if (item.id == v) {
|
ratioChange(v, index) {
|
||||||
item.ratio = this.staffLists[index].ratio;
|
this.staffList.forEach((item) => {
|
||||||
item.staffNames = item.brandNumber + "--" + item.staffName;
|
if (item.id == v) {
|
||||||
this.staffLists.splice(index, 1, item);
|
item.ratio = this.staffLists[index].ratio;
|
||||||
}
|
item.staffNames = item.brandNumber + "--" + item.staffName;
|
||||||
});
|
this.staffLists.splice(index, 1, item);
|
||||||
this.confirm();
|
}
|
||||||
this.changeStaff();
|
});
|
||||||
},
|
this.confirm();
|
||||||
//打开员工修改输入框
|
this.changeStaff();
|
||||||
openStaffRatio(index, row) {
|
},
|
||||||
if (index != 0 || row.ratio * 1 != 100) {
|
//打开员工修改输入框
|
||||||
let form = { ...row };
|
openStaffRatio(index, row) {
|
||||||
this.editIndex = index;
|
if (index != 0 || row.ratio * 1 != 100) {
|
||||||
this.staffLists.splice(index, 1, form);
|
let form = { ...row };
|
||||||
}
|
this.editIndex = index;
|
||||||
},
|
this.staffLists.splice(index, 1, form);
|
||||||
//关闭员工修改输入框
|
}
|
||||||
endStaffRatio(row, index) {
|
},
|
||||||
let num = 0;
|
//关闭员工修改输入框
|
||||||
if (index != 0) {
|
endStaffRatio(row, index) {
|
||||||
this.staffLists.forEach((item, i) => {
|
let num = 0;
|
||||||
if (i != 0) {
|
if (index != 0) {
|
||||||
num += item.ratio * 1;
|
this.staffLists.forEach((item, i) => {
|
||||||
}
|
if (i != 0) {
|
||||||
});
|
num += item.ratio * 1;
|
||||||
this.staffLists[0].ratio = 100 - num;
|
}
|
||||||
if (this.staffLists[0].ratio < 1) {
|
});
|
||||||
this.$message.error({
|
this.staffLists[0].ratio = 100 - num;
|
||||||
message: "第一位员工占比过低",
|
if (this.staffLists[0].ratio < 1) {
|
||||||
});
|
this.$message.error({
|
||||||
} else {
|
message: "第一位员工占比过低",
|
||||||
if (!row.ratio) {
|
});
|
||||||
row.ratio = 0;
|
} else {
|
||||||
} else {
|
if (!row.ratio) {
|
||||||
row.ratio = row.ratio * 1;
|
row.ratio = 0;
|
||||||
}
|
} else {
|
||||||
let form = this.staffLists[index];
|
row.ratio = row.ratio * 1;
|
||||||
this.staffLists.splice(index, 1, form);
|
}
|
||||||
}
|
let form = this.staffLists[index];
|
||||||
this.editIndex = -1;
|
this.staffLists.splice(index, 1, form);
|
||||||
}
|
}
|
||||||
this.confirm();
|
this.editIndex = -1;
|
||||||
this.changeStaff();
|
}
|
||||||
},
|
this.confirm();
|
||||||
//撤销增加员工
|
this.changeStaff();
|
||||||
delsalesman() {
|
},
|
||||||
let index = this.staffLists.length - 1;
|
//撤销增加员工
|
||||||
if (index == 0) {
|
delsalesman() {
|
||||||
this.$message.warning({ message: "第一行员工只能修改" });
|
let index = this.staffLists.length - 1;
|
||||||
} else {
|
if (index == 0) {
|
||||||
let ratio = this.staffLists[index].ratio;
|
this.$message.warning({ message: "第一行员工只能修改" });
|
||||||
this.staffLists[0].ratio += ratio;
|
} else {
|
||||||
this.staffLists.splice(index, 1);
|
let ratio = this.staffLists[index].ratio;
|
||||||
}
|
this.staffLists[0].ratio += ratio;
|
||||||
this.confirm();
|
this.staffLists.splice(index, 1);
|
||||||
this.changeStaff();
|
}
|
||||||
},
|
this.confirm();
|
||||||
//组件传值
|
this.changeStaff();
|
||||||
show(list, storeId) {
|
},
|
||||||
this.staffLists = [...list];
|
//组件传值
|
||||||
if (storeId) {
|
show(list, storeId) {
|
||||||
this.storeId = storeId;
|
this.staffLists = [...list];
|
||||||
}
|
if (storeId) {
|
||||||
this.getData();
|
this.storeId = storeId;
|
||||||
},
|
}
|
||||||
//确定返回方法
|
this.getData();
|
||||||
confirm() {
|
},
|
||||||
let list = [];
|
//确定返回方法
|
||||||
this.staffLists.forEach((item) => {
|
confirm() {
|
||||||
let items = {
|
let list = [];
|
||||||
id: item.id,
|
this.staffLists.forEach((item) => {
|
||||||
ratio: item.ratio,
|
let items = {
|
||||||
brandNumber: item.brandNumber,
|
id: item.id,
|
||||||
staffName: item.staffName,
|
ratio: item.ratio,
|
||||||
identityCard: item.identityCard,
|
brandNumber: item.brandNumber,
|
||||||
storeId: item.storeId,
|
staffName: item.staffName,
|
||||||
storeName: item.storeName,
|
identityCard: item.identityCard,
|
||||||
staffType: 1,
|
storeId: item.storeId,
|
||||||
staffNames: item.brandNumber + "--" + item.staffName,
|
storeName: item.storeName,
|
||||||
};
|
staffType: 1,
|
||||||
list.push(items);
|
staffNames: item.brandNumber + "--" + item.staffName,
|
||||||
});
|
};
|
||||||
this.$emit("adminData", list);
|
list.push(items);
|
||||||
},
|
});
|
||||||
//改变员工 去除未选择员工列表中的员工
|
this.$emit("adminData", list);
|
||||||
changeStaff() {
|
},
|
||||||
var that = this;
|
//改变员工 去除未选择员工列表中的员工
|
||||||
var list = that.staffLists
|
changeStaff() {
|
||||||
.concat(that.staffListCopy)
|
var that = this;
|
||||||
.filter(function (v) {
|
var list = that.staffLists
|
||||||
return (
|
.concat(that.staffListCopy)
|
||||||
that.staffLists.indexOf(v) === -1 ||
|
.filter(function (v) {
|
||||||
that.staffListCopy.indexOf(v) === -1
|
return (
|
||||||
);
|
that.staffLists.indexOf(v) === -1 ||
|
||||||
});
|
that.staffListCopy.indexOf(v) === -1
|
||||||
this.staffList = list;
|
);
|
||||||
},
|
});
|
||||||
//获取员工数据
|
this.staffList = list;
|
||||||
//获取数据
|
},
|
||||||
async getData() {
|
//获取员工数据
|
||||||
let form = { type: 0 };
|
//获取数据
|
||||||
if (this.storeId) {
|
async getData() {
|
||||||
form.storeId = this.storeId;
|
let form = { type: 0 };
|
||||||
}
|
if (this.storeId) {
|
||||||
selectListType(form).then((res) => {
|
form.storeId = this.storeId;
|
||||||
if (res.code == "000000") {
|
}
|
||||||
res.rows.forEach((item) => {
|
selectListType(form).then((res) => {
|
||||||
item.editStaffRatioShow = false;
|
if (res.code == "000000") {
|
||||||
});
|
res.rows.forEach((item) => {
|
||||||
this.staffList = res.rows;
|
item.editStaffRatioShow = false;
|
||||||
this.staffListCopy = res.rows;
|
});
|
||||||
} else {
|
this.staffList = res.rows;
|
||||||
this.$alert(res.message, "加载员工提示", {
|
this.staffListCopy = res.rows;
|
||||||
confirmButtonText: "确定",
|
} else {
|
||||||
confirmButtonClass: "confirmbtnFalses",
|
this.$alert(res.message, "加载员工提示", {
|
||||||
type: "warning",
|
confirmButtonText: "确定",
|
||||||
center: true,
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
callback: (action) => {},
|
type: "warning",
|
||||||
});
|
center: true,
|
||||||
}
|
callback: (action) => {},
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
},
|
});
|
||||||
};
|
},
|
||||||
</script>
|
},
|
||||||
|
};
|
||||||
<style>
|
</script>
|
||||||
</style>
|
|
||||||
|
<style>
|
||||||
|
</style>
|
||||||
|
|||||||
@ -1,167 +1,167 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="width: 300px;overflow: hidden;" class="border-radius-10 border bg-white">
|
<div style="width: 300px;overflow: hidden;" class="border-radius-10 border bg-white">
|
||||||
<el-table :data="staffLists" max-height="300" class="margin-xs" style="width:280px">
|
<el-table :data="staffLists" max-height="300" class="margin-xs" style="width:280px">
|
||||||
<el-table-column align="left" prop="brandNumber" label="水牌号--高管名字" min-width="180">
|
<el-table-column align="left" prop="brandNumber" label="水牌号--高管名字" min-width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-select style="width:180px" v-model="scope.row.staffNames" clearable @clear="clear" no-match-text="重新选择高管" placeholder="请选择" @change="ratioChange($event,scope.$index)" filterable default-first-option>
|
<el-select style="width:180px" v-model="scope.row.staffNames" clearable @clear="clear" 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 v-for="(item,index) in staffList" :key="index" :label="item.brandNumber+'--'+ item.staffName" :value="item.id">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" prop="ratio" label="占比(%)" width="80">
|
<el-table-column align="center" prop="ratio" label="占比(%)" width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div class="form-input-width" v-if="editIndex!=scope.$index" @click="openStaffRatio(scope.$index, scope.row)">
|
<div class="form-input-width" v-if="editIndex!=scope.$index" @click="openStaffRatio(scope.$index, scope.row)">
|
||||||
{{ scope.row.ratio }}
|
{{ scope.row.ratio }}
|
||||||
<i class="el-icon-edit text-cyan" v-if="scope.$index!=0"></i>
|
<i class="el-icon-edit text-cyan" v-if="scope.$index!=0"></i>
|
||||||
</div>
|
</div>
|
||||||
<el-input v-focus class="form-input-width-xs" size="samll" type="number" oninput="this.value=this.value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3')" pattern="[0-9]*\.?[0-9]{0,2}" v-else v-model="scope.row.ratio" @blur="endStaffRatio(scope.row, scope.$index)"></el-input>
|
<el-input v-focus class="form-input-width-xs" size="samll" type="number" oninput="this.value=this.value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3')" pattern="[0-9]*\.?[0-9]{0,2}" v-else v-model="scope.row.ratio" @blur="endStaffRatio(scope.row, scope.$index)"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div style="width: 150px;margin:10px auto;" class="flex justify-between align-center">
|
<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="info" :disabled="staffLists.length == 0" @click="delsalesman">撤销</el-button>
|
||||||
<el-button size="mini" type="primary" plain @click="(staffLists.push({brandNumber:'',staffName:'',ratio:0}))">增加</el-button>
|
<el-button size="mini" type="primary" plain @click="(staffLists.push({brandNumber:'',staffName:'',ratio:0}))">增加</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { QuerCompetent } from "@/api/eashier.js";
|
import { QuerCompetent } from "@/api/eashier.js";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
staffList: [], //选择员工数组
|
staffList: [], //选择员工数组
|
||||||
staffLists: [{ ratio: 100 }], //员工占比初始化 //主员工数组
|
staffLists: [{ ratio: 100 }], //员工占比初始化 //主员工数组
|
||||||
editIndex: -1, //员工占比修改下标
|
editIndex: -1, //员工占比修改下标
|
||||||
staffListCopy: [], //复制选择员工数组
|
staffListCopy: [], //复制选择员工数组
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//删除当前选择
|
//删除当前选择
|
||||||
clear() {
|
clear() {
|
||||||
this.staffLists = [{ ratio: 100 }];
|
this.staffLists = [{ brandNumber: "", staffName: "", ratio: 100 }];
|
||||||
this.changeStaff();
|
this.changeStaff();
|
||||||
this.confirm();
|
this.confirm();
|
||||||
},
|
},
|
||||||
//下拉选择方法
|
//下拉选择方法
|
||||||
ratioChange(v, index) {
|
ratioChange(v, index) {
|
||||||
this.staffList.forEach((item) => {
|
this.staffList.forEach((item) => {
|
||||||
if (item.id == v) {
|
if (item.id == v) {
|
||||||
item.ratio = this.staffLists[index].ratio;
|
item.ratio = this.staffLists[index].ratio;
|
||||||
item.staffNames = item.brandNumber + "--" + item.staffName;
|
item.staffNames = item.brandNumber + "--" + item.staffName;
|
||||||
this.staffLists.splice(index, 1, item);
|
this.staffLists.splice(index, 1, item);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.confirm();
|
this.confirm();
|
||||||
this.changeStaff();
|
this.changeStaff();
|
||||||
},
|
},
|
||||||
//打开员工修改输入框
|
//打开员工修改输入框
|
||||||
openStaffRatio(index, row) {
|
openStaffRatio(index, row) {
|
||||||
if (index != 0 || row.ratio * 1 != 100) {
|
if (index != 0 || row.ratio * 1 != 100) {
|
||||||
let form = { ...row };
|
let form = { ...row };
|
||||||
this.editIndex = index;
|
this.editIndex = index;
|
||||||
this.staffLists.splice(index, 1, form);
|
this.staffLists.splice(index, 1, form);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//关闭员工修改输入框
|
//关闭员工修改输入框
|
||||||
endStaffRatio(row, index) {
|
endStaffRatio(row, index) {
|
||||||
let num = 0;
|
let num = 0;
|
||||||
if (index != 0) {
|
if (index != 0) {
|
||||||
this.staffLists.forEach((item, i) => {
|
this.staffLists.forEach((item, i) => {
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
num += item.ratio * 1;
|
num += item.ratio * 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.staffLists[0].ratio = 100 - num;
|
this.staffLists[0].ratio = 100 - num;
|
||||||
if (this.staffLists[0].ratio < 1) {
|
if (this.staffLists[0].ratio < 1) {
|
||||||
this.$message.error({
|
this.$message.error({
|
||||||
message: "第一位占比过低",
|
message: "第一位占比过低",
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (!row.ratio) {
|
if (!row.ratio) {
|
||||||
row.ratio = 0;
|
row.ratio = 0;
|
||||||
} else {
|
} else {
|
||||||
row.ratio = row.ratio * 1;
|
row.ratio = row.ratio * 1;
|
||||||
}
|
}
|
||||||
let form = this.staffLists[index];
|
let form = this.staffLists[index];
|
||||||
this.editIndex = -1;
|
this.editIndex = -1;
|
||||||
this.staffLists.splice(index, 1, form);
|
this.staffLists.splice(index, 1, form);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.confirm();
|
this.confirm();
|
||||||
this.changeStaff();
|
this.changeStaff();
|
||||||
},
|
},
|
||||||
//撤销增加员工
|
//撤销增加员工
|
||||||
delsalesman() {
|
delsalesman() {
|
||||||
let index = this.staffLists.length - 1;
|
let index = this.staffLists.length - 1;
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
this.$message.warning({ message: "第一行员工只能修改" });
|
this.$message.warning({ message: "第一行员工只能修改" });
|
||||||
} else {
|
} else {
|
||||||
let ratio = this.staffLists[index].ratio;
|
let ratio = this.staffLists[index].ratio;
|
||||||
this.staffLists[0].ratio += ratio;
|
this.staffLists[0].ratio += ratio;
|
||||||
this.staffLists.splice(index, 1);
|
this.staffLists.splice(index, 1);
|
||||||
}
|
}
|
||||||
this.confirm();
|
this.confirm();
|
||||||
this.changeStaff();
|
this.changeStaff();
|
||||||
},
|
},
|
||||||
//组件传值
|
//组件传值
|
||||||
show(list) {
|
show(list) {
|
||||||
this.staffLists = [...list];
|
this.staffLists = [...list];
|
||||||
this.getData();
|
this.getData();
|
||||||
},
|
},
|
||||||
//确定返回方法
|
//确定返回方法
|
||||||
confirm() {
|
confirm() {
|
||||||
let list = [];
|
let list = [];
|
||||||
this.staffLists.forEach((item) => {
|
this.staffLists.forEach((item) => {
|
||||||
let items = {
|
let items = {
|
||||||
id: item.id,
|
id: item.id,
|
||||||
ratio: item.ratio,
|
ratio: item.ratio,
|
||||||
brandNumber: item.brandNumber,
|
brandNumber: item.brandNumber,
|
||||||
staffName: item.staffName,
|
staffName: item.staffName,
|
||||||
identityCard: item.identityCard,
|
identityCard: item.identityCard,
|
||||||
storeId: item.storeId,
|
storeId: item.storeId,
|
||||||
storeName: item.storeName,
|
storeName: item.storeName,
|
||||||
staffNames: item.brandNumber + "--" + item.staffName,
|
staffNames: item.brandNumber + "--" + item.staffName,
|
||||||
staffType: 0,
|
staffType: 0,
|
||||||
};
|
};
|
||||||
list.push(items);
|
list.push(items);
|
||||||
});
|
});
|
||||||
this.$emit("managerData", list);
|
this.$emit("managerData", list);
|
||||||
},
|
},
|
||||||
//改变员工 去除未选择员工列表中的员工
|
//改变员工 去除未选择员工列表中的员工
|
||||||
changeStaff() {
|
changeStaff() {
|
||||||
var that = this;
|
var that = this;
|
||||||
var list = that.staffLists
|
var list = that.staffLists
|
||||||
.concat(that.staffListCopy)
|
.concat(that.staffListCopy)
|
||||||
.filter(function (v) {
|
.filter(function (v) {
|
||||||
return (
|
return (
|
||||||
that.staffLists.indexOf(v) === -1 ||
|
that.staffLists.indexOf(v) === -1 ||
|
||||||
that.staffListCopy.indexOf(v) === -1
|
that.staffListCopy.indexOf(v) === -1
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
this.staffList = list;
|
this.staffList = list;
|
||||||
},
|
},
|
||||||
//获取高管数据
|
//获取高管数据
|
||||||
//获取数据
|
//获取数据
|
||||||
async getData() {
|
async getData() {
|
||||||
QuerCompetent({ type: 0, pageSize: 999 }).then((res) => {
|
QuerCompetent({ type: 0, pageSize: 999 }).then((res) => {
|
||||||
if (res.code == "000000") {
|
if (res.code == "000000") {
|
||||||
this.staffList = res.pageInfo.list;
|
this.staffList = res.pageInfo.list;
|
||||||
this.staffListCopy = res.pageInfo.list;
|
this.staffListCopy = res.pageInfo.list;
|
||||||
} else {
|
} else {
|
||||||
this.$alert(res.message, "加载高管提示", {
|
this.$alert(res.message, "加载高管提示", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
confirmButtonClass: "confirmbtnFalses",
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
center: true,
|
center: true,
|
||||||
callback: (action) => {},
|
callback: (action) => {},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,180 +1,180 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="width: 300px;overflow: hidden;" class="border-radius-10 border margin-right-xs bg-white ">
|
<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">
|
<el-table :data="staffLists" max-height="300" class="margin-xs" style="width:280px">
|
||||||
<el-table-column align="left" prop="brandNumber" label="水牌号--员工名字" min-width="180">
|
<el-table-column align="left" prop="brandNumber" label="水牌号--员工名字" min-width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-select style="width:180px" v-model="scope.row.staffNames" clearable @clear="clear" no-match-text="重新选择员工" placeholder="请选择" @change="ratioChange($event,scope.$index)" filterable default-first-option>
|
<el-select style="width:180px" v-model="scope.row.staffNames" clearable @clear="clear" 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 v-for="(item,index) in staffList" :key="index" :label="item.brandNumber+'--'+ item.staffName" :value="item.id">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" prop="ratio" label="占比(%)" width="80">
|
<el-table-column align="center" prop="ratio" label="占比(%)" width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div class="form-input-width" v-if="editIndex!=scope.$index" @click="openStaffRatio(scope.$index, scope.row)">
|
<div class="form-input-width" v-if="editIndex!=scope.$index" @click="openStaffRatio(scope.$index, scope.row)">
|
||||||
{{ scope.row.ratio }}
|
{{ scope.row.ratio }}
|
||||||
<i class="el-icon-edit text-cyan" v-if="scope.$index!=0"></i>
|
<i class="el-icon-edit text-cyan" v-if="scope.$index!=0"></i>
|
||||||
</div>
|
</div>
|
||||||
<el-input v-focus class="form-input-width-xs" size="samll" type="number" oninput="this.value=this.value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3')" pattern="[0-9]*\.?[0-9]{0,2}" v-else v-model="scope.row.ratio" @blur="endStaffRatio(scope.row, scope.$index)"></el-input>
|
<el-input v-focus class="form-input-width-xs" size="samll" type="number" oninput="this.value=this.value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3')" pattern="[0-9]*\.?[0-9]{0,2}" v-else v-model="scope.row.ratio" @blur="endStaffRatio(scope.row, scope.$index)"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div style="width: 150px;margin:10px auto;" class="flex justify-between align-center">
|
<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="info" :disabled="staffLists.length == 0" @click="delsalesman">撤销</el-button>
|
||||||
<el-button size="mini" type="primary" plain @click="(staffLists.push({brandNumber:'',staffName:'',ratio:0}))">增加</el-button>
|
<el-button size="mini" type="primary" plain @click="(staffLists.push({brandNumber:'',staffName:'',ratio:0}))">增加</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { selectList } from "@/api/eashier.js";
|
import { selectList } from "@/api/eashier.js";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
staffList: [], //选择员工数组
|
staffList: [], //选择员工数组
|
||||||
staffLists: [{ ratio: 100 }], //员工占比初始化 //主员工数组
|
staffLists: [{ ratio: 100 }], //员工占比初始化 //主员工数组
|
||||||
editIndex: -1, //员工占比修改下标
|
editIndex: -1, //员工占比修改下标
|
||||||
staffListCopy: [], //复制选择员工数组
|
staffListCopy: [], //复制选择员工数组
|
||||||
storeId: null, //当前门店id
|
storeId: null, //当前门店id
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//下拉选择方法
|
//下拉选择方法
|
||||||
ratioChange(v, index) {
|
ratioChange(v, index) {
|
||||||
this.staffList.forEach((item) => {
|
this.staffList.forEach((item) => {
|
||||||
if (item.id == v) {
|
if (item.id == v) {
|
||||||
item.ratio = this.staffLists[index].ratio;
|
item.ratio = this.staffLists[index].ratio;
|
||||||
item.staffNames = item.brandNumber + "--" + item.staffName;
|
item.staffNames = item.brandNumber + "--" + item.staffName;
|
||||||
this.staffLists.splice(index, 1, item);
|
this.staffLists.splice(index, 1, item);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.changeStaff();
|
this.changeStaff();
|
||||||
this.confirm();
|
this.confirm();
|
||||||
},
|
},
|
||||||
//删除当前选择
|
//删除当前选择
|
||||||
clear() {
|
clear() {
|
||||||
this.staffLists = [{ ratio: 100 }];
|
this.staffLists = [{ brandNumber: "", staffName: "", ratio: 100 }];
|
||||||
this.changeStaff();
|
this.changeStaff();
|
||||||
this.confirm();
|
this.confirm();
|
||||||
},
|
},
|
||||||
//打开员工修改输入框
|
//打开员工修改输入框
|
||||||
openStaffRatio(index, row) {
|
openStaffRatio(index, row) {
|
||||||
if (index != 0 || row.ratio * 1 != 100) {
|
if (index != 0 || row.ratio * 1 != 100) {
|
||||||
let form = { ...row };
|
let form = { ...row };
|
||||||
this.editIndex = index;
|
this.editIndex = index;
|
||||||
this.staffLists.splice(index, 1, form);
|
this.staffLists.splice(index, 1, form);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//关闭员工修改输入框
|
//关闭员工修改输入框
|
||||||
endStaffRatio(row, index) {
|
endStaffRatio(row, index) {
|
||||||
let num = 0;
|
let num = 0;
|
||||||
if (index != 0) {
|
if (index != 0) {
|
||||||
this.staffLists.forEach((item, i) => {
|
this.staffLists.forEach((item, i) => {
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
num += item.ratio * 1;
|
num += item.ratio * 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.staffLists[0].ratio = 100 - num;
|
this.staffLists[0].ratio = 100 - num;
|
||||||
if (this.staffLists[0].ratio < 1) {
|
if (this.staffLists[0].ratio < 1) {
|
||||||
this.$message.error({
|
this.$message.error({
|
||||||
message: "第一位员工占比过低",
|
message: "第一位员工占比过低",
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (!row.ratio) {
|
if (!row.ratio) {
|
||||||
row.ratio = 0;
|
row.ratio = 0;
|
||||||
} else {
|
} else {
|
||||||
row.ratio = row.ratio * 1;
|
row.ratio = row.ratio * 1;
|
||||||
}
|
}
|
||||||
let form = this.staffLists[index];
|
let form = this.staffLists[index];
|
||||||
this.editIndex = -1;
|
this.editIndex = -1;
|
||||||
this.staffLists.splice(index, 1, form);
|
this.staffLists.splice(index, 1, form);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.changeStaff();
|
this.changeStaff();
|
||||||
this.confirm();
|
this.confirm();
|
||||||
},
|
},
|
||||||
//撤销增加员工
|
//撤销增加员工
|
||||||
delsalesman() {
|
delsalesman() {
|
||||||
let index = this.staffLists.length - 1;
|
let index = this.staffLists.length - 1;
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
this.$message.warning({ message: "第一行员工只能修改" });
|
this.$message.warning({ message: "第一行员工只能修改" });
|
||||||
} else {
|
} else {
|
||||||
let ratio = this.staffLists[index].ratio;
|
let ratio = this.staffLists[index].ratio;
|
||||||
this.staffLists[0].ratio += ratio;
|
this.staffLists[0].ratio += ratio;
|
||||||
this.staffLists.splice(index, 1);
|
this.staffLists.splice(index, 1);
|
||||||
}
|
}
|
||||||
this.changeStaff();
|
this.changeStaff();
|
||||||
this.confirm();
|
this.confirm();
|
||||||
},
|
},
|
||||||
//组件传值
|
//组件传值
|
||||||
show(list, storeId) {
|
show(list, storeId) {
|
||||||
console.log(list);
|
console.log(list);
|
||||||
this.staffLists = [...list];
|
this.staffLists = [...list];
|
||||||
if (storeId) {
|
if (storeId) {
|
||||||
this.storeId = storeId;
|
this.storeId = storeId;
|
||||||
}
|
}
|
||||||
this.getData();
|
this.getData();
|
||||||
},
|
},
|
||||||
//确定返回方法
|
//确定返回方法
|
||||||
confirm() {
|
confirm() {
|
||||||
let list = [];
|
let list = [];
|
||||||
this.staffLists.forEach((item) => {
|
this.staffLists.forEach((item) => {
|
||||||
let items = {
|
let items = {
|
||||||
id: item.id,
|
id: item.id,
|
||||||
ratio: item.ratio,
|
ratio: item.ratio,
|
||||||
brandNumber: item.brandNumber,
|
brandNumber: item.brandNumber,
|
||||||
staffName: item.staffName,
|
staffName: item.staffName,
|
||||||
identityCard: item.identityCard,
|
identityCard: item.identityCard,
|
||||||
storeId: item.storeId,
|
storeId: item.storeId,
|
||||||
storeName: item.storeName,
|
storeName: item.storeName,
|
||||||
staffNames: item.brandNumber + "--" + item.staffName,
|
staffNames: item.brandNumber + "--" + item.staffName,
|
||||||
staffType: 2,
|
staffType: 2,
|
||||||
};
|
};
|
||||||
list.push(items);
|
list.push(items);
|
||||||
});
|
});
|
||||||
this.$emit("staffslesData", list);
|
this.$emit("staffslesData", list);
|
||||||
},
|
},
|
||||||
//改变员工 去除未选择员工列表中的员工
|
//改变员工 去除未选择员工列表中的员工
|
||||||
changeStaff() {
|
changeStaff() {
|
||||||
var that = this;
|
var that = this;
|
||||||
var list = that.staffLists
|
var list = that.staffLists
|
||||||
.concat(that.staffListCopy)
|
.concat(that.staffListCopy)
|
||||||
.filter(function (v) {
|
.filter(function (v) {
|
||||||
return (
|
return (
|
||||||
that.staffLists.indexOf(v) === -1 ||
|
that.staffLists.indexOf(v) === -1 ||
|
||||||
that.staffListCopy.indexOf(v) === -1
|
that.staffListCopy.indexOf(v) === -1
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
this.staffList = list;
|
this.staffList = list;
|
||||||
},
|
},
|
||||||
//获取员工数据
|
//获取员工数据
|
||||||
//获取数据
|
//获取数据
|
||||||
async getData() {
|
async getData() {
|
||||||
let form = { id: "" };
|
let form = { id: "" };
|
||||||
if (this.storeId) {
|
if (this.storeId) {
|
||||||
form.storeId = this.storeId;
|
form.storeId = this.storeId;
|
||||||
}
|
}
|
||||||
selectList(form).then((res) => {
|
selectList(form).then((res) => {
|
||||||
if (res.code == "000000") {
|
if (res.code == "000000") {
|
||||||
res.rows.forEach((item) => {
|
res.rows.forEach((item) => {
|
||||||
item.editStaffRatioShow = false;
|
item.editStaffRatioShow = false;
|
||||||
});
|
});
|
||||||
this.staffList = res.rows;
|
this.staffList = res.rows;
|
||||||
this.staffListCopy = res.rows;
|
this.staffListCopy = res.rows;
|
||||||
} else {
|
} else {
|
||||||
this.$alert(res.message, "加载员工提示", {
|
this.$alert(res.message, "加载员工提示", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
confirmButtonClass: "confirmbtnFalses",
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
center: true,
|
center: true,
|
||||||
callback: (action) => {},
|
callback: (action) => {},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,171 +1,174 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 门店日报 -->
|
<!-- 门店日报 -->
|
||||||
<div>
|
<div class="bottom-right flex justify-center flex-wrap padding-bottom">
|
||||||
<div class="bottom-right flex justify-center flex-wrap padding-bottom">
|
<el-tooltip effect="dark" :content="'今日客单总数为 ' + form.cashPeopleNum " placement="top">
|
||||||
<el-tooltip effect="dark" :content="'今日客单总数为 ' + form.cashPeopleNum " placement="top">
|
<div class="bottom-right-item text-center">
|
||||||
<div class="bottom-right-item">
|
<div style="width:100%;" class="text-center">
|
||||||
<i class="el-icon-user i"></i>
|
<i class="el-icon-user i"></i>
|
||||||
<br>
|
</div>
|
||||||
<span>客单数</span>
|
<span>客单数</span>
|
||||||
<div class="bottom-right-item-number">{{form.cashPeopleNum}}</div>
|
<div class="bottom-right-item-number">{{form.cashPeopleNum?form.cashPeopleNum:0}}</div>
|
||||||
</div>
|
</div>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip effect="dark" :content="'今日总充值金额 ' + form.rechargeMoney +' , 总共充值人数为 ' +form.rechargeOrderNum" placement="top">
|
<el-tooltip effect="dark" :content="'今日总充值金额 ' + form.rechargeMoney +' , 总共充值人数为 ' +form.rechargeOrderNum" placement="top">
|
||||||
<div class="bottom-right-item">
|
<div class="bottom-right-item">
|
||||||
<i class="el-icon-s-management i"></i>
|
<i class="el-icon-s-management i"></i>
|
||||||
<br>
|
<br>
|
||||||
<span>充值金额</span>
|
<span>充值金额</span>
|
||||||
<div>
|
<div>
|
||||||
<div class="text-red text-price">{{form.rechargeMoney | money}}</div>
|
<div class="text-red text-price">{{form.rechargeMoney | money}}</div>
|
||||||
<div>
|
<div>
|
||||||
<i class=" text-blue el-icon-user-solid bottom-right-item-icon"></i>
|
<i class=" text-blue el-icon-user-solid bottom-right-item-icon"></i>
|
||||||
<div class=" bottom-right-item-icon-number">{{form.rechargeOrderNum}}</div>
|
<div class=" bottom-right-item-icon-number">{{form.rechargeOrderNum}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip effect="dark" :content="'今日总服务金额 ' + form.cashMoney +' , 男客 ' +form.man+'女客'+form.woman" placement="top">
|
<el-tooltip effect="dark" :content="'今日总服务金额 ' + form.cashMoney +' , 男客 ' +form.man+'女客'+form.woman" placement="top">
|
||||||
<div class="bottom-right-item">
|
<div class="bottom-right-item">
|
||||||
<i class="el-icon-s-finance i"></i>
|
<i class="el-icon-s-finance i"></i>
|
||||||
<br>
|
<br>
|
||||||
<span>服务金额</span>
|
<span>服务金额</span>
|
||||||
<div>
|
<div>
|
||||||
<div class="text-red text-price">{{form.cashMoney | money}}</div>
|
<div class="text-red text-price">{{form.cashMoney | money}}</div>
|
||||||
<div>
|
<div>
|
||||||
<i class=" text-blue el-icon-user-solid bottom-right-item-icon"></i>
|
<i class=" text-blue el-icon-user-solid bottom-right-item-icon"></i>
|
||||||
<div class="text-blue bottom-right-item-icon-number">{{form.man}}</div>
|
<div class="text-blue bottom-right-item-icon-number">{{form.man}}</div>
|
||||||
<i class="text-red el-icon-user-solid bottom-right-item-icon"></i>
|
<i class="text-red el-icon-user-solid bottom-right-item-icon"></i>
|
||||||
<div class="text-red bottom-right-item-icon-number">{{form.woman}}</div>
|
<div class="text-red bottom-right-item-icon-number">{{form.woman}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</el-tooltip>
|
||||||
</el-tooltip>
|
<el-tooltip effect="dark" :content="'今日总还款金额 ' + form.repayMoney" placement="top">
|
||||||
<el-tooltip effect="dark" :content="'今日总还款金额 ' + form.repayMoney" placement="top">
|
<div class="bottom-right-item">
|
||||||
<div class="bottom-right-item">
|
<i class="el-icon-s-ticket i"></i>
|
||||||
<i class="el-icon-s-ticket i"></i>
|
<br>
|
||||||
<br>
|
<span>还款金额</span>
|
||||||
<span>还款金额</span>
|
<div class="text-red text-price">{{form.repayMoney | money}}</div>
|
||||||
<div class="text-red text-price">{{form.repayMoney | money}}</div>
|
</div>
|
||||||
</div>
|
</el-tooltip>
|
||||||
</el-tooltip>
|
<el-tooltip effect="dark" :content="'今日总退款金额 ' + form.refundMoney" placement="top">
|
||||||
<el-tooltip effect="dark" :content="'今日总退款金额 ' + form.refundMoney" placement="top">
|
<div class="bottom-right-item">
|
||||||
<div class="bottom-right-item">
|
<i class="el-icon-s-release i"></i>
|
||||||
<i class="el-icon-s-release i"></i>
|
<br>
|
||||||
<br>
|
<span>退款金额</span>
|
||||||
<span>退款金额</span>
|
<div class="text-red text-price">{{form.refundMoney | money}}</div>
|
||||||
<div class="text-red text-price">{{form.refundMoney | money}}</div>
|
</div>
|
||||||
</div>
|
</el-tooltip>
|
||||||
</el-tooltip>
|
<el-tooltip effect="dark" :content="'今日新增会员 ' + form.newMemberNum" placement="top">
|
||||||
<el-tooltip effect="dark" :content="'今日新增会员 ' + form.newMemberNum" placement="top">
|
<div class="bottom-right-item">
|
||||||
<div class="bottom-right-item">
|
<i class="el-icon-s-marketing i"></i>
|
||||||
<i class="el-icon-s-marketing i"></i>
|
<br>
|
||||||
<br>
|
<span>新增会员</span>
|
||||||
<span>新增会员</span>
|
<div>
|
||||||
<div>
|
<i class="text-blue el-icon-user-solid bottom-right-item-icon"></i>
|
||||||
<i class="text-blue el-icon-user-solid bottom-right-item-icon"></i>
|
<div class=" bottom-right-item-icon-number">{{form.newMemberNum}}</div>
|
||||||
<div class=" bottom-right-item-icon-number">{{form.newMemberNum}}</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</el-tooltip>
|
||||||
</el-tooltip>
|
<el-tooltip effect="dark" :content="'总使用中的会员数为 ' + form.startMemberNum" placement="top">
|
||||||
<el-tooltip effect="dark" :content="'总使用中的会员数为 ' + form.startMemberNum" placement="top">
|
<div class="bottom-right-item">
|
||||||
<div class="bottom-right-item">
|
<i class="el-icon-loading i"></i>
|
||||||
<i class="el-icon-loading i"></i>
|
<br>
|
||||||
<br>
|
<span>启用会员</span>
|
||||||
<span>启用会员</span>
|
<div>
|
||||||
<div>
|
<i class=" text-blue el-icon-user-solid bottom-right-item-icon"></i>
|
||||||
<i class=" text-blue el-icon-user-solid bottom-right-item-icon"></i>
|
<div class=" bottom-right-item-icon-number">{{form.startMemberNum}}</div>
|
||||||
<div class=" bottom-right-item-icon-number">{{form.startMemberNum}}</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</el-tooltip>
|
||||||
</el-tooltip>
|
<el-tooltip effect="dark" :content="'门店会员总数为 ' + form.memberNum" placement="top">
|
||||||
<el-tooltip effect="dark" :content="'门店会员总数为 ' + form.memberNum" placement="top">
|
|
||||||
|
<div class="bottom-right-item">
|
||||||
<div class="bottom-right-item">
|
<i class="el-icon-s-data i"></i>
|
||||||
<i class="el-icon-s-data i"></i>
|
<br>
|
||||||
<br>
|
<span>会员总数</span>
|
||||||
<span>会员总数</span>
|
<div>
|
||||||
<div>
|
<i class="text-blue el-icon-user-solid bottom-right-item-icon"></i>
|
||||||
<i class="text-blue el-icon-user-solid bottom-right-item-icon"></i>
|
<div class=" bottom-right-item-icon-number">{{form.memberNum}}</div>
|
||||||
<div class=" bottom-right-item-icon-number">{{form.memberNum}}</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</el-tooltip>
|
||||||
</el-tooltip>
|
</div>
|
||||||
</div>
|
|
||||||
|
</template>
|
||||||
</div>
|
|
||||||
</template>
|
<script>
|
||||||
|
import { storeDaily } from "../../api/statistics";
|
||||||
<script>
|
export default {
|
||||||
import { storeDaily } from "../../api/statistics";
|
data() {
|
||||||
export default {
|
return {
|
||||||
data() {
|
form: {
|
||||||
return {
|
headCount: 68,
|
||||||
form: {
|
rechargeMoney: 264568,
|
||||||
headCount: 68,
|
rechargeOrderNum: 26,
|
||||||
rechargeMoney: 264568,
|
cashPeopleNum: 54,
|
||||||
rechargeOrderNum: 26,
|
cashMoney: 344501,
|
||||||
cashPeopleNum: 54,
|
repayMoney: 5500,
|
||||||
cashMoney: 344501,
|
newMemberNum: 8,
|
||||||
repayMoney: 5500,
|
memberNum: 48,
|
||||||
newMemberNum: 8,
|
startMemberNum: 47,
|
||||||
memberNum: 48,
|
refundMoney: 3500,
|
||||||
startMemberNum: 47,
|
},
|
||||||
refundMoney: 3500,
|
};
|
||||||
},
|
},
|
||||||
};
|
methods: {
|
||||||
},
|
storeDaily() {
|
||||||
methods: {
|
let form = JSON.parse(sessionStorage.getItem("userInfo"));
|
||||||
storeDaily() {
|
storeDaily({ storeId: form.storeId }).then((res) => {
|
||||||
let form = JSON.parse(sessionStorage.getItem("userInfo"));
|
if (res.code == "000000") {
|
||||||
storeDaily({ storeId: form.storeId }).then((res) => {
|
this.form = res.data;
|
||||||
if (res.code == "000000") {
|
}
|
||||||
this.form = res.data;
|
});
|
||||||
}
|
},
|
||||||
});
|
},
|
||||||
},
|
created() {
|
||||||
},
|
this.storeDaily();
|
||||||
created() {
|
},
|
||||||
this.storeDaily();
|
};
|
||||||
},
|
</script>
|
||||||
};
|
<style scoped>
|
||||||
</script>
|
.bottom-right {
|
||||||
<style scoped>
|
/* display: flex;
|
||||||
.bottom-right {
|
justify-content: space-between;
|
||||||
/* display: flex;
|
flex-wrap: wrap; */
|
||||||
justify-content: space-between;
|
max-height: 40vh;
|
||||||
flex-wrap: wrap; */
|
height: 100%;
|
||||||
max-height: 40vh;
|
overflow: auto;
|
||||||
|
padding: 2%;
|
||||||
overflow: auto;
|
}
|
||||||
}
|
.bottom-right-item {
|
||||||
.bottom-right-item {
|
overflow: hidden;
|
||||||
height: 80px;
|
height: 40%;
|
||||||
width: 130px;
|
width: 20%;
|
||||||
/* border: 1px solid #333; */
|
text-align: center;
|
||||||
text-align: center;
|
margin-right: 2%;
|
||||||
padding: 25px 50px;
|
border: 1px solid rgba(255, 184, 184, 0.7);
|
||||||
}
|
padding-top: 2%;
|
||||||
.bottom-right-item .i {
|
padding-bottom: 1%;
|
||||||
font-size: 42px;
|
border-radius: 10%;
|
||||||
color: #51a5ff;
|
}
|
||||||
}
|
.bottom-right-item .i {
|
||||||
.bottom-right-item span {
|
font-size: 42px;
|
||||||
font-size: 16px;
|
color: #51a5ff;
|
||||||
color: #999;
|
}
|
||||||
}
|
.bottom-right-item span {
|
||||||
.bottom-right-item-number {
|
font-size: 16px;
|
||||||
font-size: 36px;
|
color: #999;
|
||||||
font-weight: 700;
|
}
|
||||||
color: #f78;
|
.bottom-right-item-number {
|
||||||
}
|
font-size: 36px;
|
||||||
.bottom-right-item-icon {
|
font-weight: 700;
|
||||||
font-size: 24px;
|
color: #f78;
|
||||||
}
|
}
|
||||||
.bottom-right-item-icon-number {
|
.bottom-right-item-icon {
|
||||||
display: inline-block;
|
font-size: 24px;
|
||||||
font-size: 16px;
|
}
|
||||||
color: #999;
|
.bottom-right-item-icon-number {
|
||||||
font-weight: 700;
|
display: inline-block;
|
||||||
}
|
font-size: 16px;
|
||||||
</style>
|
color: #999;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@ -1,71 +1,71 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 员工业绩和提成 -->
|
<!-- 员工业绩和提成 -->
|
||||||
<div class="month">
|
<div class="month">
|
||||||
<div class="month_header">
|
<div class="month_header">
|
||||||
<div style="padding:0 20px;font-size:14px;color:#999">员工业绩和提成</div>
|
<div class="padding-left-xs" style="font-size:14px;color:#999">员工业绩和提成</div>
|
||||||
<el-input clearable prefix-icon="el-icon-search" size="mini" style="width:150px;margin-right:50px" v-model="input"></el-input>
|
<el-input clearable prefix-icon="el-icon-search" size="samll" style="width:150px;margin-right:20px" v-model="input"></el-input>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<el-table :data="tableData" max-height="280" @row-dblclick="confirm" border :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)',color:'#eeeeee'}">
|
<el-table :data="tableData" max-height="280" @row-dblclick="confirm" border :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)',color:'#eeeeee'}">
|
||||||
<el-table-column align="center" prop="brandNumber" label="水牌号"> </el-table-column>
|
<el-table-column align="center" prop="brandNumber" label="水牌号"> </el-table-column>
|
||||||
<el-table-column align="center" prop="staffName" label="员工名称"> </el-table-column>
|
<el-table-column align="center" prop="staffName" label="员工名称"> </el-table-column>
|
||||||
<el-table-column align="center" prop="achievementAmount" label="业绩"> </el-table-column>
|
<el-table-column align="center" prop="achievementAmount" label="业绩"> </el-table-column>
|
||||||
<el-table-column align="center" prop="commissionAmount" label="提成"> </el-table-column>
|
<el-table-column align="center" prop="commissionAmount" label="提成"> </el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<perform ref="perform"></perform>
|
<perform ref="perform"></perform>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { statisticStaffDayList } from "../../api/home.js";
|
import { statisticStaffDayList } from "../../api/home.js";
|
||||||
import perform from "@/components/perform/index";
|
import perform from "@/components/perform/index";
|
||||||
export default {
|
export default {
|
||||||
components: { perform },
|
components: { perform },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableList: [],
|
tableList: [],
|
||||||
input: "",
|
input: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
statisticStaffDayList() {
|
statisticStaffDayList() {
|
||||||
statisticStaffDayList({ id: "" }).then((res) => {
|
statisticStaffDayList({ id: "" }).then((res) => {
|
||||||
this.tableList = res.rows;
|
this.tableList = res.rows;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
confirm(row) {
|
confirm(row) {
|
||||||
let date = new Date();
|
let date = new Date();
|
||||||
console.log(row);
|
console.log(row);
|
||||||
this.$refs.perform.show(row, date);
|
this.$refs.perform.show(row, date);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.statisticStaffDayList();
|
this.statisticStaffDayList();
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
//表名列表中搜索
|
//表名列表中搜索
|
||||||
tableData() {
|
tableData() {
|
||||||
var search = this.input.toString().toLowerCase(); //将用户输入的值变字符串并小写
|
var search = this.input.toString().toLowerCase(); //将用户输入的值变字符串并小写
|
||||||
if (search) {
|
if (search) {
|
||||||
return this.tableList.filter(function (dataNews) {
|
return this.tableList.filter(function (dataNews) {
|
||||||
return Object.keys(dataNews).some(function (key) {
|
return Object.keys(dataNews).some(function (key) {
|
||||||
return String(dataNews[key]).toLowerCase().indexOf(search) > -1;
|
return String(dataNews[key]).toLowerCase().indexOf(search) > -1;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return this.tableList;
|
return this.tableList;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.month {
|
.month {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding-top: 10px;
|
padding-top: 2px;
|
||||||
}
|
}
|
||||||
.month_header {
|
.month_header {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,92 +1,92 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div style="width:280px">
|
<div style="width:100%">
|
||||||
<el-table :data="payLists" class='border ' :summary-method="getSummariesPay" show-summary :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)',color:'#eeeeee'}">
|
<el-table :data="payLists" style="width:280px" class='border' :summary-method="getSummariesPay" show-summary :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)',color:'#eeeeee'}">
|
||||||
<el-table-column align="center" prop="payName" min-width="150" label="支付方式"></el-table-column>
|
<el-table-column align="center" prop="payName" min-width="100" label="支付方式"></el-table-column>
|
||||||
<el-table-column align="center" prop="payMoney" width="120" label="本次支付 ">
|
<el-table-column align="center" prop="payMoney" min-width="80" label="本次支付 ">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div v-if="payIndex != scope.$index" @click="editPay(scope.row,scope.$index)">
|
<div v-if="payIndex != scope.$index" @click="editPay(scope.row,scope.$index)">
|
||||||
{{ scope.row.payMoney }}
|
{{ scope.row.payMoney }}
|
||||||
<i class="text-cyan el-icon-edit"></i>
|
<i class="text-cyan el-icon-edit"></i>
|
||||||
</div>
|
</div>
|
||||||
<el-input class="form-input-xs" v-else v-focus oninput="this.value=this.value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3')" pattern="[0-9]*\.?[0-9]{0,2}" @blur="endEdit(scope.row, scope.$index,)" v-model="scope.row.payMoney" size="samll"></el-input>
|
<el-input class="form-input-xs" v-else v-focus oninput="this.value=this.value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3')" pattern="[0-9]*\.?[0-9]{0,2}" @blur="endEdit(scope.row, scope.$index,)" v-model="scope.row.payMoney" size="samll"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [], //主数组
|
list: [], //主数组
|
||||||
form: {}, //主对象
|
form: {}, //主对象
|
||||||
payLists: [], //现付列表
|
payLists: [], //现付列表
|
||||||
rechargeAccountList: [], //卡付列表
|
rechargeAccountList: [], //卡付列表
|
||||||
recIndex: -1,
|
recIndex: -1,
|
||||||
giftIndex: -1,
|
giftIndex: -1,
|
||||||
payIndex: -1,
|
payIndex: -1,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//组件传值
|
//组件传值
|
||||||
show(form, list) {
|
show(form, list) {
|
||||||
var that = this;
|
var that = this;
|
||||||
that.form = JSON.parse(JSON.stringify(form));
|
that.form = JSON.parse(JSON.stringify(form));
|
||||||
that.payLists = [];
|
that.payLists = [];
|
||||||
that.payLists = JSON.parse(JSON.stringify(list));
|
that.payLists = JSON.parse(JSON.stringify(list));
|
||||||
},
|
},
|
||||||
//选择金额.
|
//选择金额.
|
||||||
editPay(row, index) {
|
editPay(row, index) {
|
||||||
this.payIndex = index;
|
this.payIndex = index;
|
||||||
row.payMoney =
|
row.payMoney =
|
||||||
(this.form.cashAmount - this.form.collectionCashAmount).toFixed(2) * 1;
|
(this.form.cashAmount - this.form.collectionCashAmount).toFixed(2) * 1;
|
||||||
},
|
},
|
||||||
endEdit(row, index) {
|
endEdit(row, index) {
|
||||||
this.payIndex = -1;
|
this.payIndex = -1;
|
||||||
if (!row.payMoney) {
|
if (!row.payMoney) {
|
||||||
row.payMoney = 0;
|
row.payMoney = 0;
|
||||||
}
|
}
|
||||||
this.sumNum();
|
this.sumNum();
|
||||||
},
|
},
|
||||||
sumNum() {
|
sumNum() {
|
||||||
let payMoney = 0;
|
let payMoney = 0;
|
||||||
this.payLists.forEach((item) => {
|
this.payLists.forEach((item) => {
|
||||||
payMoney += item.payMoney * 1;
|
payMoney += item.payMoney * 1;
|
||||||
});
|
});
|
||||||
this.form.collectionCashAmount = payMoney;
|
this.form.collectionCashAmount = payMoney;
|
||||||
let form = { form: this.form, list: this.payLists };
|
let form = { form: this.form, list: this.payLists };
|
||||||
this.$emit("paymentData", form);
|
this.$emit("paymentData", form);
|
||||||
},
|
},
|
||||||
getSummariesPay(param) {
|
getSummariesPay(param) {
|
||||||
const { columns, data } = param;
|
const { columns, data } = param;
|
||||||
const sums = [];
|
const sums = [];
|
||||||
columns.forEach((column, index) => {
|
columns.forEach((column, index) => {
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
sums[index] = "合计";
|
sums[index] = "合计";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const values = data.map((item) => Number(item[column.property]));
|
const values = data.map((item) => Number(item[column.property]));
|
||||||
if (column.property == "payMoney") {
|
if (column.property == "payMoney") {
|
||||||
sums[index] = values.reduce((prev, curr) => {
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
const value = Number(curr);
|
const value = Number(curr);
|
||||||
if (!isNaN(value)) {
|
if (!isNaN(value)) {
|
||||||
return prev + curr;
|
return prev + curr;
|
||||||
} else {
|
} else {
|
||||||
sums[index] = "--";
|
sums[index] = "--";
|
||||||
}
|
}
|
||||||
}, 0);
|
}, 0);
|
||||||
sums[index] += " ";
|
sums[index] += " ";
|
||||||
} else {
|
} else {
|
||||||
sums[index] = "--";
|
sums[index] = "--";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return sums;
|
return sums;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,233 +1,233 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="dialogFormVisible" width="80%" v-dialogDrag>
|
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="dialogFormVisible" width="80%" v-dialogDrag>
|
||||||
<el-form :model="form" inline ref="form" class="max-height-60" label-width="80px">
|
<el-form :model="form" inline ref="form" class="max-height-60" label-width="80px">
|
||||||
<el-form-item label="转出门店">
|
<el-form-item label="转出门店">
|
||||||
<el-select filterable default-first-option clearable v-model="form.storesNum" placeholder="请选择" @change="changeOut">
|
<el-select filterable default-first-option clearable v-model="form.storesNum" placeholder="请选择" @change="changeOut">
|
||||||
<el-option v-for="(item,index) in options" :key="index" :label="item.storeNum" :value="item.storeNum">
|
<el-option v-for="(item,index) in options" :key="index" :label="item.storeNum" :value="item.storeNum">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="门店名称">
|
<el-form-item label="门店名称">
|
||||||
{{form.storesName}}
|
{{form.storesName}}
|
||||||
<!-- <el-select filterable default-first-option clearable v-model="form.storeName" placeholder="请选择">
|
<!-- <el-select filterable default-first-option clearable v-model="form.storeName" placeholder="请选择">
|
||||||
<el-option v-for="(item,index) in options" :key="index" :label="item.storeName" :value="item.storeName">
|
<el-option v-for="(item,index) in options" :key="index" :label="item.storeName" :value="item.storeName">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select> -->
|
</el-select> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-table :data="list" ref="list" v-loading="listLoading" max-height="600" :element-loading-text="elementLoadingText" @row-click="getCurrentRow" :row-class-name="rowName" @selection-change="handleSelectionChange" :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)',color:'#eeeeee'}">
|
<el-table :data="list" ref="list" v-loading="listLoading" max-height="600" :element-loading-text="elementLoadingText" @row-click="getCurrentRow" :row-class-name="rowName" @selection-change="handleSelectionChange" :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)',color:'#eeeeee'}">
|
||||||
<el-table-column type="selection" width="50"></el-table-column>
|
<el-table-column type="selection" width="50"></el-table-column>
|
||||||
<el-table-column align="center" prop="brandNumber" label="水牌号" sortable min-width="80"></el-table-column>
|
<el-table-column align="center" prop="brandNumber" label="水牌号" sortable min-width="80"></el-table-column>
|
||||||
<el-table-column align="center" prop="staffName" label="员工名称" sortable min-width="80"></el-table-column>
|
<el-table-column align="center" prop="staffName" label="员工名称" sortable min-width="80"></el-table-column>
|
||||||
<el-table-column align="center" prop="sex" label="性别" sortable min-width="80">
|
<el-table-column align="center" prop="sex" label="性别" sortable min-width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div v-if="scope.row.sex==1">男</div>
|
<div v-if="scope.row.sex==1">男</div>
|
||||||
<div v-else>女</div>
|
<div v-else>女</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" prop="mobilePhone" label="手机号码" sortable min-width="120"></el-table-column>
|
<el-table-column align="center" prop="mobilePhone" label="手机号码" sortable min-width="120"></el-table-column>
|
||||||
<el-table-column align="center" prop="joinedDate" label="入职日期" sortable min-width="110"></el-table-column>
|
<el-table-column align="center" prop="joinedDate" label="入职日期" sortable min-width="110"></el-table-column>
|
||||||
<el-table-column align="center" prop="jobName" label="工种" sortable min-width="80"></el-table-column>
|
<el-table-column align="center" prop="wordTypeName" label="工种" sortable min-width="80"></el-table-column>
|
||||||
<el-table-column align="center" prop="postName" label="职务" sortable min-width="80"></el-table-column>
|
<el-table-column align="center" prop="postName" label="职务" sortable min-width="80"></el-table-column>
|
||||||
<el-table-column align="center" prop="type" label="员工类型" sortable min-width="80">
|
<el-table-column align="center" prop="type" label="员工类型" sortable min-width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{scope.row.type==0?"高管":"普通员工"}}
|
{{scope.row.type==0?"高管":"普通员工"}}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align=" center" prop="source" label="员工来源" sortable min-width="80">
|
<el-table-column align=" center" prop="source" label="员工来源" sortable min-width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{scope.row.source==0?"校招":scope.row.source==1?"社招":scope.row.source==2?"介绍":"其他"}}
|
{{scope.row.source==0?"校招":scope.row.source==1?"社招":scope.row.source==2?"介绍":"其他"}}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="转入门店">
|
<el-table-column align="center" label="转入门店">
|
||||||
<el-table-column align="center" prop="storeNum" label="编码" min-width="80">
|
<el-table-column align="center" prop="storeNum" label="编码" min-width="80">
|
||||||
<!-- <template slot-scope="scope">
|
<!-- <template slot-scope="scope">
|
||||||
<el-select class="form-width-m" filterable default-first-option clearable v-model="scope.row.storeNums" placeholder="请选择">
|
<el-select class="form-width-m" filterable default-first-option clearable v-model="scope.row.storeNums" placeholder="请选择">
|
||||||
<el-option v-for="(item,index) in options" :key="index" :label="item.storeNum" :value="item.storeNum">
|
<el-option v-for="(item,index) in options" :key="index" :label="item.storeNum" :value="item.storeNum">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template> -->
|
</template> -->
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" prop="storeName" label="名称" min-width="200">
|
<el-table-column align="center" prop="storeName" label="名称" min-width="200">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-select class="form-width-m" filterable default-first-option clearable @clear='clear(scope.row)' v-model="scope.row.storeName" @change="changeIn($event,scope.row)" placeholder="请选择">
|
<el-select class="form-width-m" filterable default-first-option clearable @clear='clear(scope.row)' v-model="scope.row.storeName" @change="changeIn($event,scope.row)" placeholder="请选择">
|
||||||
<el-option v-for="(item,index) in storeList" :key="index" :label="item.storeName" :value="item.storeName">
|
<el-option v-for="(item,index) in storeList" :key="index" :label="item.storeName" :value="item.storeName">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button size="mini" type="primary" @click="dialogFormVisible = false">取 消</el-button>
|
<el-button size="mini" type="primary" @click="dialogFormVisible = false">取 消</el-button>
|
||||||
<el-button size="mini" type="primary" :disabled="outShow" @click="confirm()">确 定</el-button>
|
<el-button size="mini" type="primary" :disabled="outShow" @click="confirm()">确 定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
addStoreConversion,
|
addStoreConversion,
|
||||||
staffPage,
|
staffPage,
|
||||||
organizations,
|
organizations,
|
||||||
} from "@/api/storeManage.js";
|
} from "@/api/storeManage.js";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogFormVisible: false,
|
dialogFormVisible: false,
|
||||||
listLoading: false, //list加载提示开启动画
|
listLoading: false, //list加载提示开启动画
|
||||||
elementLoadingText: "加载中...",
|
elementLoadingText: "加载中...",
|
||||||
title: "",
|
title: "",
|
||||||
form: {}, //主对象
|
form: {}, //主对象
|
||||||
list: [], //主数组
|
list: [], //主数组
|
||||||
selection: [],
|
selection: [],
|
||||||
queryForm: {
|
queryForm: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
},
|
},
|
||||||
options: [],
|
options: [],
|
||||||
outShow: false,
|
outShow: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeOut(e) {
|
changeOut(e) {
|
||||||
console.log(123);
|
console.log(123);
|
||||||
this.options.forEach((item) => {
|
this.options.forEach((item) => {
|
||||||
if (item.storeNum == e) {
|
if (item.storeNum == e) {
|
||||||
this.form.storesName = item.storeName;
|
this.form.storesName = item.storeName;
|
||||||
this.form.storesId = item.id;
|
this.form.storesId = item.id;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.getStaffData();
|
this.getStaffData();
|
||||||
this.getData();
|
this.getData();
|
||||||
},
|
},
|
||||||
changeIn(e, row) {
|
changeIn(e, row) {
|
||||||
let form = { ...row };
|
let form = { ...row };
|
||||||
this.storeList.forEach((item) => {
|
this.storeList.forEach((item) => {
|
||||||
if (item.storeName == e) {
|
if (item.storeName == e) {
|
||||||
form.storeName = item.storeName;
|
form.storeName = item.storeName;
|
||||||
form.storeId = item.id;
|
form.storeId = item.id;
|
||||||
form.storeNum = item.storeNum;
|
form.storeNum = item.storeNum;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.list.splice(row.index, 1, form);
|
this.list.splice(row.index, 1, form);
|
||||||
this.getCurrentRow(row);
|
this.getCurrentRow(row);
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs["list"].toggleRowSelection(this.list[row.index], true);
|
this.$refs["list"].toggleRowSelection(this.list[row.index], true);
|
||||||
});
|
});
|
||||||
console.log(this.selection);
|
console.log(this.selection);
|
||||||
},
|
},
|
||||||
clear(row) {
|
clear(row) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs["list"].toggleRowSelection(this.list[row.index], false);
|
this.$refs["list"].toggleRowSelection(this.list[row.index], false);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//多选方法
|
//多选方法
|
||||||
getCurrentRow(row) {
|
getCurrentRow(row) {
|
||||||
this.$refs["list"].toggleRowSelection(row);
|
this.$refs["list"].toggleRowSelection(row);
|
||||||
},
|
},
|
||||||
//列表返回方法
|
//列表返回方法
|
||||||
rowName({ row, rowIndex }) {
|
rowName({ row, rowIndex }) {
|
||||||
row.index = rowIndex;
|
row.index = rowIndex;
|
||||||
},
|
},
|
||||||
//多选变动方法
|
//多选变动方法
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.selection = selection;
|
this.selection = selection;
|
||||||
},
|
},
|
||||||
show(row) {
|
show(row) {
|
||||||
this.title = "员工转出门店";
|
this.title = "员工转出门店";
|
||||||
this.dialogFormVisible = true;
|
this.dialogFormVisible = true;
|
||||||
this.getData();
|
this.getData();
|
||||||
},
|
},
|
||||||
//获取数据
|
//获取数据
|
||||||
async getData() {
|
async getData() {
|
||||||
// let parentId = JSON.parse(sessionStorage.getItem("storeInfo")).id;
|
// let parentId = JSON.parse(sessionStorage.getItem("storeInfo")).id;
|
||||||
organizations({ pageSize: 999 }).then((res) => {
|
organizations({ pageSize: 999 }).then((res) => {
|
||||||
if (res.code == "000000") {
|
if (res.code == "000000") {
|
||||||
let list = [];
|
let list = [];
|
||||||
res.rows.forEach((item) => {
|
res.rows.forEach((item) => {
|
||||||
if (this.form.storesNum != item.storeNum) {
|
if (this.form.storesNum != item.storeNum) {
|
||||||
list.push(item);
|
list.push(item);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.options = res.rows;
|
this.options = res.rows;
|
||||||
this.storeList = list;
|
this.storeList = list;
|
||||||
} else {
|
} else {
|
||||||
this.$alert(res.message, "获取门店信息", {
|
this.$alert(res.message, "获取门店信息", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
confirmButtonClass: "confirmbtnFalses",
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
center: true,
|
center: true,
|
||||||
callback: (action) => {},
|
callback: (action) => {},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getStaffData() {
|
getStaffData() {
|
||||||
var arr1 = {
|
var arr1 = {
|
||||||
state: 1,
|
state: 1,
|
||||||
pageNum: this.queryForm.pageNum,
|
pageNum: this.queryForm.pageNum,
|
||||||
pageSize: this.queryForm.pageSize,
|
pageSize: this.queryForm.pageSize,
|
||||||
storeId: this.form.storesId,
|
storeId: this.form.storesId,
|
||||||
};
|
};
|
||||||
console.log(arr1);
|
console.log(arr1);
|
||||||
staffPage(arr1).then((res) => {
|
staffPage(arr1).then((res) => {
|
||||||
if (res.code == "000000") {
|
if (res.code == "000000") {
|
||||||
res.pageInfo.list.forEach((item) => {
|
res.pageInfo.list.forEach((item) => {
|
||||||
item.storeNum = null;
|
item.storeNum = null;
|
||||||
item.storeName = null;
|
item.storeName = null;
|
||||||
item.storeId = null;
|
item.storeId = null;
|
||||||
item.staffId = item.id;
|
item.staffId = item.id;
|
||||||
});
|
});
|
||||||
if (res.pageInfo.total > 1) {
|
if (res.pageInfo.total > 1) {
|
||||||
this.outShow = false;
|
this.outShow = false;
|
||||||
} else {
|
} else {
|
||||||
this.outShow = true;
|
this.outShow = true;
|
||||||
this.$alert("店铺剩余人数过少不建议转店", "提示", {
|
this.$alert("店铺剩余人数过少不建议转店", "提示", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
confirmButtonClass: "confirmbtnFalses",
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
center: true,
|
center: true,
|
||||||
callback: (action) => {},
|
callback: (action) => {},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.list = res.pageInfo.list;
|
this.list = res.pageInfo.list;
|
||||||
} else {
|
} else {
|
||||||
this.$alert(res.message, "获取门店员工信息", {
|
this.$alert(res.message, "获取门店员工信息", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
confirmButtonClass: "confirmbtnFalses",
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
center: true,
|
center: true,
|
||||||
callback: (action) => {},
|
callback: (action) => {},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
confirm() {
|
confirm() {
|
||||||
this.selection.forEach((item) => {
|
this.selection.forEach((item) => {
|
||||||
item.storesId = this.form.storesId;
|
item.storesId = this.form.storesId;
|
||||||
item.storesName = this.form.storesName;
|
item.storesName = this.form.storesName;
|
||||||
item.storesNum = this.form.storesNum;
|
item.storesNum = this.form.storesNum;
|
||||||
});
|
});
|
||||||
addStoreConversion(this.selection).then((res) => {
|
addStoreConversion(this.selection).then((res) => {
|
||||||
if (res.code == "000000") {
|
if (res.code == "000000") {
|
||||||
this.dialogFormVisible = false;
|
this.dialogFormVisible = false;
|
||||||
this.$emit("editData");
|
this.$emit("editData");
|
||||||
} else {
|
} else {
|
||||||
this.$alert(res.message, "提示", {
|
this.$alert(res.message, "提示", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
confirmButtonClass: "confirmbtnFalses",
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
center: true,
|
center: true,
|
||||||
callback: (action) => {},
|
callback: (action) => {},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,281 +1,281 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="header_flex">
|
<div class="header_flex">
|
||||||
<div>
|
<div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-input size="medium" style="width:180px;" placeholder="当前页搜索" v-model="input">
|
<el-input size="medium" style="width:180px;" placeholder="当前页搜索" v-model="input">
|
||||||
<i slot="prefix" class="el-input__icon el-icon-search"></i>
|
<i slot="prefix" class="el-input__icon el-icon-search"></i>
|
||||||
</el-input>
|
</el-input>
|
||||||
<el-button size="mini" type="primary" @click="(searchDialog=true)">条件搜索</el-button>
|
<el-button size="mini" type="primary" @click="(searchDialog=true)">条件搜索</el-button>
|
||||||
<el-button size="mini" type="info" plain @click="getData(refreshtext=true)">刷新</el-button>
|
<el-button size="mini" type="info" plain @click="getData(refreshtext=true)">刷新</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
<el-table :data="tableData" :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)',color:'#eeeeee'}" :summary-method="getSummaries" show-summary style="width: 100%">
|
<el-table :data="tableData" :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)',color:'#eeeeee'}" :summary-method="getSummaries" show-summary style="width: 100%">
|
||||||
<el-table-column align="center" prop="brandNumber" label="水牌号" min-width="110"></el-table-column>
|
<el-table-column align="center" prop="brandNumber" label="水牌号" min-width="110"></el-table-column>
|
||||||
<el-table-column align="center" prop="staffName" label="名字" min-width="100"></el-table-column>
|
<el-table-column align="center" prop="staffName" label="名字" min-width="100"></el-table-column>
|
||||||
<el-table-column align="center" prop="postName" label="职务" min-width="100"></el-table-column>
|
<el-table-column align="center" prop="postName" label="职务" min-width="100"></el-table-column>
|
||||||
<el-table-column align="center" prop="jobName" label="工种" min-width="100"></el-table-column>
|
<el-table-column align="center" prop="wordTypeName" label="工种" min-width="100"></el-table-column>
|
||||||
<el-table-column align="center" prop="joinedDate" sortable label="入职时间" min-width="180"></el-table-column>
|
<el-table-column align="center" prop="joinedDate" sortable label="入职时间" min-width="180"></el-table-column>
|
||||||
<el-table-column align="center" prop="count" sortable label="会员数(个)" min-width="110"></el-table-column>
|
<el-table-column align="center" prop="count" sortable label="会员数(个)" min-width="110"></el-table-column>
|
||||||
<el-table-column fixed="right" align="center" label="操作" width="80">
|
<el-table-column fixed="right" align="center" label="操作" width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini" type="primary" @click="detail(scope.row,scope.$index,(detailVisible=true))" plain>明细</el-button>
|
<el-button size="mini" type="primary" @click="detail(scope.row,scope.$index,(detailVisible=true))" plain>明细</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div class="block" style="margin-top:15px;">
|
<div class="block" style="margin-top:15px;">
|
||||||
<el-pagination align="left" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNum" :page-sizes="[10,20,30,40,50]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="pageInfo.total"></el-pagination>
|
<el-pagination align="left" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNum" :page-sizes="[10,20,30,40,50]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="pageInfo.total"></el-pagination>
|
||||||
</div>
|
</div>
|
||||||
<el-drawer :visible.sync="detailVisible" size="40%" direction="rtl">
|
<el-drawer :visible.sync="detailVisible" size="40%" direction="rtl">
|
||||||
<el-table :data="detailTableData" stripe style="width: 95%;margin:2px auto;border:0.5px solid #eeeeee" :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)',color:'#eeeeee'}" height="90%">
|
<el-table :data="detailTableData" stripe style="width: 95%;margin:2px auto;border:0.5px solid #eeeeee" :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)',color:'#eeeeee'}" height="90%">
|
||||||
<el-table-column align="center" prop="memberNum" label="编码" min-width="100" sortable></el-table-column>
|
<el-table-column align="center" prop="memberNum" label="编码" min-width="100" sortable></el-table-column>
|
||||||
<el-table-column align="center" prop="memberName" label="姓名" min-width="100" sortable></el-table-column>
|
<el-table-column align="center" prop="memberName" label="姓名" min-width="100" sortable></el-table-column>
|
||||||
<el-table-column align="center" prop="sex" label="性别" min-width="80">
|
<el-table-column align="center" prop="sex" label="性别" min-width="80">
|
||||||
<template slot-scope="scope">{{scope.row.sex==1?'男':'女'}}</template>
|
<template slot-scope="scope">{{scope.row.sex==1?'男':'女'}}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" prop="label" :show-overflow-tooltip="true" label="标签" min-width="80"></el-table-column>
|
<el-table-column align="center" prop="label" :show-overflow-tooltip="true" label="标签" min-width="80"></el-table-column>
|
||||||
<el-table-column align="center" prop="mobilePhone" label="手机" min-width="150" sortable> <template slot-scope="scope">{{scope.row.mobilePhone | phone}}</template></el-table-column>
|
<el-table-column align="center" prop="mobilePhone" label="手机" min-width="150" sortable> <template slot-scope="scope">{{scope.row.mobilePhone | phone}}</template></el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
<el-dialog title="搜索" :visible.sync="searchDialog">
|
<el-dialog title="搜索" :visible.sync="searchDialog">
|
||||||
<el-form :model="searchForm">
|
<el-form :model="searchForm">
|
||||||
<el-form-item label="入职日期搜索:" label-width="120px">
|
<el-form-item label="入职日期搜索:" label-width="120px">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<el-date-picker @change='changeDate' size="large" v-model="date" type="daterange" align="center" unlink-panels value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions">
|
<el-date-picker @change='changeDate' size="large" v-model="date" type="daterange" align="center" unlink-panels value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="水牌号搜索:" label-width="120px">
|
<el-form-item label="水牌号搜索:" label-width="120px">
|
||||||
<div class="searchDiv">
|
<div class="searchDiv">
|
||||||
<el-input size="medium" v-model="searchForm.brandNumber" placeholder="输入要查询的员工水牌号" clearable></el-input>
|
<el-input size="medium" v-model="searchForm.brandNumber" placeholder="输入要查询的员工水牌号" clearable></el-input>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="员工名字搜索:" label-width="120px">
|
<el-form-item label="员工名字搜索:" label-width="120px">
|
||||||
<div class="searchDiv">
|
<div class="searchDiv">
|
||||||
<el-input size="medium" v-model="searchForm.staffName" placeholder="输入要查询的员工姓名" clearable></el-input>
|
<el-input size="medium" v-model="searchForm.staffName" placeholder="输入要查询的员工姓名" clearable></el-input>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button size="mini" type="primary" plain @click="searchDialog = false">取 消</el-button>
|
<el-button size="mini" type="primary" plain @click="searchDialog = false">取 消</el-button>
|
||||||
<el-button type="primary" size="mini" @click="search(searchDialog = false) ">确 定</el-button>
|
<el-button type="primary" size="mini" @click="search(searchDialog = false) ">确 定</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
import { staffMemberPage, storeMemberlistByStaff } from "@/api/storeManage.js";
|
import { staffMemberPage, storeMemberlistByStaff } from "@/api/storeManage.js";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
detailVisible: false, //弹窗开关
|
detailVisible: false, //弹窗开关
|
||||||
pageNum: 1, // 当前页码
|
pageNum: 1, // 当前页码
|
||||||
pageSize: 10, // 每页的数据条数,
|
pageSize: 10, // 每页的数据条数,
|
||||||
input: "", //当前页搜索 输入值
|
input: "", //当前页搜索 输入值
|
||||||
searchDialog: false, //搜索弹窗开关
|
searchDialog: false, //搜索弹窗开关
|
||||||
refreshtext: false, //搜索标识
|
refreshtext: false, //搜索标识
|
||||||
date: [], //时间默认数组
|
date: [], //时间默认数组
|
||||||
searchForm: {
|
searchForm: {
|
||||||
//搜索表单
|
//搜索表单
|
||||||
brandNumber: "",
|
brandNumber: "",
|
||||||
staffName: "",
|
staffName: "",
|
||||||
startTime: "",
|
startTime: "",
|
||||||
endTime: "",
|
endTime: "",
|
||||||
},
|
},
|
||||||
pageInfo: {
|
pageInfo: {
|
||||||
total: 0, //分页总条数
|
total: 0, //分页总条数
|
||||||
tableList: [],
|
tableList: [],
|
||||||
},
|
},
|
||||||
detailTableData: [], //展示会员列表
|
detailTableData: [], //展示会员列表
|
||||||
pickerOptions: {
|
pickerOptions: {
|
||||||
shortcuts: [
|
shortcuts: [
|
||||||
{
|
{
|
||||||
text: "最近一周",
|
text: "最近一周",
|
||||||
onClick(picker) {
|
onClick(picker) {
|
||||||
const end = new Date();
|
const end = new Date();
|
||||||
const start = new Date();
|
const start = new Date();
|
||||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||||
picker.$emit("pick", [start, end]);
|
picker.$emit("pick", [start, end]);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "最近一个月",
|
text: "最近一个月",
|
||||||
onClick(picker) {
|
onClick(picker) {
|
||||||
const end = new Date();
|
const end = new Date();
|
||||||
const start = new Date();
|
const start = new Date();
|
||||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||||
picker.$emit("pick", [start, end]);
|
picker.$emit("pick", [start, end]);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
searchTrue: false,
|
searchTrue: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//时间改变方法
|
//时间改变方法
|
||||||
//时间改变方法
|
//时间改变方法
|
||||||
changeDate() {
|
changeDate() {
|
||||||
this.searchForm.startTime = this.date[0];
|
this.searchForm.startTime = this.date[0];
|
||||||
this.searchForm.endTime = this.date[1];
|
this.searchForm.endTime = this.date[1];
|
||||||
},
|
},
|
||||||
//搜索方法
|
//搜索方法
|
||||||
search() {
|
search() {
|
||||||
//条件搜索
|
//条件搜索
|
||||||
staffMemberPage(this.searchForm).then((res) => {
|
staffMemberPage(this.searchForm).then((res) => {
|
||||||
if (res.code == "000000") {
|
if (res.code == "000000") {
|
||||||
this.searchTrue = true;
|
this.searchTrue = true;
|
||||||
res.pageInfo.tableList = res.pageInfo.list;
|
res.pageInfo.tableList = res.pageInfo.list;
|
||||||
this.pageInfo = res.pageInfo;
|
this.pageInfo = res.pageInfo;
|
||||||
if (res.pageInfo.total == 0) {
|
if (res.pageInfo.total == 0) {
|
||||||
this.$message.warning({ message: "没有找到该员工数据" });
|
this.$message.warning({ message: "没有找到该员工数据" });
|
||||||
} else {
|
} else {
|
||||||
this.$message.success({ message: "已显示符合条件的全部数据" });
|
this.$message.success({ message: "已显示符合条件的全部数据" });
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$alert(res.message, "提示", {
|
this.$alert(res.message, "提示", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
confirmButtonClass: "confirmbtnFalses",
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
center: true,
|
center: true,
|
||||||
callback: (action) => {},
|
callback: (action) => {},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//指定列求和
|
//指定列求和
|
||||||
//数组按对应字段合计返回方法
|
//数组按对应字段合计返回方法
|
||||||
getSummaries(param) {
|
getSummaries(param) {
|
||||||
const { columns, data } = param;
|
const { columns, data } = param;
|
||||||
const sums = [];
|
const sums = [];
|
||||||
columns.forEach((column, index) => {
|
columns.forEach((column, index) => {
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
sums[index] = "合计";
|
sums[index] = "合计";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const values = data.map((item) => Number(item[column.property]));
|
const values = data.map((item) => Number(item[column.property]));
|
||||||
if (column.property == "count") {
|
if (column.property == "count") {
|
||||||
sums[index] = values.reduce((prev, curr) => {
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
const value = Number(curr);
|
const value = Number(curr);
|
||||||
if (!isNaN(value)) {
|
if (!isNaN(value)) {
|
||||||
return prev + curr;
|
return prev + curr;
|
||||||
} else {
|
} else {
|
||||||
sums[index] = "--";
|
sums[index] = "--";
|
||||||
}
|
}
|
||||||
}, 0);
|
}, 0);
|
||||||
//console.log(sums )
|
//console.log(sums )
|
||||||
sums[index] += " 个";
|
sums[index] += " 个";
|
||||||
} else {
|
} else {
|
||||||
sums[index] = "--";
|
sums[index] = "--";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return sums;
|
return sums;
|
||||||
},
|
},
|
||||||
//查询明细
|
//查询明细
|
||||||
detail(row) {
|
detail(row) {
|
||||||
var id = { staffId: row.id };
|
var id = { staffId: row.id };
|
||||||
storeMemberlistByStaff(id).then((res) => {
|
storeMemberlistByStaff(id).then((res) => {
|
||||||
//console.log(res);
|
//console.log(res);
|
||||||
if (res.code == "000000") {
|
if (res.code == "000000") {
|
||||||
//console.log(res.rows);
|
//console.log(res.rows);
|
||||||
res.rows.forEach((item) => {
|
res.rows.forEach((item) => {
|
||||||
if (item.sex == 1) {
|
if (item.sex == 1) {
|
||||||
item.sex = "男";
|
item.sex = "男";
|
||||||
} else {
|
} else {
|
||||||
item.sex = "女";
|
item.sex = "女";
|
||||||
}
|
}
|
||||||
if (item.kinType == 3) {
|
if (item.kinType == 3) {
|
||||||
item.kinType = "干性";
|
item.kinType = "干性";
|
||||||
} else if (item.kinType == 2) {
|
} else if (item.kinType == 2) {
|
||||||
item.kinType = "中性";
|
item.kinType = "中性";
|
||||||
} else if (item.kinType == 1) {
|
} else if (item.kinType == 1) {
|
||||||
item.kinType = "油性";
|
item.kinType = "油性";
|
||||||
} else {
|
} else {
|
||||||
item.kinType = "暂无";
|
item.kinType = "暂无";
|
||||||
}
|
}
|
||||||
if (item.hairLong == 3) {
|
if (item.hairLong == 3) {
|
||||||
item.hairLong = "短";
|
item.hairLong = "短";
|
||||||
} else if (item.hairLong == 2) {
|
} else if (item.hairLong == 2) {
|
||||||
item.hairLong = "适中";
|
item.hairLong = "适中";
|
||||||
} else if (item.hairLong == 1) {
|
} else if (item.hairLong == 1) {
|
||||||
item.hairLong = "长";
|
item.hairLong = "长";
|
||||||
} else {
|
} else {
|
||||||
item.hairLong == "暂无";
|
item.hairLong == "暂无";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.detailTableData = res.rows;
|
this.detailTableData = res.rows;
|
||||||
} else {
|
} else {
|
||||||
this.$alert(res.message, "提示", {
|
this.$alert(res.message, "提示", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
confirmButtonClass: "confirmbtnFalses",
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
center: true,
|
center: true,
|
||||||
callback: (action) => {},
|
callback: (action) => {},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
//分页方法
|
//分页方法
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
// //console.log(`每页 ${val} 条`);
|
// //console.log(`每页 ${val} 条`);
|
||||||
this.pageSize = val;
|
this.pageSize = val;
|
||||||
if (this.searchTrue == true) {
|
if (this.searchTrue == true) {
|
||||||
this.search();
|
this.search();
|
||||||
} else {
|
} else {
|
||||||
this.getData();
|
this.getData();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
// //console.log(`当前页: ${val}`);
|
// //console.log(`当前页: ${val}`);
|
||||||
this.pageNum = val;
|
this.pageNum = val;
|
||||||
if (this.searchTrue == true) {
|
if (this.searchTrue == true) {
|
||||||
this.search();
|
this.search();
|
||||||
} else {
|
} else {
|
||||||
this.getData();
|
this.getData();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//获取数据
|
//获取数据
|
||||||
getData() {
|
getData() {
|
||||||
var page = { pageNum: this.pageNum, pageSize: this.pageSize };
|
var page = { pageNum: this.pageNum, pageSize: this.pageSize };
|
||||||
staffMemberPage(page).then((res) => {
|
staffMemberPage(page).then((res) => {
|
||||||
if (res.code == "000000") {
|
if (res.code == "000000") {
|
||||||
if (this.refreshtext == true) {
|
if (this.refreshtext == true) {
|
||||||
this.searchTrue = false;
|
this.searchTrue = false;
|
||||||
this.$message.success({ message: "已刷新最新数据" });
|
this.$message.success({ message: "已刷新最新数据" });
|
||||||
this.refreshtext = false;
|
this.refreshtext = false;
|
||||||
}
|
}
|
||||||
res.pageInfo.tableList = res.pageInfo.list;
|
res.pageInfo.tableList = res.pageInfo.list;
|
||||||
this.pageInfo = res.pageInfo;
|
this.pageInfo = res.pageInfo;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
let list = JSON.parse(sessionStorage.getItem("list"));
|
let list = JSON.parse(sessionStorage.getItem("list"));
|
||||||
list.forEach((item) => {
|
list.forEach((item) => {
|
||||||
if (item.id == 4009001) {
|
if (item.id == 4009001) {
|
||||||
this.getData();
|
this.getData();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
//表名列表中搜索
|
//表名列表中搜索
|
||||||
tableData() {
|
tableData() {
|
||||||
var search = this.input.toString().toLowerCase(); //将用户输入的值变字符串并小写
|
var search = this.input.toString().toLowerCase(); //将用户输入的值变字符串并小写
|
||||||
if (search) {
|
if (search) {
|
||||||
return this.pageInfo.tableList.filter(function (dataNews) {
|
return this.pageInfo.tableList.filter(function (dataNews) {
|
||||||
return Object.keys(dataNews).some(function (key) {
|
return Object.keys(dataNews).some(function (key) {
|
||||||
return String(dataNews[key]).toLowerCase().indexOf(search) > -1;
|
return String(dataNews[key]).toLowerCase().indexOf(search) > -1;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return this.pageInfo.tableList;
|
return this.pageInfo.tableList;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
Reference in New Issue