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.

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