steps.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. <template>
  2. <view class="steps-lists">
  3. <view class="steps-box">
  4. <view :class="status.sign ? 'steps-item success':'steps-item'">
  5. <view class="steps-state">
  6. <uni-icons class="inherit-icons" type="checkmarkempty" size="18" color="#fff">
  7. </uni-icons>
  8. </view>
  9. <view class="steps-content">
  10. <view class="steps-name">
  11. <view class="name">签订合同</view>
  12. <view class="date"><text>{{detail.signingDate}}</text></view>
  13. </view>
  14. <view v-if="status.sign">
  15. <view class="steps-item-content" v-for="(item,index) in documentFileList" :key="index"
  16. @click="openDocument(item)">
  17. <view class="steps-file">{{item.name}}</view>
  18. <uni-icons class="inherit-icons right-icon" type="right" color="#858585">
  19. </uni-icons>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="steps-line"></view>
  24. </view>
  25. <view :class="status.payment ? 'steps-item success':'steps-item'">
  26. <view class="steps-state">
  27. <uni-icons class="inherit-icons" type="checkmarkempty" size="18" color="#fff">
  28. </uni-icons>
  29. </view>
  30. <view class="steps-content">
  31. <view class="steps-name">
  32. <view class="name">合同账单</view>
  33. <view class="date"><text>{{payment.date}}</text></view>
  34. </view>
  35. <view class="steps-item-content">
  36. <view class="title">合同账单</view>
  37. <view class="content">共<text class="steps-text">{{payment.all}}</text>期,已付款<text
  38. class="steps-text">{{payment.pass}}</text>期
  39. </view>
  40. <uni-icons class="inherit-icons right-icon" type="right" color="#858585">
  41. </uni-icons>
  42. </view>
  43. </view>
  44. <view class="steps-line"></view>
  45. </view>
  46. <view :class="status.invoice ? 'steps-item success':'steps-item'">
  47. <view class="steps-state">
  48. <uni-icons class="inherit-icons" type="checkmarkempty" size="18" color="#fff">
  49. </uni-icons>
  50. </view>
  51. <view class="steps-content">
  52. <view class="steps-name">
  53. <view class="name">合同发票</view>
  54. <view class="date"><text>{{invoice.date}}</text></view>
  55. </view>
  56. <view class="steps-item-content">
  57. <view class="title">合同发票</view>
  58. <view class="content">共<text class="steps-text">{{invoice.all}}</text>条发票
  59. </view>
  60. <uni-icons class="inherit-icons right-icon" type="right" color="#858585">
  61. </uni-icons>
  62. </view>
  63. </view>
  64. <view class="steps-line"></view>
  65. </view>
  66. <view class="steps-item">
  67. <view class="steps-state">
  68. <uni-icons class="inherit-icons" type="checkmarkempty" size="18" color="#fff">
  69. </uni-icons>
  70. </view>
  71. <view class="steps-content">
  72. <view class="steps-name">
  73. <view class="name">合同工单</view>
  74. <view class="date"><text>{{order.date}}</text></view>
  75. </view>
  76. <view class="steps-item-content">
  77. <view class="title">合同工单</view>
  78. <view class="content">共<text class="steps-text">{{order.all}}</text>条工单
  79. </view>
  80. <uni-icons class="inherit-icons right-icon" type="right" color="#858585">
  81. </uni-icons>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. </template>
  88. <script>
  89. import config from "@/config";
  90. import {
  91. getPaymentListByPage
  92. } from '@/request/api/contract.js'
  93. import {
  94. getInvoiceListByPage
  95. } from '@/request/api/invouce.js'
  96. import {
  97. getOrderPageListByQuery
  98. } from '@/request/api/order.js'
  99. export default {
  100. props: ['detail'],
  101. data() {
  102. return {
  103. status: {
  104. sign: false,
  105. payment: false,
  106. invoice: false
  107. },
  108. documentFileList: [],
  109. payment: {
  110. date: '',
  111. all: 0,
  112. pass: 0
  113. },
  114. invoice: {
  115. date: '',
  116. all: 0
  117. },
  118. order: {
  119. date: '',
  120. all: 0
  121. },
  122. }
  123. },
  124. created() {
  125. this.status['sign'] = this.detail.status === 2;
  126. if (this.status.sign) {
  127. this.documentFileList = this.detail.document ? JSON.parse(this.detail.document) : [];
  128. this.getPayment();
  129. this.getInvoice();
  130. this.getOrder();
  131. }
  132. },
  133. methods: {
  134. openDocument(item) {
  135. let fileUrl = config.baseUrl + '/file/archived/' + item.id + '/pdf.pdf';
  136. this.$navigateTo('/pages/pdf/pdf?fileUrl=' + fileUrl + '&titleName=' + item.name);
  137. },
  138. getPayment() {
  139. getPaymentListByPage({
  140. currPage: 1,
  141. pageSize: 100,
  142. contractId: this.detail.id
  143. }).then(res => {
  144. if (res.code === 200) {
  145. if (res.data.totalCount === 0) return;
  146. this.status['payment'] = res.data.totalCount > 0;
  147. this.payment = {
  148. date: res.data.dataList[0].reminderDate,
  149. all: res.data.totalCount,
  150. pass: res.data.dataList.filter(node => node.status === 1).length
  151. }
  152. }
  153. })
  154. },
  155. getInvoice() {
  156. getInvoiceListByPage({
  157. currPage: 1,
  158. pageSize: 100,
  159. contractId: this.detail.id
  160. }).then(res => {
  161. if (res.data.totalCount === 0) return;
  162. this.status['invoice'] = res.data.totalCount > 0;
  163. this.invoice = {
  164. date: res.data.dataList[0].date || '-',
  165. all: res.data.totalCount
  166. }
  167. })
  168. },
  169. getOrder() {
  170. getOrderPageListByQuery({
  171. currPage: 1,
  172. pageSize: 100,
  173. contractId: this.detail.id
  174. }).then(res => {
  175. if (res.data.totalCount === 0) return;
  176. this.status['order'] = res.data.totalCount > 0;
  177. this.order = {
  178. date: res.data.dataList[0].date || '-',
  179. all: res.data.totalCount
  180. }
  181. })
  182. }
  183. }
  184. }
  185. </script>
  186. <style lang="scss">
  187. .steps-lists {
  188. background: #fff;
  189. padding: 30rpx;
  190. .steps-text {
  191. color: $uni-primary;
  192. margin: 0 2rpx;
  193. font-weight: 400;
  194. }
  195. .steps-item {
  196. position: relative;
  197. display: flex;
  198. .steps-state {
  199. width: 52rpx;
  200. height: 52rpx;
  201. background: $uni-border-4;
  202. border-radius: 50%;
  203. margin-right: 20rpx;
  204. margin-top: 16rpx;
  205. display: flex;
  206. align-items: center;
  207. justify-content: center;
  208. oversteps: hidden;
  209. color: #fff;
  210. }
  211. .steps-content {
  212. flex: 1;
  213. width: 0;
  214. .steps-name {
  215. height: 96rpx;
  216. display: flex;
  217. flex-direction: column;
  218. justify-content: center;
  219. .name {
  220. color: $uni-border-4;
  221. font-size: 32rpx;
  222. font-weight: 600;
  223. }
  224. .date {
  225. font-size: 24rpx;
  226. color: $uni-secondary-color;
  227. display: flex;
  228. align-items: center;
  229. justify-content: space-between;
  230. }
  231. }
  232. .steps-item-content {
  233. background-color: #ffffff;
  234. border-radius: 8px;
  235. box-shadow: 0px 1px 12px rgba(3, 3, 3, 0.08);
  236. padding: 10px;
  237. margin-bottom: 16rpx;
  238. position: relative;
  239. &.last {
  240. margin-bottom: 0;
  241. }
  242. .title {
  243. font-weight: 600;
  244. padding-bottom: 10rpx;
  245. }
  246. .content {
  247. font-weight: 300;
  248. }
  249. .right-icon {
  250. position: absolute;
  251. top: 50%;
  252. margin-top: -16rpx;
  253. right: 20rpx;
  254. }
  255. }
  256. }
  257. .steps-line {
  258. width: 1px;
  259. border-left: 1px solid $uni-border-4;
  260. position: absolute;
  261. top: 68rpx;
  262. bottom: -16rpx;
  263. left: 26rpx;
  264. }
  265. &.success {
  266. .steps-state {
  267. background: $uni-success;
  268. }
  269. .steps-name .name {
  270. color: $uni-success;
  271. }
  272. .steps-line {
  273. border-color: $uni-success;
  274. }
  275. }
  276. }
  277. }
  278. </style>