steps.vue 7.7 KB

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