You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

213 lines
5.9 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div style="padding: 0 5px;">
  3. <div>
  4. <el-select v-model="diagnosis" placeholder="快速选择诊断疾病" size="small" filterable clearable remote automatic-dropdown
  5. :remote-method="remoteMethod" @change="quickChoosedDiag" default-first-option ref="diagnosises" value-key="id"
  6. style="width:250px;text-align: left;padding-right: 15px;">
  7. <el-option v-for="item in diagnosisesCur" :key="item.id" :value="item" :label="item.displayName" />
  8. </el-select>
  9. </div>
  10. <div>
  11. <el-table :data="sumDoctorCheck.diagnosisList" :height="window.pageHeight - 110" width="100%" size="small">
  12. <!-- temporaryselection personnelUnit.nogroupselected-->
  13. <!--
  14. "patientRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  15. "diagnosisId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  16. "sumSuggestionHeaderId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  17. "displayOrder": 0,
  18. "diagnosisName": "string"
  19. -->
  20. <el-table-column type="index" label="序号" align="center" width="60" />
  21. <el-table-column label="诊断疾病" width="160" prop="diagnosisName" />
  22. <el-table-column fixed="right" label="操作" width="60">
  23. <template slot-scope="scope">
  24. <i class="el-icon-delete" @click="deleteRow(scope.$index)"
  25. style="font-size: 24px;color: red;cursor:pointer;"></i>
  26. </template>
  27. </el-table-column>
  28. </el-table>
  29. </div>
  30. </div>
  31. </template>
  32. <script>
  33. import moment from "moment";
  34. import { mapState, mapMutations } from "vuex";
  35. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  36. import { dddw, objCopy, arrayReduce, deepCopy } from "@/utlis/proFunc";
  37. export default {
  38. components: {
  39. },
  40. props: ['patientRegisterId'],
  41. data() {
  42. return {
  43. diagnosis: "",
  44. diagnosisesCur: [], //疾病列表数据
  45. diagnosisesAll: [], //疾病列表数据
  46. };
  47. },
  48. created() {
  49. this.dictInit();
  50. this.getDiagnosisList(this.patientRegisterId);
  51. },
  52. //挂载完成
  53. mounted() { },
  54. computed: {
  55. ...mapState(["window", "dict", "patientRegister", "customerOrg", "doctorCheck", "sumDoctorCheck", "report"]),
  56. },
  57. methods: {
  58. dictInit() {
  59. postapi('/api/app/diagnosis/getlistinsuggestion', {}).then(res => {
  60. if (res.code != -1) {
  61. this.diagnosisesCur = res.data
  62. this.diagnosisesAll = res.data
  63. //过滤已选的诊断
  64. this.filterDiagnosises()
  65. }
  66. })
  67. },
  68. //快速选择组合项目时,调整可按拼间简码及简称查找
  69. remoteMethod(keyWords) {
  70. //console.log('remoteMethod',this.dict.asbItemQuick)
  71. if (keyWords) {
  72. this.diagnosisesCur = [];
  73. this.diagnosisesAll.forEach(item => {
  74. if (item.displayName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1
  75. || item.simpleCode.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1) {
  76. this.diagnosisesCur.push(item);
  77. }
  78. });
  79. } else {
  80. this.diagnosisesCur = deepCopy(this.diagnosisesAll)
  81. }
  82. //过滤已选的诊断
  83. this.filterDiagnosises()
  84. },
  85. //过滤已选诊断的
  86. filterDiagnosises(){
  87. let sumDiagnosises = deepCopy(this.sumDoctorCheck.diagnosisList)
  88. sumDiagnosises.forEach(e =>{
  89. e.id = e.diagnosisId
  90. return e
  91. })
  92. this.diagnosisesCur = arrayReduce(this.diagnosisesCur,sumDiagnosises,'id')
  93. },
  94. quickChoosedDiag(v) {
  95. if (!v) return
  96. console.log(v)
  97. this.sumDoctorCheck.diagnosisList.push({
  98. patientRegisterId: this.patientRegisterId,
  99. diagnosisId: v.id,
  100. diagnosisName: v.displayName,
  101. })
  102. let id = String(new Date().getTime())
  103. let details = []
  104. v.suggestions.forEach(e => {
  105. details.push({
  106. sumSuggestionHeaderId: id,
  107. suggestionContent: e.suggestionContent
  108. })
  109. })
  110. let pojo = {
  111. id: id,
  112. patientRegisterId: this.patientRegisterId,
  113. suggestionTitle: v.suggestionName || v.displayName,
  114. diagnosisId: v.id,
  115. details
  116. }
  117. this.sumDoctorCheck.suggestionList.push(pojo);
  118. },
  119. //查询
  120. getDiagnosisList(PatientRegisterId) {
  121. // /api/app/sumdiagnosis/getsumdiagnosislistinpatientregisterid?PatientRegisterId=3fa85f64-5717-4562-b3fc-2c963f66afa6
  122. getapi(`/api/app/sumdiagnosis/getsumdiagnosislistinpatientregisterid?PatientRegisterId=${PatientRegisterId}`)
  123. .then((res) => {
  124. if(res.code != - 1) this.sumDoctorCheck.diagnosisList = res.data
  125. });
  126. },
  127. deleteRow(index) {
  128. this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
  129. confirmButtonText: "是",
  130. cancelButtonText: "否",
  131. type: "warning",
  132. }).then(() => {
  133. //删除建议
  134. let count = this.sumDoctorCheck.suggestionList.length - 1
  135. for (let i = count; i > 0; i--) {
  136. //console.log(this.sumDoctorCheck.suggestionList[i].diagnosisId, this.sumDoctorCheck.diagnosisList[index].diagnosisId)
  137. if (this.sumDoctorCheck.suggestionList[i].diagnosisId == this.sumDoctorCheck.diagnosisList[index].diagnosisId) {
  138. this.sumDoctorCheck.suggestionList.splice(i, 1)
  139. }
  140. }
  141. this.sumDoctorCheck.diagnosisList.splice(index, 1)
  142. }).catch((err) => {
  143. //
  144. });
  145. },
  146. },
  147. //监听事件
  148. watch: {
  149. "patientRegisterId"(newVal, oldVal){
  150. if(newVal && newVal != oldVal){
  151. this.getDiagnosisList(newVal)
  152. }
  153. },
  154. },
  155. };
  156. </script>
  157. <style scoped>
  158. /* 输入框相关设置*/
  159. ::v-deep .el-input__inner {
  160. padding-left: 2px;
  161. padding-right: 15px;
  162. }
  163. ::v-deep .el-input__icon {
  164. width: 15px;
  165. /* 输入框下拉箭头或清除图标 默认 25 */
  166. }
  167. ::v-deep .el-input-group__append {
  168. padding: 0 5px;
  169. /* 控件默认 0 20px;*/
  170. }
  171. .box {
  172. display: flex;
  173. }
  174. .query {
  175. margin-left: 5px;
  176. margin-bottom: 2px;
  177. }
  178. .listBtn {
  179. margin-top: 10px;
  180. }
  181. </style>