diff --git a/App.vue b/App.vue index ff4d0fe..38300d6 100644 --- a/App.vue +++ b/App.vue @@ -4,6 +4,57 @@ globalData: { appid: 'wxf7d6140f507466be' }, + getUserRange() { + let that = this; + that.$u.api.deptList({ + page: 0, + type__in: 'rparty,dept', + query: '{id, name, parent, type}' + }).then(res => { + let list1 = res; + let list2 = []; + let reqList = []; + list1.forEach(function(item) { + reqList.push(that.$u.api.userList({ + page: 0, + belong_dept: item.id, + is_active: true, + query: '{id, name, belong_dept}' + })) + }) + Promise.all(reqList).then(res => { + for (let i = 0; i < res.length; i++) { + list1[i].children = res[i] + } + list1.forEach(item=>{ + if(item.type == 'dept'){ + list2.push({ ...item }) + } + }) + that.$u.vuex('vuex_userRange', that.parseData(list1)) + that.$u.vuex('vuex_userRange2', that.parseData(list2)) + }) + }) + }, + parseData(data) { + // * 先生成parent建立父子关系 + const obj = {}; + data.forEach((item) => { + obj[item.id] = item; + }); + const parentList = []; + data.forEach((item) => { + const parent = obj[item.parent]; + if (parent) { + // * 当前项有父节点 + parent.children = parent.children || []; + parent.children.unshift(item); + } else { + parentList.push(item); + } + }); + return parentList; + }, onLaunch() { // #ifdef APP-PLUS @@ -68,11 +119,11 @@ } }); // #endif - // #ifdef APP-PLUS uni.getSystemInfo({ success(res) { console.log(res) that.$u.vuex('vuex_version', res.appVersion) + // #ifdef APP-PLUS if (res.platform == 'android') { that.$u.api.apkCheck().then(res1 => { if (res.appVersion < res1.version) { @@ -95,127 +146,9 @@ } }) } + // #endif } }) - // #endif - // #ifdef APP-PLUS - uni.showLoading({ - title: '自动登录中...', - mask: true - }) - uni.getStorage({ - key: 'mySecret', - success: function(res) { - let secret = res.data - if (secret) { - uni.showToast({ - title: JSON.parse(secret).username, - icon: "none" - }) - that.$u.api.loginSecret(JSON.parse(secret)).then(res => { - that.$u.vuex('vuex_token', res.access) - that.$u.api.getUserInfo().then(res => { - if(res.avatar){ - res.avatar = this.vuex_host + res.avatar - } - that.$u.vuex('vuex_user', res) - let perms = []; - for (let key in user.perms) { - perms.push(key); - } - console.log(perms); - that.$u.vuex('vuex_perm', perms) - // 修改资源请求地址 - }) - uni.reLaunch({ - url: '/pages/home/home_' - }) - }).catch(e=>{ - uni.reLaunch({ - url: '/pages/login/login_' - }) - }) - }else{ - uni.reLaunch({ - url: '/pages/login/login_' - }) - } - - }, - fail() { - uni.reLaunch({ - url: '/pages/login/login_' - }) - }, - complete() { - uni.hideLoading() - } - }); - - // 根据设备唯一标识进行自动登录 - uni.showToast({ - title: qyjyClientId, - icon: "none" - }) - /* that.$u.api.loginCOde(qyjyClientId).then(res => { - that.$u.api.getUserInfo().then(res => { - that.$u.vuex('vuex_user', res) - // 修改资源请求地址 - }) - uni.reLaunch({ - url: '/pages/home/home_' - }) - }).catch(res=>{ - uni.reLaunch({ - url: '/pages/login/login_' - }) - }) */ - // #endif - - - - - uni.showLoading({ - title: '自动登录中...', - mask: true - }) - uni.getStorage({ - key: 'mySecret', - success: function(res) { - let secret = res.data - if (secret) { - - uni.showToast({ - title: JSON.parse(secret).username, - icon: "none" - }) - let a=JSON.parse(secret).username; - console.log(a) - that.$u.api.getUserInfo().then(res => { - that.$u.vuex('vuex_user', res) - let perms = []; - for (let key in user.perms) { - perms.push(key); - } - console.log(perms); - that.$u.vuex('vuex_perm', perms) - if(res.type==='employee'||res.type==='remployee'){ - uni.reLaunch({ - url: '/pages/home/home_' - }) - }else{ - uni.reLaunch({ - url: '/pages/workSpace/workSpace' - }) - } - // 修改资源请求地址 - }) - } - }, - complete() { - uni.hideLoading() - } - }); }, } diff --git a/manifest.json b/manifest.json index 4872e97..6b14c02 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "曲阳金隅EHS", "appid" : "__UNI__B00D419", "description" : "曲阳金隅EHS", - "versionName" : "1.01.03", - "versionCode" : 10103, + "versionName" : "1.01.07", + "versionCode" : 10107, "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { @@ -121,6 +121,6 @@ "mode" : "history", "base" : "/h5/" }, - "title" : "共享平台" + "title" : "曲阳金隅EHS" } } diff --git a/pages.json b/pages.json index c98d9d0..e475739 100644 --- a/pages.json +++ b/pages.json @@ -41,7 +41,7 @@ { "path": "pages/home/home_", "style": { - // "navigationBarTitleText": "曲阳金隅EHS主页", + "navigationBarTitleText": "曲阳金隅EHS主页", "enablePullDownRefresh": false } }, diff --git a/pages/home/detail/ticketHandle.vue b/pages/home/detail/ticketHandle.vue index c89bb3e..aadde16 100644 --- a/pages/home/detail/ticketHandle.vue +++ b/pages/home/detail/ticketHandle.vue @@ -2,32 +2,32 @@ - - - - 工单流水号 - - - {{ticketDetail.sn}} - + + + + 工单流水号 - - - 工单名称 - - - {{ticketDetail.title}} - - - - - 工单状态 - - - {{ticketDetail.state_.name}} - + + {{ticketDetail.sn}} + + + 工单名称 + + + {{ticketDetail.title}} + + + + + 工单状态 + + + {{ticketDetail.state_.name}} + + + @@ -192,7 +192,7 @@ - + @@ -269,7 +269,8 @@ 所属作业 - {{oplDetail.operation_.name}} + {{oplDetail.operation_.name}} + @@ -332,42 +333,44 @@ - - - * - 作业情况 - - + + + * + 作业情况 - - - + + + + + * + 审批意见 - - - * - 审批意见 - -