فهرست منبع

公共询价发布时增加推荐功能,将相关物料推荐给拥有该物料的用户,可以方便快捷的进行报价处理

hejq 8 سال پیش
والد
کامیت
e36b854667

+ 184 - 1
src/main/webapp/resources/js/index/app.js

@@ -337,6 +337,13 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             url: "/pubinquiry/:id",
             templateUrl: "static/tpl/index/sale/pubinquiry_detail.html",
             controller: 'SalePubInquiryDetailCtrl'
+        }).state('sale.inquiryRemind', {
+            /**
+             * 针对卖家,查询推荐的询价列表
+             */
+            url: "/inquiryRemind",
+            templateUrl: "static/tpl/index/sale/inquiryRemind.html",
+            controller: 'SaleInquiryRemindCtrl'
         }).state('sale.inquirymould', {
             url: "/mould",
             templateUrl: "static/tpl/index/sale/inquiry_mould.html",
@@ -23801,7 +23808,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $scope.active = $rootScope.active;
             $rootScope.active = null;
         } else {
-            $scope.active = 'todo';
+            $scope.active = 'all';
         }
         $scope.agreedText = '全部';
         $scope.dateZoneText = '最近一个月';
@@ -24175,5 +24182,181 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         });
     }]);
 
+    /**
+     * 针对卖家,询价推荐列表
+     */
+    app.controller('SaleInquiryRemindCtrl', ['$scope', '$filter', 'ngTableParams', 'toaster', 'BaseService', 'publicInquiry', '$modal', 'AccountEnterprise', '$http', 'AuthenticationService', function ($scope, $filter, ngTableParams, toaster, BaseService, publicInquiry, $modal, AccountEnterprise, $http, AuthenticationService) {
+        BaseService.scrollBackToTop();
+        $scope.agreedText = '全部';
+        $scope.dateZoneText = '最近一个月';
+        $scope.condition = {dateZone: 1};
+
+        /* 时间筛选初始化*/
+        var fromDate = new Date();
+        var toDate = new Date();
+        fromDate.setMonth(fromDate.getMonth() - 1);
+        fromDate.setHours(0, 0, 0, 0);
+        toDate.setHours(23, 59, 59, 999);
+        $scope.condition.dateFrom = fromDate;
+        $scope.condition.dateTo = toDate;
+
+        $scope.changeDateZone = function (zone) {
+            $scope.condition.dateZone = zone;
+            $scope.dateZoneText = zone == 1 ? '最近一个月' : (zone == 3 ? '最近三个月' : (zone == 3 ? '最近六个月' : '自定义'));
+            $scope.condition.$dateZoneOpen = false;
+            getDateCondition(zone, $scope.condition);
+            $scope.tableParams.page(1);
+            $scope.tableParams.reload();
+        };
+
+        $scope.tableParams = new ngTableParams({
+            page: 1,
+            count: 20,
+            sorting: {
+                'date': 'desc'
+            }
+        }, {
+            total: 0,
+            counts: [5, 10, 25, 50],
+            getData: function ($defer, params) {
+                $scope.loading = true;
+                var pageParams = params.url();
+                var realActive = {};
+                pageParams.searchFilter = { // 筛选条件
+                    keyword: $scope.keyword,
+                    fromDate: getDateTime($scope.condition.dateFrom),
+                    endDate: getDateTime($scope.condition.dateTo)
+                };
+                if ($scope.active == 'overdue') {
+                    $scope.active = 'end';
+                }
+              
+                AccountEnterprise.get({}, function(data) {
+                    $scope.currentEn = data;
+                    publicInquiry.getUrl({}, function(data) {
+                        $scope.url = data.url;
+                        AuthenticationService.getAuthentication().success(function (data) {
+                            $scope.loading = false;
+                            $scope.thisUser = data;
+                            $http({
+                                method: 'get',
+                                dataType: 'json',
+                                url: $scope.url + '/inquiry/sale/remind',
+                                params: {pageNumber: pageParams.page, pageSize: pageParams.count, useruu: $scope.thisUser.userUU, enuu: $scope.currentEn.uu,
+                                    keyword: $scope.keyword, fromDate: getDateTime($scope.condition.dateFrom), endDate: getDateTime($scope.condition.dateTo)}
+                            }).success(function (response) {
+                                $scope.loading = false;
+                                if (response) {
+                                    params.total(response.totalElements);
+                                    $defer.resolve(response.content);
+                                }
+                            }).error(function (err) {
+                                $scope.loading = false;
+                                toaster.pop('error', '数据加载失败', err);
+                            });
+                        });
+                    });
+                });
+            }
+        });
+
+        $scope.getMinDate = function (item) {
+            return $filter('date')(item.inquiry.date, 'yyyy-MM-dd');
+        };
+
+        $scope.openDatePicker = function ($event, item, openParam) {
+            $event.preventDefault();
+            $event.stopPropagation();
+            item[openParam] = !item[openParam];
+        };
+
+        $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.onSearch = function (keyword) {
+            // 每次搜索重置获取数据方法
+            $scope.searchMethod = false;
+            if(keyword != null && keyword != '') {
+                $scope.searchMethod = true;
+            }
+            $scope.tableParams.page(1);
+            $scope.tableParams.reload();
+        };
+
+        // 取消
+        $scope.cancel = function () {
+            $scope.tableParams.reload();
+        }
+
+        // 是否已过期
+        $scope.isOverDue = function (date) {
+            if (date) {
+                var ndate = new Date();
+                ndate.setHours(23, 59, 59 ,999);
+                ndate.setDate(ndate.getDate());
+                var timestamp = Date.parse(ndate);
+                if (date > timestamp) {
+                    return true;
+                } else {
+                    return false;
+                }
+            } else {
+                return true;
+            }
+        }
+
+        // 转客户询价
+        $scope.qute = function (remind) {
+            $http({
+                method: 'get',
+                dataType: 'json',
+                url: $scope.url + '/inquiry/sale/quote',
+                params: {id: remind.itemId, en_uu: $scope.currentEn.uu}
+            }).success(function (response) {
+                $scope.loading = false;
+                if (response.inquiry != null) {
+                   toaster.pop('error', '该单据已报价');
+                } else {
+                    $http({
+                        method: 'get',
+                        dataType: 'json',
+                        url: $scope.url + '/inquiry/sale/quote',
+                        params: {id: remind.itemId, en_uu: $scope.currentEn.uu}
+                    }).success(function (response) {
+                        var inquiryItem = response;
+                        var modalInstance = $modal.open({
+                            templateUrl: 'static/tpl/index/baseInfo/modal/quotation_modal.html',
+                            controller: 'QuoteCtrl',
+                            size: 'lg',
+                            resolve: {
+                                inquiryItem: function () {
+                                    return inquiryItem
+                                }
+                            }
+                        });
+
+                        modalInstance.result.then(function (data) {
+                            $scope.tableParams.reload();
+                        }, function () {
+
+                        });
+                    }).error(function (error) {
+                        toaster.pop('error', '数据加载失败', error);
+                    });
+                }
+            }).error(function (err) {
+                toaster.pop('error', '数据加载失败', err);
+            });
+        }
+
+    }]);
+    
     return app;
 });

+ 2 - 1
src/main/webapp/resources/tpl/index/baseInfo/inquiry_list.html

@@ -334,7 +334,8 @@
                         <div class="slider" id="slider">
                            <marquee behavior="scroll" direction="left" scrollamount="5">
                                <span ng-repeat="msg in message">
-                                   <a ng-click="toDetail(msg.inid)" title="点击查看详情"><img src="static/img/all/circle.png" alt="" class="circle"/> “<em ng-bind="msg.enName"></em>”发布关于“<em ng-bind="msg.pordName"></em>”的询价 <img src="static/img/home/new.png" class="new"/></a>
+                                   <a ng-if="msg.quteId == null" ui-sref="baseInfo.inquiryListDetail({id:msg.inid})" title="点击查看详情"><img src="static/img/all/circle.png" alt="" class="circle"/> “<em ng-bind="msg.enName"></em>”发布关于“<em ng-bind="msg.pordName"></em>”的询价 <img src="static/img/home/new.png" class="new"/></a>
+                                   <a ng-if="msg.quteId != null" ui-sref="sale.pubinquiry_detail({id:msg.quteId})" title="点击查看详情"><img src="static/img/all/circle.png" alt="" class="circle"/> “<em ng-bind="msg.enName"></em>”发布关于“<em ng-bind="msg.pordName"></em>”的询价 <img src="static/img/home/new.png" class="new"/></a>
                                </span>
                            </marquee>
                             <!--    指令

+ 340 - 0
src/main/webapp/resources/tpl/index/sale/inquiryRemind.html

@@ -0,0 +1,340 @@
+<style>
+    .order-table .header>th {
+        height: 38px;
+        text-align: center;
+        background: #f5f5f5;
+        border-top: 1px solid #e8e8e8;
+        border-bottom: 1px solid #e8e8e8;
+    }
+
+    .order-table .sep-row {
+        height: 10px;
+    }
+
+    .order-table .selector {
+        vertical-align: middle;
+        margin: 0 0 2px 0;
+    }
+
+    .toolbar label {
+        margin-right: 10px;
+        margin-bottom: 0;
+    }
+
+    .toolbar .select_all {
+        margin: 0 6px 0 10px;
+        line-height: 20px;
+    }
+
+    .toolbar .btn {
+        -moz-border-radius: 2px;
+        margin-right: 5px;
+        border: 1px solid #dcdcdc;
+        border-radius: 2px;
+        -webkit-border-radius: 2px;
+    }
+
+    .order-table .order-hd {
+        background: #f5f5f5;
+        height: 40px;
+        line-height: 40px;
+    }
+
+    .order-table .order-hd td.first {
+        padding-left: 20px;
+    }
+
+    .order-table .order-hd .order-main span {
+        margin-right: 8px;
+    }
+
+    .order-table .order-hd .order-code {
+        font-style: normal;
+        font-family: verdana;
+    }
+
+    .order-table .order-hd .order-sum {
+        padding: 0 5px;
+    }
+
+    .order-table>tbody {
+        border: 1px solid transparent;
+    }
+
+    .order-table>tbody:hover {
+        border-color: #d32526;
+        border-width: 2px;
+    }
+
+    .order-table .operates {
+        display: none;
+    }
+
+    .order-table>tbody:hover .operates {
+        display: block;
+    }
+
+    .order-table .order-bd {
+        border-bottom: 1px solid #e6e6e6;
+    }
+
+    .order-table .order-bd>td {
+        padding: 10px 5px;
+        vertical-align: top;
+        position: relative;
+    }
+
+    .order-table .order-bd .product {
+        padding-left: 20px;
+    }
+    .order-table .order-bd .product .dropdown-toggle span{
+        color:#333;
+    }
+    .order-table .order-bd .product .dropdown-toggle{
+        position:relative;
+        display:inline-block;
+        color:#333;
+    }
+    .order-table .order-bd .product .dropdown-toggle:hover{
+        text-decoration: none;
+        cursor:pointer;
+    }
+    .order-table .order-bd .product .dropdown-toggle:hover span{
+        text-decoration: none;
+        color:#327ebe;
+    }
+    .order-table .order-bd .product .dropdown-toggle i{
+        position:relative;
+        top:-3px;
+        color:#c8c8c8;
+    }
+    .order-table .order-bd .product .dropdown-toggle:hover i{
+        text-decoration: none;
+        color:#000;
+    }
+    .order-table .order-bd .product .dropdown-toggle:hover .dropdown-menu{
+        display:block;
+        margin:0;
+    }
+
+    .input-xs,.input-group-xs>.form-control,.input-group-xs>.input-group-addon,.input-group-xs>.input-group-btn>.btn
+    {
+        height: 26px;
+        padding: 0 5px;
+        font-size: 12px;
+        line-height: 1.5;
+        border-radius: 3px;
+    }
+
+    .input-group-xs .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn {
+        border-top-left-radius: 0;
+        border-bottom-left-radius: 0;
+    }
+
+    @media ( min-width : 768px) {
+        .form-horizontal .form-group-xs .control-label {
+            padding-top: 5px;
+        }
+    }
+
+    .info-container .info:hover {
+        color: #CC3333;
+    }
+    .input-error{
+        background-color: #fff8ee;
+        border-color: #CC0033;
+    }
+    input.input-error:focus {
+        background-color: #fff8ee;
+        border-color: #CC0033;
+    }
+    .block{
+        /*background: #f5f5f5;*/
+    }
+    .order-table{
+        background: #fff;
+    }
+    .menu .new-dot{
+        width: 20px;
+        height: 20px;
+        line-height: 20px;
+        font-size: 12px;
+        color: #fff;
+        font-weight: inherit;
+        top: -2px;
+    }
+</style>
+<link rel="stylesheet" href="static/css/public.css">
+<style>
+    .order-table .order-bd .pane-body span{
+        font-size: 14px;
+        color:#333;
+    }
+    .order-table .order-bd .pane-body em{
+        font-size: 14px;
+        color:#999;
+        font-style:normal;
+    }
+    .order-table .order-bd td span{
+        font-size: 14px;
+        color:#999;
+        font-style:normal;
+    }
+</style>
+<div class="block" id="public">
+    <div class="loading in" ng-class="{'in': loading}">
+        <i></i>
+    </div>
+    <div class="pub-com_head">
+        <span>我的待报价</span>
+    </div>
+    <div class="condition block">
+        <div class="search-bg condition block" style="padding: 10px 15px;">
+            <div class="row">
+                <div id="topSearch" style="float: left">
+                    <a ng-click="changeDateZone(1);condition.$open=false" title="最近一个月" ng-class="{'active':condition.dateZone=='1'}">最近一个月</a>
+                    <a ng-click="changeDateZone(3);condition.$open=false" title="最近三个月" ng-class="{'active':condition.dateZone=='3'}">最近三个月</a>
+                    <a ng-click="changeDateZone(6);condition.$open=false" title="最近六个月" ng-class="{'active':condition.dateZone=='6'}">最近六个月</a>
+                    <a ng-click="condition.$open=!condition.$open;changeDateZone(-1)" title="自定义" ng-class="{'active':condition.dateZone=='-1'}" >自定义</a>
+                </div>
+                <div class="col-xs-6" style="float: right;">
+                    <div class="search">
+                        <div class="form-group form-group-sm has-feedback" dropdown auto-close="outsideClick"
+                             on-toggle="searchAdvance=open">
+                            <input type="search" class="form-control input-sm" ng-model="keyword"
+                                   ng-search="onSearch(keyword)" placeholder="输入客户名称、物料名称、型号、规格搜索" style="width: 100%"/>
+                            <a class="btn input-group-addon" ng-click="onSearch(keyword)">搜索</a>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="more-list more" ng-class="{'open': condition.$open}">
+                <form class="form-inline">
+                    <div class="form-group ">
+                        <label>日期:</label>
+                        <div class="btn-group btn-menu" dropdown is-open="condition.$dateZoneOpen">
+                            <ul class="dropdown-menu">
+                                <li><a ng-click="changeDateZone(1)">一个月内</a></li>
+                                <li><a ng-click="changeDateZone(6)">半年内</a></li>
+                                <li><a ng-click="changeDateZone()">半年前</a></li>
+                            </ul>
+                        </div>
+                        <div class="form-group input-group input-group-xs input-trigger">
+                            <input type="text" ng-model="condition.dateFrom"
+                                   class="form-control" placeholder="从"
+                                   datepicker-popup="yyyy-MM-dd" is-open="condition.$fromOpened"
+                                   ng-required="true" max-date = "condition.dateTo"
+                                   current-text="今天" clear-text="清除" close-text="关闭"
+                                   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+                                   ng-focus="openFilterDatePicker($event, condition, '$fromOpened')">
+                            <span class="input-group-btn">
+							<button type="button" class="btn btn-default"
+                                    ng-click="openFilterDatePicker($event, condition, '$fromOpened')">
+								<i class="fa fa-calendar"></i>
+							</button>
+						</span>
+                        </div>
+                        <div class="form-group input-group input-group-xs input-trigger">
+                            <input type="text" ng-model="condition.dateTo"
+                                   class="form-control" placeholder="到"
+                                   datepicker-popup="yyyy-MM-dd" is-open="condition.$toOpened"
+                                   ng-required="true" min-date = "condition.dateFrom"
+                                   current-text="今天" clear-text="清除" close-text="关闭"
+                                   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+                                   ng-focus="openFilterDatePicker($event, condition, '$toOpened')">
+                            <span class="input-group-btn">
+							<button type="button" class="btn btn-default"
+                                    ng-click="openFilterDatePicker($event, condition, '$toOpened')">
+								<i class="fa fa-calendar"></i>
+							</button>
+						</span>
+                        </div>
+                    </div>
+                </form>
+            </div>
+        </div>
+    </div>
+    <table class="order-table block" ng-table="tableParams">
+        <thead>
+        <tr class="header">
+            <th width="100">发布日期</th>
+            <th>产品型号</th>
+            <th width="100">品牌</th>
+            <th width="80">需求数量</th>
+            <th width="100">询价企业</th>
+            <th width="80">联系人</th>
+            <th width="80">联系方式</th>
+            <th width="80">截止日期</th>
+            <th width="75">操作</th>
+        </tr>
+        <tr class="sep-row">
+            <td colspan="6"></td>
+        </tr>
+        </thead>
+        <tbody ng-if="tableParams.total() == 0">
+        </tbody>
+        <tbody ng-repeat="remind in $data track by remind.id">
+        <tr class="order-bd">
+            <td>
+                <span class="text-num text-bold" title="{{remind.reDate}}"
+                      ng-bind="::remind.reDate | date:'yyyy-MM-dd'"></span>
+            </td>
+            <td class="product">
+                <div class="text-num text-bold">
+                    <a class="dropdown-toggle"
+                       ng-mouseover="getHistory(remind)">
+                        <span ng-bind="::remind.cmpCode"></span>
+                        <i class="fa fa-fw fa-sort-desc"></i>
+                        <div class="dropdown-menu pane" style="width: 270px;">
+                            <div class="pane-body">
+                                <div>
+                                    <div>
+                                        <span>产品规格:</span>
+                                        <em ng-bind="::remind.spec"></em>
+                                    </div>
+                                    <div>
+                                        <span>产品名称:</span>
+                                        <em ng-bind="::remind.title"></em>
+                                    </div>
+                                </div>
+                                <div ng-show="!remind.spec && !remind.title"
+                                     class="text-center text-muted">暂无产品信息</div>
+                            </div>
+                        </div>
+                    </a>
+                </div>
+            </td>
+            <td class="text-center">
+                <span ng-bind="remind.brand || '-'"></span>
+            </td>
+            <td class="text-center">
+                <span ng-bind="remind.needQty || '-'"></span>
+            </td>
+            <td class="text-center">
+                <span ng-bind="remind.enName || '-'"></span>
+            </td>
+            <td class="text-center">
+                <span ng-bind="remind.userName || '-'"></span>
+            </td>
+            <td class="text-center">
+                <span ng-bind="remind.userTel || '-'"></span>
+            </td>
+            <td class="text-center">
+                <span class="text-muted">剩余</span>
+                <span ng-bind="remind.endDate | timespan" class="text-inverse text-bold"></span>
+            </td>
+            <td class="text-center">
+                <div ng-if="!isOverDue(remind.endDate)" class="block">
+                    <span>已结束</span>
+                </div>
+                <div ng-if="isOverDue(remind.endDate)" class="block">
+                    <a ng-if="remind.status==100" ng-click="qute(remind)">报价</a>
+                    <span ng-if="remind.status==101">已报价</span>
+                    <span ng-if="remind.status==104">已采纳</span>
+                    <span ng-if="remind.status==103">未采纳</span>
+                </div>
+            </td>
+        </tr>
+        </tbody>
+    </table>
+</div>

+ 1 - 0
src/main/webapp/resources/tpl/index/sale/left.html

@@ -30,6 +30,7 @@
 		<ul class="list-unstyled">
 			<li ui-sref-active="active"><a ui-sref="sale.inquiry" ng-click="getUnread()"><em class="new-dot" ng-if="unread.inquiry > 0"></em>客户采购询价</a></li>
 			<li ui-sref-active="active"><a ui-sref="sale.pubinquiry" ng-click="getUnread()">客户公共询价</a></li>
+			<li ui-sref-active="active"><a ui-sref="sale.inquiryRemind">我的待报价</a></li>
 			<li ui-sref-active="active"><a ui-sref="sale.inquirymould" ng-click="getUnread()"><em class="new-dot" ng-if="unread.mould > 0"></em>客户模具询价</a></li>
 			<li ui-sref-active="active"><a ui-sref="sale.quotation.list"><em class="new-dot" ng-if="false"></em>主动报价</a></li>
 			<li ui-sref-active="active"><a ui-sref="sale.tenderlist"><em class="new-dot" ng-if="unread.tender > 0"></em>客户招标</a></li>

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

@@ -203,10 +203,10 @@
 						<button type="button" class="btn btn-default btn-line"
 								ng-class="{'btn-info':active=='done'}" ng-click="setActive('done');setOrdersReadByState()">已报价<b class="new-dot" ng-if="unread.replied>0">{{unread.replied>99?'99+':unread.replied}}</b></button>
 					</div>
-					<div class="btn-group btn-group-sm">
+					<!--<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
 								ng-class="{'btn-info':active=='todo'}" ng-click="setActive('todo')">待报价<b class="new-dot" ng-if="unread.notReply>0">{{unread.notReply>99?'99+':unread.notReply}}</b></button>
-					</div>
+					</div>-->
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
 								ng-class="{'btn-info':active=='agreed'}" ng-click="setActive('agreed')">已采纳</button>