detail.vue 1.55 KB
<template>
    <div class="app-container">
        <section class="qg-container">
        <h4 class="qg-container__title">详情</h4>
        <el-form :model="tshjInfo" class="qg-edit-form" label-width="120px">
       <el-form-item label="图书" prop="bookId">
           <span v-if="tshjInfo.bookId && tshjInfo.bookIdEntity">	
             {{ tshjInfo.bookIdEntity.code }}
            </span>
            <span v-else>--</span>
      </el-form-item>
       <el-form-item label="归还时间" prop="returnTime">
         	{{tshjInfo.returnTime && tshjInfo.returnTime.substring(0,10) || '--'}}
      </el-form-item>
            <el-form-item>
              <el-button @click="goBack">返回</el-button>
  			</el-form-item>
        </el-form>
        </section>
    </div>
</template>
                    
<script>
    import {tshj} from '@/api/moudles/zxm/tshj';
  	import {componentsData} from './config.js'
  	
    export default {
        name:'TshjDetail',
        data() {
            const id = this.$route.query.id;
            return {
                componentsData,
                id,
                tshjInfo: {}
            };
        },
        created() {
            if (this.id) {
                this.tshj(this.id);
            }
        },
        methods: {
            tshj(id) {
                tshj(id).then(response => {
      				if (response.data) {
                      	this.tshjInfo = response.data;
                    }
                });
            },
            goBack() {
                 this.$router.back();
            }
        }
    };
</script>