|
|
@@ -3653,7 +3653,8 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
if ((i > 0 ? r.lapQty : 1) || r.price) {
|
|
|
replies.push(r);
|
|
|
}
|
|
|
- if (i > 0 && r.lapQty <= item.replies[i - 1].lapQty || r.lapQty == null) {
|
|
|
+ // 直接比较是字符串比较,需要先转换再比较 2017年9月7日 15:05:51
|
|
|
+ if (i > 0 && parseInt(r.lapQty) <= parseInt(item.replies[i - 1].lapQty) || r.lapQty == null) {
|
|
|
valid = false;
|
|
|
validLapQty = r.lapQty;
|
|
|
}
|
|
|
@@ -3668,37 +3669,52 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
$scope.loading = false;
|
|
|
} else {
|
|
|
- var file = item.myFiles, file = file && file.length > 0 ? file[0] : null;
|
|
|
- $upload.upload({
|
|
|
- url: 'sale/inquiry/addAttach',
|
|
|
- file: file,
|
|
|
- method: 'POST',
|
|
|
- data: {
|
|
|
- item: item
|
|
|
- }
|
|
|
- }).success(function (data) {
|
|
|
- if (data.item) {
|
|
|
- item = data.item;
|
|
|
- }
|
|
|
- });
|
|
|
if (withSteps) { // 保存并报价
|
|
|
PurcInquiry.reply({itemId: item.id, token: $scope.token}, item, function () {
|
|
|
- $scope.loading = false;
|
|
|
- toaster.pop('info', '提示', '报价成功');
|
|
|
- $timeout(function () {
|
|
|
+ var file = item.myFiles, file = file && file.length > 0 ? file[0] : null;
|
|
|
+ $upload.upload({
|
|
|
+ url: 'sale/inquiry/addAttach',
|
|
|
+ file: file,
|
|
|
+ method: 'POST',
|
|
|
+ data: {
|
|
|
+ item: item
|
|
|
+ }
|
|
|
+ }).success(function (data) {
|
|
|
+ if (data.item) {
|
|
|
+ item = data.item;
|
|
|
+ }
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('info', '提示', '报价成功');
|
|
|
$scope.tableParams.reload();
|
|
|
- }, 300);
|
|
|
+ }).error(function (data) {
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '附件上传失败');
|
|
|
+ });
|
|
|
}, function (response) {
|
|
|
$scope.loading = false;
|
|
|
toaster.pop('error', '询价失效', response.data);
|
|
|
});
|
|
|
} else { // 保存
|
|
|
PurcInquiry.saveItem({itemId: item.id, token: $scope.token}, item, function () {
|
|
|
- $scope.loading = false;
|
|
|
- toaster.pop('info', '提示', '保存成功');
|
|
|
- $timeout(function () {
|
|
|
+ var file = item.myFiles, file = file && file.length > 0 ? file[0] : null;
|
|
|
+ $upload.upload({
|
|
|
+ url: 'sale/inquiry/addAttach',
|
|
|
+ file: file,
|
|
|
+ method: 'POST',
|
|
|
+ data: {
|
|
|
+ item: item
|
|
|
+ }
|
|
|
+ }).success(function (data) {
|
|
|
+ if (data.item) {
|
|
|
+ item = data.item;
|
|
|
+ }
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('info', '提示', '保存成功');
|
|
|
$scope.tableParams.reload();
|
|
|
- }, 300);
|
|
|
+ }).error(function (data) {
|
|
|
+ $scope.loading = false;
|
|
|
+ toaster.pop('error', '附件上传失败');
|
|
|
+ });
|
|
|
}, function (response) {
|
|
|
$scope.loading = false;
|
|
|
toaster.pop('error', '保存失败', response.data);
|