|
|
@@ -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]) {
|