BianJiShouShu.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <template>
  2. <el-form ref="shouShuBiaoGe" :model="props.data" :rules="jiaoYanGuiZe" label-width="80px">
  3. <el-row>
  4. <el-col :span="12">
  5. <el-form-item label="手术" prop="opCode">
  6. <xc-combo-grid-v2 v-model="props.data"
  7. code="opCode"
  8. @row-click="clickToSelectSurgery"
  9. :table-header="tableHeader"
  10. name="opName"
  11. :query-data-func="queryOperation">
  12. </xc-combo-grid-v2>
  13. </el-form-item>
  14. </el-col>
  15. <el-col :span="12">
  16. <el-form-item label="申请时间" prop="applyDate">
  17. {{ props.data.applyDate }}
  18. </el-form-item>
  19. </el-col>
  20. <el-col :span="12">
  21. <el-form-item label="手术时间" prop="opDatetime">
  22. <el-date-picker v-model="props.data.opDatetime"
  23. @change="buildOrderName"
  24. format="YYYY-MM-DD HH:mm:ss"
  25. placeholder="time"
  26. type="datetime"
  27. value-format="YYYY-MM-DD HH:mm:ss"/>
  28. </el-form-item>
  29. </el-col>
  30. <el-col :span="12">
  31. <el-form-item label="情况">
  32. <el-switch
  33. v-model="props.data.urgentClinicFlag"
  34. :active-value="1"
  35. :inactive-value="0"
  36. active-color="#13ce66"
  37. active-text="急诊"
  38. inactive-color="#ff4949"
  39. inactive-text="择期">
  40. </el-switch>
  41. </el-form-item>
  42. </el-col>
  43. <el-col :span="12">
  44. <el-form-item label="班次">
  45. <el-switch
  46. v-model="props.data.ssbc"
  47. :active-value="1"
  48. :inactive-value="2"
  49. active-color="#13ce66"
  50. active-text="正常"
  51. inactive-color="#ff4949"
  52. inactive-text="加班">
  53. </el-switch>
  54. </el-form-item>
  55. </el-col>
  56. <el-col :span="12">
  57. <el-form-item label="术前诊断" prop="diagBeforeCode">
  58. <xc-combo-grid-v2
  59. v-model="props.data"
  60. code="diagBeforeCode"
  61. name="diagBeforeOp"
  62. :query-data-func="diagnosisInOurHospital"
  63. />
  64. </el-form-item>
  65. </el-col>
  66. <el-col :span="12">
  67. <el-form-item label="自费">
  68. <el-switch
  69. v-model="props.data.ybSelfFlag"
  70. :active-value="1"
  71. :inactive-value="0"
  72. active-color="#13ce66"
  73. active-text="是"
  74. inactive-color="#ff4949"
  75. inactive-text="否">
  76. </el-switch>
  77. </el-form-item>
  78. </el-col>
  79. <el-col :span="12">
  80. <el-form-item label="手术部位" prop="partCode">
  81. <xc-combo-grid-v2 v-model="props.data" code="partCode" name="partCodeName"
  82. :data="props.surgicalSiteList"
  83. filterable/>
  84. </el-form-item>
  85. </el-col>
  86. <el-col :span="12">
  87. <el-form-item label="手术等级" prop="opScale">
  88. <el-select v-model="props.data.opScale"
  89. :disabled="disabledOpScale">
  90. <xc-el-option :data="shouShuDengJi"/>
  91. </el-select>
  92. </el-form-item>
  93. </el-col>
  94. <el-col :span="12">
  95. <el-form-item label="麻醉方式">
  96. <xc-combo-grid-v2 v-model="props.data"
  97. @row-click="buildOrderName"
  98. filterable
  99. :data="props.anestheticMode"
  100. code-name="hocusCode"/>
  101. </el-form-item>
  102. </el-col>
  103. <el-col :span="12">
  104. <el-form-item label="主刀医生" prop="doctorZd">
  105. <xc-combo-grid-v2 v-model="props.data"
  106. code-name="doctorZd"
  107. filterable
  108. :table-header="personnel"
  109. :data="designateASurgeonInChief.length > 0 ? designateASurgeonInChief : props.personnelList"/>
  110. </el-form-item>
  111. </el-col>
  112. <el-col :span="12">
  113. <el-form-item label="第一助手">
  114. <xc-combo-grid-v2 v-model="props.data"
  115. code="doctor1" name="doctor1Name"
  116. filterable
  117. clearable
  118. :table-header="personnel"
  119. :data="props.personnelList"/>
  120. </el-form-item>
  121. </el-col>
  122. <el-col :span="12">
  123. <el-form-item label="第二助手">
  124. <xc-combo-grid-v2 v-model="props.data"
  125. code-name="doctor2"
  126. filterable
  127. clearable
  128. :table-header="personnel"
  129. :data="props.personnelList"/>
  130. </el-form-item>
  131. </el-col>
  132. <el-col :span="12">
  133. <el-form-item label="第三助手">
  134. <xc-combo-grid-v2 v-model="props.data"
  135. code-name="doctor3"
  136. filterable
  137. clearable
  138. :table-header="personnel"
  139. :data="props.personnelList"/>
  140. </el-form-item>
  141. </el-col>
  142. <el-col :span="12">
  143. <el-form-item label="麻醉医生">
  144. <xc-combo-grid-v2 v-model="props.data"
  145. code-name="doctorMz"
  146. filterable
  147. clearable
  148. :table-header="personnel"
  149. :data="props.personnelList"/>
  150. </el-form-item>
  151. </el-col>
  152. <el-col :span="12">
  153. <el-form-item label="器械护士">
  154. <xc-combo-grid-v2 v-model="props.data"
  155. code-name="nurseQx"
  156. filterable
  157. clearable
  158. :table-header="personnel"
  159. :data="props.personnelList"/>
  160. </el-form-item>
  161. </el-col>
  162. <el-col :span="12">
  163. <el-form-item label="巡回护士">
  164. <xc-combo-grid-v2 v-model="props.data"
  165. code-name="nurseXh"
  166. filterable
  167. clearable
  168. :table-header="personnel"
  169. :data="props.personnelList"/>
  170. </el-form-item>
  171. </el-col>
  172. <el-col :span="24">
  173. <el-form-item label="医嘱名:">
  174. <el-input style="width: 220px"
  175. :rows="3"
  176. type="textarea"
  177. show-word-limit
  178. maxlength="50"
  179. v-model="props.data.orderName"/>
  180. </el-form-item>
  181. </el-col>
  182. <el-col :span="24">
  183. <el-form-item label="附注说明">
  184. <el-input v-model="props.data.remark" :rows="6" maxlength="50" show-word-limit
  185. style="width: 450px;"
  186. type="textarea"/>
  187. </el-form-item>
  188. </el-col>
  189. </el-row>
  190. </el-form>
  191. </template>
  192. <script setup name="BianJiShouShu">
  193. import {ref} from "vue";
  194. import {diagnosisInOurHospital} from "@/api/zhu-yuan-yi-sheng/jian-yan-jian-cha-shen-qing";
  195. import {getDoctorByOpCode, huoQuShouShuBuWei, obtainSurgicalItems} from "@/api/zhu-yuan-yi-sheng/shou-shu-shen-qing";
  196. import {getRenYuan} from "@/api/public-api";
  197. import moment from "moment";
  198. import XcSelectV3 from "@/components/xiao-chan/select-v3/XcSelectV3.vue";
  199. import XcTableColumn from "@/components/xiao-chan/select-v3/XcTableColumn";
  200. import {getFormatDatetime} from "@/utils/date";
  201. import XcComboGrid from "@/components/xiao-chan/combo-grid/XcComboGrid.vue";
  202. import XcElOption from "@/components/xiao-chan/xc-el-option/XcElOption.vue";
  203. import XEUtils from 'xe-utils'
  204. import {xcMessage} from "@/utils/xiaochan-element-plus";
  205. import {isDev} from "@/utils/public";
  206. import XcComboGridV2 from "@/components/xiao-chan/combo-grid/XcComboGridV2.vue";
  207. const props = defineProps({
  208. anestheticMode: {
  209. type: Array,
  210. },
  211. data: Object,
  212. index: Number,
  213. personnelList: Array,
  214. surgicalSiteList: Array,
  215. })
  216. const tableHeader = [
  217. {label: '编码', prop: 'code', width: 120},
  218. {label: '名称', prop: 'name', width: 200},
  219. {label: '类型', prop: 'opTypeName', width: 100},
  220. {label: '等级', prop: 'opScale', width: 40},
  221. ]
  222. const emit = defineEmits(['qu-xiao'])
  223. const queryOperation = (val) => {
  224. return obtainSurgicalItems(val, 0)
  225. }
  226. const selectOpRow = ref({})
  227. const designateASurgeonInChief = ref([])
  228. const clickToSelectSurgery = async (val) => {
  229. designateASurgeonInChief.value = []
  230. disabledOpScale.value = false
  231. selectOpRow.value = val
  232. let res = await getDoctorByOpCode(val.code)
  233. designateASurgeonInChief.value = res
  234. yiShengShuJu.value = res
  235. if (designateASurgeonInChief.value.length > 0) {
  236. xcMessage.warning('医务部锁定手术主刀医生无法修改');
  237. }
  238. if (val.opScale !== null) {
  239. disabledOpScale.value = true
  240. props.data.opScale = gradeToCode(val.opScale)
  241. xcMessage.warning('医务部锁定手术等级无法修改')
  242. }
  243. buildOrderName()
  244. }
  245. const disabledOpScale = ref(false)
  246. // 医生信息
  247. const yiShengShuJu = ref([])
  248. const personnel = [
  249. {label: '编码', prop: 'code', width: 46},
  250. {label: '名称', prop: 'name', width: 56},
  251. {label: '科室', prop: 'deptName', width: 92},
  252. {label: '级别', prop: 'empTitName', width: 105},
  253. ]
  254. const shouShuBiaoGe = ref()
  255. // 时间校验
  256. const shenQingShiJian = (rule, value, callback) => {
  257. const oDate1 = moment(value).format('YYYY-MM-DD HH:mm:ss')
  258. const oDate2 = moment(props.data.applyDate).format('YYYY-MM-DD HH:mm:ss')
  259. if (moment(oDate1).isBefore(moment(oDate2))) {
  260. callback(new Error('手术时间不能小于申请时间'))
  261. } else {
  262. callback()
  263. }
  264. }
  265. // 校验数据
  266. const jiaoYanGuiZe = ref({
  267. opCode: [{required: true, message: '项目编码不能为空', trigger: 'blur'}],
  268. opName: [{required: true, message: '项目名称不能为空', trigger: 'blur'}],
  269. applyDate: [{required: true, message: '申请时间不能为空', trigger: 'blur'}],
  270. opDatetime: [{required: true, message: '手术时间不能为空', trigger: 'blur'},
  271. {validator: shenQingShiJian, trigger: 'blur'}],
  272. diagBeforeCode: [{required: true, message: '术前诊断不能为空', trigger: 'blur'}],
  273. partCode: [{required: true, message: '手术部位不能为空', trigger: 'blur'}],
  274. doctorZd: [{required: true, message: '主刀医生不能为空', trigger: 'blur'}],
  275. opScale: [{required: true, message: '手术等级不能为空', trigger: 'blur'}],
  276. })
  277. const buildOrderName = () => {
  278. props.data.orderName =
  279. `拟于${getFormatDatetime(props.data.opDatetime, 'YYYY-MM-DD HH:mm')}在${props.data.hocusCodeName === null ? '' : props.data.hocusCodeName}下行${props.data.opName}`
  280. }
  281. const shouShuDengJi = [
  282. {code: 1, name: '四级', value: 4},
  283. {code: 2, name: '三级', value: 3},
  284. {code: 3, name: '二级', value: 2},
  285. {code: 4, name: '一级', value: 1},
  286. ]
  287. const gradeToCode = (val) => {
  288. return XEUtils.filter(shouShuDengJi, (item) => {
  289. return item.value === val
  290. })[0].code
  291. }
  292. </script>
  293. <style scoped>
  294. </style>