gx
queenwuli
2021-01-09 79f11f34546a394ab1c16ba427c31e9b59d05523
hive-app/pages/workbench/serviceOrderList.vue
@@ -42,7 +42,7 @@
                     </view>
                     
                  </view>
                  <view class="flex flex-v right">
                  <view class="flex flex-v right" style="flex: 0 0 70px;">
                     <text class="gray mb-5">{{item.timeLength}}分钟</text>
                     <text class="gray mt-5" v-for="(op, index) in item.projs">{{op.beautyName || '-'}}</text>
                     <text class="mt-10" :class="item.status==7 || item.status==8?'gray':'blue'">{{item.status | formatStatus}}</text>
@@ -53,6 +53,11 @@
                     v-if="isShowCancelBtn(item.status, item.projs, item.staffId)" 
                     @click.stop="cancelOrder(item.id)">
                     取消
                  </text>
                  <text class="blue-btn small-btn ml-10"
                     v-if="isShowOrder(item.status)"
                     @click.stop="">
                     确认预约
                  </text>
                  <text class="blue-btn small-btn ml-10" 
                     v-if="isShowStartServiceBtn(item.status, item.projs)"
@@ -91,7 +96,11 @@
            },
            {
               state: 1,
               name: '待预约'
               name: '待确认'
            },
            {
               state: 8,
               name: '待排班'
            },
            {
               state: 2,
@@ -120,6 +129,15 @@
         }
         this.loadList();
         this.userId = this.$httpUtils.getRoleInfo().id;
         // 判断权限
         // #ifdef APP-PLUS
         if(!this.$utils.hasPermission('fwdgl.add')){
            let webView = this.$mp.page.$getAppWebview();
            webView.setTitleNViewButtonStyle(0, {
                width: 0,
            });
         }
         // #endif
      },
      onNavigationBarButtonTap(Object){
         if(Object.key === 'add'){
@@ -145,25 +163,30 @@
         isShowFooter(status, items, staffId){
            return this.isShowCancelBtn(status, items, staffId) ||
               this.isShowStartServiceBtn(status, items) ||
               this.isShowEndServiceBtn(status, items)
               this.isShowEndServiceBtn(status, items) ||
               this.isShowOrder(status)
         },
         // 是否显示取消按钮
         isShowCancelBtn(status, items, staffId){
            // 美疗师和下单顾问可以取消服务
            let isEnable = (items.some((item) => item.id == this.userId)) || (this.userId == staffId);
            return status != 5 && status != 6 && status != 7 && status != 8 && isEnable;
            return status != 5 && status != 6 && status != 7 && status != 8 && isEnable && this.$utils.hasPermission('fwdgl.cancel');
         },
         // 是否显示确认预约
         isShowOrder(status){
            return status == 1 && this.$utils.hasPermission('fwdgl.qryy');
         },
         // 是否显示开始服务按钮
         isShowStartServiceBtn(status, items){
            // 只有美疗师本人才可以开始服务
            let isEnable = items.some((item) => item.id == this.userId)
            return status == 4 && isEnable;
            return status == 4 && isEnable && this.$utils.hasPermission('fwdgl.begin');
         },
         // 是否显示结束服务按钮
         isShowEndServiceBtn(status, items){
            // 只有美疗师本人才可以开始服务
            let isEnable = items.some((item) => item.id == this.userId)
            return status == 5 && isEnable;
            return status == 5 && isEnable && this.$utils.hasPermission('fwdgl.end');
         },
         search(val){
            this.queryKey = val;