123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839 |
- var rightData = [];
- var printIndex = -1;
- var hospitalName = '';
- $(function () {
- initClinicDeptNo();
- //初始频次下拉选
- initOrderFrequencys("orderFrequencyZl", true);
- initDayNum();
- initExecUnit();
- initSearchList('<div id="yjksPopoverContent"><table id="tb_table_yjksItem"></table></div>',
- 'yjksItem', 800, 400);
- $('#yjksItem').on('input focus', function (e) {
- loadItemTbale(null)
- });
- loadRightTable()
- getAjaxRequst("/thmz/queryHospitalName",{},true,function (res) {
- hospitalName = res.data
- $('.hospitalName').text(hospitalName)
- })
- });
- function deldata(index) {
- rightData.splice(index,1)
- jiSuanTotalCharge();
- loadRightTable()
- }
- function loadRightTable() {
- $('#dataTable').bootstrapTable('destroy');
- // 初始化表格
- $('#dataTable').bootstrapTable({
- data: rightData,
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true,
- cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: false, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc",
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- columns: [
- {
- title: '操作',
- field: 'op',
- align: "center",
- valign: 'middle',
- formatter: function (value, row, index) {
- var str = '<button type="button" class="btn btn-primary btn-sm" onclick=deldata(' + index + ')>删除</button>';
- return [str].join('');
- }
- },
- {
- field: 'zlCode',
- title: '编码',
- align: "center",
- valign: 'middle',
- }, {
- field: 'name',
- title: '名称',
- align: "center",
- valign: 'middle',
- }
- , {
- field: 'zlItemPrice',
- title: '单价(元)',
- align: "center",
- valign: 'middle',
- },
- {
- field: 'itemQuantity',
- title: '单量',
- align: "center",
- valign: 'middle',
- },
- {
- field: 'descriptions',
- title: '规格',
- align: "center",
- valign: 'middle',
- },
- {
- field: 'chargeUnit',
- title: '单位',
- align: "center",
- valign: 'middle',
- },
- {
- field: 'dayZlNum',
- title: '天数',
- align: "center",
- valign: 'middle',
- },
- {
- field: 'orderFrequencyZl',
- title: '频次',
- align: "center",
- valign: 'middle',
- },
- {
- field: 'totalNumZl',
- title: '总量',
- align: "center",
- valign: 'middle',
- },
- {
- field: 'totalAmountZl',
- title: '总价(元)',
- align: "center",
- valign: 'middle',
- },
- {
- field: 'execUnitName',
- title: '执行科室',
- align: "center",
- valign: 'middle',
- },
- {
- field: 'remark',
- title: '备注',
- align: "center",
- valign: 'middle',
- }
- ],
- });
- }
- function loadItemTbale(event) {
- if (event != null) {
- if (event.keyCode == 38 || event.keyCode == 40 || event.keyCode == 13) {
- //上下键不刷新表格
- return;
- }
- }
- $('#yjksItem').webuiPopover('show');
- $('#tb_table_yjksItem').bootstrapTable('refresh');
- $('#tb_table_yjksItem').bootstrapTable({
- url: '/thmz/listZdChargeItem', //请求后台的URL(*)
- method: 'POST', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: false, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: function () {
- var temp = {
- pageSize:50,
- pageIndex:0,
- zdChargeItem:{
- name: $("#yjksItem").val(),
- delFlag: 0
- }
- };
- return JSON.stringify(temp);
- }, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 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: [
- {
- field: 'code',
- title: '编码',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'name',
- title: '名称',
- align: "center",
- valign: 'middle',
- // sortable: true
- }
- , {
- field: 'execUnitName',
- title: '执行科室',
- align: "center",
- valign: 'middle',
- // sortable: true
- }
- , {
- field: 'chargeAmount',
- title: '价格',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- if (value == null) {
- return "0.00元";
- }
- return value.toFixed(2) + "元";
- }
- }, {
- field: 'descriptions',
- title: '规格',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'connotation',
- title: '医保说明',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'nationalCode',
- title: '医保编码',
- align: "left",
- valign: 'middle',
- // sortable: true
- }
- ],
- 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": {} //数据
- };
- }
- $("#yjksPopoverContent").parent().css("background", "#EBEBE4");
- return {
- "total": ress.data.length,//总页数
- "rows": ress.data //数据
- };
- },
- onClickRow: function (row, $element) {
- $('#yjksItem').webuiPopover('hide');
- clearData();
- setItemData(row)
- return;
- }
- });
- }
- function setItemData(row) {
- $("#descriptions").val(row.descriptions)
- $("#yjksItem").val(row.name)
- $("#zlCode").val(row.code)
- $("#chargeUnit").val(row.chargeUnit)
- $("#zlItemPrice").val(row.chargeAmount)
- $("#itemQuantity").val("1")
- $("#dayZlNum").val(1)
- $('#dayZlNum').selectpicker('refresh');
- $("#orderFrequencyZl").val('ONCE')
- $('#orderFrequencyZl').selectpicker('refresh');
- $("#execUnit").val(row.execUnit)
- $('#execUnit').selectpicker('refresh');
- calculateTotal(false)
- }
- /**
- * 计算诊疗金额
- * @param flag true ,直接计算总价, false 还要计算总量
- */
- function calculateTotal(flag) {
- if (!flag) {
- var itemQuantity = $("#itemQuantity").val();
- if (itemQuantity == null) {
- return;
- }
- var dayZlNum = $("#dayZlNum").val();
- if (dayZlNum == null) {
- return;
- }
- //频率
- var times = $('#orderFrequencyZl').find("option:selected").attr('desc');
- if (times == null) {
- return;
- }
- var totalNumZl = Multiply(Multiply(itemQuantity, dayZlNum), times);
- $("#totalNumZl").val(totalNumZl);
- }
- //总量
- var totalNumZl = $("#totalNumZl").val();
- if (totalNumZl == null) {
- return;
- }
- //单价
- var zlItemPrice = $("#zlItemPrice").val();
- if (zlItemPrice == null) {
- return;
- }
- $("#totalAmountZl").val(Multiply(totalNumZl, zlItemPrice));
- }
- /**
- * 初始频次下拉选
- * @param id
- * @param async 是否是异步 true 异步 false 同步
- */
- function initOrderFrequencys(id, async) {
- $.ajax({
- type: "GET",
- url: '/thmz/getXyOrderFrequencys',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- async: async,
- 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 + '" desc="' + comment.times + '">' + comment.name + '(' + comment.code + ')' + '</option>';
- });
- $('#' + id).empty();
- $('#' + id).html(html);
- $('#' + id).selectpicker('refresh');
- }
- });
- }
- function initDayNum() {
- var html = '';
- for (var i = 1; i <= 112; i++) {
- html += '<option value="' + i + '">' + i + '</option>';
- }
- $('#dayZlNum').html(html);
- $('#dayZlNum').selectpicker('refresh');
- }
- function initExecUnit() {
- //父科室列表
- $.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;
- }
- $('#execUnit').empty(); //清空resText里面的所有内容
- var html = '';
- $.each(data.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + '-' + comment.code + ')</option>';
- });
- $('#execUnit').html(html);
- $('#execUnit').selectpicker('refresh');
- }
- });
- }
- function clearData() {
- $("#payQrcodeYjEntry").html("")
- $("#yjksItem").val(null)
- $("#descriptions").val(null)
- $("#zlCode").val(null)
- $("#chargeUnit").val(null)
- $("#zlItemPrice").val(null)
- $("#itemQuantity").val(null)
- $("#dayZlNum").val(null)
- $('#dayZlNum').selectpicker('refresh');
- $("#orderFrequencyZl").val(null)
- $('#orderFrequencyZl').selectpicker('refresh');
- $("#totalNumZl").val(null)
- $("#totalAmountZl").val(null)
- $("#execUnit").val(null)
- $('#execUnit').selectpicker('refresh');
- $("#remark").val(null)
- }
- //保存右边数据
- function saveRightData() {
- let obj = {
- zlCode: $("#zlCode").val(),
- name: $("#yjksItem").val(),
- descriptions: $("#descriptions").val(),
- chargeUnit: $("#chargeUnit").val(),
- zlItemPrice: $("#zlItemPrice").val(),
- itemQuantity: $("#itemQuantity").val(),
- dayZlNum: $("#dayZlNum").val(),
- orderFrequencyZl: $("#orderFrequencyZl").val(),
- totalNumZl: $("#totalNumZl").val(),
- totalAmountZl: $("#totalAmountZl").val(),
- execUnit: $("#execUnit").val(),
- execUnitName: $('#execUnit option:selected').text(),
- remark: $("#remark").val(),
- }
- if(!stringNotBlank(obj.zlCode)){
- errorMesageSimaple('项目编码不能为空!')
- return
- }
- if(!stringNotBlank(obj.itemQuantity) || obj.itemQuantity <= 0){
- errorMesageSimaple('单量不能为空或单量必须大于0!')
- return
- }
- if(!stringNotBlank(obj.dayZlNum)){
- errorMesageSimaple('天数不能为空!')
- return
- }
- if(!stringNotBlank(obj.orderFrequencyZl)){
- errorMesageSimaple('频次不能为空!')
- return
- }
- if(checkCfData(obj)){
- errorMesageSimaple('已经开具了该项目,请不要重复开!')
- return
- }
- rightData.push(obj);
- loadRightTable();
- jiSuanTotalCharge();
- clearData();
- }
- function checkCfData(obj) {
- for (let i = 0; i <rightData.length ; i++) {
- if(rightData[i].zlCode === obj.zlCode){
- return true;
- }
- }
- return false;
- }
- /**
- * 保存
- */
- function saveYjItem() {
- if($("#patientIdText").text() == null){
- errorMesageSimaple('门诊号不能为空!')
- return
- }
- // rightData
- if(rightData.length === 0) {
- errorMesageSimaple('要保存的数据不能为空!')
- return
- }
- if(!confirm("请确认是否保存")){
- return
- }
- let mzChargeDetailList = []
- for (let i = 0; i <rightData.length ; i++) {
- let temp = {
- unitPrice:rightData[i].zlItemPrice,
- origPrice:rightData[i].zlItemPrice,
- chargeItemCode:rightData[i].zlCode,
- quantity:rightData[i].totalNumZl,
- drugQuan:rightData[i].itemQuantity,
- instructionText:rightData[i].remark,
- execDept:rightData[i].execUnit,
- frequency:rightData[i].orderFrequencyZl,
- orderDays:rightData[i].dayZlNum,
- paySelf:"0",
- drugWin:1,
- groupNo:"00",
- tryFlag:"0",
- }
- mzChargeDetailList.push(temp)
- }
- let paramData = {
- patientId: $("#patientIdText").text(),
- visitDeptCode: $("#clinicDeptNo").val(),
- mzChargeDetailList: mzChargeDetailList
- }
- postAjaxJsonHttpRequst("/thmz/saveYjItemEntry",paramData,true,function (res) {
- if(res.code == 0){
- successMesageSimaple('保存成功!')
- setPrintDetail(paramData.patientId,res.data);
- setTimeout(function () {
- clearData()
- clearPatient()
- $("#patientIdParam").val(null)
- $("#totalCharge").text(0)
- rightData = []
- loadRightTable()
- },2000)
- }else {
- errorMesage(res)
- }
- })
- }
- /**
- * 打开医技录入记录 yj_history_table
- */
- function openYjEntryHistoryModel() {
- $("#yjEntryModal").modal();
- initYjHistoryTable();
- }
- /**
- * 初始医技费用历史列表
- */
- function initYjHistoryTable() {
- $('#yj_history_table').bootstrapTable("destroy");
- $('#yj_history_table').bootstrapTable({
- url: '/thmz/queryYjEntryHistory', //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: {}, //传递参数(*)
- 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="chongPrint(\'' + row.patientId + '\',\'' + row.times + '\')">打印</button>';
- return str;
- }
- },
- {
- field: 'patientId',
- title: '门诊号',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'times',
- title: '次数',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'name',
- title: '姓名',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'deptName',
- title: '科室',
- align: "center",
- valign: 'middle'
- },
- {
- field: 'doctorName',
- 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: 'totalFee',
- 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.data.length,//总页数
- "rows": ress.data //数据
- };
- },
- });
- }
- //查询病人信息
- function queryMzPatient() {
- //getByIcCardNo icCardNo
- getAjaxRequst("/thmz/getByIcCardNo",{icCardNo:$("#patientIdParam").val()},true,function (res) {
- if(res.code == 0){
- $("#patientIdText").text(res.data.patientId)
- $("#nameParam").text(res.data.name)
- $("#ageParam").text(res.data.ageString)
- $("#sexParam").text(res.data.sex == 1 ? '男' : '女')
- }else {
- errorMesage(res)
- }
- })
- }
- /**
- * 清空病人信息
- */
- function clearPatient() {
- $("#patientIdText").text(null)
- $("#nameParam").text(null)
- $("#ageParam").text(null)
- $("#sexParam").text(null)
- }
- /**
- * 初始化当前医生说书科室
- */
- function initClinicDeptNo() {
- $.ajax({
- type: "GET",
- url: '/thmz/getUnitCodeByCurrentUser',
- 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>';
- });
- $('#clinicDeptNo').empty();
- $('#clinicDeptNo').html(html);
- $('#clinicDeptNo').selectpicker('refresh');
- $('#clinicDeptNo').val(res.data[0].code);
- $('#clinicDeptNo').selectpicker('refresh');
- }
- });
- }
- /**
- * 打开科室选择页面
- */
- function selectDeptModal() {
- $("#selectDeptModal").modal("show");
- }
- function chongPrint(patientId,times) {
- setPrintDetail(patientId,times)
- $("#yjEntryModal").modal("hide");
- }
- /**
- * 加载搜索窗口
- */
- function initSearchList(content, searchTextIds, 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
- };
- if(Array.isArray(searchTextIds)){
- for (let i = 0; i < searchTextIds.length; i++) {
- $('#' + searchTextIds[i]).webuiPopover('destroy').webuiPopover(settings);
- }
- }else{
- $('#' + searchTextIds).webuiPopover('destroy').webuiPopover(settings);
- }
- }
- function setPrintDetail(patientId,times) {
- postAjaxJsonHttpRequst("/thmz/queryYjEntryPrintData",{patientId:patientId,times:times},true,function (res) {
- if(res.code == 0){
- $("#patientId_t").html("门诊号:"+ res.data.patientId)
- $("#name_t").html("姓名:"+ res.data.name)
- $("#date_t").html("日期:"+ format(res.data.visitDate,'yyyy-MM-dd'))
- $("#dept_t").html("科室:"+ res.data.deptName)
- $("#doctor_t").html("医生:"+ res.data.doctorName)
- let html = "";
- let mzChargeDetails = res.data.mzChargeDetails
- for (let i = 0; i <mzChargeDetails.length ; i++) {
- html += "<tr>";
- html += ' <td style="width: 17%;padding-left: 8px;padding-top: 4px;word-break:break-all;">' + mzChargeDetails[i].chargeItemCode + '</td>';
- html += ' <td style="width: 45%;padding-left: 8px;padding-top: 4px;word-break:break-all;">' + mzChargeDetails[i].tcName + '</td>';
- html += ' <td style="width: 10%;padding-left: 8px;padding-top: 4px;word-break:break-all;">' + mzChargeDetails[i].instructionText + '</td>';
- html += ' <td style="width: 10%;padding-left: 8px;padding-top: 4px;word-break:break-all;">' + mzChargeDetails[i].drugUnit + '</td>';
- html += ' <td style="width: 6%;padding-left: 8px;padding-top: 4px;word-break:break-all;">' + mzChargeDetails[i].unitPrice + '</td>';
- html += ' <td style="width: 6%;padding-left: 8px;padding-top: 4px;word-break:break-all;">' + mzChargeDetails[i].quantity + '</td>';
- html += ' <td style="width: 6%;padding-left: 8px;padding-top: 4px;word-break:break-all;">' + mzChargeDetails[i].amount + '</td>';
- html += "</tr>";
- }
- html += '<tr><td colspan="8"><div style="border:0;border-top:1px solid #000;overflow:hidden;font-size: 13px;"><div style="float: right;font-weight: 700;padding-top: 4px;padding-bottom: 4px;"><span>金额合计:</span><span id="total_count" style="margin-left: 50px;"></span></div></div></td></tr>';
- $("#fymx_table_body").html(html);
- $("#total_count").text(res.data.totalFee+' 元');
- setTimeout(printChargeDetail,500)
- }else {
- errorMesage(res)
- }
- })
- }
- function jiSuanTotalCharge() {
- let total = 0;
- for (let i = 0; i <rightData.length ; i++) {
- total += Number(rightData[i].totalAmountZl)
- }
- $("#totalCharge").text(total)
- }
- /**
- * 打印费用明细
- */
- function printChargeDetail() {
- setPrint();
- LODOP = getLodop();
- LODOP.PRINT_INITA(6, 0, "210mm", "297mm", "项目录入费用清单");
- //设置默认打印机
- LODOP.SET_PRINTER_INDEX(printIndex);
- LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "297mm");
- LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
- LODOP.ADD_PRINT_TABLE(150, "5%", "90%", 800, document.getElementById("fymx_table").innerHTML);
- LODOP.SET_PRINT_STYLEA(0, "Vorient", 3);
- LODOP.ADD_PRINT_HTM(26, "5%", "90%", 109, document.getElementById("right_title").innerHTML);
- LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
- LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 1);
- LODOP.ADD_PRINT_HTM(950, "5%", "90%", 120, document.getElementById("foot").innerHTML);
- LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
- LODOP.SET_PRINT_STYLEA(0, "LinkedItem", 1);
- // LODOP.PRINT();
- LODOP.PREVIEW();
- }
- /**
- * 查询默认打印机
- */
- 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;
- }
- }
- });
- }
|