Browse Source

Merge remote-tracking branch 'origin/release-201827-wangcz' into release-201827-wangcz

shenjj 7 years ago
parent
commit
17a5e864db

+ 36 - 0
src/main/java/com/uas/platform/b2c/common/lottery/controller/LotteryController.java

@@ -0,0 +1,36 @@
+package com.uas.platform.b2c.common.lottery.controller;
+
+import com.uas.platform.b2c.common.lottery.service.UserInfoService;
+import com.uas.platform.b2c.trade.support.ResultMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 推广抽奖活动接口
+ * Created by wangyc on 2018/9/12.
+ *
+ * @version 2018/9/12 10:25 wangyc
+ */
+@RestController
+@RequestMapping(value = "/lottery")
+public class LotteryController {
+
+    private final UserInfoService userInfoService;
+
+    @Autowired
+    public LotteryController(UserInfoService userInfoService) {
+        this.userInfoService = userInfoService;
+    }
+
+    /**
+     * 获取单个用户信息
+     * @param activityCode 活动编号
+     * @return
+     */
+    @RequestMapping(value = "/userInfo", method = RequestMethod.GET, produces = "application/json")
+    public ResultMap findUserInfo(String activityCode) {
+        return userInfoService.findUserInfo(activityCode);
+    }
+}

+ 19 - 0
src/main/java/com/uas/platform/b2c/common/lottery/service/UserInfoService.java

@@ -0,0 +1,19 @@
+package com.uas.platform.b2c.common.lottery.service;
+
+import com.uas.platform.b2c.trade.support.ResultMap;
+
+/**
+ * Created by wangyc on 2018/9/12.
+ *
+ * @version 2018/9/12 10:28 wangyc
+ */
+public interface UserInfoService {
+
+    /**
+     * 获取单个用户信息
+     * @param activityCode 活动编号
+     * @return
+     */
+    ResultMap findUserInfo(String activityCode);
+
+}

+ 53 - 0
src/main/java/com/uas/platform/b2c/common/lottery/service/impl/UserInfoServiceImpl.java

@@ -0,0 +1,53 @@
+package com.uas.platform.b2c.common.lottery.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.uas.platform.b2c.common.lottery.service.UserInfoService;
+import com.uas.platform.b2c.core.config.SysConf;
+import com.uas.platform.b2c.core.support.SystemSession;
+import com.uas.platform.b2c.trade.support.CodeType;
+import com.uas.platform.b2c.trade.support.ResultMap;
+import com.uas.platform.core.util.HttpUtil;
+import com.uas.platform.core.util.HttpUtil.Response;
+import java.util.HashMap;
+import java.util.Map;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+/**
+ * Created by wangyc on 2018/9/12.
+ *
+ * @version 2018/9/12 10:30 wangyc
+ */
+@Service
+public class UserInfoServiceImpl implements UserInfoService {
+
+    // 获取单个用户信息路径
+    private static final String GET_USER_URL = "/users/user";
+
+    private final SysConf sysConf;
+
+    @Autowired
+    public UserInfoServiceImpl(SysConf sysConf) {
+        this.sysConf = sysConf;
+    }
+
+    @Override
+    public ResultMap findUserInfo(String activityCode) {
+        if (StringUtils.isEmpty(activityCode)) {
+            return new ResultMap(CodeType.PARAMETER_ERROR, "活动信息不完全,请确认活动信息");
+        }
+
+        Map<String, Object> params = new HashMap<>();
+        params.put("useruu", SystemSession.getUser().getUserUU());
+        params.put("enuu", SystemSession.getUser().getEnterprise() == null ? 0 : SystemSession.getUser().getEnterprise().getUu());
+        params.put("activityCode", activityCode);
+
+        try {
+            Response response = HttpUtil.sendGetRequest(sysConf.getLottery() + GET_USER_URL, params);
+            return JSON.parseObject(response.getResponseText(), ResultMap.class);
+        } catch (Exception e) {
+            return new ResultMap(CodeType.ERROR_STATE, "获取用户信息错误,请重试");
+        }
+    }
+}

+ 14 - 0
src/main/java/com/uas/platform/b2c/core/config/SysConf.java

@@ -175,6 +175,12 @@ public class SysConf {
 	@Value(("#{sys.profile}"))
 	private String profile;
 
+	/**
+	 * 推广抽奖活动地址
+	 */
+	@Value(("#{sys.lottery}"))
+	private String lottery;
+
 	/**
 	 * 物料id
 	 */
@@ -394,6 +400,14 @@ public class SysConf {
 		return this;
 	}
 
+	public String getLottery() {
+		return lottery;
+	}
+
+	public void setLottery(String lottery) {
+		this.lottery = lottery;
+	}
+
 	public String getProductServiceIp() {
 		return productServiceIp;
 	}

+ 3 - 0
src/main/resources/dev/sys.properties

@@ -55,3 +55,6 @@ messageServiceUrl=http://192.168.253.12:24000/message/
 #b2b
 b2b=http://218.17.158.219/b2b_test
 b2bDomain=218.17.158.219:9000/b2b_test
+
+#lottery
+lottery=http://10.1.51.79:20000

+ 4 - 1
src/main/resources/prod/sys.properties

@@ -57,4 +57,7 @@ messageServiceUrl=http://api-message.ubtob.com/
 #b2b
 b2b=http://uas.ubtob.com
 b2bDomain=uas.ubtob.com
-b2bInner=http://10.10.100.103:8080
+b2bInner=http://10.10.100.103:8080
+
+#lottery
+lottery=http://10.1.51.79:20000

+ 4 - 1
src/main/resources/test/sys.properties

@@ -55,4 +55,7 @@ messageServiceUrl=http://192.168.253.12:24000/message/
 
 #b2b
 b2b=http://218.17.158.219/b2b_test
-b2bDomain=218.17.158.219:9000/b2b_test
+b2bDomain=218.17.158.219:9000/b2b_test
+
+#lottery
+lottery=http://10.1.51.79:20000

+ 5 - 0
src/main/webapp/resources/js/common/query/seekPurchase.js

@@ -110,6 +110,11 @@ define([ 'ngResource' ], function() {
             deleteBom: {
                 url: 'seek/bom/delete',
                 method: 'DELETE'
+            },
+            // 新增物料信息
+            addEaterialObj: {
+                url: 'seek/bom/detail/add',
+                method: 'POST'
             }
 		});
 }])

+ 62 - 10
src/main/webapp/resources/js/usercenter/controllers/forstore/bomListDetailCtrl.js

@@ -49,6 +49,9 @@ define(['app/app'], function(app) {
         $scope.editBom = false;
         // 是否编辑询价
         $scope.editSeek = false;
+        // 是否新增物料
+        $scope.addNew = false;
+        $scope.newMateriel = [];
         // bom数据
         $scope.bomData = {};
         // 求购参数
@@ -124,7 +127,7 @@ define(['app/app'], function(app) {
                     }, function (err) {
                         toaster.pop('error', err.data);
                     })
-                } else {
+                } else if($scope.editSeek){
                     if (!$scope.seekObj.count) {
                         toaster.pop('error', '请输入采购数量');
                     } else if (!$scope.seekObj.endTime) {
@@ -168,14 +171,40 @@ define(['app/app'], function(app) {
                             })
                         }
                     }
+                } else {
+                    // 批量验证
+                    for (var i = 0; i < $scope.newMateriel.length; i++) {
+                        if (!$scope.checkAllProduct($scope.newMateriel[i])) {
+                            return;
+                        }
+                    }
+                    angular.forEach($scope.newMateriel, function(val){
+                        val.bomId = $scope.bomData.id
+                    })
+                    seekPurchase.addEaterialObj(null, $scope.newMateriel, function (data) {
+                        if (data.success) {
+                            toaster.pop('success', '新增物料成功');
+                            $scope.addNewMateriel(false);
+                            loadData();
+                            $scope.newMateriel = []
+                        } else {
+                            toaster.pop('error', data.message);
+                        }
+                    }, function (err) {
+                        toaster.pop('error', err.data);
+                    })
                 }
             } else {
                 if ($scope.editBom) {
                     // 取消BOM编辑
                     $scope.setEditBom(false);
-                } else {
+                } else if($scope.editSeek){
                     // 取消发布求购
                     $scope.setEditSeek(false);
+                } else {
+                    // 取消新增物料
+                    $scope.addNewMateriel(false);
+                    $scope.newMateriel = [];
                 }
             }
         }
@@ -186,6 +215,10 @@ define(['app/app'], function(app) {
                 toaster.pop('info', '请先保存求购信息');
                 return;
             }
+            if (editBom && $scope.addNew) {
+                toaster.pop('info', '请先保存新增物料');
+                return;
+            }
             // 编辑中临时数据
             $scope.tmpEditBom = angular.copy($scope.bomData);
             // 最少选中一个
@@ -209,6 +242,10 @@ define(['app/app'], function(app) {
                 toaster.pop('info', '请先保存BOM修改');
                 return;
             }
+            if (editSeek && $scope.addNew) {
+                toaster.pop('info', '请先保存新增物料');
+                return;
+            }
             if ($scope.editSeek) {
                 $scope.seekObj.endTime = '';
                 $scope.seekObj.count = '';
@@ -218,7 +255,29 @@ define(['app/app'], function(app) {
                 $scope.setAllCheck(false);
             }
             $scope.editSeek = editSeek;
-        }
+        };
+
+        // 新增单条物料信息
+        $scope.addNewMateriel = function (addNew) {
+            if (addNew && $scope.editSeek) {
+                toaster.pop('info', '请先保存求购信息');
+                return;
+            }
+            if (addNew && $scope.editBom) {
+                toaster.pop('info', '请先保存BOM修改');
+                return;
+            }
+            $scope.newMateriel.push({
+                brand: '',
+                kind: '',
+                code: '',
+                spec: '',
+                amount: 0
+            });
+            $scope.setAllCheck(false);
+            $scope.addNew = addNew;
+        };
+
         // 打开日期选择框
         $scope.openDatePicker = function ($event) {
             $event.preventDefault();
@@ -279,13 +338,6 @@ define(['app/app'], function(app) {
             })
         };
 
-        // 新增单条物料信息
-        $scope.addNewBom = function () {
-            $scope.bomData.seekPurchaseByBatchs.unshift({});
-            $scope.setEditBom(true);
-            $scope.onCheckAllCheck();
-        };
-
         // 删除BOM提示框
         $scope.showDeleteBomBox = false;
         $scope.setShowDeleteBomBox = function (flag) {

+ 125 - 31
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_storageCtrl.js

@@ -1,6 +1,6 @@
 define([ 'app/app' ], function(app) {
     'use strict';
-    app.register.controller('vendor_storageCtrl', ['$scope', '$rootScope', '$stateParams', 'BaseService', 'Goods', 'KdnLogistics', '$modal', 'toaster', 'Loading', 'AuthenticationService', '$q', '$upload', '$http', 'ngTableParams', 'InvoiceFPurchase', 'ShippingAddress', function ($scope, $rootScope, $stateParams, BaseService, Goods, KdnLogistics, $modal, toaster, Loading, AuthenticationService, $q, $upload, $http, ngTableParams, InvoiceFPurchase, ShippingAddress) {
+    app.register.controller('vendor_storageCtrl', ['$scope', '$rootScope', '$stateParams', 'BaseService', 'Goods', 'KdnLogistics', '$modal', 'toaster', 'Loading', 'AuthenticationService', '$q', '$upload', '$http', 'ngTableParams', 'InvoiceFPurchase', 'ShippingAddress', 'Enterprise', function ($scope, $rootScope, $stateParams, BaseService, Goods, KdnLogistics, $modal, toaster, Loading, AuthenticationService, $q, $upload, $http, ngTableParams, InvoiceFPurchase, ShippingAddress, Enterprise) {
         $rootScope.active = 'vendor_storage';
         $scope.keyword = '';
         $scope.type = '';
@@ -9,11 +9,7 @@ define([ 'app/app' ], function(app) {
         document.title = '卖家出入库-优软商城';
         $scope.storage_tab = $stateParams.storage_tab? $stateParams.storage_tab : 'inBound';
         $scope.countData = 10;
-        $scope.userInfo = $rootScope.userInfo || {}
-        console.log($stateParams)
-
-        //数字的正则表达式
-        var intPattern = /^[1-9]+$/;
+        $scope.userInfo = $rootScope.userInfo || {};
 
         // 更多操作数据和记录
         $scope.handleLink = [
@@ -24,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 = {
@@ -67,6 +62,27 @@ define([ 'app/app' ], function(app) {
             return new Date(_formatDate(date, 'yyyy-MM-dd')).getTime() - 8 * 60 * 60 * 1000
         };
 
+        var getRealLen = function (str) {
+            var len = 0;
+            for (var i = 0; i < str.length; i++) {
+                if (str.charCodeAt(i) > 127 || str.charCodeAt(i) === 94) {
+                    len += 2;
+                } else {
+                    len++;
+                }
+            }
+            return len;
+        }
+        var cutOutString = function (str, length) {
+            for (var i = 1; i <= str.length; i++) {
+                if (getRealLen(str.substr(0, i)) > length){
+                    str = str.substr(0, i-1);
+                    break;
+                }
+            }
+            return str;
+        };
+
         // 清空数据初始化数据
         var clearRecordParams = function () {
             $scope.dateArea = 'oneMonth'
@@ -80,6 +96,18 @@ define([ 'app/app' ], function(app) {
         };
         clearRecordParams();
 
+        //获取币别信息
+        Enterprise.getCurrencyByRegisterAddress(null, function (data) {
+            if(data.code === 1) {
+                $scope.currency = data.data;
+            }else {
+                toaster.pop('info', '提示', '您公司的注册地址为空,无法确定币别,系统默认为人民币');
+                $scope.currency = 'RMB';
+            }
+        }, function (response) {
+            toaster.pop('info', '提示', '获取不到公司的币别信息');
+        });
+
         // 其它出入库默认数据
         $scope.othenParam = {
             enName: '',
@@ -109,6 +137,7 @@ define([ 'app/app' ], function(app) {
             $scope.storage_tab = type;
             $scope.type = $scope.storage_tab === 'inBound'? 'INBOUND' : 'OUTBOUND';
             getLoadStorageData();
+            initOtherData();
         };
 
         // 操作类型切换
@@ -117,6 +146,7 @@ define([ 'app/app' ], function(app) {
             if(type !== 1) {
                 getLoadStorageData();
             }
+            initOtherData();
             clearRecordParams();
         };
         // 销售方式筛选
@@ -211,7 +241,6 @@ define([ 'app/app' ], function(app) {
                 total: 0,
                 getData: function ($defer, params) {
                     var param = BaseService.parseParams(params.url())
-                    console.log($scope.keyword, 'keyword')
                     if($scope.keyword){
                         param.keyword = $scope.keyword
                     }
@@ -249,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;
@@ -271,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) {
@@ -292,17 +355,22 @@ define([ 'app/app' ], function(app) {
                 return false
             }
             $scope.othenParam.detail = [];
-            console.log($scope.otherData)
-            if(!$scope.othenParam.enName) {
-                toaster.pop('error', '请填写' + ($scope.storage_tab === 'inBound' ? '卖家名称' : '买家名称'));
-                return false
-            }
+            var flag = false;
             angular.forEach($scope.otherData, function(val) {
                 if(val.id) {
-                    $scope.othenParam.detail.push({productId: val.id, qty: 323, price: 4234})
+                    if(val.qty && val.price) {
+                        $scope.othenParam.detail.push({productId: val.id, qty: Number(val.qty), price: Number(val.price)});
+                        flag = true;
+                    }else {
+                        flag = false;
+                    }
                 }
             })
-            Goods.saveOtherProductData({storage_tab: $scope.storage_tab, enName: $scope.othenParam.enName}, $scope.othenParam.detail, function(data) {
+            if(!flag) {
+                toaster.pop('info', '提示', '请正确填写下面的信息内容!');
+                return;
+            }
+            Goods.saveOtherProductData({storage_tab: $scope.storage_tab, enName: $scope.othenParam.enName ? $scope.othenParam.enName : null}, $scope.othenParam.detail, function(data) {
                 if(data.code === 1) {
                     toaster.pop('success', '申请成功!');
                     initOtherData();
@@ -452,7 +520,46 @@ define([ 'app/app' ], function(app) {
         };
 
         //数量进行验证
-        $scope.ChangeSendCount = function(details, val) {
+        $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);
+                }
+            }
+        };
+
+        $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) {
                 toaster.pop('warning', '提示', '本次发货数量不能大于已剩数量')
@@ -513,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);
                 }
@@ -552,18 +659,6 @@ define([ 'app/app' ], function(app) {
                 toaster.pop('info', '获取定单的信息' + response);
             });
         };
-
-          var getRealLen = function(str) {
-            var len = 0;
-            for (var i = 0; i < str.length; i++) {
-              if (str.charCodeAt(i) > 127 || str.charCodeAt(i) === 94) {
-                len += 2;
-              } else {
-                len++;
-              }
-            }
-            return len;
-          }
     }]);
 
     // 设置物流公司
@@ -687,7 +782,6 @@ define([ 'app/app' ], function(app) {
 
         $scope.onKeyDown = function () {
             var dom = document.getElementById("ulContent");
-            // console.log(dom.scrollTop);
             if ($scope.showDownFrame && $scope.matchData){
                 if(event.keyCode == 40) { //监听到按下键
                     $scope.selectIndex ++;

+ 84 - 2
src/main/webapp/resources/view/usercenter/forstore/bomListDetail.html

@@ -202,6 +202,9 @@
         padding: 0 10px;
         text-align: center;
     }
+    .com-check-box{
+        cursor:pointer;
+    }
 </style>
 <div class="user_right fr bom-list-detail">
     <a class="back" href="user#/seekPurchase?type=bomManage&bomTab=bomList">&lt;返回BOM列表</a>
@@ -211,8 +214,8 @@
         <button class="operate-btn" ng-click="setEditBom(true)">编辑BOM</button>
         <button class="operate-btn" ng-click="deleteProduct()">删除物料</button>
         <button class="operate-btn" ng-click="deleteBom()">删除本BOM</button>
-        <button class="operate-btn" ng-click="addNewBom()">新增物料</button>
-        <div class="fr" ng-show="editBom || editSeek">
+        <button class="operate-btn" ng-click="addNewMateriel(true)">新增物料</button>
+        <div class="fr" ng-show="editBom || editSeek || addNew">
             <button class="sure-btn" ng-click="sure(true)">确认</button>
             <button class="sure-btn cancel-btn" ng-click="sure(false)">取消</button>
         </div>
@@ -266,6 +269,85 @@
             </tr>
         </thead>
         <tbody>
+            <tr ng-if="addNew" ng-repeat="(key, item) in newMateriel">
+                <td>
+                    <label class="com-check-box" ng-click="newMateriel.splice(key, 1);" ng-if="key !== 0">
+                        <span class="fa fa-close"></span>
+                    </label>
+                </td>
+                <td class="base-info">
+                    <div class="content-line">
+                        <div class="inline-block title">
+                            <i class="must">*</i>品牌:
+                        </div>
+                        <div class="inline-block" ng-class="{'similar-wrap': item.showSimilarBrandList}" title="{{item.brand}}">
+                            <input ng-model="item.brand"
+                                   ng-change="onBrandChange(item)"
+                                   ng-blur="checkBrand(item)"
+                                   type="text">
+                            <ul class="similar-list"
+                                ng-show="item.showSimilarBrandList"
+                                ng-mouseenter="item.isInBrandList = true;"
+                                ng-mouseleave="item.isInBrandList = false">
+                                <li ng-repeat="sBrand in similarBrand" ng-bind="sBrand.nameEn" title="{{sBrand.nameEn}}" ng-click="setBrand(item, sBrand.nameEn)"></li>
+                            </ul>
+                        </div>
+                    </div>
+                    <div class="content-line">
+                        <div class="inline-block title">
+                            <i class="must">*</i>物料名称:
+                        </div>
+                        <div class="inline-block" title="{{item.kind}}">
+                            <input ng-model="item.kind"
+                                   ng-change="onKindChange(item)"
+                                   ng-blur="checkKind(item)"
+                                   type="text">
+                        </div>
+                    </div>
+                </td>
+                <td class="base-info">
+                    <div class="content-line">
+                        <div class="inline-block title">
+                            <i class="must">*</i>型号:
+                        </div>
+                        <div class="inline-block" ng-class="{'similar-wrap': item.showSimilarCodeList}" title="{{item.code}}">
+                            <input ng-model="item.code"
+                                   ng-change="onCodeChange(item)"
+                                   ng-blur="checkCode(item)"
+                                   type="text">
+                            <ul class="similar-list"
+                                ng-show="item.showSimilarCodeList"
+                                ng-mouseenter="item.isInCodeList = true;"
+                                ng-mouseleave="item.isInCodeList = false">
+                                <li ng-repeat="sCode in similarCode" ng-bind="sCode.code" title="{{sCode.code}}" ng-click="setCode(item, sCode.code)"></li>
+                            </ul>
+                        </div>
+                    </div>
+                    <div class="content-line">
+                        <div class="inline-block title">
+                            规格:
+                        </div>
+                        <div class="inline-block" title="{{item.spec}}">
+                            <input ng-model="item.spec"
+                                   ng-change="onSpecChange(item)"
+                                   ng-blur="checkSpec(item)"
+                                   type="text">
+                        </div>
+                    </div>
+                </td>
+                <td class="base-info pcs-line">
+                    <div class="content-line">
+                        <div class="inline-block title">
+                            单位用量:
+                        </div>
+                        <div class="inline-block" title="{{item.amount}}">
+                            <input ng-model="item.amount"
+                                   ng-change="onAmountChange(item)"
+                                   type="text">
+                        </div>
+                    </div>
+                </td>
+            </tr>
             <tr ng-repeat="detail in bomData.seekPurchaseByBatchs track by $index">
                 <td>
                     <label class="com-check-box">

+ 36 - 35
src/main/webapp/resources/view/vendor/forstore/vendor_storage.html

@@ -937,7 +937,7 @@
         white-space: nowrap;
     }
     .wanted_list .wanted-tab tbody>tr>td{
-        padding:0;
+        padding:0 5px;
         line-height: 50px;
         height:50px;
         vertical-align: middle;
@@ -1138,8 +1138,11 @@
         -webkit-border-radius: 5px !important;
         border-radius: 5px !important;
     }
+    .wanted_list em.red_color{
+        color:#f00;
+    }
 </style>
-<div class="user_right fr" ng-click="">
+<div class="user_right fr" ng-click="clearOtherData()">
     <!--货品管理-->
     <div class="pro_management device">
         <div class="com_tab">
@@ -1184,20 +1187,6 @@
                     <label for="autoMonth"></label>
                     自定义
                 </label>
-                <div class="search fr check">
-                    <input type="text" class="form-control" ng-model="keyword" ng-search="onSearch(keyword)" placeholder="{{storage_tab =='outBound' ? '订单号/买家名称' : '发货单/卖家名称'}}"/>
-                    <button ng-click="onSearch(keyword)" style="float: left;">搜索</button>
-                </div>
-            </div>
-            <div class="radio-block">
-                更多操作:
-                <ul class="radio-btn list-inline">
-                    <li ng-repeat="item in handleLink"
-                        ng-bind="item.name"
-                        ng-class="{'active': handleItem === item.id}"
-                        ng-if="item.tab === storage_tab"
-                        ng-click="toggleType(item.id)"></li>
-                </ul>
                 <div class="radio-date" ng-show="dateArea === 'autoMonth'">
                     <div class="data-input">
                         <input id="start" type="text" ng-model="startDate" readonly="readonly"
@@ -1225,6 +1214,20 @@
                     </div>
                 </div>
             </div>
+            <div class="radio-block">
+                更多操作:
+                <ul class="radio-btn list-inline">
+                    <li ng-repeat="item in handleLink"
+                        ng-bind="item.name"
+                        ng-class="{'active': handleItem === item.id}"
+                        ng-if="item.tab === storage_tab"
+                        ng-click="toggleType(item.id)"></li>
+                </ul>
+                <div class="search fr check" ng-if="handleItem !== 1">
+                    <input type="text" class="form-control" ng-model="keyword" ng-search="onSearch(keyword)" placeholder="{{storage_tab =='outBound' ? '订单号/买家名称' : ( handleItem === 0 ? '入库订单/卖家名称':'发货单/卖家名称')}}"/>
+                    <button ng-click="onSearch(keyword)" style="float: left;">搜索</button>
+                </div>
+            </div>
         </div>
 
         <div class="wanted_list">
@@ -1234,7 +1237,7 @@
                     <th width="120" ng-bind="storage_tab === 'inBound' ? '入库单号' : '出库单号'"></th>
                     <th width="180" ng-bind="storage_tab === 'inBound' ? '发货单' : '订单号'" ng-if="handleItem === 2"></th>
                     <th width="180" ng-bind="storage_tab === 'inBound' ? '卖家名称' : '买家名称'"></th>
-                    <th class="filter" width="110" ng-if="handleItem !== 0">类型</th>
+                    <th class="filter" width="110" ng-if="handleItem == 2">类型</th>
                     <th class="filter" width="110" ng-if="handleItem === 0">
                         <a ng-bind="selfSupport">全部类型</a> <i class="fa fa-angle-down fa-angle-up"></i>
                         <div class="hover-show" ng-if="storage_tab === 'inBound'">
@@ -1261,7 +1264,7 @@
                     <td ng-bind="item.affiliatedEnterprise || '-'">深圳有陵县什么 翁一搂的</td>
                     <td ng-bind="boundType[item.opertatorType]">腌肉入库</td>
                     <td ng-bind="item.operaterUserName">张三</td>
-                    <td ng-bind="item.createTime | date : 'yyyy-MM-dd: hh:mm:ss'">2018-12-12 12:!@:</td>
+                    <td ng-bind="item.createTime | date : 'yyyy-MM-dd: HH:mm:ss'">2018-12-12</td>
                     <td><span class="btn-toggle" ng-show="item.seleted" ng-click="item.seleted = !item.seleted">收起 <i class="fa fa-angle-up"></i></span><span ng-click="unfoldClick(storageList,item)" class="btn-toggle" ng-show="!item.seleted">展开 <i class="fa fa-angle-down"></i></span></td>
                 </tr>
                 <tr ng-show="item.seleted">
@@ -1280,7 +1283,7 @@
                                     <th>物料名称</th>
                                     <th width="210">规格</th>
                                     <th width="130">{{storage_tab === 'inBound' ? '入库数' : '出库数'}}(PCS)</th>
-                                    <th width="130">单价(¥)</th>
+                                    <th width="130">单价({{currency === 'RMB' ? '¥' : '$'}})</th>
                                 </tr>
                                 </thead>
                             </table>
@@ -1307,13 +1310,12 @@
                 <tr style="background:#f5f5f5;">
                     <td>系统自动生成</td>
                     <td><input type="text" class="form-control" ng-model="othenParam.enName"></td>
-                    <td ng-bind="storage_tab === 'inBound' ? '其它入库' : '其它出库'">其它入库</td>
                     <td ng-bind="userInfo.userName">张三</td>
                     <td ng-bind="newDate">2018-12-12</td>
                     <td><a class="btn-click" ng-click="otherAddClick()">确认</a><a class="btn-click" ng-click="otherAddClick('clear')">取消</a></td>
                 </tr>
                 <tr>
-                    <td colspan="6">
+                    <td colspan="5">
                         <table class="wanted-sub-tab table">
                             <caption>
                                 明细列表:
@@ -1321,12 +1323,12 @@
                             <thead>
                             <tr>
                                 <th width="60">序号</th>
-                                <th width="110">*型号</th>
+                                <th width="110"><em class="red_color">*</em>型号</th>
                                 <th width="130">品牌</th>
                                 <th>物料名称</th>
                                 <th width="210">规格</th>
-                                <th width="130">{{storage_tab === 'inBound' ? '*入库数' : '*出库数'}}(PCS)</th>
-                                <th width="130">单价(¥)</th>
+                                <th width="130"><em class="red_color">*</em>{{storage_tab === 'inBound' ? '入库数' : '出库数'}}(PCS)</th>
+                                <th width="130">单价({{currency === 'RMB' ? '¥' : '$'}})</th>
                             </tr>
                             </thead>
                             <tbody>
@@ -1335,7 +1337,7 @@
                                 <td>
                                     <span ng-if="!item.newId" ng-bind="item.pcmpcode || '-'" title="{{item.pcmpcode}}"></span>
                                     <div class="down-form" ng-if="item.newId">
-                                        <input type="text" class="form-control" ng-model="item.key" ng-change="onChange(item)">
+                                        <input type="text" class="form-control" ng-model="item.key" ng-change="onChange(item, index)">
                                         <div ng-show="item.show" class="down-key" ng-mouseenter="item.show = true">
                                             <ul class="list-unstyled">
                                                 <li ng-repeat="list in listData" ng-click="addProductId(list, item)">
@@ -1344,9 +1346,6 @@
                                                     <span ng-bind="list.kind || '-'" title="{{list.kind}}"></span>
                                                     <span ng-bind="list.spec || '-'" title="{{list.spec}}"></span>
                                                 </li>
-                                                <li ng-if="listData.length <= 0">
-                                                    <div>没的找到与“{{item.key}}”产品信息</div>
-                                                </li>
                                             </ul>
                                         </div>
                                     </div>
@@ -1354,8 +1353,8 @@
                                 <td><span ng-bind="item.pbranden || '-'" title="{{item.pbranden}}"></span></td>
                                 <td><span ng-bind="item.kind || '-'" title="{{item.kind}}"></span></td>
                                 <td><span ng-bind="item.spec || '-'" title="{{item.spec}}"></span></td>
-                                <td><input type="text" ng-pattern="/^[1-9]\d*$/" class="form-control" ng-model="item.qty"></td>
-                                <td><input type="text" ng-pattern="/^((\d)|(\d+\.?\d+))$/" class="form-control" ng-model="item.price"></td>
+                                <td><input type="text" class="form-control" ng-model="item.qty" ng-change="onAmountChange(item, item.qty, 'qty', 9)"></td>
+                                <td><input type="text" class="form-control" ng-model="item.price" ng-change="onAmountChange(item, item.price, 'price', 4, 6)"></td>
                             </tr>
                             <tr>
                                 <td colspan="7">
@@ -1385,6 +1384,7 @@
                 <tr ng-if="item.seleted && storage_tab === 'outBound'">
                     <td colspan="7" style="background:#f5f5f5;">
                         <div class="logistics-info">
+                            <span style="margin-right:150px;">所属订单:<span ng-bind="item.associateOrderid || '-'"></span></span>
                             <span>物流公司 :&nbsp;</span>
                             <span class="input-ul">
                                 <input id="logistics-input" type="text" class="form-control select-adder" ng-focus="getItemFocus()"
@@ -1398,7 +1398,7 @@
                                   <a ng-click="addDistributor()">+&nbsp;新增配送商</a>
                                 </div>
                               </span>
-                            <span>物流单号 :&nbsp;</span>
+                            <span style="margin-left:100px;">物流单号 :&nbsp;</span>
                             <span style="margin-right: 20px; width: 160px;">
                             <form name="myForm" style="display:inline-block;width:140px;">
                               <!--ng-pattern="/^[A-Za-z0-9]+$/"-->
@@ -1412,9 +1412,10 @@
                 <tr ng-if="item.seleted && storage_tab === 'inBound' && item.logistics">
                     <td colspan="7" style="background:#f5f5f5;">
                         <div class="logistics-info">
+                            <span style="margin-right:150px;">所属订单:<span ng-bind="item.associateOrderid || '-'"></span></span>
                             <span>物流公司 :&nbsp;</span>
                             <span class="input-ul" ng-bind="item.logistics.companyName"></span>
-                            <span>物流单号 :&nbsp;</span>
+                            <span style="margin-left:100px;">物流单号 :&nbsp;</span>
                             <span style="margin-right: 20px;" ng-bind="item.logistics.number">
                             </span>
                         </div>
@@ -1433,8 +1434,8 @@
                                     <th width="180">规格</th>
                                     <th width="100" ng-if="storage_tab === 'outBound'">应出库(PCS)</th>
                                     <th width="100" ng-if="storage_tab === 'outBound'">已出库(PCS)</th>
-                                    <th width="100">{{storage_tab === 'inBound' ? '*入库数' : '*出库数'}}(PCS)</th>
-                                    <th width="80">单价(¥)</th>
+                                    <th width="100"><em class="red_color">*</em>{{storage_tab === 'inBound' ? '入库数' : '出库数'}}(PCS)</th>
+                                    <th width="80">单价({{currency === 'RMB' ? '¥' : '$'}})</th>
                                 </tr>
                                 </thead>
                             </table>
@@ -1464,7 +1465,7 @@
                                     <td width="100" ng-if="storage_tab === 'outBound'"><span ng-bind="list.shipQty || '-'" title="{{list.shipQty}}"></span></td>
                                     <td width="100">
                                         <span ng-if="list.number === list.shipQty">-</span>
-                                        <input type="text" ng-pattern="/^[1-9]\d*$/" ng-model="list.sendCount" ng-blur="ontChangeSendCount(list, list.sendCount)" ng-if="list.number !== list.shipQty" class="form-control">
+                                        <input type="text" ng-pattern="/^[1-9]\d*$/" ng-model="list.sendCount" ng-change="onAmountChange(list, list.sendCount, 'sendCount', 9)" ng-blur="outBlurSendCount(list, list.sendCount)" ng-if="list.number !== list.shipQty" class="form-control">
                                     </td>
                                     <td width="80"><span ng-bind="list.price || '-'" title="{{list.price}}"></span></td>
                                 </tr>