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.

448 lines
13 KiB

12 months ago
  1. <template>
  2. <div style="display: flex">
  3. <div :style="`width: 300px;height:550px;border: 1px solid #EEE;`">
  4. <div style="margin: 2px 2px 2px 2px">
  5. <el-input
  6. placeholder="输入关键字进行过滤"
  7. v-model="filterText"
  8. size="small"
  9. />
  10. </div>
  11. <div>
  12. <!-- default-expand-all -->
  13. <el-tree
  14. :style="`overflow: scroll;width: 280px;height:510px;`"
  15. :data="pacsTemplateTree"
  16. :props="treeprops"
  17. :filter-node-method="filterNode"
  18. :expand-on-click-node="false"
  19. highlight-current
  20. ref="ref_tree"
  21. show-checkbox
  22. @check-change="handleCheckChange"
  23. >
  24. <span class="custom-tree-node" slot-scope="{ node, data }">
  25. <div>
  26. <span class="treeicons">
  27. <img
  28. style="width: 20px; height: 20px; vertical-align: sub"
  29. src="@/assets/images/order.png"
  30. v-if="!data.parentId"
  31. />
  32. </span>
  33. <span :class="!data.parentId ? 'maxtitle' : 'mintitle'"
  34. >{{ node.label }}
  35. </span>
  36. </div>
  37. </span>
  38. </el-tree>
  39. </div>
  40. </div>
  41. <div :style="`display: block;width:620px; margin-left: 5px;`">
  42. <div>
  43. <!-- 多个检查明细 -->
  44. <div>
  45. <span>检查结果</span>
  46. <el-radio-group v-model="tabPosition">
  47. <el-radio :label="'top'">横排</el-radio>
  48. <el-radio :label="'left'">纵排</el-radio>
  49. </el-radio-group>
  50. </div>
  51. <el-tabs :tab-position="tabPosition" v-model="tabChoosed">
  52. <el-tab-pane
  53. v-for="(item, seq) in doctorCheck.checkItemList"
  54. :label="dispLabel(item.itemName)"
  55. :name="seq + ''"
  56. :key="seq"
  57. >
  58. <el-input
  59. style="width: 100%"
  60. type="textarea"
  61. v-model="item.result"
  62. placeholder="请输入检查结果"
  63. :autosize="{ minRows: decLineCount, maxRows: decLineCount }"
  64. />
  65. <div style="display: flex; justify-content: space-between">
  66. <div></div>
  67. <div>
  68. <el-tooltip
  69. :content="`给 ${item.itemName} 项目,赋默认结果`"
  70. placement="top"
  71. >
  72. <i
  73. class="el-icon-edit"
  74. @click="btnDefResult(seq)"
  75. style="
  76. font-size: 18px;
  77. color: blue;
  78. cursor: pointer;
  79. margin-right: 10px;
  80. "
  81. ></i>
  82. </el-tooltip>
  83. <el-tooltip
  84. :content="`清除 ${item.itemName} 项目的检查结果`"
  85. placement="top"
  86. >
  87. <i
  88. class="el-icon-delete"
  89. @click="btnClear(seq)"
  90. style="
  91. font-size: 18px;
  92. color: red;
  93. cursor: pointer;
  94. margin-right: 10px;
  95. "
  96. ></i>
  97. </el-tooltip>
  98. </div>
  99. </div>
  100. </el-tab-pane>
  101. </el-tabs>
  102. </div>
  103. <div style="margin-top: 5px">
  104. <span>检查结论</span>
  105. <div style="display: flex; justify-content: space-between">
  106. <el-input
  107. style="width: 100%"
  108. type="textarea"
  109. v-model="summary"
  110. placeholder="请输入结论"
  111. :autosize="{ minRows: conLineCount, maxRows: conLineCount }"
  112. />
  113. </div>
  114. </div>
  115. <div
  116. style="display: flex; justify-content: space-between; margin-top: 10px"
  117. >
  118. <div></div>
  119. <div>
  120. <!--
  121. <el-button type="primary" @click="btnTest" class="commonbutton">测试</el-button>
  122. -->
  123. <el-tooltip content="清除所有检查项目描述及结论" placement="top">
  124. <el-button type="primary" @click="btnClearAll" class="commonbutton"
  125. >清除</el-button
  126. >
  127. </el-tooltip>
  128. <el-tooltip content="所有检查项目赋默认描述及结论" placement="top">
  129. <el-button type="primary" @click="btnDefault" class="commonbutton"
  130. >默认结果</el-button
  131. >
  132. </el-tooltip>
  133. <el-button type="primary" @click="btnOk" class="commonbutton"
  134. >确定</el-button
  135. >
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. </template>
  141. <script>
  142. import moment from "moment";
  143. import { mapState } from "vuex";
  144. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  145. import {
  146. hadoopGet,
  147. hadoopPost,
  148. hadoopPut,
  149. hadoopDel,
  150. } from "../../api/hadoopApi";
  151. import {
  152. arrayReduce,
  153. arrayExistObj,
  154. deepCopy,
  155. reMadeOrgTree,
  156. } from "../../utlis/proFunc";
  157. import {
  158. getTreePids,
  159. getTreeAllChildIdsById,
  160. madeTree,
  161. } from "../../utlis/tree";
  162. export default {
  163. components: {},
  164. props: ["refParams", "refFuncOther"],
  165. data() {
  166. return {
  167. filterText: "",
  168. description: [], // 描述
  169. conclusion: [], // 结论
  170. descriptionChoosedPre: [], // 前次选中
  171. descriptionChoosed: [], // 所有选中的描述的集合,切换部位时可用于描述初始化选择
  172. conclusionChoosed: [], // 选中的结论
  173. conclusionAll: [], // 所有选中的描述,对应的结论
  174. result: "", // 检查结果
  175. summary: "", // 小结
  176. pacsTemplateTree: [], //类别 + 模板树
  177. treeprops: {
  178. label: "displayName", // label/displayName
  179. value: "id",
  180. id: "id",
  181. children: "children",
  182. }, //树形组件的数据结构
  183. tabChoosed: "0",
  184. tabPosition: "top", // 多个明细检查排列方式
  185. };
  186. },
  187. //<el-tree :data="$store.state.customerOrg.ref_tree" :props="$store.state.customerOrg.treeprops" @node-click="treeclick"></el-tree>
  188. computed: {
  189. ...mapState(["window", "dialogWin", "doctorCheck"]),
  190. mainHeight() {
  191. return this.window.pageHeight - 118;
  192. },
  193. tableHeight() {
  194. return this.mainHeight - 120 - 80 - 80;
  195. },
  196. decLineCount() {
  197. return this.refParams.from == "dcm" ? 14 : 16;
  198. },
  199. conLineCount() {
  200. return this.refParams.from == "dcm" ? 7 : 8;
  201. },
  202. },
  203. //创建组件后
  204. created() {},
  205. //挂载组件完成
  206. mounted() {
  207. //获取体检单位列表树信息
  208. this.init();
  209. },
  210. methods: {
  211. // 初始化数据
  212. init() {
  213. this.description = [];
  214. this.result = this.refParams.result || "";
  215. this.summary = this.refParams.summary || "";
  216. this.tabChoosed = this.refParams.index + "";
  217. this.tabPosition =
  218. this.doctorCheck.checkItemList.length > 5 ? "left" : "top";
  219. console.log("init");
  220. this.getPacsTemplateTree();
  221. },
  222. // 显示tab标签名称,过长处理
  223. dispLabel(itemName) {
  224. return itemName.length > 5 ? itemName.substring(0, 4) + "…" : itemName;
  225. },
  226. //勾选节点
  227. handleCheckChange(data, checked, indeterminate) {
  228. // console.log('data, checked, indeterminate,this.menuInfoSet',data, checked, indeterminate,this.menuInfoSet);
  229. this.description = [];
  230. this.conclusion = [];
  231. postapi("/api/app/BigtextResultTemplate/GetBigtextResultTemplateDetail", {
  232. bigtextResultTemplateIds: [data.id],
  233. }).then((res) => {
  234. if (res.code > -1) {
  235. this.description = res.data.descriptionDetail;
  236. this.conclusion = res.data.conclusionDetail;
  237. let opraType = false;
  238. if (checked) {
  239. // 勾选
  240. opraType = true;
  241. } else if (!indeterminate) {
  242. // 取消勾选
  243. opraType = false;
  244. }
  245. this.chooseDescription(opraType);
  246. this.chooseConclusion(opraType);
  247. }
  248. });
  249. },
  250. //树过滤
  251. filterNode(value, data) {
  252. //console.log(value,data)
  253. if (!value) return true;
  254. return (
  255. data["displayName"].indexOf(value) > -1 ||
  256. data["simpleCode"].indexOf(value.toUpperCase()) > -1
  257. );
  258. },
  259. // 选择true或取消false 描述
  260. chooseDescription(opraType) {
  261. let bfind = false;
  262. let result =
  263. this.doctorCheck.checkItemList[parseInt(this.tabChoosed)].result;
  264. this.description.forEach((e) => {
  265. bfind = result.includes(e.description);
  266. if (opraType) {
  267. if (!bfind) {
  268. if (result) {
  269. if (
  270. result ==
  271. this.doctorCheck.checkItemList[parseInt(this.tabChoosed)]
  272. .defaultResult
  273. ) {
  274. result = e.description;
  275. } else {
  276. result += ";" + e.description;
  277. }
  278. } else {
  279. result = e.description;
  280. }
  281. }
  282. } else {
  283. if (bfind)
  284. result = result
  285. .replaceAll(e.description + ";", "")
  286. .replaceAll(e.description, "");
  287. }
  288. });
  289. // 去掉 最后的 ;
  290. if (result.substring(result.length - 1) == ";") {
  291. result = result.substring(0, result.length - 1);
  292. }
  293. this.doctorCheck.checkItemList[parseInt(this.tabChoosed)].result = result;
  294. },
  295. // 选择true或取消false 结论
  296. chooseConclusion(opraType) {
  297. let lfind = 0;
  298. let summarys = this.summary.split(";");
  299. this.conclusion.forEach((e) => {
  300. lfind = summarys.indexOf(e.conclusion);
  301. if (opraType) {
  302. if (lfind == -1 && e.isAbnormal == "Y") summarys.push(e.conclusion);
  303. } else {
  304. if (lfind > -1) summarys.splice(lfind, 1);
  305. }
  306. });
  307. let summary = "";
  308. // 再次过滤 未见异常 或 未见明显异常
  309. summarys.forEach((e) => {
  310. if (!(e.includes("未见异常") || e.includes("未见明显异常"))) {
  311. if (summary) {
  312. summary += ";" + e;
  313. } else {
  314. summary = e;
  315. }
  316. }
  317. });
  318. this.summary = summary;
  319. // 没有结论时(取描述)
  320. if(!this.summary){
  321. if(this.doctorCheck.checkItemList.length > 0) this.summary = this.doctorCheck.checkItemList[0].result;
  322. }
  323. },
  324. //获取pacs结果模板
  325. getPacsTemplateTree() {
  326. let resultType = [],
  327. resultTemplate = [],
  328. treeData = [];
  329. postapi("/api/app/BigtextResultType/GetList", {
  330. itemTypeId: this.refParams.row.itemTypeId,
  331. })
  332. .then((res) => {
  333. if (res.code > -1) {
  334. resultType = res.data;
  335. resultType.forEach((e) => {
  336. e.disabled = true;
  337. });
  338. return postapi("/api/app/BigtextResultTemplate/GetList", {});
  339. }
  340. })
  341. .then((res) => {
  342. if (res && res.code > -1) {
  343. res.data.forEach((e) => {
  344. resultTemplate.push(
  345. Object.assign({}, e, { parentId: e.bigtextResultTypeId })
  346. );
  347. });
  348. treeData = resultType.concat(resultTemplate);
  349. // console.log('treeData',treeData,resultType,)
  350. this.pacsTemplateTree = madeTree(
  351. treeData,
  352. "children",
  353. "parentId",
  354. "id",
  355. null
  356. );
  357. }
  358. });
  359. },
  360. btnTest() {
  361. console.log("this.descriptionChoosed", this.descriptionChoosed);
  362. console.log("this.conclusionChoosed", this.conclusionChoosed);
  363. },
  364. // 清除所有描述与结论
  365. btnClearAll() {
  366. this.doctorCheck.checkItemList.forEach((e) => {
  367. e.result = "";
  368. });
  369. this.summary = "";
  370. },
  371. // 清除结果
  372. btnClear(seq) {
  373. this.doctorCheck.checkItemList[seq].result = "";
  374. },
  375. // 默认结果
  376. btnDefResult(seq) {
  377. this.doctorCheck.checkItemList[seq].result =
  378. this.doctorCheck.checkItemList[seq].defaultResult;
  379. },
  380. // 默认结果
  381. btnDefault() {
  382. this.doctorCheck.checkItemList.forEach((e) => {
  383. e.result = e.defaultResult;
  384. });
  385. this.summary = "未见异常";
  386. },
  387. // 确定
  388. btnOk() {
  389. this.refFuncOther(this.refParams.row, this.refParams.index, {
  390. result: this.result,
  391. summary: this.summary,
  392. });
  393. this.dialogWin.PacsTemplate = false;
  394. },
  395. },
  396. watch: {
  397. filterText(newVal, oldVal) {
  398. if (newVal != oldVal) this.$refs["ref_tree"].filter(newVal);
  399. },
  400. "refParams.refresh"(newVal, oldVal) {
  401. if (newVal && newVal != oldVal) this.init();
  402. },
  403. // 检查明细改变
  404. tabChoosed(newVal, oldVal) {
  405. if (newVal && newVal != oldVal) this.conclusion = [];
  406. },
  407. },
  408. };
  409. </script>
  410. <style lang="scss" scoped>
  411. @import "../../assets/css/global_dialog.css";
  412. @import "../../assets/css/global_table.css";
  413. @import "../../assets/css/global_input.css";
  414. @import "../../assets/css/global.css";
  415. @import "../../assets/css/global_tree.css";
  416. :deep .el-tree-node > .el-tree-node__children {
  417. overflow: visible;
  418. }
  419. </style>