|
@@ -1,3 +1,24 @@
|
|
|
+export const editDiagMsg = (state, action) => {
|
|
|
+ const res = JSON.parse(JSON.stringify(state));
|
|
|
+ let tmpLis = res.diagnosticList
|
|
|
+ for(let i = 0;i < tmpLis.length;i++){
|
|
|
+ if(action.idx == i){
|
|
|
+ tmpLis[i].name = action.name
|
|
|
+ if(!!tmpLis[i].hasTreat){
|
|
|
+ let obj = {
|
|
|
+ "dateValue": '',
|
|
|
+ "name": action.name,
|
|
|
+ "uniqueName": tmpLis[i].uniqueName
|
|
|
+ }
|
|
|
+ res.diseaseName = obj
|
|
|
+ }
|
|
|
+ }
|
|
|
+ res.diagnosticStr = tmpLis[i].name + ','
|
|
|
+ }
|
|
|
+ res.diagnosticList = [...tmpLis]
|
|
|
+ return res;
|
|
|
+}
|
|
|
+
|
|
|
export const addDiagMsg = (state, action) => {
|
|
|
const res = JSON.parse(JSON.stringify(state));
|
|
|
let tmpLis = res.diagnosticList
|
|
@@ -11,7 +32,7 @@ export const addDiagMsg = (state, action) => {
|
|
|
let obj = {
|
|
|
"dateValue": '',
|
|
|
"name": action.item.name,
|
|
|
- "uniqueName": action.item.name
|
|
|
+ "uniqueName": action.item.uniqueName
|
|
|
}
|
|
|
res.diagnosticList = [...tmpLis]
|
|
|
res.diseaseName = obj
|
|
@@ -23,6 +44,7 @@ export const addDiagnostic = (state, action) => {
|
|
|
res.diagnosticList.push(action.item)
|
|
|
let tmpLis = res.diagnosticList,num=0
|
|
|
for(let i = 0;i < tmpLis.length;i++){
|
|
|
+ tmpLis[i].uniqueName = tmpLis[i].name
|
|
|
if(!tmpLis[i].hasTreat){
|
|
|
++num
|
|
|
}
|
|
@@ -32,7 +54,7 @@ export const addDiagnostic = (state, action) => {
|
|
|
let obj = {
|
|
|
"dateValue": '',
|
|
|
"name": tmpLis[0].name,
|
|
|
- "uniqueName": tmpLis[0].name
|
|
|
+ "uniqueName": tmpLis[0].uniqueName
|
|
|
}
|
|
|
res.diseaseName = obj
|
|
|
}
|
|
@@ -54,7 +76,7 @@ export const delDiagnostic = (state, action) => {
|
|
|
let obj = {
|
|
|
"dateValue": '',
|
|
|
"name": tmpLis[0].name,
|
|
|
- "uniqueName": tmpLis[0].name
|
|
|
+ "uniqueName": tmpLis[0].uniqueName
|
|
|
}
|
|
|
res.diseaseName = obj
|
|
|
}
|