Browse Source

bom求购

liusw 8 years ago
parent
commit
39884bd3bb

+ 2 - 2
src/main/java/com/uas/platform/b2c/trade/seek/controller/SeekPurchaseController.java

@@ -8,13 +8,13 @@ import com.uas.platform.b2c.core.support.log.UsageBufferedLogger;
 import com.uas.platform.b2c.core.support.view.JxlsExcelView;
 import com.uas.platform.b2c.core.utils.FastjsonUtils;
 import com.uas.platform.b2c.prod.commodity.model.Goods;
-import com.uas.platform.b2c.trade.order.StringConstant.Currency;
 import com.uas.platform.b2c.trade.seek.model.SeekPurchase;
 import com.uas.platform.b2c.trade.seek.model.SeekPurchaseBom;
 import com.uas.platform.b2c.trade.seek.model.SeekPurchaseBomList;
 import com.uas.platform.b2c.trade.seek.model.SeekPurchaseByBatch;
 import com.uas.platform.b2c.trade.seek.model.SeekPurchaseGoods;
 import com.uas.platform.b2c.trade.seek.service.SeekPurchaseService;
+import com.uas.platform.b2c.trade.support.CodeType;
 import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.logging.BufferedLoggerManager;
@@ -161,7 +161,7 @@ public class SeekPurchaseController {
             } else if ("xlsx".equals(suffix)) {
                 workbook = new XSSFWorkbook(is);
             } else {
-                throw new IllegalOperatorException("文件格式不正确!请上传.xls或.xlsx格式的文件");
+                return new ResultMap(CodeType.PARAMETER_ERROR, "文件格式不正确!请上传.xls或.xlsx格式的文件");
             }
             User user = SystemSession.getUser();
             logger.log("求购", "导入新的bom求购,uu:" + user.getUserUU());

+ 23 - 0
src/main/java/com/uas/platform/b2c/trade/seek/model/SeekPurchaseByBatch.java

@@ -1,11 +1,14 @@
 package com.uas.platform.b2c.trade.seek.model;
 
 import java.util.Date;
+import java.util.List;
+import java.util.Map;
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
 import javax.persistence.Table;
+import javax.persistence.Transient;
 
 /**
  * Bom求购临时类
@@ -94,6 +97,18 @@ public class SeekPurchaseByBatch {
     @Column(name = "bom_id")
     private Long bomId;
 
+    /**
+     * code联想词
+     */
+    @Transient
+    private List<Map<String, Object>> codeWord;
+
+    /**
+     * brand联想词
+     */
+    @Transient
+    private List<Map<String, Object>> brandWord;
+
     public Long getId() {
         return id;
     }
@@ -189,4 +204,12 @@ public class SeekPurchaseByBatch {
     public void setBomId(Long bomId) {
         this.bomId = bomId;
     }
+
+    public void setCodeWord(List<Map<String, Object>> codeWord) {
+        this.codeWord = codeWord;
+    }
+
+    public void setBrandWord(List<Map<String, Object>> brandWord) {
+        this.brandWord = brandWord;
+    }
 }

+ 94 - 23
src/main/java/com/uas/platform/b2c/trade/seek/service/impl/SeekPurchaseServiceImpl.java

@@ -1,6 +1,7 @@
 package com.uas.platform.b2c.trade.seek.service.impl;
 
 import com.uas.platform.b2c.common.account.model.User;
+import com.uas.platform.b2c.common.search.service.SearcherService;
 import com.uas.platform.b2c.core.utils.StringUtilB2C;
 import com.uas.platform.b2c.prod.commodity.dao.GoodsDao;
 import com.uas.platform.b2c.prod.commodity.model.Goods;
@@ -30,7 +31,6 @@ import com.uas.platform.core.persistence.criteria.CriterionExpression.Operator;
 import com.uas.platform.core.persistence.criteria.LogicalExpression;
 import com.uas.platform.core.persistence.criteria.PredicateUtils;
 import com.uas.platform.core.persistence.criteria.SimpleExpression;
-import java.io.UnsupportedEncodingException;
 import java.math.BigDecimal;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
@@ -53,6 +53,7 @@ import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.convert.converter.Converter;
 import org.springframework.dao.DataAccessException;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Sort.Direction;
@@ -105,6 +106,11 @@ public class SeekPurchaseServiceImpl implements SeekPurchaseService {
     @Autowired
     private SeekPurchaseBomListDao seekPurchaseBomListDao;
 
+    @Autowired
+    private SearcherService searcherService;
+
+    private static Long deadlineTime = Long.valueOf(90 * 24 * 60 * 60 * 1000);
+
     @Override
     public Page<SeekPurchase> getSeekPageInfo(final PageInfo pageInfo, String keyWord) {
         // 关键字
@@ -213,6 +219,9 @@ public class SeekPurchaseServiceImpl implements SeekPurchaseService {
         SeekPurchase seekPurchase = seekPurchasedao.findOne(spId);
         seekPurchase.setStatus(Status.ACCEPTED.getValue());
         seekPurchase.setBoughtAmount(purchaseQuantity);
+        if (seekPurchase.getAmount() == null) {
+            seekPurchase.setAmount(Integer.valueOf(purchaseQuantity.intValue()));
+        }
         seekPurchase.setDeadline(new Date(System.currentTimeMillis()));
         seekPurchasedao.save(seekPurchase);
         // 修改报价表的状态
@@ -277,6 +286,7 @@ public class SeekPurchaseServiceImpl implements SeekPurchaseService {
         if (bomId != null) {
             pageInfo.filter("bomId", bomId);
         }
+
         pageInfo.sorting("releaseDate", Direction.DESC);
         Page<SeekPurchaseGoods> pageSeeks = seekPurchaseGoodsDao.findAll(new Specification<SeekPurchaseGoods>() {
             public Predicate toPredicate(Root<SeekPurchaseGoods> root, CriteriaQuery<?> query,
@@ -292,7 +302,7 @@ public class SeekPurchaseServiceImpl implements SeekPurchaseService {
     public SeekPurchase confirmSeekPurchase(Long spId, Double purchaseQuantity) {
         SeekPurchase seekPurchase = seekPurchasedao.findOne(spId);
         // 求购数量
-        Integer amount = seekPurchase.getAmount();
+        Integer amount = seekPurchase.getAmount() == null ? 0 : seekPurchase.getAmount();
         Double boughtAmount = seekPurchase.getBoughtAmount() + purchaseQuantity;
         if (boughtAmount >= amount) {
             seekPurchase.setDeadline(new Date(System.currentTimeMillis()));
@@ -306,9 +316,12 @@ public class SeekPurchaseServiceImpl implements SeekPurchaseService {
         // 获取第一个工作表
         Sheet sheet = workbook.getSheetAt(0);
         int colNum = sheet.getRow(0).getPhysicalNumberOfCells();
+        if (colNum != 8) {
+            return new ResultMap(CodeType.PARAMETER_ERROR, "表格模板不正确!请重新下载最新模板");
+        }
         int rowNum = sheet.getLastRowNum();
         if (rowNum > 500) {
-            throw new IllegalOperatorException("您上传的信息超过500条,请拆分成2000以再在上传");
+            return new ResultMap(CodeType.PARAMETER_ERROR, "您上传的信息超过500条,请拆分成2000以再在上传");
         }
         // 插入Bom求购中
         SeekPurchaseBom seekPurchaseBom = new SeekPurchaseBom();
@@ -318,20 +331,38 @@ public class SeekPurchaseServiceImpl implements SeekPurchaseService {
         seekPurchaseBom.setName(bomName);
         seekPurchaseBom.setStatus(0);
         seekPurchaseBom = seekPurchaseBomDao.save(seekPurchaseBom);
-        // 创造唯一标识
-        //String batch = createNumberService.getTimeNumber("product$goods", 8, rowNum);
         // 获取第一行的信息
         Row headerRow = sheet.getRow(0);
         int total = 0;
         int blankNum = 0;
         if (headerRow != null) {
             // 验证是否为商城模板
+            Object codeCellObj = readWorkBookCell(headerRow.getCell(0), Cell.CELL_TYPE_STRING,
+                    0, 0);
+            if (!"产品型号".equals(StringUtilB2C.getStr(codeCellObj))) {
+                return new ResultMap(CodeType.PARAMETER_ERROR, "您上传的信息列信息不正确,请与模板的列做比较");
+            }
+            Object brandCellObj = readWorkBookCell(headerRow.getCell(1), Cell.CELL_TYPE_STRING,
+                    0, 1);
+            if (!"品牌名称".equals(StringUtilB2C.getStr(brandCellObj))) {
+                return new ResultMap(CodeType.PARAMETER_ERROR, "您上传的信息列信息不正确,请与模板的列做比较");
+            }
+            Object deadlineCellObj = readWorkBookCell(headerRow.getCell(2), Cell.CELL_TYPE_STRING,
+                    0, 2);
+            if (!"截止时间".equals(StringUtilB2C.getStr(deadlineCellObj))) {
+                return new ResultMap(CodeType.PARAMETER_ERROR, "您上传的信息列信息不正确,请与模板的列做比较");
+            }
+            Object produceDateCellObj = readWorkBookCell(headerRow.getCell(7), Cell.CELL_TYPE_STRING,
+                    0, 7);
+            if (!"生产日期".equals(StringUtilB2C.getStr(produceDateCellObj))) {
+                return new ResultMap(CodeType.PARAMETER_ERROR, "您上传的信息列信息不正确,请与模板的列做比较");
+            }
             List<SeekPurchaseByBatch> seekPurchaseByBatchList = new ArrayList<>();
-            for (int r = 2; r <= rowNum; r++) {
+            for (int r = 3; r <= rowNum; r++) {
                 Row row = sheet.getRow(r);
                 if (row != null) {
                     SeekPurchaseByBatch seekPurchaseByBatch = new SeekPurchaseByBatch();
-                    blankNum = convertValueToSeekPurchase(row, seekPurchaseByBatch, r);
+                    blankNum = convertValueToSeekPurchaseByBatch(row, seekPurchaseByBatch, r);
                     seekPurchaseByBatch.setBomId(seekPurchaseBom.getId());
                     seekPurchaseByBatch.setReleaseDate(new Date(System.currentTimeMillis()));
 
@@ -343,7 +374,14 @@ public class SeekPurchaseServiceImpl implements SeekPurchaseService {
         return ResultMap.success(seekPurchaseBom.getId());
     }
 
-    private int convertValueToSeekPurchase(Row row, SeekPurchaseByBatch seekPurchaseByBatch, int rowNum) {
+    /**
+     * 将列信息注入到求购临时实体中
+     * @param row
+     * @param seekPurchaseByBatch
+     * @param rowNum
+     * @return
+     */
+    private int convertValueToSeekPurchaseByBatch(Row row, SeekPurchaseByBatch seekPurchaseByBatch, int rowNum) {
         // 统计为空的个数
         int result = 0;
         // 型号
@@ -372,46 +410,63 @@ public class SeekPurchaseServiceImpl implements SeekPurchaseService {
         } else {
             String deadline = StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(deadlineValue));
             try {
-                deadline = com.uas.platform.b2c.fa.payment.utils.StringUtils.cutOutString(deadline, 12);
-            } catch (UnsupportedEncodingException e) {
-                e.printStackTrace();
+                deadline = com.uas.platform.b2c.fa.payment.utils.StringUtils.cutOutString(deadline, 10);
+                seekPurchaseByBatch.setDeadline(addTime(new Date(deadline)));
+            } catch (Exception e) {
+                seekPurchaseByBatch.setDeadline(addTime(new Date(System.currentTimeMillis())));
             }
-            seekPurchaseByBatch.setDeadline(addTime(new Date(deadline)));
         }
 
         // 求购数量
         Object amountValue = readWorkBookCell(row.getCell(3), Cell.CELL_TYPE_STRING,
                 rowNum, 3);
         if (!StringUtils.isEmpty(amountValue)) {
-            Integer amount = Integer.valueOf(StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(amountValue)));
-            seekPurchaseByBatch.setAmount(amount);
+            try {
+                Integer amount = Integer.valueOf(StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(amountValue)));
+                seekPurchaseByBatch.setAmount(amount);
+            } catch (NumberFormatException e) {
+                seekPurchaseByBatch.setAmount(null);
+            }
         }
 
         // 币别
         Object currencyValue = readWorkBookCell(row.getCell(4), Cell.CELL_TYPE_STRING,
                 rowNum, 4);
         if (!StringUtils.isEmpty(currencyValue)) {
-            String currency = StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(currencyValue));
-            seekPurchaseByBatch.setCurrency(currency);
+            try {
+                String currency = StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(currencyValue));
+                seekPurchaseByBatch.setCurrency(currency);
+            } catch (Exception e) {
+                seekPurchaseByBatch.setCurrency("RMB");
+            }
         }
 
         // 单价
         Object unitPriceValue = readWorkBookCell(row.getCell(5), Cell.CELL_TYPE_STRING,
                 rowNum, 5);
         if (!StringUtils.isEmpty(unitPriceValue)) {
-            Double unitPrice = Double.valueOf(StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(unitPriceValue)));
-            seekPurchaseByBatch.setUnitPrice(unitPrice);
+            try {
+                Double unitPrice = Double.valueOf(StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(unitPriceValue)));
+                seekPurchaseByBatch.setUnitPrice(unitPrice);
+            } catch (NumberFormatException e) {
+                seekPurchaseByBatch.setUnitPrice(null);
+            }
         }
         // 如果填了单价又不选币种,导入的时候系统就默认人民币吧
         if (!StringUtils.isEmpty(unitPriceValue) && StringUtils.isEmpty(currencyValue)) {
             seekPurchaseByBatch.setCurrency("RMB");
         }
+
         // 封装
         Object encapsulationValue = readWorkBookCell(row.getCell(6), Cell.CELL_TYPE_STRING,
                 rowNum, 6);
         if (!StringUtils.isEmpty(encapsulationValue)) {
-            String encapsulation = StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(encapsulationValue));
-            seekPurchaseByBatch.setEncapsulation(encapsulation);
+            try {
+                String encapsulation = StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(encapsulationValue));
+                seekPurchaseByBatch.setEncapsulation(encapsulation);
+            } catch (Exception e) {
+                seekPurchaseByBatch.setEncapsulation(null);
+            }
         }
 
 
@@ -419,8 +474,12 @@ public class SeekPurchaseServiceImpl implements SeekPurchaseService {
         Object produceDateValue = readWorkBookCell(row.getCell(7), Cell.CELL_TYPE_STRING,
                 rowNum, 7);
         if (!StringUtils.isEmpty(produceDateValue)) {
-            String produceDate = StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(produceDateValue));
-            seekPurchaseByBatch.setProduceDate(produceDate);
+            try {
+                String produceDate = StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(produceDateValue));
+                seekPurchaseByBatch.setProduceDate(produceDate);
+            } catch (Exception e) {
+                seekPurchaseByBatch.setProduceDate(null);
+            }
         }
         return result;
     }
@@ -484,6 +543,14 @@ public class SeekPurchaseServiceImpl implements SeekPurchaseService {
                 return null;
             }
         }, pageInfo);
+        List<SeekPurchaseByBatch> seekPurchaseByBatchList = pageSeeks.getContent();
+        for (int i = 0;i < seekPurchaseByBatchList.size(); i++) {
+            if (!StringUtils.isEmpty(seekPurchaseByBatchList.get(i).getCode()) && !StringUtils.isEmpty(seekPurchaseByBatchList.get(i).getBrand())) {
+                seekPurchaseByBatchList.get(i).setCodeWord(searcherService.getSimilarComponents(seekPurchaseByBatchList.get(i).getCode()));
+                seekPurchaseByBatchList.get(i).setBrandWord(searcherService.getSimilarBrands(seekPurchaseByBatchList.get(i).getBrand()));
+            }
+        }
+        pageSeeks = (Page<SeekPurchaseByBatch>) seekPurchaseByBatchList;
         return pageSeeks;
     }
 
@@ -508,7 +575,11 @@ public class SeekPurchaseServiceImpl implements SeekPurchaseService {
             SeekPurchase seekPurchase = new SeekPurchase();
             if (!StringUtils.isEmpty(batch.getCode()) && !StringUtils.isEmpty(batch.getBrand()) && !StringUtils.isEmpty(batch.getDeadline())) {
                 //seekPurchase = (SeekPurchase) batch;
-                seekPurchase.setDeadline(batch.getDeadline());
+                if (batch.getDeadline().getTime() - System.currentTimeMillis() > deadlineTime) {
+                    seekPurchase.setDeadline(new Date(System.currentTimeMillis() + deadlineTime));
+                } else {
+                    seekPurchase.setDeadline(batch.getDeadline());
+                }
                 seekPurchase.setCurrency(batch.getCurrency());
                 seekPurchase.setReleaseDate(batch.getReleaseDate());
                 seekPurchase.setCode(batch.getCode());

+ 30 - 1
src/main/webapp/resources/js/usercenter/controllers/forstore/seek_purchase_ctrl.js

@@ -13,6 +13,7 @@ define(['app/app'], function (app) {
           document.title = '我的求购-优软商城';
           $scope.activeType = $stateParams.type ? $stateParams.type :'seekManage';
           $scope.toogleType = function (type) {
+            clearSeekStatus();
             $scope.activeType = type;
           }
           var enIdFilter = $filter('EncryptionFilter');
@@ -66,6 +67,9 @@ define(['app/app'], function (app) {
             $scope.validObj.unitPrice = ($scope.applyObj.unitPrice === '' || !$scope.applyObj.unitPrice ) ? true
                 : $scope.applyObj.unitPrice > 0 && $scope.applyObj.unitPrice
                 < 100000000;
+            if (!$scope.validObj.unitPrice) {
+              toaster.pop('error', '请输入正确的数值');
+            }
             return $scope.validObj.unitPrice;
           }
           $scope.onUnitPriceInput = function () {
@@ -83,6 +87,11 @@ define(['app/app'], function (app) {
               }
             }
           }
+          $scope.onAmountChange = function () {
+            if ($scope.applyObj.amount.length > 8 || !(/^[0-9]*$/).test($scope.applyObj.amount)) {
+              $scope.applyObj.amount = $scope.applyObj.amount.substring(0, $scope.applyObj.amount.length - 1)
+            }
+          }
           $scope.onEncapsulationChange = function () {
             if ($scope.applyObj.encapsulation && getRealLen($scope.applyObj.encapsulation) > 20) {
               $scope.applyObj.encapsulation = $scope.applyObj.encapsulation.substring(0, $scope.applyObj.encapsulation.length - 1)
@@ -197,6 +206,10 @@ define(['app/app'], function (app) {
                   ? $scope.startDate.getTime() : null;
               param.maxReleaseDate = $scope.endDate ? $scope.endDate.getTime()
                   : null;
+              if ($scope.isSearch) {
+                param.page = 1;
+                $scope.isSearch = false;
+              }
               seekPurchase.getUserSeekPageInfo(param, function (data) {
                 params.total(data.totalElements);
                 $defer.resolve(data.content);
@@ -209,12 +222,18 @@ define(['app/app'], function (app) {
 
           // 搜索
           $scope.onSearch = function (searchStatus) {
+            $scope.isSearch = true;
             if (searchStatus) {
               $scope.searchStatus = searchStatus;
             }
             $scope.seekPurchaseTableParams.reload();
           }
 
+          $scope.purchaseQuantityChange = function () {
+            if ($scope.purchaseQuantity.length > 8 || !(/^[0-9]*$/).test($scope.purchaseQuantity)) {
+              $scope.purchaseQuantity = $scope.purchaseQuantity.substring(0, $scope.purchaseQuantity.length - 1)
+            }
+          }
           // 采纳报价
           $scope.adopt = function () {
             if (!$scope.purchaseQuantity) {
@@ -607,8 +626,13 @@ define(['app/app'], function (app) {
               file: file,
               method: 'POST'
             }).success(function(data) {
-              window.open("applyPurchase/" + data.data);
+              if (data.success) {
+                window.open("applyPurchase/" + data.data);
+              } else {
+                toaster.pop('error', data.message);
+              }
             }).error(function(response) {
+              toaster.pop('error', response.data);
             });
           };
           $scope.bomSearch = {};
@@ -624,6 +648,10 @@ define(['app/app'], function (app) {
               param.maxReleaseDate = $scope.bomSearch.endDate ? $scope.bomSearch.endDate.getTime()
                   : null;
               param.name = $scope.bomSearch.name;
+              if ($scope.isSearch) {
+                param.page = 1;
+                $scope.isSearch = false;
+              }
               seekPurchase.getSeekPurchaseBomListPage(param, function (data) {
                 params.total(data.totalElements);
                 $scope.bomTotal = data.totalElements;
@@ -635,6 +663,7 @@ define(['app/app'], function (app) {
           });
           // 搜索
           $scope.onBomSearch = function () {
+            $scope.isSearch = true;
             $scope.bomTableParams.reload();
           }
 

+ 5 - 0
src/main/webapp/resources/js/vendor/controllers/forstore/purchase_offer_ctrl.js

@@ -25,6 +25,10 @@ define(['app/app'], function(app) {
                 param.keyWord = $scope.keyWord;
                 param.minReleaseDate = $scope.startDate ? $scope.startDate.getTime() : null;
                 param.maxReleaseDate = $scope.endDate ? $scope.endDate.getTime() : null;
+              if ($scope.isSearch) {
+                param.page = 1;
+                $scope.isSearch = false;
+              }
                 seekPurchase.getMyOfferPageInfo(param, function (data) {
                     params.total(data.totalElements);
                     $defer.resolve(data.content);
@@ -36,6 +40,7 @@ define(['app/app'], function(app) {
 
         // 搜索
         $scope.onSearch = function(){
+            $scope.isSearch = true;
             $scope.seekPurchaseTableParams.reload();
         }
 

+ 11 - 1
src/main/webapp/resources/js/vendor/controllers/forstore/seek_purchase_ctrl.js

@@ -24,6 +24,10 @@ define(['app/app'], function (app) {
                   ? $scope.startDate.getTime() : null;
               param.maxReleaseDate = $scope.endDate ? $scope.endDate.getTime()
                   : null;
+              if ($scope.isSearch) {
+                param.page = 1;
+                $scope.isSearch = false;
+              }
               seekPurchase.getSeekPushGoodsPageInfo(param, function (data) {
                 params.total(data.totalElements);
                 $defer.resolve(data.content);
@@ -36,6 +40,7 @@ define(['app/app'], function (app) {
 
           // 搜索
           $scope.onSearch = function () {
+            $scope.isSearch = true;
             $scope.seekPurchaseTableParams.reload();
           }
 
@@ -131,7 +136,7 @@ define(['app/app'], function (app) {
 
           $scope.onProduceDateChange = function () {
             if ($scope.offer.produceDate && getRealLen($scope.offer.produceDate) > 12) {
-              $scope.offer.produceDate = $scope.offer.produceDate.substring(0, 6);
+              $scope.offer.produceDate = $scope.offer.produceDate.substring(0, $scope.applyObj.produceDate.length - 1);
             }
           }
 
@@ -140,14 +145,19 @@ define(['app/app'], function (app) {
           }
 
           // 保存报价
+          $scope.saveOfferBtn = false;
           $scope.saveOffer = function (seek) {
             if ($scope.checkAllOffer()) {
+              $scope.saveOfferBtn = true;
+              return;
               seekPurchase.saveOffer($scope.offer, function (data) {
                 if (data.success) {
                   $scope.setSeekActive(seek, false);
                   $scope.seekPurchaseTableParams.reload();
+                  $scope.saveOfferBtn = true;
                   toaster.pop('success', '报价成功');
                 } else {
+                  $scope.saveOfferBtn = true;
                   toaster.pop('error', data.message);
                 }
               }, function (res) {

+ 4 - 4
src/main/webapp/resources/view/usercenter/forstore/seekPurchase.html

@@ -594,7 +594,7 @@
                 </div>
                 <div class="form-block">
                     <span>采购数量</span>
-                    <input type="number" class="form-group" ng-class="{'error': !validObj.amount}" ng-model="applyObj.amount" ng-blur="checkAmount()" >
+                    <input type="text" ng-change="onAmountChange()" class="form-group" ng-class="{'error': !validObj.amount}" ng-model="applyObj.amount" ng-blur="checkAmount()" >
                 </div>
                 <div class="form-block single-price">
                     <span>单价预算</span>
@@ -602,7 +602,7 @@
                         <option value="RMB">¥</option>
                         <option value="USD">$</option>
                     </select>
-                    <input type="number" class="form-group" ng-class="{'error': !validObj.unitPrice}" ng-model="applyObj.unitPrice" ng-blur="checkUnitPrice()" ng-change="onUnitPriceInput()" >
+                    <input type="number" class="form-group" ng-class="{'error': !validObj.unitPrice}" ng-model="applyObj.unitPrice" ng-blur="checkUnitPrice()"  ng-change="onUnitPriceInput()" >
                 </div>
                 <div class="form-block">
                     <span>封装</span>
@@ -695,7 +695,7 @@
                 <td ng-bind="seek.brand || '-'" title="{{seek.brand}}"></td>
                 <td ng-bind="seek.amount || '-'"></td>
                 <td>
-                    <span>{{seek.currency + seek.unitPrice | currencyStr}}</span>
+                    <span title="{{seek.currency + seek.unitPrice | currencyStr}}">{{seek.currency + seek.unitPrice | currencyStr}}</span>
                 </td>
                 <td ng-bind="seek.encapsulation || '-'" title="{{seek.encapsulation}}">盘装</td>
                 <td ng-bind="seek.produceDate || '-'" title="{{seek.produceDate}}">2012-12-12</td>
@@ -887,7 +887,7 @@
         <div class="content">
             <p><i class="fa fa-exclamation-circle"></i>是否要采纳此报价?</p>
             <div class="remind-line"><i class="red-text">*</i>点击【确认】后默认终止该求购</div>
-            <div class="input-line"><i class="red-text">*</i>采购数量&nbsp;<input type="number" placeholder="请输入采购数量" class="form-control" ng-model="purchaseQuantity"></div>
+            <div class="input-line"><i class="red-text">*</i>采购数量&nbsp;<input  ng-change="purchaseQuantityChange()" type="text" placeholder="请输入采购数量" class="form-control" ng-model="purchaseQuantity"></div>
             <div class="btn-line">
                 <a ng-click="setShowUseFlag(false)">取消</a>
                 <a ng-click="adopt()">确认</a>

+ 1 - 1
src/main/webapp/resources/view/vendor/forstore/seekPurchase.html

@@ -499,7 +499,7 @@
                             </div>
                             <div>
                                 <span ng-click="setSeekActive(seek, false)">取消</span>
-                                <span ng-click="saveOffer(seek)">提交</span>
+                                <span ng-disabled="saveOfferBtn" ng-click="saveOffer(seek)">提交</span>
                             </div>
                         </div>
                     </td>