|
@@ -133,6 +133,7 @@ var Ration = {
|
|
|
});
|
|
|
this.project.pushNow('insertRation', [this.getSourceType()], [updateData]);
|
|
|
|
|
|
+ newRation.ID = this.getNewRationID();
|
|
|
if (preRation) {
|
|
|
var preIndex = br.indexOf(preRation), i;
|
|
|
this.datas.push(newRation);
|
|
@@ -145,6 +146,21 @@ var Ration = {
|
|
|
return newRation;
|
|
|
};
|
|
|
|
|
|
+ ration.prototype.getChangePosUpdateData = function (ration1, ration2) {
|
|
|
+ var updateData = [];
|
|
|
+ updateData.push({updateType: 'ut_update', updateData: this.getTempRationData(ration1.ID, ration1.billsItemID, ration2.serialNo)});
|
|
|
+ updateData.push({updateType: 'ut_update', updateData: this.getTempRationData(ration2.ID, ration2.billsItemID, ration1.serialNo)});
|
|
|
+ return updateData;
|
|
|
+ };
|
|
|
+ ration.prototype.changePos = function (ration1, ration2) {
|
|
|
+ var updateData = this.getChangePosUpdateData(ration1, ration2);
|
|
|
+ this.project.pushNow('insertRation', [this.getSourceType()], [updateData]);
|
|
|
+
|
|
|
+ var preSerialNo = ration1.serialNo;
|
|
|
+ ration1.serialNo = ration2.serialNo;
|
|
|
+ ration2.serialNo = preSerialNo;
|
|
|
+ }
|
|
|
+
|
|
|
return new ration(project);
|
|
|
}
|
|
|
};
|