|
@@ -5,7 +5,7 @@ var TableInit = function () {
|
|
|
//初始化Table
|
|
|
oTableInit.Init = function () {
|
|
|
$dataTableHot = $('#tb_report').bootstrapTable({
|
|
|
- url: '/thmz/getMzClassList', //请求后台的URL(*)
|
|
|
+ url: '/thmz/getMzZdResponceTypeList', //请求后台的URL(*)
|
|
|
method: 'post', //请求方式(*)
|
|
|
toolbar: '#toolbar', //工具按钮用哪个容器
|
|
|
striped: true, //是否显示行间隔色
|
|
@@ -45,7 +45,8 @@ var TableInit = function () {
|
|
|
// } else {
|
|
|
// str = '<button type="button" class="btn btn-primary btn-sm" onclick="updateDelete(\'' + row.code + '\',\'' + row.name + '\',\'' + row.deleteFlag + '\')">停用</button>';
|
|
|
// }
|
|
|
- str = '<button type="button" class="btn btn-default btn-sm" onclick="editZdMzClass(\'' + row.code + '\')">编辑</button>';
|
|
|
+ str = '<button type="button" class="btn btn-default btn-sm" onclick="editMzZdResponceType(\'' + row.code + '\')">编辑</button>';
|
|
|
+ str += '<button type="button" class="btn btn-danger btn-sm" onclick="deleteMzZdResponceType(\'' + row.code + '\')">删除</button>';
|
|
|
return [str].join('');
|
|
|
}
|
|
|
},
|
|
@@ -87,7 +88,6 @@ var TableInit = function () {
|
|
|
oTableInit.queryParams = function (params) {
|
|
|
var temp = { //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
|
|
|
code: $("#code").val(),
|
|
|
- deleteFlag: $("#delFlag").val(),
|
|
|
};
|
|
|
return temp;
|
|
|
};
|
|
@@ -127,9 +127,6 @@ function initSelect() {
|
|
|
$(".selectpicker").selectpicker({
|
|
|
dropuAuto: false
|
|
|
});
|
|
|
- var yesNo = '<option value="1">是</option><option value="0">否</option>';
|
|
|
- $('#delFlag').html(yesNo);
|
|
|
- $('#delFlag').selectpicker('refresh');
|
|
|
}
|
|
|
|
|
|
|
|
@@ -138,64 +135,42 @@ function initSelect() {
|
|
|
* 打开编辑窗口
|
|
|
* @param code
|
|
|
*/
|
|
|
-function editZdMzClass(code) {
|
|
|
+function editMzZdResponceType(code) {
|
|
|
clearModel();
|
|
|
$("#codePlus").val(code);
|
|
|
$("#unitCodeModal").modal();
|
|
|
- $("#myModalLabel").text("编辑门诊科室分类码");
|
|
|
+ $("#myModalLabel").text("编辑门诊身份类型");
|
|
|
fillModel(code);
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * 删除记录 (停用)
|
|
|
- * @param code
|
|
|
- */
|
|
|
-function updateDelete(code, name, delFlag) {
|
|
|
- $("#deleteCode").val(code);// 将模态框中需要修改删除的科室的ID设为需要删除的
|
|
|
- $("#dataDelFlag").val(delFlag);// 将模态框中需要删除的科室的停用状态设置成当前状态
|
|
|
- if (delFlag == 1) {
|
|
|
- $("#deleteMessage").html("您确认要启用【" + name + "】门诊科室分类码吗?");
|
|
|
- } else {
|
|
|
- $("#deleteMessage").html("您确认要停用【" + name + "】门诊科室分类码吗?");
|
|
|
- }
|
|
|
- $("#deleteConfirmModel").modal({
|
|
|
- backdrop: 'static',
|
|
|
- keyboard: false
|
|
|
- });
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
|
|
|
/**
|
|
|
- * 停用科室操作提交
|
|
|
+ * 删除门诊身份类型
|
|
|
+ * @param id
|
|
|
*/
|
|
|
-function deleteSubmit() {
|
|
|
- var delFlag = $("#dataDelFlag").val();
|
|
|
- var newDelFlag = 1;
|
|
|
- var text = "门诊科室分类码停用成功";
|
|
|
- if (delFlag == 1) {
|
|
|
- newDelFlag = 0;
|
|
|
- text = "门诊科室分类码启用成功";
|
|
|
- }
|
|
|
- $.ajax({
|
|
|
- type: "POST",
|
|
|
- url: '/thmz/saveZdMzClass',
|
|
|
- contentType: "application/json;charset=UTF-8",
|
|
|
- dataType: "json",
|
|
|
- data: JSON.stringify({"code": $("#deleteCode").val(), "deleteFlag": newDelFlag}),
|
|
|
- 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) {
|
|
|
- successMesageSimaple(text);
|
|
|
- $dataTableHot.bootstrapTable('refresh');
|
|
|
- } else {
|
|
|
- errorMesage(res);
|
|
|
+function deleteMzZdResponceType(code) {
|
|
|
+ $("#messageModal").modal();
|
|
|
+ $("#messageContent").html("确认要删除当前门诊身份类型吗?");
|
|
|
+ $("#messageButton").off("click").on("click", function (t) {
|
|
|
+ $("#messageModal").modal("hide");
|
|
|
+ $.ajax({
|
|
|
+ type: "GET",
|
|
|
+ url: '/thmz/deleteMzZdResponceType?code=' + code,
|
|
|
+ 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) {
|
|
|
+ $dataTableHot.bootstrapTable('refresh');
|
|
|
+ successMesage(res);
|
|
|
+ } else {
|
|
|
+ errorMesage(res);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -214,7 +189,7 @@ function clearModel() {
|
|
|
function fillModel(code) {
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
- url: '/thmz/getZdMzClassByCode?code='+code,
|
|
|
+ url: '/thmz/getMzZdResponceTypeByCode?code='+code,
|
|
|
contentType: "application/json;charset=UTF-8",
|
|
|
dataType: "json",
|
|
|
headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
|
|
@@ -252,7 +227,7 @@ $(function () {
|
|
|
$("button[name='plus']").on("click", function (t) {
|
|
|
$("#originalCode").val(null);
|
|
|
clearModel();
|
|
|
- $("#myModalLabel").text("新增门诊科室分类码");
|
|
|
+ $("#myModalLabel").text("新增门诊身份类型");
|
|
|
$("#unitCodeModal").modal();
|
|
|
});
|
|
|
|
|
@@ -264,11 +239,10 @@ $(function () {
|
|
|
var params = {
|
|
|
"code": $("#codePlus").val(),
|
|
|
"name": $("#namePlus").val(),
|
|
|
- "sortCode": $("#sortCodePlus").val()
|
|
|
};
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
- url: '/thmz/saveZdMzClass',
|
|
|
+ url: '/thmz/saveMzZdResponceType',
|
|
|
contentType: "application/json;charset=UTF-8",
|
|
|
dataType: "json",
|
|
|
data: JSON.stringify(params),
|