Commit b26e3dd0 by 薛文刚

案件编号查询

parent 12b0f350
This source diff could not be displayed because it is too large. You can view the blob instead.
<template> <template>
<div id="ryxxkcSearch" class="ryxxkcSearch"> <div id="ryxxkcSearch"
<div class="top-title">人员信息核查</div> class="ryxxkcSearch">
<div style="margin-top: 15px;"> <div class="top-title">人员信息核查</div>
<el-input :placeholder="seletListValue[selectType]==undefined?'':'请输入'+seletListValue[selectType]" v-model="searchValue" class="input-with-select"> <div style="margin-top: 15px;">
<el-select v-model="selectType" slot="prepend" placeholder="请选择"> <el-input :placeholder="seletListValue[selectType]==undefined?'':'请输入'+seletListValue[selectType]"
<el-option :label="item.name" :value="item.value" v-for="(item,index) in seletList" :key="index"></el-option> v-model="searchValue"
</el-select> class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="search">搜索</el-button> <el-select v-model="selectType"
</el-input> slot="prepend"
</div> placeholder="请选择">
<div class="history"> <el-option :label="item.name"
<ul> :value="item.value"
<li v-for="(item,index) in historyList" :key="index" class="historyItem" @click="setValue(item)">{{item.value}}</li> v-for="(item,index) in seletList"
</ul> :key="index"></el-option>
</div> </el-select>
<el-button slot="append"
icon="el-icon-search"
@click="search">搜索</el-button>
</el-input>
</div> </div>
<div class="history">
<ul>
<li v-for="(item,index) in historyList"
:key="index"
class="historyItem"
@click="setValue(item)">{{item.value}}</li>
</ul>
</div>
</div>
</template> </template>
<script> <script>
import { import {
ryxxhcSelectList,ryxxhcSelectListValue ryxxhcSelectList, ryxxhcSelectListValue
} from "@/utils/params"; } from "@/utils/params";
export default { export default {
name: "ryxxkcSearch", name: "ryxxkcSearch",
data(){ data () {
return { return {
searchValue:'', searchValue: '',
selectType:'zjhm', selectType: 'zjhm',
seletList:ryxxhcSelectList, seletList: ryxxhcSelectList,
seletListValue:ryxxhcSelectListValue, seletListValue: ryxxhcSelectListValue,
historyList:[] historyList: []
} }
}, },
methods:{ methods: {
setValue(item){ setValue (item) {
this.selectType=item.type; debugger
this.searchValue=item.value; this.selectType = item.type;
}, this.searchValue = item.value;
search(){ },
let self=this; search () {
if(self.searchValue!=""){ let self = this;
let history=[]; if (self.searchValue != "") {
let json={}; let history = [];
json.type=self.selectType; let json = {};
json.value=self.searchValue; json.type = self.selectType;
if(sessionStorage.getItem("searchHistory")){ json.value = self.searchValue;
let i=0; if (sessionStorage.getItem("searchHistory")) {
JSON.parse(sessionStorage.getItem("searchHistory")).forEach(item=>{ let i = 0;
debugger JSON.parse(sessionStorage.getItem("searchHistory")).forEach(item => {
i++; debugger
if(item.value==self.searchValue&&item.type==self.selectType){ i++;
history=JSON.parse(sessionStorage.getItem("searchHistory")); if (item.value == self.searchValue && item.type == self.selectType) {
return; history = JSON.parse(sessionStorage.getItem("searchHistory"));
} return;
if(i==JSON.parse(sessionStorage.getItem("searchHistory")).length){
history=JSON.parse(sessionStorage.getItem("searchHistory"));
history.push(json);
}
})
}else{
history.push(json);
}
sessionStorage.setItem("searchHistory",JSON.stringify(history));
self.historyList=history;
let routeData = self.$router.resolve({
path: "/ryxxhcDetailIndex",
query: {type:self.selectType,value:self.searchValue}
});
window.open(routeData.href, "_blank");
}else{
self.$message({
type: "error",
message: "请输入"+self.seletListValue[self.selectType]
});
}
} }
}, if (i == JSON.parse(sessionStorage.getItem("searchHistory")).length) {
mounted() { history = JSON.parse(sessionStorage.getItem("searchHistory"));
let self=this; history.push(json);
if(sessionStorage.getItem("searchHistory")){
self.historyList=JSON.parse(sessionStorage.getItem("searchHistory"));
} }
})
} else {
history.push(json);
} }
sessionStorage.setItem("searchHistory", JSON.stringify(history));
self.historyList = history;
let routeData = self.$router.resolve({
path: "/ryxxhcDetailIndex",
query: { type: self.selectType, value: self.searchValue }
});
window.open(routeData.href, "_blank");
} else {
self.$message({
type: "error",
message: "请输入" + self.seletListValue[self.selectType]
});
}
}
},
mounted () {
let self = this;
if (sessionStorage.getItem("searchHistory")) {
self.historyList = JSON.parse(sessionStorage.getItem("searchHistory"));
} }
}
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '../../assets/styles/ryxxhc.scss'; @import "../../assets/styles/ryxxhc.scss";
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment