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.

275 lines
8.6 KiB

1 year ago
  1. <template>
  2. <div style="display: flex;">
  3. <div :style="`width: 220px;height:550px;border: 1px solid #EEE;`">
  4. <div style="margin:2px 2px 2px 2px;">
  5. <el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small" />
  6. </div>
  7. <div>
  8. <el-tree :style="`overflow: scroll;width: 200px;height:510px;`" :data="pacsTemplateTree"
  9. :props="treeprops" :filter-node-method="filterNode" :expand-on-click-node="false"
  10. highlight-current ref="ref_tree" show-checkbox default-expand-all @check-change="handleCheckChange" >
  11. <span class="custom-tree-node" slot-scope="{ node, data }">
  12. <div>
  13. <span class="treeicons">
  14. <img style="width:20px;height:20px;vertical-align: sub;" src="@/assets/images/order.png"
  15. v-if="!data.parentId" />
  16. </span>
  17. <span :class="!data.parentId ? 'maxtitle' : 'mintitle'">{{ node.label }}
  18. </span>
  19. </div>
  20. </span>
  21. </el-tree>
  22. </div>
  23. </div>
  24. <div :style="`display: block;width:620px; margin-left: 5px;`">
  25. <div>
  26. <span>检查结果</span>
  27. <el-input style="width: 100%;" type="textarea" v-model="result" placeholder="请输入描述"
  28. :autosize="{ minRows: decLineCount, maxRows: decLineCount }" />
  29. </div>
  30. <div style="margin-top: 5px;">
  31. <span>检查结论</span>
  32. <div style="display: flex;justify-content: space-between;">
  33. <el-input style="width: 100%;" type="textarea" v-model="summary" placeholder="请输入结论"
  34. :autosize="{ minRows: conLineCount, maxRows: conLineCount }" />
  35. </div>
  36. </div>
  37. <div style="display: flex;justify-content: space-between;margin-top: 10px;">
  38. <div></div>
  39. <div>
  40. <!--
  41. <el-button type="primary" @click="btnTest" class="commonbutton">测试</el-button>
  42. -->
  43. <el-button type="primary" @click="btnClear" class="commonbutton">清除</el-button>
  44. <el-button type="primary" @click="btnDefault" class="commonbutton">默认结果</el-button>
  45. <el-button type="primary" @click="btnOk" class="commonbutton">确定</el-button>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </template>
  51. <script>
  52. import moment from "moment";
  53. import { mapState } from "vuex";
  54. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  55. import { hadoopGet, hadoopPost, hadoopPut, hadoopDel } from "../../api/hadoopApi"
  56. import { arrayReduce, arrayExistObj, deepCopy, reMadeOrgTree } from "../../utlis/proFunc";
  57. import { getTreePids, getTreeAllChildIdsById, madeTree } from "../../utlis/tree";
  58. export default {
  59. components: {},
  60. props: ["refParams", "refFuncOther"],
  61. data() {
  62. return {
  63. filterText: '',
  64. description: [], // 描述
  65. conclusion: [], // 结论
  66. descriptionChoosedPre: [], // 前次选中
  67. descriptionChoosed: [], // 所有选中的描述的集合,切换部位时可用于描述初始化选择
  68. conclusionChoosed: [], // 选中的结论
  69. conclusionAll: [], // 所有选中的描述,对应的结论
  70. result: '', // 检查结果
  71. summary: '', // 小结
  72. pacsTemplateTree: [], //类别 + 模板树
  73. treeprops: {
  74. label: "displayName", // label/displayName
  75. value: "id",
  76. id: "id",
  77. children: "children",
  78. }, //树形组件的数据结构
  79. };
  80. },
  81. //<el-tree :data="$store.state.customerOrg.ref_tree" :props="$store.state.customerOrg.treeprops" @node-click="treeclick"></el-tree>
  82. computed: {
  83. ...mapState(["window", "dialogWin","doctorCheck"]),
  84. mainHeight() {
  85. return this.window.pageHeight - 118;
  86. },
  87. tableHeight() {
  88. return this.mainHeight - 120 - 80 - 80;
  89. },
  90. decLineCount(){
  91. return this.refParams.from == 'dcm' ? 14:16
  92. },
  93. conLineCount(){
  94. return this.refParams.from == 'dcm' ? 7:8
  95. }
  96. },
  97. //创建组件后
  98. created() {
  99. },
  100. //挂载组件完成
  101. mounted() {
  102. //获取体检单位列表树信息
  103. this.getPacsTemplateTree();
  104. this.init()
  105. },
  106. methods: {
  107. // 初始化数据
  108. init() {
  109. this.btnClear()
  110. this.description = []
  111. this.result = this.refParams.result || ''
  112. this.summary = this.refParams.summary || ''
  113. console.log('init')
  114. },
  115. //勾选节点
  116. handleCheckChange(data, checked, indeterminate) {
  117. // console.log('data, checked, indeterminate,this.menuInfoSet',data, checked, indeterminate,this.menuInfoSet);
  118. this.description = []
  119. this.conclusion = []
  120. postapi('/api/app/BigtextResultTemplate/GetBigtextResultTemplateDetail', { bigtextResultTemplateIds: [data.id] })
  121. .then(res => {
  122. if (res.code > -1) {
  123. this.description = res.data.descriptionDetail
  124. this.conclusion = res.data.conclusionDetail
  125. let opraType = false
  126. if(checked){
  127. // 勾选
  128. opraType = true
  129. }else if(!indeterminate){
  130. // 取消勾选
  131. opraType = false
  132. }
  133. this.chooseDescription(opraType)
  134. this.chooseConclusion(opraType)
  135. }
  136. });
  137. },
  138. //树过滤
  139. filterNode(value, data) {
  140. //console.log(value,data)
  141. if (!value) return true;
  142. return data['displayName'].indexOf(value) > -1 || data['simpleCode'].indexOf(value.toUpperCase()) > -1;
  143. },
  144. // 选择true或取消false 描述
  145. chooseDescription(opraType){
  146. let bfind = false
  147. this.description.forEach(e => {
  148. bfind = this.result.includes(e.description)
  149. if(opraType){
  150. if(!bfind){
  151. if(this.result){
  152. this.result += ";" + e.description
  153. }else{
  154. this.result = e.description
  155. }
  156. }
  157. }else{
  158. if(bfind) this.result = this.result.replaceAll(e.description + ';','').replaceAll(e.description,'')
  159. }
  160. });
  161. },
  162. // 选择true或取消false 描述
  163. chooseConclusion(opraType){
  164. let lfind = 0
  165. let summarys = this.summary.split(';')
  166. this.conclusion.forEach(e => {
  167. lfind = summarys.indexOf(e.conclusion)
  168. if(opraType){
  169. if(lfind == -1) summarys.push(e.conclusion)
  170. }else{
  171. if(lfind > -1) summarys.splice(lfind,1)
  172. }
  173. });
  174. let summary = ''
  175. summarys.forEach(e => {
  176. if(summary){
  177. summary += ';' + e
  178. }else{
  179. summary = e
  180. }
  181. });
  182. this.summary = summary
  183. },
  184. //获取pacs结果模板
  185. getPacsTemplateTree() {
  186. let resultType = [], resultTemplate = [], treeData = []
  187. postapi('/api/app/BigtextResultType/GetList',{
  188. itemTypeId:this.refParams.row.itemTypeId
  189. })
  190. .then(res => {
  191. if (res.code > -1) {
  192. resultType = res.data
  193. resultType.forEach(e => {
  194. e.disabled = true
  195. });
  196. return postapi('/api/app/BigtextResultTemplate/GetList',{})
  197. }
  198. })
  199. .then(res => {
  200. if (res && res.code > -1) {
  201. res.data.forEach(e => {
  202. resultTemplate.push(Object.assign({}, e, { parentId: e.bigtextResultTypeId }))
  203. });
  204. treeData = resultType.concat(resultTemplate)
  205. // console.log('treeData',treeData,resultType,)
  206. this.pacsTemplateTree = madeTree(treeData, "children", "parentId", "id", null)
  207. }
  208. })
  209. },
  210. btnTest() {
  211. console.log('this.descriptionChoosed', this.descriptionChoosed)
  212. console.log('this.conclusionChoosed', this.conclusionChoosed)
  213. },
  214. // 清除所选描述与结论
  215. btnClear() {
  216. console.log('btnClear')
  217. this.result = ''
  218. this.summary = ''
  219. },
  220. // 默认结果
  221. btnDefault() {
  222. this.btnClear()
  223. this.result = this.refParams.row.defaultResult
  224. this.summary = '未见异常'
  225. },
  226. // 确定
  227. btnOk() {
  228. this.refFuncOther(this.refParams.row, this.refParams.index, { result: this.result, summary: this.summary })
  229. this.dialogWin.PacsTemplate = false
  230. },
  231. },
  232. watch: {
  233. "filterText"(newVal, oldVal) {
  234. if (newVal != oldVal) this.$refs['ref_tree'].filter(newVal);
  235. },
  236. "refParams.refresh"(newVal, oldVal) {
  237. if (newVal && newVal != oldVal) this.init();
  238. },
  239. },
  240. };
  241. </script>
  242. <style lang="scss" scoped>
  243. @import "../../assets/css/global_dialog.css";
  244. @import "../../assets/css/global_table.css";
  245. @import "../../assets/css/global_input.css";
  246. @import "../../assets/css/global.css";
  247. @import "../../assets/css/global_tree.css";
  248. :deep .el-tree-node>.el-tree-node__children {
  249. overflow: visible;
  250. }
  251. </style>