手机端排查清单需在电子围栏中

pull/5/head
dearlin 2024-01-25 17:29:41 +08:00
parent 5e7217a392
commit ca7db13c77
2 changed files with 235 additions and 153 deletions

View File

@ -9,7 +9,10 @@
</cu-custom> </cu-custom>
<scroll-view scroll-y> <scroll-view scroll-y>
<view class="spot-list"> <view class="spot-list">
<view class="spot-item" v-for="item in list" :key="item.IDENTIFICATIONPARTS_ID" @click="$noMultipleClicks(goToList,{'IDENTIFICATIONPARTS_ID':item.IDENTIFICATIONPARTS_ID,'isChecked':item.isChecked})"> <view class="spot-item" v-for="item in list" :key="item.IDENTIFICATIONPARTS_ID" @click="$noMultipleClicks(goToList,{
'ELECTRONIC_FENCE_ID':item.ELECTRONIC_FENCE_ID,
'IDENTIFICATIONPARTS_ID':item.IDENTIFICATIONPARTS_ID,
'isChecked':item.isChecked})">
<view class="spot-img"> <view class="spot-img">
<image v-if="item.isChecked" src="../../../../static/zt-over.png" mode=""></image> <image v-if="item.isChecked" src="../../../../static/zt-over.png" mode=""></image>
<image v-else src="../../../../static/zt-ing.png" mode=""></image> <image v-else src="../../../../static/zt-ing.png" mode=""></image>
@ -18,22 +21,28 @@
<view class="text f30"> <view class="text f30">
{{item.DEPT_NAME}}--{{item.RISKUNITNAME}}--{{item.PARTSNAME}} {{item.DEPT_NAME}}--{{item.RISKUNITNAME}}--{{item.PARTSNAME}}
</view> </view>
<view v-if="item.ELECTRONIC_FENCE_ID" class="text f30">
所属电子围栏{{item.ELECTRONIC_FENCE}}
</view>
</view> </view>
</view> </view>
</view> </view>
<view class="cu-tabbar-height"></view> <view class="cu-tabbar-height"></view>
</scroll-view> </scroll-view>
<view class="bottom-fixed" @click="$noMultipleClicks(goNext)"> <view class="bottom-fixed" @click="$noMultipleClicks(goNext)">
<button class="cu-btn bg-green" >下一步</button> <button class="cu-btn bg-green">下一步</button>
</view> </view>
<yk-authpup ref="authpup" type="top" @changeAuth="$noMultipleClicks(scan)" :permissionID="permissionID"></yk-authpup> <yk-authpup ref="authpup" type="top" @changeAuth="$noMultipleClicks(scan)" :permissionID="permissionID">
</yk-authpup>
</view> </view>
</template> </template>
<script> <script>
import { import {
basePath,loginUser,loginSession basePath,
loginUser,
loginSession
} from '@/common/tool.js'; } from '@/common/tool.js';
import ykAuthpup from "@/components/yk-authpup/yk-authpup" import ykAuthpup from "@/components/yk-authpup/yk-authpup"
export default { export default {
@ -42,27 +51,27 @@
}, },
data() { data() {
return { return {
permissionID:'', permissionID: '',
noClick:true, noClick: true,
initflag:false, initflag: false,
listId:'', listId: '',
listName:'', listName: '',
baoBaoType:'', baoBaoType: '',
list: [], list: [],
dataFlag:'noData', dataFlag: 'noData',
CHECKRECORD_ID:'', CHECKRECORD_ID: '',
} }
}, },
onLoad(e){ onLoad(e) {
this.listId=e.listId; this.listId = e.listId;
this.listName=e.listName; this.listName = e.listName;
this.baoBaoType=e.baoBaoType this.baoBaoType = e.baoBaoType
this.getData(); this.getData();
loginSession(); loginSession();
}, },
onShow(e){ onShow(e) {
var _this = this; var _this = this;
if(_this.initflag){ if (_this.initflag) {
_this.initflag = false; _this.initflag = false;
_this.list = []; _this.list = [];
this.getData() this.getData()
@ -79,67 +88,119 @@
method: 'POST', method: 'POST',
dataType: 'json', dataType: 'json',
header: { header: {
'Content-type':'application/x-www-form-urlencoded' 'Content-type': 'application/x-www-form-urlencoded'
}, },
data: { data: {
LISTMANAGER_ID: _this.listId, LISTMANAGER_ID: _this.listId,
USER_NAME : loginUser.NAME, USER_NAME: loginUser.NAME,
CORPINFO_ID:loginUser.CORPINFO_ID, CORPINFO_ID: loginUser.CORPINFO_ID,
USER_ID:loginUser.USER_ID, USER_ID: loginUser.USER_ID,
}, },
success: (res) => { success: (res) => {
if("success" == res.data.result){ if ("success" == res.data.result) {
uni.hideLoading(); uni.hideLoading();
_this.list = res.data.varList; _this.list = res.data.varList;
_this.CHECKRECORD_ID=res.data.CHECKRECORD_ID; _this.CHECKRECORD_ID = res.data.CHECKRECORD_ID;
if(res.data.checkmap){ if (res.data.checkmap) {
for (var i = 0; i <_this.list.length ; i++) { for (var i = 0; i < _this.list.length; i++) {
if(res.data.checkmap[_this.list[i].IDENTIFICATIONPARTS_ID] >=_this.list[i].RISK_COUNT){ if (res.data.checkmap[_this.list[i].IDENTIFICATIONPARTS_ID] >= _this.list[
_this.list[i].isChecked=1 i].RISK_COUNT) {
_this.list[i].isChecked = 1
} }
} }
} }
} else { } else {
uni.showToast({ uni.showToast({
icon:'none', icon: 'none',
title:'系统异常', title: '系统异常',
duration: 2000 duration: 2000
}); });
} }
} }
}); });
}, },
getInorout(e) {
uni.request({
url: basePath + '/app/listmanager/isInElectronicFence',
method: 'POST',
dataType: 'json',
header: {
'Content-type': 'application/x-www-form-urlencoded'
},
data: {
ELECTRONIC_FENCE_ID: e.ELECTRONIC_FENCE_ID,
USER_NAME: loginUser.NAME,
PLS_ID: loginUser.PLS_ID,
CORPINFO_ID: loginUser.CORPINFO_ID,
USER_ID: loginUser.USER_ID,
},
success: (res) => {
if(res.data.code != 0) {
uni.showToast({
icon: 'none',
title: res.data.msg,
duration: 2000
});
}else{
uni.navigateTo({
url: '/pages/application/hidden-trouble-investigation/hidden-trouble-app/check-items-list?IDENTIFICATIONPARTS_ID=' +
e.IDENTIFICATIONPARTS_ID + "&listId=" + this.listId + '&listName=' + this.listName +
"&CHECKRECORD_ID=" + (this.CHECKRECORD_ID ? this.CHECKRECORD_ID : '') + "&baoBaoType=" +
this
.baoBaoType
});
}
}
});
},
// //
goToList(e) { goToList(e) {
if (e.ELECTRONIC_FENCE_ID) {
this.getInorout(e)
}else {
uni.navigateTo({ uni.navigateTo({
url: '/pages/application/hidden-trouble-investigation/hidden-trouble-app/check-items-list?IDENTIFICATIONPARTS_ID=' url: '/pages/application/hidden-trouble-investigation/hidden-trouble-app/check-items-list?IDENTIFICATIONPARTS_ID=' +
+e.IDENTIFICATIONPARTS_ID+"&listId="+this.listId+'&listName='+this.listName+"&CHECKRECORD_ID="+(this.CHECKRECORD_ID?this.CHECKRECORD_ID:'') +"&baoBaoType="+this.baoBaoType e.IDENTIFICATIONPARTS_ID + "&listId=" + this.listId + '&listName=' + this.listName +
"&CHECKRECORD_ID=" + (this.CHECKRECORD_ID ? this.CHECKRECORD_ID : '') + "&baoBaoType=" +
this
.baoBaoType
}); });
}
// uni.navigateTo({
// url: '/pages/application/hidden-trouble-investigation/hidden-trouble-app/check-items-list?IDENTIFICATIONPARTS_ID=' +
// e.IDENTIFICATIONPARTS_ID + "&listId=" + this.listId + '&listName=' + this.listName +
// "&CHECKRECORD_ID=" + (this.CHECKRECORD_ID ? this.CHECKRECORD_ID : '') + "&baoBaoType=" +
// this
// .baoBaoType
// });
}, },
openAuth(permissionID){ openAuth(permissionID) {
this.permissionID = permissionID; this.permissionID = permissionID;
setTimeout(()=>{ setTimeout(() => {
this.$refs['authpup'].open(); this.$refs['authpup'].open();
},200) }, 200)
}, },
scan(){ scan() {
let _this=this; let _this = this;
uni.scanCode({ uni.scanCode({
success: function (res) { success: function(res) {
let flag=false; let flag = false;
let ideId = res.result; let ideId = res.result;
for(var i=0;i<_this.list.length;i++){ for (var i = 0; i < _this.list.length; i++) {
if(_this.list[i].IDENTIFICATIONPARTS_ID==ideId){ if (_this.list[i].IDENTIFICATIONPARTS_ID == ideId) {
flag=true; flag = true;
_this.goToList({'IDENTIFICATIONPARTS_ID':_this.list[i].IDENTIFICATIONPARTS_ID}); _this.goToList({
'IDENTIFICATIONPARTS_ID': _this.list[i].IDENTIFICATIONPARTS_ID
});
break; break;
} }
} }
if(!flag){ if (!flag) {
uni.showToast({ uni.showToast({
icon:'none', icon: 'none',
title: "该清单中不含此部位。", title: "该清单中不含此部位。",
duration: 2000 duration: 2000
}); });
@ -149,18 +210,19 @@
}, },
// //
goNext(e) { goNext(e) {
for(let i=0;i<this.list.length;i++){ for (let i = 0; i < this.list.length; i++) {
if(this.list[i].isChecked!=1){ if (this.list[i].isChecked != 1) {
uni.showToast({ uni.showToast({
icon:'none', icon: 'none',
title:'清单未全部检查,无法提交', title: '清单未全部检查,无法提交',
duration: 3000 duration: 3000
}); });
return; return;
} }
} }
uni.navigateTo({ uni.navigateTo({
url: '/pages/application/hidden-trouble-investigation/hidden-trouble-app/check-items-next?listId='+this.listId+'&CHECKRECORD_ID='+(this.CHECKRECORD_ID?this.CHECKRECORD_ID:'') url: '/pages/application/hidden-trouble-investigation/hidden-trouble-app/check-items-next?listId=' +
this.listId + '&CHECKRECORD_ID=' + (this.CHECKRECORD_ID ? this.CHECKRECORD_ID : '')
}); });
}, },
} }
@ -168,25 +230,28 @@
</script> </script>
<style> <style>
.spot-list{ .spot-list {}
} .spot-cont {
.spot-cont{
margin-left: 20upx; margin-left: 20upx;
flex: 1; flex: 1;
} }
.spot-cont .text{
.spot-cont .text {
line-height: 1.4; line-height: 1.4;
} }
.spot-img{
.spot-img {
width: 100upx; width: 100upx;
height: 100upx; height: 100upx;
} }
.spot-img image{
.spot-img image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.spot-list .spot-item{
.spot-list .spot-item {
display: flex; display: flex;
align-items: center; align-items: center;
background-color: #fff; background-color: #fff;

View File

@ -1,5 +1,6 @@
<template> <template>
<view style="background: url(../../static/bg-login.png) no-repeat;background-size:100% auto;height:100vh;background-color: #058cf5; position: fixed; width: 100%;"> <view
style="background: url(../../static/bg-login.png) no-repeat;background-size:100% auto;height:100vh;background-color: #058cf5; position: fixed; width: 100%;">
<!-- <view class="bottom-img"> <!-- <view class="bottom-img">
<image src="../../static/hg-bottom.png" mode=""></image> <image src="../../static/hg-bottom.png" mode=""></image>
</view> --> </view> -->
@ -19,7 +20,8 @@
<text class="">手机号码</text> <text class="">手机号码</text>
</view> </view>
<view class="m-input-view"> <view class="m-input-view">
<input v-model="userName" class="m-input" placeholder-style="color: #5caceb;font-size: 34upx;" placeholder="请输入手机号..." /> <input v-model="userName" class="m-input" placeholder-style="color: #5caceb;font-size: 34upx;"
placeholder="请输入手机号..." />
</view> </view>
</view> </view>
<view class="input-row mt30"> <view class="input-row mt30">
@ -27,8 +29,8 @@
<text class="">密码</text> <text class="">密码</text>
</view> </view>
<view class="m-input-view"> <view class="m-input-view">
<input v-model="userPwd" class="m-input" placeholder-style="color: #5caceb;font-size: 34upx;" password type="text" <input v-model="userPwd" class="m-input" placeholder-style="color: #5caceb;font-size: 34upx;"
placeholder="请输入密码..." /> password type="text" placeholder="请输入密码..." />
</view> </view>
</view> </view>
</view> </view>
@ -36,7 +38,7 @@
<button class="cu-btn bg-login margin-tb-sm lg" @click="$noMultipleClicks(login)"> </button> <button class="cu-btn bg-login margin-tb-sm lg" @click="$noMultipleClicks(login)"> </button>
</view> </view>
<view class="bar-forget"> <view class="bar-forget">
<!-- <navigator class="title" url="/pages/login/forget/forget"> <!-- <navigator class="title" url="/pages/login/forget/forget">
忘记密码 忘记密码
</navigator> --> </navigator> -->
<!-- <view class="title"> <!-- <view class="title">
@ -44,7 +46,8 @@
</view> --> </view> -->
</view> </view>
</view> </view>
<view style="width: 100%;color: #fff;position: absolute;left: 50%;transform: translateX(-50%);bottom: 50upx;display: flex;justify-content: center;align-items: center"> <view
style="width: 100%;color: #fff;position: absolute;left: 50%;transform: translateX(-50%);bottom: 50upx;display: flex;justify-content: center;align-items: center">
<radio-group> <radio-group>
<radio :checked="radio === '1'" @click="radioChange"></radio> <radio :checked="radio === '1'" @click="radioChange"></radio>
</radio-group> </radio-group>
@ -83,11 +86,11 @@
export default { export default {
data() { data() {
return { return {
noClick:true, noClick: true,
userName : '', userName: '',
userPwd: '', userPwd: '',
push_clientid:'', push_clientid: '',
radio:'' radio: ''
} }
}, },
async onLoad() { async onLoad() {
@ -96,7 +99,7 @@
success: (res) => { success: (res) => {
this.push_clientid = res.cid this.push_clientid = res.cid
this.getLoginUser() this.getLoginUser()
console.log('客户端推送标识:',res.cid) console.log('客户端推送标识:', res.cid)
}, },
fail(err) { fail(err) {
uni.showToast({ uni.showToast({
@ -110,7 +113,7 @@
//this.getUrlVersion(); //this.getUrlVersion();
}, },
methods: { methods: {
getRemember(){ getRemember() {
uni.getStorage({ uni.getStorage({
key: 'remember', key: 'remember',
success: async (res) => { success: async (res) => {
@ -134,7 +137,7 @@
setloginUser(res.data); setloginUser(res.data);
// //
this.handleLoginCheck(res.data.USER_ID).then(()=>{ this.handleLoginCheck(res.data.USER_ID).then(() => {
uni.navigateTo({ uni.navigateTo({
url: '/pages/index/index', url: '/pages/index/index',
}); });
@ -143,8 +146,8 @@
} }
}); });
}, },
handleLoginCheck(USER_ID){ handleLoginCheck(USER_ID) {
return new Promise((resolve,reject)=>{ return new Promise((resolve, reject) => {
uni.request({ uni.request({
url: basePath + '/app/offduty/isRest', url: basePath + '/app/offduty/isRest',
method: 'POST', method: 'POST',
@ -165,14 +168,14 @@
setIsRest(res.data.ISREST); setIsRest(res.data.ISREST);
} }
resolve() resolve()
}else if ("usercorperror" == res1.data.result) { } else if ("usercorperror" == res1.data.result) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: "您的企业已停用,请联系管理员", title: "您的企业已停用,请联系管理员",
duration: 2000 duration: 2000
}); });
reject() reject()
}else if ("userUSEerror" == res1.data.result) { } else if ("userUSEerror" == res1.data.result) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: "您的企业已到使用期限,请联系管理员", title: "您的企业已到使用期限,请联系管理员",
@ -278,11 +281,17 @@
setDeptLevel(res.data.DEPARTMENT_LEVEL); setDeptLevel(res.data.DEPARTMENT_LEVEL);
setIsRest(res.data.ISREST); setIsRest(res.data.ISREST);
setloginUser(res.data); setloginUser(res.data);
uni.setStorage({key: 'USER', data: res.data}); uni.setStorage({
key: 'USER',
data: res.data
});
const remember = {} const remember = {}
remember.username = userName remember.username = userName
remember.userPwd = userPwd remember.userPwd = userPwd
uni.setStorage({key: 'remember', data: remember}); uni.setStorage({
key: 'remember',
data: remember
});
this.getMenu() this.getMenu()
this.updatePushCid(res.data.USER_ID, this.push_clientid) this.updatePushCid(res.data.USER_ID, this.push_clientid)
} else if ("usererror" == result) { } else if ("usererror" == result) {
@ -315,13 +324,13 @@
title: res.data.msg, title: res.data.msg,
duration: 2000 duration: 2000
}); });
}else if ("maintainDeactivateError" == result) { } else if ("maintainDeactivateError" == result) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: "企业处于维护停用阶段,暂时无法登录", title: "企业处于维护停用阶段,暂时无法登录",
duration: 2000 duration: 2000
}); });
}else if ("exception" == result) { } else if ("exception" == result) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: res.data.exception, title: res.data.exception,
@ -366,13 +375,16 @@
premissionList.set('commitment', true) premissionList.set('commitment', true)
if (item.subMenu && item.subMenu.length > 0) { if (item.subMenu && item.subMenu.length > 0) {
item.subMenu.map(child => { item.subMenu.map(child => {
if (child.menu_NAME == '公司级承诺公告' && child.hasMenu) { if (child.menu_NAME == '公司级承诺公告' && child
.hasMenu) {
premissionList.set('commitment-company', true) premissionList.set('commitment-company', true)
} }
if (child.menu_NAME == '车间级承诺公告' && child.hasMenu) { if (child.menu_NAME == '车间级承诺公告' && child
.hasMenu) {
premissionList.set('commitment-workshop', true) premissionList.set('commitment-workshop', true)
} }
if (child.menu_NAME == '班组级承诺公告' && child.hasMenu) { if (child.menu_NAME == '班组级承诺公告' && child
.hasMenu) {
premissionList.set('commitment-team', true) premissionList.set('commitment-team', true)
} }
}) })
@ -445,7 +457,7 @@
}); });
}, },
getUrlVersion() { getUrlVersion() {
plus.runtime.getProperty(plus.runtime.appid, function (inf) { plus.runtime.getProperty(plus.runtime.appid, function(inf) {
var _this = this; var _this = this;
// //
uni.request({ uni.request({
@ -493,16 +505,18 @@
</script> </script>
<style> <style>
.bottom-img{ .bottom-img {
height: 298upx; height: 298upx;
width: 100%; width: 100%;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
} }
.bottom-img image{
.bottom-img image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.bg-login { .bg-login {
background-color: #72b0ed; background-color: #72b0ed;
color: #1f63ae; color: #1f63ae;
@ -534,15 +548,18 @@
align-items: center; align-items: center;
padding-top: 46upx; padding-top: 46upx;
} }
.login-logo{
.login-logo {
margin-right: 26upx; margin-right: 26upx;
margin-top: 10upx; margin-top: 10upx;
} }
.login-logo image{
.login-logo image {
width: 100upx; width: 100upx;
height: 100upx; height: 100upx;
} }
.login-text{
.login-text {
color: #fff; color: #fff;
font-size: 44upx; font-size: 44upx;
font-weight: 500; font-weight: 500;