|
@@ -1,5 +1,16 @@
|
|
|
<template>
|
|
|
<div class="message-list">
|
|
|
+ <el-select v-model="addressVal" placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in addressList"
|
|
|
+ :key="item.addressid"
|
|
|
+ :label="item.addressname"
|
|
|
+ :value="item.addressid"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-button type="primary" @click="searchMessage">筛选</el-button>
|
|
|
+ <el-button type="info">重置</el-button>
|
|
|
<el-table :data="tableData" style="width: 100%">
|
|
|
<el-table-column type="index" width="50"> </el-table-column>
|
|
|
<el-table-column prop="jrid" label="信息ID"> </el-table-column>
|
|
@@ -25,11 +36,14 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getMessage } from "@/api/message";
|
|
|
+import { getMessage, searchInfo } from "@/api/message";
|
|
|
+import { getLocation } from "@/api/location";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
tableData: [],
|
|
|
+ addressList: [],
|
|
|
+ addressVal: "",
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -40,18 +54,55 @@ export default {
|
|
|
this.tableData = res.data;
|
|
|
});
|
|
|
},
|
|
|
- updateRow(row){
|
|
|
- console.log(row)
|
|
|
+ updateRow(row) {
|
|
|
+ console.log(row);
|
|
|
this.$router.push({
|
|
|
- path: '/message/addMessage',
|
|
|
+ path: "/message/addMessage",
|
|
|
query: {
|
|
|
- id: row.jrid
|
|
|
+ id: row.jrid,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //获取地址信息
|
|
|
+ getLocationList() {
|
|
|
+ getLocation().then((res) => {
|
|
|
+ console.log(res.data);
|
|
|
+ this.addressList = res.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //筛选功能
|
|
|
+ searchMessage() {
|
|
|
+ console.log(this.addressVal);
|
|
|
+
|
|
|
+ let _addressName = "";
|
|
|
+ this.addressList.forEach((val) => {
|
|
|
+ if (val.addressid == this.addressVal) {
|
|
|
+ _addressName = val.addressname;
|
|
|
}
|
|
|
+ });
|
|
|
+ searchInfo({
|
|
|
+ searchid: this.addressVal,
|
|
|
})
|
|
|
- }
|
|
|
+ .then((res) => {
|
|
|
+ if(res.data == undefined){
|
|
|
+ this.tableData = []
|
|
|
+ }
|
|
|
+ console.log(res.data);
|
|
|
+ let _data = res.data;
|
|
|
+ this.tableData = _data.map((val) => {
|
|
|
+ val.addressname = _addressName
|
|
|
+ val.levelname = '查无此项'
|
|
|
+ return val
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err)
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
created() {
|
|
|
this.getMessageList();
|
|
|
+ this.getLocationList();
|
|
|
},
|
|
|
};
|
|
|
</script>
|