Merge remote-tracking branch 'origin/dev' into dev

pull/5/head
chenxinying 2024-01-25 17:40:08 +08:00
commit b692cf9a6d
2 changed files with 235 additions and 153 deletions

View File

@ -9,60 +9,69 @@
</cu-custom>
<scroll-view scroll-y>
<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">
<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>
</view>
<view class="spot-cont">
<view class="text f30">
{{item.DEPT_NAME}}--{{item.RISKUNITNAME}}--{{item.PARTSNAME}}
</view>
<view v-if="item.ELECTRONIC_FENCE_ID" class="text f30">
所属电子围栏{{item.ELECTRONIC_FENCE}}
</view>
</view>
</view>
</view>
<view class="cu-tabbar-height"></view>
</scroll-view>
<view class="bottom-fixed" @click="$noMultipleClicks(goNext)">
<button class="cu-btn bg-green" >下一步</button>
<button class="cu-btn bg-green">下一步</button>
</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>
</template>
<script>
import {
basePath,loginUser,loginSession
basePath,
loginUser,
loginSession
} from '@/common/tool.js';
import ykAuthpup from "@/components/yk-authpup/yk-authpup"
import ykAuthpup from "@/components/yk-authpup/yk-authpup"
export default {
components: {
ykAuthpup
},
components: {
ykAuthpup
},
data() {
return {
permissionID:'',
noClick:true,
initflag:false,
listId:'',
listName:'',
baoBaoType:'',
permissionID: '',
noClick: true,
initflag: false,
listId: '',
listName: '',
baoBaoType: '',
list: [],
dataFlag:'noData',
CHECKRECORD_ID:'',
dataFlag: 'noData',
CHECKRECORD_ID: '',
}
},
onLoad(e){
this.listId=e.listId;
this.listName=e.listName;
this.baoBaoType=e.baoBaoType
onLoad(e) {
this.listId = e.listId;
this.listName = e.listName;
this.baoBaoType = e.baoBaoType
this.getData();
loginSession();
},
onShow(e){
onShow(e) {
var _this = this;
if(_this.initflag){
if (_this.initflag) {
_this.initflag = false;
_this.list = [];
this.getData()
@ -79,67 +88,119 @@
method: 'POST',
dataType: 'json',
header: {
'Content-type':'application/x-www-form-urlencoded'
'Content-type': 'application/x-www-form-urlencoded'
},
data: {
LISTMANAGER_ID: _this.listId,
USER_NAME : loginUser.NAME,
CORPINFO_ID:loginUser.CORPINFO_ID,
USER_ID:loginUser.USER_ID,
USER_NAME: loginUser.NAME,
CORPINFO_ID: loginUser.CORPINFO_ID,
USER_ID: loginUser.USER_ID,
},
success: (res) => {
if("success" == res.data.result){
if ("success" == res.data.result) {
uni.hideLoading();
_this.list = res.data.varList;
_this.CHECKRECORD_ID=res.data.CHECKRECORD_ID;
if(res.data.checkmap){
for (var i = 0; i <_this.list.length ; i++) {
if(res.data.checkmap[_this.list[i].IDENTIFICATIONPARTS_ID] >=_this.list[i].RISK_COUNT){
_this.list[i].isChecked=1
_this.CHECKRECORD_ID = res.data.CHECKRECORD_ID;
if (res.data.checkmap) {
for (var i = 0; i < _this.list.length; i++) {
if (res.data.checkmap[_this.list[i].IDENTIFICATIONPARTS_ID] >= _this.list[
i].RISK_COUNT) {
_this.list[i].isChecked = 1
}
}
}
} else {
uni.showToast({
icon:'none',
title:'系统异常',
icon: 'none',
title: '系统异常',
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) {
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
});
if (e.ELECTRONIC_FENCE_ID) {
this.getInorout(e)
}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
});
}
// 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){
this.permissionID = permissionID;
setTimeout(()=>{
this.$refs['authpup'].open();
},200)
},
openAuth(permissionID) {
this.permissionID = permissionID;
setTimeout(() => {
this.$refs['authpup'].open();
}, 200)
},
scan(){
let _this=this;
scan() {
let _this = this;
uni.scanCode({
success: function (res) {
let flag=false;
let ideId = res.result;
for(var i=0;i<_this.list.length;i++){
if(_this.list[i].IDENTIFICATIONPARTS_ID==ideId){
flag=true;
_this.goToList({'IDENTIFICATIONPARTS_ID':_this.list[i].IDENTIFICATIONPARTS_ID});
success: function(res) {
let flag = false;
let ideId = res.result;
for (var i = 0; i < _this.list.length; i++) {
if (_this.list[i].IDENTIFICATIONPARTS_ID == ideId) {
flag = true;
_this.goToList({
'IDENTIFICATIONPARTS_ID': _this.list[i].IDENTIFICATIONPARTS_ID
});
break;
}
}
if(!flag){
if (!flag) {
uni.showToast({
icon:'none',
icon: 'none',
title: "该清单中不含此部位。",
duration: 2000
});
@ -147,46 +208,50 @@
}
});
},
//
goNext(e) {
for(let i=0;i<this.list.length;i++){
if(this.list[i].isChecked!=1){
uni.showToast({
icon:'none',
title:'清单未全部检查,无法提交',
duration: 3000
});
return;
}
}
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:'')
});
},
//
goNext(e) {
for (let i = 0; i < this.list.length; i++) {
if (this.list[i].isChecked != 1) {
uni.showToast({
icon: 'none',
title: '清单未全部检查,无法提交',
duration: 3000
});
return;
}
}
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 : '')
});
},
}
}
</script>
<style>
.spot-list{
.spot-list {}
}
.spot-cont{
.spot-cont {
margin-left: 20upx;
flex: 1;
}
.spot-cont .text{
.spot-cont .text {
line-height: 1.4;
}
.spot-img{
.spot-img {
width: 100upx;
height: 100upx;
}
.spot-img image{
.spot-img image {
width: 100%;
height: 100%;
}
.spot-list .spot-item{
.spot-list .spot-item {
display: flex;
align-items: center;
background-color: #fff;

View File

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