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.

654 lines
27 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div style="display: flex;">
  3. <div style="width:50%;">
  4. <el-table id="tableSummary" row-key="id" :data="sumDoctorCheck.summaryList" width="100%" :height="sumHeight" border
  5. size="small">
  6. <el-table-column type="index" width="20" align="center" />
  7. <el-table-column prop="summaryTitle" label="综述">
  8. <template slot-scope="scope">
  9. <div>
  10. <el-input v-model="scope.row.summaryTitle" placeholder="请输入综述" disabled></el-input>
  11. <el-table :id="scope.row.id" :row-key="scope.$index + scope.row.id" style="margin-left: 10px;"
  12. :data="scope.row.details" border @row-click="rowClick" :show-header="false">
  13. <el-table-column width="30">
  14. <template slot-scope="scope2">
  15. <div>{{ scope2.$index + 1 }})</div>
  16. </template>
  17. </el-table-column>
  18. <el-table-column prop="summaryContent" label="综述" min-width="200">
  19. <template slot-scope="scope2">
  20. <!--:autosize="{ minRows: 1, maxRows: 20 } "-->
  21. <el-input type="textarea" v-model="scope2.row.summaryContent" placeholder="请输入综述" disabled
  22. :autosize="{ minRows: 1, maxRows: 20 }">
  23. </el-input>
  24. </template>
  25. </el-table-column>
  26. <el-table-column width="8" />
  27. </el-table>
  28. </div>
  29. </template>
  30. </el-table-column>
  31. </el-table>
  32. </div>
  33. <div style="width:50%;">
  34. <el-table id="tableSuggestion" row-key="id" :data="sumDoctorCheck.suggestionList" width="100%" :height="sumHeight"
  35. border size="small">
  36. <el-table-column type="index" width="20" align="center">
  37. </el-table-column>
  38. <el-table-column prop="suggestionTitle" label="建议">
  39. <template slot-scope="scope">
  40. <div>
  41. <div style="display: flex;">
  42. <el-input v-model="scope.row.suggestionTitle" placeholder="请输入建议标题" :ref="scope.row.id" :id="scope.row.id"
  43. :disabled="sumDoctorCheck.sumPREdit.completeFlag == '3' || sumDoctorCheck.sumPREdit.isAudit == 'Y'">
  44. </el-input>
  45. <el-button v-show="checkPagePriv(pagePriv.privs, '删除建议')" type="danger" icon="el-icon-delete"
  46. style="margin-left: 2px;min-width:21px;height:21px;padding:2px;" @click="delSugHead(scope.$index)"
  47. :disabled="sumDoctorCheck.sumPREdit.completeFlag == '3' || sumDoctorCheck.sumPREdit.isAudit == 'Y'"></el-button>
  48. </div>
  49. <div style="display: flex;margin-top: 2px;">
  50. <div style="width:60px;">诊断</div>
  51. <el-select v-model="scope.row.diagnosisIds" multiple placeholder="请选择" style="width: 100%;"
  52. :disabled="sumDoctorCheck.sumPREdit.completeFlag == '3' || sumDoctorCheck.sumPREdit.isAudit == 'Y'"
  53. @change="changeDiagnosis">
  54. <el-option v-for="item in diagnosises" :key="item.id" :value="item.id" :label="item.displayName" />
  55. </el-select>
  56. <el-tooltip content="新增医学解释" placement="top">
  57. <el-button v-show="checkPagePriv(pagePriv.privs, '新增医学解释')" type="success" icon="el-icon-plus"
  58. style="min-width:21px;height:21px;padding:2px;" @click="addSug(scope.$index, 0)"
  59. :disabled="sumDoctorCheck.sumPREdit.completeFlag == '3' || sumDoctorCheck.sumPREdit.isAudit == 'Y'">
  60. </el-button>
  61. </el-tooltip>
  62. <el-tooltip content="新增常见原因" placement="top">
  63. <el-button v-show="checkPagePriv(pagePriv.privs, '新增常见原因')" type="danger" icon="el-icon-plus"
  64. style="margin-left: 2px;min-width:21px;height:21px;padding:2px;" @click="addSug(scope.$index, 1)"
  65. :disabled="sumDoctorCheck.sumPREdit.completeFlag == '3' || sumDoctorCheck.sumPREdit.isAudit == 'Y'">
  66. </el-button>
  67. </el-tooltip>
  68. <el-tooltip content="新增健康指导" placement="top">
  69. <el-button v-show="checkPagePriv(pagePriv.privs, '新增健康指导')" type="danger" icon="el-icon-plus"
  70. style="margin-left: 2px;min-width:21px;height:21px;padding:2px;" @click="addSug(scope.$index, 2)"
  71. :disabled="sumDoctorCheck.sumPREdit.completeFlag == '3' || sumDoctorCheck.sumPREdit.isAudit == 'Y'">
  72. </el-button>
  73. </el-tooltip>
  74. </div>
  75. <div style="display: flex;margin-top: 2px;">
  76. <div style="width:60px;">医学解释</div>
  77. <el-table :id="'0_sug' + scope.row.id" row-key="displayOrder" style="margin-left: 10px;"
  78. :data="scope.row.medicalInterpretations" border @row-click="rowClickSug0" :show-header="false">
  79. <el-table-column width="30">
  80. <template slot-scope="scope2">
  81. <div>{{ scope2.$index + 1 }}).</div>
  82. </template>
  83. </el-table-column>
  84. <el-table-column prop="suggestionContent" label="建议" min-width="200">
  85. <template slot-scope="scope2">
  86. <el-input type="textarea" v-model="scope2.row.suggestionContent" placeholder="请输入建议内容"
  87. :disabled="sumDoctorCheck.sumPREdit.completeFlag == '3' || sumDoctorCheck.sumPREdit.isAudit == 'Y'"
  88. :autosize="{ minRows: 1, maxRows: 10 }">
  89. </el-input>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="操作" width="25">
  93. <template slot-scope="scope2">
  94. <el-button v-show="checkPagePriv(pagePriv.privs, '删除医学解释')" type="danger"
  95. style="min-width:21px;height:21px;padding:2px;" icon="el-icon-delete"
  96. @click="delSug(scope.row.medicalInterpretations, scope2.$index)"
  97. :disabled="sumDoctorCheck.sumPREdit.completeFlag == '3' || sumDoctorCheck.sumPREdit.isAudit == 'Y'"
  98. size="small"></el-button>
  99. </template>
  100. </el-table-column>
  101. </el-table>
  102. </div>
  103. <div style="display: flex;margin-top: 2px;">
  104. <div style="width:60px;">常见原因</div>
  105. <el-table :id="'1_sug' + scope.row.id" row-key="displayOrder" style="margin-left: 10px;"
  106. :data="scope.row.commonReasons" border @row-click="rowClickSug1" :show-header="false">
  107. <el-table-column width="30">
  108. <template slot-scope="scope2">
  109. <div>{{ scope2.$index + 1 }}).</div>
  110. </template>
  111. </el-table-column>
  112. <el-table-column prop="suggestionContent" label="建议" min-width="200">
  113. <template slot-scope="scope2">
  114. <el-input type="textarea" v-model="scope2.row.suggestionContent" placeholder="请输入建议内容"
  115. :disabled="sumDoctorCheck.sumPREdit.completeFlag == '3' || sumDoctorCheck.sumPREdit.isAudit == 'Y'"
  116. :autosize="{ minRows: 1, maxRows: 10 }">
  117. </el-input>
  118. </template>
  119. </el-table-column>
  120. <el-table-column label="操作" width="25">
  121. <template slot-scope="scope2">
  122. <el-button v-show="checkPagePriv(pagePriv.privs, '删除常见原因')" type="danger"
  123. style="min-width:21px;height:21px;padding:2px;" icon="el-icon-delete"
  124. @click="delSug(scope.row.commonReasons, scope2.$index)"
  125. :disabled="sumDoctorCheck.sumPREdit.completeFlag == '3' || sumDoctorCheck.sumPREdit.isAudit == 'Y'"
  126. size="small"></el-button>
  127. </template>
  128. </el-table-column>
  129. </el-table>
  130. </div>
  131. <div style="display: flex;margin-top: 2px;">
  132. <div style="width:60px;">健康指导</div>
  133. <el-table :id="'2_sug' + scope.row.id" row-key="displayOrder" style="margin-left: 10px;"
  134. :data="scope.row.healthGuidances" border @row-click="rowClickSug2" :show-header="false">
  135. <el-table-column width="30">
  136. <template slot-scope="scope2">
  137. <div>{{ scope2.$index + 1 }}).</div>
  138. </template>
  139. </el-table-column>
  140. <el-table-column prop="suggestionContent" label="建议" min-width="200">
  141. <template slot-scope="scope2">
  142. <el-input type="textarea" v-model="scope2.row.suggestionContent" placeholder="请输入健康指导"
  143. :disabled="sumDoctorCheck.sumPREdit.completeFlag == '3' || sumDoctorCheck.sumPREdit.isAudit == 'Y'"
  144. :autosize="{ minRows: 1, maxRows: 10 }">
  145. </el-input>
  146. </template>
  147. </el-table-column>
  148. <el-table-column label="操作" width="25">
  149. <template slot-scope="scope2">
  150. <el-button v-show="checkPagePriv(pagePriv.privs, '删除健康指导')" type="danger"
  151. style="min-width:21px;height:21px;padding:2px;" icon="el-icon-delete"
  152. @click="delSug(scope.row.healthGuidances, scope2.$index)"
  153. :disabled="sumDoctorCheck.sumPREdit.completeFlag == '3' || sumDoctorCheck.sumPREdit.isAudit == 'Y'"
  154. size="small"></el-button>
  155. </template>
  156. </el-table-column>
  157. </el-table>
  158. </div>
  159. </div>
  160. </template>
  161. </el-table-column>
  162. </el-table>
  163. </div>
  164. </div>
  165. </template>
  166. <script>
  167. import { mapState } from 'vuex';
  168. import Sortable from "sortablejs";
  169. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  170. import { getPagePriv, checkPagePriv, deepCopy, arrayExistObj } from '../../utlis/proFunc';
  171. export default {
  172. components: {},
  173. props: ["patientRegisterId", "curGetFocusSuggestionId"],
  174. data() {
  175. return {
  176. pagePriv: {
  177. routeUrlorPageName: 'sumDoctorCheck', //当前页面归属路由或归属页面权限名称
  178. privs: [] // 页面权限
  179. },
  180. sumDetails: [],
  181. suggestionCurRow:0, //当前操作建议的行
  182. diagnosises:[], // 诊断
  183. };
  184. },
  185. created() {
  186. //获取用户当前页面的权限
  187. let userPriv = window.sessionStorage.getItem('userPriv')
  188. if (userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName))
  189. },
  190. //挂载完成
  191. mounted() {
  192. this.rowDrop();
  193. this.rowDropSuggestion();
  194. this.dictInit()
  195. // document.addEventListener('DOMContentLoaded', function () {
  196. // const textarea = document.querySelector('textarea');
  197. // textarea.addEventListener('input', function () {
  198. // // 当文本域内容变化时调整大小
  199. // console.log('textarea.addEventListener',textarea.style.height)
  200. // textarea.style.height = 'auto'; // 重置高度
  201. // // textarea.style.height = textarea.scrollHeight + 'px'; // 根据滚动高度调整高度
  202. // });
  203. // });
  204. this.summaryList(this.dataTransOpts.tableS.patient_register.id)
  205. this.suggestionList(this.dataTransOpts.tableS.patient_register.id)
  206. },
  207. computed: {
  208. ...mapState(['window', 'dict', 'dataTransOpts', 'doctorCheck', 'sumDoctorCheck']),
  209. sumHeight() {
  210. let tempHeight = this.window.pageHeight < 600 ? 600 : this.window.pageHeight
  211. return tempHeight - 335
  212. },
  213. },
  214. methods: {
  215. checkPagePriv,
  216. // textareaResize() {
  217. // const textarea = document.querySelectorAll('textarea');
  218. // textarea.forEach(e => {
  219. // e.style.height = 'auto'; // 重置高度
  220. // });
  221. // },
  222. // 获取诊断数据
  223. dictInit() {
  224. postapi('/api/app/diagnosis/getlistinsuggestion', {}).then(res => {
  225. if (res.code > -1) {
  226. this.diagnosises = res.data
  227. }
  228. })
  229. },
  230. //获取综述
  231. summaryList(RegisterId) {
  232. if (!RegisterId) {
  233. this.sumDoctorCheck.summaryList = [];
  234. return
  235. }
  236. // 旧接口: console.log(`/api/app/sumsummaryheader/getsumsummarylist?PatientRegisterId=${RegisterId}`)
  237. let body = {
  238. patientRegisterId: RegisterId,
  239. isGetExistData: 'Y',
  240. }
  241. postapi('/api/app/sumsummaryheader/getsumsummarylist', body)
  242. .then((res) => {
  243. console.log("summaryList", res.data);
  244. if (res.code > -1) {
  245. let summaryList = []
  246. res.data.forEach((e, i) => {
  247. let details = []
  248. e.details.forEach((e2, i2) => {
  249. details.push({ id: `summaryDetails_${i2}`, summaryContent: ' ' })
  250. });
  251. summaryList.push({ id: `summary_${i}`, summaryTitle: ' ', details })
  252. });
  253. this.sumDoctorCheck.summaryList = deepCopy(summaryList)
  254. // 自动高度有问题,需要这样处理一下
  255. setTimeout(() => {
  256. this.sumDoctorCheck.summaryList = deepCopy(res.data);
  257. this.sumDoctorCheck.summaryList.forEach((e, i) => {
  258. e.id = `summary_${i}`
  259. e.details.forEach((e2, i2) => {
  260. e2.id = `summaryDetails_${i2}`
  261. });
  262. });
  263. }, 10);
  264. // this.sumDoctorCheck.summaryList = res.data;
  265. // this.textareaResize()
  266. }
  267. })
  268. .catch((err) => {
  269. this.$message({ type: "error", message: `操作失败,原因:${err}` });
  270. });
  271. },
  272. //获取建议
  273. suggestionList(RegisterId) {
  274. if (!RegisterId) {
  275. this.sumDoctorCheck.suggestionList = [];
  276. return;
  277. };
  278. // {
  279. // "patientRegisterId": "3a11ee70-02cb-c5e6-a087-79ecdd0356b6",
  280. // "isGetExistData": "Y"
  281. // }
  282. let body = {
  283. patientRegisterId: RegisterId,
  284. isGetExistData: 'Y',
  285. }
  286. // 旧接口: console.log(`/api/app/sumsuggestionheader/getsumsuggestionlist?PatientRegisterId=${RegisterId}`)
  287. postapi('/api/app/sumsuggestionheader/getsumsuggestionlist', body)
  288. .then((res) => {
  289. console.log("suggestionList", res.data);
  290. if (res.code > -1) {
  291. this.sumDoctorCheck.suggestionList = res.data;
  292. // 处理拖动排序使用
  293. this.sumDoctorCheck.suggestionList.forEach((e, i) => {
  294. e.id = `suggestion_${i}`
  295. if (e.medicalInterpretations) {
  296. e.medicalInterpretations.forEach((e0, i0) => {
  297. e0.sumSuggestionHeaderId = `suggestion_${i}`
  298. e0.id = `medicalInterpretations_${i0}`
  299. });
  300. }
  301. if (e.commonReasons) {
  302. e.commonReasons.forEach((e0, i0) => {
  303. e0.sumSuggestionHeaderId = `suggestion_${i}`
  304. e0.id = `commonReasons_${i0}`
  305. });
  306. }
  307. if (e.healthGuidances) {
  308. e.healthGuidances.forEach((e0, i0) => {
  309. e0.sumSuggestionHeaderId = `suggestion_${i}`
  310. e0.id = `healthGuidances_${i0}`
  311. });
  312. }
  313. });
  314. }
  315. })
  316. .catch((err) => {
  317. this.$message({ type: "error", message: `操作失败,原因:${err}` });
  318. });
  319. },
  320. // 诊断选择
  321. changeDiagnosis(v){
  322. console.log('changeDiagnosis',v)
  323. let suggestionTitle = []
  324. if(v.length == 0){
  325. this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['suggestionTitle'] = ''
  326. return
  327. }
  328. //先找到是操作的建议行
  329. let lv = `${v}`
  330. let suggestionList = deepCopy(this.sumDoctorCheck.suggestionList)
  331. suggestionList.forEach(e => {
  332. e.diagnosisIds = `${e.diagnosisIds}`
  333. });
  334. let lfind = arrayExistObj(suggestionList,'diagnosisIds',lv)
  335. if(lfind == -1) return
  336. this.suggestionCurRow = lfind
  337. let sumSuggestionHeaderId = this.sumDoctorCheck.suggestionList[lfind].id
  338. v.forEach(e => {
  339. let ld = arrayExistObj(this.diagnosises,'id',e)
  340. if(ld > -1){
  341. suggestionTitle.push(this.diagnosises[ld]["displayName"])
  342. //添加医学解释
  343. let medicalInterpretations = this.diagnosises[ld]['medicalInterpretations']
  344. if(medicalInterpretations){
  345. if(!this.sumDoctorCheck.suggestionList[lfind]['medicalInterpretations']) this.sumDoctorCheck.suggestionList[lfind]['medicalInterpretations'] = []
  346. medicalInterpretations.forEach(e2 => {
  347. let lf = arrayExistObj(this.sumDoctorCheck.suggestionList[lfind]['medicalInterpretations'],"suggestionContent",e2.suggestionContent)
  348. if(lf == -1){
  349. this.sumDoctorCheck.suggestionList[lfind]['medicalInterpretations'].push({
  350. sumSuggestionHeaderId,
  351. suggestionContent:e2.suggestionContent,
  352. displayOrder: Math.random(),
  353. })
  354. }
  355. });
  356. }
  357. //添加常见原因
  358. let commonReasons = this.diagnosises[ld]['commonReasons']
  359. if(commonReasons){
  360. if(!this.sumDoctorCheck.suggestionList[lfind]['commonReasons']) this.sumDoctorCheck.suggestionList[lfind]['commonReasons'] = []
  361. commonReasons.forEach(e2 => {
  362. let lf = arrayExistObj(this.sumDoctorCheck.suggestionList[lfind]['commonReasons'],"suggestionContent",e2.suggestionContent)
  363. if(lf == -1){
  364. this.sumDoctorCheck.suggestionList[lfind]['commonReasons'].push({
  365. sumSuggestionHeaderId,
  366. suggestionContent:e2.suggestionContent,
  367. displayOrder: Math.random(),
  368. })
  369. }
  370. });
  371. }
  372. //添加常见原因
  373. let healthGuidances = this.diagnosises[ld]['healthGuidances']
  374. if(healthGuidances){
  375. if(!this.sumDoctorCheck.suggestionList[lfind]['healthGuidances']) this.sumDoctorCheck.suggestionList[lfind]['healthGuidances'] = []
  376. healthGuidances.forEach(e2 => {
  377. let lf = arrayExistObj(this.sumDoctorCheck.suggestionList[lfind]['healthGuidances'],"suggestionContent",e2.suggestionContent)
  378. if(lf == -1){
  379. this.sumDoctorCheck.suggestionList[lfind]['healthGuidances'].push({
  380. sumSuggestionHeaderId,
  381. suggestionContent:e2.suggestionContent,
  382. displayOrder: Math.random(),
  383. })
  384. }
  385. });
  386. }
  387. }
  388. });
  389. this.sumDoctorCheck.suggestionList[this.suggestionCurRow]['suggestionTitle'] = `${suggestionTitle}`
  390. },
  391. //增加建议明细
  392. addSug(index, contentType) {
  393. this.suggestionCurRow = index
  394. let lcontentType = 'healthGuidances'
  395. switch (contentType) {
  396. case 0:
  397. lcontentType = 'medicalInterpretations'
  398. break;
  399. case 1:
  400. lcontentType = 'commonReasons'
  401. break;
  402. default:
  403. break;
  404. }
  405. if (!this.sumDoctorCheck.suggestionList[index][lcontentType]) this.sumDoctorCheck.suggestionList[index][lcontentType] = []
  406. this.sumDoctorCheck.suggestionList[index][lcontentType].push({
  407. sumSuggestionHeaderId: this.sumDoctorCheck.suggestionList[index].id, // 拖拽用到
  408. suggestionContent: '',
  409. displayOrder: Math.random(),
  410. })
  411. console.log('this.sumDoctorCheck.suggestionList', index, this.sumDoctorCheck.suggestionList)
  412. },
  413. //删除建议头及明细
  414. delSugHead(index) {
  415. this.$confirm("此操作将删除该记录, 是否继续?", "提示", {
  416. confirmButtonText: "是",
  417. cancelButtonText: "否",
  418. type: "warning",
  419. }).then(() => {
  420. //删除建议
  421. this.sumDoctorCheck.suggestionList.splice(index, 1)
  422. }).catch((err) => {
  423. if (err == 'cancel') {
  424. console.log(`已取消 ${err}`)
  425. } else {
  426. this.$message.error(`操作失败 ${err}`)
  427. }
  428. });
  429. },
  430. //删除建议明细
  431. delSug(details, indexD) {
  432. this.$confirm("此操作将删除该记录, 是否继续?", "提示", {
  433. confirmButtonText: "是",
  434. cancelButtonText: "否",
  435. type: "warning",
  436. }).then(() => {
  437. //删除建议明细
  438. details.splice(indexD, 1);
  439. }).catch((err) => {
  440. if (err == 'cancel') {
  441. console.log(`已取消 ${err}`)
  442. } else {
  443. this.$message.error(`操作失败 ${err}`)
  444. }
  445. });
  446. },
  447. //选择组合项目
  448. rowClick(row) {
  449. console.log('rowClick row', row)
  450. let lfind = arrayExistObj(this.sumDoctorCheck.summaryList, 'id', row.sumSummaryHeaderId)
  451. if (lfind > -1) {
  452. this.sumDetails = this.sumDoctorCheck.summaryList[lfind].details
  453. this.rowDropSumDetail(row.sumSummaryHeaderId)
  454. }
  455. console.log('this.sumDetails', this.sumDetails)
  456. },
  457. //综述明细拖拽
  458. rowDropSumDetail(id) {
  459. this.$nextTick(() => {
  460. const fEl = document.getElementById(id) // document.querySelector(`#${id} tbody`) querySelector为静态方法不支持动态传参;
  461. console.log('rowDropSumDetail tbody', fEl, fEl.children) //el.childNodes,el.children
  462. const el = this.findEl(fEl, 'TBODY')
  463. console.log('rowDropSumDetail tbody', el) //el.childNodes,el.children
  464. const that = this;
  465. Sortable.create(el, {
  466. animation: 150, // ms, number 单位:ms,定义排序动画的时间
  467. //拖拽结束
  468. onEnd({ newIndex, oldIndex }) {
  469. that.isshow = false;
  470. const currRow = that.sumDetails.splice(oldIndex, 1)[0];
  471. that.sumDetails.splice(newIndex, 0, currRow);
  472. },
  473. });
  474. });
  475. },
  476. findEl(fEl, nodeName) {
  477. let el = null
  478. for (let i = 0; i < fEl.children.length; i++) {
  479. console.log(fEl.children[i].nodeName)
  480. if (fEl.children[i].nodeName == nodeName) {
  481. el = fEl.children[i]
  482. break
  483. } else {
  484. el = this.findEl(fEl.children[i], nodeName)
  485. }
  486. if (el) break
  487. }
  488. return el
  489. },
  490. rowClickSug0(row) {
  491. this.rowClickSug(row, 0)
  492. },
  493. rowClickSug1(row) {
  494. this.rowClickSug(row, 1)
  495. },
  496. rowClickSug2(row) {
  497. this.rowClickSug(row, 2)
  498. },
  499. rowClickSug(row, contentType) {
  500. console.log('rowClick row', row, contentType)
  501. let lcontentType = 'healthGuidances'
  502. switch (contentType) {
  503. case 0:
  504. lcontentType = 'medicalInterpretations'
  505. break;
  506. case 1:
  507. lcontentType = 'commonReasons'
  508. break;
  509. default:
  510. break;
  511. }
  512. let lfind = arrayExistObj(this.sumDoctorCheck.suggestionList, 'id', row.sumSuggestionHeaderId)
  513. if (lfind > -1) {
  514. this.sugDetails = this.sumDoctorCheck.suggestionList[lfind][lcontentType]
  515. this.rowDropSugDetail(contentType, row.sumSuggestionHeaderId)
  516. }
  517. console.log('this.sumDetails', lfind, this.sugDetails)
  518. },
  519. //建议明细拖拽
  520. rowDropSugDetail(contentType, id) {
  521. this.$nextTick(() => {
  522. const fEl = document.getElementById(`${contentType}_sug${id}`) // document.querySelector(`#${id} tbody`) querySelector为静态方法不支持动态传参;
  523. console.log('rowDropSumDetail tbody', fEl, fEl.children) //el.childNodes,el.children
  524. const el = this.findEl(fEl, 'TBODY')
  525. console.log('rowDropSumDetail tbody', el) //el.childNodes,el.children
  526. const that = this;
  527. if (this.detailsDrag) this.detailsDrag.destroy()
  528. this.detailsDrag = Sortable.create(el, {
  529. animation: 150, // ms, number 单位:ms,定义排序动画的时间
  530. //拖拽结束
  531. onEnd({ newIndex, oldIndex }) {
  532. that.isshow = false;
  533. const currRow = that.sugDetails.splice(oldIndex, 1)[0];
  534. that.sugDetails.splice(newIndex, 0, currRow);
  535. },
  536. });
  537. });
  538. },
  539. //拖拽
  540. rowDrop() {
  541. this.$nextTick(() => {
  542. const el = document.querySelector("#tableSummary tbody");
  543. console.log('tbody', el)
  544. const that = this;
  545. Sortable.create(el, {
  546. animation: 150, // ms, number 单位:ms,定义排序动画的时间
  547. //拖拽结束
  548. onEnd({ newIndex, oldIndex }) {
  549. that.isshow = false;
  550. const currRow = that.sumDoctorCheck.summaryList.splice(oldIndex, 1)[0];
  551. that.sumDoctorCheck.summaryList.splice(newIndex, 0, currRow);
  552. },
  553. });
  554. });
  555. },
  556. //拖拽
  557. rowDropSuggestion() {
  558. this.$nextTick(() => {
  559. const el = document.querySelector("#tableSuggestion tbody");
  560. console.log('tbody', el)
  561. const that = this;
  562. Sortable.create(el, {
  563. animation: 150, // ms, number 单位:ms,定义排序动画的时间
  564. //拖拽结束
  565. onEnd({ newIndex, oldIndex }) {
  566. that.isshow = false;
  567. const currRow = that.sumDoctorCheck.suggestionList.splice(oldIndex, 1)[0];
  568. that.sumDoctorCheck.suggestionList.splice(newIndex, 0, currRow);
  569. },
  570. });
  571. });
  572. },
  573. },
  574. //监听事件
  575. watch: {
  576. // 虚拟表 触发强制刷新 (sumDoctor.M 合并包含:综述、建议、对比、历史等,不包含总检诊断)
  577. "dataTransOpts.refresh.sumDoctor.M": {
  578. // immediate:true,
  579. handler(newVal, oldVal) {
  580. console.log(`watch 总检--综述建议 newVal: ${newVal}, oldVal: ${oldVal} patientRegisterId: ${this.dataTransOpts.tableS.patient_register.id}`);
  581. this.summaryList(this.dataTransOpts.tableS.patient_register.id)
  582. this.suggestionList(this.dataTransOpts.tableS.patient_register.id)
  583. }
  584. },
  585. // 新增时,光标定位
  586. "curGetFocusSuggestionId": {
  587. immediate: true,
  588. handler(newVal, oldVal) {
  589. console.log(`watch curGetFocusSuggestionId newVal: ${newVal}, oldVal: ${oldVal}`);
  590. if (newVal) {
  591. this.$nextTick(() => {
  592. this.$refs[newVal].focus();
  593. });
  594. }
  595. }
  596. },
  597. },
  598. };
  599. </script>
  600. <style scoped>
  601. @import '../../assets/css/global_table.css';
  602. /* 设置单元格内内容顶对齐 */
  603. ::v-deep .el-table__cell {
  604. display: table-cell;
  605. /* 使单元格表现为表格单元 */
  606. vertical-align: top;
  607. /* 顶对齐 el-table_2_column_2 el-table__cell */
  608. }
  609. ::v-deep .el-textarea__inner {
  610. min-height: 23px;
  611. height: 23px;
  612. line-height: 1.25;
  613. padding: 1px 15px 1px 2px;
  614. }
  615. ::v-deep .el-input__inner {
  616. min-height: 23px;
  617. height: 23px;
  618. padding: 1px 15px 1px 2px;
  619. }
  620. </style>