From c08d1c10fbafd7f57eb51c51269a95c281383ae3 Mon Sep 17 00:00:00 2001
From: liubp <1535785116@qq.com>
Date: 星期五, 26 十二月 2025 18:33:55 +0800
Subject: [PATCH] 公共收益金增删查改
---
public/pages/property/costDetail/detail/detail.js | 38 +++++++++++++++-----------------------
1 files changed, 15 insertions(+), 23 deletions(-)
diff --git a/public/pages/property/costDetail/detail/detail.js b/public/pages/property/costDetail/detail/detail.js
index bcb8f73..0abc7b8 100644
--- a/public/pages/property/costDetail/detail/detail.js
+++ b/public/pages/property/costDetail/detail/detail.js
@@ -28,14 +28,13 @@
},
_initMethod: function () {
$that = vc.component;
- // 浠嶶RL鑾峰彇costDetailId
var costDetailId = vc.getParam('costDetailId');
if (costDetailId) {
$that.costDetailInfo.costDetailId = costDetailId;
$that._loadCostDetail();
} else {
vc.toast('缂哄皯璐圭敤鏄庣粏ID');
- setTimeout(function() {
+ setTimeout(function () {
vc.goBack();
}, 1500);
}
@@ -44,31 +43,29 @@
},
methods: {
_loadCostDetail: function () {
- // 鏌ヨ鎵�鏈夋暟鎹紝鐒跺悗鎵惧埌鍖归厤鐨勮褰�
var params = {
communityName: vc.getCurrentCommunity().name,
page: 1,
- row: 1000 // 鏌ヨ瓒冲澶氱殑鏁版嵁浠ユ壘鍒扮洰鏍囪褰�
+ row: 1000
};
-
+
var param = {
params: params
};
-
+
console.log('寮�濮嬪姞杞借垂鐢ㄦ槑缁嗚鎯咃紝ID:', $that.costDetailInfo.costDetailId);
-
+
vc.http.apiGet('/maintenancePayment/queryMaintenancePayment',
param,
function (json, res) {
try {
var _json = JSON.parse(json);
console.log('API杩斿洖鏁版嵁:', _json);
-
+
if (_json.code === 0 && _json.data) {
var records = Array.isArray(_json.data) ? _json.data : [];
console.log('鏌ヨ鍒拌褰曟暟:', records.length);
-
- // 鏌ユ壘鍖归厤鐨勮褰� - 鏀寔瀛楃涓插拰鏁板瓧绫诲瀷鐨処D姣旇緝
+
var foundItem = null;
var targetId = String($that.costDetailInfo.costDetailId);
for (var i = 0; i < records.length; i++) {
@@ -80,21 +77,21 @@
break;
}
}
-
+
if (foundItem) {
$that._fillDetailData(foundItem);
console.log('璇︽儏鏁版嵁宸插~鍏�:', $that.costDetailInfo);
} else {
console.error('鏈壘鍒板尮閰嶇殑璁板綍锛岀洰鏍嘔D:', $that.costDetailInfo.costDetailId);
vc.toast('鏈壘鍒拌璐圭敤鏄庣粏锛孖D: ' + $that.costDetailInfo.costDetailId);
- setTimeout(function() {
+ setTimeout(function () {
vc.goBack();
}, 1500);
}
} else {
console.error('API杩斿洖閿欒:', _json);
vc.toast(_json.msg || '鏈壘鍒拌璐圭敤鏄庣粏');
- setTimeout(function() {
+ setTimeout(function () {
vc.goBack();
}, 1500);
}
@@ -111,23 +108,19 @@
},
_fillDetailData: function (item) {
console.log('寮�濮嬪~鍏呰鎯呮暟鎹紝鍘熷鏁版嵁:', item);
-
- // 濉厖璇︽儏鏁版嵁
+
var dateStr = '';
if (item.date) {
- // 濡傛灉鏃ユ湡鏍煎紡鏄� yyyy-mm-dd 鎴� yyyy-mm-dd HH:mm:ss锛屽彧鍙栨棩鏈熼儴鍒�
dateStr = item.date.substring(0, 10);
} else if (item.year && item.month) {
var monthStr = item.month < 10 ? '0' + item.month : String(item.month);
var dayStr = item.day ? (item.day < 10 ? '0' + item.day : String(item.day)) : '01';
dateStr = item.year + '-' + monthStr + '-' + dayStr;
} else if (item.year && item.month) {
- // 鍙湁骞存湀鐨勬儏鍐�
var monthStr = item.month < 10 ? '0' + item.month : String(item.month);
dateStr = item.year + '-' + monthStr;
}
-
- // 浣跨敤Vue.set鎴栬�呯洿鎺ヨ祴鍊兼潵纭繚鍝嶅簲寮忔洿鏂�
+
vc.component.costDetailInfo.flowCode = item.flowNumber || '';
vc.component.costDetailInfo.date = dateStr;
vc.component.costDetailInfo.communityName = item.projectName || '';
@@ -141,19 +134,18 @@
vc.component.costDetailInfo.approvalDepartment = item.reportDepartment || '';
vc.component.costDetailInfo.fundTypeLevel1 = item.fundTypeLevel1 || '';
vc.component.costDetailInfo.fundTypeLevel2 = item.fundTypeLevel2 || '';
-
- // 澶勭悊buildingType瀛楁
+
var buildingType = item.buildingOrAll || '1';
if (buildingType === '鍏ㄤ綋' || buildingType === '2' || buildingType === 2) {
vc.component.costDetailInfo.buildingType = '鍏ㄤ綋';
} else {
vc.component.costDetailInfo.buildingType = '1';
}
-
+
vc.component.costDetailInfo.maintenanceType = item.maintenanceType || '';
vc.component.costDetailInfo.ownerScope = item.ownerScope || '';
vc.component.costDetailInfo.buildingScope = item.buildingScope || '';
-
+
console.log('璇︽儏鏁版嵁濉厖瀹屾垚:', vc.component.costDetailInfo);
},
_goBack: function () {
--
Gitblit v1.8.0