Commit af4f57bfb78d25e0a9e444cf9ce8b063c10fb9aa

Authored by 杨泽宇
1 parent ae23ae81

物业费

Showing 1 changed file with 32 additions and 52 deletions
src/views/fee/index.vue
... ... @@ -106,7 +106,6 @@ let data = reactive({
106 106 * @param {array} data 选中的一条数据
107 107 */
108 108 const handleSelectionChange = (data: array) => {
109   - console.log(data);
110 109 multipleSelection.value = data;
111 110 };
112 111 /**
... ... @@ -138,8 +137,6 @@ const handleChange = (value: number, pageSize: number) => {
138 137 pageSize: pageSize,
139 138 type: 0,
140 139 }).then((res) => {
141   - console.log("楼宇");
142   - console.log(res);
143 140 data.buildings = res?.data?.data?.list;
144 141 if (res?.data?.data?.total > pageSize) {
145 142 handleChange(value, res?.data?.data?.total);
... ... @@ -161,12 +158,9 @@ const paper = (obj: any) => {
161 158 const handleBuildingChange = (value: number) => {
162 159 getList();
163 160 if (value) {
164   - console.log(value);
165 161 getUnitList({
166 162 buildingId: value,
167 163 }).then((res) => {
168   - console.log("单元");
169   - console.log(res);
170 164 data.units = res?.data?.data;
171 165 });
172 166 }
... ... @@ -194,7 +188,6 @@ const handleDelete = (obj: any) => {
194 188 type: "warning",
195 189 })
196 190 .then(async () => {
197   - console.log("post delete");
198 191 try {
199 192 let res = await propertyFeeDelete({
200 193 ids: obj.id,
... ... @@ -226,7 +219,6 @@ const getList = async () => {
226 219 data.loading = true;
227 220 try {
228 221 const res = await propertyFeeList(data.params.query);
229   - console.log(res.data.data);
230 222 data.list = res?.data?.data?.list?.list;
231 223 data.params.total = res?.data?.data?.list?.total;
232 224 // 一键确认按钮上的总金额数
... ... @@ -244,7 +236,7 @@ const reset = () => {
244 236 data.params.query = {};
245 237 data.params.query.page = 1;
246 238 data.params.query.pageSize = 10;
247   - getList()
  239 + getList();
248 240 };
249 241 /**
250 242 * 下载模板
... ... @@ -256,20 +248,14 @@ const download = () => {
256 248 * 导出文件
257 249 */
258 250 const exportFile = () => {
259   - console.log("export");
260   - propertyFeeExport(data.params.query).then((res) => {
261   - console.log(res)
262   - exportData(res, `物业费`)
263   - }).catch(error => {
264   - console.log(error)
265   - exportData(error, `物业费`)
266   - })
267   -};
268   -/**
269   - * 导入文件
270   - */
271   -const importFile = () => {
272   - console.log("import");
  251 + propertyFeeExport(data.params.query)
  252 + .then((res) => {
  253 + exportData(res, `物业费`);
  254 + })
  255 + .catch((error) => {
  256 + console.log(error);
  257 + exportData(error, `物业费`);
  258 + });
273 259 };
274 260 /**
275 261 * 确认
... ... @@ -286,7 +272,6 @@ const sure = () => {
286 272 }
287 273 )
288 274 .then((res) => {
289   - console.log("goes api");
290 275 propertyFeeSure({
291 276 ids: multipleSelection.value.map((i) => i.id).join(","),
292 277 }).then((res) => {
... ... @@ -312,8 +297,6 @@ const sure = () => {
312 297 * 一键确认
313 298 */
314 299 const sureAll = () => {
315   - console.log("sureall");
316   - console.log(data.params.query);
317 300 let msg = `是否确认将${
318 301 data.params.query.neighborhoodId ? data.list[0].nbhdName : "全部小区"
319 302 }${data.params.query.buildingId ? data.list[0].buildingName : ""}${
... ... @@ -325,21 +308,20 @@ const sureAll = () => {
325 308 type: "warning",
326 309 })
327 310 .then((res) => {
328   - console.log("goes api");
329   - propertyFeeSureFast(data.params.query).then(res => {
330   - if(res) {
  311 + propertyFeeSureFast(data.params.query).then((res) => {
  312 + if (res.data.data !== false) {
331 313 ElMessage({
332   - type: 'success',
333   - message: '操作成功'
334   - })
335   - getList()
  314 + type: "success",
  315 + message: "操作成功",
  316 + });
  317 + getList();
336 318 } else {
337 319 ElMessage({
338   - type: 'error',
339   - message: '操作失败'
340   - })
  320 + type: "error",
  321 + message: "操作失败",
  322 + });
341 323 }
342   - })
  324 + });
343 325 })
344 326 .catch((error) => {
345 327 console.log(error);
... ... @@ -351,7 +333,6 @@ const sureAll = () => {
351 333 * @param {number} type 1为现金缴费,0为撤销现金缴费
352 334 */
353 335 const shiftPayment = (obj: any, type: number) => {
354   - console.log("变更付费状态");
355 336 let msg = `是否将【${obj.nbhdName}】小区【${obj.buildingName}】【${
356 337 obj.unitNumber
357 338 }】单元【${obj.roomNumber}】房间账单${type ? "设置为" : "撤回"}现金缴费?`;
... ... @@ -361,15 +342,13 @@ const shiftPayment = (obj: any, type: number) => {
361 342 type: "warning",
362 343 })
363 344 .then((res) => {
364   - console.log("goes api");
365 345 propertyFeeShift({
366 346 id: obj.id,
367 347 })
368 348 .then((res) => {
369   - console.log("现金缴费");
370   - console.log(res);
371 349 if (res) {
372 350 instance?.proxy?.$message.success("操作成功");
  351 + getList();
373 352 } else {
374 353 instance?.proxy?.$message.error("操作失败");
375 354 }
... ... @@ -392,8 +371,6 @@ const handleClose = () => {
392 371 * 编辑
393 372 */
394 373 const edit = (obj: any) => {
395   - console.log("编辑");
396   - console.log(obj);
397 374 form.data = obj;
398 375 form.data.period = [obj.beginTime, obj.endTime];
399 376 form.visible = true;
... ... @@ -419,12 +396,8 @@ const submitForm = (formEl: InstanceType<typeof ElForm> | undefined) => {
419 396 if (!formEl) return;
420 397 formEl.validate(async (valid) => {
421 398 if (valid) {
422   - console.log("ok post");
423   - console.log(form.data);
424 399 propertyFeeSave(form.data)
425 400 .then((res) => {
426   - console.log("表单提交");
427   - console.log(res);
428 401 getList();
429 402 form.visible = false;
430 403 })
... ... @@ -446,8 +419,6 @@ const getData = (pageSize = 100) => {
446 419 pageSize: pageSize,
447 420 type: 0,
448 421 }).then((res) => {
449   - console.log("小区列表");
450   - console.log(res);
451 422 data.neighborhoods = res?.data?.data?.list;
452 423 if (res?.data?.data?.total > pageSize) {
453 424 getData(res?.data?.data?.total);
... ... @@ -554,6 +525,7 @@ onMounted(() => {
554 525 <el-date-picker
555 526 v-model="data.params.query.endTime"
556 527 type="month"
  528 + @change="getList"
557 529 placeholder="到期月份"
558 530 />
559 531 </el-form-item>
... ... @@ -585,8 +557,16 @@ onMounted(() =&gt; {
585 557 <el-form-item>
586 558 <el-button type="primary" @click="exportFile">导出</el-button>
587 559 <el-button type="primary" @click="download">下载模板</el-button>
588   - <el-button type="success" @click="sure" :disabled="!multipleSelection.length">确认</el-button>
589   - <el-button type="success" @click="sureAll" :disabled="!data.list.length"
  560 + <el-button
  561 + type="success"
  562 + @click="sure"
  563 + :disabled="!multipleSelection.length"
  564 + >确认</el-button
  565 + >
  566 + <el-button
  567 + type="success"
  568 + @click="sureAll"
  569 + :disabled="!data.list.length"
590 570 >一键确认(总计:{{ data.totals }}¥)</el-button
591 571 >
592 572 <el-button
... ... @@ -696,7 +676,7 @@ onMounted(() =&gt; {
696 676 <el-button
697 677 type="text"
698 678 @click="shiftPayment(scope.row, 1)"
699   - v-show="~~scope.row.payStatus === 0"
  679 + v-show="~~scope.row.payStatus === 0 && ~~scope.row.status === 1"
700 680 >现金缴费</el-button
701 681 >
702 682 <el-button
... ...