Browse Source

发货提醒更新

hejq 8 years ago
parent
commit
6892e366d2

+ 5 - 16
src/main/java/com/uas/platform/b2b/model/PurchaseNotice.java

@@ -1,23 +1,12 @@
 package com.uas.platform.b2b.model;
 
-import java.io.Serializable;
-import java.util.Date;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.OneToOne;
-import javax.persistence.SequenceGenerator;
-import javax.persistence.Table;
-import javax.persistence.Transient;
-
 import com.uas.platform.core.model.Constant;
 import com.uas.platform.core.model.Status;
 
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
 /**
  * 平台里面,以供应商的角度来查看客户送货提醒
  * 
@@ -88,7 +77,7 @@ public class PurchaseNotice implements Serializable {
 	/**
 	 * 处理状态(已回复、未回复),全部发货后改为已回复
 	 */
-	@Column(name = "pn_status", insertable = false, updatable = false)
+	@Column(name = "pn_status")
 	private Short status;
 
 	/**

+ 1 - 1
src/main/java/com/uas/platform/b2b/model/SaleSendItem.java

@@ -20,7 +20,7 @@ import java.util.Set;
 public class SaleSendItem {
 
 	@Id
-	@GeneratedValue(strategy = GenerationType.AUTO)
+	@GeneratedValue(strategy = GenerationType.IDENTITY)
 	@Column(name = "si_id")
 	private Long id;
 

+ 21 - 70
src/main/webapp/resources/js/index/app.js

@@ -368,7 +368,10 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         }).state('sale.quotation.new', {
             url: "/new",
             templateUrl: "static/tpl/index/sale/quotation_new.html",
-            controller: 'SaleQuotationNewCtrl'
+            controller: 'SaleQuotationNewCtrl',
+            params: {
+                'inquiryItem': null
+            }
         }).state('sale.quotation.list', {
             url: "/list",
             templateUrl: "static/tpl/index/sale/quotation_list.html",
@@ -7027,6 +7030,20 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             }
         };
 
+        // 根据传入的询价相关的信息封装成报价需要的信息
+        if ($stateParams.inquiryItem != null) {
+            var item = $stateParams.inquiryItem;
+            console.log(item);
+            $scope.item.quotation.cust = item.inquiry.enterprise;
+            $scope.item.quotation.custUser = item.user;
+            $scope.item.quotation.custUserUU = item.userUU;
+            if (item.product == null || item.product.id == null) {
+                toaster.pop('info', '暂未匹配到物料信息,请手动选择');
+            } else {
+                $scope.item.product = item.product;
+            }
+        }
+
         // 保存
         $scope.save = function () {
             var valid = true;
@@ -7042,15 +7059,10 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 if (!$scope.item.quotation.code) //新增,设单号
                     $scope.item.quotation.code = 'BJ' + $filter('date')(new Date(), 'yyMMddHHmmss_sss');
                 $scope.item.quotation.custUU = $scope.item.quotation.cust.uu;
-                $scope.item.quotation.custUserUU = $scope.item.quotation.custUser.userUU;
+                if ($scope.item.quotation.custUserUU == null) {
+                    $scope.item.quotation.custUserUU = $scope.item.quotation.custUser.userUU;
+                }
                 $scope.item.productId = $scope.item.product.id;
-                // $scope.item.quotation.status = 100;//在录入
-                // if ($scope.item.quotation.date instanceof Date) {
-                //     $scope.item.quotation.date = $scope.item.quotation.date.getTime();
-                // }
-                // if ($scope.item.quotation.endDate instanceof Date) {
-                //     $scope.item.quotation.endDate = $scope.item.quotation.endDate.getTime();
-                // }
                 Quotation.save({}, $scope.item, function (data) {
                     $scope.loading = false;
                     $scope.item = data;
@@ -7058,7 +7070,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                     if ($stateParams.id)
                         window.location.reload();
                     else
-                    // window.location.hash = '#/sale/quotation/' + data.id;
                         window.location.hash = '#/sale/quotation/list';
                 }, function (response) {
                     $scope.loading = false;
@@ -23477,15 +23488,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             }
         };
 
-        // // 设置阅读状态
-        // $scope.setReadStatus = function(msg) {
-        //     if(!msg.read) {
-        //         PurcInquiry.setStatus({id: msg.inid}, {}, function(data) {
-        //
-        //         });
-        //     }
-        // }
-
         $scope.searchMethod = false;
         var getService = function () {
             return $scope.searchMethod ? PubInquirySearchInfo : PubInquiryNoSearchInfo;
@@ -23513,17 +23515,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 if ($scope.active == 'overdue') {
                     $scope.active = 'end';
                 }
-                /*getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function (page) {
-                    $scope.loading = false;
-                    if (page) {
-                        params.total(page.totalElement);
-                        $defer.resolve(page.content);
-                        $scope.searchFilterXls = angular.copy(pageParams.searchFilter);//保存当前取值的关键词
-                    }
-                }, function (response) {
-                    $scope.loading = false;
-                    toaster.pop('error', '数据加载失败', response.data);
-                });*/
                 AccountEnterprise.get({}, function(data) {
                     $scope.currentEn = data;
                     publicInquiry.getUrl({}, function(data) {
@@ -23540,7 +23531,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                             if (response) {
                                 params.total(response.totalElements);
                                 $defer.resolve(response.content);
-                                // $scope.keywordXls = angular.copy($scope.keyword); // 保存当前取值的关键词  做导出时需要的字段
                             }
                         }).error(function (err) {
                             $scope.loading = false;
@@ -23551,45 +23541,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             }
         });
 
-        //获得各分类未阅读数量
-        // var getUnreadCount = function () {
-        //     PurcInquiry.getUnreadCount(null, function (data) {
-        //         $scope.unread = data;
-        //     });
-        // };
-        // getUnreadCount();
-
-        // //设置单据已读
-        // $scope.setOrdersRead = function (id) {
-        //     // 如果单据本身已读,则不发送请求修改数据
-        //     if (!$scope.isUnread(id)){
-        //         return;
-        //     }
-        //     var sourceId = [];
-        //     sourceId.push(id);
-        //     PurcInquiry.setRead({}, sourceId, function (message) {
-        //         getUnreadCount();
-        //         removeByValue($scope.unreadCode, id);
-        //     });
-        // };
-
-        // $scope.setOrdersReadByState = function () {
-        //     if (!$scope.unread.replied || $scope.unread.replied == 0) {
-        //         return;
-        //     }
-        //     PurcInquiry.setReadByState({}, function () {
-        //         getUnreadIds();
-        //         getUnreadCount();
-        //     });
-        // };
-
-        // var getUnreadIds = function () {
-        //     PurcInquiry.getUnreadIds({}, "", function (message) {
-        //         $scope.unreadCode = message.content;
-        //     });
-        // };
-        // getUnreadIds();
-
         $scope.isUnread = function (id) {
             for (var i in $scope.unreadCode) {
                 if (id == $scope.unreadCode[i]) {

+ 4 - 0
src/main/webapp/resources/tpl/index/sale/pubinquiry.html

@@ -433,6 +433,10 @@
 				<div ng-if="inquiryItem.status == 201 && inquiryItem.agreed == 0" class="block">
 					<span class="text-trans error">未采纳</span>
 				</div>
+				<div ng-if="(inquiryItem.status == 201 && (inquiryItem.agreed == 1 || inquiryItem.agreed == 0)) || isoverdue(inquiryItem.inquiry.endDate) && inquiryItem.checked != 1">
+					<br><br>
+					<a ui-sref="sale.quotation.new({inquiryItem:inquiryItem})">我要报价</a>
+				</div>
 			</td>
 		</tr>
 		</tbody>