|
@@ -525,7 +525,7 @@ const XML_EXPORT_BASE = (() => {
|
|
|
let projectData = _cache.projectData;
|
|
|
// 没有数据,需要拉取
|
|
|
if (!Object.keys(projectData).length) {
|
|
|
- projectData = await ajaxPost('/pm/api/getProjectByGranularity', { user_id: userID, tenderID, granularity, summaryObj});
|
|
|
+ projectData = await ajaxPost('/pm/api/getProjectByGranularity', { user_id: userID, tenderID, granularity, summaryObj });
|
|
|
_cache.projectData = projectData;
|
|
|
}
|
|
|
return projectData;
|
|
@@ -780,15 +780,44 @@ const XML_EXPORT_BASE = (() => {
|
|
|
* 有错误的话,将先直接弹窗提示,不会进行其他的自检
|
|
|
* */
|
|
|
function propertyCheck() {
|
|
|
- const failtList = ['<span style="font-weight: bold>基本信息下:</span>'];
|
|
|
+ const type = {
|
|
|
+ info: '基本信息',
|
|
|
+ feature: '工程特征'
|
|
|
+ };
|
|
|
+ const failList = ['<span style="font-weight: bold">建设项目下:</span>'];
|
|
|
+ let haveHandledProjectData = false;
|
|
|
const tenderDetailMap = _cache.tenderDetailMap;
|
|
|
+ // 按照获取顺序serialNo(根据树结构)排序
|
|
|
+ Object.values(tenderDetailMap)
|
|
|
+ .sort((a, b) => a.serialNo - b.serialNo)
|
|
|
+ .forEach(tenderDetail => {
|
|
|
+ if (!haveHandledProjectData) {
|
|
|
+ haveHandledProjectData = true;
|
|
|
+ const basicInformation = tenderDetail.projectInfo.property.basicInformation || [];
|
|
|
+ const infoFailList = itemsCheck(basicInformation, type.info);
|
|
|
+ if (!infoFailList.length) {
|
|
|
+ failList.splice(0, failList.length);
|
|
|
+ } else {
|
|
|
+ failList.push(...infoFailList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ failList.push(`<span style="font-weight: bold">单位工程“${tenderDetail.projectInfo.name}”下:</span>`);
|
|
|
+ const projectFeature = tenderDetail.projectInfo.property.projectFeature || [];
|
|
|
+ const featureFailList = itemsCheck(projectFeature, type.feature);
|
|
|
+ if (!featureFailList.length) {
|
|
|
+ failList.splice(-1, 1);
|
|
|
+ } else {
|
|
|
+ failList.push(...featureFailList);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return failList;
|
|
|
|
|
|
// 条目检查
|
|
|
- function itemsCheck(items) {
|
|
|
+ function itemsCheck(items, type) {
|
|
|
const requiredData = commonUtil.getRequired([], items);
|
|
|
return requiredData
|
|
|
.filter(item => commonUtil.isEmptyVal(item.value))
|
|
|
- .map(item => `${item.dispName}不能为空` );
|
|
|
+ .map(item => `${type}-“${item.dispName}”不能为空。`);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -803,12 +832,12 @@ const XML_EXPORT_BASE = (() => {
|
|
|
// 检查清单综合单价是否大于最高限价,大于则提示
|
|
|
function checkMaxPrice(tenderDetail) {
|
|
|
return tenderDetail.mainTree.items
|
|
|
- .filter(node => calcTools.unitFeeGTMaxPrice(node, 'common.unitFee'))
|
|
|
- .map(node => {
|
|
|
- const code = node.data.code || '';
|
|
|
- const name = node.data.name || '';
|
|
|
- return `第${node.serialNo()}行“${code + name}”,清单综合单价 > 最高限价`;
|
|
|
- });
|
|
|
+ .filter(node => calcTools.unitFeeGTMaxPrice(node, 'common.unitFee'))
|
|
|
+ .map(node => {
|
|
|
+ const code = node.data.code || '';
|
|
|
+ const name = node.data.name || '';
|
|
|
+ return `第${node.serialNo()}行“${code + name}”,清单综合单价 > 最高限价`;
|
|
|
+ });
|
|
|
}
|
|
|
const infos = [];
|
|
|
// 按照获取顺序serialNo(根据树结构)排序
|
|
@@ -824,7 +853,7 @@ const XML_EXPORT_BASE = (() => {
|
|
|
});
|
|
|
return infos;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
const UTIL = Object.freeze({
|
|
|
deWeightHints,
|
|
|
isDef,
|
|
@@ -853,6 +882,7 @@ const XML_EXPORT_BASE = (() => {
|
|
|
setAttr,
|
|
|
getParsedData,
|
|
|
setupCode,
|
|
|
+ propertyCheck,
|
|
|
softCheck
|
|
|
});
|
|
|
|
|
@@ -962,7 +992,7 @@ const XML_EXPORT_BASE = (() => {
|
|
|
async function getExtractData() {
|
|
|
const fileKind = projectObj.project.projectInfo.property.fileKind;
|
|
|
const projectID = projectObj.project.ID();
|
|
|
- const extractData = await extractExportData(XMLStandard.entry, GRANULARITY.PROJECT,
|
|
|
+ const extractData = await extractExportData(XMLStandard.entry, GRANULARITY.PROJECT,
|
|
|
XMLStandard.summaryObj, fileKind, projectID, userID);
|
|
|
// projects表数据
|
|
|
const projectData = _.cloneDeep(_cache.projectData);
|