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.

324 lines
12 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <div style="display: flex;">
  3. <div :style="`width: 258px;height:${mainHeight}px;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:${mainHeight - 40}px;`" :data="pacsTemplateTree"
  9. :props="treeprops" @node-click="handleNode" :filter-node-method="filterNode" :expand-on-click-node="false"
  10. highlight-current ref="ref_tree">
  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:${window.pageWidth - 200 - 30}px; margin-left: 5px;`">
  25. <div style="display: flex;">
  26. <div :style="`width: ${window.pageWidth - 200 - 30 - 250}px;`">
  27. <el-table :data="description" border :height="tableHeight" highlight-current-row
  28. @selection-change="selectionChangeDes" size="small" ref="ref_description">
  29. <el-table-column type="selection" width="40" align="center" />
  30. <el-table-column prop="description" label="描述" min-width="400" />
  31. <el-table-column prop="conclusion" label="结论" min-width="150" align="center" />
  32. </el-table>
  33. </div>
  34. <div style="width: 240px;margin-left: 5px;">
  35. <el-table :data="conclusionAll" border :height="tableHeight" highlight-current-row
  36. @selection-change="selectionChangeCon" size="small" ref="ref_conclusion">
  37. <el-table-column type="selection" width="40" align="center" />
  38. <el-table-column prop="conclusion" label="结论" min-width="150" />
  39. </el-table>
  40. </div>
  41. </div>
  42. <div style="margin-top: 5px;">
  43. <span>检查结果</span>
  44. <el-input style="width: 100%;" type="textarea" v-model="result" placeholder="请输入描述"
  45. :autosize="{ minRows: 6, maxRows: 6 }" />
  46. </div>
  47. <div style="margin-top: 5px;">
  48. <span>检查结论</span>
  49. <div style="display: flex;justify-content: space-between;">
  50. <el-input style="width: 100%;" type="textarea" v-model="summary" placeholder="请输入结论"
  51. :autosize="{ minRows: 4, maxRows: 4 }" />
  52. </div>
  53. </div>
  54. <div style="display: flex;justify-content: space-between;margin-top: 10px;">
  55. <div></div>
  56. <div>
  57. <el-button type="primary" @click="btnTest" class="commonbutton">测试</el-button>
  58. <el-button type="primary" @click="btnClear" class="commonbutton">清除</el-button>
  59. <el-button type="primary" @click="btnDefault" class="commonbutton">默认结果</el-button>
  60. <el-button type="primary" @click="btnOk" class="commonbutton">确定</el-button>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </template>
  66. <script>
  67. import moment from "moment";
  68. import { mapState } from "vuex";
  69. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  70. import { hadoopGet, hadoopPost, hadoopPut, hadoopDel } from "../../api/hadoopApi"
  71. import { arrayReduce, arrayExistObj, deepCopy, reMadeOrgTree } from "../../utlis/proFunc";
  72. import { getTreePids, getTreeAllChildIdsById, madeTree } from "../../utlis/tree";
  73. export default {
  74. components: {},
  75. props: ["useCustomerOrg", "initDateType", "isUnit"],
  76. data() {
  77. return {
  78. filterText: '',
  79. description: [], // 描述
  80. conclusion: [], // 结论
  81. descriptionChoosedPre: [], // 前次选中
  82. descriptionChoosed: [], // 所有选中的描述的集合,切换部位时可用于描述初始化选择
  83. conclusionChoosed: [], // 选中的结论
  84. conclusionAll: [], // 所有选中的描述,对应的结论
  85. result: '', // 检查结果
  86. summary: '', // 小结
  87. pacsTemplateTree: [], //类别 + 模板树
  88. treeprops: {
  89. label: "displayName", // label/displayName
  90. value: "id",
  91. id: "id",
  92. children: "children",
  93. }, //树形组件的数据结构
  94. newQuery: 0, // 0 表示新查询,新查询不执行 selectionChangeDes 的取消查询动作
  95. };
  96. },
  97. //<el-tree :data="$store.state.customerOrg.ref_tree" :props="$store.state.customerOrg.treeprops" @node-click="treeclick"></el-tree>
  98. computed: {
  99. ...mapState(["dict", "window", "customerOrg", "patientRegister", "report", "diagnosis", "project"]),
  100. mainHeight() {
  101. return this.window.pageHeight - 78;
  102. },
  103. tableHeight() {
  104. return this.mainHeight - 120 - 80 - 80;
  105. },
  106. },
  107. //创建组件后
  108. created() {
  109. },
  110. //挂载组件完成
  111. mounted() {
  112. //获取体检单位列表树信息
  113. this.getPacsTemplateTree();
  114. },
  115. methods: {
  116. //树过滤
  117. filterNode(value, data) {
  118. //console.log(value,data)
  119. if (!value) return true;
  120. return data['displayName'].indexOf(value) > -1;
  121. },
  122. //获取pacs结果模板
  123. getPacsTemplateTree() {
  124. let resultType = [], resultTemplate = [], treeData = []
  125. postapi('/api/app/BigtextResultType/GetList')
  126. .then(res => {
  127. if (res.code > -1) {
  128. resultType = res.data
  129. return postapi('/api/app/BigtextResultTemplate/GetList', {})
  130. }
  131. })
  132. .then(res => {
  133. if (res && res.code > -1) {
  134. res.data.forEach(e => {
  135. resultTemplate.push(Object.assign({}, e, { parentId: e.bigtextResultTypeId }))
  136. });
  137. treeData = resultType.concat(resultTemplate)
  138. // console.log('treeData',treeData,resultType,)
  139. this.pacsTemplateTree = madeTree(treeData, "children", "parentId", "id", null)
  140. }
  141. })
  142. },
  143. //点击树节点
  144. handleNode(data, node, prop) {
  145. let ids = getTreeAllChildIdsById(this.pacsTemplateTree, "children", "id", data.id)
  146. ids.unshift(data.id) // 加入自身节点
  147. hadoopPost('pacsApi','/api/app/BigtextResultTemplate/GetBigtextResultTemplateDetail', { bigtextResultTemplateIds: ids })
  148. .then(res => {
  149. if (res.code > -1) {
  150. this.newQuery = 0
  151. this.description = res.data.descriptionDetail
  152. this.conclusion = res.data.conclusionDetail
  153. let lfind = -1
  154. this.description.forEach((e, i) => {
  155. let conclusion = this.conclusion.filter(c => {
  156. return c.bigtextResultTemplateId == e.bigtextResultTemplateId
  157. })
  158. e["conclusion"] = ""
  159. e["conclusionList"] = []
  160. conclusion.forEach(c => {
  161. e["conclusionList"].push(c)
  162. });
  163. if (conclusion.length == 1) e["conclusion"] = conclusion[0].conclusion
  164. // 初始选中状态
  165. lfind = arrayExistObj(this.descriptionChoosed, "description", e.description)
  166. if (lfind > -1) {
  167. // console.log('this.descriptionChoosed refresh', deepCopy(this.descriptionChoosed))
  168. this.$nextTick(() => {
  169. this.$refs['ref_description'].toggleRowSelection(this.description[i],true)
  170. })
  171. }
  172. });
  173. }
  174. })
  175. },
  176. // 选择描述
  177. selectionChangeDes(v) {
  178. this.newQuery++
  179. let lfind = 0
  180. v.forEach(e => {
  181. lfind = arrayExistObj(this.descriptionChoosed, "description", e.description)
  182. if (lfind == -1) {
  183. this.descriptionChoosed.push(e)
  184. }
  185. e.conclusionList.forEach(c => {
  186. lfind = arrayExistObj(this.conclusionAll, "conclusion", c.conclusion)
  187. if (lfind == -1) this.conclusionAll.push(c)
  188. });
  189. // 单个结论时,直接选中结论,多个则将结论添加至待选结论
  190. if (e.conclusion) {
  191. lfind = arrayExistObj(this.conclusionAll, "conclusion", e.conclusion)
  192. // console.log(lfind, e)
  193. if (lfind > -1) {
  194. this.$refs['ref_conclusion'].toggleRowSelection(this.conclusionAll[lfind], true)
  195. }
  196. }
  197. if (this.result) {
  198. if (!this.result.includes(e.description)) this.result += ';' + e.description
  199. } else {
  200. this.result = e.description
  201. }
  202. });
  203. // 这一次没选中的在上一次的选中当中,说明取消选择
  204. if (this.newQuery > 1) {
  205. let unChooseed = arrayReduce(deepCopy(this.description), v, "description=description")
  206. // console.log('this.descriptionChoosedPre,unChooseed', deepCopy(this.descriptionChoosedPre), unChooseed)
  207. unChooseed.forEach(e => {
  208. lfind = arrayExistObj(this.descriptionChoosedPre, "description", e.description)
  209. if (lfind > -1) {
  210. lfind = arrayExistObj(this.descriptionChoosed, "description", e.description)
  211. if (lfind > -1) this.descriptionChoosed.splice(lfind, 1)
  212. if (this.result.includes(e.description)) this.result = this.result.replaceAll(e.description + ";", "").replaceAll(e.description, "")
  213. if (e.conclusion) {
  214. lfind = arrayExistObj(this.conclusionAll, "conclusion", e.conclusion)
  215. if (lfind > -1) this.$refs['ref_conclusion'].toggleRowSelection(this.conclusionAll[lfind], false)
  216. }
  217. }
  218. });
  219. }
  220. this.descriptionChoosedPre = deepCopy(v)
  221. if(this.result){
  222. if(this.result.substring(this.result.length - 1,this.result.length) == ";") this.result = this.result.substring(0,this.result.length - 1)
  223. }
  224. },
  225. // 选择结论(取消选择)
  226. selectionChangeCon(v) {
  227. let summarys = []
  228. v.forEach(e => {
  229. if (this.summary) {
  230. summarys = this.summary.split(";")
  231. if (summarys.indexOf(e.conclusion) == -1) this.summary += ';' + e.conclusion
  232. } else {
  233. this.summary = e.conclusion
  234. }
  235. });
  236. // if(this.summary && this.summary.substring())
  237. // 取消选择时
  238. let lfind = -1
  239. let unChooseed = arrayReduce(deepCopy(this.conclusionAll), v, "conclusion=conclusion")
  240. unChooseed.forEach(e => {
  241. if (this.summary) {
  242. summarys = this.summary.split(";")
  243. lfind = summarys.indexOf(e.conclusion)
  244. if (lfind > -1) summarys.splice(lfind, 1)
  245. this.summary = ''
  246. summarys.forEach((c, i) => {
  247. if (i == 0) {
  248. this.summary = c
  249. } else {
  250. this.summary += ";" + c
  251. }
  252. });
  253. }
  254. });
  255. },
  256. btnTest() {
  257. console.log('this.descriptionChoosed', this.descriptionChoosed)
  258. console.log('this.conclusionChoosed', this.conclusionChoosed)
  259. },
  260. // 清除所选描述与结论
  261. btnClear() {
  262. this.result = ''
  263. this.summary = ''
  264. this.descriptionChoosed = []
  265. this.$refs['ref_description'].clearSelection();
  266. this.conclusionChoosed = []
  267. this.conclusionAll = []
  268. this.$refs['ref_conclusion'].clearSelection();
  269. },
  270. // 默认结果
  271. btnDefault() {
  272. },
  273. // 确定
  274. btnOk() {
  275. this.dialogWin.PacsTemplate = false
  276. },
  277. },
  278. watch: {
  279. "filterText"(newVal, oldVal) {
  280. if (newVal != oldVal) this.$refs['ref_tree'].filter(newVal);
  281. }
  282. },
  283. };
  284. </script>
  285. <style lang="scss" scoped>
  286. @import "../../assets/css/global_dialog.css";
  287. @import "../../assets/css/global_table.css";
  288. @import "../../assets/css/global_input.css";
  289. @import "../../assets/css/global.css";
  290. @import "../../assets/css/global_tree.css";
  291. :deep .el-tree-node>.el-tree-node__children {
  292. overflow: visible;
  293. }
  294. </style>