|
@@ -70,7 +70,7 @@ let rationOprObj = {
|
|
|
sheet.suspendEvent();
|
|
|
if(combo){
|
|
|
combo = sheetCommonObj.getDynamicCombo();
|
|
|
- combo.items(rationUnits).itemHeight(10).editable(true);
|
|
|
+ combo.items(rationAndGljUnits).itemHeight(10).editable(true);
|
|
|
}
|
|
|
sheet.getRange(-1, me.setting.view.comboBox[0].col, -1, 1).cellType(combo);
|
|
|
sheet.resumePaint();
|
|
@@ -173,7 +173,7 @@ let rationOprObj = {
|
|
|
for(let i = 0; i < sels[sel].rowCount; i++){
|
|
|
if(sels[sel].row + i < cacheSection.length){
|
|
|
removeArr.push(cacheSection[sels[sel].row + i].ID);
|
|
|
- me.rationsCodes.splice(me.rationsCodes.indexOf(cacheSection[sels[sel].row + i].code), 1);
|
|
|
+ me.rationsCodes.splice(me.rationsCodes.indexOf(cacheSection[sels[sel].row + i].code.toString()), 1);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -259,6 +259,7 @@ let rationOprObj = {
|
|
|
onCellEditStart: function(sender, args) {
|
|
|
let me = rationOprObj;
|
|
|
if(!me.canRations || me.setting.view.lockColumns.indexOf(args.col) !== -1){
|
|
|
+ console.log('enter');
|
|
|
args.cancel = true;
|
|
|
}
|
|
|
else{
|
|
@@ -289,9 +290,9 @@ let rationOprObj = {
|
|
|
if(me.currentEditingRation[dataCode] !== rObj[dataCode]){
|
|
|
me.addRationItem = rObj;
|
|
|
if(dataCode === 'code'){
|
|
|
- if(me.rationsCodes.indexOf(rObj.code) === -1){
|
|
|
- me.rationsCodes.splice(me.rationsCodes.indexOf(rObj.code), 1);
|
|
|
- me.rationsCodes.push(rObj.code);
|
|
|
+ if(me.rationsCodes.indexOf(rObj.code.toString()) === -1){
|
|
|
+ me.rationsCodes.splice(me.rationsCodes.indexOf(rObj.code.toString()), 1);
|
|
|
+ me.rationsCodes.push(rObj.code.toString());
|
|
|
updateArr.push(rObj);
|
|
|
}
|
|
|
else{
|
|
@@ -320,7 +321,7 @@ let rationOprObj = {
|
|
|
//addArr.push(rObj);
|
|
|
me.addRationItem = rObj;
|
|
|
if(rObj.code && rObj.code.toString().trim().length > 0){
|
|
|
- if(me.rationsCodes.indexOf(rObj.code) === -1){
|
|
|
+ if(me.rationsCodes.indexOf(rObj.code.toString()) === -1){
|
|
|
//jobContent
|
|
|
if(jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL){
|
|
|
rObj.jobContent = jobContentOprObj.currentJobContent ? jobContentOprObj.currentJobContent : '';
|
|
@@ -330,7 +331,7 @@ let rationOprObj = {
|
|
|
}
|
|
|
me.setInitPrc(rObj);
|
|
|
addArr.push(rObj);
|
|
|
- me.rationsCodes.push(rObj.code);
|
|
|
+ me.rationsCodes.push(rObj.code.toString());
|
|
|
me.addRationItem = null;
|
|
|
}
|
|
|
else{
|
|
@@ -372,11 +373,11 @@ let rationOprObj = {
|
|
|
for (let i = 0; i < items.length; i++) {
|
|
|
let rowIdx = info.cellRange.row + i;
|
|
|
if (cacheSection) {
|
|
|
- if(!me.isValidUnit(items[i], rationUnits)){//无效单位
|
|
|
+ /* if(!me.isValidUnit(items[i], rationUnits)){//无效单位
|
|
|
items[i].unit = rowIdx < cacheSection.length && typeof cacheSection[rowIdx].unit !== 'undefined' ? cacheSection[rowIdx].unit : '';
|
|
|
- }
|
|
|
+ }*/
|
|
|
if(!cacheSection[rowIdx] && info.cellRange.col === 0 ){
|
|
|
- if(me.rationsCodes.indexOf(items[i].code) === -1){
|
|
|
+ if(me.rationsCodes.indexOf(items[i].code.toString()) === -1){
|
|
|
//jobConten
|
|
|
if(jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL){
|
|
|
items[i].jobContent = jobContentOprObj.currentJobContent ? jobContentOprObj.currentJobContent : '';
|
|
@@ -386,7 +387,7 @@ let rationOprObj = {
|
|
|
}
|
|
|
me.setInitPrc(items[i]);
|
|
|
addArr.push(items[i]);
|
|
|
- me.rationsCodes.push(items[i].code);
|
|
|
+ me.rationsCodes.push(items[i].code.toString());
|
|
|
}
|
|
|
else{
|
|
|
me.workBook.getSheet(0).setValue(rowIdx, 0, '');
|
|
@@ -403,7 +404,7 @@ let rationOprObj = {
|
|
|
me.workBook.getSheet(0).setValue(rowIdx, 8, '');
|
|
|
}
|
|
|
if(info.cellRange.col === 0){
|
|
|
- if(me.rationsCodes.indexOf(items[i].code) === -1){
|
|
|
+ if(me.rationsCodes.indexOf(items[i].code.toString()) === -1){
|
|
|
items[i].ID = cacheSection[rowIdx].ID;
|
|
|
updateArr.push(items[i]);
|
|
|
}
|
|
@@ -418,13 +419,13 @@ let rationOprObj = {
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
- if(!me.isValidUnit(items[i], rationUnits)){//无效单位
|
|
|
+ /* if(!me.isValidUnit(items[i], rationUnits)){//无效单位
|
|
|
items[i].unit = '';
|
|
|
- }
|
|
|
+ }*/
|
|
|
//add
|
|
|
if(info.cellRange.col === 0){
|
|
|
//是否含有已存在的编号
|
|
|
- if(me.rationsCodes.indexOf(items[i].code) === -1){
|
|
|
+ if(me.rationsCodes.indexOf(items[i].code.toString()) === -1){
|
|
|
//jobConten
|
|
|
if(jobContentOprObj && jobContentOprObj.currentSituation === jobContentOprObj.situations.ALL){
|
|
|
items[i].jobContent = jobContentOprObj.currentJobContent ? jobContentOprObj.currentJobContent : '';
|