|
|
@@ -0,0 +1,348 @@
|
|
|
+//@ sourceURL=repeal_refund_medicine.js
|
|
|
+$(function () {
|
|
|
+ init_daterangepicker();
|
|
|
+ initRepealRefundListByPatient();
|
|
|
+ // initFeeTable();
|
|
|
+ //重置查询参数
|
|
|
+ $('#btn_clean').click(function () {
|
|
|
+ cleanParams();
|
|
|
+ });
|
|
|
+
|
|
|
+ $("#btn_query").click(function (t) {
|
|
|
+ initRepealRefundListByPatient();
|
|
|
+ });
|
|
|
+
|
|
|
+ $(".selectpicker").selectpicker({
|
|
|
+ dropuAuto: false
|
|
|
+ });
|
|
|
+});
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 查询退药申请记录
|
|
|
+ */
|
|
|
+function initRepealRefundListByPatient() {
|
|
|
+ $('#tb_table').bootstrapTable("destroy");
|
|
|
+ $('#tb_table').bootstrapTable({
|
|
|
+ url: '/thmz/getRepealRefund', //请求后台的URL(*)
|
|
|
+ method: 'post', //请求方式(*)
|
|
|
+ toolbar: '#toolbar', //工具按钮用哪个容器
|
|
|
+ striped: true, //是否显示行间隔色
|
|
|
+ cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
|
|
|
+ pagination: true, //是否显示分页(*)
|
|
|
+ sortable: true, //是否启用排序
|
|
|
+ sortOrder: "asc", //排序方式
|
|
|
+ queryParams: 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',
|
|
|
+ // sortable: true,
|
|
|
+ formatter: function (value, row, index) {
|
|
|
+ return '<button type="button" class="registration-no-color-foot-button" title="取消退药申请" onclick="repealRefund(\'' + row.patientId + '\','+row.times+','+row.receiptNo+','+row.realNo+')"><i class="fa fa-reply"></i></button>' ;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ,{
|
|
|
+ field: 'patientId',
|
|
|
+ title: '门诊号',
|
|
|
+ align: "center",
|
|
|
+ valign: 'middle',
|
|
|
+ }, {
|
|
|
+ field: 'name',
|
|
|
+ title: '姓名',
|
|
|
+ align: "center",
|
|
|
+ valign: 'middle',
|
|
|
+ }, {
|
|
|
+ field: 'groupNoOut',
|
|
|
+ title: '药房',
|
|
|
+ align: "center",
|
|
|
+ valign: 'middle',
|
|
|
+ }, {
|
|
|
+ field: 'inputTime',
|
|
|
+ title: '退药时间',
|
|
|
+ align: "center",
|
|
|
+ valign: 'middle',
|
|
|
+ formatter: function (value, row, index) {
|
|
|
+ if (value != null && value != "") {
|
|
|
+ return format(value, "yyyy-MM-dd HH:mm:ss");
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ field: 'doctorName',
|
|
|
+ title: '医生',
|
|
|
+ align: "center",
|
|
|
+ valign: 'middle',
|
|
|
+ }, {
|
|
|
+ field: 'realNo',
|
|
|
+ title: '流水号',
|
|
|
+ align: "center",
|
|
|
+ valign: 'middle',
|
|
|
+ formatter: function (value, row, index) {
|
|
|
+ if (value != null && value != "") {
|
|
|
+ return Math.abs(value);
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ onClickRow: function (row) {
|
|
|
+ fitfymx(row.patientId, row.times, row.receiptNo,row.orderNo,row.groupNo);
|
|
|
+ },
|
|
|
+ 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 != '') {
|
|
|
+ errorMesage(res);
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ "total": 0,//总页数
|
|
|
+ "rows": {} //数据
|
|
|
+ };
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ "total": ress.data.length,//总页数
|
|
|
+ "rows": ress.data //数据
|
|
|
+ };
|
|
|
+ },
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 构建列表查询参数
|
|
|
+ * @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 rePortRangeArr = getRePortRangeArr();
|
|
|
+ var temp = {
|
|
|
+ beginDate: rePortRangeArr[0],
|
|
|
+ endDate: rePortRangeArr[1],
|
|
|
+ name: $("#name").val(),
|
|
|
+ patientId: $("#patientId").val(),
|
|
|
+ serialNo: $("#serialNo").val()
|
|
|
+ };
|
|
|
+ return temp;
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 撤销退药申请
|
|
|
+ * @param patientId
|
|
|
+ * @param times
|
|
|
+ * @param receiptNo
|
|
|
+ * @param realNo
|
|
|
+ */
|
|
|
+function repealRefund(patientId,times,receiptNo,realNo) {
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: '/thmz/repealRefund',
|
|
|
+ contentType: "application/json;charset=UTF-8",
|
|
|
+ dataType: "json",
|
|
|
+ data: JSON.stringify({"patientId": patientId, "times": times, "receiptNo": receiptNo,"realNo":realNo}),
|
|
|
+ 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) {
|
|
|
+ successMesage(res);
|
|
|
+ } else {
|
|
|
+ errorMesage(res);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 设置病人id
|
|
|
+ */
|
|
|
+function setPatientId() {
|
|
|
+ var patientId_or_cardNo = $("#patientId_or_cardNo").val();
|
|
|
+ $.ajax({
|
|
|
+ type: "GET",
|
|
|
+ url: '/thmz/getByIcCardNo?icCardNo=' + patientId_or_cardNo,
|
|
|
+ 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) {
|
|
|
+ if (res.data != null) {
|
|
|
+ $("#patientId").val(res.data.patientId);
|
|
|
+ } else {
|
|
|
+ $("#patientId").val(patientId_or_cardNo);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ $("#patientId").val(null);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 获取时间选择器的时间数组
|
|
|
+ * @returns {string[]}
|
|
|
+ */
|
|
|
+function getRePortRangeArr() {
|
|
|
+ var rePortRange = $('#reportrange span').html();
|
|
|
+ var rePortRangeArr = rePortRange.split(" - ");
|
|
|
+ rePortRangeArr[0] = rePortRangeArr[0] + " 00:00:00"
|
|
|
+ rePortRangeArr[1] = rePortRangeArr[1] + " 23:59:59"
|
|
|
+ return rePortRangeArr;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 清空查询条件
|
|
|
+ */
|
|
|
+function cleanParams() {
|
|
|
+ $('#reportrange span').html(moment().format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
|
|
|
+ $("#name").val(null),
|
|
|
+ $("#patientId").val(null),
|
|
|
+ $("#serialNo").val(null),
|
|
|
+ $("#patientId_or_cardNo").val(null)
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 设置病人药品明细
|
|
|
+ */
|
|
|
+var $table;
|
|
|
+function fitfymx(patientId,times,receiptNo,orderNo,groupNoOut) {
|
|
|
+ var temp = {
|
|
|
+ patientId: patientId,
|
|
|
+ times: times,
|
|
|
+ receiptNo:receiptNo,
|
|
|
+ orderNo:orderNo,
|
|
|
+ groupNoOut:groupNoOut
|
|
|
+ };
|
|
|
+
|
|
|
+ $('#tb_table_right').bootstrapTable("destroy");
|
|
|
+ $table= $('#tb_table_right').bootstrapTable({
|
|
|
+ url: '/thmz/getRefundMedicineDetail', //请求后台的URL(*)
|
|
|
+ method: 'post', //请求方式(*)
|
|
|
+ toolbar: '#toolbar', //工具按钮用哪个容器
|
|
|
+ striped: true, //是否显示行间隔色
|
|
|
+ cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
|
|
|
+ pagination: true, //是否显示分页(*)
|
|
|
+ sortable: true, //是否启用排序
|
|
|
+ sortOrder: "asc", //排序方式
|
|
|
+ queryParams: temp, //传递参数(*)
|
|
|
+ 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: [
|
|
|
+ {
|
|
|
+ field: 'drugname',
|
|
|
+ title: '品名',
|
|
|
+ align: "center",
|
|
|
+ valign: 'middle',
|
|
|
+ formatter: function (value, row, index) {
|
|
|
+ if (value != null && value != "") {
|
|
|
+ return value.replace("()","");
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ field: 'specification',
|
|
|
+ title: '规格',
|
|
|
+ align: "center",
|
|
|
+ valign: 'middle',
|
|
|
+ }, {
|
|
|
+ field: 'quantity',
|
|
|
+ title: '退药量',
|
|
|
+ align: "center",
|
|
|
+ valign: 'middle',
|
|
|
+ }, {
|
|
|
+ field: 'unit_price',
|
|
|
+ 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 //数据
|
|
|
+ };
|
|
|
+ },
|
|
|
+ });
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|