移动端
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 

218 Zeilen
6.4 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. title="审批历史"
  5. fixed
  6. placeholder
  7. left-arrow
  8. @click-left="onClickLeft"
  9. />
  10. <div class="main_box2">
  11. <van-row v-for="(item,index) in historyList" :key="index">
  12. <van-col :span="4">
  13. <p class="index">{{index+1}}</p>
  14. <div class="indexBorder" :class="{'indexCenter':index==0 ? false : true}">
  15. <p class="ssT" v-if="index>0"></p>
  16. <p class="yq"></p>
  17. <p class="ss" v-if="historyList.length != index+1"></p>
  18. </div>
  19. </van-col>
  20. <van-col :span="20">
  21. <van-cell :title="item.activityName" center :to="{name:'programmeDetail'}">
  22. <template #label>
  23. <p>{{ item.endTime }}</p>
  24. </template>
  25. <template #default>
  26. <p style="color: #666666;">{{ item.assigneeName }}
  27. <span
  28. class="bq"
  29. :style="{
  30. background:item.comment.substr(item.comment.length-2,2) == '申请' ? 'rgba(29,111,233,0.2)' : item.comment.substr(item.comment.length-2,2) == '同意' ? 'rgba(29,204,128,0.2)' : item.comment.substr(item.comment.length-2,2) == '结束' ? 'rgba(255,166,62,0.2)' : item.comment.substr(item.comment.length-2,2) == '驳回' ? 'rgba(254,19,19,0.2)' : '',
  31. color:item.comment.substr(item.comment.length-2,2) == '申请' ? '#1D6FE9' : item.comment.substr(item.comment.length-2,2) == '同意' ? '#1DCC80' : item.comment.substr(item.comment.length-2,2) == '结束' ? '#FFA63E' : item.comment.substr(item.comment.length-2,2) == '驳回' ? '#FE1313' : ''
  32. }"
  33. >{{ item.comment.substr(item.comment.length-2,2) }}</span>
  34. </p>
  35. <p style="color: #999999;">{{ item.durationInMillis }}</p>
  36. </template>
  37. </van-cell>
  38. </van-col>
  39. </van-row>
  40. </div>
  41. </div>
  42. </template>
  43. <script>
  44. import request from "@/utils/request";
  45. export default {
  46. name: "programmeDetail",
  47. data() {
  48. return {
  49. showBankType:false,
  50. showPayeeType:false,
  51. showPicker:false,
  52. form:{},
  53. bankType:'',
  54. payeeType:'',
  55. value:'',
  56. // 查询参数
  57. queryParams: {
  58. pageNum: 1,
  59. pageSize: 999,
  60. processInstanceId: null,
  61. activityName: null,
  62. assignee: null,
  63. },
  64. bankTypeOptions:[],
  65. payeeTypeOptions:[],
  66. historyList: [],
  67. };
  68. },
  69. created() {
  70. this.handleViewHistoryList()
  71. },
  72. methods: {
  73. handleViewHistoryList() {
  74. this.queryParams.processInstanceId = this.$route.query.id;
  75. this.getHistoryList();
  76. },
  77. getHistoryList: function () {
  78. this.loading = true;
  79. return request({
  80. url: "/activiti/process/listHistory",
  81. method: "post",
  82. data: this.queryParams,
  83. })
  84. .then((response) => {
  85. this.historyList = response.rows;
  86. this.historyList.forEach((row) => {
  87. row.startTime = this.format(row.startTime, "yyyy-MM-dd HH:mm:ss");
  88. row.endTime = this.format(row.endTime, "yyyy-MM-dd HH:mm:ss");
  89. row.durationInMillis = this.formatTotalDateSub(
  90. row.durationInMillis / 1000
  91. );
  92. });
  93. this.total = response.total;
  94. this.loading = false;
  95. })
  96. .then(() => {});
  97. },
  98. format(time, format) {
  99. var t = new Date(time);
  100. var tf = function (i) { return (i < 10 ? '0' : '') + i };
  101. return format.replace(/yyyy|MM|dd|HH|mm|ss/g, function (a) {
  102. switch (a) {
  103. case 'yyyy':
  104. return tf(t.getFullYear());
  105. break;
  106. case 'MM':
  107. return tf(t.getMonth() + 1);
  108. break;
  109. case 'mm':
  110. return tf(t.getMinutes());
  111. break;
  112. case 'dd':
  113. return tf(t.getDate());
  114. break;
  115. case 'HH':
  116. return tf(t.getHours());
  117. break;
  118. case 'ss':
  119. return tf(t.getSeconds());
  120. break;
  121. }
  122. })
  123. },
  124. /**
  125. * 计算出相差天数
  126. * @param secondSub
  127. */
  128. formatTotalDateSub (secondSub) {
  129. var days = Math.floor(secondSub / (24 * 3600)); // 计算出小时数
  130. var leave1 = secondSub % (24*3600) ; // 计算天数后剩余的毫秒数
  131. var hours = Math.floor(leave1 / 3600); // 计算相差分钟数
  132. var leave2 = leave1 % (3600); // 计算小时数后剩余的毫秒数
  133. var minutes = Math.floor(leave2 / 60); // 计算相差秒数
  134. var leave3 = leave2 % 60; // 计算分钟数后剩余的毫秒数
  135. var seconds = Math.round(leave3);
  136. return days + "天" + hours + "时" + minutes + "分" + seconds + '秒';
  137. }
  138. },
  139. }
  140. </script>
  141. <style scoped lang="scss">
  142. .app-container {
  143. padding: 2% 2%;
  144. }
  145. .main_box2{
  146. width: 96%;
  147. margin: 0 auto;
  148. background: #ffffff;
  149. border-radius: 6PX;
  150. overflow: hidden;
  151. margin-top: 10PX;
  152. margin-bottom: 20PX;
  153. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  154. .van-col{
  155. height: 76PX;
  156. position: relative;
  157. }
  158. .van-row:nth-child(2n){
  159. background: rgba(29,111,233,0.1);
  160. }
  161. /deep/ .van-cell{
  162. background: transparent;
  163. padding: 10Px;
  164. }
  165. .bq{
  166. display: inline-block;
  167. padding: 4PX 8PX;
  168. border-radius: 5PX;
  169. font-size: 12Px;
  170. }
  171. .index{
  172. background: #1D6FE9;
  173. color: #ffffff;
  174. text-align: center;
  175. width: 20PX;
  176. height: 20PX;
  177. line-height: 20PX;
  178. border-radius: 50%;
  179. position: absolute;
  180. left: 50%;
  181. top: 50%;
  182. transform: translate(-50%,-50%);
  183. }
  184. .indexCenter{
  185. top: 0!important;
  186. }
  187. .indexBorder{
  188. width: 10PX;
  189. position: absolute;
  190. right: 0;
  191. top: calc(50% - 5PX);
  192. .yq{
  193. height: 10PX;
  194. width: 10PX;
  195. background: #C9C9C9;
  196. border-radius: 50%;
  197. }
  198. .ss{
  199. height: 33PX;
  200. width: 2PX;
  201. background: #C9C9C9;
  202. position: relative;
  203. left: 4PX;
  204. }
  205. .ssT{
  206. height: 33PX;
  207. width: 2PX;
  208. background: #C9C9C9;
  209. position: relative;
  210. left: 4PX;
  211. }
  212. }
  213. }
  214. </style>