|
@@ -40,13 +40,21 @@ var ration_glj = {
|
|
|
this.datas = datas;
|
|
|
};
|
|
|
|
|
|
- ration_glj.prototype.getGljArrByRation = function (rationID) {
|
|
|
- let result = this.datas.filter(function (data) {
|
|
|
- return data.rationID === rationID;
|
|
|
- })
|
|
|
- result = gljOprObj.combineWithProjectGlj(result);
|
|
|
- return result;
|
|
|
+ ration_glj.prototype.getGljArrByRation = function (ration) {
|
|
|
+ if (ration.type == rationType.gljRation){
|
|
|
+ let glj = JSON.parse(JSON.stringify(ration));
|
|
|
+ glj.type = glj.subType;
|
|
|
+ return [glj];
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ let result = this.datas.filter(function (data) {
|
|
|
+ return data.rationID === ration.ID;
|
|
|
+ })
|
|
|
+ result = gljOprObj.combineWithProjectGlj(result);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
};
|
|
|
+
|
|
|
ration_glj.prototype.getGatherGljArrByRations = function (rations, billQuantity) {
|
|
|
let result = [];
|
|
|
let clone = function (obj) {
|
|
@@ -71,7 +79,7 @@ var ration_glj = {
|
|
|
result.push(ration);
|
|
|
}
|
|
|
else{
|
|
|
- let rationGljs = this.getGljArrByRation(ration.ID);
|
|
|
+ let rationGljs = this.getGljArrByRation(ration);
|
|
|
for (let glj of rationGljs) {
|
|
|
let sameGlj = findGlj(glj, result);
|
|
|
if (!sameGlj) {
|