prescriptionTemplatedetail.vue 107KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773
  1. <template>
  2. <div class="main-contain new-main-contain">
  3. <div style="height: calc(100% - 0px);display: flex;flex-direction: column;">
  4. <div style="display:flex;justify-content: space-between;align-items:center;margin:10px 0;padding:0 10px;color:#606266;">
  5. <div style="font-size:14px;">姓名:{{ $route.query.patient_name }}</div>
  6. <el-button size="small" @click="save" type="primary">保存</el-button>
  7. </div>
  8. <div class="mainCenter" style="padding:0 10px;" v-loading="loading">
  9. <div class="centerLeft">
  10. <el-form :model="tempForm" ref="tempForm" label-width="80px"
  11. style="display: flex;flex-wrap: wrap;justify-content: space-between;">
  12. <el-form-item label="模版名称:" prop="name" label-position="right">
  13. <el-input v-model="tempForm.name" placeholder=""></el-input>
  14. </el-form-item>
  15. <!-- <el-button @click="lili">调试</el-button>-->
  16. <el-form-item label="透析模式: " prop="mode_id" label-position="right">
  17. <el-select v-model="tempForm.mode_id" style="width:100%;" placeholder="请选择"
  18. :disabled="this.$route.query.id > 0 ?true:false" v-if="this.$route.query.id == 0"
  19. @change = "changeMode">
  20. <el-option
  21. v-for="item in modeOptions"
  22. :key="item.id"
  23. :label="item.name"
  24. :value="item.id"
  25. ></el-option>
  26. </el-select>
  27. <el-select v-model="tempForm.mode_id" style="width:100%;" placeholder="请选择"
  28. :disabled="this.$route.query.id > 0 ?true:false" v-if="this.$route.query.id > 0"
  29. @change = "changeMode">>
  30. <el-option
  31. v-for="item in modeOptionsTwo"
  32. :key="item.id"
  33. :label="item.name"
  34. :value="item.id"
  35. ></el-option>
  36. </el-select>
  37. </el-form-item>
  38. </el-form>
  39. <div class="tabsBox">
  40. <el-tabs class="preTabs" v-model="editableTabsValue" type="border-card"
  41. closable
  42. @tab-remove="removeTab"
  43. :before-leave="moreState" @tab-click="tabclickEvent">
  44. <el-tab-pane
  45. v-for="(item, index) in prescriptions"
  46. :key="index"
  47. :label="item.name"
  48. :name="item.name"
  49. >
  50. <!--<el-select style="width:50%;" v-model="item.med_type" placeholder="医疗类型" v-if="($store.getters.xt_user.org_id == 10028 || $store.getters.xt_user.org_id == 9504 || $store.getters.xt_user.org_id == 10138)" @change="changevalue" >-->
  51. <!--<el-option-->
  52. <!--v-for="(item,index) in medical_care"-->
  53. <!--:key="index"-->
  54. <!--:label="item.label"-->
  55. <!--:value="item.value">-->
  56. <!--</el-option>-->
  57. <!--</el-select>-->
  58. <el-select v-if="org_id != 10206" style="width:50%;" v-model="item.med_type" placeholder="医疗类型"
  59. @change="changevalue">
  60. <el-option
  61. v-for="(item,index) in register"
  62. :key="index"
  63. :label="item.label"
  64. :value="item.value">
  65. </el-option>
  66. </el-select>
  67. <!-- //针对海拉尔普爱肾病医院-->
  68. <el-select v-if="org_id == 10206" style="width:50%;" v-model="item.med_type" placeholder="医疗类型"
  69. @change="changevalue">
  70. <el-option
  71. v-for="(item,index) in register10206"
  72. :key="index"
  73. :label="item.label"
  74. :value="item.value">
  75. </el-option>
  76. </el-select>
  77. </el-tab-pane>
  78. <el-tab-pane name="more" closable><span slot="label"><i
  79. class="el-icon-plus"
  80. @click="addTab"></i></span>
  81. </el-tab-pane>
  82. <!--<prescription-table ref="prescription_tables"-->
  83. <!--:prescription="curPrescriptions"-->
  84. <!--:preDrugs="preDrugs"-->
  85. <!--:activeType="customTabIndex"></prescription-table>-->
  86. <prescription-template-table ref="prescription_tables"
  87. :prescription="curPrescriptions"
  88. :preDrugs="preDrugs"
  89. :activeType="customTabIndex"></prescription-template-table>
  90. </el-tabs>
  91. </div>
  92. </div>
  93. <div class='centerRight'>
  94. <el-tabs class="borderCard" type="border-card" v-model="rightTab" @tab-click="clickTab"
  95. :before-leave='beforeLeave'>
  96. <el-tab-pane label="药品" :name="1">
  97. </el-tab-pane>
  98. <el-tab-pane label="项目" :name="2">
  99. </el-tab-pane>
  100. <div style="height:100%;" v-show="showOne">
  101. <el-tabs class="rightTabs" v-model="drug_activeName">
  102. <el-tab-pane label="药品列表" name="1">
  103. <div style="margin-bottom:5px;display:flex;">
  104. <el-input style="width:50%;" @input="searchAction"
  105. @keyup.enter.native='searchAction'
  106. v-model.trim="search_keyword"
  107. placeholder="请输入药品名字"></el-input>
  108. <el-select style="margin-left:5px;width:50%;" v-model="value" placeholder=""
  109. @change="changeKind">
  110. <el-option
  111. label="全部"
  112. value="0">
  113. </el-option>
  114. <el-option
  115. v-for="(item,index) in getDictionaryDataConfig('system','drug_type')"
  116. :key="index"
  117. :label="item.name"
  118. :value="item.id">
  119. </el-option>
  120. </el-select>
  121. </div>
  122. <div style="width: 100%;flex:1;overflow: hidden;" ref="rightTable">
  123. <el-table ref="multipleTable"
  124. :height="multipleTableHeight != '' ? multipleTableHeight : '200'"
  125. :data="drugs" border @select='selectDrugs'
  126. :row-style="{ color: '#303133' }"
  127. @select-all="changeAllGoodInfoTableData"
  128. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  129. highlight-current-row>
  130. <el-table-column type="selection" width="40"
  131. align="center"></el-table-column>
  132. <el-table-column label="名称" v-if="org_id == 10206 || org_id == 0">
  133. <template slot-scope="scope">{{ scope.row.drug_name }}{{scope.row.number?"("+scope.row.number+")":""}}</template>
  134. </el-table-column>
  135. <el-table-column label="名称" v-if="org_id != 10206 && org_id != 0">
  136. <template slot-scope="scope">{{ scope.row.drug_name }}</template>
  137. </el-table-column>
  138. <el-table-column label="规格" width="60" v-if="org_id != 10206 && org_id != 0">
  139. <template slot-scope="scope">
  140. <span
  141. v-if="scope.row.min_unit != scope.row.dose_unit">{{ scope.row.dose }}{{ scope.row.dose_unit }}&nbsp;* &nbsp;</span>
  142. {{ scope.row.min_number }}{{ scope.row.min_unit }}/{{ scope.row.max_unit }}
  143. </template>
  144. </el-table-column>
  145. <el-table-column label="库存" width="60" v-if="org_id == 10206" >
  146. <template slot-scope="scope">{{ scope.row.zuobiao_stock_num }}</template>
  147. </el-table-column>
  148. <el-table-column label="规格" width="60" v-if="org_id == 10206 || org_id == 0">
  149. <template slot-scope="scope">
  150. <span>{{scope.row.drug_spec}}</span>
  151. </template>
  152. </el-table-column>
  153. <el-table-column label="单价" width="40">
  154. <template slot-scope="scope">{{ scope.row.retail_price }}</template>
  155. </el-table-column>
  156. </el-table>
  157. </div>
  158. </el-tab-pane>
  159. </el-tabs>
  160. </div>
  161. <div style="height:100%;" v-show="showTwo">
  162. <div style="height:100%;" v-show="showTwo">
  163. <el-tabs class="rightTabs" v-model="activeName">
  164. <el-tab-pane label="项目列表" name="1">
  165. <div style="margin-bottom:5px;">
  166. <!--<el-input style="width:50%;" v-model="input" placeholder=""></el-input>-->
  167. <el-input style="width:50%;" @input="searchProjectAction"
  168. @keyup.enter.native='searchProjectAction'
  169. v-model.trim="search_project_keyword"
  170. placeholder="请输入项目名称"></el-input>
  171. <el-select style="float: right;width: 49%;" v-model="value" placeholder=""
  172. @change="changeClass">
  173. <el-option
  174. label="全部"
  175. value="0">
  176. </el-option>
  177. <el-option
  178. v-for="(item, index) in getDictionaryDataConfig('system','cost_classify')"
  179. :key="index"
  180. :label="item.name"
  181. :value="item.id">
  182. </el-option>
  183. </el-select>
  184. </div>
  185. <div style="width: 100%;flex:1;overflow-y: auto;">
  186. <el-table ref="tables"
  187. :height="multipleTableHeight != '' ? multipleTableHeight : '200'"
  188. :data="tabProject" border @select='selectChange'
  189. :row-style="{ color: '#303133' }"
  190. @select-all="changeAllGoodInfoTableDataTwo"
  191. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  192. highlight-current-row>
  193. <el-table-column type="selection" width="40"
  194. align="center"></el-table-column>
  195. <el-table-column prop="name" label="名称" v-if="org_id != 10206 && org_id != 0">
  196. <template slot-scope="scope">{{ scope.row.project_name }}</template>
  197. </el-table-column>
  198. <el-table-column prop="name" label="名称" v-if="org_id == 10206 || org_id == 0">
  199. <template slot-scope="scope">{{ scope.row.project_name }}{{scope.row.number?"("+scope.row.number+")":""}}</template>
  200. </el-table-column>
  201. <el-table-column label="库存" width="60" v-if="org_id == 10206" >
  202. <template slot-scope="scope">{{ scope.row.type == 3?scope.row.zuobiao_stock_num :""}}</template>
  203. </el-table-column>
  204. <el-table-column label="规格" width="60">
  205. <template slot-scope="scope">{{ scope.row.single_dose }}</template>
  206. </el-table-column>
  207. <el-table-column label="单价" width="40">
  208. <template slot-scope="scope">{{ scope.row.price }}</template>
  209. </el-table-column>
  210. </el-table>
  211. </div>
  212. </el-tab-pane>
  213. <el-tab-pane label="项目组套" name="2">
  214. <div style="width: 100%;flex:1;overflow-y: auto;">
  215. <el-table :data="tabPrjectTeam" border ref="tabProjectTeam"
  216. :height="multipleTableHeight != '' ? multipleTableHeight : '200'"
  217. :row-style="{ color: '#303133' }"
  218. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  219. highlight-current-row
  220. @select='selectTeam'>
  221. <el-table-column type="selection" width="40"
  222. align="center"></el-table-column>
  223. <el-table-column prop="name" label="名称">
  224. <template slot-scope="scope">{{scope.row.project_team}}</template>
  225. </el-table-column>
  226. </el-table>
  227. </div>
  228. </el-tab-pane>
  229. </el-tabs>
  230. </div>
  231. </div>
  232. </el-tabs>
  233. <template>
  234. <div class="comfirmBox">
  235. <el-button type="primary" style="width:100%;" @click="comfirm">确定添加</el-button>
  236. </div>
  237. </template>
  238. </div>
  239. </div>
  240. </div>
  241. </div>
  242. </template>
  243. <script>
  244. import { createdTemplate, delHisPrescriptionInfoTemplate, getPrescriptionTemplateInfo } from '@/api/his/his_config'
  245. import {
  246. createHisPrescription,
  247. delHisPrescription,
  248. editHisPrescription,
  249. getCallHisPrescription,
  250. getDayOrMonthHisPrescription,
  251. getInitData,
  252. getNextOrLastHisPrescription,
  253. getPatientInfo,
  254. getSchedulePatientList,
  255. getPresciptionTemplateDetail
  256. } from '@/api/his/his'
  257. import { getDictionaryDataConfig } from '@/utils/data'
  258. import prescriptionTable from './components/prescriptionTable'
  259. import {
  260. addProjectTeam,
  261. getAllProjectList,
  262. getAllProjectTeam,
  263. getHisProject,
  264. getPojectListById
  265. } from '@/api/project/project'
  266. import { uParseTime } from '@/utils/tools'
  267. import PrescriptionTemplateTable from './components/prescriptionTemplateTable'
  268. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  269. import axios from 'axios'
  270. const moment = require('moment')
  271. export default {
  272. props: {
  273. patientInfo: Object,
  274. hisPatientInfo: Object,
  275. prescriptions: Array,
  276. record_date: String,
  277. search_keyword: '',
  278. month_prescriptions: Array,
  279. isloading: false,
  280. loading: false,
  281. other_sick: {
  282. type: Array,
  283. default: function() {
  284. return []
  285. }
  286. }
  287. },
  288. components: {
  289. PrescriptionTemplateTable,
  290. prescriptionTable,
  291. BreadCrumb
  292. },
  293. data() {
  294. return {
  295. org_id:this.$store.getters.xt_user.org_id,
  296. register10206: [
  297. { value: 1, label: '普通' },
  298. { value: 2, label: '急诊' },
  299. { value: 5, label: '第一类精神药品' },
  300. { value: 6, label: '第二类精神药品' },
  301. { value: 7, label: '放射药品' },
  302. { value: 8, label: '毒性药品' },
  303. { value: 9, label: '检查' },
  304. { value: 10, label: '检验' },
  305. { value: 12, label: '治疗' },
  306. { value: 99, label: '其他' },
  307. ],
  308. medical_care: [
  309. { value: 11, label: '普通门诊' },
  310. { value: 12, label: '家庭通道' },
  311. { value: 13, label: '门诊大病' },
  312. { value: 14, label: '重疾特药' },
  313. { value: 15, label: '门诊慢病' },
  314. { value: 16, label: '门诊特检' },
  315. { value: 17, label: '健康体检' },
  316. { value: 18, label: '预防接种' },
  317. { value: 19, label: '门诊输血' },
  318. { value: 91, label: '新冠肺炎门诊' }
  319. ],
  320. register: [
  321. { value: 11, label: '普通门诊' },
  322. // { value: 12, label: '门诊挂号' },
  323. // { value: 13, label: '急诊' },
  324. { value: 14, label: '门诊特殊病' }
  325. // { value: 15, label: '门诊统筹' },
  326. // { value: 16, label: '门诊慢性病' },
  327. // { value: 21, label: '普通住院' }
  328. ],
  329. crumbs: [
  330. { path: false, name: '门诊医生站' },
  331. { path: false, name: '处方模版' },
  332. { path: false, name: '模版详情' }
  333. ],
  334. tempForm: {
  335. name: '',
  336. mode_id: ''
  337. },
  338. modeOptions:{},
  339. modeOptionsTwo: {},
  340. start_time: moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  341. end_time: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  342. isLastOrNextVisible: false,
  343. multipleTableHeight: '',
  344. register_type: 1,
  345. value: '0',
  346. search_project_keyword: '',
  347. drugs: [],
  348. allDrugs: [],
  349. advices_template: [],
  350. additions: [],
  351. editableTabsValueTwo: '处方1',
  352. editableTabsValue: '处方1',
  353. editableTabs: [{
  354. title: '处方1',
  355. name: '1'
  356. }],
  357. curDayPrescriptions: null,
  358. dayPrescriptions: [],
  359. currenet_inedx: 0,
  360. rightTab: 1,
  361. activeName: '1',
  362. drug_activeName: '1',
  363. curPrescriptions: null,
  364. drugTableData: [],
  365. preDrugs: [],
  366. curDrugs: [],
  367. doctorOptions: [],
  368. doctorValue: '',
  369. departmentOptions: [],
  370. departmentValue: '',
  371. total: 0,
  372. request_record_date: '',
  373. state2: '',
  374. customTabIndex: 1,
  375. options: [],
  376. tabProject: [],
  377. allProject: [],
  378. strids: '',
  379. showOne: true,
  380. showTwo: false,
  381. tableData: [],
  382. tabPrjectTeam: [],
  383. teamList: [],
  384. doctors: [],
  385. departMent: [],
  386. curStatus: 0,
  387. isShowDayPrescription: false,
  388. monthCustomTabIndex: 1,
  389. order_status: '',
  390. register_types: [
  391. { id: 1, name: '医保' },
  392. { id: 2, name: '自费' }
  393. ],
  394. pickerOptions: {
  395. disabledDate(time) {
  396. let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear() - 1)).getTime() - 24 * 3600 * 1000
  397. return time.getTime() > Date.now() || time.getTime() < threeMonths
  398. }
  399. },
  400. department: [],
  401. sick: [],
  402. diagnoses: [],
  403. diagnose: 1,
  404. state1: 1,
  405. curTotal: 0,
  406. prescription_id: 0,
  407. tempDrugs: [],
  408. dayorMonth: 'day',
  409. hisList: [],
  410. id:0,
  411. zuobiao_drug:[],
  412. zuobiao_project:[],
  413. }
  414. },
  415. methods: {
  416. getZuobiaoDrugStock(){
  417. if (this.org_id == 10206) {
  418. var that = this
  419. axios.get('http://127.0.0.1:9532' + '/nmg/coordinate/querystockdrug', {})
  420. .then(function(response) {
  421. if (response.data.state == 0) {
  422. that.$message.error(response.data.msg)
  423. that.loadingtwo = false
  424. return false
  425. } else {
  426. if (response.data.data.failed_code == -10) {
  427. that.$confirm(response.data.data.msg, '医保错误信息', {
  428. confirmButtonText: '确 定',
  429. type: 'warning'
  430. }).then(() => {
  431. }).catch(() => {
  432. })
  433. } else {
  434. that.zuobiao_drug = response.data.data.drug
  435. // console.log('坐标~~坐标')
  436. // console.log(that.zuobiao_drug)
  437. // console.log(response.data.data.drug)
  438. // console.log('坐标~~坐标')
  439. //
  440. // // that.zuobiao_project = response.data.data.project
  441. // //跟坐标数据进行匹配,如果bbx01相等的话则,替换库存数量
  442. // for (let i = 0; i < that.zuobiao_drug.length; i++) {
  443. // for (let b = 0; b < that.drugs.length; b++) {
  444. // if (that.zuobiao_drug[i].bby01 == that.drugs[b].bby01) {
  445. // that.drugs[b]['zuobiao_stock_num'] = that.zuobiao_drug[i].sysl
  446. // that.drugs[b].min_price = that.zuobiao_drug[i].lsj
  447. //
  448. // }
  449. //
  450. // }
  451. // }
  452. // console.log('坐标~~坐标')
  453. // console.log(that.drugs)
  454. // console.log('坐标~~坐标')
  455. }
  456. }
  457. })
  458. .catch(function(error) {
  459. })
  460. }
  461. },
  462. getZuobiaoGoodStock(){
  463. if(this.org_id == 10206){
  464. var that = this
  465. axios.get("http://127.0.0.1:9532" + '/nmg/coordinate/querystockgood', {
  466. })
  467. .then(function(response) {
  468. if (response.data.state == 0) {
  469. that.$message.error(response.data.msg)
  470. that.loadingtwo = false
  471. return false
  472. } else {
  473. if (response.data.data.failed_code == -10) {
  474. that.$confirm(response.data.data.msg, '医保错误信息', {
  475. confirmButtonText: '确 定',
  476. type: 'warning'
  477. }).then(() => {
  478. }).catch(() => {
  479. })
  480. } else {
  481. // that.zuobiao_drug = response.data.data.drug
  482. that.zuobiao_project = response.data.data.project
  483. }
  484. }
  485. })
  486. .catch(function(error) {
  487. })
  488. }
  489. },
  490. lili(){
  491. console.log("this.$store.getters.treatment_mode",this.$store.getters.treatment_mode)
  492. },
  493. save() {
  494. if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length == 0) {
  495. this.$message.error('请先开处方')
  496. return
  497. }
  498. if (this.tempForm.name.length <= 0) {
  499. this.$message.error('模版名称不能为空')
  500. return
  501. }
  502. if (this.tempForm.mode_id <= 0) {
  503. this.$message.error('透析模式不能为空')
  504. return
  505. }
  506. for (let i = 0; i < this.prescriptions.length; i++) {
  507. console.log(this.prescriptions[i].med_type)
  508. if (this.prescriptions[i].med_type == 0 || this.prescriptions[i].med_type == '') {
  509. this.$message.error('处方医疗类型不能为空')
  510. return
  511. }
  512. }
  513. if(this.org_id != 10206){
  514. for (let i = 0; i < this.prescriptions.length; i++) {
  515. for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
  516. if (this.prescriptions[i].med_type == 14 && this.prescriptions[i].advices[b].drug.is_special_diseases != 1) {
  517. this.$message.error('处方' + (i + 1).toString() + '属于特病类型处方,不能开非特病类型的药')
  518. return
  519. }
  520. }
  521. for (let c = 0; c < this.prescriptions[i].project.length; c++) {
  522. if (this.prescriptions[i].med_type == 14 && this.prescriptions[i].project[c].type == 2 && this.prescriptions[i].project[c].project.disease_directory != 1) {
  523. this.$message.error('处方' + (i + 1).toString() + '属于特病类型处方,请开特病类型的项目')
  524. return
  525. }
  526. if (this.prescriptions[i].med_type == 14 && this.prescriptions[i].project[c].type == 3 && this.prescriptions[i].project[c].good_info.is_special_diseases != 1) {
  527. this.$message.error('处方' + (i + 1).toString() + '属于特病类型处方,请开特病类型的耗材')
  528. return
  529. }
  530. }
  531. }
  532. }
  533. let params = {
  534. name: this.tempForm.name,
  535. mode_id: this.tempForm.mode_id,
  536. patient_id: this.$route.query.patient_id,
  537. id:this.$route.query.id,
  538. }
  539. for (let i = 0; i < this.prescriptions.length; i++) {
  540. this.prescriptions[i].med_type = parseInt(this.prescriptions[i].med_type)
  541. if (this.prescriptions[i].advices.length > 0 && this.prescriptions[i].project.length == 0) {
  542. this.prescriptions[i]['type'] = 1
  543. }
  544. if (this.prescriptions[i].advices.length == 0 && this.prescriptions[i].project.length > 0) {
  545. this.prescriptions[i]['type'] = 2
  546. }
  547. for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
  548. this.prescriptions[i].advices[b].single_dose = this.prescriptions[i].advices[b].single_dose.toString()
  549. this.prescriptions[i].advices[b].prescribing_number = this.prescriptions[i].advices[b].prescribing_number.toString()
  550. this.prescriptions[i].advices[b].retail_price = this.prescriptions[i].advices[b].retail_price.toString()
  551. this.prescriptions[i].advices[b].day = parseInt(this.prescriptions[i].advices[b].day)
  552. this.prescriptions[i].advices[b].groupno = parseInt(this.prescriptions[i].advices[b].groupno)
  553. this.prescriptions[i].advices[b].day_count = parseInt(this.prescriptions[i].advices[b].day_count)
  554. this.prescriptions[i].advices[b].frequency_type = parseInt(this.prescriptions[i].advices[b].frequency_type)
  555. this.prescriptions[i].advices[b].week_day = this.prescriptions[i].advices[b].week_day.toString()
  556. }
  557. console.log("数据wwwwwwwwwwwww",this.prescriptions[i].project)
  558. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  559. this.prescriptions[i].project[b].single_dose = this.prescriptions[i].project[b].single_dose.toString()
  560. this.prescriptions[i].project[b].price = this.prescriptions[i].project[b].price.toString()
  561. this.prescriptions[i].project[b].total = this.prescriptions[i].project[b].total.toString()
  562. this.prescriptions[i].project[b].delivery_way = this.prescriptions[i].project[b].delivery_way.toString()
  563. this.prescriptions[i].project[b].day_count = parseInt(this.prescriptions[i].project[b].day_count)
  564. this.prescriptions[i].project[b].frequency_type = parseInt(this.prescriptions[i].project[b].frequency_type)
  565. this.prescriptions[i].project[b].week_day = this.prescriptions[i].project[b].number_days.toString()
  566. }
  567. }
  568. let data = {
  569. 'prescriptions': this.prescriptions
  570. }
  571. console.log("paramoowowowowoowowowowowowowow",data)
  572. createdTemplate(params, data).then(response => {
  573. if (response.data.state == 1) {
  574. this.$message.success('保存成功')
  575. this.$emit('save',this.$route.query.patient_name)
  576. for (const mkey in this.modeOptions) {
  577. if (mkey == this.tempForm.mode_id) {
  578. delete this.modeOptions[mkey]
  579. }
  580. }
  581. this.$router.go(-1)
  582. } else {
  583. this.$message.error(response.data.msg)
  584. }
  585. })
  586. },
  587. changeClass(id) {
  588. this.tabProject = []
  589. if (id == 0) {
  590. this.tabProject = this.allProject
  591. } else {
  592. for (let i = 0; i < this.allProject.length; i++) {
  593. if (this.allProject[i].cost_classify == id) {
  594. this.tabProject.push(this.allProject[i])
  595. }
  596. }
  597. }
  598. },
  599. formatDecimal(num, decimal) {
  600. num = num.toString()
  601. let index = num.indexOf('.')
  602. if (index !== -1) {
  603. num = num.substring(0, decimal + index + 1)
  604. } else {
  605. num = num.substring(0)
  606. }
  607. return parseFloat(num).toFixed(decimal)
  608. },
  609. setValue(val) {
  610. this.prescriptions = []
  611. this.prescriptions = val
  612. this.$refs.next_or_last_prescription.close()
  613. var nowDate = new Date()
  614. var nowYear = nowDate.getFullYear()
  615. var nowMonth = nowDate.getMonth() + 1
  616. var nowDay = nowDate.getDate()
  617. var hours = nowDate.getHours()
  618. var min = nowDate.getMinutes()
  619. var nowTime =
  620. nowYear +
  621. '-' +
  622. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  623. '-' +
  624. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (hours < 10 ? '0' + hours : hours) +
  625. ':' + (min < 10 ? '0' + min : min)
  626. for (let i = 0; i < this.prescriptions.length; i++) {
  627. this.prescriptions[i].name = '处方' + (i + 1)
  628. this.prescriptions[i]['pre_time'] = nowTime
  629. if (i == 0) {
  630. if (this.prescriptions[0].advices.length > 0 && this.prescriptions[0].project.length == 0) {
  631. this.customTabIndex = 1
  632. this.curStatus = 1
  633. this.rightTab = 1
  634. this.showOne = true
  635. this.showTwo = false
  636. }
  637. if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length > 0) {
  638. this.customTabIndex = 2
  639. this.curStatus = 2
  640. this.rightTab = 2
  641. this.showTwo = true
  642. this.showOne = false
  643. }
  644. }
  645. }
  646. this.curPrescriptions = this.prescriptions[0]
  647. this.request_record_date = this.record_date
  648. this.$emit('setData', this.prescriptions)
  649. },
  650. GetNextOrLastHisPrescription(params) {
  651. getNextOrLastHisPrescription(params).then(response => {
  652. if (response.data.state == 1) {
  653. if (this.dayorMonth == 'day') {
  654. this.$refs.next_or_last_prescription.show(response.data.data.prescriptions, this.patientInfo.name, this.patientInfo.id, this.prescriptions)
  655. this.request_record_date = uParseTime(response.data.data.prescriptions[0].record_date, '{y}-{m}-{d}')
  656. } else {
  657. this.$message.error('当前处于月结,无法使用上一方或下一方功能')
  658. }
  659. } else {
  660. this.$message.error(response.data.msg)
  661. }
  662. })
  663. },
  664. selectTemplate(selection, row) {
  665. this.tempDrugs = selection
  666. }, changeTemplateData(selection) {
  667. this.tempDrugs = selection
  668. },
  669. searchProjectAction() {
  670. if (this.search_project_keyword.length == 0) {
  671. this.tabProject = this.allProject
  672. } else {
  673. let arr = []
  674. for (let i = 0; i < this.tabProject.length; i++) {
  675. if (this.tabProject[i].project_name.indexOf(this.search_project_keyword) != -1 ||
  676. this.tabProject[i].first_letter.indexOf(this.search_project_keyword) !=-1) {
  677. arr = arr.concat(this.tabProject[i])
  678. }
  679. }
  680. this.tabProject = arr
  681. }
  682. },
  683. searchAction() {
  684. if (this.search_keyword.length == 0) {
  685. this.drugs = this.allDrugs
  686. } else {
  687. let arr = []
  688. for (let i = 0; i < this.drugs.length; i++) {
  689. if (this.drugs[i].drug_name.indexOf(this.search_keyword) != -1 ||
  690. this.drugs[i].wubi.indexOf(this.search_keyword) != -1 ||
  691. this.drugs[i].pinyin.indexOf(this.search_keyword) != -1 ||
  692. this.drugs[i].first_letter.indexOf(this.search_keyword) != -1) {
  693. arr = arr.concat(this.drugs[i])
  694. }
  695. }
  696. this.drugs = arr
  697. }
  698. },
  699. createFilter(queryString) {
  700. return (restaurant) => {
  701. return (restaurant.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
  702. }
  703. },
  704. querySearch2(queryString, cb) {
  705. var restaurants = this.other_sick
  706. restaurants.map(item => {
  707. item.value = item.name
  708. })
  709. var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
  710. // 调用 callback 返回建议列表的数据
  711. cb(results)
  712. },
  713. changeKind(val) {
  714. this.drugs = []
  715. if (val == 0) {
  716. this.drugs = this.allDrugs
  717. } else {
  718. for (let i = 0; i < this.allDrugs.length; i++) {
  719. if (this.allDrugs[i].drug_type == val) {
  720. this.drugs.push(this.allDrugs[i])
  721. }
  722. }
  723. }
  724. },
  725. getDictionaryDataConfig(module, filed_name) {
  726. return getDictionaryDataConfig(module, filed_name)
  727. },
  728. getInitData() {
  729. getInitData().then(response => {
  730. if (response.data.state == 0) {
  731. this.$message.error(response.data.msg)
  732. return false
  733. } else {
  734. this.drugs = response.data.data.drugs
  735. if (this.org_id == 10206) {
  736. for (let i = 0; i < this.zuobiao_drug.length; i++) {
  737. for (let b = 0; b < this.drugs.length; b++) {
  738. if (this.zuobiao_drug[i].bby01 == this.drugs[b].bby01) {
  739. this.drugs[b]['zuobiao_stock_num'] = this.zuobiao_drug[i].sysl
  740. this.drugs[b].retail_price = this.zuobiao_drug[i].lsj
  741. }
  742. }
  743. }
  744. }
  745. this.allDrugs = response.data.data.drugs
  746. this.advices_template = response.data.data.advices_template
  747. this.doctors = response.data.data.doctors
  748. for (let i = 0; i < this.doctors.length; i++) {
  749. if (this.doctors[i].user_type == 1) {
  750. this.doctors.splice(i, 1)
  751. }
  752. }
  753. this.department = response.data.data.department
  754. this.sick = response.data.data.sick
  755. this.diagnoses = response.data.data.diagnose
  756. this.additions = response.data.data.additions
  757. }
  758. })
  759. },
  760. tabclickEvent(val) {
  761. for (let i = 0; i < this.prescriptions.length; i++) {
  762. if (this.prescriptions[i].name == val.name) {
  763. this.prescription_id = this.prescriptions[i].id
  764. this.$emit('event1', this.prescription_id)
  765. this.curPrescriptions = this.prescriptions[i]
  766. this.teamList = []
  767. this.curDrugs = []
  768. this.$refs.multipleTable.clearSelection()
  769. this.$refs.tables.clearSelection()
  770. //用来区分处方属于项目还是药品
  771. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  772. this.customTabIndex = 1
  773. this.curStatus = 1
  774. this.rightTab = 1
  775. this.showOne = true
  776. this.showTwo = false
  777. }
  778. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  779. this.customTabIndex = 2
  780. this.curStatus = 2
  781. this.rightTab = 2
  782. this.showTwo = true
  783. this.showOne = false
  784. }
  785. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
  786. this.customTabIndex = this.rightTab
  787. this.curStatus = 0
  788. }
  789. }
  790. }
  791. if (this.curPrescriptions.order_status == 0) {
  792. this.order_status = ''
  793. }
  794. if (this.curPrescriptions.order_status == 1) {
  795. this.order_status = '未收费'
  796. }
  797. if (this.curPrescriptions.order_status == 2) {
  798. this.order_status = '已结算'
  799. }
  800. if (this.curPrescriptions.order_status == 3) {
  801. this.order_status = '已退费'
  802. }
  803. },
  804. clearData() {
  805. this.curPrescriptions = []
  806. this.curStatus = 0
  807. this.curDrugs = []
  808. this.preDrugs = []
  809. this.teamList = []
  810. },
  811. setData(data, info, admin_info, doctors, department, hisPatientInfo, month_data) {
  812. for (let i = 0; i < doctors.length; i++) {
  813. if (doctors[i].user_type == 1) {
  814. doctors.splice(i, 1)
  815. }
  816. }
  817. this.curMonthPrescriptions = {}
  818. this.curPrescriptions = {}
  819. this.prescription_id = data[0].id
  820. this.editableTabsValue = '处方1'
  821. this.dayorMonth = 'day'
  822. this.$emit('event1', this.prescription_id)
  823. this.curStatus = 0
  824. this.curPrescriptions = {}
  825. this.curMonthPrescriptions = {}
  826. if (month_data && month_data.length > 0) {
  827. this.curMonthPrescriptions = month_data[0]
  828. } else {
  829. this.curMonthPrescriptions = {}
  830. }
  831. if (data && data.length > 0) {
  832. this.curPrescriptions = data[0]
  833. } else {
  834. this.curPrescriptions = {}
  835. }
  836. this.diagnose = info.diagnosis
  837. if (this.diagnose == 0) {
  838. for (let i = 0; i < this.diagnoses.length; i++) {
  839. this.diagnose = this.diagnoses[0].id
  840. }
  841. }
  842. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  843. this.curStatus = 1
  844. this.customTabIndex = 1
  845. this.rightTab = 1
  846. this.showOne = true
  847. this.showTwo = false
  848. }
  849. if (this.curPrescriptions.project.length > 0 && this.curPrescriptions.advices.length == 0) {
  850. this.curStatus = 2
  851. this.customTabIndex = 2
  852. this.rightTab = 2
  853. this.showOne = false
  854. this.showTwo = true
  855. }
  856. this.state1 = info.sick_type
  857. if (this.state1 == 0) {
  858. this.state1 = ''
  859. for (let i = 0; i < this.sick.length; i++) {
  860. this.state1 = this.sick[0].id
  861. }
  862. }
  863. this.state2 = info.sick_history
  864. if (this.state2 == 0) {
  865. this.state2 = ''
  866. }
  867. if (info.prescription_status == 0) {
  868. this.order_status = ''
  869. }
  870. if (this.curPrescriptions.order_status == 1) {
  871. this.order_status = '未收费'
  872. }
  873. if (this.curPrescriptions.order_status == 2) {
  874. this.order_status = '已结算'
  875. }
  876. if (this.curPrescriptions.order_status == 3) {
  877. this.order_status = '已退费'
  878. }
  879. if (info.id > 0) {
  880. this.doctorValue = info.doctor_id
  881. this.departmentValue = info.departments
  882. } else {
  883. if (hisPatientInfo.doctor != 0 && hisPatientInfo.department != 0) {
  884. this.doctorValue = hisPatientInfo.doctor
  885. this.departmentValue = hisPatientInfo.department
  886. } else {
  887. if (admin_info.user_type == 2 || admin_info.user_type == 1) {
  888. this.doctorValue = admin_info.admin_user_id
  889. if (admin_info.department_id == 0) {
  890. if (this.department.length > 0) {
  891. if (department && department.length > 0) {
  892. this.departmentValue = department[0].id
  893. } else {
  894. this.departmentValue = ''
  895. }
  896. } else {
  897. this.departmentValue = ''
  898. }
  899. } else {
  900. this.departmentValue = admin_info.department_id
  901. }
  902. } else {
  903. this.doctorValue = doctors[0].admin_user_id
  904. }
  905. if (this.doctorValue == 0) {
  906. this.doctorValue = ''
  907. }
  908. }
  909. }
  910. if (info.register_type == 0) {
  911. for (let i = 0; i < this.register.length; i++) {
  912. this.register_type = this.register[0].value
  913. }
  914. } else {
  915. this.register_type = info.register_type
  916. }
  917. },
  918. moreState(tab, event) {
  919. if (tab == 'more') {
  920. return false
  921. }
  922. }, open_three() {
  923. this.$refs.saveTemplate.show(this.prescriptions)
  924. }, open_two() {
  925. if (this.dayorMonth == 'day') {
  926. if (this.patientInfo == null || this.patientInfo.id == 0) {
  927. this.$message.error('请选择患者')
  928. return
  929. }
  930. let params = {
  931. end_time: this.record_date,
  932. start_time: moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  933. patient_id: this.patientInfo.id,
  934. p_type: 2
  935. }
  936. getCallHisPrescription(params).then(response => {
  937. if (response.data.state == 1) {
  938. this.$refs.call_prescription.show(this.patientInfo.name, this.patientInfo.id, params.end_time, params.start_time, this.prescriptions, response.data.data.prescriptions)
  939. } else {
  940. this.$message.error(response.data.msg)
  941. }
  942. })
  943. } else {
  944. this.$message.error('当前属于月结状态,无法试用处方调用')
  945. }
  946. },
  947. open(index, isLoading) {
  948. if (this.dayorMonth == 'day') {
  949. if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length == 0) {
  950. this.$message.error('请先开处方')
  951. return
  952. }
  953. }
  954. if (this.dayorMonth == 'day') {
  955. if (this.doctorValue.length <= 0) {
  956. this.$message.error('医生不能为空')
  957. return
  958. }
  959. if (this.departmentValue.length <= 0) {
  960. this.$message.error('科室不能为空')
  961. return
  962. }
  963. if (this.state1 <= 0) {
  964. this.$message.error('疾病类型不能为空')
  965. return
  966. }
  967. if (index == 1) {
  968. let params = {
  969. p_type: 2,
  970. patient_id: this.patientInfo.id,
  971. diagnose: this.diagnose,
  972. sick_type: this.state1,
  973. sick_history: this.state2,
  974. doctor: this.doctorValue,
  975. department: this.departmentValue,
  976. record_date: this.record_date,
  977. his_patient_id: this.hisPatientInfo.id,
  978. reg_type: this.register_type,
  979. }
  980. for (let i = 0; i < this.prescriptions.length; i++) {
  981. if (this.prescriptions[i].advices.length > 0 && this.prescriptions[i].project.length == 0) {
  982. this.prescriptions[i]['type'] = 1
  983. }
  984. if (this.prescriptions[i].advices.length == 0 && this.prescriptions[i].project.length > 0) {
  985. this.prescriptions[i]['type'] = 2
  986. }
  987. for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
  988. this.prescriptions[i].advices[b].single_dose = this.prescriptions[i].advices[b].single_dose.toString()
  989. this.prescriptions[i].advices[b].prescribing_number = this.prescriptions[i].advices[b].prescribing_number.toString()
  990. this.prescriptions[i].advices[b].retail_price = this.prescriptions[i].advices[b].retail_price.toString()
  991. this.prescriptions[i].advices[b].day = parseInt(this.prescriptions[i].advices[b].day)
  992. this.prescriptions[i].advices[b].day_count = parseInt(this.prescriptions[i].advices[b].day_count)
  993. this.prescriptions[i].advices[b].frequency_type = parseInt(this.prescriptions[i].advices[b].frequency_type)
  994. this.prescriptions[i].advices[b].week_day = this.prescriptions[i].advices[b].week_day.toString()
  995. }
  996. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  997. this.prescriptions[i].project[b].price = this.prescriptions[i].project[b].price.toString()
  998. this.prescriptions[i].project[b].total = this.prescriptions[i].project[b].total.toString()
  999. this.prescriptions[i].project[b].delivery_way = this.prescriptions[i].project[b].delivery_way.toString()
  1000. this.prescriptions[i].project[b].day_count = parseInt(this.prescriptions[i].project[b].day_count)
  1001. this.prescriptions[i].project[b].frequency_type = parseInt(this.prescriptions[i].project[b].frequency_type)
  1002. this.prescriptions[i].project[b].week_day = this.prescriptions[i].project[b].week_day.toString()
  1003. }
  1004. for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
  1005. this.prescriptions[i].addition[b].id = parseInt(this.prescriptions[i].addition[b].id)
  1006. this.prescriptions[i].addition[b].item_id = parseInt(this.prescriptions[i].addition[b].item_id)
  1007. this.prescriptions[i].addition[b].price = this.prescriptions[i].addition[b].price.toString()
  1008. this.prescriptions[i].addition[b].count = this.prescriptions[i].addition[b].count.toString()
  1009. }
  1010. }
  1011. let data = {
  1012. 'prescriptions': this.prescriptions
  1013. }
  1014. isLoading = true
  1015. createHisPrescription(data, params).then(response => {
  1016. if (response.data.state == 1) {
  1017. this.$emit('change', this.patientInfo.id)
  1018. this.$message.success('保存成功')
  1019. }
  1020. })
  1021. } else if (index == 2) {
  1022. this.$router.push('/outpatientDoctorStation/print')
  1023. } else if (index == 4) {
  1024. } else if (index == 5) {
  1025. this.$refs.saveTemplate.show()
  1026. }
  1027. } else if (this.dayorMonth == 'month') {
  1028. if (this.isShowDayPrescription) {
  1029. // if (this.curDayPrescriptions.order_status == 2) {
  1030. // this.$message.error('当前处方已经结算,无法保存')
  1031. // return
  1032. // }
  1033. if (this.doctorValue.length <= 0) {
  1034. this.$message.error('医生不能为空')
  1035. return
  1036. }
  1037. if (this.departmentValue.length <= 0) {
  1038. this.$message.error('科室不能为空')
  1039. return
  1040. }
  1041. if (index == 1) {
  1042. let params = {
  1043. patient_id: this.patientInfo.id,
  1044. diagnose: this.diagnose,
  1045. sick_type: this.state1,
  1046. sick_history: this.state2,
  1047. doctor: this.doctorValue,
  1048. department: this.departmentValue,
  1049. record_date: this.end_time,
  1050. his_patient_id: this.hisPatientInfo.id,
  1051. reg_type: this.register_type,
  1052. p_type: 2
  1053. }
  1054. var month_prescriptions = this.deepClone(this.month_prescriptions)
  1055. for (let i = 0; i < month_prescriptions.length; i++) {
  1056. if (month_prescriptions[i].advices.length > 0 && month_prescriptions[i].project.length == 0) {
  1057. month_prescriptions[i]['type'] = 1
  1058. }
  1059. if (month_prescriptions[i].advices.length == 0 && month_prescriptions[i].project.length > 0) {
  1060. month_prescriptions[i]['type'] = 2
  1061. }
  1062. for (let b = 0; b < month_prescriptions[i].advices.length; b++) {
  1063. month_prescriptions[i].advices[b].single_dose = month_prescriptions[i].advices[b].single_dose.toString()
  1064. month_prescriptions[i].advices[b].prescribing_number = month_prescriptions[i].advices[b].prescribing_number.toString()
  1065. month_prescriptions[i].advices[b].retail_price = month_prescriptions[i].advices[b].retail_price.toString()
  1066. month_prescriptions[i].advices[b].day = parseInt(month_prescriptions[i].advices[b].day)
  1067. }
  1068. for (let b = 0; b < month_prescriptions[i].project.length; b++) {
  1069. console.log('~~~~~~~')
  1070. month_prescriptions[i].project[b].price = month_prescriptions[i].project[b].price.toString()
  1071. month_prescriptions[i].project[b].total = month_prescriptions[i].project[b].total.toString()
  1072. month_prescriptions[i].project[b].delivery_way = month_prescriptions[i].project[b].delivery_way.toString()
  1073. }
  1074. for (let b = 0; b < month_prescriptions[i].addition.length; b++) {
  1075. month_prescriptions[i].addition[b].id = parseInt(month_prescriptions[i].addition[b].id)
  1076. month_prescriptions[i].addition[b].item_id = parseInt(month_prescriptions[i].addition[b].item_id)
  1077. month_prescriptions[i].addition[b].price = month_prescriptions[i].addition[b].price.toString()
  1078. month_prescriptions[i].addition[b].count = month_prescriptions[i].addition[b].count.toString()
  1079. }
  1080. }
  1081. let data = {
  1082. 'prescriptions': month_prescriptions
  1083. }
  1084. editHisPrescription(data, params).then(response => {
  1085. if (response.data.state == 1) {
  1086. this.month_prescriptions = month_prescriptions
  1087. this.$message.success('编辑成功')
  1088. }
  1089. })
  1090. }
  1091. }
  1092. }
  1093. },
  1094. addTab(targetName) {
  1095. // if (this.curPrescriptions.order_status == 2) {
  1096. // this.$message.error('该处方已经结算或者退费,无法继续添加处方')
  1097. // return
  1098. // }
  1099. // if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
  1100. // this.$message.error('当前处方无数据,新增数据后才能新增处方')
  1101. // return
  1102. // }
  1103. if (this.prescriptions.length == 0){
  1104. this.tabIndex = 1
  1105. }else{
  1106. var str = this.prescriptions[this.prescriptions.length - 1].name
  1107. var reg =/[\u4e00-\u9fa5]/g;
  1108. this.tabIndex = parseInt(str.replace(reg, ""))
  1109. ++this.tabIndex
  1110. }
  1111. let newTabName = '处方' + this.tabIndex
  1112. var nowDate = new Date()
  1113. var nowYear = nowDate.getFullYear()
  1114. var nowMonth = nowDate.getMonth() + 1
  1115. var nowDay = nowDate.getDate()
  1116. var hours = nowDate.getHours()
  1117. var min = nowDate.getMinutes()
  1118. var nowTime =
  1119. nowYear +
  1120. '-' +
  1121. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  1122. '-' +
  1123. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (hours < 10 ? '0' + hours : hours) +
  1124. ':' + (min < 10 ? '0' + min : min)
  1125. let obj = {
  1126. id: 0,
  1127. name: newTabName,
  1128. order_status: 0,
  1129. advices: [],
  1130. project: [],
  1131. addition: [],
  1132. pre_time: nowTime,
  1133. // pre_time: nowTime
  1134. }
  1135. if(this.org_id == 10206) {
  1136. obj.med_type = 12
  1137. }else{
  1138. obj.med_type = 14
  1139. }
  1140. this.prescriptions.push(obj)
  1141. this.editableTabsValue = newTabName
  1142. this.curPrescriptions = this.prescriptions[this.prescriptions.length - 1]
  1143. this.curStatus = 0
  1144. if (this.curPrescriptions.order_status == 0) {
  1145. this.order_status = '未收费'
  1146. }
  1147. if (this.curPrescriptions.order_status == 1) {
  1148. this.order_status = '未收费'
  1149. }
  1150. if (this.curPrescriptions.order_status == 2) {
  1151. this.order_status = '已结算'
  1152. }
  1153. if (this.curPrescriptions.order_status == 3) {
  1154. this.order_status = '已退费'
  1155. }
  1156. },
  1157. removeTab(targetName) {
  1158. this.$confirm('处方删除后不可恢复,是否确认删除', '删除', {
  1159. confirmButtonText: '确 定',
  1160. cancelButtonText: '取 消',
  1161. type: 'warning'
  1162. }).then(() => {
  1163. let id = 0
  1164. for (let i = 0; i < this.prescriptions.length; i++) {
  1165. if (this.prescriptions[i].name == targetName) {
  1166. id = this.prescriptions[i].id
  1167. }
  1168. }
  1169. if (id == 0) {
  1170. let tabs = this.prescriptions
  1171. let activeName = this.editableTabsValue
  1172. if (activeName === targetName) {
  1173. tabs.forEach((tab, index) => {
  1174. if (tab.name === targetName) {
  1175. let nextTab = tabs[index + 1] || tabs[index - 1]
  1176. if (nextTab) {
  1177. activeName = nextTab.name
  1178. }
  1179. }
  1180. })
  1181. }
  1182. this.editableTabsValue = activeName
  1183. this.prescriptions = tabs.filter(tab => tab.name !== targetName)
  1184. for (let i = 0; i < this.prescriptions.length; i++) {
  1185. if (activeName == this.prescriptions[i].name) {
  1186. this.curPrescriptions = this.prescriptions[i]
  1187. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1188. this.curStatus = 1
  1189. }
  1190. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  1191. this.curStatus = 2
  1192. }
  1193. }
  1194. }
  1195. if (this.prescriptions.length == 0) {
  1196. this.curPrescriptions = []
  1197. this.curStatus = 0
  1198. }
  1199. } else {
  1200. let params = {
  1201. 'id': id
  1202. }
  1203. delHisPrescriptionInfoTemplate(params).then(response => {
  1204. if (response.data.state == 1) {
  1205. this.$message.success('删除成功')
  1206. let tabs = this.prescriptions
  1207. let activeName = this.editableTabsValue
  1208. if (activeName === targetName) {
  1209. tabs.forEach((tab, index) => {
  1210. if (tab.name === targetName) {
  1211. let nextTab = tabs[index + 1] || tabs[index - 1]
  1212. if (nextTab) {
  1213. activeName = nextTab.name
  1214. }
  1215. }
  1216. })
  1217. }
  1218. this.editableTabsValue = activeName
  1219. this.prescriptions = tabs.filter(tab => tab.name !== targetName)
  1220. for (let i = 0; i < this.prescriptions.length; i++) {
  1221. if (activeName == this.prescriptions[i].name) {
  1222. this.curPrescriptions = this.prescriptions[i]
  1223. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1224. this.curStatus = 1
  1225. }
  1226. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  1227. this.curStatus = 2
  1228. }
  1229. }
  1230. }
  1231. if (this.prescriptions.length == 0) {
  1232. this.curPrescriptions = []
  1233. this.curStatus = 0
  1234. }
  1235. } else {
  1236. this.$message.success(response.data.msg)
  1237. }
  1238. })
  1239. }
  1240. }).catch(() => {
  1241. })
  1242. },
  1243. beforeLeave(activeName, oldActiveName) {
  1244. let index = activeName
  1245. if (index == 1) {
  1246. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  1247. return false
  1248. }
  1249. } else {
  1250. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1251. return false
  1252. }
  1253. }
  1254. },
  1255. clickTab(tab) {
  1256. let index = parseInt(tab.name)
  1257. if (index == 1) {
  1258. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  1259. this.$message.error('当前处方为项目,无法切换为药品,需要新开处方')
  1260. return
  1261. }
  1262. } else {
  1263. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1264. this.$message.error('当前处方为药品,无法切换为项目,需要新开处方')
  1265. return
  1266. }
  1267. }
  1268. if (index == 1) {
  1269. this.teamList = []
  1270. this.$refs.tables.clearSelection()
  1271. this.showOne = true
  1272. this.showTwo = false
  1273. this.$nextTick(() => {
  1274. console.log("lilili1111111111111111111111111111111111111111111",this.prescriptions[this.prescriptions.length - 1])
  1275. this.$refs.prescription_tables.setNewData(this.prescriptions[this.prescriptions.length - 1])
  1276. })
  1277. this.customTabIndex = 1
  1278. }
  1279. if (index == 2) {
  1280. this.curDrugs = []
  1281. this.$refs.multipleTable.clearSelection()
  1282. this.showTwo = true
  1283. this.showOne = false
  1284. this.$nextTick(() => {
  1285. console.log("lilili1111111111111111111111111111111111111111111",this.prescriptions[this.prescriptions.length - 1])
  1286. this.$refs.prescription_tables.setNewData(this.prescriptions[this.prescriptions.length - 1])
  1287. })
  1288. this.customTabIndex = 2
  1289. }
  1290. this.rightTab = index
  1291. //用来区分处方属于项目还是药品
  1292. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1293. this.customTabIndex = 1
  1294. this.curStatus = 1
  1295. }
  1296. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  1297. this.customTabIndex = 2
  1298. this.curStatus = 2
  1299. }
  1300. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
  1301. // this.customTabIndex = this.rightTab
  1302. this.customTabIndex = index
  1303. this.curStatus = 0
  1304. }
  1305. }, changeAllGoodInfoTableData: function(selection) {
  1306. this.curDrugs = selection
  1307. }, addCharges() {
  1308. this.$refs.additionalCharges.show()
  1309. },
  1310. selectDrugs(selection, row) {
  1311. if(this.org_id == 10206){
  1312. if (row.zuobiao_stock_num <= 0) {
  1313. if (selection) {
  1314. selection.forEach(row => {
  1315. if (row.zuobiao_stock_num <= 0) {
  1316. this.$refs.multipleTable.toggleRowSelection(row)
  1317. }
  1318. })
  1319. } else {
  1320. this.$refs.multipleTable.clearSelection()
  1321. }
  1322. this.$message.error(row.drug_name + '库存不足')
  1323. return
  1324. }else{
  1325. this.curDrugs = selection
  1326. }
  1327. }else{
  1328. this.curDrugs = selection
  1329. }
  1330. },
  1331. comfirm() {
  1332. console.log("temlist",this.teamList)
  1333. // if (this.curPrescriptions.order_status == 2) {
  1334. // this.$message.error('该处方已经结算,无法继续添加药品或者项目')
  1335. // this.teamList = []
  1336. // this.curDrugs = []
  1337. // this.tempDrugs = []
  1338. // this.$refs.tables.clearSelection()
  1339. // this.$refs.multipleTableTwo.clearSelection()
  1340. // this.$refs.multipleTable.clearSelection()
  1341. // return
  1342. // }
  1343. // if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1344. // if (this.$store.getters.xt_user.org_id == 10138) {
  1345. // for (let i = 0; i < this.curDrugs.length; i++) {
  1346. // if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
  1347. // this.$message.error('该处方属于特病类型处方,开非特病类型的药')
  1348. // return
  1349. // }
  1350. // }
  1351. // }
  1352. // }
  1353. // if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
  1354. // if (this.$store.getters.xt_user.org_id == 10138) {
  1355. // for (let i = 0; i < this.curDrugs.length; i++) {
  1356. // if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
  1357. // this.$message.error('该处方属于特病类型处方,开非特病类型的药')
  1358. // return
  1359. // }
  1360. // }
  1361. // }
  1362. // }
  1363. if (this.curDrugs.length > 0) {
  1364. for (let i = 0; i < this.curDrugs.length; i++) {
  1365. if(this.$store.getters.xt_user.org.id != 10206) {
  1366. if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
  1367. this.$message.error('该处方属于特病类型处方,开非特病类型的药')
  1368. return
  1369. }
  1370. }
  1371. }
  1372. }
  1373. if (this.teamList.length > 0) {
  1374. for (let i = 0; i < this.teamList.length; i++) {
  1375. if(this.$store.getters.xt_user.org.id != 10206) {
  1376. if (this.curPrescriptions.med_type == 14 && this.teamList[i].is_special_diseases != 1) {
  1377. setTimeout(() => {
  1378. this.$message.error('该处方属于特病类型处方,请开特病类型的项目')
  1379. }, 100)
  1380. // return
  1381. }
  1382. }
  1383. }
  1384. let arr = this.teamList
  1385. let newArr = []
  1386. arr.map(item => {
  1387. if (this.curPrescriptions.med_type != 14) {
  1388. newArr.push(item)
  1389. }
  1390. if (this.curPrescriptions.med_type == 14 && item.is_special_diseases == 1) {
  1391. newArr.push(item)
  1392. }
  1393. })
  1394. this.teamList = newArr
  1395. }
  1396. if (this.curDrugs.length == 0) {
  1397. for (let i = 0; i < this.curDrugs.length; i++) {
  1398. if(this.$store.getters.xt_user.org.id != 10206) {
  1399. if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
  1400. this.$message.error('该处方属于特病类型处方,开非特病类型的药')
  1401. return
  1402. }
  1403. }
  1404. }
  1405. }
  1406. if (this.curStatus == 1 && this.rightTab == 2) {
  1407. this.$message.error('该处方是药品,无法添加项目')
  1408. this.teamList = []
  1409. this.$refs.tables.clearSelection()
  1410. return
  1411. }
  1412. if (this.curStatus == 2 && this.rightTab == 1) {
  1413. this.$message.error('该处方是项目,无法添加药品')
  1414. this.curDrugs = []
  1415. this.tempDrugs = []
  1416. this.$refs.multipleTable.clearSelection()
  1417. this.$refs.multipleTableTwo.clearSelection()
  1418. return
  1419. }
  1420. for (let i = 0; i < this.teamList.length; i++) {
  1421. for (let a = 0; a < this.curPrescriptions.project.length; a++) {
  1422. if (this.teamList[i].id == this.curPrescriptions.project[a].project_id) {
  1423. this.$message.error('当前处方存在相同的药品,无法添加相同的项目')
  1424. return
  1425. }
  1426. }
  1427. }
  1428. for (let i = 0; i < this.curDrugs.length; i++) {
  1429. for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
  1430. if (this.curDrugs[i].id == this.curPrescriptions.advices[a].id) {
  1431. this.$message.error('当前处方存在相同的药品,无法添加相同的药品')
  1432. return
  1433. }
  1434. }
  1435. }
  1436. let templateDrugs = []
  1437. for (let i = 0; i < this.tempDrugs.length; i++) {
  1438. for (let a = 0; a < this.tempDrugs[i].advices.length; a++) {
  1439. templateDrugs.push(this.tempDrugs[i].advices[a])
  1440. }
  1441. }
  1442. // for (let i = 0; i < templateDrugs.length; i++) {
  1443. // for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
  1444. // if (this.templateDrugs[i].drug_id == this.curPrescriptions.advices[i].id) {
  1445. // this.$message.error('改处方存在相同的药品,无法添加相同的药品')
  1446. // return
  1447. //
  1448. // }
  1449. // }
  1450. // }
  1451. for (let i = 0; i < this.prescriptions.length; i++) {
  1452. if (this.prescriptions[i].name == this.editableTabsValue) {
  1453. var temp = this.deepClone(this.curDrugs)
  1454. var temp2 = this.deepClone(this.teamList)
  1455. var temp3 = this.deepClone(templateDrugs)
  1456. if (temp3.length > 0) {
  1457. for (let b = 0; b < temp3.length; b++) {
  1458. let obj = {
  1459. advice_id: 0,
  1460. id: temp3[b].id,
  1461. drug_name: temp3[b].advice_name,
  1462. single_dose: temp3[b].single_dose,
  1463. delivery_way: temp3[b].delivery_way,
  1464. execution_frequency: temp3[b].execution_frequency,
  1465. retail_price: temp3[b].drug.retail_price.toString(),
  1466. remark: '',
  1467. day: 1,
  1468. prescribing_number: temp3[b].prescribing_number,
  1469. single_dose_unit: temp3[b].drug.drug_dose_unit,
  1470. prescribing_number_unit: temp3[b].drug.max_unit,
  1471. medical_insurance_number: temp3[b].drug.medical_insurance_number
  1472. }
  1473. if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
  1474. obj.prescribing_number = 1
  1475. }
  1476. this.prescriptions[i].advices.push(obj)
  1477. }
  1478. this.curStatus = 1
  1479. }
  1480. let index = 0
  1481. if (this.prescriptions[i].advices.length > 0) {
  1482. index = this.prescriptions[i].advices.length
  1483. }
  1484. if (temp.length > 0) {
  1485. for (let b = 0; b < temp.length; b++) {
  1486. let temp_index = b + 1
  1487. let obj = {
  1488. advice_id: 0,
  1489. id: temp[b].id,
  1490. drug_name: temp[b].drug_name,
  1491. single_dose: temp[b].single_dose,
  1492. delivery_way: temp[b].delivery_way,
  1493. execution_frequency: temp[b].execution_frequency,
  1494. retail_price: temp[b].prescribing_number_unit == temp[b].max_unit ? temp[b].retail_price.toString() : temp[b].min_price.toString(),
  1495. remark: '',
  1496. day: 1,
  1497. prescribing_number: temp[b].prescribing_number,
  1498. single_dose_unit: temp[b].dose_unit,
  1499. prescribing_number_unit: temp[b].prescribing_number_unit,
  1500. medical_insurance_number: temp[b].medical_insurance_number,
  1501. drug: temp[b],
  1502. groupno: index + temp_index,
  1503. frequency_type: 1,
  1504. day_count: 0,
  1505. week_day: ''
  1506. }
  1507. if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
  1508. obj.prescribing_number = 1
  1509. }
  1510. this.prescriptions[i].advices.push(obj)
  1511. }
  1512. this.curStatus = 1
  1513. }
  1514. console.log("~~~~222222~~~~~~~")
  1515. console.log(temp2)
  1516. if (temp2.length > 0) {
  1517. console.log("~~~~11111~~~~~~~")
  1518. for (let b = 0; b < temp2.length; b++) {
  1519. let obj = {
  1520. id: 0,
  1521. project_id: temp2[b].id,
  1522. project_name: temp2[b].project_name,
  1523. statistical_classification: temp2[b].statistical_classification,
  1524. single_dose: temp2[b].single_dose,
  1525. delivery_way: temp2[b].delivery_way,
  1526. execution_frequency: temp2[b].execution_frequency,
  1527. number_days: temp2[b].number_days,
  1528. total: temp2[b].total,
  1529. price: temp2[b].price,
  1530. remark: '',
  1531. medical_code: temp2[b].medical_code,
  1532. type: temp2[b].type,
  1533. frequency_type: 1,
  1534. day_count: 0,
  1535. week_day:temp2[b].number_days
  1536. }
  1537. if (temp2[b].type == 2) {
  1538. obj['project'] = temp2[b].project
  1539. obj['unit'] = temp2[b].project.unit
  1540. } else if (temp2[b].type == 3) {
  1541. obj['good_info'] = temp2[b].good_info
  1542. obj['unit'] = temp2[b].good_info.packing_unit
  1543. }
  1544. if (obj.total == 0 || obj.total == undefined) {
  1545. obj.total = 1
  1546. }
  1547. if (obj.type == 3) {
  1548. obj.single_dose = 1
  1549. }
  1550. this.prescriptions[i].project.push(obj)
  1551. }
  1552. this.curStatus = 2
  1553. }
  1554. this.curPrescriptions = this.prescriptions[i]
  1555. this.$refs.multipleTable.clearSelection()
  1556. this.$refs.tables.clearSelection()
  1557. }
  1558. }
  1559. this.curDrugs = []
  1560. this.preDrugs = []
  1561. this.teamList = []
  1562. }, changeAllGoodInfoTableDataTwo(row) {
  1563. this.teamList = row
  1564. },
  1565. selectChange(selection, row) {
  1566. if (this.org_id == 10206 && row.zuobiao_stock_num <= 0) {
  1567. if (row.type == 3) {
  1568. if (selection) {
  1569. selection.forEach(row => {
  1570. if (row.zuobiao_stock_num <= 0) {
  1571. this.$refs.tables.toggleRowSelection(row)
  1572. }
  1573. })
  1574. } else {
  1575. this.$refs.tables.clearSelection()
  1576. }
  1577. this.$message.error(row.project_name + '库存不足')
  1578. return
  1579. }
  1580. }
  1581. this.teamList = selection
  1582. },
  1583. getPrescriptionTemplateInfo() {
  1584. let params = {
  1585. id: this.$route.query.id
  1586. }
  1587. getPrescriptionTemplateInfo(params).then(response => {
  1588. if (response.data.state == 0) {
  1589. this.$message.error(response.data.msg)
  1590. return false
  1591. } else {
  1592. this.prescriptions = []
  1593. if (response.data.data.template.id > 0) {
  1594. this.tempForm.name = response.data.data.template.name
  1595. this.tempForm.mode_id = response.data.data.template.mode
  1596. console.log("数据woowowowo",response.data.data.prescriptions)
  1597. for (let i = 0; i < response.data.data.prescriptions.length; i++) {
  1598. var prescription = response.data.data.prescriptions[i]
  1599. let tempAdvice = []
  1600. let tempProject = []
  1601. let tempAddition = []
  1602. //药品
  1603. for (let b = 0; b < prescription.advices.length; b++) {
  1604. console.log("prescription.advices[b].drug.drug_status.startsWith('停用')",prescription.advices[b].drug.drug_status.startsWith('停用'))
  1605. if(prescription.advices[b].drug!=null && prescription.advices[b].drug.drug_status.startsWith('停用') == false){
  1606. let obj = {
  1607. advice_id: prescription.advices[b].id,
  1608. drug_name: prescription.advices[b].advice_name,
  1609. single_dose: prescription.advices[b].single_dose,
  1610. delivery_way: prescription.advices[b].delivery_way,
  1611. execution_frequency: prescription.advices[b].execution_frequency,
  1612. retail_price: prescription.advices[b].price.toString(),
  1613. remark: prescription.advices[b].remark,
  1614. day: prescription.advices[b].day,
  1615. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1616. single_dose_unit: prescription.advices[b].single_dose_unit,
  1617. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1618. medical_insurance_number: prescription.advices[b].med_list_codg,
  1619. id: prescription.advices[b].drug_id,
  1620. drug: prescription.advices[b].drug,
  1621. groupno: prescription.advices[b].groupno,
  1622. frequency_type: prescription.advices[b].frequency_type,
  1623. day_count: prescription.advices[b].day_count,
  1624. week_day: prescription.advices[b].week_day,
  1625. number: prescription.advices[b].drug.number
  1626. }
  1627. tempAdvice.push(obj)
  1628. }
  1629. }
  1630. //项目
  1631. for (let b = 0; b < prescription.project.length; b++) {
  1632. if(prescription.project[b].type == 2 && prescription.project[b].project.medical_status!=1){
  1633. if (this.org_id == 10206) {
  1634. let obj = {
  1635. id: prescription.project[b].id,
  1636. project_id: prescription.project[b].project_id,
  1637. project_name: prescription.project[b].project.project_name,
  1638. statistical_classification: prescription.project[b].project.statistical_classification,
  1639. single_dose: prescription.project[b].single_dose,
  1640. delivery_way: prescription.project[b].delivery_way,
  1641. execution_frequency: prescription.project[b].execution_frequency,
  1642. number_days: prescription.project[b].day,
  1643. total: prescription.project[b].count.toString(),
  1644. price: prescription.project[b].price,
  1645. remark: prescription.project[b].remark,
  1646. medical_code: prescription.project[b].project.medical_code,
  1647. type: prescription.project[b].type,
  1648. frequency_type: prescription.project[b].frequency_type,
  1649. day_count: prescription.project[b].day_count,
  1650. week_day: prescription.project[b].week_day,
  1651. number_days:prescription.project[b].week_day
  1652. }
  1653. if (prescription.project[b].type == 2) {
  1654. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  1655. obj['medical_code'] = prescription.project[b].project.medical_code
  1656. obj['project_name'] = prescription.project[b].project.project_name
  1657. obj['project'] = prescription.project[b].project
  1658. obj['unit'] = prescription.project[b].unit
  1659. obj['number'] = ""
  1660. } else if (prescription.project[b].type == 3) {
  1661. obj['statistical_classification'] = ''
  1662. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  1663. obj['project_name'] = prescription.project[b].good_info.good_name
  1664. obj['good_info'] = prescription.project[b].good_info
  1665. obj['unit'] = prescription.project[b].good_info.packing_unit
  1666. obj['number'] = prescription.project[b].good_info.good_number
  1667. }
  1668. tempProject.push(obj)
  1669. }else{
  1670. let obj = {
  1671. id: prescription.project[b].id,
  1672. project_id: prescription.project[b].project_id,
  1673. project_name: prescription.project[b].project.project_name,
  1674. statistical_classification: prescription.project[b].project.statistical_classification,
  1675. single_dose: prescription.project[b].single_dose,
  1676. delivery_way: prescription.project[b].delivery_way,
  1677. execution_frequency: prescription.project[b].execution_frequency,
  1678. number_days: prescription.project[b].day,
  1679. total: prescription.project[b].count.toString(),
  1680. price: prescription.project[b].price,
  1681. remark: prescription.project[b].remark,
  1682. medical_code: prescription.project[b].project.medical_code,
  1683. type: prescription.project[b].type,
  1684. frequency_type: prescription.project[b].frequency_type,
  1685. day_count: prescription.project[b].day_count,
  1686. week_day: prescription.project[b].week_day,
  1687. number_days:prescription.project[b].week_day
  1688. }
  1689. if (prescription.project[b].type == 2) {
  1690. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  1691. obj['medical_code'] = prescription.project[b].project.medical_code
  1692. obj['project_name'] = prescription.project[b].project.project_name
  1693. obj['project'] = prescription.project[b].project
  1694. obj['unit'] = prescription.project[b].unit
  1695. } else if (prescription.project[b].type == 3) {
  1696. obj['statistical_classification'] = ''
  1697. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  1698. obj['project_name'] = prescription.project[b].good_info.good_name
  1699. obj['good_info'] = prescription.project[b].good_info
  1700. obj['unit'] = prescription.project[b].good_info.packing_unit
  1701. }
  1702. tempProject.push(obj)
  1703. }
  1704. }else if(prescription.project[b].type == 3 && prescription.project[b].good_info.good_status.startsWith('停用') == false){
  1705. if (this.org_id == 10206 ) {
  1706. let obj = {
  1707. id: prescription.project[b].id,
  1708. project_id: prescription.project[b].project_id,
  1709. project_name: prescription.project[b].project.project_name,
  1710. statistical_classification: prescription.project[b].project.statistical_classification,
  1711. single_dose: prescription.project[b].single_dose,
  1712. delivery_way: prescription.project[b].delivery_way,
  1713. execution_frequency: prescription.project[b].execution_frequency,
  1714. number_days: prescription.project[b].day,
  1715. total: prescription.project[b].count.toString(),
  1716. price: prescription.project[b].price,
  1717. remark: prescription.project[b].remark,
  1718. medical_code: prescription.project[b].project.medical_code,
  1719. type: prescription.project[b].type,
  1720. frequency_type: prescription.project[b].frequency_type,
  1721. day_count: prescription.project[b].day_count,
  1722. week_day: prescription.project[b].week_day,
  1723. number_days:prescription.project[b].week_day
  1724. }
  1725. if (prescription.project[b].type == 2) {
  1726. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  1727. obj['medical_code'] = prescription.project[b].project.medical_code
  1728. obj['project_name'] = prescription.project[b].project.project_name
  1729. obj['project'] = prescription.project[b].project
  1730. obj['unit'] = prescription.project[b].unit
  1731. obj['number'] = ""
  1732. } else if (prescription.project[b].type == 3) {
  1733. obj['statistical_classification'] = ''
  1734. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  1735. obj['project_name'] = prescription.project[b].good_info.good_name
  1736. obj['good_info'] = prescription.project[b].good_info
  1737. obj['unit'] = prescription.project[b].good_info.packing_unit
  1738. obj['number'] = prescription.project[b].good_info.good_number
  1739. }
  1740. tempProject.push(obj)
  1741. }else{
  1742. let obj = {
  1743. id: prescription.project[b].id,
  1744. project_id: prescription.project[b].project_id,
  1745. project_name: prescription.project[b].project.project_name,
  1746. statistical_classification: prescription.project[b].project.statistical_classification,
  1747. single_dose: prescription.project[b].single_dose,
  1748. delivery_way: prescription.project[b].delivery_way,
  1749. execution_frequency: prescription.project[b].execution_frequency,
  1750. number_days: prescription.project[b].day,
  1751. total: prescription.project[b].count.toString(),
  1752. price: prescription.project[b].price,
  1753. remark: prescription.project[b].remark,
  1754. medical_code: prescription.project[b].project.medical_code,
  1755. type: prescription.project[b].type,
  1756. frequency_type: prescription.project[b].frequency_type,
  1757. day_count: prescription.project[b].day_count,
  1758. week_day: prescription.project[b].week_day,
  1759. number_days:prescription.project[b].week_day
  1760. }
  1761. if (prescription.project[b].type == 2) {
  1762. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  1763. obj['medical_code'] = prescription.project[b].project.medical_code
  1764. obj['project_name'] = prescription.project[b].project.project_name
  1765. obj['project'] = prescription.project[b].project
  1766. obj['unit'] = prescription.project[b].unit
  1767. } else if (prescription.project[b].type == 3) {
  1768. obj['statistical_classification'] = ''
  1769. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  1770. obj['project_name'] = prescription.project[b].good_info.good_name
  1771. obj['good_info'] = prescription.project[b].good_info
  1772. obj['unit'] = prescription.project[b].good_info.packing_unit
  1773. }
  1774. tempProject.push(obj)
  1775. }
  1776. }
  1777. }
  1778. // var preTime = nowTime
  1779. let index = i + 1
  1780. let obj = {
  1781. id: prescription.id,
  1782. name: '处方' + index,
  1783. advices: tempAdvice,
  1784. project: tempProject,
  1785. addition: tempAddition,
  1786. order_status: 1
  1787. // pre_time: preTime
  1788. }
  1789. if (prescription.med_type == '' || prescription.med_type == 0) {
  1790. obj['med_type'] = ''
  1791. } else {
  1792. obj['med_type'] = parseInt(prescription.med_type)
  1793. }
  1794. this.prescriptions.push(obj)
  1795. console.log("!!!!!")
  1796. console.log(this.prescriptions)
  1797. console.log("!!!!!")
  1798. }
  1799. this.curPrescriptions = this.prescriptions[0]
  1800. } else {
  1801. let obj = {
  1802. id: 0,
  1803. name: '处方1',
  1804. advices: [],
  1805. project: [],
  1806. addition: [],
  1807. order_status: 0,
  1808. med_type: ''
  1809. }
  1810. if(this.org_id == 10206) {
  1811. obj.med_type = 12
  1812. }else{
  1813. obj.med_type = 14
  1814. }
  1815. this.prescriptions.push(obj)
  1816. console.log("this.prescriptions")
  1817. console.log(this.prescriptions)
  1818. console.log("this.prescriptions")
  1819. this.curPrescriptions = this.prescriptions[0]
  1820. }
  1821. }
  1822. })
  1823. },
  1824. getlist() {
  1825. this.tabProject = []
  1826. getHisProject().then(response => {
  1827. if (response.data.state == 1) {
  1828. var project = response.data.data.project
  1829. for (let i = 0; i < project.length; i++) {
  1830. let obj = {
  1831. id: project[i].id,
  1832. project_name: project[i].project_name,
  1833. statistical_classification: project[i].statistical_classification,
  1834. single_dose: project[i].single_dose,
  1835. delivery_way: project[i].delivery_way,
  1836. execution_frequency: project[i].execution_frequency,
  1837. number_days: project[i].number_days,
  1838. price: project[i].price,
  1839. medical_code: project[i].medical_code,
  1840. unit: project[i].unit,
  1841. type: 2,
  1842. is_special_diseases: project[i].disease_directory,
  1843. project: project[i],
  1844. first_letter:project[i].first_letter,
  1845. number: "",
  1846. bbx01:project[i].bbx01,
  1847. }
  1848. this.tabProject.push(obj)
  1849. }
  1850. var good_info = response.data.data.good_info
  1851. for (let i = 0; i < good_info.length; i++) {
  1852. let obj = {
  1853. id: good_info[i].id,
  1854. project_name: good_info[i].good_name,
  1855. statistical_classification: 0,
  1856. single_dose: good_info[i].specification_name,
  1857. delivery_way: '',
  1858. execution_frequency: '',
  1859. number_days: 1,
  1860. price: good_info[i].retail_price,
  1861. medical_code: good_info[i].medical_insurance_number,
  1862. unit: this.getGoodUnit(good_info[i].good_unit),
  1863. type: 3,
  1864. is_special_diseases: good_info[i].is_special_diseases,
  1865. good_info: good_info[i],
  1866. first_letter:good_info[i].first_letter,
  1867. number: good_info[i].good_number,
  1868. bbx01:good_info[i].bbx01,
  1869. }
  1870. this.tabProject.push(obj)
  1871. }
  1872. this.allProject = this.tabProject
  1873. if(this.org_id == 10206 ) {
  1874. console.log("-=======")
  1875. console.log(this.zuobiao_project)
  1876. console.log(this.tabProject)
  1877. console.log("-=======")
  1878. for (let i = 0; i < this.zuobiao_project.length; i++) {
  1879. for (let b = 0; b < this.tabProject.length; b++) {
  1880. if (this.zuobiao_project[i].bbx01 == this.tabProject[b].bbx01 && this.zuobiao_project[i].bby06 == this.tabProject[b].single_dose){
  1881. this.tabProject[b]["zuobiao_stock_num"] = this.zuobiao_project[i].lsqty
  1882. this.tabProject[b].price = this.zuobiao_project[i].price
  1883. }
  1884. }
  1885. }
  1886. }
  1887. }
  1888. })
  1889. }, deepClone(source) {
  1890. if (!source && typeof source !== 'object') {
  1891. throw new Error('error arguments', 'shallowClone')
  1892. }
  1893. const targetObj = source.constructor === Array ? [] : {}
  1894. Object.keys(source).forEach((keys) => {
  1895. if (source[keys] && typeof source[keys] === 'object') {
  1896. targetObj[keys] = this.deepClone(source[keys])
  1897. } else {
  1898. targetObj[keys] = source[keys]
  1899. }
  1900. })
  1901. return targetObj
  1902. }, getGoodUnit(id) {
  1903. var goodUnit = this.$store.getters.good_unit
  1904. for (let i = 0; i < goodUnit.length; i++) {
  1905. if (goodUnit[i].id == id) {
  1906. return goodUnit[i].name
  1907. }
  1908. }
  1909. },
  1910. getAllProjectTeam() {
  1911. getAllProjectTeam().then(response => {
  1912. if (response.data.state == 1) {
  1913. var team = response.data.data.team
  1914. console.log('team2222', team)
  1915. this.tabPrjectTeam = team.sort(this.compare("sort"))
  1916. this.projectList = team
  1917. }
  1918. })
  1919. },
  1920. compare (property) {
  1921. return function (a, b) {
  1922. var value1 = a[property]
  1923. var value2 = b[property]
  1924. return value1 - value2
  1925. }
  1926. },
  1927. changevalue(val) {
  1928. this.$forceUpdate()
  1929. },
  1930. selectTeam(row) {
  1931. console.log('row', row)
  1932. var arr = []
  1933. for (let i = 0; i < row.length; i++) {
  1934. arr.push(row[i].item_id)
  1935. }
  1936. var ids = arr.join(',')
  1937. var strArr = ids.split(',')
  1938. var res = []//接收不重复的数据
  1939. for (var i = 0; i < strArr.length; i++) {
  1940. var flag = true
  1941. for (var j = 0; j < i; j++) {
  1942. if (strArr[i] === strArr[j]) {
  1943. flag = false
  1944. break
  1945. }
  1946. }
  1947. if (flag) {
  1948. res.push(strArr[i])
  1949. }
  1950. }
  1951. var idstr = res.join(',')
  1952. const params = {
  1953. project_id: idstr
  1954. }
  1955. getPojectListById(params).then(response => {
  1956. if (response.data.state == 1) {
  1957. this.teamList = []
  1958. var project = response.data.data.project
  1959. for (let i = 0; i < project.length; i++) {
  1960. if (project[i].type == 2) {
  1961. let obj = {
  1962. id: project[i].project_id,
  1963. project_name: project[i].project.project_name,
  1964. statistical_classification: project[i].project.statistical_classification,
  1965. single_dose: project[i].project.single_dose,
  1966. delivery_way: project[i].project.delivery_way,
  1967. execution_frequency: project[i].project.execution_frequency,
  1968. number_days: project[i].project.number_days,
  1969. total: project[i].number,
  1970. price: project[i].project.price,
  1971. remark: '',
  1972. medical_code: project[i].project.medical_code,
  1973. unit: project[i].project.unit,
  1974. type: project[i].type,
  1975. is_special_diseases: project[i].project.disease_directory,
  1976. project: project[i].project
  1977. }
  1978. if (obj.total == 0 || obj.total == undefined) {
  1979. obj.total = 1
  1980. }
  1981. this.teamList.push(obj)
  1982. } else if (project[i].type == 3) {
  1983. let obj = {
  1984. id: project[i].project_id,
  1985. project_name: project[i].good_info.good_name,
  1986. statistical_classification: '',
  1987. single_dose: '',
  1988. delivery_way: '',
  1989. execution_frequency: '',
  1990. number_days: '',
  1991. total: project[i].number,
  1992. price: project[i].good_info.retail_price,
  1993. remark: '',
  1994. medical_code: project[i].good_info.medical_insurance_number,
  1995. unit: project[i].good_info.unit,
  1996. type: project[i].type,
  1997. is_special_diseases: project[i].good_info.is_special_diseases,
  1998. good_info: project[i].good_info
  1999. }
  2000. if (obj.total == 0 || obj.total == undefined) {
  2001. obj.total = 1
  2002. }
  2003. this.teamList.push(obj)
  2004. console.log(this.teamList)
  2005. }
  2006. }
  2007. }
  2008. })
  2009. }, changeDoctor(val) {
  2010. for (let i = 0; i < this.doctors.length; i++) {
  2011. if (this.doctors[i].admin_user_id == this.doctorValue) {
  2012. this.departmentValue = this.doctors[i].department_id
  2013. }
  2014. }
  2015. if (this.departmentValue == 0) {
  2016. this.departmentValue = ''
  2017. }
  2018. },
  2019. changeDayOrMonth(tab) {
  2020. if (this.dayorMonth == 'day') {
  2021. } else if (this.dayorMonth == 'month') {
  2022. }
  2023. },
  2024. getAllProjectList() {
  2025. getAllProjectList().then(response => {
  2026. if (response.data.state == 1) {
  2027. var hisprojectlist = response.data.data.hisprojectlist
  2028. console.log('hisprojectlist', hisprojectlist)
  2029. this.hisList = hisprojectlist
  2030. }
  2031. })
  2032. },
  2033. clearSelection() {
  2034. this.$refs.tabProjectTeam.clearSelection()
  2035. },
  2036. changeMode(id){
  2037. var params = {
  2038. mode_id:id,
  2039. }
  2040. getPresciptionTemplateDetail(params).then(response=>{
  2041. if (response.data.state == 0) {
  2042. this.$message.error(response.data.msg)
  2043. return false
  2044. } else {
  2045. this.prescriptions = []
  2046. // console.log(this.tempForm)
  2047. if (response.data.data.template.id > 0) {
  2048. this.tempForm.name = response.data.data.template.name
  2049. this.tempForm.mode_id = response.data.data.template.mode
  2050. this.id = response.data.data.template.id
  2051. for (let i = 0; i < response.data.data.prescriptions.length; i++) {
  2052. var prescription = response.data.data.prescriptions[i]
  2053. let tempAdvice = []
  2054. let tempProject = []
  2055. let tempAddition = []
  2056. //药品
  2057. for (let b = 0; b < prescription.advices.length; b++) {
  2058. let obj = {
  2059. advice_id: 0,
  2060. drug_name: prescription.advices[b].advice_name,
  2061. single_dose: prescription.advices[b].single_dose,
  2062. delivery_way: prescription.advices[b].delivery_way,
  2063. execution_frequency: prescription.advices[b].execution_frequency,
  2064. retail_price: prescription.advices[b].price.toString(),
  2065. remark: prescription.advices[b].remark,
  2066. day: prescription.advices[b].day,
  2067. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  2068. single_dose_unit: prescription.advices[b].single_dose_unit,
  2069. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  2070. medical_insurance_number: prescription.advices[b].med_list_codg,
  2071. id: prescription.advices[b].drug_id,
  2072. drug: prescription.advices[b].drug,
  2073. groupno: prescription.advices[b].groupno,
  2074. frequency_type: prescription.advices[b].frequency_type,
  2075. day_count: prescription.advices[b].day_count,
  2076. week_day: prescription.advices[b].week_day,
  2077. }
  2078. tempAdvice.push(obj)
  2079. }
  2080. //项目
  2081. for (let b = 0; b < prescription.project.length; b++) {
  2082. let obj = {
  2083. id: 0,
  2084. project_id: prescription.project[b].project_id,
  2085. project_name: prescription.project[b].project.project_name,
  2086. statistical_classification: prescription.project[b].project.statistical_classification,
  2087. single_dose: prescription.project[b].single_dose,
  2088. delivery_way: prescription.project[b].delivery_way,
  2089. execution_frequency: prescription.project[b].execution_frequency,
  2090. number_days: prescription.project[b].day,
  2091. total: prescription.project[b].count.toString(),
  2092. price: prescription.project[b].price,
  2093. remark: prescription.project[b].remark,
  2094. medical_code: prescription.project[b].project.medical_code,
  2095. unit: prescription.project[b].project.unit,
  2096. type: prescription.project[b].type,
  2097. frequency_type: prescription.project[b].frequency_type,
  2098. day_count: prescription.project[b].day_count,
  2099. week_day: prescription.project[b].week_day
  2100. }
  2101. if (prescription.project[b].type == 2) {
  2102. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  2103. obj['medical_code'] = prescription.project[b].project.medical_code
  2104. obj['project_name'] = prescription.project[b].project.project_name
  2105. obj['project'] = prescription.project[b].project
  2106. } else if (prescription.project[b].type == 3) {
  2107. obj['statistical_classification'] = ''
  2108. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  2109. obj['project_name'] = prescription.project[b].good_info.good_name
  2110. obj['good_info'] = prescription.project[b].good_info
  2111. }
  2112. tempProject.push(obj)
  2113. }
  2114. // var preTime = nowTime
  2115. let index = i + 1
  2116. let obj = {
  2117. id: 0,
  2118. name: '处方' + index,
  2119. advices: tempAdvice,
  2120. project: tempProject,
  2121. addition: tempAddition,
  2122. order_status: 1
  2123. // pre_time: preTime
  2124. }
  2125. if (prescription.med_type == '' || prescription.med_type == 0) {
  2126. obj['med_type'] = ''
  2127. } else {
  2128. obj['med_type'] = parseInt(prescription.med_type)
  2129. }
  2130. this.prescriptions.push(obj)
  2131. }
  2132. this.curPrescriptions = this.prescriptions[0]
  2133. } else {
  2134. let obj = {
  2135. id: 0,
  2136. name: '处方1',
  2137. advices: [],
  2138. project: [],
  2139. addition: [],
  2140. order_status: 0,
  2141. med_type: ''
  2142. }
  2143. if(this.org_id == 10206) {
  2144. obj.med_type = 12
  2145. }else{
  2146. obj.med_type = 14
  2147. }
  2148. this.prescriptions.push(obj)
  2149. this.curPrescriptions = this.prescriptions[0]
  2150. }
  2151. }
  2152. })
  2153. }
  2154. }, created() {
  2155. for(let key in this.$store.getters.treatment_mode){
  2156. this.modeOptions[key] = this.$store.getters.treatment_mode[key]
  2157. this.modeOptionsTwo[key]= this.$store.getters.treatment_mode[key]
  2158. }
  2159. var modes = this.$route.query.modes.split(',')
  2160. console.log('~~~~~~~~~~')
  2161. console.log(modes)
  2162. for (const mkey in this.modeOptions) {
  2163. console.log(mkey)
  2164. for (let b = 0; b < modes.length; b++) {
  2165. if (mkey == parseInt(modes[b])) {
  2166. delete this.modeOptions[mkey]
  2167. }
  2168. }
  2169. }
  2170. this.getZuobiaoDrugStock()
  2171. this.getZuobiaoGoodStock()
  2172. this.getPrescriptionTemplateInfo()
  2173. this.getInitData()
  2174. //获取所有项目
  2175. this.getlist()
  2176. //获取所以项目组套
  2177. this.getAllProjectTeam()
  2178. this.getAllProjectList()
  2179. this.$nextTick(() => {
  2180. this.multipleTableHeight = parseInt(this.$refs.rightTable.offsetHeight)
  2181. })
  2182. }
  2183. }
  2184. </script>
  2185. <style lang="scss" scoped>
  2186. .new-main-contain {
  2187. height: 100%;
  2188. display: flex;
  2189. flex-direction: column;
  2190. }
  2191. .app-container {
  2192. height: 100%;
  2193. }
  2194. .mainCell {
  2195. height: 36px;
  2196. display: flex;
  2197. align-items: center;
  2198. }
  2199. .mainLeft {
  2200. width: 200px;
  2201. height: 100%;
  2202. display: flex;
  2203. flex-direction: column;
  2204. margin-top: 2px;
  2205. .el-radio {
  2206. margin-right: 5px;
  2207. }
  2208. }
  2209. .mainRight {
  2210. margin-left: 20px;
  2211. flex: 1;
  2212. height: 100%;
  2213. display: flex;
  2214. flex-direction: column;
  2215. .cellSpan {
  2216. min-width: 80px;
  2217. display: inline-block;
  2218. margin-right: 10px;
  2219. }
  2220. }
  2221. .mainCenter {
  2222. display: flex;
  2223. flex: 1;
  2224. height: 100%;
  2225. }
  2226. .centerLeft {
  2227. flex: 1;
  2228. display: flex;
  2229. flex-direction: column;
  2230. position: relative;
  2231. overflow-x: auto;
  2232. .el-form-item {
  2233. width: 33%;
  2234. margin-bottom: 14px;
  2235. }
  2236. .el-form-item__label {
  2237. text-align: left;
  2238. }
  2239. }
  2240. .backColor {
  2241. background: #f6f8f9;
  2242. height: 5px;
  2243. margin-bottom: 5px;
  2244. }
  2245. .RP {
  2246. color: #409EFF;
  2247. font-size: 14px;
  2248. margin-bottom: 5px;
  2249. }
  2250. .tabsBox {
  2251. position: relative;
  2252. flex: 1;
  2253. overflow-y: auto;
  2254. margin-bottom: 60px;
  2255. /*/ / margin-top: 4 px;*/
  2256. .el-tabs__item {
  2257. padding: 0 10px;
  2258. }
  2259. }
  2260. .preTabs {
  2261. height: 100%;
  2262. display: flex;
  2263. flex-direction: column;
  2264. .el-tabs__content {
  2265. flex: 1;
  2266. overflow-y: auto;
  2267. }
  2268. }
  2269. .costBox {
  2270. width: 100%;
  2271. height: 60px;
  2272. background: #fff;
  2273. position: absolute;
  2274. bottom: 0;
  2275. display: flex;
  2276. align-items: center;
  2277. justify-content: space-between;
  2278. }
  2279. .statusRed {
  2280. color: red;
  2281. }
  2282. .addTab {
  2283. position: absolute;
  2284. right: 8px;
  2285. top: 3px;
  2286. z-index: 20;
  2287. }
  2288. .centerRight {
  2289. width: 300px;
  2290. margin-left: 10px;
  2291. display: flex;
  2292. flex-direction: column;
  2293. position: relative;
  2294. }
  2295. .rightTab {
  2296. height: 40px;
  2297. width: 100%;
  2298. border: 1px solid #d2d2d2;
  2299. box-sizing: border-box;
  2300. p {
  2301. width: 50%;
  2302. height: 40px;
  2303. line-height: 40px;
  2304. text-align: center;
  2305. background: #eee;
  2306. float: left;
  2307. }
  2308. > p:last-child {
  2309. border-left: 1px solid #d2d2d2;
  2310. float: right;
  2311. }
  2312. .activeP {
  2313. background: #409EFF;
  2314. color: #fff;
  2315. }
  2316. }
  2317. .rightTabs {
  2318. display: flex;
  2319. flex-direction: column;
  2320. }
  2321. .comfirmBox {
  2322. width: 100%;
  2323. height: 60px;
  2324. background: #fff;
  2325. position: absolute;
  2326. bottom: 0;
  2327. display: flex;
  2328. align-items: center;
  2329. justify-content: space-between;
  2330. z-index: 99;
  2331. }
  2332. .borderCard {
  2333. height: 100%;
  2334. display: flex;
  2335. flex-direction: column;
  2336. margin-bottom: 60px;
  2337. .el-tabs--border-card > .el-tabs__content {
  2338. padding: 0;
  2339. }
  2340. }
  2341. </style>
  2342. <style lang="scss">
  2343. .borderCard {
  2344. .el-tabs__nav {
  2345. width: 100%;
  2346. }
  2347. .el-tabs__item {
  2348. width: 50%;
  2349. text-align: center;
  2350. }
  2351. .el-tabs__content {
  2352. padding: 5px;
  2353. flex: 1;
  2354. }
  2355. }
  2356. .centerLeft {
  2357. .el-form-item__label {
  2358. text-align: left;
  2359. }
  2360. }
  2361. .tabsBox {
  2362. .el-tabs__item {
  2363. padding: 0 10px;
  2364. }
  2365. .el-tabs--bottom .el-tabs--left > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom .el-tabs--right > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom.el-tabs--border-card > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--bottom.el-tabs--card > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top .el-tabs--left > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top .el-tabs--right > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top.el-tabs--border-card > .el-tabs__header .el-tabs__item:nth-child(2), .el-tabs--top.el-tabs--card > .el-tabs__header .el-tabs__item:nth-child(2) {
  2366. padding: 0 10px;
  2367. }
  2368. .el-tabs--bottom .el-tabs--left > .el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom .el-tabs--right > .el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom.el-tabs--border-card > .el-tabs__header .el-tabs__item:last-child, .el-tabs--bottom.el-tabs--card > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top .el-tabs--left > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top .el-tabs--right > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top.el-tabs--border-card > .el-tabs__header .el-tabs__item:last-child, .el-tabs--top.el-tabs--card > .el-tabs__header .el-tabs__item:last-child {
  2369. padding: 0 10px;
  2370. }
  2371. .el-tabs--card > .el-tabs__header .el-tabs__item.is-active.is-closable {
  2372. padding: 0 10px;
  2373. }
  2374. }
  2375. .centerRight {
  2376. .el-tabs__nav-scroll {
  2377. display: flex;
  2378. }
  2379. .el-tabs__nav {
  2380. margin: 0 auto;
  2381. }
  2382. .el-table th .cell, .el-table td .cell {
  2383. padding: 0 2px;
  2384. }
  2385. }
  2386. .preTabs {
  2387. .el-tabs__content {
  2388. flex: 1;
  2389. overflow-y: auto;
  2390. padding: 5px 0 5px 5px;
  2391. }
  2392. }
  2393. .rightTabs {
  2394. height: 100%;
  2395. .el-tabs__nav {
  2396. width: auto;
  2397. }
  2398. .el-tabs__header {
  2399. margin-bottom: 5px;
  2400. }
  2401. .el-tabs__item {
  2402. width: auto;
  2403. text-align: inherit;
  2404. }
  2405. .el-tabs__content {
  2406. flex: 1;
  2407. overflow-y: auto;
  2408. }
  2409. .el-tab-pane {
  2410. display: flex;
  2411. flex-direction: column;
  2412. height: 100%;
  2413. }
  2414. }
  2415. #tab-more {
  2416. .el-icon-close {
  2417. display: none;
  2418. }
  2419. }
  2420. ::-webkit-scrollbar {
  2421. height: 15px;
  2422. }
  2423. </style>