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