|
@@ -158,6 +158,38 @@
|
|
|
all({success: false});
|
|
|
return;
|
|
|
}
|
|
|
+ let allInvoiceAmount = 0;
|
|
|
+ for (let key of Object.keys(postData)) {
|
|
|
+ let mealName = postData[key];
|
|
|
+ if (key.startsWith("Contract")) {
|
|
|
+ allInvoiceAmount += Number(mealName.invoiceAmount);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(Number(postData.contractInvoice.invoiceAmount) != Number(allInvoiceAmount)){
|
|
|
+ all({success: false, errorMsg: "开票金额与所有项目开票金额之和不相等!"});
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ for (let key of Object.keys(postData)) {
|
|
|
+ let mealName = postData[key];
|
|
|
+ if (key.startsWith("Contract")) {
|
|
|
+ z.ui.ajax({
|
|
|
+ url: z.ui.comm.getEntranceUrl("/contract-invoice-relation"),
|
|
|
+ type: 'put',
|
|
|
+ contentType: 'application/json',
|
|
|
+ data: JSON.stringify({
|
|
|
+ 'id': mealName.id,
|
|
|
+ 'returnAmount': mealName.returnAmount,
|
|
|
+ 'invoiceAmount': mealName.invoiceAmount
|
|
|
+ }),
|
|
|
+ success: function (res) {
|
|
|
+
|
|
|
+ },
|
|
|
+ error: function () {
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
z.ui.ajax({
|
|
|
url: z.ui.comm.getEntranceUrl("/flow/invoice/update"),
|
|
|
data: z.ui.form.childStringify(postData),
|