|
@@ -374,6 +374,9 @@ var rationOprObj = {
|
|
let failPasteArr = [];
|
|
let failPasteArr = [];
|
|
for (var i = 0, rowIdx =info.cellRange.row; i < items.length; i++, rowIdx++) {
|
|
for (var i = 0, rowIdx =info.cellRange.row; i < items.length; i++, rowIdx++) {
|
|
if (cacheSection) {
|
|
if (cacheSection) {
|
|
|
|
+ if(!me.isValidUnit(items[i], rationUnits)){//无效单位
|
|
|
|
+ items[i].unit = typeof cacheSection[rowIdx].unit !== 'undefined' && !cacheSection[rowIdx] ? cacheSection[rowIdx].unit : '';
|
|
|
|
+ };
|
|
//var hasCacheItem = false;
|
|
//var hasCacheItem = false;
|
|
if(!cacheSection[rowIdx] && info.cellRange.col === 0 ){
|
|
if(!cacheSection[rowIdx] && info.cellRange.col === 0 ){
|
|
if(me.rationsCodes.indexOf(items[i].code) === -1){
|
|
if(me.rationsCodes.indexOf(items[i].code) === -1){
|
|
@@ -407,6 +410,9 @@ var rationOprObj = {
|
|
}
|
|
}
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
|
+ if(!me.isValidUnit(items[i], rationUnits)){//无效单位
|
|
|
|
+ items[i].unit = '';
|
|
|
|
+ };
|
|
//add
|
|
//add
|
|
if(info.cellRange.col === 0){
|
|
if(info.cellRange.col === 0){
|
|
//是否含有已存在的编号
|
|
//是否含有已存在的编号
|
|
@@ -427,6 +433,13 @@ var rationOprObj = {
|
|
me.mixUpdateRequest(updateArr, addArr, []);
|
|
me.mixUpdateRequest(updateArr, addArr, []);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ isValidUnit: function (rationObj, validUnits) {
|
|
|
|
+ let rst = true;
|
|
|
|
+ if(typeof rationObj.unit !== 'undefined' && rationObj.unit && validUnits.indexOf(rationObj.unit) === -1){//无效
|
|
|
|
+ rst = false;
|
|
|
|
+ }
|
|
|
|
+ return rst;
|
|
|
|
+ },
|
|
getRationsCodes: function (repId) {
|
|
getRationsCodes: function (repId) {
|
|
let me = rationOprObj;
|
|
let me = rationOprObj;
|
|
$.ajax({
|
|
$.ajax({
|