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/costDetail.js | 53 -
public/pages/property/costDetail/edit/edit.js | 338 ++++++++++-
public/pages/property/costDetail/more/more.js | 398 ++++++++++++--
public/pages/property/costDetail/detail/detail.html | 39
public/pages/property/costDetail/more/more.html | 227 ++++++--
public/pages/property/costDetail/add/add.html | 53 +
public/css/vc.css | 146 +++++
public/pages/property/costDetail/edit/edit.html | 53 +
public/pages/property/costDetail/add/add.js | 245 ++++++++
public/pages/property/costDetail/detail/detail.js | 38
10 files changed, 1,301 insertions(+), 289 deletions(-)
diff --git a/public/css/vc.css b/public/css/vc.css
index 0db6a65..1783e4a 100644
--- a/public/css/vc.css
+++ b/public/css/vc.css
@@ -1366,13 +1366,15 @@
transition: all 0.3s;
}
-.cost-detail-container .action-buttons .add-btn, .cost-detail-container .action-buttons .import-btn{
+.cost-detail-container .action-buttons .add-btn,
+.cost-detail-container .action-buttons .import-btn {
background: #1677ff;
color: #fff;
border: 1px solid #1677ff;
}
-.cost-detail-container .action-buttons .add-btn:hover, .cost-detail-container .action-buttons .import-btn:hover {
+.cost-detail-container .action-buttons .add-btn:hover,
+.cost-detail-container .action-buttons .import-btn:hover {
background: #4096ff;
}
@@ -1583,6 +1585,132 @@
border-radius: 4px;
}
+.multi-select-wrapper {
+ position: relative;
+ display: inline-block;
+ width: 220px;
+ vertical-align: middle;
+}
+
+.multi-select-input {
+ position: relative;
+ top: 12px;
+ display: flex;
+ align-items: center;
+ padding: 6px 30px 6px 6px;
+ border: 1px solid #ddd;
+ border-radius: 4px;
+ background-color: #fff;
+ cursor: pointer;
+ min-height: 32px;
+ box-sizing: border-box;
+}
+
+.multi-select-input:hover {
+ border-color: #1ab394;
+}
+
+.multi-select-input.active {
+ border-color: #1ab394;
+ box-shadow: 0 0 0 2px rgba(26, 179, 148, 0.1);
+}
+
+.multi-select-tags {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 4px;
+ flex: 1;
+ align-items: center;
+}
+
+.multi-select-tag {
+ display: inline-flex;
+ align-items: center;
+ padding: 2px 6px;
+ background-color: #f0f0f0;
+ border: 1px solid #ddd;
+ border-radius: 3px;
+ font-size: 12px;
+ color: #333;
+ white-space: nowrap;
+}
+
+.multi-select-tag-close {
+ margin-left: 4px;
+ cursor: pointer;
+ color: #999;
+ font-size: 14px;
+ line-height: 1;
+ font-weight: bold;
+}
+
+.multi-select-tag-close:hover {
+ color: #ed5565;
+}
+
+.multi-select-placeholder {
+ color: #999;
+ font-size: 14px;
+}
+
+.multi-select-arrow {
+ position: absolute;
+ right: 8px;
+ top: 50%;
+ transform: translateY(-50%);
+ color: #666;
+ font-size: 12px;
+ pointer-events: none;
+ transition: transform 0.2s;
+}
+
+.multi-select-input.active .multi-select-arrow {
+ transform: translateY(-50%) rotate(180deg);
+}
+
+.multi-select-dropdown {
+ position: absolute;
+ top: 110%;
+ left: 0;
+ right: 0;
+ margin-top: 4px;
+ background-color: #fff;
+ border: 1px solid #ddd;
+ border-radius: 4px;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
+ z-index: 1000;
+ max-height: 300px;
+ overflow-y: auto;
+}
+
+.multi-select-option {
+
+ display: flex;
+ align-items: center;
+ padding: 8px 12px;
+ cursor: pointer;
+ transition: background-color 0.2s;
+}
+
+.multi-select-option:hover {
+ background-color: #f5f5f5;
+}
+
+.multi-select-option input[type="checkbox"] {
+ margin-right: 8px;
+ cursor: pointer;
+ width: 16px;
+ height: 16px;
+}
+
+.multi-select-option label {
+ cursor: pointer;
+ flex: 1;
+ margin: 0;
+ font-size: 14px;
+ color: #333;
+}
+
.form-container .btn-group {
margin-left: 95px;
margin-top: 25px;
@@ -1618,7 +1746,7 @@
line-height: 32px;
}
-.form-label-detail{
+.form-label-detail {
padding: 0px 0 15px 0;
margin: 0px;
font-size: 14px;
@@ -1633,13 +1761,14 @@
margin-right: 15px;
}
-#ownerScope{
+#ownerScope {
position: relative;
top: 12px;
width: 180px;
height: 32px;
}
-#buildingScope{
+
+#buildingScope {
position: relative;
top: 12px;
width: 180px;
@@ -1662,6 +1791,7 @@
}
@media (max-width: 1400px) {
+
#button-container .role-a-checkbox,
#data-container .role-a-checkbox {
flex: 0 0 calc((100% - 60px) / 7);
@@ -1669,6 +1799,7 @@
}
@media (max-width: 1200px) {
+
#button-container .role-a-checkbox,
#data-container .role-a-checkbox {
flex: 0 0 calc((100% - 50px) / 6);
@@ -1676,6 +1807,7 @@
}
@media (max-width: 992px) {
+
#button-container .role-a-checkbox,
#data-container .role-a-checkbox {
flex: 0 0 calc((100% - 40px) / 5);
@@ -1683,11 +1815,13 @@
}
@media (max-width: 768px) {
+
#button-container .role-a-checkbox,
#data-container .role-a-checkbox {
flex: 0 0 calc((100% - 20px) / 2);
}
}
+
.role-a-checkbox label {
padding-top: 5px;
}
@@ -1698,7 +1832,6 @@
color: #1677ff;
}
-/* 缂栬緫鍏叡鏀剁泭閲戝脊绐楁牱寮� */
.edit-public-income-modal .edit-form-group {
display: flex;
align-items: center;
@@ -1752,7 +1885,6 @@
cursor: pointer;
}
-/* 纭繚缂栬緫鍏叡鏀剁泭閲戝脊绐楀眳涓樉绀� */
#editPublicIncomeModal {
display: flex !important;
align-items: center;
diff --git a/public/pages/property/costDetail/add/add.html b/public/pages/property/costDetail/add/add.html
index 53c2294..fe36287 100644
--- a/public/pages/property/costDetail/add/add.html
+++ b/public/pages/property/costDetail/add/add.html
@@ -53,7 +53,16 @@
<label for="committeeSealNo" style="margin-top: 8px;">鍚�</label>
</div>
<label class="form-label" for="approveDept">绛炬姤閮ㄩ棬</label>
- <input type="text" id="approveDept" class="form-input" placeholder="璇疯緭鍏�" v-model="costDetailInfo.approvalDepartment" style="width: 120px;">
+ <select id="approveDept" class="form-input" v-model="costDetailInfo.approvalDepartment" style="width: 120px;">
+ <option value="">璇烽�夋嫨</option>
+ <option value="鐢垫閮�">鐢垫閮�</option>
+ <option value="宸ョ▼閮�">宸ョ▼閮�</option>
+ <option value="绠$悊澶�">绠$悊澶�</option>
+ <option value="涓氬浼�">涓氬浼�</option>
+ <option value="鏅鸿兘鍖�">鏅鸿兘鍖�</option>
+ <option value="鍝佽川閮�">鍝佽川閮�</option>
+ <option value="灏忓尯缁忕悊">灏忓尯缁忕悊</option>
+ </select>
</div>
<!-- 鍒嗘憡鑼冨洿 + 缁翠慨绫诲瀷 -->
@@ -78,13 +87,43 @@
</div>
<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>
- </select>
+ <div class="multi-select-wrapper">
+ <div class="multi-select-input" @click="toggleOwnerScopeDropdown" :class="{ 'active': ownerScopeDropdownOpen }">
+ <div class="multi-select-tags">
+ <span v-for="(item, index) in (costDetailInfo.ownerScope || [])" :key="'tag-' + index" class="multi-select-tag">
+ {{ item }}
+ <span class="multi-select-tag-close" @click.stop="removeOwnerScopeItem(index)">脳</span>
+ </span>
+ <span v-if="!costDetailInfo.ownerScope || costDetailInfo.ownerScope.length === 0" class="multi-select-placeholder">璇烽�夋嫨</span>
+ </div>
+ <span class="multi-select-arrow">鈻�</span>
+ </div>
+ <div class="multi-select-dropdown" v-show="ownerScopeDropdownOpen">
+ <div class="multi-select-option" v-for="(option, index) in ownerScopeOptions" :key="'option-' + index" @click.stop="toggleOwnerScopeOption(option)">
+ <input type="checkbox" :checked="costDetailInfo.ownerScope && costDetailInfo.ownerScope.indexOf(option) !== -1" @click.stop="toggleOwnerScopeOption(option)">
+ <label>{{ option }}</label>
+ </div>
+ </div>
+ </div>
<label class="form-label" for="buildingScope">闂ㄧ墝骞㈣寖鍥�</label>
- <select id="buildingScope" class="form-select">
- <option value="multi">澶氶��</option>
- </select>
+ <div class="multi-select-wrapper">
+ <div class="multi-select-input" @click="toggleBuildingScopeDropdown" :class="{ 'active': buildingScopeDropdownOpen }">
+ <div class="multi-select-tags">
+ <span v-for="(item, index) in (costDetailInfo.buildingScope || [])" :key="'building-tag-' + index" class="multi-select-tag">
+ {{ item }}
+ <span class="multi-select-tag-close" @click.stop="removeBuildingScopeItem(index)">脳</span>
+ </span>
+ <span v-if="!costDetailInfo.buildingScope || costDetailInfo.buildingScope.length === 0" class="multi-select-placeholder">璇烽�夋嫨</span>
+ </div>
+ <span class="multi-select-arrow">鈻�</span>
+ </div>
+ <div class="multi-select-dropdown" v-show="buildingScopeDropdownOpen">
+ <div class="multi-select-option" v-for="(option, index) in buildingScopeOptions" :key="'building-option-' + index" @click.stop="toggleBuildingScopeOption(option)">
+ <input type="checkbox" :checked="costDetailInfo.buildingScope && costDetailInfo.buildingScope.indexOf(option) !== -1" @click.stop="toggleBuildingScopeOption(option)">
+ <label>{{ option }}</label>
+ </div>
+ </div>
+ </div>
</div>
</div>
diff --git a/public/pages/property/costDetail/add/add.js b/public/pages/property/costDetail/add/add.js
index e4907fb..9b8f12f 100644
--- a/public/pages/property/costDetail/add/add.js
+++ b/public/pages/property/costDetail/add/add.js
@@ -21,16 +21,201 @@
fundTypeLevel2: '',
buildingType: '1',
maintenanceType: '',
- fundType: 'repair', // 榛樿閫変腑缁翠慨璧勯噾
- fundSystemType: 'out' // 榛樿閫変腑绯荤粺澶�
- }
+ fundType: 'repair',
+ fundSystemType: 'out',
+ ownerScope: [],
+ buildingScope: []
+ },
+ ownerScopeOptions: [
+ '鏈哄姩杞﹀仠杞﹀簱(浣�)',
+ '灏忓尯閬撹矾',
+ '浜ら�氶檮灞炶鏂�',
+ '闈炴満鍔ㄨ溅杞﹀簱(鐩告湅)',
+ '灏忓尯鍏叡鐓ф槑',
+ '閿呯倝',
+ '鎺掓按銆佹帓姹¤鏂�',
+ '娑堥槻绯荤粺',
+ '瀹夐槻璁炬柦',
+ '鍏叡鏅缁垮寲',
+ '鍋ヨ韩銆佹父涔愯鏂�',
+ '灏忓尯瀹d紶銆佹爣璇�',
+ '寮虹數',
+ '寮辩數',
+ '閫氫俊璁炬柦',
+ '鍏叡鐢ㄦ埧',
+ '骞冲眿闈�',
+ '妤兼爧澶栫珛闈�',
+ '渚涚數璁炬柦',
+ '鏆栭�氱郴缁�',
+ '渚涙按绯荤粺',
+ '閫氱敤璁炬柦(閰嶄欢)'
+ ],
+ ownerScopeDropdownOpen: false,
+ buildingScopeOptions: [
+ '鏈哄姩杞﹀仠杞﹀簱(浣�)',
+ '浜ら�氶檮灞炶鏂�',
+ '灏忓尯閬撹矾',
+ '鍏叡鏅缁垮寲',
+ '闈炴満鍔ㄨ溅杞﹀簱(妫�)',
+ '閿呯倝',
+ '鎺掓按銆佹帓姹¤鏂�',
+ '娑堥槻绯荤粺',
+ '瀹夐槻璁炬柦',
+ '鍋ヨ韩銆佹父涔愯鏂�',
+ '灏忓尯瀹d紶銆佹爣璇�',
+ '寮虹數',
+ '寮辩數',
+ '閫氫俊璁炬柦',
+ '鍏叡鐢ㄦ埧',
+ '骞冲眿闈�',
+ '澶槼鑳借鏂�',
+ '鍧″眿闈�',
+ '缁撴瀯',
+ '妤兼爧澶栫珛闈�',
+ '妤煎耿鍏ュ彛',
+ '妤煎耿鍏叡',
+ '妤奸亾璁炬柦',
+ '渚涚數璁炬柦',
+ '鏆栭�氱郴缁�',
+ '渚涙按绯荤粺',
+ '閫氱敤璁炬柦(閰嶄欢)',
+ '娉曢櫌寮哄埗鎵ц'
+ ],
+ buildingScopeDropdownOpen: false
},
_initMethod: function () {
$that = vc.component;
+ if (!$that.costDetailInfo) {
+ $that.costDetailInfo = {};
+ }
+ if (!$that.costDetailInfo.ownerScope || !Array.isArray($that.costDetailInfo.ownerScope)) {
+ $that.costDetailInfo.ownerScope = [];
+ }
+ if (!$that.costDetailInfo.buildingScope || !Array.isArray($that.costDetailInfo.buildingScope)) {
+ $that.costDetailInfo.buildingScope = [];
+ }
+ if (!$that.ownerScopeOptions || !Array.isArray($that.ownerScopeOptions)) {
+ $that.ownerScopeOptions = [
+ '鏈哄姩杞﹀仠杞﹀簱(浣�)',
+ '灏忓尯閬撹矾',
+ '浜ら�氶檮灞炶鏂�',
+ '闈炴満鍔ㄨ溅杞﹀簱(鐩告湅)',
+ '灏忓尯鍏叡鐓ф槑',
+ '閿呯倝',
+ '鎺掓按銆佹帓姹¤鏂�',
+ '娑堥槻绯荤粺',
+ '瀹夐槻璁炬柦',
+ '鍏叡鏅缁垮寲',
+ '鍋ヨ韩銆佹父涔愯鏂�',
+ '灏忓尯瀹d紶銆佹爣璇�',
+ '寮虹數',
+ '寮辩數',
+ '閫氫俊璁炬柦',
+ '鍏叡鐢ㄦ埧',
+ '骞冲眿闈�',
+ '妤兼爧澶栫珛闈�',
+ '渚涚數璁炬柦',
+ '鏆栭�氱郴缁�',
+ '渚涙按绯荤粺',
+ '閫氱敤璁炬柦(閰嶄欢)'
+ ];
+ }
+ if ($that.ownerScopeDropdownOpen === undefined) {
+ $that.ownerScopeDropdownOpen = false;
+ }
+ if (!$that.buildingScopeOptions || !Array.isArray($that.buildingScopeOptions)) {
+ $that.buildingScopeOptions = [
+ '鏈哄姩杞﹀仠杞﹀簱(浣�)',
+ '浜ら�氶檮灞炶鏂�',
+ '灏忓尯閬撹矾',
+ '鍏叡鏅缁垮寲',
+ '闈炴満鍔ㄨ溅杞﹀簱(妫�)',
+ '閿呯倝',
+ '鎺掓按銆佹帓姹¤鏂�',
+ '娑堥槻绯荤粺',
+ '瀹夐槻璁炬柦',
+ '鍋ヨ韩銆佹父涔愯鏂�',
+ '灏忓尯瀹d紶銆佹爣璇�',
+ '寮虹數',
+ '寮辩數',
+ '閫氫俊璁炬柦',
+ '鍏叡鐢ㄦ埧',
+ '骞冲眿闈�',
+ '澶槼鑳借鏂�',
+ '鍧″眿闈�',
+ '缁撴瀯',
+ '妤兼爧澶栫珛闈�',
+ '妤煎耿鍏ュ彛',
+ '妤煎耿鍏叡',
+ '妤奸亾璁炬柦',
+ '渚涚數璁炬柦',
+ '鏆栭�氱郴缁�',
+ '渚涙按绯荤粺',
+ '閫氱敤璁炬柦(閰嶄欢)',
+ '娉曢櫌寮哄埗鎵ц'
+ ];
+ }
+ if ($that.buildingScopeDropdownOpen === undefined) {
+ $that.buildingScopeDropdownOpen = false;
+ }
+ var clickHandler = function (e) {
+ if (!e.target.closest('.multi-select-wrapper')) {
+ if ($that && $that.ownerScopeDropdownOpen !== undefined) {
+ $that.ownerScopeDropdownOpen = false;
+ }
+ if ($that && $that.buildingScopeDropdownOpen !== undefined) {
+ $that.buildingScopeDropdownOpen = false;
+ }
+ }
+ };
+ setTimeout(function () {
+ document.addEventListener('click', clickHandler);
+ }, 100);
},
methods: {
+ toggleOwnerScopeDropdown: function () {
+ if ($that && $that.ownerScopeDropdownOpen !== undefined) {
+ $that.ownerScopeDropdownOpen = !$that.ownerScopeDropdownOpen;
+ }
+ },
+ toggleOwnerScopeOption: function (option) {
+ if (!$that || !$that.costDetailInfo || !$that.costDetailInfo.ownerScope) {
+ return;
+ }
+ var index = $that.costDetailInfo.ownerScope.indexOf(option);
+ if (index === -1) {
+ $that.costDetailInfo.ownerScope.push(option);
+ } else {
+ $that.costDetailInfo.ownerScope.splice(index, 1);
+ }
+ },
+ removeOwnerScopeItem: function (index) {
+ if ($that && $that.costDetailInfo && $that.costDetailInfo.ownerScope) {
+ $that.costDetailInfo.ownerScope.splice(index, 1);
+ }
+ },
+ toggleBuildingScopeDropdown: function () {
+ if ($that && $that.buildingScopeDropdownOpen !== undefined) {
+ $that.buildingScopeDropdownOpen = !$that.buildingScopeDropdownOpen;
+ }
+ },
+ toggleBuildingScopeOption: function (option) {
+ if (!$that || !$that.costDetailInfo || !$that.costDetailInfo.buildingScope) {
+ return;
+ }
+ var index = $that.costDetailInfo.buildingScope.indexOf(option);
+ if (index === -1) {
+ $that.costDetailInfo.buildingScope.push(option);
+ } else {
+ $that.costDetailInfo.buildingScope.splice(index, 1);
+ }
+ },
+ removeBuildingScopeItem: function (index) {
+ if ($that && $that.costDetailInfo && $that.costDetailInfo.buildingScope) {
+ $that.costDetailInfo.buildingScope.splice(index, 1);
+ }
+ },
_saveCostDetail: function () {
- // 楠岃瘉蹇呭~瀛楁
if (!$that.costDetailInfo.flowCode) {
vc.toast('璇疯緭鍏ユ祦杞紪鐮�');
return;
@@ -47,8 +232,35 @@
vc.toast('璇疯緭鍏ュ皬鍖虹紪鐮�');
return;
}
-
- // 鏋勫缓淇濆瓨鏁版嵁
+
+ var fundTypeLevel1 = '';
+ if ($that.costDetailInfo.fundType === 'repair') {
+ fundTypeLevel1 = '缁翠慨璧勯噾';
+ } else if ($that.costDetailInfo.fundType === 'public') {
+ fundTypeLevel1 = '鍏叡鏀剁泭';
+ }
+
+ var fundTypeLevel2 = '';
+ var buildingOrAll = '';
+
+ if ($that.costDetailInfo.fundType === 'repair') {
+ fundTypeLevel2 = ($that.costDetailInfo.ownerScope && $that.costDetailInfo.ownerScope.length > 0)
+ ? $that.costDetailInfo.ownerScope.join(',')
+ : '';
+ buildingOrAll = ($that.costDetailInfo.buildingScope && $that.costDetailInfo.buildingScope.length > 0)
+ ? $that.costDetailInfo.buildingScope.join(',')
+ : '';
+ } else if ($that.costDetailInfo.fundType === 'public') {
+ if ($that.costDetailInfo.fundSystemType === 'out') {
+ fundTypeLevel2 = '绯荤粺澶�';
+ } else if ($that.costDetailInfo.fundSystemType === 'in') {
+ fundTypeLevel2 = '绯荤粺鍐�';
+ }
+ buildingOrAll = '';
+ } else {
+ buildingOrAll = '';
+ }
+
var saveData = {
flowNumber: $that.costDetailInfo.flowCode,
date: $that.costDetailInfo.date,
@@ -61,14 +273,16 @@
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'),
+ fundTypeLevel1: fundTypeLevel1,
+ fundTypeLevel2: fundTypeLevel2,
maintenanceType: $that.costDetailInfo.maintenanceType || '',
communityId: vc.getCurrentCommunity().communityId
};
-
- // 瑙f瀽鏃ユ湡
+
+ if ($that.costDetailInfo.fundType === 'repair') {
+ saveData.buildingOrAll = buildingOrAll;
+ }
+
if (saveData.date) {
var dateParts = saveData.date.split('-');
if (dateParts.length >= 2) {
@@ -81,14 +295,14 @@
}
vc.http.apiPost('/maintenancePayment/saveMaintenancePayment',
JSON.stringify(saveData), {
- emulateJSON: true
- },
+ emulateJSON: true
+ },
function (json, res) {
try {
var _json = JSON.parse(json);
if (_json.code === 0 || _json.code === '0') {
vc.toast('淇濆瓨鎴愬姛');
- setTimeout(function() {
+ setTimeout(function () {
vc.goBack();
}, 1000);
} else {
@@ -110,5 +324,4 @@
}
}
});
-})(window.vc);
-
+})(window.vc);
\ No newline at end of file
diff --git a/public/pages/property/costDetail/costDetail.js b/public/pages/property/costDetail/costDetail.js
index fd62347..870f984 100644
--- a/public/pages/property/costDetail/costDetail.js
+++ b/public/pages/property/costDetail/costDetail.js
@@ -45,36 +45,29 @@
},
methods: {
_initDate: function () {
- // 骞翠唤杈撳叆妗嗕笉闇�瑕佺壒娈婂垵濮嬪寲锛屼娇鐢� 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) {
- // 浣跨敤閫変腑鐨勫皬鍖哄悕绉帮紝濡傛灉娌℃湁閫変腑鍒欎娇鐢ㄥ綋鍓嶅皬鍖哄悕绉�
var selectedCommunityName = $that.costDetailInfo.conditions.communityName || vc.getCurrentCommunity().name;
var params = {
communityName: selectedCommunityName,
page: _page,
row: _rows
};
-
- // 娣诲姞鍙�夋煡璇㈠弬鏁�
+
if ($that.costDetailInfo.conditions.flowNumber) {
params.flowNumber = $that.costDetailInfo.conditions.flowNumber;
}
@@ -87,21 +80,21 @@
if ($that.costDetailInfo.conditions.projectName) {
params.projectName = $that.costDetailInfo.conditions.projectName;
}
-
+
var param = {
params: params
};
-
+
vc.http.apiGet('/maintenancePayment/queryMaintenancePayment',
param,
function (json, res) {
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 mappedRecords = records.map(function (item) {
var dateStr = '';
if (item.date) {
dateStr = item.date.substring(0, 7);
@@ -109,7 +102,7 @@
var monthStr = item.month < 10 ? '0' + item.month : String(item.month);
dateStr = item.year + '-' + monthStr;
}
-
+
return {
flowCode: item.flowNumber || '--',
communityCode: item.projectCode || '--',
@@ -130,10 +123,10 @@
_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;
@@ -168,7 +161,7 @@
var currentPage = $that.costDetailInfo.paginationInfo.currentPage;
var total = $that.costDetailInfo.paginationInfo.total;
var pageList = [];
-
+
if (total <= 7) {
for (var i = 1; i <= total; i++) {
pageList.push({
@@ -244,14 +237,13 @@
});
}
}
-
+
$that.costDetailInfo.paginationInfo.pageList = pageList;
},
_queryCostDetails: function () {
$that._listCostDetails(DEFAULT_PAGE, $that.costDetailInfo.paginationInfo.rows);
},
_resetQuery: function () {
- // 閲嶇疆鏃舵仮澶嶄负绗竴涓皬鍖�
if ($that.costDetailInfo.communityList && $that.costDetailInfo.communityList.length > 0) {
$that.costDetailInfo.conditions.communityName = $that.costDetailInfo.communityList[0].name;
} else {
@@ -285,27 +277,21 @@
$that._listCostDetails(page, $that.costDetailInfo.paginationInfo.rows);
},
_downloadTemplate: function () {
- // 涓嬭浇妯℃澘
vc.toast('妯℃澘涓嬭浇鍔熻兘');
},
_importCostDetail: function () {
- // 鎵撳紑鏈湴鏂囦欢
vc.toast('璐圭敤瀵煎叆鍔熻兘');
},
_addCostDetail: function () {
- // 璺宠浆鍒版坊鍔犻〉闈�
vc.jumpToPage('/#/pages/property/costDetail/add');
},
_viewCostDetail: function (_item) {
- // 鏌ョ湅璇︽儏
vc.jumpToPage('/#/pages/property/costDetail/detail?costDetailId=' + _item.costDetailId);
},
_viewMore: function (_item) {
- // 鏌ョ湅鏇村
vc.jumpToPage('/#/pages/property/costDetail/more?costDetailId=' + _item.costDetailId);
},
_editCostDetail: function (_item) {
- // 缂栬緫
vc.jumpToPage('/#/pages/property/costDetail/edit?costDetailId=' + _item.costDetailId);
},
_deleteCostDetail: function (_item) {
@@ -321,10 +307,10 @@
};
vc.http.apiPost('/maintenancePayment/deleteMaintenancePayment',
JSON.stringify(param), {
- headers: {
- 'Content-Type': 'application/json'
- }
- },
+ headers: {
+ 'Content-Type': 'application/json'
+ }
+ },
function (json, res) {
try {
var _json = JSON.parse(json);
@@ -346,7 +332,6 @@
);
});
} else {
- // 濡傛灉 vc.confirm 涓嶅瓨鍦紝浣跨敤 window.confirm 浣滀负鍚庡鏂规
if (window.confirm('纭畾瑕佸垹闄よ繖鏉¤垂鐢ㄦ槑缁嗗悧锛�')) {
var param = {
id: _item.costDetailId,
@@ -354,10 +339,10 @@
};
vc.http.apiPost('/maintenancePayment/deleteMaintenancePayment',
JSON.stringify(param), {
- headers: {
- 'Content-Type': 'application/json'
- }
- },
+ headers: {
+ 'Content-Type': 'application/json'
+ }
+ },
function (json, res) {
try {
var _json = JSON.parse(json);
diff --git a/public/pages/property/costDetail/detail/detail.html b/public/pages/property/costDetail/detail/detail.html
index 6fb1c86..2751af9 100644
--- a/public/pages/property/costDetail/detail/detail.html
+++ b/public/pages/property/costDetail/detail/detail.html
@@ -4,29 +4,29 @@
<!-- 娴佽浆缂栫爜 + 鏃ユ湡 -->
<div class="form-row">
<label class="form-label-detail" for="flowCode">娴佽浆缂栫爜</label>
- <p>{{costDetailInfo.flowCode || '-'}}</p>
+ <p>{{costDetailInfo.flowCode || '--'}}</p>
<label class="form-label-detail" for="date">鏃ユ湡</label>
- <p>{{costDetailInfo.date || '-'}}</p>
+ <p>{{costDetailInfo.date || '--'}}</p>
</div>
<!-- 灏忓尯鍚嶇О + 灏忓尯缂栫爜 -->
<div class="form-row">
<label class="form-label-detail" for="communityName">灏忓尯鍚嶇О</label>
- <p>{{costDetailInfo.communityName || '-'}}</p>
+ <p>{{costDetailInfo.communityName || '--'}}</p>
<label class="form-label-detail">灏忓尯缂栫爜</label>
- <p>{{costDetailInfo.communityCode || '-'}}</p>
+ <p>{{costDetailInfo.communityCode || '--'}}</p>
</div>
<!-- 宸ョ▼鍐呭 -->
<div class="form-row">
<label class="form-label-detail" for="projectContent">宸ョ▼鍐呭</label>
- <p>{{costDetailInfo.projectContent || '-'}}</p>
+ <p>{{costDetailInfo.projectContent || '--'}}</p>
</div>
<!-- 绠$悊澶勯噾棰� + 鏄惁鐩栫珷 -->
<div class="form-row">
<label class="form-label-detail" for="mgmtAmount">绠$悊澶勯噾棰�</label>
- <p>{{costDetailInfo.managementAmount || '-'}} <span>鍏�</span></p>
+ <p>{{costDetailInfo.managementAmount || '--'}} <span>鍏�</span></p>
<label class="form-label-detail">鏄惁鐩栫珷</label>
<div class="radio-group">
<p>{{costDetailInfo.managementStamped == '1' ? '鏄�' : '鍚�'}}</p>
@@ -36,15 +36,15 @@
<!-- 涓氬浼氶噾棰� + 瀹′环閲戦 + 鏄惁鐩栫珷 + 绛炬姤閮ㄩ棬 -->
<div class="form-row">
<label class="form-label-detail" for="committeeAmount">涓氬浼氶噾棰�</label>
- <p>{{costDetailInfo.committeeAmount || '-'}} <span>鍏�</span></p>
+ <p>{{costDetailInfo.committeeAmount || '--'}} <span>鍏�</span></p>
<label class="form-label-detail" for="auditAmount">瀹′环閲戦</label>
- <p>{{costDetailInfo.appraisalAmount || '-'}} <span>鍏�</span></p>
+ <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-detail" for="approveDept">绛炬姤閮ㄩ棬</label>
- <p>{{costDetailInfo.approvalDepartment || '-'}}</p>
+ <p>{{costDetailInfo.approvalDepartment || '--'}}</p>
</div>
<!-- 鍒嗘憡鑼冨洿 + 缁翠慨绫诲瀷 -->
@@ -54,25 +54,16 @@
<p>{{costDetailInfo.buildingType == '鍏ㄤ綋' || costDetailInfo.buildingType == '2' ? '鍏ㄤ綋' : '骞�'}}</p>
</div>
<label class="form-label-detail" for="repairType">缁翠慨绫诲瀷</label>
- <p>{{costDetailInfo.maintenanceType || '-'}}</p>
+ <p>{{costDetailInfo.maintenanceType || '--'}}</p>
</div>
<!-- 鍩洪噾涓庤鏂� + 涓氫富澶т細鑼冨洿 + 闂ㄧ墝骞㈣寖鍥� -->
<div class="form-row">
- <label class="form-label-detail">鍩洪噾涓庤鏂�</label>
- <div class="radio-group">
- <p>{{costDetailInfo.fundTypeLevel1 || '-'}}</p>
- </div>
- <label class="form-label-detail" for="ownerScope">涓氫富澶т細鑼冨洿</label>
- <p>{{costDetailInfo.ownerScope || '-'}}</p>
- <label class="form-label-detail" for="buildingScope">闂ㄧ墝骞㈣寖鍥�</label>
- <p>{{costDetailInfo.buildingScope || '-'}}</p>
- </div>
-
- <div class="form-row" v-if="costDetailInfo.fundTypeLevel2">
- <div class="radio-group" style="margin-left: 100px;">
- <p>{{costDetailInfo.fundTypeLevel2}}</p>
- </div>
+ <label class="form-label-detail">{{costDetailInfo.fundTypeLevel1}}</label>
+ <label class="form-label-detail" for="ownerScope" v-if="costDetailInfo.fundTypeLevel1 == '缁翠慨鍩洪噾'">涓氫富澶т細鑼冨洿</label>
+ <p>{{costDetailInfo.fundTypeLevel2 || '--'}}</p>
+ <label class="form-label-detail" for="buildingScope" v-if="costDetailInfo.fundTypeLevel1 == '缁翠慨鍩洪噾'">闂ㄧ墝骞㈣寖鍥�</label>
+ <p v-if="costDetailInfo.fundTypeLevel1 == '缁翠慨鍩洪噾'">{{costDetailInfo.buildingScope || '--'}}</p>
</div>
<!-- 鎸夐挳缁� -->
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 () {
diff --git a/public/pages/property/costDetail/edit/edit.html b/public/pages/property/costDetail/edit/edit.html
index 24159ed..ecfcd50 100644
--- a/public/pages/property/costDetail/edit/edit.html
+++ b/public/pages/property/costDetail/edit/edit.html
@@ -53,7 +53,16 @@
<label for="committeeSealNo" style="margin-top: 8px;">鍚�</label>
</div>
<label class="form-label" for="approveDept">绛炬姤閮ㄩ棬</label>
- <input type="text" id="approveDept" class="form-input" placeholder="璇疯緭鍏�" v-model="costDetailInfo.approvalDepartment" style="width: 120px;">
+ <select id="approveDept" class="form-input" v-model="costDetailInfo.approvalDepartment" style="width: 120px;">
+ <option value="">璇烽�夋嫨</option>
+ <option value="鐢垫閮�">鐢垫閮�</option>
+ <option value="宸ョ▼閮�">宸ョ▼閮�</option>
+ <option value="绠$悊澶�">绠$悊澶�</option>
+ <option value="涓氬浼�">涓氬浼�</option>
+ <option value="鏅鸿兘鍖�">鏅鸿兘鍖�</option>
+ <option value="鍝佽川閮�">鍝佽川閮�</option>
+ <option value="灏忓尯缁忕悊">灏忓尯缁忕悊</option>
+ </select>
</div>
<!-- 鍒嗘憡鑼冨洿 + 缁翠慨绫诲瀷 -->
@@ -78,13 +87,43 @@
</div>
<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>
- </select>
+ <div class="multi-select-wrapper">
+ <div class="multi-select-input" @click="toggleOwnerScopeDropdown" :class="{ 'active': ownerScopeDropdownOpen }">
+ <div class="multi-select-tags">
+ <span v-for="(item, index) in (costDetailInfo.ownerScope || [])" :key="'tag-' + index" class="multi-select-tag">
+ {{ item }}
+ <span class="multi-select-tag-close" @click.stop="removeOwnerScopeItem(index)">脳</span>
+ </span>
+ <span v-if="!costDetailInfo.ownerScope || costDetailInfo.ownerScope.length === 0" class="multi-select-placeholder">璇烽�夋嫨</span>
+ </div>
+ <span class="multi-select-arrow">鈻�</span>
+ </div>
+ <div class="multi-select-dropdown" v-show="ownerScopeDropdownOpen">
+ <div class="multi-select-option" v-for="(option, index) in ownerScopeOptions" :key="'option-' + index" @click.stop="toggleOwnerScopeOption(option)">
+ <input type="checkbox" :checked="costDetailInfo.ownerScope && costDetailInfo.ownerScope.indexOf(option) !== -1" @click.stop="toggleOwnerScopeOption(option)">
+ <label>{{ option }}</label>
+ </div>
+ </div>
+ </div>
<label class="form-label" for="buildingScope">闂ㄧ墝骞㈣寖鍥�</label>
- <select id="buildingScope" class="form-select">
- <option value="multi">澶氶��</option>
- </select>
+ <div class="multi-select-wrapper">
+ <div class="multi-select-input" @click="toggleBuildingScopeDropdown" :class="{ 'active': buildingScopeDropdownOpen }">
+ <div class="multi-select-tags">
+ <span v-for="(item, index) in (costDetailInfo.buildingScope || [])" :key="'building-tag-' + index" class="multi-select-tag">
+ {{ item }}
+ <span class="multi-select-tag-close" @click.stop="removeBuildingScopeItem(index)">脳</span>
+ </span>
+ <span v-if="!costDetailInfo.buildingScope || costDetailInfo.buildingScope.length === 0" class="multi-select-placeholder">璇烽�夋嫨</span>
+ </div>
+ <span class="multi-select-arrow">鈻�</span>
+ </div>
+ <div class="multi-select-dropdown" v-show="buildingScopeDropdownOpen">
+ <div class="multi-select-option" v-for="(option, index) in buildingScopeOptions" :key="'building-option-' + index" @click.stop="toggleBuildingScopeOption(option)">
+ <input type="checkbox" :checked="costDetailInfo.buildingScope && costDetailInfo.buildingScope.indexOf(option) !== -1" @click.stop="toggleBuildingScopeOption(option)">
+ <label>{{ option }}</label>
+ </div>
+ </div>
+ </div>
</div>
</div>
diff --git a/public/pages/property/costDetail/edit/edit.js b/public/pages/property/costDetail/edit/edit.js
index da0016a..dc6d725 100644
--- a/public/pages/property/costDetail/edit/edit.js
+++ b/public/pages/property/costDetail/edit/edit.js
@@ -22,51 +22,234 @@
fundTypeLevel2: '',
buildingType: '1',
maintenanceType: '',
- fundType: 'repair', // 榛樿閫変腑缁翠慨璧勯噾
- fundSystemType: 'out' // 榛樿閫変腑绯荤粺澶�
- }
+ fundType: 'repair',
+ fundSystemType: 'out',
+ ownerScope: [],
+ buildingScope: []
+ },
+ ownerScopeOptions: [
+ '鏈哄姩杞﹀仠杞﹀簱(浣�)',
+ '灏忓尯閬撹矾',
+ '浜ら�氶檮灞炶鏂�',
+ '闈炴満鍔ㄨ溅杞﹀簱(鐩告湅)',
+ '灏忓尯鍏叡鐓ф槑',
+ '閿呯倝',
+ '鎺掓按銆佹帓姹¤鏂�',
+ '娑堥槻绯荤粺',
+ '瀹夐槻璁炬柦',
+ '鍏叡鏅缁垮寲',
+ '鍋ヨ韩銆佹父涔愯鏂�',
+ '灏忓尯瀹d紶銆佹爣璇�',
+ '寮虹數',
+ '寮辩數',
+ '閫氫俊璁炬柦',
+ '鍏叡鐢ㄦ埧',
+ '骞冲眿闈�',
+ '妤兼爧澶栫珛闈�',
+ '渚涚數璁炬柦',
+ '鏆栭�氱郴缁�',
+ '渚涙按绯荤粺',
+ '閫氱敤璁炬柦(閰嶄欢)'
+ ],
+ ownerScopeDropdownOpen: false,
+ buildingScopeOptions: [
+ '鏈哄姩杞﹀仠杞﹀簱(浣�)',
+ '浜ら�氶檮灞炶鏂�',
+ '灏忓尯閬撹矾',
+ '鍏叡鏅缁垮寲',
+ '闈炴満鍔ㄨ溅杞﹀簱(妫�)',
+ '閿呯倝',
+ '鎺掓按銆佹帓姹¤鏂�',
+ '娑堥槻绯荤粺',
+ '瀹夐槻璁炬柦',
+ '鍋ヨ韩銆佹父涔愯鏂�',
+ '灏忓尯瀹d紶銆佹爣璇�',
+ '寮虹數',
+ '寮辩數',
+ '閫氫俊璁炬柦',
+ '鍏叡鐢ㄦ埧',
+ '骞冲眿闈�',
+ '澶槼鑳借鏂�',
+ '鍧″眿闈�',
+ '缁撴瀯',
+ '妤兼爧澶栫珛闈�',
+ '妤煎耿鍏ュ彛',
+ '妤煎耿鍏叡',
+ '妤奸亾璁炬柦',
+ '渚涚數璁炬柦',
+ '鏆栭�氱郴缁�',
+ '渚涙按绯荤粺',
+ '閫氱敤璁炬柦(閰嶄欢)',
+ '娉曢櫌寮哄埗鎵ц'
+ ],
+ buildingScopeDropdownOpen: false
},
_initMethod: function () {
$that = vc.component;
- // 浠嶶RL鑾峰彇costDetailId
+ if (!$that.costDetailInfo) {
+ $that.costDetailInfo = {};
+ }
+ if (!$that.costDetailInfo.ownerScope || !Array.isArray($that.costDetailInfo.ownerScope)) {
+ $that.costDetailInfo.ownerScope = [];
+ }
+ if (!$that.costDetailInfo.buildingScope || !Array.isArray($that.costDetailInfo.buildingScope)) {
+ $that.costDetailInfo.buildingScope = [];
+ }
+ if (!$that.ownerScopeOptions || !Array.isArray($that.ownerScopeOptions)) {
+ $that.ownerScopeOptions = [
+ '鏈哄姩杞﹀仠杞﹀簱(浣�)',
+ '灏忓尯閬撹矾',
+ '浜ら�氶檮灞炶鏂�',
+ '闈炴満鍔ㄨ溅杞﹀簱(鐩告湅)',
+ '灏忓尯鍏叡鐓ф槑',
+ '閿呯倝',
+ '鎺掓按銆佹帓姹¤鏂�',
+ '娑堥槻绯荤粺',
+ '瀹夐槻璁炬柦',
+ '鍏叡鏅缁垮寲',
+ '鍋ヨ韩銆佹父涔愯鏂�',
+ '灏忓尯瀹d紶銆佹爣璇�',
+ '寮虹數',
+ '寮辩數',
+ '閫氫俊璁炬柦',
+ '鍏叡鐢ㄦ埧',
+ '骞冲眿闈�',
+ '妤兼爧澶栫珛闈�',
+ '渚涚數璁炬柦',
+ '鏆栭�氱郴缁�',
+ '渚涙按绯荤粺',
+ '閫氱敤璁炬柦(閰嶄欢)'
+ ];
+ }
+ if ($that.ownerScopeDropdownOpen === undefined) {
+ $that.ownerScopeDropdownOpen = false;
+ }
+ if (!$that.buildingScopeOptions || !Array.isArray($that.buildingScopeOptions)) {
+ $that.buildingScopeOptions = [
+ '鏈哄姩杞﹀仠杞﹀簱(浣�)',
+ '浜ら�氶檮灞炶鏂�',
+ '灏忓尯閬撹矾',
+ '鍏叡鏅缁垮寲',
+ '闈炴満鍔ㄨ溅杞﹀簱(妫�)',
+ '閿呯倝',
+ '鎺掓按銆佹帓姹¤鏂�',
+ '娑堥槻绯荤粺',
+ '瀹夐槻璁炬柦',
+ '鍋ヨ韩銆佹父涔愯鏂�',
+ '灏忓尯瀹d紶銆佹爣璇�',
+ '寮虹數',
+ '寮辩數',
+ '閫氫俊璁炬柦',
+ '鍏叡鐢ㄦ埧',
+ '骞冲眿闈�',
+ '澶槼鑳借鏂�',
+ '鍧″眿闈�',
+ '缁撴瀯',
+ '妤兼爧澶栫珛闈�',
+ '妤煎耿鍏ュ彛',
+ '妤煎耿鍏叡',
+ '妤奸亾璁炬柦',
+ '渚涚數璁炬柦',
+ '鏆栭�氱郴缁�',
+ '渚涙按绯荤粺',
+ '閫氱敤璁炬柦(閰嶄欢)',
+ '娉曢櫌寮哄埗鎵ц'
+ ];
+ }
+ if ($that.buildingScopeDropdownOpen === undefined) {
+ $that.buildingScopeDropdownOpen = false;
+ }
+ var clickHandler = function (e) {
+ if (!e.target.closest('.multi-select-wrapper')) {
+ if ($that && $that.ownerScopeDropdownOpen !== undefined) {
+ $that.ownerScopeDropdownOpen = false;
+ }
+ if ($that && $that.buildingScopeDropdownOpen !== undefined) {
+ $that.buildingScopeDropdownOpen = false;
+ }
+ }
+ };
+ setTimeout(function () {
+ document.addEventListener('click', clickHandler);
+ }, 100);
var costDetailId = vc.getParam('costDetailId');
if (costDetailId) {
$that.costDetailInfo.costDetailId = costDetailId;
$that._loadCostDetail();
} else {
vc.toast('缂哄皯璐圭敤鏄庣粏ID');
- setTimeout(function() {
+ setTimeout(function () {
vc.goBack();
}, 1500);
}
},
methods: {
+ toggleOwnerScopeDropdown: function () {
+ if ($that && $that.ownerScopeDropdownOpen !== undefined) {
+ $that.ownerScopeDropdownOpen = !$that.ownerScopeDropdownOpen;
+ }
+ },
+ toggleOwnerScopeOption: function (option) {
+ if (!$that || !$that.costDetailInfo || !$that.costDetailInfo.ownerScope) {
+ return;
+ }
+ var index = $that.costDetailInfo.ownerScope.indexOf(option);
+ if (index === -1) {
+ $that.costDetailInfo.ownerScope.push(option);
+ } else {
+ $that.costDetailInfo.ownerScope.splice(index, 1);
+ }
+ },
+ removeOwnerScopeItem: function (index) {
+ if ($that && $that.costDetailInfo && $that.costDetailInfo.ownerScope) {
+ $that.costDetailInfo.ownerScope.splice(index, 1);
+ }
+ },
+ toggleBuildingScopeDropdown: function () {
+ if ($that && $that.buildingScopeDropdownOpen !== undefined) {
+ $that.buildingScopeDropdownOpen = !$that.buildingScopeDropdownOpen;
+ }
+ },
+ toggleBuildingScopeOption: function (option) {
+ if (!$that || !$that.costDetailInfo || !$that.costDetailInfo.buildingScope) {
+ return;
+ }
+ var index = $that.costDetailInfo.buildingScope.indexOf(option);
+ if (index === -1) {
+ $that.costDetailInfo.buildingScope.push(option);
+ } else {
+ $that.costDetailInfo.buildingScope.splice(index, 1);
+ }
+ },
+ removeBuildingScopeItem: function (index) {
+ if ($that && $that.costDetailInfo && $that.costDetailInfo.buildingScope) {
+ $that.costDetailInfo.buildingScope.splice(index, 1);
+ }
+ },
_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++) {
@@ -78,21 +261,21 @@
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() {
+ setTimeout(function () {
vc.goBack();
}, 1500);
}
} else {
console.error('API杩斿洖閿欒:', _json);
vc.toast('鏈壘鍒拌璐圭敤鏄庣粏');
- setTimeout(function() {
+ setTimeout(function () {
vc.goBack();
}, 1500);
}
@@ -109,18 +292,16 @@
},
_fillFormData: function (item) {
console.log('寮�濮嬪~鍏呰〃鍗曟暟鎹紝鍘熷鏁版嵁:', item);
-
- // 濉厖琛ㄥ崟鏁版嵁
+
var dateStr = '';
if (item.date) {
- dateStr = item.date.substring(0, 10); // 鍙栨棩鏈熼儴鍒� yyyy-mm-dd
+ 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;
}
-
- // 浣跨敤Vue.set鎴栬�呯洿鎺ヨ祴鍊兼潵纭繚鍝嶅簲寮忔洿鏂�
+
vc.component.costDetailInfo.flowCode = item.flowNumber || '';
vc.component.costDetailInfo.date = dateStr;
vc.component.costDetailInfo.communityName = item.projectName || '';
@@ -132,36 +313,61 @@
vc.component.costDetailInfo.appraisalAmount = item.auditAmount || '';
vc.component.costDetailInfo.committeeStamped = (item.ownersCommitteeSeal === '鏄�' || item.ownersCommitteeSeal === '1') ? '1' : '0';
vc.component.costDetailInfo.approvalDepartment = item.reportDepartment || '';
+
+ if (item.fundTypeLevel1 === '缁翠慨璧勯噾') {
+ vc.component.costDetailInfo.fundType = 'repair';
+ if (item.fundTypeLevel2) {
+ vc.component.costDetailInfo.ownerScope = typeof item.fundTypeLevel2 === 'string'
+ ? item.fundTypeLevel2.split(',').filter(function (item) { return item.trim(); })
+ : [];
+ } else {
+ vc.component.costDetailInfo.ownerScope = [];
+ }
+ if (item.buildingOrAll) {
+ vc.component.costDetailInfo.buildingScope = typeof item.buildingOrAll === 'string'
+ ? item.buildingOrAll.split(',').filter(function (item) { return item.trim(); })
+ : [];
+ } else {
+ vc.component.costDetailInfo.buildingScope = [];
+ }
+ vc.component.costDetailInfo.fundSystemType = 'out';
+ } else if (item.fundTypeLevel1 === '鍏叡鏀剁泭') {
+ vc.component.costDetailInfo.fundType = 'public';
+ if (item.fundTypeLevel2 === '绯荤粺澶�') {
+ vc.component.costDetailInfo.fundSystemType = 'out';
+ } else if (item.fundTypeLevel2 === '绯荤粺鍐�') {
+ vc.component.costDetailInfo.fundSystemType = 'in';
+ } else {
+ vc.component.costDetailInfo.fundSystemType = 'out';
+ }
+ vc.component.costDetailInfo.ownerScope = [];
+ vc.component.costDetailInfo.buildingScope = [];
+ } else {
+ vc.component.costDetailInfo.fundType = 'repair';
+ vc.component.costDetailInfo.ownerScope = [];
+ vc.component.costDetailInfo.buildingScope = [];
+ vc.component.costDetailInfo.fundSystemType = 'out';
+ }
+
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';
+ if (buildingType && buildingType.indexOf(',') !== -1) {
+ vc.component.costDetailInfo.buildingType = '1';
+ } else {
+ vc.component.costDetailInfo.buildingType = 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;
@@ -178,8 +384,35 @@
vc.toast('璇疯緭鍏ュ皬鍖虹紪鐮�');
return;
}
-
- // 鏋勫缓淇濆瓨鏁版嵁
+
+ var fundTypeLevel1 = '';
+ if ($that.costDetailInfo.fundType === 'repair') {
+ fundTypeLevel1 = '缁翠慨璧勯噾';
+ } else if ($that.costDetailInfo.fundType === 'public') {
+ fundTypeLevel1 = '鍏叡鏀剁泭';
+ }
+
+ var fundTypeLevel2 = '';
+ var buildingOrAll = '';
+
+ if ($that.costDetailInfo.fundType === 'repair') {
+ fundTypeLevel2 = ($that.costDetailInfo.ownerScope && $that.costDetailInfo.ownerScope.length > 0)
+ ? $that.costDetailInfo.ownerScope.join(',')
+ : '';
+ buildingOrAll = ($that.costDetailInfo.buildingScope && $that.costDetailInfo.buildingScope.length > 0)
+ ? $that.costDetailInfo.buildingScope.join(',')
+ : '';
+ } else if ($that.costDetailInfo.fundType === 'public') {
+ if ($that.costDetailInfo.fundSystemType === 'out') {
+ fundTypeLevel2 = '绯荤粺澶�';
+ } else if ($that.costDetailInfo.fundSystemType === 'in') {
+ fundTypeLevel2 = '绯荤粺鍐�';
+ }
+ buildingOrAll = '';
+ } else {
+ buildingOrAll = '';
+ }
+
var saveData = {
id: $that.costDetailInfo.costDetailId,
flowNumber: $that.costDetailInfo.flowCode,
@@ -193,14 +426,16 @@
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'),
+ fundTypeLevel1: fundTypeLevel1,
+ fundTypeLevel2: fundTypeLevel2,
maintenanceType: $that.costDetailInfo.maintenanceType || '',
communityId: vc.getCurrentCommunity().communityId
};
-
- // 瑙f瀽鏃ユ湡
+
+ if ($that.costDetailInfo.fundType === 'repair') {
+ saveData.buildingOrAll = buildingOrAll;
+ }
+
if (saveData.date) {
var dateParts = saveData.date.split('-');
if (dateParts.length >= 2) {
@@ -211,18 +446,17 @@
}
}
}
-
- // 璋冪敤鏇存柊API
+
vc.http.apiPost('/maintenancePayment/updateMaintenancePayment',
JSON.stringify(saveData), {
- emulateJSON: true
- },
+ emulateJSON: true
+ },
function (json, res) {
try {
var _json = JSON.parse(json);
if (_json.code === 0) {
vc.toast('淇濆瓨鎴愬姛');
- setTimeout(function() {
+ setTimeout(function () {
vc.goBack();
}, 1000);
} else {
diff --git a/public/pages/property/costDetail/more/more.html b/public/pages/property/costDetail/more/more.html
index daa5df4..d919b4b 100644
--- a/public/pages/property/costDetail/more/more.html
+++ b/public/pages/property/costDetail/more/more.html
@@ -8,9 +8,9 @@
<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="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>
+ <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>
</div>
@@ -19,47 +19,56 @@
<div class="margin-top-sm">
<ul class="nav nav-tabs">
<li class="nav-item">
- <a class="nav-link" v-bind:class="{active:moreInfo.currentTab == 'publicIncome'}" v-on:click="changeTab('publicIncome')">
+ <a class="nav-link" v-bind:class="{active:moreInfo.currentTab == 'publicIncome'}"
+ v-on:click="changeTab('publicIncome')">
鍏叡鏀剁泭閲�
</a>
</li>
<li class="nav-item">
- <a class="nav-link" v-bind:class="{active:moreInfo.currentTab == 'convention'}" v-on:click="changeTab('convention')">
+ <a class="nav-link" v-bind:class="{active:moreInfo.currentTab == 'convention'}"
+ v-on:click="changeTab('convention')">
涓氬浼氬叕绾�
</a>
</li>
<li class="nav-item">
- <a class="nav-link" v-bind:class="{active:moreInfo.currentTab == 'withdrawalIssues'}" v-on:click="changeTab('withdrawalIssues')">
+ <a class="nav-link" v-bind:class="{active:moreInfo.currentTab == 'withdrawalIssues'}"
+ v-on:click="changeTab('withdrawalIssues')">
鏀彇瀛樺湪闂
</a>
</li>
<li class="nav-item">
- <a class="nav-link" v-bind:class="{active:moreInfo.currentTab == 'warranty'}" v-on:click="changeTab('warranty')">
+ <a class="nav-link" v-bind:class="{active:moreInfo.currentTab == 'warranty'}"
+ v-on:click="changeTab('warranty')">
璐ㄤ繚閲�/楠屾敹瀹℃牳
</a>
</li>
<li class="nav-item">
- <a class="nav-link" v-bind:class="{active:moreInfo.currentTab == 'printDetail'}" v-on:click="changeTab('printDetail')">
+ <a class="nav-link" v-bind:class="{active:moreInfo.currentTab == 'printDetail'}"
+ v-on:click="changeTab('printDetail')">
鎵撳嵃鏄庣粏
</a>
</li>
<li class="nav-item">
- <a class="nav-link" v-bind:class="{active:moreInfo.currentTab == 'printSummary'}" v-on:click="changeTab('printSummary')">
+ <a class="nav-link" v-bind:class="{active:moreInfo.currentTab == 'printSummary'}"
+ v-on:click="changeTab('printSummary')">
鎵撳嵃姹囨��
</a>
</li>
<li class="nav-item">
- <a class="nav-link" v-bind:class="{active:moreInfo.currentTab == 'payablePaid'}" v-on:click="changeTab('payablePaid')">
+ <a class="nav-link" v-bind:class="{active:moreInfo.currentTab == 'payablePaid'}"
+ v-on:click="changeTab('payablePaid')">
搴斾粯/瀹炰粯
</a>
</li>
<li class="nav-item">
- <a class="nav-link" v-bind:class="{active:moreInfo.currentTab == 'payablePaidSummary'}" v-on:click="changeTab('payablePaidSummary')">
+ <a class="nav-link" v-bind:class="{active:moreInfo.currentTab == 'payablePaidSummary'}"
+ v-on:click="changeTab('payablePaidSummary')">
搴斾粯瀹炰粯姹囨��
</a>
</li>
<li class="nav-item">
- <a class="nav-link" v-bind:class="{active:moreInfo.currentTab == 'remarks'}" v-on:click="changeTab('remarks')">
+ <a class="nav-link" v-bind:class="{active:moreInfo.currentTab == 'remarks'}"
+ v-on:click="changeTab('remarks')">
澶囨敞
</a>
</li>
@@ -252,13 +261,20 @@
<th style="background-color: rgb(233, 243, 255);">搴忓彿</th>
<th style="background-color: rgb(233, 243, 255);">鎵撳嵃鍚堣</th>
<th style="background-color: rgb(233, 243, 255);">鍒拌处鍚堣</th>
- <th style="background-color: rgb(233, 243, 255);">鍒拌处鐜� <span title="缁翠慨鍩洪噾鎴栧叕鍏辨敹鐩婇噾鍒拌处鐜�" style="cursor: pointer;">鈶�</span></th>
- <th style="background-color: rgb(233, 243, 255);">灏氱己閲戦 <span title="缁翠慨鍩洪噾鎴栧叕鍏辨敹鐩婇噾灏氱己閲戦" style="cursor: pointer;">鈶�</span></th>
- <th style="background-color: rgb(233, 243, 255);">绠$悊璐瑰崰姣� <span title="鎸夌収鏂藉伐鍗曚綅鎵胯鍑�,浜哄伐杈撳叆鍊�" style="cursor: pointer;">鈶�</span></th>
- <th style="background-color: rgb(233, 243, 255);">绠$悊璐� <span title="鎸夌収鏂藉伐鍗曚綅鎵胯鍑�,浜哄伐杈撳叆鍊�" style="cursor: pointer;">鈶�</span></th>
- <th style="background-color: rgb(233, 243, 255);">搴斾粯閲戦A <span title="绛炬姤涓氬浼氶噾棰濃�旂鐞嗚垂" style="cursor: pointer;">鈶�</span></th>
- <th style="background-color: rgb(233, 243, 255);">搴斾粯閲戦B <span title="绛炬姤涓氬浼氶噾棰濃�旇川淇濋噾閲戦鈥旂鐞�" style="cursor: pointer;">鈶�</span></th>
- <th style="background-color: rgb(233, 243, 255);">搴斾粯閲戦C <span title="鎸夊埌璐﹀簲浠樷�斿悓姣旂鐞嗚垂,鍒拌处閲戦涓嶅寘鍚川淇濋噾" style="cursor: pointer;">鈶�</span></th>
+ <th style="background-color: rgb(233, 243, 255);">鍒拌处鐜� <span title="缁翠慨鍩洪噾鎴栧叕鍏辨敹鐩婇噾鍒拌处鐜�"
+ style="cursor: pointer;">鈶�</span></th>
+ <th style="background-color: rgb(233, 243, 255);">灏氱己閲戦 <span title="缁翠慨鍩洪噾鎴栧叕鍏辨敹鐩婇噾灏氱己閲戦"
+ style="cursor: pointer;">鈶�</span></th>
+ <th style="background-color: rgb(233, 243, 255);">绠$悊璐瑰崰姣� <span title="鎸夌収鏂藉伐鍗曚綅鎵胯鍑�,浜哄伐杈撳叆鍊�"
+ style="cursor: pointer;">鈶�</span></th>
+ <th style="background-color: rgb(233, 243, 255);">绠$悊璐� <span title="鎸夌収鏂藉伐鍗曚綅鎵胯鍑�,浜哄伐杈撳叆鍊�"
+ style="cursor: pointer;">鈶�</span></th>
+ <th style="background-color: rgb(233, 243, 255);">搴斾粯閲戦A <span title="绛炬姤涓氬浼氶噾棰濃�旂鐞嗚垂"
+ style="cursor: pointer;">鈶�</span></th>
+ <th style="background-color: rgb(233, 243, 255);">搴斾粯閲戦B <span title="绛炬姤涓氬浼氶噾棰濃�旇川淇濋噾閲戦鈥旂鐞�"
+ style="cursor: pointer;">鈶�</span></th>
+ <th style="background-color: rgb(233, 243, 255);">搴斾粯閲戦C <span title="鎸夊埌璐﹀簲浠樷�斿悓姣旂鐞嗚垂,鍒拌处閲戦涓嶅寘鍚川淇濋噾"
+ style="cursor: pointer;">鈶�</span></th>
<th style="background-color: rgb(233, 243, 255);">鏀粯鍏徃鎴栦釜浜哄悕绉�</th>
<th style="background-color: rgb(233, 243, 255);">韬唤璇佸彿</th>
<th style="background-color: rgb(233, 243, 255);">寮�鎴烽摱琛�</th>
@@ -293,18 +309,6 @@
</tr>
</tbody>
</table>
- <!-- 鎵撳嵃姹囨�诲娉ㄨ鏄� -->
- <!-- <div v-if="moreInfo.currentTab == 'printSummary'" style="margin-top: 20px; padding: 10px; background-color: #f5f5f5; border-radius: 4px;">
- <div style="font-weight: bold; margin-bottom: 10px;">澶囨敞:鍏夋爣娴湪鈶犱笂鏃�,鏈夎В閲婃彁绀�,鍐呭濡備笅:</div>
- <div style="margin-left: 20px;">
- <div><strong>鍒拌处鐜�:</strong> 缁翠慨鍩洪噾鎴栧叕鍏辨敹鐩婇噾鍒拌处鐜�</div>
- <div><strong>灏氱己閲戦:</strong> 缁翠慨鍩洪噾鎴栧叕鍏辨敹鐩婇噾灏氱己閲戦</div>
- <div><strong>绠$悊璐瑰崰姣�:</strong> 鎸夌収鏂藉伐鍗曚綅鎵胯鍑�,浜哄伐杈撳叆鍊�</div>
- <div><strong>搴斾粯閲戦A:</strong> 绛炬姤涓氬浼氶噾棰濃�旂鐞嗚垂</div>
- <div><strong>搴斾粯閲戦B:</strong> 绛炬姤涓氬浼氶噾棰濃�旇川淇濋噾閲戦鈥旂鐞�</div>
- <div><strong>搴斾粯閲戦C:</strong> 鎸夊埌璐﹀簲浠樷�斿悓姣旂鐞嗚垂,鍒拌处閲戦涓嶅寘鍚川淇濋噾</div>
- </div>
- </div> -->
<!-- 鏁版嵁琛ㄦ牸 - 搴斾粯/瀹炰粯 -->
<table v-if="moreInfo.currentTab == 'payablePaid'">
@@ -352,9 +356,12 @@
<th style="background-color: rgb(233, 243, 255);">鏈粯鍚堣</th>
<th style="background-color: rgb(233, 243, 255);">鍨粯閲戦</th>
<th style="background-color: rgb(233, 243, 255);">鏈粯鍚堣-鍒板笎鍙e緞</th>
- <th style="background-color: rgb(233, 243, 255);">寰呬粯閲戦A <span title="绛炬姤涓氬浼氶噾棰濃�旂鐞嗚垂" style="cursor: pointer;">鈶�</span></th>
- <th style="background-color: rgb(233, 243, 255);">寰呬粯閲戦B <span title="绛炬姤涓氬浼氶噾棰濃�旇川淇濋噾閲戦鈥旂鐞�" style="cursor: pointer;">鈶�</span></th>
- <th style="background-color: rgb(233, 243, 255);">寰呬粯閲戦C <span title="鎸夊埌璐﹀簲浠樷�斿悓姣旂鐞嗚垂,鍒拌处閲戦涓嶅寘鍚川淇濋噾" style="cursor: pointer;">鈶�</span></th>
+ <th style="background-color: rgb(233, 243, 255);">寰呬粯閲戦A <span title="绛炬姤涓氬浼氶噾棰濃�旂鐞嗚垂"
+ style="cursor: pointer;">鈶�</span></th>
+ <th style="background-color: rgb(233, 243, 255);">寰呬粯閲戦B <span title="绛炬姤涓氬浼氶噾棰濃�旇川淇濋噾閲戦鈥旂鐞�"
+ style="cursor: pointer;">鈶�</span></th>
+ <th style="background-color: rgb(233, 243, 255);">寰呬粯閲戦C <span title="鎸夊埌璐﹀簲浠樷�斿悓姣旂鐞嗚垂,鍒拌处閲戦涓嶅寘鍚川淇濋噾"
+ style="cursor: pointer;">鈶�</span></th>
<th style="background-color: rgb(233, 243, 255);">鎿嶄綔</th>
</tr>
</thead>
@@ -379,15 +386,7 @@
</tr>
</tbody>
</table>
- <!-- 搴斾粯瀹炰粯姹囨�诲娉ㄨ鏄� -->
- <!-- <div v-if="moreInfo.currentTab == 'payablePaidSummary'" style="margin-top: 20px; padding: 10px; background-color: #f5f5f5; border-radius: 4px;">
- <div style="font-weight: bold; margin-bottom: 10px;">澶囨敞:鍏夋爣娴湪鈶犱笂鏃�,鏈夎В閲婃彁绀�,鍐呭濡備笅:</div>
- <div style="margin-left: 20px;">
- <div><strong>寰呬粯閲戦A:</strong> 绛炬姤涓氬浼氶噾棰濃�旂鐞嗚垂</div>
- <div><strong>寰呬粯閲戦B:</strong> 绛炬姤涓氬浼氶噾棰濃�旇川淇濋噾閲戦鈥旂鐞�</div>
- <div><strong>寰呬粯閲戦C:</strong> 鎸夊埌璐﹀簲浠樷�斿悓姣旂鐞嗚垂,鍒拌处閲戦涓嶅寘鍚川淇濋噾</div>
- </div>
- </div> -->
+
<!-- 鏁版嵁琛ㄦ牸 - 澶囨敞 -->
<table v-if="moreInfo.currentTab == 'remarks'">
@@ -429,40 +428,137 @@
<option value="100">100</option>
</select>
<span class="page-size-label">/椤�</span>
- <button class="page-btn" v-on:click="_goToPage(moreInfo.paginationInfo.currentPage - 1)"
- :disabled="moreInfo.paginationInfo.currentPage == 1">鈥�</button>
- <button class="page-btn" v-for="page in moreInfo.paginationInfo.pageList"
- :class="{active: page.currentPage}"
- v-on:click="_goToPage(page.page)"
- v-if="page.pageView != '...'">
+ <button class="page-btn" v-on:click="_goToPage(moreInfo.paginationInfo.currentPage - 1)"
+ :disabled="moreInfo.paginationInfo.currentPage == 1">鈥�</button>
+ <button class="page-btn" v-for="page in moreInfo.paginationInfo.pageList"
+ :class="{active: page.currentPage}" v-on:click="_goToPage(page.page)" v-if="page.pageView != '...'">
{{page.pageView}}
</button>
- <span v-for="page in moreInfo.paginationInfo.pageList"
- v-if="page.pageView == '...'"
- class="page-ellipsis">...</span>
- <button class="page-btn" v-on:click="_goToPage(moreInfo.paginationInfo.currentPage + 1)"
- :disabled="moreInfo.paginationInfo.currentPage == moreInfo.paginationInfo.total">鈥�</button>
+ <span v-for="page in moreInfo.paginationInfo.pageList" v-if="page.pageView == '...'"
+ class="page-ellipsis">...</span>
+ <button class="page-btn" v-on:click="_goToPage(moreInfo.paginationInfo.currentPage + 1)"
+ :disabled="moreInfo.paginationInfo.currentPage == moreInfo.paginationInfo.total">鈥�</button>
<span class="jump-label">璺宠浆鑷�</span>
- <input type="number" class="jump-input" v-model="moreInfo.jumpPage" min="1" :max="moreInfo.paginationInfo.total" />
+ <input type="number" class="jump-input" v-model="moreInfo.jumpPage" min="1"
+ :max="moreInfo.paginationInfo.total" />
<span class="page-label">椤�</span>
<button class="page-btn" v-on:click="_jumpToPage()">纭畾</button>
</div>
</div>
</div>
-<!-- 缂栬緫鍏叡鏀剁泭閲� Modal -->
-<div class="modal fade" id="editPublicIncomeModal" inert aria-hidden="true" tabindex="-1" style="position: relative; top: 50%; left: 50%; transform: translate(-50%, -30%);">
+<!-- 娣诲姞鍏憡鏃堕棿鑼冨洿 Modal -->
+<div class="modal fade" id="addAnnouncementTimeRangeModal" inert aria-hidden="true" tabindex="-1"
+ style="position: relative; top: 50%; left: 50%; transform: translate(-50%, -30%);">
+ <div class="modal-dialog">
+ <div class="modal-content" style="border-radius: 10px;">
+ <div class="modal-header">
+ <h4 class="modal-title">娣诲姞</h4>
+ <button type="button" class="close" v-on:click="_hideAddAnnouncementModal()" aria-label="Close"><span
+ aria-hidden="true">脳</span></button>
+ </div>
+ <div class="modal-body edit-public-income-modal">
+ <div class="form-group edit-form-group">
+ <label class="edit-form-label">鎷熷叕甯�-璧峰(骞存湀)</label>
+ <div class="edit-input-wrapper">
+ <input type="month" class="form-control edit-input"
+ v-model.trim="moreInfo.addForm.plannedAnnouncementStart" placeholder="璇烽�夋嫨骞存湀">
+ </div>
+ </div>
+ <div class="form-group edit-form-group">
+ <label class="edit-form-label">鎷熷叕甯�-姝�(骞存湀)</label>
+ <div class="edit-input-wrapper">
+ <input type="month" class="form-control edit-input"
+ v-model.trim="moreInfo.addForm.plannedAnnouncementEnd" placeholder="璇烽�夋嫨骞存湀">
+ </div>
+ </div>
+ <div class="form-group edit-form-group">
+ <label class="edit-form-label">宸插叕甯�-璧峰(骞存湀)</label>
+ <div class="edit-input-wrapper">
+ <input type="month" class="form-control edit-input"
+ v-model.trim="moreInfo.addForm.publishedAnnouncementStart" placeholder="璇烽�夋嫨骞存湀">
+ </div>
+ </div>
+ <div class="form-group edit-form-group">
+ <label class="edit-form-label">宸插叕甯�-姝�(骞存湀)</label>
+ <div class="edit-input-wrapper">
+ <input type="month" class="form-control edit-input"
+ v-model.trim="moreInfo.addForm.publishedAnnouncementEnd" placeholder="璇烽�夋嫨骞存湀">
+ </div>
+ </div>
+ </div>
+ <div style="display: flex; justify-content: center; padding-bottom: 20px; gap: 20px;">
+ <button type="button" class="btn btn-white" v-on:click="_hideAddAnnouncementModal()">鍙栨秷</button>
+ <button type="button" class="btn btn-primary" v-on:click="_saveAddAnnouncementTimeRange()">纭</button>
+ </div>
+ </div>
+ </div>
+</div>
+
+<!-- 缂栬緫鍏憡鏃堕棿鑼冨洿 Modal -->
+<div class="modal fade" id="editAnnouncementTimeRangeModal" inert aria-hidden="true" tabindex="-1"
+ style="position: relative; top: 50%; left: 50%; transform: translate(-50%, -30%);">
<div class="modal-dialog">
<div class="modal-content" style="border-radius: 10px;">
<div class="modal-header">
<h4 class="modal-title">缂栬緫</h4>
- <button type="button" class="close" v-on:click="_hideEditPublicModal()" aria-label="Close"><span aria-hidden="true">脳</span></button>
+ <button type="button" class="close" v-on:click="_hideEditAnnouncementModal()" aria-label="Close"><span
+ aria-hidden="true">脳</span></button>
+ </div>
+ <div class="modal-body edit-public-income-modal">
+ <div class="form-group edit-form-group">
+ <label class="edit-form-label">鎷熷叕甯�-璧峰(骞存湀)</label>
+ <div class="edit-input-wrapper">
+ <input type="month" class="form-control edit-input"
+ v-model.trim="moreInfo.editAnnouncementForm.plannedAnnouncementStart" placeholder="璇烽�夋嫨骞存湀">
+ </div>
+ </div>
+ <div class="form-group edit-form-group">
+ <label class="edit-form-label">鎷熷叕甯�-姝�(骞存湀)</label>
+ <div class="edit-input-wrapper">
+ <input type="month" class="form-control edit-input"
+ v-model.trim="moreInfo.editAnnouncementForm.plannedAnnouncementEnd" placeholder="璇烽�夋嫨骞存湀">
+ </div>
+ </div>
+ <div class="form-group edit-form-group">
+ <label class="edit-form-label">宸插叕甯�-璧峰(骞存湀)</label>
+ <div class="edit-input-wrapper">
+ <input type="month" class="form-control edit-input"
+ v-model.trim="moreInfo.editAnnouncementForm.publishedAnnouncementStart" placeholder="璇烽�夋嫨骞存湀">
+ </div>
+ </div>
+ <div class="form-group edit-form-group">
+ <label class="edit-form-label">宸插叕甯�-姝�(骞存湀)</label>
+ <div class="edit-input-wrapper">
+ <input type="month" class="form-control edit-input"
+ v-model.trim="moreInfo.editAnnouncementForm.publishedAnnouncementEnd" placeholder="璇烽�夋嫨骞存湀">
+ </div>
+ </div>
+ </div>
+ <div style="display: flex; justify-content: center; padding-bottom: 20px; gap: 20px;">
+ <button type="button" class="btn btn-white" v-on:click="_hideEditAnnouncementModal()">鍙栨秷</button>
+ <button type="button" class="btn btn-primary" v-on:click="_saveEditAnnouncementTimeRange()">纭</button>
+ </div>
+ </div>
+ </div>
+</div>
+
+<!-- 缂栬緫鍏叡鏀剁泭閲� Modal -->
+<div class="modal fade" id="editPublicIncomeModal" inert aria-hidden="true" tabindex="-1"
+ style="position: relative; top: 50%; left: 50%; transform: translate(-50%, -30%);">
+ <div class="modal-dialog">
+ <div class="modal-content" style="border-radius: 10px;">
+ <div class="modal-header">
+ <h4 class="modal-title">缂栬緫</h4>
+ <button type="button" class="close" v-on:click="_hideEditPublicModal()" aria-label="Close"><span
+ aria-hidden="true">脳</span></button>
</div>
<div class="modal-body edit-public-income-modal">
<div class="form-group edit-form-group">
<label class="edit-form-label">棰濆害</label>
<div class="edit-input-wrapper">
- <input type="text" class="form-control edit-input" v-model.trim="moreInfo.editForm.amount" placeholder="璇疯緭鍏ュ悕绉�">
+ <input type="text" class="form-control edit-input" v-model.trim="moreInfo.editForm.amount"
+ placeholder="璇疯緭鍏ュ悕绉�">
<span class="edit-input-unit">鍏�</span>
</div>
</div>
@@ -470,10 +566,12 @@
<label class="edit-form-label">涓氬浼氬ぇ浼氬喅璁�</label>
<div class="edit-radio-group">
<label class="edit-radio-label">
- <input type="radio" name="meetingResolution" value="1" v-model="moreInfo.editForm.meetingResolution"> 鏄�
+ <input type="radio" name="meetingResolution" value="1"
+ v-model="moreInfo.editForm.meetingResolution"> 鏄�
</label>
<label class="edit-radio-label">
- <input type="radio" name="meetingResolution" value="0" v-model="moreInfo.editForm.meetingResolution"> 鍚�
+ <input type="radio" name="meetingResolution" value="0"
+ v-model="moreInfo.editForm.meetingResolution"> 鍚�
</label>
</div>
</div>
@@ -481,10 +579,12 @@
<label class="edit-form-label">涓氬浼氬緛璇㈣〃</label>
<div class="edit-radio-group">
<label class="edit-radio-label">
- <input type="radio" name="consultationForm" value="1" v-model="moreInfo.editForm.consultationForm"> 鏄�
+ <input type="radio" name="consultationForm" value="1"
+ v-model="moreInfo.editForm.consultationForm"> 鏄�
</label>
<label class="edit-radio-label">
- <input type="radio" name="consultationForm" value="0" v-model="moreInfo.editForm.consultationForm"> 鍚�
+ <input type="radio" name="consultationForm" value="0"
+ v-model="moreInfo.editForm.consultationForm"> 鍚�
</label>
</div>
</div>
@@ -495,5 +595,4 @@
</div>
</div>
</div>
-</div>
-
+</div>
\ No newline at end of file
diff --git a/public/pages/property/costDetail/more/more.js b/public/pages/property/costDetail/more/more.js
index 1e3e719..49d9fb9 100644
--- a/public/pages/property/costDetail/more/more.js
+++ b/public/pages/property/costDetail/more/more.js
@@ -1,5 +1,5 @@
/**
- 涓氬浼氬叕绾︾鐞�
+ 璐圭敤鏄庣粏鏇村绠$悊
**/
(function (vc) {
var DEFAULT_PAGE = 1;
@@ -27,15 +27,27 @@
amount: '',
meetingResolution: '1',
consultationForm: '1'
+ },
+ addForm: {
+ plannedAnnouncementStart: '',
+ plannedAnnouncementEnd: '',
+ publishedAnnouncementStart: '',
+ publishedAnnouncementEnd: ''
+ },
+ editAnnouncementForm: {
+ id: '',
+ mpId: '',
+ plannedAnnouncementStart: '',
+ plannedAnnouncementEnd: '',
+ publishedAnnouncementStart: '',
+ publishedAnnouncementEnd: ''
}
}
},
_initMethod: function () {
$that = vc.component;
$that._initDate();
- // 杩涘叆椤甸潰鏃剁珛鍗宠皟鐢ㄦ帴鍙�
$that._loadPublicIncomeData(DEFAULT_PAGE, DEFAULT_ROWS);
- // 鏍规嵁褰撳墠鏍囩椤靛姞杞芥暟鎹�
if ($that.moreInfo.currentTab !== 'publicIncome') {
$that._listData(DEFAULT_PAGE, DEFAULT_ROWS);
}
@@ -44,7 +56,6 @@
},
methods: {
_initDate: function () {
- // 鍒濆鍖栨棩鏈熼�夋嫨鍣�
$(".startDate").datetimepicker({
minView: "month",
language: 'zh-CN',
@@ -68,12 +79,11 @@
clearBtn: true
});
- // 璁剧疆榛樿鏃ユ湡涓哄綋鍓嶆湀浠�
var now = new Date();
var year = now.getFullYear();
var month = now.getMonth() + 1;
var startDateStr = year + '-' + (month < 10 ? '0' + month : month) + '-01';
- var endDate = new Date(year, month, 0); // 鑾峰彇褰撴湀鏈�鍚庝竴澶�
+ var endDate = new Date(year, month, 0);
var endDateStr = year + '-' + (month < 10 ? '0' + month : month) + '-' + endDate.getDate();
$that.moreInfo.conditions.startDate = startDateStr;
@@ -100,7 +110,6 @@
}
});
- // 闃叉澶氭鐐瑰嚮鏃堕棿鎻掍欢澶卞幓鐒︾偣
var startDateElements = document.getElementsByClassName('form-control startDate');
if (startDateElements.length > 0) {
startDateElements[0].addEventListener('click', function (e) {
@@ -116,19 +125,17 @@
},
changeTab: function (_tab) {
$that.moreInfo.currentTab = _tab;
- // 鏍规嵁鏍囩椤靛姞杞戒笉鍚屾暟鎹�
if (_tab === 'publicIncome') {
- // 鍏叡鏀剁泭閲戞爣绛撅紝璋冪敤鐗规畩鎺ュ彛
$that._loadPublicIncomeData(DEFAULT_PAGE, $that.moreInfo.paginationInfo.rows);
+ } else if (_tab === 'convention') {
+ $that._loadConventionData(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);
@@ -142,12 +149,12 @@
}
}
}
-
+
if (!costDetailId) {
vc.toast('缂哄皯costDetailId鍙傛暟');
return;
}
-
+
var param = {
params: {
mpId: costDetailId,
@@ -155,8 +162,7 @@
row: _rows
}
};
-
- // 璋冪敤鍏叡鏀剁泭閲戞帴鍙�
+
vc.http.apiGet('/announcementTimeRange/queryAnnouncementTimeRangeInfo',
param,
function (json, res) {
@@ -165,19 +171,17 @@
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) {
+ dataList = _json.data.map(function (item) {
return {
id: item.id,
mpId: item.mpId,
@@ -191,7 +195,90 @@
};
});
}
-
+
+ $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();
+ }
+ );
+ },
+ _loadConventionData: function (_page, _rows) {
+ var costDetailId = vc.getParam('costDetailId');
+ if (!costDetailId) {
+ 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 || 1,
+ row: _rows || DEFAULT_ROWS
+ }
+ };
+
+ vc.http.apiGet('/ownersCommitteeConvention/queryOwnersCommitteeConvention',
+ 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;
+ }
+
$that.moreInfo.dataList = dataList;
$that.moreInfo.paginationInfo.currentPage = _page;
$that._freshPageList();
@@ -232,7 +319,6 @@
var param = {
params: $that.moreInfo.conditions
};
- // 鍙戦�乬et璇锋眰 - 杩欓噷闇�瑕佹牴鎹疄闄匒PI璋冩暣
vc.http.apiGet('/costDetail/queryMore',
param,
function (json, res) {
@@ -245,7 +331,6 @@
},
function (errInfo, error) {
console.log('璇锋眰澶辫触澶勭悊');
- // 妯℃嫙鏁版嵁鐢ㄤ簬婕旂ず
$that.moreInfo.dataList = [
{
amount: '寮犱笁涓�',
@@ -266,7 +351,6 @@
var pageList = [];
if (total <= 7) {
- // 鎬婚〉鏁板皬浜庣瓑浜�7锛屾樉绀烘墍鏈夐〉鐮�
for (var i = 1; i <= total; i++) {
pageList.push({
page: i,
@@ -275,9 +359,7 @@
});
}
} else {
- // 鎬婚〉鏁板ぇ浜�7锛屾樉绀洪儴鍒嗛〉鐮�
if (currentPage <= 4) {
- // 褰撳墠椤靛湪鍓�4椤�
for (var i = 1; i <= 5; i++) {
pageList.push({
page: i,
@@ -296,7 +378,6 @@
currentPage: false
});
} else if (currentPage >= total - 3) {
- // 褰撳墠椤靛湪鍚�4椤�
pageList.push({
page: 1,
pageView: 1,
@@ -315,7 +396,6 @@
});
}
} else {
- // 褰撳墠椤靛湪涓棿
pageList.push({
page: 1,
pageView: 1,
@@ -351,6 +431,8 @@
_changePageSize: function () {
if ($that.moreInfo.currentTab === 'publicIncome') {
$that._loadPublicIncomeData(DEFAULT_PAGE, $that.moreInfo.paginationInfo.rows);
+ } else if ($that.moreInfo.currentTab === 'convention') {
+ $that._loadConventionData(DEFAULT_PAGE, $that.moreInfo.paginationInfo.rows);
} else {
$that._listData(DEFAULT_PAGE, $that.moreInfo.paginationInfo.rows);
}
@@ -361,6 +443,8 @@
}
if ($that.moreInfo.currentTab === 'publicIncome') {
$that._loadPublicIncomeData(_page, $that.moreInfo.paginationInfo.rows);
+ } else if ($that.moreInfo.currentTab === 'convention') {
+ $that._loadConventionData(_page, $that.moreInfo.paginationInfo.rows);
} else {
$that._listData(_page, $that.moreInfo.paginationInfo.rows);
}
@@ -375,20 +459,101 @@
}
if ($that.moreInfo.currentTab === 'publicIncome') {
$that._loadPublicIncomeData(page, $that.moreInfo.paginationInfo.rows);
+ } else if ($that.moreInfo.currentTab === 'convention') {
+ $that._loadConventionData(page, $that.moreInfo.paginationInfo.rows);
} else {
$that._listData(page, $that.moreInfo.paginationInfo.rows);
}
},
_add: function () {
- // 娣诲姞鍔熻兘
- vc.toast('娣诲姞鍔熻兘');
+ if ($that.moreInfo.currentTab !== 'publicIncome') {
+ return;
+ }
+ $that.moreInfo.addForm = {
+ plannedAnnouncementStart: '',
+ plannedAnnouncementEnd: '',
+ publishedAnnouncementStart: '',
+ publishedAnnouncementEnd: ''
+ };
+ $that._showAddAnnouncementModal();
+ },
+ _showAddAnnouncementModal: function () {
+ const modal = document.getElementById('addAnnouncementTimeRangeModal');
+ modal.classList.add('show');
+ modal.style.display = 'block';
+ modal.removeAttribute('inert');
+ modal.removeAttribute('aria-hidden');
+ modal.setAttribute('aria-modal', 'true');
+ modal.focus();
+ },
+ _hideAddAnnouncementModal: function () {
+ const modal = document.getElementById('addAnnouncementTimeRangeModal');
+ modal.classList.remove('show');
+ modal.style.display = 'none';
+ modal.setAttribute('inert', '');
+ modal.setAttribute('aria-hidden', 'true');
+ modal.removeAttribute('aria-modal');
+ },
+ _saveAddAnnouncementTimeRange: function () {
+ var costDetailId = vc.getParam('costDetailId');
+ if (!costDetailId) {
+ 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 requestData = {
+ mpId: costDetailId,
+ plannedAnnouncementStart: $that.moreInfo.addForm.plannedAnnouncementStart || '',
+ plannedAnnouncementEnd: $that.moreInfo.addForm.plannedAnnouncementEnd || '',
+ publishedAnnouncementStart: $that.moreInfo.addForm.publishedAnnouncementStart || '',
+ publishedAnnouncementEnd: $that.moreInfo.addForm.publishedAnnouncementEnd || ''
+ };
+
+ vc.http.apiPost('/announcementTimeRange/saveAnnouncementTimeRangeInfo',
+ JSON.stringify(requestData),
+ {
+ emulateJSON: true
+ },
+ function (json, res) {
+ try {
+ var _json = JSON.parse(json);
+ if (_json.code === "0000") {
+ vc.toast(_json.msg || '淇濆瓨鎴愬姛');
+ $that._hideAddAnnouncementModal();
+ $that._loadPublicIncomeData($that.moreInfo.paginationInfo.currentPage, $that.moreInfo.paginationInfo.rows);
+ } else {
+ vc.toast(_json.msg || '淇濆瓨澶辫触');
+ }
+ } catch (e) {
+ console.error('鏁版嵁瑙f瀽澶辫触:', e);
+ vc.toast('鏁版嵁瑙f瀽澶辫触');
+ }
+ },
+ function (errInfo, error) {
+ console.error('璇锋眰澶辫触:', errInfo, error);
+ vc.toast(errInfo || '淇濆瓨澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�');
+ }
+ );
},
_export: function () {
- // 瀵煎嚭鍔熻兘
vc.toast('瀵煎嚭鍔熻兘');
},
_viewDetailPublicIncome: function (_item) {
- // 鏌ョ湅璇︽儏
vc.toast('鏌ョ湅璇︽儏鍔熻兘');
},
_showEditPublicModal: function () {
@@ -409,16 +574,104 @@
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();
+ if (!_item || !_item.id) {
+ vc.toast('鏁版嵁閿欒锛屾棤娉曠紪杈�');
+ return;
+ }
+
+ var costDetailId = vc.getParam('costDetailId');
+ if (!costDetailId) {
+ 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;
+ }
+ }
+ }
+ }
+
+ var formatDate = function (dateStr) {
+ if (!dateStr || dateStr === '-' || dateStr.trim() === '') {
+ return '';
+ }
+ return dateStr.trim();
+ };
+
+ $that.moreInfo.editAnnouncementForm = {
+ id: _item.id || '',
+ mpId: costDetailId || _item.mpId || '',
+ plannedAnnouncementStart: formatDate(_item.proposedStartDate),
+ plannedAnnouncementEnd: formatDate(_item.proposedEndDate),
+ publishedAnnouncementStart: formatDate(_item.publishedStartDate),
+ publishedAnnouncementEnd: formatDate(_item.publishedEndDate)
+ };
+
+ $that._showEditAnnouncementModal();
+ },
+ _showEditAnnouncementModal: function () {
+ const modal = document.getElementById('editAnnouncementTimeRangeModal');
+ modal.classList.add('show');
+ modal.style.display = 'block';
+ modal.removeAttribute('inert');
+ modal.removeAttribute('aria-hidden');
+ modal.setAttribute('aria-modal', 'true');
+ modal.focus();
+ },
+ _hideEditAnnouncementModal: function () {
+ const modal = document.getElementById('editAnnouncementTimeRangeModal');
+ modal.classList.remove('show');
+ modal.style.display = 'none';
+ modal.setAttribute('inert', '');
+ modal.setAttribute('aria-hidden', 'true');
+ modal.removeAttribute('aria-modal');
+ },
+ _saveEditAnnouncementTimeRange: function () {
+ if (!$that.moreInfo.editAnnouncementForm.id) {
+ vc.toast('缂哄皯涓婚敭ID锛屾棤娉曚繚瀛�');
+ return;
+ }
+
+ var requestData = {
+ id: $that.moreInfo.editAnnouncementForm.id,
+ mpId: $that.moreInfo.editAnnouncementForm.mpId || '',
+ plannedAnnouncementStart: $that.moreInfo.editAnnouncementForm.plannedAnnouncementStart || '',
+ plannedAnnouncementEnd: $that.moreInfo.editAnnouncementForm.plannedAnnouncementEnd || '',
+ publishedAnnouncementStart: $that.moreInfo.editAnnouncementForm.publishedAnnouncementStart || '',
+ publishedAnnouncementEnd: $that.moreInfo.editAnnouncementForm.publishedAnnouncementEnd || ''
+ };
+
+ vc.http.apiPost('/announcementTimeRange/updateAnnouncementTimeRangeInfo',
+ JSON.stringify(requestData),
+ {
+ emulateJSON: true
+ },
+ function (json, res) {
+ try {
+ var _json = JSON.parse(json);
+ if (_json.code === "0000") {
+ vc.toast(_json.msg || '淇敼鎴愬姛');
+ $that._hideEditAnnouncementModal();
+ $that._loadPublicIncomeData($that.moreInfo.paginationInfo.currentPage, $that.moreInfo.paginationInfo.rows);
+ } else {
+ vc.toast(_json.msg || '淇敼澶辫触');
+ }
+ } catch (e) {
+ console.error('鏁版嵁瑙f瀽澶辫触:', e);
+ vc.toast('鏁版嵁瑙f瀽澶辫触');
+ }
+ },
+ function (errInfo, error) {
+ console.error('璇锋眰澶辫触:', errInfo, error);
+ vc.toast(errInfo || '淇敼澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�');
+ }
+ );
},
_saveEditPublicIncome: function () {
- // 淇濆瓨缂栬緫
var param = {
params: {
id: $that.moreInfo.editForm.id,
@@ -441,23 +694,58 @@
);
},
_delete: function (_item) {
+ if (!_item || !_item.id) {
+ vc.toast('鏁版嵁閿欒锛屾棤娉曞垹闄�');
+ return;
+ }
+
vc.confirm('纭畾瑕佸垹闄よ繖鏉¤褰曞悧锛�', function () {
- var param = {
- params: {
+ if ($that.moreInfo.currentTab === 'publicIncome') {
+ var requestData = {
id: _item.id
- }
- };
- // 杩欓噷闇�瑕佹牴鎹疄闄匒PI璋冩暣
- vc.http.apiPost('/costDetail/deleteMore',
- param,
- function (json, res) {
- vc.toast('鍒犻櫎鎴愬姛');
- $that._listData($that.moreInfo.paginationInfo.currentPage, $that.moreInfo.paginationInfo.rows);
- },
- function (errInfo, error) {
- vc.message(errInfo);
- }
- );
+ };
+
+ vc.http.apiPost('/announcementTimeRange/deleteAnnouncementTimeRangeInfo',
+ JSON.stringify(requestData),
+ {
+ emulateJSON: true
+ },
+ function (json, res) {
+ try {
+ var _json = JSON.parse(json);
+ if (_json.code === "0000") {
+ vc.toast(_json.msg || '鍒犻櫎鎴愬姛');
+ $that._loadPublicIncomeData($that.moreInfo.paginationInfo.currentPage, $that.moreInfo.paginationInfo.rows);
+ } else {
+ vc.toast(_json.msg || '鍒犻櫎澶辫触');
+ }
+ } catch (e) {
+ console.error('鏁版嵁瑙f瀽澶辫触:', e);
+ vc.toast('鏁版嵁瑙f瀽澶辫触');
+ }
+ },
+ function (errInfo, error) {
+ console.error('璇锋眰澶辫触:', errInfo, error);
+ vc.toast(errInfo || '鍒犻櫎澶辫触锛岃妫�鏌ョ綉缁滆繛鎺�');
+ }
+ );
+ } else {
+ var param = {
+ params: {
+ id: _item.id
+ }
+ };
+ vc.http.apiPost('/costDetail/deleteMore',
+ param,
+ function (json, res) {
+ vc.toast('鍒犻櫎鎴愬姛');
+ $that._listData($that.moreInfo.paginationInfo.currentPage, $that.moreInfo.paginationInfo.rows);
+ },
+ function (errInfo, error) {
+ vc.message(errInfo);
+ }
+ );
+ }
});
}
}
--
Gitblit v1.8.0