Browse Source

公海线索权限配置

zhaoxiaohai 3 years ago
parent
commit
dce16d8add

+ 21 - 36
packageA/publicClue/detail.js

@@ -1,6 +1,9 @@
 const _Http = getApp().globalData.http;
 Page({
     data: {
+        isAdmin: getApp().globalData.auth.wCustomer.options.some(v => v == "admin"), //是否具有管理权限
+        isLeader: false, //是否为负责人
+
         tabsActive: 0, //tabs 选中项
         sat_orderclueid: "",
         detail: '',
@@ -18,37 +21,20 @@ Page({
             num: 132
         }],
         tabbarList: [{
-            icon: "icon-bianji",
-            label: "编辑"
-        }, {
-            icon: "icon-zhuanyi",
-            label: "分配"
-        }, {
-            icon: "icon-dibu-tuihui",
-            label: "撤回"
-        }, /* {
-            icon: "icon-zhuanyi",
-            label: "更换负责人"
-        }, */ {
-            icon: "icon-dibu-jieshu",
-            label: "作废"
-        }],
-        oldtabbarList: [{
-            icon: "icon-bianji",
-            label: "编辑"
-        },{
-            icon: "icon-dibu-tuihui",
-            label: "撤回"
-        }, {
-            icon: "icon-bianji",
-            label: "编辑"
-        }, {
-            icon: "icon-dibu-jieshu",
-            label: "作废"
-        }, {
-            icon: "icon-zhuanyi",
-            label: "更换负责人"
-        }],
+                icon: "icon-bianji",
+                label: "编辑"
+            }, {
+                icon: "icon-zhuanyi",
+                label: "分配"
+            }, {
+                icon: "icon-dibu-tuihui",
+                label: "撤回"
+            },
+            {
+                icon: "icon-dibu-jieshu",
+                label: "作废"
+            }
+        ],
     },
     onLoad(options) {
         this.setData({
@@ -71,6 +57,7 @@ Page({
                 title: res.msg,
                 icon: "none"
             });
+
             this.setData({
                 detail: res.data,
                 briefs: [{
@@ -171,8 +158,6 @@ Page({
                     return item.label != '编辑' && item.label != '撤回'
                 })
             }
-            
-
 
             /* 更新列表中状态 */
             let page = getCurrentPages().find(v => v.__route__ == 'packageA/publicClue/index');
@@ -253,7 +238,7 @@ Page({
                 break;
             case "分配":
                 wx.navigateTo({
-                url: `/packageA/publicClue/distribution?data=${JSON.stringify(this.data.detail)}`,
+                    url: `/packageA/publicClue/distribution?data=${JSON.stringify(this.data.detail)}`,
                 })
                 break;
             case "作废":
@@ -276,12 +261,12 @@ Page({
                             setTimeout(() => {
                                 wx.navigateBack()
                                 getCurrentPages().forEach(v => {
-                                    if (v.__route__=="packageA/publicClue/index") {
+                                    if (v.__route__ == "packageA/publicClue/index") {
                                         v.getList(true)
                                     }
                                 })
                             }, 300)
-                            
+
                         })
                     }
                 })

+ 1 - 1
packageA/publicClue/detail.wxml

@@ -14,4 +14,4 @@
 </Yl_FunTabs>
 
 <!-- 底部 -->
-<Yl_Tabbar list='{{tabbarList}}' bind:callback="tabbarOnClick" />
+<Yl_Tabbar wx:if="{{isAdmin}}" list='{{tabbarList}}' bind:callback="tabbarOnClick" />

+ 15 - 13
packageA/publicClue/index.js

@@ -6,13 +6,15 @@ Page({
      * 页面的初始数据
      */
     data: {
+        insert: getApp().globalData.auth.worderclue_public.options.some(v => v == 'insert'), //查询新增权限
+        allot: getApp().globalData.auth.worderclue_public.options.some(v => v == 'allot'), //分配
         navList: [{
             label: "全部",
             icon: "icon-webxialaxuanxiangjiantou",
             color: "",
             width: "",
             id: "1"
-        },{
+        }, {
             label: "排序",
             icon: "icon-shengxu",
             color: "",
@@ -21,11 +23,11 @@ Page({
         }],
         classShow: false,
         classActions: [{
-            name:'全部',
-            index:''
+            name: '全部',
+            index: ''
         }],
         content: {
-            "isExport":0,
+            "isExport": 0,
             "nocache": true,
             "version": 1,
             "pageNumber": 1,
@@ -87,12 +89,12 @@ Page({
         })
     },
     /* 获取线索状态 */
-    getTypeList () {
+    getTypeList() {
         _Http.basic({
             "classname": "sysmanage.develop.optiontype.optiontype",
             "method": "optiontypeselect",
             "content": {
-                "typename":'cluepublic'
+                "typename": 'cluepublic'
             }
         }).then(res => {
             console.log("状态列表", res)
@@ -102,13 +104,13 @@ Page({
             })
             let classActions = res.data.map(item => {
                 return {
-                    name:item.value,
-                    index:item.remarks
+                    name: item.value,
+                    index: item.remarks
                 }
             })
             classActions.unshift({
-                name:'全部',
-                index:''
+                name: '全部',
+                index: ''
             })
             this.setData({
                 classActions: classActions
@@ -151,7 +153,7 @@ Page({
     /* 去添加 */
     openType() {
         wx.navigateTo({
-          url: '/packageA/publicClue/addClue',
+            url: '/packageA/publicClue/addClue',
         })
     },
     /* 选择添加报价形式 */
@@ -209,11 +211,11 @@ Page({
         } else {
             this.setData({
                 "content.where.status": detail.index,
-                "content.where.allocationstatus":'',
+                "content.where.allocationstatus": '',
                 'navList[0].label': detail.name
             })
         }
-        
+
         this.classClose();
         this.getList(true)
     },

+ 2 - 2
packageA/publicClue/index.wxml

@@ -4,7 +4,7 @@
 <view class="total">共{{content.total}}个</view>
 
 <My_listBox id='ListBox' height="{{listHeight}}" bind:getlist='getList'>
-    <list list='{{list}}' />
+    <list list='{{list}}' allot="{{allot}}" />
     <view style="height: 80rpx;" />
 </My_listBox>
 
@@ -43,4 +43,4 @@
 </Yl_filtrate>
 
 <!-- 浮动按钮 -->
-<Yl_FloatingButton bindtap="openType" />
+<Yl_FloatingButton wx:if="{{insert}}" bindtap="openType" />

+ 6 - 5
packageA/publicClue/modules/list/list.js

@@ -4,10 +4,11 @@ Component({
      * 组件的属性列表
      */
     properties: {
-        list:Array
+        list: Array,
+        allot: Boolean
     },
     options: {
-        addGlobalClass:true
+        addGlobalClass: true
     },
 
     /**
@@ -21,12 +22,12 @@ Component({
      * 组件的方法列表
      */
     methods: {
-        distribution ({
+        distribution({
             currentTarget
         }) {
             wx.navigateTo({
-              url: `/packageA/publicClue/distribution?data=${JSON.stringify(currentTarget.dataset.item)}`,
+                url: `/packageA/publicClue/distribution?data=${JSON.stringify(currentTarget.dataset.item)}`,
             })
         }
     }
-})
+})

+ 1 - 1
packageA/publicClue/modules/list/list.wxml

@@ -8,7 +8,7 @@
     <view class="exp line-1">手机号:<text>{{item.phonenumber || '--'}}</text></view>
     <view class="exp line-1">来源:<text>{{item.cluesource ? item.cluesource : '--'}}</text></view>
     <view class="exp line-1">线索类型:<text>{{item.cluetype ? item.cluetype : '--'}}</text></view>
-    <van-button wx:if="{{item.allocationstatus=='待分配'}}" custom-class='action' catchtap="distribution" data-item="{{item}}">分配</van-button>
+    <van-button wx:if="{{allot && item.allocationstatus=='待分配'}}" custom-class='action' catchtap="distribution" data-item="{{item}}">分配</van-button>
 </navigator>
 
 <My_empty wx:if="{{list.length == 0}}" />