|
@@ -1114,6 +1114,52 @@ let pageCCOprObj = {
|
|
|
}
|
|
|
projectObj.mainSpread.getActiveSheet().autoFitRow(row);
|
|
|
},
|
|
|
+ bulkSetCharacterBySetting: function(nodes, setting) {
|
|
|
+ $.bootstrapLoading.start();
|
|
|
+ let me = this;
|
|
|
+ let updateDatas = [];
|
|
|
+ let updateNodes = [];
|
|
|
+ let updateMapping = {};
|
|
|
+ for(let node of nodes){
|
|
|
+ if(!node || node.sourceType !== projectObj.project.Bills.getSourceType()){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ let findSet = {ID: node.data.ID, projectID: node.data.projectID};
|
|
|
+ let updateData = this.getCharacterUpdateData(setting, node);
|
|
|
+ updateData.jobContent = node.data.jobContent;
|
|
|
+ updateData.itemCharacter = node.data.itemCharacter;
|
|
|
+ let orgName = isDef(node.data.name) ? node.data.name : '';
|
|
|
+ let orgItemCharacterText = isDef(node.data.itemCharacterText) ? node.data.itemCharacterText : '';
|
|
|
+ let orgJobContentText = isDef(node.data.jobContentText) ? node.data.jobContentText : '';
|
|
|
+ if(orgName == updateData.name && orgItemCharacterText == updateData.itemCharacterText && orgJobContentText == updateData.jobContentText){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ updateMapping[node.data.ID] = updateData;
|
|
|
+ updateNodes.push(node);
|
|
|
+ updateDatas.push({findSet: findSet, updateData: updateData});
|
|
|
+ }
|
|
|
+ if(updateDatas.length > 0){
|
|
|
+ CommonAjax.post('/bills/updateBills', {updateDatas: updateDatas}, function (rstData) {
|
|
|
+ for(let node of updateNodes){
|
|
|
+ let mainSheet = projectObj.mainSpread.getActiveSheet();
|
|
|
+ mainSheet.suspendPaint();
|
|
|
+ mainSheet.suspendEvent();
|
|
|
+ me.refreshView(node, updateMapping[node.data.ID]);
|
|
|
+ node.data.name = updateMapping[node.data.ID]['name'];
|
|
|
+ node.data.itemCharacterText = updateMapping[node.data.ID]['itemCharacterText'];
|
|
|
+ node.data.jobContentText = updateMapping[node.data.ID]['jobContentText'];
|
|
|
+ mainSheet.resumePaint();
|
|
|
+ mainSheet.resumeEvent();
|
|
|
+ }
|
|
|
+ $.bootstrapLoading.end();
|
|
|
+ }, function () {
|
|
|
+ $.bootstrapLoading.end();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $.bootstrapLoading.end();
|
|
|
+ }
|
|
|
+ },
|
|
|
/**
|
|
|
* 根据配置设置清单项目特征
|
|
|
*
|