Răsfoiți Sursa

Signed-off-by: zhaobao <528046418@qq.com>

zhaobao 10 luni în urmă
părinte
comite
03f2930a49

+ 8 - 0
api/aqpt/checklist.js

@@ -0,0 +1,8 @@
+import {request} from '@/utils/request.js'
+export function getcompletedchecklistByPage(data) {
+  return request({
+    url: "/checklist/completed/record/page",
+    method: 'GET',
+	data
+  })
+}

+ 6 - 0
api/aqpt/checklistRecordHazardApi.js

@@ -14,3 +14,9 @@ export function initChecklistHazardRecordView(data) {
     data
   })
 }
+export function getChecklistHazardRecordById(recordId, checklistId, hazardId, riskId, measureId) {
+  return request({
+    url: `/checklist/hazard/record/${recordId}/${checklistId}/${hazardId}/${riskId}/${measureId}`,
+    method: 'GET'
+  })
+}

+ 6 - 0
api/system/user.js

@@ -60,3 +60,9 @@ export function wxWorkLogin({userId,code}) {
     method: 'post'
   })
 }
+export function selectUserByGroupId(groupId) {
+  return request({
+    url: `/user/select/${groupId}`,
+    method: 'GET'
+  })
+}

+ 10 - 2
pages.json

@@ -137,7 +137,7 @@
             "path" : "pages/app_views/hazard/index/index",
             "style" :                                                                                    
             {
-                "navigationBarTitleText": "危险源",
+                "navigationBarTitleText": "危险源清单",
 				"navigationStyle": "custom",
                 "enablePullDownRefresh": false
             }
@@ -147,7 +147,7 @@
             "path" : "pages/app_views/hazard/form/form",
             "style" :                                                                                    
             {
-                "navigationBarTitleText": "隐患提交",
+                "navigationBarTitleText": "清单检查",
 				"navigationStyle": "custom",
                 "enablePullDownRefresh": false
             }
@@ -238,6 +238,14 @@
 				"navigationBarTitleText" : "任务处理",
 				"enablePullDownRefresh" : false
 			}
+		},
+		{
+			"path" : "pages/app_views/hazard/detail/detail",
+			"style" : 
+			{
+				"navigationBarTitleText" : "危险源清单详情",
+				"enablePullDownRefresh" : false
+			}
 		}
     ],
 	"tabBar": {

+ 1 - 1
pages/app_views/checkList/index/index.vue

@@ -107,7 +107,7 @@
 			check(point){	
 				uni.setStorageSync('point',point)	
 				if(this.type==='history'){	
-					if(this.status===2){
+					if(this.status===2||this.status===-1){
 						uni.navigateTo({
 							url:"/pages/app_views/checkList/detail/detail"
 						})						

+ 60 - 13
pages/app_views/danger/submit/submit.vue

@@ -32,7 +32,10 @@
 			    <uni-forms-item label="整改截止时间" name="dangerDeadLine" required>
 					<uni-datetime-picker type="datetime" return-type="string" v-model="formData.dangerDeadLine"/>
 			    </uni-forms-item>	
-			    <uni-forms-item label="处理人员" name="accountId" required>
+			    <uni-forms-item label="评审部门" name="handleGroup" required>
+				  <uni-data-select v-model="formData.handleGroup" :localdata="groupList" @change="changeHandGroup"></uni-data-select>
+			    </uni-forms-item>				
+			    <uni-forms-item label="评审人员" name="accountId" required>
 				  <uni-data-select v-model="formData.accountId" :localdata="userList"></uni-data-select>
 			    </uni-forms-item>						
 			    <uni-forms-item label="描述" name="dangerDesc">
@@ -54,7 +57,7 @@
 </template>
 
 <script>
-	import {getUserList} from '@/api/system/user.js'
+	import {getUserList,selectUserByGroupId} from '@/api/system/user.js'
 	import {getGroupView,getGroupByList} from '@/api/system/groupApi.js'
 	import {getDangerCatByList} from '@/api/danger.js'
 	import {getRiskPointByList} from '@/api/riskPiont.js'
@@ -63,6 +66,7 @@
 	import {upload} from '@/api/system/upload.js'
 	import {getchecklistRecord} from '@/api/aqpt/checklistPoint.js'
 	import { getChecklistHazardRecordView } from '@/api/aqpt/checklistRecordHazardApi'
+	
 	export default {
 		data() {
 			return {
@@ -73,8 +77,10 @@
 				  { value: 3, text: "政府执法" },
 				],
 				dangerLevelRange:[
-				  { value: 1, text: "一般隐患" },
-				  { value: 2, text: "重大隐患" }
+				  { value: 1, text: "重大隐患" },
+				  { value: 2, text: "较大隐患" },
+				  { value: 3, text: "严重隐患" },
+				  { value: 4, text: "一般隐患" }
 				],
 				groupList:[],
 				riskPointRange:[],
@@ -91,7 +97,8 @@
 					dangerCatId: undefined,
 					dangerCatTitle: '',
 					riskPointId: undefined,
-					dangerLocation: '',		
+					dangerLocation: '',	
+					accountId:"",
 					attachList:[]
 				},
 				rules: {
@@ -100,6 +107,16 @@
 							{required: true,errorMessage: '请填写姓名',},
 						]
 					},
+					handleGroup: {
+						rules:[
+							{required: true,errorMessage: '请选择评审部门',},
+						]
+					},
+					accountId: {
+						rules:[
+							{required: true,errorMessage: '请选择评审人员',},
+						]
+					},
 					// dangerCode: {rules:[{required: true,errorMessage: '请填写隐患编码'}]},
 					dangerDeadLine: {rules:[{required: true,errorMessage: '请填写整改截止时间'}]}										
 				},
@@ -138,6 +155,33 @@
 					})
 				})
 			},
+			changeHandGroup(id){
+				this.userList=[]
+				this.formData.accountId="";
+				if(!id){
+					this.getUserList();
+					return;
+				}
+				selectUserByGroupId(id).then((res)=>{
+					var userList=[]
+					for (var i = 0; i < res.data.length; i++) {
+						userList.push({
+								value: -i, 
+								text: res.data[i].name,
+								disable:true
+						})
+						for(let j = 0; j < res.data[i].children.length; j++){
+							userList.push({
+								...res.data[i].children[j],
+								value: res.data[i].children[j].accountId, 
+								text: res.data[i].children[j].accountName
+							})							
+						}
+					}
+					console.log({userList})
+					this.userList=userList				
+				})
+			},
 			getRiskPoint(){
 				let app=uni.getStorageSync('qrcode');
 				this.formData.dangerLocation=app.riskPointTitle
@@ -183,7 +227,7 @@
 							}						
 						}
 						let noPassPoints=points.filter(item=>item.checkResult===-1)
-						let dangerDesc=noPassPoints.reduce((acc, cur) => `${cur.pointContent}【未通过】;\n` + acc, "")
+						let dangerDesc=noPassPoints.reduce((acc, cur) => `${cur?.pointContent}【未通过】;\n` + acc, "")
 						this.formData.dangerDesc=dangerDesc
 						this.formData.dangerTitle=res.data.targetTitle
 					})					
@@ -231,12 +275,13 @@
 				this.$refs.form.validate().then(res=>{
 					let flow=this.userList.filter(item=>this.formData.accountId===item.accountId)[0]
 					let group=this.groupList.filter(item=>this.formData.groupId===item.groupId)[0]
-					res.curGroupId = res.groupId
-					res.curGroupName = group.groupName
+					res.curGroupId = flow.groupId
+					res.curGroupName = flow.groupName
 					res.curPositionId = flow.positionId
 					res.curPositionName = flow.positionName
 					res.curAccountId = flow.accountId
 					res.curAccountName = flow.accountName
+					res.groupId=this.formData.groupId
 					res.formCode= 'submit'
 					res.dangerId=this.flowData.wfInsId
 					res.dangerLocation=this.formData.dangerLocation
@@ -252,11 +297,13 @@
 						"activityCode":this.flowData.activityCode,
 						"actionInsId":this.flowData.actionInsId,                    
 						"actionDefId":this.flowData.actionDefList[0].actionDefId,
-						"actionCode":this.flowData.actionDefList[0].actionCode,  	
-						"groupIdTo": res.groupId||flow.groupId,
+						"actionCode":this.flowData.actionDefList[0].actionCode,  
+						"groupId":this.formData.groupId,
+						"groupName":group.groupName,
+						"groupIdTo": flow.groupId,
 						"accountIdTo": flow.accountId,						
 						"accountNameTo": flow.accountName,
-						"groupNameTo": group.groupName||flow.groupName,
+						"groupNameTo": flow.groupName,
 						"positionIdTo": flow.positionId,						
 						"positionNameTo": flow.positionName,
 						"actionRemark":this.formData.dangerDesc									
@@ -282,8 +329,8 @@
 					targetGroupId:qrcode.groupId,
 					targetGroupName:qrcode.groupName,
 				}
-				let data=await handleWorkflow({...workflowForm,attachList})
-				let resq=await handleDanger({...res,...qrcode_target,attachList,status:1,riskPointId:qrcode.targetId})
+				let flow=await handleWorkflow({...workflowForm,attachList})
+				let resq=await handleDanger({... this.formData,...qrcode_target,attachList,status:1,riskPointId:qrcode.targetId})
 				uni.showToast({
 					icon:'none',
 					title:"提交成功!",

+ 101 - 0
pages/app_views/hazard/detail/detail.vue

@@ -0,0 +1,101 @@
+<template>
+	<view class="wrap">
+		<uni-section :title="hazard.measureContent" type="line">
+			<uni-forms :label-width="300" label-position="top">
+				<uni-forms-item label="检查结果" name="checkResult">
+					<view class="uni-data-checkbox-wrap">{{hazard.checkResult}}</view>	
+				</uni-forms-item>	
+				<uni-forms-item label="备注" name="remark">
+				  <uni-easyinput disabled v-model="hazard.remark" type="textarea" :maxlength="-1" autoHeight placeholder="备注" />
+				</uni-forms-item>
+				<template v-if="hazard.attachList.length>0">
+					<view class="attach-box" @click="preview(attach,index)" v-for="(attach,index) in hazard.attachList" :key="index">	
+						<image class="attach" :src="attach.fileUrl" mode="widthFix"></image>					 
+					</view>
+				</template>
+			</uni-forms>
+		</uni-section>
+	</view>
+</template>
+
+<script>
+	import {getChecklistHazardRecordById} from '@/api/aqpt/checklistRecordHazardApi.js'
+	export default {
+		data() {
+			return {
+				hazard:{
+					checkResult:"",
+					remark:"",
+					attachList:[]	
+				}
+			}
+		},
+		onLoad() {
+			this.init()
+		},
+		methods: {
+			init(){
+				let hazard=uni.getStorageSync('hazard')
+				this.hazard=hazard
+				if(hazard.checkResult===1){this.hazard.checkResult="通过"}
+				if(hazard.checkResult===-1){this.hazard.checkResult="未通过"}
+			},
+			preview(attach,index){
+				uni.previewImage({
+					urls:[attach.fileUrl],
+					current:index
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+.wrap{
+	padding: 20rpx;
+	position: relative;
+	// &::after{
+	// 	content: "";
+	// 	width: 100%;
+	// 	height: 100vh;
+	// 	position: fixed;
+	// 	left: 0;
+	// 	top: 0;
+	// 	background-color: rgba(0,0,0,0);
+	// 	z-index: 999;
+	// }
+	.submit-BT {
+		width: 750rpx;
+		color: #4D73FF;
+		text-align: center;
+		font-size: 32rpx;
+		padding-bottom: 68rpx;
+		background-color: #fff;
+		position: fixed;
+		left: 0;
+		bottom: 0;
+		z-index: 99;
+		box-shadow: 0px 0px 12px 0px #0000000A;
+		border-radius: 8px 8px 0px 0px
+	}
+	::v-deep .uni-forms-item{
+		.uni-forms-item__content{
+			.uni-data-checkbox-wrap{
+				height: 100%;
+				display: flex;
+				align-items: center;					
+			}
+	
+		}		
+	}
+	.attach-box{
+		&,.attach{
+			width: 200rpx;
+			height: 200rpx;
+			margin-right: 10rpx;
+			border: 1px solid #333;			
+		}
+
+	}
+}
+</style>

+ 3 - 2
pages/app_views/hazard/form/form.vue

@@ -2,7 +2,7 @@
 	<view class="wrap">
 		<uni-section :title="hazard.measureContent" type="line">
 			<uni-forms ref="form" :modelValue="formData" :rules="rules" :label-width="300" label-position="top">
-				<uni-forms-item label="隐患等级" name="checkResult" required>
+				<uni-forms-item label="检查结果" name="checkResult" required>
 					<view class="uni-data-checkbox-wrap">
 						<uni-data-checkbox v-model="formData.checkResult" :localdata="checkResults" />				
 					</view>
@@ -87,9 +87,10 @@
 				// 		})
 				// 	}
 				// })
-				let idx=this.itemList.findIndex(item=>item.hazardId===hazard.hazardId)
+				let idx=this.itemList.findIndex(item=>item.measureId===hazard.measureId)
 				this.itemList[idx].checkResult=this.formData.checkResult
 				this.batchHandle()
+
 			},
 			getchecklist(){
 				getChecklistHazardRecordView(this.hazard.recordId).then((res)=>{

+ 37 - 20
pages/app_views/hazard/index/index.vue

@@ -60,29 +60,32 @@
 				checklistId:undefined,
 				handleVisiable:false,
 				showMore:false,
-				submit_bt_state:false
+				submit_bt_state:false,
+				type:undefined,
+				status:undefined
 			}
 		},
 		filters: {
 		  checkResultFilter(i) {
-					  if (i >= 0) {
-					    const strs = [
-					      '未检查',
-					      '通过'
-					    ]
-					    return strs[i]
-					  } else {
-					    if (i === -1) {
-					      return '未通过'
-					    } else if (i === -2) {
-					      return '发现隐患'
-					    }
-					  }
+			  if (i >= 0) {
+				const strs = [
+				  '未检查',
+				  '通过'
+				]
+				return strs[i]
+			  } else {
+				if (i === -1) {
+				  return '未通过'
+				} else if (i === -2) {
+				  return '发现隐患'
+				}
+			  }
 		  }
 		},
 		onLoad({id,recordId,type}) {
 			this.checklistId=id	
-			this.recordId=recordId	
+			this.recordId=recordId
+			this.type=type
 			if(type==="app"){
 			    this.initCheckList(id)	
 				this.handleVisiable=true
@@ -110,19 +113,33 @@
 				getChecklistHazardRecordViewById(recordId,checklistId).then((res)=>{
 					this.itemList=res.data.hazardList
 					 let userId=uni.getStorageSync('userId')
+					 this.status=res.data.status
 					this.handleVisiable=(res.data.status===0||res.data.status===1)&&(res.data.accountId===userId)
 				})
 			},
-			check(measure){
-				if(!this.handleVisiable) return
+			check(measure){			
 				uni.setStorageSync('hazard',{
 					...measure,
 					checklistId:this.checklistId,
 					recordId:this.recordId
 				})
-				uni.navigateTo({
-					url:"/pages/app_views/hazard/form/form"
-				})
+				if(this.type==='history'){	
+					if(this.status===2||this.status===-1){
+						uni.navigateTo({
+							url:"/pages/app_views/hazard/detail/detail"
+						})						
+					}
+					if(this.handleVisiable){
+						uni.navigateTo({
+							url:"/pages/app_views/hazard/form/form"
+						})							
+					}
+				}else{
+					if(!this.handleVisiable) return
+					uni.navigateTo({
+						url:"/pages/app_views/hazard/form/form"
+					})			
+				}			
 			},
 			handleSubmit(type){
 				let recordId=this.recordId;

+ 32 - 3
pages/history/history.vue

@@ -9,6 +9,7 @@
 			<view class="tab" :class="tabIdx===5?'active':''" @click="tabclick(5)">问题反馈</view>				
 			<view class="tab" :class="tabIdx===3?'active':''" @click="tabclick(3)">满意度评价</view>			
 		</view>
+		<view class="back" @click="back" v-if="showback">返回</view>
 		<view class="item-list-wrap" v-if="total>0">
 			<view class="item-list basics" v-if="tabIdx===1||tabIdx===4">
 				<view class="basics-item" v-for="(item,idx) in items" :key="idx" @click="showDetail(item)">
@@ -78,6 +79,7 @@
 	import {getDangerByPage} from '@/api/aqpt/dangerApi.js'
 	import { getchecklistByPage} from '@/api/aqpt/checklistPoint.js'
 	import { getSnapshotByPage} from '@/api/aqpt/snapshotApi.js'
+	import { getcompletedchecklistByPage} from '@/api/aqpt/checklist.js'	
 	export default { 
 		data() {
 			return {
@@ -88,7 +90,8 @@
 				total:0,
 				items:[],
 				tabIdx:1,
-				isAccount:undefined
+				isAccount:undefined,
+				showback:window.android?true:false
 			}
 		},
 		onShow() {
@@ -146,6 +149,11 @@
 				this.tabIdx=tabIdx
 				this.init()
 			},
+			back(){
+				if(window.android){
+					window.android.webExit()					
+				}
+			},
 			getData(){
 				let qrcode=uni.getStorageSync('qrcode')
 				let targetType=qrcode.targetType
@@ -169,7 +177,8 @@
 						targetId,						
 					}
 					if(this.tabIdx!==1){params.checklistTypeId=enums[this.tabIdx]}
-					getchecklistByPage(params).then((res)=>{
+					let getchecklist=this.tabIdx===1?getcompletedchecklistByPage:getchecklistByPage
+					getchecklist(params).then((res)=>{
 						let items=JSON.parse(JSON.stringify(this.items))
 						this.items=items.concat(res.data)
 						this.total=res.total
@@ -205,7 +214,12 @@
 			showDetail(item){
 				let pageUrl="";
 				if(this.tabIdx===1){
-					pageUrl="/pages/app_views/checkList/index/index"				
+					if(item.checklistTypeId===1){
+						pageUrl="/pages/app_views/hazard/index/index"						
+					}else{
+						pageUrl="/pages/app_views/checkList/index/index"					
+					}
+				
 				}
 				if(this.tabIdx===3){
 					pageUrl="/pages/app_views/satisfaction_evaluation/satisfaction_evaluation"
@@ -278,6 +292,21 @@
 			}
 		}
 	}
+	.back{
+		width: 100rpx;
+		height: 100rpx;
+		background-color: #4D73FF;
+		color: #fff;
+		font-size: 32rpx;
+		text-align: center;
+		line-height: 100rpx;
+		box-shadow:1px 2px 8px rgba(0,0,0,0.5);
+		position: fixed;	
+		right: 20rpx;
+		top: 40%;
+		z-index: 999;
+		border-radius: 50%;
+	}
 }
 .isEmpty{
 	width: 100%;