|
@@ -128,6 +128,34 @@ $(function () {
|
|
|
initNavTabs(0);
|
|
|
//初始医生工作太配置
|
|
|
initWorkspaceConfigForCurrent();
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 西药点击事件
|
|
|
+ */
|
|
|
+ $("#western_medicine_name").on("click", function (t) {
|
|
|
+ var obj = $("#westernMedicinePopoverContent").parent().parent().parent();
|
|
|
+ if ($(obj).hasClass("in") || $(obj).css("display") == "block") {
|
|
|
+ $('#western_medicine_name').webuiPopover('hide');
|
|
|
+ $("#treeButton").webuiPopover('hide');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $('#western_medicine_name').webuiPopover('show');
|
|
|
+ loadYpList(0);
|
|
|
+ });
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 项目点击事件
|
|
|
+ */
|
|
|
+ $("#jcJyItem").on("click", function (t) {
|
|
|
+ if ($("#jcJyItemPopoverContent").parent().parent().parent().hasClass("in")) {
|
|
|
+ $('#jcJyItem').webuiPopover('hide');
|
|
|
+ $("#treeButton").webuiPopover('hide');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $('#jcJyItem').webuiPopover('show');
|
|
|
+ loadjcJyItemList();
|
|
|
+ });
|
|
|
+
|
|
|
});
|
|
|
|
|
|
/**
|
|
@@ -193,11 +221,11 @@ function groupIdChange() {
|
|
|
//天数
|
|
|
$("#dayNum").selectpicker('val', dayNum);
|
|
|
$('#dayNum').selectpicker('refresh');
|
|
|
- // $("#dayNum").attr("disabled", "disabled");
|
|
|
+ // $("#dayNum").attr("disabled", "disabled");
|
|
|
//频次编码
|
|
|
$("#orderFrequency").selectpicker('val', orderFrequency);
|
|
|
$('#orderFrequency').selectpicker('refresh');
|
|
|
- // $("#orderFrequency").attr("disabled", "disabled");
|
|
|
+ // $("#orderFrequency").attr("disabled", "disabled");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1382,20 +1410,6 @@ function initZySupplyTypes(id) {
|
|
|
function changeDate(ev) {
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * 列表类型按钮切换事件
|
|
|
- * @param object
|
|
|
- */
|
|
|
-function titleButtonChange(object) {
|
|
|
- $("#regi_List_btn_group").find("button").each(function (index, element) {
|
|
|
- if ($(element).hasClass("btn-primary")) {
|
|
|
- $(element).removeClass("btn-primary").addClass("btn-default");
|
|
|
- }
|
|
|
- });
|
|
|
- $(object).removeClass("btn-default").addClass("btn-primary");
|
|
|
- loadRegistrationList(true);
|
|
|
-}
|
|
|
-
|
|
|
|
|
|
/**
|
|
|
* 表格类型切换事件 卡片展示或者列表形式
|
|
@@ -1477,6 +1491,8 @@ function saveWesternMedicine() {
|
|
|
var medicalAdvice = $("#medicalAdvice").val();
|
|
|
//金额
|
|
|
var totalRetprice = parseFloat($("#totalRetprice").val());
|
|
|
+ //单价
|
|
|
+ var packRetprice = $("#packRetprice").val();
|
|
|
if (currentCode == null || currentCode == '') {
|
|
|
errorMesageSimaple("未选择任何药品!");
|
|
|
return;
|
|
@@ -1493,22 +1509,77 @@ function saveWesternMedicine() {
|
|
|
if (medicalAdvice != null && medicalAdvice != '') {
|
|
|
html += '医嘱:' + medicalAdvice;
|
|
|
}
|
|
|
- html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 30px;font-size: 20px;"></i>';
|
|
|
- html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 30px;font-size: 20px;"></i>';
|
|
|
+ html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="editWesternMedicine(this)"></i>';
|
|
|
+ html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="removeYpOrProject(0,this)"></i>';
|
|
|
html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
|
|
|
html += '<input type="hidden" class="temporary_items_serial" value="' + currentSerial + '"/>';
|
|
|
html += '<input type="hidden" class="temporary_items_amount" value="' + totalRetprice + '"/>';
|
|
|
+ html += '<input type="hidden" class="temporary_items_groupId" value="' + groupId + '"/>';
|
|
|
+ html += '<input type="hidden" class="temporary_items_westernMedicineNamme" value="' + westernMedicineNamme + '"/>';
|
|
|
+ html += '<input type="hidden" class="temporary_items_drugWinDb" value="' + drugWinDb + '"/>';
|
|
|
+ html += '<input type="hidden" class="temporary_items_drugWin" value="' + drugWin + '"/>';
|
|
|
+ html += '<input type="hidden" class="temporary_items_drugWinUnit" value="' + drugWinUnit + '"/>';
|
|
|
+ html += '<input type="hidden" class="temporary_items_gross" value="' + gross + '"/>';
|
|
|
+ html += '<input type="hidden" class="temporary_items_packUnit" value="' + packUnit + '"/>';
|
|
|
+ html += '<input type="hidden" class="temporary_items_supplyType" value="' + supplyType + '"/>';
|
|
|
+ html += '<input type="hidden" class="temporary_items_orderFrequency" value="' + orderFrequency + '"/>';
|
|
|
+ html += '<input type="hidden" class="temporary_items_dayNum" value="' + dayNum + '"/>';
|
|
|
+ html += '<input type="hidden" class="temporary_items_medicalAdvice" value="' + medicalAdvice + '"/>';
|
|
|
+ html += '<input type="hidden" class="temporary_items_packRetprice" value="' + packRetprice + '"/>';
|
|
|
html += '</div>';
|
|
|
|
|
|
var tableId = $("#xyTab li.active").find("a").attr("href");
|
|
|
- $(tableId).find("div:eq(0)").append(html);
|
|
|
- //设置单张处方金额
|
|
|
- var cfAmount = $(tableId).find("span.cf_amount").html();
|
|
|
- if (cfAmount != null && cfAmount != "") {
|
|
|
- cfAmount = parseFloat($(tableId).find("span.cf_amount").html());
|
|
|
+ var temporaryItemsAmount = 0;
|
|
|
+ //是新增药品还是编辑 true 修改 默认false
|
|
|
+ var updateFlag = $("#update_flag").val();
|
|
|
+ if (updateFlag == undefined || updateFlag == null) {
|
|
|
+ updateFlag = false;
|
|
|
}
|
|
|
- cfAmount = Add(cfAmount, totalRetprice);
|
|
|
- $(tableId).find("span.cf_amount").html(cfAmount);
|
|
|
+ //原药品金额 如果是修改则需要设置
|
|
|
+ var temporaryItemsAmount = 0;
|
|
|
+ //当前需要被移除元素的下个兄弟节点
|
|
|
+ var nextObj = null;
|
|
|
+ //当前修改的药品是不是最后一个
|
|
|
+ var isLast = false;
|
|
|
+ var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
|
|
|
+ if (formGroups != null && formGroups.length > 0) {
|
|
|
+ //如果是修改,需要减去原来的费用
|
|
|
+ if (updateFlag=="true" || updateFlag==true) {
|
|
|
+ for (var i = 0; i < formGroups.length; i++) {
|
|
|
+ var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
|
|
|
+ var temporaryItemsSerial = $(formGroups[i]).find("input.temporary_items_serial").val();
|
|
|
+ if (temporaryItemsCode === currentCode && temporaryItemsSerial === currentSerial) {
|
|
|
+ temporaryItemsAmount = $(formGroups[i]).find("input.temporary_items_amount").val();
|
|
|
+ if (formGroups.length > 1) {
|
|
|
+ nextObj = $(formGroups[i]).next();
|
|
|
+ }
|
|
|
+ isLast = (i + 1) === formGroups.length;
|
|
|
+ $(formGroups[i]).remove();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //因为药品可以换组号,要保证相同组号的在一起
|
|
|
+ for (var i = 0; i < formGroups.length; i++) {
|
|
|
+ var temporaryItemsGroupId = parseInt($(formGroups[i]).find("input.temporary_items_groupId").val());
|
|
|
+ //如果当前的组号小与遍历到的组号,说明是原组号的下一个兄弟节点,新的药品插入到兄弟节点前就可以了
|
|
|
+ if (temporaryItemsGroupId > groupId) {
|
|
|
+ nextObj = $(formGroups[i]);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
|
|
|
+ if (nextObj == null || isLast) {
|
|
|
+ $(tableId).find("div:eq(0)").append(html);
|
|
|
+ } else {
|
|
|
+ $(nextObj).before(html);
|
|
|
+ }
|
|
|
+ //设置当前处方金额
|
|
|
+ calculateCfAmount(tableId, totalRetprice, temporaryItemsAmount, 0, 0);
|
|
|
//设置总金额
|
|
|
calculateTotalAmount();
|
|
|
//判断当前组号是不是最后一个,是最后一个组号,就需要新增组号
|
|
@@ -1528,6 +1599,145 @@ function saveWesternMedicine() {
|
|
|
clearWesternMedicine(false);
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * 上移
|
|
|
+ * @param obj
|
|
|
+ */
|
|
|
+function arrowUp(obj){
|
|
|
+ var parentObject = $(obj).parent();
|
|
|
+ if($(parentObject).prev()==null){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //当前元素的序号
|
|
|
+ var thisJcjyItemGroupId=null;
|
|
|
+ //前一个兄弟节点的序号
|
|
|
+ var prevJcjyItemGroupId=null;
|
|
|
+ //当是项目时有序号,进行序号调整
|
|
|
+ if($(parentObject).find("span.jcjyItemGroupId")!=null){
|
|
|
+ thisJcjyItemGroupId=$(parentObject).find("span.jcjyItemGroupId").html();
|
|
|
+ prevJcjyItemGroupId=$(parentObject).prev().find("span.jcjyItemGroupId").html();
|
|
|
+ $(parentObject).find("span.jcjyItemGroupId").html(prevJcjyItemGroupId);
|
|
|
+ $(parentObject).prev().find("span.jcjyItemGroupId").html(thisJcjyItemGroupId);
|
|
|
+ }
|
|
|
+ $(parentObject).prev().before($(parentObject));
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 下移
|
|
|
+ * @param obj
|
|
|
+ */
|
|
|
+function arrowDown(obj){
|
|
|
+ var parentObject = $(obj).parent();
|
|
|
+ if($(parentObject).next()==null){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //当前元素的序号
|
|
|
+ var thisJcjyItemGroupId=null;
|
|
|
+ //后一个兄弟节点的序号
|
|
|
+ var afterJcjyItemGroupId=null;
|
|
|
+ //当是项目时有序号,进行序号调整
|
|
|
+ if($(parentObject).find("span.jcjyItemGroupId")!=null){
|
|
|
+ thisJcjyItemGroupId=$(parentObject).find("span.jcjyItemGroupId").html();
|
|
|
+ afterJcjyItemGroupId=$(parentObject).after().find("span.jcjyItemGroupId").html();
|
|
|
+ $(parentObject).find("span.jcjyItemGroupId").html(afterJcjyItemGroupId);
|
|
|
+ $(parentObject).after().find("span.jcjyItemGroupId").html(thisJcjyItemGroupId);
|
|
|
+ }
|
|
|
+ $(parentObject).next().after($(parentObject));
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 修改西药
|
|
|
+ * @param obj
|
|
|
+ */
|
|
|
+function editWesternMedicine(obj) {
|
|
|
+ //是新增药品还是编辑 true 修改 默认false
|
|
|
+ $("#update_flag").val(true);
|
|
|
+ var parentObject = $(obj).parent();
|
|
|
+ //组号
|
|
|
+ $("#groupId").val($(parentObject).find("input.temporary_items_groupId").val());
|
|
|
+ $('#groupId').selectpicker('refresh');
|
|
|
+ //药品名称
|
|
|
+ $("#western_medicine_name").val($(parentObject).find("input.temporary_items_westernMedicineNamme").val());
|
|
|
+ //当前药品编码
|
|
|
+ $("#current_code").val($(parentObject).find("input.temporary_items_code").val());
|
|
|
+ //当前药品规格
|
|
|
+ $("#current_serial").val($(parentObject).find("input.temporary_items_serial").val());
|
|
|
+ //用法编码
|
|
|
+ $("#supplyType").val($(parentObject).find("input.temporary_items_supplyType").val());
|
|
|
+ $('#supplyType').selectpicker('refresh');
|
|
|
+
|
|
|
+ //药品默认单次使用剂量
|
|
|
+ $("#drugWinDb").val($(parentObject).find("input.temporary_items_drugWinDb").val());
|
|
|
+ //处方实际单次使用剂量
|
|
|
+ $("#drugWin").val($(parentObject).find("input.temporary_items_drugWin").val());
|
|
|
+ //剂量单位
|
|
|
+ $("#drugWinUnit").val($(parentObject).find("input.temporary_items_drugWinUnit").val());
|
|
|
+ $('#drugWinUnit').selectpicker('refresh');
|
|
|
+ //天数
|
|
|
+ $("#dayNum").val($(parentObject).find("input.temporary_items_dayNum").val());
|
|
|
+ $('#dayNum').selectpicker('refresh');
|
|
|
+ //频次编码
|
|
|
+ $("#orderFrequency").val($(parentObject).find("input.temporary_items_orderFrequency").val());
|
|
|
+ $('#orderFrequency').selectpicker('refresh');
|
|
|
+ //总量
|
|
|
+ $("#gross").val($(parentObject).find("input.temporary_items_gross").val());
|
|
|
+ //包装单位
|
|
|
+ $("#packUnit").val($(parentObject).find("input.temporary_items_packUnit").val());
|
|
|
+ $('#packUnit').selectpicker('refresh');
|
|
|
+ //医嘱
|
|
|
+ $("#medicalAdvice").val($(parentObject).find("input.temporary_items_medicalAdvice").val());
|
|
|
+ //金额
|
|
|
+ $("#totalRetprice").val($(parentObject).find("input.temporary_items_amount").val());
|
|
|
+ //单价
|
|
|
+ $("#packRetprice").val($(parentObject).find("input.temporary_items_packRetprice").val());
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 修改中药
|
|
|
+ * @param obj
|
|
|
+ */
|
|
|
+function editChineseMedicine(obj) {
|
|
|
+ //是新增药品还是编辑 true 修改 默认false
|
|
|
+ $("#update_flag").val(true);
|
|
|
+ var parentObject = $(obj).parent();
|
|
|
+ //当前药品编码
|
|
|
+ $("#current_code").val($(parentObject).find("input.temporary_items_code").val());
|
|
|
+ //当前药品规格
|
|
|
+ $("#current_serial").val($(parentObject).find("input.temporary_items_serial").val());
|
|
|
+ //中药类型
|
|
|
+ $("#zyClassType").val($(parentObject).find("input.temporary_items_zyClassType").val());
|
|
|
+ $('#zyClassType').selectpicker('refresh');
|
|
|
+ //药品名称
|
|
|
+ $("#chinese_medicine_name").val($(parentObject).find("input.temporary_items_chineseMedicineNamme").val());
|
|
|
+ //单价
|
|
|
+ $("#zy_packRetprice").val($(parentObject).find("input.temporary_items_zyPackRetprice").val());
|
|
|
+ //处方实际单次使用剂量
|
|
|
+ $("#zy_drugWin").val($(parentObject).find("input.temporary_items_drugWin").val());
|
|
|
+ //医嘱码
|
|
|
+ $("#zyInstruction").val($(parentObject).find("input.temporary_items_zyInstruction").val());
|
|
|
+ $('#zyInstruction').selectpicker('refresh');
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 修改项目
|
|
|
+ * @param obj
|
|
|
+ */
|
|
|
+function editJyJcItem(obj) {
|
|
|
+ //是新增药品还是编辑 true 修改 默认false
|
|
|
+ $("#update_flag").val(true);
|
|
|
+ var parentObject = $(obj).parent();
|
|
|
+ //当前项目编码
|
|
|
+ $("#current_code").val($(parentObject).find("input.temporary_items_code").val());
|
|
|
+ //项目名称
|
|
|
+ $("#jcJyItem").val($(parentObject).find("input.temporary_items_jcJyItemName").val());
|
|
|
+ //单价
|
|
|
+ $("#jcjyItemPrice").val($(parentObject).find("input.temporary_items_amount").val());
|
|
|
+ //备注
|
|
|
+ $("#remark").val($(parentObject).find("input.temporary_items_remark").val());
|
|
|
+}
|
|
|
|
|
|
/**
|
|
|
* 保存当前项目到右边处方区域
|
|
@@ -1537,9 +1747,9 @@ function saveJyJcItem() {
|
|
|
var tableId = $("#zlTab li.active").find("a").attr("href");
|
|
|
//组号
|
|
|
var groupId = $(tableId).find("div:eq(0)").children().length + 1;
|
|
|
- //药品名称
|
|
|
+ //项目名称
|
|
|
var jcJyItem = $("#jcJyItem").val();
|
|
|
- //当前药品编码
|
|
|
+ //当前项目编码
|
|
|
var currentCode = $("#current_code").val();
|
|
|
//当前项目价格
|
|
|
var jcjyItemPrice = $("#jcjyItemPrice").val();
|
|
@@ -1550,36 +1760,91 @@ function saveJyJcItem() {
|
|
|
return;
|
|
|
}
|
|
|
var html = '<div class="form-group">';
|
|
|
- html += groupId + '. ';
|
|
|
+ html+='<span class="jcjyItemGroupId">'+groupId+'</span>. '
|
|
|
html += jcJyItem + ' ';
|
|
|
if (remark != null && remark != '') {
|
|
|
html += '备注:' + remark;
|
|
|
}
|
|
|
- html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 30px;font-size: 20px;"></i>';
|
|
|
- html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 30px;font-size: 20px;"></i>';
|
|
|
- html += '<i class="fa fa-eye" style="cursor: pointer;height: 20px;line-height: 20px;width: 30px;font-size: 20px;" onclick="getJcJyItemChargeByCode(\'' + currentCode + '\')"></i>';
|
|
|
+ html += ' <i class="fa fa-long-arrow-up" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="arrowUp(this)"></i>';
|
|
|
+ html += '<i class="fa fa-long-arrow-down" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="arrowDown(this)"></i>';
|
|
|
+ html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="editJyJcItem(this)"></i>';
|
|
|
+ html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="removeYpOrProject(2,this)"></i>';
|
|
|
+ html += '<i class="fa fa-eye" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="getJcJyItemChargeByCode(\'' + currentCode + '\')"></i>';
|
|
|
html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
|
|
|
+ html += '<input type="hidden" class="temporary_items_jcJyItemName" value="' + jcJyItem + '"/>';
|
|
|
html += '<input type="hidden" class="temporary_items_amount" value="' + jcjyItemPrice + '"/>';
|
|
|
+ html += '<input type="hidden" class="temporary_items_remark" value="' + remark + '"/>';
|
|
|
html += '</div>';
|
|
|
- $(tableId).find("div:eq(0)").append(html);
|
|
|
- //设置单张处方金额
|
|
|
- var cfAmount = $(tableId).find("span.cf_amount").html();
|
|
|
- if (cfAmount != null && cfAmount != "") {
|
|
|
- cfAmount = parseFloat($(tableId).find("span.cf_amount").html());
|
|
|
+
|
|
|
+ //原药品金额 如果是修改则需要设置
|
|
|
+ var temporaryItemsAmount = 0;
|
|
|
+ //当前需要被移除元素的下个兄弟节点
|
|
|
+ var nextObj = null;
|
|
|
+ //当前修改的药品是不是最后一个
|
|
|
+ var isLast = false;
|
|
|
+ //是新增药品还是编辑 true 修改 默认false
|
|
|
+ var updateFlag = $("#update_flag").val();
|
|
|
+ if (updateFlag == undefined || updateFlag == null) {
|
|
|
+ updateFlag = false;
|
|
|
}
|
|
|
- cfAmount = Add(cfAmount, jcjyItemPrice);
|
|
|
- $(tableId).find("span.cf_amount").html(cfAmount);
|
|
|
+ //如果是修改,需要减去原来的费用
|
|
|
+ if (updateFlag=="true" || updateFlag==true) {
|
|
|
+ var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
|
|
|
+ if (formGroups != null && formGroups.length > 0) {
|
|
|
+ for (var i = 0; i < formGroups.length; i++) {
|
|
|
+ var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
|
|
|
+ if (temporaryItemsCode === currentCode) {
|
|
|
+ temporaryItemsAmount = $(formGroups[i]).find("input.temporary_items_amount").val();
|
|
|
+ if (formGroups.length > 1) {
|
|
|
+ nextObj = $(formGroups[i]).next();
|
|
|
+ }
|
|
|
+ isLast = (i + 1) === formGroups.length;
|
|
|
+ $(formGroups[i]).remove();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
|
|
|
+ if (nextObj == null || isLast) {
|
|
|
+ $(tableId).find("div:eq(0)").append(html);
|
|
|
+ } else {
|
|
|
+ $(nextObj).before(html);
|
|
|
+ }
|
|
|
+ //设置当前处方金额
|
|
|
+ calculateCfAmount(tableId, jcjyItemPrice, temporaryItemsAmount, 2, 0);
|
|
|
//设置总金额
|
|
|
calculateTotalAmount();
|
|
|
clearJyJcItem();
|
|
|
}
|
|
|
|
|
|
|
|
|
+function removeYpOrProject(index, obj) {
|
|
|
+ var tabId = null;
|
|
|
+ //西药
|
|
|
+ if (index == 0) {
|
|
|
+ tabId = "xyTab";
|
|
|
+ } else if (index == 1) {
|
|
|
+ //中成药
|
|
|
+ tabId = "zyTab";
|
|
|
+ } else if (index == 2) {
|
|
|
+ //医技与诊疗
|
|
|
+ tabId = "zlTab";
|
|
|
+ }
|
|
|
+ var tableId = $("#" + tabId + " li.active").find("a").attr("href");
|
|
|
+ var totalRetprice = $(obj).parent().find("input.temporary_items_amount").val();
|
|
|
+ calculateCfAmount(tableId, totalRetprice, null, index, 1);
|
|
|
+ calculateTotalAmount();
|
|
|
+ $(obj).parent().remove();
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 清空西药
|
|
|
* @param flag 是否全部清空 因为 西药有分组,同一组的药品用药方式和频率以及天数一样,不能改变。所以不换组是不能改变 并且设置成不可编辑
|
|
|
*/
|
|
|
function clearWesternMedicine(flag) {
|
|
|
+ $("#update_flag").val(false);
|
|
|
//药品名称
|
|
|
$("#western_medicine_name").val(null);
|
|
|
//当前药品编码
|
|
@@ -1594,15 +1859,15 @@ function clearWesternMedicine(flag) {
|
|
|
//天数
|
|
|
$("#dayNum").selectpicker('val', null);
|
|
|
$('#dayNum').selectpicker('refresh');
|
|
|
- // $("#dayNum").removeAttr("disabled");
|
|
|
+ // $("#dayNum").removeAttr("disabled");
|
|
|
//频次编码
|
|
|
$("#orderFrequency").selectpicker('val', null);
|
|
|
$('#orderFrequency').selectpicker('refresh');
|
|
|
- // $("#orderFrequency").removeAttr("disabled");
|
|
|
+ // $("#orderFrequency").removeAttr("disabled");
|
|
|
} else {
|
|
|
//$("#supplyType").attr("disabled", "disabled");
|
|
|
//$("#dayNum").attr("disabled", "disabled");
|
|
|
- // $("#orderFrequency").attr("disabled", "disabled");
|
|
|
+ // $("#orderFrequency").attr("disabled", "disabled");
|
|
|
}
|
|
|
//药品默认单次使用剂量
|
|
|
$("#drugWinDb").val(null);
|
|
@@ -1637,7 +1902,7 @@ function saveChineseMedicine() {
|
|
|
var currentSerial = $("#current_serial").val();
|
|
|
//处方实际单次使用剂量
|
|
|
var drugWin = $("#zy_drugWin").val();
|
|
|
- //医嘱
|
|
|
+ //医嘱码
|
|
|
var zyInstruction = $("#zyInstruction").val();
|
|
|
//医嘱
|
|
|
var zyInstructionText = $('#zyInstruction option:selected').text();
|
|
@@ -1645,6 +1910,8 @@ function saveChineseMedicine() {
|
|
|
var zyPackRetprice = parseFloat($("#zy_packRetprice").val());
|
|
|
//当前中药的总价
|
|
|
var totalRetprice = Multiply(drugWin, zyPackRetprice);
|
|
|
+ //中药类型
|
|
|
+ var zyClassType = $("#zyClassType").val();
|
|
|
if (currentCode == null || currentCode == '') {
|
|
|
errorMesageSimaple("未选择任何药品!");
|
|
|
return;
|
|
@@ -1656,27 +1923,59 @@ function saveChineseMedicine() {
|
|
|
}
|
|
|
html += ' ';
|
|
|
html += drugWin + 'g';
|
|
|
- html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 30px;font-size: 20px;"></i>';
|
|
|
- html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 30px;font-size: 20px;"></i>';
|
|
|
+ html += ' <i class="fa fa-long-arrow-up" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="arrowUp(this)"></i>';
|
|
|
+ html += '<i class="fa fa-long-arrow-down" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="arrowDown(this)"></i>';
|
|
|
+ html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="editChineseMedicine(this)"></i>';
|
|
|
+ html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left:10px;" onclick="removeYpOrProject(1,this)"></i>';
|
|
|
html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
|
|
|
html += '<input type="hidden" class="temporary_items_serial" value="' + currentSerial + '"/>';
|
|
|
html += '<input type="hidden" class="temporary_items_amount" value="' + totalRetprice + '"/>';
|
|
|
+ html += '<input type="hidden" class="temporary_items_zyClassType" value="' + zyClassType + '"/>';
|
|
|
+ html += '<input type="hidden" class="temporary_items_chineseMedicineNamme" value="' + chineseMedicineNamme + '"/>';
|
|
|
+ html += '<input type="hidden" class="temporary_items_zyPackRetprice" value="' + zyPackRetprice + '"/>';
|
|
|
+ html += '<input type="hidden" class="temporary_items_drugWin" value="' + drugWin + '"/>';
|
|
|
+ html += '<input type="hidden" class="temporary_items_zyInstruction" value="' + zyInstruction + '"/>';
|
|
|
html += '</div>';
|
|
|
|
|
|
var tableId = $("#zyTab li.active").find("a").attr("href");
|
|
|
- $(tableId).find("div:eq(0)").append(html);
|
|
|
- //获取中药付数
|
|
|
- var zyfs = $(tableId).find("input.zyfs").val();
|
|
|
- //当前处方单付金额
|
|
|
- var singleAmount = $("#singleAmount").val();
|
|
|
- if (singleAmount == null || singleAmount == '') {
|
|
|
- singleAmount = 0;
|
|
|
+ //原药品金额 如果是修改则需要设置
|
|
|
+ var temporaryItemsAmount = 0;
|
|
|
+ //当前需要被移除元素的下个兄弟节点
|
|
|
+ var nextObj = null;
|
|
|
+ //当前修改的药品是不是最后一个
|
|
|
+ var isLast = false;
|
|
|
+ //是新增药品还是编辑 true 修改 默认false
|
|
|
+ var updateFlag = $("#update_flag").val();
|
|
|
+ if (updateFlag == undefined || updateFlag == null) {
|
|
|
+ updateFlag = false;
|
|
|
}
|
|
|
- singleAmount = Add(singleAmount, totalRetprice);
|
|
|
- var cfAmount = Multiply(singleAmount, zyfs);
|
|
|
- $(tableId).find("span.cf_amount").html(cfAmount);
|
|
|
- //单张处方的价格
|
|
|
- $("#singleAmount").val(singleAmount);
|
|
|
+ //如果是修改,需要减去原来的费用
|
|
|
+ if (updateFlag=="true" || updateFlag==true) {
|
|
|
+ var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
|
|
|
+ if (formGroups != null && formGroups.length > 0) {
|
|
|
+ for (var i = 0; i < formGroups.length; i++) {
|
|
|
+ var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
|
|
|
+ var temporaryItemsSerial = $(formGroups[i]).find("input.temporary_items_serial").val();
|
|
|
+ if (temporaryItemsCode === currentCode && temporaryItemsSerial === currentSerial) {
|
|
|
+ temporaryItemsAmount = $(formGroups[i]).find("input.temporary_items_amount").val();
|
|
|
+ if (formGroups.length > 1) {
|
|
|
+ nextObj = $(formGroups[i]).next();
|
|
|
+ }
|
|
|
+ isLast = (i + 1) === formGroups.length;
|
|
|
+ $(formGroups[i]).remove();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
|
|
|
+ if (nextObj == null || isLast) {
|
|
|
+ $(tableId).find("div:eq(0)").append(html);
|
|
|
+ } else {
|
|
|
+ $(nextObj).before(html);
|
|
|
+ }
|
|
|
+ //设置当前处方金额
|
|
|
+ calculateCfAmount(tableId, totalRetprice, temporaryItemsAmount, 1, 0);
|
|
|
//设置总金额
|
|
|
calculateTotalAmount();
|
|
|
clearChineseMedicine();
|
|
@@ -1687,6 +1986,7 @@ function saveChineseMedicine() {
|
|
|
* 清空中药
|
|
|
*/
|
|
|
function clearChineseMedicine() {
|
|
|
+ $("#update_flag").val(false);
|
|
|
//药品名称
|
|
|
$("#chinese_medicine_name").val(null);
|
|
|
//当前药品编码
|
|
@@ -1707,6 +2007,7 @@ function clearChineseMedicine() {
|
|
|
* 清空项目
|
|
|
*/
|
|
|
function clearJyJcItem() {
|
|
|
+ $("#update_flag").val(false);
|
|
|
//项目名称
|
|
|
$("#jcJyItem").val(null);
|
|
|
//当前项目编码
|
|
@@ -1717,6 +2018,74 @@ function clearJyJcItem() {
|
|
|
$("#remark").val(null);
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * 设置当前处方金额
|
|
|
+ * @param tableId
|
|
|
+ * @param totalRetprice 新项目金额
|
|
|
+ * @param temporaryItemsAmount 原项目金额
|
|
|
+ * @param index 0 西药 1 中药 2诊疗
|
|
|
+ * @param opFlag 0 保存药品或者项目 1 删除药品或者项目
|
|
|
+ */
|
|
|
+function calculateCfAmount(tableId, totalRetprice, temporaryItemsAmount, index, opFlag) {
|
|
|
+ if (opFlag == 0) {
|
|
|
+ if (index == 1) {
|
|
|
+ //获取中药付数
|
|
|
+ var zyfs = $(tableId).find("input.zyfs").val();
|
|
|
+ //当前处方单付金额
|
|
|
+ var singleAmount = $("#singleAmount").val();
|
|
|
+ if (singleAmount == null || singleAmount == '') {
|
|
|
+ singleAmount = 0;
|
|
|
+ }
|
|
|
+ //如果是修改,需要减去原来的费用
|
|
|
+ if (temporaryItemsAmount != null) {
|
|
|
+ singleAmount = Minus(singleAmount, temporaryItemsAmount);
|
|
|
+ }
|
|
|
+ singleAmount = Add(singleAmount, totalRetprice);
|
|
|
+ var cfAmount = Multiply(singleAmount, zyfs);
|
|
|
+ $(tableId).find("span.cf_amount").html(cfAmount);
|
|
|
+ //单张处方的价格
|
|
|
+ $("#singleAmount").val(singleAmount);
|
|
|
+ } else {
|
|
|
+ //设置单张处方金额
|
|
|
+ var cfAmount = $(tableId).find("span.cf_amount").html();
|
|
|
+ if (cfAmount != null && cfAmount != "") {
|
|
|
+ cfAmount = parseFloat($(tableId).find("span.cf_amount").html());
|
|
|
+ }
|
|
|
+ //如果是修改,需要减去原来的费用
|
|
|
+ if (temporaryItemsAmount != null) {
|
|
|
+ cfAmount = Minus(cfAmount, temporaryItemsAmount);
|
|
|
+ }
|
|
|
+ cfAmount = Add(cfAmount, totalRetprice);
|
|
|
+ $(tableId).find("span.cf_amount").html(cfAmount);
|
|
|
+ }
|
|
|
+ } else if (opFlag == 1) {
|
|
|
+ if (index == 1) {
|
|
|
+ //获取中药付数
|
|
|
+ var zyfs = $(tableId).find("input.zyfs").val();
|
|
|
+ //当前处方单付金额
|
|
|
+ var singleAmount = $("#singleAmount").val();
|
|
|
+ if (singleAmount == null || singleAmount == '') {
|
|
|
+ singleAmount = 0;
|
|
|
+ }
|
|
|
+ singleAmount = Minus(singleAmount, totalRetprice);
|
|
|
+ var cfAmount = Multiply(singleAmount, zyfs);
|
|
|
+ $(tableId).find("span.cf_amount").html(cfAmount);
|
|
|
+ //单张处方的价格
|
|
|
+ $("#singleAmount").val(singleAmount);
|
|
|
+ } else {
|
|
|
+ //设置单张处方金额
|
|
|
+ var cfAmount = $(tableId).find("span.cf_amount").html();
|
|
|
+ if (cfAmount != null && cfAmount != "") {
|
|
|
+ cfAmount = parseFloat($(tableId).find("span.cf_amount").html());
|
|
|
+ }
|
|
|
+ cfAmount = Minus(cfAmount, totalRetprice);
|
|
|
+ $(tableId).find("span.cf_amount").html(cfAmount);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //计算结束都设置成新增药品或者项目
|
|
|
+ $("#update_flag").val(false);
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* 计算总金额
|
|
|
*/
|
|
@@ -1724,7 +2093,6 @@ function calculateTotalAmount() {
|
|
|
var cfAmounts = $("span.cf_amount");
|
|
|
var totalAmount = 0;
|
|
|
if (cfAmounts != null && cfAmounts.length > 0) {
|
|
|
-
|
|
|
for (var i = 0; i < cfAmounts.length; i++) {
|
|
|
totalAmount = Add(totalAmount, parseFloat($(cfAmounts[i]).html()));
|
|
|
}
|
|
@@ -1959,7 +2327,7 @@ function initUserList() {
|
|
|
style: '',
|
|
|
delay: 300,
|
|
|
padding: true,
|
|
|
- height: 300
|
|
|
+ height: 300,
|
|
|
};
|
|
|
var webuiPopover = $('#rapidAcceptsUserName').webuiPopover('destroy').webuiPopover(settings);
|
|
|
//用户姓名选中事件
|
|
@@ -2075,7 +2443,7 @@ function initRecommendList() {
|
|
|
var width = $("#symptom").parent().css("width");
|
|
|
var settings = {
|
|
|
placement: 'bottom-right',//值: auto,top,right,bottom,left,top-right,top-left,bottom-right,bottom-left 要显示的位置
|
|
|
- trigger: 'click', //值:click,hover 触发方式
|
|
|
+ trigger: 'click', //值:click,hover 触发方式 manual 手动
|
|
|
content: '',//内容,内容可以是函数
|
|
|
width: width,
|
|
|
//arrow:false,//是否显示箭头
|
|
@@ -2099,12 +2467,17 @@ function initRecommendList() {
|
|
|
//西药弹窗
|
|
|
settings.width = 680;
|
|
|
settings.closeable = false;
|
|
|
+ settings.arrow = false;//显示箭头或不显示箭头
|
|
|
settings.content = '<div id="westernMedicinePopoverContent"><table id="tb_table_western_medicine"></table></div>';
|
|
|
+ //手动触发
|
|
|
+ settings.trigger = 'manual';
|
|
|
var westernMedicineWebuiPopover = $('#western_medicine_name').webuiPopover('destroy').webuiPopover(settings);
|
|
|
//中药弹窗
|
|
|
+ settings.trigger = 'click';
|
|
|
settings.content = '<div id="chineseMedicinePopoverContent"><table id="tb_table_chinese_medicine"></table></div>';
|
|
|
var chineseMedicineWebuiPopover = $('#chinese_medicine_name').webuiPopover('destroy').webuiPopover(settings);
|
|
|
//诊疗与医技弹窗
|
|
|
+ settings.trigger = 'manual';
|
|
|
settings.content = '<div id="jcJyItemPopoverContent"><table id="tb_table_jc_jy_item"></table></div>';
|
|
|
var jcJyItemWebuiPopover = $('#jcJyItem').webuiPopover('destroy').webuiPopover(settings);
|
|
|
//主诉选中事件
|
|
@@ -2221,13 +2594,13 @@ function initRecommendList() {
|
|
|
fitEmrPsData();
|
|
|
});
|
|
|
|
|
|
- //西药选中事件
|
|
|
- $("#western_medicine_name").on("click", function (t) {
|
|
|
- if ($(westernMedicineWebuiPopover).css("display") == "block") {
|
|
|
- $("#westernMedicinePopoverContent").parent().parent().prev().css("left", "23px");
|
|
|
- loadYpList(0);
|
|
|
- }
|
|
|
- });
|
|
|
+ // //西药选中事件
|
|
|
+ // $("#western_medicine_name").on("click", function (t) {
|
|
|
+ // if ($(westernMedicineWebuiPopover).css("display") == "block") {
|
|
|
+ // $("#westernMedicinePopoverContent").parent().parent().prev().css("left", "23px");
|
|
|
+ // loadYpList(0);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
|
|
|
//中药选中事件
|
|
|
$("#chinese_medicine_name").on("click", function (t) {
|
|
@@ -2237,12 +2610,26 @@ function initRecommendList() {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- //诊疗与医技弹窗选中事件
|
|
|
- $("#jcJyItem").on("click", function (t) {
|
|
|
- if ($(jcJyItemWebuiPopover).css("display") == "block") {
|
|
|
- $("#jcJyItemPopoverContent").parent().parent().prev().css("left", "23px");
|
|
|
- loadjcJyItemList();
|
|
|
- }
|
|
|
+ // //诊疗与医技弹窗选中事件
|
|
|
+ // $("#jcJyItem").on("click", function (t) {
|
|
|
+ // if ($(jcJyItemWebuiPopover).css("display") == "block") {
|
|
|
+ // $("#jcJyItemPopoverContent").parent().parent().prev().css("left", "23px");
|
|
|
+ // loadjcJyItemList();
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+
|
|
|
+
|
|
|
+ //帮助字典弹窗
|
|
|
+ settings.width = 250;
|
|
|
+ settings.height = 200;
|
|
|
+ settings.placement = 'right';//值: auto,top,right,bottom,left,top-right,top-left,bottom-right,bottom-left 要显示的位置
|
|
|
+ settings.content = '<div id="treePopoverContent"><div><ul id="treeDemo" class="ztree"></ul></div></div>';
|
|
|
+ settings.trigger = 'click';
|
|
|
+ var treeWebuiPopover = $('#treeButton').webuiPopover('destroy').webuiPopover(settings);
|
|
|
+ $("#treeButton").on("click", function (t) {
|
|
|
+ // $("#treePopoverContent").parent().parent().prev().css("left", "23px");
|
|
|
+ //初始化药品,检查检验菜单树
|
|
|
+ initzTree();
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -2558,25 +2945,25 @@ function fitValue(value, id) {
|
|
|
* @param index
|
|
|
*/
|
|
|
function loadYpList(index) {
|
|
|
- var medicinePopoverContent = null;
|
|
|
+ //var medicinePopoverContent = null;
|
|
|
var tableMedicine = null;
|
|
|
var MedicineName = null;
|
|
|
//var groupNo=null;
|
|
|
if (index == 0) {
|
|
|
- medicinePopoverContent = "westernMedicinePopoverContent";
|
|
|
+ // medicinePopoverContent = "westernMedicinePopoverContent";
|
|
|
tableMedicine = "tb_table_western_medicine";
|
|
|
MedicineName = "western_medicine_name";
|
|
|
// groupNo=71;
|
|
|
}
|
|
|
if (index == 1) {
|
|
|
- medicinePopoverContent = "chineseMedicinePopoverContent";
|
|
|
+ // medicinePopoverContent = "chineseMedicinePopoverContent";
|
|
|
tableMedicine = "tb_table_chinese_medicine";
|
|
|
MedicineName = "chinese_medicine_name";
|
|
|
// groupNo=$("#zyClassType").val();
|
|
|
}
|
|
|
- if (!$("#" + medicinePopoverContent).parent().parent().parent().hasClass("in")) {
|
|
|
- return;
|
|
|
- }
|
|
|
+ // if (!$("#" + medicinePopoverContent).parent().parent().parent().hasClass("in")) {
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
$('#' + tableMedicine).bootstrapTable('refresh');
|
|
|
$('#' + tableMedicine).bootstrapTable({
|
|
|
url: '/thmz/getYpListByCommonParams', //请求后台的URL(*)
|
|
@@ -2722,6 +3109,7 @@ function checkYpInfo(code, serial) {
|
|
|
if (verifyRepeat(code, serial, 0)) {
|
|
|
return;
|
|
|
}
|
|
|
+ $("#treeButton").webuiPopover('hide');
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial,
|
|
@@ -2801,9 +3189,9 @@ function checkZyInfo(code, serial) {
|
|
|
* @param index
|
|
|
*/
|
|
|
function loadjcJyItemList() {
|
|
|
- if (!$("#jcJyItemPopoverContent").parent().parent().parent().hasClass("in")) {
|
|
|
- return;
|
|
|
- }
|
|
|
+ // if (!$("#jcJyItemPopoverContent").parent().parent().parent().hasClass("in")) {
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
$('#tb_table_jc_jy_item').bootstrapTable('refresh');
|
|
|
$('#tb_table_jc_jy_item').bootstrapTable({
|
|
|
url: '/thmz/getJcJyItemByCommonParams', //请求后台的URL(*)
|
|
@@ -2899,6 +3287,7 @@ function checkJcJyItemInfo(code, name) {
|
|
|
if (verifyRepeat(code, null, 2)) {
|
|
|
return;
|
|
|
}
|
|
|
+ $("#treeButton").webuiPopover('hide');
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
url: '/thmz/getJcJyItemChargeByCode?code=' + code,
|
|
@@ -3070,6 +3459,14 @@ function getJcJyItemChargeByCode(code) {
|
|
|
* @param index
|
|
|
*/
|
|
|
function verifyRepeat(code, serial, index) {
|
|
|
+ //是新增药品还是编辑 true 修改 默认false
|
|
|
+ var updateFlag = $("#update_flag").val();
|
|
|
+ if (updateFlag == undefined || updateFlag == null) {
|
|
|
+ updateFlag = false;
|
|
|
+ }
|
|
|
+ if (updateFlag=="true" || updateFlag==true) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
var tabId = null;
|
|
|
//西药
|
|
|
if (index == 0) {
|
|
@@ -3760,24 +4157,24 @@ function initListDoctorSelect() {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-/**
|
|
|
- * 加载挂号列表
|
|
|
- * @param flag 是否清空挂号卡片列表区域
|
|
|
- */
|
|
|
-function loadRegistrationList(flag) {
|
|
|
- if (flag) {
|
|
|
- pageIndex = 0;
|
|
|
- $("#card_regi_list").empty();
|
|
|
- $("div.page").removeClass("in").addClass("hide");
|
|
|
- }
|
|
|
- var regiListType = getIndex("regi_List_type");
|
|
|
- if (regiListType == 0) {
|
|
|
- loadCardList();
|
|
|
- } else if (regiListType == 1) {
|
|
|
- loadTableList();
|
|
|
- }
|
|
|
-}
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 加载挂号列表
|
|
|
+// * @param flag 是否清空挂号卡片列表区域
|
|
|
+// */
|
|
|
+// function loadRegistrationList(flag) {
|
|
|
+// if (flag) {
|
|
|
+// pageIndex = 0;
|
|
|
+// $("#card_regi_list").empty();
|
|
|
+// $("div.page").removeClass("in").addClass("hide");
|
|
|
+// }
|
|
|
+// var regiListType = getIndex("regi_List_type");
|
|
|
+// if (regiListType == 0) {
|
|
|
+// loadCardList();
|
|
|
+// } else if (regiListType == 1) {
|
|
|
+// loadTableList();
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -3948,4 +4345,92 @@ function saveWorkspaceConfig() {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
-}
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 初始化药品,检查检验菜单树
|
|
|
+ */
|
|
|
+function initzTree() {
|
|
|
+ var index = getIndex("bill_item_group");
|
|
|
+ if (index == 0) {
|
|
|
+ $("#western_medicine_name").webuiPopover('hide');
|
|
|
+ $.ajax({
|
|
|
+ type: "GET",
|
|
|
+ url: '/thmz/getYpZdClasses',
|
|
|
+ contentType: "application/json;charset=UTF-8",
|
|
|
+ dataType: "json",
|
|
|
+ async: false,
|
|
|
+ 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) {
|
|
|
+ // zTree 的参数配置,深入使用请参考 API 文档(setting 配置详解)
|
|
|
+ var setting = {
|
|
|
+ callback: {
|
|
|
+ onClick: zTreeOnClick
|
|
|
+ }
|
|
|
+ };
|
|
|
+ $.fn.zTree.init($("#treeDemo"), setting, res.data);
|
|
|
+ } else {
|
|
|
+ errorMesage(res);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else if (index == 2) {
|
|
|
+ $("#jcJyItem").webuiPopover('hide');
|
|
|
+ $.ajax({
|
|
|
+ type: "GET",
|
|
|
+ url: '/thmz/getJyJcZdClasses',
|
|
|
+ contentType: "application/json;charset=UTF-8",
|
|
|
+ dataType: "json",
|
|
|
+ async: false,
|
|
|
+ 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) {
|
|
|
+ // zTree 的参数配置,深入使用请参考 API 文档(setting 配置详解)
|
|
|
+ var setting = {
|
|
|
+ callback: {
|
|
|
+ onClick: zTreeOnClick
|
|
|
+ }
|
|
|
+ };
|
|
|
+ $.fn.zTree.init($("#treeDemo"), setting, res.data);
|
|
|
+ } else {
|
|
|
+ errorMesage(res);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ $("#treeButton").webuiPopover('hide');
|
|
|
+ warningMesageSimaple("中药暂无帮助字典");
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 节点点击事件
|
|
|
+ * @param event
|
|
|
+ * @param treeId
|
|
|
+ * @param treeNode
|
|
|
+ */
|
|
|
+function zTreeOnClick(event, treeId, treeNode) {
|
|
|
+ var index = getIndex("bill_item_group");
|
|
|
+ if (index == 0) {
|
|
|
+ $("#western_medicine_name").val(treeNode.id);
|
|
|
+ $('#western_medicine_name').webuiPopover('show');
|
|
|
+ loadYpList(0);
|
|
|
+ } else if (index == 2) {
|
|
|
+ $("#jcJyItem").val(treeNode.id);
|
|
|
+ $('#jcJyItem').webuiPopover('show');
|
|
|
+ loadjcJyItemList();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|