From 9e90f6e2e7958310906ccb88489015bbd2bc02b8 Mon Sep 17 00:00:00 2001
From: liubp <1535785116@qq.com>
Date: 星期三, 24 十二月 2025 09:50:05 +0800
Subject: [PATCH] 权限页面完善,我的小区页面权限对接,费用明细详情页面,公共收益金编辑模态框

---
 public/pages/property/costDetail/more/more.js |   77 ++++++++++++++++++++++++++++++++------
 1 files changed, 64 insertions(+), 13 deletions(-)

diff --git a/public/pages/property/costDetail/more/more.js b/public/pages/property/costDetail/more/more.js
index 9d03b81..47ebaa5 100644
--- a/public/pages/property/costDetail/more/more.js
+++ b/public/pages/property/costDetail/more/more.js
@@ -17,10 +17,16 @@
                     pageList: []
                 },
                 jumpPage: 1,
-                currentTab: 'convention',
+                currentTab: 'publicIncome',
                 conditions: {
                     startDate: '',
                     endDate: ''
+                },
+                editForm: {
+                    id: '',
+                    amount: '',
+                    meetingResolution: '1',
+                    consultationForm: '1'
                 }
             }
         },
@@ -57,7 +63,7 @@
                     todayBtn: true,
                     clearBtn: true
                 });
-                
+
                 // 璁剧疆榛樿鏃ユ湡涓哄綋鍓嶆湀浠�
                 var now = new Date();
                 var year = now.getFullYear();
@@ -65,12 +71,12 @@
                 var startDateStr = year + '-' + (month < 10 ? '0' + month : month) + '-01';
                 var endDate = new Date(year, month, 0); // 鑾峰彇褰撴湀鏈�鍚庝竴澶�
                 var endDateStr = year + '-' + (month < 10 ? '0' + month : month) + '-' + endDate.getDate();
-                
+
                 $that.moreInfo.conditions.startDate = startDateStr;
                 $that.moreInfo.conditions.endDate = endDateStr;
                 $(".startDate").val(startDateStr);
                 $(".endDate").val(endDateStr);
-                
+
                 $('.startDate').datetimepicker()
                     .on('changeDate', function (ev) {
                         var value = $(".startDate").val();
@@ -89,17 +95,17 @@
                             $that.moreInfo.conditions.endDate = value;
                         }
                     });
-                
+
                 // 闃叉澶氭鐐瑰嚮鏃堕棿鎻掍欢澶卞幓鐒︾偣
                 var startDateElements = document.getElementsByClassName('form-control startDate');
                 if (startDateElements.length > 0) {
-                    startDateElements[0].addEventListener('click', function(e) {
+                    startDateElements[0].addEventListener('click', function (e) {
                         e.currentTarget.blur();
                     });
                 }
                 var endDateElements = document.getElementsByClassName('form-control endDate');
                 if (endDateElements.length > 0) {
-                    endDateElements[0].addEventListener('click', function(e) {
+                    endDateElements[0].addEventListener('click', function (e) {
                         e.currentTarget.blur();
                     });
                 }
@@ -149,7 +155,7 @@
                 var currentPage = $that.moreInfo.paginationInfo.currentPage;
                 var total = $that.moreInfo.paginationInfo.total;
                 var pageList = [];
-                
+
                 if (total <= 7) {
                     // 鎬婚〉鏁板皬浜庣瓑浜�7锛屾樉绀烘墍鏈夐〉鐮�
                     for (var i = 1; i <= total; i++) {
@@ -230,7 +236,7 @@
                         });
                     }
                 }
-                
+
                 $that.moreInfo.paginationInfo.pageList = pageList;
             },
             _changePageSize: function () {
@@ -260,13 +266,58 @@
                 // 瀵煎嚭鍔熻兘
                 vc.toast('瀵煎嚭鍔熻兘');
             },
-            _viewDetail: function (_item) {
+            _viewDetailPublicIncome: function (_item) {
                 // 鏌ョ湅璇︽儏
                 vc.toast('鏌ョ湅璇︽儏鍔熻兘');
             },
-            _edit: function (_item) {
-                // 缂栬緫
-                vc.toast('缂栬緫鍔熻兘');
+            _showEditPublicModal: function () {
+                const modal = document.getElementById('editPublicIncomeModal');
+                modal.classList.add('show');
+                modal.style.display = 'block';
+                modal.removeAttribute('inert');
+                modal.removeAttribute('aria-hidden');
+                modal.setAttribute('aria-modal', 'true');
+                modal.focus();
+            },
+            _hideEditPublicModal: function () {
+                const modal = document.getElementById('editPublicIncomeModal');
+                modal.classList.remove('show');
+                modal.style.display = 'none';
+                modal.setAttribute('inert', '');
+                modal.setAttribute('aria-hidden', 'true');
+                modal.removeAttribute('aria-modal');
+            },
+            _editPublicIncome: function (_item) {
+                // 缂栬緫 - 濉厖琛ㄥ崟鏁版嵁
+                // $that.moreInfo.editForm.id = _item.id || '';
+                // $that.moreInfo.editForm.amount = _item.amount || '';
+                // $that.moreInfo.editForm.meetingResolution = _item.meetingResolution || '1';
+                // $that.moreInfo.editForm.consultationForm = _item.consultationForm || '1';
+                // 鎵撳紑寮圭獥
+                $that._showEditPublicModal();
+            },
+            _saveEditPublicIncome: function () {
+                // 淇濆瓨缂栬緫
+                var param = {
+                    params: {
+                        id: $that.moreInfo.editForm.id,
+                        amount: $that.moreInfo.editForm.amount,
+                        meetingResolution: $that.moreInfo.editForm.meetingResolution,
+                        consultationForm: $that.moreInfo.editForm.consultationForm,
+                        communityId: vc.getCurrentCommunity().communityId
+                    }
+                };
+                vc.http.apiPost('/costDetail/updatePublicIncome',
+                    param,
+                    function (json, res) {
+                        vc.toast('淇濆瓨鎴愬姛');
+                        $that._hideEditPublicModal();
+                        $that._listData($that.moreInfo.paginationInfo.currentPage, $that.moreInfo.paginationInfo.rows);
+                    },
+                    function (errInfo, error) {
+                        vc.message(errInfo);
+                    }
+                );
             },
             _delete: function (_item) {
                 vc.confirm('纭畾瑕佸垹闄よ繖鏉¤褰曞悧锛�', function () {

--
Gitblit v1.8.0