Просмотр исходного кода

代采订单相关问题的处理,方法优化整理

hejq 7 лет назад
Родитель
Сommit
7601a810d8

+ 0 - 2
src/main/java/com/uas/platform/b2b/controller/DeputyOrderController.java

@@ -125,7 +125,6 @@ public class DeputyOrderController {
 	 */
 	@RequestMapping(value = "/edit/saveDeOrder", method = RequestMethod.POST)
 	public ModelMap saveDeOrder(@RequestBody DeputyOrder deorder) {
-		deorder.setEntrystatus("保存");
 		return deputyOrderService.saveDeOrder(deorder);
 	}
 
@@ -137,7 +136,6 @@ public class DeputyOrderController {
 	 */
 	@RequestMapping(value = "/submit/saveDeOrder", method = RequestMethod.POST)
 	public ModelMap submitDeOrder(@RequestBody DeputyOrder deorder) {
-		deorder.setEntrystatus("已提交");
 		return deputyOrderService.saveDeOrder(deorder);
 	}
 

+ 8 - 79
src/main/webapp/resources/js/index/app.js

@@ -17216,11 +17216,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                         toaster.pop('info', '提示', '订单明细第' + (index + 1) + '行订单单价未填写');
                     } else {
                         $scope.checkresult = true;
-                        if ($scope.deOrder.entrystatus == '保存') {
-                            $scope.isSave = true;
-                        } else if ($scope.deOrder.entrystatus == '已提交') {
-                            $scope.isSubmit = true;
-                        }
+                        $scope.isSave = true;
                     }
                 })
             };
@@ -17228,42 +17224,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
         // 保存
         $scope.isSave = false;
-        $scope.save = function () {
-            $scope.deOrder.entrystatus = '保存';
-            checkKeyword();
-            if ($scope.checkresult) {
-                $scope.deOrder.totalamount = 0;
-                $scope.deOrder.usdpayment = 0;
-                $scope.deOrder.orderamount = 0;
-                $scope.deOrder.totalpayament = 0;
-                angular.forEach($scope.deOrder.deputyOrderItems, function (item) {
-                    $scope.deOrder.totalamount += DecimalNumber.accMul(item.amount, item.unitprice);
-                    $scope.deOrder.usdpayment += DecimalNumber.accMul(item.amount, item.unitprice);
-                    $scope.deOrder.totalpayament += DecimalNumber.accMul(item.amount, item.unitprice);
-                    $scope.deOrder.orderamount += DecimalNumber.accMul(item.amount, item.purcprice);
-                });
-                if ($scope.deOrder.deputyOrderItems[0].prodcode == null) {
-                    toaster.pop('info', '提示', '您还未填写任何商品信息');
-                } else {
-                    DeputyOrder.saveDeOrder({}, $scope.deOrder, function (data) {
-                        if (data.id) {
-                            toaster.pop('success', '提示', '保存成功');
-                            window.location.hash = "#/purc/deputy/" + data.id;
-                        }
-                        if (data.error) {
-                            toaster.pop('error', '提示', '保存失败');
-                        }
-                    }, function (response) {
-
-                    });
-                }
-            }
-        }
-
-        // 提交
-        $scope.isSubmit = false;
-        $scope.submit = function () {
-            $scope.deOrder.entrystatus = '已提交';
+        $scope.save = function (status) {
+            $scope.deOrder.entrystatus = status;
             checkKeyword();
             if ($scope.checkresult) {
                 $scope.deOrder.totalamount = 0;
@@ -17281,11 +17243,11 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 } else {
                     DeputyOrder.saveDeOrder({}, $scope.deOrder, function (data) {
                         if (data.id) {
-                            toaster.pop('success', '提示', '提交成功');
+                            toaster.pop('success', '提示', status + '成功');
                             window.location.hash = "#/purc/deputy/" + data.id;
                         }
                         if (data.error) {
-                            toaster.pop('error', '提示', '保存失败');
+                            toaster.pop('error', '提示', status + '失败');
                         }
                     }, function (response) {
 
@@ -17716,11 +17678,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                         toaster.pop('info', '提示', '订单明细第' + (index + 1) + '行订单单价未填写');
                     } else {
                         $scope.checkresult = true;
-                        if ($scope.deOrder.entrystatus == '保存') {
-                            $scope.isSave = true;
-                        } else if ($scope.deOrder.entrystatus == '已提交') {
-                            $scope.isSubmit = true;
-                        }
+                        $scope.isSave = true;
                     }
                 });
             }
@@ -17728,7 +17686,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
         // 保存
         $scope.isSave = false;
-        $scope.save = function () {
+        $scope.save = function (status) {
+            $scope.deOrder.entrystatus = status;
             checkKeyword();
             if ($scope.checkresult) {
                 $scope.deOrder.totalamount = 0;
@@ -17760,36 +17719,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             }
         }
 
-        // 提交
-        $scope.isSubmit = false;
-        $scope.submit = function () {
-            checkKeyword();
-            if ($scope.checkresult) {
-                $scope.deOrder.totalamount = 0;
-                $scope.deOrder.usdpayment = 0;
-                $scope.deOrder.orderamount = 0;
-                $scope.deOrder.totalpayament = 0;
-                angular.forEach($scope.deOrder.deputyOrderItems, function (item) {
-                    $scope.deOrder.totalamount += DecimalNumber.accMul(item.amount, item.unitprice);
-                    $scope.deOrder.usdpayment += DecimalNumber.accMul(item.amount, item.unitprice);
-                    $scope.deOrder.totalpayament += DecimalNumber.accMul(item.amount, item.unitprice);
-                    $scope.deOrder.orderamount += DecimalNumber.accMul(item.amount, item.purcprice);
-                });
-                DeputyOrder.submitDeOrder({}, $scope.deOrder, function (data) {
-                    if (data.id) {
-                        toaster.pop('success', '提示', '提交成功');
-                        window.location.hash = "#/purc/deputy/" + data.id;
-                        window.location.reload();
-                    }
-                    if (data.error) {
-                        toaster.pop('error', '提示', '保存失败');
-                    }
-                }, function (response) {
-                    toaster.pop('error', '保存失败', response.data);
-                });
-            }
-        }
-
         $scope.openDatePicker = function ($event, deOrder, openParam) {
             $event.preventDefault();
             $event.stopPropagation();

+ 8 - 15
src/main/webapp/resources/tpl/index/purc/deputyOrder_detail.html

@@ -268,12 +268,12 @@
                                 <span>
                                 	<select name="" ng-model="deOrder.paymentmethod" class="select" ng-required="true">
                                         <option value="">请先选择支付方式</option>
-                                        <option value="预付20%履约保定金,尾款提货前付清。">预付20%履约保定金,尾款提货前付清。</option>
-                                        <option value="预付10%履约保定金,尾款提货前付清。">预付10%履约保定金,尾款提货前付清。</option>
-                                        <option value="预付15%履约保定金,尾款提货前付清。">预付15%履约保定金,尾款提货前付清。</option>
-                                        <option value="预付25%履约保定金,尾款提货前付清。">预付25%履约保定金,尾款提货前付清。</option>
-                                        <option value="预付30%履约保定金,尾款提货前付清。">预付30%履约保定金,尾款提货前付清。</option>
-                                        <option value="预付30%履约保定金,尾款提货前付清。">预付35%履约保定金,尾款提货前付清。</option>
+                                        <option value="预付20%履约保证金,尾款提货前付清。">预付20%履约保证金,尾款提货前付清。</option>
+                                        <option value="预付10%履约保证金,尾款提货前付清。">预付10%履约保证金,尾款提货前付清。</option>
+                                        <option value="预付15%履约保证金,尾款提货前付清。">预付15%履约保证金,尾款提货前付清。</option>
+                                        <option value="预付25%履约保证金,尾款提货前付清。">预付25%履约保证金,尾款提货前付清。</option>
+                                        <option value="预付30%履约保证金,尾款提货前付清。">预付30%履约保证金,尾款提货前付清。</option>
+                                        <option value="预付30%履约保证金,尾款提货前付清。">预付35%履约保证金,尾款提货前付清。</option>
                                         <option value="提货前TT全款。">提货前TT全款。</option>
                                     </select>
                                     <!--<select ng-if="methods.length != 0" ng-model="deOrder.paymentmethod" class="select" ng-required="true" ng-options="me.value for me in methods | orderBy:'-weight'">
@@ -347,13 +347,6 @@
                             </span>
                         </dd>
                     </dl>
-                 <!--    <div class="page fl">
-                        <ul>
-                            <li><a href="#">上一页</a> </li>
-                            <li>第<input type="text" placeholder="3">页&nbsp;共6页</li>
-                            <li><a href="#">下一页</a> </li>
-                        </ul>
-                    </div> -->
                 </div>
                 <!--采购订单-->
                 <div class="com_title01"><span>采购订单</span></div>
@@ -571,8 +564,8 @@
                     </ul>
                 </div>
                 <div class="save" >
-                	<span ng-if="deOrder.entrystatus == '保存'"><button ng-click="submit()" ng-disabled="isSubmit">提交</button></span>
-                	<span ng-if="deOrder.entrystatus == '保存'"><button ng-click="save()" ng-disabled="isSave">保存</button></span>
+                	<span ng-if="deOrder.entrystatus == '保存'"><button ng-click="save('已提交')" ng-disabled="isSave">提交</button></span>
+                	<span ng-if="deOrder.entrystatus == '保存'"><button ng-click="save('保存')" ng-disabled="isSave">保存</button></span>
                 	<span ng-if="deOrder.entrystatus == '保存'"><button ng-click="clear(deOrder.id)">删除</button></span>
                 </div>
             </div>

+ 2 - 2
src/main/webapp/resources/tpl/index/purc/deputyOrder_new.html

@@ -578,8 +578,8 @@
                     </ul>
                 </div>
                 <div class="save">
-                	<button ng-click="save()">保存</button>
-                	<button ng-click="submit()">提交</button>
+                	<button ng-click="save('保存')">保存</button>
+                	<button ng-click="save('已提交')">提交</button>
                 </div>
             </div>
         </form>