inquiriesDetail.vue 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. <template>
  2. <div>
  3. <el-dialog
  4. title="详情"
  5. width="1000px"
  6. :visible.sync="visible"
  7. :before-close="_close"
  8. class="detailDialog"
  9. >
  10. <div style="position: absolute;right:20px;z-index:99">
  11. <el-button v-if="activeName == 'first'" @click="open(1)" type="primary">打印</el-button>
  12. <el-button v-if="activeName == 'second'" @click="open(2)" type="primary">打印</el-button>
  13. </div>
  14. <el-tabs v-model="activeName">
  15. <el-tab-pane label="处方详情" name="first">
  16. <el-tabs class="preTabs" v-model="editableTabsValue" type="card" @tab-click="tabclickEvent">
  17. <el-tab-pane
  18. v-for="(item, index) in prescriptions"
  19. :key="index"
  20. :label="item.name"
  21. :name="item.name"
  22. >
  23. </el-tab-pane>
  24. <div class="RP">
  25. Rp
  26. </div>
  27. <new-prescription-table ref="prescription_tables" :prescription="curPrescriptions"></new-prescription-table>
  28. </el-tabs>
  29. </el-tab-pane>
  30. <el-tab-pane label="病历详情" name="second">
  31. <div class="commonCell">
  32. <p style="color:#409EFF;">基本信息</p>
  33. <div class="detailMain">
  34. <span style="width:270px;">处方号:{{order.prescription_number}}</span>
  35. <span style="width:180px;">姓名:{{order.patient.name}}</span>
  36. <span style="width:240px;">证件号:{{order.patient.id_card_no}}</span>
  37. <span style="width:180px;">联系电话:{{order.patient.phone}}</span>
  38. <span style="width:270px;">医生:{{order.doctor}}</span>
  39. <span style="width:180px;">科室:{{getDepartMent(order.departments)}}</span>
  40. <span style="width:240px;">创建时间: {{getTimes(order.ctime,"{y}-{m}-{d} {h}:{i}")}}</span>
  41. <!-- <span style="width:180px;">疾病名称:{{case_history.diagnostic}}</span>
  42. <span style="width:180px;">症状:{{case_history.diagnostic}}</span> -->
  43. </div>
  44. </div>
  45. <div class="commonCell">
  46. <p style="color:#409EFF;">体格信息</p>
  47. <div class="detailMain">
  48. <span style="width:140px;">体温:{{case_history.temperature}}℃</span>
  49. <span style="width:140px;">呼吸:{{case_history.breathing}} 次/分</span>
  50. <span style="width:140px;">脉搏:{{case_history.pulse}} 次/分</span>
  51. <span style="width:200px;">血压:{{case_history.sbp}}~{{case_history.dbp}} mmHg</span>
  52. </div>
  53. </div>
  54. <div class="commonCell">
  55. <p style="color:#409EFF;">病历信息</p>
  56. <div class="detailMain">
  57. <span style="width:260px;" v-if="case_history.is_infect== 1">是否传染:是</span>
  58. <span style="width:260px;" v-if="case_history.is_infect != 1">是否传染:否</span>
  59. <span style="width:180px;">发病日期:{{getTimes(case_history.sick_date,"{y}-{m}-{d}")}}</span>
  60. </div>
  61. </div>
  62. <div class="commonCell">
  63. <p>主诉</p>
  64. <div>{{case_history.chief_conplaint}}</div>
  65. </div>
  66. <div class="commonCell">
  67. <p>现病史</p>
  68. <div>{{case_history.history_of_present_illness}}</div>
  69. </div>
  70. <div class="commonCell">
  71. <p>门诊诊断</p>
  72. <div>{{case_history.diagnostic}}</div>
  73. </div>
  74. <div class="commonCell">
  75. <p>门诊医嘱</p>
  76. <div>{{case_history.doctor_advice}}</div>
  77. </div>
  78. <div class="commonCell">
  79. <p>过敏史</p>
  80. <div>{{case_history.past_history}}</div>
  81. </div>
  82. <div class="commonCell">
  83. <p>既往史</p>
  84. <div>{{case_history.past_history}}</div>
  85. </div>
  86. <div class="commonCell">
  87. <p>个人史</p>
  88. <div>{{case_history.personal_history}}</div>
  89. </div>
  90. <div class="commonCell">
  91. <p>家族史</p>
  92. <div>{{case_history.family_history}}</div>
  93. </div>
  94. </el-tab-pane>
  95. </el-tabs>
  96. <div slot="footer" class="dialog-footer">
  97. <el-button @click="hide">取 消</el-button>
  98. <!--<el-button type="primary" :loading="submitLoading" @click="hide">确定</el-button>-->
  99. </div>
  100. <el-dialog
  101. class="centerDialog detailDialog"
  102. width="600px"
  103. title="打印"
  104. :visible.sync="innerVisible"
  105. append-to-body>
  106. <print v-if="activeName == 'first'" :paramsObj='paramsObj'></print>
  107. <recordPrint v-if="activeName == 'second'" :patientid="patientid"></recordPrint>
  108. </el-dialog>
  109. </el-dialog>
  110. </div>
  111. </template>
  112. <script>
  113. import { getDictionaryDataConfig} from "@/utils/data";
  114. import { getHisPrescriptionInfo } from '@/api/his/his'
  115. import NewPrescriptionTable from './newPrescriptionTable'
  116. import { uParseTime } from '@/utils/tools'
  117. import { getAllDoctorList } from "@/api/project/project"
  118. import moment from 'moment';
  119. import print from '../print'
  120. import recordPrint from '../recordPrint'
  121. export default {
  122. components: { NewPrescriptionTable,print,recordPrint },
  123. data() {
  124. return {
  125. visible: false,
  126. activeName: 'first',
  127. curPrescriptions: {},
  128. prescriptions: [],
  129. record_date: '',
  130. editableTabsValue: '处方1',
  131. loadingone: false,
  132. editableTabs: [{
  133. title: '处方1',
  134. name: '1'
  135. }],
  136. tabIndex: 1,
  137. hisPatientInfo: {},
  138. loadingtwo: false,
  139. patientTableData: [{
  140. name: '杨美英',
  141. mdtrt_id: '1709946'
  142. }],
  143. patientInfo: { id: 0 },
  144. doctor: {},
  145. total: 0,
  146. state: '未收费',
  147. radio: 1,
  148. radioStatus: 1,
  149. search_input: '',
  150. case_history:{},
  151. order:{},
  152. doctorList:[],
  153. departmentList:[],
  154. innerVisible:false,
  155. paramsObj:{},
  156. patientid:''
  157. }
  158. },
  159. methods: {
  160. open(index){
  161. if(index == 1){
  162. var arr= [];
  163. for(let i=0;i<this.prescriptions.length;i++){
  164. arr.push(this.prescriptions[i].id)
  165. }
  166. var prescription_id = arr[0];
  167. var record_date = this.format(this.order.record_date);
  168. var ids = arr.toString();
  169. let obj = {
  170. record:record_date,
  171. prescription_id:prescription_id,
  172. ids:ids,
  173. patient_id:this.patientInfo.id
  174. };
  175. this.paramsObj = obj;
  176. this.innerVisible = true
  177. // this.$router.push("/outpatientDoctorStation/print?record="+record_date+"&prescription_id="+prescription_id+"&ids="+ids+"&patient_id="+this.patientInfo.id)
  178. }else if(index == 2){
  179. var record_date = this.format(this.case_history.sick_date);
  180. this.patientid = this.patientInfo.id;
  181. this.innerVisible = true
  182. // this.$router.push("/outpatientDoctorStation/recordPrint?record="+record_date+"&patient_id="+this.case_history.patient_id)
  183. }
  184. },
  185. getTimes(time,temp) {
  186. return uParseTime(time, temp);
  187. },
  188. tabclickEvent(val) {
  189. for (let i = 0; i < this.prescriptions.length; i++) {
  190. if (this.prescriptions[i].name == val.name) {
  191. this.curPrescriptions = {};
  192. var temp = this.deepClone(this.prescriptions[i]);
  193. this.curPrescriptions = temp
  194. }
  195. }
  196. },
  197. deepClone(source) {
  198. if (!source && typeof source !== 'object') {
  199. throw new Error('error arguments', 'shallowClone')
  200. }
  201. const targetObj = source.constructor === Array ? [] : {};
  202. Object.keys(source).forEach((keys) => {
  203. if (source[keys] && typeof source[keys] === 'object') {
  204. targetObj[keys] = this.deepClone(source[keys])
  205. } else {
  206. targetObj[keys] = source[keys]
  207. }
  208. });
  209. return targetObj
  210. },
  211. moreState(tab, event) {
  212. if (tab == 'more') {
  213. return false
  214. }
  215. },
  216. _close: function(done) {
  217. // this.clear()
  218. done()
  219. },
  220. clear: function() {
  221. this.form.id = 0;
  222. this.form.name = '';
  223. this.form.intro = ''
  224. },
  225. show(id) {
  226. let params={
  227. id:id,
  228. };
  229. getHisPrescriptionInfo(params).then(response => {
  230. if (response.data.state == 0) {
  231. this.$message.error(response.data.msg);
  232. return false
  233. } else {
  234. this.patientInfo = response.data.data.order.patient;
  235. console.log("患者信息",this.patientInfo);
  236. this.hisPatientInfo = response.data.data.order.his_patient;
  237. this.case_history = response.data.data.order.case_history;
  238. console.log("历史详情",this.case_history);
  239. this.order = response.data.data.order;
  240. console.log('this.order',this.order);
  241. this.prescriptions = [];
  242. for (let i = 0; i < response.data.data.prescription.length; i++) {
  243. var prescription = response.data.data.prescription[i];
  244. let tempAdvice = [];
  245. let tempProject = [];
  246. for (let b = 0; b < prescription.advices.length; b++) {
  247. let obj = {
  248. advice_id: prescription.advices[b].id,
  249. drug_name: prescription.advices[b].advice_name,
  250. single_dose: prescription.advices[b].single_dose,
  251. delivery_way: prescription.advices[b].delivery_way,
  252. execution_frequency: prescription.advices[b].execution_frequency,
  253. retail_price: prescription.advices[b].price.toString(),
  254. remark: prescription.advices[b].remark,
  255. day: prescription.advices[b].day,
  256. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  257. single_dose_unit: prescription.advices[b].single_dose_unit,
  258. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  259. medical_insurance_number: prescription.advices[b].med_list_codg
  260. };
  261. tempAdvice.push(obj)
  262. }
  263. for (let b = 0; b < prescription.project.length; b++) {
  264. let obj = {
  265. id: prescription.project[b].id,
  266. project_id: prescription.project[b].project.id,
  267. project_name: prescription.project[b].project.project_name,
  268. statistical_classification: prescription.project[b].project.statistical_classification,
  269. single_dose: prescription.project[b].single_dose,
  270. delivery_way: prescription.project[b].delivery_way,
  271. execution_frequency: prescription.project[b].execution_frequency,
  272. number_days: prescription.project[b].day,
  273. total: prescription.project[b].count.toString(),
  274. price: prescription.project[b].price,
  275. remark: prescription.project[b].remark,
  276. medical_code: prescription.project[b].project.medical_code,
  277. unit:prescription.project[b].project.unit,
  278. };
  279. if(prescription.project[b].type == 2){
  280. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  281. obj['medical_code'] = prescription.project[b].project.medical_code
  282. obj['project_name'] = prescription.project[b].project.project_name
  283. obj['type'] = 2
  284. }else if(prescription.project[b].type == 3){
  285. obj['statistical_classification'] = ""
  286. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  287. obj['project_name'] = prescription.project[b].good_info.good_name
  288. obj['type'] = 3
  289. }
  290. tempProject.push(obj)
  291. }
  292. console.log(tempProject)
  293. let index = i + 1;
  294. let obj = {
  295. id: prescription.id,
  296. name: '处方' + index,
  297. advices: tempAdvice,
  298. project: tempProject,
  299. type: response.data.data.prescription[i].type
  300. };
  301. this.prescriptions.push(obj);
  302. this.curPrescriptions = this.prescriptions[0]
  303. }
  304. }
  305. });
  306. // this.clear()
  307. this.visible = true
  308. },
  309. hide() {
  310. // this.clear()
  311. this.visible = false
  312. },
  313. getAllDoctorList(){
  314. getAllDoctorList().then(response=>{
  315. if(response.data.state == 1){
  316. var doctor = response.data.data.doctor;
  317. this.doctorList = doctor;
  318. var department = response.data.data.department;
  319. console.log("department",department);
  320. this.departmentList = department
  321. }
  322. })
  323. },
  324. getDepartMent(id){
  325. var name = "";
  326. for(let i=0;i<this.departmentList.length;i++){
  327. if(id == this.departmentList[i].id){
  328. name = this.departmentList[i].name
  329. }
  330. }
  331. return name
  332. },
  333. format(time){
  334. moment.locale();
  335. var times = time*1000;
  336. times = moment(times).format('YYYY-MM-DD');
  337. return times
  338. }
  339. },
  340. created(){
  341. this.getAllDoctorList()
  342. }
  343. }
  344. </script>
  345. <style lang="scss">
  346. .detailDialog {
  347. .el-dialog__body {
  348. padding: 0 20px 30px;
  349. position: relative;
  350. }
  351. .detailMain {
  352. flex: 1;
  353. span {
  354. display: inline-block;
  355. }
  356. }
  357. .commonCell {
  358. display: flex;
  359. line-height: 40px;
  360. > p {
  361. font-weight: bold;
  362. color: #000;
  363. width: 80px;
  364. }
  365. }
  366. }
  367. </style>