123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718 |
- <template>
- <view :style="colorStyle">
- <view class='commission-details'>
- <view class='search acea-row row-between-wrapper'
- v-if="recordType != 1 && recordType != 4 && recordType!=5 && recordType!= 6 && recordType!= 7">
- <view class='input'>
- <text class="iconfont icon-sousuo4"></text>
- <input placeholder='搜索用户名称' placeholder-class='placeholder' v-model="keyword" @confirm="submitForm"
- confirm-type='search' name="search"></input>
- </view>
- </view>
- <view class="nav" v-if="recordType==6">
- <view class="nav-item" :class="{'action': sixType == 1}" @click="getYjList('re',1)">
- 销售业绩
- </view>
- <view class="nav-item" :class="{'action': sixType == 2}" @click="getYjList('re',2)">
- 手工业绩
- </view>
- </view>
- <view class="nav" v-if="recordType==7">
- <view class="nav-item" :class="{'action': sevenType == 51}" @click="getJt('re',51)">
- 销售业绩
- </view>
- <view class="nav-item" :class="{'action': sevenType == 70}" @click="getJt('re',70)">
- 手工业绩
- </view>
- </view>
- <timeSlot @changeTime="changeTime" v-if="recordType!=5 && recordType!=7"></timeSlot>
- <view class='sign-record'>
- <view class="top_num"
- v-if="recordType != 4 && recordList.length && recordType!=5 && recordType!=6 && recordType!=7">
- 支出:¥{{expend || 0}} 收入:¥{{income || 0}}
- </view>
- <view class="top_num" v-if="recordType==6">
- 销售业绩:{{sale_sum || 0}} 手工业绩:{{craft_sum || 0}}
- </view>
- <view class="top_num" v-if="recordType==7">
- 销售业绩:{{ staffInfo.sale_performance || 0}}
- 手工业绩:{{staffInfo.craft_performance || 0}}
- 当前完成预约订单:{{staffInfo.service_count || 0}}
- </view>
- <view class="top_num top_num_2" v-if="recordType == 5">
- <text>
- 当前股权:{{staffInfo.shareholding*1}}
- </text>
- <text>
- 总股权:{{staffInfo.total_shareholding}}
- </text>
- </view>
- <view class="box" v-if="recordType !=7">
- <block v-for="(item,index) in recordList" :key="index" v-if="recordList.length>0">
- <view class='list' @click="showDetail(item)">
- <view class='item'>
- <!-- <view class='data'>{{item.time}}</view> -->
- <view class='listn'>
- <!-- <block v-for="(child,indexn) in item.child" :key="indexn"> -->
- <view class='itemn1 acea-row row-between-wrapper'>
- <view class="flex-g">
- <view class='name line2'>
- <text v-if="recordType!=5 && recordType!=6">{{item.title}}</text>
- <text v-else>{{item.content}}</text>
- <text class="status_badge default"
- v-if="recordType == 4 && item.status == 0">待审核</text>
- <text class="status_badge error"
- v-if="recordType == 4 && item.status == 2">未通过</text>
- </view>
- <view class="mark" v-if="recordType == 4 && item.mark && item.status !== 1">
- {{item.mark}}
- </view>
- <view v-if="recordType!=5 && recordType!=6">{{item.add_time}}</view>
- <view v-else>{{item.create_time}}</view>
- </view>
- <template v-if="recordType!=5 && recordType!=6">
- <view class='num font-color' v-if="item.pm == 1">+{{item.number}}</view>
- <view class='num' v-else>-{{item.number}}</view>
- </template>
- <template v-if="recordType == 5">
- <view class='num font-color' v-if="item.pm == 1">+{{item.shareholding}}
- </view>
- <view class='num' v-else>-{{item.shareholding}}</view>
- </template>
- <template v-if="recordType == 6">
- <view class='num font-color' v-if="item.pm == 1">+{{item.performance}}
- </view>
- <view class='num' v-else>-{{item.performance}}</view>
- </template>
- </view>
- <!-- </block> -->
- </view>
- </view>
- </view>
- </block>
- </view>
- <view class="box" v-else>
- <block v-for="(item,index) in recordList" :key="index" v-if="recordList.length>0">
- <view class='list' @click="showDetail(item)">
- <view class='item'>
- <view class='listn'>
- <view class='itemn1 acea-row row-between-wrapper'>
- <view class="flex-g">
- <view class='name line2'>
- 业绩值:{{item.step}}
- </view>
- <view>
- <view>
- 1. 奖励{{item.shareholding}}股权
- </view>
- <view>
- 2. 提升{{item.ratio}}%提成比
- </view>
- </view>
- </view>
- <view class='status ' v-if="sevenType == 51"
- :class="{'font-color': staffInfo.sale_performance*1 < item.step*1}">
- {{staffInfo.sale_performance*1 >= item.step*1 ? '已完成': '未达到'}}
- </view>
- <view class='status font-color' v-if="sevenType == 70"
- :class="{'font-color': staffInfo.craft_performance*1 < item.step*1}">
- {{staffInfo.craft_performance*1 >= item.step*1 ? '已完成': '未达到'}}
- </view>
- </view>
- </view>
- </view>
- </view>
- </block>
- </view>
- </view>
- </view>
- <view style="height: 120rpx;" v-if="recordType == 5">
-
- </view>
- <view class="tx" @click="navto('/pages/users/user_payment/index?is_gq=1')" v-if="recordType == 5">
- 立即提现
- </view>
- <home v-if="navigation"></home>
- <!-- #ifdef MP -->
- <!-- <authorize v-if="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize> -->
- <!-- #endif -->
- </view>
- </template>
- <script>
- import {
- moneyList,
- getSpreadInfo,
- getGqList,
- getStaffInfo,
- getUserInfo,
- getYjList,
- getJt
- } from '@/api/user.js';
- import {
- toLogin
- } from '@/libs/login.js';
- import {
- mapGetters
- } from "vuex";
- import emptyPage from '@/components/emptyPage.vue'
- import home from '@/components/home';
- import colors from '@/mixins/color.js';
- import timeSlot from '@/components/timeSlot/index.vue'
- export default {
- components: {
- emptyPage,
- home,
- timeSlot
- },
- mixins: [colors],
- data() {
- return {
- sevenType: 51,
- sixType: 1,
- sale_sum: 0,
- craft_sum: 0,
- timer: '',
- userInfo: {},
- staffInfo: {},
- name: '',
- keyword: '',
- type: 0,
- page: 1,
- limit: 15,
- loading: false,
- loadend: false,
- loadTitle: '加载更多',
- recordList: [],
- recordType: 0,
- recordCount: 0,
- extractCount: 0,
- times: [],
- start: 0,
- stop: 0,
- income: '',
- expend: '',
- isShowAuth: false
- };
- },
- computed: mapGetters(['isLogin']),
- onLoad(options) {
- this.type = options.type;
- if (!this.isLogin) {
- toLogin();
- }
- },
- onShow: function() {
- uni.removeStorageSync('form_type_cart');
- let type = this.type;
- if (type == 1) {
- uni.setNavigationBarTitle({
- title: "佣金记录"
- });
- this.name = '提现总额';
- this.recordType = 3;
- this.getRecordList();
- // this.getRecordListCount();
- } else if (type == 2) {
- uni.setNavigationBarTitle({
- title: "佣金记录"
- });
- this.name = '佣金明细';
- this.recordType = 3;
- this.getRecordList();
- // this.getRecordListCount();
- } else if (type == 4) {
- uni.setNavigationBarTitle({
- title: "提现记录"
- });
- this.name = '提现明细';
- this.recordType = 4;
- this.getRecordList();
- // this.getRecordListCount();
- } else if (type == 5) {
- uni.setNavigationBarTitle({
- title: "股权记录"
- });
- this.recordType = 5;
- this.name = '股权明细';
- this.getStaffInfo();
- } else if (type == 6) {
- uni.setNavigationBarTitle({
- title: "业绩记录"
- });
- this.recordType = 6;
- this.name = '业绩明细';
- this.getStaffInfo()
- // this.getYjList()
- } else if (type == 7) {
- uni.setNavigationBarTitle({
- title: "阶梯奖励"
- });
- this.recordType = 7;
- this.name = '阶梯奖励';
- this.getStaffInfo()
- } else {
- uni.showToast({
- title: '参数错误',
- icon: 'none',
- duration: 1000,
- mask: true,
- success: function(res) {
- setTimeout(function() {
- // #ifndef H5
- uni.navigateBack({
- delta: 1,
- });
- // #endif
- // #ifdef H5
- history.back();
- // #endif
- }, 1200)
- },
- });
- }
- },
- methods: {
- getJt(type, id) {
- if (type == 're') {
- this.recordList = []
- }
- if (id) {
- this.sevenType = id
- }
- getJt({
- gid: this.sevenType,
- page: 1,
- limit: 100
- }).then(res => {
- this.recordList = res.data.list
- })
- },
- getYjList(type, sixType) {
- let that = this;
- if (sixType) {
- that.sixType = sixType
- }
- let page = that.page;
- let limit = that.limit;
- if (type = 're') {
- page = 1
- that.loading = false
- that.loadend = false
- this.recordList = []
- }
- if (that.loading) return;
- if (that.loadend) return;
- getYjList({
- page: page,
- limit: limit,
- create_time: that.timer,
- member_id: that.staffInfo.id,
- type: that.sixType
- }).then(res => {
- this.sale_sum = res.data.sale_sum;
- this.craft_sum = res.data.craft_sum;
- this.recordList = this.recordList.concat(res.data.list);
- let loadend = res.data.list.length < that.limit;
- that.loadend = loadend;
- that.loadTitle = loadend ? '没有更多内容啦~' : '加载更多';
- that.page += 1;
- that.loading = false;
- }).catch(err => {
- that.loading = false;
- that.loadTitle = '加载更多';
- })
- },
- // 显示详细
- showDetail(item) {
- console.log(item);
- if (this.type == 6) {
- if (item.recharge) {
- uni.showModal({
- title: '充值订单',
- content: `用户ID:${item.recharge.uid},充值${item.recharge.price}获得销售业绩`,
- showCancel: false,
- });
- }
- if (item.subscribe) {
- const info = item.info[0];
- uni.showModal({
- title: '服务项目',
- content: `订单:${item.order_name},用户:${item.real_name},项目:${info.store_name},支付金额:${info.pay_price}`,
- showCancel: false,
- });
- }
- if (item.store) {
- uni.showModal({
- title: '普通商品',
- content: `订单:${item.order_id},用户:${item.store.real_name},支付金额:${item.store.pay_price}获得销售业绩`,
- showCancel: false,
- });
- }
- } else {
- if (item.mark) {
- uni.showModal({
- title: '详细说明',
- content: item.mark,
- showCancel: false,
- });
- } else if (item.content) {
- uni.showModal({
- title: '详细说明',
- content: item.content,
- showCancel: false,
- });
- }
- }
- },
- navto(url) {
- uni.navigateTo({
- url
- })
- },
- onLoadFun() {
- this.isShowAuth = false
- },
- // 授权关闭
- authColse: function(e) {
- this.isShowAuth = e
- },
- submitForm() {
- this.page = 1;
- this.limit = 20;
- this.loadend = false;
- this.status = false;
- this.$set(this, 'recordList', []);
- this.$set(this, 'times', []);
- this.getRecordList();
- },
- getTimeStr(timestamp) {
- let date;
- if (timestamp) {
- date = new Date(timestamp * 1000);
- } else {
- date = new Date();
- }
- const year = date.getFullYear();
- const month = date.getMonth() + 1; // 月份从 0 开始,所以需要加 1
- const day = date.getDate();
- return year + '/' + (month > 9 ? month : '0' + month) + '/' + (day > 9 ? day : '0' + day)
- },
- changeTime(time) {
- console.log(time, 'time')
- if (this.recordType == 6) {
- let times = ''
- if (time.start == 0 && time.stop == 0) {
- console.log('全部')
- this.timer = '2020/01/01-' + this.getTimeStr()
- } else {
- this.timer = this.getTimeStr(time.start) + '-' + this.getTimeStr(time.stop)
- }
- console.log(this.timer, 'timer')
- this.getYjList()
- } else {
- this.start = time.start
- this.stop = time.stop
- this.page = 1;
- // this.loading = false;
- this.loadend = false;
- this.$set(this, 'recordList', []);
- this.getRecordList();
- }
- },
- getGqList() {
- let that = this;
- let page = that.page;
- let limit = that.limit;
- if (that.loading) return;
- if (that.loadend) return;
- getGqList({
- page: page,
- limit: limit,
- uid: that.userInfo.uid
- }).then(res => {
- this.recordList = this.recordList.concat(res.data.list)
- let loadend = res.data.list.length < that.limit;
- that.loadend = loadend;
- that.loadTitle = loadend ? '没有更多内容啦~' : '加载更多';
- that.page += 1;
- that.loading = false;
- }).catch(err => {
- that.loading = false;
- that.loadTitle = '加载更多';
- })
- },
- getStaffInfo() {
- let that = this
- getUserInfo().then(res => {
- that.userInfo = res.data
- if (this.recordType == 5) {
- that.getGqList();
- }
- getStaffInfo({
- uid: res.data.uid
- }).then(ress => {
- that.staffInfo = ress.data;
- if (that.recordType == 6) {
- that.getYjList()
- }
- if (that.recordType == 7) {
- that.getJt('re', 51)
- }
- })
- })
- },
- getRecordList: function() {
- let that = this;
- let page = that.page;
- let limit = that.limit;
- let recordType = that.recordType;
- if (that.loading) return;
- if (that.loadend) return;
- that.loading = true;
- that.loadTitle = '';
- moneyList({
- keyword: this.keyword,
- start: this.start,
- stop: this.stop,
- page: page,
- limit: limit
- }, recordType).then(res => {
- this.expend = res.data.expend;
- this.income = res.data.income;
- // for (let i = 0; i < res.data.time.length; i++) {
- // // if (!this.times.includes(res.data.time[i])) {
- // this.times.push(res.data.time[i])
- // this.recordList.push({
- // time: res.data.time[i],
- // child: []
- // })
- // // }
- // }
- // // for (let x = 0; x < this.times.length; x++) {
- // for (let j = 0; j < res.data.list.length; j++) {
- // // if (this.times[x] === res.data.list[j].time_key) {
- // // }
- // this.recordList[j].child.push(res.data.list[j])
- // }
- // // }
- this.recordList = this.recordList.concat(res.data.list)
- let loadend = res.data.list.length < that.limit;
- that.loadend = loadend;
- that.loadTitle = loadend ? '没有更多内容啦~' : '加载更多';
- that.page += 1;
- that.loading = false;
- }).catch(err => {
- that.loading = false;
- that.loadTitle = '加载更多';
- })
- },
- getRecordListCount: function() {
- let that = this;
- getSpreadInfo().then(res => {
- that.recordCount = res.data.commissionCount;
- that.extractCount = res.data.extractCount;
- });
- }
- },
- onReachBottom: function() {
- if (this.recordType == 5) {
- this.getGqList()
- } else if (this.recordType == 6) {
- this.getYjList()
- } else {
- this.getRecordList();
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .commission-details .search {
- width: 100%;
- background-color: var(--view-theme);
- border-bottom: 1px solid #f2f2f2;
- height: 86rpx;
- padding: 0 30rpx;
- box-sizing: border-box;
- .input {
- width: 100%;
- height: 60rpx;
- border-radius: 50rpx;
- background-color: #f5f5f5;
- position: relative;
- input {
- height: 100%;
- font-size: 26rpx;
- width: 100%;
- padding-left: 60rpx;
- }
- .placeholder {
- color: #bbb;
- }
- .iconfont {
- position: absolute;
- left: 28rpx;
- color: #999;
- font-size: 28rpx;
- top: 50%;
- transform: translateY(-50%);
- }
- }
- }
- .box {
- border-radius: 14rpx;
- margin: 0 30rpx;
- overflow: hidden;
- }
- .sign-record {
- // margin-top: 20rpx;
- }
- .commission-details {
- .promoterHeader {
- .headerCon {
- .money {
- font-size: 36rpx;
- .num {
- font-family: 'Guildford Pro';
- }
- }
- }
- }
- }
- .top_num {
- padding: 30rpx;
- font-size: 26rpx;
- color: #666;
- }
- .top_num_2 {
- display: flex;
- justify-content: space-around;
- position: sticky;
- top: 0;
- background-color: rgba(245, 245, 245, 1);
- }
- .tx {
- background-color: #1890FF;
- color: #fff;
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- text-align: center;
- line-height: 80rpx;
- font-size: $uni-font-size-lg;
- }
- .radius15 {
- border-radius: 14rpx 14rpx 0 0;
- }
- .sign-record {
- .list {
- .item {
- .listn {
- .itemn1 {
- border-bottom: 1rpx solid #eee;
- padding: 22rpx 24rpx;
- flex-wrap: nowrap;
- .flex-g {
- flex-grow: 1;
- padding-right: 30rpx;
- .status {
- font-size: 28rpx;
- }
- }
- .name {
- font-size: 28rpx;
- color: #282828;
- margin-bottom: 10rpx;
- }
- .num {
- font-size: 36rpx;
- font-family: 'Guildford Pro';
- color: #16ac57;
- &.font-color {
- color: #e93323 !important;
- }
- }
- }
- }
- }
- }
- }
- .mark {
- margin-bottom: 10rpx;
- }
- .status_badge {
- display: inline-block;
- height: 30rpx;
- border-radius: 4rpx;
- font-size: 20rpx;
- line-height: 30rpx;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- margin-left: 12rpx;
- padding: 0 6rpx 0;
- }
- .success {
- background: rgba(24, 144, 255, .1);
- color: #1890FF;
- }
- .default {
- background: #f5f5f5;
- color: #282828;
- ;
- }
- .error {
- background: rgba(233, 51, 35, .1);
- color: #E93323;
- }
- .nav {
- display: flex;
- justify-content: space-evenly;
- .nav-item {
- width: 50%;
- line-height: 60rpx;
- text-align: center;
- color: #1890FF;
- border: 1px solid #1890FF;
- font-size: 28rpx;
- background-color: #fff;
- }
- .action {
- background-color: #1890FF;
- color: #fff;
- font-weight: bold;
- }
- }
- </style>
|