...
|
...
|
@@ -5,35 +5,41 @@ |
|
|
</div>
|
|
|
<div class="company-data">
|
|
|
<div class="company-item" v-for="item in showData">
|
|
|
<h2>{{ $key }}</h2>
|
|
|
<a class="tag" :name="$key">{{ $key }}</a>
|
|
|
<span v-for="val in item" track-by="id" @click="select(val.id, val.company_name)">{{val.company_name}}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<index-list style="margin-top:70px"></index-list>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
const $ = require('yoho-jquery');
|
|
|
const indexList = require('component/tool/index-list.vue');
|
|
|
|
|
|
module.exports = {
|
|
|
props: ['company_list'],
|
|
|
data() {
|
|
|
this.company_list = JSON.parse(this.company_list);
|
|
|
return {
|
|
|
inputname: '',
|
|
|
data: {},
|
|
|
showData: {}
|
|
|
showData: this.company_list
|
|
|
};
|
|
|
},
|
|
|
components: {
|
|
|
indexList
|
|
|
},
|
|
|
methods: {
|
|
|
search: function() {
|
|
|
var inputname = this.inputname;
|
|
|
if (!inputname) {
|
|
|
this.showData = this.data;
|
|
|
this.showData = this.company_list;
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var filter = {};
|
|
|
for (var k in this.data) {
|
|
|
this.data[k].forEach(function(d){
|
|
|
for (var k in this.company_list) {
|
|
|
this.company_list[k].forEach(function(d){
|
|
|
if (d.company_name.indexOf(inputname) > -1) {
|
|
|
if (!filter[k]) filter[k] = [];
|
|
|
filter[k].push(d);
|
...
|
...
|
@@ -51,27 +57,8 @@ |
|
|
|
|
|
// 重置列表
|
|
|
this.inputname = '';
|
|
|
this.showData = this.data;
|
|
|
}
|
|
|
},
|
|
|
activate: function(done) {
|
|
|
let _this = this;
|
|
|
$.ajax({
|
|
|
url: '/home/refund/companylist'
|
|
|
}).then(function(res) {
|
|
|
if ($.type(res) !== 'object') {
|
|
|
res = {};
|
|
|
this.showData = this.company_list;
|
|
|
}
|
|
|
if (res.code === 200) {
|
|
|
_this.data = res.data;
|
|
|
_this.showData = res.data;
|
|
|
}
|
|
|
done();
|
|
|
}).fail(function() {
|
|
|
tip('网络错误');
|
|
|
done();
|
|
|
});
|
|
|
|
|
|
}
|
|
|
};
|
|
|
</script> |
...
|
...
|
|