|
|
@@ -11,16 +11,6 @@ define([ 'app/app' ], function(app) {
|
|
|
$scope.countData = 10;
|
|
|
$scope.userInfo = $rootScope.userInfo || {};
|
|
|
|
|
|
-
|
|
|
- /**
|
|
|
- * 最大出入库数
|
|
|
- * @type {number}
|
|
|
- */
|
|
|
- $scope.maxReserve = 999999999;
|
|
|
- //数字的正则表达式
|
|
|
- var intPattern = /^[1-9]+$/;
|
|
|
- $scope.isInt = /^[0-9]*[1-9][0-9]*$/;
|
|
|
-
|
|
|
// 更多操作数据和记录
|
|
|
$scope.handleLink = [
|
|
|
{name: '查看入库记录', tab: 'inBound', id: 0},
|
|
|
@@ -30,7 +20,6 @@ define([ 'app/app' ], function(app) {
|
|
|
{name: '其它出库', tab: 'outBound', id: 1},
|
|
|
{name: '销售出库', tab: 'outBound', id: 2}];
|
|
|
$scope.handleItem = $stateParams.storage_tab ? 1 : ($scope.storage_tab === 'inBound'? $scope.handleLink[0].id : $scope.handleLink[3].id);
|
|
|
- // $scope.handleItem = 2;
|
|
|
|
|
|
// 销售方式数据
|
|
|
$scope.boundType = {
|
|
|
@@ -148,6 +137,7 @@ define([ 'app/app' ], function(app) {
|
|
|
$scope.storage_tab = type;
|
|
|
$scope.type = $scope.storage_tab === 'inBound'? 'INBOUND' : 'OUTBOUND';
|
|
|
getLoadStorageData();
|
|
|
+ initOtherData();
|
|
|
};
|
|
|
|
|
|
// 操作类型切换
|
|
|
@@ -156,6 +146,7 @@ define([ 'app/app' ], function(app) {
|
|
|
if(type !== 1) {
|
|
|
getLoadStorageData();
|
|
|
}
|
|
|
+ initOtherData();
|
|
|
clearRecordParams();
|
|
|
};
|
|
|
// 销售方式筛选
|
|
|
@@ -287,15 +278,47 @@ define([ 'app/app' ], function(app) {
|
|
|
|
|
|
// 展开收起
|
|
|
$scope.unfoldClick = function (data, type) {
|
|
|
+ $scope.logistics.number = '';
|
|
|
+ $scope.logistics.companyName = '';
|
|
|
angular.forEach(data, function(key) {
|
|
|
type.id !== key.id ? key.seleted = false : key.seleted = true;
|
|
|
})
|
|
|
};
|
|
|
|
|
|
+ // 点击外面清除弹窗
|
|
|
+ $scope.clearOtherData = function() {
|
|
|
+ angular.forEach($scope.otherData, function(val) {
|
|
|
+ val.show = false;
|
|
|
+ if(!val.id){
|
|
|
+ val.pbranden = '';
|
|
|
+ val.key = '';
|
|
|
+ val.kind = '';
|
|
|
+ val.spec = '';
|
|
|
+ val.qty = '';
|
|
|
+ val.price = '';
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
$scope.onChange = function (type) {
|
|
|
+ angular.forEach($scope.otherData, function(val) {
|
|
|
+ val.show = false;
|
|
|
+ })
|
|
|
type.show = true;
|
|
|
Goods.getKeywordToProductId({keyword: type.key}, function(data) {
|
|
|
- $scope.listData = data
|
|
|
+ if(data.length <= 0) {
|
|
|
+ toaster.pop('info', '提示', '该型号不存在你的产品库中!');
|
|
|
+ type.pbranden = '';
|
|
|
+ type.key = '';
|
|
|
+ type.kind = '';
|
|
|
+ type.spec = '';
|
|
|
+ type.qty = '';
|
|
|
+ type.price = '';
|
|
|
+ $scope.listData = [];
|
|
|
+ type.show = false;
|
|
|
+ } else {
|
|
|
+ $scope.listData = data
|
|
|
+ }
|
|
|
}, function (res) {
|
|
|
$scope.listData = [];
|
|
|
type.show = false;
|
|
|
@@ -309,6 +332,8 @@ define([ 'app/app' ], function(app) {
|
|
|
type.kind = key.kind;
|
|
|
type.spec = key.spec;
|
|
|
type.id = key.id;
|
|
|
+ type.qty = key.erpReserve;
|
|
|
+ type.price = key.price;
|
|
|
};
|
|
|
|
|
|
$scope.addOneTable = function (type) {
|
|
|
@@ -495,21 +520,45 @@ define([ 'app/app' ], function(app) {
|
|
|
};
|
|
|
|
|
|
//数量进行验证
|
|
|
- $scope.onAmountChange = function (item, val, type, key) {
|
|
|
- if (!(/^[0-9]*$/).test(val)) {
|
|
|
- var chineseIndex = -1;
|
|
|
- for (var i = 0; i < val.length; i++) {
|
|
|
- if (!(/^[0-9]*$/).test(val.charAt(i))) {
|
|
|
- chineseIndex = i;
|
|
|
- break;
|
|
|
+ $scope.onAmountChange = function (item, val, type, key, deg) {
|
|
|
+ if (deg) {
|
|
|
+ if (angular.isNumber(Number(val))) {
|
|
|
+ if (val >= 10000) {
|
|
|
+ item[type] = Number(val.toString().substring(0, key));
|
|
|
+ } else if (val.toString().indexOf('.') > -1) {
|
|
|
+ var arr = val.toString().split(".");
|
|
|
+ if (arr[0].length > key) {
|
|
|
+ item[type] = Number(arr[0].substring(0, key) + '.' + arr[1]);
|
|
|
+ } else if (arr[1].length > deg) {
|
|
|
+ item[type] = Number(arr[0] + '.' + arr[1].substring(0, deg));
|
|
|
+ }
|
|
|
}
|
|
|
+ } else {
|
|
|
+ item[type] = ''
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (!(/^[0-9]*$/).test(val)) {
|
|
|
+ var chineseIndex = -1;
|
|
|
+ for (var i = 0; i < val.length; i++) {
|
|
|
+ if (!(/^[0-9]*$/).test(val.charAt(i))) {
|
|
|
+ chineseIndex = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ item[type] = cutOutString(val, chineseIndex);
|
|
|
+ } else if (val.length > key) {
|
|
|
+ item[type] = cutOutString(val, key);
|
|
|
}
|
|
|
- item[type] = cutOutString(val, chineseIndex);
|
|
|
- } else if (val.length > key) {
|
|
|
- item[type] = cutOutString(val, key);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ $scope.checkAmount = function (item, val, type) {
|
|
|
+ $scope.validObj.amount = $scope.applyObj.amount === '' ? true
|
|
|
+ : $scope.applyObj.amount > 0 && $scope.applyObj.amount
|
|
|
+ < 1000000000;
|
|
|
+ return $scope.validObj.amount;
|
|
|
+ }
|
|
|
+
|
|
|
$scope.outBlurSendCount = function(details, val) {
|
|
|
var newShipQty = details.shipQty ? details.shipQty : 0
|
|
|
if (val > details.number - newShipQty) {
|
|
|
@@ -571,7 +620,7 @@ define([ 'app/app' ], function(app) {
|
|
|
// TODO huxz 跳转到订单管理页面
|
|
|
if (res.success) {
|
|
|
toaster.pop("success", "信息", "发货成功");
|
|
|
- $state.go('vendor_order');
|
|
|
+ // $state.go('vendor_order');
|
|
|
} else {
|
|
|
toaster.pop("error", res.message);
|
|
|
}
|