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.

152 lines
5.3 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
  1. <template>
  2. <div style="display: flex;">
  3. <div :style="'width:'+Math.floor((window.pageWidth - 200 - 110 - 45 - 4)/2) + 'px;'">
  4. <el-table id="tableSummary" row-key="id" :data="doctorCheck.checkSummaryList" size="samll"
  5. :height="window.pageHeight < 600 ? Math.floor((395 - (isCheckPicture ? 100:0))*2/5):Math.floor((window.pageHeight - 205 - (isCheckPicture ? 100:0))*2/5)"
  6. width="100%" border @row-click="rowClick">
  7. <el-table-column prop="summary" label="小结" >
  8. <template slot-scope="scope">
  9. <el-input type="textarea" v-model="scope.row.summary" :autosize="{ minRows: 1, maxRows: 100 }"
  10. :disabled="doctorCheck.RegisterCheckEdit.completeFlag=='1' || doctorCheck.RegisterCheckEdit.completeFlag=='2'" placeholder="请输入小结">
  11. </el-input>
  12. </template>
  13. </el-table-column>
  14. </el-table>
  15. </div>
  16. <div :style="'margin-left:2px;width:'+Math.floor((window.pageWidth - 200 - 110 - 45 - 4)/2) + 'px;'">
  17. <el-table id="tableSuggestion" row-key="id" :data="doctorCheck.checkSuggestionList" size="samll"
  18. :height="window.pageHeight < 600 ? Math.floor((395 - (isCheckPicture ? 100:0))*2/5):Math.floor((window.pageHeight - 205 - (isCheckPicture ? 100:0))*2/5)"
  19. width="100%" border @row-click="rowClick">
  20. <el-table-column prop="suggestion" label="建议" >
  21. <template slot-scope="scope">
  22. <el-input type="textarea" v-model="scope.row.suggestion" :autosize="{ minRows: 1, maxRows: 100 }"
  23. :disabled="doctorCheck.RegisterCheckEdit.completeFlag=='1' || doctorCheck.RegisterCheckEdit.completeFlag=='2'" placeholder="请输入建议">
  24. </el-input>
  25. </template>
  26. </el-table-column>
  27. </el-table>
  28. </div>
  29. </div>
  30. </template>
  31. <script lang="ts">
  32. import { mapState } from 'vuex';
  33. import Sortable from "sortablejs";
  34. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  35. export default {
  36. components: {},
  37. props:["isCheckPicture"],
  38. data() {
  39. return {
  40. };
  41. },
  42. created() { },
  43. //挂载完成
  44. mounted() {
  45. this.rowDrop();
  46. this.rowDropSuggestion()
  47. },
  48. computed: {
  49. ...mapState(['window','dict', 'doctorCheck']),
  50. },
  51. methods: {
  52. //获取小结
  53. checkSummaryList(RegisterCheckId) {
  54. if(!RegisterCheckId){
  55. this.doctorCheck.checkSummaryList = [];
  56. return;
  57. }
  58. // console.log(`/api/app/registerchecksummary/getregisterchecksummarylist?RegisterCheckId=${RegisterCheckId}`)
  59. getapi(`/api/app/registerchecksummary/getregisterchecksummarylist?RegisterCheckId=${RegisterCheckId}`)
  60. .then((res) => {
  61. console.log("checkSummaryList", res.data);
  62. if (res.code != -1) {
  63. this.doctorCheck.checkSummaryList = res.data;
  64. }
  65. })
  66. .catch((err) => {
  67. this.$message({ type: "error", message: `操作失败,原因:${err}` });
  68. });
  69. },
  70. //获取建议
  71. checkSuggestionList(RegisterCheckId) {
  72. if(!RegisterCheckId){
  73. this.doctorCheck.checkSuggestionList = [];
  74. return;
  75. }
  76. // console.log(`/api/app/registerchecksuggestion/getregisterchecksuggestionlist?RegisterCheckId=${RegisterCheckId}`)
  77. getapi(`/api/app/registerchecksuggestion/getregisterchecksuggestionlist?RegisterCheckId=${RegisterCheckId}`)
  78. .then((res) => {
  79. console.log("checkSuggestionList", res.data);
  80. if (res.code != -1) {
  81. this.doctorCheck.checkSuggestionList = res.data;
  82. }
  83. })
  84. .catch((err) => {
  85. this.$message({ type: "error", message: `操作失败,原因:${err}` });
  86. });
  87. },
  88. //选择组合项目
  89. rowClick(row) {
  90. },
  91. //拖拽
  92. rowDrop() {
  93. this.$nextTick(() => {
  94. const el = document.querySelector("#tableSummary tbody");
  95. console.log('el0',el)
  96. const that = this;
  97. Sortable.create(el, {
  98. animation: 150, // ms, number 单位:ms,定义排序动画的时间
  99. //拖拽结束
  100. onEnd({ newIndex, oldIndex }) {
  101. that.isshow = false;
  102. const currRow = that.doctorCheck.checkSummaryList.splice(oldIndex, 1)[0];
  103. that.doctorCheck.checkSummaryList.splice(newIndex, 0, currRow);
  104. console.log('el',el)
  105. },
  106. });
  107. });
  108. },
  109. //拖拽
  110. rowDropSuggestion() {
  111. this.$nextTick(() => {
  112. const el = document.querySelector("#tableSuggestion tbody");
  113. //console.log('tbody',tbody)
  114. const that = this;
  115. Sortable.create(el, {
  116. animation: 150, // ms, number 单位:ms,定义排序动画的时间
  117. //拖拽结束
  118. onEnd({ newIndex, oldIndex }) {
  119. that.isshow = false;
  120. const currRow = that.doctorCheck.checkSuggestionList.splice(oldIndex, 1)[0];
  121. that.doctorCheck.checkSuggestionList.splice(newIndex, 0, currRow);
  122. },
  123. });
  124. });
  125. },
  126. },
  127. //监听事件
  128. watch: {
  129. //检查项目切换
  130. "doctorCheck.RegisterCheckId"(newVal, oldVal) {
  131. console.log("watch doctorCheck.RegisterCheckId newVal:", newVal, " oldVal:", oldVal);
  132. this.checkSummaryList(newVal)
  133. this.checkSuggestionList(newVal)
  134. },
  135. },
  136. };
  137. </script>
  138. <style scoped>
  139. @import '../../assets/css/global_table.css';
  140. </style>