myActivityRegistration.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <template>
  2. <view style="margin-top: 100upx;">
  3. <u-mask :show="show" @click="show = false" :mask-click-able="false">
  4. <view style="display: flex;align-items: center;justify-content: center;height: 100%;">
  5. <view style="width: 20px;height: 20px;">
  6. <u-loading mode="circle"></u-loading>
  7. </view>
  8. </view>
  9. </u-mask>
  10. <view class="">
  11. <u-tabs :list="list" :is-scroll="true" :current="current" @change="change"></u-tabs>
  12. </view>
  13. <view class="offline-signup-list" v-if="tableData.length">
  14. <view class="offline-signup-list-item" v-for="(item, index) in tableData" :key="index"
  15. @click="resubmit(item)">
  16. <!-- <view class="conference-title">{{ array2Obj(item.meetingId, $i18n.locale=='en'?'meetingNameEn':'meetingName') }}</view>-->
  17. <view class="conference-title">{{ item.guestRoomInfoId }}</view>
  18. <view class="signup-info">
  19. <view>
  20. <text class="signup-info-label">{{$i18n.locale=='en'?'ApplyName':'报名人员:'}}</text>
  21. <text class="signup-info-value">{{item.applyWay=='zh'? item.name: item.nameEn}}</text>
  22. </view>
  23. <!--<view>
  24. <text class="signup-info-label">{{$i18n.locale=='en'?'ApplyDate':'报名时间:'}}</text>
  25. <text class="signup-info-value">{{item.isAcceptMeeting}}</text>
  26. </view>-->
  27. <view>
  28. <text class="signup-info-label">{{$i18n.locale=='en'?'Date':'活动时间:'}}</text>
  29. <text class="signup-info-value">
  30. {{item.isAcceptMeeting}} ~ {{item.isAcceptVisit}}
  31. </text>
  32. </view>
  33. <!-- <view><text class="signup-info-label">会议地点:</text><text class="signup-info-value">北京,中国</text></view> -->
  34. <text v-if="item.auditStatusDict != '4'" class="approval-com" v-for="(com,c) in item.comments"
  35. :key="c">{{com}}
  36. </text>
  37. <view class="operation-btn-group">
  38. <button @click="resubmit(item)" v-if="item.auditStatusDict=='2' && item.comments.length"
  39. type="resubmit" hover-class="button-hover" class="operation-btn" plain="true">
  40. {{$i18n.locale=='en'?'ReApply':'重新提交'}}
  41. </button>
  42. </view>
  43. </view>
  44. <!-- 审批中:2 审批不通过:3 审批通过:4 -->
  45. <view
  46. class="approval-state"
  47. :style="{background: getStateColor(item.auditStatusDict).c, 'box-shadow': '0 4px 4px '+getStateColor(item.auditStatusDict).sc}">
  48. {{ approvalStatus(item.auditStatusDict) }}
  49. </view>
  50. </view>
  51. <view style="margin-top: 30upx;">
  52. <u-loadmore :status="status" :load-text="loadText"/>
  53. </view>
  54. </view>
  55. <view class="nodata-box" v-else>
  56. <image src="@/static/img/public/7.png" mode=""></image>
  57. <text>{{$i18n.locale=='en'? 'No Data': '暂无数据'}}</text>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. export default {
  63. data() {
  64. return {
  65. show: false,
  66. list: [
  67. {
  68. name: this.$i18n.locale == 'zh' ? '全部' : 'All',
  69. }, {
  70. name: this.$i18n.locale == 'zh' ? '审批中' : 'Under Approval',
  71. }, {
  72. name: this.$i18n.locale == 'zh' ? '审批不通过' : 'Registration Failed',
  73. }, {
  74. name: this.$i18n.locale == 'zh' ? '审批通过' : 'Registration Successful',
  75. }
  76. ],
  77. current: 0,
  78. tableData: [],
  79. statusArray: [],
  80. userId: JSON.parse(uni.getStorageSync('user')).id,
  81. auditStatusDict: '',
  82. pageNo: 0,
  83. totalPage: 1,
  84. status: 'loading',
  85. isLoading: true,
  86. loadText: {
  87. loading: this.$i18n.locale == 'zh' ? '加载中' : 'Loading',
  88. nomore: this.$i18n.locale == 'zh' ? '没有更多数据了' : 'No more'
  89. },
  90. }
  91. },
  92. props: {
  93. fatherData: {
  94. type: Number,
  95. default: function() {
  96. return {};
  97. }
  98. },
  99. },
  100. mounted() {
  101. // console.log(JSON.parse(uni.getStorageSync('user')))
  102. this.getMeetingInfo();
  103. this.getDicts();
  104. },
  105. /*onReachBottom() { //页面拉到底部加载
  106. if (this.isLoading) {
  107. this.getMeetingInfo();
  108. }
  109. },*/
  110. watch:{
  111. 'fatherData'(val,oldval){
  112. if (this.isLoading) {
  113. this.getMeetingInfo();
  114. }
  115. }
  116. },
  117. methods: {
  118. async getDicts() {
  119. const res = await this.$myRequest({
  120. url: '/sys/sysDicts',
  121. data: {
  122. type: 'APPROVAL_STATUS'
  123. }
  124. })
  125. this.statusArray = res.data[0];
  126. this.statusEnArray = [{"label": "Approvaling", "value": "2"},
  127. {"label": "Failed", "value": "3"},
  128. {"label": "Successful", "value": "4"}];
  129. // console.log(this.statusArray)
  130. },
  131. async getMeetingInfo() {
  132. console.log(this.pageNo)
  133. console.log(this.totalPage)
  134. const that = this;
  135. this.show = true;
  136. let params = {
  137. pageNo: '',
  138. pageSize: 10,
  139. language: this.$i18n.locale.toUpperCase(),
  140. auditStatusDict: that.auditStatusDict,
  141. createBy: that.userId,
  142. };
  143. if (this.pageNo >= this.totalPage) {
  144. this.isLoading = false;
  145. this.status = 'nomore';
  146. this.show = false;
  147. } else {
  148. this.isLoading = true;
  149. this.pageNo++;
  150. params.pageNo = this.pageNo;
  151. await this.$myRequest({
  152. url: '/meeting/meetingApplys/getActivityApplyByIdForWeb',
  153. data: {
  154. ...params
  155. }
  156. }).then(res => {
  157. if (res.data && res.data.page.list) {
  158. if (that.tableData.length == 0 || that.tableData.length == undefined) {
  159. that.tableData = res.data.page.list;
  160. } else {
  161. that.tableData = that.tableData.concat(res.data.page.list);
  162. }
  163. that.tableData.forEach(item => {
  164. item.isAcceptMeeting = item.isAcceptMeeting - 0;
  165. item.isAcceptVisit = item.isAcceptVisit - 0;
  166. item.isAcceptMeeting = item.isAcceptMeeting ? this.formatDate(item.isAcceptMeeting, "YYYY-MM-DD") : "";
  167. item.isAcceptVisit = item.isAcceptVisit ? this.formatDate(item.isAcceptVisit, "YYYY-MM-DD") : "";
  168. that.$set(item, 'comments', [])
  169. this.$myRequest({
  170. url: '/workflow/approval/history',
  171. data: {
  172. processKey: 'MEETING_APPROVE',
  173. businessKey: item.id
  174. }
  175. }).then(taskRes => {
  176. if (taskRes.data && taskRes.data.tasks) {
  177. taskRes.data.tasks.forEach(com => {
  178. if (com.comment) {
  179. item.comments.push(com.comment)
  180. }
  181. })
  182. }
  183. })
  184. });
  185. if (res.data.page.list.length < 10) {
  186. that.status = 'nomore';
  187. }
  188. this.totalPage = res.data.page.totalPage;
  189. }
  190. this.show = false
  191. })
  192. }
  193. },
  194. change(index) {
  195. this.current = index;
  196. if (index == 0) {
  197. this.auditStatusDict = '';
  198. } else {
  199. this.auditStatusDict = index - 0 + 1;
  200. }
  201. this.tableData = [];
  202. this.pageNo = 0;
  203. this.totalPage = 1;
  204. this.getMeetingInfo()
  205. },
  206. approvalStatus(val) {
  207. let arr = this.$i18n.locale == 'en' ? this.statusEnArray : this.statusArray;
  208. let targeTapproval = arr.filter(item => {
  209. return val == item.value;
  210. })
  211. return targeTapproval[0]['label'];
  212. },
  213. getStateColor(s) {
  214. let color;
  215. let sColor;
  216. switch (s) {
  217. case '2':
  218. color = '#f59a23';
  219. sColor = '#fad1c5';
  220. break;
  221. case '3':
  222. color = '#fd5c5c';
  223. sColor = '#f99b9b';
  224. break;
  225. case '4':
  226. color = '#03b6b3';
  227. sColor = '#5ddedd';
  228. break;
  229. }
  230. return {
  231. c: color,
  232. sc: sColor
  233. };
  234. },
  235. resubmit(data) {
  236. console.log(data)
  237. uni.navigateTo({
  238. url: `/pages/cooperationExchange/cooperationExchangeList/cooperationActiveRegistration?id=${data.travelPointId}&Rep=${data.id}`,
  239. /*success: function(res) {
  240. res.eventChannel.emit('reapply', { data: data })
  241. }*/
  242. })
  243. },
  244. }
  245. }
  246. </script>
  247. <style scoped>
  248. .uni-page-body {
  249. height: 100%;
  250. }
  251. .menu {
  252. position: relative;
  253. height: 100 upx;
  254. margin-top: 100 upx;
  255. }
  256. .offline-signup-list {
  257. /*padding-top: 10px;*/
  258. }
  259. .offline-signup-list-item {
  260. background: #FFFFFF;
  261. color: #666;
  262. padding: 10px;
  263. position: relative;
  264. overflow: hidden;
  265. margin-top: 10px;
  266. }
  267. .conference-title {
  268. width: 80%;
  269. font-size: 18px;
  270. font-weight: bold;
  271. padding: 16px 0;
  272. }
  273. .signup-info {
  274. padding: 0 10px;
  275. }
  276. .signup-info-label {
  277. color: #999;
  278. padding-right: 10px;
  279. line-height: 30px;
  280. }
  281. .approval-state {
  282. position: absolute;
  283. top: 0;
  284. right: -100px;
  285. font-size: 14px;
  286. color: #FFFFFF;
  287. line-height: 28px;
  288. width: 200px;
  289. text-align: center;
  290. font-weight: bold;
  291. transform: rotate(45deg) translate(-10px, 30px);
  292. transform-origin: 50% 50%;
  293. }
  294. .approval-com {
  295. color: #f8c897;
  296. line-height: 30px;
  297. }
  298. .operation-btn-group {
  299. display: flex;
  300. }
  301. .operation-btn {
  302. height: 28px;
  303. line-height: 28px;
  304. font-size: 14px;
  305. width: 100px;
  306. border-color: #6ec8c8;
  307. color: #6ec8c8;
  308. margin-left: 0;
  309. margin-right: 10px;
  310. }
  311. .button-hover[type = resubmit] {
  312. background: #6ec8c8;
  313. color: #FFFFFF;
  314. }
  315. .nodata-box {
  316. text-align: center;
  317. padding-top: 50px;
  318. }
  319. .nodata-box image {
  320. width: 60%;
  321. /* height: 200px; */
  322. }
  323. .nodata-box text {
  324. display: block;
  325. font-size: 20px;
  326. color: #CCE6FF;
  327. line-height: 40px;
  328. }
  329. </style>