|
|
@@ -0,0 +1,341 @@
|
|
|
+//@ sourceURL=incoming_records.js
|
|
|
+var pharmacyGroupNo = window.localStorage["groupNo"];//药房编码
|
|
|
+$(function () {
|
|
|
+ $('#fyClass').selectpicker('refresh');
|
|
|
+ //$("#pharmacyModal").modal("show");
|
|
|
+ $(".selectpicker").selectpicker();
|
|
|
+ initDaterangepickerWithId("reportrange_in", 'left');
|
|
|
+ initDaterangepickerWithId("reportrange_in1", 'left');
|
|
|
+ if(pharmacyGroupNo == null){
|
|
|
+ return errorMesageSimaple('药房参数未设置,请在发药参数设置中设置');
|
|
|
+ }
|
|
|
+ getAll();
|
|
|
+ $("input").each(function () {
|
|
|
+ this.onkeydown = function (e) { // 监听键盘事件
|
|
|
+ let theEvent = window.event || e;
|
|
|
+ let code = theEvent.keyCode || theEvent.which;
|
|
|
+ if (code == 13) {//回车事件
|
|
|
+ $("#btn_search").click(); //触发搜索按钮点击事件
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ //initDaterangepickerWithId("reportrange_out",'left');
|
|
|
+ initSearchList('<div id="medicinePopoverContent"><table id="tb_table_medicine"></table></div>',
|
|
|
+ 'searchTextDrug', 700, 250);
|
|
|
+ initSearchList('<div id="employeePopoverContent"><table id="tb_table_employee"></table></div>',
|
|
|
+ 'inputNameSearch', 300, 250);
|
|
|
+ initSearchList('<div id="manufactoryPopoverContent"><table id="tb_table_manufactory"></table></div>',
|
|
|
+ 'manufactoryNameSearch', 350, 250);
|
|
|
+ $('#searchTextDrug').on('input focus', function (e) {
|
|
|
+ showDrugPopover();
|
|
|
+ if ($('#searchTextDrug').val().length == 0) {
|
|
|
+ $('#codeSearch').val("");
|
|
|
+ $('#serialSearch').val("");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('#inputNameSearch').on('input focus', function (e) {
|
|
|
+ showEmployeePopover();
|
|
|
+ });
|
|
|
+ $('#manufactoryNameSearch').on('input focus', function (e) {
|
|
|
+ showManufactoryPopover();
|
|
|
+ });
|
|
|
+});
|
|
|
+
|
|
|
+
|
|
|
+//显示查询的医生悬浮窗
|
|
|
+function showEmployeePopover() {
|
|
|
+ if ($('#inputNameSearch').val().length == 0) {
|
|
|
+ $('#inputId').val("");
|
|
|
+ }
|
|
|
+ $('#tb_table_employee').bootstrapTable('destroy');
|
|
|
+ $('#tb_table_employee').bootstrapTable({
|
|
|
+ url: '/thmz/getEmployeeBySearchText', //请求后台的URL(*)
|
|
|
+ method: 'GET', //请求方式(*)
|
|
|
+ toolbar: '#toolbar', //工具按钮用哪个容器
|
|
|
+ striped: true, //是否显示行间隔色
|
|
|
+ cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
|
|
|
+ pagination: false, //是否显示分页(*)
|
|
|
+ sortable: true, //是否启用排序
|
|
|
+ sortOrder: "asc", //排序方式
|
|
|
+ queryParams: {
|
|
|
+ searchText: $("#inputNameSearch").val() == "" ? null : $("#inputNameSearch").val(),
|
|
|
+ }, //传递参数(*)
|
|
|
+ sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
|
|
|
+ search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
|
|
|
+ strictSearch: true,
|
|
|
+ showColumns: false, //是否显示所有的列
|
|
|
+ showRefresh: false, //是否显示刷新按钮
|
|
|
+ minimumCountColumns: 2, //最少允许的列数
|
|
|
+ clickToSelect: true, //是否启用点击选中行
|
|
|
+ uniqueId: "ID", //每一行的唯一标识,一般为主键列
|
|
|
+ showToggle: false, //是否显示详细视图和列表视图的切换按钮
|
|
|
+ cardView: false, //是否显示详细视图
|
|
|
+ detailView: false,
|
|
|
+ //rowStyle:rowStyle,//通过自定义函数设置行样式
|
|
|
+ ajaxOptions: {
|
|
|
+ headers: {
|
|
|
+ 'Accept': 'application/json',
|
|
|
+ 'Authorization': 'Bearer ' + localStorage.getItem("token")
|
|
|
+ }
|
|
|
+ },
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ field: 'employeeCode',
|
|
|
+ title: '编码',
|
|
|
+ align: "center",
|
|
|
+ valign: 'middle'
|
|
|
+ }, {
|
|
|
+ field: 'employeeName',
|
|
|
+ title: '姓名',
|
|
|
+ align: "center",
|
|
|
+ valign: 'middle'
|
|
|
+ }, {
|
|
|
+ field: 'deptName',
|
|
|
+ title: '科室',
|
|
|
+ align: "center",
|
|
|
+ valign: 'middle'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ 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.data.length,//总页数
|
|
|
+ "rows": ress.data //数据
|
|
|
+ };
|
|
|
+ },
|
|
|
+ onClickRow: function (row, $element) {
|
|
|
+ $('#inputNameSearch').webuiPopover('hide');
|
|
|
+ $('#inputNameSearch').val(row.employeeName);
|
|
|
+ $('#inputId').val(row.employeeCode);
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+//显示查询的制造厂商悬浮窗
|
|
|
+function showManufactoryPopover() {
|
|
|
+ if ($('#manufactoryNameSearch').val().length == 0) {
|
|
|
+ $('#manuCode').val("");
|
|
|
+ }
|
|
|
+ $('#tb_table_manufactory').bootstrapTable('destroy');
|
|
|
+ $('#tb_table_manufactory').bootstrapTable({
|
|
|
+ url: '/thmz/getYpZdManufactoryBySearchText', //请求后台的URL(*)
|
|
|
+ method: 'GET', //请求方式(*)
|
|
|
+ toolbar: '#toolbar', //工具按钮用哪个容器
|
|
|
+ striped: true, //是否显示行间隔色
|
|
|
+ cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
|
|
|
+ pagination: false, //是否显示分页(*)
|
|
|
+ sortable: true, //是否启用排序
|
|
|
+ sortOrder: "asc", //排序方式
|
|
|
+ queryParams: {
|
|
|
+ searchText: $("#manufactoryNameSearch").val() == "" ? null : $("#manufactoryNameSearch").val(),
|
|
|
+ }, //传递参数(*)
|
|
|
+ sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
|
|
|
+ search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
|
|
|
+ strictSearch: true,
|
|
|
+ showColumns: false, //是否显示所有的列
|
|
|
+ showRefresh: false, //是否显示刷新按钮
|
|
|
+ minimumCountColumns: 2, //最少允许的列数
|
|
|
+ clickToSelect: true, //是否启用点击选中行
|
|
|
+ uniqueId: "ID", //每一行的唯一标识,一般为主键列
|
|
|
+ showToggle: false, //是否显示详细视图和列表视图的切换按钮
|
|
|
+ cardView: false, //是否显示详细视图
|
|
|
+ detailView: false,
|
|
|
+ //rowStyle:rowStyle,//通过自定义函数设置行样式
|
|
|
+ ajaxOptions: {
|
|
|
+ headers: {
|
|
|
+ 'Accept': 'application/json',
|
|
|
+ 'Authorization': 'Bearer ' + localStorage.getItem("token")
|
|
|
+ }
|
|
|
+ },
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ field: 'code',
|
|
|
+ title: '编码',
|
|
|
+ align: "center",
|
|
|
+ valign: 'middle'
|
|
|
+ }, {
|
|
|
+ field: 'name',
|
|
|
+ title: '厂名',
|
|
|
+ align: "center",
|
|
|
+ valign: 'middle'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ 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.data.length,//总页数
|
|
|
+ "rows": ress.data //数据
|
|
|
+ };
|
|
|
+ },
|
|
|
+ onClickRow: function (row, $element) {
|
|
|
+ $('#manufactoryNameSearch').webuiPopover('hide');
|
|
|
+ $('#manuCode').val(row.code);
|
|
|
+ $('#manufactoryNameSearch').val(row.name);
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 加载搜索窗口
|
|
|
+ */
|
|
|
+function initSearchList(content, searchTextId, width, height) {
|
|
|
+ var settings = {
|
|
|
+ placement: 'bottom-right',//值: auto,top,right,bottom,left,top-right,top-left,bottom-right,bottom-left 要显示的位置
|
|
|
+ trigger: 'click', //值:click,hover 触发方式
|
|
|
+ content: '',//内容,内容可以是函数
|
|
|
+ width: width,
|
|
|
+ //arrow:false,//是否显示箭头
|
|
|
+ multi: true,//在页面允许其他弹出层
|
|
|
+ closeable: true,//显示关闭按钮
|
|
|
+ style: '', //值:'',inverse
|
|
|
+ delay: 300,//延迟时间, 悬浮属性才执行
|
|
|
+ padding: true,//内容填充
|
|
|
+ height: height,
|
|
|
+ //offsetTop:10,
|
|
|
+ cache: true,//如果缓存设置为false,则popover将销毁并重新创建
|
|
|
+ content: content
|
|
|
+ };
|
|
|
+ $('#' + searchTextId).webuiPopover('destroy').webuiPopover(settings);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 初始化参数
|
|
|
+ */
|
|
|
+/*function initTable() {
|
|
|
+ pharmacyGroupNo = $("#pharmacyGroupNo").val();
|
|
|
+ $("#pharmacyModal").modal("hide");
|
|
|
+ getAll();
|
|
|
+}*/
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 重置查询表单
|
|
|
+ */
|
|
|
+function resetSearch() {
|
|
|
+ $("#codeSearch").val(null);
|
|
|
+ $("#serialSearch").val(null);
|
|
|
+ $("#manuCode").val(null);
|
|
|
+ $("#inputId").val(null);
|
|
|
+ $("#manufactoryNameSearch").val(null);
|
|
|
+ $("#yfInNoSearch").val(null);
|
|
|
+ $("#searchTextDrug").val(null);
|
|
|
+ $("#inputNameSearch").val(null);
|
|
|
+ $("#inTypeSearch").val(null);
|
|
|
+ $("#inTypeSearch").selectpicker('refresh');
|
|
|
+ $('#reportrange_in span').html(new Date.format('YYYY-MM-DD') + ' - ' + new Date.format('YYYY-MM-DD'));
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 查询列表
|
|
|
+ */
|
|
|
+function getAll() {
|
|
|
+ $.jgrid.gridUnload("tb_table");
|
|
|
+ $("#tb_table").jqGrid({
|
|
|
+ datatype: 'json',
|
|
|
+ mtype: 'POST',
|
|
|
+ url: '/thmz/getYpInDetlYfCk',
|
|
|
+ postData: queryParams(),
|
|
|
+ loadBeforeSend: function (jqXHR) {
|
|
|
+ jqXHR.setRequestHeader("Authorization", 'Bearer ' + localStorage.getItem("token"));
|
|
|
+ jqXHR.setRequestHeader("Accept", 'application/json');
|
|
|
+ },
|
|
|
+ styleUI: 'Bootstrap',
|
|
|
+ height: 'auto',
|
|
|
+ caption: '药品出库记录',
|
|
|
+ toolbar : [ true, "top" ],
|
|
|
+ rowNum: 20,
|
|
|
+ rowList: [20, 30, 50],
|
|
|
+ pager: 'pager',
|
|
|
+ colNames: ['药品编码', '药品名', '规格', '出库量', '零售价', '购入价', '出库单号', '录入日期','领用科室', '请领单号', '经发人','审核人','审核出库日期','结账人','结账日期','效期','生产批号','医保编码'],
|
|
|
+ colModel: [
|
|
|
+ {name: 'chargeCode', index: 'chargeCode',width: 50,align:'center'},
|
|
|
+ {name: 'name', index: 'name',width: 80},
|
|
|
+ {name: 'specification', index: 'specification',width: 50},
|
|
|
+ {name: 'buyAmt', index: 'buyAmt',width: 50,align:'center'},
|
|
|
+ {name: 'packRetprice', index: 'packRetprice',width: 50,align:'center'},
|
|
|
+ {name: 'buyPrice', index: 'buyPrice', formatter: 'number', summaryType: 'sum',width: 50,align:'center'},
|
|
|
+ {name: 'inDocuNo', index: 'inDocuNo',width: 70,align:'center'},
|
|
|
+ {name: 'inDate', index: 'inDate', formatter: 'date',width: 50,align:'center'},
|
|
|
+ {name: 'wardName', index: 'wardName',width: 70,align:'center'},
|
|
|
+ {name: 'reptNo', index: 'reptNo',width: 50,align:'center'},
|
|
|
+ {name: 'purchaser', index: 'purchaser',width: 50,align:'center'},
|
|
|
+ {name: 'confirmId', index: 'confirmId',width: 50},
|
|
|
+ {name: 'confirmDate', index: 'confirmDate',width: 70, formatter: 'date'},
|
|
|
+ {name: 'acctId', index: 'acctId',width: 50},
|
|
|
+ {name: 'acctDate', index: 'acctDate',width: 50, formatter: 'date'},
|
|
|
+ {name: 'effDate', index: 'effDate', formatter: 'date',width: 60},
|
|
|
+ {name: 'manuNo', index: 'manuNo',width: 60,align:'center'},
|
|
|
+ {name: 'nationalCode', index: 'nationalCode',width: 120},
|
|
|
+ ],
|
|
|
+ jsonReader: {
|
|
|
+ root: "data", page: "page", total: "total",
|
|
|
+ records: "rows", repeatitems: false
|
|
|
+ },
|
|
|
+ viewrecords: true,
|
|
|
+ grouping: false,
|
|
|
+ groupingView: {
|
|
|
+ groupField: ['inTypeName'],
|
|
|
+ groupSummary: [true],//是否开启汇总页脚
|
|
|
+ groupColumnShow: [false],//是否展示分组列
|
|
|
+ groupText: ['<b>{0}</b>'],//组名的展示文字
|
|
|
+ groupCollapse: false,
|
|
|
+ },
|
|
|
+ autowidth: true,
|
|
|
+ loadComplete: function (res) { //加载完成(初始加载),回调函数
|
|
|
+ if (res == '401' || res == 401) {
|
|
|
+ window.location.href = '/thmz/login/view';
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (res.code == -1) {
|
|
|
+ errorMesage(res);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $("#t_tb_table").append("<button class='registration-no-color-foot-button' title='打印汇总药单' onclick='printCount()' style='margin-left: 10px;'><i class='fa fa-print'></i></button>");
|
|
|
+ $("#t_tb_table").append("<button class='registration-no-color-foot-button' title='打印口服标签' onclick='printLabelData(0)' style='color: green;margin-left: 10px;'><i class='fa fa-file-excel-o'></i></button>");
|
|
|
+ $("#t_tb_table").append("<button class='registration-no-color-foot-button' title='保存' id='collect_save' onclick='save(0)' style='color: green;margin-left: 10px;'><i class='fa fa-floppy-o'></i></button>");
|
|
|
+ /**
|
|
|
+ * 构建列表查询参数
|
|
|
+ */
|
|
|
+ function queryParams() {
|
|
|
+ var rePortRangeArr = getRePortRangeArrById('reportrange_in');
|
|
|
+ var temp = {
|
|
|
+ 'beginTime': rePortRangeArr[0],
|
|
|
+ 'endTime': rePortRangeArr[1],
|
|
|
+ 'chargeCode': $("#codeSearch").val(),
|
|
|
+ 'serial': $("#serialSearch").val(),
|
|
|
+ 'manuCode': $("#manuCode").val(),
|
|
|
+ 'inputId': $("#inputId").val(),
|
|
|
+ 'inDocuNo': $("#yfInNoSearch").val(),
|
|
|
+ 'inType': $("#inTypeSearch").val(),
|
|
|
+ 'groupNo': pharmacyGroupNo
|
|
|
+ };
|
|
|
+ return temp;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|