123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- <template>
- <div class="contains" v-loading="listLoading" element-loading-text="查询中,请稍等...">
- <h1>e码头供应链-海关跨境电子商务年度个人额度查询</h1>
- <div class="step-contains">
- <el-steps simple space="20%">
- <el-step title="放置身份证" status="finish" icon="el-icon-postcard"></el-step>
- <el-step title="点击查询" status="finish" icon="el-icon-thumb"></el-step>
- <el-step title="查询结果" status="finish" icon="el-icon-tickets"></el-step>
- </el-steps>
- </div>
- <div id="result">
- <h3>自{{ inceptionDate }}00:00起,至{{ currentDate }}24:00,您的个人额度如下:</h3>
- <table>
- <tbody>
- <tr>
- <td class="title">姓名:</td>
- <td class="value">
- <div>{{ name }}</div>
- </td>
- <td rowspan="4">
- <el-button id="button" type="primary" @click="limit_query()">
- 查 询
- </el-button>
- </td>
- </tr>
- <tr>
- <td class="title">身份证号:</td>
- <td class="value">
- <div>{{ idNo }}</div>
- </td>
- </tr>
- <tr>
- <td class="title">本年已用金额:</td>
- <td class="value">
- <div id="red">{{ totalAmount }}</div>
- </td>
- </tr>
- <tr>
- <td class="title">本年可用金额:</td>
- <td class="value">
- <div id="green">{{ innerBalance }}</div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </template>
- <script>
- import { getLimit } from '@/api/limit'
- export default {
- name: 'YearLimit',
- data() {
- return {
- listLoading: false,
- name: null,
- idNo: null,
- totalAmount: null,
- innerBalance: null,
- inceptionDate: null,
- currentDate: null,
- listQuery: {
- page: 1,
- limit: 20,
- // 如下为搜索栏字段
- // 根据实际配置
- someParam: undefined
- }
- }
- },
- mounted() {
- this.inception_date()
- this.current_date()
- this.create_interval()
- },
- methods: {
- limit_query() {
- if (!this.listLoading) {
- this.listLoading = true
- getLimit().then(response => {
- console.log('str' + JSON.stringify(response))
- // do something
- this.listLoading = false
- if (!response.code) {
- this.$message.error('[10]查询失败')
- return
- }
- if (response.code !== '0') {
- this.$message.error(response.msg)
- return
- }
- this.name = response.rows[0].data.name
- this.idNo = response.rows[0].data.id_no
- this.totalAmount = response.rows[0].data.total_amount + '元'
- this.innerBalance = response.rows[0].data.innerbalance + '元'
- }).catch(error => {
- this.$message.error(error || '数据加载失败')
- this.listLoading = false
- })
- }
- },
- inception_date() {
- var date = new Date()
- var year = date.getFullYear()
- this.inceptionDate = year + '年1月1日'
- },
- current_date() {
- var date = new Date()
- var year = date.getFullYear()
- var month = date.getMonth() + 1
- var strDate = date.getDate()
- this.currentDate = year + '年' + month + '月' + strDate + '日'
- }
- }
- }
- </script>
- <style scoped>
- .contains {
- text-align: center;
- }
- h1 {
- color: #1890ff;
- }
- .step-contains {
- width: 60%;
- margin: 0 auto;
- padding: 3% 0;
- border: 0px solid #000;
- }
- #result {
- width: 50%;
- margin: 0 auto;
- }
- h3 {
- font-weight: normal;
- }
- table {
- font-size: 18px;
- width: 90%;
- margin: 5% auto;
- }
- table td {
- height: 50px;
- position: relative;
- display: table-cell;
- padding: 0.2% 0;
- }
- table td.title {
- text-align: right;
- padding: 0 2% 0 0;
- width: 25%;
- }
- table td.value {
- width: 30%;
- }
- table td div {
- width: 100%;
- height: 30px;
- font-family: inherit;
- font-size: inherit;
- line-height: inherit;
- border: solid 1px silver;
- padding-top: 9px;
- }
- table td.value #red {
- color: red;
- }
- table td.value #green {
- color: green;
- }
- table td.value {
- width: 30%;
- }
- #button {
- width: 100px;
- height: 120px;
- margin: 0 50% 0 0;
- font-size: 16px;
- }
- </style>
|