|  | @@ -85,12 +85,7 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |      currentCache: null,
 | 
	
		
			
				|  |  |      parentNodeIds: {},
 | 
	
		
			
				|  |  |      gljList: [],
 | 
	
		
			
				|  |  | -    //materialType: ['钢材', '木材', '水泥', '钢筋', '标准砖'],//三材类型:钢材1、钢筋101、木材2、水泥3、标准砖4
 | 
	
		
			
				|  |  | -    materialType: {textArr: ['钢材', '钢筋', '木材', '水泥', '标准砖'], comboItems: [{text: '钢材', value: 1}, {text: '钢筋', value: 2},{text: '木材', value: 3},//三材类型:钢材1、钢筋101、木材2、水泥3、标准砖4
 | 
	
		
			
				|  |  | -         {text: '水泥', value: 4}, {text: '标准砖', value: 5}]},
 | 
	
		
			
				|  |  | -    materialTypeIdx: {'1': '钢材', '2': '钢筋', '3': '木材', '4': '水泥', '5': '标准砖'},
 | 
	
		
			
				|  |  | -    machineModel: {textArr: ['特', '大', '中', '小'], comboItems: [{text: '特', value: 1}, {text: '大', value: 2},{text: '中', value: 3}, {text: '小', value: 4}]},
 | 
	
		
			
				|  |  | -    machineModelIdx: {'1': '特', '2': '大', '3': '中', '4': '小'},
 | 
	
		
			
				|  |  | +    feeDataCode: ['grossWeightCoe', 'purchaseStorageRate', 'offSiteTransportLossRate', 'handlingLossRate'],
 | 
	
		
			
				|  |  |      distTypeTree: null,//add
 | 
	
		
			
				|  |  |      setting: {
 | 
	
		
			
				|  |  |          owner: "glj",
 | 
	
	
		
			
				|  | @@ -101,10 +96,6 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |              {headerName:"单位",headerWidth:60,dataCode:"unit", dataType: "String", hAlign: "center", vAlign: "center"},
 | 
	
		
			
				|  |  |              {headerName:"定额价",headerWidth:80,dataCode:"basePrice", dataType: "Number", formatter: "0.00", hAlign: "right", vAlign: "center"},
 | 
	
		
			
				|  |  |              {headerName:"类型",headerWidth:90,dataCode:"gljType", dataType: "String", hAlign: "center", vAlign: "center"},
 | 
	
		
			
				|  |  | -            {headerName:"调整系数",headerWidth:60,dataCode:"adjCoe", dataType: "Number", hAlign: "center", vAlign: "center"},
 | 
	
		
			
				|  |  | -            {headerName:"三材类别",headerWidth:90,dataCode:"materialType", dataType: "String", hAlign: "center", vAlign: "center"},
 | 
	
		
			
				|  |  | -            {headerName:"三材系数",headerWidth:60,dataCode:"materialCoe", dataType: "Number", hAlign: "center", vAlign: "center"},
 | 
	
		
			
				|  |  | -            {headerName:"机型",headerWidth:60,dataCode:"model", dataType: "Number", hAlign: "center", vAlign: "center"},
 | 
	
		
			
				|  |  |          ],
 | 
	
		
			
				|  |  |          view:{
 | 
	
		
			
				|  |  |              comboBox:[
 | 
	
	
		
			
				|  | @@ -193,10 +184,10 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          let tailHeaders = [
 | 
	
		
			
				|  |  | -            {headerName:"调整系数",headerWidth:60,dataCode:"adjCoe", dataType: "Number", hAlign: "center", vAlign: "center"},
 | 
	
		
			
				|  |  | -            {headerName:"三材类别",headerWidth:90,dataCode:"materialType", dataType: "String", hAlign: "center", vAlign: "center"},
 | 
	
		
			
				|  |  | -            {headerName:"三材系数",headerWidth:60,dataCode:"materialCoe", dataType: "Number", hAlign: "center", vAlign: "center"},
 | 
	
		
			
				|  |  | -            {headerName:"机型",headerWidth:60,dataCode:"model", dataType: "Number", hAlign: "center", vAlign: "center"}
 | 
	
		
			
				|  |  | +            {headerName:"毛重系数",headerWidth:90,dataCode:"grossWeightCoe", dataType: "Number", hAlign: "center", vAlign: "center"},
 | 
	
		
			
				|  |  | +            {headerName:"采购保管费率",headerWidth:90,dataCode:"purchaseStorageRate", dataType: "Number", hAlign: "center", vAlign: "center"},
 | 
	
		
			
				|  |  | +            {headerName:"场外运输损耗率",headerWidth:100,dataCode:"offSiteTransportLossRate", dataType: "Number", hAlign: "center", vAlign: "center"},
 | 
	
		
			
				|  |  | +            {headerName:"每增一次装卸损耗率",headerWidth:100,dataCode:"handlingLossRate", dataType: "Number", hAlign: "center", vAlign: "center"},
 | 
	
		
			
				|  |  |          ];
 | 
	
		
			
				|  |  |          headers = headers.concat(tailHeaders);
 | 
	
		
			
				|  |  |          return headers;
 | 
	
	
		
			
				|  | @@ -398,13 +389,9 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |              let cacheSection = data;
 | 
	
		
			
				|  |  |              me.sortGljDeep(cacheSection);
 | 
	
		
			
				|  |  |              sheetCommonObj.cleanData(me.workBook.getSheet(0), me.setting, -1);
 | 
	
		
			
				|  |  | -            sheetsOprObj.showData(me, me.workBook.getSheet(0), me.setting, cacheSection, me.distTypeTree, me.materialTypeIdx, me.machineModelIdx);
 | 
	
		
			
				|  |  | -            let gljTypeCol = me.colMapping.fieldToCol['gljType'],
 | 
	
		
			
				|  |  | -                materialTypeCol = me.colMapping.fieldToCol['materialType'],
 | 
	
		
			
				|  |  | -                modelCol = me.colMapping.fieldToCol['model'];
 | 
	
		
			
				|  |  | +            sheetsOprObj.showData(me, me.workBook.getSheet(0), me.setting, cacheSection, me.distTypeTree);
 | 
	
		
			
				|  |  | +            let gljTypeCol = me.colMapping.fieldToCol['gljType'];
 | 
	
		
			
				|  |  |              sheetCommonObj.setDynamicCombo(me.workBook.getActiveSheet(), 0, gljTypeCol, me.workBook.getActiveSheet().getRowCount(), me.distTypeTree.comboDatas, 10, 'text');
 | 
	
		
			
				|  |  | -            sheetCommonObj.setDynamicCombo(me.workBook.getActiveSheet(), 0, materialTypeCol, me.workBook.getActiveSheet().getRowCount(), me.materialType.comboItems, false, 'text');
 | 
	
		
			
				|  |  | -            sheetCommonObj.setDynamicCombo(me.workBook.getActiveSheet(), 0, modelCol, me.workBook.getActiveSheet().getRowCount(), me.machineModel.comboItems, false, 'text');
 | 
	
		
			
				|  |  |              cacheSection = null;
 | 
	
		
			
				|  |  |              let selRow =  me.workBook.getActiveSheet().getSelections()[0].row;
 | 
	
		
			
				|  |  |              me.initSel(selRow);
 | 
	
	
		
			
				|  | @@ -633,8 +620,7 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |          let me = repositoryGljObj;
 | 
	
		
			
				|  |  |          let thisDataCode = me.setting.header[args.col].dataCode,
 | 
	
		
			
				|  |  |              lastDataCode = me.setting.header[me.lastCell.col].dataCode;
 | 
	
		
			
				|  |  | -        if(thisDataCode === 'unit'|| lastDataCode === 'unit' || thisDataCode === 'gljType' || lastDataCode === 'gljType'
 | 
	
		
			
				|  |  | -            || thisDataCode === 'materialType' || lastDataCode === 'materialType' || thisDataCode === 'model' || lastDataCode === 'model'){
 | 
	
		
			
				|  |  | +        if(thisDataCode === 'unit'|| lastDataCode === 'unit' || thisDataCode === 'gljType' || lastDataCode === 'gljType'){
 | 
	
		
			
				|  |  |              let rects = [];
 | 
	
		
			
				|  |  |              rects.push(args.sheet.getCellRect(args.row, args.col));
 | 
	
		
			
				|  |  |              if(me.lastCell){
 | 
	
	
		
			
				|  | @@ -720,9 +706,7 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |              let dataCode = me.setting.header[args.col].dataCode;
 | 
	
		
			
				|  |  |              me.currentGlj = me.currentCache[args.row];
 | 
	
		
			
				|  |  |              if(dataCode === 'code'
 | 
	
		
			
				|  |  | -                || (dataCode === 'adjCoe' && me.currentGlj.gljType !== 1 && me.currentGlj.gljType !== 303)
 | 
	
		
			
				|  |  | -                || (dataCode === 'materialCoe' && !me.currentGlj.materialType)
 | 
	
		
			
				|  |  | -                || (dataCode === 'model' && me.currentGlj.gljType !== 301)){
 | 
	
		
			
				|  |  | +                || (me.feeDataCode.includes(dataCode) && me.currentGlj.gljType !== 201)){//费率数据列只有普通材料能用
 | 
	
		
			
				|  |  |                  args.cancel = true;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              else {
 | 
	
	
		
			
				|  | @@ -750,7 +734,8 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |          let me = repositoryGljObj, that = gljComponentOprObj,
 | 
	
		
			
				|  |  |              updateArr = [], addArr = [], updateBasePrcArr = [];
 | 
	
		
			
				|  |  |          let deESCFields = ['code', 'name', 'specs'];//消除转义字符
 | 
	
		
			
				|  |  | -        if(deESCFields.includes(me.setting.header[args.col]['dataCode'])){
 | 
	
		
			
				|  |  | +        let dataCode = me.setting.header[args.col].dataCode;
 | 
	
		
			
				|  |  | +        if(deESCFields.includes(dataCode)){
 | 
	
		
			
				|  |  |              args.editingText = me.isDef(args.editingText) ? args.editingText.toString().replace(/[\r, \n]/g, '') : '';
 | 
	
		
			
				|  |  |              args.sheet.setValue(args.row, args.col, args.editingText);
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -759,7 +744,7 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |          //rObj.basePrice = rObj.basePrice ? rObj.basePrice : 0;
 | 
	
		
			
				|  |  |          me.initPrice(rObj);
 | 
	
		
			
				|  |  |          //更新
 | 
	
		
			
				|  |  | -        if (me.currentEditingGlj["ID"] && me.currentGlj) {
 | 
	
		
			
				|  |  | +        if (me.currentEditingGlj["ID"] !== null && me.currentEditingGlj["ID"] !== undefined && me.currentGlj) {
 | 
	
		
			
				|  |  |              rObj["ID"] = me.currentEditingGlj["ID"];
 | 
	
		
			
				|  |  |              rObj.gljClass = me.currentEditingGlj.gljClass;
 | 
	
		
			
				|  |  |              if(me.dataChanged(me.currentEditingGlj, rObj, args.col)){
 | 
	
	
		
			
				|  | @@ -775,16 +760,13 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |                              if(me.currentGlj){
 | 
	
		
			
				|  |  |                                  me.currentGlj.component = [];
 | 
	
		
			
				|  |  |                              }
 | 
	
		
			
				|  |  | -                            /*if(me.allowComponent.indexOf(rObj.gljType) !== -1){//更改成可添加组成物的类型,则将定额价设成零
 | 
	
		
			
				|  |  | -                             rObj.basePrice = 0;
 | 
	
		
			
				|  |  | -                             }*/
 | 
	
		
			
				|  |  | -                            //调整系数,工料机类型为人工和机上人工时,可输入整数
 | 
	
		
			
				|  |  | -                            if((me.currentEditingGlj.gljType === 1 || me.currentEditingGlj.gljType === 303) && !(rObj.gljType === 1 || rObj.gljType === 303)){
 | 
	
		
			
				|  |  | -                                rObj.adjCoe = null;
 | 
	
		
			
				|  |  | -                            }
 | 
	
		
			
				|  |  | -                            //工料机类型不为机械台班时,清空机型
 | 
	
		
			
				|  |  | -                            if(me.currentEditingGlj.gljType === 301 && rObj.gljType !== 301 && me.currentEditingGlj.model){
 | 
	
		
			
				|  |  | -                                rObj.model = null;
 | 
	
		
			
				|  |  | +                            //工料机类型不为普通材料时,情况费率数据
 | 
	
		
			
				|  |  | +                            if (me.currentEditingGlj.gljType === 201 && rObj.gljType !== 201) {
 | 
	
		
			
				|  |  | +                                for (let feeCode of me.feeDataCode) {
 | 
	
		
			
				|  |  | +                                    if (me.currentEditingGlj[feeCode]) {
 | 
	
		
			
				|  |  | +                                        rObj[feeCode] = null;
 | 
	
		
			
				|  |  | +                                    }
 | 
	
		
			
				|  |  | +                                }
 | 
	
		
			
				|  |  |                              }
 | 
	
		
			
				|  |  |                              if(componentType.includes(me.currentEditingGlj.gljType)&&
 | 
	
		
			
				|  |  |                                  !(machineComponent.includes(me.currentEditingGlj.gljType) && machineComponent.includes(rObj.gljType)) &&
 | 
	
	
		
			
				|  | @@ -810,24 +792,13 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |                              args.sheet.setValue(args.row, args.col, _.find(me.distTypeTree.comboDatas, {value: me.currentGlj.gljType}).text);
 | 
	
		
			
				|  |  |                          });
 | 
	
		
			
				|  |  |                          return;
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                    else if(rObj.adjCoe !== me.currentEditingGlj.adjCoe){//修改调整系数,整数控制
 | 
	
		
			
				|  |  | -                        if(isNaN(rObj.adjCoe) || rObj.adjCoe % 1 !== 0){
 | 
	
		
			
				|  |  | -                            args.sheet.setValue(args.row, args.col, me.currentEditingGlj.adjCoe ? me.currentEditingGlj.adjCoe : '');
 | 
	
		
			
				|  |  | -                            alert('调整系数只能输入整数!');
 | 
	
		
			
				|  |  | +                    } else if (me.feeDataCode.includes(dataCode) && rObj[dataCode] !== me.currentEditingGlj[dataCode]) {
 | 
	
		
			
				|  |  | +                        if(isNaN(rObj[dataCode])){
 | 
	
		
			
				|  |  | +                            args.sheet.setValue(args.row, args.col, me.currentEditingGlj[dataCode] ? me.currentEditingGlj[dataCode] : '');
 | 
	
		
			
				|  |  | +                            alert(`${me.setting.header[args.col].headerName}只能输入数值!`);
 | 
	
		
			
				|  |  |                              return;
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                    else if(rObj.materialCoe !== me.currentEditingGlj.materialCoe){
 | 
	
		
			
				|  |  | -                        if(isNaN(rObj.materialCoe)){
 | 
	
		
			
				|  |  | -                            args.sheet.setValue(args.row, args.col, me.currentEditingGlj.materialCoe ? me.currentEditingGlj.materialCoe : '');
 | 
	
		
			
				|  |  | -                            alert('三材系数只能输入数值!');
 | 
	
		
			
				|  |  | -                            return;
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  | -                        rObj.materialCoe = scMathUtil.roundTo(parseFloat(rObj.materialCoe), -5);
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                    else if(!me.priceIsEqual(rObj, me.currentEditingGlj)){//修改了单价,可修改单价的必为可成为组成物的
 | 
	
		
			
				|  |  | +                    } else if(!me.priceIsEqual(rObj, me.currentEditingGlj)){//修改了单价,可修改单价的必为可成为组成物的
 | 
	
		
			
				|  |  |                          let rObjPrice = me.getPrice(rObj, args.col),
 | 
	
		
			
				|  |  |                              editingGljPrice = me.getPrice(me.currentEditingGlj, args.col);
 | 
	
		
			
				|  |  |                          //寻找所有引用了此组成物的工料机,并从组成物中删去此工料机,并重算单价
 | 
	
	
		
			
				|  | @@ -849,19 +820,16 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                      rObj.component = me.currentGlj.component;
 | 
	
		
			
				|  |  |                      updateArr.push(rObj);
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                else{
 | 
	
		
			
				|  |  | -                    if(me.setting.header[args.col].dataCode === 'gljType'){
 | 
	
		
			
				|  |  | -                        let distTypeVal =  me.distTypeTree.distTypes[me.distTypeTree.prefix + me.currentEditingGlj[me.setting.header[args.col].dataCode]].data.fullName;
 | 
	
		
			
				|  |  | +                } else{
 | 
	
		
			
				|  |  | +                    if(dataCode === 'gljType'){
 | 
	
		
			
				|  |  | +                        let distTypeVal =  me.distTypeTree.distTypes[me.distTypeTree.prefix + me.currentEditingGlj[dataCode]].data.fullName;
 | 
	
		
			
				|  |  |                          args.sheet.setValue(args.row, args.col, distTypeVal);
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                    else{
 | 
	
		
			
				|  |  | -                        args.sheet.setValue(args.row, args.col, me.currentEditingGlj[me.setting.header[args.col].dataCode]);
 | 
	
		
			
				|  |  | +                    } else{
 | 
	
		
			
				|  |  | +                        args.sheet.setValue(args.row, args.col, me.currentEditingGlj[dataCode]);
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              if(!me.priceIsEqual(rObj, me.currentEditingGlj)){
 | 
	
		
			
				|  |  | -                console.log('df');
 | 
	
		
			
				|  |  |                  //update basePrice of ration when editting basePrice of glj
 | 
	
		
			
				|  |  |                  let gljType = -1;
 | 
	
		
			
				|  |  |                  let gljTypeParent = me.distTypeTree.distTypes[me.distTypeTree.prefix + me.currentEditingGlj.gljType].parent;
 | 
	
	
		
			
				|  | @@ -879,9 +847,7 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        //新增
 | 
	
		
			
				|  |  | -        else {
 | 
	
		
			
				|  |  | +        } else { //新增
 | 
	
		
			
				|  |  |              if(typeof rObj.code !== 'undefined'){
 | 
	
		
			
				|  |  |                  me.addGljObj = rObj;
 | 
	
		
			
				|  |  |                  let isCanSav = true;
 | 
	
	
		
			
				|  | @@ -891,7 +857,6 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |                  if(isCanSav){
 | 
	
		
			
				|  |  |                      me.addGljObj = null;
 | 
	
		
			
				|  |  |                      rObj.component = [];
 | 
	
		
			
				|  |  | -                    //rObj.basePrice = !isNaN(parseFloat(rObj.basePrice)) && (rObj.basePrice && typeof rObj.basePrice !== 'undefined') ? scMathUtil.roundTo(parseFloat(rObj.basePrice), -2) : 0;
 | 
	
		
			
				|  |  |                      me.initPrice(rObj);
 | 
	
		
			
				|  |  |                      addArr.push(rObj);
 | 
	
		
			
				|  |  |                  }
 | 
	
	
		
			
				|  | @@ -974,9 +939,6 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |                                          });
 | 
	
		
			
				|  |  |                                      }
 | 
	
		
			
				|  |  |                                      else {
 | 
	
		
			
				|  |  | -                                        if (dataCode === 'materialType') {
 | 
	
		
			
				|  |  | -                                            updateObj['materialCoe'] = null;
 | 
	
		
			
				|  |  | -                                        }
 | 
	
		
			
				|  |  |                                          updateObj[dataCode] = '';
 | 
	
		
			
				|  |  |                                      }
 | 
	
		
			
				|  |  |                                  }
 | 
	
	
		
			
				|  | @@ -1105,8 +1067,7 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |              that = gljComponentOprObj,
 | 
	
		
			
				|  |  |              tempObj = me.currentCache[rowIdx],
 | 
	
		
			
				|  |  |              reCalBasePrc = false,
 | 
	
		
			
				|  |  | -            isValid = true,
 | 
	
		
			
				|  |  | -            materialTypeValid = true;
 | 
	
		
			
				|  |  | +            isValid = true;
 | 
	
		
			
				|  |  |          //备份原始数据
 | 
	
		
			
				|  |  |          for(let atr in tempObj){
 | 
	
		
			
				|  |  |              backUpObj[atr] = tempObj[atr];
 | 
	
	
		
			
				|  | @@ -1143,18 +1104,12 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |                  if(pasteObj.gljType === me.distTypeTree.comboDatas[i].text){
 | 
	
		
			
				|  |  |                      pasteObj.gljType = me.distTypeTree.comboDatas[i].value;
 | 
	
		
			
				|  |  |                      isExsit = true;
 | 
	
		
			
				|  |  | -                    //调整系数
 | 
	
		
			
				|  |  | -                    if(pasteObj.gljType !== 1 && pasteObj.gljType !== 303){
 | 
	
		
			
				|  |  | -                        tempObj.adjCoe = null;
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                    else if((pasteObj.gljType === 1 || pasteObj.gljType === 303) && typeof pasteObj.adjCoe !== 'undefined' && !isNaN(pasteObj.adjCoe) && pasteObj.adjCoe % 1 === 0) {
 | 
	
		
			
				|  |  | -                        tempObj.adjCoe = pasteObj.adjCoe;
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                    if(pasteObj.gljType !== 301 && tempObj.gljType === 301){
 | 
	
		
			
				|  |  | -                        tempObj.model = null;
 | 
	
		
			
				|  |  | +                    if (pasteObj.gljType !== 201 && tempObj.gljType === 201) {
 | 
	
		
			
				|  |  | +                        for (let feeCode of me.feeDataCode) {
 | 
	
		
			
				|  |  | +                            tempObj[feeCode] = null;
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                      if(componentType.includes(tempObj.gljType) &&
 | 
	
		
			
				|  |  | -                        //!(tempObj.gljType === 302 && pasteObj.gljType === 303) && !(tempObj.gljType === 303 && pasteObj.gljType === 302)){//修改了原本是组成物的工料机
 | 
	
		
			
				|  |  |                          !(machineComponent.includes(tempObj.gljType) && machineComponent.includes(pasteObj.gljType)) &&
 | 
	
		
			
				|  |  |                          !(materialComponent.includes(tempObj.gljType) && materialComponent.includes(pasteObj.gljType))){//修改了原本是组成物的工料机
 | 
	
		
			
				|  |  |                          //寻找所有引用了此组成物的工料机,并从组成物中删去此工料机,并重算单价
 | 
	
	
		
			
				|  | @@ -1169,9 +1124,6 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                      tempObj.component = tempObj.gljType === pasteObj.gljType ? tempObj.component : [];
 | 
	
		
			
				|  |  | -                    /*if(me.allowComponent.indexOf(tempObj.gljType) !== -1){//更改成可含组成物的工料机类型,定额价设置为零
 | 
	
		
			
				|  |  | -                        tempObj.basePrice = tempObj.gljType === me.distTypeTree.comboDatas[i].value ? tempObj.basePrice : 0;
 | 
	
		
			
				|  |  | -                    }*/
 | 
	
		
			
				|  |  |                      tempObj.gljType = pasteObj.gljType;
 | 
	
		
			
				|  |  |                      tempObj.shortName = me.distTypeTree.distTypes[me.distTypeTree.prefix + tempObj.gljType].data.shortName;
 | 
	
		
			
				|  |  |                      break;
 | 
	
	
		
			
				|  | @@ -1181,12 +1133,14 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |                  isValid = false;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        if(typeof pasteObj.adjCoe !== 'undefined' && typeof pasteObj.gljType === 'undefined'){
 | 
	
		
			
				|  |  | -            if(tempObj.gljType && (tempObj.gljType === 1 || tempObj.gljType === 303) && typeof pasteObj.adjCoe !== 'undefined' && !isNaN(pasteObj.adjCoe) && pasteObj.adjCoe % 1 === 0) {
 | 
	
		
			
				|  |  | -                tempObj.adjCoe = pasteObj.adjCoe;
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -            else {
 | 
	
		
			
				|  |  | -                isValid = false;
 | 
	
		
			
				|  |  | +        for (let feeCode of me.feeDataCode) {
 | 
	
		
			
				|  |  | +            if (typeof pasteObj[feeCode] !== 'undefined' && !isNaN(pasteObj[feeCode])) {
 | 
	
		
			
				|  |  | +                if ((typeof pasteObj.gljType !== 'undefined' && pasteObj.gljType === 201) ||
 | 
	
		
			
				|  |  | +                    (tempObj.gljType && tempObj.gljType === 201)) {
 | 
	
		
			
				|  |  | +                    tempObj[feeCode] = pasteObj[feeCode];
 | 
	
		
			
				|  |  | +                } else {
 | 
	
		
			
				|  |  | +                    isValid = false;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          //单价相关
 | 
	
	
		
			
				|  | @@ -1226,53 +1180,6 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        if(typeof pasteObj.materialType !== 'undefined'){
 | 
	
		
			
				|  |  | -            if(!me.materialType.textArr.includes(pasteObj.materialType)){
 | 
	
		
			
				|  |  | -                isValid = false;
 | 
	
		
			
				|  |  | -                materialTypeValid = false;
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -            else {
 | 
	
		
			
				|  |  | -                me.materialType.comboItems.forEach(function (item) {
 | 
	
		
			
				|  |  | -                   if(item.text === pasteObj.materialType){
 | 
	
		
			
				|  |  | -                       tempObj.materialType = item.value;
 | 
	
		
			
				|  |  | -                   }
 | 
	
		
			
				|  |  | -                });
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        if(typeof pasteObj.materialCoe !== 'undefined'){
 | 
	
		
			
				|  |  | -            if(isNaN(pasteObj.materialCoe) ||
 | 
	
		
			
				|  |  | -                (!tempObj.materialType && (!pasteObj.materialType || !me.materialType.textArr.includes(pasteObj.materialType)))){
 | 
	
		
			
				|  |  | -                tempObj.materialType = '';
 | 
	
		
			
				|  |  | -                tempObj.materialCoe = null;
 | 
	
		
			
				|  |  | -                isValid = false;
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -            else{
 | 
	
		
			
				|  |  | -                tempObj.materialCoe = pasteObj.materialCoe !== '' ? scMathUtil.roundTo(parseFloat(pasteObj.materialCoe), -5) : null;
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        if(typeof pasteObj.model !== 'undefined'){
 | 
	
		
			
				|  |  | -            if(!me.machineModel.textArr.includes(pasteObj.model)){
 | 
	
		
			
				|  |  | -                isValid = false;
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -            else {
 | 
	
		
			
				|  |  | -                let existsModel = false;
 | 
	
		
			
				|  |  | -                if((typeof pasteObj.gljType !== 'undefined' && pasteObj.gljType === 301) ||
 | 
	
		
			
				|  |  | -                    (tempObj.gljType && tempObj.gljType === 301)){
 | 
	
		
			
				|  |  | -                    me.machineModel.comboItems.forEach(function (item) {
 | 
	
		
			
				|  |  | -                        if(item.text === pasteObj.model){
 | 
	
		
			
				|  |  | -                            tempObj.model = item.value;
 | 
	
		
			
				|  |  | -                            existsModel = true;
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  | -                    });
 | 
	
		
			
				|  |  | -                    if(!existsModel){
 | 
	
		
			
				|  |  | -                        isValid = false;
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                else {
 | 
	
		
			
				|  |  | -                    isValid = false;
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  |          if(isValid){
 | 
	
		
			
				|  |  |              rst.updateGlj.push(tempObj);
 | 
	
		
			
				|  |  |              if(reCalBasePrc){
 | 
	
	
		
			
				|  | @@ -1316,38 +1223,11 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        if(pasteObj.adjCoe && typeof pasteObj.adjCoe !== 'undefined'){
 | 
	
		
			
				|  |  | -            if(isNaN(pasteObj.adjCoe) || pasteObj.adjCoe % 1 !== 0){
 | 
	
		
			
				|  |  | +        for (let feeCode of me.feeDataCode) {
 | 
	
		
			
				|  |  | +            if (typeof pasteObj[feeCode] !== 'undefined' && (isNaN(pasteObj[feeCode]) || pasteObj.gljType !== 201)) {
 | 
	
		
			
				|  |  |                  return false;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        if(pasteObj.materialType){
 | 
	
		
			
				|  |  | -            if(!me.materialType.textArr.includes(pasteObj.materialType)){
 | 
	
		
			
				|  |  | -                return false;
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -            else {
 | 
	
		
			
				|  |  | -                me.materialType.comboItems.forEach(function (item) {
 | 
	
		
			
				|  |  | -                    if(item.text === pasteObj.materialType){
 | 
	
		
			
				|  |  | -                        pasteObj.materialType = item.value;
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                });
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        if(pasteObj.materialCoe){
 | 
	
		
			
				|  |  | -            if(isNaN(pasteObj.materialCoe) || !pasteObj.materialType){
 | 
	
		
			
				|  |  | -                return false;
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        if(typeof pasteObj.model !== 'undefined' && pasteObj.model){
 | 
	
		
			
				|  |  | -            if(!me.machineModel.textArr.includes(pasteObj.model) || pasteObj.gljType !== 301){
 | 
	
		
			
				|  |  | -                return false;
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -            me.machineModel.comboItems.forEach(function (item) {
 | 
	
		
			
				|  |  | -                if(item.text === pasteObj.model){
 | 
	
		
			
				|  |  | -                    pasteObj.model = item.value;
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -            });
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  |          if(!priceProperties || priceProperties.length === 0){
 | 
	
		
			
				|  |  |              pasteObj.basePrice = !isNaN(parseFloat(pasteObj.basePrice)) && (pasteObj.basePrice && typeof pasteObj.basePrice !== 'undefined') ? parseFloat(pasteObj.basePrice) : 0;
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -1404,19 +1284,17 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |          let me = repositoryGljObj;
 | 
	
		
			
				|  |  |          let updateArr = [], addArr = [];
 | 
	
		
			
				|  |  |          let items = sheetCommonObj.analyzePasteData(me.setting, info);
 | 
	
		
			
				|  |  | -        let beginRow = info.cellRange.row, endRow = info.cellRange.row + info.cellRange.rowCount - 1,
 | 
	
		
			
				|  |  | +        let beginRow = info.cellRange.row,
 | 
	
		
			
				|  |  | +            endRow = info.cellRange.row + info.cellRange.rowCount - 1,
 | 
	
		
			
				|  |  |              maxRow = me.currentCache.length - 1,
 | 
	
		
			
				|  |  |              updateBasePrcArr = [],
 | 
	
		
			
				|  |  |              updateCount, resumeArr = [];
 | 
	
		
			
				|  |  |          if(endRow <= maxRow){
 | 
	
		
			
				|  |  | -            //updateItems = items;
 | 
	
		
			
				|  |  |              for(let i = 0; i < items.length; i++){
 | 
	
		
			
				|  |  |                  let updateObj = me.validUpdateObj(items[i], info.cellRange.row + i);
 | 
	
		
			
				|  |  |                  if(updateObj && typeof updateObj.updateGlj !== 'undefined' && updateObj.updateGlj.length > 0){
 | 
	
		
			
				|  |  | -                    //updateArr = updateObj.updateGlj;
 | 
	
		
			
				|  |  |                      updateArr = updateArr.concat(updateObj.updateGlj);
 | 
	
		
			
				|  |  |                      if(typeof updateObj.updateBasePrcArr !== 'undefined'){
 | 
	
		
			
				|  |  | -                        //updateBasePrcArr = updateObj.updateBasePrc;
 | 
	
		
			
				|  |  |                          updateBasePrcArr = updateBasePrcArr.concat(updateObj.updateBasePrcArr);
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
	
		
			
				|  | @@ -1433,7 +1311,6 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            //if(info.cellRange.colCount >= me.setting.header.length - 4 && info.cellRange.colCount <= me.setting.header.length){
 | 
	
		
			
				|  |  |              //[code, ..., gljType]
 | 
	
		
			
				|  |  |              if(info.cellRange.colCount >= 5 && info.cellRange.colCount <= me.setting.header.length){
 | 
	
		
			
				|  |  |                  for(let i = updateCount ; i < items.length; i++){
 | 
	
	
		
			
				|  | @@ -1445,7 +1322,6 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          else{
 | 
	
		
			
				|  |  | -            //if(info.cellRange.colCount >= me.setting.header.length - 4 && info.cellRange.colCount <= me.setting.header.length && info.cellRange.col + info.cellRange.colCount - 1 >= 5){
 | 
	
		
			
				|  |  |              //粘贴的的最大列至少要等于工料机类型列,因为工料机类型必须有效才可新增
 | 
	
		
			
				|  |  |              if(info.cellRange.colCount >= 5 && info.cellRange.colCount <= me.setting.header.length && info.cellRange.col + info.cellRange.colCount - 1 >= me.colMapping.fieldToCol['gljType']){
 | 
	
		
			
				|  |  |                  for(let i = 0; i < items.length; i++){
 | 
	
	
		
			
				|  | @@ -1474,12 +1350,6 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |                              let gljType = me.currentCache[resumeArr[i]][dCode];
 | 
	
		
			
				|  |  |                              info.sheet.setValue(resumeArr[i], col, me.distTypeTree.distTypes["gljType" + gljType].data.fullName);
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  | -                        else if(dCode === 'materialType'){
 | 
	
		
			
				|  |  | -                            info.sheet.setValue(resumeArr[i], col, me.currentCache[resumeArr[i]][dCode] ? me.materialTypeIdx[me.currentCache[resumeArr[i]][dCode]]: '');
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  | -                        else if(dCode === 'model'){
 | 
	
		
			
				|  |  | -                            info.sheet.setValue(resumeArr[i], col, me.currentCache[resumeArr[i]][dCode] ? me.machineModelIdx[me.currentCache[resumeArr[i]][dCode]]: '');
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  |                          else{
 | 
	
		
			
				|  |  |                              info.sheet.setValue(resumeArr[i], col, me.currentCache[resumeArr[i]][dCode]);
 | 
	
		
			
				|  |  |                          }
 | 
	
	
		
			
				|  | @@ -1702,26 +1572,12 @@ let repositoryGljObj = {
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              return 0;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -      /*  if(this.currentOprParent){
 | 
	
		
			
				|  |  | -            datas.sort(function (a, b) {
 | 
	
		
			
				|  |  | -                let rst = 0;
 | 
	
		
			
				|  |  | -                if(a.code > b.code){
 | 
	
		
			
				|  |  | -                    rst = 1;
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                else if(a.code < b.code){
 | 
	
		
			
				|  |  | -                    rst = -1;
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                return rst;
 | 
	
		
			
				|  |  | -            });
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        else {*/
 | 
	
		
			
				|  |  | -            //排序符号-
 | 
	
		
			
				|  |  | -            datas.sort(function (a, b) {
 | 
	
		
			
				|  |  | -                let aArr = a.code.split('-'),
 | 
	
		
			
				|  |  | -                    bArr = b.code.split('-');
 | 
	
		
			
				|  |  | -                return recurCompare(aArr, bArr, 0);
 | 
	
		
			
				|  |  | -            });
 | 
	
		
			
				|  |  | -       // }
 | 
	
		
			
				|  |  | +        //排序符号-
 | 
	
		
			
				|  |  | +        datas.sort(function (a, b) {
 | 
	
		
			
				|  |  | +            let aArr = a.code.split('-'),
 | 
	
		
			
				|  |  | +                bArr = b.code.split('-');
 | 
	
		
			
				|  |  | +            return recurCompare(aArr, bArr, 0);
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //工料机排序
 | 
	
		
			
				|  |  |      sortGlj: function() {
 |