|
@@ -1,5 +1,6 @@
|
|
|
import {getLabelIndex,fullfillText,getIds} from '@common/js/func.js';
|
|
|
import config from '@config/index.js';
|
|
|
+import {getInitModules} from '@store/async-actions/homePage.js';
|
|
|
|
|
|
//插入病程变化模板
|
|
|
function insertPro(data,processModule){
|
|
@@ -38,9 +39,23 @@ export const setModule = (state,action)=>{
|
|
|
//插入病程变化
|
|
|
export const insertProcess = (state,action)=>{
|
|
|
const res = Object.assign({},state);
|
|
|
- const processModule = JSON.parse(JSON.stringify(res.processModule));
|
|
|
+ const sonId = action.id;//子模板id
|
|
|
+ // const processModule = JSON.parse(JSON.stringify(res.processModule));
|
|
|
+ let addSmoduleData;
|
|
|
+ let allModules = JSON.parse(localStorage.getItem('modules'));
|
|
|
+ if(!allModules){
|
|
|
+ console.log(44,'重新调接口获取模板');
|
|
|
+ // let getModulesApi = getInitModules;
|
|
|
+ // allModules = JSON.parse(localStorage.getItem('modules'));
|
|
|
+ }
|
|
|
+ for(let k=0; k<allModules.length; k++){
|
|
|
+ if(allModules[k].id==sonId){
|
|
|
+ addSmoduleData = JSON.parse(JSON.stringify(allModules[k].moduleDetailDTOList));
|
|
|
+ }
|
|
|
+ }
|
|
|
let data = res.data;
|
|
|
- res.data = insertPro(data,processModule);
|
|
|
+ let newData = insertPro(data,addSmoduleData);
|
|
|
+ res.data = fullfillText(newData).newArr;
|
|
|
res.saveText = fullfillText(res.data).saveText;
|
|
|
res.update=Math.random();
|
|
|
return res;
|