From 1cef3adee31c6934c0da4b4f0b8a6f5ac03b364f Mon Sep 17 00:00:00 2001
From: zhangjiaqing <z1637266029@163.com>
Date: 星期四, 09 四月 2026 16:50:09 +0800
Subject: [PATCH] 小区信息添加页面修复市不显示问题情况,修复采购导入不稳定情况
---
public/pages/property/costDetail/costDetail.js | 131 ++++++++++++++++++++++++++++++-------------
1 files changed, 91 insertions(+), 40 deletions(-)
diff --git a/public/pages/property/costDetail/costDetail.js b/public/pages/property/costDetail/costDetail.js
index 4b6f2cb..fc36210 100644
--- a/public/pages/property/costDetail/costDetail.js
+++ b/public/pages/property/costDetail/costDetail.js
@@ -59,16 +59,21 @@
});
},
methods: {
+ _computeTableDivWidth: function () {
+ let mainWidth = document.getElementsByTagName('body')[0].clientWidth - document.getElementById('menu-nav').offsetWidth;
+ mainWidth = mainWidth - 20 - 15 - 20;
+ return mainWidth + 'px';
+ },
_initDate: function () {
},
_loadCommunityList: function () {
var currentCommunity = vc.getCurrentCommunity();
console.log('褰撳墠灏忓尯:', currentCommunity);
-
+
// 灏濊瘯浠巐ocalStorage鑾峰彇灏忓尯鍒楄〃锛屽彲鑳藉瓨鍌ㄥ湪涓嶅悓鐨勯敭鍚嶄笅
var communityListKeys = ['communityList', 'communityInfos', 'communities'];
var communityInfos = null;
-
+
for (var key of communityListKeys) {
try {
let localCommunityList = JSON.parse(window.localStorage.getItem(key));
@@ -81,13 +86,13 @@
console.error('瑙f瀽localStorage涓殑' + key + '澶辫触:', e);
}
}
-
+
// 濡傛灉localStorage涓病鏈夊皬鍖哄垪琛紝浣跨敤vc.getCommunitys()
if (!communityInfos) {
communityInfos = vc.getCommunitys();
console.log('浣跨敤vc.getCommunitys()鑾峰彇灏忓尯鍒楄〃:', communityInfos);
}
-
+
// 濡傛灉杩樻槸娌℃湁灏忓尯鍒楄〃锛岄�氳繃API鑾峰彇
if (!communityInfos || !Array.isArray(communityInfos) || (Array.isArray(communityInfos) && communityInfos.length <= 3)) {
console.log('灏忓尯鍒楄〃涓嶅畬鏁达紝閫氳繃API鑾峰彇');
@@ -116,7 +121,7 @@
}
);
}
-
+
if (communityInfos && Array.isArray(communityInfos) && communityInfos.length > 0) {
$that.costDetailInfo.communityList = communityInfos;
// 榛樿閫夋嫨"璇烽�夋嫨"锛屾樉绀烘墍鏈夊皬鍖虹殑鏁版嵁
@@ -144,7 +149,7 @@
page: _page,
row: _rows
};
-
+
// 濡傛灉鐢ㄦ埛閫夋嫨浜�"璇烽�夋嫨"锛屼紶鍏ョ┖瀛楃涓诧紝鐪嬬湅鍚庣鏄惁浼氳繑鍥炴墍鏈夊皬鍖虹殑鏁版嵁
if (!selectedCommunityName) {
params.communityName = '';
@@ -189,8 +194,9 @@
return {
flowCode: item.flowNumber || '--',
- communityCode: item.projectCode || '--',
+ projectCode: item.projectCode || '--',
communityName: item.projectName || '--',
+ auxiliaryColumn: item.auxiliaryColumn || '--',
date: item.date || '--',
projectContent: item.projectContent || '--',
managementAmount: item.managementOfficeAmount || '--',
@@ -204,7 +210,52 @@
buildingType: item.buildingOrAll || '--',
maintenanceType: item.maintenanceType || '--',
costDetailId: item.id,
- _originalData: item
+ _originalData: item,
+ projectCode: item.projectCode || '--',
+ auxiliaryColumn: item.auxiliaryColumn || '--',
+ flowNumber: item.flowNumber || '--',
+ serialNumber: item.serialNumber || '--',
+ projectName: item.projectName || '--',
+ year: item.year || '--',
+ month: item.month || '--',
+ day: item.day || '--',
+ date: item.date || '--',
+ projectContent: item.projectContent || '--',
+ managementOfficeAmount: item.managementOfficeAmount || '--',
+ managementOfficeSeal: item.managementOfficeSeal || '--',
+ ownersCommitteeAmount: item.ownersCommitteeAmount || '--',
+ auditAmount: item.auditAmount || '--',
+ ownersCommitteeSeal: item.ownersCommitteeSeal || '--',
+ reportDepartment: item.reportDepartment || '--',
+ fundTypeLevel1: item.fundTypeLevel1 || '--',
+ fundTypeLevel2: item.fundTypeLevel2 || '--',
+ maintenanceType: item.maintenanceType || '--',
+ buildingOrAll: item.buildingOrAll || '--',
+ specificAnnouncementStatus: item.specificAnnouncementStatus || '--',
+ quota: item.quota || '--',
+ ownersCommitteeResolution: item.ownersCommitteeResolution || '--',
+ ownersCommitteeConsultation: item.ownersCommitteeConsultation || '--',
+ withdrawalEncounteredProblem: item.withdrawalEncounteredProblem || '--',
+ shortageOrArrears: item.shortageOrArrears || '--',
+ roadName: item.roadName || '--',
+ lane: item.lane || '--',
+ door: item.door || '--',
+ room: item.room || '--',
+ doorRoomNumber: item.doorRoomNumber || '--',
+ ownerAddress: item.ownerAddress || '--',
+ qualityGuaranteePeriod2: item.qualityGuaranteePeriod2 || '--',
+ qualityGuaranteeRatio: item.qualityGuaranteeRatio || '--',
+ qualityGuaranteeAmount: item.qualityGuaranteeAmount || '--',
+ acceptanceDate: item.acceptanceDate || '--',
+ auditDate: item.auditDate || '--',
+ availableWithdrawalDate: item.availableWithdrawalDate || '--',
+ managementFeeRatio: item.managementFeeRatio || '--',
+ payeeName: item.payeeName || '--',
+ idCardNumber: item.idCardNumber || '--',
+ bankName: item.bankName || '--',
+ bankAccount: item.bankAccount || '--',
+ advancedPayment: item.advancedPayment || '--',
+ payableAmountD: item.payableAmountD || '--'
};
});
@@ -372,14 +423,14 @@
// 妯℃澘璺緞锛屽彲鏍规嵁闇�瑕佷粠閰嶇疆鎴栧悗绔幏鍙�
var templatePath = '/import/璐圭敤瀵煎叆妯℃澘.xlsx';
var templateName = '璐圭敤瀵煎叆妯℃澘.xlsx';
-
+
link.href = templatePath;
link.download = templateName;
link.style.display = 'none';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
-
+
vc.toast('妯℃澘涓嬭浇涓紝璇风◢鍊�...');
} catch (e) {
console.error('妯℃澘涓嬭浇澶辫触:', e);
@@ -410,7 +461,7 @@
$('#importCostDetailModal').modal('show');
console.log('妯℃�佹宸叉樉绀�');
},
-
+
importCostDetailValidate() {
return vc.validate.validate({
importCostDetailInfo: $that.importCostDetailInfo
@@ -427,23 +478,23 @@
}]
});
},
-
+
/**
* 鏂囦欢閫夋嫨澶勭悊
* 鍔熻兘锛氬鐞嗘枃浠堕�夋嫨浜嬩欢锛屾洿鏂版枃浠朵俊鎭�
* @param {Event} e 鏂囦欢閫夋嫨浜嬩欢
*/
- getExcelTemplate: function(e) {
+ getExcelTemplate: function (e) {
console.log('閫夋嫨鏂囦欢:', e.target.files[0]);
$that.importCostDetailInfo.excelTemplate = e.target.files[0];
console.log('鏂囦欢淇℃伅:', $that.importCostDetailInfo.excelTemplate);
},
-
+
/**
* 瀵煎叆鏁版嵁
* 鍔熻兘锛氭墽琛岃垂鐢ㄦ槑缁嗘暟鎹鍏�
*/
- _importData: function() {
+ _importData: function () {
console.log('寮�濮嬫墽琛屽鍏ユ暟鎹�');
try {
// 楠岃瘉琛ㄥ崟
@@ -453,7 +504,7 @@
return;
}
console.log('楠岃瘉閫氳繃');
-
+
// 楠岃瘉鏂囦欢鏄惁瀛樺湪
if (!$that.importCostDetailInfo.excelTemplate) {
console.log('鏈�夋嫨鏂囦欢');
@@ -461,7 +512,7 @@
return;
}
console.log('鏂囦欢瀛樺湪:', $that.importCostDetailInfo.excelTemplate);
-
+
// 楠岃瘉鏂囦欢绫诲瀷
const fileExtension = $that.importCostDetailInfo.excelTemplate.name.split('.').pop();
if (!fileExtension || !$that.checkOwnerFileType(fileExtension)) {
@@ -470,16 +521,16 @@
return;
}
console.log('鏂囦欢绫诲瀷楠岃瘉閫氳繃:', fileExtension);
-
+
// 楠岃瘉鏂囦欢澶у皬
if (!$that.checkOwnerFileSize($that.importCostDetailInfo.excelTemplate.size)) {
console.log('鏂囦欢澶у皬瓒呰繃闄愬埗');
// 绉婚櫎鏂囦欢澶у皬闄愬埗妫�鏌�
- // vc.toast('Excel鏂囦欢澶у皬涓嶈兘瓒呰繃20M');
- // return;
+ // vc.toast('Excel鏂囦欢澶у皬涓嶈兘瓒呰繃20M');
+ // return;
}
console.log('鏂囦欢澶у皬楠岃瘉閫氳繃:', $that.importCostDetailInfo.excelTemplate.size);
-
+
// 璁剧疆瀵煎叆鐘舵��
$that.importStatus = {
isImporting: true,
@@ -487,15 +538,15 @@
message: '姝e湪鍑嗗瀵煎叆...'
};
console.log('璁剧疆瀵煎叆鐘舵�佷负瀵煎叆涓�');
-
+
// 妯℃嫙杩涘害鏇存柊
- let progressInterval = setInterval(function() {
+ let progressInterval = setInterval(function () {
if ($that.importStatus.progress < 90) {
$that.importStatus.progress += 10;
$that.importStatus.message = '瀵煎叆涓�... ' + $that.importStatus.progress + '%';
}
}, 500);
-
+
// 鏋勫缓琛ㄥ崟鏁版嵁
var param = new FormData();
param.append("uploadFile", $that.importCostDetailInfo.excelTemplate);
@@ -514,17 +565,17 @@
'assetImport',
'importData',
param, {
- emulateJSON: true,
- headers: {
- "Content-Type": "multipart/form-data"
- }
- },
- function(json, res) {
+ emulateJSON: true,
+ headers: {
+ "Content-Type": "multipart/form-data"
+ }
+ },
+ function (json, res) {
// 娓呴櫎杩涘害鏇存柊
clearInterval(progressInterval);
$that.importStatus.progress = 100;
$that.importStatus.message = '瀵煎叆瀹屾垚';
-
+
try {
let _json = JSON.parse(json);
if (_json.code == 0) {
@@ -565,7 +616,7 @@
};
}
},
- function(errInfo, error) {
+ function (errInfo, error) {
// 娓呴櫎杩涘害鏇存柊
clearInterval(progressInterval);
console.error('瀵煎叆璇锋眰澶辫触:', errInfo, error);
@@ -589,13 +640,13 @@
};
}
},
-
+
/**
* 娓呯┖瀵煎叆琛ㄥ崟淇℃伅
* 鍔熻兘锛氶噸缃鍏ヨ〃鍗曠殑鎵�鏈夊瓧娈�
* 璋冪敤鏃舵満锛氭墦寮�瀵煎叆寮圭獥鍓嶅拰瀵煎叆瀹屾垚鍚�
*/
- clearImportInfo: function() {
+ clearImportInfo: function () {
$that.importCostDetailInfo = {
communityId: vc.getCurrentCommunity().communityId,
excelTemplate: ''
@@ -606,13 +657,13 @@
message: ''
};
},
-
+
/**
* 鏌ョ湅瀵煎叆鍘嗗彶璁板綍
* 鍔熻兘锛氳烦杞埌瀵煎叆鍘嗗彶璁板綍椤甸潰
* 瀹炵幇锛氳烦杞埌璧勪骇瀵煎叆鏃ュ織鍒楄〃椤甸潰锛屽甫涓婅垂鐢ㄦ槑缁嗗鍏ョ殑绛涢�夋潯浠�
*/
- _viewImportHistory: function() {
+ _viewImportHistory: function () {
try {
// 璺宠浆鍒板鍏ユ棩蹇楀垪琛ㄩ〉闈紝绛涢�夎垂鐢ㄦ槑缁嗗鍏ヨ褰�
vc.jumpToPage('/#/pages/property/assetImportLog?logType=importReportMainV2&source=costDetailReport');
@@ -621,8 +672,8 @@
vc.toast('璺宠浆鍒板鍏ュ巻鍙查〉闈㈠け璐ワ紝璇烽噸璇�');
}
},
-
- checkOwnerFileType: function(fileType) {
+
+ checkOwnerFileType: function (fileType) {
const acceptTypes = ['xlsx', 'xls'];
for (var i = 0; i < acceptTypes.length; i++) {
if (fileType === acceptTypes[i]) {
@@ -631,8 +682,8 @@
}
return false;
},
-
- checkOwnerFileSize: function(fileSize) {
+
+ checkOwnerFileSize: function (fileSize) {
//20M
const MAX_SIZE = 20 * 1024 * 1024;
if (fileSize > MAX_SIZE) {
--
Gitblit v1.8.0