xiaohaizhao пре 5 месеци
родитељ
комит
7569bb36c3
3 измењених фајлова са 24 додато и 11 уклоњено
  1. 1 1
      pages/index/home.vue
  2. 8 0
      pages/login/login.vue
  3. 15 10
      pages/workOrder/changeMsg.vue

+ 1 - 1
pages/index/home.vue

@@ -81,7 +81,7 @@ const itemList = ref([{
 
 onLoad(() => {
 	let userMsg = uni.getStorageSync('userMsg');
-	if (userMsg.usertype == 21) {
+	if (wx.getStorageSync('isAdmin')) {
 		itemList.value = [{
 			label: '新建服务申请',
 			icon: '/static/image/djd.png',

+ 8 - 0
pages/login/login.vue

@@ -379,6 +379,14 @@ function handleLogin1(data) {
                 icon: 'none',
             });
         } else {
+            uni.removeStorageSync('isAdmin');
+            try {
+                let app = res.data.find(v => v.system == "service").modules.find(v => v.systemmodule == "wserve").apps.find(v => v.name == "wxchatserve").meta.auth.map(v => v.option);
+                uni.setStorageSync('isAdmin', app.includes('admin'));
+            } catch (error) {
+                console.log(error)
+                uni.setStorageSync('isAdmin', false);
+            }
             uni.redirectTo({
                 url: '/pages/index/index',
             });

+ 15 - 10
pages/workOrder/changeMsg.vue

@@ -176,7 +176,7 @@ function servicetypeChange(type) {
 }
 
 const class1 = ref(''),
-    servertypes = ref(['安装', '维修', '清洗']),
+    servertypes = ref(['维修', '清洗']),
     class2 = ref('');
 
 let sa_workorderid = 0;
@@ -184,10 +184,6 @@ let sa_workorderid = 0;
 onLoad((options) => {
     sa_workorderid = options.id;
     getDetail()
-    $Http.getClass('servertype').then(res => {
-        servertypes.value = res.data.map(v => v.value);
-        if (res.code !== 1) return uni.showToast({ title: res.msg, icon: 'none' });
-    });
 
     $Http.getClass('prodclass1').then(res => {
         class1.value = res.data;
@@ -246,12 +242,21 @@ function getDetail() {
         console.log("工单详情", res)
         if (res.code !== 1) return uni.showToast({ title: res.msg, icon: 'none' });
         detail = reactive(res.data);
-        rules.class2[0].required = detail.type == '维修'
-        for (const key in form) {
-            if (detail[key] !== undefined) {
-                form[key] = detail[key];
-            }
+        rules.class2[0].required = detail.type == '维修';
+        if (detail.type != '安装') {
+            servertypes.value = ['安装'];
+        } else {
+            $Http.getClass('servertype').then(res1 => {
+                servertypes.value = res1.data.map(v => v.value).filter(v => v != '安装')
+                if (res1.code !== 1) return uni.showToast({ title: res.msg, icon: 'none' });
+            });
         }
+        if (res.data.servicetype)
+            for (const key in form) {
+                if (detail[key] !== undefined) {
+                    form[key] = detail[key];
+                }
+            }
         disabled.value = detail.item ? true : false
     })
 }