|
|
@@ -4,7 +4,7 @@
|
|
|
*/
|
|
|
define(['app/app'], function (app) {
|
|
|
'use strict';
|
|
|
- app.register.controller('seekPurchaseCtrl',
|
|
|
+ app.register.controller('bomDetailCtrl',
|
|
|
['$scope', '$rootScope', 'seekPurchase', 'toaster', 'BaseService',
|
|
|
'ngTableParams', 'Order', 'SessionService', '$filter', '$upload', '$stateParams',
|
|
|
function ($scope, $rootScope, seekPurchase, toaster, BaseService,
|
|
|
@@ -17,11 +17,13 @@ define(['app/app'], function (app) {
|
|
|
$scope.bomName = '';
|
|
|
|
|
|
var getBomInfo = function () {
|
|
|
- seekPurchase.findOneBom({bomId: $stateParams.id}, function (data) {
|
|
|
+ if ($stateParams.id) {
|
|
|
+ seekPurchase.findOneBom({bomId: $stateParams.id}, function (data) {
|
|
|
$scope.bomInfo = data;
|
|
|
- }, function (error) {
|
|
|
-
|
|
|
- });
|
|
|
+ }, function (response) {
|
|
|
+ toaster.pop('error', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
getBomInfo();
|
|
|
|
|
|
@@ -38,9 +40,11 @@ define(['app/app'], function (app) {
|
|
|
toaster.pop('success', '修改成功');
|
|
|
$scope.bomInfo.name = $scope.bomName;
|
|
|
$scope.setIsEditName(false);
|
|
|
+ } else {
|
|
|
+ toaster.pop('error', data.message);
|
|
|
}
|
|
|
- }, function (error) {
|
|
|
- toaster.pop('srror', '系统错误');
|
|
|
+ }, function (response) {
|
|
|
+ toaster.pop('error', response.data);
|
|
|
})
|
|
|
}
|
|
|
|
|
|
@@ -273,8 +277,8 @@ define(['app/app'], function (app) {
|
|
|
$scope.goodsCount = 0;
|
|
|
$scope.currentSeek = {};
|
|
|
$scope.setSeekStatus = function (seek, status) {
|
|
|
- $scope.offerCount = seek.offerAmount;
|
|
|
- $scope.goodsCount = seek.goodsAmount;
|
|
|
+ $scope.offerCount = seek.offerAmount || 0;
|
|
|
+ $scope.goodsCount = seek.goodsAmount || 0;
|
|
|
$scope.currentSeek = seek;
|
|
|
// 查看报价
|
|
|
if (status == 2 && $scope.offerCount != 0) {
|