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.

340 lines
12 KiB

1 year ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
1 year ago
12 months ago
12 months ago
1 year ago
12 months ago
12 months ago
12 months ago
12 months ago
1 year ago
12 months ago
1 year ago
12 months ago
12 months ago
12 months ago
12 months ago
1 year ago
12 months ago
12 months ago
12 months ago
1 year ago
1 year ago
12 months ago
1 year ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
1 year ago
12 months ago
1 year ago
12 months ago
1 year ago
12 months ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
12 months ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
12 months ago
1 year ago
12 months ago
1 year ago
12 months ago
1 year ago
  1. <template>
  2. <div>
  3. <div>
  4. <el-table :data="bigTexts" style="width: 100%;" highlight-current-row @row-click="rowClick" height="260">
  5. <el-table-column type="index" label="序号" width="40" align="center" />
  6. <el-table-column prop="bigtextResultTypeName" label="词条类别" min-width="80" align="center" />
  7. <el-table-column prop="bigtextResultTemplateName" label="词条模版" min-width="150" align="center" />
  8. <el-table-column prop="bigtextResultConclusion" label="检查结论" min-width="150" align="center" />
  9. <el-table-column prop="bigtextResultDescription" label="检查描述" min-width="400" />
  10. </el-table>
  11. </div>
  12. <div style="display: flex;margin-top: 5px;">
  13. <div style="width: 49%;">
  14. <!-- 多个检查明细 -->
  15. <div style="display: flex; justify-content: space-between;height: 20px;">
  16. <div><span>检查结果</span></div>
  17. <div>
  18. <el-tooltip :content="`给 ${doctorCheck.checkItemList[refParams.index].itemName} 项目,赋默认结果`" placement="top">
  19. <i class="el-icon-edit" @click="btnDefResult(refParams.index)"
  20. style="font-size: 18px;color: blue;cursor: pointer;margin-right: 10px;"></i>
  21. </el-tooltip>
  22. <el-tooltip :content="`清除 ${doctorCheck.checkItemList[refParams.index].itemName} 项目的检查结果`" placement="top">
  23. <i class="el-icon-delete" @click="btnClear(refParams.index)"
  24. style="font-size: 18px; color: red;cursor: pointer;margin-right: 10px;"></i>
  25. </el-tooltip>
  26. </div>
  27. </div>
  28. <div>
  29. <el-input style="width: 100%" type="textarea" v-model="doctorCheck.checkItemList[refParams.index].result"
  30. placeholder="请输入检查结果" :autosize="{ minRows: 9, maxRows: 9 }" />
  31. </div>
  32. </div>
  33. <div style="margin-left: 8px; width: 50%;">
  34. <div style="display: flex; justify-content: space-between;height: 20px;">
  35. <div><span>检查结论</span></div>
  36. <div>
  37. </div>
  38. </div>
  39. <div>
  40. <el-table row-key="id" :data="doctorCheck.checkSummaryList" size="samll" height="186"
  41. width="100%" border>
  42. <el-table-column width="30" align="center">
  43. <template slot-scope="scope">
  44. <el-tag class="moveSummary" style="height:25px;padding:0 2px;cursor: move;background-color: #EEEEEE;">
  45. <div style="width: 16px;">{{ scope.$index + 1 }}</div>
  46. </el-tag>
  47. </template>
  48. </el-table-column>
  49. <el-table-column prop="summary" label="小结">
  50. <template slot="header">
  51. <div style="display: flex;justify-content:space-between;">
  52. <div>小结</div>
  53. <div></div>
  54. </div>
  55. </template>
  56. <template slot-scope="scope">
  57. <div style="display: flex;">
  58. <el-input type="textarea" v-model="scope.row.summary" :autosize="{ minRows: 1, maxRows: 100 }"
  59. placeholder="请输入小结">
  60. </el-input>
  61. <el-button type="danger" style="min-width:23px;padding:2px;" icon="el-icon-delete"
  62. @click="delSum(scope.$index)" size="small"></el-button>
  63. </div>
  64. </template>
  65. </el-table-column>
  66. </el-table>
  67. </div>
  68. </div>
  69. </div>
  70. <!--可选结果-->
  71. <div style="display: flex; justify-content: space-between; margin-top: 5px">
  72. <div style="width: 730px;">
  73. <el-table row-key="id" :data="resultOptRows" size="samll" width="100%" border>
  74. <el-table-column v-for="col in resultOpts" :key="col.resultTemplate" width="120" align="left">
  75. <template slot="header">{{ col.resultTemplate }}</template>
  76. <template slot-scope="scope">
  77. <el-radio-group v-model="scope.row[col.resultTemplate]" @input="radioGroupInput">
  78. <div v-for="opt in col.opts" :key="opt" style="margin-left: 10px;">
  79. <el-radio :label="opt" style="margin: 5px 0;">{{ opt }}</el-radio>
  80. </div>
  81. </el-radio-group>
  82. </template>
  83. </el-table-column>
  84. </el-table>
  85. </div>
  86. <div style=" margin-top: 5px">
  87. <!--
  88. <el-button type="primary" @click="btnTest" class="commonbutton">测试</el-button>
  89. -->
  90. <el-button type="primary" @click="btnOk" class="commonbutton">确定</el-button>
  91. </div>
  92. </div>
  93. </div>
  94. </template>
  95. <script>
  96. import moment from "moment";
  97. import { mapState } from "vuex";
  98. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  99. import { arrayExistObj } from "@/utlis/proFunc";
  100. export default {
  101. components: {},
  102. props: ["refParams", "refFuncOther"],
  103. data() {
  104. return {
  105. bigTexts: [{
  106. bigtextResultTypeName: "",
  107. bigtextResultTemplateName: "",
  108. bigtextResultConclusion: "",
  109. bigtextResultDescription: ""
  110. }], // 大文本词条
  111. result: "", //隐藏在后台处理数据用
  112. resultOpts: [
  113. { resultTemplate: "[A|B|C|D]", opts: ['A', 'B', 'C', 'D'], chooseOpt: 'A' }
  114. ], // [|] 结果带选项
  115. resultOptRows: [
  116. ],
  117. };
  118. },
  119. //<el-tree :data="$store.state.customerOrg.ref_tree" :props="$store.state.customerOrg.treeprops" @node-click="treeclick"></el-tree>
  120. computed: {
  121. ...mapState(["window", "dialogWin", "doctorCheck"]),
  122. },
  123. //创建组件后
  124. created() { },
  125. //挂载组件完成
  126. mounted() {
  127. //获取体检单位列表树信息
  128. this.init();
  129. },
  130. methods: {
  131. // 初始化数据
  132. init() {
  133. this.result = this.doctorCheck.checkItemList[this.refParams.index].result
  134. this.resultOpts = []
  135. this.madeResultOpts()
  136. let itemId = this.doctorCheck.checkItemList[this.refParams.index].itemId
  137. //"itemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  138. postapi('/api/app/BigtextResultTemplate/GetBigtextResultTemplateWithDetail', { itemId })
  139. .then(res => {
  140. if (res.code > -1) {
  141. this.bigTexts = res.data
  142. }
  143. })
  144. },
  145. // 分析可选模版 [A|B|C|D]
  146. madeResultOpts() {
  147. this.resultOptRows = []
  148. if (!this.result) return
  149. let opts1 = this.result.split(']')
  150. opts1.forEach(e => {
  151. let opts2 = e.split('[')
  152. if (opts2.length == 2) {
  153. if (opts2[1].includes('|')) {
  154. let resultTemplate = `[${opts2[1]}]`
  155. let lfind = arrayExistObj(this.resultOpts, 'resultTemplate', resultTemplate)
  156. if (lfind == -1) {
  157. let opts = opts2[1].split('|')
  158. let chooseOpt = ''
  159. this.resultOpts.push({ resultTemplate, opts, chooseOpt })
  160. }
  161. }
  162. }
  163. });
  164. let resultOptRow = { id: 1 }
  165. if (this.resultOpts.length > 0) {
  166. this.resultOpts.forEach(e => {
  167. resultOptRow[e.resultTemplate] = e.chooseOpt
  168. });
  169. }
  170. this.resultOptRows.push(resultOptRow)
  171. },
  172. //
  173. radioGroupInput(v){
  174. // console.log('radioGroupInput',this.resultOptRows,this.refParams.index)
  175. let result = this.result
  176. this.resultOpts.forEach(e => {
  177. if(this.resultOptRows[0][e.resultTemplate]) result = result.replace(e.resultTemplate,this.resultOptRows[0][e.resultTemplate])
  178. });
  179. this.doctorCheck.checkItemList[this.refParams.index].result = result
  180. },
  181. // 选择结果模版 (true 则添加,false则取消) 老板说,只有选,没有取消选择
  182. rowClick(row) {
  183. // bigtextResultTypeName: "",
  184. // bigtextResultTemplateName: "",
  185. // bigtextResultConclusion: "",
  186. // bigtextResultDescription: ""
  187. let chooseOpra = true
  188. let conclusions = []
  189. let result = this.doctorCheck.checkItemList[this.refParams.index].result
  190. if (result) {
  191. if (result == this.doctorCheck.checkItemList[this.refParams.index].defaultResult) {
  192. chooseOpra = true
  193. result = row.bigtextResultDescription
  194. } else {
  195. //
  196. if (result.includes(row.bigtextResultDescription)) {
  197. return // 老板说,只有选,没有取消选择
  198. // chooseOpra = false
  199. // result = result.replaceAll(`;${row.bigtextResultDescription}`, '').replaceAll(`${row.bigtextResultDescription};`, '').replaceAll(`${row.bigtextResultDescription}`, '')
  200. // if (!result) result = this.doctorCheck.checkItemList[this.refParams.index].defaultResult
  201. } else {
  202. chooseOpra = true
  203. result += ";" + row.bigtextResultDescription
  204. }
  205. }
  206. } else {
  207. chooseOpra = true
  208. result = row.bigtextResultDescription
  209. }
  210. this.doctorCheck.checkItemList[this.refParams.index].result = result
  211. this.result = result
  212. this.madeResultOpts()
  213. if (row.bigtextResultConclusion) conclusions = row.bigtextResultConclusion.split(";")
  214. if (conclusions.length > 0) {
  215. let lfind = -1
  216. conclusions.forEach(e => {
  217. if (chooseOpra) {
  218. lfind = -1
  219. this.doctorCheck.checkSummaryList.forEach(c => {
  220. if (c.summary == e) lfind = 1
  221. });
  222. // 没找到,则添加结论
  223. if (lfind == -1) {
  224. this.doctorCheck.checkSummaryList.push({
  225. id: Math.random(),
  226. registerCheckId: this.doctorCheck.RegisterCheckEdit.id,
  227. summary: e,
  228. summaryFlag: 'N',
  229. })
  230. }
  231. } else {
  232. if (this.doctorCheck.checkSummaryList.length > 0) {
  233. for (let i = this.doctorCheck.checkSummaryList.length - 1; i > -1; i--) {
  234. if (e == this.doctorCheck.checkSummaryList[i].summary) this.doctorCheck.checkSummaryList.splice(i, 1)
  235. }
  236. }
  237. }
  238. });
  239. }
  240. },
  241. //删除小结
  242. delSum(index) {
  243. this.$confirm("此操作将删除该记录, 是否继续?", "提示", {
  244. confirmButtonText: "是",
  245. cancelButtonText: "否",
  246. type: "warning",
  247. }).then(() => {
  248. this.doctorCheck.checkSummaryList.splice(index, 1);
  249. }).catch(err => {
  250. if (err == "cancel") {
  251. // this.$message.info("已取消删除");
  252. console.log('已取消删除')
  253. }
  254. });
  255. },
  256. //勾选节点
  257. handleCheckChange(data, checked, indeterminate) {
  258. // console.log('data, checked, indeterminate,this.menuInfoSet',data, checked, indeterminate,this.menuInfoSet);
  259. this.description = [];
  260. this.conclusion = [];
  261. postapi("/api/app/BigtextResultTemplate/GetBigtextResultTemplateDetail", {
  262. bigtextResultTemplateIds: [data.id],
  263. }).then((res) => {
  264. if (res.code > -1) {
  265. this.description = res.data.descriptionDetail;
  266. this.conclusion = res.data.conclusionDetail;
  267. let opraType = false;
  268. if (checked) {
  269. // 勾选
  270. opraType = true;
  271. } else if (!indeterminate) {
  272. // 取消勾选
  273. opraType = false;
  274. }
  275. this.chooseDescription(opraType);
  276. this.chooseConclusion(opraType);
  277. }
  278. });
  279. },
  280. // 清除结果
  281. btnClear(seq) {
  282. this.doctorCheck.checkItemList[seq].result = "";
  283. },
  284. // 默认结果
  285. btnDefResult(seq) {
  286. this.doctorCheck.checkItemList[seq].result =
  287. this.doctorCheck.checkItemList[seq].defaultResult;
  288. },
  289. // 确定
  290. btnOk() {
  291. this.refFuncOther(this.refParams.row, this.refParams.index, {
  292. result: this.result,
  293. summary: this.summary,
  294. });
  295. this.dialogWin.PacsTemplate = false;
  296. },
  297. },
  298. watch: {
  299. "refParams.refresh"(newVal, oldVal) {
  300. if (newVal && newVal != oldVal) this.init();
  301. }
  302. },
  303. };
  304. </script>
  305. <style lang="scss" scoped>
  306. @import "../../assets/css/global_dialog.css";
  307. @import "../../assets/css/global_table.css";
  308. @import "../../assets/css/global_input.css";
  309. @import "../../assets/css/global.css";
  310. @import "../../assets/css/global_tree.css";
  311. :deep .el-tree-node>.el-tree-node__children {
  312. overflow: visible;
  313. }
  314. </style>