|
|
@@ -8,6 +8,7 @@ define(['app/app'], function (app) {
|
|
|
$rootScope.active = 'vendor_seek_purchase';
|
|
|
$scope.storeType = 'seekPurchase';
|
|
|
$scope.seekPurchaseRate = {};
|
|
|
+ $scope.inquiryItem = {};
|
|
|
$scope.sayType = 'current'; // 报价类型,current为当前,replace为替代料
|
|
|
var _formatDate = function (date, fmt) {
|
|
|
if (!date) {
|
|
|
@@ -51,22 +52,23 @@ define(['app/app'], function (app) {
|
|
|
|
|
|
seekPurchase.getSeekUrl({}, function(data) {
|
|
|
var seekUrl = data.url;
|
|
|
- var initInquiryItem = function () {
|
|
|
- $scope.validSayPrice = {
|
|
|
- leadtime: false,
|
|
|
- taxrate: false,
|
|
|
- repliesPrice: false,
|
|
|
- repliesLapQty: false,
|
|
|
- replaceBrand: false,
|
|
|
- replaceCmpCode: false,
|
|
|
- replaceSpec: true
|
|
|
- };
|
|
|
- $scope.inquiryItem = {};
|
|
|
- }
|
|
|
- init();
|
|
|
- initInquiryItem();
|
|
|
+ var initInquiryItem = function () {
|
|
|
+ $scope.validSayPrice = {
|
|
|
+ leadtime: false,
|
|
|
+ taxrate: false,
|
|
|
+ repliesPrice: false,
|
|
|
+ repliesLapQty: false,
|
|
|
+ replaceBrand: false,
|
|
|
+ replaceCmpCode: false,
|
|
|
+ replaceSpec: true
|
|
|
+ };
|
|
|
+ $scope.inquiryItem = {};
|
|
|
+ }
|
|
|
+ init();
|
|
|
+ initInquiryItem();
|
|
|
|
|
|
$scope.setSayType = function (type) {
|
|
|
+ initInquiryItem();
|
|
|
if (type == 'current') {
|
|
|
delete $scope.inquiryItem.replaceBrand;
|
|
|
delete $scope.inquiryItem.replaceCmpCode;
|
|
|
@@ -74,6 +76,7 @@ define(['app/app'], function (app) {
|
|
|
// $scope.inquiryItem.isReplace = null;
|
|
|
}
|
|
|
$scope.inquiryItem.leadtime = '';
|
|
|
+ $scope.inquiryItem.taxrate = '';
|
|
|
for (var i = 0; i < $scope.seekCurrency.length; i++) {
|
|
|
$scope.seekCurrency[i] = 'RMB';
|
|
|
}
|
|
|
@@ -440,25 +443,27 @@ define(['app/app'], function (app) {
|
|
|
if (!$scope.inquiryItem.leadtime || $scope.inquiryItem.leadtime < 1 || $scope.inquiryItem.leadtime >= 1000 || $scope.inquiryItem.leadtime.toString().indexOf('.') !== -1) {
|
|
|
$scope.validSayPrice.leadtime = false;
|
|
|
toaster.pop('error', '交期请填写1-999之间的正整数');
|
|
|
+ $scope.inquiryItem.leadtime = '';
|
|
|
} else {
|
|
|
$scope.validSayPrice.leadtime = true;
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- $scope.onTaxrateInput = function () {
|
|
|
- var time = $scope.inquiryItem.taxrate.replace(/[^\-?\d.]/g, '');
|
|
|
- if (time.length > 2) {
|
|
|
- $scope.inquiryItem.taxrate = Number(time.substring(0, 2));
|
|
|
- }
|
|
|
+ $scope.onTaxrateInput = function () {
|
|
|
+ var time = $scope.inquiryItem.taxrate.replace(/[^\-?\d.]/g, '');
|
|
|
+ if (time.length > 2) {
|
|
|
+ $scope.inquiryItem.taxrate = Number(time.substring(0, 2));
|
|
|
}
|
|
|
- $scope.onTaxrateBlur = function () {
|
|
|
- if ($scope.inquiryItem.taxrate < 0 || $scope.inquiryItem.taxrate >= 100 || $scope.inquiryItem.taxrate.toString().indexOf('.') !== -1) {
|
|
|
- $scope.validSayPrice.taxrate = false;
|
|
|
- toaster.pop('error', '税率请填写0-99之间的正整数');
|
|
|
- } else {
|
|
|
- $scope.validSayPrice.taxrate = true;
|
|
|
- }
|
|
|
- };
|
|
|
+ }
|
|
|
+ $scope.onTaxrateBlur = function () {
|
|
|
+ if ($scope.inquiryItem.taxrate < 0 || $scope.inquiryItem.taxrate >= 100 || $scope.inquiryItem.taxrate.toString().indexOf('.') !== -1) {
|
|
|
+ $scope.validSayPrice.taxrate = false;
|
|
|
+ toaster.pop('error', '税率请填写0-99之间的正整数');
|
|
|
+ $scope.inquiryItem.taxrate = '';
|
|
|
+ } else {
|
|
|
+ $scope.validSayPrice.taxrate = true;
|
|
|
+ }
|
|
|
+ };
|
|
|
|
|
|
$scope.onReplaceBrandBlur = function () {
|
|
|
if (!$scope.inquiryItem.replaceBrand || $scope.inquiryItem.replaceBrand.length == 0) {
|