Merge branch 'master' of https://e.coding.net/ctcdevteam/cma_search
This commit is contained in:
		
						commit
						8a4db4911f
					
				
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 66 KiB  | 
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| 
						 | 
					@ -10,14 +10,18 @@ user-scalable: 用户是否能缩放页面 -->
 | 
				
			||||||
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
 | 
					    <meta http-equiv="X-UA-Compatible" content="IE=edge">
 | 
				
			||||||
    <meta name="viewport" content="width=device-width, user-scalable=no,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
 | 
					    <meta name="viewport" content="width=device-width, user-scalable=no,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
 | 
				
			||||||
    <title>证书查询</title>
 | 
					    <title>证书查询</title>
 | 
				
			||||||
    <script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
 | 
					    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vue@2"></script>
 | 
				
			||||||
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
 | 
					    <!-- <script src="https://unpkg.com/axios/dist/axios.min.js"></script> -->
 | 
				
			||||||
 | 
					    <script type="text/javascript" src="https://cdn.bootcss.com/axios/0.19.0-beta.1/axios.js"></script>
 | 
				
			||||||
</head>
 | 
					</head>
 | 
				
			||||||
<style>
 | 
					<style>
 | 
				
			||||||
    body,html{
 | 
					    body,html{
 | 
				
			||||||
        padding: 0;
 | 
					        padding: 0;
 | 
				
			||||||
        margin: 0;
 | 
					        margin: 0;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    .container{
 | 
				
			||||||
 | 
					        padding-bottom: 20px;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    .active{
 | 
					    .active{
 | 
				
			||||||
        color: #2698f0;
 | 
					        color: #2698f0;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -96,9 +100,40 @@ user-scalable: 用户是否能缩放页面 -->
 | 
				
			||||||
        margin: auto;
 | 
					        margin: auto;
 | 
				
			||||||
        margin: 0 auto 10px auto;
 | 
					        margin: 0 auto 10px auto;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    .listItem{
 | 
				
			||||||
 | 
					        width: 100%;
 | 
				
			||||||
 | 
					        padding: 10px;
 | 
				
			||||||
 | 
					        box-sizing: border-box;
 | 
				
			||||||
 | 
					        border: 1px dashed #2698f0;
 | 
				
			||||||
 | 
					        border-radius: 5px;
 | 
				
			||||||
 | 
					        position: relative;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    .imgs{
 | 
					    .imgs{
 | 
				
			||||||
        width: 100%;
 | 
					        width: 100%;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    .neishen{
 | 
				
			||||||
 | 
					        display: inline-block;
 | 
				
			||||||
 | 
					        border: 1px solid orange;
 | 
				
			||||||
 | 
					        border-radius: 3px;
 | 
				
			||||||
 | 
					        padding: 0 3px;
 | 
				
			||||||
 | 
					        position: absolute;
 | 
				
			||||||
 | 
					        top: 5px;
 | 
				
			||||||
 | 
					        left: 5px;
 | 
				
			||||||
 | 
					        color: orange;
 | 
				
			||||||
 | 
					        font-size: 14px;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    .info{
 | 
				
			||||||
 | 
					        padding: 5px 20px;
 | 
				
			||||||
 | 
					        color: #ffffff;
 | 
				
			||||||
 | 
					        position: fixed;
 | 
				
			||||||
 | 
					        z-index: 10;
 | 
				
			||||||
 | 
					        width: fit-content;
 | 
				
			||||||
 | 
					        top: 40%;
 | 
				
			||||||
 | 
					        left: 50%;
 | 
				
			||||||
 | 
					        transform: translateX(-50%);
 | 
				
			||||||
 | 
					        background: rgba(0,0,0,.5);
 | 
				
			||||||
 | 
					        border-radius: 5px;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    @media screen and (max-width: 992px){
 | 
					    @media screen and (max-width: 992px){
 | 
				
			||||||
        .search-dialog{
 | 
					        .search-dialog{
 | 
				
			||||||
            width: 96%;
 | 
					            width: 96%;
 | 
				
			||||||
| 
						 | 
					@ -146,24 +181,39 @@ user-scalable: 用户是否能缩放页面 -->
 | 
				
			||||||
            <div v-if="type==0">
 | 
					            <div v-if="type==0">
 | 
				
			||||||
                <div class="row">
 | 
					                <div class="row">
 | 
				
			||||||
                    <span class="label"><span class="redStar">*</span>证书号</span>
 | 
					                    <span class="label"><span class="redStar">*</span>证书号</span>
 | 
				
			||||||
                    <input class="searchInput" type="text" id="username" v-model="form.number">
 | 
					                    <input class="searchInput" type="text" id="number" v-model="form.number">
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <div class="searchBtn" @click="searchClick(0)">查询</div>
 | 
					                <div class="searchBtn" @click="searchClick(0)">查询</div>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
            <div v-else>
 | 
					            <div v-else>
 | 
				
			||||||
                <div class="row">
 | 
					                <div class="row">
 | 
				
			||||||
                    <span class="label"><span class="redStar">*</span>姓名</span>
 | 
					                    <span class="label"><span class="redStar">*</span>姓名</span>
 | 
				
			||||||
                    <input class="searchInput" type="text" id="username" v-model="form.name">
 | 
					                    <input class="searchInput" type="text" id="name" v-model="form.name">
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <div class="row">
 | 
					                <div class="row">
 | 
				
			||||||
                    <span class="label"><span class="redStar">*</span>单位</span>
 | 
					                    <span class="label"><span class="redStar">*</span>单位</span>
 | 
				
			||||||
                    <input class="searchInput" type="password" id="password" v-model="form.deptName">
 | 
					                    <input class="searchInput" type="text" id="deptName" v-model="form.deptName">
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <div class="searchBtn" @click="searchClick(1)">查询</div>
 | 
					                <div class="searchBtn" @click="searchClick(1)">查询</div>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
            <div>
 | 
					            <div v-if="showImg">
 | 
				
			||||||
                <img class="imgs"  :src="imgSrc">
 | 
					                <img class="imgs"  :src="imgSrc">
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
 | 
					            <div class="lists" v-if="dataList.length>0">
 | 
				
			||||||
 | 
					                <div v-for="item in dataList" class="listItem" @click="showImage(item)">
 | 
				
			||||||
 | 
					                    <div>姓名:{{item.姓名}}</div>
 | 
				
			||||||
 | 
					                    <div>证书编号:{{item.证书编号}}</div>
 | 
				
			||||||
 | 
					                    <div>所属单位:{{item.所属单位}}</div>
 | 
				
			||||||
 | 
					                    <div v-if="item.职务!==null&&item.职务!=='/'">职务:{{item.职务}}</div>
 | 
				
			||||||
 | 
					                    <div class="neishen" v-if="item.内审员">内审员</div>
 | 
				
			||||||
 | 
					                </div>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					            <div  v-else>
 | 
				
			||||||
 | 
					                <p>暂未查询到您的相关证书!</p>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					        <div v-if="showErr" class="info">
 | 
				
			||||||
 | 
					            {{errMsg}}
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
| 
						 | 
					@ -176,33 +226,76 @@ user-scalable: 用户是否能缩放页面 -->
 | 
				
			||||||
                name: '',
 | 
					                name: '',
 | 
				
			||||||
                deptName: ''
 | 
					                deptName: ''
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
            imgSrc:''
 | 
					            imgSrc:'',
 | 
				
			||||||
 | 
					            showImg:false,
 | 
				
			||||||
 | 
					            dataList:[],
 | 
				
			||||||
 | 
					            showErr:false,
 | 
				
			||||||
 | 
					            errMsg:''
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        methods: {
 | 
					        methods: {
 | 
				
			||||||
            typeChange(index){
 | 
					            typeChange(index){
 | 
				
			||||||
 | 
					                let that = this;
 | 
				
			||||||
 | 
					                that.dataList = [];
 | 
				
			||||||
                this.type = index;
 | 
					                this.type = index;
 | 
				
			||||||
 | 
					                that.showImg = false;
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
            searchClick(type){
 | 
					            searchClick(type){
 | 
				
			||||||
                axios.get('https://testsearch.ctc.ac.cn/api/edu/certificate/',{params:{证书编号:this.form.number}})
 | 
					                let that = this;
 | 
				
			||||||
 | 
					                that.dataList = [];
 | 
				
			||||||
 | 
					                if(that.type==0){
 | 
				
			||||||
 | 
					                    if(that.form.number!==''){
 | 
				
			||||||
 | 
					                        axios.get('https://testsearch.ctc.ac.cn/api/edu/certificate/',{params:{证书编号:that.form.number}})
 | 
				
			||||||
                        .then(res => {
 | 
					                        .then(res => {
 | 
				
			||||||
                    let data = res.data.data[0];
 | 
					                            if(res.data.data.length>0){
 | 
				
			||||||
                    if(data.证书地址!==null){
 | 
					                                that.dataList = res.data.data;
 | 
				
			||||||
                        this.imgSrc = 'https://testsearch.ctc.ac.cn'+data.证书地址;
 | 
					                            }
 | 
				
			||||||
 | 
					                        })
 | 
				
			||||||
                    }else{
 | 
					                    }else{
 | 
				
			||||||
                        axios.get(`https://testsearch.ctc.ac.cn/api/edu/certificate/${data.id}/`).then(res1=>{
 | 
					                        that.errMsg = '请输入证书编号';
 | 
				
			||||||
 | 
					                        that.showErr = true;
 | 
				
			||||||
 | 
					                        setTimeout(()=>{
 | 
				
			||||||
 | 
					                            that.showErr = false;
 | 
				
			||||||
 | 
					                        },1500)
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }else{
 | 
				
			||||||
 | 
					                    if(that.form.name!==''){
 | 
				
			||||||
 | 
					                        if(that.form.deptName!==''){
 | 
				
			||||||
 | 
					                            axios.get('https://testsearch.ctc.ac.cn/api/edu/certificate/',{params:{姓名:that.form.name,所属单位:that.form.deptName}})
 | 
				
			||||||
 | 
					                            .then(res => {
 | 
				
			||||||
 | 
					                                if(res.data.data.length>0){
 | 
				
			||||||
 | 
					                                    that.dataList = res.data.data;
 | 
				
			||||||
 | 
					                                }
 | 
				
			||||||
 | 
					                            })
 | 
				
			||||||
 | 
					                        }else{
 | 
				
			||||||
 | 
					                            that.errMsg = '请输入所属单位';
 | 
				
			||||||
 | 
					                            that.showErr = true;
 | 
				
			||||||
 | 
					                            setTimeout(()=>{
 | 
				
			||||||
 | 
					                                that.showErr = false;
 | 
				
			||||||
 | 
					                            },1500)
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                    }else{
 | 
				
			||||||
 | 
					                        that.errMsg = '请输入姓名';
 | 
				
			||||||
 | 
					                        that.showErr = true;
 | 
				
			||||||
 | 
					                        setTimeout(()=>{
 | 
				
			||||||
 | 
					                            that.showErr = false;
 | 
				
			||||||
 | 
					                        },1500)
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					            showImage(data){
 | 
				
			||||||
 | 
					                let that = this;
 | 
				
			||||||
 | 
					                if(data.证书地址!==null){
 | 
				
			||||||
 | 
					                    that.imgSrc = 'https://testsearch.ctc.ac.cn'+data.证书地址;
 | 
				
			||||||
 | 
					                    that.showImg = true;
 | 
				
			||||||
 | 
					                }else{
 | 
				
			||||||
 | 
					                    axios.get(`https://testsearch.ctc.ac.cn/api/edu/certificate/${data.id}/`).then(res=>{
 | 
				
			||||||
                        if(res.data){
 | 
					                        if(res.data){
 | 
				
			||||||
                                debugger;
 | 
					                            let data1 = res.data.data;
 | 
				
			||||||
                                console.log('res1.data:')
 | 
					                            that.imgSrc = 'https://testsearch.ctc.ac.cn'+data1.证书地址;
 | 
				
			||||||
                                console.log(res1.data.data)
 | 
					                            that.showImg = true;
 | 
				
			||||||
                                console.log(res1.data.data.证书地址)
 | 
					 | 
				
			||||||
                                let data1 = res1.data.data;
 | 
					 | 
				
			||||||
                                this.imgSrc = 'https://testsearch.ctc.ac.cn'+data1.证书地址;
 | 
					 | 
				
			||||||
                                console.log(this.imgSrc)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    })
 | 
					                    })
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                })
 | 
					 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        mounted: function () {
 | 
					        mounted: function () {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue