|
|
@@ -1,6 +1,6 @@
|
|
|
-define([ 'toaster', 'ngTable', 'common/services', 'service/Purc', 'service/Make', 'ui.router','service/Fa','ui.bootstrap' ], function() {
|
|
|
+define([ 'toaster', 'ngTable', 'common/services', 'service/Purc', 'service/Make', 'ui.router','service/Fa','ui.bootstrap', 'service/Token'], function() {
|
|
|
'use strict';
|
|
|
- var app = angular.module('myApp', ['ngAnimate', 'toaster', 'ui.router', 'common.services', 'PurcServices', 'MakeServices', 'FaServices' , 'ui.bootstrap']);
|
|
|
+ var app = angular.module('myApp', ['ngAnimate', 'toaster', 'ui.router', 'common.services', 'PurcServices', 'MakeServices', 'FaServices' , 'ui.bootstrap', 'TokenService']);
|
|
|
|
|
|
app.init = function() {
|
|
|
angular.bootstrap(document, [ 'myApp' ]);
|
|
|
@@ -696,7 +696,7 @@ define([ 'toaster', 'ngTable', 'common/services', 'service/Purc', 'service/Make'
|
|
|
/**
|
|
|
* 客户询价单详情
|
|
|
*/
|
|
|
- app.controller('SaleInquiryCtrl', ['$scope', '$stateParams', 'toaster', 'PurcInquiry', 'Symbol', function($scope, $stateParams, toaster, PurcInquiry, Symbol){
|
|
|
+ app.controller('SaleInquiryCtrl', ['$scope', '$stateParams', 'toaster', 'PurcInquiry', 'Symbol', 'token', function($scope, $stateParams, toaster, PurcInquiry, Symbol, token){
|
|
|
$scope.loading = true;
|
|
|
$scope.vendFromDateOpen = false;
|
|
|
$scope.vendToDateOpen = false;
|
|
|
@@ -728,7 +728,16 @@ define([ 'toaster', 'ngTable', 'common/services', 'service/Purc', 'service/Make'
|
|
|
$scope.purcInquiry.replies.push({price: null, lapQty: null, id: null, editing: true});
|
|
|
reply.editing = false;
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
+ // 获取token信息
|
|
|
+ $scope.getToken = function() {
|
|
|
+ token.info({userType: 'saleinquiry'}, {}, function(data) {
|
|
|
+ $scope.token = data.token;
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
$scope.save = function(item) {
|
|
|
$scope.loading = true;
|
|
|
if(angular.equals($scope.purcInquiry, inquiry)) {
|
|
|
@@ -742,7 +751,7 @@ define([ 'toaster', 'ngTable', 'common/services', 'service/Purc', 'service/Make'
|
|
|
if(angular.isDate(item.vendToDate)) {
|
|
|
item.vendToDate = item.vendToDate.getTime();
|
|
|
}
|
|
|
- PurcInquiry.saveItem({itemId: item.id}, item, function(data) {
|
|
|
+ PurcInquiry.saveItem({itemId: item.id, token: $scope.token}, item, function(data) {
|
|
|
toaster.pop('info', '提示', '保存成功');
|
|
|
PurcInquiry.getItem({itemId: $stateParams.itemId}, function(data){
|
|
|
$scope.purcInquiry = data;
|
|
|
@@ -756,7 +765,7 @@ define([ 'toaster', 'ngTable', 'common/services', 'service/Purc', 'service/Make'
|
|
|
toaster.pop('error', '保存失败', response.data);
|
|
|
});
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
$scope.reply = function(item) {
|
|
|
$scope.loading = true;
|
|
|
if(item.vendFromDate instanceof Date) {
|
|
|
@@ -767,7 +776,7 @@ define([ 'toaster', 'ngTable', 'common/services', 'service/Purc', 'service/Make'
|
|
|
}
|
|
|
PurcInquiry.reply({itemId: item.id}, item, function(data) {
|
|
|
toaster.pop('info', '提示', '回复成功');
|
|
|
- PurcInquiry.getItem({itemId: $stateParams.itemId}, function(data){
|
|
|
+ PurcInquiry.getItem({itemId: $stateParams.itemId, token: $scope.token}, function(data){
|
|
|
$scope.purcInquiry = data;
|
|
|
$scope.loading = false;
|
|
|
}, function(data){
|