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.

1349 lines
53 KiB

2 years ago
2 years ago
4 weeks 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 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
6 months ago
2 years ago
6 months 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 year 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 year 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
6 months ago
2 years ago
6 months 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 month ago
2 years ago
2 years ago
2 years ago
2 years ago
6 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 month ago
4 weeks ago
1 month ago
4 weeks ago
1 month ago
4 weeks ago
2 years ago
6 months 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
6 months 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 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
6 months 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 year 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 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
6 months 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
6 months ago
11 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
6 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
11 months ago
6 months ago
11 months ago
6 months ago
11 months 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
11 months ago
6 months ago
11 months ago
6 months ago
11 months ago
2 years ago
11 months ago
2 years ago
2 years ago
2 years ago
6 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
11 months ago
6 months ago
11 months ago
6 months ago
11 months 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
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
4 weeks ago
2 years ago
2 years ago
1 year 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>
  3. <!--组件-->
  4. <div style="display: flex;" @contextmenu.prevent="onContextmenu">
  5. <div
  6. :style="`position: absolute; top: 0px; left: ${Math.floor((window.pageWidth - 120) / 2) - 110}px; display: flex;z-index: 3;`">
  7. <div v-show="checkPagePriv(pagePriv.privs, '新增综述')">
  8. <el-button style="height: 28px;" class="commonbutton" @click="addSummary"
  9. :disabled="sumBtnDisabled('addSummary')">新增综述</el-button>
  10. </div>
  11. </div>
  12. <div style="width:50%;">
  13. <el-table id="tableSummary" row-key="id" :data="sumDoctorCheck.summaryList" width="100%" :height="sumHeight"
  14. border size="small">
  15. <el-table-column type="index" width="30" align="center" />
  16. <el-table-column prop="summaryTitle" label="综述">
  17. <template slot="header">
  18. <div style="display: flex;justify-content:space-between;">
  19. <div>综述</div>
  20. <div></div>
  21. </div>
  22. </template>
  23. <template slot-scope="scope">
  24. <div>
  25. <div style="display: flex;">
  26. <el-input v-model="scope.row.summaryTitle" placeholder="请输入综述" :ref="scope.row.id" :id="scope.row.id"
  27. :disabled="sumBtnDisabled('addSummary')"></el-input>
  28. <el-button v-show="checkPagePriv(pagePriv.privs, '新增综述明细')" icon="el-icon-plus"
  29. style="min-width:21px;height:21px;padding:2px;" @click="addSum(scope.$index)"
  30. :disabled="sumBtnDisabled('addSummary')"></el-button>
  31. <el-button v-show="checkPagePriv(pagePriv.privs, '删除综述')" type="danger" icon="el-icon-delete"
  32. style="margin-left: 2px;min-width:21px;height:21px;padding:2px;" @click="delSumHead(scope.$index)"
  33. :disabled="sumBtnDisabled('addSummary')"></el-button>
  34. </div>
  35. <el-table :id="scope.row.id" :row-key="scope.$index + scope.row.id" style="margin-left: 10px;"
  36. :data="scope.row.details" border @row-click="rowClick" :show-header="false">
  37. <el-table-column width="30">
  38. <template slot-scope="scope2">
  39. <div>{{ scope2.$index + 1 }})</div>
  40. </template>
  41. </el-table-column>
  42. <el-table-column prop="summaryContent" label="综述" min-width="200">
  43. <template slot-scope="scope2">
  44. <div style="display: flex;">
  45. <el-input type="textarea" v-model="scope2.row.summaryContent" placeholder="请输入综述"
  46. :disabled="sumBtnDisabled('addSummary')" :id="scope2.row.id" :ref="scope2.row.id"
  47. :autosize="{ minRows: 1, maxRows: 20 }">
  48. </el-input>
  49. <el-button v-show="checkPagePriv(pagePriv.privs, '删除综述明细')" type="danger" icon="el-icon-delete"
  50. style="margin-left: 2px;min-width:21px;height:21px;padding:2px;"
  51. @click="delSug(scope.row.details, scope2.$index)"
  52. :disabled="sumBtnDisabled('addSummary')"></el-button>
  53. </div>
  54. </template>
  55. </el-table-column>
  56. <el-table-column width="8" />
  57. </el-table>
  58. </div>
  59. </template>
  60. </el-table-column>
  61. </el-table>
  62. </div>
  63. <div style="position: absolute; top: 0px; right: 2px; display: flex;z-index: 3;">
  64. <div style="margin-right: 5px;">
  65. <el-button style="height: 28px;" class="commonbutton" @click="btnCollapseAll"
  66. :disabled="sumBtnDisabled('collapse')">{{
  67. collapse ?
  68. '展开' : '折叠' }}全部建议</el-button>
  69. </div>
  70. <div v-show="checkPagePriv(pagePriv.privs, '新增建议')">
  71. <el-button style="height: 28px;" class="commonbutton" @click="addSuggtion"
  72. :disabled="sumBtnDisabled()">新增建议</el-button>
  73. </div>
  74. </div>
  75. <div style="width:50%;">
  76. <el-table id="tableSuggestion" row-key="id" :data="sumDoctorCheck.suggestionList" width="100%"
  77. :height="sumHeight" border size="small" ref="tableSuggestion">
  78. <el-table-column width="30" align="center">
  79. <template slot-scope="scope">
  80. <el-tag class="moveTag" style="cursor: move;background-color: #EEEEEE;">
  81. <div style="width: 16px;">{{ scope.$index + 1 }}</div>
  82. </el-tag>
  83. </template>
  84. </el-table-column>
  85. <el-table-column prop="suggestionTitle" label="建议">
  86. <template slot="header">
  87. <div style="display: flex;justify-content:space-between;">
  88. <div>建议</div>
  89. <div></div>
  90. </div>
  91. </template>
  92. <template slot-scope="scope">
  93. <div>
  94. <div style="display: flex;" @dblclick="openSymbols(scope.$index, 'suggestionTitle', -1)">
  95. <el-input v-model="scope.row.suggestionTitle" placeholder="请输入建议标题" :ref="scope.row.id"
  96. :id="scope.row.id" :disabled="sumBtnDisabled()">
  97. </el-input>
  98. <el-button type="danger" :icon="scope.row.collapse ? 'el-icon-arrow-down' : 'el-icon-arrow-up'"
  99. style="min-width:21px;height:21px;padding:2px;"
  100. @click="btnCollapse(sumDoctorCheck.suggestionList, scope.$index, scope.row)"
  101. :disabled="sumBtnDisabled('collapse')"></el-button>
  102. <el-button v-show="checkPagePriv(pagePriv.privs, '删除建议')" type="danger" icon="el-icon-delete"
  103. style="margin-left: 2px;min-width:21px;height:21px;padding:2px;" @click="delSugHead(scope.$index)"
  104. :disabled="sumBtnDisabled()"></el-button>
  105. </div>
  106. <div v-show="!scope.row.collapse">
  107. <div style="display: flex;margin-top: 2px;">
  108. <div style="width:60px;">诊断</div>
  109. <el-input placeholder="请选择诊断" :value="`${scope.row.diagnosisNames}`" size="small" disabled>
  110. </el-input>
  111. <el-tooltip content="选择诊断" placement="top">
  112. <el-button icon="el-icon-search" style="min-width:21px;height:21px;padding:2px;"
  113. @click="btnChooseDiagnosis(scope.$index)" :disabled="sumBtnDisabled()"></el-button>
  114. </el-tooltip>
  115. <el-tooltip content="根据诊断搜索医学解释、常见原因及健康指导" placement="top">
  116. <el-button icon="el-icon-cpu" style="margin-left: 2px;min-width:21px;height:21px;padding:2px;"
  117. @click="btnAIdiagnosis(scope.row.diagnosisNames)" :disabled="sumBtnDisabled()"></el-button>
  118. </el-tooltip>
  119. <!--
  120. <el-select v-model="scope.row.diagnosisIds" multiple placeholder="请选择" style="width: 100%;"
  121. :disabled="sumBtnDisabled()" @change="changeDiagnosis" filterable class="no-animation">
  122. <el-option v-for="item in diagnosises" :key="item.id" :value="item.id" :label="item.displayName"
  123. :disabled="disabledDiagnosis(item.id, scope.$index)" />
  124. </el-select>
  125. -->
  126. </div>
  127. <!--医学解释-->
  128. <div v-if="dispTermReason == 'Y'" style="display: flex;margin-top: 2px;">
  129. <div style="width:60px;">医学解释</div>
  130. <el-tooltip content="新增医学解释" placement="top">
  131. <el-button v-show="checkPagePriv(pagePriv.privs, '新增医学解释')" type="success" icon="el-icon-plus"
  132. style="min-width:21px;height:21px;padding:2px;" @click="addSug(scope.$index, 0)"
  133. :disabled="sumBtnDisabled()">
  134. </el-button>
  135. </el-tooltip>
  136. <el-table :id="'0_sug' + scope.row.id" row-key="displayOrder" style="margin-left: 5px;"
  137. :data="scope.row.medicalInterpretations" border @row-click="rowClickSug0" :show-header="false">
  138. <el-table-column width="30">
  139. <template slot-scope="scope2">
  140. <el-tag class="moveTag2" style="cursor: move;background-color: #EEEEEE;">
  141. <div style="width: 16px;">{{ scope2.$index + 1 }}).</div>
  142. </el-tag>
  143. </template>
  144. </el-table-column>
  145. <el-table-column prop="suggestionContent" label="建议" min-width="200">
  146. <template slot-scope="scope2">
  147. <div @dblclick="openSymbols(scope.$index, 'medicalInterpretations', scope2.$index)">
  148. <el-input type="textarea" v-model="scope2.row.suggestionContent" placeholder="请输入建议内容"
  149. :disabled="sumBtnDisabled()" :autosize="{ minRows: 1, maxRows: 10 }">
  150. </el-input>
  151. </div>
  152. </template>
  153. </el-table-column>
  154. <el-table-column label="操作" width="25">
  155. <template slot-scope="scope2">
  156. <el-button v-show="checkPagePriv(pagePriv.privs, '删除医学解释')" type="danger"
  157. style="min-width:21px;height:21px;padding:2px;" icon="el-icon-delete"
  158. @click="delSug(scope.row.medicalInterpretations, scope2.$index)"
  159. :disabled="sumBtnDisabled()" size="small"></el-button>
  160. </template>
  161. </el-table-column>
  162. </el-table>
  163. </div>
  164. <!--常见原因-->
  165. <div v-if="dispTermReason == 'Y'" style="display: flex;margin-top: 2px;">
  166. <div style="width:60px;">常见原因</div>
  167. <el-tooltip content="新增常见原因" placement="top">
  168. <el-button v-show="checkPagePriv(pagePriv.privs, '新增常见原因')" type="danger" icon="el-icon-plus"
  169. style="min-width:21px;height:21px;padding:2px;" @click="addSug(scope.$index, 1)"
  170. :disabled="sumBtnDisabled()">
  171. </el-button>
  172. </el-tooltip>
  173. <el-table :id="'1_sug' + scope.row.id" row-key="displayOrder" style="margin-left: 5px;"
  174. :data="scope.row.commonReasons" border @row-click="rowClickSug1" :show-header="false">
  175. <el-table-column width="30">
  176. <template slot-scope="scope2">
  177. <el-tag class="moveTag2" style="cursor: move;background-color: #EEEEEE;">
  178. <div style="width: 16px;">{{ scope2.$index + 1 }}).</div>
  179. </el-tag>
  180. </template>
  181. </el-table-column>
  182. <el-table-column prop="suggestionContent" label="建议" min-width="200">
  183. <template slot-scope="scope2">
  184. <div @dblclick="openSymbols(scope.$index, 'commonReasons', scope2.$index)">
  185. <el-input type="textarea" v-model="scope2.row.suggestionContent" placeholder="请输入建议内容"
  186. :disabled="sumBtnDisabled()" :autosize="{ minRows: 1, maxRows: 10 }">
  187. </el-input>
  188. </div>
  189. </template>
  190. </el-table-column>
  191. <el-table-column label="操作" width="25">
  192. <template slot-scope="scope2">
  193. <el-button v-show="checkPagePriv(pagePriv.privs, '删除常见原因')" type="danger"
  194. style="min-width:21px;height:21px;padding:2px;" icon="el-icon-delete"
  195. @click="delSug(scope.row.commonReasons, scope2.$index)" :disabled="sumBtnDisabled()"
  196. size="small"></el-button>
  197. </template>
  198. </el-table-column>
  199. </el-table>
  200. </div>
  201. <!--健康指导-->
  202. <div style="display: flex;margin-top: 2px;">
  203. <div style="width:60px;">健康指导</div>
  204. <el-tooltip content="新增健康指导" placement="top">
  205. <el-button v-show="checkPagePriv(pagePriv.privs, '新增健康指导')" type="danger" icon="el-icon-plus"
  206. style="min-width:21px;height:21px;padding:2px;" @click="addSug(scope.$index, 2)"
  207. :disabled="sumBtnDisabled()">
  208. </el-button>
  209. </el-tooltip>
  210. <el-table :id="'2_sug' + scope.row.id" row-key="displayOrder" style="margin-left: 5px;"
  211. :data="scope.row.healthGuidances" border @row-click="rowClickSug2" :show-header="false">
  212. <el-table-column width="30">
  213. <template slot-scope="scope2">
  214. <el-tag class="moveTag2" style="cursor: move;background-color: #EEEEEE;">
  215. <div style="width: 16px;">{{ scope2.$index + 1 }}).</div>
  216. </el-tag>
  217. </template>
  218. </el-table-column>
  219. <el-table-column prop="suggestionContent" label="建议" min-width="200">
  220. <template slot-scope="scope2">
  221. <div @dblclick="openSymbols(scope.$index, 'healthGuidances', scope2.$index)">
  222. <el-input type="textarea" v-model="scope2.row.suggestionContent" placeholder="请输入健康指导"
  223. :disabled="sumBtnDisabled()" :autosize="{ minRows: 1, maxRows: 10 }">
  224. </el-input>
  225. </div>
  226. </template>
  227. </el-table-column>
  228. <el-table-column label="操作" width="25">
  229. <template slot-scope="scope2">
  230. <el-button v-show="checkPagePriv(pagePriv.privs, '删除健康指导')" type="danger"
  231. style="min-width:21px;height:21px;padding:2px;" icon="el-icon-delete"
  232. @click="delSug(scope.row.healthGuidances, scope2.$index)" :disabled="sumBtnDisabled()"
  233. size="small"></el-button>
  234. </template>
  235. </el-table-column>
  236. </el-table>
  237. </div>
  238. </div>
  239. </div>
  240. </template>
  241. </el-table-column>
  242. </el-table>
  243. </div>
  244. </div>
  245. <!--弹窗-->
  246. <div>
  247. <!-- 插入特殊符号 -->
  248. <el-dialog title="插入特殊符号" :visible.sync="dialogWinSymbols" width="600px" :close-on-click-modal="false">
  249. <div style="margin-top: -5px;">
  250. <div style="overflow-y:auto; width:100%;display: flex;flex-wrap: wrap;align-content: flex-start;">
  251. <div v-for="item in symbols" :key="item.id" style="margin: 1px 2px;cursor:pointer;"
  252. @click="insertSymbols(item.displayName)">
  253. <el-tag
  254. style="padding: 0 3px;height: 24px;line-height: 24px;font-size: 15px;color: #303133;background-color: white;">
  255. {{ item.displayName }}
  256. </el-tag>
  257. </div>
  258. </div>
  259. <div style="padding: 5px 0;">录入结果</div>
  260. <el-input id="resultBox" class="commonFont" style="width: 100%;" type="textarea"
  261. :autosize="{ minRows: 4, maxRows: 4 }" v-model="curResult" />
  262. </div>
  263. <span slot="footer" class="dialog-footer">
  264. <el-button type="primary" @click="btnOkResult">确定</el-button>
  265. <el-button @click="dialogWinSymbols = false">关闭</el-button>
  266. </span>
  267. </el-dialog>
  268. <el-dialog title="选择诊断" :visible.sync="dialogDiagnosises" width="800px" :close-on-click-modal="false">
  269. <div style="height: 320px;">
  270. <el-select v-model="choosedDiagnosisIds" multiple placeholder="请选择" style="width: 100%;" filterable
  271. :filter-method="filterMethod" popper-class="diagnosisSelect" :popper-append-to-body="false">
  272. <el-option v-for="item in diagnosisesFilter" :key="item.id" :value="item.id" :label="item.displayName" />
  273. </el-select>
  274. </div>
  275. <span slot="footer" class="dialog-footer">
  276. <el-button type="primary" @click="btnOkDiagnosis">确定</el-button>
  277. <el-button @click="dialogDiagnosises = false">关闭</el-button>
  278. </span>
  279. </el-dialog>
  280. <!-- AI诊断所有小结信息-->
  281. <div v-show="AI.visible"
  282. :style="`z-index:3;border-radius: 10px;border: 1px solid #ddd;background-color:#FFF; position: absolute;top:0px;left:0px;width:${AI.width}px;height: ${AI.height}px;opacity:1;`">
  283. <div v-show="AI.max" style="display: flex;justify-content: space-between;">
  284. <p>AI诊断内容</p>
  285. <el-tooltip content="隐藏 AI诊断内容" placement="top">
  286. <i class="el-icon-minus" @click="btnAImax(AI.max)" style="font-size: 24px;color: red;cursor:pointer;"></i>
  287. </el-tooltip>
  288. </div>
  289. <div v-show="!AI.max">
  290. <el-tooltip content="显示 AI诊断内容" placement="top">
  291. <i class="el-icon-plus" @click="btnAImax(AI.max)" style="font-size: 24px;color: red;cursor:pointer;"></i>
  292. </el-tooltip>
  293. </div>
  294. <el-input v-show="AI.max" type="textarea" v-model="AI.diagnosis" placeholder="AI诊断内容"
  295. :autosize="{ minRows: AIDH, maxRows: AIDH }" style="text-align: right;">
  296. </el-input>
  297. <div v-show="AI.max" style="text-align: right; margin-top: 10px;">
  298. <el-button class="commonbutton" @click="AI.visible = false">关闭</el-button>
  299. </div>
  300. </div>
  301. </div>
  302. </div>
  303. </template>
  304. <script>
  305. import { mapState } from 'vuex';
  306. import Sortable from "sortablejs";
  307. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  308. import { getPagePriv, checkPagePriv, deepCopy, arrayExistObj } from '../../utlis/proFunc';
  309. export default {
  310. components: {},
  311. props: ["patientRegisterId", "tabChoosed"],
  312. data() {
  313. return {
  314. pagePriv: {
  315. routeUrlorPageName: 'sumDoctorCheck', //当前页面归属路由或归属页面权限名称
  316. privs: [] // 页面权限
  317. },
  318. sumDetails: [],
  319. suggestionCurRow: 0, //当前操作建议的行
  320. dialogDiagnosises: false, // 诊断选择窗口
  321. diagnosises: [], // 诊断
  322. diagnosisesFilter: [], // 可选的诊断
  323. choosedDiagnosisIds: [], // 已选的诊断 id 集合
  324. disabledDiagnosisIds: [], // 不可选的诊断 id 集合
  325. diagnosisesChoosed: [], // 已选的诊断集合
  326. collapse: false, // 折叠/展开全部建议
  327. dispTermReason: 'N', // 显示医学解释与常见原因
  328. dialogWinSymbols: false,
  329. selection: { // 光标位置
  330. start: 0, end: 0
  331. },
  332. symbols: [], //特殊符号
  333. curResult: "", // 当前输入框内容
  334. dbclObj: { // 输入特殊符号前,双击的对象
  335. index: -1,
  336. colName: '', //
  337. subIndex: -1,
  338. },
  339. summary_check_default_summay_modifiable: 'N',
  340. AI: {
  341. width: 500,
  342. height: 24,
  343. max: true,
  344. visible: false,
  345. diagnosis: 'AI诊断信息',
  346. }
  347. };
  348. },
  349. created() {
  350. //获取用户当前页面的权限
  351. let userPriv = window.sessionStorage.getItem('userPriv')
  352. if (userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName))
  353. // 获取是否显示医学解释与常见原因
  354. // 获取系统参数(医生诊台侧边项目归类模式 0-检检类别,1-指引类别,2-报告类别)
  355. postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId: 'summary_check_disp_reas' })
  356. .then(res => {
  357. if (res.code > -1) {
  358. this.dispTermReason = res.data || "Y"
  359. }
  360. })
  361. this.AI.height = this.frameHeight
  362. },
  363. //挂载完成
  364. async mounted() {
  365. // this.rowDrop(); (综述取消拖拽)
  366. this.rowDropSuggestion();
  367. await this.dictInit()
  368. // document.addEventListener('DOMContentLoaded', function () {
  369. // const textarea = document.querySelector('textarea');
  370. // textarea.addEventListener('input', function () {
  371. // // 当文本域内容变化时调整大小
  372. // console.log('textarea.addEventListener',textarea.style.height)
  373. // textarea.style.height = 'auto'; // 重置高度
  374. // // textarea.style.height = textarea.scrollHeight + 'px'; // 根据滚动高度调整高度
  375. // });
  376. // });
  377. this.summaryList(this.dataTransOpts.tableS.patient_register.id)
  378. this.suggestionList(this.dataTransOpts.tableS.patient_register.id)
  379. },
  380. computed: {
  381. ...mapState(['window', 'dict', 'dataTransOpts', 'doctorCheck', 'sumDoctorCheck']),
  382. sumHeight() {
  383. let tempHeight = this.window.pageHeight < 600 ? 600 : this.window.pageHeight
  384. return tempHeight - 335
  385. },
  386. frameHeight() {
  387. return this.window.pageHeight - 42 - 10
  388. },
  389. // AIdiagnosisHeight
  390. AIDH() {
  391. return Math.floor((this.AI.height - 24 - 42 - 4) / 21.5)
  392. }
  393. },
  394. methods: {
  395. checkPagePriv,
  396. // textareaResize() {
  397. // const textarea = document.querySelectorAll('textarea');
  398. // textarea.forEach(e => {
  399. // e.style.height = 'auto'; // 重置高度
  400. // });
  401. // },
  402. // 获取诊断数据
  403. async dictInit() {
  404. // 获取诊断 /api/app/diagnosis/getlistinsuggestion , {}
  405. postapi('/api/app/Diagnosis/GetSimpleDiagnosisWithSuggestions').then(res => {
  406. if (res.code > -1) {
  407. this.diagnosises = res.data
  408. }
  409. })
  410. //获取结果状态提示数据
  411. postapi('/api/app/CommonChar/GetCommonCharList', {}).then(res => {
  412. if (res.code >= 0) {
  413. this.symbols = res.data
  414. }
  415. })
  416. let sysParmId = "summary_check_default_summay_modifiable"
  417. try {
  418. let sysParm = await postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId })
  419. this.summary_check_default_summay_modifiable = sysParm.data.toUpperCase()
  420. // console.log('dictInit this.summary_check_default_summay_modifiable',this.summary_check_default_summay_modifiable,sysParm.data.toUpperCase())
  421. } catch (error) {
  422. console.log('获取参数 summary_check_default_summay_modifiable 失败', error)
  423. }
  424. },
  425. // 增加综述
  426. addSummary() {
  427. let id = String(new Date().getTime())
  428. let pojo = {
  429. id,
  430. patientRegisterId: this.dataTransOpts.tableS.patient_register.id,
  431. summaryTitle: '',
  432. details: [{
  433. id: 'detail' + id,
  434. summaryContent: '',
  435. }]
  436. }
  437. this.sumDoctorCheck.summaryList.push(pojo);
  438. this.$nextTick(() => {
  439. this.$refs[id].focus();
  440. })
  441. },
  442. //增加建议
  443. addSuggtion() {
  444. let id = String(new Date().getTime())
  445. let pojo = {
  446. id,
  447. patientRegisterId: this.dataTransOpts.tableS.patient_register.id,
  448. diagnosisIds: [],
  449. medicalInterpretations: [
  450. {
  451. sumSuggestionHeaderId: id, // 拖拽用到
  452. diagnosisId: '', // 关联诊断用到
  453. suggestionContent: '',
  454. }
  455. ],
  456. commonReasons: [
  457. {
  458. sumSuggestionHeaderId: id, // 拖拽用到
  459. diagnosisId: '',
  460. suggestionContent: '',
  461. }
  462. ],
  463. healthGuidances: [
  464. {
  465. sumSuggestionHeaderId: id, // 拖拽用到
  466. diagnosisId: '',
  467. suggestionContent: '',
  468. }
  469. ],
  470. }
  471. this.sumDoctorCheck.suggestionList.push(pojo);
  472. this.$nextTick(() => {
  473. this.$refs[id].focus();
  474. })
  475. },
  476. // 单个折叠展开建议
  477. btnCollapseAll() {
  478. this.collapse = !this.collapse
  479. this.sumDoctorCheck.suggestionList.forEach((e, index) => {
  480. e.collapse = this.collapse
  481. this.$set(this.sumDoctorCheck.suggestionList, index, e)
  482. });
  483. },
  484. // 单个折叠展开建议
  485. btnCollapse(data, index, row) {
  486. row.collapse = !row.collapse
  487. this.$set(data, index, row)
  488. // this.sumDoctorCheck.suggestionList[index]['collapse'] = !this.sumDoctorCheck.suggestionList[index]['collapse']
  489. this.$nextTick(() => {
  490. this.$refs['tableSuggestion'].doLayout()
  491. })
  492. },
  493. //选择诊断
  494. btnChooseDiagnosis(index) {
  495. this.suggestionCurRow = index
  496. this.choosedDiagnosisIds = this.sumDoctorCheck.suggestionList[index].diagnosisIds || []
  497. this.disabledDiagnosisIds = []
  498. this.sumDoctorCheck.suggestionList.forEach((e, i) => {
  499. if (i != index) {
  500. if (e.diagnosisIds) this.disabledDiagnosisIds = this.disabledDiagnosisIds.concat(e.diagnosisIds)
  501. }
  502. });
  503. this.diagnosisesFilter = []
  504. this.diagnosisesChoosed = []
  505. this.diagnosises.forEach(e => {
  506. if (e.id && this.disabledDiagnosisIds.indexOf(e.id) == -1) {
  507. console.log('this.disabledDiagnosisIds', e.id, this.disabledDiagnosisIds, this.choosedDiagnosisIds)
  508. if (this.choosedDiagnosisIds.indexOf(e.id) == -1) {
  509. console.log('this.diagnosisesFilter', e.id, this.diagnosisesFilter)
  510. if (this.diagnosisesFilter.length < 20) this.diagnosisesFilter.push(e)
  511. } else {
  512. this.diagnosisesChoosed.push(e)
  513. }
  514. }
  515. });
  516. this.diagnosisesFilter = this.diagnosisesFilter.concat(this.diagnosisesChoosed)
  517. this.dialogDiagnosises = true
  518. },
  519. // 根据诊断,搜索医学解释、常见原因、健康指导
  520. // AI诊断 AI重新诊断
  521. btnAIdiagnosis(diagnosis) {
  522. if (!diagnosis) {
  523. this.$message.warning({ showClose: true, message: '诊断内容为空,无法搜索医学解释、常见原因及健康指导信息。' })
  524. return
  525. }
  526. let message = '性别:' + this.doctorCheck.prBase.sexName + ',年龄:' + this.doctorCheck.prBase.age + '岁,检查结果:' + diagnosis
  527. + ' 请给出医学解释、常见原因及健康指导'
  528. postapi('/api/app/AIMessage/GetAIMessageResult', { message })
  529. .then(res => {
  530. if (res.code > -1) {
  531. this.AI.visible = true
  532. this.AI.diagnosis = res.data.result
  533. this.btnAImax(false)
  534. } else {
  535. this.$message.error({ showClose: true, message: res.message })
  536. }
  537. })
  538. },
  539. btnAImax(max) {
  540. this.AI.max = !max
  541. if (this.AI.max) {
  542. this.AI.width = 500
  543. this.AI.height = this.frameHeight
  544. } else {
  545. this.AI.width = 24
  546. this.AI.height = 24
  547. }
  548. },
  549. //快速选择组合项目时,调整可按拼间简码及简称查找
  550. filterMethod(keyWords) {
  551. if (keyWords) {
  552. let diagnosisesFilter = []
  553. this.diagnosises.forEach(e => {
  554. if (this.disabledDiagnosisIds.indexOf(e.id) == -1) {
  555. if (this.choosedDiagnosisIds.indexOf(e.id) == -1) {
  556. if (e.displayName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1 || e.simpleCode.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1) {
  557. if (diagnosisesFilter.length < 20) diagnosisesFilter.push(e)
  558. }
  559. }
  560. }
  561. })
  562. this.diagnosisesFilter = diagnosisesFilter.concat(this.diagnosisesChoosed)
  563. }
  564. },
  565. btnOkDiagnosis() {
  566. this.changeDiagnosis(this.choosedDiagnosisIds)
  567. this.dialogDiagnosises = false
  568. },
  569. // 获取人员是否已总检过
  570. getHaveSumData(patientRegisterId) {
  571. this.sumDoctorCheck.summaryList = [];
  572. this.sumDoctorCheck.suggestionList = [];
  573. if (!patientRegisterId) return
  574. // console.log('getHaveSumData', this.dataTransOpts.tableS.patient_register.completeFlag)
  575. if (this.dataTransOpts.tableS.patient_register.completeFlag == '3') {
  576. this.summaryList(patientRegisterId, 'Y')
  577. this.suggestionList(patientRegisterId, 'Y')
  578. return
  579. }
  580. postapi('/api/app/patientregister/GetHaveSumData', { patientRegisterId })
  581. .then(async (res) => {
  582. if (res.code > -1) {
  583. let isGetExistData = res.data
  584. if (res.data == 'Y') {
  585. try {
  586. await this.$confirm('检测到该人员已经生成过总检信息。', '确认信息', {
  587. distinguishCancelAndClose: true,
  588. confirmButtonText: '重新生成总检信息',
  589. cancelButtonText: '获取上次总检信息',
  590. showClose: false
  591. })
  592. isGetExistData = 'N'
  593. } catch (error) {
  594. //console.log()
  595. }
  596. }
  597. this.summaryList(patientRegisterId, isGetExistData)
  598. this.suggestionList(patientRegisterId, isGetExistData)
  599. }
  600. })
  601. },
  602. //获取综述
  603. summaryList(RegisterId, isGetExistData) {
  604. if (!RegisterId) {
  605. this.sumDoctorCheck.summaryList = [];
  606. return
  607. }
  608. // 旧接口: console.log(`/api/app/sumsummaryheader/getsumsummarylist?PatientRegisterId=${RegisterId}`)
  609. let body = {
  610. patientRegisterId: RegisterId,
  611. isGetExistData,
  612. }
  613. postapi('/api/app/sumsummaryheader/getsumsummarylist', body)
  614. .then((res) => {
  615. // console.log("summaryList", res.data);
  616. if (res.code > -1) {
  617. let summaryList = []
  618. res.data.forEach((e, i) => {
  619. let details = []
  620. e.details.forEach((e2, i2) => {
  621. details.push({ id: `summaryDetails_${i2}`, summaryContent: ' ' })
  622. });
  623. summaryList.push({ id: `summary_${i}`, summaryTitle: ' ', details })
  624. });
  625. this.sumDoctorCheck.summaryList = summaryList
  626. // 自动高度有问题,需要这样处理一下
  627. setTimeout(() => {
  628. res.data.forEach((e, i) => {
  629. e.id = `summary_${i}`
  630. e.details.forEach((e2, i2) => {
  631. e2.id = `summaryDetails_${i2}`
  632. });
  633. });
  634. this.sumDoctorCheck.summaryList = res.data;
  635. }, 10);
  636. // this.sumDoctorCheck.summaryList = res.data;
  637. // this.textareaResize()
  638. }
  639. })
  640. .catch((err) => {
  641. this.$message({ type: "error", message: `操作失败,原因:${err}` });
  642. });
  643. },
  644. //获取建议
  645. suggestionList(RegisterId, isGetExistData) {
  646. this.sumDoctorCheck.suggestionList = [];
  647. if (!RegisterId) return;
  648. // {
  649. // "patientRegisterId": "3a11ee70-02cb-c5e6-a087-79ecdd0356b6",
  650. // "isGetExistData": "Y"
  651. // }
  652. let body = {
  653. patientRegisterId: RegisterId,
  654. isGetExistData,
  655. }
  656. // 旧接口: console.log(`/api/app/sumsuggestionheader/getsumsuggestionlist?PatientRegisterId=${RegisterId}`)
  657. postapi('/api/app/sumsuggestionheader/getsumsuggestionlist', body)
  658. .then((res) => {
  659. // console.log("suggestionList", res.data);
  660. if (res.code > -1) {
  661. // 处理拖动排序使用
  662. let suggestionList = []
  663. res.data.forEach((e, i) => {
  664. e.id = `suggestion_${i}`
  665. e.collapse = this.collapse
  666. let medicalInterpretations = []
  667. if (e.medicalInterpretations) {
  668. e.medicalInterpretations.forEach((e0, i0) => {
  669. e0.sumSuggestionHeaderId = `suggestion_${i}`
  670. e0.id = `medicalInterpretations_${i0}`
  671. medicalInterpretations.push(Object.assign({}, e0, { suggestionContent: '' }))
  672. });
  673. }
  674. let commonReasons = []
  675. if (e.commonReasons) {
  676. e.commonReasons.forEach((e0, i0) => {
  677. e0.sumSuggestionHeaderId = `suggestion_${i}`
  678. e0.id = `commonReasons_${i0}`
  679. commonReasons.push(Object.assign({}, e0, { suggestionContent: '' }))
  680. });
  681. }
  682. let healthGuidances = []
  683. if (e.healthGuidances) {
  684. e.healthGuidances.forEach((e0, i0) => {
  685. e0.sumSuggestionHeaderId = `suggestion_${i}`
  686. e0.id = `healthGuidances_${i0}`
  687. healthGuidances.push(Object.assign({}, e0, { suggestionContent: '' }))
  688. });
  689. }
  690. suggestionList.push(Object.assign({}, e, { medicalInterpretations, commonReasons, healthGuidances }))
  691. });
  692. this.sumDoctorCheck.suggestionList = suggestionList
  693. setTimeout(() => {
  694. this.sumDoctorCheck.suggestionList = res.data;
  695. }, 10);
  696. }
  697. });
  698. },
  699. // 按钮可用
  700. sumBtnDisabled(btnType) {
  701. let patientRegister = this.dataTransOpts.tableS.patient_register
  702. let ret = true
  703. //' 请选择体检人员'
  704. if (!patientRegister.id) return ret
  705. // '人员已锁定,不可执行此操作'
  706. if (patientRegister.isLock && patientRegister.isLock == 'Y') return ret
  707. // console.log('btnType', btnType, this.summary_check_default_summay_modifiable)
  708. switch (btnType) {
  709. case 'collapse':
  710. return false;
  711. case 'addSummary':
  712. if (patientRegister.completeFlag && patientRegister.completeFlag != '3' && this.summary_check_default_summay_modifiable == 'Y') {
  713. return false;
  714. } else {
  715. return true;
  716. }
  717. default:
  718. break;
  719. }
  720. if (patientRegister.completeFlag && patientRegister.completeFlag != '3') ret = false
  721. return ret
  722. },
  723. // 诊断选择
  724. changeDiagnosis(v) {
  725. // console.log('changeDiagnosis', v)
  726. let suggestionTitle = []
  727. if (v.length == 0) {
  728. this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['suggestionTitle'] = ''
  729. return
  730. }
  731. //先找到是操作的建议行
  732. // let lv = `${v}`
  733. // let suggestionList = deepCopy(this.sumDoctorCheck.suggestionList)
  734. // suggestionList.forEach(e => {
  735. // e.diagnosisIds = `${e.diagnosisIds}`
  736. // });
  737. // let lfind = arrayExistObj(suggestionList, 'diagnosisIds', lv)
  738. // if (lfind == -1) return
  739. // this.suggestionCurRow = lfind
  740. let sumSuggestionHeaderId = this.sumDoctorCheck.suggestionList[this.suggestionCurRow].id
  741. v.forEach(e => {
  742. let ld = arrayExistObj(this.diagnosises, 'id', e)
  743. if (ld > -1) {
  744. suggestionTitle.push(this.diagnosises[ld]["displayName"])
  745. //添加医学解释
  746. let medicalInterpretations = this.diagnosises[ld]['medicalInterpretations']
  747. if (medicalInterpretations) {
  748. if (!this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['medicalInterpretations']) {
  749. this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['medicalInterpretations'] = []
  750. }
  751. medicalInterpretations.forEach(e2 => {
  752. let lf = arrayExistObj(this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['medicalInterpretations'], "suggestionContent", e2.suggestionContent)
  753. if (lf == -1) {
  754. this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['medicalInterpretations'].push({
  755. sumSuggestionHeaderId,
  756. suggestionContent: e2.suggestionContent,
  757. displayOrder: Math.random(),
  758. })
  759. }
  760. });
  761. // 将空的医学解释删除
  762. if (this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['medicalInterpretations'].length > 0) {
  763. for (let index = this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['medicalInterpretations'].length; index > 0; index--) {
  764. let element = this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['medicalInterpretations'][index - 1];
  765. if (!element?.suggestionContent) this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['medicalInterpretations'].splice(index - 1, 1)
  766. }
  767. }
  768. }
  769. //添加常见原因
  770. let commonReasons = this.diagnosises[ld]['commonReasons']
  771. if (commonReasons) {
  772. if (!this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['commonReasons']) {
  773. this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['commonReasons'] = []
  774. }
  775. commonReasons.forEach(e2 => {
  776. let lf = arrayExistObj(this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['commonReasons'], "suggestionContent", e2.suggestionContent)
  777. if (lf == -1) {
  778. this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['commonReasons'].push({
  779. sumSuggestionHeaderId,
  780. suggestionContent: e2.suggestionContent,
  781. displayOrder: Math.random(),
  782. })
  783. }
  784. });
  785. // 将空的常见原因删除
  786. if (this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['commonReasons'].length > 0) {
  787. for (let index = this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['commonReasons'].length; index > 0; index--) {
  788. let element = this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['commonReasons'][index - 1];
  789. if (!element?.suggestionContent) this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['commonReasons'].splice(index - 1, 1)
  790. }
  791. }
  792. }
  793. //添加健康指导
  794. let healthGuidances = this.diagnosises[ld]['healthGuidances']
  795. if (healthGuidances) {
  796. if (!this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['healthGuidances']) {
  797. this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['healthGuidances'] = []
  798. }
  799. healthGuidances.forEach(e2 => {
  800. let lf = arrayExistObj(this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['healthGuidances'], "suggestionContent", e2.suggestionContent)
  801. if (lf == -1) {
  802. this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['healthGuidances'].push({
  803. sumSuggestionHeaderId,
  804. suggestionContent: e2.suggestionContent,
  805. displayOrder: Math.random(),
  806. })
  807. }
  808. });
  809. // 将空的健康指导删除
  810. if (this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['healthGuidances'].length > 0) {
  811. for (let index = this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['healthGuidances'].length; index > 0; index--) {
  812. let element = this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['healthGuidances'][index - 1];
  813. if (!element?.suggestionContent) this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['healthGuidances'].splice(index - 1, 1)
  814. }
  815. }
  816. }
  817. }
  818. });
  819. this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['diagnosisIds'] = v
  820. this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['suggestionTitle'] = `${suggestionTitle}`
  821. this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['diagnosisNames'] = `${suggestionTitle}`
  822. this.$nextTick(() => {
  823. this.$refs['tableSuggestion'].doLayout()
  824. })
  825. },
  826. // 新增综述明细
  827. addSum(index) {
  828. let id = String(new Date().getTime())
  829. this.sumDoctorCheck.summaryList[index]['details'].push({
  830. id,
  831. summaryContent: '',
  832. })
  833. this.$nextTick(() => {
  834. this.$refs[id].focus();
  835. })
  836. },
  837. //增加建议明细
  838. addSug(index, contentType) {
  839. this.suggestionCurRow = index
  840. let lcontentType = 'healthGuidances'
  841. switch (contentType) {
  842. case 0:
  843. lcontentType = 'medicalInterpretations'
  844. break;
  845. case 1:
  846. lcontentType = 'commonReasons'
  847. break;
  848. default:
  849. break;
  850. }
  851. if (!this.sumDoctorCheck.suggestionList[index][lcontentType]) this.sumDoctorCheck.suggestionList[index][lcontentType] = []
  852. this.sumDoctorCheck.suggestionList[index][lcontentType].push({
  853. sumSuggestionHeaderId: this.sumDoctorCheck.suggestionList[index].id, // 拖拽用到
  854. suggestionContent: '',
  855. displayOrder: Math.random(),
  856. })
  857. this.$nextTick(() => {
  858. this.$refs['tableSuggestion'].doLayout()
  859. })
  860. console.log('this.sumDoctorCheck.suggestionList', index, this.sumDoctorCheck.suggestionList)
  861. },
  862. //删除建议头及明细
  863. delSumHead(index) {
  864. this.$confirm("此操作将删除该记录, 是否继续?", "提示", {
  865. confirmButtonText: "是",
  866. cancelButtonText: "否",
  867. type: "warning",
  868. }).then(() => {
  869. //删除建议
  870. this.sumDoctorCheck.summaryList.splice(index, 1)
  871. }).catch((err) => {
  872. if (err == 'cancel') {
  873. console.log(`已取消 ${err}`)
  874. } else {
  875. this.$message.error(`操作失败 ${err}`)
  876. }
  877. });
  878. },
  879. //删除建议头及明细
  880. delSugHead(index) {
  881. this.$confirm("此操作将删除该记录, 是否继续?", "提示", {
  882. confirmButtonText: "是",
  883. cancelButtonText: "否",
  884. type: "warning",
  885. }).then(() => {
  886. //删除建议
  887. this.sumDoctorCheck.suggestionList.splice(index, 1)
  888. }).catch((err) => {
  889. if (err == 'cancel') {
  890. console.log(`已取消 ${err}`)
  891. } else {
  892. this.$message.error(`操作失败 ${err}`)
  893. }
  894. });
  895. },
  896. //删除/综述建议明细
  897. delSug(details, indexD) {
  898. this.$confirm("此操作将删除该记录, 是否继续?", "提示", {
  899. confirmButtonText: "是",
  900. cancelButtonText: "否",
  901. type: "warning",
  902. }).then(() => {
  903. //删除建议明细
  904. details.splice(indexD, 1);
  905. }).catch((err) => {
  906. if (err == 'cancel') {
  907. console.log(`已取消 ${err}`)
  908. } else {
  909. this.$message.error(`操作失败 ${err}`)
  910. }
  911. });
  912. },
  913. //选择组合项目
  914. rowClick(row) {
  915. console.log('rowClick row', row)
  916. let lfind = arrayExistObj(this.sumDoctorCheck.summaryList, 'id', row.sumSummaryHeaderId)
  917. if (lfind > -1) {
  918. this.sumDetails = this.sumDoctorCheck.summaryList[lfind].details
  919. this.rowDropSumDetail(row.sumSummaryHeaderId)
  920. }
  921. console.log('this.sumDetails', this.sumDetails)
  922. },
  923. //综述明细拖拽
  924. rowDropSumDetail(id) {
  925. this.$nextTick(() => {
  926. const fEl = document.getElementById(id) // document.querySelector(`#${id} tbody`) querySelector为静态方法不支持动态传参;
  927. console.log('rowDropSumDetail tbody', fEl, fEl.children) //el.childNodes,el.children
  928. const el = this.findEl(fEl, 'TBODY')
  929. console.log('rowDropSumDetail tbody', el) //el.childNodes,el.children
  930. const that = this;
  931. Sortable.create(el, {
  932. animation: 150, // ms, number 单位:ms,定义排序动画的时间
  933. //拖拽结束
  934. onEnd({ newIndex, oldIndex }) {
  935. that.isshow = false;
  936. const currRow = that.sumDetails.splice(oldIndex, 1)[0];
  937. that.sumDetails.splice(newIndex, 0, currRow);
  938. },
  939. });
  940. });
  941. },
  942. // 打开特殊符号输入
  943. openSymbols(index, colName, subIndex) {
  944. if (this.dataTransOpts.tableS.patient_register.completeFlag == '3') return
  945. this.dbclObj = { index, colName, subIndex }
  946. switch (colName) {
  947. case 'suggestionTitle':
  948. this.curResult = this.sumDoctorCheck.suggestionList[index][colName]
  949. break;
  950. default:
  951. this.curResult = this.sumDoctorCheck.suggestionList[index][colName][subIndex]['suggestionContent']
  952. break;
  953. }
  954. this.dialogWinSymbols = true
  955. this.watchSelection()
  956. },
  957. // 光标位置插入特殊符号
  958. insertSymbols(symbols) {
  959. let result = this.curResult || ''
  960. if (result) {
  961. result = result.substring(0, this.selection.start) + symbols + result.substring(this.selection.end)
  962. } else {
  963. result = symbols
  964. }
  965. this.curResult = result
  966. this.selection.start++
  967. this.selection.end++
  968. },
  969. // 获取光标位置的函数
  970. getCaretPosition() {
  971. let input = document.getElementById('resultBox');
  972. this.selection.start = input.selectionStart;
  973. this.selection.end = input.selectionEnd;
  974. // console.log('selection',this.selection)
  975. },
  976. watchSelection() {
  977. this.$nextTick(() => {
  978. let that = this
  979. let resultBox = document.getElementById('resultBox'); //用数组可以读取多个标签的元素 //.inline-input
  980. // 绑定键盘事件到文本框
  981. resultBox.addEventListener('click', function (event) {
  982. // 获取光标位置
  983. that.getCaretPosition()
  984. })
  985. resultBox.addEventListener('input', function (event) {
  986. // 获取光标位置
  987. that.getCaretPosition()
  988. })
  989. })
  990. },
  991. btnOkResult() {
  992. switch (this.dbclObj.colName) {
  993. case 'suggestionTitle':
  994. this.sumDoctorCheck.suggestionList[this.dbclObj.index][this.dbclObj.colName] = this.curResult
  995. break;
  996. default:
  997. this.sumDoctorCheck.suggestionList[this.dbclObj.index][this.dbclObj.colName][this.dbclObj.subIndex]['suggestionContent'] = this.curResult
  998. break;
  999. }
  1000. this.dialogWinSymbols = false
  1001. },
  1002. findEl(fEl, nodeName) {
  1003. let el = null
  1004. for (let i = 0; i < fEl.children.length; i++) {
  1005. console.log(fEl.children[i].nodeName)
  1006. if (fEl.children[i].nodeName == nodeName) {
  1007. el = fEl.children[i]
  1008. break
  1009. } else {
  1010. el = this.findEl(fEl.children[i], nodeName)
  1011. }
  1012. if (el) break
  1013. }
  1014. return el
  1015. },
  1016. rowClickSug0(row) {
  1017. this.rowClickSug(row, 0)
  1018. },
  1019. rowClickSug1(row) {
  1020. this.rowClickSug(row, 1)
  1021. },
  1022. rowClickSug2(row) {
  1023. // console.log('column',column.property) -- suggestionContent
  1024. this.rowClickSug(row, 2)
  1025. },
  1026. rowClickSug(row, contentType) {
  1027. let lcontentType = 'healthGuidances'
  1028. switch (contentType) {
  1029. case 0:
  1030. lcontentType = 'medicalInterpretations'
  1031. break;
  1032. case 1:
  1033. lcontentType = 'commonReasons'
  1034. break;
  1035. default:
  1036. break;
  1037. }
  1038. let lfind = arrayExistObj(this.sumDoctorCheck.suggestionList, 'id', row.sumSuggestionHeaderId)
  1039. if (lfind > -1) {
  1040. this.sugDetails = this.sumDoctorCheck.suggestionList[lfind][lcontentType]
  1041. this.rowDropSugDetail(contentType, row.sumSuggestionHeaderId)
  1042. }
  1043. // console.log('this.sumDetails', lfind, this.sugDetails)
  1044. },
  1045. //建议明细拖拽
  1046. rowDropSugDetail(contentType, id) {
  1047. this.$nextTick(() => {
  1048. const fEl = document.getElementById(`${contentType}_sug${id}`) // document.querySelector(`#${id} tbody`) querySelector为静态方法不支持动态传参;
  1049. console.log('rowDropSumDetail tbody', fEl, fEl.children) //el.childNodes,el.children
  1050. const el = this.findEl(fEl, 'TBODY')
  1051. console.log('rowDropSumDetail tbody', el) //el.childNodes,el.children
  1052. const that = this;
  1053. Sortable.create(el, {
  1054. handle: ".moveTag2",
  1055. animation: 150, // ms, number 单位:ms,定义排序动画的时间
  1056. // 拖拽结束
  1057. onEnd({ newIndex, oldIndex }) {
  1058. that.isshow = false;
  1059. const currRow = that.sugDetails.splice(oldIndex, 1)[0];
  1060. that.sugDetails.splice(newIndex, 0, currRow);
  1061. },
  1062. });
  1063. });
  1064. },
  1065. //拖拽(综述取消拖拽)
  1066. rowDrop() {
  1067. this.$nextTick(() => {
  1068. const el = document.querySelector("#tableSummary tbody");
  1069. console.log('tbody', el)
  1070. const that = this;
  1071. Sortable.create(el, {
  1072. animation: 150, // ms, number 单位:ms,定义排序动画的时间
  1073. //拖拽结束
  1074. onEnd({ newIndex, oldIndex }) {
  1075. that.isshow = false;
  1076. const currRow = that.sumDoctorCheck.summaryList.splice(oldIndex, 1)[0];
  1077. that.sumDoctorCheck.summaryList.splice(newIndex, 0, currRow);
  1078. },
  1079. });
  1080. });
  1081. },
  1082. //拖拽
  1083. rowDropSuggestion() {
  1084. this.$nextTick(() => {
  1085. const el = document.querySelector("#tableSuggestion tbody");
  1086. console.log('tbody', el)
  1087. const that = this;
  1088. Sortable.create(el, {
  1089. handle: ".moveTag",
  1090. animation: 150, // ms, number 单位:ms,定义排序动画的时间
  1091. //拖拽结束
  1092. onEnd({ newIndex, oldIndex }) {
  1093. that.isshow = false;
  1094. const currRow = that.sumDoctorCheck.suggestionList.splice(oldIndex, 1)[0];
  1095. that.sumDoctorCheck.suggestionList.splice(newIndex, 0, currRow);
  1096. },
  1097. });
  1098. });
  1099. },
  1100. // 右击复制粘贴
  1101. // 依次为:撤销、重做、剪切、复制、粘贴、删除、全选、非选
  1102. // undo: () => Promise<any>;
  1103. // redo: () => Promise<any>;
  1104. // cut: () =>Promise<any>;
  1105. // copy: () => Promise<any>;
  1106. // paste: () => Promise<any>;
  1107. // delete: () => Promise<any>;
  1108. // selectAll: () => Promise<any>;
  1109. // unselect: () => Promise<any>;
  1110. onContextmenu(event) {
  1111. if (!this.$peisAPI) {
  1112. return
  1113. }
  1114. console.log('this.$peisAPI.contextMenuForPeis()')
  1115. this.$peisAPI.contextMenuForPeis()
  1116. .then(res => {
  1117. console.log('res', res)
  1118. })
  1119. .catch(err => {
  1120. console.log('err', err)
  1121. })
  1122. .finally(() => {
  1123. console.log('finally')
  1124. })
  1125. /*
  1126. let items = [
  1127. {
  1128. label: "复制",
  1129. onClick: () => {
  1130. console.log('this.$peisAPI.copy()')
  1131. this.$peisAPI.copy()
  1132. .then(res => {
  1133. console.log('res', res)
  1134. })
  1135. .catch(err => {
  1136. console.log('err', err)
  1137. })
  1138. .finally(() => {
  1139. console.log('finally')
  1140. })
  1141. },
  1142. }, {
  1143. label: "剪切",
  1144. onClick: () => {
  1145. console.log('this.$peisAPI.cut()')
  1146. this.$peisAPI.cut()
  1147. .then(res => {
  1148. console.log('res', res)
  1149. })
  1150. .catch(err => {
  1151. console.log('err', err)
  1152. })
  1153. .finally(() => {
  1154. console.log('finally')
  1155. })
  1156. },
  1157. }, {
  1158. label: "粘贴",
  1159. onClick: () => {
  1160. console.log('this.$peisAPI.paste()')
  1161. this.$peisAPI.paste()
  1162. .then(res => {
  1163. console.log('res', res)
  1164. })
  1165. .catch(err => {
  1166. console.log('err', err)
  1167. })
  1168. .finally(() => {
  1169. console.log('finally')
  1170. })
  1171. },
  1172. }
  1173. ]
  1174. this.$contextmenu({
  1175. items,
  1176. event,
  1177. x: event.clientX,
  1178. y: event.clientY,
  1179. customClass: "custom-class",
  1180. zIndex: 3,
  1181. minWidth: 80,
  1182. });
  1183. */
  1184. }
  1185. },
  1186. //监听事件
  1187. watch: {
  1188. // 虚拟表 人员更换时,综述建议一定刷新
  1189. "dataTransOpts.tableS.patient_register.id": {
  1190. // immediate:true,
  1191. handler(newVal, oldVal) {
  1192. console.log(`watch 总检--综述建议patient_register.id newVal: ${newVal}, oldVal: ${oldVal} patientRegisterId: ${this.dataTransOpts.tableS.patient_register.id}`);
  1193. if (newVal != oldVal && this.tabChoosed != '1') this.getHaveSumData(this.dataTransOpts.tableS.patient_register.id)
  1194. }
  1195. },
  1196. // 虚拟表 触发强制刷新 (sumDoctor.M 合并包含:综述、建议、对比、历史等,不包含总检诊断)
  1197. "dataTransOpts.refresh.sumDoctor.M": {
  1198. // immediate:true,
  1199. handler(newVal, oldVal) {
  1200. console.log(`watch 总检--综述建议sumDoctor.M newVal: ${newVal}, oldVal: ${oldVal} patientRegisterId: ${this.dataTransOpts.tableS.patient_register.id}`);
  1201. if (newVal != oldVal && this.tabChoosed == '1') this.getHaveSumData(this.dataTransOpts.tableS.patient_register.id)
  1202. }
  1203. },
  1204. },
  1205. };
  1206. </script>
  1207. <style scoped>
  1208. @import '../../assets/css/global_table.css';
  1209. @import '../../assets/css/global.css';
  1210. ::v-deep .el-icon-search:before {
  1211. color: #00F;
  1212. }
  1213. /* 设置单元格内内容顶对齐 */
  1214. ::v-deep .el-table__cell {
  1215. display: table-cell;
  1216. /* 使单元格表现为表格单元 */
  1217. vertical-align: top;
  1218. /* 顶对齐 el-table_2_column_2 el-table__cell */
  1219. }
  1220. ::v-deep .el-textarea__inner {
  1221. min-height: 23px;
  1222. height: 23px;
  1223. line-height: 1.25;
  1224. padding: 1px 15px 1px 2px;
  1225. }
  1226. ::v-deep .el-table__empty-text {
  1227. line-height: 22px;
  1228. }
  1229. ::v-deep .el-tag {
  1230. color: black;
  1231. padding: 0 5px;
  1232. font-size: 14px;
  1233. }
  1234. ::v-deep .el-table__empty-block {
  1235. min-height: 22px;
  1236. }
  1237. ::v-deep .el-input__inner {
  1238. min-height: 23px;
  1239. height: 23px;
  1240. padding: 1px 15px 1px 2px;
  1241. }
  1242. ::v-deep .commonFont .el-textarea__inner {
  1243. font-family: "Microsoft YaHei";
  1244. }
  1245. ::v-deep .diagnosisSelect .el-select-dropdown__wrap {
  1246. background-color: #FFF;
  1247. max-height: 288px;
  1248. }
  1249. </style>