|
|
@@ -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",
|
|
|
@@ -595,6 +598,9 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
controller: 'AddPartnersCtrl'
|
|
|
}).state('baseInfo.partner_searchresult', {
|
|
|
url: '/search',
|
|
|
+ params: {
|
|
|
+ 'active': 'done'
|
|
|
+ },
|
|
|
templateUrl: "static/tpl/index/baseInfo/searchresult.html",
|
|
|
controller: 'EnterpriseSearchCtrl'
|
|
|
}).state('baseInfo.invitation', {
|
|
|
@@ -1342,7 +1348,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
modalInstance.result.then(function (data) {
|
|
|
InvitationRecord.invite({formStore: data}, {}, function (data) {
|
|
|
if (data.success) {
|
|
|
- toaster.pop('success', '提示', data.success);
|
|
|
+ // toaster.pop('success', '提示', data.success);
|
|
|
}
|
|
|
if (data.error) {
|
|
|
toaster.pop('error', '提示', data.error);
|
|
|
@@ -4351,6 +4357,15 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
toaster.pop('error', '数据加载失败', response.data);
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+ $scope.isoverdue = function(time) {
|
|
|
+ var timeSpan = new Date().getTime();
|
|
|
+ if (time > timeSpan) {
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
}]);
|
|
|
|
|
|
// 询价单明细
|
|
|
@@ -6001,8 +6016,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- modalInstance.result.then(function (data) {
|
|
|
- $scope.tableParams.reload();
|
|
|
+ modalInstance.result.then(function () {
|
|
|
+ loadData();
|
|
|
}, function () {
|
|
|
|
|
|
});
|
|
|
@@ -6439,7 +6454,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
// var file = $scope.myFiles;
|
|
|
if (file.length > 0) {
|
|
|
for (var i = 0; i < file.length; i++) {
|
|
|
- console.log(file[i].name);
|
|
|
var flag = true;
|
|
|
|
|
|
if (mould.sellAttachs.length > 0) {
|
|
|
@@ -6475,23 +6489,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
// 保存并确认报价
|
|
|
$scope.onReplyClick = function (mould, withSteps) {
|
|
|
$scope.loading = true;
|
|
|
-//// var file = mould.attachFile.$viewValue, file = file && file.length > 0 ? file[0] : null;
|
|
|
-// var file = mould.attachs[0];
|
|
|
-// $scope.mould = mould;
|
|
|
-// $upload.upload({
|
|
|
-// url: 'sale/mould/' + mould.id + '/send',
|
|
|
-// method: 'POST',
|
|
|
-// file: file,
|
|
|
-// data: {
|
|
|
-// json: $scope.mould
|
|
|
-// }
|
|
|
-// }).success(function(res){
|
|
|
-// console.log("success");
|
|
|
-// console.log(res);
|
|
|
-// }).error(function(res){
|
|
|
-// console.log("failure");
|
|
|
-// });
|
|
|
-
|
|
|
if (withSteps) {
|
|
|
PurcInquiryMould.reply({id: mould.id}, mould, function () {
|
|
|
$scope.loading = false;
|
|
|
@@ -6716,21 +6713,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
|
|
|
$scope.onReplyClick = function (mould, withSteps) {
|
|
|
$scope.loading = true;
|
|
|
-// var file = mould.attachs[0];
|
|
|
-// $scope.mould = mould;
|
|
|
-// $upload.upload({
|
|
|
-// url: 'sale/mould/' + mould.id + '/send',
|
|
|
-// method: 'POST',
|
|
|
-// file: file,
|
|
|
-// data: {
|
|
|
-// json: $scope.mould
|
|
|
-// }
|
|
|
-// }).success(function(res){
|
|
|
-//
|
|
|
-// }).error(function(res){
|
|
|
-// console.log(res);
|
|
|
-// });
|
|
|
-
|
|
|
if (withSteps) {
|
|
|
PurcInquiryMould.reply({id: mould.id}, mould, function () {
|
|
|
$scope.loading = false;
|
|
|
@@ -7027,6 +7009,33 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ // 根据传入的询价相关的信息封装成报价需要的信息
|
|
|
+ if ($stateParams.inquiryItem != null) {
|
|
|
+ var item = $stateParams.inquiryItem;
|
|
|
+ $scope.item.quotation.cust = item.inquiry.enterprise;
|
|
|
+ $scope.item.quotation.custUser = item.user;
|
|
|
+ $scope.item.quotation.custUserUU = item.userUU;
|
|
|
+ if ($scope.item.quotation.custUserUU == null) {
|
|
|
+ $scope.item.quotation.custUserUU = item.inquiry.recorderUU;
|
|
|
+ }
|
|
|
+ if (item.product == null || item.product.id == null) {
|
|
|
+ toaster.pop('info', '暂未匹配到物料信息,请手动选择');
|
|
|
+ } else {
|
|
|
+ $scope.item.product = item.product;
|
|
|
+ if (item.replies.length > 0) {
|
|
|
+ $scope.item.prices = item.replies;
|
|
|
+ angular.forEach($scope.item.prices, function(price) {
|
|
|
+ price.id = null;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ $scope.item.quotation.taxrate = item.taxrate;
|
|
|
+ $scope.item.minPackQty = item.minPackQty;
|
|
|
+ $scope.item.minOrderQty = item.minOrderQty;
|
|
|
+ $scope.item.leadtime = item.leadtime;
|
|
|
+ $scope.item.quotation.currency = item.currency;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 保存
|
|
|
$scope.save = function () {
|
|
|
var valid = true;
|
|
|
@@ -7042,15 +7051,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;
|
|
|
@@ -7092,7 +7096,9 @@ 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 = 101;//已提交
|
|
|
if ($scope.item.quotation.date instanceof Date) {
|
|
|
@@ -14774,8 +14780,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}, function (response) {
|
|
|
|
|
|
});
|
|
|
- }
|
|
|
- ;
|
|
|
+ };
|
|
|
|
|
|
// 查找供应商
|
|
|
$scope.dbfindVend = function () {
|
|
|
@@ -20974,10 +20979,14 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}]);
|
|
|
|
|
|
// 企业圈搜索结果
|
|
|
- app.controller('EnterpriseSearchCtrl', ['$scope', 'getAccountUserSpace', 'ngTableParams', '$filter', 'BaseService', 'toaster', 'AddPartner', '$rootScope', '$modal', 'InvitationRecord', function ($scope, getAccountUserSpace, ngTableParams, $filter, BaseService, toaster, AddPartner, $rootScope, $modal, InvitationRecord) {
|
|
|
+ app.controller('EnterpriseSearchCtrl', ['$scope', 'getAccountUserSpace', 'ngTableParams', '$filter', 'BaseService', 'toaster', 'AddPartner', '$rootScope', '$modal', 'InvitationRecord', '$stateParams', function ($scope, getAccountUserSpace, ngTableParams, $filter, BaseService, toaster, AddPartner, $rootScope, $modal, InvitationRecord, $stateParams) {
|
|
|
$scope.status = 'add';
|
|
|
BaseService.scrollBackToTop();
|
|
|
- $scope.active = 'all';
|
|
|
+ if ($stateParams.active != null) {
|
|
|
+ $scope.active = $stateParams.active;
|
|
|
+ } else {
|
|
|
+ $scope.active = 'all';
|
|
|
+ }
|
|
|
$scope.agreedText = '全部';
|
|
|
$scope.dateZoneText = '一个月内';
|
|
|
$scope.condition = {dateZone: 1};
|
|
|
@@ -21082,7 +21091,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
modalInstance.result.then(function (data) {
|
|
|
InvitationRecord.invite({formStore: data}, {}, function (data) {
|
|
|
if (data.success) {
|
|
|
- toaster.pop('success', '提示', data.success);
|
|
|
+ // toaster.pop('success', '提示', data.success);
|
|
|
$scope.tableParams.reload();
|
|
|
}
|
|
|
if (data.error) {
|
|
|
@@ -21483,7 +21492,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
modalInstance.result.then(function (data) {
|
|
|
InvitationRecord.invite({formStore: data}, {}, function (data) {
|
|
|
if (data.success) {
|
|
|
- toaster.pop('success', '提示', data.success);
|
|
|
+ // toaster.pop('success', '提示', data.success);
|
|
|
$scope.tableParams.reload();
|
|
|
}
|
|
|
if (data.error) {
|
|
|
@@ -23498,15 +23507,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;
|
|
|
@@ -23534,17 +23534,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) {
|
|
|
@@ -23561,7 +23550,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;
|
|
|
@@ -23572,264 +23560,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]) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
- $scope.getMinDate = function (item) {
|
|
|
- return $filter('date')(item.inquiry.date, 'yyyy-MM-dd');
|
|
|
- };
|
|
|
- $scope.replyPrices = [];
|
|
|
- $scope.replylapQtys = [];
|
|
|
- $scope.replyPrices.push(true);
|
|
|
- $scope.replylapQtys.push(true);
|
|
|
- $scope.addStep = function (inquiryItem) {
|
|
|
- $scope.replyPrices.push(true);
|
|
|
- if (inquiryItem.replies.length >= 10) {
|
|
|
- toaster.pop('warning', '提示', '最多支持10个分段!');
|
|
|
- } else {
|
|
|
- inquiryItem.replies.push({});
|
|
|
- if (inquiryItem.replies.length != 1) {
|
|
|
- $scope.replyPrices.push(true);
|
|
|
- $scope.replylapQtys.push(true);
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
- $scope.removeStep = function (inquiryItem, stepIndex) {
|
|
|
- inquiryItem.replies.splice(stepIndex, 1);
|
|
|
- $scope.replyPrices.splice(stepIndex, 1);
|
|
|
- $scope.replylapQtys.splice(stepIndex, 1);
|
|
|
- };
|
|
|
-
|
|
|
- $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.getHistory = function (item) {
|
|
|
- if (!item.history) {
|
|
|
- publicInquiry.getHistory({itemId: item.id}, function (data) {
|
|
|
- item.history = data;
|
|
|
- });
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
- // 报价
|
|
|
- $scope.quote = function(inquiryItem) {
|
|
|
- $modal.open({
|
|
|
- animation: true,
|
|
|
- templateUrl: 'static/tpl/index/sale/modal/quote_inquiry.html',
|
|
|
- controller: 'QuoteInquiryCtrl',
|
|
|
- resolve: {
|
|
|
- inquiryItem: function () {
|
|
|
- return inquiryItem
|
|
|
- }
|
|
|
- }
|
|
|
- }).result.then(function (data) {
|
|
|
-
|
|
|
- }, function () {})
|
|
|
- };
|
|
|
-
|
|
|
- $scope.deleteAttach = function (attaches, index) {
|
|
|
- attaches.splice(index, 1);
|
|
|
- };
|
|
|
-
|
|
|
- $scope.onReplyClick = function (item, withSteps) {
|
|
|
- if (item.vendFromDate instanceof Date) {
|
|
|
- item.vendFromDate = item.vendFromDate.getTime();
|
|
|
- }
|
|
|
- if (item.vendToDate instanceof Date) {
|
|
|
- item.vendToDate = item.vendToDate.getTime();
|
|
|
- }
|
|
|
- if (item.vendFromDate > item.vendToDate) {
|
|
|
- toaster.pop('warning', '警告', '有效开始日期不能超过有效截止日期');
|
|
|
- return;
|
|
|
- }
|
|
|
- var replies = [];
|
|
|
- // 判断分段数是否合法
|
|
|
- var valid = true;
|
|
|
- var validLapQty = 0;
|
|
|
- angular.forEach(item.replies, function (r, i) {
|
|
|
- if ((i > 0 ? r.lapQty : 1) || r.price) {
|
|
|
- replies.push(r);
|
|
|
- }
|
|
|
- // 直接比较是字符串比较,需要先转换再比较 2017年9月7日 15:05:51
|
|
|
- if (i > 0 && parseInt(r.lapQty) <= parseInt(item.replies[i - 1].lapQty) || r.lapQty == null) {
|
|
|
- valid = false;
|
|
|
- validLapQty = r.lapQty;
|
|
|
- }
|
|
|
- });
|
|
|
- item.replies = replies;
|
|
|
- $scope.loading = true;
|
|
|
- if (!valid) {
|
|
|
- if (validLapQty) {
|
|
|
- toaster.pop('info', '提示', '分段' + validLapQty + '小于等于了上一分段数,不能保存!');
|
|
|
- } else {
|
|
|
- toaster.pop('info', '提示', '分段数量不合法,不能保存!');
|
|
|
- }
|
|
|
- $scope.loading = false;
|
|
|
- } else {
|
|
|
- var file = item.myFiles, file = file && file.length > 0 ? file[0] : null;
|
|
|
- if (withSteps) { // 保存并报价
|
|
|
- if(null != file) {
|
|
|
- $upload.upload({
|
|
|
- url: 'sale/pubInquiry/addAttach',
|
|
|
- file: file,
|
|
|
- method: 'POST',
|
|
|
- data: {
|
|
|
- item: item,
|
|
|
- method: 'reply'
|
|
|
- }
|
|
|
- }).success(function (data) {
|
|
|
- if (data.item) {
|
|
|
- item = data.item;
|
|
|
- }
|
|
|
- $scope.loading = false;
|
|
|
- toaster.pop('info', '提示', '报价成功');
|
|
|
- $scope.tableParams.reload();
|
|
|
- }).error(function (data) {
|
|
|
- $scope.loading = false;
|
|
|
- toaster.pop('error', '附件上传失败');
|
|
|
- });
|
|
|
- } else {
|
|
|
- publicInquiry.reply({itemId: item.id, token: $scope.token}, item, function (data) {
|
|
|
- $scope.loading = false;
|
|
|
- toaster.pop('info', '提示', '报价成功');
|
|
|
- $scope.tableParams.reload();
|
|
|
- }, function (response) {
|
|
|
- $scope.loading = false;
|
|
|
- toaster.pop('error', '询价失效', response.data);
|
|
|
- });
|
|
|
- }
|
|
|
- } else { // 保存
|
|
|
- if(null != file) {
|
|
|
- $upload.upload({
|
|
|
- url: 'sale/pubInquiry/addAttach',
|
|
|
- file: file,
|
|
|
- method: 'POST',
|
|
|
- data: {
|
|
|
- item: item,
|
|
|
- method: 'save'
|
|
|
- }
|
|
|
- }).success(function (data) {
|
|
|
- if (data.item) {
|
|
|
- item = data.item;
|
|
|
- }
|
|
|
- $scope.loading = false;
|
|
|
- toaster.pop('info', '提示', '保存成功');
|
|
|
- $scope.tableParams.reload();
|
|
|
- }).error(function (data) {
|
|
|
- $scope.loading = false;
|
|
|
- toaster.pop('error', '附件上传失败');
|
|
|
- });
|
|
|
- } else {
|
|
|
- publicInquiry.saveItem({itemId: item.id, token: $scope.token}, item, function (data) {
|
|
|
- $scope.loading = false;
|
|
|
- toaster.pop('info', '提示', '保存成功');
|
|
|
- $scope.tableParams.reload();
|
|
|
- }, function (response) {
|
|
|
- $scope.loading = false;
|
|
|
- toaster.pop('error', '保存失败', response.data);
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
- $scope.isValid = function (item, withSteps) {
|
|
|
- var bool = item.leadtime && item.replies && item.replies[0].price > 0;
|
|
|
- if (!withSteps || !bool)
|
|
|
- return bool;
|
|
|
- angular.forEach(item.replies, function (r, i) {
|
|
|
- $scope.verifylapQty(r.lapQty, i, item);
|
|
|
- bool = (i > 0 ? r.lapQty : 1) && r.price && $scope.replylapQtys[i];
|
|
|
- });
|
|
|
- return bool;
|
|
|
- };
|
|
|
-
|
|
|
- $scope.verifylapQty = function (value, index, inquiryItem) {
|
|
|
- value = parseInt(value);
|
|
|
- var regex = /^\d+(.\d{1,5})?$/;
|
|
|
- var valid = true;
|
|
|
- angular.forEach(inquiryItem.replies, function(reply, $index) {
|
|
|
- if ($index < index && reply.lapQty >= value) {
|
|
|
- valid = false;
|
|
|
- }
|
|
|
- });
|
|
|
- $scope.replylapQtys[index] = regex.test(value) && valid;
|
|
|
- };
|
|
|
-
|
|
|
- $scope.minOrderQtyVerify = $scope.minPackQtyVerify = $scope.leadtimeVerify = true;
|
|
|
- $scope.verify = function (value, type) {
|
|
|
- var regex = /^\d+(.\d{1,5})?$/;//
|
|
|
- switch (type) {
|
|
|
- case 'minOrderQty':
|
|
|
- $scope.minOrderQtyVerify = regex.test(value);
|
|
|
- break;
|
|
|
- case 'minPackQty':
|
|
|
- $scope.minPackQtyVerify = regex.test(value);
|
|
|
- break;
|
|
|
- case 'leadtime':
|
|
|
- $scope.leadtimeVerify = regex.test(value);
|
|
|
- break;
|
|
|
- default:
|
|
|
- $scope.replyPrices[type] = regex.test(value);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
// 搜索框回车
|
|
|
$scope.onSearch = function (keyword) {
|
|
|
// 每次搜索重置获取数据方法
|
|
|
@@ -23846,15 +23576,14 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
$scope.tableParams.reload();
|
|
|
}
|
|
|
|
|
|
- // 导出
|
|
|
- $scope.exportXls = function () {
|
|
|
- PurcInquiry.exportXls({}, {}, function (data) {
|
|
|
- if (data.success) {
|
|
|
- window.location.href = 'sale/inquiry/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
|
|
|
- }
|
|
|
- }, function (response) {
|
|
|
- toaster.pop('error', '数据加载失败', response.data);
|
|
|
- })
|
|
|
+ // 判断是否过期
|
|
|
+ $scope.isoverdue = function(time) {
|
|
|
+ var timeSpan = new Date().getTime();
|
|
|
+ if (time > timeSpan) {
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
@@ -24142,17 +23871,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) {
|