Browse Source

新增采购变更单优化

hejq 7 years ago
parent
commit
089cb6bf27

+ 32 - 3
src/main/webapp/resources/js/index/app.js

@@ -24058,6 +24058,11 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             });
         }
 
+        // 删除明细
+        $scope.del = function (index) {
+            $scope.change.orderChangeItems.splice(index, 1);
+        }
+
         $scope.getMinDate = function () {
             return $filter('date')(new Date, 'yyyy-MM-dd');
         };
@@ -24069,11 +24074,17 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         };
 
         $scope.save = function() {
-            change.save({}, $scope.change, function (data) {
+            if ($scope.change.unNeedReply == null) {
+                toaster.pop('error', '请选择是否需要供应商确认');
+            } else if ($scope.change.orderChangeItems.length == 0) {
+                toaster.pop('error', '请至少选择一条采购明细')
+            } else {
+                change.save({}, $scope.change, function (data) {
 
-            }, function(res) {
+                }, function(res) {
 
-            });
+                });
+            }
         }
     }]);
 
@@ -24098,6 +24109,24 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $scope.condition.dateFrom = fromDate;
             $scope.condition.dateTo = toDate;
 
+            $scope.changeDateZone = function (zone) {
+                $scope.condition.dateZone = zone;
+                $scope.dateZoneText = zone == 1 ? '最近一个月' : (zone == 3 ? '最近三个月' : (zone == 6 ? '最近六个月' : '自定义'));
+                $scope.condition.$dateZoneOpen = false;
+                getDateCondition(zone, $scope.condition);
+                $scope.tableParams.page(1);
+                $scope.tableParams.reload();
+            };
+
+            $scope.openFilterDatePicker = function ($event, item, openParam) {
+                $event.preventDefault();
+                $event.stopPropagation();
+                item[openParam] = !item[openParam];
+                if ($scope.condition.dateFrom && $scope.condition.dateTo && !item[openParam]) {
+                    $scope.tableParams.reload();
+                }
+            };
+
             $scope.tableParams = new ngTableParams({
                 page: 1,
                 count: 5,

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

@@ -315,7 +315,8 @@
                                        ng-click="openDatePicker($event, item.$dateOpen, $index)">
                             </td>
                             <td>
-                                <a ng-click="add($index)" style="color: #1f4fb2">添加</a><a ng-click="del($index)" style="color: #d32526"> 删除</a>
+                                <!--<a ng-click="add($index)" style="color: #1f4fb2">添加</a>-->
+                                <a ng-click="del($index)" style="color: #d32526"> 删除</a>
                             </td>
                         </tr>
                         </tbody>

+ 3 - 3
src/main/webapp/resources/tpl/index/purc/modal/enableOrderList.html

@@ -166,7 +166,7 @@
         <table class="order-table block" ng-table="tableParams">
             <thead>
                 <tr class="header">
-                    <th>选择</th>
+                    <th width="50">选择</th>
                     <th>物料</th>
                     <th width="80">含税单价</th>
                     <th width="100">税率</th>
@@ -223,7 +223,7 @@
                     <input type="checkbox" ng-click="checkOne(order)" ng-checked="order.checked"
                            ng-disabled="checkedOrder != null && checkedOrder.id != order.id">
                 </td>
-                <td class="first" colspan="5">
+                <td class="first" colspan="4">
                     <div class="order-main">
 					<span class="text-num text-bold"
                           ng-bind="::order.date | date:'yyyy-MM-dd'"></span>
@@ -280,6 +280,6 @@
     </div>
     <div class="modal-footer">
         <a class="btn btn-success btn-sm" ng-click="choose()">确定</a>
-        <a class="btn btn-waring btn-sm" ng-click="close()"> 取消</a>
+        <a class="btn btn-danger btn-sm" ng-click="close()"> 取消</a>
     </div>
 </div>