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.

699 lines
31 KiB

3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
5 months ago
4 months ago
1 year 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
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
5 months ago
2 years ago
3 years ago
5 months ago
2 years ago
5 months ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
5 months ago
2 years ago
10 months ago
1 year ago
3 months ago
1 year ago
3 months ago
1 year ago
2 years ago
3 months 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
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 months ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 months ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
1 year ago
1 year ago
1 year ago
3 months ago
3 months ago
3 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 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
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
3 years ago
5 months ago
2 years ago
2 years ago
5 months ago
2 years ago
2 years ago
5 months ago
2 years ago
2 years ago
5 months 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
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
5 months ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
1 year 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
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
1 year ago
2 years ago
3 months ago
1 year ago
1 year ago
3 months ago
1 year ago
2 years ago
3 months ago
1 year ago
3 months ago
1 year ago
3 months ago
1 year ago
3 months ago
1 year ago
3 months ago
1 year ago
1 year ago
3 months ago
3 months ago
3 months ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 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
3 years ago
2 years ago
3 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
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
5 months 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
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
5 months ago
2 years ago
3 years ago
5 months ago
3 years ago
5 months ago
2 years ago
3 years ago
3 years ago
2 years ago
5 months ago
2 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
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
5 months ago
3 years ago
3 years ago
2 years ago
  1. <template>
  2. <div>
  3. <div v-show="checkPagePriv(pagePriv.privs, '人员列表')" class="listBtn">
  4. <el-button type="primary" class="commonbutton" @click="prList">人员列表</el-button>
  5. </div>
  6. <div v-show="checkPagePriv(pagePriv.privs, '医生诊台')" class="listBtn">
  7. <el-button type="primary" class="commonbutton" @click="toDoctorCheck">医生诊台</el-button>
  8. </div>
  9. <div v-show="checkPagePriv(pagePriv.privs, '导入结果')" class="listBtn">
  10. <el-dropdown @command="btnImportResult">
  11. <el-button type="primary" class="commonbutton">
  12. 导入结果<i class="el-icon-arrow-down el-icon--right"></i>
  13. </el-button>
  14. <el-dropdown-menu slot="dropdown">
  15. <el-dropdown-item command="pacs" :disabled="sumBtnDisabled('save')"
  16. v-show="checkPagePriv(pagePriv.privs, '导入检查结果')">导入检查结果</el-dropdown-item>
  17. <el-dropdown-item command="lis" :disabled="sumBtnDisabled('save')"
  18. v-show="checkPagePriv(pagePriv.privs, '导入检验结果')">导入检验结果</el-dropdown-item>
  19. <el-dropdown-item command="diAn" :disabled="sumBtnDisabled('save')"
  20. v-show="checkPagePriv(pagePriv.privs, '导入迪安结果')">导入迪安结果</el-dropdown-item>
  21. </el-dropdown-menu>
  22. </el-dropdown>
  23. </div>
  24. <!--AI诊断不控制权限 v-show="checkPagePriv(pagePriv.privs, 'AI诊断')" :disabled="sumBtnDisabled('save')"-->
  25. <div class="listBtn">
  26. <el-button slot="reference" class="commonbutton" @click="btnAIdiagnosis(false)">AI诊断</el-button>
  27. </div>
  28. <div v-show="checkPagePriv(pagePriv.privs, '保存')" class="listBtn">
  29. <el-button type="primary" class="commonbutton" @click="btnSave"
  30. :disabled="sumBtnDisabled('save')">保存</el-button>
  31. </div>
  32. <div v-show="checkPagePriv(pagePriv.privs, '修改')" class="listBtn">
  33. <el-button type="primary" class="commonbutton" @click="btnEdit"
  34. :disabled="sumBtnDisabled('edit')">修改</el-button>
  35. </div>
  36. <div v-show="checkPagePriv(pagePriv.privs, '取消总检')" class="listBtn">
  37. <el-button type="primary" class="commonbutton" @click="btnDel"
  38. :disabled="sumBtnDisabled('del')">取消总检</el-button>
  39. </div>
  40. <div v-show="checkPagePriv(pagePriv.privs, '审核')" class="listBtn">
  41. <el-button type="primary" class="commonbutton" @click="audit"
  42. :disabled="sumBtnDisabled('audit')">审核</el-button>
  43. </div>
  44. <div v-show="checkPagePriv(pagePriv.privs, '取消审核')" class="listBtn">
  45. <el-button type="primary" class="commonbutton" @click="unAudit"
  46. :disabled="sumBtnDisabled('unAudit')">取消审核</el-button>
  47. </div>
  48. <!-- 直接放在 建议旁边
  49. <div class="listBtn">
  50. <el-button type="primary" class="btnClass" @click="addDiagnosis">疾病诊断</el-button>
  51. </div>
  52. -->
  53. <div v-show="checkPagePriv(pagePriv.privs, '体检报告')" class="listBtn">
  54. <el-button type="primary" class="commonbutton" @click="btnReport"
  55. :disabled="sumBtnDisabled('report')">体检报告</el-button>
  56. </div>
  57. <div v-show="checkPagePriv(pagePriv.privs, '复查')" class="listBtn">
  58. <el-button type="primary" class="commonbutton" @click="btnReCheck"
  59. :disabled="sumBtnDisabled('reCheck')">复查</el-button>
  60. </div>
  61. <div v-show="checkPagePriv(pagePriv.privs, '随访')" class="listBtn">
  62. <el-button type="primary" class="commonbutton" @click="btnReCall"
  63. :disabled="sumBtnDisabled('reCall')">随访</el-button>
  64. </div>
  65. <div v-show="false" class="listBtn">
  66. <el-button type="primary" class="commonbutton" @click="btnIntervene"
  67. :disabled="sumBtnDisabled('intervene')">干预措施</el-button>
  68. </div>
  69. <div v-show="checkPagePriv(pagePriv.privs, '职业病')" class="listBtn">
  70. <el-button type="primary" class="commonbutton" @click="btnOcc"
  71. :disabled="sumBtnDisabled('btnOcc')">职业病</el-button>
  72. </div>
  73. <div class="listBtn">
  74. <el-button type="primary" class="commonbutton" @click="btnReset">重置</el-button>
  75. </div>
  76. <!-- AI诊断所有小结信息-->
  77. <div v-show="AI.visible"
  78. :style="`z-index:3;border-radius: 10px;border: 1px solid #ddd;background-color:#FFF; position: absolute;top:50px;left:0px;width:${AI.width}px;height: ${AI.height}px;opacity:1;`">
  79. <div v-show="AI.max" style="display: flex;justify-content: space-between;">
  80. <p>AI诊断内容</p>
  81. <el-tooltip content="隐藏 AI诊断内容" placement="top">
  82. <i class="el-icon-minus" @click="btnAImax(AI.max)"
  83. style="font-size: 24px;color: red;cursor:pointer;"></i>
  84. </el-tooltip>
  85. </div>
  86. <div v-show="!AI.max">
  87. <el-tooltip content="显示 AI诊断内容" placement="top">
  88. <i class="el-icon-plus" @click="btnAImax(AI.max)"
  89. style="font-size: 24px;color: red;cursor:pointer;"></i>
  90. </el-tooltip>
  91. </div>
  92. <!-- <el-input v-show="AI.max" type="textarea" v-model="AI.diagnosis" placeholder="AI诊断内容"
  93. :autosize="{ minRows: AIDH, maxRows: AIDH }" style="text-align: right;">
  94. </el-input> -->
  95. <div ref="aiContent" v-html="AI.html" :style="`height:${AI.height - 42 - 48}px;overflow-y: auto;display: blockresize:vertical;padding: 5px 5px 5px 20px;line-height: 1.5;box-sizing: border-box;width: 100%;font-size: inherit;background-color: #fff;background-image: none;border: 1px solid #dcdfe6;border-radius: 4px;transition: border-color .2s cubic-bezier(.645, .045, .355, 1);`"></div>
  96. <div v-show="AI.max" style="text-align: right; margin-top: 10px;">
  97. <el-button class="commonbutton" @click="AI.visible = false">关闭</el-button>
  98. <el-button class="commonbutton" @click="btnAIdiagnosis(true)">AI重新诊断</el-button>
  99. </div>
  100. </div>
  101. <div v-show="sumDoctorCheck.sumDoctorCheckDialogVisible"
  102. :style="`z-index:3;border-radius: 10px;border: 1px solid #ddd;background-color:#FFF; position: absolute;top:50px;right:120px;width:350px;height: ${window.pageHeight - 42 - 10}px;opacity:1;`">
  103. <PatientRegisterList win="sumDoctorCheck" :winAbsolute="true" />
  104. </div>
  105. <el-dialog title="职业病" :visible.sync="dialogWin.OccDisease" width="800px" :close-on-click-modal="false"
  106. :append-to-body="true">
  107. <OccDisease />
  108. </el-dialog>
  109. <!-- 抽屉方式遮罩层不能操作
  110. <el-drawer title="体检人员列表" :visible.sync="sumDoctorCheck.sumDoctorCheckDialogVisible" direction="rtl"
  111. :wrapperClosable="false" :modal="false" :size="300">
  112. <PatientRegisterList :win="sumDoctorCheck" :winAbsolute="false"/>
  113. </el-drawer>
  114. -->
  115. <!-- 直接放在 建议旁边
  116. <el-drawer title="诊断列表" :visible.sync="sumDoctorCheck.sumDiagnosisVisible" direction="ltr" :size="300"
  117. :wrapperClosable="false">
  118. <SumDiagnosis :patientRegisterId="dataTransOpts.tableS.patient_register.id" />
  119. </el-drawer>
  120. -->
  121. </div>
  122. </template>
  123. <script>
  124. import { mapState } from "vuex";
  125. import { getapi, postapi, putapi, deletapi, fetchStream } from "@/api/api";
  126. import { getPagePriv, checkPagePriv, deepCopy } from "../../utlis/proFunc";
  127. import PatientRegisterList from "../doctorCheck/PatientRegisterList.vue";
  128. import SumDiagnosis from "./SumDiagnosis.vue";
  129. import OccDisease from "../../components/occDisease/OccDisease.vue"
  130. import moment from "moment";
  131. import MarkdownIt from "markdown-it";
  132. const md = new MarkdownIt();
  133. export default {
  134. components: {
  135. PatientRegisterList,
  136. SumDiagnosis,
  137. OccDisease
  138. },
  139. data() {
  140. return {
  141. pagePriv: {
  142. routeUrlorPageName: 'sumDoctorCheck', //当前页面归属路由或归属页面权限名称
  143. privs: [] // 页面权限
  144. },
  145. dialogVisible: false,
  146. tableData: [
  147. {
  148. col: 'col',
  149. details: [{ id: 1, name: '000' }, { id: 2, name: '001' }]
  150. }
  151. ],
  152. summary_check_doctor_alias: ["总检", "审核"],
  153. AI: {
  154. width: 500,
  155. height: 24,
  156. max: true,
  157. visible: false,
  158. diagnosis: 'AI诊断信息',
  159. rawText: '',
  160. html: ""
  161. },
  162. };
  163. },
  164. created() {
  165. //获取用户当前页面的权限
  166. let userPriv = window.sessionStorage.getItem('userPriv')
  167. if (userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName))
  168. this.AI.height = this.frameHeight
  169. },
  170. //挂载完成
  171. mounted() {
  172. postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId: "summary_check_doctor_alias" })
  173. .then(res => {
  174. if (res.code > -1) {
  175. this.summary_check_doctor_alias = JSON.parse(res.data)
  176. }
  177. })
  178. },
  179. computed: {
  180. ...mapState(["window", "dict", "dataTransOpts", "dialogWin", "patientRegister", "doctorCheck", "sumDoctorCheck"]),
  181. frameHeight() {
  182. return this.window.pageHeight - 42 - 10
  183. },
  184. // AIdiagnosisHeight
  185. AIDH() {
  186. return Math.floor((this.AI.height - 24 - 42 - 4) / 21.5)
  187. }
  188. },
  189. methods: {
  190. checkPagePriv,
  191. prList() {
  192. this.sumDoctorCheck.sumDoctorCheckDialogVisible = true
  193. },
  194. //诊断列表
  195. addDiagnosis() {
  196. this.sumDoctorCheck.sumDiagnosisVisible = true
  197. },
  198. //to医生诊台
  199. toDoctorCheck() {
  200. // this.doctorCheck.prBase = Object.assign({},this.dataTransOpts.tableS.patient_register)
  201. // this.patientRegister.photo = this.doctorCheck.prBase.photo
  202. this.$router.push({ path: "/doctorCheck", query: { patient_register: this.dataTransOpts.tableS.patient_register } });
  203. },
  204. // 按钮可用
  205. sumBtnDisabled(btnFlagName) {
  206. let patientRegister = this.dataTransOpts.tableS.patient_register
  207. let ret = true
  208. //' 请选择体检人员'
  209. if (!patientRegister.id) return ret
  210. // '人员已锁定,不可执行此操作'
  211. if (patientRegister.isLock && patientRegister.isLock == 'Y') return ret
  212. switch (btnFlagName) {
  213. case 'addSuggtion':
  214. case 'save':
  215. if (patientRegister.completeFlag && patientRegister.completeFlag != '3') ret = false
  216. break;
  217. case 'edit':
  218. case 'del':
  219. case 'audit':
  220. if (patientRegister.completeFlag && patientRegister.completeFlag == '3' && patientRegister.isAudit != 'Y') ret = false
  221. break;
  222. case 'unAudit':
  223. case 'reCheck':
  224. if (patientRegister.completeFlag && patientRegister.completeFlag == '3' && patientRegister.isAudit && patientRegister.isAudit == 'Y') ret = false
  225. break;
  226. case 'report':
  227. ret = false
  228. break;
  229. case 'intervene':
  230. if (patientRegister.completeFlag && patientRegister.completeFlag == '3') ret = false
  231. break;
  232. case 'btnOcc':
  233. if (patientRegister.isPatientOccupationalDisease && patientRegister.isPatientOccupationalDisease == 'Y') ret = false
  234. break;
  235. default:
  236. ret = false
  237. break;
  238. }
  239. console.log('sumBtnDisabled btnFlagName, patientRegister,ret', btnFlagName, patientRegister, ret)
  240. return ret
  241. },
  242. // 导入结果(检查、检验、迪安)
  243. btnImportResult(checkType) {
  244. if (!this.dataTransOpts.tableS.patient_register.id) {
  245. this.$message.warning({ showClose: true, message: "请先选择记录!" })
  246. return
  247. }
  248. let url = '/api/app/ImportLisResult/ImportResultByPatientRegisterId'
  249. let patientRegisterId = this.dataTransOpts.tableS.patient_register.id
  250. switch (checkType) {
  251. case 'pacs':
  252. url = '/api/app/ImportPacsResult/ImportResultByPatientRegisterId'
  253. postapi(url, { patientRegisterId })
  254. .then(res => {
  255. if (res.code > -1) {
  256. // 心电图(格尔木)
  257. return postapi('/api/app/ImportElectrocardiogramResult/ImportElectrocardiogramResultByPatientRegisterId', { patientRegisterId })
  258. }
  259. })
  260. .then(res => {
  261. if (res && res.code > -1) {
  262. this.$message.success({ showClose: true, message: '导入成功!' })
  263. }
  264. })
  265. break;
  266. case 'diAn':
  267. url = "/api/app/ImportLisResult/ImportDianResultByPatientRegisterId";
  268. postapi(url, { patientRegisterId }).then(res => {
  269. if (res.code > -1) {
  270. this.$message.success({ showClose: true, message: '导入成功!' })
  271. }
  272. })
  273. break;
  274. default: //lis
  275. postapi(url, { patientRegisterId }).then(res => {
  276. if (res.code > -1) {
  277. this.$message.success({ showClose: true, message: '导入成功!' })
  278. }
  279. })
  280. break;
  281. }
  282. },
  283. //保存数据
  284. btnSave() {
  285. let body = {
  286. patientRegisterId: this.dataTransOpts.tableS.patient_register.id,
  287. summaryDoctorId: this.dataTransOpts.tableS.patient_register.summaryDoctorId || null,
  288. summaryDate: this.dataTransOpts.tableS.patient_register.summaryDate || moment(new Date()).format("yyyy-MM-DD HH:mm:ss"),
  289. medicalConclusionId: this.dataTransOpts.tableS.patient_register.medicalConclusionId || null,
  290. summaryHistoricalReview:this.sumDoctorCheck.historySummary,
  291. sumSummarys: this.sumDoctorCheck.summaryList,
  292. sumSuggestions: this.sumDoctorCheck.suggestionList
  293. }
  294. // 检查综述建议是否同一个人,防止不同人员数据覆盖
  295. let message = ''
  296. for (let index = 0; index < this.sumDoctorCheck.summaryList.length; index++) {
  297. let e = this.sumDoctorCheck.summaryList[index];
  298. if (!e.patientRegisterId || e.patientRegisterId != this.dataTransOpts.tableS.patient_register.id) {
  299. message = "人员ID 与 综述人员ID 不一致"
  300. break
  301. }
  302. }
  303. if (!message) {
  304. let male_disable_keywords = ['子宫', '宫颈', '卵巢', '白带', '阴道']
  305. let female_disable_keywords = ['睾丸', '阴茎']
  306. let disable_keywords = []
  307. switch (this.dataTransOpts.tableS.patient_register.sexId) {
  308. case 'M':
  309. case 'F':
  310. disable_keywords = this.dataTransOpts.tableS.patient_register.sexId == 'M' ? male_disable_keywords : female_disable_keywords
  311. disable_keywords.forEach(key => {
  312. this.sumDoctorCheck.summaryList.forEach(e => {
  313. if (e.summaryTitle && e.summaryTitle.indexOf(key) > -1) message = `当前患者性别为:${this.dataTransOpts.tableS.patient_register.sexName} 报告不应出现 ${key} 字眼`
  314. if (e.details) {
  315. e.details.forEach(d => {
  316. if (d.summaryContent && d.summaryContent.indexOf(key) > -1) message = `当前患者性别为:${this.dataTransOpts.tableS.patient_register.sexName} 报告不应出现 ${key} 字眼`
  317. });
  318. }
  319. });
  320. this.sumDoctorCheck.suggestionList.forEach(e => {
  321. if (e.suggestionTitle && e.suggestionTitle.indexOf(key) > -1) message = `当前患者性别为:${this.dataTransOpts.tableS.patient_register.sexName} 报告不应出现 ${key} 字眼`
  322. if (e.diagnosisNames && e.diagnosisNames.indexOf(key) > -1) message = `当前患者性别为:${this.dataTransOpts.tableS.patient_register.sexName} 报告不应出现 ${key} 字眼`
  323. });
  324. });
  325. break;
  326. default:
  327. break;
  328. }
  329. }
  330. if (message) {
  331. this.$message.error({ showClose: true, message })
  332. return
  333. }
  334. for (let index = 0; index < this.sumDoctorCheck.suggestionList.length; index++) {
  335. let e = this.sumDoctorCheck.suggestionList[index];
  336. if (!e.patientRegisterId || e.patientRegisterId != this.dataTransOpts.tableS.patient_register.id) {
  337. message = "人员ID 与 建议人员ID 不一致"
  338. break
  339. }
  340. }
  341. if (message) {
  342. this.$message.error({ showClose: true, message })
  343. return
  344. }
  345. postapi(`/api/app/patientregister/UpdatePatientRegisterSummarySuggestion`, body)
  346. .then((res) => {
  347. if (res.code > -1) {
  348. // this.dataTransOpts.tableS.patient_register.completeFlag = '3';
  349. this.dataTransOpts.refresh.patient_register.S++
  350. }
  351. })
  352. },
  353. //修改结果
  354. btnEdit() {
  355. this.dataTransOpts.tableS.patient_register.completeFlag = '2'
  356. },
  357. //取消总检
  358. async btnDel() {
  359. let tips = false // 已打印删除提示
  360. if (this.dataTransOpts.tableS.patient_register.reportPrintTimes > 0) {
  361. let sysParmId = "summary_check_cancel_alreay_print_is_prompt"
  362. let sysParam = await postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId })
  363. if (sysParam.data.toUpperCase() == 'Y') tips = true
  364. }
  365. let body = {
  366. patientRegisterId: this.dataTransOpts.tableS.patient_register.id
  367. }
  368. if (tips) {
  369. this.$confirm("已打印过报告, 是否继续取消总检?", "提示", {
  370. confirmButtonText: "是",
  371. cancelButtonText: "否",
  372. type: "warning",
  373. })
  374. .then(() => {
  375. return postapi(`/api/app/patientregister/CancelSumCheck`, body)
  376. })
  377. .then((res) => {
  378. if (res.code > -1) {
  379. this.dataTransOpts.tableS.patient_register.completeFlag = '2';
  380. }
  381. })
  382. .catch((err) => {
  383. if (err != "cancel") {
  384. this.$message.info({ showClose: true, message: err });
  385. }
  386. });
  387. } else {
  388. postapi(`/api/app/patientregister/CancelSumCheck`, body)
  389. .then((res) => {
  390. if (res.code > -1) {
  391. this.dataTransOpts.tableS.patient_register.completeFlag = '2';
  392. }
  393. })
  394. }
  395. },
  396. // AI诊断 AI重新诊断(使用 fetchStream 实现流式实时渲染)
  397. async btnAIdiagnosis(again) {
  398. if (!again) {
  399. if (this.AI.visible) {
  400. this.btnAImax(false);
  401. return;
  402. }
  403. }
  404. let message = '';
  405. let linkStr = ';';
  406. this.sumDoctorCheck.summaryList.forEach(e => {
  407. if (message) {
  408. linkStr = ';';
  409. } else {
  410. linkStr = '';
  411. }
  412. message += linkStr + e.summaryTitle + ':';
  413. e.details.forEach((e1, i) => {
  414. message += (i + 1) + ')、' + e1.summaryContent;
  415. });
  416. });
  417. message = '性别:' + this.doctorCheck.prBase.sexName + ',年龄:' + this.doctorCheck.prBase.age + '岁,检查结果:' + message;
  418. this.AI.rawText = '';
  419. this.AI.html = '';
  420. try {
  421. await fetchStream('/api/app/AiMessageWs/GetAIMessageResult', { message }, (chunk) => {
  422. // 清洗 SSE 风格前缀并移除结束标志
  423. let cleaned = String(chunk).replace(/data:\s*\[DONE\]/g, '').replace(/^data:\s*/gm, '');
  424. if (!cleaned) return;
  425. // 首个数据到达时显示弹窗并展开
  426. if (!this.AI.visible) {
  427. this.AI.visible = true;
  428. this.btnAImax(false);
  429. }
  430. this.AI.rawText += cleaned;
  431. // 实时渲染 Markdown
  432. this.AI.html = md.render(this.AI.rawText);
  433. // 滚动到底部
  434. this.$nextTick(() => {
  435. try {
  436. const el = this.$refs.aiContent;
  437. if (el) el.scrollTop = el.scrollHeight;
  438. } catch (e) {}
  439. });
  440. });
  441. } catch (err) {
  442. // 回退:非流式请求(axios/postapi)
  443. try {
  444. const res = await postapi('/api/app/AiMessageWs/GetAIMessageResult', { message });
  445. if (res) {
  446. let cleaned = String(res).replace(/data:\s*\[DONE\]/g, '').replace(/^data:\s*/gm, '');
  447. if (cleaned) {
  448. // 回退响应到达后显示弹窗并展开
  449. if (!this.AI.visible) {
  450. this.AI.visible = true;
  451. this.btnAImax(false);
  452. }
  453. this.AI.rawText += cleaned;
  454. this.AI.html = md.render(this.AI.rawText);
  455. }
  456. }
  457. } catch (e) {
  458. this.$message.error({ showClose: true, message: (err && err.message) || 'AI诊断请求失败' });
  459. }
  460. }
  461. },
  462. btnAImax(max) {
  463. this.AI.max = !max
  464. if (this.AI.max) {
  465. this.AI.width = 500
  466. this.AI.height = this.frameHeight
  467. } else {
  468. this.AI.width = 24
  469. this.AI.height = 24
  470. }
  471. },
  472. //审核
  473. audit() {
  474. // dataTransOpts.tableS.patient_register.summaryDoctorId
  475. // dataTransOpts.tableS.patient_register.auditDoctorId
  476. let auditDoctorId = this.dataTransOpts.tableS.patient_register.auditDoctorId
  477. if (!auditDoctorId) auditDoctorId = window.sessionStorage.getItem("userId")
  478. let body = {
  479. patientRegisterId: this.dataTransOpts.tableS.patient_register.id,
  480. auditDoctorId, // 不传时,取当前用户
  481. //auditDate: "string" // 不传时,取当前时间
  482. isAudit: 'Y'
  483. }
  484. if (this.dataTransOpts.tableS.patient_register.summaryDoctorId == auditDoctorId) {
  485. this.$confirm(`${this.summary_check_doctor_alias[0]}医生与${this.summary_check_doctor_alias[1]}医生相同,一般不允许这样操作, 是否强行操作?`, "提示", {
  486. confirmButtonText: "是",
  487. cancelButtonText: "否",
  488. type: "warning",
  489. }).then(() => {
  490. this.auditApi(body)
  491. })
  492. } else {
  493. this.auditApi(body)
  494. }
  495. },
  496. //取消审核
  497. unAudit() {
  498. let body = {
  499. patientRegisterId: this.dataTransOpts.tableS.patient_register.id,
  500. //auditDoctor: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  501. //auditDate: "string" 不传时,取当前时间
  502. isAudit: 'N'
  503. }
  504. this.auditApi(body)
  505. },
  506. // 审核或取消审核接口
  507. auditApi(body) {
  508. postapi(`/api/app/patientregister/updatepatientregisterauditordoctor`, body)
  509. .then((res) => {
  510. console.log("unAudit", res.data);
  511. if (res.code != -1) {
  512. this.dataTransOpts.tableS.patient_register.isAudit = body.isAudit;
  513. }
  514. })
  515. .catch((err) => {
  516. this.$message({ type: "error", message: `${body.isAudit == 'Y' ? '' : '取消'}总检审核失败,原因:${err}` });
  517. });
  518. },
  519. //体检报告
  520. async btnReport() {
  521. if (!this.$peisAPI) {
  522. this.$message.info("此功能,需要在壳客户端才可运行!")
  523. return
  524. }
  525. ///3a0c990e-5756-2dc0-19d5-69a617fe4048
  526. let ReportCode = '0005';
  527. let BusinessCode = this.dataTransOpts.tableS.patient_register.id
  528. if (this.dataTransOpts.tableS.patient_register.isPatientOccupationalDisease == 'Y') ReportCode = '0006'
  529. let token = window.sessionStorage.getItem('token');
  530. let user = window.sessionStorage.getItem('user');
  531. let toOutShell = {
  532. ReportCode, token, BusinessCode,
  533. isBuildImage: 'N',
  534. IsUploadPdf: 'N',
  535. preViewCanPrint: 'Y',
  536. Parameters: [
  537. { Name: 'printer', Value: user },
  538. { Name: 'LTS', Value: 'Y' }, //Y、N N只看不能打印
  539. { Name: "firstPage", Value: "pic/peisReportFirstPage.jpg" }, //报告首页主图
  540. { Name: "pageHeader", Value: "pic/peisReportPageHeader.jpg" }, //报告页眉图片
  541. { Name: "pageFooter", Value: "pic/peisReportPageFooter.jpg" }, //报告页脚图片
  542. { Name: "orgSign", Value: this.dataTransOpts.tableS.patient_register.isPatientOccupationalDisease == 'Y' ? "pic/orgSignOcc.png" : "pic/orgSign.png" }, // 体检章
  543. { Name: 'picExtOne', Value: 'pic/hisLog.jpg' }, // 院徽
  544. { Name: 'picExtTwo', Value: 'pic/orgSignCom.png' }, // 单位公章
  545. { Name: 'resultSign', Value: 'pic/resultSign.png' }, // 结果章,如:职业病(本次体检未发现职业性异常)
  546. { Name: 'picExtThree', Value: 'pic/peisQrCode.jpg' }, // 公众号二维码
  547. { Name: 'picExtFour', Value: 'pic/peisQrCodeMini.jpg' }, // 小程序二维码
  548. ],
  549. };
  550. // 总检审核后才能打印
  551. if (this.dataTransOpts.tableS.patient_register.completeFlag != '3') toOutShell.preViewCanPrint = 'N'
  552. if (toOutShell.preViewCanPrint == 'Y' && this.dataTransOpts.tableS.patient_register.isAudit == 'N') {
  553. let sysParmId = "medical_report_print_after_summary_check_is_audit"
  554. let sysParam = await postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId })
  555. if (sysParam.data.toUpperCase() == 'Y') toOutShell.preViewCanPrint = 'N'
  556. }
  557. // postapi(`/api/app/printreport/getpeisreport?PatientRegisterId=${this.dataTransOpts.tableS.patient_register.id}`)
  558. // .then((res) => {
  559. // if (res.code != -1) {
  560. // toOutShell.ReportTable = res.data;
  561. // console.log('JSON.stringify(toOutShell)', JSON.stringify(toOutShell));
  562. // return this.$peisAPI.printPre(JSON.stringify(toOutShell));
  563. // }
  564. // })
  565. let JSONtoOutShell = JSON.stringify(toOutShell)
  566. console.log('$peisAPI.printPre', JSONtoOutShell)
  567. this.$peisAPI.printPre(JSONtoOutShell)
  568. .then(res => {
  569. if (res) {
  570. let lres = JSON.parse(res)
  571. if (lres.code < 0) this.$message.error({ showClose: true, message: lres.message })
  572. }
  573. })
  574. .catch(err => {
  575. this.$message.warning(err);
  576. });
  577. },
  578. //复查
  579. btnReCheck() {
  580. console.log("复查")
  581. },
  582. btnReCall() {
  583. console.log("随访")
  584. },
  585. //干预措施
  586. btnIntervene() {
  587. console.log("干预措施")
  588. },
  589. // 显示职业病
  590. btnOcc() {
  591. if (!this.dataTransOpts.tableS.patient_register.id) {
  592. this.$message.warning({ showClose: true, message: '人员信息尚未保存!' })
  593. return
  594. }
  595. this.dataTransOpts.plus.OccDisease++
  596. this.dialogWin.OccDisease = true
  597. },
  598. //重置
  599. btnReset(){
  600. location.reload()
  601. },
  602. addSummary() {
  603. if (!this.dataTransOpts.tableS.patient_register.id) {
  604. alert("请选择检查项目")
  605. return
  606. }
  607. this.doctorCheck.checkSummaryList.push({
  608. registerCheckId: this.dataTransOpts.tableS.patient_register.id,
  609. summary: '',
  610. summaryFlag: 'N',
  611. })
  612. this.doctorCheck.checkSuggestionList.push({
  613. registerCheckId: this.dataTransOpts.tableS.patient_register.id,
  614. suggestion: '',
  615. })
  616. },
  617. },
  618. //监听事件()
  619. watch: {
  620. },
  621. };
  622. </script>
  623. <style scoped>
  624. @import '../../assets/css/global_button.css';
  625. .listBtn {
  626. margin-top: 5px;
  627. margin-left: 10px;
  628. text-align: center;
  629. }
  630. </style>