|
@@ -1061,12 +1061,12 @@ $(function () {
|
|
|
const regexp = /(【(.+?)】)/g;
|
|
|
for (let i = 0; i < questionMapping.length;) {
|
|
|
if (questionMapping[i + 1]) {
|
|
|
- tdVal = "<td id='anchor" + questionMapping[i].id + "' contenteditable='true'>" + questionMapping[i].name + extractVars(questionMapping[i].val) + "</td><td id='anchor" + questionMapping[i + 1].id + "' contenteditable='true'>" + questionMapping[i + 1].name + extractVars(questionMapping[i + 1].val) + "</td>";
|
|
|
+ tdVal = "<td id='anchor" + questionMapping[i].id + "' contenteditable='false'>" + questionMapping[i].name + extractVars(questionMapping[i].val) + "</td><td id='anchor" + questionMapping[i + 1].id + "' contenteditable='false'>" + questionMapping[i + 1].name + extractVars(questionMapping[i + 1].val) + "</td>";
|
|
|
} else {
|
|
|
- tdVal = "<td id='anchor" + questionMapping[i].id + "' contenteditable='true'>" + questionMapping[i].name + extractVars(questionMapping[i].val) + "</td><td contenteditable='true'></td>";
|
|
|
+ tdVal = "<td id='anchor" + questionMapping[i].id + "' contenteditable='false'>" + questionMapping[i].name + extractVars(questionMapping[i].val) + "</td><td contenteditable='false'></td>";
|
|
|
}
|
|
|
if (i == 0) {
|
|
|
- hml = hml + `<tr><td rowspan="${colNum}" id='anchor${id}' contenteditable='true'>${name}</td>${tdVal}`;
|
|
|
+ hml = hml + `<tr><td rowspan="${colNum}" id='anchor${id}' contenteditable='false'>${name}</td>${tdVal}`;
|
|
|
} else {
|
|
|
hml = hml + `<tr>${tdVal}`;
|
|
|
}
|
|
@@ -1142,28 +1142,45 @@ $(function () {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- var isEditing = false;
|
|
|
+ var isEditing = {
|
|
|
+ "病案首页": false,
|
|
|
+ "入院记录": false,
|
|
|
+ "首次病程录": false,
|
|
|
+ "查房记录": false,
|
|
|
+ "出院小结": false
|
|
|
+ }
|
|
|
// $().attr('contenteditable', isEditing);
|
|
|
|
|
|
$("body").on("click", ".save", function () {
|
|
|
- isEditing = !isEditing; // 切换状态
|
|
|
- if (isEditing) {
|
|
|
+
|
|
|
+ // global_activeTab
|
|
|
+ isEditing[global_activeTab] = !isEditing[global_activeTab]
|
|
|
+ // isEditing = !isEditing; // 切换状态
|
|
|
+ if (isEditing[global_activeTab]) {
|
|
|
console.log("编辑中");
|
|
|
$(this).text('保存');
|
|
|
- // $('p, .embed-table .table-1 td, .opera-table td,.embed-table .table-2 td').off("input")
|
|
|
-
|
|
|
} else {
|
|
|
-
|
|
|
- let state = saveOrUpdate()
|
|
|
- if (state === true) {
|
|
|
- console.log("保存成功");
|
|
|
- } else {
|
|
|
- console.log("保存失败");
|
|
|
+ switch (global_activeTab) {
|
|
|
+ case "病案首页":
|
|
|
+ let state = saveOrUpdate()
|
|
|
+ if (state === true) {
|
|
|
+ console.log("保存成功");
|
|
|
+ } else {
|
|
|
+ console.log("保存失败");
|
|
|
+ }
|
|
|
+ $(this).text('编辑');
|
|
|
+ break
|
|
|
+ case "入院记录":
|
|
|
+ $(this).text('编辑');
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ $(this).text('编辑');
|
|
|
}
|
|
|
- $(this).text('编辑');
|
|
|
+
|
|
|
}
|
|
|
- $('p, .embed-table .table-1 td, .opera-table td,.embed-table .table-2 td').attr('contenteditable', isEditing);
|
|
|
+ $(`.content-item[code=${global_activeTab}]`).find('p, .embed-table .table-1 td, .opera-table td,.embed-table .table-2 td,.inner-table td').attr('contenteditable', isEditing[global_activeTab]);
|
|
|
});
|
|
|
+
|
|
|
function saveOrUpdate() {
|
|
|
/**病案首页编号*/
|
|
|
const homePageId = $('.patient-info span').eq(0).text().match(/\d+/)[0]
|
|
@@ -1203,9 +1220,9 @@ $(function () {
|
|
|
/**新生儿出生天数*/
|
|
|
const newbornDay = ""
|
|
|
/**新生儿出生体重*/
|
|
|
- const newbornWeight = $('#anchor2244 p').text().replace("克", "")
|
|
|
+ const newbornWeight = $('#anchor2244 p').text().replace("克", "") || "-"
|
|
|
/**新生儿入院体重*/
|
|
|
- const newbornBehospitalWeight = $('#anchor2245 p').text().replace("克", "")
|
|
|
+ const newbornBehospitalWeight = $('#anchor2245 p').text().replace("克", "") || "-"
|
|
|
/**出生地*/
|
|
|
const bornAddress = $('#anchor2246 p').text()
|
|
|
/**籍贯*/
|
|
@@ -1413,9 +1430,9 @@ $(function () {
|
|
|
/** 手术用一次性医用材料费 */
|
|
|
const operationMaterialFee = matchs_anchor2300_3 ? matchs_anchor2300_3[1] : '';
|
|
|
|
|
|
-
|
|
|
+ let matchs_anchor2301 = $('#anchor2301 p').text().match(/其他费:(\d+\.?\d+)/)
|
|
|
/** 其他类其他费 */
|
|
|
- const otherTypeFee = $('#anchor2301 p').text().match(/其他费:(\d+\.?\d+)/)[1] || '';
|
|
|
+ const otherTypeFee = matchs_anchor2301 ? matchs_anchor2301[1] : '';
|
|
|
/** 单病种管理 */
|
|
|
const singleDiagManage = $('#anchor2302 p').text();
|
|
|
/** 临床路径管理 */
|