八项作业流程图

pull/5/head
fangjiakai 2024-02-21 10:49:36 +08:00
parent 5052eba52a
commit 35bcb78b59
7 changed files with 175 additions and 432 deletions

View File

@ -87,138 +87,136 @@
// //
requestPermissions(permissionID) { requestPermissions(permissionID) {
let _this = this; let _this = this;
// #ifdef APP-PLUS
//ios
if (plus.os.name == 'Android') {
let _permissionID = 'android.permission.' + permissionID;
plus.android.checkPermission(_permissionID,
granted => {
if (granted.checkResult == -1) {
//
_this.showPopup = true;
_this.$nextTick(() => {
setTimeout(() => {
_this.ani = 'uni-' + _this.type
},30)
})
}
},
error => {
console.log(error.message);
}
);
plus.android.requestPermissions([_permissionID],
(e) => {
//
_this.ani = '';
_this.$nextTick(() => {
setTimeout(() => {
_this.showPopup = false
}, 0)
})
console.log(e,'kkkkk')
if (e.granted.length > 0) {
//
_this.$emit('changeAuth'); _this.$emit('changeAuth');
// }
// // #ifdef APP-PLUS if (e.deniedAlways.length > 0) {
// //ios //
// if (plus.os.name == 'Android') { uni.showModal({
// let _permissionID = 'android.permission.' + permissionID; title: '温馨提示',
// plus.android.checkPermission(_permissionID, content: '还没有该权限,立即去设置开启?',
// granted => { cancelText: "取消",
// if (granted.checkResult == -1) { confirmText: "去设置",
// // showCancel: true,
// _this.showPopup = true; confirmColor: '#000',
// _this.$nextTick(() => { cancelColor: '#666',
// setTimeout(() => { success: (res) => {
// _this.ani = 'uni-' + _this.type if (res.confirm) {
// },30) _this.goSetting();
// }) }
// } }
// }, })
// error => { }
// console.log(error.message); })
// } } else {
// ); //IOS访
// plus.android.requestPermissions([_permissionID], //uniAPI使使IOSIOS https://ext.dcloud.net.cn/plugin?id=15787
// (e) => { let result = 0;
// // if (permissionID == 'ACCESS_FINE_LOCATION') {
// _this.ani = ''; //IOS
// _this.$nextTick(() => { let cLLocationManager = plus.ios.importClass("CLLocationManager"),
// setTimeout(() => { authStatus = cLLocationManager.authorizationStatus(),
// _this.showPopup = false enable = cLLocationManager.locationServicesEnabled();
// }, 0) if (enable && authStatus != 2) {
// }) result = 1;
// console.log(e,'kkkkk') } else {
// if (e.granted.length > 0) { result = 0;
// // }
// _this.$emit('changeAuth'); plus.ios.deleteObject(cLLocationManager);
// } } else if (permissionID == 'WRITE_EXTERNAL_STORAGE') {
// if (e.deniedAlways.length > 0) { //IOS
// // let PHPhotoLibrary = plus.ios.importClass("PHPhotoLibrary"),
// uni.showModal({ authStatus = PHPhotoLibrary.authorizationStatus();
// title: '', if (authStatus === 3) {
// content: '', result = 1;
// cancelText: "", } else {
// confirmText: "", result = 0;
// showCancel: true, }
// confirmColor: '#000', plus.ios.deleteObject(PHPhotoLibrary);
// cancelColor: '#666', } else if (permissionID == 'CAMERA') {
// success: (res) => { //IOS/
// if (res.confirm) { let avCaptureDevice = plus.ios.importClass("AVCaptureDevice"),
// _this.goSetting(); authStatus = avCaptureDevice.authorizationStatusForMediaType("vide");
// } if (authStatus === 3) {
// } result = 1;
// }) } else {
// } result = 0;
// }) }
// } else { plus.ios.deleteObject(avCaptureDevice);
// //IOS访 } else if (permissionID == 'CALL_PHONE') {
// //uniAPI使使IOSIOS https://ext.dcloud.net.cn/plugin?id=15787 //IOS
// let result = 0; let contactStore = plus.ios.importClass("CNContactStore"),
// if (permissionID == 'ACCESS_FINE_LOCATION') { authStatus = contactStore.authorizationStatusForEntityType(0);
// //IOS if (authStatus === 3) {
// let cLLocationManager = plus.ios.importClass("CLLocationManager"), result = 1;
// authStatus = cLLocationManager.authorizationStatus(), } else {
// enable = cLLocationManager.locationServicesEnabled(); result = 0;
// if (enable && authStatus != 2) { }
// result = 1; plus.ios.deleteObject(contactStore);
// } else { }else if(permissionID == 'RECORD_AUDIO'){
// result = 0; //IOS
// } let aVAudioSession = plus.ios.importClass("AVAudioSession"),
// plus.ios.deleteObject(cLLocationManager); aVAudio = aVAudioSession.sharedInstance(),
// } else if (permissionID == 'WRITE_EXTERNAL_STORAGE') { authStatus = aVAudio.recordPermission();
// //IOS if ([1684369017, 1970168948].includes(authStatus)) {
// let PHPhotoLibrary = plus.ios.importClass("PHPhotoLibrary"), result = 0;
// authStatus = PHPhotoLibrary.authorizationStatus(); } else {
// if (authStatus === 3) { result = 1;
// result = 1; }
// } else { plus.ios.deleteObject(aVAudioSession);
// result = 0; }
// } if (result) {
// plus.ios.deleteObject(PHPhotoLibrary); //
// } else if (permissionID == 'CAMERA') { that.$emit('changeAuth')
// //IOS/ } else {
// let avCaptureDevice = plus.ios.importClass("AVCaptureDevice"), //,
// authStatus = avCaptureDevice.authorizationStatusForMediaType("vide"); uni.showModal({
// if (authStatus === 3) { title: '温馨提示',
// result = 1; content: '还没有该权限,立即去设置开启?',
// } else { cancelText: "取消",
// result = 0; confirmText: "去设置",
// } showCancel: true,
// plus.ios.deleteObject(avCaptureDevice); confirmColor: '#000',
// } else if (permissionID == 'CALL_PHONE') { cancelColor: '#666',
// //IOS success: (res) => {
// let contactStore = plus.ios.importClass("CNContactStore"), if (res.confirm) {
// authStatus = contactStore.authorizationStatusForEntityType(0); _this.goSetting();
// if (authStatus === 3) { }
// result = 1; }
// } else { })
// result = 0; }
// } }
// plus.ios.deleteObject(contactStore);
// }else if(permissionID == 'RECORD_AUDIO'){
// //IOS
// let aVAudioSession = plus.ios.importClass("AVAudioSession"),
// aVAudio = aVAudioSession.sharedInstance(),
// authStatus = aVAudio.recordPermission();
// if ([1684369017, 1970168948].includes(authStatus)) {
// result = 0;
// } else {
// result = 1;
// }
// plus.ios.deleteObject(aVAudioSession);
// }
// if (result) {
// //
// that.$emit('changeAuth')
// } else {
// //,
// uni.showModal({
// title: '',
// content: '',
// cancelText: "",
// confirmText: "",
// showCancel: true,
// confirmColor: '#000',
// cancelColor: '#666',
// success: (res) => {
// if (res.confirm) {
// _this.goSetting();
// }
// }
// })
// }
// }
// #endif // #endif
}, },
// //

View File

@ -93,7 +93,7 @@
</view> </view>
<view class="step-item-wrap-right"> <view class="step-item-wrap-right">
<view class="step-item-wrap-right-title">{{item.STEP_NAME}}</view> <view class="step-item-wrap-right-title">{{item.STEP_NAME}}</view>
<view class="step-item-wrap-right-title">{{item.ACT_USER_NAME || item.SIGN_USER}}</view> <view class="step-item-wrap-right-title">{{item.SIGN_USER || item.FINISHED_SIGN_USER || item.ACT_USER_NAME }}</view>
<view class="step-item-wrap-right-title">{{item.ACT_TIME}}</view> <view class="step-item-wrap-right-title">{{item.ACT_TIME}}</view>
</view> </view>
</view> </view>

View File

@ -12,7 +12,7 @@
<text>八项作业</text> <text>八项作业</text>
</view> --> </view> -->
<view class="apps-warp"> <view class="apps-warp">
<navigator v-show="premission.confinedspace" class="apps-item" hover-class="none" url="/pages/application/confinedspace/home"> <navigator class="apps-item" hover-class="none" url="/pages/application/confinedspace/home">
<view class="imgs action"> <view class="imgs action">
<image src="../../static/icon-apps/icon-806.png" mode=""></image> <image src="../../static/icon-apps/icon-806.png" mode=""></image>
<view v-if="eight_work_count.CONFINEDSPACE_COUNT" class="cu-tag badge">{{eight_work_count.CONFINEDSPACE_COUNT}}</view> <view v-if="eight_work_count.CONFINEDSPACE_COUNT" class="cu-tag badge">{{eight_work_count.CONFINEDSPACE_COUNT}}</view>
@ -30,7 +30,7 @@
<!-- <view>设备检修</view>--> <!-- <view>设备检修</view>-->
<!-- </view>--> <!-- </view>-->
<!-- </navigator>--> <!-- </navigator>-->
<navigator v-show="premission['blind-board']" class="apps-item" hover-class="none" url="/pages/application/blind-board/home"> <navigator class="apps-item" hover-class="none" url="/pages/application/blind-board/home">
<view class="imgs action"> <view class="imgs action">
<image src="../../static/icon-apps/icon-801.png" mode=""></image> <image src="../../static/icon-apps/icon-801.png" mode=""></image>
<view v-if="eight_work_count.BLIND_BOARD_COUNT" class="cu-tag badge">{{eight_work_count.BLIND_BOARD_COUNT}}</view> <view v-if="eight_work_count.BLIND_BOARD_COUNT" class="cu-tag badge">{{eight_work_count.BLIND_BOARD_COUNT}}</view>
@ -39,7 +39,7 @@
<view>盲板抽堵作业</view> <view>盲板抽堵作业</view>
</view> </view>
</navigator> </navigator>
<navigator v-show="premission['break-ground']" class="apps-item" hover-class="none" url="/pages/application/break-ground/home"> <navigator class="apps-item" hover-class="none" url="/pages/application/break-ground/home">
<view class="imgs action"> <view class="imgs action">
<image src="../../static/icon-apps/icon-802.png" mode=""></image> <image src="../../static/icon-apps/icon-802.png" mode=""></image>
<view v-if="eight_work_count.BREAK_GROUND_COUNT" class="cu-tag badge">{{eight_work_count.BREAK_GROUND_COUNT}}</view> <view v-if="eight_work_count.BREAK_GROUND_COUNT" class="cu-tag badge">{{eight_work_count.BREAK_GROUND_COUNT}}</view>
@ -48,7 +48,7 @@
<view>动土作业</view> <view>动土作业</view>
</view> </view>
</navigator> </navigator>
<navigator v-show="premission['high-work']" class="apps-item" hover-class="none" url="/pages/application/highwork/home"> <navigator class="apps-item" hover-class="none" url="/pages/application/highwork/home">
<view class="imgs action"> <view class="imgs action">
<image src="../../static/icon-apps/icon-803.png" mode=""></image> <image src="../../static/icon-apps/icon-803.png" mode=""></image>
<view v-if="eight_work_count.HIGHWORK_COUNT" class="cu-tag badge">{{eight_work_count.HIGHWORK_COUNT}}</view> <view v-if="eight_work_count.HIGHWORK_COUNT" class="cu-tag badge">{{eight_work_count.HIGHWORK_COUNT}}</view>
@ -59,7 +59,7 @@
</navigator> </navigator>
<!-- </view>--> <!-- </view>-->
<!-- <view class="apps-warp">--> <!-- <view class="apps-warp">-->
<navigator v-show="premission.hoisting" class="apps-item" hover-class="none" url="/pages/application/hoisting/home"> <navigator class="apps-item" hover-class="none" url="/pages/application/hoisting/home">
<view class="imgs action"> <view class="imgs action">
<image src="../../static/icon-apps/icon-804.png" mode=""></image> <image src="../../static/icon-apps/icon-804.png" mode=""></image>
<view v-if="eight_work_count.HOISTING_COUNT" class="cu-tag badge">{{eight_work_count.HOISTING_COUNT}}</view> <view v-if="eight_work_count.HOISTING_COUNT" class="cu-tag badge">{{eight_work_count.HOISTING_COUNT}}</view>
@ -68,7 +68,6 @@
<view>吊装作业</view> <view>吊装作业</view>
</view> </view>
</navigator> </navigator>
<!-- v-show="premission.electricity"-->
<navigator class="apps-item" hover-class="none" url="/pages/application/electricity/home"> <navigator class="apps-item" hover-class="none" url="/pages/application/electricity/home">
<view class="imgs action"> <view class="imgs action">
<image src="../../static/icon-apps/icon-805.png" mode=""></image> <image src="../../static/icon-apps/icon-805.png" mode=""></image>
@ -78,7 +77,7 @@
<view>临时用电作业</view> <view>临时用电作业</view>
</view> </view>
</navigator> </navigator>
<navigator v-show="premission.hotwork" class="apps-item" hover-class="none" url="/pages/application/hotwork/home"> <navigator class="apps-item" hover-class="none" url="/pages/application/hotwork/home">
<view class="imgs action"> <view class="imgs action">
<image src="../../static/icon-apps/icon-807.png" mode=""></image> <image src="../../static/icon-apps/icon-807.png" mode=""></image>
<view v-if="eight_work_count.HOTWORK_COUNT" class="cu-tag badge">{{eight_work_count.HOTWORK_COUNT}}</view> <view v-if="eight_work_count.HOTWORK_COUNT" class="cu-tag badge">{{eight_work_count.HOTWORK_COUNT}}</view>
@ -87,7 +86,7 @@
<view>动火作业</view> <view>动火作业</view>
</view> </view>
</navigator> </navigator>
<navigator v-show="premission['open-circuit']" class="apps-item" hover-class="none" url="/pages/application/open-circuit/home"> <navigator class="apps-item" hover-class="none" url="/pages/application/open-circuit/home">
<view class="imgs action"> <view class="imgs action">
<image src="../../static/icon-apps/open-circuit.png" mode=""></image> <image src="../../static/icon-apps/open-circuit.png" mode=""></image>
<view v-if="eight_work_count.OPEN_CIRCUIT_COUNT" class="cu-tag badge">{{eight_work_count.OPEN_CIRCUIT_COUNT}}</view> <view v-if="eight_work_count.OPEN_CIRCUIT_COUNT" class="cu-tag badge">{{eight_work_count.OPEN_CIRCUIT_COUNT}}</view>

View File

@ -626,24 +626,15 @@
// //
ChooseImage() { ChooseImage() {
var _this = this; var _this = this;
var ss = 4 - this.hiddenForm.hiddenImgs.length;
uni.chooseImage({ uni.chooseImage({
count: ss, //9 count: 4, //9
sizeType: ['original', 'compressed'], // sizeType: ['original', 'compressed'], //
sourceType: ['camera', 'album'], // sourceType: ['camera', 'album'], //
success: (res) => { success: (res) => {
for (let i = 0; i < res.tempFilePaths.length; i++) { if (this.imgList.length != 0) {
if (e == 0) { this.imgList = this.imgList.concat(res.tempFilePaths)
let img = {};
img.IMGFILES_ID = '';
img.FILEPATH = res.tempFilePaths[i];
this.hiddenForm.hiddenImgs.push(img)
} else { } else {
let img = {}; this.imgList = res.tempFilePaths
img.IMGFILES_ID = '';
img.FILEPATH = res.tempFilePaths[i];
this.imgList1.push(img)
}
} }
} }
}); });
@ -672,13 +663,15 @@
ChooseImage_fa() { ChooseImage_fa() {
var _this = this; var _this = this;
uni.chooseImage({ uni.chooseImage({
count: 4 - _this.imgList.length, // +++ 4 count: 4, //9
sizeType: ['original', 'compressed'], sizeType: ['original', 'compressed'], //
sourceType: ['camera', 'album'], sourceType: ['camera', 'album'], //
success: (res) => { success: (res) => {
// imgList if (this.imgList_fa.length != 0) {
_this.imgList = _this.imgList.concat(res.tempFilePaths); this.imgList_fa = this.imgList_fa.concat(res.tempFilePaths)
_this.$forceUpdate(); // +++ } else {
this.imgList_fa = res.tempFilePaths
}
} }
}); });
}, },
@ -762,14 +755,14 @@
}); });
return; return;
} }
// if (_this.imgList.length <= 0) { if (_this.imgList.length <= 0) {
// uni.showToast({ uni.showToast({
// icon: 'none', icon: 'none',
// title: '', title: '请上传整改后照片',
// duration: 1500 duration: 1500
// }); });
// return; return;
// } }
if (this.HAVESCHEME == 1) { if (this.HAVESCHEME == 1) {
if (this.pd.GOVERNSTANDARDS == '' || this.pd.GOVERNSTANDARDS == undefined) { if (this.pd.GOVERNSTANDARDS == '' || this.pd.GOVERNSTANDARDS == undefined) {

View File

@ -100,7 +100,7 @@
</view> </view>
<view class="step-item-wrap-right"> <view class="step-item-wrap-right">
<view class="step-item-wrap-right-title">{{item.STEP_NAME}}</view> <view class="step-item-wrap-right-title">{{item.STEP_NAME}}</view>
<view class="step-item-wrap-right-title">{{item.ACT_USER_NAME || item.SIGN_USER}}</view> <view class="step-item-wrap-right-title">{{item.SIGN_USER || item.FINISHED_SIGN_USER || item.ACT_USER_NAME }}</view>
<view class="step-item-wrap-right-title">{{item.ACT_TIME}}</view> <view class="step-item-wrap-right-title">{{item.ACT_TIME}}</view>
</view> </view>
</view> </view>

View File

@ -104,7 +104,7 @@
</view> </view>
<view class="home-apps-list"> <view class="home-apps-list">
<navigator class="home-apps-item" hover-class="none" url="/pages/application/eight-assignments" <navigator class="home-apps-item" hover-class="none" url="/pages/application/eight-assignments"
v-show="premission.eightWork"> >
<view class="home-apps-item-img" style="position: relative;"> <view class="home-apps-item-img" style="position: relative;">
<image src="../../static/icon-apps/home-gw.png" mode=""></image> <image src="../../static/icon-apps/home-gw.png" mode=""></image>
<view v-if="eight_work_count>0" class="cu-tag badge">{{ eight_work_count }}</view> <view v-if="eight_work_count>0" class="cu-tag badge">{{ eight_work_count }}</view>
@ -125,7 +125,7 @@
<view v-if="keyProjectManagement" class="cu-tag badge">{{ keyProjectManagement }}</view> <view v-if="keyProjectManagement" class="cu-tag badge">{{ keyProjectManagement }}</view>
</navigator> </navigator>
<navigator class="home-apps-item" hover-class="none" url="/pages/application/commitment" <navigator class="home-apps-item" hover-class="none" url="/pages/application/commitment"
v-show="premission.commitment"> >
<view class="home-apps-item-img"> <view class="home-apps-item-img">
<image src="../../static/icon-apps/home-cns.png" mode=""></image> <image src="../../static/icon-apps/home-cns.png" mode=""></image>
</view> </view>
@ -134,7 +134,7 @@
</view> </view>
</navigator> </navigator>
<navigator class="home-apps-item" hover-class="none" url="/pages/application/onlinexxks/home" <navigator class="home-apps-item" hover-class="none" url="/pages/application/onlinexxks/home"
v-show="premission.education"> >
<view class="home-apps-item-img"> <view class="home-apps-item-img">
<image src="../../static/icon-apps/home-study.png" mode=""></image> <image src="../../static/icon-apps/home-study.png" mode=""></image>
</view> </view>
@ -180,7 +180,7 @@
<!-- </navigator>--> <!-- </navigator>-->
<navigator class="home-apps-item" hover-class="none" url="/pages/application/speEquip/index" <navigator class="home-apps-item" hover-class="none" url="/pages/application/speEquip/index"
v-show="premission.speEquip"> >
<view class="home-apps-item-img"> <view class="home-apps-item-img">
<image src="../../static/icon-apps/home-speEquip.jpg" mode=""></image> <image src="../../static/icon-apps/home-speEquip.jpg" mode=""></image>
</view> </view>
@ -657,12 +657,8 @@
loginSession() loginSession()
this.getSafetyEnvironmentalInspectionCount(); this.getSafetyEnvironmentalInspectionCount();
this.getUpdateInfo() this.getUpdateInfo()
this.premission = Object.assign({}, premission)
let now = new Date(); let now = new Date();
var today = formatDate(now, 'yyyy-MM-dd'); var today = formatDate(now, 'yyyy-MM-dd');
if (!this.premission || JSON.stringify(this.premission) === '{}') {
this.getMenu();
}
this.getIsRest(); this.getIsRest();
this.getData(); this.getData();
this.getSurveyData(); this.getSurveyData();
@ -765,118 +761,6 @@
}) })
}, },
getMenu() {
var _this = this;
uni.showLoading({
title: '请稍候'
})
uni.request({
url: basePath + '/app/main/index',
method: 'POST',
dataType: 'json',
header: {
'Content-type': 'application/x-www-form-urlencoded'
},
data: {
USER_ID: loginUser.USER_ID,
},
success: (res) => {
console.log(res.data.result)
if ("success" == res.data.result) {
var menuList = res.data.menuList
var premissionList = new Map()
menuList.map(item => {
if (item.menu_NAME == '安全承诺' && item.hasMenu) {
premissionList.set('commitment', true)
if (item.subMenu && item.subMenu.length > 0) {
item.subMenu.map(child => {
if (child.menu_NAME == '公司级承诺公告' && child
.hasMenu) {
premissionList.set('commitment-company', true)
}
if (child.menu_NAME == '车间级承诺公告' && child
.hasMenu) {
premissionList.set('commitment-workshop', true)
}
if (child.menu_NAME == '班组级承诺公告' && child
.hasMenu) {
premissionList.set('commitment-team', true)
}
})
}
}
if (item.menu_NAME == '受限空间作业管理' && item.hasMenu) {
premissionList.set('eightWork', true)
premissionList.set('confinedspace', true)
}
if (item.menu_NAME == '动火作业管理' && item.hasMenu) {
premissionList.set('eightWork', true)
premissionList.set('hotwork', true)
}
if (item.menu_NAME == '高处作业管理' && item.hasMenu) {
premissionList.set('eightWork', true)
premissionList.set('high-work', true)
}
if (item.menu_NAME == '吊装作业管理' && item.hasMenu) {
premissionList.set('eightWork', true)
premissionList.set('hoisting', true)
}
if (item.menu_NAME == '盲板抽堵作业管理' && item.hasMenu) {
premissionList.set('eightWork', true)
premissionList.set('blind-board', true)
}
if (item.menu_NAME == '动土作业管理' && item.hasMenu) {
premissionList.set('eightWork', true)
premissionList.set('break-ground', true)
}
if (item.menu_NAME == '临时用电作业管理' && item.hasMenu) {
premissionList.set('eightWork', true)
premissionList.set('electricity', true)
}
if (item.menu_NAME == '断路作业管理' && item.hasMenu) {
premissionList.set('eightWork', true)
premissionList.set('open-circuit', true)
}
if (item.menu_NAME == '在线学习与考试' && item.hasMenu) {
premissionList.set('education', true)
}
// console.info(premissionList)
if (item.menu_NAME == '设备设施管理' && item.hasMenu) {
premissionList.set('speEquip', true)
}
})
this.premission = (Object.fromEntries(premissionList));
setPremission(Object.fromEntries(premissionList));
uni.hideLoading();
} else {
setloginUserId(null);
setCorpinfoId(null);
setDeptId(null);
setloginUser(null);
uni.removeStorage({
key: 'USER'
});
uni.reLaunch({
url: '/pages/login/home'
});
// uni.showToast({
// title: res.data.message,
// duration: 2000
// });
}
},
fail: (res) => {
uni.showToast({
icon: 'none',
title: "服务器正在升级,请稍后再试。",
duration: 2000
});
}
});
},
async downCallback(page) { async downCallback(page) {
await this.getWork(); await this.getWork();
await this.getUserData(); await this.getUserData();

View File

@ -89,26 +89,12 @@
noClick: true, noClick: true,
userName: '', userName: '',
userPwd: '', userPwd: '',
push_clientid: '',
radio: '' radio: ''
} }
}, },
async onLoad() { async onLoad() {
this.getRemember() this.getRemember()
uni.getPushClientId({
success: (res) => {
this.push_clientid = res.cid
this.getLoginUser() this.getLoginUser()
console.log('客户端推送标识:', res.cid)
},
fail(err) {
uni.showToast({
icon: 'none',
title: "获取用户标识失败,请重新登录",
duration: 2000
});
}
});
// this.getLoginUser() // this.getLoginUser()
//this.getUrlVersion(); //this.getUrlVersion();
}, },
@ -160,7 +146,6 @@
USER_ID: loginUser.USER_ID, USER_ID: loginUser.USER_ID,
}, },
success: (res1) => { success: (res1) => {
this.updatePushCid(USER_ID, this.push_clientid)
if ("success" == res1.data.result) { if ("success" == res1.data.result) {
if (res1.data.ISREST != null) { if (res1.data.ISREST != null) {
setIsRest(res1.data.ISREST); setIsRest(res1.data.ISREST);
@ -292,8 +277,14 @@
key: 'remember', key: 'remember',
data: remember data: remember
}); });
this.getMenu() uni.hideLoading();
this.updatePushCid(res.data.USER_ID, this.push_clientid) uni.showToast({
title: "登录成功",
duration: 1000
});
uni.redirectTo({
url: '/pages/index/index'
});
} else if ("usererror" == result) { } else if ("usererror" == result) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
@ -346,114 +337,6 @@
duration: 2000 duration: 2000
}); });
} }
})
},
getMenu() {
var _this = this;
uni.showLoading({
title: '请稍候'
})
uni.request({
url: basePath + '/app/main/index',
method: 'POST',
dataType: 'json',
header: {
'Content-type': 'application/x-www-form-urlencoded'
},
data: {
USER_ID: loginUser.USER_ID,
},
success: (res) => {
if ("success" == res.data.result) {
var menuList = res.data.menuList
var premissionList = new Map()
menuList.map(item => {
if (item.menu_NAME == '安全承诺' && item.hasMenu) {
premissionList.set('commitment', true)
if (item.subMenu && item.subMenu.length > 0) {
item.subMenu.map(child => {
if (child.menu_NAME == '公司级承诺公告' && child
.hasMenu) {
premissionList.set('commitment-company', true)
}
if (child.menu_NAME == '车间级承诺公告' && child
.hasMenu) {
premissionList.set('commitment-workshop', true)
}
if (child.menu_NAME == '班组级承诺公告' && child
.hasMenu) {
premissionList.set('commitment-team', true)
}
})
}
}
if (item.menu_NAME == '受限空间作业管理' && item.hasMenu) {
premissionList.set('eightWork', true)
premissionList.set('confinedspace', true)
}
if (item.menu_NAME == '动火作业管理' && item.hasMenu) {
premissionList.set('eightWork', true)
premissionList.set('hotwork', true)
}
if (item.menu_NAME == '高处作业管理' && item.hasMenu) {
premissionList.set('eightWork', true)
premissionList.set('high-work', true)
}
if (item.menu_NAME == '吊装作业管理' && item.hasMenu) {
premissionList.set('eightWork', true)
premissionList.set('hoisting', true)
}
if (item.menu_NAME == '盲板抽堵作业管理' && item.hasMenu) {
premissionList.set('eightWork', true)
premissionList.set('blind-board', true)
}
if (item.menu_NAME == '动土作业管理' && item.hasMenu) {
premissionList.set('eightWork', true)
premissionList.set('break-ground', true)
}
if (item.menu_NAME == '临时用电作业管理' && item.hasMenu) {
premissionList.set('eightWork', true)
premissionList.set('electricity', true)
}
if (item.menu_NAME == '断路作业管理' && item.hasMenu) {
premissionList.set('eightWork', true)
premissionList.set('open-circuit', true)
}
if (item.menu_NAME == '在线学习与考试' && item.hasMenu) {
premissionList.set('education', true)
}
if (item.menu_NAME == '设备设施管理' && item.hasMenu) {
premissionList.set('speEquip', true)
}
})
setPremission(Object.fromEntries(premissionList));
uni.hideLoading();
uni.showToast({
title: "登录成功",
duration: 1000
});
uni.redirectTo({
url: '/pages/index/index'
});
} else {
uni.showToast({
title: res.data.message,
duration: 2000
});
}
},
fail: (res) => {
uni.showToast({
icon: 'none',
title: "服务器正在升级,请稍后再试。",
duration: 2000
});
}
}); });
}, },
getUrlVersion() { getUrlVersion() {
@ -486,20 +369,6 @@
}); });
}); });
}, },
updatePushCid(userId, pushCid) {
uni.request({
url: basePath + '/app/user/updatePushCid',
method: 'POST',
dataType: 'json',
header: {
'Content-type': 'application/x-www-form-urlencoded'
},
data: {
USER_ID: userId,
PUSH_CID: pushCid
},
});
}
} }
} }
</script> </script>