|
@@ -53,9 +53,11 @@ $(function () {
|
|
|
name: row['name'],
|
|
|
specification: row['specification'],
|
|
|
packRetprice: row['packRetprice'],
|
|
|
+ buyPrice: row['buyPrice'],
|
|
|
amount: 0,
|
|
|
amountOut: 0,
|
|
|
amountOutMoney: 0,
|
|
|
+ buyInMoney: 0,
|
|
|
jbFlag: row['jbFlag'],
|
|
|
nationalCode: row['nationalCode'],
|
|
|
serial: row['serial']
|
|
@@ -485,7 +487,17 @@ function initInDetlDetailed() {
|
|
|
}
|
|
|
$("#tb_table_detailed").jqGrid('setCell', rowId, "amountOut", amountOut);
|
|
|
$("#tb_table_detailed").jqGrid('setCell', rowId, "amountOutMoney", keepTwoDecimal(amountOut * parseFloat(rowData.packRetprice)));
|
|
|
+ $("#tb_table_detailed").jqGrid('setCell', rowId, "buyInMoney", keepTwoDecimal(amountOut * parseFloat(rowData.buyPrice)));
|
|
|
$("#tb_table_detailed").jqGrid('setCell', rowId, "inSeri", rowData.inSeri);
|
|
|
+ var rowNum=parseInt($("#tb_table_detailed").getGridParam("records"),20);//获取行数
|
|
|
+ if(rowNum>0){
|
|
|
+ $(".ui-jqgrid-sdiv").show();
|
|
|
+ let amountOutMoney=$("#tb_table_detailed").getCol("amountOutMoney",false,"sum");//需要统计的列
|
|
|
+ let buyInMoney=$("#tb_table_detailed").getCol("buyInMoney",false,"sum");
|
|
|
+ $("#tb_table_detailed").footerData("set",{"amountOut":"合计","amountOutMoney":keepTwoDecimal(amountOutMoney),"buyInMoney":keepTwoDecimal(buyInMoney)}); //将合计值显示出来
|
|
|
+ }else{
|
|
|
+ $(".ui-jqgrid-sdiv").hide();
|
|
|
+ }
|
|
|
},
|
|
|
loadComplete: function (res) { //加载完成(初始加载),回调函数
|
|
|
if (res == '401' || res == 401) {
|
|
@@ -531,13 +543,14 @@ function initDetailed() {
|
|
|
loadonce: false, //一次加载全部数据到客户端,由客户端进行排序。
|
|
|
footerrow:true,//设置属性,显示统计行
|
|
|
cellsubmit: "remote",
|
|
|
- colNames: ['单号', '药品编码', '药品名称', '规格', '零售价', '请领数量', '出库量', '金额', '基本药物', '药品国家医保编码', 'serial'],
|
|
|
+ colNames: ['单号', '药品编码', '药品名称', '规格', '零售价', '购入价', '请领数量', '出库量', '金额', '购入金额', '基本药物', '药品国家医保编码', 'serial'],
|
|
|
colModel: [
|
|
|
{name: 'drawNo', index: 'drawNo', align: 'center'},
|
|
|
{name: 'chargeCode', index: 'chargeCode', align: 'center'},
|
|
|
{name: 'name', index: 'name', align: 'left'},
|
|
|
{name: 'specification', index: 'specification', align: 'left'},
|
|
|
{name: 'packRetprice', index: 'packRetprice', align: 'center'},
|
|
|
+ {name: 'buyPrice', index: 'buyPrice', align: 'center'},
|
|
|
{name: 'amount', index: 'amount', align: 'center'},
|
|
|
{
|
|
|
name: 'amountOut', index: 'amountOut', align: 'center',
|
|
@@ -554,6 +567,15 @@ function initDetailed() {
|
|
|
return keepTwoDecimal((isEmpty(rowObject.amount) ? rowObject.outAmt : rowObject.amountOut) * rowObject.packRetprice);
|
|
|
}
|
|
|
},
|
|
|
+ {
|
|
|
+ name: 'buyInMoney', index: 'buyInMoney', align: 'center',
|
|
|
+ formatter: function (cellvalue, options, rowObject) {
|
|
|
+ if(!isEmpty(cellvalue) && cellvalue+"".indexOf("span") != -1){
|
|
|
+ return cellvalue;
|
|
|
+ }
|
|
|
+ return keepTwoDecimal((isEmpty(rowObject.amount) ? rowObject.outAmt : rowObject.amountOut) * rowObject.buyPrice);
|
|
|
+ }
|
|
|
+ },
|
|
|
{
|
|
|
name: 'jbFlag', index: 'jbFlag', align: 'center',
|
|
|
formatter: function (cellvalue, options, rowObject) {
|
|
@@ -575,7 +597,8 @@ function initDetailed() {
|
|
|
if(rowNum>0){
|
|
|
$(".ui-jqgrid-sdiv").show();
|
|
|
let amountOutMoney=$(this).getCol("amountOutMoney",false,"sum");//需要统计的列
|
|
|
- $(this).footerData("set",{"amountOut":"合计","amountOutMoney":keepTwoDecimal(amountOutMoney)}); //将合计值显示出来
|
|
|
+ let buyInMoney=$(this).getCol("buyInMoney",false,"sum");
|
|
|
+ $(this).footerData("set",{"amountOut":"合计","amountOutMoney":keepTwoDecimal(amountOutMoney),"buyInMoney":keepTwoDecimal(buyInMoney)}); //将合计值显示出来
|
|
|
}else{
|
|
|
$(".ui-jqgrid-sdiv").hide();
|
|
|
}
|