details.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <u-navbar :titleStyle="{ color: '#000' }" :autoBack="true" :title="dataList[0]?.createBy + '的日报'" :placeholder="true" :safeAreaInsetTop="true" bgColor="#fff">
  3. <template #left>
  4. <view class="u-navbar__content__left__item">
  5. <u-icon name="arrow-left" size="20" color="#000"></u-icon>
  6. </view>
  7. </template>
  8. </u-navbar>
  9. <oa-scroll
  10. customClass="record-details-container scroll-height"
  11. :style="{
  12. //#ifdef APP-PLUS || MP-WEIXIN
  13. height: 'calc(100vh - 88px)',
  14. //#endif
  15. //#ifdef H5
  16. height: 'calc(100vh - 44px)',
  17. //#endif
  18. }"
  19. :refresherLoad="false"
  20. :refresherEnabled="false"
  21. :refresherEnabledTitle="false"
  22. :refresherDefaultStyle="'none'"
  23. :refresherThreshold="44"
  24. :refresherBackground="'#f5f6f7'"
  25. :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
  26. >
  27. <template #default>
  28. <view class="content-area radius bg-white" v-for="(item,index) in dataList" :key="index">
  29. <view class="content-area-header flex mb10">
  30. <img :src="item.avatar" class="content-area-header-avatarImg mr10" v-if="item.avatar"/>
  31. <u-avatar
  32. v-if="!item.avatar"
  33. class="content-area-header-avatar mr10"
  34. :text="item.createBy.length > 2 ? item.createBy.slice(1, 3) : item.createBy"
  35. shape="square"
  36. size="40"
  37. fontSize="12"
  38. color="#ffffff"
  39. :bgColor="proxy.$settingStore.themeColor.color"
  40. ></u-avatar>
  41. <view>
  42. <view class="content-area-header-title font16 mb5">{{ item.createBy ? item.createBy : " " }}</view>
  43. <view class="content-area-header-time font14">{{ item.submitDate ? item.submitDate.replace("T", " ") : " " }}</view>
  44. </view>
  45. </view>
  46. <view class="content-area-center mb10" v-for="child in item.workContents" :key="child">
  47. <view class="content-area-center-top flex">
  48. <view class="content-area-center-top-title mr10" style="color: #559AFF;" @click="toProjectMange(child.projectId)">{{ child.projectName ? child.projectName : " " }}</view>
  49. <view class="content-area-center-top-time" :style="{ color: proxy.$settingStore.themeColor.color }">{{ child.workTime }}h</view>
  50. </view>
  51. <u-text :text="child.workContent" color="#000000" size="14"></u-text>
  52. </view>
  53. <view class="content-area-center mb10">
  54. <view class="content-area-center-top"> 明日计划 </view>
  55. <u-text :text="item.tomorrowPlan" color="#000000" size="14"></u-text>
  56. </view>
  57. <view class="content-area-center mb10">
  58. <view class="content-area-center-top"> 工作协调 </view>
  59. <u-text :text="item.coordinateWork" color="#000000" size="14"></u-text>
  60. </view>
  61. <view class="content-area-center mb10">
  62. <view class="content-area-center-top">抄送人 </view>
  63. <u-text :text='item.ccTo ? proxy.$common.mapping("nickName", "userId", item.ccTo, userData) : "无"' color="#000000" size="14"></u-text>
  64. </view>
  65. </view>
  66. </template>
  67. </oa-scroll>
  68. </template>
  69. <script setup>
  70. /*----------------------------------依赖引入-----------------------------------*/
  71. import { onLoad, onShow, onReady, onHide, onLaunch, onBackPress, onUnload, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
  72. import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
  73. /*----------------------------------接口引入-----------------------------------*/
  74. import { projectApi } from "@/api/business/project.js";
  75. import { dUserList } from "@/api/system/user.js";
  76. /*----------------------------------组件引入-----------------------------------*/
  77. /*----------------------------------store引入-----------------------------------*/
  78. /*----------------------------------公共方法引入-----------------------------------*/
  79. /*----------------------------------公共变量-----------------------------------*/
  80. const { proxy } = getCurrentInstance();
  81. /*----------------------------------变量声明-----------------------------------*/
  82. const state = reactive({
  83. loading: true,
  84. dataList: [],//日报列表
  85. options: {//日报详情参数
  86. reportId: "",
  87. },
  88. userData:[],//用户列表
  89. });
  90. const { dataList, userData} = toRefs(state);
  91. /**
  92. * @初始化
  93. */
  94. function init() {
  95. dataList.value = [];
  96. state.loading = true;
  97. dUserList().then(res=>{
  98. userData.value = res.data;
  99. projectApi()
  100. .ReportRecord({
  101. reportId: state.options.reportId,
  102. pageNum: 1,
  103. pageSize: 1,
  104. })
  105. .then((requset) => {
  106. dataList.value = requset.data.records;
  107. state.loading = false;
  108. })
  109. .catch((err) => {
  110. state.loading = false;
  111. });
  112. })
  113. }
  114. /**
  115. * 跳转项目概览
  116. * @param id 项目id
  117. */
  118. function toProjectMange(id) {
  119. proxy.$tab.navigateTo(`/pages/business/common/projectMange/overview/index?id=${id}`);
  120. }
  121. onReady(() => {});
  122. onShow(() => {
  123. //调用系统主题颜色
  124. proxy.$settingStore.systemThemeColor([1]);
  125. });
  126. onLoad((options) => {
  127. state.options.reportId = options?.reportId;
  128. init();
  129. });
  130. onUnload(() => {
  131. projectApi()
  132. .ReportRecordReadFlag({ reportId: state.options.reportId })
  133. .then((requset) => {
  134. uni.$emit("projectMange_record", true); //监听器
  135. })
  136. .catch((err) => {
  137. uni.$emit("projectMange_record", true); //监听器
  138. });
  139. });
  140. </script>
  141. <style lang="scss" scoped>
  142. .content-area {
  143. margin: 0;
  144. padding: 15px 20px;
  145. overflow: hidden;
  146. &-header {
  147. &-avatar {
  148. margin: auto 0;
  149. }
  150. &-avatarImg {
  151. width:35px;
  152. height:35px;
  153. border-radius: 4px;
  154. }
  155. &-title {
  156. margin: 0 0 15px 0;
  157. font-weight: 600;
  158. color: #000000;
  159. }
  160. }
  161. &-center {
  162. line-height: 25px;
  163. &-top {
  164. color: #000000;
  165. font-weight: 600;
  166. }
  167. }
  168. }
  169. </style>