Detail.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <template>
  2. <div class="card-container">
  3. <div class="card-content">
  4. <el-form
  5. :model="creditLimitInfo"
  6. v-loading="loading"
  7. ref="creditLimitInfo"
  8. label-position="right"
  9. label-width="180px">
  10. <div class="section-title">Monthly Credit Limit:</div>
  11. <el-row :gutter="20">
  12. <el-col :xs="24" :md="12">
  13. <el-form-item label="Fleet Company:">
  14. <el-input
  15. class="add-text"
  16. v-model="creditLimit.fleetCompany"
  17. readonly/>
  18. </el-form-item>
  19. </el-col>
  20. <el-col :xs="24" :md="12">
  21. <el-form-item label="Status:">
  22. <el-input
  23. class="add-text"
  24. v-model="creditLimit.creditLimitStatus"
  25. readonly/>
  26. </el-form-item>
  27. </el-col>
  28. </el-row>
  29. <el-row :gutter="20">
  30. <el-col :xs="24" :md="12">
  31. <el-form-item label="Monthly Credit Limit:">
  32. <span class="item-unit">(S$)</span>
  33. <el-input
  34. class="add-text"
  35. v-model="creditLimitInfo.creditLimitAmount"
  36. readonly/>
  37. </el-form-item>
  38. </el-col>
  39. <el-col :xs="24" :md="12">
  40. <el-form-item label="Effective Start Date:">
  41. <el-input
  42. class="add-text"
  43. v-model="creditLimitInfo.effectiveStartDate"
  44. readonly/>
  45. </el-form-item>
  46. </el-col>
  47. </el-row>
  48. <el-row :gutter="20">
  49. <el-col :xs="24" :md="12">
  50. <el-form-item label="Used Credit Limit:">
  51. <span class="item-unit">(S$)</span>
  52. <el-input
  53. class="add-text"
  54. v-model="creditLimitInfo.usedCreditLimitAmount"
  55. readonly/>
  56. </el-form-item>
  57. </el-col>
  58. <el-col :xs="24" :md="12">
  59. <el-form-item label="Effective End Date:">
  60. <el-input
  61. class="add-text"
  62. v-model="creditLimitInfo.effectiveEndDate"
  63. readonly/>
  64. </el-form-item>
  65. </el-col>
  66. </el-row>
  67. <el-row :gutter="20">
  68. <el-col :xs="24" :md="12">
  69. <el-form-item
  70. label="Remaining Credit Limit:"
  71. prop="chargeBoxId">
  72. <span class="item-unit">(S$)</span>
  73. <el-input
  74. class="add-text"
  75. v-model="creditLimitInfo.creditLimitRemainingAmount"
  76. readonly/>
  77. </el-form-item>
  78. </el-col>
  79. <el-col :xs="24" :md="12">
  80. <el-form-item
  81. label="Deposit Received:"
  82. prop="depositReceivedAmount">
  83. <span class="item-unit">(S$)</span>
  84. <el-input
  85. class="add-text"
  86. v-model="creditLimitInfo.depositReceivedAmount"
  87. readonly/>
  88. </el-form-item>
  89. </el-col>
  90. </el-row>
  91. <div class="hr-full"/>
  92. <div class="buttons">
  93. <el-button
  94. type="primary"
  95. class="cancel-button"
  96. @click="handleClickCancleButton">
  97. Back
  98. </el-button>
  99. </div>
  100. </el-form>
  101. </div>
  102. </div>
  103. </template>
  104. <script>
  105. import { mapState } from 'vuex'
  106. import limit from '../../http/api/limit.js'
  107. import { fetchFleetCompanyPages } from '../../http/api/fleetCompany';
  108. export default {
  109. data() {
  110. return {
  111. loading: false,
  112. creditLimitInfo: {
  113. creditLimitId: 0,
  114. fleetCompanyId: '',
  115. creditLimitAmount: '',
  116. depositReceivedAmount: '',
  117. effectiveStartDate: "",
  118. effectiveEndDate: "",
  119. creditLimitStatus: ""
  120. }
  121. }
  122. },
  123. computed: {
  124. ...mapState('provider', ['creditLimit'])
  125. },
  126. created() {
  127. this.loading = true;
  128. this.getLimitInfo();
  129. },
  130. methods: {
  131. getLimitInfo() {
  132. var id = this.creditLimit.creditLimitId;
  133. if (!id) id = this.$route.params.id;
  134. limit.viewCreditLimit(id).then(res => {
  135. this.loading = false;
  136. if (res.data) {
  137. this.creditLimitInfo = res.data
  138. }
  139. }).catch(err => {
  140. this.loading = false;
  141. this.$message({
  142. message: err,
  143. type: 'error'
  144. })
  145. });
  146. },
  147. handleClickCancleButton() {
  148. this.$router.go(-1)
  149. }
  150. }
  151. }
  152. </script>
  153. <style scoped="scoped" lang='scss'>
  154. @import '../../styles/variables.scss';
  155. .card-container {
  156. width: 100%;
  157. padding: 20px 60px;
  158. min-height: $mainAppMinHeight;
  159. background-color: #F0F5FC;
  160. }
  161. .card-content {
  162. padding: 15px 80px;
  163. border-radius: 6px;
  164. background-color: white;
  165. }
  166. .section-title {
  167. color: #333;
  168. margin-top: 20px;
  169. margin-bottom: 30px;
  170. font-size: 16px;
  171. user-select: none;
  172. line-height: 24px;
  173. font-weight: 500;
  174. font-family: sans-serif;
  175. text-transform: uppercase;
  176. }
  177. .add-text {
  178. width: 100%;
  179. max-width: 300px;
  180. }
  181. .add-text ::v-deep .el-textarea__inner {
  182. font-family: sans-serif;
  183. }
  184. .hr {
  185. height: 2px;
  186. margin: 10px -40px;
  187. background-color: #F0F5FC;
  188. }
  189. .hr-full {
  190. height: 2px;
  191. margin: 20px -80px;
  192. background-color: #F0F5FC;
  193. }
  194. .rate-list-view {
  195. display: flex;
  196. align-items: center;
  197. }
  198. .rate-text {
  199. max-width: 150px;
  200. padding-right: 14px;
  201. }
  202. .list-item-icon {
  203. width: 30px;
  204. height: 30px;
  205. cursor: pointer;
  206. margin: 0 10px 22px;
  207. }
  208. .buttons {
  209. padding-top: 15px;
  210. padding-bottom: 30px;
  211. }
  212. @media screen and (max-width: 500px) {
  213. .card-container {
  214. padding: 0px;
  215. }
  216. .card-content {
  217. padding: 15px 30px;
  218. }
  219. }
  220. .item-unit {
  221. top: 12px;
  222. left: -40px;
  223. font-size: 12px;
  224. user-select: none;
  225. position: absolute;
  226. }
  227. </style>