bug
This commit is contained in:
parent
d5a7ddd1d2
commit
63ca5ca01b
@ -211,21 +211,21 @@
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="进货单价" prop="buyingPrice">
|
||||
<el-input v-model="form.buyingPrice" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')">
|
||||
<el-input v-model="form.buyingPrice" maxlength="10" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="零售价" prop="retailPrice">
|
||||
<el-input v-model="form.retailPrice" @input="getPrice" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')">
|
||||
<el-input v-model="form.retailPrice" maxlength="10" @input="getPrice" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="会员价" prop="memberPrice">
|
||||
<el-input v-model="form.memberPrice" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')">
|
||||
<el-input v-model="form.memberPrice" maxlength="10" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
@ -212,11 +212,11 @@
|
||||
<dict-tag :options="dict.type.zhzt" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="公众号" align="center" prop="official">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.official" :value="scope.row.official"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="公众号" align="center" prop="official">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <dict-tag :options="dict.type.official" :value="scope.row.official"/>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="操作" align="center" width="120" fixed='right'>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
@ -269,11 +269,18 @@
|
||||
collapse-tags
|
||||
@change="getCheckbox"
|
||||
placeholder="请选择">
|
||||
<el-checkbox style="margin-left: 100px" :checked="checked" v-model="checked" @change='selectAll'>全选</el-checkbox>
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="dict in dict.type.shqx"-->
|
||||
<!-- :key="dict.label"-->
|
||||
<!-- :label="dict.label"-->
|
||||
<!-- :value="dict.label"-->
|
||||
<!-- >-->
|
||||
<el-option
|
||||
v-for="dict in dict.type.shqx"
|
||||
:key="dict.label"
|
||||
:label="dict.label"
|
||||
:value="dict.label"
|
||||
v-for="dict in shqxList"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
@ -324,6 +331,7 @@ import {getName} from "../../utils/fuint";
|
||||
import {addStaff, createStaffQrCode, delStaff, getStaff, listStaff, queryStaff, updateStaff} from "@/api/staff/staff";
|
||||
import {getDuty, listDuty} from "@/api/staff/duty";
|
||||
import html2canvas from "html2canvas";
|
||||
import {getDicts} from "@/api/order/data";
|
||||
|
||||
export default {
|
||||
name: "StaffList",
|
||||
@ -333,6 +341,7 @@ export default {
|
||||
return {
|
||||
// 二维码类型
|
||||
type:"",
|
||||
checked:false,
|
||||
// 二维码图片url
|
||||
imgUrl:"",
|
||||
// 角色列表
|
||||
@ -351,6 +360,7 @@ export default {
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
storeOptions: [],
|
||||
shqxList: [],
|
||||
// role:[],
|
||||
posPrem:'',
|
||||
posOptions:[
|
||||
@ -481,6 +491,22 @@ export default {
|
||||
// this.getStoreList();
|
||||
},
|
||||
methods: {
|
||||
selectAll(val){
|
||||
this.auditPrem = []
|
||||
if (val) {
|
||||
this.shqxList.forEach((item) => {
|
||||
this.auditPrem.push(item.dictValue)
|
||||
this.form.auditPrem = this.auditPrem.toString();
|
||||
})
|
||||
} else {
|
||||
this.auditPrem = []
|
||||
}
|
||||
},
|
||||
getAuditPrem(){
|
||||
getDicts("shqx").then(res => {
|
||||
this.shqxList = res.data
|
||||
})
|
||||
},
|
||||
// 获取员工码
|
||||
getStaffQRcode(id){
|
||||
createStaffQrCode(id).then(res => {
|
||||
@ -543,11 +569,16 @@ export default {
|
||||
handleNodeClick2(data) {
|
||||
this.form.appletPrem = JSON.stringify(data);
|
||||
},
|
||||
getCheckbox(){
|
||||
getCheckbox(val){
|
||||
console.log("this.auditPrem.toString()",this.auditPrem.toString())
|
||||
// this.form.writeOff = this.writeOff.toString();
|
||||
// this.form.specialPrem = this.specialPrem.toString();
|
||||
this.form.auditPrem = this.auditPrem.toString();
|
||||
if (val.length === this.shqxList.length) {
|
||||
this.checked = true
|
||||
} else {
|
||||
this.checked = false
|
||||
}
|
||||
},
|
||||
// 页面跳转
|
||||
toTarget(url) {
|
||||
@ -637,6 +668,7 @@ export default {
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.checked = false;
|
||||
this.reset();
|
||||
},
|
||||
changePassword(){
|
||||
@ -660,6 +692,7 @@ export default {
|
||||
if (response.data==1){
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.checked = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
@ -673,6 +706,7 @@ export default {
|
||||
if (response.data==1){
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.checked = false;
|
||||
this.getList();
|
||||
}else {
|
||||
this.$modal.msgError("手机号已存在");
|
||||
@ -684,11 +718,12 @@ export default {
|
||||
});
|
||||
},
|
||||
// 修改按钮操作
|
||||
handleUpdate(row) {
|
||||
async handleUpdate(row) {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
const id = row.id || this.ids;
|
||||
getStaff(id).then(response => {
|
||||
await this.getAuditPrem()
|
||||
await getStaff(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.form.password = '123456'
|
||||
// this.form.refundPassword = '123456'
|
||||
@ -699,7 +734,11 @@ export default {
|
||||
this.auditPrem = []
|
||||
this.auditPrem = this.form.auditPrem.split(",");
|
||||
console.log("this.form.auditPrem",this.auditPrem)
|
||||
|
||||
if (this.auditPrem.length === this.shqxList.length) {
|
||||
this.checked = true
|
||||
} else {
|
||||
this.checked = false
|
||||
}
|
||||
}
|
||||
if (this.writeOff.length > 0){
|
||||
this.writeOff = this.form.writeOff.split(",");
|
||||
|
@ -247,15 +247,15 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="消费条件" prop="meetCondition">
|
||||
<el-input v-if="form.type == 'orderAmount'" v-model="form.meetCondition">
|
||||
<el-input v-if="form.type == 'orderAmount'" maxlength="10" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" v-model="form.meetCondition">
|
||||
<template slot="prepend">订单金额消费满</template>
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
<el-input v-if="form.type == 'payAmount'" v-model="form.meetCondition">
|
||||
<el-input v-if="form.type == 'payAmount'" maxlength="10" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" v-model="form.meetCondition">
|
||||
<template slot="prepend">实际金额消费满</template>
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
<el-input v-if="form.type == 'refuleNum'" v-model="form.meetCondition">
|
||||
<el-input v-if="form.type == 'refuleNum'" maxlength="10" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" v-model="form.meetCondition">
|
||||
<template slot="prepend">加油数量消费满</template>
|
||||
<template slot="append">单位(升/立方)</template>
|
||||
</el-input>
|
||||
@ -266,7 +266,7 @@
|
||||
<el-col :span="24">
|
||||
<el-form-item label="提成金额" prop="royaltyRate">
|
||||
<el-input v-model="form.royaltyRate" placeholder="请输入提成">
|
||||
<el-select v-model="select" style="width: 70px" slot="append" placeholder="请选择">
|
||||
<el-select v-model="select" maxlength="10" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" style="width: 70px" slot="append" placeholder="请选择">
|
||||
<el-option label="元" value="元"></el-option>
|
||||
<el-option label="%" value="%"></el-option>
|
||||
</el-select>
|
||||
@ -553,7 +553,9 @@ export default {
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.form.royaltyRate = this.form.royaltyRate + this.select
|
||||
if (/^\d+$/.test(this.form.royaltyRate)){
|
||||
this.form.royaltyRate = this.form.royaltyRate + this.select
|
||||
}
|
||||
this.form.staffRoleGroup = this.staffRoleGroup.toString()
|
||||
if (this.form.id) {
|
||||
updateCommission(this.form).then(response => {
|
||||
|
@ -61,7 +61,7 @@ public interface StaffCommissionService extends IService<StaffCommission> {
|
||||
* @param amount 订单金额
|
||||
* @param payAmount 实付金额
|
||||
* @param oilLiters 油品消费升数
|
||||
* @param type 订单类型(油品、非油品)
|
||||
* @param type 订单类型(1.油品、2.非油品、3.储值卡、4.囤油卡、5.礼品卡、6.加油)
|
||||
* @param orderNo 关联订单号
|
||||
*/
|
||||
void countStaffCommission(Integer staffId,Integer storeId,Double amount,Double payAmount,Double oilLiters,String type,String orderNo);
|
||||
|
@ -174,7 +174,6 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (type.equals("2") && staffCommission.getCommissionSource().equals("非油品")){
|
||||
for (String staffRoleGroup : staffRoleGroups) {
|
||||
@ -197,6 +196,150 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
|
||||
}
|
||||
}
|
||||
}
|
||||
// 按照实付金额计算提成
|
||||
if (staffCommission.getType().equals("payAmount")) {
|
||||
if (payAmount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
if (unit.equals("元")) {
|
||||
commissionRecord.setAmount(royaltyRate);
|
||||
}
|
||||
if (unit.equals("%")) {
|
||||
commissionRecord.setAmount(payAmount * (royaltyRate / 100));
|
||||
}
|
||||
}
|
||||
}
|
||||
commissionRecordService.insertRecord(commissionRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (type.equals("3") && staffCommission.getCommissionSource().equals("储值卡")){
|
||||
for (String staffRoleGroup : staffRoleGroups) {
|
||||
if (staff.getRoleId().equals(staffRoleGroup)) {
|
||||
commissionRecord.setStaffId(staffId);
|
||||
commissionRecord.setStoreId(storeId);
|
||||
commissionRecord.setType(type);
|
||||
commissionRecord.setDescription(staffCommission.getCommissionSource() + "订单出售提成");
|
||||
commissionRecord.setOrderNo(orderNo);
|
||||
Double royaltyRate = Double.valueOf(staffCommission.getRoyaltyRate().substring(0, staffCommission.getRoyaltyRate().length() - 1));
|
||||
String unit = staffCommission.getRoyaltyRate().substring(staffCommission.getRoyaltyRate().length() - 1);
|
||||
// 按照订单金额计算提成
|
||||
if (staffCommission.getType().equals("orderAmount")) {
|
||||
if (amount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
if (unit.equals("元")) {
|
||||
commissionRecord.setAmount(royaltyRate);
|
||||
}
|
||||
if (unit.equals("%")) {
|
||||
commissionRecord.setAmount(amount * (royaltyRate / 100));
|
||||
}
|
||||
}
|
||||
}
|
||||
// 按照实付金额计算提成
|
||||
if (staffCommission.getType().equals("payAmount")) {
|
||||
if (payAmount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
if (unit.equals("元")) {
|
||||
commissionRecord.setAmount(royaltyRate);
|
||||
}
|
||||
if (unit.equals("%")) {
|
||||
commissionRecord.setAmount(payAmount * (royaltyRate / 100));
|
||||
}
|
||||
}
|
||||
}
|
||||
commissionRecordService.insertRecord(commissionRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (type.equals("4") && staffCommission.getCommissionSource().equals("囤油卡")){
|
||||
for (String staffRoleGroup : staffRoleGroups) {
|
||||
if (staff.getRoleId().equals(staffRoleGroup)) {
|
||||
commissionRecord.setStaffId(staffId);
|
||||
commissionRecord.setStoreId(storeId);
|
||||
commissionRecord.setType(type);
|
||||
commissionRecord.setDescription(staffCommission.getCommissionSource() + "订单出售提成");
|
||||
commissionRecord.setOrderNo(orderNo);
|
||||
Double royaltyRate = Double.valueOf(staffCommission.getRoyaltyRate().substring(0, staffCommission.getRoyaltyRate().length() - 1));
|
||||
String unit = staffCommission.getRoyaltyRate().substring(staffCommission.getRoyaltyRate().length() - 1);
|
||||
// 按照订单金额计算提成
|
||||
if (staffCommission.getType().equals("orderAmount")) {
|
||||
if (amount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
if (unit.equals("元")) {
|
||||
commissionRecord.setAmount(royaltyRate);
|
||||
}
|
||||
if (unit.equals("%")) {
|
||||
commissionRecord.setAmount(amount * (royaltyRate / 100));
|
||||
}
|
||||
}
|
||||
}
|
||||
// 按照实付金额计算提成
|
||||
if (staffCommission.getType().equals("payAmount")) {
|
||||
if (payAmount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
if (unit.equals("元")) {
|
||||
commissionRecord.setAmount(royaltyRate);
|
||||
}
|
||||
if (unit.equals("%")) {
|
||||
commissionRecord.setAmount(payAmount * (royaltyRate / 100));
|
||||
}
|
||||
}
|
||||
}
|
||||
commissionRecordService.insertRecord(commissionRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (type.equals("5") && staffCommission.getCommissionSource().equals("礼品卡")){
|
||||
for (String staffRoleGroup : staffRoleGroups) {
|
||||
if (staff.getRoleId().equals(staffRoleGroup)) {
|
||||
commissionRecord.setStaffId(staffId);
|
||||
commissionRecord.setStoreId(storeId);
|
||||
commissionRecord.setType(type);
|
||||
commissionRecord.setDescription(staffCommission.getCommissionSource() + "订单出售提成");
|
||||
commissionRecord.setOrderNo(orderNo);
|
||||
Double royaltyRate = Double.valueOf(staffCommission.getRoyaltyRate().substring(0, staffCommission.getRoyaltyRate().length() - 1));
|
||||
String unit = staffCommission.getRoyaltyRate().substring(staffCommission.getRoyaltyRate().length() - 1);
|
||||
// 按照订单金额计算提成
|
||||
if (staffCommission.getType().equals("orderAmount")) {
|
||||
if (amount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
if (unit.equals("元")) {
|
||||
commissionRecord.setAmount(royaltyRate);
|
||||
}
|
||||
if (unit.equals("%")) {
|
||||
commissionRecord.setAmount(amount * (royaltyRate / 100));
|
||||
}
|
||||
}
|
||||
}
|
||||
// 按照实付金额计算提成
|
||||
if (staffCommission.getType().equals("payAmount")) {
|
||||
if (payAmount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
if (unit.equals("元")) {
|
||||
commissionRecord.setAmount(royaltyRate);
|
||||
}
|
||||
if (unit.equals("%")) {
|
||||
commissionRecord.setAmount(payAmount * (royaltyRate / 100));
|
||||
}
|
||||
}
|
||||
}
|
||||
commissionRecordService.insertRecord(commissionRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (type.equals("6") && staffCommission.getCommissionSource().equals("加油")){
|
||||
for (String staffRoleGroup : staffRoleGroups) {
|
||||
if (staff.getRoleId().equals(staffRoleGroup)) {
|
||||
commissionRecord.setStaffId(staffId);
|
||||
commissionRecord.setStoreId(storeId);
|
||||
commissionRecord.setType(type);
|
||||
commissionRecord.setDescription(staffCommission.getCommissionSource() + "订单出售提成");
|
||||
commissionRecord.setOrderNo(orderNo);
|
||||
Double royaltyRate = Double.valueOf(staffCommission.getRoyaltyRate().substring(0, staffCommission.getRoyaltyRate().length() - 1));
|
||||
String unit = staffCommission.getRoyaltyRate().substring(staffCommission.getRoyaltyRate().length() - 1);
|
||||
// 按照订单金额计算提成
|
||||
if (staffCommission.getType().equals("orderAmount")) {
|
||||
if (amount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
if (unit.equals("元")) {
|
||||
commissionRecord.setAmount(royaltyRate);
|
||||
}
|
||||
if (unit.equals("%")) {
|
||||
commissionRecord.setAmount(amount * (royaltyRate / 100));
|
||||
}
|
||||
}
|
||||
}
|
||||
// 按照实付金额计算提成
|
||||
if (staffCommission.getType().equals("payAmount")) {
|
||||
if (payAmount >= Double.valueOf(staffCommission.getMeetCondition())) {
|
||||
|
@ -4,8 +4,8 @@
|
||||
<sql id="selectHangBill">
|
||||
select hb.*,ms.real_name,ms.mobile,cu.unit_name,cu.person_credit,cu.contact_mobile,cu.credit_limit
|
||||
from hang_bill hb
|
||||
inner join mt_staff ms on hb.staff_id = ms.id
|
||||
inner join credit_unit cu on hb.credit_unit_id = cu.id
|
||||
left join mt_staff ms on hb.staff_id = ms.id
|
||||
left join credit_unit cu on hb.credit_unit_id = cu.id
|
||||
</sql>
|
||||
|
||||
<select id="selectHangBillList" resultType="com.fuint.business.order.vo.HangBillVo">
|
||||
|
Loading…
Reference in New Issue
Block a user