myOfflineSignup.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <template>
  2. <view class="">
  3. <view class="offline-signup-list" v-if="tableData.length">
  4. <view class="offline-signup-list-item" v-for="(item, index) in tableData" :key="index">
  5. <view class="conference-title">{{ array2Obj(item.meetingId, $i18n.locale=='en'?'meetingNameEn':'meetingName') }}</view>
  6. <view class="signup-info">
  7. <view>
  8. <text class="signup-info-label">{{$i18n.locale=='en'?'ApplyName':'报名人员:'}}</text>
  9. <text class="signup-info-value">{{item.applyWay=='zh'? item.name: item.nameEn}}</text></view>
  10. <view>
  11. <text class="signup-info-label">{{$i18n.locale=='en'?'ApplyDate':'报名时间:'}}</text>
  12. <text class="signup-info-value">{{moment(item.createDate).format('YYYY-MM-DD HH:mm')}}</text>
  13. </view>
  14. <view>
  15. <text class="signup-info-label">{{$i18n.locale=='en'?'MeetingDate':'会议时间:'}}</text>
  16. <text class="signup-info-value">
  17. {{moment(array2Obj(item.meetingId, 'meetingStartDate')).format('YYYY-MM-DD')}} ~ {{moment(array2Obj(item.meetingId, 'meetingEndDate')).format('YYYY-MM-DD')}}
  18. </text>
  19. </view>
  20. <!-- <view><text class="signup-info-label">会议地点:</text><text class="signup-info-value">北京,中国</text></view> -->
  21. <text v-if="item.auditStatusDict != '4'" class="approval-com" v-for="(com,c) in item.comments" :key="c">{{com}}</text>
  22. <view class="operation-btn-group">
  23. <button @click="resubmit(item)" v-if="item.auditStatusDict=='2' && item.comments.length" type="resubmit" hover-class="button-hover" class="operation-btn" plain="true">{{$i18n.locale=='en'?'ReApply':'重新提交'}}</button>
  24. </view>
  25. </view>
  26. <!-- 审批中:2 审批不通过:3 审批通过:4 -->
  27. <view
  28. class="approval-state"
  29. :style="{background: getStateColor(item.auditStatusDict).c, 'box-shadow': '0 4px 4px '+getStateColor(item.auditStatusDict).sc}">
  30. {{ approvalStatus(item.auditStatusDict) }}</view>
  31. </view>
  32. </view>
  33. <view class="nodata-box" v-else>
  34. <image src="@/static/img/public/7.png" mode=""></image>
  35. <text>{{$i18n.locale=='en'? 'No Data': '暂无数据'}}</text>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. export default {
  41. data() {
  42. return {
  43. tableData: [],
  44. meetingInfoArray: [],
  45. statusArray: [],
  46. userId: JSON.parse(uni.getStorageSync('user')).id,
  47. }
  48. },
  49. mounted() {
  50. // console.log(JSON.parse(uni.getStorageSync('user')))
  51. this.getMeetingInfo();
  52. this.getDicts();
  53. this.getApplyHistory();
  54. },
  55. methods: {
  56. resubmit(data){
  57. let path;
  58. if(this.$i18n.locale=='en'){
  59. path = "/pages/conference/conferenceOfflineEn/conference-offline-en"
  60. }else{
  61. path = "/pages/conference/conferenceOfflineZh/conference-offline-zh"
  62. }
  63. uni.navigateTo({
  64. url: path,
  65. success: function(res) {
  66. res.eventChannel.emit('reapply', { data: data })
  67. }
  68. })
  69. },
  70. approvalStatus(val){
  71. let arr = this.$i18n.locale=='en'? this.statusEnArray: this.statusArray;
  72. let targeTapproval = arr.filter(item=>{
  73. return val==item.value;
  74. })
  75. return targeTapproval[0]['label'];
  76. },
  77. array2Obj(id, attr){
  78. let targetConference = this.meetingInfoArray.filter(item=>{
  79. return id==item.id;
  80. })
  81. // console.log('targetConference',targetConference)
  82. return targetConference[0][attr];
  83. },
  84. getStateColor(s){
  85. let color;
  86. let sColor;
  87. switch(s){
  88. case '2':
  89. color = '#f59a23';
  90. sColor = '#fad1c5';
  91. break;
  92. case '3':
  93. color = '#fd5c5c';
  94. sColor = '#f99b9b';
  95. break;
  96. case '4':
  97. color = '#03b6b3';
  98. sColor = '#5ddedd';
  99. break;
  100. }
  101. return {
  102. c: color,
  103. sc: sColor
  104. };
  105. },
  106. async getDicts() {
  107. const res = await this.$myRequest({
  108. url: '/sys/sysDicts',
  109. data: {
  110. type: 'APPROVAL_STATUS'
  111. }
  112. })
  113. this.statusArray = res.data[0];
  114. this.statusEnArray = [{"label":"Approvaling","value":"2"},
  115. {"label":"Failed","value":"3"},
  116. {"label":"Successful","value":"4"}];
  117. // console.log(this.statusArray)
  118. },
  119. async getMeetingInfo() {
  120. const res = await this.$myRequest({
  121. url: '/meeting/meetingBasicInfos'
  122. });
  123. console.log('this.meetingInfoArray', res)
  124. this.meetingInfoArray = res.data.meetingBasicInfos;
  125. },
  126. async getApplyHistory(){
  127. await this.$myRequest({
  128. url: '/meeting/meetingApplys/meetingApplyHistory',
  129. data: {
  130. pageNo: '',
  131. auditStatusDict: '',
  132. createBy: this.userId
  133. }
  134. }).then(res => {
  135. if(res.data && res.data.meetingApplys){
  136. res.data.meetingApplys.forEach(item => {
  137. item.comments = [];
  138. this.$myRequest({
  139. url: '/workflow/approval/history',
  140. data: {
  141. processKey: 'MEETING_APPROVE',
  142. businessKey: item.id
  143. }
  144. }).then(taskRes =>{
  145. if(taskRes.data && taskRes.data.tasks){
  146. taskRes.data.tasks.forEach(com => {
  147. if(com.comment){
  148. item.comments.push(com.comment)
  149. }
  150. })
  151. }
  152. this.tableData = res.data.meetingApplys || [];
  153. // console.log('lllllllllll',this.tableData)
  154. })
  155. })
  156. }
  157. })
  158. // console.log('lllllllllll',this.tableData)
  159. }
  160. }
  161. }
  162. </script>
  163. <style scoped>
  164. .offline-signup-list{
  165. padding-top: 10px;
  166. }
  167. .offline-signup-list-item{
  168. background: #FFFFFF;
  169. color: #666;
  170. padding: 10px;
  171. position: relative;
  172. overflow: hidden;
  173. margin-top: 10px;
  174. }
  175. .conference-title{
  176. width: 80%;
  177. font-size: 18px;
  178. font-weight: bold;
  179. padding: 16px 0;
  180. }
  181. .signup-info{
  182. padding: 0 10px;
  183. }
  184. .signup-info-label{
  185. color: #999;
  186. padding-right: 10px;
  187. line-height: 30px;
  188. }
  189. .approval-state{
  190. position: absolute;
  191. top: 0;
  192. right: -100px;
  193. font-size: 14px;
  194. color: #FFFFFF;
  195. line-height: 28px;
  196. width: 200px;
  197. text-align: center;
  198. font-weight: bold;
  199. transform: rotate(45deg) translate(-10px, 30px);
  200. transform-origin: 50% 50%;
  201. }
  202. .approval-com{
  203. color: #f8c897;
  204. line-height: 30px;
  205. }
  206. .operation-btn-group{
  207. display: flex;
  208. }
  209. .operation-btn{
  210. height: 28px;
  211. line-height: 28px;
  212. font-size: 14px;
  213. width: 100px;
  214. border-color: #6ec8c8;
  215. color: #6ec8c8;
  216. margin-left: 0;
  217. margin-right: 10px;
  218. }
  219. .button-hover[type = resubmit]{
  220. background: #6ec8c8;
  221. color: #FFFFFF;
  222. }
  223. .nodata-box{
  224. text-align: center;
  225. padding-top: 50px;
  226. }
  227. .nodata-box image{
  228. width: 60%;
  229. /* height: 200px; */
  230. }
  231. .nodata-box text{
  232. display: block;
  233. font-size: 20px;
  234. color: #CCE6FF;
  235. line-height: 40px;
  236. }
  237. </style>