gx
queenwuli
2021-01-09 79f11f34546a394ab1c16ba427c31e9b59d05523
hive-app/pages/workbench/index.vue
@@ -1,143 +1,148 @@
<template>
   <!-- 工作台 -->
   <view class="container">
   <view class="container" @click="isShow=false">
      <!-- #ifndef H5 -->
      <view class="status_bar"></view>
      <!-- #endif -->
      <view class="header flex align-center justify-between">
         <text class="font-18 dark-gray">HIVE</text>
         <view>
            <text class="icon gray iconfont iconsousuo mr-15"></text>
      <view class="header">
         <text class="font-16 dark-gray">{{userInfo.shopName}}</text>
         <view class="flex align-center">
            <text class="icon gray iconfont iconsousuo mr-15" @click="linkToMember"></text>
            <text class="icon gray iconfont iconjia" @click.stop="isShow=!isShow"></text>
         </view>
         <popover class="popup-content" v-show="isShow">
            <view class="popup-content-item">
               <navigator url="../member/editMember" hover-class="none">
                  <text class="icon iconfont iconjia"></text>
                  <text class="text">新增会员</text>
               </navigator>
            </view>
            <view class="popup-content-item">
               <text class="icon iconfont iconsaomiao"></text>
               <text class="text">扫一扫</text>
            </view>
         </popover>
      </view>
      <popover class="popup-content" v-show="isShow">
         <view class="popup-item flex align-center">
            <text class="icon white iconfont iconjia mr-5"></text>
            <text class="white font-14 popup-content-text">新增会员</text>
         </view>
         <view class="popup-item flex align-center">
            <text class="icon white iconfont iconsaomiao mr-5"></text>
            <text class="white font-14 popup-content-text">扫一扫</text>
         </view>
      </popover>
      <view class="condition">
      <view class="condition flex justify-around">
         <view class="eyes">
            <text class="iconfont iconyanjing2"></text>
            <!-- <text class="iconfont iconbiyan"></text> -->
            <text class="iconfont"
               :class="isShowAssets?'iconyanjing2':'iconbiyan'"
               @click="toggleAssets">
            </text>
         </view>
         <view class="flex justify-around">
            <view class="flex flex-v align-center">
               <text class="font-17">¥ 1000</text>
               <text>今日订单</text>
            </view>
            <view class="flex flex-v align-center">
               <text class="font-17">¥ 100</text>
               <text>今日消耗</text>
            </view>
            <view class="flex flex-v align-center">
               <text class="font-17">¥ 90</text>
               <text>手工提成</text>
            </view>
         <view class="flex flex-v align-center">
            <text class="font-17">¥ {{handleAssets(userAchieve.orderCash)}}</text>
            <text>今日订单</text>
         </view>
         <view class="flex flex-v align-center">
            <text class="font-17">¥ {{handleAssets(userAchieve.hisConsume)}}</text>
            <text>今日消耗</text>
         </view>
         <view class="flex flex-v align-center">
            <text class="font-17">¥ {{handleAssets(userAchieve.projCommission)}}</text>
            <text>手工提成</text>
         </view>
      </view>
      <view class="content-item mt-10">
      <view class="content-item mt-10" v-if="this.$utils.hasPermission('ddgl,xfjl,linyong')">
         <text class="title">订单</text>
         <view class="flex align-center mt-10">
            <view class="list-item">
            <view class="list-item" v-if="this.$utils.hasPermission('ddgl.add')">
               <navigator url="./selectCustomer" hover-class="none">
                  <image class="content-icon" src="../../static/images/order1.png"></image>
                  <text class="font-12 mt-10 font-dark">新建订单</text>
                  <image class="icon" src="../../static/images/order1.png"></image>
                  <text>新建订单</text>
               </navigator>
            </view>
            <view class="list-item">
               <navigator url="./orderList"  hover-class="none">
                  <image class="content-icon" src="../../static/images/order2.png"></image>
                  <text class="font-12 mt-10 font-dark">待付款</text>
               </navigator>
            </view>
            <view class="list-item">
               <navigator url="./orderList"  hover-class="none">
                  <image class="content-icon" src="../../static/images/order3.png"></image>
                  <text class="font-12 mt-10 font-dark">已付款</text>
               </navigator>
            </view>
            <view class="list-item">
               <navigator url="./"  hover-class="none">
                  <image class="content-icon" src="../../static/images/order4.png"></image>
                  <text class="font-12 mt-10 font-dark">领用</text>
            <template v-if="$utils.hasPermission('xfjl')">
               <view class="list-item">
                  <navigator url="./orderList?status=1"  hover-class="none">
                     <image class="icon" src="../../static/images/order2.png"></image>
                     <text>待付款</text>
                  </navigator>
               </view>
               <view class="list-item">
                  <navigator url="./orderList?status=2"  hover-class="none">
                     <image class="icon" src="../../static/images/order3.png"></image>
                     <text>已付款</text>
                  </navigator>
               </view>
            </template>
            <view class="list-item" v-if="this.$utils.hasPermission('linyong')">
               <navigator url="./receive"  hover-class="none">
                  <image class="icon" src="../../static/images/order4.png"></image>
                  <text>领用</text>
               </navigator>
            </view>
         </view>
      </view>
      <view class="content-item mt-10">
      <view class="content-item mt-10" v-if="this.$utils.hasPermission('fwdgl,fwjl')">
         <text class="title">项目/服务</text>
         <view class="flex align-center mt-10">
            <view class="list-item">
            <view class="list-item" v-if="this.$utils.hasPermission('fwdgl.add')">
               <navigator url="./selectCustomer?type=2"  hover-class="none">
                  <image class="content-icon" src="../../static/images/order1.png"></image>
                  <text class="font-12 mt-10 font-dark">新建服务单</text>
                  <image class="icon" src="../../static/images/order1.png"></image>
                  <text>新建服务单</text>
               </navigator>
            </view>
            <view class="list-item">
               <navigator url="./serviceOrderList"  hover-class="none">
                  <image class="content-icon" src="../../static/images/sever2.png"></image>
                  <text class="font-12 mt-10 font-dark">待服务</text>
               </navigator>
            </view>
            <view class="list-item">
               <navigator url="./serviceOrderList"  hover-class="none">
                  <image class="content-icon" src="../../static/images/sever3.png"></image>
                  <text class="font-12 mt-10 font-dark">服务中</text>
               </navigator>
            </view>
            <view class="list-item">
               <navigator url="./serviceOrderList"  hover-class="none">
                  <image class="content-icon" src="../../static/images/sever4.png"></image>
                  <text class="font-12 mt-10 font-dark">服务完成</text>
               </navigator>
            </view>
            <template v-if="$utils.hasPermission('fwjl')">
               <view class="list-item">
                  <navigator url="./serviceOrderList?status=1"  hover-class="none">
                     <image class="icon" src="../../static/images/sever1.png"></image>
                     <text>待确定</text>
                  </navigator>
               </view>
               <view class="list-item">
                  <navigator url="./serviceOrderList?status=4"  hover-class="none">
                     <image class="icon" src="../../static/images/sever2.png"></image>
                     <text>待服务</text>
                  </navigator>
               </view>
               <view class="list-item">
                  <navigator url="./serviceOrderList?status=5"  hover-class="none">
                     <image class="icon" src="../../static/images/sever3.png"></image>
                     <text>服务中</text>
                  </navigator>
               </view>
            </template>
         </view>
      </view>
      <view class="content-item mt-10">
      <view class="content-item mt-10" v-if="this.$utils.hasPermission('appKanban')">
         <text class="title">待办</text>
         <view class="flex align-center mt-10">
            <view class="list-item">
               <navigator url="./"  hover-class="none">
                  <image class="content-icon" src="../../static/images/commission1.png"></image>
                  <text class="font-12 mt-10 font-dark">看板</text>
            <view class="list-item" v-if="this.$utils.hasPermission('appKanban,gjjl,notice')">
               <navigator url="./board"  hover-class="none">
                  <image class="icon" src="../../static/images/commission1.png"></image>
                  <text>看板</text>
               </navigator>
            </view>
            <view class="list-item">
               <navigator url="./"  hover-class="none">
                  <image class="content-icon" src="../../static/images/sever1.png"></image>
                  <text class="font-12 mt-10 font-dark">客户预约</text>
            <view class="list-item" v-if="this.$utils.hasPermission('gjjl')">
               <navigator url="./followRecords"  hover-class="none">
                  <image class="icon" src="../../static/images/commission2.png"></image>
                  <text>跟进记录</text>
               </navigator>
            </view>
            <view class="list-item">
            <view class="list-item" v-if="this.$utils.hasPermission('notice')">
               <navigator url="./"  hover-class="none">
                  <image class="content-icon" src="../../static/images/commission2.png"></image>
                  <text class="font-12 mt-10 font-dark">跟进记录</text>
               </navigator>
            </view>
            <view class="list-item">
               <navigator url="./"  hover-class="none">
                  <image class="content-icon" src="../../static/images/commission3.png"></image>
                  <text class="font-12 mt-10 font-dark">通知</text>
                  <image class="icon" src="../../static/images/commission3.png"></image>
                  <text>通知</text>
               </navigator>
            </view>
         </view>
      </view>
      <view class="content-item mt-10">
      <view class="content-item mt-10" v-if="this.$utils.hasPermission('kccx,pandian')">
         <text class="title">仓库</text>
         <view class="flex align-center mt-10">
            <view class="flex flex-v align-center list-item">
               <image class="content-icon" src="../../static/images/warehouse1.png"></image>
               <text class="font-12 mt-10 font-dark">库存查询</text>
            <view class="list-item" v-if="this.$utils.hasPermission('kccx')">
               <navigator url="./stockSearch"  hover-class="none">
                  <image class="icon" src="../../static/images/warehouse1.png"></image>
                  <text>库存查询</text>
               </navigator>
            </view>
            <view class="flex flex-v align-center list-item">
               <image class="content-icon" src="../../static/images/warehouse2.png"></image>
               <text class="font-12 mt-10 font-dark">盘点</text>
            <view class="list-item" v-if="this.$utils.hasPermission('pandian')">
               <navigator url="./check/index"  hover-class="none">
                  <image class="icon" src="../../static/images/warehouse2.png"></image>
                  <text>盘点</text>
               </navigator>
            </view>
         </view>
      </view>
@@ -152,17 +157,49 @@
      },
      data(){
         return{
            isShow:false
            userInfo: {},
            userAchieve: {},
            isShow:false,
            isShowAssets: false
         }
      },
      onLoad() {
         document.addEventListener('click', () => {
            this.isShow = false
         }, false)
      onShow() {
         this.getUserAchieve();
         this.getUserInfo();
      },
      onHide() {
         this.isShow = false;
      },
      methods:{
         appear(){
         linkToMember(){
            getApp().globalData.isFocus = true;
            uni.switchTab({
               url: '../member/index'
            });
         },
         getUserInfo(){
            let roleInfo = this.$httpUtils.getRoleInfo();
            this.userInfo = roleInfo || {};
         },
         getUserAchieve(){
            this.$httpUtils.request('/api/user/findUserAchieve/1').then((res) => {
               if(res.status == 200){
                  let {achieve} = res.mapInfo;
                  this.userAchieve = achieve || {};
               }else{
                  this.userAchieve = {};
               }
            })
         },
         // 显示隐藏业绩
         toggleAssets(){
            this.isShowAssets = !this.isShowAssets;
         },
         handleAssets(val){
            if(this.isShowAssets){
               return this.$filters.formatNum(val);
            }
            return '***';
         },
         linkTo(val){
            uni.navigateTo({
@@ -176,32 +213,38 @@
<style>
   page{
      background: #F6F6F8;
      height: 100%;
   }
   .icon {
      font-size: 18px;
      text-align: center;
      font-family: texticons;
   }
   .container{
      padding: 0 10px;
      min-height: 100%;
   }
   .header{
      padding: 12px 5px;
      position: relative;
      padding: 0 5px 10px;
      display: flex;
      align-items: center;
      justify-content: space-between;
   }
    .header .icon {
      font-size: 16px;
      text-align: center;
      font-family: texticons;
   }
   .condition{
      position: relative;
      background: #518EFF;
      padding: 15px 22px;
      padding: 15px 20px;
      border-radius: 4px;
      font-size: 14px;
      color: #FFFFFF;
      line-height: 30px;
   }
   .condition .eyes{
      /* position: absolute;
      position: absolute;
      right: 10px;
      top: 10px; */
      text-align: right;
      top: 10px;
   }
   .condition .eyes .iconfont{
      font-size: 18px;
@@ -221,27 +264,38 @@
   .list-item{
      width: 25%;
      text-align: center;
      font-size: 12px;
      color: #111111;
   }
   .content-icon{
      width: 30px;
      height: 30px;
   .list-item .icon{
      width: 26px;
      height: 26px;
      display: block;
      margin: 0 auto 10px;
   }
   
   .popup-content{
      position: absolute;
      right: 9px;
      top: 48px;
      padding-left: 10px;
      z-index: 999;
      right: 0;
      top: 32px;
      padding: 5px 0;
   }
   .popup-content-text{
      width: 100%;
   .popup-content-item{
      padding: 0 10px;
      color: #FFFFFF;
      font-size: 14px;
   }
   .popup-content-item .icon{
      font-size: 14px;
      margin-right: 10px;
   }
   .popup-content-item .text{
      border-bottom: 1px solid gray;
      padding: 10px 10px 10px 0;
      line-height: 32px;
      display: inline-block;
   }
   .popup-content .popup-item:nth-last-of-type(1) .popup-content-text{
   .popup-content-item:nth-last-of-type(1) .text{
      border-bottom: 0;
   }
</style>