Преглед изворни кода

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

zhaobao пре 1 година
родитељ
комит
c1638c9296

+ 2 - 2
libs/enum.js

@@ -176,8 +176,8 @@ export function alertLevel(i) {
 export function alertStatus(i) {
   if (i >= 0) {
     const strs = [
-      '待处理',
-      '已处理'
+      '活动',
+      '已解除'
     ]
     return strs[i]
   } else {

+ 40 - 31
pages/index/detail/detail.vue

@@ -67,8 +67,8 @@
 				</view>
 				<view class="part" v-if="type==='alert'">
 					<view class="tab">
-						<view class="tab-item" :class="activeTab===1?'active':''" @click="tabChange(0,1)">待处理</view>
-						<view class="tab-item" :class="activeTab===2?'active':''" @click="tabChange(1,2)">已处理</view>
+						<view class="tab-item" :class="activeTab===1?'active':''" @click="tabChange(0,1)">活动</view>
+						<view class="tab-item" :class="activeTab===2?'active':''" @click="tabChange(1,2)">已解除</view>
 						<view class="tab-item" :class="activeTab===3?'active':''" @click="tabChange(-1,3)">已撤销</view>
 					</view>
 					<view class="part-cont">
@@ -81,15 +81,16 @@
 								<text class="tag">{{alertLevel(item.alertLevel)}}</text>
 							</view>
 							<view class="time">
-								发生时间:{{item.warnTime}}
+								发生时间:{{item.alertTime}}
 							</view>
-							<view class="bottom" v-if="item.handleAccountName">
-								<view class="user">
-									<image class="avatar" src="/static/index/user.png" mode="widthFix"></image>
-									处理人:{{item.handleAccountName}}
-								</view>		
+							<view class="bottom" v-if="item.clearTime">		
 								<view class="hand-time">
-									{{item.warnTime}}
+									解除时间:{{item.clearTime}}
+								</view>																
+							</view>
+							<view class="bottom" v-if="item.alertContent">
+								<view class="alertContent">
+									内容:{{item.alertContent}}
 								</view>																
 							</view>
 						</view>
@@ -99,7 +100,7 @@
 					<view class="tab">
 						<view class="tab-item" :class="activeTab===1?'active':''" @click="tabChange(0,1)">待处理</view>
 						<view class="tab-item" :class="activeTab===2?'active':''" @click="tabChange(1,2)">我提交</view>
-						<view class="tab-item" :class="activeTab===3?'active':''" @click="tabChange(1,3)">我处理</view>
+						<view class="tab-item" :class="activeTab===3?'active':''" @click="tabChange(2,3)">我处理</view>
 						<view class="tab-item" :class="activeTab===4?'active':''" @click="tabChange(-1,4)">我撤销</view>
 					</view>
 					<view class="part-cont">
@@ -141,7 +142,8 @@
 	import { getAlertByPage } from '@/api/aqpt/alertApi.js';
 	import { getDangerByPage } from '@/api/aqpt/dangerApi.js';
 	import { getTaskByPage } from '@/api/aqpt/taskApi.js';
-	import { getWarningByPage } from '@/api/aqpt/warning.js';		
+	import { getWarningByPage } from '@/api/aqpt/warning.js';	
+			import { handleCheckTask } from '@/api/aqpt/checkTaskApi'
 	import{
 		taskStatus,taskPriority,taskType,
 		alertLevel,alertStatus,
@@ -170,7 +172,7 @@
 			uni.setNavigationBarTitle({
 				title:`${name||'详情'}`
 			})
-			this.getData()
+			this.tabChange(0,1)
 		},
 		methods: {
 			taskStatus,taskPriority,taskType,
@@ -230,13 +232,13 @@
 					this.conditions.status=value
 				}
 				if(this.type==='danger'){
-					  if (value === 1) {
+					  if (index === 1) {
 						this.conditions.curAccountId = this.user.userId
-					  } else if (value === 2) {
+					  } else if (index === 2) {
 						this.conditions.submitAccountId = this.user.userId
-					  } else if (value === 3) {
+					  } else if (index === 3) {
 						this.conditions.handleAccountId = this.user.userId
-					  } else if (value === 4) {
+					  } else if (index === 4) {
 						this.conditions.submitAccountId = this.user.userId
 						this.conditions.status = -1
 					  }
@@ -246,11 +248,13 @@
 			handle(type,item){			
 				let url=""
 				if(type==='danger'){
+					if(item.curAccountId!==this.user.userId) return;
 					url=`/pages/index/handle/danger/index/index?type=${type}&id=${item.dangerId}`
 				}
 				if(type==='task'){this.handTask(item);return};
 				if(type==='warn'){	
-					if(this.activeTab!==0) return;
+					if(this.conditions.status!==0) return;
+					if(item.curAccountId!==this.user.userId) return;
 					url=`/pages/index/handle/warning/warning?id=${item.warnId}`
 				}				
 				uni.navigateTo({
@@ -258,15 +262,13 @@
 				})				
 			},
 			handTask(item){
-				if(this.activeTab!==0) return;				
+				if(item.curAccountId!==this.user.userId) return;
+				if(this.conditions.status!==0) return;				
 				handleCheckTask(item.taskId).then((res)=>{
 					const { checklistId, checklistTypeId } = res.data //recordId-taskId
-					// if (checklistTypeId === 1) {// HazardRecordView
-											  
-					// } else if (checklistTypeId === 2) {// PointRecordView
-											  
-					// } else if (checklistTypeId === 3) {// ScoreRecordView
-											  
+					// if (checklistTypeId === 1) {// HazardRecordView											  
+					// } else if (checklistTypeId === 2) {// PointRecordView											  
+					// } else if (checklistTypeId === 3) {// ScoreRecordView											  
 					// }
 					uni.navigateTo({
 						url:`/pages/index/handle/task/task?rid=${item.taskId}&cid=${checklistId}`
@@ -274,12 +276,8 @@
 				})
 			
 			},
-			onPullDownRefresh() {				
-				this.activeTab=1,
-			    this.conditions= {page: 1,limit: 10},
-				this.total=0,
-				this.items=[]	
-				this.getData()
+			onPullDownRefresh() {					
+				this.tabChange(this.conditions.status||0,this.activeTab)
 				uni.stopPullDownRefresh()
 			},
 			onReachBottom() {
@@ -381,7 +379,18 @@
 									font-size: 24rpx;
 									color: rgba(0, 0, 0, 1);
 								}
-							}							
+							}
+							.alertContent{
+								font-size: 26rpx;
+								color: #666;
+								line-height: 1.5;
+								text-overflow: ellipsis;
+								overflow: hidden;
+								word-break: break-all;
+								display: -webkit-box;
+								-webkit-box-orient: vertical;
+								-webkit-line-clamp: 2;
+							}
 						}
 					}
 				}

+ 1 - 1
pages/index/handle/danger/index/index.vue

@@ -54,7 +54,7 @@
 				</view>
 			</uni-section>
 		</div>
-		<view class="button-container" @click="onSubmit">
+		<view class="button-container" @click="onSubmit" v-if="flowData.activityInsTitle">
 			<text>{{flowData.activityInsTitle}}</text>
 		</view>
 	</view>

+ 23 - 3
pages/index/handle/warning/warning.vue

@@ -41,6 +41,7 @@
 </template>
 
 <script>
+	import {upload} from '@/api/system/upload.js'		
 	import {getUserList} from '@/api/system/user.js'
 	import { getWarningById, completeWarning, transferWarning } from '@/api/aqpt/warningApi'
 	export default {
@@ -68,6 +69,7 @@
 		},
 		onLoad({id}) {
 			this.warnId=id	
+			this.formData.warnId = id			
 			this.getData()
 		},
 		methods: {
@@ -110,10 +112,18 @@
 				})
 			},	
 			// 提交
-			handleSubmit() {
+			async handleSubmit() {
 				  const action = this.action
 				  if (action === 1) {
-					completeWarning(this.formData).then((resp) => {
+					  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)
+					  }
+					this.formData.attachList=attachList
+					await completeWarning(this.formData).then((resp) => {
 					  const { msg } = resp
 					  uni.showToast({
 						icon:"none",
@@ -145,7 +155,17 @@
 			  this.transferData.accountNameTo = obj.accountName
 			  this.transferData.groupNameTo = obj.groupName
 			  this.transferData.positionNameTo = obj.positionName
-			},					
+			},	
+			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>

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/pages/index/handle/danger/index/index.js.map


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
unpackage/dist/dev/mp-weixin/pages/index/handle/danger/index/index.wxml


Неке датотеке нису приказане због велике количине промена