|
@@ -41,6 +41,10 @@ let repositoryGljObj = {
|
|
gljList: [],
|
|
gljList: [],
|
|
allowComponent: [202, 203, 204, 301, 4],//可带组成物类型:混凝土、砂浆、配合比、机械台班
|
|
allowComponent: [202, 203, 204, 301, 4],//可带组成物类型:混凝土、砂浆、配合比、机械台班
|
|
componentGljType: [201, 302, 303, 4],//可成为组成物的工料机类型: 普通材料、 机械组成物、 机上人工
|
|
componentGljType: [201, 302, 303, 4],//可成为组成物的工料机类型: 普通材料、 机械组成物、 机上人工
|
|
|
|
+ //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': '标准砖'},
|
|
distTypeTree: null,//add
|
|
distTypeTree: null,//add
|
|
setting: {
|
|
setting: {
|
|
owner: "glj",
|
|
owner: "glj",
|
|
@@ -52,6 +56,8 @@ let repositoryGljObj = {
|
|
{headerName:"定额价",headerWidth:80,dataCode:"basePrice", dataType: "Number", formatter: "0.00", hAlign: "right", 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:90,dataCode:"gljType", dataType: "String", hAlign: "center", vAlign: "center"},
|
|
{headerName:"调整系数",headerWidth:60,dataCode:"adjCoe", dataType: "Number", 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"},
|
|
],
|
|
],
|
|
view:{
|
|
view:{
|
|
comboBox:[
|
|
comboBox:[
|
|
@@ -187,8 +193,9 @@ let repositoryGljObj = {
|
|
if (me.workBook) {
|
|
if (me.workBook) {
|
|
let cacheSection = data;
|
|
let cacheSection = data;
|
|
sheetCommonObj.cleanData(me.workBook.getSheet(0), me.setting, -1);
|
|
sheetCommonObj.cleanData(me.workBook.getSheet(0), me.setting, -1);
|
|
- sheetsOprObj.showData(me.workBook.getSheet(0), me.setting, cacheSection, me.distTypeTree);
|
|
|
|
|
|
+ sheetsOprObj.showData(me.workBook.getSheet(0), me.setting, cacheSection, me.distTypeTree, me.materialTypeIdx);
|
|
sheetCommonObj.setDynamicCombo(me.workBook.getActiveSheet(), 0, 5, me.workBook.getActiveSheet().getRowCount(), me.distTypeTree.comboDatas, false, 'text');
|
|
sheetCommonObj.setDynamicCombo(me.workBook.getActiveSheet(), 0, 5, me.workBook.getActiveSheet().getRowCount(), me.distTypeTree.comboDatas, false, 'text');
|
|
|
|
+ sheetCommonObj.setDynamicCombo(me.workBook.getActiveSheet(), 0, 7, me.workBook.getActiveSheet().getRowCount(), me.materialType.comboItems, false, 'text');
|
|
cacheSection = null;
|
|
cacheSection = null;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -330,7 +337,10 @@ let repositoryGljObj = {
|
|
},
|
|
},
|
|
onEnterCell: function (sender, args) {
|
|
onEnterCell: function (sender, args) {
|
|
let me = repositoryGljObj;
|
|
let me = repositoryGljObj;
|
|
- if(me.setting.header[args.col].dataCode === 'gljType' || me.setting.header[me.lastCol].dataCode === 'gljType'){
|
|
|
|
|
|
+ let thisDataCode = me.setting.header[args.col].dataCode,
|
|
|
|
+ lastDataCode = me.setting.header[me.lastCol].dataCode;
|
|
|
|
+ if(thisDataCode === 'gljType' || lastDataCode === 'gljType'
|
|
|
|
+ || thisDataCode === 'materialType' || lastDataCode === 'materialType'){
|
|
args.sheet.repaint();
|
|
args.sheet.repaint();
|
|
}
|
|
}
|
|
me.cellRowIdx = args.row;
|
|
me.cellRowIdx = args.row;
|
|
@@ -400,10 +410,12 @@ let repositoryGljObj = {
|
|
me.currentEditingGlj = rObj;
|
|
me.currentEditingGlj = rObj;
|
|
me.orgCode = me.workBook.getSheet(0).getValue(args.row, 0);
|
|
me.orgCode = me.workBook.getSheet(0).getValue(args.row, 0);
|
|
if(args.row < me.currentCache.length){
|
|
if(args.row < me.currentCache.length){
|
|
|
|
+ let dataCode = me.setting.header[args.col].dataCode;
|
|
me.currentGlj = me.currentCache[args.row];
|
|
me.currentGlj = me.currentCache[args.row];
|
|
- if(args.col === 0 || (args.col === 4 && me.allowComponent.indexOf(me.currentGlj.gljType) !== -1
|
|
|
|
|
|
+ if(dataCode === 'code' || (dataCode === 'basePrice' && me.allowComponent.indexOf(me.currentGlj.gljType) !== -1
|
|
&& me.currentGlj.component.length > 0)
|
|
&& me.currentGlj.component.length > 0)
|
|
- || (args.col === 6 && me.currentGlj.gljType !== 1 && me.currentGlj.gljType !== 303)){
|
|
|
|
|
|
+ || (dataCode === 'adjCoe' && me.currentGlj.gljType !== 1 && me.currentGlj.gljType !== 303)
|
|
|
|
+ || (dataCode === 'materialCoe' && !me.currentGlj.materialType)){
|
|
args.cancel = true;
|
|
args.cancel = true;
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
@@ -416,11 +428,13 @@ let repositoryGljObj = {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onCellEditEnd: function(sender, args) {
|
|
onCellEditEnd: function(sender, args) {
|
|
|
|
+ console.log(args);
|
|
let me = repositoryGljObj, that = gljComponentOprObj,
|
|
let me = repositoryGljObj, that = gljComponentOprObj,
|
|
rObj = sheetsOprObj.combineRowData(me.workBook.getSheet(0), me.setting, args.row, me),
|
|
rObj = sheetsOprObj.combineRowData(me.workBook.getSheet(0), me.setting, args.row, me),
|
|
updateArr = [], addArr = [], updateBasePrcArr = [];
|
|
updateArr = [], addArr = [], updateBasePrcArr = [];
|
|
me.editingRowIdx = args.row;
|
|
me.editingRowIdx = args.row;
|
|
rObj.basePrice = rObj.basePrice ? rObj.basePrice : 0;
|
|
rObj.basePrice = rObj.basePrice ? rObj.basePrice : 0;
|
|
|
|
+ console.log(rObj);
|
|
//更新
|
|
//更新
|
|
if (me.currentEditingGlj["ID"] && me.currentGlj) {
|
|
if (me.currentEditingGlj["ID"] && me.currentGlj) {
|
|
rObj["ID"] = me.currentEditingGlj["ID"];
|
|
rObj["ID"] = me.currentEditingGlj["ID"];
|
|
@@ -432,9 +446,9 @@ let repositoryGljObj = {
|
|
if(me.currentGlj){
|
|
if(me.currentGlj){
|
|
me.currentGlj.component = [];
|
|
me.currentGlj.component = [];
|
|
}
|
|
}
|
|
- if(me.allowComponent.indexOf(rObj.gljType) !== -1){
|
|
|
|
|
|
+ /*if(me.allowComponent.indexOf(rObj.gljType) !== -1){//更改成可添加组成物的类型,则将定额价设成零
|
|
rObj.basePrice = 0;
|
|
rObj.basePrice = 0;
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
//调整系数,工料机类型为人工和机上人工时,可输入整数
|
|
//调整系数,工料机类型为人工和机上人工时,可输入整数
|
|
if((me.currentEditingGlj.gljType === 1 || me.currentEditingGlj.gljType === 303) && !(rObj.gljType === 1 || rObj.gljType === 303)){
|
|
if((me.currentEditingGlj.gljType === 1 || me.currentEditingGlj.gljType === 303) && !(rObj.gljType === 1 || rObj.gljType === 303)){
|
|
rObj.adjCoe = null;
|
|
rObj.adjCoe = null;
|
|
@@ -462,6 +476,14 @@ let repositoryGljObj = {
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ 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(rObj.basePrice !== me.currentEditingGlj.basePrice){//修改了单价,可修改单价的必为可成为组成物的
|
|
else if(rObj.basePrice !== me.currentEditingGlj.basePrice){//修改了单价,可修改单价的必为可成为组成物的
|
|
//寻找所有引用了此组成物的工料机,并从组成物中删去此工料机,并重算单价
|
|
//寻找所有引用了此组成物的工料机,并从组成物中删去此工料机,并重算单价
|
|
if(isNaN(parseFloat(rObj.basePrice))){
|
|
if(isNaN(parseFloat(rObj.basePrice))){
|
|
@@ -535,9 +557,9 @@ let repositoryGljObj = {
|
|
me.addGljObj = null;
|
|
me.addGljObj = null;
|
|
rObj.component = [];
|
|
rObj.component = [];
|
|
//如果类型为混凝土、砂浆、配合比、机械台班时,添加时填写的单价清空
|
|
//如果类型为混凝土、砂浆、配合比、机械台班时,添加时填写的单价清空
|
|
- if(me.allowComponent.indexOf(rObj.gljType) !== -1){
|
|
|
|
|
|
+ /*if(me.allowComponent.indexOf(rObj.gljType) !== -1){
|
|
rObj.basePrice = 0;
|
|
rObj.basePrice = 0;
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
rObj.basePrice = !isNaN(parseFloat(rObj.basePrice)) && (rObj.basePrice && typeof rObj.basePrice !== 'undefined') ? scMathUtil.roundTo(parseFloat(rObj.basePrice), -2) : 0;
|
|
rObj.basePrice = !isNaN(parseFloat(rObj.basePrice)) && (rObj.basePrice && typeof rObj.basePrice !== 'undefined') ? scMathUtil.roundTo(parseFloat(rObj.basePrice), -2) : 0;
|
|
addArr.push(rObj);
|
|
addArr.push(rObj);
|
|
}
|
|
}
|
|
@@ -586,52 +608,47 @@ let repositoryGljObj = {
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
let maxCol = sels[i].col + sels[i].colCount - 1;
|
|
let maxCol = sels[i].col + sels[i].colCount - 1;
|
|
- if(sels[i].col >= 2 && maxCol <= 4){
|
|
|
|
- for(let j = 0; j < sels[i].rowCount; j++){
|
|
|
|
- if(sels[i].row + j < cacheSection.length){
|
|
|
|
- let updateObj = cacheSection[sels[i].row + j];
|
|
|
|
- for(let col = sels[i].col; col <= maxCol; col++){
|
|
|
|
- if(me.setting.header[col].dataCode === 'basePrice'){
|
|
|
|
- //如果类型不为混凝土、砂浆、配合比、机械,才可删除单价 basePrice = 0
|
|
|
|
- if(me.allowComponent.indexOf(updateObj.gljType) === -1){
|
|
|
|
|
|
+ let cantNullDataCode = ['code', 'name', 'gljType'];
|
|
|
|
+ for(let j = 0; j < sels[i].rowCount; j++){
|
|
|
|
+ if(sels[i].row + j < cacheSection.length){
|
|
|
|
+ let updateObj = cacheSection[sels[i].row + j];
|
|
|
|
+ for(let col = sels[i].col; col <= maxCol; col++){
|
|
|
|
+ let dataCode = me.setting.header[col].dataCode;
|
|
|
|
+ if(cantNullDataCode.includes(dataCode)){
|
|
|
|
+ $('#alertText').text(me.setting.header[col].headerName + "不可为空!");
|
|
|
|
+ $('#codeAlert').modal('show');
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ if(dataCode === 'basePrice'){
|
|
|
|
+ //如果类型不为混凝土、砂浆、配合比、机械、主材且无组成物,才可删除单价 basePrice = 0
|
|
|
|
+ if(me.allowComponent.indexOf(updateObj.gljType) === -1 ||
|
|
|
|
+ (me.allowComponent.indexOf(updateObj.gljType) !== -1 && updateObj.component.length === 0)){
|
|
canUpdate = true;
|
|
canUpdate = true;
|
|
- updateObj[me.setting.header[col].dataCode] = 0;
|
|
|
|
|
|
+ updateObj[dataCode] = 0;
|
|
updateBasePrcArr.push({gljId: updateObj.ID, gljType: updateObj.gljType, basePrice: 0});
|
|
updateBasePrcArr.push({gljId: updateObj.ID, gljType: updateObj.gljType, basePrice: 0});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
|
|
+ if(dataCode === 'materialType'){
|
|
|
|
+ updateObj['materialCoe'] = null;
|
|
|
|
+ }
|
|
canUpdate = true;
|
|
canUpdate = true;
|
|
- updateObj[me.setting.header[col].dataCode] = '';
|
|
|
|
|
|
+ updateObj[dataCode] = '';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if(canUpdate){
|
|
|
|
- updateArr.push(updateObj);
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
- }
|
|
|
|
- }
|
|
|
|
- //编号、名称、类型不可为空
|
|
|
|
- else{
|
|
|
|
- if(sels[i].row < cacheSection.length){
|
|
|
|
- let text = '', cantNullStr =['编码', '名称', '类型'];
|
|
|
|
- for(let col = sels[i].col; col <= sels[i].col + sels[i].colCount -1; col++){
|
|
|
|
- if(cantNullStr.indexOf(me.setting.header[col].headerName) !== -1){
|
|
|
|
- text += me.setting.header[col].headerName + " ";
|
|
|
|
- }
|
|
|
|
|
|
+ if(canUpdate){
|
|
|
|
+ updateArr.push(updateObj);
|
|
}
|
|
}
|
|
- $('#alertText').text(text + "不可为空!");
|
|
|
|
- $('#codeAlertBtn').click();
|
|
|
|
- $('#codAleConfBtn').click(function () {
|
|
|
|
- });
|
|
|
|
- $('#codAleClose').click(function () {
|
|
|
|
- });
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if(removeArr.length > 0 || updateArr.length > 0){
|
|
if(removeArr.length > 0 || updateArr.length > 0){
|
|
//删除警告
|
|
//删除警告
|
|
- $('#alertGljTxt').text('可能已有定额引用了当前工料机,导致定额查找不到此工料机。确定要删除吗?');
|
|
|
|
|
|
+ let upAlertText = removeArr.length > 0 ? '可能已有定额引用了当前工料机,导致定额查找不到此工料机。确定要删除吗?' : '确认删除选中字段?';
|
|
|
|
+ $('#alertGljTxt').text(upAlertText);
|
|
$('#gljAlertBtn').click();
|
|
$('#gljAlertBtn').click();
|
|
//确认
|
|
//确认
|
|
$('#aleConfBtn').click(function () {
|
|
$('#aleConfBtn').click(function () {
|
|
@@ -654,7 +671,8 @@ let repositoryGljObj = {
|
|
that = gljComponentOprObj,
|
|
that = gljComponentOprObj,
|
|
tempObj = me.currentCache[rowIdx],
|
|
tempObj = me.currentCache[rowIdx],
|
|
reCalBasePrc = false,
|
|
reCalBasePrc = false,
|
|
- isValid = true;
|
|
|
|
|
|
+ isValid = true,
|
|
|
|
+ materialTypeValid = true;
|
|
//备份原始数据
|
|
//备份原始数据
|
|
for(let atr in tempObj){
|
|
for(let atr in tempObj){
|
|
backUpObj[atr] = tempObj[atr];
|
|
backUpObj[atr] = tempObj[atr];
|
|
@@ -689,13 +707,14 @@ let repositoryGljObj = {
|
|
let isExsit = false;
|
|
let isExsit = false;
|
|
for(let i = 0; i < me.distTypeTree.comboDatas.length; i++){
|
|
for(let i = 0; i < me.distTypeTree.comboDatas.length; i++){
|
|
if(pasteObj.gljType === me.distTypeTree.comboDatas[i].text){
|
|
if(pasteObj.gljType === me.distTypeTree.comboDatas[i].text){
|
|
|
|
+ pasteObj.gljType = me.distTypeTree.comboDatas[i].value;
|
|
isExsit = true;
|
|
isExsit = true;
|
|
reCalBasePrc = true;
|
|
reCalBasePrc = true;
|
|
//调整系数
|
|
//调整系数
|
|
- if(me.distTypeTree.comboDatas[i].value !== 1 && me.distTypeTree.comboDatas[i].value !== 303){
|
|
|
|
|
|
+ if(pasteObj.gljType !== 1 && pasteObj.gljType !== 303){
|
|
tempObj.adjCoe = null;
|
|
tempObj.adjCoe = null;
|
|
}
|
|
}
|
|
- else if((me.distTypeTree.comboDatas[i].value === 1 || me.distTypeTree.comboDatas[i].value === 303) && typeof pasteObj.adjCoe !== 'undefined' && !isNaN(pasteObj.adjCoe) && pasteObj.adjCoe % 1 === 0) {
|
|
|
|
|
|
+ else if((pasteObj.gljType === 1 || pasteObj.gljType === 303) && typeof pasteObj.adjCoe !== 'undefined' && !isNaN(pasteObj.adjCoe) && pasteObj.adjCoe % 1 === 0) {
|
|
tempObj.adjCoe = pasteObj.adjCoe;
|
|
tempObj.adjCoe = pasteObj.adjCoe;
|
|
}
|
|
}
|
|
if(me.componentGljType.indexOf(tempObj.gljType) !== -1 &&
|
|
if(me.componentGljType.indexOf(tempObj.gljType) !== -1 &&
|
|
@@ -711,11 +730,11 @@ let repositoryGljObj = {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- tempObj.component = tempObj.gljType === me.distTypeTree.comboDatas[i].value ? tempObj.component : [];
|
|
|
|
- if(me.allowComponent.indexOf(tempObj.gljType) !== -1){
|
|
|
|
|
|
+ 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.basePrice = tempObj.gljType === me.distTypeTree.comboDatas[i].value ? tempObj.basePrice : 0;
|
|
- }
|
|
|
|
- tempObj.gljType = me.distTypeTree.comboDatas[i].value;
|
|
|
|
|
|
+ }*/
|
|
|
|
+ tempObj.gljType = pasteObj.gljType;
|
|
tempObj.shortName = me.distTypeTree.distTypes[me.distTypeTree.prefix + tempObj.gljType].data.shortName;
|
|
tempObj.shortName = me.distTypeTree.distTypes[me.distTypeTree.prefix + tempObj.gljType].data.shortName;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -749,6 +768,30 @@ 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(isValid){
|
|
if(isValid){
|
|
rst.updateGlj.push(tempObj);
|
|
rst.updateGlj.push(tempObj);
|
|
if(reCalBasePrc){
|
|
if(reCalBasePrc){
|
|
@@ -798,6 +841,23 @@ let repositoryGljObj = {
|
|
return false;
|
|
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;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
pasteObj.basePrice = !isNaN(parseFloat(pasteObj.basePrice)) && (pasteObj.basePrice && typeof pasteObj.basePrice !== 'undefined') ? parseFloat(pasteObj.basePrice) : 0;
|
|
pasteObj.basePrice = !isNaN(parseFloat(pasteObj.basePrice)) && (pasteObj.basePrice && typeof pasteObj.basePrice !== 'undefined') ? parseFloat(pasteObj.basePrice) : 0;
|
|
if(!me.parentNodeIds["_pNodeId_" + me.gljCurTypeId]){
|
|
if(!me.parentNodeIds["_pNodeId_" + me.gljCurTypeId]){
|
|
pasteObj.gljClass = me.gljCurTypeId;
|
|
pasteObj.gljClass = me.gljCurTypeId;
|
|
@@ -836,6 +896,10 @@ let repositoryGljObj = {
|
|
onClipboardPasting: function(sender, args) {
|
|
onClipboardPasting: function(sender, args) {
|
|
let me = repositoryGljObj;
|
|
let me = repositoryGljObj;
|
|
//复制的列数超过正确的列数,不可复制
|
|
//复制的列数超过正确的列数,不可复制
|
|
|
|
+ if(me.prevent){
|
|
|
|
+ args.cancel = true;
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
if(!me.canPasted(args)){
|
|
if(!me.canPasted(args)){
|
|
args.cancel = true;
|
|
args.cancel = true;
|
|
}
|
|
}
|
|
@@ -860,9 +924,6 @@ let repositoryGljObj = {
|
|
updateBasePrcArr = updateBasePrcArr.concat(updateObj.updateBasePrcArr);
|
|
updateBasePrcArr = updateBasePrcArr.concat(updateObj.updateBasePrcArr);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- else{
|
|
|
|
- resumeArr.push(info.cellRange.row + i);
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if(beginRow <= maxRow && endRow > maxRow){
|
|
else if(beginRow <= maxRow && endRow > maxRow){
|
|
@@ -875,66 +936,54 @@ let repositoryGljObj = {
|
|
updateBasePrcArr = updateBasePrcArr.concat(updateObj.updateBasePrcArr);
|
|
updateBasePrcArr = updateBasePrcArr.concat(updateObj.updateBasePrcArr);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- else{
|
|
|
|
- resumeArr.push(info.cellRange.row + i);
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
//if(info.cellRange.colCount === me.setting.header.length){
|
|
//if(info.cellRange.colCount === me.setting.header.length){
|
|
- if(info.cellRange.colCount >= me.setting.header.length - 1 && info.cellRange.colCount <= me.setting.header.length){
|
|
|
|
|
|
+ if(info.cellRange.colCount >= me.setting.header.length - 3 && info.cellRange.colCount <= me.setting.header.length){
|
|
for(let i = updateCount ; i < items.length; i++){
|
|
for(let i = updateCount ; i < items.length; i++){
|
|
if(me.isValidObj(items[i])){
|
|
if(me.isValidObj(items[i])){
|
|
items[i].component = [];
|
|
items[i].component = [];
|
|
//类型为混凝土、砂浆、配合比、机械时,基价只能组成物计算
|
|
//类型为混凝土、砂浆、配合比、机械时,基价只能组成物计算
|
|
- if(me.allowComponent.indexOf(items[i].gljType) !== -1){
|
|
|
|
|
|
+ /* if(me.allowComponent.indexOf(items[i].gljType) !== -1){
|
|
items[i].basePrice = 0;
|
|
items[i].basePrice = 0;
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
addArr.push(items[i]);
|
|
addArr.push(items[i]);
|
|
}
|
|
}
|
|
- else{
|
|
|
|
- resumeArr.push(info.cellRange.row + i);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else{
|
|
|
|
- for(let i = updateCount ; i < items.length; i++){
|
|
|
|
- resumeArr.push(info.cellRange.row + i);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
//if(info.cellRange.colCount === me.setting.header.length && info.cellRange.col + info.cellRange.colCount - 1 >= 5){
|
|
//if(info.cellRange.colCount === me.setting.header.length && info.cellRange.col + info.cellRange.colCount - 1 >= 5){
|
|
- if(info.cellRange.colCount >= me.setting.header.length - 1 && info.cellRange.colCount <= me.setting.header.length && info.cellRange.col + info.cellRange.colCount - 1 >= 5){
|
|
|
|
|
|
+ if(info.cellRange.colCount >= me.setting.header.length - 3 && info.cellRange.colCount <= me.setting.header.length && info.cellRange.col + info.cellRange.colCount - 1 >= 5){
|
|
for(let i = 0; i < items.length; i++){
|
|
for(let i = 0; i < items.length; i++){
|
|
if(me.isValidObj(items[i])){
|
|
if(me.isValidObj(items[i])){
|
|
items[i].component = [];
|
|
items[i].component = [];
|
|
- if(me.allowComponent.indexOf(items[i].gljType) !== -1){
|
|
|
|
|
|
+ /* if(me.allowComponent.indexOf(items[i].gljType) !== -1){
|
|
items[i].basePrice = 0;
|
|
items[i].basePrice = 0;
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
addArr.push(items[i]);
|
|
addArr.push(items[i]);
|
|
}
|
|
}
|
|
- else{
|
|
|
|
- resumeArr.push(info.cellRange.row + i);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else{
|
|
|
|
- for(let i = 0; i < items.length; i++){
|
|
|
|
- resumeArr.push(info.cellRange.row + i);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//repaint
|
|
//repaint
|
|
|
|
+ for(let i = 0; i < info.cellRange.rowCount; i++){
|
|
|
|
+ resumeArr.push(info.cellRange.row + i);
|
|
|
|
+ }
|
|
if(resumeArr.length > 0){
|
|
if(resumeArr.length > 0){
|
|
info.sheet.suspendPaint();
|
|
info.sheet.suspendPaint();
|
|
for(let i = 0; i < resumeArr.length ; i++){
|
|
for(let i = 0; i < resumeArr.length ; i++){
|
|
if(resumeArr[i] < me.currentCache.length){
|
|
if(resumeArr[i] < me.currentCache.length){
|
|
for(let col = 0; col < me.setting.header.length; col++){
|
|
for(let col = 0; col < me.setting.header.length; col++){
|
|
- if(me.setting.header[col].dataCode === 'gljType'){
|
|
|
|
- let gljType = me.currentCache[resumeArr[i]][me.setting.header[col].dataCode];
|
|
|
|
|
|
+ let dCode = me.setting.header[col].dataCode;
|
|
|
|
+ if(dCode === 'gljType'){
|
|
|
|
+ let gljType = me.currentCache[resumeArr[i]][dCode];
|
|
info.sheet.setValue(resumeArr[i], col, me.distTypeTree.distTypes["gljType" + gljType].data.fullName);
|
|
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{
|
|
else{
|
|
- info.sheet.setValue(resumeArr[i], col, me.currentCache[resumeArr[i]][me.setting.header[col].dataCode]);
|
|
|
|
|
|
+ info.sheet.setValue(resumeArr[i], col, me.currentCache[resumeArr[i]][dCode]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -957,6 +1006,7 @@ let repositoryGljObj = {
|
|
let me = this;
|
|
let me = this;
|
|
me.prevent = true;
|
|
me.prevent = true;
|
|
$.bootstrapLoading.start();
|
|
$.bootstrapLoading.start();
|
|
|
|
+ //me.workBook.focus(false);
|
|
$.ajax({
|
|
$.ajax({
|
|
type: 'post',
|
|
type: 'post',
|
|
url: 'api/updateRationBasePrc',
|
|
url: 'api/updateRationBasePrc',
|
|
@@ -968,6 +1018,7 @@ let repositoryGljObj = {
|
|
}
|
|
}
|
|
$.bootstrapLoading.end();
|
|
$.bootstrapLoading.end();
|
|
me.prevent = false;
|
|
me.prevent = false;
|
|
|
|
+ //me.workBook.focus(true);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|