|
|
@@ -10117,7 +10117,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
/**
|
|
|
* 物料详情
|
|
|
*/
|
|
|
- app.controller('ProductDetailCtrl', ['$scope', 'GetProductInfo', '$upload', 'ngTableParams', '$stateParams', 'toaster', 'AuthenticationService', '$filter', 'BaseService', '$rootScope', '$modal', function($scope, GetProductInfo, $upload, ngTableParams, $stateParams, toaster, AuthenticationService, $filter, BaseService, $rootScope, $modal) {
|
|
|
+ app.controller('ProductDetailCtrl', ['$scope', 'GetProductInfo', '$upload', 'ngTableParams', '$stateParams', 'toaster', 'AuthenticationService', '$filter', 'BaseService', '$rootScope', '$modal', 'Products', function($scope, GetProductInfo, $upload, ngTableParams, $stateParams, toaster, AuthenticationService, $filter, BaseService, $rootScope, $modal, Products) {
|
|
|
BaseService.scrollBackToTop();
|
|
|
// 录入人
|
|
|
AuthenticationService.getAuthentication().success(function(data) {
|
|
|
@@ -10145,6 +10145,13 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
})
|
|
|
}
|
|
|
$scope.prodInfo = data;
|
|
|
+ if($scope.prodInfo.standard != 1 ) {// 非标准的先进行匹配
|
|
|
+ Products.matchone({id: $scope.prodInfo.id}, {}, function(data) {
|
|
|
+ $scope.matchresults = data;
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
if ($rootScope.isProductEdit) { // 是否点击编辑
|
|
|
$scope.prodInfo.$editing = true;
|
|
|
} else {
|
|
|
@@ -10156,6 +10163,17 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
};
|
|
|
loadData();
|
|
|
|
|
|
+ //更新为标准器件
|
|
|
+ $scope.updateone = function(id) {
|
|
|
+ Products.updateone({id: id}, {}, function(data) {
|
|
|
+ if(data.success) {
|
|
|
+ toaster.pop('success', '提示', data.success);
|
|
|
+ }
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
// 选择类目
|
|
|
$scope.selectKind = function(cmpcode) {
|
|
|
if(cmpcode == null) {
|