Parcourir la source

修改重要提醒

“yueshang” il y a 1 an
Parent
commit
aef01ca852

+ 27 - 1
api/remind/index.js

@@ -2,8 +2,34 @@ import request from '@/utils/request'
 //获取已接受的广播列表
 export function getRemindBroadPage(query) {
   return request({
-    url: '/backend/remind-broad/page',
+    url: '/admin-api/backend/remind-broad/page',
     method: 'get',
     params: query
   })
+}
+//详情
+export function getRemindBroadDetail(id) {
+  return request({
+    url: '/admin-api/backend/remind-broad/get?id=' + id,
+    method: 'get'
+  })
+}
+//已阅
+export function setisread(query) {
+  return request({
+    url: '/admin-api/backend/remind-broad/setisread',
+   header: {
+   		'content-type': 'application/x-www-form-urlencoded'
+   	},
+   method: 'post',
+   data: query
+  })
+}
+//上传附件完成
+export function remindBroadFinish(data) {
+  return request({
+    url: '/admin-api/backend/remind-broad/finish',
+    method: 'post',
+    data: data
+  })
 }

+ 2 - 2
pages.json

@@ -249,9 +249,9 @@
 			},{
 				"path": "fire/remind/details/details",
 				"style": {
-					"navigationBarTitleText": "重要提醒详情",
+					"navigationBarTitleText": "重要提醒详情"
 					// "enablePullDownRefresh": false,
-					"navigationStyle": "custom"
+					// "navigationStyle": "custom"
 				}
 			},{
 				"path": "fire/fire_station/index",

+ 4 - 0
pages/work/index.vue

@@ -94,6 +94,7 @@
 				// archive: `${baseUrlImg}/working/gongzuodangan.png`,
 				archive: `${baseUrlImg}/working/archive.png`,
 				fireSpecial: `${baseUrlImg}/working/fireSpecial.png`,
+				remind:`${baseUrlImg}/working/remind.png`,
 				fireWork: `${baseUrlImg}/working/fireWork.png`,
 				fire_inspetItem: `${baseUrlImg}/working/fire_inspetItem.png`,
 				fire_street: `${baseUrlImg}/working/fire_street.png`,
@@ -210,6 +211,9 @@
 				} else if (val == 'fireSpecial') {
 					// return this.archive;
 					return this.fireSpecial
+				}else if (val == 'remind') {
+					// return this.archive;
+					return this.remind
 				}
 			},
 			// 顶部个人信息跳转

+ 95 - 44
pagesA/fire/remind/details/details.vue

@@ -1,26 +1,73 @@
 <template>
 	<view v-if="formData">
-		<navInfo :title="重要指令详情"></navInfo>
+		<navInfo title="重要提醒详情"></navInfo>
 		<view class="bgTopImg">
-			<image slot="right" :src="`${urls}/navBg@2x.png`" class="bgTopImg"></image>
+			<image slot="right" :src="`${urls}/navBg@2x.png`"></image>
 		</view>
 		<view class="container uni-container">
-			<uni-title type="h2" v-if="formData.comType" :title="formData.comTitle" align="center"></uni-title>
-			<uni-title type="h2" v-else :title="formData.title" align="center"></uni-title>
-			<text class="fabu-time">发布时间:{{times}}</text>
+			<uni-title type="h2" v-if="formData.remindInfoRespVO" :title="formData.remindInfoRespVO.remindTitle"
+				align="center"></uni-title>
+			<text class="fabu-time">发布时间:{{formData.pubDate}}</text>
+			<text class="fabu-time">完成时间:{{formData.doneDate}}</text>
 			<u-line></u-line>
 			<view class="main-content">
-				
+
 				<!-- <text>{{formData.comContent}}</text> -->
-				<rich-text v-if="formData.comContent" :nodes="formData.comContent" class="nodes"></rich-text>
-				<rich-text v-else :nodes="formData.content" class="nodes"></rich-text>
-				<view style="color: blue;float:right;font-size: 16px;" v-if="formData.attId">
+				<view class="titles">
+					提醒内容描述:
+				</view>
+				<rich-text v-if="formData.remindInfoRespVO" :nodes="formData.remindInfoRespVO.remindContent"
+					class="nodes"></rich-text>
+				<rich-text v-else :nodes="'暂无内容'" class="nodes"></rich-text>
+				<view class="titles"style="color: #000;">
+					完成情况描述:
+				</view>
+				<rich-text v-if="formData.donetext" :nodes="formData.donetext"
+					class="nodes"></rich-text>
+				<rich-text v-else :nodes="'暂无内容'" class="nodes"></rich-text>
+
+				<view style="color: blue;font-size: 16px;">
 					<!-- #ifdef MP-WEIXIN -->
-					<text style="color:#00a3f4;cursor: pointer;"
-						@click.native="down(formData.attId)">点击预览附件</text>
+					<!-- 任务接收的文件 -->
+					<view class="titles"  v-if="formData.sendFileUrls"style="color: #000;">
+						提醒内容附件:
+					</view>
+					<view v-if="formData.sendFileUrls">
+						<view class="" v-for="(item,index) in formData.sendFileUrls" :key="index">
+							<text style="color:#00a3f4;cursor: pointer;"
+								@click.native="down(item)">点击预览附件{{index+1}}</text>
+						</view>
+					</view>
+					<view class="titles" v-if="formData.doneFileUrls" style="color: #000;">
+						完成情况附件:
+					</view>
+					<!-- 完成文件 -->
+					<view v-if="formData.doneFileUrls">
+						<view class="" v-for="(item,index) in formData.doneFileUrls" :key="index">
+							<text style="color:#00a3f4;cursor: pointer;"
+								@click.native="down(item)">点击预览附件{{index+1}}</text>
+						</view>
+					</view>
 					<!-- #endif -->
 					<!-- #ifdef H5 -->
-					<a style="color:#00a3f4;cursor: pointer;" @click="down(formData.attId)">点击预览文件</a>
+					<!-- 任务接收的文件 -->
+					<view class="titles"  v-if="formData.sendFileUrls" style="color: #000;">
+						提醒内容附件:
+					</view>
+					<view v-if="formData.sendFileUrls">
+						<view class="" v-for="(item,index) in formData.sendFileUrls" :key="index">
+							<a style="color:#00a3f4;cursor: pointer;" @click="down(item)">点击预览文件{{index+1}}</a>
+						</view>
+					</view>
+					<view class="titles" v-if="formData.doneFileUrls" style="color: #000;">
+						完成情况附件:
+					</view>
+					<!-- 完成文件 -->
+					<view v-if="formData.doneFileUrls">
+						<view class="" v-for="(item,index) in formData.doneFileUrls" :key="index">
+							<a style="color:#00a3f4;cursor: pointer;" @click="down(item)">点击预览文件{{index+1}}</a>
+						</view>
+					</view>
 					<!-- #endif -->
 				</view>
 				<!-- <text class="uni-body flex justify-center padding-tb-sm"> 发布时间:{{formData.time}}</text> -->
@@ -33,21 +80,21 @@
 				<!-- <a class="uni-body flex justify-center padding-tb-sm" style='color: #007AFF;'> 附件1:历史遗留消防设施操作员名册.pdf</a> -->
 			</view>
 		</view>
-		
+
 	</view>
 </template>
 <script>
 	let that = null
 	import {
-		getNoticeDetail, // 通知公告列详情
-	} from "@/api/notice";
+		getRemindBroadDetail
+	} from "@/api/remind";
 	import config from '@/config'
 	import {
 		downSee
 	} from '@/utils/common.js'
 	const baseUrlImg = config.baseUrlImg
 	import navInfo from '@/pagesA/components/my-nav/nav'
-	
+
 	export default {
 		components: {
 			navInfo
@@ -67,26 +114,27 @@
 				loading: false,
 				true: true,
 				times: '',
-				current: ''
+				broadId: null
 			}
 		},
 		//目的页面接收
 		//这里用onshow()也可以
 		onLoad: function(option) {
 			that = this;
-			if (option.current) {
-				this.current = option.current
+			this.broadId = option.id
 
-			}
-			this.$nextTick(() => {
-
-				const eventChannel = this.getOpenerEventChannel();
-				// 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
-				eventChannel.on('acceptDataFromOpenerPage', function(val) {
-					that.formData = val
-					that.times = val.createTime?uni.$u.timeFormat(parseInt(val.createTime.toString().slice(0,-3))):'';
-				})
-			})
+			// this.$nextTick(() => {
+
+			// 	const eventChannel = this.getOpenerEventChannel();
+			// 	// 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
+			// 	eventChannel.on('acceptDataFromOpenerPage', function(val) {
+			// 		that.formData = val
+			// 		that.times = val.createTime?uni.$u.timeFormat(parseInt(val.createTime.toString().slice(0,-3))):'';
+			// 	})
+			// })
+		},
+		onShow() {
+			this.getDatas(this.broadId)
 		},
 		methods: {
 			// 下载附件
@@ -94,17 +142,14 @@
 				downSee(appendix)
 			},
 			// 获取数据
-			// getData(id) {
-			// 	console.log('id', id);
-			// 	this.loading = true
-			// 	getNoticeDetail({
-			// 		id: id
-			// 	}).then(response => {
-			// 		console.log(response);
-			// 		// 为数据赋值:通过展开运算符的形式,进行新旧数据的拼接 
-			// 		this.formData = response.data
-			// 	});
-			// },
+			getDatas(id) {
+				this.loading = true
+				getRemindBroadDetail(this.broadId).then(response => {
+					console.log(response);
+					// 为数据赋值:通过展开运算符的形式,进行新旧数据的拼接 
+					this.formData = response.data
+				});
+			},
 		}
 	}
 </script>
@@ -129,12 +174,12 @@
 		border-radius: 30px 30px 0px 0px;
 		background: #fff;
 		/*#ifdef H5*/
-		margin-top: 100rpx;
+		margin-top: 50rpx;
 		/* #endif */
 		/* #ifdef  MP-WEIXIN*/
-		margin-top: 100rpx;
+		margin-top: 50rpx;
 		/* #endif */
-		z-index: 999999;
+		z-index: 99;
 		position: relative;
 		min-height: 400rpx;
 		;
@@ -159,4 +204,10 @@
 		justify-content: center;
 		margin-bottom: 20rpx;
 	}
-</style>
+	//列表样式
+	.titles {
+		font-weight: 600;
+		margin: 20rpx 0;
+		font-size: 14px;
+	}
+</style>

+ 111 - 36
pagesA/fire/remind/index.vue

@@ -10,17 +10,17 @@
 			</uni-row>
 		</view>
 		<view class="" v-if="tableData.length>0 && isLoaded">
-			<uni-card v-for="(item, index) in tableData" :key="index" @click.native="onNoticeClick(item)">
-				<view class="titles">{{item.title}}</view>
+			<uni-card v-for="(item, index) in tableData" :key="index">
+				<view class="titles">{{item.remind_title}}</view>
 				<view style="float: left;">重要提醒内容:</view>
 				<!-- <text class="conts">{{item.taskContent}}</text> -->
-				<rich-text :nodes="item.content?item.content:''" class="font-12"></rich-text>
-				<view style="float: left;">发布日期:{{item}}</view>
+				<rich-text :nodes="item.remind_content?item.remind_content:''" class="font-12"></rich-text>
+				<view style="float: left;">发布日期:{{item.pubDate}}</view>
 				<view class="an-niu">
-					<view class="an-niu-street" @click.native="uploadButton" link>
-						<text class="bianji">上传</text>
+					<view class="an-niu-street" @click.native="uploadButton(item)" link>
+						<text class="bianji" v-if="item.is_done==0">上传</text>
 					</view>
-					<text @click="isRead" class="detail isread">已阅</text>
+					<text @click="isRead(item)" class="detail isread " v-if="item.is_read==0&&item.is_done==0">已阅</text>
 					<text @click.native="onNoticeClick(item)" class="detail">查看详情</text>
 				</view>
 			</uni-card>
@@ -61,25 +61,27 @@
 			</u-list-item>
 		</u-list> -->
 		<tarBar :totarBer='tar'></tarBar>
-		<u-popup :show="showDel" title="完成提醒" mode="center">
-			<view style="width: 400rpx;height: 200rpx;margin: 20rpx 20rpx;">
-				<view>完成描述</view>
-				<u--textarea v-model="eventContent" placeholder="请输入内容" :disabled="isview" :maxlength="1000" count
+		<u-popup :show="showComplete" title="完成提醒" mode="center">
+			<view style="width:550rpx;height: 900rpx;margin: 20rpx 20rpx;position: relative;overflow-y: auto;">
+				<view class="titles-popup">完成描述:</view>
+				<u--textarea v-model="formData.donetext" placeholder="请输入内容" :maxlength="500" count
 					height="150">
-					<view class="">
-						附件上传
-					</view>
-					<uni-file-picker v-model="formData.attId" del-icon limit="5" auto-upload file-mediatype="all"
-						@select="selectFile" @delete="deleteFile">
-						<button type="primary" class="selectBtn">选择文件</button>
-						<!-- 加载中 -->
-						<isLodingModel v-if="loading"></isLodingModel>
-					</uni-file-picker>
 				</u--textarea>
-				<view style="display: flex;justify-content: space-around;align-items: center;margin-top: 40rpx;">
-					<button class="antherBtn" @click="makeSureDel" style="background-color: red;">确认</button>
-					<button class="antherBtn" @click="showDel = false">取消</button>
+				<view class="titles-popup">
+					附件上传:
 				</view>
+				<uni-file-picker v-model="formData.fileUrls" del-icon limit="5" file-mediatype="all"
+					@select="selectFile" @delete="deleteFile">
+					<button type="primary" class="selectBtn">选择文件</button>
+					<!-- 加载中 -->
+					<isLodingModel v-if="loading"></isLodingModel>
+				</uni-file-picker>
+			    <view style="position:absolute;bottom:20px;width: 100%;">
+			    	<view style="display: flex;justify-content: space-around;align-items: center;width: 100%;">
+			    		<button class="antherBtn" @click="makeSure" style="background-color: #4cb2b6;color: #fff;">确认</button>
+			    		<button class="antherBtn" @click="showComplete = false">取消</button>
+			    	</view>
+			    </view>
 			</view>
 		</u-popup>
 		<!-- 加载中 -->
@@ -89,13 +91,18 @@
 <script>
 	import tarBar from '@/components/tabBar/index' //先把tabBar.vue组件导入
 	import {
-		getRemindBroadPage, // 通知公告列表 
+		getRemindBroadPage,// 重要通知列表 
+		setisread,//是否已阅
+		remindBroadFinish
 	} from "@/api/remind";
 	import {
-		uploadFile
+		uploadFileComp
 	} from '@/utils/common.js';
+	import {
+		parseTime // 时间戳转换
+	} from '@/utils/ruoyi';
+		import config from '@/config'
 	let that = null;
-	import config from '@/config'
 	const baseUrlImg = config.baseUrlImg
 	export default {
 		components: {
@@ -123,11 +130,16 @@
 				ids: '0',
 				title: '1',
 				tan90: `${baseUrlImg}/tan90.png`,
-				eventContent: '', //上传描述内容
-				fileUrls: [], //上传附件
 				formData: {
-					attId: []
+					fileUrls: [],
+					donetext: '', //上传描述内容
+					doneDate:'',//完成时间
+					attId:[],
+					broadId:null,
+					broadType:null
+					
 				},
+				showComplete:false
 			}
 		},
 		// 在 vue页面,向起始页通过事件传递数据
@@ -157,44 +169,91 @@
 			// 获取数据
 			getData(pageNo, value = '') {
 				this.loading = true
+				this.tableData = [];
 				this.pageNo = pageNo
-				const deptId = uni.getStorageSync('getUserInfo_key')?.streetInfo?.id;
+				const deptId =  uni.getStorageSync('getUserInfo_key')?.streetInfo?uni.getStorageSync('getUserInfo_key').streetInfo.id:uni.getStorageSync('getUserInfo_key').userInfo.deptId;
 				const userId = uni.getStorageSync('getUserInfo_key')?.userInfo?.id;
 				getRemindBroadPage({
 					pageNo: this.pageNo,
 					pageSize: 10,
 					reciver: deptId,
-					userId: userId
+					userId: userId,
+					remindTitle:this.keyword
 				}).then(response => {
 					this.isLoaded = true
+					response.data.records.forEach(item=>{
+						item.pubDate = parseTime(item.pub_date,"{y}-{m}-{d}")
+					})
 					// 为数据赋值:通过展开运算符的形式,进行新旧数据的拼接
-					this.tableData = [...this.tableData, ...response.data.list]
+					this.tableData = [...this.tableData, ...response.data.records]
 					// this.tableData = response.data.list;
 					this.total = response.data.total;
 					this.loading = false;
 				});
 			},
+			isRead(item){
+				const arr = [];
+				arr[0]=item.broad_id
+				setisread({broadIds:arr}).then(res=>{
+					this.getData(1);
+				})
+			},
+				
+			uploadButton(item){
+				this.showComplete=true;
+				this.formData.attId = [];
+				this.formData.broadId = item.broad_id;
+				this.formData.broadType = item.broad_type
+				this.formData.fileUrls=[];
+				this.formData.donetext = ''
+			},
 			// 移出图片函数
 			async deleteFile(e) {
-				this.formData.attId = [];
+				this.formData.attId.forEach((item,index)=>{
+					console.log(e.tempFilePath,'-------------');
+					if(item.id==e.tempFilePath){
+						this.formData.attId.splice(index, 1);
+
+					}
+				})
+				// this.formData.fileUrls = [];
 			},
 			selectFile(e) {
+				console.log(e.tempFilePaths,'e.tempFilePaths');
 				let promises = [];
 				for (let i = 0; i < e.tempFilePaths.length; i++) {
-					const promise = uploadFile(e.tempFilePaths, i, this);
-					promises.push(promise);
+					const promise2 = uploadFileComp(e.tempFilePaths, i, this,this.formData.attId.length);
+					this.$forceUpdate()
+					promises.push(promise2);
 				}
 				Promise.all(promises).then(result => {
+									console.log(result,'result====');
 					// 处理上传文件成功的结果
 				}).catch(error => {
 					// 处理上传文件失败的错误
 				});
 			},
+			//上传文件点击确认	
+			makeSure(){
+				this.formData.doneDate = parseTime(new Date(),"{y}-{m}-{d}");
+				 this.formData.attId.forEach(item=>{
+					 this.formData.fileUrls.push(item.path)
+				 })
+				console.log('sdfsf',this.formData);
+				remindBroadFinish(this.formData).then(res=>{
+					this.$modal.msgSuccess('上传成功');
+					this.showComplete=false;
+				}).catch(err=>{
+						this.$modal.msgSuccess('上传失败');
+						this.showComplete=false;
+				})
+				this.getData()
+			},
 			// 单个公告详情点击事件
 			onNoticeClick(val) {
 				this.isLoaded = false
 				uni.navigateTo({
-					url: `/pagesA/fire/remind/details/details?id=${val.id}`,
+					url: `/pagesA/fire/remind/details/details?id=${val.broad_id}`,
 					success: function(res) {
 						// 通过eventChannel向被打开页面传送数据
 						res.eventChannel.emit('acceptDataFromOpenerPage', val)
@@ -277,4 +336,20 @@
 		-webkit-line-clamp: 1;
 		overflow: hidden;
 	}
+	.selectBtn {
+		width: 200rpx;
+		margin-left: 0;
+		font-size: 30rpx;
+		background-color: #4cb2b6;
+	}
+		
+	.titles-popup{
+		margin: 10px 10px;
+		font-weight: 600;
+		font-size: 14px;
+	}
+	::v-deep .uni-file-picker__lists{
+		height: 200rpx;
+		overflow-y: auto;
+	}
 </style>

BIN
static/appimg/working/remind.png


+ 35 - 0
utils/common.js

@@ -333,6 +333,41 @@ export function uploadFile(tempFilePaths, i, that) {
 		});
 	});
 }
+//重要提醒上传
+export function uploadFileComp(tempFilePaths, i, that,lengths) {
+	return new Promise((resolve, reject) => {
+		const loading = uni.showLoading({
+			title: '文件上传中...',
+			mask: true
+		});
+		uni.uploadFile({
+			url: baseUrl + '/admin-api/infra/file/upload', // 后端用于处理图片并返回图片地址及文件的接口
+			filePath: tempFilePaths[i],
+			name: 'file',
+			header: {
+				Authorization: 'Bearer ' + getAccessToken() // 请求token
+			},
+			success: res => {
+				let data = JSON.parse(res.data);
+				that.formData.attId.push({id:tempFilePaths[i],path:data.data})
+				uni.showToast({
+					title: '文件上传成功!'
+				});
+				that.loading = false
+			},
+			fail: err => {
+				uni.showToast({
+					icon: 'error',
+					title: '文件上传失败!'
+				});
+				that.loading = false
+			},
+			complete: () => {
+				uni.hideLoading(loading);
+			}
+		});
+	});
+}
 // 图片放大
 export function viewImgBig(i, imgList) {
 	uni.previewImage({