|
@@ -158,7 +158,7 @@ var Ration = {
|
|
newRation = data.updateData;
|
|
newRation = data.updateData;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- this.project.pushNow('insertRation', [this.getSourceType()], [updateData]);
|
|
|
|
|
|
+ this.project.pushNow('insertRation', [this.getSourceType(), this.project.projCounter()], [updateData, this.getCounterData()]);
|
|
|
|
|
|
newRation.ID = this.getNewRationID();
|
|
newRation.ID = this.getNewRationID();
|
|
if (preRation) {
|
|
if (preRation) {
|
|
@@ -178,16 +178,41 @@ var Ration = {
|
|
updateData.push({'updateType': 'ut_delete', 'updateData': {'ID': rationData.ID, 'projectID': this.project.ID()}});
|
|
updateData.push({'updateType': 'ut_delete', 'updateData': {'ID': rationData.ID, 'projectID': this.project.ID()}});
|
|
return updateData;
|
|
return updateData;
|
|
};
|
|
};
|
|
- ration.prototype.getDeleteDataByBill = function (node) {
|
|
|
|
- console.log(node);
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
ration.prototype.delete = function (ration) {
|
|
ration.prototype.delete = function (ration) {
|
|
var ration_glj =projectObj.project.ration_glj;
|
|
var ration_glj =projectObj.project.ration_glj;
|
|
this.project.pushNow('deleteRation', [this.getSourceType(),ration_glj.getSourceType()], [this.getDeleteData(ration),ration_glj.getDeleteDataByRation(ration)]);
|
|
this.project.pushNow('deleteRation', [this.getSourceType(),ration_glj.getSourceType()], [this.getDeleteData(ration),ration_glj.getDeleteDataByRation(ration)]);
|
|
|
|
|
|
|
|
+ project.ration_glj.deleteByRation(ration);
|
|
|
|
+ project.ration_coe.deleteByRation(ration);
|
|
|
|
+ project.quantity_detail.deleteByRation(ration);
|
|
this.datas.splice(this.datas.indexOf(ration), 1);
|
|
this.datas.splice(this.datas.indexOf(ration), 1);
|
|
};
|
|
};
|
|
|
|
+ ration.prototype.getDeleteDataByBill = function (nodes) {
|
|
|
|
+ let updateData = [];
|
|
|
|
+ for (let node of nodes) {
|
|
|
|
+ if (node.children.length > 0) {
|
|
|
|
+ updateData = updateData.concat(this.getDeleteDataByBills[node.children]);
|
|
|
|
+ } else {
|
|
|
|
+ let rations = this.getBillsSortRation(node.getID());
|
|
|
|
+ for (let r of rations) {
|
|
|
|
+ updateData.push({'updateType': 'ut_delete', 'updateData': {'ID': r.ID, 'projectID': this.project.ID()}});
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return updateData;
|
|
|
|
+ };
|
|
|
|
+ ration.prototype.deleteByBills = function (nodes) {
|
|
|
|
+ for (let node of nodes) {
|
|
|
|
+ if (node.children.length > 0) {
|
|
|
|
+ this.deleteByBills([node.children]);
|
|
|
|
+ } else {
|
|
|
|
+ let rations = this.getBillsSortRation(node.getID());
|
|
|
|
+ for (let r of rations) {
|
|
|
|
+ this.datas.splice(this.datas.indexOf(r), 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
ration.prototype.getChangePosUpdateData = function (ration1, ration2) {
|
|
ration.prototype.getChangePosUpdateData = function (ration1, ration2) {
|
|
var updateData = [];
|
|
var updateData = [];
|