|
|
|
@ -44,11 +44,12 @@
|
|
|
|
|
<div class="input">
|
|
|
|
|
<el-input v-model="input" placeholder="请输入产品名称、批准文号/备案编号"></el-input>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="sousuo" @click="gotoBgpage">
|
|
|
|
|
<!-- @click="gotoBgpage" -->
|
|
|
|
|
<div class="sousuo" @click="getsearchList()" >
|
|
|
|
|
<img src="@/assets/images/daping/searchicon.png" alt="" />
|
|
|
|
|
搜索
|
|
|
|
|
</div>
|
|
|
|
|
<div class="box-dialog" v-loading="loading" v-if="dialog">
|
|
|
|
|
<div class="box-dialog" v-loading="loading" v-show="!loading">
|
|
|
|
|
<div class="dialog-item" v-for='(item, index) in searchList' :key="index" @click="getValue(item)">
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
</div>
|
|
|
|
@ -204,19 +205,19 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
async input(newValue, oldValue) {
|
|
|
|
|
// let data = await this.$api.productPortrayal.findByName({current:1,size:10});
|
|
|
|
|
if (newValue) {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
this.dialog = true;
|
|
|
|
|
// let a = this.throttle(this.getsearchList,500)
|
|
|
|
|
this.getsearchList(newValue);
|
|
|
|
|
} else {
|
|
|
|
|
this.dialog = false;
|
|
|
|
|
this.searchList = [];
|
|
|
|
|
this.loading = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// async input(newValue, oldValue) {
|
|
|
|
|
// // let data = await this.$api.productPortrayal.findByName({current:1,size:10});
|
|
|
|
|
// if (newValue) {
|
|
|
|
|
// this.loading = true;
|
|
|
|
|
// this.dialog = true;
|
|
|
|
|
// // let a = this.throttle(this.getsearchList,500)
|
|
|
|
|
// this.getsearchList(newValue);
|
|
|
|
|
// } else {
|
|
|
|
|
// this.dialog = false;
|
|
|
|
|
// this.searchList = [];
|
|
|
|
|
// this.loading = false;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
},
|
|
|
|
|
created() { this.dataNow(1) },
|
|
|
|
|
mounted() {
|
|
|
|
@ -226,6 +227,7 @@ export default {
|
|
|
|
|
this.userName = user.realName
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
|
|
ListGO(item) {
|
|
|
|
|
this.$router.push({ path: "/bgpage", query: { code: item.code, name: item.name, type: item.type } })
|
|
|
|
|
},
|
|
|
|
@ -311,18 +313,20 @@ export default {
|
|
|
|
|
getValue(item) {
|
|
|
|
|
this.input = item.name;
|
|
|
|
|
this.getData = item;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.dialog = false;
|
|
|
|
|
}, 200);
|
|
|
|
|
this.loading = true;
|
|
|
|
|
this.gotoBgpage()
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
async getsearchList(newValue) {
|
|
|
|
|
let data = await this.$api.productPortrayal.findByName({ name: newValue });
|
|
|
|
|
if (data.code == 200) {
|
|
|
|
|
async getsearchList() {
|
|
|
|
|
let res = await this.$api.productPortrayal.findByName({ name: this.input });
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.searchList = data.data;
|
|
|
|
|
if (this.searchList.length < 1) {
|
|
|
|
|
this.dialog = false;
|
|
|
|
|
}
|
|
|
|
|
this.searchList = res.data;
|
|
|
|
|
|
|
|
|
|
if(this.searchList.length>0){
|
|
|
|
|
this.loading = false
|
|
|
|
|
}else{
|
|
|
|
|
this.$modal.msgWarning("未搜索到结果!")
|
|
|
|
|
this.loading = true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
tuichudengl() {
|
|
|
|
|