Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dongbw 7 years ago
parent
commit
01a039adad

+ 1 - 1
src/main/java/com/uas/platform/b2b/dao/PurchaseNoticeDao.java

@@ -164,5 +164,5 @@ public interface PurchaseNoticeDao extends JpaSpecificationExecutor<PurchaseNoti
 	 */
     @Modifying(clearAutomatically = true)
 	@Query("update PurchaseNotice set status = :status where id = :noticeId")
-	void updateStatus(@Param("noticeId") Long noticeId, @Param("status") int status);
+	void updateStatus(@Param("noticeId") Long noticeId, @Param("status") short status);
 }

+ 1 - 1
src/main/java/com/uas/platform/b2b/service/impl/PurchaseNoticeServiceImpl.java

@@ -575,7 +575,7 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
 				purchaseNoticeDao.updateBySend(item.getNoticeId());
                 PurchaseNotice notice = purchaseNoticeDao.findOne(item.getNoticeId());
                 if (notice.getEndQty() < notice.getQty() && notice.getStatus() == Status.REPLIED.value()) {
-                    purchaseNoticeDao.updateStatus(item.getNoticeId(), Status.NOT_REPLY.value());
+                    purchaseNoticeDao.updateStatus(item.getNoticeId(), (short) Status.NOT_REPLY.value());
                 }
 				ids.add(item.getNoticeId());
 			}

+ 14 - 6
src/main/webapp/resources/js/index/app.js

@@ -3326,10 +3326,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             var str = '';
             angular.forEach($scope.tableParams.data, function (order) {
                 if (order.$selected == true) {
-                    angular.forEach(order.orderItems, function (item) {
-                        str += item.id;
-                        str += ',';
-                    });
+                    str += order.id;
+                    str += ',';
                 }
             });
             if (!(str == '')) {
@@ -3459,12 +3457,16 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $scope.isUser = data.isUser;
         });
 
+        var existFile = false;
         var loadData = function () {
             PurcOrder.get({id: $stateParams.id}, function (data) {
                 $scope.order = data;
                 var sum = 0;
                 angular.forEach($scope.order.orderItems, function (item) {
                     sum += item.qty * item.price;
+                    if (item.attachs.length > 0) {
+                        existFile = true;
+                    }
                 });
                 $scope.order.total = sum;
                 if ($scope.order.display == 1) {//未查看的设为已查看
@@ -3565,10 +3567,16 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             }
         };
 
+        // 下载附件
         $scope.fileDownload = function (id) {
-            window.open("file/batch/" + id);
+            if (!existFile) {
+                toaster.pop('error', '提示', "当前采购单不存在附件信息");
+            } else {
+                window.open("file/batch/" + id);
+            }
         }
     }]);
+
     app.controller('SaleChangeCtrl', ['$scope', '$filter', 'PurcChange', 'PurcChanges', 'ngTableParams', 'toaster', 'BaseService', 'PurcChangeHis', 'CurrentRole', function ($scope, $filter, PurcChange, PurcChanges, ngTableParams, toaster, BaseService, PurcChangeHis, CurrentRole) {
         BaseService.scrollBackToTop();
 
@@ -7141,7 +7149,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         /* 时间筛选初始化*/
         var fromDate = new Date();
         var toDate = new Date();
-        fromDate.setMonth(fromDate.getMonth() - 1);
+        fromDate.setMonth(fromDate.getMonth() - 6);
         fromDate.setHours(0, 0, 0, 0);
         toDate.setHours(23, 59, 59, 999);
         $scope.condition.dateFrom = fromDate;

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

@@ -152,7 +152,7 @@
            <!-- <div class="com_title">服务>采购模块><font>>代采订单</font></div>-->
             <div class="com_head">
                 <span>代采订单</span>
-                <div class="p-right">
+                <div class="pull-right" style="font-size: 16px">
                     <a ng-click="copyorder(deOrder.id)" title="复制生成一张新的订单,除了采购单号和合同编号不同,其他信息基本相同"><i class="fa fa-copy"></i> 复制订单</a>
                 </div>
             </div>