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.

339 lines
11 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 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 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: 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" :props="treeprops"
  9. :filter-node-method="filterNode" :expand-on-click-node="false" highlight-current ref="ref_tree" show-checkbox
  10. 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. <!-- 多个检查明细 -->
  27. <div>
  28. <span>检查结果</span>
  29. <el-radio-group v-model="tabPosition">
  30. <el-radio :label="'top'">横排</el-radio>
  31. <el-radio :label="'left'">纵排</el-radio>
  32. </el-radio-group>
  33. </div>
  34. <el-tabs :tab-position="tabPosition" v-model="tabChoosed">
  35. <el-tab-pane v-for="(item, seq) in doctorCheck.checkItemList" :label="dispLabel(item.itemName)" :name="seq + ''"
  36. :key="seq">
  37. <el-input style="width: 100%;" type="textarea" v-model="item.result" placeholder="请输入检查结果"
  38. :autosize="{ minRows: decLineCount, maxRows: decLineCount }" />
  39. <div style="display: flex;justify-content: space-between;">
  40. <div></div>
  41. <div>
  42. <el-tooltip :content="`给 ${item.itemName} 项目,赋默认结果`" placement="top">
  43. <i class="el-icon-edit" @click="btnDefResult(seq)"
  44. style="font-size: 18px;color: blue;cursor:pointer;margin-right: 10px;"></i>
  45. </el-tooltip>
  46. <el-tooltip :content="`清除 ${item.itemName} 项目的检查结果`" placement="top">
  47. <i class="el-icon-delete" @click="btnClear(seq)"
  48. style="font-size: 18px;color: red;cursor:pointer;margin-right: 10px;"></i>
  49. </el-tooltip>
  50. </div>
  51. </div>
  52. </el-tab-pane>
  53. </el-tabs>
  54. </div>
  55. <div style="margin-top: 5px;">
  56. <span>检查结论</span>
  57. <div style="display: flex;justify-content: space-between;">
  58. <el-input style="width: 100%;" type="textarea" v-model="summary" placeholder="请输入结论"
  59. :autosize="{ minRows: conLineCount, maxRows: conLineCount }" />
  60. </div>
  61. </div>
  62. <div style="display: flex;justify-content: space-between;margin-top: 10px;">
  63. <div></div>
  64. <div>
  65. <!--
  66. <el-button type="primary" @click="btnTest" class="commonbutton">测试</el-button>
  67. -->
  68. <el-tooltip content="清除所有检查项目描述及结论" placement="top">
  69. <el-button type="primary" @click="btnClearAll" class="commonbutton">清除</el-button>
  70. </el-tooltip>
  71. <el-tooltip content="所有检查项目赋默认描述及结论" placement="top">
  72. <el-button type="primary" @click="btnDefault" class="commonbutton">默认结果</el-button>
  73. </el-tooltip>
  74. <el-button type="primary" @click="btnOk" class="commonbutton">确定</el-button>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </template>
  80. <script>
  81. import moment from "moment";
  82. import { mapState } from "vuex";
  83. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  84. import { hadoopGet, hadoopPost, hadoopPut, hadoopDel } from "../../api/hadoopApi"
  85. import { arrayReduce, arrayExistObj, deepCopy, reMadeOrgTree } from "../../utlis/proFunc";
  86. import { getTreePids, getTreeAllChildIdsById, madeTree } from "../../utlis/tree";
  87. export default {
  88. components: {},
  89. props: ["refParams", "refFuncOther"],
  90. data() {
  91. return {
  92. filterText: '',
  93. description: [], // 描述
  94. conclusion: [], // 结论
  95. descriptionChoosedPre: [], // 前次选中
  96. descriptionChoosed: [], // 所有选中的描述的集合,切换部位时可用于描述初始化选择
  97. conclusionChoosed: [], // 选中的结论
  98. conclusionAll: [], // 所有选中的描述,对应的结论
  99. result: '', // 检查结果
  100. summary: '', // 小结
  101. pacsTemplateTree: [], //类别 + 模板树
  102. treeprops: {
  103. label: "displayName", // label/displayName
  104. value: "id",
  105. id: "id",
  106. children: "children",
  107. }, //树形组件的数据结构
  108. tabChoosed: "0",
  109. tabPosition: "top", // 多个明细检查排列方式
  110. };
  111. },
  112. //<el-tree :data="$store.state.customerOrg.ref_tree" :props="$store.state.customerOrg.treeprops" @node-click="treeclick"></el-tree>
  113. computed: {
  114. ...mapState(["window", "dialogWin", "doctorCheck"]),
  115. mainHeight() {
  116. return this.window.pageHeight - 118;
  117. },
  118. tableHeight() {
  119. return this.mainHeight - 120 - 80 - 80;
  120. },
  121. decLineCount() {
  122. return this.refParams.from == 'dcm' ? 14 : 16
  123. },
  124. conLineCount() {
  125. return this.refParams.from == 'dcm' ? 7 : 8
  126. }
  127. },
  128. //创建组件后
  129. created() {
  130. },
  131. //挂载组件完成
  132. mounted() {
  133. //获取体检单位列表树信息
  134. this.getPacsTemplateTree();
  135. this.init()
  136. },
  137. methods: {
  138. // 初始化数据
  139. init() {
  140. this.description = []
  141. this.result = this.refParams.result || ''
  142. this.summary = this.refParams.summary || ''
  143. this.tabChoosed = this.refParams.index + ''
  144. this.tabPosition = this.doctorCheck.checkItemList.length > 5 ? 'left' : 'top'
  145. console.log('init')
  146. },
  147. // 显示tab标签名称,过长处理
  148. dispLabel(itemName) {
  149. return itemName.length > 5 ? (itemName.substring(0, 4) + "…") : itemName
  150. },
  151. //勾选节点
  152. handleCheckChange(data, checked, indeterminate) {
  153. // console.log('data, checked, indeterminate,this.menuInfoSet',data, checked, indeterminate,this.menuInfoSet);
  154. this.description = []
  155. this.conclusion = []
  156. postapi('/api/app/BigtextResultTemplate/GetBigtextResultTemplateDetail', { bigtextResultTemplateIds: [data.id] })
  157. .then(res => {
  158. if (res.code > -1) {
  159. this.description = res.data.descriptionDetail
  160. this.conclusion = res.data.conclusionDetail
  161. let opraType = false
  162. if (checked) {
  163. // 勾选
  164. opraType = true
  165. } else if (!indeterminate) {
  166. // 取消勾选
  167. opraType = false
  168. }
  169. this.chooseDescription(opraType)
  170. this.chooseConclusion(opraType)
  171. }
  172. });
  173. },
  174. //树过滤
  175. filterNode(value, data) {
  176. //console.log(value,data)
  177. if (!value) return true;
  178. return data['displayName'].indexOf(value) > -1 || data['simpleCode'].indexOf(value.toUpperCase()) > -1;
  179. },
  180. // 选择true或取消false 描述
  181. chooseDescription(opraType) {
  182. let bfind = false
  183. let result = this.doctorCheck.checkItemList[parseInt(this.tabChoosed)].result
  184. this.description.forEach(e => {
  185. bfind = result.includes(e.description)
  186. if (opraType) {
  187. if (!bfind) {
  188. if (result) {
  189. if(result == this.doctorCheck.checkItemList[parseInt(this.tabChoosed)].defaultResult){
  190. result = e.description
  191. }else{
  192. result += ";" + e.description
  193. }
  194. } else {
  195. result = e.description
  196. }
  197. }
  198. } else {
  199. if (bfind) result = result.replaceAll(e.description + ';', '').replaceAll(e.description, '')
  200. }
  201. });
  202. // 去掉 最后的 ;
  203. if (result.substring(result.length - 1) == ';') {
  204. result = result.substring(0, result.length - 1)
  205. }
  206. this.doctorCheck.checkItemList[parseInt(this.tabChoosed)].result = result
  207. },
  208. // 选择true或取消false 描述
  209. chooseConclusion(opraType) {
  210. let lfind = 0
  211. let summarys = this.summary.split(';')
  212. this.conclusion.forEach(e => {
  213. lfind = summarys.indexOf(e.conclusion)
  214. if (opraType) {
  215. if (lfind == -1) summarys.push(e.conclusion)
  216. } else {
  217. if (lfind > -1) summarys.splice(lfind, 1)
  218. }
  219. });
  220. let summary = ''
  221. summarys.forEach(e => {
  222. if (summary) {
  223. summary += ';' + e
  224. } else {
  225. summary = e
  226. }
  227. });
  228. this.summary = summary
  229. },
  230. //获取pacs结果模板
  231. getPacsTemplateTree() {
  232. let resultType = [], resultTemplate = [], treeData = []
  233. postapi('/api/app/BigtextResultType/GetList', {
  234. itemTypeId: this.refParams.row.itemTypeId
  235. })
  236. .then(res => {
  237. if (res.code > -1) {
  238. resultType = res.data
  239. resultType.forEach(e => {
  240. e.disabled = true
  241. });
  242. return postapi('/api/app/BigtextResultTemplate/GetList', {})
  243. }
  244. })
  245. .then(res => {
  246. if (res && res.code > -1) {
  247. res.data.forEach(e => {
  248. resultTemplate.push(Object.assign({}, e, { parentId: e.bigtextResultTypeId }))
  249. });
  250. treeData = resultType.concat(resultTemplate)
  251. // console.log('treeData',treeData,resultType,)
  252. this.pacsTemplateTree = madeTree(treeData, "children", "parentId", "id", null)
  253. }
  254. })
  255. },
  256. btnTest() {
  257. console.log('this.descriptionChoosed', this.descriptionChoosed)
  258. console.log('this.conclusionChoosed', this.conclusionChoosed)
  259. },
  260. // 清除所有描述与结论
  261. btnClearAll() {
  262. this.doctorCheck.checkItemList.forEach(e => {
  263. e.result = ''
  264. });
  265. this.summary = ''
  266. },
  267. // 清除结果
  268. btnClear(seq) {
  269. this.doctorCheck.checkItemList[seq].result = ''
  270. },
  271. // 默认结果
  272. btnDefResult(seq) {
  273. this.doctorCheck.checkItemList[seq].result = this.doctorCheck.checkItemList[seq].defaultResult
  274. },
  275. // 默认结果
  276. btnDefault() {
  277. this.doctorCheck.checkItemList.forEach(e => {
  278. e.result = e.defaultResult
  279. });
  280. this.summary = '未见异常'
  281. },
  282. // 确定
  283. btnOk() {
  284. this.refFuncOther(this.refParams.row, this.refParams.index, { result: this.result, summary: this.summary })
  285. this.dialogWin.PacsTemplate = false
  286. },
  287. },
  288. watch: {
  289. "filterText"(newVal, oldVal) {
  290. if (newVal != oldVal) this.$refs['ref_tree'].filter(newVal);
  291. },
  292. "refParams.refresh"(newVal, oldVal) {
  293. if (newVal && newVal != oldVal) this.init();
  294. },
  295. // 检查明细改变
  296. "tabChoosed"(newVal, oldVal) {
  297. if (newVal && newVal != oldVal) this.conclusion = [];
  298. },
  299. },
  300. };
  301. </script>
  302. <style lang="scss" scoped>
  303. @import "../../assets/css/global_dialog.css";
  304. @import "../../assets/css/global_table.css";
  305. @import "../../assets/css/global_input.css";
  306. @import "../../assets/css/global.css";
  307. @import "../../assets/css/global_tree.css";
  308. :deep .el-tree-node>.el-tree-node__children {
  309. overflow: visible;
  310. }
  311. </style>