123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838 |
- //@ sourceURL=user_manage.js
- var LODOP; //声明为全局变量
- //默认打印机下标
- var printIndex = -1;
- var hospitalName='沭阳铭和医院'
- $(function () {
- getAjaxRequst("/thmz/queryHospitalName",{},true,function (res) {
- hospitalName = res.data
- $('.hospitalName').text(hospitalName)
- })
- $("input").each(function () {
- this.onkeydown = function (e) { // 监听键盘事件
- var theEvent = window.event || e;
- var code = theEvent.keyCode || theEvent.which;
- if (code == 13) {//回车事件
- $("#btn_search").click(); //触发搜索按钮点击事件
- }
- }
- });
- //角色保存按钮点击事件
- $("#btn_save").click(function (t) {
- var validatorResult = validator.checkAll($("#editForm"));
- if (validatorResult) {
- saveData();
- }
- });
- $("#icdCodeForm").click(function (t) {
- $("#diagModal").modal();
- diagResetSearch()
- getDiagData()
- });
- //初始化表格数据
- getAllPatient();
- initListDeptSelect();
- iniAdmissStatus();
- initZySelect();
- initRelationSelect();
- });
- /**
- * 清空入院证输入框
- */
- function clearZyReq() {
- $("#inpatientWardBeHospitalized").selectpicker('val', null);
- $('#inpatientWardBeHospitalized').selectpicker('refresh');
- $("#smallWardBeHospitalized").selectpicker('val', null);
- $('#smallWardBeHospitalized').selectpicker('refresh');
- $("#admissStatus").selectpicker('val', null);
- $('#admissStatus').selectpicker('refresh');
- $("#conditionCode").selectpicker('val', null);
- $('#conditionCode').selectpicker('refresh');
- $("#routeOfAdmission").selectpicker('val', null);
- $('#routeOfAdmission').selectpicker('refresh');
- $("#totalBedNum").val(null);
- $("#freeBedNum").val(null);
- $("#occupationBedNum").val(null);
- $("#icdCodeForm").val(null);
- $("#icdTextForm").val(null);
- $("#deposit").val(null);
- $("#contacterName").val(null);
- $("#contacterRelationship").selectpicker('val', null);
- $("#contacterRelationship").selectpicker('refresh');
- $("#contacterPhone").val(null);
- $("#contacterAddress").val(null);
- initSmallDeptByDept();
- }
- function diagResetSearch() {
- $("#diagParamSearch").val(null);
- }
- /**
- * 获取诊断数据
- */
- function getDiagData() {
- $('#diag_tb_table').bootstrapTable("destroy");
- $('#diag_tb_table').bootstrapTable({
- url: '/thmz/queryIcdCodePage', //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: diagQueryParams, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 10, //每页的记录行数(*)
- pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
- 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: [
- {
- title: '操作',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- // var rowData = JSON.stringify(row);
- var str = '<button type="button" class="btn btn-primary btn-sm" onclick="xuanZheDiag(\'' + row.code + '\',\'' + row.name + '\')">选中</button>';
- return str;
- }
- },
- {
- 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) {
- if (ress.message != null && ress.message != '') {
- new PNotify({
- title: '错误提示',
- text: ress.message,
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- }
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.total,//总页数
- "rows": ress.data //数据
- };
- },
- });
- }
- //选择诊断
- function xuanZheDiag(code,name) {
- $("#icdCodeForm").val(code)
- $("#icdTextForm").val(name)
- $("#diagModal").modal("hide");
- }
- //初始化科室下拉
- function initDeptSelect() {
- //科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/allUnitCode',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (data) {
- if (data == '401' || data == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- let html = '';
- $.each(data.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
- });
- $('#deptNoManagerDept').empty();
- $('#deptNoManagerDept').html(html);
- $('#deptNoManagerDept').selectpicker('refresh');
- }
- });
- }
- /**
- * 保存用户数据
- */
- function saveData() {
- var s_data = {
- "patientId": $("#patientId").val(),
- "reqDept": $("#inpatientWardBeHospitalized").val(),
- "smallDept": $("#smallWardBeHospitalized").val(),
- "admissStatus": $("#admissStatus").val(),
- "conditionCode":$("#conditionCode").val(),
- "routeOfAdmission":$("#routeOfAdmission").val(),
- "icdCode":$("#icdCodeForm").val(),
- "deposit":$("#deposit").val(),
- "icdText":$("#icdTextForm").val(),
- "contacterName":$("#contacterName").val(),
- "contacterRelationship":$("#contacterRelationship").val(),
- "contacterPhone":$("#contacterPhone").val(),
- "contacterAddress":$("#contacterAddress").val()
- }
- $.ajax({
- type: "POST",
- url: '/thmz/banLiZyReq',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- data: JSON.stringify(s_data),
- success: function (res) {
- let visitDate = format(res.data,'yyyy-MM-dd HH:mm:ss');
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $("#editModal").modal("hide");
- clearZyReq();
- //successMesage(res);
- printZyReq($("#patientId").val(),1, visitDate)
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 查询病人信息
- */
- function getAllPatient() {
- $('#tb_table').bootstrapTable("destroy");
- $('#tb_table').bootstrapTable({
- url: '/thmz/getPatientMiPage', //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: queryParams, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 10, //每页的记录行数(*)
- pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
- 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: [
- {
- title: '操作',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- // var rowData = JSON.stringify(row);
- var str = '<button type="button" class="btn btn-primary btn-sm" onclick="editAdd(\'' + row.patientId + '\')">办理住院证</button>';
- str += '<button type="button" class="btn btn-primary btn-sm" onclick="bdZyz(\'' + row.patientId + '\')">补打住院证</button>';
- return str;
- }
- },
- {
- field: 'patientId',
- title: '门诊号',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'name',
- title: '姓名',
- align: "center",
- valign: 'middle'
- }, {
- field: 'sex',
- title: '性别',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- return value == 1 ? "男":"女";
- }
- },
- {
- field: 'birthDayStr',
- title: '出生日期',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'socialNo',
- 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) {
- if (ress.message != null && ress.message != '') {
- new PNotify({
- title: '错误提示',
- text: ress.message,
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- }
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.total,//总页数
- "rows": ress.data //数据
- };
- },
- });
- }
- /**
- * 关系列表初始化
- */
- function initRelationSelect() {
- //医生列表
- $.ajax({
- type: "GET",
- url: '/thmz/getRelation',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- });
- $('#contacterRelationship').empty();
- $('#contacterRelationship').html(html);
- $('#contacterRelationship').selectpicker('destroy').selectpicker('refresh');
- }
- });
- }
- /**
- * 构建列表查询参数
- * @param params
- * @returns {{mzChargeDetail: {patientId: string | number | string[] | undefined | jQuery, warnDept: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery, payMark: number}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
- */
- function queryParams(params) {
- var temp = {
- pageSize: params.limit,
- offset: params.offset/params.limit,
- patientId: $("#patientIdSearch").val() == "" ? null : $("#patientIdSearch").val(),
- name: $("#nameSearch").val() == "" ? null : $("#nameSearch").val(),
- socialNo: $("#socialNoSearch").val() == "" ? null : $("#socialNoSearch").val()
- };
- return temp;
- };
- function diagQueryParams(params) {
- var temp = {
- pageSize: params.limit,
- pageIndex: params.offset / params.limit,
- name: $("#diagParamSearch").val() == "" ? null : $("#diagParamSearch").val(),
- };
- return temp;
- };
- function initZySelect() {
- //入院病情
- var conditionCode = '<option value="1">有</option><option value="2">临床未确定</option><option value="3">情况不明</option><option value="4">无</option>';
- $('#conditionCode').html(conditionCode);
- $('#conditionCode').selectpicker('refresh');
- //入院途径
- initRouteOfAdmission()
- }
- /**
- * 初始化入院途径
- */
- function initRouteOfAdmission() {
- getAjaxRequst("/thmz/queryRouteOfAdmission",{},true,function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- let html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- });
- $('#routeOfAdmission').empty();
- $('#routeOfAdmission').html(html);
- $('#routeOfAdmission').selectpicker('refresh');
- })
- }
- /**
- * 所有的入院状态
- */
- function iniAdmissStatus() {
- $.ajax({
- type: "GET",
- url: '/thmz/getAdmissStatus',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- let html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- });
- $('#admissStatus').empty();
- $('#admissStatus').html(html);
- $('#admissStatus').selectpicker('refresh');
- }
- });
- }
- /**
- * 入院登记的病区列表
- */
- function initListDeptSelect() {
- //科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/allInpatientWard',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (data) {
- if (data == '401' || data == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(data.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
- });
- $('#inpatientWardBeHospitalized').empty();
- $('#inpatientWardBeHospitalized').html(html);
- $('#inpatientWardBeHospitalized').selectpicker('refresh');
- initSmallDeptByDept();
- }
- });
- }
- /**
- * 小科室列表
- */
- function initSmallDeptByDept() {
- let code = escape($('#inpatientWardBeHospitalized').val()).replace(/\+/g, '%2B');
- //小科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/getSmallDeptByDept?code=' + code,
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- });
- $('#smallWardBeHospitalized').empty();
- $('#smallWardBeHospitalized').html(html);
- $('#smallWardBeHospitalized').selectpicker('destroy').selectpicker('refresh');
- }
- });
- //病床数
- $.ajax({
- type: "GET",
- url: '/thmz/getBedStatusNumByDept?code=' + code,
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var data = res.data;
- if (data == null) {
- $("#totalBedNum").val(0);
- $("#freeBedNum").val(0);
- $("#occupationBedNum").val(0);
- } else {
- $("#totalBedNum").val(data.total);
- $("#freeBedNum").val(data.free);
- $("#occupationBedNum").val(data.occupation);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 打开编辑窗口
- * @param row
- */
- function editAdd(patientId) {
- $("#patientId").val(patientId)
- clearZyReq();
- $("#editModal").modal();
- }
- /**
- * 重置查询表单
- */
- function resetSearch() {
- $("#patientIdSearch").val(null);
- $("#nameSearch").val(null);
- $("#socialNoSearch").val(null);
- }
- //住院证补打
- function bDPrintZyz(patientId,visitDate) {
- let date = format(visitDate,'yyyy-MM-dd HH:mm:ss')
- printZyReq(patientId,1,date)
- }
- /**
- * 打开编辑窗口
- * @param row
- */
- function bdZyz(patientId) {
- $("#bdZyzModal").modal();
- getBdZyzData(patientId);
- }
- function getBdZyzData(patientId) {
- $('#bdZyz_tb_table').bootstrapTable("destroy");
- $('#bdZyz_tb_table').bootstrapTable({
- url: '/thmz/queryZyzByPatientId', //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: {patientId:patientId}, //传递参数(*)
- sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 10, //每页的记录行数(*)
- pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
- 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: [
- {
- title: '操作',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- // var rowData = JSON.stringify(row);
- var str = '<button type="button" class="btn btn-primary btn-sm" onclick="bDPrintZyz(\'' + row.patientId + '\',\'' + row.visitDate + '\')">打印</button>';
- return str;
- }
- },
- {
- field: 'patientId',
- title: '门诊号',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'name',
- title: '姓名',
- align: "center",
- valign: 'middle',
- },
- {
- field: 'visitDate',
- title: '就诊时间',
- align: "center",
- valign: 'middle',
- formatter:function (value,row,index) {
- return format(value,'yyyy-MM-dd HH:mm:ss')
- }
- },
- {
- field: 'doctorName',
- title: '医生',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'icdTextNew',
- title: '诊断',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'reqDeptName',
- title: '入院科室',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'smallDeptName',
- 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) {
- if (ress.message != null && ress.message != '') {
- new PNotify({
- title: '错误提示',
- text: ress.message,
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- }
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- // "total": ress.total,//总页数
- "rows": ress.data //数据
- };
- },
- });
- }
- /**
- * 打印入院通知单
- * @param patientId
- * @param times
- * @param clnicId
- * @param payMark
- * @param printType 打印模式 1 预览打印 2 打印设置
- */
- function printZyReq(patientId, printType,visitDate) {
- $.ajax({
- type: "GET",
- url: '/thmz/printZyReq?patientId=' + patientId+'&visitDate='+visitDate,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- setPrint();
- LODOP = getLodop();
- LODOP.PRINT_INITA(6, 0, "148mm", "210mm", hospitalName+"入院通知单");
- LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
- //设置默认打印机
- LODOP.SET_PRINTER_INDEX(printIndex);
- LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
- LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
- LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
- LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "入院通知单");//对新建的纸张重命名
- //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
- //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
- //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
- //intWidth,intHeight 窗口的宽和高,整数型,单位是px
- //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
- //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
- LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
- //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
- var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
- var mzPatientMi = res.mzPatientMi;
- var mzZyReq = res.mzZyReq;
- $("#patientIdZyReq").text(mzPatientMi.patientId);
- $("#patientNameZyReq").text(mzPatientMi.name);
- $("#patientGenderZyReq").text(mzPatientMi.gender);
- $("#patientAgeZyReq").text(mzPatientMi.ageString);
- $("#sfzZyReq").text(mzPatientMi.socialNo);
- $("#birthDateZyReq").text(format(mzPatientMi.birthDay, "yyyy-MM-dd"));
- $("#phoneZyReq").text(mzPatientMi.phoneNo);
- $("#responseTypeZyReq").text(mzPatientMi.responseTypeName);
- $("#addressZyReq").text(mzPatientMi.address);
- if (mzZyReq.icdCode == null || mzZyReq.icdCode == "" || mzZyReq.icdCode.length == 0) {
- $("#icsCodeZyReq").html(" ");
- $("#icsTextZyReq").text(mzZyReq.icdText);
- } else {
- $("#icsCodeZyReq").text(mzZyReq.icdCode);
- $("#icsTextZyReq").text(mzZyReq.icdText);
- }
- $("#reqDeptZyReq").text(mzZyReq.reqWardName);
- $("#smallDeptZyReq").text(mzZyReq.smallDeptName);
- $("#routeOfAdmissionName").text(mzZyReq.routeOfAdmissionName);
- $("#depositZyReq").text(mzZyReq.deposit);
- //$("#admissStatusZyReq").text(mzZyReq.admissStatus);
- // $("input:checkbox[value='" + mzZyReq.admissStatus + "']").prop('checked', true);
- $("input:checkbox[name='admissStatusZyReq']").each(function (i, e) {
- $(this).removeAttr("checked");
- if ($(this).val() ==Number(mzZyReq.admissStatus) ||$(this).val()==mzZyReq.admissStatus) {
- $(this).attr("checked",true)
- }
- });
- $("#visitDateZyReq").text(format(mzZyReq.visitDate, "yyyy-MM-dd HH:mm:ss"));
- $("#deptCodeZyReq").text(mzZyReq.deptName);
- getAjaxRequst("/thmz/getDoctorSignatureImage",{doctorCode:mzZyReq.doctorCode},false,function (signRes) {
- if(signRes.code == 0){
- $("#doctorCodeZyReq").html("<img src='" + signRes.data + "' style='width:100px;height:23px;'/>")
- }else {
- $("#doctorCodeZyReq").text(mzZyReq.doctorName);
- }
- })
- LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("mz_zy_req_table").innerHTML);
- if (printType == 1) {
- LODOP.PREVIEW();
- } else if (printType == 2) {
- LODOP.PRINT_SETUP();
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 查询默认打印机
- */
- function setPrint() {
- if (printIndex >= 0) {
- return;
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getLastWindowsByCurrentUser',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: false,
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- printIndex = res.data.cgPrintIndex;
- } else {
- printIndex = -1;
- }
- }
- });
- }
|