zhanghua
8 天以前 7c20fd15b7fbc2bd5756b39d5ab655cc849ffcc3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<template>
  <el-container style="height: 100%">
    <el-aside heigth="100%" width="200px ">
      <myAside @selectedDepartment="selectedDepartment" />
    </el-aside>
 
    <el-container>
      <store-content :model="'three-pack'" />
    </el-container>
  </el-container>
</template>
<script>
import myAside from "./components/aside";
import updateUser from "@/views/operate/fivepack/threepack/components/updateUser";
import storeContent from "@/views/operate/fivepack/threepack/components/content";
import {
  getStoreInfoList,
  deleteStoreInfo,
} from "@/api/operate/storeManagement";
 
export default {
  components: { myAside, storeContent, updateUser },
 
  created() {
    this.search();
  },
 
  data() {
    return {
      storeCode: null,
      storeStatus: null,
      options: [
        { label: "全部", value: 0 },
        { label: "经营", value: 1 },
        { label: "倒闭", value: 2 },
      ],
      tableData: [],
      dialogUpdate: false,
      currentPage: 1,
      totalNum: 0,
      pageSize: 10,
      userInfo: null,
      updateFlag: false,
      storeInfo: null,
    };
  },
 
  methods: {
    search(data) {
      let communityId, streetId;
      if (data) {
        communityId = data.id;
        streetId = data.parentId;
      }
      getStoreInfoList({ keyword: this.storeCode, communityId, streetId })
        .then(({ list, pageSize, totalPage }) => {
          this.tableData = list;
          this.pageSize = pageSize;
          this.totalNum = totalPage;
        })
        .catch((err) => this.$message({ type: "error", message: err }));
    },
 
    handleReset() {
      this.storeCode = "";
      this.storeStatus = null;
      this.currentPage = 1;
      this.search();
    },
 
    handleView(row, type) {
      this.dialogUpdate = true;
      this.storeInfo = row;
      this.updateFlag = type === "update";
    },
 
    handleDelete(id) {
      deleteStoreInfo(id)
        .then(() => {
          this.$message({ type: "success", message });
          this.currentPage = 1;
          this.search();
        })
        .catch((err) => this.$message({ type: "error", message: err }));
    },
 
    handleClose() {
      this.dialogUpdate = false;
    },
 
    closeDialog() {
      this.dialogUpdate = false;
      this.currentPage = 1;
      this.search();
    },
 
    changeCurrentPage(currentPage) {
      this.currentPage = currentPage;
      this.search();
    },
 
    tableRowClassName({ row, rowIndex }) {
      if ((rowIndex + 1) % 2 === 0) {
        return "warning-row";
      } else {
        return "success-row";
      }
    },
    selectedDepartment(data) {
      if (!data.children) {
        this.searchData = data;
        this.search(data);
      } else {
        data.parentId = data.id;
        data.id = null;
        this.searchData = data;
        this.search(data);
      }
      this.currentPage = 1;
    },
  },
};
</script>
<style lang="scss" scoped>
::v-deep .el-header {
  // background-color: #09152f;
  color: #000;
  line-height: 60px;
}
 
// ::v-deep .el-aside {
  // background-color: #09152f;
// }
 
// ::v-deep .el-menu {
  // background-color: #09152f;
// }
 
// ::v-deep .el-main,
// ::v-deep .el-footer {
//   background-color: #09152f;
// }
 
::v-deep .el-tree-node__label {
  line-height: 30px;
  font-size: 14px;
  // color: rgb(75, 155, 183);
}
</style>