|
|
@@ -445,7 +445,7 @@ const pmShare = (function () {
|
|
|
let node = tree.items[options.row];
|
|
|
// Draw Text
|
|
|
GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
|
|
|
- if (node && node.data.projType === projectType.tender) {
|
|
|
+ if (node && node.data.projType === projectType.tender||node.data.projType === projectType.project) {
|
|
|
let text = options.sheet.getText(options.row, options.col);
|
|
|
let acStyle = options.sheet.getActualStyle(options.row, options.col),
|
|
|
zoom = options.sheet.zoom();
|
|
|
@@ -732,6 +732,7 @@ const pmShare = (function () {
|
|
|
//data.allowCopy与shareInfo里allowCopy的区别:
|
|
|
//data.allowCopy为该单位实际的权限(跟着最新的分享信息走,可能随着父项)
|
|
|
for (let data of datas) {
|
|
|
+ if($(".p-title").text().includes('专业') && data.projType == projectType.project) data.allowCopy = isAllowCopy(userID, data); //20200715 专业版要求能复制建设项目
|
|
|
if (data.projType === projectType.tender) {
|
|
|
data.allowCopy = isAllowCopy(userID, data);
|
|
|
data.allowCooperate = isAllowCoop(userID, data);
|
|
|
@@ -782,12 +783,23 @@ const pmShare = (function () {
|
|
|
icon: 'fa-copy',
|
|
|
disabled: function () {
|
|
|
let selected = tree.selected;
|
|
|
- return !(selected && selected.data.allowCopy);
|
|
|
+ return !(selected && selected.data.allowCopy && selected.data.projType === projectType.tender);
|
|
|
},
|
|
|
callback: function (key, opt) {
|
|
|
$('#copyShare').modal('show');
|
|
|
}
|
|
|
},
|
|
|
+ "copyProject": {
|
|
|
+ name: "拷贝建设项目",
|
|
|
+ icon: 'fa-copy',
|
|
|
+ disabled: function () {
|
|
|
+ let selected = tree.selected;
|
|
|
+ return !($(".p-title").text().includes('专业')&&selected && selected.data.allowCopy && selected.data.projType === projectType.project);
|
|
|
+ },
|
|
|
+ callback: function (key, opt) {
|
|
|
+ copyContructionProject(tree.selected);
|
|
|
+ }
|
|
|
+ },
|
|
|
"cancel": {
|
|
|
name: "清除",
|
|
|
icon: 'fa-remove',
|
|
|
@@ -928,6 +940,31 @@ const pmShare = (function () {
|
|
|
alert(err);
|
|
|
}
|
|
|
}
|
|
|
+ //拷贝分享的建设项目
|
|
|
+ //@param {Object}selected
|
|
|
+ async function copyContructionProject(selected){
|
|
|
+ try {
|
|
|
+ let newName = getCopyName(selected);
|
|
|
+ //获取单项工程的单位工程
|
|
|
+ let projectQuery = {$or: [{deleteInfo: null}, {'deleteInfo.deleted': false}], userID: userID,projType: "Project"};
|
|
|
+ const rstData = await ajaxPost('/pm/api/getProjectsByQuery', {user_id: userID, query: projectQuery, options: '-_id -property'}, false, 10000);
|
|
|
+ for(let project of rstData){
|
|
|
+ if(project.name === newName){
|
|
|
+ alert("已存在此建设项目");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let tenderCount = 0;
|
|
|
+ if(selected.children) tenderCount = selected.children.length;
|
|
|
+ let key = uuid.v1();
|
|
|
+ $.bootstrapLoading.progressStart('拷贝建设项目', true);
|
|
|
+ $("#progress_modal_body").text('正在拷贝建设项目,请稍候……');
|
|
|
+ await ajaxPost('/pm/api/copyConstructionProject', {user_id: userID, tenderCount: tenderCount,key:key,projectID:selected.data.actualTreeInfo.ID,newName:newName});
|
|
|
+ importProcessChecking(key, null, projTreeObj.emitTreeChange);
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ }
|
|
|
+ }
|
|
|
//获取拷贝后的名称
|
|
|
//@param {Object}node @return {String}
|
|
|
function getCopyName(node) {
|