Commit e766d971 by jack

修复bug

1 parent 3f9ab9ad
...@@ -3,8 +3,10 @@ ...@@ -3,8 +3,10 @@
<el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small"> <el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small">
</el-input> </el-input>
<el-tree style="max-height:50vh;overflow:auto" class="filter-tree" :data="filterTextData" :filter-node-method="filterNode" highlight-current ref="tree" node-key="id" check-on-click-node> <div v-loading="loading">
</el-tree> <el-tree style="max-height:50vh;overflow:auto" class="filter-tree" :data="filterTextData" :filter-node-method="filterNode" highlight-current ref="tree" node-key="id" check-on-click-node>
</el-tree>
</div>
<p style="text-align: right; margin-top: 10px"> <p style="text-align: right; margin-top: 10px">
<el-button @click="filterConfirm" type="primary">确定</el-button> <el-button @click="filterConfirm" type="primary">确定</el-button>
<el-button @click="closeFilter">取消</el-button> <el-button @click="closeFilter">取消</el-button>
...@@ -20,11 +22,22 @@ export default { ...@@ -20,11 +22,22 @@ export default {
return { return {
filterText: "", filterText: "",
filterTextData: [], filterTextData: [],
_timeout: "",
loading: false,
}; };
}, },
mounted() { mounted() {
this.getTree(); this.getTree();
}, },
watch: {
filterText(n) {
let _this = this;
_this.loading = true;
setTimeout(function () {
_this.$refs.tree.filter(n);
}, 100);
},
},
methods: { methods: {
// 确认选择树 // 确认选择树
filterConfirm() { filterConfirm() {
...@@ -64,9 +77,14 @@ export default { ...@@ -64,9 +77,14 @@ export default {
// 搜索树 // 搜索树
filterNode(value, data) { filterNode(value, data) {
console.log(value, data); let _this = this;
this.loading = false; if (!value) {
if (!value) return true; _this.loading = false;
return true;
}
setTimeout(function () {
_this.loading = false;
}, 1500);
return data.label.indexOf(value) !== -1; return data.label.indexOf(value) !== -1;
}, },
...@@ -74,6 +92,12 @@ export default { ...@@ -74,6 +92,12 @@ export default {
closeFilter() { closeFilter() {
this.$emit("change"); this.$emit("change");
}, },
// 搜索树
onChange(val) {
this.loading = true;
this.$refs.tree.filter(val);
},
}, },
}; };
</script> </script>
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<!-- 按钮区域 end --> <!-- 按钮区域 end -->
<!-- 列表 开始 --> <!-- 列表 开始 -->
<glsx-table ref="glsxTable" :list="tableData" :column="columnList" :pageTotal="pageTotal" @change="getList"> <glsx-table ref="glsxTable" v-loading="loading" :list="tableData" :column="columnList" :pageTotal="pageTotal" @change="getList">
<div slot="operate" slot-scope="{scope}"> <div slot="operate" slot-scope="{scope}">
<!-- <el-button size="mini" :id="scope.id">试驾轨迹</el-button> --> <!-- <el-button size="mini" :id="scope.id">试驾轨迹</el-button> -->
<el-link type="primary" :unline="false" :id="scope.id" @click="lookTrack(scope)">试驾轨迹</el-link> <el-link type="primary" :unline="false" :id="scope.id" @click="lookTrack(scope)">试驾轨迹</el-link>
...@@ -58,7 +58,7 @@ export default { ...@@ -58,7 +58,7 @@ export default {
data() { data() {
return { return {
searchForm: {keywords:this.$route.query.vin}, searchForm: {keywords:this.$route.query.vin},
test: "1", loading: false,
tableData: [], tableData: [],
columnList: [ columnList: [
{ label: "特约店编码", prop: "account", align: "center" }, { label: "特约店编码", prop: "account", align: "center" },
...@@ -136,6 +136,17 @@ export default { ...@@ -136,6 +136,17 @@ export default {
components: { components: {
GlsxTable, GlsxTable,
}, },
watch:{
'$route.query':{
handler:function(n,o){
console.log(n)
this.searchForm.keywords = n.vin;
this.timeDate = n.day?[n.day,n.day]:[]
this.getList()
},
immediate: true,
}
},
created(){ created(){
let o = this.$route.query; let o = this.$route.query;
this.timeDate = o.day?[o.day,o.day]:[] this.timeDate = o.day?[o.day,o.day]:[]
...@@ -164,11 +175,15 @@ export default { ...@@ -164,11 +175,15 @@ export default {
let oParams = this.getParams(); let oParams = this.getParams();
oParams.pageSize = options ? options.pageSize || 10 : 10; oParams.pageSize = options ? options.pageSize || 10 : 10;
oParams.pageNumber = options ? options.pageNumber || 1 : 1; oParams.pageNumber = options ? options.pageNumber || 1 : 1;
this.loading = true
DRIVE_DETAIL_SEARCH(oParams).then((res) => { DRIVE_DETAIL_SEARCH(oParams).then((res) => {
this.loading = false
let { data } = res; let { data } = res;
let { list, totalElements } = data; let { list, totalElements } = data;
this.pageTotal = totalElements; this.pageTotal = totalElements;
this.tableData = list; this.tableData = list;
}).catch(error => {
this.loading = false
}); });
}, },
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<div> <div>
<glsx-organization @change="onChange"></glsx-organization> <glsx-organization @change="onChange"></glsx-organization>
</div> </div>
<el-input v-model="searchForm.orgName" :placeholder="searchForm.specialShopName || '请选择特约店名称'" slot="reference"> <el-input v-model="searchForm.orgName" :placeholder="searchForm.specialShopName || '系统组织架构树'" slot="reference" readonly>
</el-input> </el-input>
</el-popover> </el-popover>
</el-form-item> </el-form-item>
...@@ -161,7 +161,7 @@ export default { ...@@ -161,7 +161,7 @@ export default {
// 查看详情 // 查看详情
lookDetail(row) { lookDetail(row) {
console.log(row); console.log(row);
// let query = {} // let query = {vin: row.vin}
// let path = '/oEshield#/reportManage/mileageDetail'; // let path = '/oEshield#/reportManage/mileageDetail';
// history.pushState(query, path, path); // history.pushState(query, path, path);
this.$router.push({ name: "mileageDetail", query: { vin: row.vin } }); this.$router.push({ name: "mileageDetail", query: { vin: row.vin } });
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!