index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <div class="contains" v-loading="listLoading" element-loading-text="查询中,请稍等...">
  3. <h1>e码头供应链-海关跨境电子商务年度个人额度查询</h1>
  4. <div class="step-contains">
  5. <el-steps simple space="20%">
  6. <el-step title="放置身份证" status="finish" icon="el-icon-postcard"></el-step>
  7. <el-step title="点击查询" status="finish" icon="el-icon-thumb"></el-step>
  8. <el-step title="查询结果" status="finish" icon="el-icon-tickets"></el-step>
  9. </el-steps>
  10. </div>
  11. <div id="result">
  12. <h3>自{{ inceptionDate }}00:00起,至{{ currentDate }}24:00,您的个人额度如下:</h3>
  13. <table>
  14. <tbody>
  15. <tr>
  16. <td class="title">姓名:</td>
  17. <td class="value">
  18. <div>{{ name }}</div>
  19. </td>
  20. <td rowspan="4">
  21. <el-button id="button" type="primary" @click="limit_query()">
  22. 查&nbsp;&nbsp;&nbsp;&nbsp;询
  23. </el-button>
  24. </td>
  25. </tr>
  26. <tr>
  27. <td class="title">身份证号:</td>
  28. <td class="value">
  29. <div>{{ idNo }}</div>
  30. </td>
  31. </tr>
  32. <tr>
  33. <td class="title">本年已用金额:</td>
  34. <td class="value">
  35. <div id="red">{{ totalAmount }}</div>
  36. </td>
  37. </tr>
  38. <tr>
  39. <td class="title">本年可用金额:</td>
  40. <td class="value">
  41. <div id="green">{{ innerBalance }}</div>
  42. </td>
  43. </tr>
  44. </tbody>
  45. </table>
  46. </div>
  47. </div>
  48. </template>
  49. <script>
  50. import { getLimit } from '@/api/limit'
  51. export default {
  52. name: 'YearLimit',
  53. data() {
  54. return {
  55. listLoading: false,
  56. name: null,
  57. idNo: null,
  58. totalAmount: null,
  59. innerBalance: null,
  60. inceptionDate: null,
  61. currentDate: null,
  62. listQuery: {
  63. page: 1,
  64. limit: 20,
  65. // 如下为搜索栏字段
  66. // 根据实际配置
  67. someParam: undefined
  68. }
  69. }
  70. },
  71. mounted() {
  72. this.inception_date()
  73. this.current_date()
  74. this.create_interval()
  75. },
  76. methods: {
  77. limit_query() {
  78. if (!this.listLoading) {
  79. this.listLoading = true
  80. getLimit().then(response => {
  81. console.log('str' + JSON.stringify(response))
  82. // do something
  83. this.listLoading = false
  84. if (!response.code) {
  85. this.$message.error('[10]查询失败')
  86. return
  87. }
  88. if (response.code !== '0') {
  89. this.$message.error(response.msg)
  90. return
  91. }
  92. this.name = response.rows[0].data.name
  93. this.idNo = response.rows[0].data.id_no
  94. this.totalAmount = response.rows[0].data.total_amount + '元'
  95. this.innerBalance = response.rows[0].data.innerbalance + '元'
  96. }).catch(error => {
  97. this.$message.error(error || '数据加载失败')
  98. this.listLoading = false
  99. })
  100. }
  101. },
  102. inception_date() {
  103. var date = new Date()
  104. var year = date.getFullYear()
  105. this.inceptionDate = year + '年1月1日'
  106. },
  107. current_date() {
  108. var date = new Date()
  109. var year = date.getFullYear()
  110. var month = date.getMonth() + 1
  111. var strDate = date.getDate()
  112. this.currentDate = year + '年' + month + '月' + strDate + '日'
  113. }
  114. }
  115. }
  116. </script>
  117. <style scoped>
  118. .contains {
  119. text-align: center;
  120. }
  121. h1 {
  122. color: #1890ff;
  123. }
  124. .step-contains {
  125. width: 60%;
  126. margin: 0 auto;
  127. padding: 3% 0;
  128. border: 0px solid #000;
  129. }
  130. #result {
  131. width: 50%;
  132. margin: 0 auto;
  133. }
  134. h3 {
  135. font-weight: normal;
  136. }
  137. table {
  138. font-size: 18px;
  139. width: 90%;
  140. margin: 5% auto;
  141. }
  142. table td {
  143. height: 50px;
  144. position: relative;
  145. display: table-cell;
  146. padding: 0.2% 0;
  147. }
  148. table td.title {
  149. text-align: right;
  150. padding: 0 2% 0 0;
  151. width: 25%;
  152. }
  153. table td.value {
  154. width: 30%;
  155. }
  156. table td div {
  157. width: 100%;
  158. height: 30px;
  159. font-family: inherit;
  160. font-size: inherit;
  161. line-height: inherit;
  162. border: solid 1px silver;
  163. padding-top: 9px;
  164. }
  165. table td.value #red {
  166. color: red;
  167. }
  168. table td.value #green {
  169. color: green;
  170. }
  171. table td.value {
  172. width: 30%;
  173. }
  174. #button {
  175. width: 100px;
  176. height: 120px;
  177. margin: 0 50% 0 0;
  178. font-size: 16px;
  179. }
  180. </style>