123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- <template>
- <div class="secureselftest">
- <div class="list">
- <!-- <div v-if="todoList.length == 0"> -->
- <div
- class="list-row"
- v-for="(item, index) in todoList"
- @click="junmpMyMechantsDetails(item.routeParam, item.handleType)"
- :key="index"
- >
- <div class="cell_1">
- <div class="width100 height44rpx mb16rpx">
- <div class="first_title">
- {{ item.title }}
- </div>
- </div>
- <div class="width100 height40rpx">
- <div class="second_title" style="width: 100%">
- {{ item.createdAt }}
- </div>
- </div>
- </div>
- </div>
- <!-- </div> -->
- <!-- <div v-else> -->
- <van-empty
- v-if="todoList.length == 0"
- class="disblock marginauto"
- style="background: white"
- description="暂无数据"
- />
- <!-- </div> -->
- </div>
- </div>
- </template>
-
- <script>
- import { handleList, getByCodes, getUserLocalStorageInfo } from "@/js_sdk/http";
- import vanEmpty from "../../../wxcomponents/weapp/dist/empty/index";
- export default {
- components: {
- vanEmpty,
- },
- data() {
- return {
- dic_key: ["safety_inspection_type"],
- dic_SelectList: {},
- active: 0,
- todoList: [],
- search: {
- pageSize: 10,
- pageNum: 1,
- types: "8,9,10",
- userId: "",
- },
- statusList: [
- { label: "全部", value: null },
- { label: "电梯自检", value: "1" },
- { label: "消防自检", value: "2" },
- { label: "电柜检查", value: "3" },
- { label: "电器线路", value: "4" },
- ],
- };
- },
- onShow() {
- // this.getByCodes();
- this.search.userId = getUserLocalStorageInfo().user.id;
- this.gettodoList();
- },
- methods: {
- getDicType(value) {
- if (!value) return "未知类型";
- let safety_inspection_type = this.dic_SelectList.safety_inspection_type;
- let index = safety_inspection_type.findIndex((e) => e.value == value);
- return safety_inspection_type[index].label;
- },
- junmpMyMechantsDetails(routeParam, type) {
- console.log(routeParam, type);
- if (type == 8) {
- uni.navigateTo({
- rl: "/pages/subPackages/repairprocessing-app/detail?id=" + routeParam,
- });
- }
- if (type == 9) {
- let param = routeParam.split(",");
- console.log(param);
- if (param[0] == "报事报修待派单") {
- console.log("报事报修待派单");
- uni.navigateTo({
- url: "/pages/subPackages/repairDispatch-app/detail?id=" + param[1],
- });
- }
- if (param[0] == "报事报修待处理") {
- console.log("报事报修待处理");
- uni.navigateTo({
- url:
- "/pages/subPackages/repairprocessing-app/detail?id=" + param[1],
- });
- }
- }
- if (type == 10) {
- uni.navigateTo({
- url: "/pages/subPackages/meetingroom/audit?" + routeParam,
- });
- }
- },
- jumpReport() {
- uni.navigateTo({
- url: "/pages/subPackages/secureselftest/report?id=" + null,
- });
- },
- async getMoreListData() {
- let that = this;
- that.search.pageNum = that.search.pageNum + 1;
- let list = await handleList(that.search);
- if (list.rows == 0) {
- that.$showToast("没有更多数据了");
- } else {
- list.rows.forEach((e) => {
- that.todoList.push(e);
- });
- }
- },
- onReachBottom() {
- this.getMoreListData();
- }, //下拉执行的时候触发 (下拉刷新)
- onChange(e) {
- this.search.type = e.detail.name == null ? "" : e.detail.name;
- this.gettodoList();
- },
- endDate() {
- return this.getDate("end");
- },
- startDate() {
- return this.getDate("start");
- },
- async getByCodes() {
- let data = await getByCodes(JSON.stringify(this.dic_key));
- this.dic_SelectList = this.$common.handleDicList(data);
- this.gettodoList();
- },
- getDate(type) {
- const date = new Date();
- let year = date.getFullYear();
- let month = date.getMonth() + 1;
- let day = date.getDate();
- if (type === "start") {
- year = year - 60;
- } else if (type === "end") {
- year = year + 2;
- }
- month = month > 9 ? month : "0" + month;
- day = day > 9 ? day : "0" + day;
- return `${year}-${month}-${day}`;
- },
- async gettodoList() {
- this.search.pageSize = 10;
- this.search.pageNum = 1;
- let list = await handleList(this.search);
- // /wx/SafetyController/handleList
- this.todoList = list.rows;
- },
- jumpAddCompanyPage() {
- uni.navigateTo({
- url: "/pages/subPackages/addCompany/addCompany",
- });
- },
- jumpPage(e) {
- uni.navigateTo({
- url: "/pages/subPackages/companyDetails/companyDetails?id=" + e,
- });
- },
- },
- };
- </script>
-
-
- <style lang="scss">
- .chooseyears {
- width: 326rpx;
- height: 56rpx;
- background: rgba(29, 24, 188, 0.05);
- border-radius: 8rpx 8rpx 8rpx 8rpx;
- text-align: center;
- line-height: 56rpx;
- display: flex;
- color: #1d18bc;
- }
- .searchbox {
- display: block;
- background: white;
- }
- .chaochuyincang {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .secureselftest {
- .custom-class {
- background: white;
- }
- }
- </style>
-
-
-
|