Przeglądaj źródła

bug修复,样式调整

qymljy 3 dni temu
rodzic
commit
f7509d02bf

+ 1 - 1
components/Yl_field/index.wxml

@@ -209,7 +209,7 @@
         <view wx:if="{{item.slot}}" style="margin-right: 8rpx;">
           <slot name="{{item.slot}}" />
         </view>
-        <Yl_VoiceInput wx:if="{{ item.type=='text'|| item.type=='textarea'  && languagecode =='ZH' && !item.disabled}}" data-index="{{index}}" bindcallback="onVoiceInput" />
+        <Yl_VoiceInput wx:if="{{ item.type=='text'|| item.type=='textarea' || item.type == 'digit'  && languagecode =='ZH' && !item.disabled}}" data-index="{{index}}" bindcallback="onVoiceInput" />
       </view>
     </van-field>
   </view>

+ 1 - 0
components/Yl_field/index.wxss

@@ -1,6 +1,7 @@
 .label-class {
     word-break: break-all;
     margin-top: 6rpx;
+    font-size: 28rpx;
 }
 
 .picker {

Plik diff jest za duży
+ 0 - 0
miniprogram_npm/@vant/weapp/stepper/index.wxss


+ 6 - 6
prsx/activity/insert.js

@@ -249,7 +249,7 @@ Page({
         detail
     }) {
         this.setData({
-            showAll: detail
+            showAll: detail,
         })
     },
     async submit() {
@@ -377,11 +377,11 @@ Page({
             })
         }, 300)
     },
-    onChange({
-        detail
-    }) {
-        this.data.condition = detail;
-    },
+    // onChange({
+    //     detail
+    // }) {
+    //     this.data.condition = detail;
+    // },
     onSearch({
         detail
     }) {

+ 1 - 1
prsx/contract/index.wxml

@@ -26,7 +26,7 @@
 		</view>
 		<view class="replenish">
 			<text style="color: #666;">有效期:</text>
-			<text>{{item.begdate + '-' +item.enddate}}</text>
+			<text>{{item.begdate + '' +item.enddate}}</text>
 		</view>
 		<view class="replenish">
 			<text style="color: #666;">签约日期:</text>

+ 1 - 1
prsx/dealer/Contract/index.wxml

@@ -32,7 +32,7 @@
 	</view>
 	<view class="replenish">
 		<text style="color: #666;">有效期:</text>
-		<text>{{item.begdate + '-' +item.enddate}}</text>
+		<text>{{item.begdate + '' +item.enddate}}</text>
 	</view>
 	<view class="replenish">
 		<text style="color: #666;">签约日期:</text>

+ 10 - 6
prsx/dealer/detail.js

@@ -156,7 +156,11 @@ Page({
       value: res.data.areanames
     }, {
       label: "状态",
-      value: res.data.status
+      value: getApp().globalData.Language.getMapText(res.data.status),
+      style: `color:${this.data.sColors[res.data.status]}`
+    }, {
+      label: "备注",
+      value: res.data.remarks
     }];
     /* 系统信息 */
     let list2 = [{
@@ -275,14 +279,14 @@ Page({
         label: "医院",
         icon: "icon-jingxiaoshang",
         model: "#Hospital"
-      }, {
-        label: "合同",
-        icon: "icon-tabhetong",
-        model: "#Contract"
       }, {
         label: "地址管理",
         icon: "icon-tabdizhi",
         model: "#Address"
+      }, {
+        label: "合同",
+        icon: "icon-tabhetong",
+        model: "#Contract"
       }];
     if (!isLeader) {
       let res = await getApp().agentOrNot("sa_agents", this.data.sa_agentsid),
@@ -358,7 +362,7 @@ Page({
             pageTotal
           } = Component.data.content,
           id = model == "#Address" ? this.data.detail.sys_enterpriseid : this.data.detail.sa_agentsid;
-          id = model == "#Salesperson" ? this.data.detail.sys_enterpriseid : this.data.detail.sa_agentsid;
+        id = model == "#Salesperson" ? this.data.detail.sys_enterpriseid : this.data.detail.sa_agentsid;
         if (model == "#Files") init = true;
         if (total == null || init) {
           Component.getList(id, init);

+ 10 - 2
prsx/dealer/index.js

@@ -72,7 +72,7 @@ Page({
                 return res.code == 1 ? res.data : []
             })
         }, {
-            label: "开发状态",
+            label: "状态",
             index: null,
             showName: "value", //显示字段
             valueKey: "status", //返回Key
@@ -83,7 +83,15 @@ Page({
             }, {
                 value: '禁用'
             }]
-        }]
+        }, {
+          label: "合作类型",
+          index: null,
+          showName: "value", //显示字段
+          valueKey: "type", //返回Key
+          selectKey: "value", //传参 代表选着字段 不传参返回整个选择对象
+          value: "", //选中值
+          list: await _Http.getTypes('cooperatetype', _Http)
+      }]
         this.setData({
             filtratelist
         })

+ 0 - 3
prsx/doctors/detail.js

@@ -132,9 +132,6 @@ Page({
         }, {
             label: "最近编辑时间",
             value: res.data.changedate
-        }, {
-            label: "删除原因",
-            value: res.data.deletereason
         }, {
             label: "转手次数",
             value: res.data.leader[0] ? res.data.leader[0].leadernum : 0

+ 1 - 0
prsx/doctors/detail.wxml

@@ -22,6 +22,7 @@
     <Record slot="操作" id="Record" ownertable='sa_doctor' ownerid='{{sa_doctorid}}' />
     <Files slot="附件" id="Files" ownertable='sa_doctor' ownerid='{{sa_doctorid}}' disabled="{{detail.status != '已终止'}}" />
 </Yl_FunTabs>
+<view style="height: 80rpx;" />
 <!-- 底部 -->
 <Yl_Tabbar wx:if="{{tabbarList.length}}" list='{{tabbarList}}' bind:callback="tabbarOnClick" />
 <wxs src='../../utils/wxmlQueryPer.wxs' module="per" />

+ 3 - 4
prsx/doctors/index.js

@@ -53,10 +53,9 @@ Page({
         this.getList(true)
 
         _Http.basic({
-            "id": 20220929085401,
+            "id": 20221013104401,
             "content": {
-                "ownertable": "sa_doctor",
-                "ownerid": ""
+                "sys_systemtagid": 62,
             }
         }).then(res => {
             if (res.code == 1) {
@@ -68,7 +67,7 @@ Page({
                     valueKey: "tag", //返回Key
                     selectKey: "tag", //传参 代表选着字段 不传参返回整个选择对象
                     value: "", //选中值
-                    list: res.data.option
+                    list: res.data
                 }]
                 this.setData({
                     filtratelist

+ 1 - 1
prsx/hospital/Contract/index.wxml

@@ -32,7 +32,7 @@
 	</view>
 	<view class="replenish">
 		<text style="color: #666;">有效期:</text>
-		<text>{{item.begdate + '-' +item.enddate}}</text>
+		<text>{{item.begdate + '' +item.enddate}}</text>
 	</view>
 	<view class="replenish">
 		<text style="color: #666;">签约日期:</text>

+ 16 - 8
prsx/hospital/detail.js

@@ -120,6 +120,12 @@ Page({
     }, {
       label: "预估手术总量",
       value: res.data.totalop
+    }, {
+      label: "省市县",
+      value: res.data.province + res.data.city + res.data.county
+    }, {
+      label: "详细地址",
+      value: res.data.address
     }, {
       label: "医院床位",
       value: res.data.bed
@@ -246,10 +252,6 @@ Page({
       tabsList = [{
         label: "详细信息",
         icon: "icon-tabxiangxixinxi1"
-      }, {
-        label: "关联经销商",
-        icon: "icon-jingxiaoshang",
-        model: "#Dealer"
       }, {
         label: "科室",
         icon: "icon-keshi",
@@ -270,6 +272,10 @@ Page({
         label: "地址管理",
         icon: "icon-tabdizhi",
         model: "#Address"
+      }, {
+        label: "关联经销商",
+        icon: "icon-jingxiaoshang",
+        model: "#Dealer"
       }];
     if (!isLeader) {
       let res = await getApp().agentOrNot("sa_customers", this.data.sa_customersid),
@@ -311,15 +317,17 @@ Page({
         icon: "color-bianji",
         label: "编辑"
       })
-      tabbarList.push({
-        icon: "icon-shanchu",
-        label: "作废"
-      })
     }
     if (this.data.appAuth.options.find(v => v == 'viewRepetition')) tabbarList.push({
       icon: "icon-a-shouyejingangquhehuoren",
       label: "查看重复"
     });
+    if (isLeader || isAdmin) {
+      tabbarList.push({
+        icon: "icon-shanchu",
+        label: "作废"
+      })
+    }
     this.setData({
       tabbarList,
       isLeader,

+ 11 - 6
prsx/hospital/detail.wxml

@@ -16,18 +16,19 @@
 <view style="height: 20rpx;" />
 <!-- 功能 -->
 <Yl_FunTabs list='{{tabsList}}' active='{{tabsActive}}' bind:onChenge="tabsChange">
+  <Trace resource='医院管理' slot='跟进动态' id='Trace' ownertable='sa_customers' ownerid='{{sa_customersid}}' disabled="{{detail.status != '已终止'}}" ownerid1='{{detail.sys_enterpriseid}}' />
     <Preview slot='详细信息' list1='{{list1}}' list2='{{list2}}' />
-    <Trace resource='医院管理' slot='跟进动态' id='Trace' ownertable='sa_customers' ownerid='{{sa_customersid}}' disabled="{{detail.status != '已终止'}}" ownerid1='{{detail.sys_enterpriseid}}' />
-    <Address slot='地址管理' id='Address' disabled="{{(per.query(appAuth.options,'address')||isAdmin||isLeader)&& detail.status != '已终止'}}" />
-    <Dealer slot='关联经销商' id='Dealer' />
+    <Department slot='科室' id='Department' disabled="{{isLeader}}" />
     <Doctors slot='医生' id='Doctors' disabled="{{isLeader}}" />
     <Surgery slot='预估手术量' id='Surgery' disabled="{{isLeader}}" />
-    <Contract slot='合同' id='Contract' />
     <Product slot='推荐产品' id='Product' disabled="{{isLeader}}" />
-    <Department slot='科室' id='Department' disabled="{{isLeader}}" />
-    <Record slot="操作" id="Record" ownertable='sa_customers' ownerid='{{sa_customersid}}' />
+    <Address slot='地址管理' id='Address' disabled="{{(per.query(appAuth.options,'address')||isAdmin||isLeader)&& detail.status != '已终止'}}" />
+    <Dealer slot='关联经销商' id='Dealer' />
+    <Contract slot='合同' id='Contract' />
     <Files slot="附件" id="Files" ownertable='sa_customers' ownerid='{{sa_customersid}}' disabled="{{detail.status != '已终止'}}" />
+    <Record slot="操作" id="Record" ownertable='sa_customers' ownerid='{{sa_customersid}}' />
 </Yl_FunTabs>
+<view style="height: 90rpx;" />
 <!-- 底部 -->
 <Yl_Tabbar wx:if="{{tabbarList.length}}" list='{{tabbarList}}' bind:callback="tabbarOnClick" />
 <wxs src='../../utils/wxmlQueryPer.wxs' module="per" />
@@ -52,6 +53,10 @@
         <view class="exp" style="color: {{item.chars['province'] ||item.chars['city'] ||item.chars['county'] ? 'red' : '#666666'}}">省市县:{{(item.province + item.city +item.county) || ' --' }}</view>
         <view class="exp" style="color: {{item.chars['grade'] ? 'red' : '#666666'}}">医院等级:{{item.grade||" --"}}</view>
         <view class="exp" style="color: {{item.chars['totalop'] ? 'red' : '#666666'}}">预估手术总量:{{item.totalop||" --"}}</view>
+        <view class="replenish">
+            <text style="color: #666;">省市县:</text>
+            <text>{{item.province + item.city +item.county  || ' --'}}</text>
+        </view>
         <view class="exp">开发状态:<text style="color: {{sColors[item.status]}}" F>{{item.status||" --"}}</text></view>
         <view class="exp">成交状态:<text style="color: {{sColors[item.tradingstatus]}}">{{item.tradingstatus||" --"}}</text></view>
         <view class="exp" style="color: {{item.chars['name'] ? 'red' : '#666666'}}">负责人:{{item.leader[0].name||" --"}}</view>

+ 69 - 3
prsx/tryOut/detail.js

@@ -173,6 +173,9 @@ Page({
     let list1 = [{
       label: "编号",
       value: res.data.billno
+    }, {
+      label: "试用类型",
+      value: res.data.type
     }, {
       label: "医院",
       value: res.data.hospitalname
@@ -185,6 +188,9 @@ Page({
     }, {
       label: "经销商",
       value: res.data.agentname
+    }, {
+      label: "领用人",
+      value: res.data.user
     }, {
       label: "申请日期",
       value: res.data.applydate
@@ -197,6 +203,10 @@ Page({
     }, {
       label: "备注",
       value: res.data.remarks
+    }, {
+      label: "状态",
+      value: getApp().globalData.Language.getMapText(res.data.status),
+      style: `color:${this.data.sColors[res.data.status]}`
     }, {
       label: "负责人",
       value: res.data.leader.name
@@ -242,6 +252,52 @@ Page({
           url: `/prsx/tryOut/insert?data=${JSON.stringify(data)}`,
         })
         break;
+      case "提交":
+        wx.showModal({
+          content: '是否确定提交该试用申请?',
+          complete: ({
+            confirm
+          }) => {
+            if (confirm) _Http.basic({
+              "content": {
+                "sa_trialid": data.sa_trialid
+              },
+              "id": 2025121114130102,
+            }).then(res => {
+              wx.showToast({
+                title: res.code == '1' ? getApp().globalData.Language.getMapText('提交成功') : res.msg,
+                icon: "none"
+              });
+              if (res.code == '1') setTimeout(() => {
+                this.getDetail();
+              }, 300)
+            })
+          }
+        })
+        break;
+      case "撤回":
+        wx.showModal({
+          content: '是否确定撤回该试用申请?',
+          complete: ({
+            confirm
+          }) => {
+            if (confirm) _Http.basic({
+              "content": {
+                "sa_trialid": data.sa_trialid
+              },
+              "id": 2025121610461102,
+            }).then(res => {
+              wx.showToast({
+                title: res.code == '1' ? getApp().globalData.Language.getMapText('撤回成功') : res.msg,
+                icon: "none"
+              });
+              if (res.code == '1') setTimeout(() => {
+                this.getDetail();
+              }, 300)
+            })
+          }
+        })
+        break;
       case "审核":
         wx.showModal({
           content: '是否确定审核该试用申请?',
@@ -330,7 +386,7 @@ Page({
       tabsList = [{
         label: "详细信息",
         icon: "icon-tabxiangxixinxi1"
-      },{
+      }, {
         label: "试用明细",
         icon: "icon-shiyongmingxi",
         model: "#tryDetail"
@@ -362,9 +418,19 @@ Page({
       label: "编辑"
     })
 
-    if (appAuth.check || isLeader) tabbarList.push({
+    if (appAuth.submit || isLeader && detail.status == '新建') tabbarList.push({
+      icon: "icon-tijiao1",
+      label: "提交"
+    })
+
+    if (appAuth.revocation || isLeader && detail.status == '提交') tabbarList.push({
+      icon: "icon-tijiao1",
+      label: "撤回"
+    })
+
+    if (appAuth.check || isLeader && (detail.status == '提交' || detail.status == '审核')) tabbarList.push({
       icon: "icon-shenhe1",
-      label: detail.status == '新建' ? "审核" : "反审核"
+      label: detail.status == '提交' ? "审核" : "反审核"
     })
 
     if (appAuth.delete || isLeader && detail.status == '新建') tabbarList.push({

+ 1 - 1
prsx/tryOut/detail.wxml

@@ -38,7 +38,7 @@
   <Files slot="附件" id="Files" ownertable='sa_trial' ownerid='{{sa_trialid}}' disabled="{{detail.status != '已终止'}}" />
 </Yl_FunTabs>
 
-<view style="height: 60rpx;" />
+<view style="height: 80rpx;" />
 
 <!-- 底部 -->
 <Yl_Tabbar wx:if="{{tabbarList.length}}" list='{{tabbarList}}' bind:callback="tabbarOnClick" />

+ 3 - 1
prsx/tryOut/index.js

@@ -64,7 +64,9 @@ Page({
             value: "", //选中值
             list: [{
                 value: '新建'
-            }, {
+            },{
+              value: '提交'
+          }, {
                 value: '审核'
             }]
         }, {

+ 28 - 1
prsx/tryOut/insert.js

@@ -18,11 +18,12 @@ Page({
           errMsg: "",
           type: "date",
           start: '',
-          value: '',
+          value: new Date().toISOString().split('T')[0],
           placeholder: "申请日期",
           valueName: "applydate",
           checking: "base",
           required: true,
+          interrupt:true
       },{
         label: "试用类型",
         error: false,
@@ -131,6 +132,7 @@ Page({
             valueName: "deliverydate",
             checking: "base",
             required: true,
+            interrupt:true
         }, {
           label: "领用人",
           error: false,
@@ -152,6 +154,7 @@ Page({
         valueName: "enddate",
         checking: "base",
         required: true,
+        interrupt:true
     }, {
             label: "备注",
             error: false,
@@ -189,6 +192,7 @@ Page({
 
     },
     interrupt(e) {
+      console.log(e,'输出222')
         const {
             data,
             form,
@@ -213,6 +217,29 @@ Page({
         }else if(temporary.item.label == '经销商'){
           form.find(v => v.label == '经销商').value = data.value;
           wx.navigateBack()
+        }else if(temporary.item.label == '申请日期'){
+          let obj2 = form.find(v => v.label == '发货日期')
+          if(new Date(data.value).getTime() > new Date(obj2.value)){
+            obj2.errMsg = '发货日期不可小于申请日期'
+          }else {
+            obj2.errMsg = ''
+          }
+        }else if(temporary.item.label == '发货日期'){
+          let obj2 = form.find(v => v.label == '发货日期')
+          let obj3 = form.find(v => v.label == '申请日期')
+          if(new Date(obj3.value).getTime() > new Date(obj2.value)){
+            obj2.errMsg = '发货日期不可小于申请日期'
+          }else {
+            obj2.errMsg = ''
+          }
+        }else if(temporary.item.label == '试用结束日期'){
+          let obj2 = form.find(v => v.label == '试用结束日期')
+          let obj3 = form.find(v => v.label == '发货日期')
+          if(new Date(obj3.value).getTime() > new Date(obj2.value)){
+            obj2.errMsg = '试用结束日期不可小于发货日期'
+          }else {
+            obj2.errMsg = ''
+          }
         }
         this.selectComponent("#Form").confirm();
         this.setData({

+ 181 - 181
utils/work/apps.js

@@ -1,193 +1,193 @@
 let authList = {};
 //通用
 function getapps() {
-	const paths = [{
-		name: "联系人",
-		path: "/prsx/contacts/index",
-		icon: "work-xiaochengxutongxunlu"
-	}, {
-		name: "工作汇报",
-		path: "/prsx/report/index",
-		icon: "work-gongzuohuibao"
-	}, {
-		name: "360°画像",
-		path: "/portrayal/index/index",
-		icon: "work-kehuhuaxiang"
-	}, {
-		name: "销售数据",
-		path: "/salesPanel/index/index",
-		icon: "work-xiaoshoushuju"
-	}, {
-		name: "数据总览",
-		path: "/salesPanel/dataOverview/index",
-		icon: "work-shujutongji"
-	}];
-	let app = [...getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['通用', '工作汇报']),
-			...getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['CRM'], ['业务管理', '数据统计'])
-		],
-		list = [];
-	app.forEach((v, i) => {
-		v.apps.forEach(s => {
-			authList[s.name] = {
-				options: s.meta.auth.map(a => a.option),
-				optionnames: s.meta.auth.map(a => a.optionname),
-				istask: s.istask == 1,
-				isdatafollowup: s.isdatafollowup == 1,
-				isdatatag: s.isdatatag == 1,
-				isdatateam: s.isdatateam == 1,
-			}
-			if (authList[s.name].options.some(s => s == "read")) {
-				let i = paths.findIndex(k => k.name == s.meta.title);
-				if (i != -1) {
-					paths[i].index = i;
-					paths[i].appName = s.name;
-					list.push(paths[i])
-				}
-			}
-		})
-	});
-	return dye(list.sort((a, b) => a.index - b.index))
+  const paths = [{
+    name: "联系人",
+    path: "/prsx/contacts/index",
+    icon: "work-xiaochengxutongxunlu"
+  }, {
+    name: "工作汇报",
+    path: "/prsx/report/index",
+    icon: "work-gongzuohuibao"
+  }, {
+    name: "360°画像",
+    path: "/portrayal/index/index",
+    icon: "work-kehuhuaxiang"
+  }, {
+    name: "销售数据",
+    path: "/salesPanel/index/index",
+    icon: "work-xiaoshoushuju"
+  }, {
+    name: "数据总览",
+    path: "/salesPanel/dataOverview/index",
+    icon: "work-shujutongji"
+  }];
+  let app = [...getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['通用'], ['通用', '工作汇报']),
+      ...getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['CRM'], ['业务管理', '数据统计'])
+    ],
+    list = [];
+  app.forEach((v, i) => {
+    v.apps.forEach(s => {
+      authList[s.name] = {
+        options: s.meta.auth.map(a => a.option),
+        optionnames: s.meta.auth.map(a => a.optionname),
+        istask: s.istask == 1,
+        isdatafollowup: s.isdatafollowup == 1,
+        isdatatag: s.isdatatag == 1,
+        isdatateam: s.isdatateam == 1,
+      }
+      if (authList[s.name].options.some(s => s == "read")) {
+        let i = paths.findIndex(k => k.name == s.meta.title);
+        if (i != -1) {
+          paths[i].index = i;
+          paths[i].appName = s.name;
+          list.push(paths[i])
+        }
+      }
+    })
+  });
+  return dye(list.sort((a, b) => a.index - b.index))
 };
 //CRM
 function getcrm() {
-	const paths = [{
-		name: "市场活动",
-		path: "/prsx/activity/index",
-		icon: "work-shichanghuodong",
-		objectname: "sat_campaign"
-	}, {
-		name: "医院管理",
-		path: "/prsx/hospital/index",
-		icon: "work-yiyuanguanli",
-		objectname: "sa_customers"
-	}, {
-		name: "科室管理",
-		path: "/prsx/department/index",
-		icon: "work-keshiguanli",
-		objectname: "sa_hospitaldep"
-	}, {
-		name: "医生管理",
-		path: "/prsx/doctors/index",
-		icon: "work-yishengguanli",
-		objectname: "sa_doctor"
-	}, {
-		name: "合同管理",
-		path: "/prsx/contract/index",
-		icon: "work-hetong",
-		objectname: "sa_contract"
-	}, {
-		name: "营销目标",
-		path: "/prsx/target/index",
-		icon: "work-xiaochengxu_xiaoshoumubiao",
-		objectname: "sa_salestarget"
-	}, {
-		name: "销售订单",
-		path: "/prsx/orderForm/index",
-		icon: "work-dingdan",
-		objectname: "sa_order"
-	}, {
-		name: "经销商管理",
-		path: "/prsx/dealer/index",
-		icon: "work-jingxiaoshangguanli",
-		objectname: "sa_agents"
-	}, {
-		name: "安装确认",
-		path: "/prsx/winstall/index",
-		icon: "work-anzhuangqueren",
-		objectname: "sa_install"
-	}, {
-		name: "试用申请",
-		path: "/prsx/tryOut/index",
-		icon: "work-shiyongshenqing",
-		objectname: "sa_trial"
-	}];
-	let crm = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['CRM'], ['业务管理', '销售管理', '营销目标']),
-		list = [];
-	crm.forEach(v => {
-		v.apps.forEach(s => {
-			authList[s.name] = {
-				options: s.meta.auth.map(a => a.option),
-				optionnames: s.meta.auth.map(a => a.optionname),
-				istask: s.istask == 1,
-				isdatafollowup: s.isdatafollowup == 1,
-				isdatatag: s.isdatatag == 1,
-				isdatateam: s.isdatateam == 1,
-			}
-			if (authList[s.name].options.some(s => s == "read")) {
-				let i = paths.findIndex(k => k.name == s.meta.title);
-				if (i != -1) {
-					paths[i].index = i;
-					paths[i].appName = s.name;
-					list.push(paths[i])
-				}
-			}
-		})
-	});
-	return dye(list.sort((a, b) => a.index - b.index))
+  const paths = [{
+    name: "市场活动",
+    path: "/prsx/activity/index",
+    icon: "work-shichanghuodong",
+    objectname: "sat_campaign"
+  }, {
+    name: "医院管理",
+    path: "/prsx/hospital/index",
+    icon: "work-yiyuanguanli",
+    objectname: "sa_customers"
+  }, {
+    name: "科室管理",
+    path: "/prsx/department/index",
+    icon: "work-keshiguanli",
+    objectname: "sa_hospitaldep"
+  }, {
+    name: "医生管理",
+    path: "/prsx/doctors/index",
+    icon: "work-yishengguanli",
+    objectname: "sa_doctor"
+  }, {
+    name: "经销商管理",
+    path: "/prsx/dealer/index",
+    icon: "work-jingxiaoshangguanli",
+    objectname: "sa_agents"
+  }, {
+    name: "合同管理",
+    path: "/prsx/contract/index",
+    icon: "work-hetong",
+    objectname: "sa_contract"
+  }, {
+    name: "试用申请",
+    path: "/prsx/tryOut/index",
+    icon: "work-shiyongshenqing",
+    objectname: "sa_trial"
+  }, {
+    name: "安装确认",
+    path: "/prsx/winstall/index",
+    icon: "work-anzhuangqueren",
+    objectname: "sa_install"
+  }, {
+    name: "销售订单",
+    path: "/prsx/orderForm/index",
+    icon: "work-dingdan",
+    objectname: "sa_order"
+  }, {
+    name: "营销目标",
+    path: "/prsx/target/index",
+    icon: "work-xiaochengxu_xiaoshoumubiao",
+    objectname: "sa_salestarget"
+  }];
+  let crm = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ['CRM'], ['业务管理', '销售管理', '营销目标']),
+    list = [];
+  crm.forEach(v => {
+    v.apps.forEach(s => {
+      authList[s.name] = {
+        options: s.meta.auth.map(a => a.option),
+        optionnames: s.meta.auth.map(a => a.optionname),
+        istask: s.istask == 1,
+        isdatafollowup: s.isdatafollowup == 1,
+        isdatatag: s.isdatatag == 1,
+        isdatateam: s.isdatateam == 1,
+      }
+      if (authList[s.name].options.some(s => s == "read")) {
+        let i = paths.findIndex(k => k.name == s.meta.title);
+        if (i != -1) {
+          paths[i].index = i;
+          paths[i].appName = s.name;
+          list.push(paths[i])
+        }
+      }
+    })
+  });
+  return dye(list.sort((a, b) => a.index - b.index))
 };
 //染色
 function dye(list) {
-	let colorList = [{
-		color: "#3874F6",
-		bColor: "#F0F3FF",
-	}, {
-		color: "#5AB73F",
-		bColor: "#F4FAEF",
-	}, {
-		color: "#F29C37",
-		bColor: "#FCF6EF",
-	}, {
-		color: "#EB4B5C",
-		bColor: "#FDF1ED",
-	}, {
-		color: "#3874F6",
-		bColor: "#F0F3FF",
-	}, {
-		color: "#F29C37",
-		bColor: "#FCF6EF",
-	}, {
-		color: "#EB4B5C",
-		bColor: "#FDF1ED",
-	}, {
-		color: "#3874F6",
-		bColor: "#F0F3FF",
-	}, {
-		color: "#5AB73F",
-		bColor: "#F4FAEF",
-	}, {
-		color: "#F29C37",
-		bColor: "#FCF6EF",
-	}, {
-		color: "#5AB73F",
-		bColor: "#F4FAEF",
-	}, {
-		color: "#3874F6",
-		bColor: "#F0F3FF",
-	}, {
-		color: "#F29C37",
-		bColor: "#FCF6EF",
-	}, {
-		color: "#EB4B5C",
-		bColor: "#FDF1ED",
-	}, {
-		color: "#5AB73F",
-		bColor: "#F4FAEF",
-	}];
-	return list.map((v, i) => {
-		if (getApp().globalData.http.appName && v.appName == getApp().globalData.http.appName) {
-			wx.navigateTo({
-				url: v.path
-			})
-			delete getApp().globalData.http.appName
-		}
-		return {
-			...v,
-			...colorList[i > colorList.length - 1 ? i - colorList.length : i]
-		}
-	})
+  let colorList = [{
+    color: "#3874F6",
+    bColor: "#F0F3FF",
+  }, {
+    color: "#5AB73F",
+    bColor: "#F4FAEF",
+  }, {
+    color: "#F29C37",
+    bColor: "#FCF6EF",
+  }, {
+    color: "#EB4B5C",
+    bColor: "#FDF1ED",
+  }, {
+    color: "#3874F6",
+    bColor: "#F0F3FF",
+  }, {
+    color: "#F29C37",
+    bColor: "#FCF6EF",
+  }, {
+    color: "#EB4B5C",
+    bColor: "#FDF1ED",
+  }, {
+    color: "#3874F6",
+    bColor: "#F0F3FF",
+  }, {
+    color: "#5AB73F",
+    bColor: "#F4FAEF",
+  }, {
+    color: "#F29C37",
+    bColor: "#FCF6EF",
+  }, {
+    color: "#5AB73F",
+    bColor: "#F4FAEF",
+  }, {
+    color: "#3874F6",
+    bColor: "#F0F3FF",
+  }, {
+    color: "#F29C37",
+    bColor: "#FCF6EF",
+  }, {
+    color: "#EB4B5C",
+    bColor: "#FDF1ED",
+  }, {
+    color: "#5AB73F",
+    bColor: "#F4FAEF",
+  }];
+  return list.map((v, i) => {
+    if (getApp().globalData.http.appName && v.appName == getApp().globalData.http.appName) {
+      wx.navigateTo({
+        url: v.path
+      })
+      delete getApp().globalData.http.appName
+    }
+    return {
+      ...v,
+      ...colorList[i > colorList.length - 1 ? i - colorList.length : i]
+    }
+  })
 };
 module.exports = {
-	getapps,
-	getcrm,
-	authList
+  getapps,
+  getcrm,
+  authList
 };

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików