|
@@ -38,10 +38,10 @@
|
|
<div class="drop_down">
|
|
<div class="drop_down">
|
|
<van-dropdown-menu active-color="#1989fa">
|
|
<van-dropdown-menu active-color="#1989fa">
|
|
<van-dropdown-item
|
|
<van-dropdown-item
|
|
- v-model="checkType"
|
|
|
|
- @change="handelChange('checkType', checkType)"
|
|
|
|
- :title="checkTypeTitle"
|
|
|
|
- :options="checkTypeList"
|
|
|
|
|
|
+ v-model="dataForm.circuitType"
|
|
|
|
+ @change="handelChange('circuitType', circuitType)"
|
|
|
|
+ :title="reviewTypeTitle"
|
|
|
|
+ :options="reviewTypeList"
|
|
/>
|
|
/>
|
|
<van-dropdown-item
|
|
<van-dropdown-item
|
|
v-model="checkPerson"
|
|
v-model="checkPerson"
|
|
@@ -69,25 +69,27 @@
|
|
finished-text="没有更多了"
|
|
finished-text="没有更多了"
|
|
@load="onLoad"
|
|
@load="onLoad"
|
|
>
|
|
>
|
|
- <div v-for="item in list" :key="item.id" class="list_item">
|
|
|
|
|
|
+ <div v-for="item in dataList" :key="item.id" class="list_item">
|
|
<van-row class="header">
|
|
<van-row class="header">
|
|
- <van-col>{{ item.tenantInfo.name }}</van-col>
|
|
|
|
|
|
+ <van-col>{{ item.circuitPosition }}</van-col>
|
|
</van-row>
|
|
</van-row>
|
|
<van-row>
|
|
<van-row>
|
|
<van-col>巡检类型:</van-col>
|
|
<van-col>巡检类型:</van-col>
|
|
- <van-col style="color: #fa5555">¥{{ item.amount }}</van-col>
|
|
|
|
|
|
+ <van-col>{{
|
|
|
|
+ dict_filter(item.circuitType, "reviewTypeList")["text"]
|
|
|
|
+ }}</van-col>
|
|
</van-row>
|
|
</van-row>
|
|
<van-row>
|
|
<van-row>
|
|
<van-col>巡检人员:</van-col>
|
|
<van-col>巡检人员:</van-col>
|
|
- <van-col style="color: #fa5555">¥{{ item.amount }}</van-col>
|
|
|
|
|
|
+ <van-col>{{ item.circuitPerson.realName }}</van-col>
|
|
</van-row>
|
|
</van-row>
|
|
<van-row>
|
|
<van-row>
|
|
<van-col>联系电话:</van-col>
|
|
<van-col>联系电话:</van-col>
|
|
- <van-col style="color: #fa5555">¥{{ item.amount }}</van-col>
|
|
|
|
|
|
+ <van-col>{{ item.circuitPerson.mobile }}</van-col>
|
|
</van-row>
|
|
</van-row>
|
|
<van-row>
|
|
<van-row>
|
|
<van-col>巡检时间:</van-col>
|
|
<van-col>巡检时间:</van-col>
|
|
- <van-col style="color: #fa5555">¥{{ item.amount }}</van-col>
|
|
|
|
|
|
+ <van-col>{{ item.circuitTime }}</van-col>
|
|
</van-row>
|
|
</van-row>
|
|
</div>
|
|
</div>
|
|
</van-list>
|
|
</van-list>
|
|
@@ -97,6 +99,7 @@
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import Api from "@/utils/api";
|
|
import Api from "@/utils/api";
|
|
|
|
+import { isEmpty, getDictDataList } from "@/utils/index";
|
|
import VCountUp from "../CountUp";
|
|
import VCountUp from "../CountUp";
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
@@ -105,26 +108,42 @@ export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
name: "电商园四期-B座",
|
|
name: "电商园四期-B座",
|
|
- checkType: "",
|
|
|
|
checkPerson: "",
|
|
checkPerson: "",
|
|
- checkTypeTitle: "巡检类型",
|
|
|
|
|
|
+ reviewTypeTitle: "巡检类型",
|
|
checkPersonTitle: "巡检人员",
|
|
checkPersonTitle: "巡检人员",
|
|
- checkTypeList: [
|
|
|
|
- { text: "安保", value: 1 },
|
|
|
|
- { text: "保洁", value: 2 },
|
|
|
|
- ],
|
|
|
|
|
|
+ reviewTypeList: [],
|
|
checkPersonList: [
|
|
checkPersonList: [
|
|
{ text: "张三", value: 1 },
|
|
{ text: "张三", value: 1 },
|
|
{ text: "李四", value: 2 },
|
|
{ text: "李四", value: 2 },
|
|
],
|
|
],
|
|
- dataForm: {},
|
|
|
|
|
|
+ dataForm: {
|
|
|
|
+ circuitType: "",
|
|
|
|
+ page: 1,
|
|
|
|
+ limit: 10,
|
|
|
|
+ },
|
|
dataList: [],
|
|
dataList: [],
|
|
loading: false,
|
|
loading: false,
|
|
refreshing: false,
|
|
refreshing: false,
|
|
finished: false,
|
|
finished: false,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
+ created() {
|
|
|
|
+ this.getReviewTypeList();
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
|
|
+ getReviewTypeList() {
|
|
|
|
+ this.reviewTypeList = getDictDataList("ReviewType");
|
|
|
|
+ this.reviewTypeList.forEach((item) => {
|
|
|
|
+ item.text = item.dictLabel;
|
|
|
|
+ item.value = item.dictValue;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ dict_filter(val, list) {
|
|
|
|
+ if (isEmpty(val)) {
|
|
|
|
+ return {};
|
|
|
|
+ }
|
|
|
|
+ return this[list].find((item) => item.dictValue == val);
|
|
|
|
+ },
|
|
onLoad() {
|
|
onLoad() {
|
|
setTimeout(async () => {
|
|
setTimeout(async () => {
|
|
if (this.refreshing) {
|
|
if (this.refreshing) {
|
|
@@ -132,33 +151,35 @@ export default {
|
|
this.refreshing = false;
|
|
this.refreshing = false;
|
|
}
|
|
}
|
|
await this.getDataList();
|
|
await this.getDataList();
|
|
|
|
+ this.dataForm.page++; // 分页数加一
|
|
}, 100);
|
|
}, 100);
|
|
},
|
|
},
|
|
onRefresh() {
|
|
onRefresh() {
|
|
// 清空列表数据
|
|
// 清空列表数据
|
|
this.finished = false;
|
|
this.finished = false;
|
|
// 重新加载数据
|
|
// 重新加载数据
|
|
|
|
+ this.dataList = [];
|
|
// 将 loading 设置为 true,表示处于加载状态
|
|
// 将 loading 设置为 true,表示处于加载状态
|
|
this.loading = true;
|
|
this.loading = true;
|
|
- this.dataList = [];
|
|
|
|
|
|
+ this.dataForm.page = 1; // 分页数赋值为1
|
|
this.onLoad();
|
|
this.onLoad();
|
|
},
|
|
},
|
|
// 获取列表数据方法
|
|
// 获取列表数据方法
|
|
getDataList() {
|
|
getDataList() {
|
|
- Api.reviewCheckList(this.dataForm).then((res) => {
|
|
|
|
|
|
+ Api.reviewList(this.dataForm).then((res) => {
|
|
if (res.code == 0) {
|
|
if (res.code == 0) {
|
|
if (res.data) {
|
|
if (res.data) {
|
|
- if (res.data.length == 0) {
|
|
|
|
|
|
+ if (res.data.list.length == 0) {
|
|
// 判断获取数据条数若等于0
|
|
// 判断获取数据条数若等于0
|
|
this.dataList = []; // 清空数组
|
|
this.dataList = []; // 清空数组
|
|
this.finished = true; // 停止加载
|
|
this.finished = true; // 停止加载
|
|
}
|
|
}
|
|
// 若数据条数不等于0
|
|
// 若数据条数不等于0
|
|
- this.dataList.push(...res.data); // 将数据放入list中
|
|
|
|
|
|
+ this.dataList.push(...res.data.list); // 将数据放入list中
|
|
this.loading = false; // 加载状态结束
|
|
this.loading = false; // 加载状态结束
|
|
|
|
|
|
// 如果list长度大于等于总数据条数,数据全部加载完成
|
|
// 如果list长度大于等于总数据条数,数据全部加载完成
|
|
- if (this.dataList.length >= res.data.length) {
|
|
|
|
|
|
+ if (this.dataList.length >= res.data.total) {
|
|
this.finished = true; // 结束加载状态
|
|
this.finished = true; // 结束加载状态
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -174,10 +195,9 @@ export default {
|
|
},
|
|
},
|
|
// change事件可以拿到的是value
|
|
// change事件可以拿到的是value
|
|
handelChange(type, val) {
|
|
handelChange(type, val) {
|
|
- console.log(type, val);
|
|
|
|
- if (type == "checkType") {
|
|
|
|
|
|
+ if (type == "reviewType") {
|
|
// 这里打印出来的值就是我们想要的text
|
|
// 这里打印出来的值就是我们想要的text
|
|
- this.checkTypeTitle = this.checkTypeList.filter(
|
|
|
|
|
|
+ this.reviewTypeTitle = this.reviewTypeList.filter(
|
|
(item) => item.value === val
|
|
(item) => item.value === val
|
|
)[0].text;
|
|
)[0].text;
|
|
}
|
|
}
|
|
@@ -187,6 +207,7 @@ export default {
|
|
(item) => item.value === val
|
|
(item) => item.value === val
|
|
)[0].text;
|
|
)[0].text;
|
|
}
|
|
}
|
|
|
|
+ this.onRefresh();
|
|
},
|
|
},
|
|
backPath() {
|
|
backPath() {
|
|
this.$router.back();
|
|
this.$router.back();
|