|
@@ -753,20 +753,23 @@ let pageCCOprObj = {
|
|
|
});
|
|
|
},
|
|
|
/**
|
|
|
- * 根据配置转换清单项目特征
|
|
|
+ * 根据配置设置清单项目特征
|
|
|
*
|
|
|
* @param {Object} node - 选中的node节点
|
|
|
* @param {Object} setting - 设置
|
|
|
* @return {void}
|
|
|
*/
|
|
|
- buildCharacterBySetting: function(node, setting) {
|
|
|
+ setCharacterBySetting: function(node, setting) {
|
|
|
let contentArray = [];
|
|
|
// 特征部分
|
|
|
const itemCharacter = node.data.itemCharacter;
|
|
|
+ // 内容数据
|
|
|
+ const itemJob = node.data.jobContent;
|
|
|
|
|
|
- if (itemCharacter === undefined || itemCharacter.length <= 0) {
|
|
|
+ if (itemCharacter === undefined || itemCharacter.length <= 0 || itemJob === undefined || itemJob.length <= 0) {
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
let characterArray = [];
|
|
|
for (const tmp of itemCharacter) {
|
|
|
if (tmp.eigenvalue === undefined || tmp.eigenvalue.length <= 0) {
|
|
@@ -797,10 +800,6 @@ let pageCCOprObj = {
|
|
|
}
|
|
|
|
|
|
// 内容部分
|
|
|
- const itemJob = node.data.jobContent;
|
|
|
- if (itemJob === undefined || itemJob.length <= 0) {
|
|
|
- return;
|
|
|
- }
|
|
|
let jobArray = [];
|
|
|
for (const tmp of itemJob) {
|
|
|
// 匹配设置的序号格式
|
|
@@ -827,21 +826,23 @@ let pageCCOprObj = {
|
|
|
break;
|
|
|
case "3":
|
|
|
// 项目特征
|
|
|
- contentArray.push(characterArray);
|
|
|
+ contentArray.push.apply(contentArray, characterArray);
|
|
|
break;
|
|
|
case "4":
|
|
|
// 工作内容
|
|
|
- contentArray.push(jobArray);
|
|
|
+ contentArray.push.apply(contentArray, jobArray);
|
|
|
break;
|
|
|
case "5":
|
|
|
// 定额子目
|
|
|
+ const rationChapter = this.getRationChapter(node, setting);
|
|
|
+ contentArray.push.apply(contentArray, rationChapter);
|
|
|
break;
|
|
|
}
|
|
|
// 显示格式
|
|
|
switch (setting.displayFormat) {
|
|
|
case "1":
|
|
|
// 换行分隔
|
|
|
- content = contentArray.join('\r\n');
|
|
|
+ content = contentArray.join("\r\n");
|
|
|
break;
|
|
|
case "2":
|
|
|
// 逗号分隔
|
|
@@ -853,18 +854,30 @@ let pageCCOprObj = {
|
|
|
break;
|
|
|
}
|
|
|
// 添加到对应位置
|
|
|
+ let saveObj = {};
|
|
|
switch (setting.position) {
|
|
|
case "1":
|
|
|
// 添加到项目特征列
|
|
|
- node.data.itemCharacterText = content;
|
|
|
+ saveObj = {field: 'itemCharacterText', text: content};
|
|
|
+ // 更新到数据库
|
|
|
+ pageCCOprObj.updateCharacterContent(pageCCOprObj.currentFindSet,
|
|
|
+ {field: 'itemCharacter', updateArr: itemCharacter}, saveObj, characterOprObj);
|
|
|
break;
|
|
|
case "2":
|
|
|
// 添加到清单名称列
|
|
|
- node.data.name = content;
|
|
|
+ const column = this.mainActiveCell.col !== undefined ? this.mainActiveCell.col : -1;
|
|
|
+ let colSetting = projectObj.mainController.setting.cols[column];
|
|
|
+ if (colSetting !== undefined) {
|
|
|
+ projectObj.project.Bills.updateField(node.source, 'name', content, true);
|
|
|
+ projectObj.mainController.refreshTreeNode([node]);
|
|
|
+ }
|
|
|
break;
|
|
|
case "3":
|
|
|
// 添加到工作内容列
|
|
|
- node.data.jobContentText = content;
|
|
|
+ saveObj = {field: 'jobContentText', text: content};
|
|
|
+ // 更新到数据库
|
|
|
+ pageCCOprObj.updateCharacterContent(pageCCOprObj.currentFindSet,
|
|
|
+ {field: 'jobContent', updateArr: itemJob}, saveObj, contentOprObj);
|
|
|
break;
|
|
|
}
|
|
|
|
|
@@ -895,4 +908,29 @@ let pageCCOprObj = {
|
|
|
}
|
|
|
return serialNo;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 查找选中的树节点中定额子目数据
|
|
|
+ *
|
|
|
+ * @param {Object} selectNode - 选中的节点
|
|
|
+ * @param {Object} setting - 设置
|
|
|
+ * @return {Array} - 返回定额子目数组
|
|
|
+ */
|
|
|
+ getRationChapter: function(selectNode, setting) {
|
|
|
+ let result = [];
|
|
|
+ if (selectNode.children === undefined || selectNode.children.length <= 0) {
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ // 查找对应的定额数据
|
|
|
+ let count = 1;
|
|
|
+ for (const tmp of selectNode.children) {
|
|
|
+ if (tmp.sourceType !== 'ration') {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ const serialNo = this.formatSerialNumber(setting.serialType, count.toString());
|
|
|
+ result.push(serialNo + tmp.data.code + ':' + tmp.data.name);
|
|
|
+ count++;
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ },
|
|
|
}
|