|
@@ -32,6 +32,10 @@
|
|
|
>
|
|
|
<template #default>
|
|
|
<view class="content-area radius bg-white" v-for="(item, index) in dataList" :key="index" style="margin-top: 6px">
|
|
|
+ <view class="content-area-top menu-item" style="float: right; padding: 10px 0px">
|
|
|
+ <view class="content-area-top-time"> </view>
|
|
|
+ <u-icon class="content-area-top-icon" name="more-dot-fill" size="20" color="#000" @click="moreClick(item)"></u-icon>
|
|
|
+ </view>
|
|
|
<view class="content-area-header flex mb10">
|
|
|
<img :src="item?.avatar" class="content-area-header-avatarImg mr10" v-if="item?.avatar" />
|
|
|
<u-avatar
|
|
@@ -68,7 +72,7 @@
|
|
|
<view class="content-area-center mb10">
|
|
|
<view class="content-area-center-top">图片</view>
|
|
|
<view class="imageBox" v-if="JSON.parse(item.reportImage) && JSON.parse(item.reportImage).length > 0">
|
|
|
- <image class="image m5" style="width: 50px" mode="widthFix" v-for="(a, index) in JSON.parse(item.reportImage)" :key="index" :src="a.url" @click="previewImage(index)" />
|
|
|
+ <image class="image m5" style="width: 50px" mode="widthFix" v-for="(a, index2) in JSON.parse(item.reportImage)" :key="index2" :src="a.url" @click="previewImage(index,index)" />
|
|
|
</view>
|
|
|
<view class="imageBox" v-else>无</view>
|
|
|
</view>
|
|
@@ -76,39 +80,77 @@
|
|
|
<view class="content-area-center mb10">
|
|
|
<view class="content-area-center-top">附件 </view>
|
|
|
<view v-if="JSON.parse(item.reportFile) && JSON.parse(item.reportFile).length > 0">
|
|
|
- <uni-link v-for="(file, index) in JSON.parse(item.reportFile)" :key="index" :href="file.url" text="file.url" style="color: rgba(0, 0, 0, 0.7)">{{ file.name }}</uni-link>
|
|
|
+ <uni-link v-for="(file, index2) in JSON.parse(item.reportFile)" :key="index2" :href="file.url" text="file.url" style="color: rgba(0, 0, 0, 0.7)">{{ file.name }}</uni-link>
|
|
|
</view>
|
|
|
<view v-else>无</view>
|
|
|
</view>
|
|
|
- <view class="content-area-center mb10" style="display: flex; flex-wrap: wrap">
|
|
|
+ <view class="content-area-center mb10" style="display: flex; flex-wrap: wrap" v-if="item.pmReportReaders.read > 0 || item.pmReportReaders.unRead > 0">
|
|
|
<u-tabs
|
|
|
- :list="tabsList"
|
|
|
- :current="tabsCurrent"
|
|
|
- @click="tabsClick"
|
|
|
+ :list="item.tabsList"
|
|
|
+ :current="item.tab"
|
|
|
+ @click="tabsClick(index, $event.value)"
|
|
|
lineColor="#333"
|
|
|
:activeStyle="{ color: '#333', fontSize: '14px' }"
|
|
|
:inactiveStyle="{ color: '#909399', fontSize: '14px' }"
|
|
|
:scrollable="false"
|
|
|
style="width: 100%"
|
|
|
></u-tabs>
|
|
|
- <view class="content-area-header mt20 mb10 text-center" style="display: inline-block" v-for="(item, index) in reportDetailData.treeSelectNodes" :key="index">
|
|
|
- <img v-if="item?.avatar" class="content-area-header-avatarImg mlr5" :src="item.avatar" style="display: block; width: 40px; height: 40px" />
|
|
|
+ <view class="content-area-header mt20 mb10 text-center" style="display: inline-block" v-for="(item2, index2) in item.tabsList[item.tab].treeSelectNodes" :key="index2">
|
|
|
+ <img v-if="item2?.avatar" class="content-area-header-avatarImg mlr5" :src="item2.avatar" style="display: block; width: 40px; height: 40px" />
|
|
|
<u-avatar
|
|
|
- v-if="!item.avatar"
|
|
|
+ v-if="!item2.avatar"
|
|
|
class="content-area-header-avatar mlr5"
|
|
|
- :text="item.nickName.length > 2 ? item.nickName.slice(1, 3) : item.nickName"
|
|
|
+ :text="item2.nickName.length > 2 ? item2.nickName.slice(1, 3) : item2.nickName"
|
|
|
shape="square"
|
|
|
size="40"
|
|
|
fontSize="12"
|
|
|
color="#ffffff"
|
|
|
:bgColor="proxy.$settingStore.themeColor.color"
|
|
|
></u-avatar>
|
|
|
- <u-text :text="item.nickName" color="#000000" size="14" align="center"></u-text>
|
|
|
+ <u-text :text="item2.nickName" color="#000000" size="14" align="center"></u-text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
+
|
|
|
</oa-scroll>
|
|
|
+ <u-popup :show="popup.show" mode="bottom" bgColor="#fff" :round="10" @close="popup.show = false">
|
|
|
+ <view
|
|
|
+ :style="{
|
|
|
+ borderTopLeftRadius: '10px',
|
|
|
+ borderTopRightRadius: '10px',
|
|
|
+ overflow: 'hidden',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <u-button
|
|
|
+ class="custom-style"
|
|
|
+ type="info"
|
|
|
+ size="normal"
|
|
|
+ :text="`查看${eventList.createBy}的所有日报`"
|
|
|
+ :customStyle="{
|
|
|
+ height: '50px',
|
|
|
+ color: '#3c9cff',
|
|
|
+ borderWidth: 0,
|
|
|
+ borderRadius: 0,
|
|
|
+ borderBottomWidth: '1px',
|
|
|
+ }"
|
|
|
+ @click="handleSubmit(eventList)"
|
|
|
+ ></u-button>
|
|
|
+ <u-button
|
|
|
+ class="custom-style"
|
|
|
+ type="info"
|
|
|
+ size="normal"
|
|
|
+ text="取消"
|
|
|
+ :customStyle="{
|
|
|
+ height: '50px',
|
|
|
+ color: '#3c9cff',
|
|
|
+ border: 'none',
|
|
|
+ borderRadius: 0,
|
|
|
+ }"
|
|
|
+ @click="popup.show = false"
|
|
|
+ ></u-button>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
@@ -140,19 +182,17 @@ const state = reactive({
|
|
|
reportId: "",
|
|
|
},
|
|
|
userData: [], //用户列表
|
|
|
- images: [], //图片列表
|
|
|
- files: [], //附件列表
|
|
|
- tabsList: [
|
|
|
- { name: "已读", value: 0 },
|
|
|
- { name: "未读", value: 1 },
|
|
|
- ],
|
|
|
- tabsCurrent: 0,
|
|
|
pageSize:1,
|
|
|
total:10,
|
|
|
submitDate:undefined,
|
|
|
+ popup: {
|
|
|
+ show: false, //弹窗显示
|
|
|
+ content: "", //提示信息
|
|
|
+ },
|
|
|
+ eventList: {}, //数据存储
|
|
|
});
|
|
|
|
|
|
-const { dataList, userData, tabsList, tabsCurrent, pageSize, total } = toRefs(state);
|
|
|
+const { dataList, userData, tabsList, tabsCurrent, pageSize, total, popup, eventList } = toRefs(state);
|
|
|
/**
|
|
|
* 返回上级页面
|
|
|
* @param defaultPage 默认页面
|
|
@@ -169,14 +209,13 @@ const { dataList, userData, tabsList, tabsCurrent, pageSize, total } = toRefs(st
|
|
|
/**
|
|
|
* @tabs点击事件
|
|
|
*/
|
|
|
-function tabsClick(e) {
|
|
|
- state.tabsCurrent = e.index;
|
|
|
- reportDetailData.value.treeSelectNodes = proxy.$common.findTreeNodes(tree.value, state.tabsCurrent == 0 ? pmReportReaders.value.readAlready : pmReportReaders.value.readNotAlready);
|
|
|
+function tabsClick(index,e) {
|
|
|
+ dataList.value[index].tab = e
|
|
|
}
|
|
|
-function previewImage(index) {
|
|
|
+function previewImage(index1,index2) {
|
|
|
uni.previewImage({
|
|
|
- current: index, // 当前显示图片索引
|
|
|
- urls: state.images, // 需要预览的图片http链接列表
|
|
|
+ current: index2, // 当前显示图片索引
|
|
|
+ urls: dataList.value[index1].images[index2], // 需要预览的图片http链接列表
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -196,28 +235,49 @@ function init() {
|
|
|
pageSize: 1,
|
|
|
})
|
|
|
.then((requset) => {
|
|
|
- dataList.value = requset.data.records;
|
|
|
- state.submitDate = requset.data.records[0].submitDate;
|
|
|
+ if(requset?.data?.records.length>0){
|
|
|
+ dataRebuild(requset.data.records);
|
|
|
+ if(requset.data.records[0].readFlag == "0"){
|
|
|
+ projectApi()
|
|
|
+ .ReportRecordReadFlag({ reportId: requset.data.records[0].id })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.status != "SUCCESS") {
|
|
|
+ proxy.$modal.msgError("读取异常");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
state.loading = false;
|
|
|
- pmReportReaders.value = requset.data.records[0].pmReportReaders;
|
|
|
- state.tabsList[0].name = state.tabsList[0].name + "(" + pmReportReaders.value.read + ")";
|
|
|
- state.tabsList[1].name = state.tabsList[1].name + "(" + pmReportReaders.value.unRead + ")";
|
|
|
- reportDetailData.value.treeSelectNodes = proxy.$common.findTreeNodes(tree.value, tabsCurrent.value == 0 ? pmReportReaders.value.readAlready : pmReportReaders.value.readNotAlready);
|
|
|
- var imgs = JSON.parse(dataList.value[0].reportImage);
|
|
|
- var files = JSON.parse(dataList.value[0].reportFile);
|
|
|
- imgs.forEach(function (item) {
|
|
|
- state.images.push(item.url);
|
|
|
- });
|
|
|
- files.forEach(function (item) {
|
|
|
- state.files.push(item.url);
|
|
|
- });
|
|
|
- load()
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
+ }).catch((err) => {
|
|
|
state.loading = false;
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * @param item 数据重组
|
|
|
+*/
|
|
|
+function dataRebuild(item){
|
|
|
+ for(let i=0;i<item.length;i++){
|
|
|
+ item[i].tabsList = [
|
|
|
+ { name: "已读(" + item[i].pmReportReaders.read + ")", value: 0,
|
|
|
+ treeSelectNodes:proxy.$common.findTreeNodes(tree.value, item[i].pmReportReaders.readAlready),num:item[i].pmReportReaders.read},
|
|
|
+ { name: "未读(" + item[i].pmReportReaders.unRead + ")", value: 1,
|
|
|
+ treeSelectNodes:proxy.$common.findTreeNodes(tree.value,item[i].pmReportReaders.readNotAlready),num:item[i].pmReportReaders.read},
|
|
|
+ ];
|
|
|
+ item[i].tab = 0
|
|
|
+ var imgs = JSON.parse(item[i].reportImage);
|
|
|
+ var files = JSON.parse(item[i].reportFile);
|
|
|
+ imgs.forEach(function (val) {
|
|
|
+ item[i].images.push(val.url);
|
|
|
+ });
|
|
|
+ files.forEach(function (val) {
|
|
|
+ item[i].files.push(val.url);
|
|
|
+ });
|
|
|
+ dataList.value.push(item[i])
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
/**
|
|
|
* 跳转项目概览
|
|
|
* @param id 项目id
|
|
@@ -229,7 +289,16 @@ function toProjectMange(id) {
|
|
|
* @scrollView加载数据
|
|
|
*/
|
|
|
function load() {
|
|
|
- console.log(1111)
|
|
|
+ //下拉数据前将未读数据修改为已读
|
|
|
+ if(dataList.value.length > 1 && dataList.value[dataList.value.length -1].readFlag == 0){
|
|
|
+ projectApi()
|
|
|
+ .ReportRecordReadFlag({ reportId: dataList.value[dataList.value.length -1].id })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.status != "SUCCESS") {
|
|
|
+ proxy.$modal.msgError("读取异常");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
projectApi().ReportRecord(
|
|
|
{
|
|
|
upOrDown:0,
|
|
@@ -238,7 +307,9 @@ function toProjectMange(id) {
|
|
|
projectAscription:2
|
|
|
}
|
|
|
).then((requset) => {
|
|
|
- dataList.value.push(requset.data.records[0])
|
|
|
+ if(requset?.data?.records.length>0){
|
|
|
+ dataRebuild(requset.data.records);
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
/**
|
|
@@ -253,11 +324,21 @@ function toProjectMange(id) {
|
|
|
projectAscription:2
|
|
|
}
|
|
|
).then((requset) => {
|
|
|
- if(requset.data.records.length>0){
|
|
|
- dataList.value.unshift(requset.data.records[0]);
|
|
|
+ if(requset?.data?.records.length>0){
|
|
|
+ dataRebuild(requset.data.records);
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+/** 更多按钮点击事件 */
|
|
|
+function moreClick(event) {
|
|
|
+ state.popup.show = true;
|
|
|
+ state.eventList = event;
|
|
|
+}
|
|
|
+/** 编辑、删除日报*/
|
|
|
+function handleSubmit(e) {
|
|
|
+ state.popup.show = true;
|
|
|
+ proxy.$tab.navigateTo(`/pages/business/common/projectMange/record/detailsAll?submitterId=${e.submitterId}`);
|
|
|
+}
|
|
|
onReady(() => {});
|
|
|
|
|
|
onShow(() => {
|
|
@@ -313,9 +394,4 @@ onUnload(() => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-// .uni-scroll-view-content .content-area:nth-child(3){
|
|
|
-// height:96px;
|
|
|
-// overflow: hidden;
|
|
|
-// background-image: linear-gradient(to top, #f3f2f2 30%, #fff 100%);
|
|
|
-// }
|
|
|
</style>
|