|
@@ -2,29 +2,61 @@ const $ = require('jquery');
|
|
|
require("../css/assertTypeDetail.less");
|
|
|
require('./modal.js');
|
|
|
const {api} = require('./api.js')
|
|
|
-const {post,getCookie,getUrlArgObjectNew} = require('./utils.js')
|
|
|
+const {post,getCookie,getUrlArgObjectNew,getUrlArgObject} = require('./utils.js')
|
|
|
const iconCheck= require("./../images/icon_check.png")
|
|
|
const iconUnCheck = require("./../images/icon_unchecked.png")
|
|
|
|
|
|
-let dataCopy
|
|
|
+let dataCopy,paramType,paramId,submitMsg="新增成功~"
|
|
|
$(function(){
|
|
|
- getList()//获取条目列表
|
|
|
+ let srcUrl = $("#contentIframe",parent.document).attr("src")
|
|
|
+ paramType = getUrlArgObject("type")||""
|
|
|
+ paramId = getUrlArgObject("id")||""
|
|
|
+ getList(paramType)//获取条目列表
|
|
|
|
|
|
})
|
|
|
-function getList(){
|
|
|
- post(api.getEntryByHospital,{}).then(res =>{
|
|
|
- let result = res.data
|
|
|
- if(result.code == '0'){
|
|
|
- const data = result.data;
|
|
|
- console.log(data)
|
|
|
- renderData(data)
|
|
|
-
|
|
|
+function getList(type){
|
|
|
+ console.log('type',type)
|
|
|
+ if(!type){
|
|
|
+ post(api.getEntryByHospital,{}).then(res =>{
|
|
|
+ let result = res.data
|
|
|
+ if(result.code == '0'){
|
|
|
+ const data = result.data;
|
|
|
+ console.log(data)
|
|
|
+ renderData(data)
|
|
|
+
|
|
|
+ }else{
|
|
|
+
|
|
|
+ }
|
|
|
+ }).catch((e) =>{
|
|
|
+
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ if(type =='"edit"'){
|
|
|
+ $('.partTitle p').html('质控类型维护/修改')
|
|
|
+ submitMsg="修改成功~"
|
|
|
}else{
|
|
|
-
|
|
|
+ $('.partTitle p').html('质控类型维护/复制')
|
|
|
+ submitMsg="复制成功~"
|
|
|
}
|
|
|
- }).catch((e) =>{
|
|
|
+ post(api.typeGetById,{id: paramId}).then(res =>{
|
|
|
+ let result = res.data
|
|
|
+ if(result.code == '0'){
|
|
|
+ const data = result.data;
|
|
|
+ const qcName = data.name
|
|
|
+ const tabData = data.entryMap
|
|
|
+ if(type =='"edit"'){
|
|
|
+ $('.patientNumInp').val(qcName)
|
|
|
+ }
|
|
|
+ renderData(tabData)
|
|
|
+
|
|
|
+ }else{
|
|
|
+
|
|
|
+ }
|
|
|
+ }).catch((e) =>{
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
- })
|
|
|
}
|
|
|
|
|
|
function renderData(data){
|
|
@@ -99,7 +131,7 @@ $('.submit').click(function(){
|
|
|
}
|
|
|
|
|
|
const param = {
|
|
|
- id:"",
|
|
|
+ id:paramId,
|
|
|
name: qcName,
|
|
|
qcTypeCasesEntryVOList
|
|
|
}
|
|
@@ -107,7 +139,10 @@ $('.submit').click(function(){
|
|
|
post(api.saveOrUpdate,param).then(res =>{
|
|
|
let result = res.data
|
|
|
if(result.code == '0'){
|
|
|
- $(parent.document).find("#contentIframe").attr("src","./assertType.html")
|
|
|
+ $.alerModal({"message":submitMsg,type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
|
|
|
+ setTimeout(function(){
|
|
|
+ $(parent.document).find("#contentIframe").attr("src","./assertType.html")
|
|
|
+ },1000)
|
|
|
}else{
|
|
|
$.alerModal({"message":res.data.msg,type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
|
|
|
}
|