|
@@ -45,6 +45,8 @@ $(function () {
|
|
|
init_validator();
|
|
|
//初始频次下拉选
|
|
|
initOrderFrequencys("orderFrequency", true);
|
|
|
+ //初始频次下拉选
|
|
|
+ initOrderFrequencys("orderFrequencyZl", true);
|
|
|
//初始用药方式下拉选
|
|
|
initSupplyTypes();
|
|
|
|
|
@@ -452,14 +454,28 @@ $(function () {
|
|
|
saveJyJcItem(true);
|
|
|
$("#jcJyItem").focus();
|
|
|
} else if (id == 'chargeUnit') {
|
|
|
+ $("#itemQuantity").focus();
|
|
|
+ } else if (id == 'itemQuantity') {
|
|
|
+ $("#dayZlNum").next().click();
|
|
|
+ } else if (id == 'dayZlNum') {
|
|
|
+ var ariaExpanded = $("#dayZlNum").next().attr("aria-expanded");
|
|
|
+ if (ariaExpanded == true || ariaExpanded == "true") {
|
|
|
+ $("#dayZlNum").next().click();
|
|
|
+ }
|
|
|
+ $("#orderFrequencyZl").next().click();
|
|
|
+ } else if (id == 'orderFrequencyZl') {
|
|
|
+ var ariaExpanded = $("#orderFrequencyZl").next().attr("aria-expanded");
|
|
|
+ if (ariaExpanded == true || ariaExpanded == "true") {
|
|
|
+ $("#orderFrequencyZl").next().click();
|
|
|
+ }
|
|
|
+ $("#totalNumZl").focus();
|
|
|
+ } else if (id == 'totalNumZl') {
|
|
|
$("#zlExecUnit").next().click();
|
|
|
} else if (id == 'zlExecUnit') {
|
|
|
var ariaExpanded = $("#zlExecUnit").next().attr("aria-expanded");
|
|
|
if (ariaExpanded == true || ariaExpanded == "true") {
|
|
|
$("#zlExecUnit").next().click();
|
|
|
}
|
|
|
- $("#itemQuantity").focus();
|
|
|
- } else if (id == 'itemQuantity') {
|
|
|
$("#zlRemark").focus();
|
|
|
} else if (id == 'zlRemark') {
|
|
|
saveZlItem(true);
|
|
@@ -812,6 +828,8 @@ function initDayNum() {
|
|
|
}
|
|
|
$('#dayNum').html(html);
|
|
|
$('#dayNum').selectpicker('refresh');
|
|
|
+ $('#dayZlNum').html(html);
|
|
|
+ $('#dayZlNum').selectpicker('refresh');
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2068,6 +2086,7 @@ function clearWorkSpaceExcludeUser(source) {
|
|
|
clearWesternMedicine(true);
|
|
|
clearChineseMedicine();
|
|
|
clearJyJcItem();
|
|
|
+ clearZlItem();
|
|
|
clearZyReq();
|
|
|
//initNavTabs(0);
|
|
|
clearNavTabs(0);
|
|
@@ -2263,6 +2282,26 @@ function fitJcjyContent(jcjyPrescription, contentId, titleId, checkBox) {
|
|
|
}
|
|
|
jcjyHtml += jcjy.index + ".";
|
|
|
jcjyHtml += jcjy.name;
|
|
|
+ var drugUnit = jcjy.drugUnit;
|
|
|
+ if (drugUnit == undefined || drugUnit == null || drugUnit == "") {
|
|
|
+ drugUnit = "";
|
|
|
+ }
|
|
|
+ var drugQuan = jcjy.drugQuan;
|
|
|
+ if (drugQuan != undefined && drugQuan != null && drugQuan != "") {
|
|
|
+ jcjyHtml += " 单量:" + drugQuan+drugUnit;
|
|
|
+ }
|
|
|
+ var orderDays = jcjy.orderDays;
|
|
|
+ if (orderDays != undefined && orderDays != null && orderDays != "") {
|
|
|
+ jcjyHtml += " 天数:" + orderDays+"天";
|
|
|
+ }
|
|
|
+ var frequency = jcjy.frequency;
|
|
|
+ if (frequency != undefined && frequency != null && frequency != "") {
|
|
|
+ jcjyHtml += " 频次:" + frequency;
|
|
|
+ }
|
|
|
+ var quantity = jcjy.quantity;
|
|
|
+ if (quantity != undefined && quantity != null && quantity != "") {
|
|
|
+ jcjyHtml += " 总量:" + quantity+drugUnit;
|
|
|
+ }
|
|
|
if (checkBox) {
|
|
|
jcjyHtml += "</span>";
|
|
|
}
|
|
@@ -2553,15 +2592,21 @@ function callBackZlDetail(code, mzChargeDetail) {
|
|
|
}
|
|
|
$("#zlItem").val(res.data.name);
|
|
|
$("#zlItem").blur();
|
|
|
+ $("#descriptions").val(res.data.descriptions);
|
|
|
$("#zlItemPrice").val(res.data.chargeAmount);
|
|
|
$("#chargeUnit").val(res.data.chargeUnit);
|
|
|
$("#zl_current_code").val(res.data.code);
|
|
|
$("#zlRemark").val(mzChargeDetail.instructionText);
|
|
|
+ $("#dayZlNum").selectpicker('val', mzChargeDetail.orderDays);
|
|
|
+ $('#dayZlNum').selectpicker('refresh');
|
|
|
+ $("#orderFrequencyZl").selectpicker('val', mzChargeDetail.frequency);
|
|
|
+ $('#orderFrequencyZl').selectpicker('refresh');
|
|
|
if (mzChargeDetail.execDept != null && mzChargeDetail.execDept != "") {
|
|
|
$("#zlExecUnit").selectpicker('val', mzChargeDetail.execDept);
|
|
|
$('#zlExecUnit').selectpicker('refresh');
|
|
|
}
|
|
|
- $("#itemQuantity").val(mzChargeDetail.quantity);
|
|
|
+ $("#itemQuantity").val(mzChargeDetail.drugQuan);
|
|
|
+ $("#totalNumZl").val(mzChargeDetail.quantity);
|
|
|
saveZlItem(false);
|
|
|
} else {
|
|
|
errorMesage(res);
|
|
@@ -4083,11 +4128,31 @@ function editZlItem(obj) {
|
|
|
var itemQuantity = $(parentObject).find("input.temporary_items_itemQuantity").val();
|
|
|
//执行科室
|
|
|
var execUnit = $(parentObject).find("input.temporary_items_execUnit").val();
|
|
|
+
|
|
|
+ var descriptions = $(parentObject).find("input.temporary_items_code").val();
|
|
|
+ if (descriptions != null && descriptions != "" && descriptions != 'null') {
|
|
|
+ $("#descriptions").val(descriptions);
|
|
|
+ }
|
|
|
+ var dayZlNum = $(parentObject).find("input.temporary_items_dayZlNum").val();
|
|
|
+ if (dayZlNum != null && dayZlNum != "" && dayZlNum != 'null') {
|
|
|
+ $("#dayZlNum").selectpicker('val', dayZlNum);
|
|
|
+ $('#dayZlNum').selectpicker('refresh');
|
|
|
+ }
|
|
|
+ var orderFrequencyZl = $(parentObject).find("input.temporary_items_orderFrequencyZl").val();
|
|
|
+ if (orderFrequencyZl != null && orderFrequencyZl != "" && orderFrequencyZl != 'null') {
|
|
|
+ $("#orderFrequencyZl").selectpicker('val', orderFrequencyZl);
|
|
|
+ $('#orderFrequencyZl').selectpicker('refresh');
|
|
|
+ }
|
|
|
+ var totalNumZl = $(parentObject).find("input.temporary_items_totalNumZl").val();
|
|
|
+ if (totalNumZl != null && totalNumZl != "" && totalNumZl != 'null') {
|
|
|
+ $("#totalNumZl").val(totalNumZl);
|
|
|
+ }
|
|
|
$("#zlExecUnit").selectpicker('val', execUnit);
|
|
|
$('#zlExecUnit').selectpicker('refresh');
|
|
|
//描述
|
|
|
$("#chargeUnit").val(chargeUnit);
|
|
|
$("#itemQuantity").val(itemQuantity);
|
|
|
+ calculateZl(true);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -4332,26 +4397,36 @@ function saveZlItemReal(calculateTotalAmountFlag) {
|
|
|
var currentCode = $("#zl_current_code").val();
|
|
|
//当前项目价格
|
|
|
var zlItemPrice = $("#zlItemPrice").val();
|
|
|
- //描述
|
|
|
+ //单位
|
|
|
var chargeUnit = $("#chargeUnit").val();
|
|
|
//执行科室
|
|
|
var zlExecUnit = $("#zlExecUnit").val();
|
|
|
//执行科室
|
|
|
var zlExecUnitName = $('#zlExecUnit option:selected').text();
|
|
|
zlExecUnitName = zlExecUnitName.substring(0, zlExecUnitName.indexOf("("));
|
|
|
- //次数
|
|
|
+ //单量
|
|
|
var itemQuantity = $("#itemQuantity").val();
|
|
|
+ //规格
|
|
|
+ var descriptions = $("#descriptions").val();
|
|
|
+ //天数
|
|
|
+ var dayZlNum = $("#dayZlNum").val();
|
|
|
+ //频次
|
|
|
+ var orderFrequencyZl = $("#orderFrequencyZl").val();
|
|
|
+ //总量
|
|
|
+ var totalNumZl = $("#totalNumZl").val();
|
|
|
//描述编码
|
|
|
var chargeUnitCode = chargeUnit;
|
|
|
- var chargeUnitName = " 描述:";
|
|
|
//备注
|
|
|
var remark = $("#zlRemark").val();
|
|
|
-
|
|
|
- if (currentCode == null || currentCode == '') {
|
|
|
- if (calculateTotalAmountFlag == true) {
|
|
|
+ if (calculateTotalAmountFlag == true) {
|
|
|
+ if (currentCode == null || currentCode == '') {
|
|
|
errorMesageSimaple("未选择任何项目!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (totalNumZl == null || totalNumZl == "" || totalNumZl == "null") {
|
|
|
+ errorMesageSimaple("项目使用总量为空!");
|
|
|
+ return;
|
|
|
}
|
|
|
- return;
|
|
|
}
|
|
|
//判断是否有重复的项目 返回true 说明有重复的
|
|
|
if (verifyRepeat(currentCode, null, null, 3)) {
|
|
@@ -4396,12 +4471,27 @@ function saveZlItemReal(calculateTotalAmountFlag) {
|
|
|
var html = '<div class="form-group">';
|
|
|
html += '<span class="zlItemGroupId">' + groupId + '</span>.<span style="margin-left: 5px"></span>'
|
|
|
html += zlItem + ' ';
|
|
|
- html += " 数量:" + itemQuantity;
|
|
|
- if (zlExecUnit != null && zlExecUnit != "") {
|
|
|
- html += " 执行科室:" + zlExecUnitName;
|
|
|
+ if (descriptions != null && descriptions != "") {
|
|
|
+ html += " 规格:" + descriptions;
|
|
|
}
|
|
|
+ html += " 单量:" + itemQuantity;
|
|
|
if (chargeUnit != null && chargeUnit != '') {
|
|
|
- html += chargeUnitName + chargeUnit;
|
|
|
+ html += chargeUnit;
|
|
|
+ }
|
|
|
+ if (dayZlNum != null && dayZlNum != "") {
|
|
|
+ html += " 天数:" + dayZlNum+"天";
|
|
|
+ }
|
|
|
+ if (orderFrequencyZl != null && orderFrequencyZl != "") {
|
|
|
+ html += " 频次:" + orderFrequencyZl;
|
|
|
+ }
|
|
|
+ if (totalNumZl != null && totalNumZl != "") {
|
|
|
+ html += " 总量:" + totalNumZl;
|
|
|
+ if (chargeUnit != null && chargeUnit != '') {
|
|
|
+ html += chargeUnit;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (zlExecUnit != null && zlExecUnit != "") {
|
|
|
+ html += " 执行科室:" + zlExecUnitName;
|
|
|
}
|
|
|
if (remark != null && remark != '') {
|
|
|
html += ' 备注:' + remark;
|
|
@@ -4417,6 +4507,10 @@ function saveZlItemReal(calculateTotalAmountFlag) {
|
|
|
html += '<input type="hidden" class="temporary_items_desc_value" value="' + chargeUnitCode + '"/>';
|
|
|
html += '<input type="hidden" class="temporary_items_itemQuantity" value="' + itemQuantity + '"/>';
|
|
|
html += '<input type="hidden" class="temporary_items_execUnit" value="' + zlExecUnit + '"/>';
|
|
|
+ html += '<input type="hidden" class="temporary_items_descriptions" value="' + descriptions + '"/>';
|
|
|
+ html += '<input type="hidden" class="temporary_items_dayZlNum" value="' + dayZlNum + '"/>';
|
|
|
+ html += '<input type="hidden" class="temporary_items_orderFrequencyZl" value="' + orderFrequencyZl + '"/>';
|
|
|
+ html += '<input type="hidden" class="temporary_items_totalNumZl" value="' + totalNumZl + '"/>';
|
|
|
html += '</div>';
|
|
|
//当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
|
|
|
if (nextObj == null || isLast) {
|
|
@@ -4798,6 +4892,13 @@ function clearZlItem() {
|
|
|
//描述
|
|
|
$("#chargeUnit").val(null);
|
|
|
$("#itemQuantity").val(1);
|
|
|
+ $("#descriptions").val(null);
|
|
|
+ $("#dayZlNum").selectpicker('val', null);
|
|
|
+ $('#dayZlNum').selectpicker('refresh');
|
|
|
+ $("#orderFrequencyZl").selectpicker('val', null);
|
|
|
+ $('#orderFrequencyZl').selectpicker('refresh');
|
|
|
+ $("#totalNumZl").val(null);
|
|
|
+ $("#totalAmountZl").val(null);
|
|
|
$("#zlExecUnit").selectpicker('val', null);
|
|
|
$('#zlExecUnit').selectpicker('refresh');
|
|
|
}
|
|
@@ -6377,6 +6478,9 @@ function loadZlItemList(event) {
|
|
|
$("#chargeUnit").val(row.specification);
|
|
|
$("#zl_current_code").val(row.code);
|
|
|
$("#itemQuantity").val(1);
|
|
|
+ $("#descriptions").val(row.descriptions);
|
|
|
+ $("#descriptions").attr('title', row.descriptions);
|
|
|
+ calculateZl(false);
|
|
|
$("#chargeUnit").focus();
|
|
|
return;
|
|
|
}
|
|
@@ -7774,7 +7878,12 @@ function getParamsForpPrescription(type) {
|
|
|
tempJson = JSON.parse('{"chargeItemCode": "","serial": "","quantity": "1","drugQuan": "1","drugUnit": "","frequency": "","orderDays": "1","paySelf": "0","drugWin": "1","instructionCode":"","instructionText":"","orderNo":"","groupOrder":"","supplyCode":"","cyJssm":"","cyDj":"","cyFysm":"","tryFlag":"0","groupNo":"00","execDept":""}');
|
|
|
tempJson.chargeItemCode = $(zlTabContents[i]).find("input.temporary_items_code").val();
|
|
|
tempJson.instructionText = $(zlTabContents[i]).find("input.temporary_items_remark").val();
|
|
|
- tempJson.quantity = $(zlTabContents[i]).find("input.temporary_items_itemQuantity").val();
|
|
|
+ tempJson.quantity = $(zlTabContents[i]).find("input.temporary_items_totalNumZl").val();
|
|
|
+ tempJson.drugQuan = $(zlTabContents[i]).find("input.temporary_items_itemQuantity").val();
|
|
|
+ //因为收费表里的单位长度限制,无法存入库
|
|
|
+ //tempJson.drugUnit = $(zlTabContents[i]).find("input.temporary_items_desc_value").val();
|
|
|
+ tempJson.frequency = $(zlTabContents[i]).find("input.temporary_items_orderFrequencyZl").val();
|
|
|
+ tempJson.orderDays = $(zlTabContents[i]).find("input.temporary_items_dayZlNum").val();
|
|
|
tempJson.orderNo = orderNo;
|
|
|
tempJson.execDept = execUnit;
|
|
|
jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
|
|
@@ -10937,4 +11046,37 @@ function consultationCliniced(patientId) {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
+/**
|
|
|
+ * 计算诊疗金额
|
|
|
+ * @param flag true ,直接计算总价, false 还要计算总量
|
|
|
+ */
|
|
|
+function calculateZl(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).toFixed(2));
|
|
|
+}
|