tudc 3 年之前
父节点
当前提交
914d7558ec

+ 42 - 7
adm/src/main/java/com/minpay/guomao/stockManage/WarehouseDistributionAction.java

@@ -392,6 +392,46 @@ public class WarehouseDistributionAction implements IMINAction {
 			throw new MINBusinessException("未获取到订单信息,请重新选择订单!");
 		}
 		
+		if(tableDataArray.size() == 0) {
+			throw new MINBusinessException("未获取到配货信息!");
+		}
+		
+		ApWarehouseStock stockInf = Service.lookup(IMINDataBaseService.class)
+				.getMybatisMapper(ApWarehouseStockMapper.class)	
+				.selectByPrimaryKey(awstId);
+		
+		if(!CommonUtil.isYHL(user.getBranchId())) {
+			// 校验货源方
+			String saleId = ((Map<String, String>)tableDataArray.get(0)).get("saleId");
+			for(int i = 0 ;i < tableDataArray.size();i++){
+				Map<String, String> map = (Map<String, String>) tableDataArray.get(i);
+				if(!saleId.equals(map.get("saleId"))) {
+					throw new MINBusinessException("请选择相同的货源方!");
+				}
+			}
+			
+			// 已经存在的配货
+			ApWarehouseDetailExample warehouseDetailExample = new ApWarehouseDetailExample();
+			warehouseDetailExample.createCriteria().andStockIdEqualTo(awstId).andTypeNotEqualTo("99");
+			List<ApWarehouseDetail> warehouseDetailList = Service.lookup(IMINDataBaseService.class)
+				.getMybatisMapper(ApWarehouseDetailMapper.class).selectByExample(warehouseDetailExample);
+			
+			if(warehouseDetailList.size() > 0) {
+				List<String> oldIdList = CommonUtil.getIdFromList(warehouseDetailList, "oldId");
+				warehouseDetailExample.clear();
+				warehouseDetailExample.createCriteria().andIdIn(oldIdList);
+				warehouseDetailList = Service.lookup(IMINDataBaseService.class)
+				.getMybatisMapper(ApWarehouseDetailMapper.class).selectByExample(warehouseDetailExample);
+				
+				List<String> buyIdList = CommonUtil.getIdFromList(warehouseDetailList, "sellerId");
+				if(!buyIdList.contains(saleId)) {
+					throw new MINBusinessException("选择的配货数据货源方与已配货的数据货源方不一致,请重新选择或清空原配货数据后再次配货!");
+				}
+			}
+		}
+		
+		
+		
 		List<ApWarehouseDetail> detailList = new ArrayList<>();
 		for(int i = 0 ;i < tableDataArray.size();i++){
 			//代表每个仓单的数据
@@ -428,17 +468,12 @@ public class WarehouseDistributionAction implements IMINAction {
 			List<ApProductSpecRel> list3 = Service.lookup(IMINDataBaseService.class)
 													.getMybatisMapper(ApProductSpecRelMapper.class)
 													.selectByExample(relExample);
+			
 			String danjia = "";
-			ApWarehouseStock stockInf  = null;
-			if(!CommonUtil.isEmpty(awstId)){
-				
-				stockInf = Service.lookup(IMINDataBaseService.class)
-						.getMybatisMapper(ApWarehouseStockMapper.class)	
-						.selectByPrimaryKey(awstId);
+			if(stockInf != null){
 				if(!stockInf.getStandardId().equals(list3.get(0).getSpecNo())){
 					throw new MINBusinessException("第"+(i+1)+"条数据规格不符,请检查规格值");
 				}
-				
 				if(!CommonUtil.isYHL(user.getBranchId())) {
 					danjia = stockInf.getRealPrice();
 				}

+ 9 - 14
adm/src/main/resources/com/minpay/db/table/own/mapper/StockManageMapper.xml

@@ -442,11 +442,13 @@
 		 			ad.AWD_CARD_NO		"cardNo",
 		 			ad.AWD_BRAND_ID		"abfId",
 		 			abi.ABF_NAME		"abfName",
-		 			com1.ACI_SHORT_NAME 	"buyName",
-		 			com2.ACI_SHORT_NAME 	"saleName",
+		 			ad.AWD_BUYER_ID 	"buyId",
+		 			ad.AWD_BUYER_NAME 	"buyName",
+		 			ad.AWD_SELLER_ID 	"saleId",
+		 			ad.AWD_SELLER_NAME 	"saleName",
 		 			ad.AWD_BOX_NO		"boxNo",
 		 			ad.AWD_LICENSE_NUMBER "licenseNumber",
-		 			aci.ACI_CONTRACT_NO		"contractNo",
+		 			ad.AWD_CONTRACT_NO		"contractNo",
 		 			ifnull(substr(ad.AWD_ENTRY_TIME,1,8),'')		entryTime,
 		 			 ROUND(ad.AWD_AVL_WEIGHT*ad.AWD_UNIT_PRICE,2)		"zongjine",
 		  			(ROUND(ad.AWD_AVL_WEIGHT*ad.AWD_UNIT_PRICE/(1.13),2)) "bhs",
@@ -466,13 +468,6 @@
 		      ON ap.API_ID = ae.ASR_PRODUCT_ID
 		 LEFT JOIN  ap_brand_inf		 abi 
 		      ON abi.ABF_ID = ad.AWD_BRAND_ID
-		 LEFT JOIN  ap_contract_inf      aci 
-		      ON o.AOI_CONTRACT_ID = aci.ACI_ID
-		 LEFT JOIN ap_company_inf com1    
-		      ON com1.ACI_ID = aci.ACI_BUYER_ID 
-		 LEFT JOIN ap_company_inf com2   
-		      ON com2.ACI_ID = aci.ACI_SELLER_ID 
-		
 		WHERE 1=1
 		<if test="dates !=null and dates != ''">
 	     	and substr(ad.AWD_CREATE_TIME,1,8) between substr((#{dates, jdbcType=VARCHAR}),1,8)
@@ -489,10 +484,10 @@
 			and ap.API_NAME like concat('%',#{proName,jdbcType=VARCHAR},'%')
 		</if>
 		<if test="buyName != null and buyName != ''">
-			and com1.ACI_SHORT_NAME like concat('%',#{buyName,jdbcType=VARCHAR},'%')
+			and ad.AWD_BUYER_NAME like concat('%',#{buyName,jdbcType=VARCHAR},'%')
 		</if>
 		<if test="saleName != null and saleName != ''">
-			and com2.ACI_SHORT_NAME like concat('%',#{saleName,jdbcType=VARCHAR},'%')
+			and ad.AWD_SELLER_NAME like concat('%',#{saleName,jdbcType=VARCHAR},'%')
 		</if>
 		<if test="warehouseName != null and warehouseName != ''">
 			and aw.AWI_NAME like concat('%',#{warehouseName,jdbcType=VARCHAR},'%')
@@ -537,7 +532,7 @@
 		  ad.AWD_TYPE 				"type",
 		  ad.AWD_WEIGHT 			"weight",
 		  ad.AWD_UNIT_PRICE 		"unitPrice",
-		  ad.AWD_TAOTAL_PRICE 			"allPrice",
+	  	  ad.AWD_TAOTAL_PRICE 	    "allPrice",
 		  ad.AWD_LOGISTICS_ID 		"logisticsId",
 		  ae.ASR_SPEC_NO			"standardId",
 		  ae.ASR_VALUE 				"spValue",
@@ -551,7 +546,7 @@
 		  ad.AWD_STANDARD_ID 		"spId",
 		  ad.AWD_WAREHOUSE_ID 		"warehouseId" ,
 		  ad.AWD_TAX 				"tax",
-		  ad.AWD_HAS_AMOUNT					"awTotalId",
+		  ad.AWD_HAS_AMOUNT			"awTotalId",
 		  ad.AWD_CARD_NO			"cardNo",
 		  ad.AWD_BRAND_ID			"abfId",
 		  abi.ABF_NAME				"abfName",

+ 34 - 3
adm/src/main/webapp/admin/giveOutManage/freightPrinting.html

@@ -18,6 +18,9 @@
 		    text-overflow: !important;
 		    white-space: nowrap !important;
 		}
+		.printChuku{
+			display: none;
+		}
     </style>
 </head>
 
@@ -63,7 +66,7 @@
 			 </button>
 		</div>
 		<div id="big" style = "display : none">
-			<div style="margin-bottom: 24px;border-bottom: 1px black solid;width: 100%;height: 127px;">
+			<div style="margin-bottom: 24px;border-bottom: 1px black solid;width: 100%;height: 127px; display: none;" id = "headImg">
 				<img src="../../images/wlHead.jpg" style="
 			    width: 80%;
 			    margin-left: 10%;
@@ -85,6 +88,21 @@
 					<br>
 					<div style = "width:980px;margin-top: 20px;">
 						<table id="tableTest" lay-filter="tableFilter" ></table>
+						
+						<table id="tableTestPrint"  style="display: none;width: 100%;" class="printChuku">
+							<thead style = "padding-left:24px;padding-right:24px;">
+							<tr>
+								<th>运费结算月</th>
+								<th>发出库</th>
+								<th>到站地</th>
+								<th>到货重量</th>
+								<th>运费单价(元)</th>
+								<th>运费(元)</th>
+							</tr>
+							</thead>
+							<tbody id ="small" style = "padding-left:24px;padding-right:24px;">
+							</tbody>
+						</table>
 					</div>
 				</div>		
 			</div>
@@ -240,7 +258,6 @@
     					,page: false
     					,done: function(res, curr, count){
 	    					 //如果是异步请求数据方式,res即为你接口返回的信息。
-	    			        console.log(res);
 	    			        $("#big").show();
 	    					// 处理合计行
 	   						var trs = $("tbody").find("tr");
@@ -312,7 +329,22 @@
 
 	//打印
   	$(document).on('click','#printBtn',function(){
+  		var tableData = table.cache['tableTest'];
+  		var printTableHtml = "";
+  		for (var i = 0; i < tableData.length; i ++) {
+  			var inf = tableData[i];
+  			printTableHtml += '<tr><td>' + (isEmpty(inf.strh)?'合计':inf.strh) + '</td><td>' + (isEmpty(inf.deliver)?'':inf.deliver) 
+  							+ '</td><td>' + (isEmpty(inf.arrive)?'':inf.arrive) + '</td><td>' + (isEmpty(inf.weight)?'':inf.weight) + '</td><td>' 
+  							+ (isEmpty(inf.price)?'':inf.price) + '</td><td>' + (isEmpty(inf.totalPriceII)?'':inf.totalPriceII) + '</td></tr>';
+  		}
+  		$("#small").html(printTableHtml);
+  		$(".layui-table-view").hide();
+  		$("#headImg").show();
+  		$("#tableTestPrint").show();
 	    $("#big").jqprint();
+		$("#headImg").hide();
+		$("#tableTestPrint").hide();
+		$(".layui-table-view").show();
 	});
 	//保存
   	$(document).on('click','#saveBtn',function(){
@@ -346,7 +378,6 @@
    					$.SuccAlert("保存成功!");
    				}
    			}
-   		 
    		})
 	}
 	

+ 13 - 20
adm/src/main/webapp/admin/stockManage/enteringReceipt.html

@@ -137,7 +137,6 @@
  		        ,{field: 'cardNo', title:'卡号',width:'6%'}
 			    ,{field: 'boxNo', title:'箱号',width:'6%'}
 			    ,{field: 'remarks', title: '备注', width:'10%'}
- 		      	,{field: 'standardId', title: '规格编号',width:'10%'}
 			    ,{field: 'unitPrice', title: '单价', width:'6%'}
 			    ,{field: 'typeDesc', title: '类型', width:'6%'}
 			    ,{field: 'allPrice', title: '总价', width:'6%'}
@@ -148,7 +147,6 @@
 			    ,{field: 'modifyTime', title: '修改时间', width:'15%',fixed:'right'}
 		    ]]
 		    ,done: function(res, curr, count){
-		        $("[data-field='standardId']").css('display','none');
 		    }
 		    ,even: true //开启隔行背景
 		  });
@@ -165,24 +163,18 @@
 		    }
 		});
 		 
-			table.on('checkbox(tableFilter)', function(obj){
-				  console.log(obj.checked); //当前是否选中状态
-				  console.log(obj.data); //选中行的相关数据
-				  console.log(obj.type); //如果触发的是全选,则为:all,如果触发的是单选,则为:one
-				  var checkStatus = table.checkStatus('tableTest'); //idTest 即为基础参数 id 对应的值
-				  console.log(checkStatus.data) //获取选中行的数据
-				  var checkData = checkStatus.data;
-				  var checkWeight = 0;
-				  var checkreaWeight = 0;
-				  for (var i = 0; i < checkData.length; i ++) {
-					  checkWeight = accAdd(checkWeight,checkData[i].weight,4);
-					  checkreaWeight = accAdd(checkreaWeight,checkData[i].reaWeight,4);
-				  }
-				  console.log(checkWeight);
-				  console.log(checkreaWeight);
-				  $("#totalWeight").val(checkWeight);
-				  $("#totalReaWeight").val(checkreaWeight);
-			});
+		table.on('checkbox(tableFilter)', function(obj){
+			  var checkStatus = table.checkStatus('tableTest'); //idTest 即为基础参数 id 对应的值
+			  var checkData = checkStatus.data;
+			  var checkWeight = 0;
+			  var checkreaWeight = 0;
+			  for (var i = 0; i < checkData.length; i ++) {
+				  checkWeight = accAdd(checkWeight,checkData[i].weight,4);
+				  checkreaWeight = accAdd(checkreaWeight,checkData[i].reaWeight,4);
+			  }
+			  $("#totalWeight").val(checkWeight);
+			  $("#totalReaWeight").val(checkreaWeight);
+		});
 	});
 
 	$(document).on('click','#transferWarehouse',function(){
@@ -198,6 +190,7 @@
 			layer.msg('请选择出库订单!', {icon: 5});
     		return;
 		}
+		
 		layer.confirm('是否确认进行配货?', function(index){
 			$.request({
 				action : 'WarehouseDistributionAction/warehouseReceiptTransfer',

+ 9 - 2
adm/src/main/webapp/admin/stockManage/enteringStock.html

@@ -460,8 +460,15 @@
 				layer.msg('请选择出库时间!', {icon: 5});
 	    		return;
 			}
-	      }
-					
+	    }
+		
+ 		let saleId = tabData[0].saleId;
+		for(let d of tabData) {
+			if(saleId != d.saleId){
+				layer.msg('请选择相同的货源方!', {icon: 5});
+	    		return;
+			}
+		}
 		
 		
 		layer.confirm('是否确认进行配货?', function(index){

+ 15 - 5
adm/src/main/webapp/admin/stockManage/enteringWarehouseCheckMore.html

@@ -11,19 +11,21 @@
    		.layui-table-cell{
    			text-overflow: unset;
    		}
+   		@media screen {
+		      tfoot {
+		        display : none
+		      }
+   		}
    	</style>
 </head>
 
 <body class="body-content">
-
 		<div class="f-body">
 			<div class="f-title f14-black-w">
 				库存信息
 				<h6 style="color: red; margin-top: 5px;" >出库单号:</h6>
 				<input type="tel" name="ckId"  id="ckId" placeholder="" class="search-select">
 			</div>
-		
-		
 			<div class="f-content display" style="overflow: hidden">
 				<div class="layui-form-item box-button"  style="z-index: 102;">
 		    		<div class="layui-inline" style="margin-left: 24px;">
@@ -112,6 +114,13 @@
 					 
 				</tbody>
 			
+			    <tfoot>
+			      <tr>
+			        <td colspan="8" style = "border: none; text-align: right; font-size: 8pt;">
+			          <a id = "yejiao">页脚内容</a>
+			        </td>
+			      </tr>
+			    </tfoot>
 			</table>
 			
 			<div id="DivFoot" style = "margin: 4px 24px;padding-bottom: 24px;">
@@ -157,8 +166,9 @@
   		$("#tableTestOne").show();
   		var totalWeight = $("#selectweight").val();
   		$("#totalWeight").html(totalWeight);
-  		var ckId = $("#ckId").val();
-  		$("#outNumber").html(ckId);
+//   		var ckId = $("#ckId").val();
+//   		$("#outNumber").html(ckId);
+  		$("#yejiao").text("No:" + new Date().getTime());
 	    $("#big").jqprint();
 	});