prescriptionTemplatedetail.vue 77KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185
  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-form-item label="透析模式: " prop="mode_id" label-position="right">
  16. <el-select v-model="tempForm.mode_id" style="width:100%;" placeholder="请选择">
  17. <el-option
  18. v-for="item in modeOptions"
  19. :key="item.id"
  20. :label="item.name"
  21. :value="item.id"
  22. ></el-option>
  23. </el-select>
  24. </el-form-item>
  25. </el-form>
  26. <div class="tabsBox">
  27. <el-tabs class="preTabs" v-model="editableTabsValue" type="border-card"
  28. closable
  29. @tab-remove="removeTab"
  30. :before-leave="moreState" @tab-click="tabclickEvent">
  31. <el-tab-pane
  32. v-for="(item, index) in prescriptions"
  33. :key="index"
  34. :label="item.name"
  35. :name="item.name"
  36. >
  37. <!--<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" >-->
  38. <!--<el-option-->
  39. <!--v-for="(item,index) in medical_care"-->
  40. <!--:key="index"-->
  41. <!--:label="item.label"-->
  42. <!--:value="item.value">-->
  43. <!--</el-option>-->
  44. <!--</el-select>-->
  45. <el-select style="width:50%;" v-model="item.med_type" placeholder="医疗类型"
  46. @change="changevalue">
  47. <el-option
  48. v-for="(item,index) in register"
  49. :key="index"
  50. :label="item.label"
  51. :value="item.value">
  52. </el-option>
  53. </el-select>
  54. </el-tab-pane>
  55. <el-tab-pane name="more" closable><span slot="label"><i
  56. class="el-icon-plus"
  57. @click="addTab"></i></span>
  58. </el-tab-pane>
  59. <!--<prescription-table ref="prescription_tables"-->
  60. <!--:prescription="curPrescriptions"-->
  61. <!--:preDrugs="preDrugs"-->
  62. <!--:activeType="customTabIndex"></prescription-table>-->
  63. <prescription-template-table ref="prescription_tables"
  64. :prescription="curPrescriptions"
  65. :preDrugs="preDrugs"
  66. :activeType="customTabIndex"></prescription-template-table>
  67. </el-tabs>
  68. </div>
  69. </div>
  70. <div class='centerRight'>
  71. <el-tabs class="borderCard" type="border-card" v-model="rightTab" @tab-click="clickTab"
  72. :before-leave='beforeLeave'>
  73. <el-tab-pane label="药品" :name="1">
  74. </el-tab-pane>
  75. <el-tab-pane label="项目" :name="2">
  76. </el-tab-pane>
  77. <div style="height:100%;" v-show="showOne">
  78. <el-tabs class="rightTabs" v-model="drug_activeName">
  79. <el-tab-pane label="药品列表" name="1">
  80. <div style="margin-bottom:5px;display:flex;">
  81. <el-input style="width:50%;" @input="searchAction"
  82. @keyup.enter.native='searchAction'
  83. v-model.trim="search_keyword"
  84. placeholder="请输入药品名字"></el-input>
  85. <el-select style="margin-left:5px;width:50%;" v-model="value" placeholder=""
  86. @change="changeKind">
  87. <el-option
  88. label="全部"
  89. value="0">
  90. </el-option>
  91. <el-option
  92. v-for="(item,index) in getDictionaryDataConfig('system','drug_type')"
  93. :key="index"
  94. :label="item.name"
  95. :value="item.id">
  96. </el-option>
  97. </el-select>
  98. </div>
  99. <div style="width: 100%;flex:1;overflow: hidden;" ref="rightTable">
  100. <el-table ref="multipleTable"
  101. :height="multipleTableHeight != '' ? multipleTableHeight : '200'"
  102. :data="drugs" border @select='selectDrugs'
  103. :row-style="{ color: '#303133' }"
  104. @select-all="changeAllGoodInfoTableData"
  105. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  106. highlight-current-row>
  107. <el-table-column type="selection" width="40"
  108. align="center"></el-table-column>
  109. <el-table-column label="名称">
  110. <template slot-scope="scope">{{ scope.row.drug_name }}</template>
  111. </el-table-column>
  112. <el-table-column label="规格" width="60">
  113. <template slot-scope="scope">{{ scope.row.drug_spec }}</template>
  114. </el-table-column>
  115. <el-table-column label="单价" width="40">
  116. <template slot-scope="scope">{{ scope.row.retail_price }}</template>
  117. </el-table-column>
  118. </el-table>
  119. </div>
  120. </el-tab-pane>
  121. </el-tabs>
  122. </div>
  123. <div style="height:100%;" v-show="showTwo">
  124. <div style="height:100%;" v-show="showTwo">
  125. <el-tabs class="rightTabs" v-model="activeName">
  126. <el-tab-pane label="项目列表" name="1">
  127. <div style="margin-bottom:5px;">
  128. <!--<el-input style="width:50%;" v-model="input" placeholder=""></el-input>-->
  129. <el-input style="width:50%;" @input="searchProjectAction"
  130. @keyup.enter.native='searchProjectAction'
  131. v-model.trim="search_project_keyword"
  132. placeholder="请输入项目名称"></el-input>
  133. <el-select style="float: right;width: 49%;" v-model="value" placeholder=""
  134. @change="changeClass">
  135. <el-option
  136. label="全部"
  137. value="0">
  138. </el-option>
  139. <el-option
  140. v-for="(item, index) in getDictionaryDataConfig('system','cost_classify')"
  141. :key="index"
  142. :label="item.name"
  143. :value="item.id">
  144. </el-option>
  145. </el-select>
  146. </div>
  147. <div style="width: 100%;flex:1;overflow-y: auto;">
  148. <el-table ref="tables"
  149. :height="multipleTableHeight != '' ? multipleTableHeight : '200'"
  150. :data="tabProject" border @select='selectChange'
  151. :row-style="{ color: '#303133' }"
  152. @select-all="changeAllGoodInfoTableDataTwo"
  153. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  154. highlight-current-row>
  155. <el-table-column type="selection" width="40"
  156. align="center"></el-table-column>
  157. <el-table-column prop="name" label="名称">
  158. <template slot-scope="scope">{{ scope.row.project_name }}</template>
  159. </el-table-column>
  160. <el-table-column label="规格" width="60">
  161. <template slot-scope="scope">{{ scope.row.single_dose }}</template>
  162. </el-table-column>
  163. <el-table-column label="单价" width="40">
  164. <template slot-scope="scope">{{ scope.row.price }}</template>
  165. </el-table-column>
  166. </el-table>
  167. </div>
  168. </el-tab-pane>
  169. <el-tab-pane label="项目组套" name="2">
  170. <div style="width: 100%;flex:1;overflow-y: auto;">
  171. <el-table :data="tabPrjectTeam" border ref="tabProjectTeam"
  172. :height="multipleTableHeight != '' ? multipleTableHeight : '200'"
  173. :row-style="{ color: '#303133' }"
  174. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  175. highlight-current-row
  176. @select='selectTeam'>
  177. <el-table-column type="selection" width="40"
  178. align="center"></el-table-column>
  179. <el-table-column prop="name" label="名称">
  180. <template slot-scope="scope">{{scope.row.project_team}}</template>
  181. </el-table-column>
  182. </el-table>
  183. </div>
  184. </el-tab-pane>
  185. </el-tabs>
  186. </div>
  187. </div>
  188. </el-tabs>
  189. <template>
  190. <div class="comfirmBox">
  191. <el-button type="primary" style="width:100%;" @click="comfirm">确定添加</el-button>
  192. </div>
  193. </template>
  194. </div>
  195. </div>
  196. </div>
  197. </div>
  198. </template>
  199. <script>
  200. import { createdTemplate, delHisPrescriptionInfoTemplate, getPrescriptionTemplateInfo } from '@/api/his/his_config'
  201. import {
  202. createHisPrescription,
  203. delHisPrescription,
  204. editHisPrescription,
  205. getCallHisPrescription,
  206. getDayOrMonthHisPrescription,
  207. getInitData,
  208. getNextOrLastHisPrescription,
  209. getPatientInfo,
  210. getSchedulePatientList
  211. } from '@/api/his/his'
  212. import { getDictionaryDataConfig } from '@/utils/data'
  213. import prescriptionTable from './components/prescriptionTable'
  214. import {
  215. addProjectTeam,
  216. getAllProjectList,
  217. getAllProjectTeam,
  218. getHisProject,
  219. getPojectListById
  220. } from '@/api/project/project'
  221. import { uParseTime } from '@/utils/tools'
  222. import PrescriptionTemplateTable from './components/prescriptionTemplateTable'
  223. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  224. const moment = require('moment')
  225. export default {
  226. props: {
  227. patientInfo: Object,
  228. hisPatientInfo: Object,
  229. prescriptions: Array,
  230. record_date: String,
  231. search_keyword: '',
  232. month_prescriptions: Array,
  233. isloading: false,
  234. loading: false,
  235. other_sick: {
  236. type: Array,
  237. default: function() {
  238. return []
  239. }
  240. }
  241. },
  242. components: {
  243. PrescriptionTemplateTable,
  244. prescriptionTable,
  245. BreadCrumb
  246. },
  247. data() {
  248. return {
  249. medical_care: [
  250. { value: 11, label: '普通门诊' },
  251. { value: 12, label: '家庭通道' },
  252. { value: 13, label: '门诊大病' },
  253. { value: 14, label: '重疾特药' },
  254. { value: 15, label: '门诊慢病' },
  255. { value: 16, label: '门诊特检' },
  256. { value: 17, label: '健康体检' },
  257. { value: 18, label: '预防接种' },
  258. { value: 19, label: '门诊输血' },
  259. { value: 91, label: '新冠肺炎门诊' }
  260. ],
  261. register: [
  262. { value: 11, label: '普通门诊' },
  263. // { value: 12, label: '门诊挂号' },
  264. // { value: 13, label: '急诊' },
  265. { value: 14, label: '门诊特殊病' },
  266. // { value: 15, label: '门诊统筹' },
  267. // { value: 16, label: '门诊慢性病' },
  268. // { value: 21, label: '普通住院' }
  269. ],
  270. crumbs: [
  271. { path: false, name: '门诊医生站' },
  272. { path: false, name: '处方模版' },
  273. { path: false, name: '模版详情' }
  274. ],
  275. tempForm: {
  276. name: '',
  277. mode_id: ''
  278. },
  279. modeOptions: this.$store.getters.treatment_mode,
  280. start_time: moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  281. end_time: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  282. isLastOrNextVisible: false,
  283. multipleTableHeight: '',
  284. register_type: 1,
  285. value: '0',
  286. search_project_keyword: '',
  287. drugs: [],
  288. allDrugs: [],
  289. advices_template: [],
  290. additions: [],
  291. editableTabsValueTwo: '处方1',
  292. editableTabsValue: '处方1',
  293. editableTabs: [{
  294. title: '处方1',
  295. name: '1'
  296. }],
  297. curDayPrescriptions: null,
  298. dayPrescriptions: [],
  299. currenet_inedx: 0,
  300. rightTab: 1,
  301. activeName: '1',
  302. drug_activeName: '1',
  303. curPrescriptions: null,
  304. drugTableData: [],
  305. preDrugs: [],
  306. curDrugs: [],
  307. doctorOptions: [],
  308. doctorValue: '',
  309. departmentOptions: [],
  310. departmentValue: '',
  311. total: 0,
  312. request_record_date: '',
  313. state2: '',
  314. customTabIndex: 1,
  315. options: [],
  316. tabProject: [],
  317. allProject: [],
  318. strids: '',
  319. showOne: true,
  320. showTwo: false,
  321. tableData: [],
  322. tabPrjectTeam: [],
  323. teamList: [],
  324. doctors: [],
  325. departMent: [],
  326. curStatus: 0,
  327. isShowDayPrescription: false,
  328. monthCustomTabIndex: 1,
  329. order_status: '',
  330. register_types: [
  331. { id: 1, name: '医保' },
  332. { id: 2, name: '自费' }
  333. ],
  334. pickerOptions: {
  335. disabledDate(time) {
  336. let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear() - 1)).getTime() - 24 * 3600 * 1000
  337. return time.getTime() > Date.now() || time.getTime() < threeMonths
  338. }
  339. },
  340. department: [],
  341. sick: [],
  342. diagnoses: [],
  343. diagnose: 1,
  344. state1: 1,
  345. curTotal: 0,
  346. prescription_id: 0,
  347. tempDrugs: [],
  348. dayorMonth: 'day',
  349. hisList: []
  350. }
  351. },
  352. methods: {
  353. save() {
  354. if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length == 0) {
  355. this.$message.error('请先开处方')
  356. return
  357. }
  358. if (this.tempForm.name.length <= 0) {
  359. this.$message.error('模版名称不能为空')
  360. return
  361. }
  362. if (this.tempForm.mode_id <= 0) {
  363. this.$message.error('透析模式不能为空')
  364. return
  365. }
  366. for (let i = 0; i < this.prescriptions.length; i++) {
  367. console.log(this.prescriptions[i].med_type)
  368. if (this.prescriptions[i].med_type == 0 || this.prescriptions[i].med_type == '') {
  369. this.$message.error('处方医疗类型不能为空')
  370. return
  371. }
  372. }
  373. for (let i = 0; i < this.prescriptions.length; i++) {
  374. for(let b = 0; b < this.prescriptions[i].advices.length; b++){
  375. if (this.prescriptions[i].med_type == 14 && this.prescriptions[i].advices[b].drug.is_special_diseases != 1) {
  376. this.$message.error("处方" + (i+1).toString() +"属于特病类型处方,开非特病类型的药")
  377. return
  378. }
  379. }
  380. for(let c = 0; c < this.prescriptions[i].project.length; c++){
  381. if (this.prescriptions[i].med_type == 14 && this.prescriptions[i].project[c].type == 2 && this.prescriptions[i].project[c].project.disease_directory != 1) {
  382. this.$message.error("处方" + (i+1).toString() +"属于特病类型处方,请开特病类型的项目")
  383. return
  384. }
  385. 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) {
  386. this.$message.error("处方" + (i+1).toString() +"属于特病类型处方,请开特病类型的耗材")
  387. return 
  388. }
  389. }
  390. }
  391. let params = {
  392. name: this.tempForm.name,
  393. mode_id: this.tempForm.mode_id,
  394. patient_id: this.$route.query.patient_id,
  395. id: this.$route.query.id
  396. }
  397. for (let i = 0; i < this.prescriptions.length; i++) {
  398. this.prescriptions[i].med_type = parseInt(this.prescriptions[i].med_type)
  399. if (this.prescriptions[i].advices.length > 0 && this.prescriptions[i].project.length == 0) {
  400. this.prescriptions[i]['type'] = 1
  401. }
  402. if (this.prescriptions[i].advices.length == 0 && this.prescriptions[i].project.length > 0) {
  403. this.prescriptions[i]['type'] = 2
  404. }
  405. for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
  406. this.prescriptions[i].advices[b].single_dose = this.prescriptions[i].advices[b].single_dose.toString()
  407. this.prescriptions[i].advices[b].prescribing_number = this.prescriptions[i].advices[b].prescribing_number.toString()
  408. this.prescriptions[i].advices[b].retail_price = this.prescriptions[i].advices[b].retail_price.toString()
  409. this.prescriptions[i].advices[b].day = parseInt(this.prescriptions[i].advices[b].day)
  410. }
  411. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  412. this.prescriptions[i].project[b].price = this.prescriptions[i].project[b].price.toString()
  413. this.prescriptions[i].project[b].total = this.prescriptions[i].project[b].total.toString()
  414. this.prescriptions[i].project[b].delivery_way = this.prescriptions[i].project[b].delivery_way.toString()
  415. }
  416. }
  417. let data = {
  418. 'prescriptions': this.prescriptions
  419. }
  420. createdTemplate(params, data).then(response => {
  421. if (response.data.state == 1) {
  422. this.$message.success('保存成功')
  423. } else {
  424. this.$message.error(response.data.msg)
  425. }
  426. })
  427. },
  428. changeClass(id) {
  429. this.tabProject = []
  430. if (id == 0) {
  431. this.tabProject = this.allProject
  432. } else {
  433. for (let i = 0; i < this.allProject.length; i++) {
  434. if (this.allProject[i].cost_classify == id) {
  435. this.tabProject.push(this.allProject[i])
  436. }
  437. }
  438. }
  439. },
  440. formatDecimal(num, decimal) {
  441. num = num.toString()
  442. let index = num.indexOf('.')
  443. if (index !== -1) {
  444. num = num.substring(0, decimal + index + 1)
  445. } else {
  446. num = num.substring(0)
  447. }
  448. return parseFloat(num).toFixed(decimal)
  449. },
  450. setValue(val) {
  451. this.prescriptions = []
  452. this.prescriptions = val
  453. this.$refs.next_or_last_prescription.close()
  454. var nowDate = new Date()
  455. var nowYear = nowDate.getFullYear()
  456. var nowMonth = nowDate.getMonth() + 1
  457. var nowDay = nowDate.getDate()
  458. var hours = nowDate.getHours()
  459. var min = nowDate.getMinutes()
  460. var nowTime =
  461. nowYear +
  462. '-' +
  463. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  464. '-' +
  465. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (hours < 10 ? '0' + hours : hours) +
  466. ':' + (min < 10 ? '0' + min : min)
  467. for (let i = 0; i < this.prescriptions.length; i++) {
  468. this.prescriptions[i].name = '处方' + (i + 1)
  469. this.prescriptions[i]['pre_time'] = nowTime
  470. if (i == 0) {
  471. if (this.prescriptions[0].advices.length > 0 && this.prescriptions[0].project.length == 0) {
  472. this.customTabIndex = 1
  473. this.curStatus = 1
  474. this.rightTab = 1
  475. this.showOne = true
  476. this.showTwo = false
  477. }
  478. if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length > 0) {
  479. this.customTabIndex = 2
  480. this.curStatus = 2
  481. this.rightTab = 2
  482. this.showTwo = true
  483. this.showOne = false
  484. }
  485. }
  486. }
  487. this.curPrescriptions = this.prescriptions[0]
  488. this.request_record_date = this.record_date
  489. this.$emit('setData', this.prescriptions)
  490. },
  491. GetNextOrLastHisPrescription(params) {
  492. getNextOrLastHisPrescription(params).then(response => {
  493. if (response.data.state == 1) {
  494. if (this.dayorMonth == 'day') {
  495. this.$refs.next_or_last_prescription.show(response.data.data.prescriptions, this.patientInfo.name, this.patientInfo.id, this.prescriptions)
  496. this.request_record_date = uParseTime(response.data.data.prescriptions[0].record_date, '{y}-{m}-{d}')
  497. } else {
  498. this.$message.error('当前处于月结,无法使用上一方或下一方功能')
  499. }
  500. } else {
  501. this.$message.error(response.data.msg)
  502. }
  503. })
  504. },
  505. selectTemplate(selection, row) {
  506. this.tempDrugs = selection
  507. }, changeTemplateData(selection) {
  508. this.tempDrugs = selection
  509. },
  510. searchProjectAction() {
  511. if (this.search_project_keyword.length == 0) {
  512. this.tabProject = this.allProject
  513. } else {
  514. let arr = []
  515. for (let i = 0; i < this.allProject.length; i++) {
  516. if (this.allProject[i].project_name.indexOf(this.search_project_keyword) != -1) {
  517. arr = arr.concat(this.allProject[i])
  518. }
  519. }
  520. this.tabProject = arr
  521. }
  522. },
  523. searchAction() {
  524. if (this.search_keyword.length == 0) {
  525. this.drugs = this.allDrugs
  526. } else {
  527. let arr = []
  528. for (let i = 0; i < this.drugs.length; i++) {
  529. if (this.drugs[i].drug_name.indexOf(this.search_keyword) != -1 || this.drugs[i].wubi.indexOf(this.search_keyword) != -1 || this.drugs[i].pinyin.indexOf(this.search_keyword) != -1) {
  530. arr = arr.concat(this.drugs[i])
  531. }
  532. }
  533. this.drugs = arr
  534. }
  535. },
  536. createFilter(queryString) {
  537. return (restaurant) => {
  538. return (restaurant.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
  539. }
  540. },
  541. querySearch2(queryString, cb) {
  542. var restaurants = this.other_sick
  543. restaurants.map(item => {
  544. item.value = item.name
  545. })
  546. var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
  547. // 调用 callback 返回建议列表的数据
  548. cb(results)
  549. },
  550. changeKind(val) {
  551. this.drugs = []
  552. if (val == 0) {
  553. this.drugs = this.allDrugs
  554. } else {
  555. for (let i = 0; i < this.allDrugs.length; i++) {
  556. if (this.allDrugs[i].drug_type == val) {
  557. this.drugs.push(this.allDrugs[i])
  558. }
  559. }
  560. }
  561. },
  562. getDictionaryDataConfig(module, filed_name) {
  563. return getDictionaryDataConfig(module, filed_name)
  564. },
  565. getInitData() {
  566. getInitData().then(response => {
  567. if (response.data.state == 0) {
  568. this.$message.error(response.data.msg)
  569. return false
  570. } else {
  571. this.drugs = response.data.data.drugs
  572. this.allDrugs = response.data.data.drugs
  573. this.advices_template = response.data.data.advices_template
  574. this.doctors = response.data.data.doctors
  575. for (let i = 0; i < this.doctors.length; i++) {
  576. if (this.doctors[i].user_type == 1) {
  577. this.doctors.splice(i, 1)
  578. }
  579. }
  580. this.department = response.data.data.department
  581. this.sick = response.data.data.sick
  582. this.diagnoses = response.data.data.diagnose
  583. this.additions = response.data.data.additions
  584. }
  585. })
  586. },
  587. tabclickEvent(val) {
  588. for (let i = 0; i < this.prescriptions.length; i++) {
  589. if (this.prescriptions[i].name == val.name) {
  590. this.prescription_id = this.prescriptions[i].id
  591. this.$emit('event1', this.prescription_id)
  592. this.curPrescriptions = this.prescriptions[i]
  593. this.teamList = []
  594. this.curDrugs = []
  595. this.$refs.multipleTable.clearSelection()
  596. this.$refs.tables.clearSelection()
  597. //用来区分处方属于项目还是药品
  598. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  599. this.customTabIndex = 1
  600. this.curStatus = 1
  601. this.rightTab = 1
  602. this.showOne = true
  603. this.showTwo = false
  604. }
  605. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  606. this.customTabIndex = 2
  607. this.curStatus = 2
  608. this.rightTab = 2
  609. this.showTwo = true
  610. this.showOne = false
  611. }
  612. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
  613. this.customTabIndex = this.rightTab
  614. this.curStatus = 0
  615. }
  616. }
  617. }
  618. if (this.curPrescriptions.order_status == 0) {
  619. this.order_status = ''
  620. }
  621. if (this.curPrescriptions.order_status == 1) {
  622. this.order_status = '未收费'
  623. }
  624. if (this.curPrescriptions.order_status == 2) {
  625. this.order_status = '已结算'
  626. }
  627. if (this.curPrescriptions.order_status == 3) {
  628. this.order_status = '已退费'
  629. }
  630. },
  631. clearData() {
  632. this.curPrescriptions = []
  633. this.curStatus = 0
  634. this.curDrugs = []
  635. this.preDrugs = []
  636. this.teamList = []
  637. },
  638. setData(data, info, admin_info, doctors, department, hisPatientInfo, month_data) {
  639. for (let i = 0; i < doctors.length; i++) {
  640. if (doctors[i].user_type == 1) {
  641. doctors.splice(i, 1)
  642. }
  643. }
  644. this.curMonthPrescriptions = {}
  645. this.curPrescriptions = {}
  646. this.prescription_id = data[0].id
  647. this.editableTabsValue = '处方1'
  648. this.dayorMonth = 'day'
  649. this.$emit('event1', this.prescription_id)
  650. this.curStatus = 0
  651. this.curPrescriptions = {}
  652. this.curMonthPrescriptions = {}
  653. if (month_data && month_data.length > 0) {
  654. this.curMonthPrescriptions = month_data[0]
  655. } else {
  656. this.curMonthPrescriptions = {}
  657. }
  658. if (data && data.length > 0) {
  659. this.curPrescriptions = data[0]
  660. } else {
  661. this.curPrescriptions = {}
  662. }
  663. this.diagnose = info.diagnosis
  664. if (this.diagnose == 0) {
  665. for (let i = 0; i < this.diagnoses.length; i++) {
  666. this.diagnose = this.diagnoses[0].id
  667. }
  668. }
  669. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  670. this.curStatus = 1
  671. this.customTabIndex = 1
  672. this.rightTab = 1
  673. this.showOne = true
  674. this.showTwo = false
  675. }
  676. if (this.curPrescriptions.project.length > 0 && this.curPrescriptions.advices.length == 0) {
  677. this.curStatus = 2
  678. this.customTabIndex = 2
  679. this.rightTab = 2
  680. this.showOne = false
  681. this.showTwo = true
  682. }
  683. this.state1 = info.sick_type
  684. if (this.state1 == 0) {
  685. this.state1 = ''
  686. for (let i = 0; i < this.sick.length; i++) {
  687. this.state1 = this.sick[0].id
  688. }
  689. }
  690. this.state2 = info.sick_history
  691. if (this.state2 == 0) {
  692. this.state2 = ''
  693. }
  694. if (info.prescription_status == 0) {
  695. this.order_status = ''
  696. }
  697. if (this.curPrescriptions.order_status == 1) {
  698. this.order_status = '未收费'
  699. }
  700. if (this.curPrescriptions.order_status == 2) {
  701. this.order_status = '已结算'
  702. }
  703. if (this.curPrescriptions.order_status == 3) {
  704. this.order_status = '已退费'
  705. }
  706. if (info.id > 0) {
  707. this.doctorValue = info.doctor_id
  708. this.departmentValue = info.departments
  709. } else {
  710. if (hisPatientInfo.doctor != 0 && hisPatientInfo.department != 0) {
  711. this.doctorValue = hisPatientInfo.doctor
  712. this.departmentValue = hisPatientInfo.department
  713. } else {
  714. if (admin_info.user_type == 2 || admin_info.user_type == 1) {
  715. this.doctorValue = admin_info.admin_user_id
  716. if (admin_info.department_id == 0) {
  717. if (this.department.length > 0) {
  718. if (department && department.length > 0) {
  719. this.departmentValue = department[0].id
  720. } else {
  721. this.departmentValue = ''
  722. }
  723. } else {
  724. this.departmentValue = ''
  725. }
  726. } else {
  727. this.departmentValue = admin_info.department_id
  728. }
  729. } else {
  730. this.doctorValue = doctors[0].admin_user_id
  731. }
  732. if (this.doctorValue == 0) {
  733. this.doctorValue = ''
  734. }
  735. }
  736. }
  737. if (info.register_type == 0) {
  738. for (let i = 0; i < this.register.length; i++) {
  739. this.register_type = this.register[0].value
  740. }
  741. } else {
  742. this.register_type = info.register_type
  743. }
  744. },
  745. moreState(tab, event) {
  746. if (tab == 'more') {
  747. return false
  748. }
  749. }, open_three() {
  750. this.$refs.saveTemplate.show(this.prescriptions)
  751. }, open_two() {
  752. if (this.dayorMonth == 'day') {
  753. if (this.patientInfo == null || this.patientInfo.id == 0) {
  754. this.$message.error('请选择患者')
  755. return
  756. }
  757. let params = {
  758. end_time: this.record_date,
  759. start_time: moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  760. patient_id: this.patientInfo.id,
  761. p_type: 2
  762. }
  763. getCallHisPrescription(params).then(response => {
  764. if (response.data.state == 1) {
  765. this.$refs.call_prescription.show(this.patientInfo.name, this.patientInfo.id, params.end_time, params.start_time, this.prescriptions, response.data.data.prescriptions)
  766. } else {
  767. this.$message.error(response.data.msg)
  768. }
  769. })
  770. } else {
  771. this.$message.error('当前属于月结状态,无法试用处方调用')
  772. }
  773. },
  774. open(index, isLoading) {
  775. if (this.dayorMonth == 'day') {
  776. if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length == 0) {
  777. this.$message.error('请先开处方')
  778. return
  779. }
  780. }
  781. if (this.dayorMonth == 'day') {
  782. if (this.doctorValue.length <= 0) {
  783. this.$message.error('医生不能为空')
  784. return
  785. }
  786. if (this.departmentValue.length <= 0) {
  787. this.$message.error('科室不能为空')
  788. return
  789. }
  790. if (this.state1 <= 0) {
  791. this.$message.error('疾病类型不能为空')
  792. return
  793. }
  794. if (index == 1) {
  795. let params = {
  796. p_type: 2,
  797. patient_id: this.patientInfo.id,
  798. diagnose: this.diagnose,
  799. sick_type: this.state1,
  800. sick_history: this.state2,
  801. doctor: this.doctorValue,
  802. department: this.departmentValue,
  803. record_date: this.record_date,
  804. his_patient_id: this.hisPatientInfo.id,
  805. reg_type: this.register_type
  806. }
  807. for (let i = 0; i < this.prescriptions.length; i++) {
  808. if (this.prescriptions[i].advices.length > 0 && this.prescriptions[i].project.length == 0) {
  809. this.prescriptions[i]['type'] = 1
  810. }
  811. if (this.prescriptions[i].advices.length == 0 && this.prescriptions[i].project.length > 0) {
  812. this.prescriptions[i]['type'] = 2
  813. }
  814. for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
  815. this.prescriptions[i].advices[b].single_dose = this.prescriptions[i].advices[b].single_dose.toString()
  816. this.prescriptions[i].advices[b].prescribing_number = this.prescriptions[i].advices[b].prescribing_number.toString()
  817. this.prescriptions[i].advices[b].retail_price = this.prescriptions[i].advices[b].retail_price.toString()
  818. this.prescriptions[i].advices[b].day = parseInt(this.prescriptions[i].advices[b].day)
  819. }
  820. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  821. this.prescriptions[i].project[b].price = this.prescriptions[i].project[b].price.toString()
  822. this.prescriptions[i].project[b].total = this.prescriptions[i].project[b].total.toString()
  823. this.prescriptions[i].project[b].delivery_way = this.prescriptions[i].project[b].delivery_way.toString()
  824. }
  825. for (let b = 0; b < this.prescriptions[i].addition.length; b++) {
  826. this.prescriptions[i].addition[b].id = parseInt(this.prescriptions[i].addition[b].id)
  827. this.prescriptions[i].addition[b].item_id = parseInt(this.prescriptions[i].addition[b].item_id)
  828. this.prescriptions[i].addition[b].price = this.prescriptions[i].addition[b].price.toString()
  829. this.prescriptions[i].addition[b].count = this.prescriptions[i].addition[b].count.toString()
  830. }
  831. }
  832. let data = {
  833. 'prescriptions': this.prescriptions
  834. }
  835. isLoading = true
  836. createHisPrescription(data, params).then(response => {
  837. if (response.data.state == 1) {
  838. this.$emit('change', this.patientInfo.id)
  839. this.$message.success('保存成功')
  840. }
  841. })
  842. } else if (index == 2) {
  843. this.$router.push('/outpatientDoctorStation/print')
  844. } else if (index == 4) {
  845. } else if (index == 5) {
  846. this.$refs.saveTemplate.show()
  847. }
  848. } else if (this.dayorMonth == 'month') {
  849. if (this.isShowDayPrescription) {
  850. // if (this.curDayPrescriptions.order_status == 2) {
  851. // this.$message.error('当前处方已经结算,无法保存')
  852. // return
  853. // }
  854. if (this.doctorValue.length <= 0) {
  855. this.$message.error('医生不能为空')
  856. return
  857. }
  858. if (this.departmentValue.length <= 0) {
  859. this.$message.error('科室不能为空')
  860. return
  861. }
  862. if (index == 1) {
  863. let params = {
  864. patient_id: this.patientInfo.id,
  865. diagnose: this.diagnose,
  866. sick_type: this.state1,
  867. sick_history: this.state2,
  868. doctor: this.doctorValue,
  869. department: this.departmentValue,
  870. record_date: this.end_time,
  871. his_patient_id: this.hisPatientInfo.id,
  872. reg_type: this.register_type,
  873. p_type: 2
  874. }
  875. var month_prescriptions = this.deepClone(this.month_prescriptions)
  876. for (let i = 0; i < month_prescriptions.length; i++) {
  877. if (month_prescriptions[i].advices.length > 0 && month_prescriptions[i].project.length == 0) {
  878. month_prescriptions[i]['type'] = 1
  879. }
  880. if (month_prescriptions[i].advices.length == 0 && month_prescriptions[i].project.length > 0) {
  881. month_prescriptions[i]['type'] = 2
  882. }
  883. for (let b = 0; b < month_prescriptions[i].advices.length; b++) {
  884. month_prescriptions[i].advices[b].single_dose = month_prescriptions[i].advices[b].single_dose.toString()
  885. month_prescriptions[i].advices[b].prescribing_number = month_prescriptions[i].advices[b].prescribing_number.toString()
  886. month_prescriptions[i].advices[b].retail_price = month_prescriptions[i].advices[b].retail_price.toString()
  887. month_prescriptions[i].advices[b].day = parseInt(month_prescriptions[i].advices[b].day)
  888. }
  889. for (let b = 0; b < month_prescriptions[i].project.length; b++) {
  890. console.log('~~~~~~~')
  891. month_prescriptions[i].project[b].price = month_prescriptions[i].project[b].price.toString()
  892. month_prescriptions[i].project[b].total = month_prescriptions[i].project[b].total.toString()
  893. month_prescriptions[i].project[b].delivery_way = month_prescriptions[i].project[b].delivery_way.toString()
  894. }
  895. for (let b = 0; b < month_prescriptions[i].addition.length; b++) {
  896. month_prescriptions[i].addition[b].id = parseInt(month_prescriptions[i].addition[b].id)
  897. month_prescriptions[i].addition[b].item_id = parseInt(month_prescriptions[i].addition[b].item_id)
  898. month_prescriptions[i].addition[b].price = month_prescriptions[i].addition[b].price.toString()
  899. month_prescriptions[i].addition[b].count = month_prescriptions[i].addition[b].count.toString()
  900. }
  901. }
  902. let data = {
  903. 'prescriptions': month_prescriptions
  904. }
  905. editHisPrescription(data, params).then(response => {
  906. if (response.data.state == 1) {
  907. this.month_prescriptions = month_prescriptions
  908. this.$message.success('编辑成功')
  909. }
  910. })
  911. }
  912. }
  913. }
  914. },
  915. addTab(targetName) {
  916. // if (this.curPrescriptions.order_status == 2) {
  917. // this.$message.error('该处方已经结算或者退费,无法继续添加处方')
  918. // return
  919. // }
  920. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
  921. this.$message.error('当前处方无数据,新增数据后才能新增处方')
  922. return
  923. }
  924. this.tabIndex = this.prescriptions.length
  925. ++this.tabIndex
  926. let newTabName = '处方' + this.tabIndex
  927. var nowDate = new Date()
  928. var nowYear = nowDate.getFullYear()
  929. var nowMonth = nowDate.getMonth() + 1
  930. var nowDay = nowDate.getDate()
  931. var hours = nowDate.getHours()
  932. var min = nowDate.getMinutes()
  933. var nowTime =
  934. nowYear +
  935. '-' +
  936. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  937. '-' +
  938. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (hours < 10 ? '0' + hours : hours) +
  939. ':' + (min < 10 ? '0' + min : min)
  940. let obj = {
  941. id: 0,
  942. name: newTabName,
  943. order_status: 0,
  944. advices: [],
  945. project: [],
  946. addition: [],
  947. pre_time: this.prescriptions[0].pre_time
  948. // pre_time: nowTime
  949. }
  950. obj.med_type = 14
  951. this.prescriptions.push(obj)
  952. this.editableTabsValue = newTabName
  953. this.curPrescriptions = this.prescriptions[this.prescriptions.length - 1]
  954. this.curStatus = 0
  955. if (this.curPrescriptions.order_status == 0) {
  956. this.order_status = '未收费'
  957. }
  958. if (this.curPrescriptions.order_status == 1) {
  959. this.order_status = '未收费'
  960. }
  961. if (this.curPrescriptions.order_status == 2) {
  962. this.order_status = '已结算'
  963. }
  964. if (this.curPrescriptions.order_status == 3) {
  965. this.order_status = '已退费'
  966. }
  967. },
  968. removeTab(targetName) {
  969. if (targetName == '处方1') {
  970. this.$message.error('该处方无法删除')
  971. return
  972. }
  973. this.$confirm('处方删除后不可恢复,是否确认删除', '删除', {
  974. confirmButtonText: '确 定',
  975. cancelButtonText: '取 消',
  976. type: 'warning'
  977. }).then(() => {
  978. let id = 0
  979. for (let i = 0; i < this.prescriptions.length; i++) {
  980. if (this.prescriptions[i].name == targetName) {
  981. id = this.prescriptions[i].id
  982. }
  983. }
  984. if (id == 0) {
  985. let tabs = this.prescriptions
  986. let activeName = this.editableTabsValue
  987. if (activeName === targetName) {
  988. tabs.forEach((tab, index) => {
  989. if (tab.name === targetName) {
  990. let nextTab = tabs[index + 1] || tabs[index - 1]
  991. if (nextTab) {
  992. activeName = nextTab.name
  993. }
  994. }
  995. })
  996. }
  997. this.editableTabsValue = activeName
  998. this.prescriptions = tabs.filter(tab => tab.name !== targetName)
  999. for (let i = 0; i < this.prescriptions.length; i++) {
  1000. if (activeName == this.prescriptions[i].name) {
  1001. this.curPrescriptions = this.prescriptions[i]
  1002. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1003. this.curStatus = 1
  1004. }
  1005. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  1006. this.curStatus = 2
  1007. }
  1008. }
  1009. }
  1010. if (this.prescriptions.length == 0) {
  1011. this.curPrescriptions = []
  1012. this.curStatus = 0
  1013. }
  1014. } else {
  1015. let params = {
  1016. 'id': id
  1017. }
  1018. delHisPrescriptionInfoTemplate(params).then(response => {
  1019. if (response.data.state == 1) {
  1020. this.$message.success('删除成功')
  1021. let tabs = this.prescriptions
  1022. let activeName = this.editableTabsValue
  1023. if (activeName === targetName) {
  1024. tabs.forEach((tab, index) => {
  1025. if (tab.name === targetName) {
  1026. let nextTab = tabs[index + 1] || tabs[index - 1]
  1027. if (nextTab) {
  1028. activeName = nextTab.name
  1029. }
  1030. }
  1031. })
  1032. }
  1033. this.editableTabsValue = activeName
  1034. this.prescriptions = tabs.filter(tab => tab.name !== targetName)
  1035. for (let i = 0; i < this.prescriptions.length; i++) {
  1036. if (activeName == this.prescriptions[i].name) {
  1037. this.curPrescriptions = this.prescriptions[i]
  1038. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1039. this.curStatus = 1
  1040. }
  1041. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  1042. this.curStatus = 2
  1043. }
  1044. }
  1045. }
  1046. if (this.prescriptions.length == 0) {
  1047. this.curPrescriptions = []
  1048. this.curStatus = 0
  1049. }
  1050. } else {
  1051. this.$message.success(response.data.msg)
  1052. }
  1053. })
  1054. }
  1055. }).catch(() => {
  1056. })
  1057. },
  1058. beforeLeave(activeName, oldActiveName) {
  1059. let index = activeName
  1060. if (index == 1) {
  1061. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  1062. return false
  1063. }
  1064. } else {
  1065. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1066. return false
  1067. }
  1068. }
  1069. },
  1070. clickTab(tab) {
  1071. let index = parseInt(tab.name)
  1072. if (index == 1) {
  1073. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  1074. this.$message.error('当前处方为项目,无法切换为药品,需要新开处方')
  1075. return
  1076. }
  1077. } else {
  1078. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1079. this.$message.error('当前处方为药品,无法切换为项目,需要新开处方')
  1080. return
  1081. }
  1082. }
  1083. if (index == 1) {
  1084. this.teamList = []
  1085. this.$refs.tables.clearSelection()
  1086. this.showOne = true
  1087. this.showTwo = false
  1088. this.$nextTick(() => {
  1089. this.$refs.prescription_tables.setNewData(this.prescriptions[this.prescriptions.length - 1])
  1090. })
  1091. this.customTabIndex = 1
  1092. }
  1093. if (index == 2) {
  1094. this.curDrugs = []
  1095. this.$refs.multipleTable.clearSelection()
  1096. this.showTwo = true
  1097. this.showOne = false
  1098. this.$nextTick(() => {
  1099. this.$refs.prescription_tables.setNewData(this.prescriptions[this.prescriptions.length - 1])
  1100. })
  1101. this.customTabIndex = 2
  1102. }
  1103. this.rightTab = index
  1104. //用来区分处方属于项目还是药品
  1105. if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1106. this.customTabIndex = 1
  1107. this.curStatus = 1
  1108. }
  1109. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
  1110. this.customTabIndex = 2
  1111. this.curStatus = 2
  1112. }
  1113. if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
  1114. // this.customTabIndex = this.rightTab
  1115. this.customTabIndex = index
  1116. this.curStatus = 0
  1117. }
  1118. }, changeAllGoodInfoTableData: function(selection) {
  1119. this.curDrugs = selection
  1120. }, addCharges() {
  1121. this.$refs.additionalCharges.show()
  1122. },
  1123. selectDrugs(selection, row) {
  1124. this.curDrugs = selection
  1125. },
  1126. comfirm() {
  1127. console.log('222222222222', this.teamList)
  1128. // if (this.curPrescriptions.order_status == 2) {
  1129. // this.$message.error('该处方已经结算,无法继续添加药品或者项目')
  1130. // this.teamList = []
  1131. // this.curDrugs = []
  1132. // this.tempDrugs = []
  1133. // this.$refs.tables.clearSelection()
  1134. // this.$refs.multipleTableTwo.clearSelection()
  1135. // this.$refs.multipleTable.clearSelection()
  1136. // return
  1137. // }
  1138. // if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
  1139. // if (this.$store.getters.xt_user.org_id == 10138) {
  1140. // for (let i = 0; i < this.curDrugs.length; i++) {
  1141. // if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
  1142. // this.$message.error('该处方属于特病类型处方,开非特病类型的药')
  1143. // return
  1144. // }
  1145. // }
  1146. // }
  1147. // }
  1148. // if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
  1149. // if (this.$store.getters.xt_user.org_id == 10138) {
  1150. // for (let i = 0; i < this.curDrugs.length; i++) {
  1151. // if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
  1152. // this.$message.error('该处方属于特病类型处方,开非特病类型的药')
  1153. // return
  1154. // }
  1155. // }
  1156. // }
  1157. // }
  1158. if (this.curDrugs.length > 0) {
  1159. for (let i = 0; i < this.curDrugs.length; i++) {
  1160. if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
  1161. this.$message.error('该处方属于特病类型处方,开非特病类型的药')
  1162. return
  1163. }
  1164. }
  1165. }
  1166. if (this.teamList.length > 0) {
  1167. for (let i = 0; i < this.teamList.length; i++) {
  1168. if (this.curPrescriptions.med_type == 14 && this.teamList[i].is_special_diseases != 1) {
  1169. this.$message.error('该处方属于特病类型处方,请开特病类型的项目')
  1170. // return
  1171. }
  1172. }
  1173. let arr = this.teamList
  1174. let newArr = []
  1175. arr.map(item => {
  1176. if(this.curPrescriptions.med_type != 14){
  1177. newArr.push(item)
  1178. }
  1179. if(this.curPrescriptions.med_type == 14 && item.is_special_diseases == 1){
  1180. newArr.push(item)
  1181. }
  1182. })
  1183. this.teamList = newArr
  1184. }
  1185. if (this.curDrugs.length == 0) {
  1186. for (let i = 0; i < this.curDrugs.length; i++) {
  1187. if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
  1188. this.$message.error('该处方属于特病类型处方,开非特病类型的药')
  1189. return
  1190. }
  1191. }
  1192. }
  1193. if (this.curStatus == 1 && this.rightTab == 2) {
  1194. this.$message.error('改处方是药品,无法添加项目')
  1195. this.teamList = []
  1196. this.$refs.tables.clearSelection()
  1197. return
  1198. }
  1199. if (this.curStatus == 2 && this.rightTab == 1) {
  1200. this.$message.error('改处方是项目,无法添加药品')
  1201. this.curDrugs = []
  1202. this.tempDrugs = []
  1203. this.$refs.multipleTable.clearSelection()
  1204. this.$refs.multipleTableTwo.clearSelection()
  1205. return
  1206. }
  1207. for (let i = 0; i < this.teamList.length; i++) {
  1208. for (let a = 0; a < this.curPrescriptions.project.length; a++) {
  1209. if (this.teamList[i].id == this.curPrescriptions.project[a].project_id) {
  1210. this.$message.error('当前处方存在相同的药品,无法添加相同的项目')
  1211. return
  1212. }
  1213. }
  1214. }
  1215. console.log(this.curDrugs)
  1216. console.log(this.curPrescriptions.advices)
  1217. for (let i = 0; i < this.curDrugs.length; i++) {
  1218. for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
  1219. if (this.curDrugs[i].id == this.curPrescriptions.advices[a].id) {
  1220. this.$message.error('当前处方存在相同的药品,无法添加相同的药品')
  1221. return
  1222. }
  1223. }
  1224. }
  1225. let templateDrugs = []
  1226. for (let i = 0; i < this.tempDrugs.length; i++) {
  1227. for (let a = 0; a < this.tempDrugs[i].advices.length; a++) {
  1228. templateDrugs.push(this.tempDrugs[i].advices[a])
  1229. }
  1230. }
  1231. // for (let i = 0; i < templateDrugs.length; i++) {
  1232. // for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
  1233. // if (this.templateDrugs[i].drug_id == this.curPrescriptions.advices[i].id) {
  1234. // this.$message.error('改处方存在相同的药品,无法添加相同的药品')
  1235. // return
  1236. //
  1237. // }
  1238. // }
  1239. // }
  1240. for (let i = 0; i < this.prescriptions.length; i++) {
  1241. if (this.prescriptions[i].name == this.editableTabsValue) {
  1242. var temp = this.deepClone(this.curDrugs)
  1243. var temp2 = this.deepClone(this.teamList)
  1244. var temp3 = this.deepClone(templateDrugs)
  1245. if (temp3.length > 0) {
  1246. for (let b = 0; b < temp3.length; b++) {
  1247. let obj = {
  1248. advice_id: 0,
  1249. id: temp3[b].id,
  1250. drug_name: temp3[b].advice_name,
  1251. single_dose: temp3[b].single_dose,
  1252. delivery_way: temp3[b].delivery_way,
  1253. execution_frequency: temp3[b].execution_frequency,
  1254. retail_price: temp3[b].drug.retail_price.toString(),
  1255. remark: '',
  1256. day: 1,
  1257. prescribing_number: temp3[b].prescribing_number,
  1258. single_dose_unit: temp3[b].drug.min_unit,
  1259. prescribing_number_unit: temp3[b].drug.max_unit,
  1260. medical_insurance_number: temp3[b].drug.medical_insurance_number
  1261. }
  1262. if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
  1263. obj.prescribing_number = 1
  1264. }
  1265. this.prescriptions[i].advices.push(obj)
  1266. }
  1267. this.curStatus = 1
  1268. }
  1269. if (temp.length > 0) {
  1270. for (let b = 0; b < temp.length; b++) {
  1271. let obj = {
  1272. advice_id: 0,
  1273. id: temp[b].id,
  1274. drug_name: temp[b].drug_name,
  1275. single_dose: temp[b].single_dose,
  1276. delivery_way: temp[b].delivery_way,
  1277. execution_frequency: temp[b].execution_frequency,
  1278. retail_price: temp[b].prescribing_number_unit == temp[b].max_unit ? temp[b].retail_price.toString() : temp[b].min_price.toString(),
  1279. remark: '',
  1280. day: 1,
  1281. prescribing_number: temp[b].prescribing_number,
  1282. single_dose_unit: temp[b].dose_unit,
  1283. prescribing_number_unit: temp[b].prescribing_number_unit,
  1284. medical_insurance_number: temp[b].medical_insurance_number,
  1285. drug: temp[b]
  1286. }
  1287. if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
  1288. obj.prescribing_number = 1
  1289. }
  1290. this.prescriptions[i].advices.push(obj)
  1291. }
  1292. this.curStatus = 1
  1293. }
  1294. // if(this.activeName == 2){
  1295. //
  1296. // for(let i = 0; i<temp2.length;i++){
  1297. // for(let j=0;j<this.hisList.length;j++){
  1298. // if(temp2[i].id == this.hisList[j].project_id){
  1299. // temp2[i].total = this.hisList[j].number
  1300. // }
  1301. // }
  1302. // }
  1303. // }
  1304. if (temp2.length > 0) {
  1305. for (let b = 0; b < temp2.length; b++) {
  1306. let obj = {
  1307. id: 0,
  1308. project_id: temp2[b].id,
  1309. project_name: temp2[b].project_name,
  1310. statistical_classification: temp2[b].statistical_classification,
  1311. single_dose: temp2[b].single_dose,
  1312. delivery_way: temp2[b].delivery_way,
  1313. execution_frequency: temp2[b].execution_frequency,
  1314. number_days: temp2[b].number_days,
  1315. total: temp2[b].total,
  1316. price: temp2[b].price,
  1317. remark: '',
  1318. medical_code: temp2[b].medical_code,
  1319. unit: temp2[b].unit,
  1320. type: temp2[b].type
  1321. }
  1322. if (obj.total == 0 || obj.total == undefined) {
  1323. obj.total = 1
  1324. }
  1325. if (obj.type == 3) {
  1326. obj.single_dose = 1
  1327. }
  1328. this.prescriptions[i].project.push(obj)
  1329. }
  1330. this.curStatus = 2
  1331. }
  1332. this.curPrescriptions = this.prescriptions[i]
  1333. this.$refs.multipleTable.clearSelection()
  1334. this.$refs.tables.clearSelection()
  1335. }
  1336. }
  1337. this.curDrugs = []
  1338. this.preDrugs = []
  1339. this.teamList = []
  1340. }, changeAllGoodInfoTableDataTwo(row) {
  1341. this.teamList = row
  1342. },
  1343. selectChange(row) {
  1344. this.teamList = row
  1345. }, getPrescriptionTemplateInfo() {
  1346. let params = {
  1347. id: this.$route.query.id
  1348. }
  1349. getPrescriptionTemplateInfo(params).then(response => {
  1350. if (response.data.state == 0) {
  1351. this.$message.error(response.data.msg)
  1352. return false
  1353. } else {
  1354. this.prescriptions = []
  1355. // console.log(this.tempForm)
  1356. if (response.data.data.template.id > 0) {
  1357. this.tempForm.name = response.data.data.template.name
  1358. this.tempForm.mode_id = response.data.data.template.mode
  1359. for (let i = 0; i < response.data.data.prescriptions.length; i++) {
  1360. var prescription = response.data.data.prescriptions[i]
  1361. let tempAdvice = []
  1362. let tempProject = []
  1363. let tempAddition = []
  1364. //药品
  1365. for (let b = 0; b < prescription.advices.length; b++) {
  1366. let obj = {
  1367. advice_id: prescription.advices[b].id,
  1368. drug_name: prescription.advices[b].advice_name,
  1369. single_dose: prescription.advices[b].single_dose,
  1370. delivery_way: prescription.advices[b].delivery_way,
  1371. execution_frequency: prescription.advices[b].execution_frequency,
  1372. retail_price: prescription.advices[b].price.toString(),
  1373. remark: prescription.advices[b].remark,
  1374. day: prescription.advices[b].day,
  1375. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1376. single_dose_unit: prescription.advices[b].single_dose_unit,
  1377. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1378. medical_insurance_number: prescription.advices[b].med_list_codg,
  1379. id: prescription.advices[b].drug_id,
  1380. drug: prescription.advices[b].drug
  1381. }
  1382. tempAdvice.push(obj)
  1383. }
  1384. //项目
  1385. for (let b = 0; b < prescription.project.length; b++) {
  1386. let obj = {
  1387. id: prescription.project[b].id,
  1388. project_id: prescription.project[b].project_id,
  1389. project_name: prescription.project[b].project.project_name,
  1390. statistical_classification: prescription.project[b].project.statistical_classification,
  1391. single_dose: prescription.project[b].single_dose,
  1392. delivery_way: prescription.project[b].delivery_way,
  1393. execution_frequency: prescription.project[b].execution_frequency,
  1394. number_days: prescription.project[b].day,
  1395. total: prescription.project[b].count.toString(),
  1396. price: prescription.project[b].price,
  1397. remark: prescription.project[b].remark,
  1398. medical_code: prescription.project[b].project.medical_code,
  1399. unit: prescription.project[b].project.unit,
  1400. type: prescription.project[b].type
  1401. }
  1402. if (prescription.project[b].type == 2) {
  1403. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  1404. obj['medical_code'] = prescription.project[b].project.medical_code
  1405. obj['project_name'] = prescription.project[b].project.project_name
  1406. } else if (prescription.project[b].type == 3) {
  1407. obj['statistical_classification'] = ''
  1408. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  1409. obj['project_name'] = prescription.project[b].good_info.good_name
  1410. }
  1411. tempProject.push(obj)
  1412. }
  1413. // var preTime = nowTime
  1414. let index = i + 1
  1415. let obj = {
  1416. id: prescription.id,
  1417. name: '处方' + index,
  1418. advices: tempAdvice,
  1419. project: tempProject,
  1420. addition: tempAddition,
  1421. order_status: 1
  1422. // pre_time: preTime
  1423. }
  1424. if (prescription.med_type == '' || prescription.med_type == 0) {
  1425. obj['med_type'] = ''
  1426. } else {
  1427. obj['med_type'] = parseInt(prescription.med_type)
  1428. }
  1429. this.prescriptions.push(obj)
  1430. }
  1431. this.curPrescriptions = this.prescriptions[0]
  1432. } else {
  1433. let obj = {
  1434. id: 0,
  1435. name: '处方1',
  1436. advices: [],
  1437. project: [],
  1438. addition: [],
  1439. order_status: 0,
  1440. med_type: ''
  1441. }
  1442. obj.med_type = 14
  1443. this.prescriptions.push(obj)
  1444. this.curPrescriptions = this.prescriptions[0]
  1445. }
  1446. }
  1447. })
  1448. },
  1449. getlist() {
  1450. this.tabProject = []
  1451. getHisProject().then(response => {
  1452. if (response.data.state == 1) {
  1453. var project = response.data.data.project
  1454. for (let i = 0; i < project.length; i++) {
  1455. let obj = {
  1456. id: project[i].id,
  1457. project_name: project[i].project_name,
  1458. statistical_classification: project[i].statistical_classification,
  1459. single_dose: project[i].single_dose,
  1460. delivery_way: project[i].delivery_way,
  1461. execution_frequency: project[i].execution_frequency,
  1462. number_days: project[i].number_days,
  1463. price: project[i].price,
  1464. medical_code: project[i].medical_code,
  1465. unit: project[i].unit,
  1466. type: 2,
  1467. is_special_diseases: project[i].disease_directory
  1468. }
  1469. this.tabProject.push(obj)
  1470. }
  1471. var good_info = response.data.data.good_info
  1472. for (let i = 0; i < good_info.length; i++) {
  1473. let obj = {
  1474. id: good_info[i].id,
  1475. project_name: good_info[i].good_name,
  1476. statistical_classification: 0,
  1477. single_dose: 1,
  1478. delivery_way: '',
  1479. execution_frequency: '',
  1480. number_days: 1,
  1481. price: good_info[i].retail_price,
  1482. medical_code: good_info[i].medical_insurance_number,
  1483. unit: this.getGoodUnit(good_info[i].good_unit),
  1484. type: 3,
  1485. is_special_diseases: good_info[i].is_special_diseases
  1486. }
  1487. this.tabProject.push(obj)
  1488. }
  1489. this.allProject = this.tabProject
  1490. }
  1491. })
  1492. }, deepClone(source) {
  1493. if (!source && typeof source !== 'object') {
  1494. throw new Error('error arguments', 'shallowClone')
  1495. }
  1496. const targetObj = source.constructor === Array ? [] : {}
  1497. Object.keys(source).forEach((keys) => {
  1498. if (source[keys] && typeof source[keys] === 'object') {
  1499. targetObj[keys] = this.deepClone(source[keys])
  1500. } else {
  1501. targetObj[keys] = source[keys]
  1502. }
  1503. })
  1504. return targetObj
  1505. }, getGoodUnit(id) {
  1506. var goodUnit = this.$store.getters.good_unit
  1507. for (let i = 0; i < goodUnit.length; i++) {
  1508. if (goodUnit[i].id == id) {
  1509. return goodUnit[i].name
  1510. }
  1511. }
  1512. },
  1513. getAllProjectTeam() {
  1514. getAllProjectTeam().then(response => {
  1515. if (response.data.state == 1) {
  1516. var team = response.data.data.team
  1517. console.log('team2222', team)
  1518. this.tabPrjectTeam = team
  1519. this.projectList = team
  1520. }
  1521. })
  1522. },
  1523. changevalue(val) {
  1524. this.$forceUpdate()
  1525. },
  1526. selectTeam(row) {
  1527. console.log('row', row)
  1528. var arr = []
  1529. for (let i = 0; i < row.length; i++) {
  1530. arr.push(row[i].item_id)
  1531. }
  1532. var ids = arr.join(',')
  1533. var strArr = ids.split(',')
  1534. var res = []//接收不重复的数据
  1535. for (var i = 0; i < strArr.length; i++) {
  1536. var flag = true
  1537. for (var j = 0; j < i; j++) {
  1538. if (strArr[i] === strArr[j]) {
  1539. flag = false
  1540. break
  1541. }
  1542. }
  1543. if (flag) {
  1544. res.push(strArr[i])
  1545. }
  1546. }
  1547. var idstr = res.join(',')
  1548. const params = {
  1549. project_id: idstr
  1550. }
  1551. getPojectListById(params).then(response => {
  1552. if (response.data.state == 1) {
  1553. this.teamList = []
  1554. var project = response.data.data.project
  1555. for (let i = 0; i < project.length; i++) {
  1556. if (project[i].type == 2) {
  1557. let obj = {
  1558. id: project[i].project_id,
  1559. project_name: project[i].project.project_name,
  1560. statistical_classification: project[i].project.statistical_classification,
  1561. single_dose: project[i].project.single_dose,
  1562. delivery_way: project[i].project.delivery_way,
  1563. execution_frequency: project[i].project.execution_frequency,
  1564. number_days: project[i].project.number_days,
  1565. total: project[i].number,
  1566. price: project[i].project.price,
  1567. remark: '',
  1568. medical_code: project[i].project.medical_code,
  1569. unit: project[i].project.unit,
  1570. type: project[i].type
  1571. }
  1572. if (obj.total == 0 || obj.total == undefined) {
  1573. obj.total = 1
  1574. }
  1575. this.teamList.push(obj)
  1576. } else if (project[i].type == 3) {
  1577. let obj = {
  1578. id: project[i].project_id,
  1579. project_name: project[i].good_info.good_name,
  1580. statistical_classification: '',
  1581. single_dose: '',
  1582. delivery_way: '',
  1583. execution_frequency: '',
  1584. number_days: '',
  1585. total: project[i].number,
  1586. price: project[i].good_info.retail_price,
  1587. remark: '',
  1588. medical_code: project[i].good_info.medical_insurance_number,
  1589. unit: project[i].good_info.unit,
  1590. type: project[i].type
  1591. }
  1592. if (obj.total == 0 || obj.total == undefined) {
  1593. obj.total = 1
  1594. }
  1595. this.teamList.push(obj)
  1596. console.log(this.teamList)
  1597. }
  1598. }
  1599. }
  1600. })
  1601. }, changeDoctor(val) {
  1602. for (let i = 0; i < this.doctors.length; i++) {
  1603. if (this.doctors[i].admin_user_id == this.doctorValue) {
  1604. this.departmentValue = this.doctors[i].department_id
  1605. }
  1606. }
  1607. if (this.departmentValue == 0) {
  1608. this.departmentValue = ''
  1609. }
  1610. },
  1611. changeDayOrMonth(tab) {
  1612. if (this.dayorMonth == 'day') {
  1613. } else if (this.dayorMonth == 'month') {
  1614. }
  1615. },
  1616. getAllProjectList() {
  1617. getAllProjectList().then(response => {
  1618. if (response.data.state == 1) {
  1619. var hisprojectlist = response.data.data.hisprojectlist
  1620. console.log('hisprojectlist', hisprojectlist)
  1621. this.hisList = hisprojectlist
  1622. }
  1623. })
  1624. },
  1625. clearSelection() {
  1626. this.$refs.tabProjectTeam.clearSelection()
  1627. }
  1628. }, created() {
  1629. this.getPrescriptionTemplateInfo()
  1630. this.getInitData()
  1631. //获取所有项目
  1632. this.getlist()
  1633. //获取所以项目组套
  1634. this.getAllProjectTeam()
  1635. this.getAllProjectList()
  1636. this.$nextTick(() => {
  1637. this.multipleTableHeight = parseInt(this.$refs.rightTable.offsetHeight)
  1638. })
  1639. }
  1640. }
  1641. </script>
  1642. <style lang="scss" scoped>
  1643. .new-main-contain {
  1644. height: 100%;
  1645. display: flex;
  1646. flex-direction: column;
  1647. }
  1648. .app-container {
  1649. height: 100%;
  1650. }
  1651. .mainCell {
  1652. height: 36px;
  1653. display: flex;
  1654. align-items: center;
  1655. }
  1656. .mainLeft {
  1657. width: 200px;
  1658. height: 100%;
  1659. display: flex;
  1660. flex-direction: column;
  1661. margin-top: 2px;
  1662. .el-radio {
  1663. margin-right: 5px;
  1664. }
  1665. }
  1666. .mainRight {
  1667. margin-left: 20px;
  1668. flex: 1;
  1669. height: 100%;
  1670. display: flex;
  1671. flex-direction: column;
  1672. .cellSpan {
  1673. min-width: 80px;
  1674. display: inline-block;
  1675. margin-right: 10px;
  1676. }
  1677. }
  1678. .mainCenter {
  1679. display: flex;
  1680. flex: 1;
  1681. height: 100%;
  1682. }
  1683. .centerLeft {
  1684. flex: 1;
  1685. display: flex;
  1686. flex-direction: column;
  1687. position: relative;
  1688. .el-form-item {
  1689. width: 33%;
  1690. margin-bottom: 14px;
  1691. }
  1692. .el-form-item__label {
  1693. text-align: left;
  1694. }
  1695. }
  1696. .backColor {
  1697. background: #f6f8f9;
  1698. height: 5px;
  1699. margin-bottom: 5px;
  1700. }
  1701. .RP {
  1702. color: #409EFF;
  1703. font-size: 14px;
  1704. margin-bottom: 5px;
  1705. }
  1706. .tabsBox {
  1707. position: relative;
  1708. flex: 1;
  1709. overflow-y: auto;
  1710. margin-bottom: 60px;
  1711. /*/ / margin-top: 4 px;*/
  1712. .el-tabs__item {
  1713. padding: 0 10px;
  1714. }
  1715. }
  1716. .preTabs {
  1717. height: 100%;
  1718. display: flex;
  1719. flex-direction: column;
  1720. .el-tabs__content {
  1721. flex: 1;
  1722. overflow-y: auto;
  1723. }
  1724. }
  1725. .costBox {
  1726. width: 100%;
  1727. height: 60px;
  1728. background: #fff;
  1729. position: absolute;
  1730. bottom: 0;
  1731. display: flex;
  1732. align-items: center;
  1733. justify-content: space-between;
  1734. }
  1735. .statusRed {
  1736. color: red;
  1737. }
  1738. .addTab {
  1739. position: absolute;
  1740. right: 8px;
  1741. top: 3px;
  1742. z-index: 20;
  1743. }
  1744. .centerRight {
  1745. width: 300px;
  1746. margin-left: 10px;
  1747. display: flex;
  1748. flex-direction: column;
  1749. position: relative;
  1750. }
  1751. .rightTab {
  1752. height: 40px;
  1753. width: 100%;
  1754. border: 1px solid #d2d2d2;
  1755. box-sizing: border-box;
  1756. p {
  1757. width: 50%;
  1758. height: 40px;
  1759. line-height: 40px;
  1760. text-align: center;
  1761. background: #eee;
  1762. float: left;
  1763. }
  1764. > p:last-child {
  1765. border-left: 1px solid #d2d2d2;
  1766. float: right;
  1767. }
  1768. .activeP {
  1769. background: #409EFF;
  1770. color: #fff;
  1771. }
  1772. }
  1773. .rightTabs {
  1774. display: flex;
  1775. flex-direction: column;
  1776. }
  1777. .comfirmBox {
  1778. width: 100%;
  1779. height: 60px;
  1780. background: #fff;
  1781. position: absolute;
  1782. bottom: 0;
  1783. display: flex;
  1784. align-items: center;
  1785. justify-content: space-between;
  1786. z-index: 99;
  1787. }
  1788. .borderCard {
  1789. height: 100%;
  1790. display: flex;
  1791. flex-direction: column;
  1792. margin-bottom: 60px;
  1793. .el-tabs--border-card > .el-tabs__content {
  1794. padding: 0;
  1795. }
  1796. }
  1797. </style>
  1798. <style lang="scss">
  1799. .borderCard {
  1800. .el-tabs__nav {
  1801. width: 100%;
  1802. }
  1803. .el-tabs__item {
  1804. width: 50%;
  1805. text-align: center;
  1806. }
  1807. .el-tabs__content {
  1808. padding: 5px;
  1809. flex: 1;
  1810. }
  1811. }
  1812. .centerLeft {
  1813. .el-form-item__label {
  1814. text-align: left;
  1815. }
  1816. }
  1817. .tabsBox {
  1818. .el-tabs__item {
  1819. padding: 0 10px;
  1820. }
  1821. .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) {
  1822. padding: 0 10px;
  1823. }
  1824. .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 {
  1825. padding: 0 10px;
  1826. }
  1827. .el-tabs--card > .el-tabs__header .el-tabs__item.is-active.is-closable {
  1828. padding: 0 10px;
  1829. }
  1830. }
  1831. .centerRight {
  1832. .el-tabs__nav-scroll {
  1833. display: flex;
  1834. }
  1835. .el-tabs__nav {
  1836. margin: 0 auto;
  1837. }
  1838. .el-table th .cell, .el-table td .cell {
  1839. padding: 0 2px;
  1840. }
  1841. }
  1842. .preTabs {
  1843. .el-tabs__content {
  1844. flex: 1;
  1845. overflow-y: auto;
  1846. padding: 5px 0 5px 5px;
  1847. }
  1848. }
  1849. .rightTabs {
  1850. height: 100%;
  1851. .el-tabs__nav {
  1852. width: auto;
  1853. }
  1854. .el-tabs__header {
  1855. margin-bottom: 5px;
  1856. }
  1857. .el-tabs__item {
  1858. width: auto;
  1859. text-align: inherit;
  1860. }
  1861. .el-tabs__content {
  1862. flex: 1;
  1863. overflow-y: auto;
  1864. }
  1865. .el-tab-pane {
  1866. display: flex;
  1867. flex-direction: column;
  1868. height: 100%;
  1869. }
  1870. }
  1871. #tab-more {
  1872. .el-icon-close {
  1873. display: none;
  1874. }
  1875. }
  1876. ::-webkit-scrollbar {
  1877. height: 15px;
  1878. }
  1879. </style>