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