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.

349 lines
12 KiB

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