|  | @@ -187,6 +187,9 @@ $(function () {
 | 
	
		
			
				|  |  |              successMesage(res);
 | 
	
		
			
				|  |  |          });
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  | +    $("#btn_daily").click(function (t) {
 | 
	
		
			
				|  |  | +        setPrintHtml();
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  |  });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  /**
 | 
	
	
		
			
				|  | @@ -566,6 +569,14 @@ function initDetailed() {
 | 
	
		
			
				|  |  |          $("#div_bar_code").hide();
 | 
	
		
			
				|  |  |          $("#manuNo").attr("disabled",false);
 | 
	
		
			
				|  |  |          $("#confirmFlag").val()==1?$("#addDetailed").attr("disabled",true):$("#addDetailed").attr("disabled",false);
 | 
	
		
			
				|  |  | +        let rowData = $("#tb_table_detailed").jqGrid("getRowData")[0];
 | 
	
		
			
				|  |  | +        if(rowData){
 | 
	
		
			
				|  |  | +            $("#reptNo").val(rowData['reptNo']);
 | 
	
		
			
				|  |  | +            $("#reptDate").val(rowData['reptDate']);
 | 
	
		
			
				|  |  | +        }else{
 | 
	
		
			
				|  |  | +            $("#reptNo").val(null);
 | 
	
		
			
				|  |  | +            $("#reptDate").val(null);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |      $("#removeDetailed").on('click', function () {
 | 
	
		
			
				|  |  |          if($("#confirmFlag").val() == 1){
 | 
	
	
		
			
				|  | @@ -722,3 +733,74 @@ function initBar() {
 | 
	
		
			
				|  |  |          autoBar(e.delegateTarget.value)
 | 
	
		
			
				|  |  |      },500));
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/**
 | 
	
		
			
				|  |  | + * 生产报表数据
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +function setPrintHtml() {
 | 
	
		
			
				|  |  | +    let date = {inDocuNo: $("#inDocuNoLabel").val()};
 | 
	
		
			
				|  |  | +    request({
 | 
	
		
			
				|  |  | +        url: '/getYpInDetlDetailed',
 | 
	
		
			
				|  |  | +        method: 'GET',
 | 
	
		
			
				|  |  | +        data: date
 | 
	
		
			
				|  |  | +    }).then((res) => {
 | 
	
		
			
				|  |  | +        console.log(res);
 | 
	
		
			
				|  |  | +        let html = '';
 | 
	
		
			
				|  |  | +        let packRetpriceSum = 0;
 | 
	
		
			
				|  |  | +        let buyPriceSum = 0;
 | 
	
		
			
				|  |  | +        $('.sjh').remove();
 | 
	
		
			
				|  |  | +        for (let i = 0; i < res['data'].length; i++) {
 | 
	
		
			
				|  |  | +            let data = res['data'][i];
 | 
	
		
			
				|  |  | +            let packRetprice = keepTwoDecimal(parseFloat(data['stockAmount']) * parseFloat(data['packRetprice']));
 | 
	
		
			
				|  |  | +            let buyPrice = keepTwoDecimal(parseFloat(data['stockAmount']) * parseFloat(data['buyPrice']));
 | 
	
		
			
				|  |  | +            packRetpriceSum += packRetprice;
 | 
	
		
			
				|  |  | +            buyPriceSum += buyPrice;
 | 
	
		
			
				|  |  | +            if (i === 0) {
 | 
	
		
			
				|  |  | +                $(".printDate").html(format(new Date(), "yyyy-MM-dd HH:mm"));
 | 
	
		
			
				|  |  | +                $(".supplyName").html(data['supplyName']);
 | 
	
		
			
				|  |  | +                $(".inDocuNo").html(data['inDocuNo']);
 | 
	
		
			
				|  |  | +                $(".confirmDate").html(format(data['confirmDate'], "yyyy-MM-dd HH:mm"));
 | 
	
		
			
				|  |  | +                $(".lister").html($(".current_user")[0].innerText);
 | 
	
		
			
				|  |  | +                $(".listerAudit").html(data['confirmName']);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            html += '<tr class="sjh">';
 | 
	
		
			
				|  |  | +            html += '<td class="xtd" style="text-align: center;">' + data['chargeCode'] + '</td>';
 | 
	
		
			
				|  |  | +            html += '<td class="xtd" style="text-align: left;">' + data['drugName'] + '</td>';
 | 
	
		
			
				|  |  | +            html += '<td class="xtd" style="text-align: left;">' + data['specification'] + '</td>';
 | 
	
		
			
				|  |  | +            html += '<td class="xtd" style="text-align: center;">' + data['stockAmount'] + '</td>';
 | 
	
		
			
				|  |  | +            html += '<td class="xtd" style="text-align: center;">' + data['buyPrice'] + '</td>';
 | 
	
		
			
				|  |  | +            html += '<td class="xtd" style="text-align: center;">' + data['packRetprice'] + '</td>';
 | 
	
		
			
				|  |  | +            html += '<td class="xtd" style="text-align: center;">' + buyPrice + '</td>';
 | 
	
		
			
				|  |  | +            html += '<td class="xtd" style="text-align: center;">' + packRetprice + '</td>';
 | 
	
		
			
				|  |  | +            html += '<td class="xtd" style="text-align: center;">' + data['manuNo'] + '</td>';
 | 
	
		
			
				|  |  | +            html += '<td class="xtd" style="text-align: left;">' + data['manufactoryName'] + '</td>';
 | 
	
		
			
				|  |  | +            html += '<td class="xtd" style="text-align: center;">' + format(data['effDate'], "yyyy-MM-dd") + '</td>';
 | 
	
		
			
				|  |  | +            html += '</tr>';
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        $("#base_tr").after(html);
 | 
	
		
			
				|  |  | +        $(".packRetpriceSum").html(keepTwoDecimal(packRetpriceSum));
 | 
	
		
			
				|  |  | +        $(".buyPriceSum").html(keepTwoDecimal(buyPriceSum));
 | 
	
		
			
				|  |  | +        $(".balance").html(keepTwoDecimal(Math.abs(packRetpriceSum-buyPriceSum)));
 | 
	
		
			
				|  |  | +        print();
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/**
 | 
	
		
			
				|  |  | + * 打印报表
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +function print() {
 | 
	
		
			
				|  |  | +    setDefaultPrint();
 | 
	
		
			
				|  |  | +    LODOP = getLodop();
 | 
	
		
			
				|  |  | +    LODOP.PRINT_INITA(6, 0, "221mm", "93mm", "入库单打印");
 | 
	
		
			
				|  |  | +    LODOP.SET_PRINT_PAGESIZE(1, "221mm", "93mm", "");
 | 
	
		
			
				|  |  | +    //设置默认打印机
 | 
	
		
			
				|  |  | +    LODOP.SET_PRINTER_INDEX(defaultPrintIndex);
 | 
	
		
			
				|  |  | +    LODOP.SET_PRINT_STYLE("FontSize", 11); //字体大小
 | 
	
		
			
				|  |  | +    LODOP.SET_PRINT_STYLEA(0, "ItemType", 2);
 | 
	
		
			
				|  |  | +    var strStyle = "<style>table,td,th {border-width: 1px;padding-bottom:0px;" +
 | 
	
		
			
				|  |  | +        "border-style: solid;border-collapse: collapse;table-layout:fixed;word-wrap:break-word;font-size: 13}.xtd{border: 1px solid black;}</style>";
 | 
	
		
			
				|  |  | +    LODOP.ADD_PRINT_HTM("0mm", "0mm", "RightMargin:0mm", "BottomMargin:0mm", strStyle + document.getElementById("report_table_1").innerHTML);
 | 
	
		
			
				|  |  | +    LODOP.PRINT();
 | 
	
		
			
				|  |  | +    //LODOP.PREVIEW();
 | 
	
		
			
				|  |  | +}
 |