|
@@ -527,14 +527,13 @@ var projectObj = {
|
|
|
let project = projectObj.project;
|
|
|
let node = project.mainTree.items[info.row];
|
|
|
let fieldName = projectObj.mainController.setting.cols[info.col].data.field;
|
|
|
- let orgV = info.sheet.getValue(info.row, info.col);
|
|
|
- let newV;
|
|
|
- if(node && node.sourceType === projectObj.project.Ration.getSourceType() && node.data.type === rationType.ration
|
|
|
- && isDef(node.data.code) && isDef(node.data.prefix) && node.data.prefix !== rationPrefix.none && fieldName === 'code'){
|
|
|
- if(node.data.prefix){
|
|
|
- newV = orgV.replace(new RegExp(node.data.prefix), '');
|
|
|
- }
|
|
|
- info.sheet.setValue(info.row, info.col, newV);
|
|
|
+ let value = info.sheet.getValue(info.row, info.col);
|
|
|
+ if(fieldName === 'code' && node && calcTools.isRationItem(node) && isDef(node.data.code)){
|
|
|
+ if (isDef(node.data.prefix) && node.data.prefix !== rationPrefix.none){
|
|
|
+ value = value.replace(new RegExp(node.data.prefix), '');
|
|
|
+ };
|
|
|
+ value = value.replace(new RegExp(rationPrefix.replace), '');
|
|
|
+ info.sheet.setValue(info.row, info.col, value);
|
|
|
}
|
|
|
if(node&&fieldName =='quantity'&&(node.data.quantityEXP !==null||node.data.quantityEXP !==undefined)){
|
|
|
info.sheet.setValue(info.row, info.col, node.data.quantityEXP);
|