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.

278 lines
10 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
  1. <template>
  2. <div style="display: flex;">
  3. <div :style="`width:${sumWidth}px;`">
  4. <el-table id="tableSummary" row-key="id" :data="doctorCheck.checkSummaryList" size="samll" :height="sumHeight"
  5. width="100%" border>
  6. <el-table-column type="index" width="25" align="center" />
  7. <el-table-column prop="summary" label="小结">
  8. <template slot="header">
  9. <div style="display: flex;justify-content:space-between;">
  10. <div>小结</div>
  11. <div style="display: flex;">
  12. <div v-show="checkPagePriv(pagePriv.privs, '生成小结')">
  13. <el-button type="primary" class="btnClass" @click="btnMakeDiagnosis">生成小结</el-button>
  14. </div>
  15. <div v-show="checkPagePriv(pagePriv.privs, '新增小结')">
  16. <el-button type="primary" class="btnClass" @click="addSummary">新增小结</el-button>
  17. </div>
  18. <div v-show="checkPagePriv(pagePriv.privs, '保存结果')">
  19. <el-button type="primary" class="btnClass" @click="save">保存结果</el-button>
  20. </div>
  21. <div v-show="checkPagePriv(pagePriv.privs, '审核')">
  22. <el-button type="primary" class="btnClass" style="min-width: 40px;" @click="audit">审核</el-button>
  23. </div>
  24. <div v-show="checkPagePriv(pagePriv.privs, '排队')">
  25. <el-button type="primary" class="btnClass" style="min-width: 40px;" @click="btnLineUp">排队</el-button>
  26. </div>
  27. </div>
  28. </div>
  29. </template>
  30. <template slot-scope="scope">
  31. <div style="display: flex;">
  32. <el-input type="textarea" v-model="scope.row.summary" :autosize="{ minRows: 1, maxRows: 100 }"
  33. :disabled="doctorCheck.RegisterCheckEdit.completeFlag == '1' || doctorCheck.RegisterCheckEdit.completeFlag == '2'"
  34. placeholder="请输入小结">
  35. </el-input>
  36. <el-button type="danger" style="min-width:23px;padding:2px;" icon="el-icon-delete"
  37. @click="delSum(scope.$index)"
  38. :disabled="doctorCheck.RegisterCheckEdit.completeFlag == '1' || doctorCheck.RegisterCheckEdit.completeFlag == '2'"
  39. size="small"></el-button>
  40. </div>
  41. </template>
  42. </el-table-column>
  43. </el-table>
  44. </div>
  45. <div :style="`margin-left:2px;width:${sumWidth}px;`">
  46. <el-table id="tableSuggestion" row-key="id" :data="doctorCheck.checkSuggestionList" size="samll" :height="sumHeight"
  47. width="100%" border>
  48. <el-table-column type="index" width="25" align="center" />
  49. <el-table-column prop="suggestion" label="建议">
  50. <template slot="header">
  51. <div style="display: flex;justify-content:space-between;">
  52. <div>建议</div>
  53. <div style="display: flex;">
  54. <div v-show="checkPagePriv(pagePriv.privs, '新增建议')">
  55. <el-button type="primary" class="btnClass" @click="addSuggestion"
  56. :disabled="doctorCheck.RegisterCheckEdit.completeFlag == '1' || doctorCheck.RegisterCheckEdit.completeFlag == '2'">新增建议</el-button>
  57. </div>
  58. </div>
  59. </div>
  60. </template>
  61. <template slot-scope="scope">
  62. <div style="display: flex;">
  63. <el-input type="textarea" v-model="scope.row.suggestion" :autosize="{ minRows: 1, maxRows: 100 }"
  64. :disabled="doctorCheck.RegisterCheckEdit.completeFlag == '1' || doctorCheck.RegisterCheckEdit.completeFlag == '2'"
  65. placeholder="请输入建议">
  66. </el-input>
  67. <el-button type="danger" style="min-width:23px;padding:2px;" icon="el-icon-delete"
  68. @click="delSug(scope.$index)"
  69. :disabled="doctorCheck.RegisterCheckEdit.completeFlag == '1' || doctorCheck.RegisterCheckEdit.completeFlag == '2'"
  70. size="small"></el-button>
  71. </div>
  72. </template>
  73. </el-table-column>
  74. </el-table>
  75. </div>
  76. </div>
  77. </template>
  78. <script>
  79. import { mapState } from 'vuex';
  80. import Sortable from "sortablejs";
  81. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  82. import { getPagePriv, checkPagePriv, deepCopy } from "../../utlis/proFunc";
  83. export default {
  84. components: {},
  85. props: ["registerCheckId", "isCheckPicture", "optGrant", "addSummary", "btnMakeDiagnosis", "save", "audit", "unAudit", "btnLineUp"],
  86. data() {
  87. return {
  88. pagePriv: {
  89. routeUrlorPageName: 'doctorCheck', //当前页面归属路由或归属页面权限名称
  90. privs: [] // 页面权限
  91. },
  92. };
  93. },
  94. created() {
  95. //获取用户当前页面的权限
  96. let userPriv = window.sessionStorage.getItem('userPriv')
  97. if (userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName))
  98. },
  99. //挂载完成
  100. mounted() {
  101. this.rowDrop();
  102. this.rowDropSuggestion()
  103. },
  104. computed: {
  105. ...mapState(['window', 'dataTransOpts', 'dict', 'doctorCheck']),
  106. //小结宽度
  107. sumWidth() {
  108. return Math.floor((this.window.pageWidth - 200 - 110 - 15 - 4) / 2);
  109. },
  110. //小结高度
  111. sumHeight() {
  112. return this.window.pageHeight < 600 ? Math.floor((480 - (this.isCheckPicture ? 110 : 0)) * 2 / 5) : Math.floor((this.window.pageHeight - 120 - (this.isCheckPicture ? 110 : 0)) * 2 / 5);
  113. }
  114. },
  115. methods: {
  116. checkPagePriv,
  117. //获取小结
  118. checkSummaryList(RegisterCheckId) {
  119. if (!RegisterCheckId) {
  120. this.doctorCheck.checkSummaryList = [];
  121. return;
  122. }
  123. // console.log(`/api/app/registerchecksummary/getregisterchecksummarylist?RegisterCheckId=${RegisterCheckId}`)
  124. getapi(`/api/app/registerchecksummary/getregisterchecksummarylist?RegisterCheckId=${RegisterCheckId}`)
  125. .then((res) => {
  126. console.log("checkSummaryList", res.data);
  127. if (res.code != -1) {
  128. this.doctorCheck.checkSummaryList = res.data;
  129. }
  130. })
  131. .catch((err) => {
  132. this.$message({ type: "error", message: `操作失败,原因:${err}` });
  133. });
  134. },
  135. //获取建议
  136. checkSuggestionList(RegisterCheckId) {
  137. if (!RegisterCheckId) {
  138. this.doctorCheck.checkSuggestionList = [];
  139. return;
  140. }
  141. // console.log(`/api/app/registerchecksuggestion/getregisterchecksuggestionlist?RegisterCheckId=${RegisterCheckId}`)
  142. getapi(`/api/app/registerchecksuggestion/getregisterchecksuggestionlist?RegisterCheckId=${RegisterCheckId}`)
  143. .then((res) => {
  144. console.log("checkSuggestionList", res.data);
  145. if (res.code != -1) {
  146. this.doctorCheck.checkSuggestionList = res.data;
  147. }
  148. })
  149. .catch((err) => {
  150. this.$message({ type: "error", message: `操作失败,原因:${err}` });
  151. });
  152. },
  153. //拖拽
  154. rowDrop() {
  155. this.$nextTick(() => {
  156. const el = document.querySelector("#tableSummary tbody");
  157. console.log('el0', el)
  158. const that = this;
  159. Sortable.create(el, {
  160. animation: 150, // ms, number 单位:ms,定义排序动画的时间
  161. //拖拽结束
  162. onEnd({ newIndex, oldIndex }) {
  163. that.isshow = false;
  164. const currRow = that.doctorCheck.checkSummaryList.splice(oldIndex, 1)[0];
  165. that.doctorCheck.checkSummaryList.splice(newIndex, 0, currRow);
  166. console.log('el', el)
  167. },
  168. });
  169. });
  170. },
  171. //拖拽
  172. rowDropSuggestion() {
  173. this.$nextTick(() => {
  174. const el = document.querySelector("#tableSuggestion tbody");
  175. //console.log('tbody',tbody)
  176. const that = this;
  177. Sortable.create(el, {
  178. animation: 150, // ms, number 单位:ms,定义排序动画的时间
  179. //拖拽结束
  180. onEnd({ newIndex, oldIndex }) {
  181. that.isshow = false;
  182. const currRow = that.doctorCheck.checkSuggestionList.splice(oldIndex, 1)[0];
  183. that.doctorCheck.checkSuggestionList.splice(newIndex, 0, currRow);
  184. },
  185. });
  186. });
  187. },
  188. //删除小结
  189. delSum(index) {
  190. this.$confirm("此操作将删除该记录, 是否继续?", "提示", {
  191. confirmButtonText: "是",
  192. cancelButtonText: "否",
  193. type: "warning",
  194. }).then(() => {
  195. this.doctorCheck.checkSummaryList.splice(index, 1);
  196. }).catch(err => {
  197. if (err == "cancel") {
  198. // this.$message.info("已取消删除");
  199. console.log('已取消删除')
  200. }
  201. });
  202. },
  203. addSuggestion() {
  204. this.doctorCheck.checkSuggestionList.push({
  205. id: Math.random(),
  206. registerCheckId: this.doctorCheck.RegisterCheckEdit.id,
  207. suggestion: '',
  208. })
  209. },
  210. //删除建议明细
  211. delSug(index) {
  212. this.$confirm("此操作将删除该记录, 是否继续?", "提示", {
  213. confirmButtonText: "是",
  214. cancelButtonText: "否",
  215. type: "warning",
  216. }).then(() => {
  217. this.doctorCheck.checkSuggestionList.splice(index, 1);
  218. }).catch((err) => {
  219. if (err == "cancel") {
  220. // this.$message.info("已取消删除");
  221. console.log('已取消删除')
  222. }
  223. });
  224. },
  225. },
  226. //监听事件
  227. watch: {
  228. //检查项目切换
  229. // "doctorCheck.RegisterCheckId"(newVal, oldVal) {
  230. // console.log("watch doctorCheck.RegisterCheckId newVal:", newVal, " oldVal:", oldVal);
  231. // this.checkSummaryList(newVal)
  232. // this.checkSuggestionList(newVal)
  233. // },
  234. //检查项目未切换换时 也可以强制刷新数据
  235. "dataTransOpts.refresh.register_check.S": {
  236. immediate: true,
  237. handler(newVal, oldVal) {
  238. console.log(`watch 小结 newVal:${newVal} oldVal:${oldVal} registerCheckId: ${this.dataTransOpts.tableS.register_check.id}`);
  239. this.checkSummaryList(this.dataTransOpts.tableS.register_check.id)
  240. this.checkSuggestionList(this.dataTransOpts.tableS.register_check.id)
  241. }
  242. },
  243. },
  244. };
  245. </script>
  246. <style scoped>
  247. @import '../../assets/css/global_table.css';
  248. .btnClass {
  249. margin-left: 2px;
  250. height: 22px;
  251. padding: 2px 2px;
  252. /*原始 默认值 500 */
  253. }
  254. ::v-deep .el-textarea__inner {
  255. min-height: 23px;
  256. height: 23px;
  257. line-height: 1.25;
  258. padding: 1px 15px 1px 2px;
  259. }</style>