员工提成

This commit is contained in:
许允枞 2024-11-08 17:36:34 +08:00
parent 14c65eb517
commit aa080206a3
4 changed files with 606 additions and 372 deletions

View File

@ -1,5 +1,6 @@
{
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
"pages": [
//pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/Login/launcherPage",
"style": {
@ -328,23 +329,27 @@
"navigationBarTitleText": "修改密码",
"navigationStyle": "custom"
}
}
,{
"path" : "pages/order/editPrice",
"style" :
},
{
"path": "pages/order/editPrice",
"style": {
"navigationBarTitleText": "价格编辑",
"navigationStyle": "custom"
}
},
{
"path" : "pages/index/selectProject",
"style" :
{
"navigationBarTitleText" : "选择项目",
"path": "pages/index/selectProject",
"style": {
"navigationBarTitleText": "选择项目",
"navigationStyle": "custom"
}
},
{
"path": "pages/staff/goRoyalty",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": true
}
}
],
"globalStyle": {

View File

@ -58,7 +58,7 @@
<text>联系用户</text>
</view>
</view>
<view class="x-box">
<view class="x-box" v-if="roleSelect == 'shop'">
<view class="h-title">订单详情</view>
<!-- <view class="on-input">-->
<!-- <view class="o-left">订单编号</view>-->
@ -248,6 +248,7 @@ export default {
tbindex: 1,
isOnline: 1,
hge: false,
roleSelect:'',
orImages:false,
show: false,
xling: false,
@ -298,6 +299,13 @@ export default {
},
onShow() {
this.getindex()
uni.getStorage({
key: 'roleSelect',
success: (res) => {
console.log('读取缓存',res)
this.roleSelect = res.data
}
})
},
methods: {
chooseBank(e) {

205
pages/staff/goRoyalty.vue Normal file
View File

@ -0,0 +1,205 @@
<template>
<view class="container">
<!-- 时间选择器 -->
<view class="date-picker">
<view @click="show = true" class="date-picker-button">选择月份</view>
<span class="selected-date" v-if="rescueStartMonth">已选时间: {{ rescueStartMonth }}</span>
<view @click="clearDate" class="clear-date-button" v-if="rescueStartMonth">清除时间</view>
</view>
<u-datetime-picker
:show="show"
v-model="value1"
mode="year-month"
@input="selectDate"
></u-datetime-picker>
<!-- 总提成金额 -->
<view class="total-royalty">
总提成金额: ¥{{ totalRoyalty.toFixed(2) }}
</view>
<!-- 提成记录列表 -->
<view v-for="item in list" :key="item.node_id" class="list-item">
<view class="row">
<span class="label">项目名称:</span>
<span class="project-name">{{ item.projectName }}</span>
</view>
<!-- <view class="row">-->
<!-- <span class="label">处理人:</span>-->
<!-- <span class="handler-name">{{ item.handlerName }}</span>-->
<!-- </view>-->
<view class="row">
<span class="label">提成金额:</span>
<span class="royalty-amount">¥{{ item.royaltyAmount.toFixed(2) }}</span>
</view>
<view class="row">
<span class="label">完成时间:</span>
<span class="create-time">{{ formatDate(item.node_create_time) }}</span>
</view>
</view>
</view>
</template>
<script>
import request from "@/utils/request";
export default {
data() {
return {
list: [],
page: 1,
size: 10,
total: 0,
pages: 2,
totalRoyalty: 0,
value1: Number(new Date()),
rescueStartMonth: null,
show: false,
};
},
onLoad() {
this.getRoyalty();
},
onReachBottom() {
if (this.page < this.pages) {
this.page++;
this.getRoyalty();
}
},
methods: {
getRoyalty() {
request({
url: '/system/info/getRoyaltyListApp',
method: 'get',
params: {
pageNo: this.page,
pageSize: this.size,
rescueStartMonth: this.rescueStartMonth
}
}).then(res => {
console.log('提成记录', res.data);
this.total = res.data.total;
this.page = res.data.current;
this.pages = res.data.pages;
this.list = [...this.list, ...res.data.records];
request({
url: '/system/info/getRoyaltySumApp',
method: 'get',
params: {
rescueStartMonth: this.rescueStartMonth
}
}).then(res => {
console.log('累计提成', res.data);
this.totalRoyalty = res.data.royaltyAmountSum;
})
});
},
selectDate() {
this.show = false;
const date = new Date(this.value1);
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
this.rescueStartMonth = `${year}-${month}`;
console.log("选择的年-月:", this.rescueStartMonth);
this.list = [];
this.getRoyalty();
},
clearDate() {
this.rescueStartMonth = null;
this.value1 = Number(new Date());
this.list = [];
this.totalRoyalty = 0;
this.getRoyalty();
},
formatDate(timestamp) {
const date = new Date(timestamp);
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
const hours = date.getHours().toString().padStart(2, '0');
const minutes = date.getMinutes().toString().padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}`;
}
},
};
</script>
<style lang="scss">
.container {
padding: 10px;
background-color: #f9f9f9;
}
.date-picker {
display: flex;
align-items: center;
margin-bottom: 15px;
justify-content: space-between;
}
.date-picker-button {
background-color: #4CAF50;
color: #fff;
padding: 10px 20px;
border-radius: 5px;
text-align: center;
font-weight: bold;
cursor: pointer;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.selected-date {
color: #666;
font-size: 14px;
margin-left: 10px;
}
.clear-date-button {
background-color: #ff4d4d;
color: #fff;
padding: 10px 20px;
border-radius: 5px;
text-align: center;
font-weight: bold;
cursor: pointer;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
margin-left: 10px;
}
.total-royalty {
font-size: 16px;
font-weight: bold;
color: #333;
padding: 15px;
margin-bottom: 10px;
background-color: #ffffff;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
text-align: center;
}
.list-item {
padding: 15px;
margin-bottom: 10px;
background-color: #ffffff;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.row {
display: flex;
align-items: center;
margin: 5px 0;
}
.label {
font-weight: bold;
color: #333;
min-width: 80px;
}
.project-name, .handler-name, .royalty-amount, .create-time {
color: #666;
}
</style>

View File

@ -3,15 +3,15 @@
<view class="content">
<view style="width: 100%; height: 44px;"></view>
<view class="top-ail">
<view class="dix">
<view class="touxiang">
<image :src="baseUrl +user.avatar" mode=""></image>
</view>
<view class="">
<view class="t-title">{{user.realName}}</view>
<view class="t-tel">{{user.phonenumber}}</view>
</view>
</view>
<!-- <view class="dix">-->
<!-- <view class="touxiang">-->
<!-- <image :src="baseUrl +user.avatar" mode=""></image>-->
<!-- </view>-->
<!-- <view class="">-->
<!-- <view class="t-title">{{user.realName}}</view>-->
<!-- <view class="t-tel">{{user.phonenumber}}</view>-->
<!-- </view>-->
<!-- </view>-->
<!-- 三项 -->
<!-- 店铺商铺 -->
@ -29,6 +29,17 @@
<uni-icons type="right" color="#999999" size="16"></uni-icons>
</view>
</view>
<view class="on-input" @click="goRoyalty()">
<view class="dix">
<view class="d-icon">
<image src="../../static/detection/zhaq.png" mode=""></image>
</view>
<view class="aa">提成记录</view>
</view>
<view class="">
<uni-icons type="right" color="#999999" size="16"></uni-icons>
</view>
</view>
</view>
<view class="ian-box">
<!-- <view class="on-input">
@ -141,6 +152,11 @@
url:"/pages/staff/golist"
})
},
goRoyalty(){
uni.navigateTo({
url:"/pages/staff/goRoyalty"
})
},
getdianpu(){
uni.navigateTo({
url:"/pages/my/shoporder"