From c1fd6952f42461bc7e83c97f594a52fc1af934eb Mon Sep 17 00:00:00 2001
From: liubp <1535785116@qq.com>
Date: 星期四, 25 十二月 2025 18:15:43 +0800
Subject: [PATCH] 费用明细表,查询,编辑,删除,添加接口对接,公益金表接口对接,页面样式优化

---
 public/pages/property/costDetail/add/add.js |  110 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 107 insertions(+), 3 deletions(-)

diff --git a/public/pages/property/costDetail/add/add.js b/public/pages/property/costDetail/add/add.js
index 369a818..e4907fb 100644
--- a/public/pages/property/costDetail/add/add.js
+++ b/public/pages/property/costDetail/add/add.js
@@ -1,9 +1,113 @@
-
+/**
+ 娣诲姞璐圭敤鏄庣粏
+ **/
 (function (vc) {
+    var $that = {};
     vc.extends({
         data: {
-            fundType: 'repair', // 榛樿閫変腑缁翠慨璧勯噾
-            fundSystemType: 'out' // 榛樿閫変腑绯荤粺澶�
+            costDetailInfo: {
+                flowCode: '',
+                date: '',
+                communityName: '',
+                communityCode: '',
+                projectContent: '',
+                managementAmount: '',
+                managementStamped: '1',
+                committeeAmount: '',
+                appraisalAmount: '',
+                committeeStamped: '1',
+                approvalDepartment: '',
+                fundTypeLevel1: '',
+                fundTypeLevel2: '',
+                buildingType: '1',
+                maintenanceType: '',
+                fundType: 'repair', // 榛樿閫変腑缁翠慨璧勯噾
+                fundSystemType: 'out' // 榛樿閫変腑绯荤粺澶�
+            }
+        },
+        _initMethod: function () {
+            $that = vc.component;
+        },
+        methods: {
+            _saveCostDetail: function () {
+                // 楠岃瘉蹇呭~瀛楁
+                if (!$that.costDetailInfo.flowCode) {
+                    vc.toast('璇疯緭鍏ユ祦杞紪鐮�');
+                    return;
+                }
+                if (!$that.costDetailInfo.date) {
+                    vc.toast('璇烽�夋嫨鏃ユ湡');
+                    return;
+                }
+                if (!$that.costDetailInfo.communityName) {
+                    vc.toast('璇疯緭鍏ュ皬鍖哄悕绉�');
+                    return;
+                }
+                if (!$that.costDetailInfo.communityCode) {
+                    vc.toast('璇疯緭鍏ュ皬鍖虹紪鐮�');
+                    return;
+                }
+                
+                // 鏋勫缓淇濆瓨鏁版嵁
+                var saveData = {
+                    flowNumber: $that.costDetailInfo.flowCode,
+                    date: $that.costDetailInfo.date,
+                    projectName: $that.costDetailInfo.communityName,
+                    projectCode: $that.costDetailInfo.communityCode,
+                    projectContent: $that.costDetailInfo.projectContent,
+                    managementOfficeAmount: parseFloat($that.costDetailInfo.managementAmount) || 0,
+                    managementOfficeSeal: $that.costDetailInfo.managementStamped === '1' ? '鏄�' : '鍚�',
+                    ownersCommitteeAmount: parseFloat($that.costDetailInfo.committeeAmount) || 0,
+                    auditAmount: parseFloat($that.costDetailInfo.appraisalAmount) || 0,
+                    ownersCommitteeSeal: $that.costDetailInfo.committeeStamped === '1' ? '鏄�' : '鍚�',
+                    reportDepartment: $that.costDetailInfo.approvalDepartment || '',
+                    fundTypeLevel1: $that.costDetailInfo.fundType === 'repair' ? '缁翠慨璧勯噾' : '鍏叡鏀剁泭',
+                    fundTypeLevel2: $that.costDetailInfo.fundType === 'public' ? ($that.costDetailInfo.fundSystemType === 'out' ? '绯荤粺澶�' : '绯荤粺鍐�') : '',
+                    buildingOrAll: $that.costDetailInfo.buildingType === '鍏ㄤ綋' ? '鍏ㄤ綋' : ($that.costDetailInfo.buildingType || '1'),
+                    maintenanceType: $that.costDetailInfo.maintenanceType || '',
+                    communityId: vc.getCurrentCommunity().communityId
+                };
+                
+                // 瑙f瀽鏃ユ湡
+                if (saveData.date) {
+                    var dateParts = saveData.date.split('-');
+                    if (dateParts.length >= 2) {
+                        saveData.year = parseInt(dateParts[0]);
+                        saveData.month = parseInt(dateParts[1]);
+                        if (dateParts.length >= 3) {
+                            saveData.day = parseInt(dateParts[2]);
+                        }
+                    }
+                }
+                vc.http.apiPost('/maintenancePayment/saveMaintenancePayment',
+                    JSON.stringify(saveData), {
+                        emulateJSON: true
+                    },
+                    function (json, res) {
+                        try {
+                            var _json = JSON.parse(json);
+                            if (_json.code === 0 || _json.code === '0') {
+                                vc.toast('淇濆瓨鎴愬姛');
+                                setTimeout(function() {
+                                    vc.goBack();
+                                }, 1000);
+                            } else {
+                                vc.toast(_json.msg || '淇濆瓨澶辫触');
+                            }
+                        } catch (e) {
+                            console.error('淇濆瓨鍝嶅簲瑙f瀽澶辫触:', e);
+                            vc.toast('淇濆瓨澶辫触');
+                        }
+                    },
+                    function (errInfo, error) {
+                        console.error('淇濆瓨璇锋眰澶辫触:', errInfo, error);
+                        vc.toast('淇濆瓨澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�');
+                    }
+                );
+            },
+            _cancel: function () {
+                vc.goBack();
+            }
         }
     });
 })(window.vc);

--
Gitblit v1.8.0