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/costDetail.js | 256 +++++++++--
public/vcCore/vcFramework.js | 13
public/pages/property/costDetail/detail/detail.html | 57 +-
public/pages/property/costDetail/more/more.html | 6
public/pages/property/costDetail/add/add.html | 54 +-
public/pages/property/costDetail/costDetail.html | 66 +-
public/pages/property/costDetail/edit/edit.html | 54 +-
public/pages/property/costDetail/add/add.js | 110 +++++
public/pages/property/costDetail/edit/edit.js | 243 +++++++++++
public/pages/property/costDetail/more/more.js | 133 ++++++
public/css/vc.css | 43 +
public/vcCore/core.js | 13
public/pages/property/costDetail/detail/detail.js | 165 +++++++
13 files changed, 1,010 insertions(+), 203 deletions(-)
diff --git a/public/css/vc.css b/public/css/vc.css
index 4a1cdf3..0db6a65 100644
--- a/public/css/vc.css
+++ b/public/css/vc.css
@@ -1380,7 +1380,7 @@
width: 100%;
border-collapse: collapse;
border: 1px solid #e8e8e8;
- font-size: 14px;
+ font-size: 12px;
background: #fff;
margin-bottom: 0;
}
@@ -1416,7 +1416,7 @@
.cost-detail-container table td a {
color: #1677ff;
text-decoration: none;
- margin-right: 12px;
+ margin-right: 10px;
cursor: pointer;
white-space: nowrap;
}
@@ -1607,6 +1607,45 @@
cursor: pointer;
}
+.form-container .form-row .form-label {
+ padding: 12px 0 15px 0;
+ margin: 0px;
+ font-size: 14px;
+ font-weight: 600;
+ color: #333;
+ text-align: right;
+ vertical-align: middle;
+ line-height: 32px;
+}
+
+.form-label-detail{
+ padding: 0px 0 15px 0;
+ margin: 0px;
+ font-size: 14px;
+ font-weight: 600;
+ color: #333;
+ text-align: right;
+ vertical-align: middle;
+ line-height: 32px;
+}
+
+.form-container .form-row p {
+ margin-right: 15px;
+}
+
+#ownerScope{
+ position: relative;
+ top: 12px;
+ width: 180px;
+ height: 32px;
+}
+#buildingScope{
+ position: relative;
+ top: 12px;
+ width: 180px;
+ height: 32px;
+}
+
#button-container,
#data-container {
display: flex;
diff --git a/public/pages/property/costDetail/add/add.html b/public/pages/property/costDetail/add/add.html
index 94a2b75..53c2294 100644
--- a/public/pages/property/costDetail/add/add.html
+++ b/public/pages/property/costDetail/add/add.html
@@ -4,35 +4,35 @@
<!-- 娴佽浆缂栫爜 + 鏃ユ湡 -->
<div class="form-row">
<label class="form-label" for="flowCode">娴佽浆缂栫爜</label>
- <input type="text" id="flowCode" class="form-input" placeholder="璇疯緭鍏�">
+ <input type="text" id="flowCode" class="form-input" placeholder="璇疯緭鍏�" v-model="costDetailInfo.flowCode">
<label class="form-label" for="date">鏃ユ湡</label>
- <input type="date" id="date" class="form-input" placeholder="yyyy/mm/鏃�">
+ <input type="date" id="date" class="form-input" placeholder="yyyy/mm/鏃�" v-model="costDetailInfo.date">
</div>
<!-- 灏忓尯鍚嶇О + 灏忓尯缂栫爜锛堝甫澶囨敞锛� -->
<div class="form-row">
<label class="form-label" for="communityName">灏忓尯鍚嶇О</label>
- <input type="text" id="communityName" class="form-input" placeholder="璇疯緭鍏�">
+ <input type="text" id="communityName" class="form-input" placeholder="璇疯緭鍏�" v-model="costDetailInfo.communityName">
<label class="form-label">灏忓尯缂栫爜</label>
- <input type="text" id="communityCode" class="form-input" placeholder="璇疯緭鍏�">
+ <input type="text" id="communityCode" class="form-input" placeholder="璇疯緭鍏�" v-model="costDetailInfo.communityCode">
</div>
<!-- 宸ョ▼鍐呭 -->
<div class="form-row">
<label class="form-label" for="projectContent">宸ョ▼鍐呭</label>
- <input type="text" id="projectContent" class="form-input" placeholder="璇疯緭鍏�" style="width: 555px;">
+ <input type="text" id="projectContent" class="form-input" placeholder="璇疯緭鍏�" style="width: 555px;" v-model="costDetailInfo.projectContent">
</div>
<!-- 绠$悊澶勯噾棰� + 鏄惁鐩栫珷 -->
<div class="form-row">
<label class="form-label" for="mgmtAmount">绠$悊澶勯噾棰�</label>
- <input type="text" id="mgmtAmount" class="form-input" placeholder="璇疯緭鍏�">
+ <input type="text" id="mgmtAmount" class="form-input" placeholder="璇疯緭鍏�" v-model="costDetailInfo.managementAmount">
<span>鍏�</span>
<label class="form-label">鏄惁鐩栫珷</label>
<div class="radio-group">
- <input type="radio" id="mgmtSealYes" name="mgmtSeal" checked>
+ <input type="radio" id="mgmtSealYes" name="mgmtSeal" value="1" v-model="costDetailInfo.managementStamped">
<label for="mgmtSealYes" style="margin-top: 8px;">鏄�</label>
- <input type="radio" id="mgmtSealNo" name="mgmtSeal">
+ <input type="radio" id="mgmtSealNo" name="mgmtSeal" value="0" v-model="costDetailInfo.managementStamped">
<label for="mgmtSealNo" style="margin-top: 8px;">鍚�</label>
</div>
</div>
@@ -40,49 +40,43 @@
<!-- 涓氬浼氶噾棰� + 瀹′环閲戦 + 鏄惁鐩栫珷 + 绛炬姤閮ㄩ棬 -->
<div class="form-row">
<label class="form-label" for="committeeAmount">涓氬浼氶噾棰�</label>
- <input type="text" id="committeeAmount" class="form-input" placeholder="璇疯緭鍏�">
+ <input type="text" id="committeeAmount" class="form-input" placeholder="璇疯緭鍏�" v-model="costDetailInfo.committeeAmount">
<span>鍏�</span>
<label class="form-label" for="auditAmount">瀹′环閲戦</label>
- <input type="text" id="auditAmount" class="form-input" placeholder="璇疯緭鍏�">
+ <input type="text" id="auditAmount" class="form-input" placeholder="璇疯緭鍏�" v-model="costDetailInfo.appraisalAmount">
<span>鍏�</span>
<label class="form-label">鏄惁鐩栫珷</label>
<div class="radio-group">
- <input type="radio" id="committeeSealYes" name="committeeSeal" checked>
+ <input type="radio" id="committeeSealYes" name="committeeSeal" value="1" v-model="costDetailInfo.committeeStamped">
<label for="committeeSealYes" style="margin-top: 8px;">鏄�</label>
- <input type="radio" id="committeeSealNo" name="committeeSeal">
+ <input type="radio" id="committeeSealNo" name="committeeSeal" value="0" v-model="costDetailInfo.committeeStamped">
<label for="committeeSealNo" style="margin-top: 8px;">鍚�</label>
</div>
<label class="form-label" for="approveDept">绛炬姤閮ㄩ棬</label>
- <select id="approveDept" class="form-select">
- <option value="1">1</option>
- </select>
+ <input type="text" id="approveDept" class="form-input" placeholder="璇疯緭鍏�" v-model="costDetailInfo.approvalDepartment" style="width: 120px;">
</div>
<!-- 鍒嗘憡鑼冨洿 + 缁翠慨绫诲瀷 -->
<div class="form-row">
<label class="form-label">鍒嗘憡鑼冨洿</label>
<div class="radio-group">
- <input type="radio" id="shareBuilding" name="shareScope" checked>
+ <input type="radio" id="shareBuilding" name="shareScope" value="1" v-model="costDetailInfo.buildingType">
<label for="shareBuilding" style="margin-top: 8px;">骞�</label>
- <input type="radio" id="shareAll" name="shareScope">
+ <input type="radio" id="shareAll" name="shareScope" value="鍏ㄤ綋" v-model="costDetailInfo.buildingType">
<label for="shareAll" style="margin-top: 8px;">鍏ㄤ綋</label>
</div>
<label class="form-label" for="repairType">缁翠慨绫诲瀷</label>
- <select id="repairType" class="form-select">
- <option value="1">1</option>
- <option value="2">2</option>
- <option value="3">3</option>
- </select>
+ <input type="text" id="repairType" class="form-input" placeholder="璇疯緭鍏�" v-model="costDetailInfo.maintenanceType" style="width: 120px;">
</div>
<!-- 鍩洪噾涓庤鏂� + 涓氫富澶т細鑼冨洿 + 闂ㄧ墝骞㈣寖鍥� -->
<div class="form-row">
<label class="form-label">鍩洪噾涓庤鏂�</label>
<div class="radio-group">
- <input type="radio" id="fundRepair" name="fundType" value="repair" v-model="fundType">
+ <input type="radio" id="fundRepair" name="fundType" value="repair" v-model="costDetailInfo.fundType">
<label for="fundRepair" style="margin-top: 8px;">缁翠慨璧勯噾</label>
</div>
- <div class="radio-group" style="margin-left: 100px;" v-if="fundType === 'repair'">
+ <div class="radio-group" style="margin-left: 100px;" v-if="costDetailInfo.fundType === 'repair'">
<label class="form-label" for="ownerScope">涓氫富澶т細鑼冨洿</label>
<select id="ownerScope" class="form-select">
<option value="multi">澶氶��</option>
@@ -96,21 +90,21 @@
<div class="form-row">
<div class="radio-group" style="margin-left: 100px;">
- <input type="radio" id="fundPublic" name="fundType" value="public" v-model="fundType">
+ <input type="radio" id="fundPublic" name="fundType" value="public" v-model="costDetailInfo.fundType">
<label for="fundPublic" style="margin-top: 8px;">鍏叡鏀剁泭</label>
</div>
- <div class="radio-group" style="margin-left: 100px;" v-if="fundType === 'public'">
- <input type="radio" id="fundSystemOut" name="fundSystemType" value="out" v-model="fundSystemType">
+ <div class="radio-group" style="margin-left: 100px;" v-if="costDetailInfo.fundType === 'public'">
+ <input type="radio" id="fundSystemOut" name="fundSystemType" value="out" v-model="costDetailInfo.fundSystemType">
<label for="fundSystemOut" style="margin-top: 8px;">绯荤粺澶�</label>
- <input type="radio" id="fundSystemIn" name="fundSystemType" value="in" v-model="fundSystemType">
+ <input type="radio" id="fundSystemIn" name="fundSystemType" value="in" v-model="costDetailInfo.fundSystemType">
<label for="fundSystemIn" style="margin-top: 8px;">绯荤粺鍐�</label>
</div>
</div>
<!-- 鎸夐挳缁� -->
<div class="btn-group">
- <button type="button" class="btn-cancel">鍙栨秷</button>
- <button type="button" class="btn-save">淇濆瓨</button>
+ <button type="button" class="btn-cancel" v-on:click="_cancel()">鍙栨秷</button>
+ <button type="button" class="btn-save" v-on:click="_saveCostDetail()">淇濆瓨</button>
</div>
</form>
</div>
\ No newline at end of file
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);
diff --git a/public/pages/property/costDetail/costDetail.html b/public/pages/property/costDetail/costDetail.html
index 95b9d9a..73e667d 100644
--- a/public/pages/property/costDetail/costDetail.html
+++ b/public/pages/property/costDetail/costDetail.html
@@ -4,14 +4,14 @@
<!-- 鎼滅储鏍� -->
<div class="search-bar">
<div>
- <label>鏃ユ湡锛�</label>
- <input type="text" class="form-control queryDate" placeholder="璇烽�夋嫨鏃ユ湡" v-model="costDetailInfo.conditions.date" />
+ <label>骞翠唤锛�</label>
+ <input type="date" class="form-control queryDate" placeholder="璇疯緭鍏ュ勾浠�" v-model="costDetailInfo.conditions.year" min="2000" max="2099" />
</div>
<div>
<label>灏忓尯锛�</label>
<select class="form-control" v-model="costDetailInfo.conditions.communityName">
<option value="">璇烽�夋嫨</option>
- <option value="楸煎鑺卞洯A鍖�">楸煎鑺卞洯A鍖�</option>
+ <option v-for="community in costDetailInfo.communityList" :value="community.name">{{community.name}}</option>
</select>
</div>
<div>
@@ -31,43 +31,43 @@
<table>
<thead>
<tr id="costDetailTableHead">
- <th>搴忓彿</th>
- <th>娴佽浆缂栫爜</th>
- <th>灏忓尯缂栫爜</th>
- <th>灏忓尯鍚嶇О</th>
- <th>鏃ユ湡</th>
- <th>宸ョ▼鍐呭</th>
- <th>绠$悊澶勯噾棰� (鍏�)</th>
- <th>鏄惁鐩栫珷</th>
- <th>涓氬浼氶噾棰� (鍏�)</th>
- <th>瀹′环閲戦 (鍏�)</th>
- <th>鏄惁鐩栫珷</th>
- <th>绛炬姤閮ㄩ棬</th>
- <th>鍩洪噾绫诲瀷-涓�绾у垎绫�</th>
- <th>鍩洪噾绫诲瀷-浜岀骇鍒嗙被</th>
- <th>骞�/鍏ㄤ綋</th>
- <th>缁翠慨绫诲瀷</th>
- <th>鎿嶄綔</th>
+ <th style="width: 8px;">搴忓彿</th>
+ <th style="width: 15px;">娴佽浆缂栫爜</th>
+ <th style="width: 6px;">灏忓尯缂栫爜</th>
+ <th style="width: 8px;">灏忓尯鍚嶇О</th>
+ <th style="width: 35px;">鏃ユ湡</th>
+ <th style="width: 200px;">宸ョ▼鍐呭</th>
+ <th style="width: 6px;">绠$悊澶勯噾棰� (鍏�)</th>
+ <th style="width: 6px;">鏄惁鐩栫珷</th>
+ <th style="width: 12px;">涓氬浼氶噾棰� (鍏�)</th>
+ <th style="width: 20px;">瀹′环閲戦 (鍏�)</th>
+ <th style="width: 6px;">鏄惁鐩栫珷</th>
+ <th style="width: 8px;">绛炬姤閮ㄩ棬</th>
+ <th style="width: 12px;">鍩洪噾绫诲瀷-涓�绾у垎绫�</th>
+ <th style="width: 12px;">鍩洪噾绫诲瀷-浜岀骇鍒嗙被</th>
+ <th style="width: 6px;">骞�/鍏ㄤ綋</th>
+ <th style="width: 8px;">缁翠慨绫诲瀷</th>
+ <th style="width: 220px;">鎿嶄綔</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in costDetailInfo.costDetails">
<td>{{(costDetailInfo.paginationInfo.currentPage - 1) * costDetailInfo.paginationInfo.rows + index + 1}}</td>
- <td>{{item.flowCode || '-'}}</td>
- <td>{{item.communityCode || '-'}}</td>
- <td>{{item.communityName || '-'}}</td>
- <td>{{item.date || '-'}}</td>
- <td>{{item.projectContent || '-'}}</td>
- <td>{{item.managementAmount || '-'}}</td>
+ <td>{{item.flowCode || '--'}}</td>
+ <td>{{item.communityCode || '--'}}</td>
+ <td>{{item.communityName || '--'}}</td>
+ <td>{{item.date || '--'}}</td>
+ <td>{{item.projectContent || '--'}}</td>
+ <td>{{item.managementAmount || '--'}}</td>
<td>{{item.managementStamped == '1' ? '鏄�' : '鍚�'}}</td>
- <td>{{item.committeeAmount || '-'}}</td>
- <td>{{item.appraisalAmount || '-'}}</td>
+ <td>{{item.committeeAmount || '--'}}</td>
+ <td>{{item.appraisalAmount || '--'}}</td>
<td>{{item.committeeStamped == '1' ? '鏄�' : '鍚�'}}</td>
- <td>{{item.approvalDepartment || '-'}}</td>
- <td>{{item.fundTypeLevel1 || '-'}}</td>
- <td>{{item.fundTypeLevel2 || '-'}}</td>
- <td>{{item.buildingType || '-'}}</td>
- <td>{{item.maintenanceType || '-'}}</td>
+ <td>{{item.approvalDepartment || '--'}}</td>
+ <td>{{item.fundTypeLevel1 || '--'}}</td>
+ <td>{{item.fundTypeLevel2 || '--'}}</td>
+ <td>{{item.buildingType || '--'}}</td>
+ <td>{{item.maintenanceType || '--'}}</td>
<td>
<a href="javascript:void(0)" v-on:click="_viewCostDetail(item)">璇︽儏</a>
<a href="javascript:void(0)" v-on:click="_viewMore(item)">鏇村</a>
diff --git a/public/pages/property/costDetail/costDetail.js b/public/pages/property/costDetail/costDetail.js
index 2f0d8cf..fd62347 100644
--- a/public/pages/property/costDetail/costDetail.js
+++ b/public/pages/property/costDetail/costDetail.js
@@ -9,6 +9,7 @@
data: {
costDetailInfo: {
costDetails: [],
+ communityList: [],
paginationInfo: {
currentPage: 1,
rows: DEFAULT_ROWS,
@@ -20,14 +21,21 @@
conditions: {
date: '',
communityName: '',
- communityCode: ''
+ communityCode: '',
+ communityId: vc.getCurrentCommunity().communityId,
+ flowNumber: '',
+ projectCode: '',
+ year: '',
+ projectName: '',
+ _communityName: vc.getCurrentCommunity().name
}
}
},
_initMethod: function () {
$that = vc.component;
- $that._injectStyles();
- $that._listCostDetails(DEFAULT_PAGE, DEFAULT_ROWS);
+ $that.costDetailInfo.conditions.communityId = vc.getCurrentCommunity().communityId;
+ $that.costDetailInfo.conditions._communityName = vc.getCurrentCommunity().name;
+ $that._loadCommunityList();
$that._initDate();
},
_initEvent: function () {
@@ -37,48 +45,118 @@
},
methods: {
_initDate: function () {
- $(".queryDate").datetimepicker({
- language: 'zh-CN',
- fontAwesome: 'fa',
- format: 'yyyy-mm-dd hh:ii:ss',
- initTime: true,
- initialDate: new Date(),
- autoClose: 1,
- todayBtn: true
- });
- $('.queryDate').datetimepicker()
- .on('changeDate', function (ev) {
- var value = $(".queryDate").val();
- $that.costDetailInfo.conditions.date = value;
- });
- //闃叉澶氭鐐瑰嚮鏃堕棿鎻掍欢澶卞幓鐒︾偣
- var queryDateElements = document.getElementsByClassName('form-control queryDate');
- if (queryDateElements.length > 0) {
- queryDateElements[0].addEventListener('click', function(e) {
- e.currentTarget.blur();
- });
+ // 骞翠唤杈撳叆妗嗕笉闇�瑕佺壒娈婂垵濮嬪寲锛屼娇鐢� v-model 鍙屽悜缁戝畾鍗冲彲
+ },
+ _loadCommunityList: function () {
+ // 鑾峰彇鎵�鏈夊皬鍖哄垪琛�
+ var communityInfos = vc.getCommunitys();
+ if (communityInfos && Array.isArray(communityInfos) && communityInfos.length > 0) {
+ $that.costDetailInfo.communityList = communityInfos;
+ // 榛樿閫夋嫨绗竴涓皬鍖�
+ $that.costDetailInfo.conditions.communityName = communityInfos[0].name;
+ } else {
+ // 濡傛灉鑾峰彇涓嶅埌鍒楄〃锛屼娇鐢ㄥ綋鍓嶅皬鍖�
+ var currentCommunity = vc.getCurrentCommunity();
+ if (currentCommunity && currentCommunity.name) {
+ $that.costDetailInfo.communityList = [currentCommunity];
+ $that.costDetailInfo.conditions.communityName = currentCommunity.name;
+ }
}
+ // 鍔犺浇鏁版嵁
+ $that._listCostDetails(DEFAULT_PAGE, DEFAULT_ROWS);
},
_listCostDetails: function (_page, _rows) {
- $that.costDetailInfo.conditions.page = _page;
- $that.costDetailInfo.conditions.row = _rows;
- $that.costDetailInfo.conditions.communityId = vc.getCurrentCommunity().communityId;
- var param = {
- params: $that.costDetailInfo.conditions
+ // 浣跨敤閫変腑鐨勫皬鍖哄悕绉帮紝濡傛灉娌℃湁閫変腑鍒欎娇鐢ㄥ綋鍓嶅皬鍖哄悕绉�
+ var selectedCommunityName = $that.costDetailInfo.conditions.communityName || vc.getCurrentCommunity().name;
+ var params = {
+ communityName: selectedCommunityName,
+ page: _page,
+ row: _rows
};
- //鍙戦�乬et璇锋眰
- vc.http.apiGet('/costDetail/queryCostDetail',
+
+ // 娣诲姞鍙�夋煡璇㈠弬鏁�
+ if ($that.costDetailInfo.conditions.flowNumber) {
+ params.flowNumber = $that.costDetailInfo.conditions.flowNumber;
+ }
+ if ($that.costDetailInfo.conditions.projectCode) {
+ params.projectCode = $that.costDetailInfo.conditions.projectCode;
+ }
+ if ($that.costDetailInfo.conditions.year) {
+ params.year = parseInt($that.costDetailInfo.conditions.year);
+ }
+ if ($that.costDetailInfo.conditions.projectName) {
+ params.projectName = $that.costDetailInfo.conditions.projectName;
+ }
+
+ var param = {
+ params: params
+ };
+
+ vc.http.apiGet('/maintenancePayment/queryMaintenancePayment',
param,
function (json, res) {
- var _json = JSON.parse(json);
- $that.costDetailInfo.paginationInfo.dataCount = _json.total || 0;
- $that.costDetailInfo.paginationInfo.total = _json.records || 1;
- $that.costDetailInfo.costDetails = _json.data || [];
- $that.costDetailInfo.paginationInfo.currentPage = _page;
- $that._freshPageList();
+ try {
+ var _json = JSON.parse(json);
+
+ if (_json.code === 0 && _json.data) {
+ var records = Array.isArray(_json.data) ? _json.data : [];
+
+ var mappedRecords = records.map(function(item) {
+ var dateStr = '';
+ if (item.date) {
+ dateStr = item.date.substring(0, 7);
+ } else if (item.year && item.month) {
+ var monthStr = item.month < 10 ? '0' + item.month : String(item.month);
+ dateStr = item.year + '-' + monthStr;
+ }
+
+ return {
+ flowCode: item.flowNumber || '--',
+ communityCode: item.projectCode || '--',
+ communityName: item.projectName || '--',
+ date: dateStr,
+ projectContent: item.projectContent || '--',
+ managementAmount: item.managementOfficeAmount || '--',
+ managementStamped: item.managementOfficeSeal === '鏄�' ? '1' : '0',
+ committeeAmount: item.ownersCommitteeAmount || '--',
+ appraisalAmount: item.auditAmount || '--',
+ committeeStamped: item.ownersCommitteeSeal === '鏄�' ? '1' : '0',
+ approvalDepartment: item.reportDepartment || '--',
+ fundTypeLevel1: item.fundTypeLevel1 || '--',
+ fundTypeLevel2: item.fundTypeLevel2 || '--',
+ buildingType: item.buildingOrAll || '--',
+ maintenanceType: item.maintenanceType || '--',
+ costDetailId: item.id,
+ _originalData: item
+ };
+ });
+
+ var total = _json.total || 0;
+ var totalPages = _json.records || 1;
+
+ $that.costDetailInfo.paginationInfo.dataCount = total;
+ $that.costDetailInfo.paginationInfo.total = totalPages;
+ $that.costDetailInfo.costDetails = mappedRecords;
+ $that.costDetailInfo.paginationInfo.currentPage = _page;
+ $that._freshPageList();
+ } else {
+ console.error('鎺ュ彛杩斿洖閿欒:', _json.msg || '鏈煡閿欒', _json);
+ vc.toast(_json.msg || '鏌ヨ澶辫触');
+ $that.costDetailInfo.costDetails = [];
+ $that.costDetailInfo.paginationInfo.dataCount = 0;
+ $that.costDetailInfo.paginationInfo.total = 1;
+ $that._freshPageList();
+ }
+ } catch (e) {
+ vc.toast('鏁版嵁瑙f瀽澶辫触');
+ $that.costDetailInfo.costDetails = [];
+ $that.costDetailInfo.paginationInfo.dataCount = 0;
+ $that.costDetailInfo.paginationInfo.total = 1;
+ $that._freshPageList();
+ }
},
function (errInfo, error) {
- console.log('璇锋眰澶辫触澶勭悊');
+ vc.toast('璇锋眰澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�');
$that.costDetailInfo.costDetails = [];
$that.costDetailInfo.paginationInfo.dataCount = 0;
$that.costDetailInfo.paginationInfo.total = 1;
@@ -92,7 +170,6 @@
var pageList = [];
if (total <= 7) {
- // 鎬婚〉鏁板皬浜庣瓑浜�7锛屾樉绀烘墍鏈夐〉鐮�
for (var i = 1; i <= total; i++) {
pageList.push({
page: i,
@@ -101,9 +178,7 @@
});
}
} else {
- // 鎬婚〉鏁板ぇ浜�7锛屾樉绀洪儴鍒嗛〉鐮�
if (currentPage <= 4) {
- // 褰撳墠椤靛湪鍓�4椤�
for (var i = 1; i <= 5; i++) {
pageList.push({
page: i,
@@ -122,7 +197,6 @@
currentPage: false
});
} else if (currentPage >= total - 3) {
- // 褰撳墠椤靛湪鍚�4椤�
pageList.push({
page: 1,
pageView: 1,
@@ -141,7 +215,6 @@
});
}
} else {
- // 褰撳墠椤靛湪涓棿
pageList.push({
page: 1,
pageView: 1,
@@ -178,9 +251,17 @@
$that._listCostDetails(DEFAULT_PAGE, $that.costDetailInfo.paginationInfo.rows);
},
_resetQuery: function () {
- $that.costDetailInfo.conditions.date = '';
- $that.costDetailInfo.conditions.communityName = '';
+ // 閲嶇疆鏃舵仮澶嶄负绗竴涓皬鍖�
+ if ($that.costDetailInfo.communityList && $that.costDetailInfo.communityList.length > 0) {
+ $that.costDetailInfo.conditions.communityName = $that.costDetailInfo.communityList[0].name;
+ } else {
+ $that.costDetailInfo.conditions.communityName = '';
+ }
$that.costDetailInfo.conditions.communityCode = '';
+ $that.costDetailInfo.conditions.flowNumber = '';
+ $that.costDetailInfo.conditions.projectCode = '';
+ $that.costDetailInfo.conditions.year = '';
+ $that.costDetailInfo.conditions.projectName = '';
$('.queryDate').val('');
$that._listCostDetails(DEFAULT_PAGE, $that.costDetailInfo.paginationInfo.rows);
},
@@ -228,23 +309,76 @@
vc.jumpToPage('/#/pages/property/costDetail/edit?costDetailId=' + _item.costDetailId);
},
_deleteCostDetail: function (_item) {
- vc.confirm('纭畾瑕佸垹闄よ繖鏉¤垂鐢ㄦ槑缁嗗悧锛�', function () {
- var param = {
- params: {
- costDetailId: _item.costDetailId
- }
- };
- vc.http.apiPost('/costDetail/deleteCostDetail',
- param,
- function (json, res) {
- vc.toast('鍒犻櫎鎴愬姛');
- $that._listCostDetails($that.costDetailInfo.paginationInfo.currentPage, $that.costDetailInfo.paginationInfo.rows);
- },
- function (errInfo, error) {
- vc.message(errInfo);
- }
- );
- });
+ if (!_item || !_item.costDetailId) {
+ vc.toast('鍒犻櫎澶辫触锛氱己灏戝繀瑕佺殑鏁版嵁');
+ return;
+ }
+ if (typeof vc.confirm === 'function') {
+ vc.confirm('纭畾瑕佸垹闄よ繖鏉¤垂鐢ㄦ槑缁嗗悧锛�', function () {
+ var param = {
+ id: _item.costDetailId,
+ communityId: vc.getCurrentCommunity().communityId
+ };
+ vc.http.apiPost('/maintenancePayment/deleteMaintenancePayment',
+ JSON.stringify(param), {
+ headers: {
+ 'Content-Type': 'application/json'
+ }
+ },
+ function (json, res) {
+ try {
+ var _json = JSON.parse(json);
+ if (_json.code === 0 || _json.code === '0') {
+ vc.toast(_json.msg || '鍒犻櫎鎴愬姛');
+ $that._listCostDetails($that.costDetailInfo.paginationInfo.currentPage, $that.costDetailInfo.paginationInfo.rows);
+ } else {
+ vc.toast(_json.msg || '鍒犻櫎澶辫触');
+ }
+ } catch (e) {
+ console.error('鍒犻櫎鍝嶅簲瑙f瀽澶辫触:', e);
+ vc.toast('鍒犻櫎澶辫触锛岃閲嶈瘯');
+ }
+ },
+ function (errInfo, error) {
+ console.error('鍒犻櫎璇锋眰澶辫触:', errInfo, error);
+ vc.toast(errInfo || '鍒犻櫎澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�');
+ }
+ );
+ });
+ } else {
+ // 濡傛灉 vc.confirm 涓嶅瓨鍦紝浣跨敤 window.confirm 浣滀负鍚庡鏂规
+ if (window.confirm('纭畾瑕佸垹闄よ繖鏉¤垂鐢ㄦ槑缁嗗悧锛�')) {
+ var param = {
+ id: _item.costDetailId,
+ communityId: vc.getCurrentCommunity().communityId
+ };
+ vc.http.apiPost('/maintenancePayment/deleteMaintenancePayment',
+ JSON.stringify(param), {
+ headers: {
+ 'Content-Type': 'application/json'
+ }
+ },
+ function (json, res) {
+ try {
+ var _json = JSON.parse(json);
+ if (_json.code === 0 || _json.code === '0') {
+ vc.toast(_json.msg || '鍒犻櫎鎴愬姛');
+ $that._listCostDetails($that.costDetailInfo.paginationInfo.currentPage, $that.costDetailInfo.paginationInfo.rows);
+ } else {
+ vc.toast(_json.msg || '鍒犻櫎澶辫触');
+ }
+ } catch (e) {
+ console.error('鍒犻櫎鍝嶅簲瑙f瀽澶辫触:', e);
+ vc.toast('鍒犻櫎澶辫触锛岃閲嶈瘯');
+ }
+ },
+ function (errInfo, error) {
+ console.error('鍒犻櫎璇锋眰澶辫触:', errInfo, error);
+ vc.toast(errInfo || '鍒犻櫎澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�');
+ }
+ );
+ }
+ }
}
}
});
diff --git a/public/pages/property/costDetail/detail/detail.html b/public/pages/property/costDetail/detail/detail.html
index e4a446e..6fb1c86 100644
--- a/public/pages/property/costDetail/detail/detail.html
+++ b/public/pages/property/costDetail/detail/detail.html
@@ -1,34 +1,33 @@
<div class="form-container">
- <h2 style="font-weight: 600;">娣诲姞</h2>
+ <h2 style="font-weight: 600;">璇︽儏</h2>
<form>
<!-- 娴佽浆缂栫爜 + 鏃ユ湡 -->
<div class="form-row">
- <label class="form-label" for="flowCode">娴佽浆缂栫爜</label>
+ <label class="form-label-detail" for="flowCode">娴佽浆缂栫爜</label>
<p>{{costDetailInfo.flowCode || '-'}}</p>
- <label class="form-label" for="date">鏃ユ湡</label>
+ <label class="form-label-detail" for="date">鏃ユ湡</label>
<p>{{costDetailInfo.date || '-'}}</p>
</div>
- <!-- 灏忓尯鍚嶇О + 灏忓尯缂栫爜锛堝甫澶囨敞锛� -->
+ <!-- 灏忓尯鍚嶇О + 灏忓尯缂栫爜 -->
<div class="form-row">
- <label class="form-label" for="communityName">灏忓尯鍚嶇О</label>
+ <label class="form-label-detail" for="communityName">灏忓尯鍚嶇О</label>
<p>{{costDetailInfo.communityName || '-'}}</p>
- <label class="form-label">灏忓尯缂栫爜</label>
+ <label class="form-label-detail">灏忓尯缂栫爜</label>
<p>{{costDetailInfo.communityCode || '-'}}</p>
</div>
<!-- 宸ョ▼鍐呭 -->
<div class="form-row">
- <label class="form-label" for="projectContent">宸ョ▼鍐呭</label>
+ <label class="form-label-detail" for="projectContent">宸ョ▼鍐呭</label>
<p>{{costDetailInfo.projectContent || '-'}}</p>
</div>
<!-- 绠$悊澶勯噾棰� + 鏄惁鐩栫珷 -->
<div class="form-row">
- <label class="form-label" for="mgmtAmount">绠$悊澶勯噾棰�</label>
- <p>{{costDetailInfo.managementAmount || '-'}}</p>
- <span>鍏�</span>
- <label class="form-label">鏄惁鐩栫珷</label>
+ <label class="form-label-detail" for="mgmtAmount">绠$悊澶勯噾棰�</label>
+ <p>{{costDetailInfo.managementAmount || '-'}} <span>鍏�</span></p>
+ <label class="form-label-detail">鏄惁鐩栫珷</label>
<div class="radio-group">
<p>{{costDetailInfo.managementStamped == '1' ? '鏄�' : '鍚�'}}</p>
</div>
@@ -36,53 +35,49 @@
<!-- 涓氬浼氶噾棰� + 瀹′环閲戦 + 鏄惁鐩栫珷 + 绛炬姤閮ㄩ棬 -->
<div class="form-row">
- <label class="form-label" for="committeeAmount">涓氬浼氶噾棰�</label>
- <p>{{costDetailInfo.committeeAmount || '-'}}</p>
- <span>鍏�</span>
- <label class="form-label" for="auditAmount">瀹′环閲戦</label>
- <p>{{costDetailInfo.appraisalAmount || '-'}}</p>
- <span>鍏�</span>
- <label class="form-label">鏄惁鐩栫珷</label>
+ <label class="form-label-detail" for="committeeAmount">涓氬浼氶噾棰�</label>
+ <p>{{costDetailInfo.committeeAmount || '-'}} <span>鍏�</span></p>
+ <label class="form-label-detail" for="auditAmount">瀹′环閲戦</label>
+ <p>{{costDetailInfo.appraisalAmount || '-'}} <span>鍏�</span></p>
+ <label class="form-label-detail">鏄惁鐩栫珷</label>
<div class="radio-group">
<p>{{costDetailInfo.committeeStamped == '1' ? '鏄�' : '鍚�'}}</p>
</div>
- <label class="form-label" for="approveDept">绛炬姤閮ㄩ棬</label>
+ <label class="form-label-detail" for="approveDept">绛炬姤閮ㄩ棬</label>
<p>{{costDetailInfo.approvalDepartment || '-'}}</p>
</div>
<!-- 鍒嗘憡鑼冨洿 + 缁翠慨绫诲瀷 -->
<div class="form-row">
- <label class="form-label">鍒嗘憡鑼冨洿</label>
+ <label class="form-label-detail">鍒嗘憡鑼冨洿</label>
<div class="radio-group">
- <p>{{costDetailInfo.buildingType == '1' ? '骞�' : '鍏ㄤ綋'}}</p>
+ <p>{{costDetailInfo.buildingType == '鍏ㄤ綋' || costDetailInfo.buildingType == '2' ? '鍏ㄤ綋' : '骞�'}}</p>
</div>
- <label class="form-label" for="repairType">缁翠慨绫诲瀷</label>
+ <label class="form-label-detail" for="repairType">缁翠慨绫诲瀷</label>
<p>{{costDetailInfo.maintenanceType || '-'}}</p>
</div>
<!-- 鍩洪噾涓庤鏂� + 涓氫富澶т細鑼冨洿 + 闂ㄧ墝骞㈣寖鍥� -->
<div class="form-row">
- <label class="form-label">鍩洪噾涓庤鏂�</label>
+ <label class="form-label-detail">鍩洪噾涓庤鏂�</label>
<div class="radio-group">
- <p>{{costDetailInfo.fundTypeLevel1 == '1' ? '缁翠慨璧勯噾' : '鍏叡鏀剁泭'}}</p>
- <label for="fundRepair" style="margin-top: 8px;">缁翠慨璧勯噾</label>
+ <p>{{costDetailInfo.fundTypeLevel1 || '-'}}</p>
</div>
- <label class="form-label" for="ownerScope">涓氫富澶т細鑼冨洿</label>
+ <label class="form-label-detail" for="ownerScope">涓氫富澶т細鑼冨洿</label>
<p>{{costDetailInfo.ownerScope || '-'}}</p>
- <label class="form-label" for="buildingScope">闂ㄧ墝骞㈣寖鍥�</label>
+ <label class="form-label-detail" for="buildingScope">闂ㄧ墝骞㈣寖鍥�</label>
<p>{{costDetailInfo.buildingScope || '-'}}</p>
</div>
- <div class="form-row">
+ <div class="form-row" v-if="costDetailInfo.fundTypeLevel2">
<div class="radio-group" style="margin-left: 100px;">
- <p>{{costDetailInfo.fundTypeLevel2 == '1' ? '鍏叡鏀剁泭' : '缁翠慨璧勯噾'}}</p>
+ <p>{{costDetailInfo.fundTypeLevel2}}</p>
</div>
</div>
<!-- 鎸夐挳缁� -->
<div class="btn-group">
- <button type="button" class="btn-cancel">鍙栨秷</button>
- <button type="button" class="btn-save">淇濆瓨</button>
+ <button type="button" class="btn-cancel" v-on:click="_goBack()">杩斿洖</button>
</div>
</form>
</div>
\ No newline at end of file
diff --git a/public/pages/property/costDetail/detail/detail.js b/public/pages/property/costDetail/detail/detail.js
index e69de29..bcb8f73 100644
--- a/public/pages/property/costDetail/detail/detail.js
+++ b/public/pages/property/costDetail/detail/detail.js
@@ -0,0 +1,165 @@
+/**
+ 璐圭敤鏄庣粏璇︽儏
+ **/
+(function (vc) {
+ var $that = {};
+ vc.extends({
+ data: {
+ costDetailInfo: {
+ costDetailId: '',
+ flowCode: '',
+ date: '',
+ communityName: '',
+ communityCode: '',
+ projectContent: '',
+ managementAmount: '',
+ managementStamped: '0',
+ committeeAmount: '',
+ appraisalAmount: '',
+ committeeStamped: '0',
+ approvalDepartment: '',
+ fundTypeLevel1: '',
+ fundTypeLevel2: '',
+ buildingType: '1',
+ maintenanceType: '',
+ ownerScope: '',
+ buildingScope: ''
+ }
+ },
+ _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() {
+ vc.goBack();
+ }, 1500);
+ }
+ },
+ _initEvent: function () {
+ },
+ methods: {
+ _loadCostDetail: function () {
+ // 鏌ヨ鎵�鏈夋暟鎹紝鐒跺悗鎵惧埌鍖归厤鐨勮褰�
+ var params = {
+ communityName: vc.getCurrentCommunity().name,
+ page: 1,
+ 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++) {
+ var recordId = String(records[i].id);
+ console.log('姣旇緝ID: 鐩爣=' + targetId + ', 璁板綍=' + recordId);
+ if (recordId === targetId || records[i].id == $that.costDetailInfo.costDetailId) {
+ foundItem = records[i];
+ console.log('鎵惧埌鍖归厤璁板綍:', foundItem);
+ 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() {
+ vc.goBack();
+ }, 1500);
+ }
+ } else {
+ console.error('API杩斿洖閿欒:', _json);
+ vc.toast(_json.msg || '鏈壘鍒拌璐圭敤鏄庣粏');
+ setTimeout(function() {
+ vc.goBack();
+ }, 1500);
+ }
+ } catch (e) {
+ console.error('鏁版嵁瑙f瀽澶辫触:', e);
+ vc.toast('鏁版嵁瑙f瀽澶辫触: ' + e.message);
+ }
+ },
+ function (errInfo, error) {
+ console.error('璇锋眰澶辫触:', errInfo, error);
+ vc.toast('璇锋眰澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�');
+ }
+ );
+ },
+ _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 || '';
+ vc.component.costDetailInfo.communityCode = item.projectCode || '';
+ vc.component.costDetailInfo.projectContent = item.projectContent || '';
+ vc.component.costDetailInfo.managementAmount = item.managementOfficeAmount || '';
+ vc.component.costDetailInfo.managementStamped = (item.managementOfficeSeal === '鏄�' || item.managementOfficeSeal === '1') ? '1' : '0';
+ vc.component.costDetailInfo.committeeAmount = item.ownersCommitteeAmount || '';
+ vc.component.costDetailInfo.appraisalAmount = item.auditAmount || '';
+ vc.component.costDetailInfo.committeeStamped = (item.ownersCommitteeSeal === '鏄�' || item.ownersCommitteeSeal === '1') ? '1' : '0';
+ 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 () {
+ vc.goBack();
+ }
+ }
+ });
+})(window.vc);
+
diff --git a/public/pages/property/costDetail/edit/edit.html b/public/pages/property/costDetail/edit/edit.html
index c335946..24159ed 100644
--- a/public/pages/property/costDetail/edit/edit.html
+++ b/public/pages/property/costDetail/edit/edit.html
@@ -4,35 +4,35 @@
<!-- 娴佽浆缂栫爜 + 鏃ユ湡 -->
<div class="form-row">
<label class="form-label" for="flowCode">娴佽浆缂栫爜</label>
- <input type="text" id="flowCode" class="form-input" placeholder="璇疯緭鍏�">
+ <input type="text" id="flowCode" class="form-input" placeholder="璇疯緭鍏�" v-model="costDetailInfo.flowCode">
<label class="form-label" for="date">鏃ユ湡</label>
- <input type="date" id="date" class="form-input" placeholder="yyyy/mm/鏃�">
+ <input type="date" id="date" class="form-input" placeholder="yyyy/mm/鏃�" v-model="costDetailInfo.date">
</div>
<!-- 灏忓尯鍚嶇О + 灏忓尯缂栫爜锛堝甫澶囨敞锛� -->
<div class="form-row">
<label class="form-label" for="communityName">灏忓尯鍚嶇О</label>
- <input type="text" id="communityName" class="form-input" placeholder="璇疯緭鍏�">
+ <input type="text" id="communityName" class="form-input" placeholder="璇疯緭鍏�" v-model="costDetailInfo.communityName">
<label class="form-label">灏忓尯缂栫爜</label>
- <input type="text" id="communityCode" class="form-input" placeholder="璇疯緭鍏�">
+ <input type="text" id="communityCode" class="form-input" placeholder="璇疯緭鍏�" v-model="costDetailInfo.communityCode">
</div>
<!-- 宸ョ▼鍐呭 -->
<div class="form-row">
<label class="form-label" for="projectContent">宸ョ▼鍐呭</label>
- <input type="text" id="projectContent" class="form-input" placeholder="璇疯緭鍏�" style="width: 555px;">
+ <input type="text" id="projectContent" class="form-input" placeholder="璇疯緭鍏�" style="width: 555px;" v-model="costDetailInfo.projectContent">
</div>
<!-- 绠$悊澶勯噾棰� + 鏄惁鐩栫珷 -->
<div class="form-row">
<label class="form-label" for="mgmtAmount">绠$悊澶勯噾棰�</label>
- <input type="text" id="mgmtAmount" class="form-input" placeholder="璇疯緭鍏�">
+ <input type="text" id="mgmtAmount" class="form-input" placeholder="璇疯緭鍏�" v-model="costDetailInfo.managementAmount">
<span>鍏�</span>
<label class="form-label">鏄惁鐩栫珷</label>
<div class="radio-group">
- <input type="radio" id="mgmtSealYes" name="mgmtSeal" checked>
+ <input type="radio" id="mgmtSealYes" name="mgmtSeal" value="1" v-model="costDetailInfo.managementStamped">
<label for="mgmtSealYes" style="margin-top: 8px;">鏄�</label>
- <input type="radio" id="mgmtSealNo" name="mgmtSeal">
+ <input type="radio" id="mgmtSealNo" name="mgmtSeal" value="0" v-model="costDetailInfo.managementStamped">
<label for="mgmtSealNo" style="margin-top: 8px;">鍚�</label>
</div>
</div>
@@ -40,49 +40,43 @@
<!-- 涓氬浼氶噾棰� + 瀹′环閲戦 + 鏄惁鐩栫珷 + 绛炬姤閮ㄩ棬 -->
<div class="form-row">
<label class="form-label" for="committeeAmount">涓氬浼氶噾棰�</label>
- <input type="text" id="committeeAmount" class="form-input" placeholder="璇疯緭鍏�">
+ <input type="text" id="committeeAmount" class="form-input" placeholder="璇疯緭鍏�" v-model="costDetailInfo.committeeAmount">
<span>鍏�</span>
<label class="form-label" for="auditAmount">瀹′环閲戦</label>
- <input type="text" id="auditAmount" class="form-input" placeholder="璇疯緭鍏�">
+ <input type="text" id="auditAmount" class="form-input" placeholder="璇疯緭鍏�" v-model="costDetailInfo.appraisalAmount">
<span>鍏�</span>
<label class="form-label">鏄惁鐩栫珷</label>
<div class="radio-group">
- <input type="radio" id="committeeSealYes" name="committeeSeal" checked>
+ <input type="radio" id="committeeSealYes" name="committeeSeal" value="1" v-model="costDetailInfo.committeeStamped">
<label for="committeeSealYes" style="margin-top: 8px;">鏄�</label>
- <input type="radio" id="committeeSealNo" name="committeeSeal">
+ <input type="radio" id="committeeSealNo" name="committeeSeal" value="0" v-model="costDetailInfo.committeeStamped">
<label for="committeeSealNo" style="margin-top: 8px;">鍚�</label>
</div>
<label class="form-label" for="approveDept">绛炬姤閮ㄩ棬</label>
- <select id="approveDept" class="form-select">
- <option value="1">1</option>
- </select>
+ <input type="text" id="approveDept" class="form-input" placeholder="璇疯緭鍏�" v-model="costDetailInfo.approvalDepartment" style="width: 120px;">
</div>
<!-- 鍒嗘憡鑼冨洿 + 缁翠慨绫诲瀷 -->
<div class="form-row">
<label class="form-label">鍒嗘憡鑼冨洿</label>
<div class="radio-group">
- <input type="radio" id="shareBuilding" name="shareScope" checked>
+ <input type="radio" id="shareBuilding" name="shareScope" value="1" v-model="costDetailInfo.buildingType">
<label for="shareBuilding" style="margin-top: 8px;">骞�</label>
- <input type="radio" id="shareAll" name="shareScope">
+ <input type="radio" id="shareAll" name="shareScope" value="鍏ㄤ綋" v-model="costDetailInfo.buildingType">
<label for="shareAll" style="margin-top: 8px;">鍏ㄤ綋</label>
</div>
<label class="form-label" for="repairType">缁翠慨绫诲瀷</label>
- <select id="repairType" class="form-select">
- <option value="1">1</option>
- <option value="2">2</option>
- <option value="3">3</option>
- </select>
+ <input type="text" id="repairType" class="form-input" placeholder="璇疯緭鍏�" v-model="costDetailInfo.maintenanceType" style="width: 120px;">
</div>
<!-- 鍩洪噾涓庤鏂� + 涓氫富澶т細鑼冨洿 + 闂ㄧ墝骞㈣寖鍥� -->
<div class="form-row">
<label class="form-label">鍩洪噾涓庤鏂�</label>
<div class="radio-group">
- <input type="radio" id="fundRepair" name="fundType" value="repair" v-model="fundType">
+ <input type="radio" id="fundRepair" name="fundType" value="repair" v-model="costDetailInfo.fundType">
<label for="fundRepair" style="margin-top: 8px;">缁翠慨璧勯噾</label>
</div>
- <div class="radio-group" style="margin-left: 100px;" v-if="fundType === 'repair'">
+ <div class="radio-group" style="margin-left: 100px;" v-if="costDetailInfo.fundType === 'repair'">
<label class="form-label" for="ownerScope">涓氫富澶т細鑼冨洿</label>
<select id="ownerScope" class="form-select">
<option value="multi">澶氶��</option>
@@ -96,21 +90,21 @@
<div class="form-row">
<div class="radio-group" style="margin-left: 100px;">
- <input type="radio" id="fundPublic" name="fundType" value="public" v-model="fundType">
+ <input type="radio" id="fundPublic" name="fundType" value="public" v-model="costDetailInfo.fundType">
<label for="fundPublic" style="margin-top: 8px;">鍏叡鏀剁泭</label>
</div>
- <div class="radio-group" style="margin-left: 100px;" v-if="fundType === 'public'">
- <input type="radio" id="fundSystemOut" name="fundSystemType" value="out" v-model="fundSystemType">
+ <div class="radio-group" style="margin-left: 100px;" v-if="costDetailInfo.fundType === 'public'">
+ <input type="radio" id="fundSystemOut" name="fundSystemType" value="out" v-model="costDetailInfo.fundSystemType">
<label for="fundSystemOut" style="margin-top: 8px;">绯荤粺澶�</label>
- <input type="radio" id="fundSystemIn" name="fundSystemType" value="in" v-model="fundSystemType">
+ <input type="radio" id="fundSystemIn" name="fundSystemType" value="in" v-model="costDetailInfo.fundSystemType">
<label for="fundSystemIn" style="margin-top: 8px;">绯荤粺鍐�</label>
</div>
</div>
<!-- 鎸夐挳缁� -->
<div class="btn-group">
- <button type="button" class="btn-cancel">鍙栨秷</button>
- <button type="button" class="btn-save">淇濆瓨</button>
+ <button type="button" class="btn-cancel" v-on:click="_cancel()">鍙栨秷</button>
+ <button type="button" class="btn-save" v-on:click="_saveCostDetail()">淇濆瓨</button>
</div>
</form>
</div>
\ No newline at end of file
diff --git a/public/pages/property/costDetail/edit/edit.js b/public/pages/property/costDetail/edit/edit.js
index 369a818..da0016a 100644
--- a/public/pages/property/costDetail/edit/edit.js
+++ b/public/pages/property/costDetail/edit/edit.js
@@ -1,10 +1,245 @@
-
+/**
+ 缂栬緫璐圭敤鏄庣粏
+ **/
(function (vc) {
+ var $that = {};
vc.extends({
data: {
- fundType: 'repair', // 榛樿閫変腑缁翠慨璧勯噾
- fundSystemType: 'out' // 榛樿閫変腑绯荤粺澶�
+ costDetailInfo: {
+ costDetailId: '',
+ 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;
+ // 浠嶶RL鑾峰彇costDetailId
+ var costDetailId = vc.getParam('costDetailId');
+ if (costDetailId) {
+ $that.costDetailInfo.costDetailId = costDetailId;
+ $that._loadCostDetail();
+ } else {
+ vc.toast('缂哄皯璐圭敤鏄庣粏ID');
+ setTimeout(function() {
+ vc.goBack();
+ }, 1500);
+ }
+ },
+ methods: {
+ _loadCostDetail: function () {
+ // 鏌ヨ鎵�鏈夋暟鎹紝鐒跺悗鎵惧埌鍖归厤鐨勮褰�
+ var params = {
+ communityName: vc.getCurrentCommunity().name,
+ page: 1,
+ 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++) {
+ var recordId = String(records[i].id);
+ console.log('姣旇緝ID: 鐩爣=' + targetId + ', 璁板綍=' + recordId);
+ if (recordId === targetId || records[i].id == $that.costDetailInfo.costDetailId) {
+ foundItem = records[i];
+ console.log('鎵惧埌鍖归厤璁板綍:', foundItem);
+ break;
+ }
+ }
+
+ if (foundItem) {
+ $that._fillFormData(foundItem);
+ console.log('琛ㄥ崟鏁版嵁宸插~鍏�:', $that.costDetailInfo);
+ } else {
+ console.error('鏈壘鍒板尮閰嶇殑璁板綍锛岀洰鏍嘔D:', $that.costDetailInfo.costDetailId);
+ vc.toast('鏈壘鍒拌璐圭敤鏄庣粏锛孖D: ' + $that.costDetailInfo.costDetailId);
+ setTimeout(function() {
+ vc.goBack();
+ }, 1500);
+ }
+ } else {
+ console.error('API杩斿洖閿欒:', _json);
+ vc.toast('鏈壘鍒拌璐圭敤鏄庣粏');
+ setTimeout(function() {
+ vc.goBack();
+ }, 1500);
+ }
+ } catch (e) {
+ console.error('鏁版嵁瑙f瀽澶辫触:', e);
+ vc.toast('鏁版嵁瑙f瀽澶辫触: ' + e.message);
+ }
+ },
+ function (errInfo, error) {
+ console.error('璇锋眰澶辫触:', errInfo, error);
+ vc.toast('璇锋眰澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�');
+ }
+ );
+ },
+ _fillFormData: function (item) {
+ console.log('寮�濮嬪~鍏呰〃鍗曟暟鎹紝鍘熷鏁版嵁:', item);
+
+ // 濉厖琛ㄥ崟鏁版嵁
+ var dateStr = '';
+ if (item.date) {
+ dateStr = item.date.substring(0, 10); // 鍙栨棩鏈熼儴鍒� yyyy-mm-dd
+ } 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;
+ }
+
+ // 浣跨敤Vue.set鎴栬�呯洿鎺ヨ祴鍊兼潵纭繚鍝嶅簲寮忔洿鏂�
+ vc.component.costDetailInfo.flowCode = item.flowNumber || '';
+ vc.component.costDetailInfo.date = dateStr;
+ vc.component.costDetailInfo.communityName = item.projectName || '';
+ vc.component.costDetailInfo.communityCode = item.projectCode || '';
+ vc.component.costDetailInfo.projectContent = item.projectContent || '';
+ vc.component.costDetailInfo.managementAmount = item.managementOfficeAmount || '';
+ vc.component.costDetailInfo.managementStamped = (item.managementOfficeSeal === '鏄�' || item.managementOfficeSeal === '1') ? '1' : '0';
+ vc.component.costDetailInfo.committeeAmount = item.ownersCommitteeAmount || '';
+ vc.component.costDetailInfo.appraisalAmount = item.auditAmount || '';
+ vc.component.costDetailInfo.committeeStamped = (item.ownersCommitteeSeal === '鏄�' || item.ownersCommitteeSeal === '1') ? '1' : '0';
+ 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 || '';
+
+ // 璁剧疆鍩洪噾绫诲瀷
+ if (item.fundTypeLevel1) {
+ vc.component.costDetailInfo.fundType = (item.fundTypeLevel1 === '缁翠慨璧勯噾' || item.fundTypeLevel1 === '1') ? 'repair' : 'public';
+ } else {
+ vc.component.costDetailInfo.fundType = 'repair'; // 榛樿鍊�
+ }
+
+ if (item.fundTypeLevel2) {
+ vc.component.costDetailInfo.fundSystemType = (item.fundTypeLevel2 === '绯荤粺澶�' || item.fundTypeLevel2 === 'out') ? 'out' : 'in';
+ } else {
+ vc.component.costDetailInfo.fundSystemType = 'out'; // 榛樿鍊�
+ }
+
+ console.log('琛ㄥ崟鏁版嵁濉厖瀹屾垚:', vc.component.costDetailInfo);
+ },
+ _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 = {
+ id: $that.costDetailInfo.costDetailId,
+ 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]);
+ }
+ }
+ }
+
+ // 璋冪敤鏇存柊API
+ vc.http.apiPost('/maintenancePayment/updateMaintenancePayment',
+ JSON.stringify(saveData), {
+ emulateJSON: true
+ },
+ function (json, res) {
+ try {
+ var _json = JSON.parse(json);
+ if (_json.code === 0) {
+ vc.toast('淇濆瓨鎴愬姛');
+ setTimeout(function() {
+ vc.goBack();
+ }, 1000);
+ } else {
+ vc.toast(_json.msg || '淇濆瓨澶辫触');
+ }
+ } catch (e) {
+ vc.toast('淇濆瓨澶辫触');
+ }
+ },
+ function (errInfo, error) {
+ vc.toast('淇濆瓨澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�');
+ }
+ );
+ },
+ _cancel: function () {
+ vc.goBack();
+ }
}
});
})(window.vc);
-
diff --git a/public/pages/property/costDetail/more/more.html b/public/pages/property/costDetail/more/more.html
index ee6fa66..daa5df4 100644
--- a/public/pages/property/costDetail/more/more.html
+++ b/public/pages/property/costDetail/more/more.html
@@ -3,12 +3,12 @@
<div class="search-bar">
<div>
<label>缁熻鏃堕棿锛�</label>
- <input type="date" class="form-control startDate" placeholder="璇烽�夋嫨寮�濮嬫棩鏈�" v-model="moreInfo.conditions.startDate" />
+ <p style="position: relative; top: 6px;">{{moreInfo.conditions.startDate || '--'}}</p>
<span style="margin: 0 5px;">鑷�</span>
- <input type="date" class="form-control endDate" placeholder="璇烽�夋嫨缁撴潫鏃ユ湡" v-model="moreInfo.conditions.endDate" />
+ <p style="position: relative; top: 6px;">{{moreInfo.conditions.endDate || '--'}}</p>
</div>
<div class="action-buttons">
- <button type="button" class="edit-btn" v-on:click="_editPublicIncome()" style="line-height: 0px;">缂栬緫</button>
+ <!-- <button type="button" class="edit-btn" v-on:click="_editPublicIncome()" style="line-height: 0px;">缂栬緫</button> -->
<button type="button" class="add-btn" v-on:click="_add()" style="line-height: 0px;">娣诲姞</button>
<button type="button" class="import-btn" v-on:click="_export()" style="line-height: 0px; background-color: white; color: #333; border: 1px solid #e8e8e8;">瀵煎嚭</button>
</div>
diff --git a/public/pages/property/costDetail/more/more.js b/public/pages/property/costDetail/more/more.js
index 47ebaa5..1e3e719 100644
--- a/public/pages/property/costDetail/more/more.js
+++ b/public/pages/property/costDetail/more/more.js
@@ -32,9 +32,13 @@
},
_initMethod: function () {
$that = vc.component;
- $that._injectStyles();
$that._initDate();
- $that._listData(DEFAULT_PAGE, DEFAULT_ROWS);
+ // 杩涘叆椤甸潰鏃剁珛鍗宠皟鐢ㄦ帴鍙�
+ $that._loadPublicIncomeData(DEFAULT_PAGE, DEFAULT_ROWS);
+ // 鏍规嵁褰撳墠鏍囩椤靛姞杞芥暟鎹�
+ if ($that.moreInfo.currentTab !== 'publicIncome') {
+ $that._listData(DEFAULT_PAGE, DEFAULT_ROWS);
+ }
},
_initEvent: function () {
},
@@ -113,7 +117,112 @@
changeTab: function (_tab) {
$that.moreInfo.currentTab = _tab;
// 鏍规嵁鏍囩椤靛姞杞戒笉鍚屾暟鎹�
- $that._listData(DEFAULT_PAGE, $that.moreInfo.paginationInfo.rows);
+ if (_tab === 'publicIncome') {
+ // 鍏叡鏀剁泭閲戞爣绛撅紝璋冪敤鐗规畩鎺ュ彛
+ $that._loadPublicIncomeData(DEFAULT_PAGE, $that.moreInfo.paginationInfo.rows);
+ } else {
+ $that._listData(DEFAULT_PAGE, $that.moreInfo.paginationInfo.rows);
+ }
+ },
+ _loadPublicIncomeData: function (_page, _rows) {
+ // 鑾峰彇URL鍙傛暟涓殑costDetailId
+ var costDetailId = vc.getParam('costDetailId');
+ if (!costDetailId) {
+ // 灏濊瘯浠巋ash涓幏鍙�
+ var hash = location.hash;
+ if (hash && hash.indexOf('?') !== -1) {
+ var hashParams = hash.substring(hash.indexOf('?') + 1);
+ var params = hashParams.split('&');
+ for (var i = 0; i < params.length; i++) {
+ var param = params[i].split('=');
+ if (param[0] === 'costDetailId') {
+ costDetailId = decodeURIComponent(param[1] || '');
+ break;
+ }
+ }
+ }
+ }
+
+ if (!costDetailId) {
+ vc.toast('缂哄皯costDetailId鍙傛暟');
+ return;
+ }
+
+ var param = {
+ params: {
+ mpId: costDetailId,
+ page: _page,
+ row: _rows
+ }
+ };
+
+ // 璋冪敤鍏叡鏀剁泭閲戞帴鍙�
+ vc.http.apiGet('/announcementTimeRange/queryAnnouncementTimeRangeInfo',
+ param,
+ function (json, res) {
+ try {
+ var _json = JSON.parse(json);
+ if (_json.code === "0000") {
+ var total = _json.total || 0;
+ var rows = _rows || DEFAULT_ROWS;
+ // 璁$畻鎬婚〉鏁�
+ var totalPages = Math.ceil(total / rows);
+ if (totalPages === 0) {
+ totalPages = 1;
+ }
+
+ $that.moreInfo.paginationInfo.dataCount = total;
+ $that.moreInfo.paginationInfo.total = totalPages;
+
+ // 鏄犲皠鏁版嵁瀛楁
+ var dataList = [];
+ if (_json.data && Array.isArray(_json.data)) {
+ dataList = _json.data.map(function(item) {
+ return {
+ id: item.id,
+ mpId: item.mpId,
+ proposedStartDate: item.plannedAnnouncementStart || '-',
+ proposedEndDate: item.plannedAnnouncementEnd || '-',
+ publishedStartDate: item.publishedAnnouncementStart || '-',
+ publishedEndDate: item.publishedAnnouncementEnd || '-',
+ createTime: item.createTime || '',
+ updateTime: item.updateTime || '',
+ _originalData: item
+ };
+ });
+ }
+
+ $that.moreInfo.dataList = dataList;
+ $that.moreInfo.paginationInfo.currentPage = _page;
+ $that._freshPageList();
+ } else {
+ vc.toast(_json.msg || '鏌ヨ澶辫触');
+ $that.moreInfo.dataList = [];
+ $that.moreInfo.paginationInfo.dataCount = 0;
+ $that.moreInfo.paginationInfo.total = 1;
+ $that.moreInfo.paginationInfo.currentPage = _page;
+ $that._freshPageList();
+ }
+ } catch (e) {
+ console.error('鏁版嵁瑙f瀽澶辫触:', e);
+ vc.toast('鏁版嵁瑙f瀽澶辫触');
+ $that.moreInfo.dataList = [];
+ $that.moreInfo.paginationInfo.dataCount = 0;
+ $that.moreInfo.paginationInfo.total = 1;
+ $that.moreInfo.paginationInfo.currentPage = _page;
+ $that._freshPageList();
+ }
+ },
+ function (errInfo, error) {
+ console.error('璇锋眰澶辫触:', errInfo, error);
+ vc.toast(errInfo || '璇锋眰澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�');
+ $that.moreInfo.dataList = [];
+ $that.moreInfo.paginationInfo.dataCount = 0;
+ $that.moreInfo.paginationInfo.total = 1;
+ $that.moreInfo.paginationInfo.currentPage = _page;
+ $that._freshPageList();
+ }
+ );
},
_listData: function (_page, _rows) {
$that.moreInfo.conditions.page = _page;
@@ -240,13 +349,21 @@
$that.moreInfo.paginationInfo.pageList = pageList;
},
_changePageSize: function () {
- $that._listData(DEFAULT_PAGE, $that.moreInfo.paginationInfo.rows);
+ if ($that.moreInfo.currentTab === 'publicIncome') {
+ $that._loadPublicIncomeData(DEFAULT_PAGE, $that.moreInfo.paginationInfo.rows);
+ } else {
+ $that._listData(DEFAULT_PAGE, $that.moreInfo.paginationInfo.rows);
+ }
},
_goToPage: function (_page) {
if (!_page || _page < 1 || _page > $that.moreInfo.paginationInfo.total) {
return;
}
- $that._listData(_page, $that.moreInfo.paginationInfo.rows);
+ if ($that.moreInfo.currentTab === 'publicIncome') {
+ $that._loadPublicIncomeData(_page, $that.moreInfo.paginationInfo.rows);
+ } else {
+ $that._listData(_page, $that.moreInfo.paginationInfo.rows);
+ }
},
_jumpToPage: function () {
var page = parseInt($that.moreInfo.jumpPage);
@@ -256,7 +373,11 @@
if (page > $that.moreInfo.paginationInfo.total) {
page = $that.moreInfo.paginationInfo.total;
}
- $that._listData(page, $that.moreInfo.paginationInfo.rows);
+ if ($that.moreInfo.currentTab === 'publicIncome') {
+ $that._loadPublicIncomeData(page, $that.moreInfo.paginationInfo.rows);
+ } else {
+ $that._listData(page, $that.moreInfo.paginationInfo.rows);
+ }
},
_add: function () {
// 娣诲姞鍔熻兘
diff --git a/public/vcCore/core.js b/public/vcCore/core.js
index 50416c1..97f4c00 100644
--- a/public/vcCore/core.js
+++ b/public/vcCore/core.js
@@ -471,6 +471,19 @@
})(window.vc);
/**
+ confirm
+ **/
+(function (vc) {
+ vc.confirm = function Confirm(msg, callback) {
+ if (window.confirm(msg)) {
+ if (typeof callback === 'function') {
+ callback();
+ }
+ }
+ }
+})(window.vc);
+
+/**
toast
**/
(function (vc) {
diff --git a/public/vcCore/vcFramework.js b/public/vcCore/vcFramework.js
index 28f7586..396f49c 100644
--- a/public/vcCore/vcFramework.js
+++ b/public/vcCore/vcFramework.js
@@ -2228,6 +2228,19 @@
})(window.vcFramework);
/**
+ confirm
+ **/
+(function (vcFramework) {
+ vcFramework.confirm = function Confirm(msg, callback) {
+ if (window.confirm(msg)) {
+ if (typeof callback === 'function') {
+ callback();
+ }
+ }
+ }
+})(window.vcFramework);
+
+/**
toast
**/
(function (vcFramework) {
--
Gitblit v1.8.0