Browse Source

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

zhaobao 1 year ago
parent
commit
7f62c86576

+ 76 - 0
api/aqpt/dangerCatApi.js

@@ -0,0 +1,76 @@
+import {request} from '@/libs/request.js'
+
+/**
+ * 分页查询Danger Category
+ * @param data
+ * @returns
+ */
+export function getDangerCatByPage(data) {
+  return request({
+    url: '/danger/cat/page',
+    method: 'GET',
+    params: data
+  })
+}
+
+/**
+ * 列表查询Danger Category
+ * @returns
+ */
+export function getDangerCatByList() {
+  return request({
+    url: '/danger/cat',
+    method: 'GET'
+  })
+}
+
+/**
+ * 基于Id查询Danger Category
+ * @param dangerCatId
+ * @returns
+ */
+export function getDangerCatById(dangerCatId) {
+  return request({
+    url: `/danger/cat/${dangerCatId}`,
+    method: 'GET'
+  })
+}
+
+/**
+ * 添加Danger Category
+ * @param data
+ * @returns
+ */
+export function createDangerCat(data) {
+  return request({
+    url: `/danger/cat/add`,
+    method: 'POST',
+    data
+  })
+}
+
+/**
+ * 更新Danger Category
+ * @param data
+ * @returns
+ */
+export function updateDangerCat(data) {
+  return request({
+    url: `/danger/cat/update`,
+    method: 'PUT',
+    data
+  })
+}
+
+/**
+ * 删除Danger Category
+ * @param dangerCatId
+ * @returns
+ */
+export function deleteDangerCat(dangerCatId) {
+  return request({
+    url: `/danger/cat/${dangerCatId}`,
+    method: 'DELETE'
+  })
+}
+

+ 98 - 0
api/aqpt/riskPointApi.js

@@ -0,0 +1,98 @@
+import { request } from '@/libs/request.js'
+/**
+ * 列表查询
+ * @returns
+ */
+export function getRiskPointByList(data) {
+  return request({
+    url: '/riskPoint',
+    method: 'GET',
+    params: data
+  })
+}
+
+/**
+ * 分页查询
+ * @returns
+ */
+export function getRiskPointByPage(data) {
+  return request({
+    url: '/riskPoint/page',
+    method: 'GET',
+    params: data
+  })
+}
+
+/**
+ * 基于ID查询
+ * @returns
+ */
+export function getRiskPointById(riskPointId) {
+  return request({
+    url: `/riskPoint/${riskPointId}`,
+    method: 'GET'
+  })
+}
+
+/**
+ * 添加风险单元
+ * @param data
+ * @returns
+ */
+export function createRiskPoint(data) {
+  return request({
+    url: `/riskPoint/add`,
+    method: 'POST',
+    data
+  })
+}
+
+/**
+ * 修改风险单元
+ * @param data
+ * @returns
+ */
+export function updateRiskPoint(data) {
+  return request({
+    url: `/riskPoint/update`,
+    method: 'PUT',
+    data
+  })
+}
+
+/**
+ * 删除风险单元
+ * @returns
+ * @param riskPointId
+ */
+export function deleteRiskPointById(riskPointId) {
+  return request({
+    url: `/riskPoint/${riskPointId}`,
+    method: 'DELETE'
+  })
+}
+
+/**
+ * 批量操作激活或未激活风险单元
+ * @param data
+ * @returns
+ */
+export function batchUpdateRiskPoint(data) {
+  return request({
+    url: `/riskPoint/batchUpdate`,
+    method: 'post',
+    data
+  })
+}
+
+/**
+ * 基于等级统计
+ * @returns
+ */
+export function getRiskPointCounterByLevel(data) {
+  return request({
+    url: '/riskPoint/statis/getCounterByLevel',
+    method: 'GET',
+    params: data
+  })
+}

+ 3 - 2
config/index.js

@@ -1,10 +1,11 @@
 export default {
     base: {
-      // dev: 'http://1.15.92.205:7001',		
+      dev: 'http://1.15.92.205:7001',		
       // dev: 'https://api.xazhyc.com',
 	  // dev: 'http://192.168.3.253:7001',	
-	  dev:"http://192.168.3.5:7001",
+	  // dev:"http://192.168.3.5:7001",
       pro: 'https://api.xazhyc.com',
+	  // pro: 'http://192.168.3.5:7001',
     },
 	appID: '10007',
 	appKey: '82a8bf439373e311',

+ 16 - 0
pages.json

@@ -97,6 +97,14 @@
         		"enablePullDownRefresh" : false
         	}
         },
+		{
+			"path" : "pages/index/handle/danger/index/submit",
+			"style" : 
+			{
+				"navigationBarTitleText" : "隐患登记",
+				"enablePullDownRefresh" : false
+			}
+		},
         {
         	"path" : "pages/index/handle/task/task",
         	"style" : 
@@ -152,6 +160,14 @@
 				"navigationBarTitleText" : "处理检查",
 				"enablePullDownRefresh" : false
 			}
+		},
+		{
+			"path" : "pages/index/handle/danger/index/submit",
+			"style" : 
+			{
+				"navigationBarTitleText" : "登记隐患",
+				"enablePullDownRefresh" : false
+			}
 		}
     ],
 	"tabBar": {

+ 439 - 0
pages/index/handle/danger/index/submit.vue

@@ -0,0 +1,439 @@
+<template>
+	<view class="danger-form">
+		<div class="form-container">
+			<uni-forms ref="form" :modelValue="formData" :rules="rules" :label-width="300" label-position="top">
+				<uni-forms-item label="隐患标题" name="dangerTitle" required>
+					<uni-easyinput type="text" v-model="formData.dangerTitle" placeholder="请输入姓名" />
+				</uni-forms-item>
+				<uni-forms-item label="所属部门" name="groupId" required>
+				  <uni-data-select v-model="formData.groupId" :localdata="groupList" :clear="false"></uni-data-select>
+				</uni-forms-item>	
+				<uni-forms-item label="发生位置" name="riskPointId" required>
+				  <uni-data-select v-model="formData.riskPointId" :localdata="riskList" :clear="false"></uni-data-select>
+				</uni-forms-item>	
+				<uni-forms-item label="隐患类别" name="dangerCatId" required>
+				  <uni-data-select v-model="formData.dangerCatId" :localdata="dangerCats" :clear="false"></uni-data-select>
+				</uni-forms-item>											
+				<uni-forms-item label="隐患来源" name="dangerSource" required>
+				  <uni-data-select v-model="formData.dangerSource" :localdata="dangerSources" :clear="false"></uni-data-select>
+				</uni-forms-item>	
+				<uni-forms-item label="隐患等级" name="dangerLevel" required>
+				  <uni-data-select v-model="formData.dangerLevel" :localdata="dangerLevels" :clear="false"></uni-data-select>
+				</uni-forms-item>	
+				<uni-forms-item label="整改截止时间" name="dangerDeadLine" required>		 
+					<uni-datetime-picker type="date" :clear-icon="false" v-model="formData.dangerDeadLine" />			
+				</uni-forms-item>																			
+				<uni-forms-item label="描述建议" name="dangerDesc">
+				  <uni-easyinput v-model="formData.dangerDesc" type="textarea" :maxlength="-1" autoHeight placeholder="描述" />
+				</uni-forms-item>
+				<uni-forms-item label="执行部门" name="groupId" required>
+				  <uni-data-select v-model="formData.handgroupId" :localdata="groupList" @change="changeGroup" :clear="false"></uni-data-select>
+				</uni-forms-item>	
+				<uni-forms-item label="执行人" name="accountIdTo" required>
+				  <uni-data-select v-model="formData.accountIdTo" :localdata="userList"></uni-data-select>
+				</uni-forms-item>	
+			</uni-forms>
+			<uni-section title="上传附件" type="line">
+				<view class="example-body">
+					<uni-file-picker  v-model="formData.attachList" 
+					 fileMediatype="image" 
+					 title="请上传附件"
+					 limit="1"
+					 @select="uploadSuccess"
+					 @delete="deleteFile"></uni-file-picker>
+				</view>
+			</uni-section>
+		</div>
+		<view class="button-container" @click="onSubmit">
+			<text>提交</text>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {getDangerById} from '@/api/aqpt/dangerApi.js'
+	import {startWorkflow,getWorkflowById,handleWorkflow} from '@/api/system/wfApi.js'
+	import {getUserList,selectUserByGroupId} from '@/api/system/user.js'	
+	import {getGroupByList} from '@/api/system/groupApi.js'
+	import { handleDanger } from '@/api/system/dangerApi.js'
+	import {upload} from '@/api/system/upload.js'
+	import { getRiskPointByList } from '@/api/aqpt/riskPointApi.js'
+	import { getDangerCatByList } from '@/api/aqpt/dangerCatApi.js'
+	export default {
+		data() {
+			return {
+				dangerId:undefined,
+				baseInfo:{
+					
+				},
+				actionDefList:[],
+				userList:[],
+				groupList:[],
+				riskList:[],
+				dangerLevels:[
+					{text:"重大隐患",value:1},
+					{text:"较大隐患",value:2},
+					{text:"严重隐患",value:3},
+					{text:"一般隐患",value:4},
+				],
+				dangerSources:[
+					{text:"自查",value:0},
+					{text:"内部反馈",value:1},
+					{text:"上级检查",value:2},
+					{text:"政府执法",value:3},
+				],
+				dangerCats:[],
+				flowData:{},
+				formData:{
+					dangerTitle:"",
+					riskPointId:undefined,
+					dangerCatId:undefined,
+					dangerSource:undefined,
+					dangerLevel:undefined,
+					dangerDesc:"",
+					accountIdTo:"",
+					actionDefId:"",
+					groupId:"",
+					attachList:[]
+				},
+				rules:{
+					
+				}
+			}
+		},
+		onLoad() {
+			this.init()
+		},
+		methods: {
+			dangerStatus(i) {
+			  if (i >= 0) {
+			    const strs = ['提交','评审','整改','验收','已完成']
+			    return strs[i]
+			  } else {
+			    return '已撤销'
+			  }
+			},
+			init(){
+				this.getUserList()
+				this.getGroupList()
+				this.start()
+				this.getRiskPoints()
+				this.getDangerCats()
+			},
+			start(){
+				startWorkflow(1).then((res)=>{
+					this.flowData=res.data
+					this.dangerId=res.data.wfInsId
+				})
+			},
+			// 获取流程
+			get(wfInsId) {
+				getWorkflowById(wfInsId).then((resp) => {
+				  const { data } = resp
+				  this.flowData = data
+				  this.formData.wfDefId = data.wfDefId
+				  this.formData.wfInsId = data.wfInsId
+				  this.formData.activityDefId = data.activityDefId
+				  this.formData.activityInsId = data.activityInsId
+				  this.formData.activityCode = data.activityCode
+				  this.formData.actionInsId = data.actionInsId
+				  if(data.wfInsTitle){
+					  uni.setNavigationBarTitle({
+						  title:`${data.activityInsTitle}流程`
+					  })
+				  }
+				  this.actionDefList=this.flowData.actionDefList.map(item=>{
+					  return{
+						  ...item,
+						  text:item.actionTitle,
+						  value:item.actionDefId
+					  }
+				  })
+				  if(this.actionDefList.length>0){
+					  this.formData.actionDefId=this.actionDefList[0].actionDefId
+				  }				  
+				}).catch(()=>{
+					uni.showToast({
+						icon:"none",
+						title:"流程初始化失败"
+					})
+				})
+			},
+			changeGroup(groupId){
+				if(!groupId){
+					this.getUserList()
+					return
+				}
+				selectUserByGroupId(groupId).then((res)=>{
+					var userList=[]
+					this.formData.accountIdTo=""
+					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
+							})							
+						}
+					}
+					this.userList=userList
+				})				
+			},
+			getDangerCats(){
+				getDangerCatByList().then((res)=>{
+					this.dangerCats=res.data.map((item)=>{
+						return{
+							value:item.dangerCatId, 
+							text: item.dangerCatTitle,							
+						}
+					})
+				}) 				
+			},
+			getRiskPoints(){
+				getRiskPointByList().then((res)=>{
+					this.riskList=res.data.map((item)=>{
+						return{
+							value:item.riskPointId, 
+							text: item.riskPointTitle,							
+						}
+					})
+				})					
+			},
+			getGroupList(){
+				getGroupByList().then((res)=>{
+					this.groupList=res.data.map((item)=>{
+						return{
+							value:item.groupId, 
+							text: item.groupName,							
+						}
+					})
+				})	
+			},	
+			getUserList(){
+				getUserList().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
+							})							
+						}
+					}
+					this.userList=userList
+				})
+			},
+			showImage(index){
+				uni.previewImage({
+					urls:this.baseInfo.attachList.map(item=>item.fileUrl),
+					current:index
+				})
+			},
+			onSubmit(){
+				let user=this.userList.filter(item=>this.formData.accountId===item.accountId)[0]
+				const arr = this.flowData.actionDefList
+				const action = arr[0]
+				this.handleUserSelect()
+				let workflowForm={				
+					"wfDefId": this.flowData.wfDefId,
+					"wfInsId": this.flowData.wfInsId,
+					"activityDefId": this.flowData.activityDefId,
+					"activityInsId":this.flowData.activityInsId,
+					"activityCode": "submit",
+					"actionId": 1,
+					"actionCode":  action.actionCode,
+					"actionRemark": this.flowData.dangerDesc,
+					"attachList": this.formData.attachList,
+					"actionInsId": this.flowData.actionInsId,
+					"actionDefId": action.actionDefId,
+					"groupIdTo": this.formData.groupIdTo,
+					"positionIdTo": this.formData.positionIdTo,
+					"accountIdTo": this.formData.accountIdTo,
+					"accountNameTo": this.formData.accountNameTo,
+					"groupNameTo": this.formData.groupNameTo,
+					"positionNameTo": this.formData.positionNameTo
+				}
+				this.handleSubmit(workflowForm)
+			},
+			async handleSubmit({res,workflowForm}) {
+				let attachList=[]
+				for(let i=0;i<this.formData.attachList.length;i++){
+					let filePath=this.formData.attachList[i].url
+					let fileresq=await upload({filePath})
+					fileresq=JSON.parse(fileresq)
+					attachList.push(fileresq.data)
+				}
+				let scenePhoto= attach[0].fileUrl
+				let sceneIcon= attach[0].fileIcon
+				let {data}=await handleWorkflow(workflowForm).catch(()=>{uni.showToast({icon:'none',title:"提交失败!"})})
+				let dangerLocation=this.riskList.find(item=>item.riskPointId===this.formData.riskPointId)[0].riskPointTitle;
+				let resq=await handleDanger({
+					"formCode": "submit",
+					"dangerId": this.flowData.wfInsId,
+					"scenePhoto":scenePhoto,
+					"sceneIcon": sceneIcon,
+					"groupId": this.formData.groupId,
+					"riskPointId": this.formData.riskPointId,
+					"dangerCode": this.formData.dangerCode,
+					"dangerTitle": this.formData.dangerTitle,
+					"dangerCatId": this.formData.dangerCatId,
+					"dangerLevel": this.formData.dangerLevel,
+					"dangerDesc": this.formData.dangerDesc,
+					"dangerLocation":dangerLocation,
+					"dangerDeadLine": this.formData.dangerDeadLine,
+					"dangerSource": this.formData.dangerSource,
+					"submitRemark": this.flowData.dangerDesc,
+					"curGroupId": this.formData.groupIdTo,
+					"curGroupName": this.formData.groupNameTo,
+					"curPositionId": this.formData.positionIdTo,
+					"curPositionName": this.formData.positionNameTo,
+					"curAccountId": this.formData.accountIdTo,
+					"curAccountName": this.formData.accountIdTo,
+					"status": 1,
+					"attachList": []					
+				}).catch(()=>{uni.showToast({icon:'none',title:"提交失败!"})})
+				uni.showToast({
+					icon:'none',
+					title:"提交成功!",
+					complete() {
+						uni.redirectTo({
+							url:'/pages/index/detail/detail?type=danger&name=隐患管理'
+						})
+					}
+				})
+			},	
+			// 选择执行人员
+			handleUserSelect() {
+				const accountId=this.formData.accountIdTo
+				const self=this;
+				this.userList.forEach((obj) => {
+					if (obj.accountId === accountId) {
+						self.form.groupIdTo= obj.groupId
+						self.form.positionIdTo= obj.positionId
+						self.form.accountIdTo= obj.accountId
+	
+						self.form.groupNameTo= obj.groupName,
+						self.form.positionNameTo=obj.positionName
+						self.form.accountNameTo= obj.accountName
+					}
+				})
+			}, 
+			getStatusByActivityCode(activityCode, wfStatus) {
+			  let iRet = 0
+			  if (wfStatus === 0) {
+				if (activityCode === 'submit') {
+				  iRet = 0
+				} else if (activityCode === 'review') {
+				  iRet = 1
+				} else if (activityCode === 'rectify') {
+				  iRet = 2
+				} else if (activityCode === 'accept') {
+				  iRet = 3
+				}
+			  } else if (wfStatus === 1) {
+				iRet = 4
+			  } else {
+				iRet = -1
+			  }
+			  return iRet
+			},
+			changeAction(item){
+				this.formData.actionDefId=item.value
+			},
+			uploadSuccess(e){
+				let attachList=JSON.parse(JSON.stringify(this.formData.attachList))
+				attachList.push(e.tempFiles[0])
+				this.formData.attachList=attachList
+			},
+			deleteFile(e){							
+				let attachList=JSON.parse(JSON.stringify(this.formData.attachList))
+				attachList.filter(item=>item.uuid!==e.tempFile.uuid)
+				this.formData.attachList=attachList
+			},			
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.danger-form{
+		padding: 20rpx 20rpx 160rpx 20rpx;
+		margin-bottom: 120rpx;
+		 .attach-wrap{
+			display: flex;
+			flex-wrap: wrap;
+			.attach{
+				display: block;
+				width: 100rpx;
+				height: 100rpx;
+				margin: 10rpx;
+				border: 1px solid #ccc;
+			}
+		}
+		.form-container{
+			padding: 10rpx;
+			// box-shadow: 0px 0px 3px 1px rgba(0, 0, 0, 0.08);
+			margin-top: 20rpx;
+		}
+		.submit_bt{
+			width: 600rpx;
+			height: 72rpx;
+			line-height: 72rpx;
+			box-sizing: border-box;
+			border-radius: 16upx;
+			margin-top: 50upx;
+			background-color:#3384FF;
+			font-size: 32rpx;
+			color: #fff;
+		}
+		.button-container{
+			width: 750rpx;
+			height:88rpx;
+			line-height:88rpx;
+			color: #4D73FF;
+			text-align: center;
+			font-size: 32rpx;
+			padding-bottom: 68rpx;
+			background-color: #fff;
+			position: fixed;
+			left: 0;
+			bottom: 0;
+			z-index: 2;
+			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;
+					.action{
+						padding: 22rpx 32rpx;
+						background-color: #fff;
+						border-radius: 2px;
+						margin-right: 20rpx;
+						font-size: 28rpx;
+						line-height: 1;
+						&.active{
+							background: rgba(77, 115, 255, 0.16);
+							color: #4D73FF;
+						}
+					}
+				}
+
+			}		
+		}
+	}
+
+</style>

+ 20 - 21
pages/index/handle/task/checkList/form/form.vue

@@ -25,6 +25,7 @@
 <script>
 	import {upload} from '@/api/system/upload.js'	
 	import {updateChecklistPoint,getchecklistRecord} from '@/api/aqpt/checklistPoint.js'
+	import {completeCheckTask} from '@/api/aqpt/task.js'	
 	export default {
 		data() {
 			return {
@@ -124,33 +125,31 @@
 						title:"提交失败!"
 					})				
 				})
-				// uni.showToast({
-				// 	icon:'none',
-				// 	title:"提交成功!",
-				// 	duration:1000,					
-				// 	complete() {
-				// 		uni.redirectTo({
-				// 			url:`/pages/app_views/checkList/index/index?type=form&id=${point.checklistId}&recordId=${point.recordId}`
-				// 		})
-				// 	}
-				// })
-				// this.goOnNext();	
+				let idx=this.itemList.findIndex(item=>item.pointId===point.pointId)
+				this.itemList[idx].checkResult=this.formData.checkResult				
 				this.batchHandle()
 			},
 			// 批量处理未处理的
 			batchHandle(){
 				let point=uni.getStorageSync('point')
 				if(this.handles.length<1){
-					uni.showToast({
-						icon:'none',
-						title:"处理完毕",
-						duration:1000,
-						complete() {
-							uni.redirectTo({
-								url:`/pages/index/detail/detail?type=task&name=待办任务`
-							})
-						}
-					})	
+					completeCheckTask(point.recordId).then(()=>{
+						uni.showToast({
+							icon:'none',
+							title:"处理完毕",
+							duration:1000,
+							complete() {
+								uni.redirectTo({
+									url:`/pages/index/detail/detail?type=task&name=待办任务`
+								})
+							}
+						})	
+					}).catch(()=>{
+						uni.showToast({
+							icon:"none",
+							title:"操作失败"
+						})
+					})					
 					return					
 				}
 				let nextPoint=this.handles[0]

+ 43 - 44
pages/index/handle/task/hazardRecord/form.vue

@@ -27,11 +27,9 @@
 
 <script>
 import {upload} from '@/api/system/upload.js'	
-import { 
-	getChecklistHazardRecordById, 
-	updateChecklistHazardRecordDoing ,
-} from '@/api/aqpt/checklistHazardRecordApi'
+import { getChecklistHazardRecordById,updateChecklistHazardRecordDoing} from '@/api/aqpt/checklistHazardRecordApi'
 import { getChecklistHazardRecordView } from '@/api/aqpt/checklistRecordHazardApi'
+import {completeCheckTask} from '@/api/aqpt/task.js'	
 	export default {
 		data() {
 			return {
@@ -78,7 +76,8 @@ import { getChecklistHazardRecordView } from '@/api/aqpt/checklistRecordHazardAp
 						let temp=measures[0];
 						measures[0]=JSON.parse(JSON.stringify(this.measure))
 						measures[index]=temp
-					}					
+					}	
+					this.itemList=measures									
 					this.handles=measures					
 				})
 			},
@@ -129,7 +128,9 @@ import { getChecklistHazardRecordView } from '@/api/aqpt/checklistRecordHazardAp
 						icon:'none',
 						title:"提交失败!"
 					})				
-				})	
+				})
+				let idx=this.itemList.findIndex(item=>item.measureId==measure.measureId)
+				this.itemList[idx].checkResult=this.formData.checkResult
 				this.batchHandle()
 			},
 			// 批量处理未处理的
@@ -139,16 +140,43 @@ import { getChecklistHazardRecordView } from '@/api/aqpt/checklistRecordHazardAp
 				handles.shift()	
 				this.handles=handles
 				if(handles.length<1){
-					uni.showToast({
-						icon:'none',
-						title:"处理完毕",
-						duration:1000,
-						complete() {
-							uni.redirectTo({
-								url:`/pages/index/detail/detail?type=task&name=待办任务`
+					const key=this.itemList.find(item=>item.checkResult===-1)
+					console.log({
+						"this.itemList":this.itemList,
+						key
+					})
+					if(!key){
+						completeCheckTask(measure.recordId).then(()=>{
+							uni.showToast({
+								icon:'none',
+								title:"处理完毕",
+								duration:1000,
+								complete() {
+									uni.redirectTo({
+										url:`/pages/index/detail/detail?type=task&name=待办任务`
+									})
+								}
+							})	
+						}).catch(()=>{
+							uni.showToast({
+								icon:"none",
+								title:"操作失败"
 							})
-						}
-					})	
+						})						
+					}else{
+						let cid=measure.checklistId;
+						let rid=measure.recordId;
+						uni.showToast({
+							icon:'none',
+							title:"处理完毕",
+							duration:1000,
+							complete() {
+								uni.redirectTo({
+									url:`/pages/index/handle/task/hazardRecord/hazardRecord?rid=${rid}&cid=${cid}&title=${measure.hazardTitle}`
+								})
+							}
+						})							
+					}
 					return					
 				}
 				this.formData={
@@ -159,35 +187,6 @@ import { getChecklistHazardRecordView } from '@/api/aqpt/checklistRecordHazardAp
 				uni.setStorageSync('measure',handles[0]);
 				this.measure=handles[0];								
 			},
-			// 批量处理未处理的【按顺序走到最后一个】
-			goOnNext(){
-				let point=uni.getStorageSync('point')				
-				let pointIdex=this.itemList.findIndex(item=>point.pointId===item.pointId)
-				let handles=this.itemList.slice(pointIdex+1);			
-				let nextPointIdx=handles.findIndex(item=>(!item.checkResult))
-					nextPointIdx=nextPointIdx+pointIdex
-				if(handles.length<1||nextPointIdx<0){
-					uni.showToast({
-						icon:'none',
-						title:"处理完毕",
-						duration:1000,
-						complete() {
-							uni.redirectTo({
-								url:`/pages/app_views/checkList/index/index?type=form&id=${point.checklistId}&recordId=${point.recordId}`
-							})
-						}
-					})	
-					return
-				}			
-				this.formData={
-					checkResult:1,	
-					remark:"",
-					attachList:[]
-				}						
-				let nextPoint=this.itemList[nextPointIdx+1]				
-				uni.setStorageSync('measure',nextPoint);//防止测试刷新数据丢失
-				this.measure=nextPoint;					
-			},
 			uploadSuccess(e){
 				let attachList=JSON.parse(JSON.stringify(this.formData.attachList))
 				attachList.push(e.tempFiles[0])

+ 100 - 17
pages/index/handle/task/hazardRecord/hazardRecord.vue

@@ -22,16 +22,24 @@
 				<view class="handle-container">	
 					<view class="handle" @click="handleSubmit(1)">全部通过</view>
 					<view class="handle" @click="handleSubmit(2)">全不通过</view>	
-					<view class="handle" @click="handleSubmit(3)">提交</view>
-					<view class="handle" @click="handleSubmit(4)">撤销</view>
-					<view class="handle" @click="handleSubmit(5)">转交</view>
+					<view class="handle submit" @click="handleSubmit(3)">提交</view>
+					<view class="handle danger" @click="handleSubmit('danger')">登记隐患</view>
+					<view class="more" @mouseenter="hover(1)" @mouseleave="hover">
+						<text class="text">更多</text>
+						<view class="list" v-if="showMore">
+							<view class="hand-item-box">
+								<view class="handle-item" @click="handleSubmit(4)">撤销</view>
+								<view class="handle-item" @click="handleSubmit(5)">转交</view>																	
+							</view>						
+						</view>						
+					</view>
 				</view>
 			</template>
 			<template v-else>没有可处理的清单^-_-^</template>
 		</view>		
 	</view>
 </template>
-<script>
+<script>	
 import { getChecklistHazardRecordView } from '@/api/aqpt/checklistRecordHazardApi'
 import { batchUpdateChecklistHazardRecordDoing } from '@/api/aqpt/checklistHazardRecordApi'
 import {cancelCheckTask,completeCheckTask} from '@/api/aqpt/task.js'	
@@ -52,7 +60,8 @@ import {cancelCheckTask,completeCheckTask} from '@/api/aqpt/task.js'
 				handleVisiable:false,
 				type:undefined,
 				status:undefined,
-				taskTitle:""
+				taskTitle:"",
+				showMore:false
 			}
 		},
 		  filters: {
@@ -83,13 +92,14 @@ import {cancelCheckTask,completeCheckTask} from '@/api/aqpt/task.js'
 		methods: {
 			getchecklistRecord(recordId){
 				getChecklistHazardRecordView(recordId).then((res)=>{
+					if(!res.data.hazardList)return					
 					this.itemList=res.data.hazardList
 					this.status=res.data.status				
 				})
 			},
 			check(measure){		
 				uni.setStorageSync("measure",measure)
-				uni.navigateTo({
+				uni.redirectTo({
 					url:"/pages/index/handle/task/hazardRecord/form"
 				})								
 			},
@@ -98,12 +108,12 @@ import {cancelCheckTask,completeCheckTask} from '@/api/aqpt/task.js'
 				let checklistId=this.checklistId;
 				if(type===1){
 					batchUpdateChecklistHazardRecordDoing(recordId,1).then(()=>{
-						this.getchecklistRecord(checklistId,recordId)
+						this.getchecklistRecord(recordId)
 					})
 				}
 				if(type===2){
 					batchUpdateChecklistHazardRecordDoing(recordId,-1).then(()=>{
-						this.getchecklistRecord(checklistId,recordId)
+						this.getchecklistRecord(recordId)
 					})
 				}				
 				if(type===3){//完成
@@ -132,10 +142,27 @@ import {cancelCheckTask,completeCheckTask} from '@/api/aqpt/task.js'
 				}	
 				if(type===5){//转交
 					let taskTitle=this.taskTitle;
-					uni.navigateTo({
+					uni.redirectTo({
 						url:`/pages/index/handle/task/checkList/form/transferCheckTask?tid=${recordId}&title=${taskTitle}`
 					})
 				}
+				if(type==="danger"){
+					let href="http://h5.xazhyc.com/danger/views/create.html";
+					let name= '登记隐患'
+					completeCheckTask(recordId).then(()=>{
+						uni.redirectTo({
+							url:`/pages/webview/webview?href=${href}&name=${name}`
+						})
+					}).catch(()=>{
+						uni.showToast({
+							icon:"none",
+							title:"操作失败"
+						})
+					})
+				}
+			},
+			hover(state){
+				this.showMore=state===1
 			}
 		}
 	}
@@ -223,18 +250,74 @@ import {cancelCheckTask,completeCheckTask} from '@/api/aqpt/task.js'
 			justify-content: center;
 			align-items: center;
 			border-top: 1rpx solid #eaeaea;
+			padding: 15rpx 0;
 			.handle{
-				display:block;
-				background-color: #3384FF;
-				color: #fff;
-				padding: 15rpx 0;
-				width: 20%;
+				display:inline-block;
+				color: #222;
+				padding: 15rpx 20rpx;
 				box-sizing: border-box;
-				border-right: 1rpx solid #eaeaea;
+				border: 1rpx solid #eaeaea;
 				font-size: 26rpx;
 				text-align: center;
-				&:last-child{
-					border: 0;
+				border-radius: 50rpx;
+				margin: 0 10rpx;
+				&.danger{
+					background-color: #FA5B41;	
+					color: #fff;						
+				}
+				&.submit{
+					background-color: #3384FF;	
+					color: #fff;
+				}
+			}
+			.more{
+				position: relative;
+				padding: 15rpx 20rpx;
+				.text:hover{
+					&+.list>.hand-item-box{
+						display: block;
+					}
+				}
+				.list{
+					position: absolute;
+					bottom: 100rpx;
+					right: 0;
+					box-shadow: 0px 2px 12px 0px #0000001F;
+					padding:0 20rpx;
+					background-color: #fff;
+					.hand-item-box{
+						position: relative;
+						display: none;
+						&.show{
+							display: block;
+						}
+						&::after{
+							width: 0;
+							height: 0;
+							content: "";
+							display: block;
+							border-width: 26rpx 26rpx 0 0;
+							border-color: #fff transparent;
+							border-style: solid;
+							position: absolute;
+							bottom: -20rpx;
+							right: -20rpx;
+						}
+						.handle-item{
+							width: 180rpx;
+							height: 50rpx;
+							font-size: 26rpx;
+							line-height: 50rpx;
+							background-color: #fff;
+							text-align: center;
+							border-bottom: 1px solid #ccc;
+							padding:10rpx 0;
+							&:last-child{
+								border: 0;
+							}
+						}						
+					}
+
 				}
 			}
 		}

+ 97 - 13
pages/index/handle/task/task.vue

@@ -32,12 +32,20 @@
 						</view>				
 					</view>					
 				</view>
-				<view class="handle-container" v-if="handleVisiable">	
+				<view class="handle-container" v-if="handleVisiable">
 					<view class="handle" @click="handleSubmit(1)">全部通过</view>
 					<view class="handle" @click="handleSubmit(2)">全不通过</view>	
-					<view class="handle" @click="handleSubmit(3)">提交</view>
-					<view class="handle" @click="handleSubmit(4)">撤销</view>
-					<view class="handle" @click="handleSubmit(5)">转交</view>
+					<view class="handle submit" @click="handleSubmit(3)">提交</view>
+					<view class="handle danger" @click="handleSubmit('danger')">登记隐患</view>
+					<view class="more" @mouseenter="hover(1)" @mouseleave="hover">
+						<text class="text">更多</text>
+						<view class="list" v-if="showMore">
+							<view class="hand-item-box">
+								<view class="handle-item" @click="handleSubmit(4)">撤销</view>
+								<view class="handle-item" @click="handleSubmit(5)">转交</view>																	
+							</view>						
+						</view>						
+					</view>
 				</view>
 			</template>
 			<template v-else>没有可处理的清单^-_-^</template>
@@ -69,7 +77,8 @@
 				handleVisiable:false,
 				type:undefined,
 				status:undefined,
-				taskTitle:""
+				taskTitle:"",
+				showMore:false
 			}
 		},
 		onLoad({rid,cid,title}) {
@@ -83,6 +92,7 @@
 		methods: {
 			getchecklistRecord(checklistId,recordId){
 				getchecklistRecord(checklistId,recordId).then((res)=>{
+					if(!res.data.itemList)return
 					this.itemList=res.data.itemList
 					this.status=res.data.status
 					this.handleVisiable=(res.data.status===0||res.data.status===1)&&(res.data.accountId===this.accountInfo.userId)
@@ -138,6 +148,24 @@
 						url:`/pages/index/handle/task/checkList/form/transferCheckTask?tid=${recordId}&title=${taskTitle}`
 					})
 				}
+				if(type==="danger"){
+					let href="http://h5.xazhyc.com/danger/views/create.html";
+					let name= '登记隐患'
+					completeCheckTask(recordId).then(()=>{
+						uni.redirectTo({
+							url:`/pages/webview/webview?href=${href}&name=${name}`
+						})
+					}).catch(()=>{
+						uni.showToast({
+							icon:"none",
+							title:"操作失败"
+						})
+					})
+
+				}
+			},
+			hover(state){
+				this.showMore=state===1
 			}
 		}
 	}
@@ -225,18 +253,74 @@
 			justify-content: center;
 			align-items: center;
 			border-top: 1rpx solid #eaeaea;
+			padding: 15rpx 0;
 			.handle{
-				display:block;
-				background-color: #3384FF;
-				color: #fff;
-				padding: 15rpx 0;
-				width: 20%;
+				display:inline-block;
+				color: #222;
+				padding: 15rpx 20rpx;
 				box-sizing: border-box;
-				border-right: 1rpx solid #eaeaea;
+				border: 1rpx solid #eaeaea;
 				font-size: 26rpx;
 				text-align: center;
-				&:last-child{
-					border: 0;
+				border-radius: 50rpx;
+				margin: 0 10rpx;
+				&.danger{
+					background-color: #FA5B41;	
+					color: #fff;						
+				}
+				&.submit{
+					background-color: #3384FF;	
+					color: #fff;
+				}
+			}
+			.more{
+				position: relative;
+				padding: 15rpx 20rpx;
+				.text:hover{
+					&+.list>.hand-item-box{
+						display: block;
+					}
+				}
+				.list{
+					position: absolute;
+					bottom: 100rpx;
+					right: 0;
+					box-shadow: 0px 2px 12px 0px #0000001F;
+					padding:0 20rpx;
+					background-color: #fff;
+					.hand-item-box{
+						position: relative;
+						display: none;
+						&.show{
+							display: block;
+						}
+						&::after{
+							width: 0;
+							height: 0;
+							content: "";
+							display: block;
+							border-width: 26rpx 26rpx 0 0;
+							border-color: #fff transparent;
+							border-style: solid;
+							position: absolute;
+							bottom: -20rpx;
+							right: -20rpx;
+						}
+						.handle-item{
+							width: 180rpx;
+							height: 50rpx;
+							font-size: 26rpx;
+							line-height: 50rpx;
+							background-color: #fff;
+							text-align: center;
+							border-bottom: 1px solid #ccc;
+							padding:10rpx 0;
+							&:last-child{
+								border: 0;
+							}
+						}						
+					}
+
 				}
 			}
 		}

File diff suppressed because it is too large
+ 0 - 1
unpackage/cache/wgt/__UNI__73F6024/app-config-service.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/cache/wgt/__UNI__73F6024/app-service.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/cache/wgt/__UNI__73F6024/app-view.js


File diff suppressed because it is too large
+ 0 - 1
unpackage/dist/build/app-plus/app-config-service.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/app-plus/app-service.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/app-plus/app-view.js


BIN
unpackage/release/apk/__UNI__73F6024__20240124142550.apk


BIN
unpackage/release/apk/__UNI__73F6024__20240123130745.apk → unpackage/release/apk/__UNI__73F6024__20240124151329.apk


Some files were not shown because too many files changed in this diff