Browse Source

代采订带同步到ERP转换成销售订单,页面UI处理

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

+ 5 - 10
src/main/java/com/uas/platform/b2b/controller/DeputyOrderController.java

@@ -9,7 +9,6 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
 import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -20,7 +19,6 @@ import org.springframework.web.servlet.ModelAndView;
 import com.alibaba.dubbo.common.utils.CollectionUtils;
 import com.alibaba.fastjson.JSON;
 import com.uas.platform.b2b.model.DeputyOrder;
-import com.uas.platform.b2b.model.DeputyOrderItem;
 import com.uas.platform.b2b.model.FileUpload;
 import com.uas.platform.b2b.model.SearchFilter;
 import com.uas.platform.b2b.search.SearchService;
@@ -190,14 +188,11 @@ public class DeputyOrderController {
 	}
 	
 	/**
-	 * 获取商品详情
-	 * 
-	 * @param params
-	 * @param keyword
-	 * @return
+	 * 在修改时删除明细行
 	 */
-	@RequestMapping(value = "/getProdList", method = RequestMethod.GET)
-	private Page<DeputyOrderItem> getProdList(PageParams params, String keyword) {
-		return null;
+	@RequestMapping(value = "/deleteProdById/{id}", method = RequestMethod.DELETE)
+	private ModelMap deleteProdById(@PathVariable Long id) {
+		return deputyOrderService.deleteProdById(id);
 	}
+	
 }

+ 12 - 0
src/main/java/com/uas/platform/b2b/dao/DeputyOrderDao.java

@@ -1,5 +1,7 @@
 package com.uas.platform.b2b.dao;
 
+import java.util.List;
+
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.stereotype.Repository;
@@ -9,4 +11,14 @@ import com.uas.platform.b2b.model.DeputyOrder;
 @Repository
 public interface DeputyOrderDao extends JpaRepository<DeputyOrder, Long>, JpaSpecificationExecutor<DeputyOrder> {
 
+	/**
+	 * 通过代采企业uu和下载状态及录入状态查询代采订单
+	 * 
+	 * @param enuu
+	 * @param entryStatus
+	 * @param downloadStatus
+	 * @return
+	 */
+	List<DeputyOrder> getByDeputyuuAndEntrystatusAndDownloadstatus(Long enuu, String entryStatus,
+			String downloadStatus);
 }

+ 71 - 0
src/main/java/com/uas/platform/b2b/erp/controller/DeputyOrderDownController.java

@@ -0,0 +1,71 @@
+package com.uas.platform.b2b.erp.controller;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.Date;
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import com.uas.platform.b2b.dao.DeputyOrderDao;
+import com.uas.platform.b2b.erp.support.ErpBufferedLogger;
+import com.uas.platform.b2b.model.DeputyOrder;
+import com.uas.platform.b2b.service.DeputyOrderService;
+import com.uas.platform.b2b.support.SystemSession;
+import com.uas.platform.core.logging.BufferedLoggerManager;
+
+/**
+ * ERP下载平台的代采订单
+ * 
+ * @author hejq
+ * @time 创建时间:2017年3月24日
+ */
+@Controller
+@RequestMapping("/erp/purchase/deputyOrder")
+public class DeputyOrderDownController {
+
+	private final static ErpBufferedLogger logger = BufferedLoggerManager.getLogger(ErpBufferedLogger.class);
+
+	@Autowired
+	private DeputyOrderService deputyOrderService;
+
+	@Autowired
+	private DeputyOrderDao deputyOrderDao;
+
+	/**
+	 * 买家ERP从平台获取代采订单
+	 * 
+	 * @return
+	 */
+	@RequestMapping(method = RequestMethod.GET)
+	@ResponseBody
+	public List<DeputyOrder> getDeOrders() {
+		List<DeputyOrder> deOrders = deputyOrderService.findByDeputyuu(SystemSession.getUser().getEnterprise().getUu());
+		logger.log("主动报价单", "下载来自供应商的主动报价", deOrders.size());
+		return deOrders;
+	}
+	
+	/**
+	 * 将已存入的数据id返回,更新下载状态
+	 * 
+	 * @param data
+	 * @throws UnsupportedEncodingException
+	 */
+	@RequestMapping(method = RequestMethod.POST)
+	@ResponseBody
+	public void downloadStatus(@RequestParam("data") String data) throws UnsupportedEncodingException {
+		String jsonStr = URLDecoder.decode(data, "UTF-8");
+		String idStr[] = jsonStr.split(",");
+		for (String id : idStr) {
+			DeputyOrder deOrder = deputyOrderDao.findOne(Long.valueOf(id));
+			deOrder.setDownloadstatus("已下载");
+			deOrder.setErpdate(new Date());
+			deputyOrderDao.save(deOrder);
+		}
+	}
+}

+ 70 - 0
src/main/java/com/uas/platform/b2b/model/DeputyOrder.java

@@ -73,6 +73,18 @@ public class DeputyOrder implements Serializable {
 	@Column(name = "deo_prostatuscode")
 	private Integer prostatuscode;
 
+	/**
+	 * 录入状态
+	 */
+	@Column(name = "deo_entrystatus")
+	private String entrystatus;
+
+	/**
+	 * ERP下载状态
+	 */
+	@Column(name = "deo_downloadstatus")
+	private String downloadstatus;
+
 	/**
 	 * 录入日期
 	 */
@@ -151,6 +163,24 @@ public class DeputyOrder implements Serializable {
 	@Column(name = "deo_paymentmethod")
 	private String paymentmethod;
 
+	/**
+	 * 代采企业uu
+	 */
+	@Column(name = "deo_deputyuu")
+	private Long deputyuu;
+
+	/**
+	 * ERP对应单据的id
+	 */
+	@Column(name = "deo_erpid")
+	private Long erpid;
+
+	/**
+	 * erp保存的时间
+	 */
+	@Column(name = "deo_erpdate")
+	private Date erpdate;
+
 	/*******************
 	 * 下单明细
 	 *******************/
@@ -698,4 +728,44 @@ public class DeputyOrder implements Serializable {
 		this.enuu = enuu;
 	}
 
+	public String getEntrystatus() {
+		return entrystatus;
+	}
+
+	public void setEntrystatus(String entrystatus) {
+		this.entrystatus = entrystatus;
+	}
+
+	public String getDownloadstatus() {
+		return downloadstatus;
+	}
+
+	public void setDownloadstatus(String downloadstatus) {
+		this.downloadstatus = downloadstatus;
+	}
+
+	public Long getDeputyuu() {
+		return deputyuu;
+	}
+
+	public void setDeputyuu(Long deputyuu) {
+		this.deputyuu = deputyuu;
+	}
+
+	public Long getErpid() {
+		return erpid;
+	}
+
+	public void setErpid(Long erpid) {
+		this.erpid = erpid;
+	}
+
+	public Date getErpdate() {
+		return erpdate;
+	}
+
+	public void setErpdate(Date erpdate) {
+		this.erpdate = erpdate;
+	}
+
 }

+ 14 - 0
src/main/java/com/uas/platform/b2b/model/DeputyOrderItem.java

@@ -89,6 +89,12 @@ public class DeputyOrderItem implements Serializable {
 	@JoinColumn(name = "dei_deoid", nullable = false)
 	private DeputyOrder deputyOrder;
 
+	/**
+	 * 序号
+	 */
+	@Column(name = "dei_detno")
+	private Integer detno;
+
 	public Long getId() {
 		return id;
 	}
@@ -163,4 +169,12 @@ public class DeputyOrderItem implements Serializable {
 		this.deputyOrder = deputyOrder;
 	}
 
+	public Integer getDetno() {
+		return detno;
+	}
+
+	public void setDetno(Integer detno) {
+		this.detno = detno;
+	}
+
 }

+ 14 - 0
src/main/java/com/uas/platform/b2b/model/Vendor.java

@@ -98,6 +98,12 @@ public class Vendor implements Serializable {
 	@OtherUserUU
 	private UserBaseInfo vendorUser;
 	
+	/**
+	 * 客户费率
+	 */
+	@Column(name = "ve_rate")
+	private Double rate;
+
 	/**
 	 * 判断是否被分配
 	 */
@@ -191,6 +197,14 @@ public class Vendor implements Serializable {
 		this.myUser = myUser;
 	}
 
+	public Double getRate() {
+		return rate;
+	}
+
+	public void setRate(Double rate) {
+		this.rate = rate;
+	}
+
 	public boolean getDistribute() {
 		return distribute;
 	}

+ 18 - 0
src/main/java/com/uas/platform/b2b/service/DeputyOrderService.java

@@ -1,5 +1,7 @@
 package com.uas.platform.b2b.service;
 
+import java.util.List;
+
 import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.ui.ModelMap;
 
@@ -31,4 +33,20 @@ public interface DeputyOrderService {
 	 */
 	public DeputyOrder getOrderDetail(Long id);
 
+	/**
+	 * 删除明细行
+	 * 
+	 * @param id
+	 * @return
+	 */
+	public ModelMap deleteProdById(Long id);
+
+	/**
+	 * 根据代采企业uu获取代采列表
+	 * 
+	 * @param enuu
+	 * @return
+	 */
+	public List<DeputyOrder> findByDeputyuu(Long enuu);
+
 }

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

@@ -107,6 +107,9 @@ public class DeputyOrderServiceImpl implements DeputyOrderService {
 	public ModelMap saveDeOrder(DeputyOrder deorder) {
 		ModelMap map = new ModelMap();
 		DeputyOrder order = new DeputyOrder();
+		if (deorder.getId() != null) {
+			order = deputyOrderDao.findOne(deorder.getId());
+		}
 		order.setActualpaydate(deorder.getActualpaydate());
 		order.setActusdpayment(deorder.getActusdpayment());
 		order.setBankaccount(deorder.getBankaccount());
@@ -135,6 +138,7 @@ public class DeputyOrderServiceImpl implements DeputyOrderService {
 		order.setRequirepaydate(deorder.getRequirepaydate());
 		order.setRiskmethod(deorder.getRiskmethod());
 		order.setShipdate(deorder.getShipdate());
+		order.setDownloadstatus("未下载");
 		if (deorder.getStatus().equals("在录入")) {
 			order.setStatus(Status.UNAUDIT.getPhrase());
 			order.setStatuscode(Status.UNAUDIT.value());
@@ -151,22 +155,32 @@ public class DeputyOrderServiceImpl implements DeputyOrderService {
 		order.setVenduser(deorder.getVenduser());
 		order.setVenduseruu(deorder.getVenduseruu());
 		order.setEnuu(SystemSession.getUser().getEnterprise().getUu());
-		List<DeputyOrderItem> items = new ArrayList<DeputyOrderItem>();
-		if (!CollectionUtils.isEmpty(deorder.getDeputyOrderItems())) {
-			for (DeputyOrderItem item : deorder.getDeputyOrderItems()) {
-				Double totalprice = item.getUnitprice() * item.getAmount();
-				item.setDeputyOrder(order);
-				item.setTotalprice(totalprice);
-				items.add(item);
+		order.setEntrystatus(deorder.getEntrystatus());
+		int i = 1;
+		if (order.getId() == null) {// 新增
+			List<DeputyOrderItem> items = new ArrayList<DeputyOrderItem>();
+			if (!CollectionUtils.isEmpty(deorder.getDeputyOrderItems())) {
+				for (DeputyOrderItem item : deorder.getDeputyOrderItems()) {
+					if (item.getId() == null) { // 明细保存只保存新增,旧的数据处理可以删除再新增
+						Double totalprice = item.getUnitprice() * item.getAmount();
+						item.setDeputyOrder(order);
+						item.setTotalprice(totalprice);
+						item.setDetno(item.getDetno());
+						item.setDetno(i);
+						items.add(item);
+						i++;
+					}
+				}
+			}
+			items = deputyOrderItemDao.save(items);
+			if (items.get(0).getId() != null) {
+				map.put("id", items.get(0).getDeputyOrder().getId());
+				logger.log("保存代采订单", "保存代采订单", "新增了一张代采订单");
+			} else {
+				map.put("error", "订单保存失败");
 			}
 		}
-		items = deputyOrderItemDao.save(items);
-		if (items.get(0).getId() != null) {
-			map.put("id", items.get(0).getDeputyOrder().getId());
-			logger.log("保存代采订单", "保存代采订单", "新增了一张代采订单");
-		} else {
-			map.put("error", "订单保存失败");
-		}
+
 		return map;
 	}
 
@@ -175,4 +189,19 @@ public class DeputyOrderServiceImpl implements DeputyOrderService {
 		return deputyOrderDao.findOne(id);
 	}
 
+	@Override
+	public ModelMap deleteProdById(Long id) {
+		ModelMap map = new ModelMap();
+		deputyOrderItemDao.delete(id);
+		map.put("success", "该条明细删除成功");
+		return map;
+	}
+
+	@Override
+	public List<DeputyOrder> findByDeputyuu(Long enuu) {
+		String entryStatus = "已提交";
+		String downloadStatus = "未下载";
+		return deputyOrderDao.getByDeputyuuAndEntrystatusAndDownloadstatus(enuu, entryStatus, downloadStatus);
+	}
+
 }

+ 1 - 0
src/main/webapp/resources/css/index.css

@@ -1620,6 +1620,7 @@ ul>li.item-link>a {
 
 .ng-table-pager {
 	padding: 10px 15px;
+	height: 55px;
 }
 
 .ng-table-pager .pagination {

+ 26 - 28
src/main/webapp/resources/js/index/app.js

@@ -7832,6 +7832,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 				code : $filter('date')(new Date(), 'yyMMddHHmmss_sss'),
 				orderItems : {
 					product : {},
+					$endDateOpen: false
 				},
 		};
 		
@@ -8004,7 +8005,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 		$scope.openDatePicker = function($event, openParam, index) {
 			$event.preventDefault();
 		    $event.stopPropagation();
-		    $scope.order.orderItems[index] = !openParam;
+		    $scope.order.orderItems[index].$endDateOpen = !openParam;
 		};
 		
 		
@@ -9070,6 +9071,22 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 		}
 		
 		$scope.save = function() {
+			$scope.deOrder.entrystatus = '保存';
+			console.log($scope.deOrder);
+			DeputyOrder.saveDeOrder({deOrder: $scope.deOrder}, {}, function(data) {
+				if(data.id) {
+					window.location.hash = "#/purc/deputy/"+data.id;
+				}
+				if(data.error) {
+					toaster.pop('error', '提示', '保存失败');
+				}
+			}, function(response) {
+				
+			});
+		}
+		
+		$scope.submit = function() {
+			$scope.deOrder.entrystatus = '提交';
 			DeputyOrder.saveDeOrder({deOrder: $scope.deOrder}, {}, function(data) {
 				if(data.id) {
 					window.location.hash = "#/purc/deputy/"+data.id;
@@ -9146,6 +9163,7 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 		var loadData = function() {
 			DeputyOrder.getOrderDetail({id: $stateParams.id}, {}, function(data) {
 				$scope.deOrder = data;
+				$scope.deOrder.$editing = false;
 			});
 		};
 		loadData();
@@ -9154,33 +9172,13 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 			return DeputyOrder.getProdList;
 		};
 		
-		 $scope.tableParams = new ngTableParams({
-	            page : 1,
-	            count : 5,
-	            sorting: {
-	            }
-	        }, {
-	            total : 0,
-	            counts: [5, 10, 25, 50],
-	            getData : function($defer, params) {
-	                $scope.loading = true;
-	                var pageParams = params.url();
-	                var realActive = {};
-	                pageParams.searchFilter = { // 筛选条件
-	                    keyword: $stateParams.id,
-	                };
-	                getService().get.call(null, BaseService.parseParams(pageParams), function(page){
-	                    $scope.loading = false;
-	                    if(page) {
-	                        params.total(page.totalElement);
-	                        $defer.resolve(page.content);
-	                    }
-	                }, function(response){
-	                    $scope.loading = false;
-	                    toaster.pop('error', '数据加载失败', response.data);
-	                });
-	            }
-	        });
+		$scope.update = function() {
+			$scope.deOrder.$editing = true;
+		}
+		
+		$scope.cancel = function() {
+			$scope.deOrder.$editing = false;
+		}
 		
 	}]);
 	

+ 4 - 0
src/main/webapp/resources/js/index/services/DeputyOrder.js

@@ -12,6 +12,10 @@ define(['ngResource'], function() {
 			getProdList: {
 				url: 'deputyOrder/getProdList',
 				method: 'GET'
+			},
+			deleteProdById: {
+				url: 'deputyOrder/deleteProdById/:id',
+				method: 'DELETE'
 			}
 		})
 	}]).factory('getDeOrder', ['$resource', function($resource) {

+ 3 - 2
src/main/webapp/resources/tpl/index/home/right.html

@@ -10,7 +10,7 @@
 	
 	<!-- 待处理统计 Start -->
 	<div class="todo">
-		<div class="todo-label list-unstyled" >
+		<div class="todo-label list-unstyled">
 			<i class="fa fa-tasks fa-lg"></i><label>工作任务</label>
 		</div>
 		<div class="todo-content" ng-controller="TodoCtrl">
@@ -83,7 +83,8 @@
 						<a class="col-xs-6" href="">我的供应商(<span ng-class="{'text-inverse': count.vendor>0}">{{count.vendor || 0}}</span>)</a>		
 						<a class="col-xs-6" style="color: #327ebe" href="#/baseInfo/myRquest"><i class="fa fa-plus"></i> 添加供应商</a>	
 						<a class="col-xs-6" style="color: #327ebe" href="#/purc/addOrder"><i class="fa fa-plus"></i> 新增采购单</a>	
-						<a class="col-xs-6" style="color: #327ebe" href="#/sale/quotation/list"><i class="fa fa-plus"></i> 新增报价单</a>		
+						<a class="col-xs-6" style="color: #327ebe" href="#/sale/quotation/new"><i class="fa fa-plus"></i> 新增报价单</a>	
+						<a class="col-xs-6" style="color: #327ebe" href="#/purc/deputy/add"><i class="fa fa-plus"></i> 新增代采订单</a>			
 					</div>
 				</div>
 			</div>

+ 180 - 46
src/main/webapp/resources/tpl/index/purc/deputyOrder_detail.html

@@ -95,11 +95,32 @@ width:135px;
 .purchase_form01 ul li .dropdown-menu span i{
 	color: white;
 }
+
+.purchase_xq dd input{
+ 	border: none;
+	border-bottom: 1px solid #333;
+	height: 35px;
+	width: 80px;
+	font-size: 14px;
+}
+
+.purchase_xq dd input:focus {
+	border-bottom: 1px solid blue;
+}
+
+.purchase .input-group .form-control{
+	border-radius: 0px;
+	border: 1px solid #5078cb;
+}
+
+.purchase .input-group .input-group-btn i{
+	color: #fff;
+}
 </style>
 <div class="warp">
     <div class=" purchase">
         <div class="width100">
-            <div class="com_title">服务>采购模块><font>>代采订单详情</font></div>
+            <div class="com_title">服务>采购模块><font>>代采订单</font></div>
             <div class="com_head"><span>代采订单</span></div>
             <div class="purchase_form">
                 <!--基本信息-->
@@ -129,62 +150,107 @@ width:135px;
                         <li>
                             <div  class="input-group input-trigger date-picker">
                                 <em>主协议签订日期:</em>
-                              	<span ng-bind="deOrder.madealdate| date: 'yyyy-MM-dd'"></span>
+                                <div class="input-group">
+									<input ng-model="deOrder.madealdate" type="text" class="form-control" 
+										placeholder="点击选择时间" datepicker-popup="yyyy-MM-dd" is-open="deOrder.$madealdate"
+										min-date="getMinDate()" ng-required="true"
+										current-text="今天" clear-text="清除" close-text="关闭"
+										datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+										ng-focus="openDatePicker($event, deOrder.madealdate.$dateOpen)" readonly>
+									<span class="input-group-btn">
+										<button type="button" class="btn btn-default btn-sm"
+											ng-click="openDatePicker($event, deOrder, '$madealdate')">
+											<i class="fa fa-calendar fa-lg"></i>
+										</button>
+									</span>
+                                </div>
                             </div>
                             
                             <div class="fr">
                                 <em>主协议编号:</em>
-                                <span ng-bind="deOrder.madealcode"></span>
+                                <span><input type="text" class="input01" ng-model="deOrder.madealcode" ng-readonly="!deOrder.$editing"></span>
                             </div>
                         </li>
                         <li>
                             <div class="fl">
                                 <em>终端供应商名称:</em>
-                                <span  ng-bind="deOrder.tervendor"></span>
+                                <span><input type="text" class="input01" ng-model="deOrder.tervendor" ng-readonly="!deOrder.$editing"></span>
                             </div>
                             <div class="fr">
                                 <em>电话:</em>
-                                <span ng-bind="deOrder.vendtel"></span>
+                                <span><input type="text" class="input01" ng-model="deOrder.vendtel" ng-readonly="!deOrder.$editing"></span>
                             </div>
                         </li>
                         <li>
                             <div class="fl">
                                 <em>联系人:</em>
-                                <span ng-bind="deOrder.venduser"></span>
+                                <span><input type="text" class="input01" ng-model="deOrder.venduser" ng-readonly="!deOrder.$editing"></span>
                             </div>
                             <div class="fr">
                                 <em>供应商发货时间:</em>
                                  <div class="input-group">
-									<span ng-bind="deOrder.shipdate| date: 'yyyy-MM-dd'"></span>
+									<input ng-model="deOrder.shipdate" type="text" class="form-control" 
+										placeholder="点击选择时间" datepicker-popup="yyyy-MM-dd" is-open="deOrder.$shipdate"
+										min-date="getMinDate()" ng-required="true"
+										current-text="今天" clear-text="清除" close-text="关闭"
+										datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+										ng-focus="openDatePicker($event, deOrder.$dateOpen)"  ng-readonly="!deOrder.$editing">
+									<span class="input-group-btn">
+										<button type="button" class="btn btn-default btn-sm"
+											ng-click="openDatePicker($event, deOrder, '$shipdate')">
+											<i class="fa fa-calendar fa-lg"></i>
+										</button>
+									</span>
                                 </div>
                             </div>
                         </li>
                         <li>
                             <div class="fl">
                                 <em>货物包装要求:</em>
-                                <span ng-bind="deOrder.goodspacking"></span>
+                                <span><input type="text" class="input01" ng-model="deOrder.goodspacking"  ng-readonly="!deOrder.$editing"></span>
                             </div>
                             <div class="fr">
                                 <em>供应商交货方式:</em>
-                                <span ng-bind="deOrder.deliverymethod">
+                                <span>
+                                    <select class="select" ng-model="deOrder.deliverymethod" ng-init="deOrder.deliverymethod = '1'" ng-readonly="!deOrder.$editing">
+                                        <option value="1">交货方式01</option>
+                                        <option value="2">交货方式02</option>
+                                        <option value="3">交货方式03</option>
+                                    </select>
                                 </span>
                             </div>
                         </li>
                         <li>
                             <div class="fl">
                                 <em>我方提货方式:</em>
-                                <span ng-bind="deOrder.pickupmethod">
+                                <span>
+                                    <select name="" class="select" ng-model="deOrder.pickupmethod" ng-init="deOrder.pickupmethod = '自提'" ng-readonly="!deOrder.$editing">
+                                        <option value="自提">自提</option>
+                                        <option value="委托第三方提货">委托第三方提货</option>
+                                        <option value="贵公司送货">贵公司送货</option>
+                                        <option value="其他">其他</option>
+                                    </select>
                                 </span>
                             </div>
                             <div class="fr">
                                 <em>我方付款方式:</em>
-                                <span ng-bind="deOrder.paymentmethod">
+                                <span>
+                                    <select name="" class="select" ng-model="deOrder.paymentmethod" ng-init="deOrder.paymentmethod = 'T'" ng-readonly="!deOrder.$editing">
+                                        <option value="T">T</option>
+                                        <option value="T支付">T支付</option>
+                                    </select>
                                 </span>
                             </div>
                         </li>
+                        <li>
+                         	<div class="fr">
+                                <em>我方提货时间:</em>
+                               <span><input type="text" class="input01" ng-model="deOrder.pickupdate" ng-readonly="!deOrder.$editing"></span>
+                            </div>
+                        </li>
                     </ul>
                 </div>
-                <div class="com_title01"><span>下单明细(注:金额单位为USD)</span> </div>
+                <div class="com_title01"><span>下单明细(注:金额单位为USD)</span><a ng-click="uplodaByBatch()" ng-readonly="!deOrder.$editing">批量导入</a>  </div>
                 <div class="purchase_xq clearfix">
                     <dl>
                         <dt>
@@ -197,19 +263,28 @@ width:135px;
                             <span>订单单价</span>
                             <span>采购总额</span>
                             <span>备注</span>
+                            <span>操作</span>
                         </dt>
                         <dd ng-repeat="item in deOrder.deputyOrderItems">
                             <span class="wid01">{{$index+1}}</span>
-                            <span>{{item.prodname}}</span>
-                            <span>{{item.prodcode}}</span>
-                            <span>{{item.prodspec}}</span>
-                            <span>{{item.amount}}</span>
-                            <span>{{item.unitprice}}</span>
-                            <span>{{item.unitprice}}</span>
-                            <span>{{item.unitprice * item.amount}}</span>
-                            <span>{{item.remark}}</span>
+                            <span><input type="text" class="text-center" ng-model="item.prodname"></span>
+                            <span><input type="text" class="text-center" ng-model="item.prodcode"></span>
+                            <span><input type="text" class="text-center" ng-model="item.prodspec"></span>
+                            <span><input type="text" class="text-center" ng-model="item.amount"></span>
+                            <span><input type="text" class="text-center" ng-model="item.unitprice"></span>
+                            <span></span>
+                            <span>{{item.unitprice * item.amount | number: 2}}</span>
+                            <span><input type="text" class="text-center" ng-model="item.remark"></span>
+                            <span><a ng-click="add($index)" style="color: #1f4fb2">添加</a><a ng-click="del($index)" style="color: #d32526"> 删除</a></span>
                         </dd>
                     </dl>
+                 <!--    <div class="page fl">
+                        <ul>
+                            <li><a href="#">上一页</a> </li>
+                            <li>第<input type="text" placeholder="3">页&nbsp;共6页</li>
+                            <li><a href="#">下一页</a> </li>
+                        </ul>
+                    </div> -->
                 </div>
                 <!--采购订单-->
                 <div class="com_title01"><span>采购订单</span></div>
@@ -221,30 +296,47 @@ width:135px;
                                 <span >${{deOrder.totalamount}}</span>
                             </div>
                             <div class="fr">
+                            	 <em>订单总价款:</em>
+                                <span >${{deOrder.orderamount}}</span>
+                            </div>
+                        </li>
+                        <li>
+                        	<div class="fl">
                                 <em>我方付款提货时间:</em>
                                  <div class="input-group">
-									<span ng-bind="deOrder.paydeldate| date: 'yyyy-MM-dd'"></span>
+									<input ng-model="deOrder.paydeldate" type="text" class="form-control" 
+										placeholder="点击选择时间" datepicker-popup="yyyy-MM-dd" is-open="deOrder.$paydeldate"
+										min-date="getMinDate()" ng-required="true"
+										current-text="今天" clear-text="清除" close-text="关闭"
+										datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+										ng-focus="openDatePicker($event, deOrder.$dateOpen)" ng-readonly="!deOrder.$editing">
+									<span class="input-group-btn">
+										<button type="button" class="btn btn-default btn-sm"
+											ng-click="openDatePicker($event, deOrder, '$paydeldate')">
+											<i class="fa fa-calendar fa-lg"></i>
+										</button>
+									</span>
                                 </div>
                             </div>
                         </li>
                         <li>
                             <div class="fl">
                                 <em>我方付款金额:</em>
-                                <span>${{deOrder.totalpayament}}</span>
+                                <span >${{deOrder.totalpayament}}</span>
                             </div>
                             <div class="fr">
                                 <em>我方付款日期:</em>
-                                <span ng-bind="deOrder.paymentdate| date: 'yyyy-MM-dd'"></span>
+                                <span ng-bind="deOrder.paymentdate"></span>
                             </div>
                         </li>
                         <li>
                             <div class="fl">
                                 <em>风险承担方式:</em>
-                                <span ng-bind="deOrder.riskmethod"></span>
+                                <span><input type="text" class="input01" ng-model="deOrder.riskmethod" ng-readonly="!deOrder.$editing"></span>
                             </div>
                             <div class="fr">
                                 <em>运、税费承担方式:</em>
-                                <span ng-bind="deOrder.taxpaymentmethod"></span>
+                                <span><input type="text" class="input01" ng-model="deOrder.taxpaymentmethod" ng-readonly="!deOrder.$editing"></span>
                             </div>
                         </li>
                     </ul>
@@ -256,20 +348,31 @@ width:135px;
                         <li>
                             <div class="fl wid100">
                                 <em>终端供应商地址:</em>
-                                <span ng-bind="deOrder.tervendaddress"></span>
+                                <span><input type="text" class="input01" ng-model="deOrder.tervendaddress" ng-readonly="!deOrder.$editing"></span>
                             </div>
                         </li>
                         <li>
                             <div class="fl wid100">
                                 <em>公司全称(英文):</em>
-                                <span ng-bind="deOrder.companyname"></span>
+                                <span><input type="text" class="input01" ng-model="deOrder.companyname" ng-readonly="!deOrder.$editing"></span>
                             </div>
                         </li>
                         <li>
                             <div class="fl">
                                 <em>要求付汇日期:</em>
                                  <div class="input-group">
-									<span ng-bind="deOrder.requirepaydate| date: 'yyyy-MM-dd'"></span>
+									<input ng-model="deOrder.requirepaydate" type="text" class="form-control" 
+										placeholder="点击选择时间" datepicker-popup="yyyy-MM-dd" is-open="deOrder.$requirepaydate"
+										min-date="getMinDate()" ng-required="true"
+										current-text="今天" clear-text="清除" close-text="关闭"
+										datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+										ng-focus="openDatePicker($event, deOrder.$dateOpen)"  ng-readonly="!deOrder.$editing">
+									<span class="input-group-btn">
+										<button type="button" class="btn btn-default btn-sm"
+											ng-click="openDatePicker($event, deOrder, '$requirepaydate')">
+											<i class="fa fa-calendar fa-lg"></i>
+										</button>
+									</span>
                                 </div>
                             </div>
                             <div class="fr">
@@ -280,7 +383,7 @@ width:135px;
                         <li>
                             <div class="fl">
                                 <em>付款金额(USD):</em>
-                                <span ng-bind="deOrder.usdpayment"></span>
+                                <span><input type="text" class="input01" ng-model="deOrder.usdpayment"  ng-readonly="!deOrder.$editing"></span>
                             </div>
                             <div class="fr">
                                 <em>实际付款金额(USD):</em>
@@ -290,27 +393,27 @@ width:135px;
                         <li>
                             <div class="fl">
                                 <em>银行名称(英文):</em>
-                                <span ng-bind="deOrder.bankname"></span>
+                                <span><input type="text" class="input01" ng-model="deOrder.bankname"  ng-readonly="!deOrder.$editing"></span>
                             </div>
                             <div class="fr">
                                 <em>银行账号:</em>
-                                <span ng-bind="deOrder.bankaccount"></span>
+                                <span><input type="text" class="input01" ng-model="deOrder.bankaccount"  ng-readonly="!deOrder.$editing"></span>
                             </div>
                         </li>
                         <li>
                             <div class="fl wid100">
                                 <em>银行地址(英文):</em>
-                                <span ng-bind="deOrder.bankaddress"></span>
+                                <span><input type="text" class="input01" ng-model="deOrder.bankaddress"  ng-readonly="!deOrder.$editing"></span>
                             </div>
                         </li>
                         <li>
                             <div class="fl">
                                 <em>银行代码:</em>
-                                <span ng-bind="deOrder.bankcode"></span>
+                                <span><input type="text" class="input01" ng-model="deOrder.bankcode"  ng-readonly="!deOrder.$editing"></span>
                             </div>
                             <div class="fr">
                                 <em>其它相关资料:</em>
-                                <span ng-bind="deOrder.otherdata"></span>
+                                <span><input type="text" class="input01" ng-model="deOrder.otherdata"  ng-readonly="!deOrder.$editing"></span>
                             </div>
                         </li>
                     </ul>
@@ -321,40 +424,56 @@ width:135px;
                     <ul>
                         <li>
                             <div class="fl">
-                                <em>方法定代表人: </em>
-                                <span ng-bind="deOrder.legalrepresent"></span>
+                                <em>供应商方法定代表人: </em>
+                                <span><input type="text" class="input01" ng-model="deOrder.legalrepresent"  ng-readonly="!deOrder.$editing"></span>
                             </div>
                             <div class="fr">
-                                <em>方电话:</em>
-                                <span ng-bind="deOrder.usertel"></span>
+                                <em>供应商方电话:</em>
+                                <span><input type="text" class="input01" ng-model="deOrder.usertel"  ng-readonly="!deOrder.$editing"></span>
                             </div>
                         </li>
                         <li>
                             <div class="fl wid100">
-                                <em>方地址:</em>
-                                <span ng-bind="deOrder.enaddress"></span>
+                                <em>供应商方地址:</em>
+                                <span><input type="text" class="input01" ng-model="deOrder.enaddress"  ng-readonly="!deOrder.$editing"></span>
                             </div>
                         </li>
                         <li>
                             <div class="fl">
-                                <em>方传真: </em>
-                                <span ng-bind="deOrder.enfax"></span>
+                                <em>供应商方传真: </em>
+                                <span><input type="text" class="input01" ng-model="deOrder.enfax"  ng-readonly="!deOrder.$editing"></span>
                             </div>
                             <div class="fr">
                                 <em>客户名称:</em>
-                                <span ng-bind="deOrder.customer"></span>
+                                <span><input type="text" class="input01" ng-model="deOrder.customer"  ng-readonly="!deOrder.$editing"></span>
                             </div>
                         </li>
                         <li>
                             <div class="fl">
                                 <em>货款支付方式:</em>
-                                <span ng-bind="deOrder.paymethod">
+                                <span>
+                                    <select name="" class="select" ng-model="deOrder.paymethod" ng-init="deOrder.paymethod = '1'"  ng-readonly="!deOrder.$editing">
+                                        <option value="1">月结30天</option>
+                                        <option value="2">交货方式02</option>
+                                        <option value="3">交货方式03</option>
+                                    </select>
                                 </span>
                             </div>
                             <div class="fr">
                                 <em>货款支付时间:</em>
                                  <div class="input-group">
-                                 	<span ng-bind="deOrder.paydate| date: 'yyyy-MM-dd'"></span>
+									<input ng-model="deOrder.paydate" type="text" class="form-control" 
+										placeholder="点击选择时间" datepicker-popup="yyyy-MM-dd" is-open="deOrder.$paydate"
+										min-date="getMinDate()" ng-required="true"
+										current-text="今天" clear-text="清除" close-text="关闭"
+										datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+										ng-focus="openDatePicker($event, deOrder.$dateOpen)"  ng-readonly="!deOrder.$editing">
+									<span class="input-group-btn">
+										<button type="button" class="btn btn-default btn-sm"
+											ng-click="openDatePicker($event, deOrder, '$paydate')">
+											<i class="fa fa-calendar fa-lg"></i>
+										</button>
+									</span>
                                 </div>
                             </div>
                         </li>
@@ -362,13 +481,28 @@ width:135px;
                             <div class="fl">
                                 <em>交货时间:</em>
                                  <div class="input-group">
-                                 	<span ng-bind="deOrder.deliverydate| date: 'yyyy-MM-dd'"></span>
+									<input ng-model="deOrder.deliverydate" type="text" class="form-control" 
+										placeholder="点击选择时间" datepicker-popup="yyyy-MM-dd" is-open="deOrder.$deliverydate"
+										min-date="getMinDate()" ng-required="true"
+										current-text="今天" clear-text="清除" close-text="关闭"
+										datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+										ng-focus="openDatePicker($event, deOrder.$dateOpen)"  ng-readonly="!deOrder.$editing">
+									<span class="input-group-btn">
+										<button type="button" class="btn btn-default btn-sm"
+											ng-click="openDatePicker($event, deOrder, '$deliverydate')">
+											<i class="fa fa-calendar fa-lg"></i>
+										</button>
+									</span>
                                 </div>
                             </div>
                             <div class="fr"></div>
                         </li>
                     </ul>
                 </div>
+                <div class="save" ng-if="!deOrder.$editing"><a ng-click="update()">更新</a></div>
+                <div class="save" ng-if="deOrder.$editing"><a href="#" ng-click="save()">提交</a> </div>
+                <div class="save" ng-if="deOrder.$editing"><a ng-click="cancel()">取消</a></div>
+            </div>
         </div>
     </div>
 </div>

+ 1 - 0
src/main/webapp/resources/tpl/index/purc/deputyOrder_new.html

@@ -500,6 +500,7 @@ width:135px;
                     </ul>
                 </div>
                 <div class="save"><a href="#" ng-click="save()">保存</a> </div>
+                <div class="save"><a href="#" ng-click="submit()">提交</a> </div>
             </div>
         </div>
     </div>

+ 1 - 1
src/main/webapp/resources/tpl/index/purc/modal/purc_order_cust.html

@@ -26,7 +26,7 @@
 				<td class="text-center" ng-bind="::customer.myEnterprise.uu"></td>
 				<td class="text-center" ng-bind="::customer.myEnterprise.enName"></td>
 				<td class="text-center" ng-bind="::customer.myEnterprise.enAddress"></td>
-				<td class="text-center"><a title="选择" href="javascript:void(0)" ng-click="check(customer)"><i class="fa fa-check-square-o"></i></a></td>
+				<td class="text-center"><a title="选择" href="javascript:void(0)" ng-click="check(customer)"><i class="fa fa-circle-o"></i></a></td>
 			</tr>
 		</tbody>
 	</table>

+ 2 - 2
src/main/webapp/resources/tpl/index/purc/order.html

@@ -168,8 +168,8 @@
 				<div class="search">
 					<div class="form-group form-group-sm has-feedback" dropdown auto-close="outsideClick" on-toggle="searchAdvance=open">
 						<input type="search" class="form-control input-sm" ng-model="keyword" ng-search="onSearch()" placeholder="输入商品、客户名称或单据流水号搜索" />
-						<div class="search-advance text-link" ng-class="{'active': searchAdvance}" dropdown-toggle>高级搜索</div>
-						<div id="searchContainer" class="dropdown-menu">
+<!-- 						<div class="search-advance text-link" ng-class="{'active': searchAdvance}" dropdown-toggle>高级搜索</div>
+ -->						<div id="searchContainer" class="dropdown-menu">
 						</div>
 						<span class="form-control-feedback text-simple"><i class="fa fa-search"></i></span>
 					</div>

+ 5 - 0
src/main/webapp/resources/tpl/index/search/search_result.html

@@ -170,6 +170,9 @@
 .enterprise-bd a {
 	border-radius: 0px;
 }
+.enterprise-table tbody {
+	margin-bottom: 10px;
+}
 </style>
 <div class="block" style="margin-left: -240px; width: 1100px;">
 	<div class="tip-body">
@@ -236,6 +239,8 @@
 			</tr>
 		</tbody>
 	</table>
+	<div style="height: 30px; background-color: #f5f5f5">
+	</div>
 	<div class="loading in" ng-class="{'in': loading}">
 		<i></i>
 	</div>