Commit 4b392ae959330a8c53dd622e5faaf2e4889e0322

Authored by 杨泽宇
1 parent 098a9802

debug

src/views/property/edit.vue
... ... @@ -158,9 +158,8 @@ const submitForm = (formEl: InstanceType<typeof ElForm> | undefined) => {
158 158 };
159 159 /**
160 160 * 小区列表
161   - * @param {number | null} pageSize 一次请求多少条数据
162 161 */
163   -const getCommunityList = async (pageSize: number = 20) => {
  162 +const getCommunityList = async () => {
164 163 try {
165 164 const res = await allNeighborhood();
166 165 form.communities = res?.data?.data;
... ...
src/views/repair/index.vue
... ... @@ -2,6 +2,7 @@
2 2 import { reactive, ref, onMounted, getCurrentInstance } from "vue";
3 3 import { repairList } from "@/api/notify/repair";
4 4 import { getTableList } from "@/api/notify/maintain.ts";
  5 +import { allNeighborhood } from "@/api/community/residence";
5 6 import { parseTime, globalFilters } from "@/utils/tool";
6 7 import Pagination from "@/components/Pagination/index.vue";
7 8 import { ElMessageBox } from "element-plus";
... ... @@ -26,6 +27,7 @@ interface Data {
26 27 loading: boolean;
27 28 list: any[];
28 29 projects: any[];
  30 + communities: any[];
29 31 status: any[];
30 32 params: Params;
31 33 }
... ... @@ -33,6 +35,7 @@ const value1 = ref([]);
33 35 let data: Data = reactive({
34 36 list: [],
35 37 projects: [],
  38 + communities: [],
36 39 status: status,
37 40 loading: false,
38 41 params: {
... ... @@ -51,6 +54,17 @@ let data: Data = reactive({
51 54 },
52 55 });
53 56 /**
  57 + * 小区列表
  58 + */
  59 +const getCommunityList = async () => {
  60 + try {
  61 + const res = await allNeighborhood();
  62 + data.communities = res?.data?.data;
  63 + } catch (e) {
  64 + console.log(e);
  65 + }
  66 +};
  67 +/**
54 68 * 列表
55 69 */
56 70 const getList = async () => {
... ... @@ -83,7 +97,7 @@ const getProjects = async (pageSize: number = 20) => {
83 97 const res = await getTableList({
84 98 page: 1,
85 99 pageSize: pageSize,
86   - oid:store?.family?.loginStore()?.organizationId??0
  100 + oid: store?.family?.loginStore()?.organizationId ?? 0,
87 101 });
88 102 data.projects = res?.data?.data?.list;
89 103 if (res?.data?.data?.total > pageSize) {
... ... @@ -92,7 +106,7 @@ const getProjects = async (pageSize: number = 20) => {
92 106 } catch (e) {
93 107 console.log(e);
94 108 }
95   -}
  109 +};
96 110 /**
97 111 * 获取维修项目名
98 112 * @param {string} ids 维修项目id串
... ... @@ -120,6 +134,7 @@ enum payTypeEnum {
120 134 "支付宝",
121 135 }
122 136 onMounted(() => {
  137 + getCommunityList();
123 138 getProjects();
124 139 getList();
125 140 });
... ... @@ -193,7 +208,7 @@ onMounted(() => {
193 208 <el-input
194 209 v-model.trim="data.params.query.id"
195 210 placeholder="请填写订单号"
196   - maxlength="15"
  211 + maxlength="50"
197 212 @change="getList"
198 213 />
199 214 </el-form-item>
... ... @@ -218,6 +233,12 @@ onMounted(() =&gt; {
218 233 <el-table-column prop="id" label="订单编号" align="center">
219 234 </el-table-column>
220 235 <el-table-column prop="neighboorHoodId" label="小区" align="center">
  236 + <template #default="scope">
  237 + {{
  238 + data.communities.find((i) => ~~i.id === ~~scope.row.neighboorHoodId)
  239 + ?.name ?? scope.row.neighboorHoodId
  240 + }}
  241 + </template>
221 242 </el-table-column>
222 243 <el-table-column prop="repairProject" label="报修项目" align="center">
223 244 <template #default="scope">
... ...