Browse Source

优化批量更新物料的方法

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@8956 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 9 years ago
parent
commit
3caf610c5d

+ 10 - 6
src/main/java/com/uas/platform/b2b/controller/ProductController.java

@@ -21,6 +21,7 @@ import com.uas.platform.b2b.service.ProductService;
 import com.uas.platform.b2b.support.JxlsExcelView;
 import com.uas.platform.b2b.support.JxlsExcelView;
 import com.uas.platform.b2b.support.SystemSession;
 import com.uas.platform.b2b.support.SystemSession;
 import com.uas.platform.b2b.support.UsageBufferedLogger;
 import com.uas.platform.b2b.support.UsageBufferedLogger;
+import com.uas.platform.b2b.temporary.model.UpdateByBatchParameter;
 import com.uas.platform.core.logging.BufferedLoggerManager;
 import com.uas.platform.core.logging.BufferedLoggerManager;
 import com.uas.platform.core.model.Constant;
 import com.uas.platform.core.model.Constant;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.PageInfo;
@@ -170,8 +171,9 @@ public class ProductController {
 	 */
 	 */
 	@RequestMapping(value = "/alterByBatch", method = RequestMethod.POST)
 	@RequestMapping(value = "/alterByBatch", method = RequestMethod.POST)
 	@ResponseBody
 	@ResponseBody
-	private ModelMap alterByBatch(String oldvalue, String newvalue, String updatetype) {
-		return productService.alterByBatch(oldvalue, oldvalue, updatetype);
+	private ModelMap alterByBatch(String parameter) {
+		UpdateByBatchParameter param = JSONObject.parseObject(parameter, UpdateByBatchParameter.class);
+		return productService.alterByBatch(param);
 	}
 	}
 
 
 	/**
 	/**
@@ -181,8 +183,9 @@ public class ProductController {
 	 */
 	 */
 	@RequestMapping(value = "/brands", method = RequestMethod.GET)
 	@RequestMapping(value = "/brands", method = RequestMethod.GET)
 	@ResponseBody
 	@ResponseBody
-	private List<Product> getBrands() {
-		return productService.getBrands();
+	private List<Product> getBrands(String parameter) {
+		UpdateByBatchParameter param = JSONObject.parseObject(parameter, UpdateByBatchParameter.class);
+		return productService.getBrands(param);
 	}
 	}
 
 
 	/**
 	/**
@@ -192,7 +195,8 @@ public class ProductController {
 	 */
 	 */
 	@RequestMapping(value = "/titles", method = RequestMethod.GET)
 	@RequestMapping(value = "/titles", method = RequestMethod.GET)
 	@ResponseBody
 	@ResponseBody
-	private List<Product> getTitles() {
-		return productService.getTitles();
+	private List<Product> getTitles(String parameter) {
+		UpdateByBatchParameter param = JSONObject.parseObject(parameter, UpdateByBatchParameter.class);
+		return productService.getTitles(param);
 	}
 	}
 }
 }

+ 4 - 3
src/main/java/com/uas/platform/b2b/service/ProductService.java

@@ -6,6 +6,7 @@ import org.springframework.data.domain.Page;
 import org.springframework.ui.ModelMap;
 import org.springframework.ui.ModelMap;
 
 
 import com.uas.platform.b2b.model.Product;
 import com.uas.platform.b2b.model.Product;
+import com.uas.platform.b2b.temporary.model.UpdateByBatchParameter;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.PageInfo;
 
 
 public interface ProductService {
 public interface ProductService {
@@ -73,19 +74,19 @@ public interface ProductService {
 	 * @param oldvalue2
 	 * @param oldvalue2
 	 * @return
 	 * @return
 	 */
 	 */
-	public ModelMap alterByBatch(String oldvalue, String newvalue, String updatetype);
+	public ModelMap alterByBatch(UpdateByBatchParameter param);
 
 
 	/**
 	/**
 	 * 获取企业所有的品牌
 	 * 获取企业所有的品牌
 	 * 
 	 * 
 	 * @return
 	 * @return
 	 */
 	 */
-	public List<Product> getBrands();
+	public List<Product> getBrands(UpdateByBatchParameter param);
 
 
 	/**
 	/**
 	 * 获取企业所有类目
 	 * 获取企业所有类目
 	 * 
 	 * 
 	 * @return
 	 * @return
 	 */
 	 */
-	public List<Product> getTitles();
+	public List<Product> getTitles(UpdateByBatchParameter param);
 }
 }

+ 43 - 14
src/main/java/com/uas/platform/b2b/service/impl/ProductServiceImpl.java

@@ -25,6 +25,7 @@ import com.uas.platform.b2b.model.UpdateType;
 import com.uas.platform.b2b.search.SearchService;
 import com.uas.platform.b2b.search.SearchService;
 import com.uas.platform.b2b.service.ProductService;
 import com.uas.platform.b2b.service.ProductService;
 import com.uas.platform.b2b.support.SystemSession;
 import com.uas.platform.b2b.support.SystemSession;
+import com.uas.platform.b2b.temporary.model.UpdateByBatchParameter;
 import com.uas.platform.core.model.Constant;
 import com.uas.platform.core.model.Constant;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.persistence.criteria.PredicateUtils;
 import com.uas.platform.core.persistence.criteria.PredicateUtils;
@@ -136,18 +137,27 @@ public class ProductServiceImpl implements ProductService {
 	}
 	}
 
 
 	@Override
 	@Override
-	public ModelMap alterByBatch(String oldvalue, String newvalue, String updatetype) {
+	public ModelMap alterByBatch(UpdateByBatchParameter param) {
 		ModelMap map = new ModelMap();
 		ModelMap map = new ModelMap();
 		Integer size = 0;
 		Integer size = 0;
 		List<Product> prods = new ArrayList<Product>();
 		List<Product> prods = new ArrayList<Product>();
-		if (null != oldvalue) {
-				if (updatetype.equals(UpdateType.BRANDUPDATE.getPhrase())) {
-				List<Product> products = productDao.findByEnUUAndBrand(SystemSession.getUser().getEnterprise().getUu(),
-						oldvalue);
+		if (null != param.getOldvalue()) {
+			if (param.getUpdatetype().equals(UpdateType.BRANDUPDATE.getPhrase())) {
+				List<Product> products = new ArrayList<Product>();
+				if (param.getType().equals(UpdateType.sale)) {
+					products = productDao.findByEnUUAndBrandAndIsSale(SystemSession.getUser().getEnterprise().getUu(),
+							param.getOldvalue(), Constant.YES);
+				} else if (param.getType().equals(UpdateType.purchase)) {
+					products = productDao.findByEnUUAndBrandAndIsPurchase(
+							SystemSession.getUser().getEnterprise().getUu(), param.getOldvalue(), Constant.YES);
+				} else {
+					products = productDao.findByEnUUAndBrand(SystemSession.getUser().getEnterprise().getUu(),
+							param.getOldvalue());
+				}
 				if (!CollectionUtils.isEmpty(products)) {
 				if (!CollectionUtils.isEmpty(products)) {
 					for (Product product : products) {
 					for (Product product : products) {
 						if (product.getCmpUuId() == null) {
 						if (product.getCmpUuId() == null) {
-							product.setBrand(newvalue);
+							product.setBrand(param.getNewvalue());
 							prods.add(product);
 							prods.add(product);
 						}
 						}
 						size = prods.size();
 						size = prods.size();
@@ -155,38 +165,57 @@ public class ProductServiceImpl implements ProductService {
 					}
 					}
 				}
 				}
 
 
-			} else if (updatetype.equals(UpdateType.TITLEUPDATE.getPhrase())) {
-				List<Product> products = productDao.findByEnUUAndTitle(SystemSession.getUser().getEnterprise().getUu(),
-						oldvalue);
+			} else if (param.getUpdatetype().equals(UpdateType.TITLEUPDATE.getPhrase())) {
+				List<Product> products = new ArrayList<Product>();
+				if (param.getType().equals(UpdateType.sale)) {
+					products = productDao.findByEnUUAndTitleAndIsSale(SystemSession.getUser().getEnterprise().getUu(),
+							param.getOldvalue(), Constant.YES);
+				} else if (param.getType().equals(UpdateType.purchase)) {
+					products = productDao.findByEnUUAndTitleAndIsPurchase(
+							SystemSession.getUser().getEnterprise().getUu(), param.getOldvalue(), Constant.YES);
+				} else {
+					products = productDao.findByEnUUAndTitle(SystemSession.getUser().getEnterprise().getUu(),
+							param.getOldvalue());
+				}
 				if (!CollectionUtils.isEmpty(products)) {
 				if (!CollectionUtils.isEmpty(products)) {
 					map.put("size", products.size());
 					map.put("size", products.size());
 					for (Product product : products) {
 					for (Product product : products) {
 						if (product.getCmpUuId() == null) {
 						if (product.getCmpUuId() == null) {
-							product.setBrand(newvalue);
+							product.setTitle(param.getNewvalue());
+							productDao.save(product);
 							prods.add(product);
 							prods.add(product);
 						}
 						}
 						size = prods.size();
 						size = prods.size();
-						productDao.save(prods);
 					}
 					}
 				}
 				}
 				}
 				}
-			map.put("success", updatetype + "修改成功,更新数量为" + size);
+			map.put("success", param.getUpdatetype() + "修改成功,更新数量为" + size);
 		}
 		}
 		return map;
 		return map;
 	}
 	}
 
 
 	@Override
 	@Override
-	public List<Product> getBrands() {
+	public List<Product> getBrands(UpdateByBatchParameter param) {
 		String sql = "select distinct p.pr_brand brand from products p where p.pr_cmpuuid is null and p.pr_enuu = "
 		String sql = "select distinct p.pr_brand brand from products p where p.pr_cmpuuid is null and p.pr_enuu = "
 				+ SystemSession.getUser().getEnterprise().getUu();
 				+ SystemSession.getUser().getEnterprise().getUu();
+		if (param.getType().equals(UpdateType.sale)) {
+			sql = sql + " and p.pr_isale = 1";
+		} else if (param.getType().equals(UpdateType.purchase)) {
+			sql = sql + " and p.pr_ispurchase = 1";
+		}
 		List<Product> products = commonDao.query(sql, Product.class);
 		List<Product> products = commonDao.query(sql, Product.class);
 		return products;
 		return products;
 	}
 	}
 
 
 	@Override
 	@Override
-	public List<Product> getTitles() {
+	public List<Product> getTitles(UpdateByBatchParameter param) {
 		String sql = "select distinct p.pr_title title from products p where p.pr_cmpuuid is null and p.pr_enuu = "
 		String sql = "select distinct p.pr_title title from products p where p.pr_cmpuuid is null and p.pr_enuu = "
 				+ SystemSession.getUser().getEnterprise().getUu();
 				+ SystemSession.getUser().getEnterprise().getUu();
+		if (param.getType().equals(UpdateType.sale)) {
+			sql = sql + " and p.pr_isale = 1";
+		} else if (param.getType().equals(UpdateType.purchase)) {
+			sql = sql + " and p.pr_ispurchase = 1";
+		}
 		List<Product> products = commonDao.query(sql, Product.class);
 		List<Product> products = commonDao.query(sql, Product.class);
 		return products;
 		return products;
 	}
 	}

+ 76 - 0
src/main/java/com/uas/platform/b2b/temporary/model/UpdateByBatchParameter.java

@@ -0,0 +1,76 @@
+package com.uas.platform.b2b.temporary.model;
+
+/**
+ * 批量修改传递的参数设置
+ * 
+ * @author hejq
+ * @time 创建时间:2017年6月9日
+ */
+public class UpdateByBatchParameter {
+
+	/**
+	 * 修改的字段类型
+	 */
+	private String updatetype;
+
+	/**
+	 * 需要修改的来源类型(销售、采购、总物料)
+	 */
+	private String type;
+
+	/**
+	 * 标准类型(all:全部; standard:标准; nonstandard: 非标准)
+	 */
+	private String standard;
+
+	/**
+	 * 原值
+	 */
+	private String oldvalue;
+
+	/**
+	 * 新值
+	 */
+	private String newvalue;
+
+	public String getUpdatetype() {
+		return updatetype;
+	}
+
+	public void setUpdatetype(String updatetype) {
+		this.updatetype = updatetype;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public String getStandard() {
+		return standard;
+	}
+
+	public void setStandard(String standard) {
+		this.standard = standard;
+	}
+
+	public String getOldvalue() {
+		return oldvalue;
+	}
+
+	public void setOldvalue(String oldvalue) {
+		this.oldvalue = oldvalue;
+	}
+
+	public String getNewvalue() {
+		return newvalue;
+	}
+
+	public void setNewvalue(String newvalue) {
+		this.newvalue = newvalue;
+	}
+
+}

+ 27 - 6
src/main/webapp/resources/js/index/app.js

@@ -9868,12 +9868,18 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 				resolve: {
 				resolve: {
 					updatetype: function() {
 					updatetype: function() {
 						return updatetype;
 						return updatetype;
+					},
+					active: function() {
+						return $scope.active;
+					},
+					type: function() {
+						return 'sale';
 					}
 					}
 				}
 				}
 			});
 			});
 			
 			
 			modalInstance.result.then(function(data) {
 			modalInstance.result.then(function(data) {
-				toaster.pop('success', '提示', data.data);
+				toaster.pop('success', '提示', data.success);
 				$scope.tableParams.reload();
 				$scope.tableParams.reload();
 			}, function(){
 			}, function(){
 				
 				
@@ -9884,15 +9890,23 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 	/**
 	/**
 	 * 批量修改
 	 * 批量修改
 	 */
 	 */
-	app.controller('UpdateByBatchCtrl', ['$scope', '$modalInstance', 'toaster', 'BaseService', 'updatetype', 'Products', function($scope, $modalInstance, toaster, BaseService, updatetype, Products) {
+	app.controller('UpdateByBatchCtrl', ['$scope', '$modalInstance', 'toaster', 'BaseService', 'updatetype', 'Products', 'active', 'type', function($scope, $modalInstance, toaster, BaseService, updatetype, Products, active, type) {
 		$scope.updatetype = updatetype;
 		$scope.updatetype = updatetype;
 		$scope.changed = false;
 		$scope.changed = false;
+		$scope.parameter = {
+				updatetype: updatetype,
+				standard: active,
+				type: type,
+				oldvalue: null,
+				newvalue: null
+		};
+		
 		$scope.cancel = function() {
 		$scope.cancel = function() {
 			$modalInstance.dismiss();
 			$modalInstance.dismiss();
 		}
 		}
 		if(updatetype === '品牌')
 		if(updatetype === '品牌')
 			var loadData = function() {
 			var loadData = function() {
-				Products.getBrands({}, function(data) {
+				Products.getBrands({parameter: $scope.parameter}, {}, function(data) {
 					$scope.products = data;
 					$scope.products = data;
 				}, function(response) {
 				}, function(response) {
 					toaster.pop('error', '提示', response.data);
 					toaster.pop('error', '提示', response.data);
@@ -9900,7 +9914,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 		}
 		}
 		if(updatetype === '名称(类目)')
 		if(updatetype === '名称(类目)')
 			var loadData = function() {
 			var loadData = function() {
-				Products.getTitles({}, function(data) {
+				Products.getTitles({parameter: $scope.parameter}, {}, function(data) {
 					$scope.products = data;
 					$scope.products = data;
 				}, function(response) {
 				}, function(response) {
 					toaster.pop('error', '提示', response.data);
 					toaster.pop('error', '提示', response.data);
@@ -9909,7 +9923,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 		loadData();
 		loadData();
 		
 		
 		$scope.okay = function() {
 		$scope.okay = function() {
-			Products.alterByBatch({oldvalue: $scope.oldvalue, newvalue: $scope.newvalue, updatetype: updatetype}, {}, function(data) {
+			console.log($scope.parameter);
+			Products.alterByBatch({parameter: $scope.parameter}, {}, function(data) {
 				$modalInstance.close(data);
 				$modalInstance.close(data);
 			}, function(response) {
 			}, function(response) {
 				toaster.pop('error', '提示', response.data);
 				toaster.pop('error', '提示', response.data);
@@ -15538,12 +15553,18 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 				resolve: {
 				resolve: {
 					updatetype: function() {
 					updatetype: function() {
 						return updatetype;
 						return updatetype;
+					},
+					active: function() {
+						return $scope.active;
+					},
+					type: function() {
+						return 'purchase';
 					}
 					}
 				}
 				}
 			});
 			});
 			
 			
 			modalInstance.result.then(function(data) {
 			modalInstance.result.then(function(data) {
-				toaster.pop('success', '提示', data.data);
+				toaster.pop('success', '提示', data.success);
 				$scope.tableParams.reload();
 				$scope.tableParams.reload();
 			}, function(){
 			}, function(){
 				
 				

+ 5 - 2
src/main/webapp/resources/tpl/index/approvalFlow/prodList.html

@@ -184,10 +184,13 @@
                 <td class="text-center" title="{{product.code}}" ng-bind="::product.code"></td>
                 <td class="text-center" title="{{product.code}}" ng-bind="::product.code"></td>
                 <td class="line-h20 first text-center">
                 <td class="line-h20 first text-center">
                     <div class="order-main">
                     <div class="order-main">
-                        <a ng-bind="::product.title" ui-sref="sale.productDetail({id:product.id})" target="_self"  title="查看详情"></a>
+                        <span ng-bind="::product.title" target="_self"  title="查看详情"></span>
                     </div>
                     </div>
                 </td>
                 </td>
-                <td class="hover-show text-center" ng-class="{'bg01' : product.cmpUuId != null && product.cmpCode != null , 'bg02' : product.cmpUuId == null && product.cmpCode != null , '': product.cmpCode == null}"><a href="#" title="产品型号" ng-bind="::product.cmpCode"></a></td>
+                <td class="hover-show text-center" ng-class="{'bg01' : product.cmpUuId != null && product.cmpCode != null , 'bg02' : product.cmpUuId == null && product.cmpCode != null , '': product.cmpCode == null}">
+                	<a href="http://www.usoftmall.com/product#/component/{{product.cmpUuId}}/" title="产品型号" ng-bind="::product.cmpCode"  target="_blank" ng-if="product.cmpUuId != null"></a>
+                	<span title="产品型号" ng-bind="::product.cmpCode" ng-if="product.cmpUuId == null"></span>
+                </td>
                 <td class="line-h20 text-center" title="{{product.brand}}" ng-bind="::product.brand"></td>
                 <td class="line-h20 text-center" title="{{product.brand}}" ng-bind="::product.brand"></td>
                 <td class="text-center" title="单位" ng-bind="::product.unit"></td>
                 <td class="text-center" title="单位" ng-bind="::product.unit"></td>
                 <td class="text-center">
                 <td class="text-center">

+ 3 - 3
src/main/webapp/resources/tpl/index/baseInfo/modal/updateByBatch_modal.html

@@ -49,13 +49,13 @@
 				<!-- <td class="text-center" ng-if="updatetype == '品牌'"><span ng-bind="::product.brand"></span></td>
 				<!-- <td class="text-center" ng-if="updatetype == '品牌'"><span ng-bind="::product.brand"></span></td>
 				<td class="text-center" ng-if="updatetype == '名称(类目)'"><span ng-bind="::product.title"></span></td>
 				<td class="text-center" ng-if="updatetype == '名称(类目)'"><span ng-bind="::product.title"></span></td>
 				<td class="text-center" ng-if="updatetype == '产品型号'"><span ng-bind="::product.spec"></span></td> -->
 				<td class="text-center" ng-if="updatetype == '产品型号'"><span ng-bind="::product.spec"></span></td> -->
-				<td ng-if="updatetype == '品牌'"><select type="text" ng-model="oldvalue" ng-options="product.brand for product in products" class="form-control">
+				<td ng-if="updatetype == '品牌'"><select type="text" ng-model="parameter.oldvalue" ng-options="product.brand as product.brand for product in products" class="form-control">
 					<option value="">请选择品牌</option>
 					<option value="">请选择品牌</option>
 					</select></td>
 					</select></td>
-				<td ng-if="updatetype == '名称(类目)'"><select type="text" ng-model="oldvalue" ng-options="product.title for product in products">
+				<td ng-if="updatetype == '名称(类目)'"><select type="text" ng-model="parameter.oldvalue" ng-options="product.title as product.title for product in products" class="form-control">
 					<option value="">请选择名称(类目)</option>
 					<option value="">请选择名称(类目)</option>
 					</select></td>
 					</select></td>
-				<td class="text-center"><input type="text" ng-model="newvalue" class="form-control"></span></td>
+				<td class="text-center"><input type="text" ng-model="parameter.newvalue" class="form-control"></span></td>
 			</tr>
 			</tr>
 		</tbody>
 		</tbody>
 	</table>
 	</table>

+ 185 - 150
src/main/webapp/resources/tpl/index/baseInfo/prodList.html

@@ -1,154 +1,185 @@
 <style>
 <style>
-    .order-table .header>th {
-        height: 40px;
-        text-align: center;
-        border-bottom: 1px solid #e8e8e8;
-    }
-    .order-table .header:hover th{
-        border: none !important;
-    }
-    .order-table .sep-row {
-        height: 10px;
-    }
-
-    .order-table .selector {
-        vertical-align: middle;
-        margin: 0 0 2px 0;
-    }
-
-    .toolbar label {
-        margin-right: 10px;
-        margin-bottom: 0;
-    }
-
-    .toolbar .select_all {
-        margin: 0 6px 0 10px;
-        line-height: 20px;
-    }
-
-    .toolbar .btn {
-        -moz-border-radius: 2px;
-        margin-right: 5px;
-        border: 1px solid #dcdcdc;
-        border-radius: 2px;
-        -webkit-border-radius: 2px;
-    }
-
-    .order-table .order-hd {
-        /*background: #f5f5f5;*/
-        height: 60px;
-        line-height: 60px;
-        font-size: 14px;
-    }
-
-    .order-table .order-hd td.first {
-        /*padding-left: 20px;*/
-    }
-
-    .order-table .order-hd .order-main span {
-        margin-right: 8px;
-    }
-
-    .order-table .order-hd .order-code {
-        font-style: normal;
-        font-family: verdana;
-    }
-
-    .order-table .order-hd .order-sum {
-        padding: 0 5px;
-    }
-
-    .order-table>tbody {
-        border-top: #e8e8e8 1px solid;
-    }
-    .order-table{
-        border-bottom: #e8e8e8 1px solid;
-    }
-    .order-table>tbody:hover {
-       /* border-color: #56a022;
+.order-table .header>th {
+	height: 40px;
+	text-align: center;
+	border-bottom: 1px solid #e8e8e8;
+}
+
+.order-table .header:hover th {
+	border: none !important;
+}
+
+.order-table .sep-row {
+	height: 10px;
+}
+
+.order-table .selector {
+	vertical-align: middle;
+	margin: 0 0 2px 0;
+}
+
+.toolbar label {
+	margin-right: 10px;
+	margin-bottom: 0;
+}
+
+.toolbar .select_all {
+	margin: 0 6px 0 10px;
+	line-height: 20px;
+}
+
+.toolbar .btn {
+	-moz-border-radius: 2px;
+	margin-right: 5px;
+	border: 1px solid #dcdcdc;
+	border-radius: 2px;
+	-webkit-border-radius: 2px;
+}
+
+.order-table .order-hd {
+	/*background: #f5f5f5;*/
+	height: 60px;
+	line-height: 60px;
+	font-size: 14px;
+}
+
+.order-table .order-hd td.first {
+	/*padding-left: 20px;*/
+	
+}
+
+.order-table .order-hd .order-main span {
+	margin-right: 8px;
+}
+
+.order-table .order-hd .order-code {
+	font-style: normal;
+	font-family: verdana;
+}
+
+.order-table .order-hd .order-sum {
+	padding: 0 5px;
+}
+
+.order-table>tbody {
+	border-top: #e8e8e8 1px solid;
+}
+
+.order-table {
+	border-bottom: #e8e8e8 1px solid;
+}
+
+.order-table>tbody:hover {
+	/* border-color: #56a022;
         border-width: 2px;*/
         border-width: 2px;*/
-    }
-
-    .order-table .operates {
-        display: none;
-    }
-
-    .order-table>tbody:hover .operates {
-        display: block;
-    }
-
-    .order-table .order-hd {
-        border-bottom: 1px solid #e6e6e6;
-    }
-    .order-table .order-bd>td {
-        padding: 10px 5px;
-        vertical-align: top;
-        position: relative;
-    }
-
-    .order-table .order-bd .product {
-        padding-left: 20px;
-    }
-
-    .input-xs,.input-group-xs>.form-control,.input-group-xs>.input-group-addon,.input-group-xs>.input-group-btn>.btn
-    {
-        height: 26px;
-        padding: 0 5px;
-        font-size: 12px;
-        line-height: 1.5;
-        border-radius: 3px;
-    }
-
-    .input-group-xs .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn {
-        border-top-left-radius: 0;
-        border-bottom-left-radius: 0;
-    }
-
-    .modal-dialog {
-        margin-top: 110px;
-    }
-
-    .file {
-        color: #336699;
-        text-decoration: underline;
-    }
-.condition{
-    padding: 10px 0;
-}
-.order-hd td{
-    word-break: break-word;
-    padding: 10px 5px !important;
-}
-.toolbar td a{
-    margin-left: 18px;
-}
-#public .com_title{
-    margin-bottom: 10px;
-}
-.order-hd td a{
-    margin: 0 8px;
-}
-   .order-table .header th label{
-       margin-left: 34px;
-   }
-    .order-table .header th label input{
-        margin: 0;
-        position: relative;
-        top: 3px;
-    }
-    /*.order-table tr.header th:first-child{
+	
+}
+
+.order-table .operates {
+	display: none;
+}
+
+.order-table>tbody:hover .operates {
+	display: block;
+}
+
+.order-table .order-hd {
+	border-bottom: 1px solid #e6e6e6;
+}
+
+.order-table .order-bd>td {
+	padding: 10px 5px;
+	vertical-align: top;
+	position: relative;
+}
+
+.order-table .order-bd .product {
+	padding-left: 20px;
+}
+
+.input-xs, .input-group-xs>.form-control, .input-group-xs>.input-group-addon,
+	.input-group-xs>.input-group-btn>.btn {
+	height: 26px;
+	padding: 0 5px;
+	font-size: 12px;
+	line-height: 1.5;
+	border-radius: 3px;
+}
+
+.input-group-xs .form-control:last-child, .input-group-addon:last-child,
+	.input-group-btn:first-child>.btn:not (:first-child ), .input-group-btn:last-child>.btn
+	{
+	border-top-left-radius: 0;
+	border-bottom-left-radius: 0;
+}
+
+.modal-dialog {
+	margin-top: 110px;
+}
+
+.file {
+	color: #336699;
+	text-decoration: underline;
+}
+
+.condition {
+	padding: 10px 0;
+}
+
+.order-hd td {
+	word-break: break-word;
+	padding: 10px 5px !important;
+}
+
+.toolbar td a {
+	margin-left: 18px;
+}
+
+#public .com_title {
+	margin-bottom: 10px;
+}
+
+.order-hd td a {
+	margin: 0 8px;
+}
+
+.order-table .header th label {
+	margin-left: 34px;
+}
+
+.order-table .header th label input {
+	margin: 0;
+	position: relative;
+	top: 3px;
+}
+/*.order-table tr.header th:first-child{
         text-align: left;
         text-align: left;
     }*/
     }*/
-    .edit.col-xs-3{
-        padding-right: 0;
-        width: 215px;
-        float: right;
-    }
-    .edit.col-xs-3 a{
-        font-size: 14px;
-        line-height: 34px;
-        color: #5078cb;
-    }
+.edit.col-xs-3 {
+	padding-right: 0;
+	width: 215px;
+	float: right;
+}
+
+.edit.col-xs-3 a {
+	font-size: 14px;
+	line-height: 34px;
+	color: #5078cb;
+}
+
+.edit a[disabled] {
+	cursor: not-allowed;
+}
+
+.edit .btn {
+	border: none;
+	padding: 0;
+	margin-left: 10px;
+}
+
+.edit.col-xs-3 a:hover {
+	background: #fff !important;
+}
 </style>
 </style>
 <link rel="stylesheet" href="static/css/public.css">
 <link rel="stylesheet" href="static/css/public.css">
 <div class="block" id="public">
 <div class="block" id="public">
@@ -205,7 +236,7 @@
                         <option value="品牌">品牌</option>
                         <option value="品牌">品牌</option>
                         <option value="名称(类目)">名称(类目)</option>
                         <option value="名称(类目)">名称(类目)</option>
                     </select>
                     </select>
-                    <a ng-click="updateByBatch(product.updatetype)" class="fr">批量修改</a>
+                    <a ng-click="updateByBatch(product.updatetype)" class="btn btn-default btn-sm" ng-disabled="active == 'standard'">批量修改</a>
                 </div>
                 </div>
             </div>
             </div>
         </div>
         </div>
@@ -235,10 +266,14 @@
                 <td class="text-center" title="{{product.code}}" ng-bind="::product.code"></td>
                 <td class="text-center" title="{{product.code}}" ng-bind="::product.code"></td>
                 <td class="line-h20 first text-center">
                 <td class="line-h20 first text-center">
                     <div class="order-main">
                     <div class="order-main">
-                        <a ng-bind="::product.title" ui-sref="sale.productDetail({id:product.id})" target="_self"  title="查看详情"></a>
+                        <a ng-bind="::product.title" ui-sref="sale.productDetail({id:product.id})" target="_self"  title="查看详情" ng-if="product.kind == null"></a>
+                        <a ng-bind="::product.title" ui-sref="sale.productDetail({id:product.id})" target="_self"  title="查看详情" ng-if="product.kind != null"></a>
                     </div>
                     </div>
                 </td>
                 </td>
-                <td class="hover-show text-center" ng-class="{'bg01' : product.cmpUuId != null && product.cmpCode != null , 'bg02' : product.cmpUuId == null && product.cmpCode != null , '': product.cmpCode == null}"><a href="http://www.usoftmall.com/product#/component/{{product.cmpUuId}}" title="产品型号" ng-bind="::product.cmpCode" ng-disabled="product.cmpUuId==null" target="_blank"></a></td>
+                <td class="hover-show text-center" ng-class="{'bg01' : product.cmpUuId != null && product.cmpCode != null , 'bg02' : product.cmpUuId == null && product.cmpCode != null , '': product.cmpCode == null}">
+                	<a href="http://www.usoftmall.com/product#/component/{{product.cmpUuId}}/" title="产品型号" ng-bind="::product.cmpCode"  target="_blank" ng-if="product.cmpUuId != null"></a>
+                	<span title="产品型号" ng-bind="::product.cmpCode" ng-if="product.cmpUuId == null"></span>
+                </td>
                 <td class="line-h20 text-center" title="{{product.brand}}" ng-bind="::product.brand"></td>
                 <td class="line-h20 text-center" title="{{product.brand}}" ng-bind="::product.brand"></td>
                 <td class="text-center" title="单位" ng-bind="::product.unit"></td>
                 <td class="text-center" title="单位" ng-bind="::product.unit"></td>
                 <td class="text-center"><a ui-sref="sale.productDetail({id:product.id})" ng-click="isProductEdit()" target="_self" title="编辑" style="position: relative;top:1px;"><i class="fa fa-lg fa-edit"></i></a>|<a ng-click="deleteById(product.id)"  title="删除"><i class="fa fa-lg fa-trash"></i></a></td>
                 <td class="text-center"><a ui-sref="sale.productDetail({id:product.id})" ng-click="isProductEdit()" target="_self" title="编辑" style="position: relative;top:1px;"><i class="fa fa-lg fa-edit"></i></a>|<a ng-click="deleteById(product.id)"  title="删除"><i class="fa fa-lg fa-trash"></i></a></td>

+ 8 - 5
src/main/webapp/resources/tpl/index/baseInfo/productDetail.html

@@ -92,16 +92,19 @@
                 </dd>
                 </dd>
                 <dd>
                 <dd>
                     <div class="fl">产品名称:</div>
                     <div class="fl">产品名称:</div>
-                    <div class="fr"><input type="text"  ng-model="prodInfo.title" ng-class="{'readonly-pointer': !prodInfo.$editing}" required="true" ng-readonly="!prodInfo.$editing"></div>
+                    <div class="fr">
+                    	<input type="text"  ng-model="prodInfo.title" ng-class="{'readonly-pointer': !prodInfo.$editing}" required="true" ng-readonly="!prodInfo.$editing" ng-if="prodInfo.kind == null">
+                    	<input type="text"  ng-model="prodInfo.kind" ng-class="{'readonly-pointer': !prodInfo.$editing}" required="true" readonly="readonly" ng-if="prodInfo.kind != null">
+                    </div>
                 </dd>
                 </dd>
                 <dd>
                 <dd>
-                    <div class="fl">产品规格:</div>
-                    <div class="fr"><input type="text"  ng-model="prodInfo.spec" ng-class="{'readonly-pointer': !prodInfo.$editing}" required="true" ng-readonly="!prodInfo.$editing"><span>(请填写详细)</span></div>
+                    <div class="fl">产品型号:</div>
+                    <div class="fr"><input type="text"  ng-model="prodInfo.cmpCode" ng-class="{'readonly-pointer': !prodInfo.$editing}" required="true" ng-readonly="!prodInfo.$editing"  ng-click="selectKind(prodInfo.cmpCode)" ng-disabled="!prodInfo.$editing"><span>(请填写详细)</span></div>
                 </dd>
                 </dd>
-                <dd>
+               <!--  <dd>
                     <div class="fl">原厂型号:</div>
                     <div class="fl">原厂型号:</div>
                     <div class="fr"><input type="text" readonly="prodInfo.cmpUuId != null" ng-disabled="!prodInfo.$editing" placeholder="点击选择原厂型号" style="cursor: pointer;" ng-model="prodInfo.cmpCode" ng-click="selectKind(prodInfo.cmpCode)"><span></span></div>
                     <div class="fr"><input type="text" readonly="prodInfo.cmpUuId != null" ng-disabled="!prodInfo.$editing" placeholder="点击选择原厂型号" style="cursor: pointer;" ng-model="prodInfo.cmpCode" ng-click="selectKind(prodInfo.cmpCode)"><span></span></div>
-                </dd>
+                </dd> -->
                 <dd>
                 <dd>
                     <div class="fl">品牌:</div>
                     <div class="fl">品牌:</div>
                     <div class="fr"><input type="text" ng-model="prodInfo.brand" type="text" placeholder="品牌" style="cursor: pointer;" readonly="prodInfo.cmpUuId != null"><span></span></div>
                     <div class="fr"><input type="text" ng-model="prodInfo.brand" type="text" placeholder="品牌" style="cursor: pointer;" readonly="prodInfo.cmpUuId != null"><span></span></div>

+ 18 - 4
src/main/webapp/resources/tpl/index/purc/prodList.html

@@ -150,6 +150,17 @@
     line-height: 34px;
     line-height: 34px;
     color: #5078cb;
     color: #5078cb;
 }
 }
+.edit a[disabled]{
+  cursor: not-allowed;
+  }
+  .edit .btn {
+  	border: none;
+  	padding: 0;
+  	margin-left: 10px;
+  }
+  .edit.col-xs-3 a:hover {
+  	background: #fff !important;
+  }
 </style>
 </style>
 <link rel="stylesheet" href="static/css/public.css">
 <link rel="stylesheet" href="static/css/public.css">
 <div class="block" id="public">
 <div class="block" id="public">
@@ -205,9 +216,8 @@
                      <select type="select"class="fl form-control"  ng-model="product.updatetype" ng-init="product.updatetype = '品牌'" style="width: 130px;">
                      <select type="select"class="fl form-control"  ng-model="product.updatetype" ng-init="product.updatetype = '品牌'" style="width: 130px;">
                         <option value="品牌">品牌</option>
                         <option value="品牌">品牌</option>
                         <option value="名称(类目)">名称(类目)</option>
                         <option value="名称(类目)">名称(类目)</option>
-                        <option value="物料型号">物料型号</option>
                      </select>
                      </select>
-                     <a ng-click="updateByBatch(product.updatetype)" class="fr">批量修改</a>
+                     <a ng-click="updateByBatch(product.updatetype)" class="btn btn-default btn-sm" ng-disabled="active == 'standard'">批量修改</a>
                 </div>
                 </div>
             </div>
             </div>
         </div>
         </div>
@@ -237,10 +247,14 @@
                 <td class="text-center" title="{{product.code}}" ng-bind="::product.code"></td>
                 <td class="text-center" title="{{product.code}}" ng-bind="::product.code"></td>
                 <td class="line-h20 first text-center">
                 <td class="line-h20 first text-center">
                     <div class="order-main">
                     <div class="order-main">
-                        <a ng-bind="::product.title" ui-sref="purc.productDetail({id:product.id})" target="_self"  title="查看详情"></a>
+                        <a ng-bind="::product.title" ui-sref="purc.productDetail({id:product.id})" target="_self"  title="查看详情" ng-if="product.kind == null"></a>
+                        <a ng-bind="::product.title" ui-sref="purc.productDetail({id:product.id})" target="_self"  title="查看详情" ng-if="product.kind != null"></a>
                     </div>
                     </div>
                 </td>
                 </td>
-                <td class="hover-show text-center" ng-class="{'bg01' : product.cmpUuId != null && product.cmpCode != null , 'bg02' : product.cmpUuId == null && product.cmpCode != null , '': product.cmpCode == null}"><a href="http://www.usoftmall.com/product#/component/{{product.cmpUuId}}" title="物料型号" ng-bind="::product.cmpCode" ng-disabled="product.cmpUuId==null" target="_blank"></a></td>
+               <td class="hover-show text-center" ng-class="{'bg01' : product.cmpUuId != null && product.cmpCode != null , 'bg02' : product.cmpUuId == null && product.cmpCode != null , '': product.cmpCode == null}">
+                	<a href="http://www.usoftmall.com/product#/component/{{product.cmpUuId}}/" title="产品型号" ng-bind="::product.cmpCode"  target="_blank" ng-if="product.cmpUuId != null"></a>
+                	<span title="产品型号" ng-bind="::product.cmpCode" ng-if="product.cmpUuId == null"></span>
+                </td>
                 <td class="line-h20 text-center" title="{{product.brand}}" ng-bind="::product.brand"></td>
                 <td class="line-h20 text-center" title="{{product.brand}}" ng-bind="::product.brand"></td>
                 <td class="text-center" title="单位" ng-bind="::product.unit"></td>
                 <td class="text-center" title="单位" ng-bind="::product.unit"></td>
                  <td class="text-center"><a ui-sref="sale.productDetail({id:product.id})" target="_self" title="编辑" style="position: relative;top:1px;"><i class="fa fa-lg fa-edit"></i></a>|<a ng-click="deleteById(product.id)"  title="删除"><i class="fa fa-lg fa-trash"></i></a></td>
                  <td class="text-center"><a ui-sref="sale.productDetail({id:product.id})" target="_self" title="编辑" style="position: relative;top:1px;"><i class="fa fa-lg fa-edit"></i></a>|<a ng-click="deleteById(product.id)"  title="删除"><i class="fa fa-lg fa-trash"></i></a></td>

+ 12 - 9
src/main/webapp/resources/tpl/index/purc/productDetail.html

@@ -84,24 +84,27 @@
             <div class="com_title01 sty01"><span>基本信息<em>*</em></span></div>
             <div class="com_title01 sty01"><span>基本信息<em>*</em></span></div>
             <dl>
             <dl>
                 <dd>
                 <dd>
-                    <div class="fl">产品编号:</div>
+                    <div class="fl">物料编号:</div>
                     <div class="fr"><input type="text" ng-model="prodInfo.code" style="cursor: pointer;" required="true" ng-readonly="!prodInfo.$editing"><span>(建议与您系统的产品编号保持一致,便于追溯)</span></div>
                     <div class="fr"><input type="text" ng-model="prodInfo.code" style="cursor: pointer;" required="true" ng-readonly="!prodInfo.$editing"><span>(建议与您系统的产品编号保持一致,便于追溯)</span></div>
                 </dd>
                 </dd>
                 <dd>
                 <dd>
-                    <div class="fl">产品名称:</div>
-                    <div class="fr"><input type="text"  ng-model="prodInfo.title" style="cursor: pointer;" required="true" ng-readonly="!prodInfo.$editing"></div>
+                    <div class="fl">物料名称:</div>
+                    <div class="fr">
+                    	<input type="text"  ng-model="prodInfo.title" ng-class="{'readonly-pointer': !prodInfo.$editing}" required="true" ng-readonly="!prodInfo.$editing" ng-if="prodInfo.kind == null">
+                    	<input type="text"  ng-model="prodInfo.kind" ng-class="{'readonly-pointer': !prodInfo.$editing}" required="true" readonly="readonly" ng-if="prodInfo.kind != null">
+                    </div>
                 </dd>
                 </dd>
                 <dd>
                 <dd>
-                    <div class="fl">产品规格:</div>
-                    <div class="fr"><input type="text"  ng-model="prodInfo.spec" style="cursor: pointer;" required="true" ng-readonly="!prodInfo.$editing"><span>(请填写详细)</span></div>
+                    <div class="fl">物料型号:</div>
+                    <div class="fr"><input type="text"  ng-model="prodInfo.cmpCode" style="cursor: pointer;" required="true" ng-readonly="!prodInfo.$editing"  ng-click="selectKind(prodInfo.cmpCode)" ng-disabled="!prodInfo.$editing"><span>(请填写详细)</span></div>
                 </dd>
                 </dd>
-                <dd>
+               <!--  <dd>
                     <div class="fl">原厂型号:</div>
                     <div class="fl">原厂型号:</div>
-                    <div class="fr"><input type="text"  readonly="prodInfo.cmpUuId != null" placeholder="点击选择原厂型号" style="cursor: pointer;" ng-model="prodInfo.cmpCode" ng-click="selectKind(prodInfo.cmpCode)" ng-disabled="!prodInfo.$editing"><span></span></div>
-                </dd>
+                    <div class="fr"><input type="text"  ng-readonly="prodInfo.cmpUuId != null" placeholder="点击选择原厂型号" style="cursor: pointer;" ng-model="prodInfo.cmpCode" ng-click="selectKind(prodInfo.cmpCode)" ng-disabled="!prodInfo.$editing"><span></span></div>
+                </dd> -->
                 <dd>
                 <dd>
                     <div class="fl">品牌:</div>
                     <div class="fl">品牌:</div>
-                    <div class="fr"><input type="text" ng-model="prodInfo.brand" type="text" placeholder="品牌" style="cursor: pointer;" readonly="prodInfo.cmpUuId != null"><span></span></div>
+                    <div class="fr"><input type="text" ng-model="prodInfo.brand" type="text" placeholder="品牌" style="cursor: pointer;" ng-readonly="prodInfo.cmpUuId != null"><span></span></div>
                 </dd>
                 </dd>
                 <dd>
                 <dd>
                     <div class="fl">单位:</div>
                     <div class="fl">单位:</div>