|  | @@ -19,9 +19,38 @@ $(function () {
 | 
	
		
			
				|  |  |      $('#searchText').on('input propertychange',function(e){
 | 
	
		
			
				|  |  |          initTable();
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    //初始化药品查询弹出框
 | 
	
		
			
				|  |  | +    initSearchList('<div id="medicinePopoverContent"><table id="tb_table_medicine"></table></div>',
 | 
	
		
			
				|  |  | +        'searchTextEff', 600, 200);
 | 
	
		
			
				|  |  | +    $('#searchTextEff').on('input focus', function (e) {
 | 
	
		
			
				|  |  | +        showDrugPopover({
 | 
	
		
			
				|  |  | +            method: 'POST',
 | 
	
		
			
				|  |  | +            data: JSON.stringify({
 | 
	
		
			
				|  |  | +                searchText: $("#searchTextEff").val() == "" ? null : $("#searchTextEff").val(),
 | 
	
		
			
				|  |  | +                groupNo: $("#groupNoSearchText").val(),
 | 
	
		
			
				|  |  | +                delFlag: 0
 | 
	
		
			
				|  |  | +            }),
 | 
	
		
			
				|  |  | +            url: '/thmz/'+($("#groupNoSearchText").val()>=61?'getYpBaseYfLike':'getYpZdDictBase'),
 | 
	
		
			
				|  |  | +            columns: [
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    field: 'stockAmount',
 | 
	
		
			
				|  |  | +                    title: '库存',
 | 
	
		
			
				|  |  | +                    align: "center",
 | 
	
		
			
				|  |  | +                    valign: 'middle'
 | 
	
		
			
				|  |  | +                }],
 | 
	
		
			
				|  |  | +            onClickRow: function (row, $element) {
 | 
	
		
			
				|  |  | +                $('#searchTextEff').webuiPopover('hide');
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  |      $('#export_excel').on('click',function(e){
 | 
	
		
			
				|  |  |          exportExcel();
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  | +    $('#btn_eff_date').on('click',function(e){
 | 
	
		
			
				|  |  | +        $("#pharmacyModal").modal("show");
 | 
	
		
			
				|  |  | +        initEffDateTable()
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  |  });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -122,6 +151,150 @@ function getChildCom(node){
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +/**
 | 
	
		
			
				|  |  | + * 校期列表
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +function initEffDateTable(chargeCode) {
 | 
	
		
			
				|  |  | +    $('#eff_table').bootstrapTable('destroy');
 | 
	
		
			
				|  |  | +    $('#eff_table').bootstrapTable({
 | 
	
		
			
				|  |  | +        url: '/thmz/getYpInDetlYfEffDate',         //请求后台的URL(*)
 | 
	
		
			
				|  |  | +        method: 'GET',                      //请求方式(*)
 | 
	
		
			
				|  |  | +        toolbar: '#toolbar',                //工具按钮用哪个容器
 | 
	
		
			
				|  |  | +        striped: true,                      //是否显示行间隔色
 | 
	
		
			
				|  |  | +        cache: false,                       //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
 | 
	
		
			
				|  |  | +        pagination: true,                   //是否显示分页(*)
 | 
	
		
			
				|  |  | +        sortable: true,                     //是否启用排序
 | 
	
		
			
				|  |  | +        sortOrder: "asc",                   //排序方式
 | 
	
		
			
				|  |  | +        queryParams: {
 | 
	
		
			
				|  |  | +            chargeCode: chargeCode,
 | 
	
		
			
				|  |  | +            groupNo: $("#groupNoSearchText").val()
 | 
	
		
			
				|  |  | +        },           //传递参数(*)
 | 
	
		
			
				|  |  | +        sidePagination: "server",           //分页方式:client客户端分页,server服务端分页(*)
 | 
	
		
			
				|  |  | +        pageNumber: 1,                       //初始化加载第一页,默认第一页
 | 
	
		
			
				|  |  | +        pageSize: 15,                       //每页的记录行数(*)
 | 
	
		
			
				|  |  | +        pageList: [15, 20, 30, 50],        //可供选择的每页的行数(*)
 | 
	
		
			
				|  |  | +        search: false,                       //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
 | 
	
		
			
				|  |  | +        strictSearch: true,
 | 
	
		
			
				|  |  | +        showColumns: false,                  //是否显示所有的列
 | 
	
		
			
				|  |  | +        showRefresh: false,                  //是否显示刷新按钮
 | 
	
		
			
				|  |  | +        minimumCountColumns: 2,             //最少允许的列数
 | 
	
		
			
				|  |  | +        clickToSelect: true,                //是否启用点击选中行
 | 
	
		
			
				|  |  | +        uniqueId: "ID",                     //每一行的唯一标识,一般为主键列
 | 
	
		
			
				|  |  | +        showToggle: false,                    //是否显示详细视图和列表视图的切换按钮
 | 
	
		
			
				|  |  | +        cardView: false,                    //是否显示详细视图
 | 
	
		
			
				|  |  | +        detailView: false,
 | 
	
		
			
				|  |  | +        ajaxOptions: {
 | 
	
		
			
				|  |  | +            headers: {
 | 
	
		
			
				|  |  | +                'Accept': 'application/json',
 | 
	
		
			
				|  |  | +                'Authorization': 'Bearer ' + localStorage.getItem("token")
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +        columns: [
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                field: 'checked',
 | 
	
		
			
				|  |  | +                checkbox: true,
 | 
	
		
			
				|  |  | +                align: "center",
 | 
	
		
			
				|  |  | +                valign: 'middle'
 | 
	
		
			
				|  |  | +            },{
 | 
	
		
			
				|  |  | +                field: 'location',
 | 
	
		
			
				|  |  | +                title: '校期',
 | 
	
		
			
				|  |  | +                align: "center",
 | 
	
		
			
				|  |  | +                width: 80,
 | 
	
		
			
				|  |  | +                valign: 'middle'
 | 
	
		
			
				|  |  | +            }, {
 | 
	
		
			
				|  |  | +                field: 'code',
 | 
	
		
			
				|  |  | +                title: '入库日期',
 | 
	
		
			
				|  |  | +                align: "center",
 | 
	
		
			
				|  |  | +                width: 50,
 | 
	
		
			
				|  |  | +                valign: 'middle'
 | 
	
		
			
				|  |  | +            }, {
 | 
	
		
			
				|  |  | +                field: 'code',
 | 
	
		
			
				|  |  | +                title: '药品编码',
 | 
	
		
			
				|  |  | +                align: "left",
 | 
	
		
			
				|  |  | +                width: 150,
 | 
	
		
			
				|  |  | +                valign: 'middle'
 | 
	
		
			
				|  |  | +            }, {
 | 
	
		
			
				|  |  | +                field: 'name',
 | 
	
		
			
				|  |  | +                title: '药品名',
 | 
	
		
			
				|  |  | +                align: "left",
 | 
	
		
			
				|  |  | +                width: 150,
 | 
	
		
			
				|  |  | +                valign: 'middle'
 | 
	
		
			
				|  |  | +            },
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                field: 'stockAmountMz',
 | 
	
		
			
				|  |  | +                title: '规格',
 | 
	
		
			
				|  |  | +                align: "center",
 | 
	
		
			
				|  |  | +                valign: 'middle',
 | 
	
		
			
				|  |  | +                width: 80,
 | 
	
		
			
				|  |  | +                visible: isMultiple==0?false:true,
 | 
	
		
			
				|  |  | +                formatter: function (value, row, index) {
 | 
	
		
			
				|  |  | +                    return Math.floor(value * 100) / 100;
 | 
	
		
			
				|  |  | +                },
 | 
	
		
			
				|  |  | +                cellStyle:function (value, row, index) {
 | 
	
		
			
				|  |  | +                    if(row.visibleFlagMz == 0){
 | 
	
		
			
				|  |  | +                        return {css:{background:'red'}};
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                    return {css:{}};
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            },
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                field: 'stockAmountZy',
 | 
	
		
			
				|  |  | +                title: '有效期',
 | 
	
		
			
				|  |  | +                align: "center",
 | 
	
		
			
				|  |  | +                valign: 'middle',
 | 
	
		
			
				|  |  | +                width: 80,
 | 
	
		
			
				|  |  | +                visible: isMultiple==0?false:true,
 | 
	
		
			
				|  |  | +                formatter: function (value, row, index) {
 | 
	
		
			
				|  |  | +                    return Math.floor(value * 100) / 100;
 | 
	
		
			
				|  |  | +                },
 | 
	
		
			
				|  |  | +                cellStyle:function (value, row, index) {
 | 
	
		
			
				|  |  | +                    if(row.visibleFlagMz == 0){
 | 
	
		
			
				|  |  | +                        return {css:{background:'red'}};
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                    return {css:{}};
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            },
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                field: 'stockAmountDz',
 | 
	
		
			
				|  |  | +                title: '生产厂商',
 | 
	
		
			
				|  |  | +                align: "center",
 | 
	
		
			
				|  |  | +                valign: 'middle',
 | 
	
		
			
				|  |  | +                width: 80,
 | 
	
		
			
				|  |  | +                visible: isMultiple==0?false:true,
 | 
	
		
			
				|  |  | +                formatter: function (value, row, index) {
 | 
	
		
			
				|  |  | +                    return Math.floor(value * 100) / 100;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        ],
 | 
	
		
			
				|  |  | +        rowStyle: function (row, index) {
 | 
	
		
			
				|  |  | +            if (isMultiple == 0 && row.visibleFlagMz == 1 && row.visibleFlagZy == 1) {
 | 
	
		
			
				|  |  | +                return { css: { 'background-color': 'red' } };
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            return {css:{}}
 | 
	
		
			
				|  |  | +        },
 | 
	
		
			
				|  |  | +        responseHandler: function (res) {
 | 
	
		
			
				|  |  | +            if (res == '401' || res == 401) {
 | 
	
		
			
				|  |  | +                window.location.href = '/thmz/login/view'
 | 
	
		
			
				|  |  | +                return;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            var ress = eval(res);
 | 
	
		
			
				|  |  | +            if (ress.code == -1) {
 | 
	
		
			
				|  |  | +                errorMesage(res);
 | 
	
		
			
				|  |  | +                return {
 | 
	
		
			
				|  |  | +                    "total": 0,//总页数
 | 
	
		
			
				|  |  | +                    "rows": {}   //数据
 | 
	
		
			
				|  |  | +                };
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            return {
 | 
	
		
			
				|  |  | +                "total": ress.total,//总页数
 | 
	
		
			
				|  |  | +                "rows": ress.data   //数据
 | 
	
		
			
				|  |  | +            };
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  /**
 | 
	
		
			
				|  |  |   * 查询列表
 | 
	
		
			
				|  |  |   */
 |