pengjun 2 years ago
parent
commit
ef47f5e454
  1. 31
      src/components/occDisease/OccDisease.vue
  2. 167
      src/components/occDisease/OccDiseaseConclusion.vue

31
src/components/occDisease/OccDisease.vue

@ -111,7 +111,7 @@ export default {
postapi('/api/app/OccupationalDisease/GetOccupationalDiseaseWithDetailByPatientRegisterId', { patientRegisterId }) postapi('/api/app/OccupationalDisease/GetOccupationalDiseaseWithDetailByPatientRegisterId', { patientRegisterId })
.then(res => { .then(res => {
if (res.code > -1) { if (res.code > -1) {
this.dataTransOpts.tableS.patient_occupational_disease = deepCopy(res.data['patientOccupationalDisease'])||{patientRegisterId}
this.dataTransOpts.tableS.patient_occupational_disease = deepCopy(res.data['patientOccupationalDisease']) || { patientRegisterId }
this.dataTransOpts.tableM.patient_poison = deepCopy(res.data['patientPoisonDtos']) this.dataTransOpts.tableM.patient_poison = deepCopy(res.data['patientPoisonDtos'])
this.dataTransOpts.tableM.patient_occupational_history = deepCopy(res.data['patientOccupationalHistoryDtos']) this.dataTransOpts.tableM.patient_occupational_history = deepCopy(res.data['patientOccupationalHistoryDtos'])
this.dataTransOpts.tableM.patient_symptom = deepCopy(res.data['patientSymptomDtos']) this.dataTransOpts.tableM.patient_symptom = deepCopy(res.data['patientSymptomDtos'])
@ -132,10 +132,10 @@ export default {
confirmButtonText: "是", confirmButtonText: "是",
cancelButtonText: "否", cancelButtonText: "否",
type: "warning", type: "warning",
}).then(() => {
}).then(() => {
return postapi('/api/app/OccupationalDisease/DeleteOccupationalDiseaseWithDetail', { patientRegisterId: this.dataTransOpts.tableS.patient_register.id }) return postapi('/api/app/OccupationalDisease/DeleteOccupationalDiseaseWithDetail', { patientRegisterId: this.dataTransOpts.tableS.patient_register.id })
}).then(res => { }).then(res => {
if(res && res.code > -1){
if (res && res.code > -1) {
this.dialogWin.OccDisease = false this.dialogWin.OccDisease = false
} }
}).catch((err) => { }).catch((err) => {
@ -146,7 +146,7 @@ export default {
}, },
// //
btnOk() {
btnOk() {
let body = { let body = {
patientRegisterId: this.dataTransOpts.tableS.patient_register.id, patientRegisterId: this.dataTransOpts.tableS.patient_register.id,
patientOccupationalDisease: this.dataTransOpts.tableS.patient_occupational_disease, patientOccupationalDisease: this.dataTransOpts.tableS.patient_occupational_disease,
@ -155,15 +155,20 @@ export default {
patientSymptoms: this.dataTransOpts.tableM.patient_symptom patientSymptoms: this.dataTransOpts.tableM.patient_symptom
} }
postapi('/api/app/OccupationalDisease/CreateOccupationalDiseaseWithDetail', body).then(res => {
if (res.code > -1) {
this.$message.success({ showClose: true, message: "操作成功!" })
this.dataTransOpts.plus.OccDisease++
} else {
this.$message.warning({ showClose: true, message: res.message })
}
})
postapi('/api/app/OccupationalDisease/CreateOccupationalDiseaseWithDetail', body)
.then(res => {
if (res.code > -1) {
this.$message.success({ showClose: true, message: "操作成功!" })
this.dataTransOpts.tableS.patient_occupational_disease.patientRegisterId = this.dataTransOpts.tableS.patient_register.id
return postapi('/api/app/OccupationalDisease/UpdateOccupationalDiseaseInspectionConclusion', this.dataTransOpts.tableS.patient_occupational_disease)
} else {
this.$message.warning({ showClose: true, message: res.message })
}
}).then(res => {
if(res && res.code > -1){
this.dataTransOpts.plus.OccDisease++
}
})
}, },
// //

167
src/components/occDisease/OccDiseaseConclusion.vue

@ -6,21 +6,21 @@
<td width="50%">建议</td> <td width="50%">建议</td>
</tr> </tr>
<tr> <tr>
<td><el-input type="textarea" v-model="form.occupationalAbnormal" size="small" :autosize="{ minRows: 8, maxRows: 8 }"></el-input></td>
<td><el-input type="textarea" v-model="form.occupationalAbSuggestion" size="small" :autosize="{ minRows: 8, maxRows: 8 }"></el-input></td>
<td><el-input type="textarea" v-model="dataTransOpts.tableS.patient_occupational_disease.occupationalAbnormal" size="small" :autosize="{ minRows: 8, maxRows: 8 }"></el-input></td>
<td><el-input type="textarea" v-model="dataTransOpts.tableS.patient_occupational_disease.occupationalAbSuggestion" size="small" :autosize="{ minRows: 8, maxRows: 8 }"></el-input></td>
</tr> </tr>
<tr> <tr>
<td width="50%">非职业性异常</td> <td width="50%">非职业性异常</td>
<td width="50%">建议</td> <td width="50%">建议</td>
</tr> </tr>
<tr> <tr>
<td><el-input type="textarea" v-model="form.noOccupationalAbnormal" size="small" :autosize="{ minRows: 8, maxRows: 8 }"></el-input></td>
<td><el-input type="textarea" v-model="form.noOccupAbSuggestion" size="small" :autosize="{ minRows: 8, maxRows: 8 }"></el-input></td>
<td><el-input type="textarea" v-model="dataTransOpts.tableS.patient_occupational_disease.noOccupationalAbnormal" size="small" :autosize="{ minRows: 8, maxRows: 8 }"></el-input></td>
<td><el-input type="textarea" v-model="dataTransOpts.tableS.patient_occupational_disease.noOccupAbSuggestion" size="small" :autosize="{ minRows: 8, maxRows: 8 }"></el-input></td>
</tr> </tr>
</table> </table>
<div>处理意见</div> <div>处理意见</div>
<div> <div>
<el-input type="textarea" v-model="form.handleSuggestion" size="small" :autosize="{ minRows: 2, maxRows: 2 }"></el-input>
<el-input type="textarea" v-model="dataTransOpts.tableS.patient_occupational_disease.handleSuggestion" size="small" :autosize="{ minRows: 2, maxRows: 2 }"></el-input>
</div> </div>
</div> </div>
</template> </template>
@ -39,45 +39,18 @@ export default {
privs: [] // privs: [] //
}, },
form: { //
id: "",
customerOrgId: '',
creationTime: null,
lastModificationTime: null,
creatorName: "",
lastModifierName: "",
displayName: "",
title: "",
remark: "",
},
formInit: {},
contactMethodList: [], //
Methodtypes: [
//{ value: '',label: '' },
{ value: "0", label: "电话" },
{ value: "1", label: "邮箱" },
],
rules: {
displayName: [
{ required: true, message: "请输入名称", trigger: "blur" },
],
},
}; };
}, },
created() { created() {
// //
let userPriv = window.sessionStorage.getItem('userPriv') let userPriv = window.sessionStorage.getItem('userPriv')
if (userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName))
this.formInit = deepCopy(this.form)
if (userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName))
}, },
// //
mounted() { mounted() {
this.getFormData(this.dataTransOpts.tableS.contact_person.id)
}, },
computed: { computed: {
@ -86,125 +59,7 @@ export default {
methods: { methods: {
moment, checkPagePriv, moment, checkPagePriv,
//
getFormData(id) {
if (!id) {
this.form = deepCopy(this.formInit)
this.form.customerOrgId = this.dataTransOpts.tableS.customer_org.id
this.contactMethodList = []
return
}
getapi(`/api/app/contact-person/${id}`)
.then(res => {
if (res.code != -1) {
this.form = deepCopy(res.data)
this.getContactMethodList(res.data.id)
}
})
},
//
//api/app/contact-method/in-contact-person-id?ContactPersonId=3a0c08ad-4304-138b-d9e6-a7338739dfc4' \
getContactMethodList(ContactPersonId) {
if (!ContactPersonId) {
this.contactMethodList = []
return
}
getapi("/api/app/contact-method/in-contact-person-id", {
ContactPersonId,
}).then(res => {
//console.log('res.data',res.data)
if (res.code != -1) this.contactMethodList = res.data;
});
},
//
deleteRow(index) {
this.$confirm("此操作确定后将永久删除该记录, 是否继续?", "提示", {
confirmButtonText: "是",
cancelButtonText: "否",
type: "warning",
}).then(() => {
this.contactMethodList.splice(index, 1);
//this.submit('form');
}).catch((err) => {
if (err == 'cancel') {
this.$message.info({ showClose: true, message: "已取消删除" });
}
});
},
//
submit(formName) {
let body = {
customerOrgId: "",
displayName: "",
title: "",
remark: "",
};
this.$refs[formName].validate((valid, fields) => {
if (!valid) {
this.$message.warning({ showClose: true, message: fields[Object.keys(fields)[0]][0].message });
return false;
}
objCopy(this.form, body);
let contactMethod = {
contactPersonId: this.form.id,
details: this.contactMethodList
}
console.log("body,contactMethod", body, contactMethod);
if (!this.form.id) {
postapi("/api/app/contact-person", body)
.then((res) => {
//console.log('api/app/contact-person')
if (res.code != -1) {
this.form = res.data
this.dataTransOpts.tableS.contact_person.id = res.data.id
this.refFunc(['curChooseRow'], res.data)
contactMethod.contactPersonId = res.data.id
return postapi('/api/app/contactmethod/createmany', contactMethod);
}
})
.then((res) => {
//console.log('api/app/contact-method/many')
if (res && res.code != -1) {
console.log("操作成功!");
this.dialogWin.ContactPersonEdit = false
}
});
} else {
putapi(`/api/app/contact-person/${this.form.id}`, body)
.then((res) => {
if (res.code != -1) {
this.refFunc(['curChooseRow'], this.form)
return postapi('/api/app/contactmethod/createmany', contactMethod);
}
})
.then((res) => {
//console.log('api/app/contact-method/many')
//this.getContactPersonList(this.customerOrgId); //
if (res && res.code != -1) {
console.log("操作成功!");
this.dialogWin.ContactPersonEdit = false
}
});
}
})
},
//
addMethod() {
this.contactMethodList.push({
contactMethodValue: "",
contactMethodType: "0",
contactPersonId: this.form.id,
});
},
}, },
@ -218,12 +73,6 @@ export default {
} }
}, },
// 'customerOrgId' (newVal,oldVal){
// console.log('watch customerOrgId',newVal,oldVal)
// if(newVal != oldVal){
// this.personId = ''
// }
// }
}, },
}; };
</script> </script>

Loading…
Cancel
Save