ChineseMedicine.vue 117 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739
  1. <template>
  2. <div>
  3. <div class="table-header flex-vertical-between">
  4. <div class="table-label flex-vertical-center-l">
  5. <div class="label-item flex-center" v-for="(item,index) in recipe_tabs" :key="'a'+index">
  6. <span
  7. :class="recipe_tabs_c==index?'l_active':''"
  8. @click="recipeChange(index)"
  9. >{{item.name}}</span>
  10. <div
  11. @click="recipeDelete(index)"
  12. v-show="!recipe_tabs[index].isPay && recipe_tabs[index].paystate==0"
  13. >X</div>
  14. <img
  15. src="../assets/new-icon/isPay.png"
  16. v-show="recipe_tabs[index].isPay || recipe_tabs[index].paystate==1"
  17. />
  18. </div>
  19. <!-- <el-button size="mini" type="warning" icon="el-icon-plus" @click="addRecipeTba()"></el-button> -->
  20. </div>
  21. <div class="flex flex-col-center flex-row-r">
  22. <!-- <div class="add-presc flex-center" @click="addRecipeTba()">新增处方</div> -->
  23. <!-- <el-popover placement="left" width="300" trigger="click">
  24. <el-button size="mini" type="warning" slot="reference">兼证加减</el-button>
  25. <template>
  26. <accompanied></accompanied>
  27. </template>
  28. </el-popover>-->
  29. <el-button size="mini" type="warning" @click="addRecipeTba()" style="margin-left:10px;">新增处方</el-button>
  30. <el-button size="mini" type="primary" @click="openSafeDrug" v-if="isShrink">安全合理用药检测</el-button>
  31. <!-- <div class="add-presc flex-center" @click="clearRecipe()">清空处方</div> -->
  32. <el-button size="mini" type="warning" @click="clearRecipe()">清空处方</el-button>
  33. </div>
  34. </div>
  35. <div class="table-container">
  36. <div class="t-con-header flex-vertical-between">
  37. <div class="t-con-radio flex-vertical-center-l" v-if="false">
  38. <span class="t-radio-title">选择药房:</span>
  39. <div class="t-radio-group">
  40. <el-select
  41. v-model="recipe_tabs[recipe_tabs_c].pharmacyID"
  42. :disabled="recipe_tabs[recipe_tabs_c].disable"
  43. placeholder="请选择"
  44. @change="changePharmacy(recipe_tabs[recipe_tabs_c].lastType)"
  45. >
  46. <el-option
  47. :label="item.pharmacyName"
  48. :value="item.pid"
  49. v-for="(item,index) in pharmacyList"
  50. :key="'b'+index"
  51. ></el-option>
  52. </el-select>
  53. </div>
  54. </div>
  55. <!-- @change="getPharmacyID" -->
  56. <!-- @change="changePharmacy(recipe_tabs[recipe_tabs_c].lastType)" -->
  57. <div class="t-con-radio flex-vertical-center-l">
  58. <div class="t-radio-group">
  59. <el-radio-group
  60. v-model="recipe_tabs[recipe_tabs_c].radio"
  61. :disabled="recipe_tabs[recipe_tabs_c].disable"
  62. >
  63. <el-radio
  64. :label="item.ptype"
  65. v-for="(item,index) in pharmacyTypes"
  66. :key="index"
  67. @click.native.prevent="changePharmacy(recipe_tabs[recipe_tabs_c].lastType,item.ptype)"
  68. >
  69. <span>{{item.name}}</span>
  70. </el-radio>
  71. </el-radio-group>
  72. </div>
  73. </div>
  74. <!-- <div class="add-presc1 flex-center" @click="clearRecipe()">清空处方</div> -->
  75. </div>
  76. <div class="table-bottom" v-if="false">
  77. <div class="header-about flex-vertical-center-l flex-wrap" v-if="container_i!=2">
  78. <div class="item flex-vertical-center-l">
  79. <!-- <span>配送:</span>
  80. <div class="div3">
  81. <el-radio-group v-model="recipe_tabs[recipe_tabs_c].bottom_form.radio"
  82. @change="getaddress">
  83. <el-radio label="0">是</el-radio>
  84. <el-radio label="1">否</el-radio>
  85. </el-radio-group>
  86. </div>-->
  87. <!-- <div>
  88. <el-checkbox @change="changeDaijian" v-model="recipe_tabs[recipe_tabs_c].bottom_form.isDaiJian">代煎
  89. </el-checkbox>
  90. </div>-->
  91. <div class="daijiao-check flex flex-row-left flex-col-center" @click="changeDaijian">
  92. <div
  93. :class="['img-body',recipe_tabs[recipe_tabs_c].bottom_form.isDaiJian==1?'active':'']"
  94. >
  95. <img
  96. src="~@/assets/new-icon/checked.png"
  97. alt
  98. v-if="recipe_tabs[recipe_tabs_c].bottom_form.isDaiJian==1"
  99. />
  100. </div>
  101. <span>代煎</span>
  102. </div>
  103. <!-- <el-checkbox @change="changePeiSong" :checked="recipe_tabs[recipe_tabs_c].bottom_form.radio==0">配送
  104. </el-checkbox>-->
  105. <div class="daijiao-check flex flex-row-left flex-col-center" @click="changePeiSong">
  106. <div
  107. :class="['img-body',recipe_tabs[recipe_tabs_c].bottom_form.radio==0?'active':'']"
  108. >
  109. <img
  110. src="~@/assets/new-icon/checked.png"
  111. alt
  112. v-if="recipe_tabs[recipe_tabs_c].bottom_form.radio==0"
  113. />
  114. </div>
  115. <span>配送</span>
  116. </div>
  117. </div>
  118. <div
  119. class="item flex-vertical-center-l"
  120. v-if="recipe_tabs[recipe_tabs_c].bottom_form.radio==0"
  121. >
  122. <span>收货人:</span>
  123. <div class="div3">
  124. <el-input
  125. size="mini"
  126. placeholder="请输入"
  127. v-model="recipe_tabs[recipe_tabs_c].bottom_form.savename"
  128. ></el-input>
  129. </div>
  130. </div>
  131. <div
  132. class="item flex-vertical-center-l"
  133. v-if="recipe_tabs[recipe_tabs_c].bottom_form.radio==0"
  134. >
  135. <span>电话:</span>
  136. <div class="div5">
  137. <el-input
  138. size="mini"
  139. placeholder="请输入"
  140. v-model="recipe_tabs[recipe_tabs_c].bottom_form.phone"
  141. ></el-input>
  142. </div>
  143. </div>
  144. <div
  145. class="item flex-vertical-center-l flex-wrap"
  146. v-if="recipe_tabs[recipe_tabs_c].bottom_form.radio==0"
  147. >
  148. <span>地址:</span>
  149. <div class="city1 city">
  150. <el-select
  151. size="mini"
  152. v-model="recipe_tabs[recipe_tabs_c].bottom_form.province"
  153. placeholder="选择省"
  154. @change="proC($event)"
  155. >
  156. <el-option
  157. :label="item.name"
  158. :value="item.code"
  159. v-for="(item,index) in recipe_tabs[recipe_tabs_c].bottom_form.provinceList"
  160. :key="'m'+index"
  161. ></el-option>
  162. </el-select>
  163. </div>
  164. <div class="city1 city">
  165. <el-select
  166. size="mini"
  167. v-model="recipe_tabs[recipe_tabs_c].bottom_form.city"
  168. placeholder="选择市"
  169. @change="cityC($event)"
  170. >
  171. <el-option
  172. :label="item.name"
  173. :value="item.code"
  174. v-for="(item,index) in recipe_tabs[recipe_tabs_c].bottom_form.cityList"
  175. :key="'n'+index"
  176. ></el-option>
  177. </el-select>
  178. </div>
  179. <div class="city1 city">
  180. <el-select
  181. size="mini"
  182. v-model="recipe_tabs[recipe_tabs_c].bottom_form.area"
  183. placeholder="选择区"
  184. >
  185. <el-option
  186. :label="item.name"
  187. :value="item.code"
  188. v-for="(item,index) in recipe_tabs[recipe_tabs_c].bottom_form.areaList"
  189. :key="'o'+index"
  190. ></el-option>
  191. </el-select>
  192. </div>
  193. <!-- div4 -->
  194. <div class="city1 city">
  195. <el-input
  196. size="mini"
  197. placeholder="请输入详细地址"
  198. v-model="recipe_tabs[recipe_tabs_c].bottom_form.address"
  199. ></el-input>
  200. </div>
  201. </div>
  202. <div
  203. class="right flex-center"
  204. v-if="recipe_tabs[recipe_tabs_c].bottom_form.radio ==0"
  205. @click="getAddressForHospital"
  206. >寄到本院</div>
  207. <!-- 数据会更新到这个组件里面 -->
  208. </div>
  209. </div>
  210. <div class="table-msg">
  211. <!-- 表格 -->
  212. <div class="table-show flex-plane-t-between flex-wrap">
  213. <!-- 表一和表二 -->
  214. <div class="table-left-body">
  215. <div class="table-left" v-if="true">
  216. <el-table
  217. :data="recipe_tabs[recipe_tabs_c].tableData"
  218. style="width:100%;"
  219. :span-method="arraySpanMethod1"
  220. id="table1"
  221. >
  222. <el-table-column prop="id" label width="20">
  223. <template slot-scope="scope">
  224. <!-- width:110px -->
  225. <!-- v-model="scope.row.key" -->
  226. <div v-if="!scope.row.name" class="flex-vertical-between">
  227. <div style="width:80px;" class="operate2" id="operate2">
  228. <el-input
  229. :value="scope.row.key"
  230. :id="'searchD'+scope.row.id"
  231. size="mini"
  232. placeholder="请输入..."
  233. @input="searchDrug($event,scope)"
  234. @focus="drugFocus(scope)"
  235. @blur="drugBlur($event,scope)"
  236. @keydown.down.native="drugDown($event,scope)"
  237. @keydown.up.native="drugUp($event,scope)"
  238. @keydown.enter.native="drugEnter(scope)"
  239. :disabled="recipe_tabs[recipe_tabs_c].disable"
  240. ></el-input>
  241. <div
  242. class="table-choose3"
  243. v-if="scope.row.key"
  244. :style="medIndex==0?'':{top:(medIndex*35)+'px'}"
  245. >
  246. <div class="table-choose-h flex-vertical-between">
  247. <div class="flex-center">药品名称</div>
  248. <div class="flex-center">规格</div>
  249. <div class="flex-center">产地</div>
  250. <div class="flex-center">单价</div>
  251. <div class="flex-center">库存</div>
  252. </div>
  253. <div
  254. class="t-c-b infinite-list"
  255. v-infinite-scroll="load"
  256. :infinite-scroll-immediate="false"
  257. :id="'infiniteList'+scope.row.id"
  258. :ref="'infiniteList'+scope.row.id"
  259. style="overflow:auto"
  260. >
  261. <div
  262. class="infinite-list-item flex-vertical-between"
  263. :style="scope.row.search_i===index1?'background: #EDF3FE;':''"
  264. @click="chooseDis1(scope,index1,item1)"
  265. v-for="(item1,index1) in scope.row.drugList"
  266. :key="scope.row.id+'f'+index1"
  267. >
  268. <p class="flex-center">{{item1.ypmc}}</p>
  269. <p class="flex-center">{{item1.gg}}</p>
  270. <p class="flex-center">{{item1.cdmc}}</p>
  271. <p class="flex-center">{{item1.price}}</p>
  272. <p class="flex-center">{{item1.kc}}</p>
  273. </div>
  274. </div>
  275. </div>
  276. </div>
  277. <!-- <div class="operate1"
  278. v-if="scope.row.id!==recipe_tabs[recipe_tabs_c].totalTableD.length && !scope.row.name">
  279. <img src="../assets/delete1.png" alt="" @click="deleteDis1(scope)" />
  280. </div>-->
  281. </div>
  282. <!-- -->
  283. <div v-else>{{scope.row.id}}</div>
  284. </template>
  285. </el-table-column>
  286. <el-table-column prop="name" label="药品名称" width="80">
  287. <template slot-scope="scope" v-if="scope.row.name">
  288. <div
  289. @click="clickName(scope)"
  290. v-if="!scope.row.showSearch"
  291. :style="{'color':scope.row.color?scope.row.color:''}"
  292. >{{scope.row.name}}</div>
  293. <div v-else class="flex-vertical-between">
  294. <div style="width:110px;">
  295. <el-input
  296. :value="scope.row.key"
  297. :id="'searchD'+scope.row.id"
  298. size="mini"
  299. :placeholder="scope.row.name"
  300. @input="searchDrug($event,scope)"
  301. @blur="drugBlur1($event,scope)"
  302. @keydown.down.native="drugDown($event,scope)"
  303. @keydown.up.native="drugUp($event,scope)"
  304. @keydown.enter.native="drugEnter(scope)"
  305. :disabled="recipe_tabs[recipe_tabs_c].disable"
  306. ></el-input>
  307. <!-- v-model="scope.row.key" -->
  308. <div
  309. class="table-choose3"
  310. v-if="scope.row.key"
  311. :style="medIndex==0?'':{top:(medIndex*35)+'px'}"
  312. >
  313. <div class="table-choose-h flex-vertical-between">
  314. <div class="flex-center">药品名称</div>
  315. <div class="flex-center">规格</div>
  316. <div class="flex-center">产地</div>
  317. <div class="flex-center">单价</div>
  318. <div class="flex-center">库存</div>
  319. </div>
  320. <!-- -->
  321. <div
  322. class="t-c-b infinite-list"
  323. v-infinite-scroll="load"
  324. :infinite-scroll-immediate="false"
  325. :id="'infiniteList'+scope.row.id"
  326. :ref="'infiniteList'+scope.row.id"
  327. style="overflow:auto"
  328. v-if="scope.row.drugList.length>0"
  329. >
  330. <div
  331. class="infinite-list-item flex-vertical-between"
  332. :style="scope.row.search_i===index1?'background: #EDF3FE;':''"
  333. @click="chooseDis1(scope,index1,item1)"
  334. v-for="(item1,index1) in scope.row.drugList"
  335. :key="scope.row.id+'g'+index1"
  336. >
  337. <p class="flex-center">{{item1.ypmc}}</p>
  338. <p class="flex-center">{{item1.gg}}</p>
  339. <p class="flex-center">{{item1.cdmc}}</p>
  340. <p class="flex-center">{{item1.price}}</p>
  341. <p class="flex-center">{{item1.kc}}</p>
  342. </div>
  343. </div>
  344. </div>
  345. </div>
  346. </div>
  347. </template>
  348. </el-table-column>
  349. <el-table-column prop="spec" label="规格" width="100"></el-table-column>
  350. <el-table-column prop="dose" label="剂量" width="40">
  351. <template slot-scope="scope" v-if="scope.row.name">
  352. <div class="t_dose">
  353. <el-input
  354. :value="scope.row.dose==0?'':scope.row.dose"
  355. size="mini"
  356. @blur="doseBlur(scope)"
  357. @focus="doseFocus(scope)"
  358. @input="countDoseMoney($event,scope)"
  359. :id="'dose'+scope.row.id"
  360. :disabled="recipe_tabs[recipe_tabs_c].disable"
  361. :placeholder="scope.row.oldDose?'原'+scope.row.oldDose+'克':''"
  362. @keydown.enter.native="doseEnter(scope)"
  363. ></el-input>
  364. <div
  365. class="dose-section"
  366. :style="{top:scope.$index==0?'':((scope.$index)*35)+'px'}"
  367. v-if="minDose && maxDose && doseId == scope.row.medid"
  368. >
  369. <span>{{minDose}}</span>~
  370. <span>{{maxDose}}</span>
  371. </div>
  372. </div>
  373. </template>
  374. </el-table-column>
  375. <el-table-column prop="unit" label="单位" width="40"></el-table-column>
  376. <!-- <el-table-column prop="inventory" label="库存" width="80">
  377. </el-table-column>-->
  378. <!-- width="80" -->
  379. <el-table-column prop="usage" label="用法">
  380. <template slot-scope="scope" v-if="scope.row.name">
  381. <el-select
  382. v-model="scope.row.usage"
  383. placeholder="请选择"
  384. size="mini"
  385. @change="usageC($event,scope)"
  386. :disabled="recipe_tabs[recipe_tabs_c].disable"
  387. >
  388. <el-option
  389. :label="item.value"
  390. :value="item.key"
  391. v-for="(item,index) in usageList"
  392. :key="scope.row.id+'h'+index"
  393. ></el-option>
  394. </el-select>
  395. </template>
  396. </el-table-column>
  397. <el-table-column prop="price" label="单价" width="50"></el-table-column>
  398. <el-table-column prop="total" label="小计" width="50">
  399. <template slot-scope="scope" v-if="scope.row.name">
  400. <div>{{scope.row.total | formatTotal}}</div>
  401. </template>
  402. </el-table-column>
  403. <el-table-column label="操作" width="64">
  404. <template slot-scope="scope">
  405. <div class="operate" v-if="scope.row.name">
  406. <div>
  407. <img
  408. src="../assets/add.png"
  409. alt
  410. @click="addDis1(scope)"
  411. v-if="!recipe_tabs[recipe_tabs_c].disable"
  412. />
  413. </div>
  414. <div>
  415. <img
  416. src="../assets/delete1.png"
  417. alt
  418. @click="deleteDis1(scope)"
  419. v-if="!recipe_tabs[recipe_tabs_c].disable"
  420. />
  421. </div>
  422. <div>
  423. <img src="../assets/find.png" alt @click="findDrug(scope)" />
  424. </div>
  425. </div>
  426. <div
  427. class="operate"
  428. v-else-if="scope.row.id==recipe_tabs[recipe_tabs_c].totalTableD.length && !scope.row.name"
  429. >
  430. <div style="opacity:0;">
  431. <img src="../assets/find.png" alt />
  432. </div>
  433. </div>
  434. <div v-else class="operate">
  435. <div v-if="scope.row.id!==recipe_tabs[recipe_tabs_c].totalTableD.length">
  436. <img
  437. src="../assets/delete1.png"
  438. alt
  439. @click="deleteDis1(scope)"
  440. v-if="!recipe_tabs[recipe_tabs_c].disable"
  441. />
  442. </div>
  443. </div>
  444. </template>
  445. </el-table-column>
  446. <div slot="empty"></div>
  447. </el-table>
  448. </div>
  449. </div>
  450. <div class="table-left-body">
  451. <div class="table-left" v-if="true">
  452. <el-table
  453. :data="recipe_tabs[recipe_tabs_c].tableData1"
  454. :span-method="arraySpanMethod1"
  455. id="table1"
  456. >
  457. <el-table-column prop="id" label width="20">
  458. <template slot-scope="scope">
  459. <!-- width:110px -->
  460. <!-- v-model="scope.row.key" -->
  461. <div v-if="!scope.row.name" class="flex-vertical-between">
  462. <div style="width:80px;" class="operate2" id="operate2">
  463. <el-input
  464. :value="scope.row.key"
  465. :id="'searchD'+scope.row.id"
  466. size="mini"
  467. placeholder="请输入..."
  468. @input="searchDrug($event,scope)"
  469. @focus="drugFocus(scope)"
  470. @blur="drugBlur($event,scope)"
  471. @keydown.down.native="drugDown($event,scope)"
  472. @keydown.up.native="drugUp($event,scope)"
  473. @keydown.enter.native="drugEnter(scope)"
  474. :disabled="recipe_tabs[recipe_tabs_c].disable"
  475. ></el-input>
  476. <div
  477. class="table-choose3"
  478. v-if="scope.row.key"
  479. :style="medIndex==0?'':{top:(medIndex*35)+'px'}"
  480. >
  481. <div class="table-choose-h flex-vertical-between">
  482. <div class="flex-center">药品名称</div>
  483. <div class="flex-center">规格</div>
  484. <div class="flex-center">产地</div>
  485. <div class="flex-center">单价</div>
  486. <div class="flex-center">库存</div>
  487. </div>
  488. <div
  489. class="t-c-b infinite-list"
  490. v-infinite-scroll="load"
  491. :infinite-scroll-immediate="false"
  492. :id="'infiniteList'+scope.row.id"
  493. :ref="'infiniteList'+scope.row.id"
  494. style="overflow:auto"
  495. >
  496. <div
  497. class="infinite-list-item flex-vertical-between"
  498. :style="scope.row.search_i===index1?'background: #EDF3FE;':''"
  499. @click="chooseDis1(scope,index1,item1)"
  500. v-for="(item1,index1) in scope.row.drugList"
  501. :key="scope.row.id+'f'+index1"
  502. >
  503. <p class="flex-center">{{item1.ypmc}}</p>
  504. <p class="flex-center">{{item1.gg}}</p>
  505. <p class="flex-center">{{item1.cdmc}}</p>
  506. <p class="flex-center">{{item1.price}}</p>
  507. <p class="flex-center">{{item1.kc}}</p>
  508. </div>
  509. </div>
  510. </div>
  511. </div>
  512. <!-- <div class="operate1"
  513. v-if="scope.row.id!==recipe_tabs[recipe_tabs_c].totalTableD.length && !scope.row.name">
  514. <img src="../assets/delete1.png" alt="" @click="deleteDis1(scope)" />
  515. </div>-->
  516. </div>
  517. <!-- -->
  518. <div v-else>{{scope.row.id}}</div>
  519. </template>
  520. </el-table-column>
  521. <el-table-column prop="name" label="药品名称" width="80">
  522. <template slot-scope="scope" v-if="scope.row.name">
  523. <div
  524. @click="clickName(scope)"
  525. v-if="!scope.row.showSearch"
  526. :style="{'color':scope.row.color?scope.row.color:''}"
  527. >{{scope.row.name}}</div>
  528. <div v-else class="flex-vertical-between">
  529. <div style="width:110px;">
  530. <el-input
  531. :value="scope.row.key"
  532. :id="'searchD'+scope.row.id"
  533. size="mini"
  534. :placeholder="scope.row.name"
  535. @input="searchDrug($event,scope)"
  536. @blur="drugBlur1($event,scope)"
  537. @keydown.down.native="drugDown($event,scope)"
  538. @keydown.up.native="drugUp($event,scope)"
  539. @keydown.enter.native="drugEnter(scope)"
  540. :disabled="recipe_tabs[recipe_tabs_c].disable"
  541. ></el-input>
  542. <!-- v-model="scope.row.key" -->
  543. <div
  544. class="table-choose3"
  545. v-if="scope.row.key"
  546. :style="medIndex==0?'':{top:(medIndex*35)+'px'}"
  547. >
  548. <div class="table-choose-h flex-vertical-between">
  549. <div class="flex-center">药品名称</div>
  550. <div class="flex-center">规格</div>
  551. <div class="flex-center">产地</div>
  552. <div class="flex-center">单价</div>
  553. <div class="flex-center">库存</div>
  554. </div>
  555. <!-- -->
  556. <div
  557. class="t-c-b infinite-list"
  558. v-infinite-scroll="load"
  559. :infinite-scroll-immediate="false"
  560. :id="'infiniteList'+scope.row.id"
  561. :ref="'infiniteList'+scope.row.id"
  562. style="overflow:auto"
  563. v-if="scope.row.drugList.length>0"
  564. >
  565. <div
  566. class="infinite-list-item flex-vertical-between"
  567. :style="scope.row.search_i===index1?'background: #EDF3FE':''"
  568. @click="chooseDis1(scope,index1,item1)"
  569. v-for="(item1,index1) in scope.row.drugList"
  570. :key="scope.row.id+'g'+index1"
  571. >
  572. <p class="flex-center">{{item1.ypmc}}</p>
  573. <p class="flex-center">{{item1.gg}}</p>
  574. <p class="flex-center">{{item1.cdmc}}</p>
  575. <p class="flex-center">{{item1.price}}</p>
  576. <p class="flex-center">{{item1.kc}}</p>
  577. </div>
  578. </div>
  579. </div>
  580. </div>
  581. </div>
  582. </template>
  583. </el-table-column>
  584. <!-- fixed="left" -->
  585. <el-table-column prop="spec" label="规格" width="100"></el-table-column>
  586. <el-table-column prop="dose" label="剂量" width="40">
  587. <template slot-scope="scope" v-if="scope.row.name">
  588. <div class="t_dose">
  589. <el-input
  590. :value="scope.row.dose==0?'':scope.row.dose"
  591. size="mini"
  592. @blur="doseBlur(scope)"
  593. @focus="doseFocus(scope)"
  594. @input="countDoseMoney($event,scope)"
  595. :id="'dose'+scope.row.id"
  596. :disabled="recipe_tabs[recipe_tabs_c].disable"
  597. :placeholder="scope.row.oldDose?'原'+scope.row.oldDose+'克':''"
  598. @keydown.enter.native="doseEnter(scope)"
  599. ></el-input>
  600. <div
  601. class="dose-section"
  602. :style="{top:scope.$index==0?'':((scope.$index)*35)+'px'}"
  603. v-if="minDose && maxDose && doseId == scope.row.medid"
  604. >
  605. <span>{{minDose}}</span>~
  606. <span>{{maxDose}}</span>
  607. </div>
  608. </div>
  609. </template>
  610. </el-table-column>
  611. <el-table-column prop="unit" label="单位" width="40"></el-table-column>
  612. <!-- <el-table-column prop="inventory" label="库存" width="80">
  613. </el-table-column>-->
  614. <el-table-column prop="usage" label="用法">
  615. <template slot-scope="scope" v-if="scope.row.name">
  616. <el-select
  617. v-model="scope.row.usage"
  618. placeholder="请选择"
  619. size="mini"
  620. @change="usageC($event,scope)"
  621. :disabled="recipe_tabs[recipe_tabs_c].disable"
  622. >
  623. <el-option
  624. :label="item.value"
  625. :value="item.key"
  626. v-for="(item,index) in scope.row.usageList"
  627. :key="scope.row.id+'h'+index"
  628. ></el-option>
  629. </el-select>
  630. </template>
  631. </el-table-column>
  632. <el-table-column prop="price" label="单价" width="50"></el-table-column>
  633. <el-table-column prop="total" label="小计" width="50">
  634. <template slot-scope="scope" v-if="scope.row.name">
  635. <div>{{scope.row.total | formatTotal}}</div>
  636. </template>
  637. </el-table-column>
  638. <el-table-column label="操作" width="64">
  639. <template slot-scope="scope">
  640. <div class="operate" v-if="scope.row.name">
  641. <div>
  642. <img
  643. src="../assets/add.png"
  644. alt
  645. @click="addDis1(scope)"
  646. v-if="!recipe_tabs[recipe_tabs_c].disable"
  647. />
  648. </div>
  649. <div>
  650. <img
  651. src="../assets/delete1.png"
  652. alt
  653. @click="deleteDis1(scope)"
  654. v-if="!recipe_tabs[recipe_tabs_c].disable"
  655. />
  656. </div>
  657. <div>
  658. <img src="../assets/find.png" alt @click="findDrug(scope)" />
  659. </div>
  660. </div>
  661. <div
  662. class="operate"
  663. v-else-if="scope.row.id==recipe_tabs[recipe_tabs_c].totalTableD.length && !scope.row.name"
  664. >
  665. <div style="opacity:0;">
  666. <img src="../assets/find.png" alt />
  667. </div>
  668. </div>
  669. <div v-else class="operate">
  670. <div v-if="scope.row.id!==recipe_tabs[recipe_tabs_c].totalTableD.length">
  671. <img
  672. src="../assets/delete1.png"
  673. alt
  674. @click="deleteDis1(scope)"
  675. v-if="!recipe_tabs[recipe_tabs_c].disable"
  676. />
  677. </div>
  678. </div>
  679. </template>
  680. </el-table-column>
  681. <div slot="empty"></div>
  682. </el-table>
  683. </div>
  684. </div>
  685. </div>
  686. <!-- 底部处方 -->
  687. <div class="table-bottom">
  688. <div class="table-b-header">
  689. <div class="flex-vertical-center-l header-about flex-wrap" v-if="container_i==0">
  690. <div class="item flex-vertical-center-l">
  691. <span>剂数:</span>
  692. <div class="div1">
  693. <el-input
  694. size="mini"
  695. placeholder="剂数"
  696. v-model="recipe_tabs[recipe_tabs_c].bottom_form.doseNum"
  697. @change="doseNumC()"
  698. ></el-input>
  699. </div>
  700. </div>
  701. <div class="item flex-vertical-center-l">
  702. <span>剂型:</span>
  703. <div class="div2">
  704. <!-- :disabled="recipe_tabs[recipe_tabs_c].disable" -->
  705. <el-select
  706. size="mini"
  707. @change="countNowRecipeMoney()"
  708. v-model="recipe_tabs[recipe_tabs_c].bottom_form.doseType"
  709. placeholder="请选择"
  710. >
  711. <el-option
  712. :label="item.value"
  713. :value="item.key"
  714. v-for="(item,index) in recipe_tabs[recipe_tabs_c].bottom_form.doseTypeList"
  715. :key="'i'+index"
  716. ></el-option>
  717. <!-- for 有问题 -->
  718. </el-select>
  719. </div>
  720. </div>
  721. <div class="item flex-vertical-center-l">
  722. <span>处方用法:</span>
  723. <div class="div2">
  724. <!-- :disabled="recipe_tabs[recipe_tabs_c].disable" -->
  725. <el-select
  726. size="mini"
  727. v-model="recipe_tabs[recipe_tabs_c].bottom_form.usege"
  728. placeholder="请选择"
  729. >
  730. <el-option
  731. :label="item.value"
  732. :value="item.key"
  733. v-for="(item,index) in recipe_tabs[recipe_tabs_c].bottom_form.usegeList"
  734. :key="'j'+index"
  735. ></el-option>
  736. </el-select>
  737. </div>
  738. </div>
  739. <div
  740. class="item flex-vertical-center-l"
  741. v-if="recipe_tabs[recipe_tabs_c].bottom_form.doseType=='0'"
  742. >
  743. <span>浓煎每次:</span>
  744. <!--浓煎-->
  745. <div class="div2" style="width:70px;">
  746. <!-- :disabled="recipe_tabs[recipe_tabs_c].disable" -->
  747. <el-select
  748. size="mini"
  749. v-model="recipe_tabs[recipe_tabs_c].bottom_form.nongjian"
  750. placeholder="请选择"
  751. >
  752. <el-option label="50ml" value="50"></el-option>
  753. <el-option label="100ml" value="100"></el-option>
  754. <el-option label="150ml" value="150"></el-option>
  755. <el-option label="200ml" value="200"></el-option>
  756. <el-option label="250ml" value="250"></el-option>
  757. <el-option label="300ml" value="300"></el-option>
  758. <el-option label="400ml" value="400"></el-option>
  759. <el-option label="500ml" value="500"></el-option>
  760. <el-option label="1000ml" value="1000"></el-option>
  761. </el-select>
  762. </div>
  763. </div>
  764. <!-- <div class="item flex-vertical-center-l" v-if="recipe_tabs[recipe_tabs_c].bottom_form.doseType=='1'">
  765. <span>代煎:</span>
  766. <div class="div1" style="width:50px;">
  767. <el-input size="mini" placeholder="剂数" @blur="countNowRecipeMoney"
  768. v-model="recipe_tabs[recipe_tabs_c].bottom_form.daijian">
  769. <div slot="suffix" class="input-suffix">剂</div>
  770. </el-input>
  771. </div>
  772. </div>-->
  773. <div class="item flex-vertical-center-l">
  774. <span>频次:</span>
  775. <div class="div3" style="width:80px;">
  776. <!-- :disabled="recipe_tabs[recipe_tabs_c].disable" -->
  777. <el-select
  778. size="mini"
  779. v-model="recipe_tabs[recipe_tabs_c].bottom_form.num"
  780. placeholder="请选择"
  781. >
  782. <el-option
  783. :label="item.value"
  784. :value="item.key"
  785. v-for="(item,index) in recipe_tabs[recipe_tabs_c].bottom_form.numList"
  786. :key="'l'+index"
  787. ></el-option>
  788. </el-select>
  789. </div>
  790. </div>
  791. <div
  792. class="item flex-vertical-center-l"
  793. v-if="recipe_tabs[recipe_tabs_c].bottom_form.usege=='0' || recipe_tabs[recipe_tabs_c].bottom_form.usege=='2' ||recipe_tabs[recipe_tabs_c].bottom_form.usege=='1'"
  794. >
  795. <!-- <span>服药时间:</span> -->
  796. <div class="div3">
  797. <!-- :disabled="recipe_tabs[recipe_tabs_c].disable" -->
  798. <el-select
  799. size="mini"
  800. v-model="recipe_tabs[recipe_tabs_c].bottom_form.time"
  801. placeholder="请选择"
  802. >
  803. <el-option
  804. :label="item.value"
  805. :value="item.key"
  806. v-for="(item,index) in recipe_tabs[recipe_tabs_c].bottom_form.timeList"
  807. :key="'k'+index"
  808. ></el-option>
  809. </el-select>
  810. </div>
  811. </div>
  812. </div>
  813. <div v-if="recipe_tabs[recipe_tabs_c].bottom_form.usege=='5'" class="header-about">
  814. <div class="item flex-vertical-center-l">
  815. <span>操作指南:</span>
  816. <div style="flex:1;">
  817. <el-input
  818. size="mini"
  819. placeholder="请输入"
  820. v-model="recipe_tabs[recipe_tabs_c].bottom_form.caozuo"
  821. ></el-input>
  822. </div>
  823. </div>
  824. </div>
  825. <div class="flex-vertical-center-l header-about flex-wrap" v-if="container_i==2">
  826. <div class="item flex-vertical-center-l">
  827. <span>类型:</span>
  828. <div class="div2">
  829. <el-select
  830. size="mini"
  831. v-model="recipe_tabs[recipe_tabs_c].bottom_form.doseType1"
  832. placeholder="请选择"
  833. >
  834. <el-option label="针刺" value="zc"></el-option>
  835. <el-option label="汤药" value="ty"></el-option>
  836. </el-select>
  837. </div>
  838. </div>
  839. <div class="item flex-vertical-center-l">
  840. <span>次数:</span>
  841. <div class="div1">
  842. <el-input
  843. size="mini"
  844. placeholder="请输入次数"
  845. v-model="recipe_tabs[recipe_tabs_c].bottom_form.doseNum1"
  846. ></el-input>
  847. </div>
  848. </div>
  849. </div>
  850. <div class="header-about">
  851. <div class="item flex-vertical-center-l">
  852. <span>嘱托:</span>
  853. <div style="flex:1;">
  854. <el-input
  855. size="mini"
  856. placeholder="请输入"
  857. v-model="recipe_tabs[recipe_tabs_c].bottom_form.zhutuo"
  858. ></el-input>
  859. </div>
  860. </div>
  861. </div>
  862. </div>
  863. </div>
  864. </div>
  865. </div>
  866. <!-- 留在这个页面 -->
  867. <div class="table-b-bottom flex-vertical-between">
  868. <div class="t-b-b-left flex-vertical-center-l flex-wrap">
  869. <div class="t-b-l-item">
  870. <!-- 单击金额 *数 -->
  871. 当前处方金额:
  872. <span>{{recipe_tabs[recipe_tabs_c].bottom_form.nowRecipeMoney1}}元</span>
  873. </div>
  874. <div class="t-b-l-item" v-if="container_i==0">
  875. 单剂金额:
  876. <span>{{recipe_tabs[recipe_tabs_c].bottom_form.nowRecipeMoney | formatTotal}}元</span>
  877. </div>
  878. <div
  879. class="t-b-l-item"
  880. v-if="recipe_tabs[recipe_tabs_c].bottom_form.isDaiJian==1&&recipe_tabs[recipe_tabs_c].bottom_form.daijian && recipe_tabs[recipe_tabs_c]. bottom_form.doseType=='0'"
  881. >
  882. 代煎费:
  883. <span>{{recipe_tabs[recipe_tabs_c].bottom_form.moneyMsg.agencyPrice?recipe_tabs[recipe_tabs_c].bottom_form.moneyMsg.agencyPrice*Number(recipe_tabs[recipe_tabs_c].bottom_form.daijian):0}}元</span>
  884. </div>
  885. <div class="t-b-l-item" v-if="recipe_tabs[recipe_tabs_c].bottom_form.radio==0">
  886. 配送费:
  887. <span>{{recipe_tabs[recipe_tabs_c].bottom_form.moneyMsg.deliveryPrice}}元</span>
  888. </div>
  889. <div class="t-b-l-item" v-if="recipe_tabs[recipe_tabs_c].bottom_form.doseType=='1'">
  890. 制膏费:
  891. <span>{{recipe_tabs[recipe_tabs_c].bottom_form.moneyMsg.systemOfCreamPrice}}元</span>
  892. </div>
  893. <div
  894. class="t-b-l-item"
  895. v-if="recipe_tabs[recipe_tabs_c].bottom_form.doseType=='2' || recipe_tabs[recipe_tabs_c].bottom_form.doseType=='3'"
  896. >
  897. 特殊调配费:
  898. <span>{{recipe_tabs[recipe_tabs_c].bottom_form.moneyMsg.specialDeploymentPrice?recipe_tabs[recipe_tabs_c].bottom_form.moneyMsg.specialDeploymentPrice*Number(recipe_tabs[recipe_tabs_c].bottom_form.doseNum):0}}元</span>
  899. </div>
  900. <div class="t-b-l-item">
  901. 合计费用:
  902. <span>{{recipe_tabs[recipe_tabs_c].bottom_form.allMoney}}元</span>
  903. <!-- 合计费用:<span>{{totalAllMoney.toFixed(4)}}元</span> -->
  904. </div>
  905. </div>
  906. <div class="t-b-b-right flex-vertical-center-r">
  907. <!-- $router.push({path:'/index/accordedit'}) -->
  908. <!-- <div class="flex-center" v-if="!recipe_tabs[recipe_tabs_c].bottom_form.disable" @click="saveToMine">
  909. 存为我的协定方
  910. </div>-->
  911. <!-- <div class="flex-center bg-green" v-if="showSubmit" @click="submit()">提交处方</div> -->
  912. <el-button
  913. type="warning"
  914. size="mini"
  915. v-if="!recipe_tabs[recipe_tabs_c].bottom_form.disable"
  916. @click="saveToMine"
  917. >存为我的协定方</el-button>
  918. <!-- showSubmit -->
  919. <!-- <template v-if="isAutoCheck==0">
  920. <el-button
  921. type="primary"
  922. size="mini"
  923. v-if="recipe_tabs[recipe_tabs_c].prescribed==0 || !recipe_tabs[recipe_tabs_c].prescribed"
  924. @click="submit"
  925. >保存处方</el-button>
  926. </template>-->
  927. <!-- v-if="isAutoCheck==1" -->
  928. <template>
  929. <el-button
  930. type="primary"
  931. size="mini"
  932. v-if="recipe_tabs[recipe_tabs_c].paystate==0 || !recipe_tabs[recipe_tabs_c].paystate"
  933. @click="submit"
  934. >保存处方</el-button>
  935. </template>
  936. </div>
  937. </div>
  938. <popup
  939. :showDialog="showDialog"
  940. distanceTop="4vh"
  941. @cancle="showDialog=false"
  942. @confim="submitAgree()"
  943. title="存为我的协定方"
  944. width="70%"
  945. >
  946. <div slot="body">
  947. <accordEdit :showBtn="false" ref="accordEdit" @success="agreeSccess"></accordEdit>
  948. </div>
  949. </popup>
  950. </div>
  951. </template>
  952. <script>
  953. import { addAccordData, getAccordShareList } from "@/api/business.js";
  954. import { getDataByKey } from "@/api/system.js";
  955. import accordEdit from "@/views/business/AccordEdit.vue";
  956. import { getRationalMed, getRationalMedForPlat } from "@/api/knowledge";
  957. import {
  958. getProver,
  959. getArea,
  960. getSelectType,
  961. getPharmacyMsg,
  962. getPatAddress
  963. } from "@/api/city.js";
  964. import {
  965. getTableDrug,
  966. getAddressForHospital,
  967. getPharmacyID,
  968. changePharmacy,
  969. customerQuery,
  970. getPharmacyIDS
  971. } from "@/api/diagnosis.js";
  972. import { debounce } from "@/utils/format.js";
  973. import { mapState, mapGetters, mapActions, mapMutations } from "vuex";
  974. import popup from "@/components/Propup.vue";
  975. import accompanied from "./ui/accompanied.vue";
  976. export default {
  977. components: {
  978. popup,
  979. accordEdit,
  980. accompanied
  981. },
  982. props: {
  983. isShrink: {
  984. type: Boolean,
  985. default: false
  986. },
  987. container_i: {
  988. type: Number,
  989. default: 0
  990. },
  991. showSubmit: {
  992. type: Boolean,
  993. default: true
  994. },
  995. isDaiJian: {
  996. type: Number,
  997. default: 1
  998. },
  999. isPs: {
  1000. type: Number,
  1001. default: 1
  1002. }
  1003. // totalAllMoney: Number,
  1004. },
  1005. data() {
  1006. return {
  1007. totalAllMoney: 0,
  1008. preData: [],
  1009. showDialog: false,
  1010. shareSelect: [], // 共享至选择器数据
  1011. share: "",
  1012. name: "中药处方",
  1013. recipe_tabs: [
  1014. {
  1015. isMyMade: true,
  1016. disable: false,
  1017. name: "处方1",
  1018. pharmacyID: "", // 药房id
  1019. isPay: false, // 是否支付
  1020. prescribed: 0, // 是否开方 0 否 1是
  1021. paystate: 0, // 云his 是否支付 0 否 1是(为否可以编辑)
  1022. totalTableD: [
  1023. {
  1024. id: 1,
  1025. key: "",
  1026. drugList: [],
  1027. page: 1,
  1028. loadMore: true,
  1029. usageList: [],
  1030. search_i: 0,
  1031. showSearch: false
  1032. }
  1033. ],
  1034. tableData: [
  1035. {
  1036. id: 1,
  1037. key: "",
  1038. drugList: [],
  1039. page: 1,
  1040. loadMore: true,
  1041. usageList: [],
  1042. search_i: 0,
  1043. showSearch: false
  1044. }
  1045. ],
  1046. radio: "1",
  1047. lastType: "1", // 上一次的 药房类型
  1048. tableData1: [],
  1049. bottom_form: {
  1050. preType: "", // 协定方的时候 切换 中药类型带入
  1051. disable: false, // 协定方 配方转方 为 true
  1052. doseNum: "",
  1053. doseType: "",
  1054. doseTypeList: [],
  1055. usegeList: [],
  1056. usege: "",
  1057. num: "",
  1058. numList: [], // 频次后台数据
  1059. daijian: "",
  1060. nongjian: "200",
  1061. time: "",
  1062. timeList: [], // 服药时间后台数据
  1063. caozuo: "",
  1064. zhutuo: "",
  1065. radio: 1,
  1066. isDaiJian: 2,
  1067. provinceList: [],
  1068. cityList: [],
  1069. areaList: [],
  1070. province: "",
  1071. city: "",
  1072. area: "",
  1073. address: "",
  1074. phone: "",
  1075. doseType1: "zc",
  1076. doseNum1: "",
  1077. savename: "",
  1078. nowRecipeMoney: 0, //单剂金额
  1079. nowRecipeMoney1: 0, //当前处方金额
  1080. allMoney: 0, // 合计金额
  1081. moneyMsg: {} // 价格数据
  1082. }
  1083. }
  1084. ], // 处方 tabs
  1085. recipe_tabs_c: 0, // 处方 tabs 下标
  1086. index: 0, // 全局index 下拉加载时使用
  1087. provinceList1: [], // 全局省列表 赋值用
  1088. countWay: "1", // 计算方式
  1089. isAutoCheck: "0", // 是否自动审核 0 手动 1自动 (自动的时候用his 的是否支付成功字段 判断显示)
  1090. pharmacyList: [], // 药房选择器 数据
  1091. pharmacyTypes: [],
  1092. clickPid: "", // 点击的药品id
  1093. maxDose: null,
  1094. minDose: null,
  1095. doseId: "", // 要展示的 剂量id
  1096. medIndex: 0, // 点击的 药品下标
  1097. usageList: [] // 用法列表
  1098. };
  1099. },
  1100. created() {
  1101. // setTimeout(() => {
  1102. // this.getDataByKey()
  1103. // }, 200);
  1104. // this.getAccordShareList()
  1105. // this.getPharmacyID()
  1106. // this.getTableDrug('', 1, 0)
  1107. this.customerQuery();
  1108. // this._getPharmacyIDS();
  1109. this.getProver();
  1110. this.getSelectType("中药药品用法", 0);
  1111. this.getSelectType("剂型", 0);
  1112. this.getSelectType("处方用法");
  1113. this.getSelectType("中药服药时间");
  1114. this.getSelectType("中药频次");
  1115. },
  1116. mounted() {},
  1117. methods: {
  1118. // 打开父级安全合理用药监测
  1119. openSafeDrug() {
  1120. this.$parent.opensafeD();
  1121. },
  1122. getRadioName(val) {
  1123. if (val == 1) {
  1124. return "散装饮片";
  1125. }
  1126. if (val == 2) {
  1127. return "散装颗粒";
  1128. }
  1129. if (val == 3) {
  1130. return "小包装饮片";
  1131. }
  1132. if (val == 4) {
  1133. return "小包装颗粒";
  1134. }
  1135. if (val == 5) {
  1136. return "膏方";
  1137. }
  1138. if (val == 6) {
  1139. return "中药制剂";
  1140. }
  1141. },
  1142. // 配送点击
  1143. changePeiSong() {
  1144. this.recipe_tabs[this.recipe_tabs_c].bottom_form.radio =
  1145. this.recipe_tabs[this.recipe_tabs_c].bottom_form.radio == 1 ? 0 : 1;
  1146. this.countNowRecipeMoney();
  1147. this.getaddress(this.recipe_tabs[this.recipe_tabs_c].bottom_form.radio);
  1148. },
  1149. // 代煎选项点击
  1150. changeDaijian() {
  1151. this.recipe_tabs[this.recipe_tabs_c].bottom_form.isDaiJian =
  1152. this.recipe_tabs[this.recipe_tabs_c].bottom_form.isDaiJian == 1 ? 0 : 1;
  1153. if (this.recipe_tabs[this.recipe_tabs_c].bottom_form.isDaiJian == 0) {
  1154. this.recipe_tabs[this.recipe_tabs_c].bottom_form.daijian = "";
  1155. } else {
  1156. this.recipe_tabs[
  1157. this.recipe_tabs_c
  1158. ].bottom_form.daijian = this.recipe_tabs[
  1159. this.recipe_tabs_c
  1160. ].bottom_form.doseNum;
  1161. }
  1162. this.countNowRecipeMoney();
  1163. },
  1164. // 是否配送
  1165. getaddress(e) {
  1166. if (e == 1) {
  1167. this.recipe_tabs[this.recipe_tabs_c].bottom_form.address = "";
  1168. this.recipe_tabs[this.recipe_tabs_c].bottom_form.savename = "";
  1169. this.recipe_tabs[this.recipe_tabs_c].bottom_form.phone = "";
  1170. this.recipe_tabs[this.recipe_tabs_c].bottom_form.province = "";
  1171. this.recipe_tabs[this.recipe_tabs_c].bottom_form.city = "";
  1172. this.recipe_tabs[this.recipe_tabs_c].bottom_form.area = "";
  1173. } else {
  1174. this.getPatAddress();
  1175. }
  1176. this.countNowRecipeMoney();
  1177. },
  1178. scroll(e) {
  1179. // console.log("滚动", e);
  1180. },
  1181. // 监听键盘事件
  1182. drugDown(e, scope) {
  1183. let index = scope.row.id ? scope.row.id - 1 : 0;
  1184. let totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
  1185. // 如果到最后一个 判断是否需要分页
  1186. if (totalData[index].search_i == totalData[index].drugList.length - 1) {
  1187. // totalData[scope.$index].search_i
  1188. if (totalData[index].loadMore) {
  1189. totalData[index].page += 1;
  1190. this.getTableDrug(
  1191. totalData[index].key,
  1192. totalData[index].page,
  1193. index,
  1194. totalData[index].loadMore
  1195. );
  1196. totalData[index].search_i += 1;
  1197. }
  1198. } else {
  1199. totalData[index].search_i += 1;
  1200. }
  1201. // 表格 fixed 时 去 下标 为 1
  1202. if (totalData[index].drugList.length > 5) {
  1203. document.querySelectorAll(
  1204. `#infiniteList${scope.row.id}`
  1205. )[1].scrollTop += 36;
  1206. console.log(
  1207. document.querySelectorAll(`#infiniteList${scope.row.id}`)[1]
  1208. .scrollTop,
  1209. "top"
  1210. );
  1211. }
  1212. this.recipe_tabs[this.recipe_tabs_c].totalTableD = totalData;
  1213. totalData.filter((item, index) => {
  1214. // this.getSelectType('中药药品用法', index)
  1215. return (item.id = index + 1);
  1216. });
  1217. this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
  1218. (item, index) => {
  1219. return item.id % 2 != 0;
  1220. }
  1221. );
  1222. this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
  1223. (item, index) => {
  1224. return item.id % 2 == 0;
  1225. }
  1226. );
  1227. this.$forceUpdate();
  1228. },
  1229. drugUp(e, scope) {
  1230. let index = scope.row.id ? scope.row.id - 1 : 0;
  1231. let totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
  1232. // 如果到最后一个 判断是否需要分页
  1233. if (totalData[index].search_i == 0) {
  1234. // totalData[scope.$index].search_i
  1235. } else {
  1236. totalData[index].search_i -= 1;
  1237. }
  1238. if (
  1239. document.querySelectorAll(`#infiniteList${scope.row.id}`)[1].scrollTop >
  1240. 0
  1241. ) {
  1242. document.querySelectorAll(
  1243. `#infiniteList${scope.row.id}`
  1244. )[1].scrollTop -= 36;
  1245. }
  1246. this.recipe_tabs[this.recipe_tabs_c].totalTableD = totalData;
  1247. totalData.filter((item, index) => {
  1248. // this.getSelectType('中药药品用法', index)
  1249. return (item.id = index + 1);
  1250. });
  1251. this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
  1252. (item, index) => {
  1253. return item.id % 2 != 0;
  1254. }
  1255. );
  1256. this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
  1257. (item, index) => {
  1258. return item.id % 2 == 0;
  1259. }
  1260. );
  1261. },
  1262. drugEnter(scope) {
  1263. this.chooseDis1(
  1264. scope,
  1265. scope.row.search_i,
  1266. scope.row.drugList[scope.row.search_i]
  1267. );
  1268. },
  1269. usageC(e, scope) {
  1270. let index = scope.row.id ? scope.row.id - 1 : 0;
  1271. let totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
  1272. this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].usage = e;
  1273. this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
  1274. (item, index) => {
  1275. return item.id % 2 != 0;
  1276. }
  1277. );
  1278. this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
  1279. (item, index) => {
  1280. return item.id % 2 == 0;
  1281. }
  1282. );
  1283. },
  1284. doseFocus(scope) {
  1285. let width = window.innerWidth;
  1286. if (width > 800) {
  1287. if (scope.row.id % 2 == 0) {
  1288. document.getElementsByClassName(
  1289. "el-table__body-wrapper"
  1290. )[1].style.overflow = "hidden";
  1291. } else {
  1292. document.getElementsByClassName(
  1293. "el-table__body-wrapper"
  1294. )[0].style.overflow = "hidden";
  1295. }
  1296. }
  1297. if (scope.row.medid.indexOf("-") != -1) {
  1298. this._getRationalMed(scope.row.medid);
  1299. } else {
  1300. this._getRationalMedForPlat(scope.row.medid);
  1301. }
  1302. this.countDoseMoney(scope.row.dose || 0, scope);
  1303. },
  1304. doseBlur(scope) {
  1305. let parent = this.$parent;
  1306. if (scope.row.dose === "") {
  1307. this.$message.error("请输入剂量");
  1308. parent.rationalMed10.forEach(item => {
  1309. if (item.reqID == scope.row.medid) {
  1310. item.showDose = false;
  1311. }
  1312. });
  1313. parent.countDose();
  1314. this.maxDose = null;
  1315. this.minDose = null;
  1316. this.doseId = "";
  1317. return;
  1318. }
  1319. let unit = scope.row.unit;
  1320. let dose = Number(scope.row.dose);
  1321. if (unit != "g" && unit != "克" && !Number.isInteger(dose)) {
  1322. this.$message.error("剂量输入有误");
  1323. parent.countDose();
  1324. this.maxDose = null;
  1325. this.minDose = null;
  1326. this.doseId = "";
  1327. console.log(
  1328. document.querySelectorAll("#dose" + scope.row.id)[0],
  1329. "dayin "
  1330. );
  1331. document.querySelectorAll("#dose" + scope.row.id)[0].style.border =
  1332. "1px solid red";
  1333. document.querySelectorAll("#dose" + scope.row.id)[0].style.color =
  1334. "red";
  1335. return;
  1336. }
  1337. if (
  1338. Number(scope.row.dose) > Number(this.maxDose) ||
  1339. Number(scope.row.dose) < Number(this.minDose)
  1340. ) {
  1341. parent.rationalMed10.forEach(item => {
  1342. if (item.reqID == scope.row.medid) {
  1343. item.showDose = true;
  1344. }
  1345. });
  1346. }
  1347. if (
  1348. Number(scope.row.dose) <= Number(this.maxDose) &&
  1349. Number(scope.row.dose) >= Number(this.minDose)
  1350. ) {
  1351. parent.rationalMed10.forEach(item => {
  1352. if (item.reqID == scope.row.medid) {
  1353. item.showDose = false;
  1354. }
  1355. });
  1356. }
  1357. parent.countDose();
  1358. this.maxDose = null;
  1359. this.minDose = null;
  1360. this.doseId = "";
  1361. },
  1362. doseEnter(scope) {
  1363. if (
  1364. scope.row.id ==
  1365. this.recipe_tabs[this.recipe_tabs_c].totalTableD.length - 1
  1366. ) {
  1367. // console.log(document.querySelectorAll('#searchD' + (scope.row.id + 1)), '啦啦啦')
  1368. document.querySelectorAll("#searchD" + (scope.row.id + 1))[0].focus();
  1369. } else {
  1370. try {
  1371. this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
  1372. if (item.name && !item.dose && scope.row.id < item.id) {
  1373. document.querySelectorAll("#dose" + item.id)[0].focus();
  1374. throw Error();
  1375. }
  1376. if (!item.name) {
  1377. // console.log(document.querySelectorAll('#searchD' + item.id), '啦啦啦')
  1378. document.querySelectorAll("#searchD" + item.id)[0].focus();
  1379. throw Error();
  1380. }
  1381. });
  1382. } catch (error) {}
  1383. }
  1384. },
  1385. // 修改剂数
  1386. doseNumC() {
  1387. let doseNum = this.recipe_tabs[this.recipe_tabs_c].bottom_form.doseNum;
  1388. var regu = /^[1-9]\d*$/;
  1389. if (!regu.test(Number(doseNum))) {
  1390. this.recipe_tabs[this.recipe_tabs_c].bottom_form.doseNum = 1;
  1391. doseNum = 1;
  1392. }
  1393. if (this.recipe_tabs[this.recipe_tabs_c].bottom_form.isDaiJian == 1) {
  1394. this.recipe_tabs[this.recipe_tabs_c].bottom_form.daijian = doseNum;
  1395. }
  1396. this.countNowRecipeMoney();
  1397. },
  1398. // 计算中药处方总金额
  1399. countMdAllMoney() {
  1400. let totalAllMoney = 0;
  1401. this.recipe_tabs.forEach(item => {
  1402. totalAllMoney += Number(item.bottom_form.allMoney);
  1403. });
  1404. // this.totalAllMoney = totalAllMoney;
  1405. this.$emit("update:totalAllMoney", totalAllMoney);
  1406. },
  1407. // 计算当前处方金额
  1408. countNowRecipeMoney() {
  1409. let data = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
  1410. let total = 0;
  1411. data.forEach(item => {
  1412. if (item.total) {
  1413. total += Number(item.total);
  1414. }
  1415. });
  1416. // console.log(total, '几家总额');
  1417. this.recipe_tabs[this.recipe_tabs_c].bottom_form.nowRecipeMoney = total;
  1418. let doseNum =
  1419. this.recipe_tabs[this.recipe_tabs_c].bottom_form.doseNum || 1;
  1420. // 计算当前处方金额
  1421. if (doseNum) {
  1422. if (this.countWay == "1") {
  1423. this.recipe_tabs[this.recipe_tabs_c].bottom_form.nowRecipeMoney1 = (
  1424. total * Number(doseNum)
  1425. ).toFixed(2);
  1426. total = (total * Number(doseNum)).toFixed(2);
  1427. } else {
  1428. this.recipe_tabs[this.recipe_tabs_c].bottom_form.nowRecipeMoney1 = (
  1429. total * Number(doseNum)
  1430. ).toFixed(3); // 3
  1431. total = (total * Number(doseNum)).toFixed(3); // 3
  1432. }
  1433. } else {
  1434. this.recipe_tabs[this.recipe_tabs_c].bottom_form.nowRecipeMoney1 = 0;
  1435. }
  1436. // 膏剂类型
  1437. let doseType = this.recipe_tabs[this.recipe_tabs_c].bottom_form.doseType;
  1438. // 是否配送
  1439. let isDelivery = this.recipe_tabs[this.recipe_tabs_c].bottom_form.radio;
  1440. // 制膏费
  1441. let systemOfCreamPrice =
  1442. doseType == "1"
  1443. ? this.recipe_tabs[this.recipe_tabs_c].bottom_form.moneyMsg
  1444. .systemOfCreamPrice
  1445. ? this.recipe_tabs[this.recipe_tabs_c].bottom_form.moneyMsg
  1446. .systemOfCreamPrice
  1447. : 0
  1448. : 0;
  1449. // 代煎费
  1450. let agencyPrice = 0;
  1451. if (
  1452. doseType == "0" &&
  1453. this.recipe_tabs[this.recipe_tabs_c].bottom_form.isDaiJian == 1
  1454. ) {
  1455. agencyPrice = this.recipe_tabs[this.recipe_tabs_c].bottom_form.daijian
  1456. ? this.recipe_tabs[this.recipe_tabs_c].bottom_form.moneyMsg
  1457. .agencyPrice *
  1458. Number(this.recipe_tabs[this.recipe_tabs_c].bottom_form.daijian)
  1459. : 0;
  1460. }
  1461. // 特殊调配费
  1462. let specialDeploymentPrice =
  1463. doseType == "2" || doseType == "3"
  1464. ? this.recipe_tabs[this.recipe_tabs_c].bottom_form.moneyMsg
  1465. .specialDeploymentPrice
  1466. : 0;
  1467. //配送费
  1468. let deliveryPrice =
  1469. isDelivery == 0
  1470. ? this.recipe_tabs[this.recipe_tabs_c].bottom_form.moneyMsg
  1471. .deliveryPrice || 0
  1472. : 0;
  1473. this.recipe_tabs[this.recipe_tabs_c].bottom_form.allMoney =
  1474. Number(Number(total).toFixed(2)) + //3
  1475. Number(systemOfCreamPrice) +
  1476. Number(agencyPrice) +
  1477. Number(specialDeploymentPrice) +
  1478. Number(deliveryPrice);
  1479. this.recipe_tabs[
  1480. this.recipe_tabs_c
  1481. ].bottom_form.allMoney = this.recipe_tabs[
  1482. this.recipe_tabs_c
  1483. ].bottom_form.allMoney.toFixed(2);
  1484. this.countMdAllMoney();
  1485. },
  1486. // 清空处方
  1487. clearRecipe() {
  1488. let paystate = this.recipe_tabs[this.recipe_tabs_c].paystate;
  1489. if (paystate == 1) {
  1490. this.$message.warning("已支付处方不可以清空");
  1491. return;
  1492. }
  1493. this.index = 0;
  1494. this.recipe_tabs[this.recipe_tabs_c].disable = false;
  1495. this.recipe_tabs[this.recipe_tabs_c].isMyMade = true;
  1496. this.recipe_tabs[this.recipe_tabs_c].totalTableD.splice(
  1497. this.recipe_tabs[this.recipe_tabs_c].totalTableD.length - 1,
  1498. 1
  1499. );
  1500. let father = this.$parent;
  1501. this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item2 => {
  1502. father.rationalMed.forEach((item1, index1) => {
  1503. if (item2.medid == item1.reqID || item2.medid == item1.matid) {
  1504. father.rationalMed.splice(index1, 1);
  1505. father.resetRationalMed();
  1506. }
  1507. });
  1508. });
  1509. this.recipe_tabs[this.recipe_tabs_c].totalTableD = [
  1510. {
  1511. drugList: [],
  1512. page: 1,
  1513. loadMore: true,
  1514. key: "",
  1515. search_i: 0
  1516. }
  1517. ];
  1518. this.recipe_tabs[this.recipe_tabs_c].tableData = [
  1519. {
  1520. drugList: [],
  1521. page: 1,
  1522. id: 1,
  1523. loadMore: true,
  1524. key: "",
  1525. search_i: 0
  1526. }
  1527. ];
  1528. this.recipe_tabs[this.recipe_tabs_c].tableData1 = [];
  1529. this.recipe_tabs[this.recipe_tabs_c].radio = this.pharmacyTypes[0].ptype;
  1530. this.recipe_tabs[
  1531. this.recipe_tabs_c
  1532. ].lastType = this.pharmacyTypes[0].ptype;
  1533. let moneyMsg = this.recipe_tabs[this.recipe_tabs_c].bottom_form.moneyMsg;
  1534. this.recipe_tabs[this.recipe_tabs_c].bottom_form = {
  1535. preType: "", // 协定方的时候 切换 中药类型带入
  1536. disable: false, // 协定方 配方转方 为 true
  1537. doseNum: "",
  1538. doseType: "",
  1539. doseTypeList: [],
  1540. usegeList: [],
  1541. usege: "",
  1542. num: "",
  1543. numList: [], // 频次后台数据
  1544. daijian: "",
  1545. nongjian: "200",
  1546. time: "",
  1547. timeList: [], // 服药时间后台数据
  1548. caozuo: "",
  1549. zhutuo: "",
  1550. radio: 1,
  1551. isDaiJian: 2,
  1552. provinceList: [],
  1553. cityList: [],
  1554. areaList: [],
  1555. province: "",
  1556. city: "",
  1557. area: "",
  1558. address: "",
  1559. phone: "",
  1560. doseType1: "zc",
  1561. doseNum1: "",
  1562. savename: "",
  1563. nowRecipeMoney: 0, //单剂金额
  1564. nowRecipeMoney1: 0, //当前处方金额
  1565. allMoney: 0, // 合计金额
  1566. moneyMsg: moneyMsg // 价格数据
  1567. };
  1568. this.nowRecipeMoney = 0;
  1569. this.getProver();
  1570. this.getSelectType("中药药品用法", 0);
  1571. this.getSelectType("剂型", 0);
  1572. this.getSelectType("处方用法");
  1573. this.getSelectType("中药服药时间");
  1574. this.getSelectType("中药频次");
  1575. sessionStorage.setItem("isupdateExpre", "0");
  1576. this.countNowRecipeMoney();
  1577. },
  1578. load() {
  1579. console.log("进入");
  1580. let key = this.recipe_tabs[this.recipe_tabs_c].totalTableD[this.index]
  1581. .key;
  1582. let page = this.recipe_tabs[this.recipe_tabs_c].totalTableD[this.index]
  1583. .page;
  1584. let loadMore = this.recipe_tabs[this.recipe_tabs_c].totalTableD[
  1585. this.index
  1586. ].loadMore;
  1587. if (loadMore) {
  1588. page += 1;
  1589. }
  1590. // if (!loadMore == 1) return;
  1591. this.getTableDrug(key, page, this.index, loadMore);
  1592. },
  1593. // 新增处方 tab
  1594. addRecipeTba() {
  1595. let obj = this.recipe_tabs[this.recipe_tabs_c].bottom_form;
  1596. this.recipe_tabs.push({
  1597. prescribed: 0,
  1598. paystate: 0,
  1599. isMyMade: true,
  1600. disable: false,
  1601. name: `处方${this.recipe_tabs.length + 1}`,
  1602. pharmacyID: this.recipe_tabs[this.recipe_tabs_c].pharmacyID,
  1603. isPay: false,
  1604. totalTableD: [
  1605. {
  1606. id: 1,
  1607. key: "",
  1608. drugList: [],
  1609. page: 1,
  1610. loadMore: true,
  1611. usageList: [],
  1612. search_i: 0,
  1613. showSearch: false
  1614. }
  1615. ],
  1616. tableData: [
  1617. {
  1618. id: 1,
  1619. key: "",
  1620. drugList: [],
  1621. page: 1,
  1622. loadMore: true,
  1623. usageList: [],
  1624. search_i: 0,
  1625. showSearch: false
  1626. }
  1627. ],
  1628. radio: this.pharmacyTypes[0].ptype,
  1629. lastType: this.pharmacyTypes[0].ptype,
  1630. tableData1: [],
  1631. bottom_form: {
  1632. doseNum: "",
  1633. doseType: "",
  1634. doseTypeList: [],
  1635. usegeList: [],
  1636. usege: "",
  1637. num: "",
  1638. numList: [], // 频次后台数据
  1639. daijian: "",
  1640. nongjian: "200",
  1641. time: "",
  1642. timeList: [], // 服药时间后台数据
  1643. caozuo: "",
  1644. zhutuo: "",
  1645. radio: 1,
  1646. isDaiJian: 2,
  1647. pro: "",
  1648. city: "",
  1649. area: "",
  1650. address: "",
  1651. phone: "",
  1652. doseType1: "",
  1653. doseNum1: "",
  1654. provinceList: this.provinceList1,
  1655. cityList: [],
  1656. areaList: [],
  1657. province: "",
  1658. city: "",
  1659. area: "",
  1660. moneyMsg: obj.moneyMsg, // 价格数据
  1661. nowRecipeMoney: 0, //单剂金额
  1662. nowRecipeMoney1: 0, //当前处方金额
  1663. allMoney: 0, // 合计金额
  1664. disable: false
  1665. }
  1666. });
  1667. this.recipe_tabs_c = this.recipe_tabs.length - 1;
  1668. // this.getPharmacyID()
  1669. this.recipeChange(this.recipe_tabs_c);
  1670. },
  1671. // 处方 tab 点击改变
  1672. recipeChange(index) {
  1673. this.recipe_tabs_c = index;
  1674. this.getSelectType("剂型");
  1675. this.getSelectType("处方用法");
  1676. this.getSelectType("中药服药时间");
  1677. this.getSelectType("中药频次");
  1678. // 调用 父级合理用药接口
  1679. let father = this.$parent;
  1680. father.rationalMed = [];
  1681. for (let i = 1; i < 11; i++) {
  1682. father["rationalMed" + i] = [];
  1683. }
  1684. this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
  1685. if (item.name) {
  1686. if (item.medid.indexOf("-") != -1) {
  1687. father.getRationalMed(item.medid);
  1688. } else {
  1689. father.getRationalMedForPlat(item.medid);
  1690. }
  1691. }
  1692. });
  1693. try {
  1694. let pid = this.recipe_tabs[this.recipe_tabs_c].radio.split("@")[0];
  1695. this.getPharmacyMsg(pid);
  1696. } catch (error) {}
  1697. },
  1698. recipeDelete(index) {
  1699. if (this.recipe_tabs.length == 1) return;
  1700. this.recipe_tabs.splice(index, 1);
  1701. this.recipe_tabs_c = this.recipe_tabs.length - 1;
  1702. this.recipe_tabs.filter((item, index) => {
  1703. return (item.name = "处方" + (index + 1));
  1704. });
  1705. this.countNowRecipeMoney();
  1706. // this.$forceUpdate()
  1707. },
  1708. // 输入剂量计算 当前药品总价格
  1709. countDoseMoney(e, scope) {
  1710. let totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
  1711. let kucun = scope.row.inventory; // 药品库存
  1712. if (Number(e) > Number(kucun)) {
  1713. this.$message.warning("当前库存不足");
  1714. document.querySelectorAll("#dose" + scope.row.id)[0].style.border =
  1715. "1px solid red";
  1716. document.querySelectorAll("#dose" + scope.row.id)[0].style.color =
  1717. "red";
  1718. } else {
  1719. document.querySelectorAll("#dose" + scope.row.id)[0].style.border = "";
  1720. document.querySelectorAll("#dose" + scope.row.id)[0].style.color = "";
  1721. }
  1722. let price = this.recipe_tabs[this.recipe_tabs_c].totalTableD[
  1723. scope.row.id - 1
  1724. ].price;
  1725. this.recipe_tabs[this.recipe_tabs_c].totalTableD[
  1726. scope.row.id - 1
  1727. ].dose = e;
  1728. let dose = this.recipe_tabs[this.recipe_tabs_c].totalTableD[
  1729. scope.row.id - 1
  1730. ].dose;
  1731. let total = 0;
  1732. // 计算方式2
  1733. if (this.countWay == "2") {
  1734. total = (Number(price) * Number(dose)).toFixed(2);
  1735. } else {
  1736. total = Number(price) * Number(dose);
  1737. }
  1738. this.recipe_tabs[this.recipe_tabs_c].totalTableD[
  1739. scope.row.id - 1
  1740. ].total = total;
  1741. const forceUpdate = (data) => Object.assign({}, data);
  1742. this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
  1743. (item, index) => {
  1744. return item.id % 2 != 0;
  1745. }
  1746. ).map(forceUpdate);
  1747. this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
  1748. (item, index) => {
  1749. return item.id % 2 == 0;
  1750. }
  1751. ).map(forceUpdate);
  1752. if (this.recipe_tabs[this.recipe_tabs_c].bottom_form.doseNum) {
  1753. // this.countNowRecipeMoney();
  1754. }
  1755. this.countNowRecipeMoney();
  1756. },
  1757. // 表一 选中药品
  1758. chooseDis1(scope, index, item, from = "now") {
  1759. let totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
  1760. let isHas = false;
  1761. totalData.forEach(item1 => {
  1762. if (item1.medid === item.pid) {
  1763. isHas = true;
  1764. }
  1765. });
  1766. if (isHas) {
  1767. this.$message.warning("请勿重复添加药品");
  1768. return;
  1769. }
  1770. let obj = {
  1771. color: item.kc == 0 ? "red" : "#000",
  1772. id: scope.row.id,
  1773. name: item.ypmc,
  1774. spec: item.gg, // 规格
  1775. // dose: "", // 剂量
  1776. dose: scope.row.color == "red" ? scope.row.dose : "",
  1777. unit: item.dw, // 单位
  1778. usage:
  1779. scope.row.color == "red"
  1780. ? this.usageList[0].key
  1781. : scope.row.usage || item.usagestr || this.usageList[0].key, // 用法
  1782. //usage: "",
  1783. // price: item.lsjg,
  1784. price: item.price,
  1785. total: 0,
  1786. inventory: item.kc, // 库存
  1787. key: "",
  1788. search_i: index,
  1789. medid: item.pid, // 药品id
  1790. originname: item.cdmc, // 产地名称
  1791. showSearch: false,
  1792. showDoseSection: false // 展示剂量区间
  1793. };
  1794. Object.assign(totalData[scope.row.id - 1], obj);
  1795. // 调用 父级合理用药接口
  1796. let father = this.$parent;
  1797. father.rationalMed.forEach((item1, index1) => {
  1798. if (this.clickPid == item1.reqID || this.clickPid == item1.matid) {
  1799. father.rationalMed.splice(index1, 1);
  1800. father.resetRationalMed();
  1801. }
  1802. });
  1803. if (obj.medid.indexOf("-") != -1) {
  1804. father.getRationalMed(obj.medid);
  1805. } else {
  1806. father.getRationalMedForPlat(obj.medid);
  1807. }
  1808. if (scope.row.id == totalData.length) {
  1809. totalData.push({
  1810. id: 2,
  1811. drugList: [],
  1812. page: 1,
  1813. loadMore: true,
  1814. usageList: [],
  1815. search_i: 0,
  1816. showSearch: false
  1817. });
  1818. }
  1819. this.recipe_tabs[this.recipe_tabs_c].totalTableD = totalData;
  1820. totalData.filter((item, index) => {
  1821. this.getSelectType("中药药品用法", index);
  1822. // if (!item.usage) {
  1823. // item.usage = item.usageList[0].key;
  1824. // }
  1825. return (item.id = index + 1);
  1826. });
  1827. this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
  1828. (item, index) => {
  1829. return item.id % 2 != 0;
  1830. }
  1831. );
  1832. this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
  1833. (item, index) => {
  1834. return item.id % 2 == 0;
  1835. }
  1836. );
  1837. if (from != "now") return;
  1838. setTimeout(() => {
  1839. let ids = document.querySelectorAll("#dose" + scope.row.id);
  1840. document.querySelectorAll("#dose" + scope.row.id)[0].focus();
  1841. }, 500);
  1842. this.countNowRecipeMoney();
  1843. },
  1844. // 表一和表二 数据添加
  1845. addDis1(scope, type = "click") {
  1846. let totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
  1847. let index = scope.row.id;
  1848. // totalData[index + 1].id && totalData[index + 1].name
  1849. if (index != totalData.length - 2) {
  1850. // 插入到 数据中间
  1851. let data = totalData.splice(scope.row.id);
  1852. totalData.push({
  1853. id: 2,
  1854. drugList: [],
  1855. page: 1,
  1856. loadMore: true,
  1857. usageList: [],
  1858. showSearch: false,
  1859. key: "",
  1860. search_i: 0
  1861. });
  1862. totalData = totalData.concat(data);
  1863. // this.totalTableD = totalData;
  1864. } else if (totalData[index + 1].id && !totalData[index + 1].name) {
  1865. totalData.push({
  1866. id: 2,
  1867. drugList: [],
  1868. page: 1,
  1869. loadMore: true,
  1870. usageList: [],
  1871. showSearch: false,
  1872. key: "",
  1873. search_i: 0
  1874. });
  1875. }
  1876. totalData.filter((item, index1) => {
  1877. this.getSelectType("中药药品用法", index1);
  1878. return (item.id = index1 + 1);
  1879. });
  1880. this.recipe_tabs[this.recipe_tabs_c].totalTableD = totalData;
  1881. this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
  1882. (item, index) => {
  1883. return item.id % 2 != 0;
  1884. }
  1885. );
  1886. this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
  1887. (item, index) => {
  1888. return item.id % 2 == 0;
  1889. }
  1890. );
  1891. if (type != "click") return;
  1892. setTimeout(() => {
  1893. if (
  1894. scope.row.id ==
  1895. this.recipe_tabs[this.recipe_tabs_c].totalTableD.length - 1
  1896. ) {
  1897. document.querySelectorAll("#searchD" + (scope.row.id + 1))[0].focus();
  1898. } else {
  1899. try {
  1900. this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
  1901. if (!item.name) {
  1902. // console.log(document.querySelectorAll('#searchD' + item.id), '啦啦啦')
  1903. document.querySelectorAll("#searchD" + item.id)[0].focus();
  1904. throw Error();
  1905. }
  1906. });
  1907. } catch (error) {}
  1908. }
  1909. }, 500);
  1910. },
  1911. // 表一 和表二 查看药品数据
  1912. findDrug(scope) {
  1913. this.$emit("find", scope);
  1914. },
  1915. // 表一和表二 数据删除
  1916. deleteDis1(scope) {
  1917. let father = this.$parent;
  1918. father.rationalMed.forEach((item1, index1) => {
  1919. if (scope.row.medid == item1.reqID || scope.row.medid == item1.matid) {
  1920. father.rationalMed.splice(index1, 1);
  1921. father.resetRationalMed();
  1922. }
  1923. });
  1924. let totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
  1925. let index = scope.row.id - 1;
  1926. this.recipe_tabs[this.recipe_tabs_c].totalTableD.splice(index, 1);
  1927. totalData.filter((item, index) => {
  1928. // 调用 父级合理用药接口
  1929. // father.getRationalMed(item.medid)
  1930. return (item.id = index + 1);
  1931. });
  1932. this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
  1933. (item, index) => {
  1934. return item.id % 2 != 0;
  1935. }
  1936. );
  1937. this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
  1938. (item, index) => {
  1939. return item.id % 2 == 0;
  1940. }
  1941. );
  1942. this.countNowRecipeMoney();
  1943. },
  1944. clickName(scope) {
  1945. // 隐藏滚动条
  1946. if (scope.row.id % 2 == 0) {
  1947. document.getElementsByClassName(
  1948. "el-table__body-wrapper"
  1949. )[1].style.overflow = "hidden";
  1950. } else {
  1951. document.getElementsByClassName(
  1952. "el-table__body-wrapper"
  1953. )[0].style.overflow = "hidden";
  1954. }
  1955. this.medIndex = scope.$index;
  1956. this.clickPid = scope.row.medid;
  1957. this.recipe_tabs[this.recipe_tabs_c].totalTableD[
  1958. scope.row.id - 1
  1959. ].showSearch = !this.recipe_tabs[this.recipe_tabs_c].totalTableD[
  1960. scope.row.id - 1
  1961. ].showSearch;
  1962. this.recipe_tabs[this.recipe_tabs_c].totalTableD[scope.row.id - 1].key =
  1963. scope.row.name;
  1964. this.recipe_tabs[this.recipe_tabs_c].totalTableD[
  1965. scope.row.id - 1
  1966. ].search_i = 0;
  1967. debounce(this.getTableDrug(scope.row.key, 1, scope.row.id - 1), 10000);
  1968. setTimeout(() => {
  1969. // console.log(document.querySelectorAll('#searchD' + scope.row.id));
  1970. document.querySelectorAll("#searchD" + scope.row.id)[0].focus();
  1971. }, 800);
  1972. },
  1973. // 输入框获取 药品列表
  1974. searchDrug(e, scope) {
  1975. // 隐藏滚动条
  1976. if (scope.row.id % 2 == 0) {
  1977. document.getElementsByClassName(
  1978. "el-table__body-wrapper"
  1979. )[1].style.overflow = "hidden";
  1980. } else {
  1981. document.getElementsByClassName(
  1982. "el-table__body-wrapper"
  1983. )[0].style.overflow = "hidden";
  1984. }
  1985. let index = scope.row.id ? scope.row.id - 1 : 0;
  1986. // console.log(this.recipe_tabs[this.recipe_tabs_c].totalTableD[index], '我是key')
  1987. this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].key = e;
  1988. let ids = document.querySelectorAll("#operate2");
  1989. ids.forEach((item, index) => {
  1990. item.style["z-index"] = "auto";
  1991. });
  1992. // if (e != '') {
  1993. // this.recipe_tabs[this.recipe_tabs_c].totalTableD[
  1994. // scope.row.id - 1
  1995. // ].showSearch = true
  1996. // } else {
  1997. // this.recipe_tabs[this.recipe_tabs_c].totalTableD[
  1998. // scope.row.id - 1
  1999. // ].showSearch = false
  2000. // }
  2001. this.recipe_tabs[this.recipe_tabs_c].tableData = this.recipe_tabs[
  2002. this.recipe_tabs_c
  2003. ].totalTableD.filter((item, index) => {
  2004. return item.id % 2 != 0;
  2005. });
  2006. this.recipe_tabs[this.recipe_tabs_c].tableData1 = this.recipe_tabs[
  2007. this.recipe_tabs_c
  2008. ].totalTableD.filter((item, index) => {
  2009. return item.id % 2 == 0;
  2010. });
  2011. this.index = scope.row.id - 1;
  2012. // this.getTableDrug(scope.row.key, 1, scope.row.id - 1)
  2013. debounce(this.getTableDrug(scope.row.key, 1, index), 10000);
  2014. },
  2015. drugFocus(scope) {
  2016. this.medIndex = scope.$index;
  2017. },
  2018. drugBlur(e, scope) {
  2019. // 调用 父级合理用药接口
  2020. // father.getRationalMedForPlat(scope.row.medid)
  2021. // 失去焦点 释放滚动条
  2022. if (scope.row.id % 2 == 0) {
  2023. document.getElementsByClassName(
  2024. "el-table__body-wrapper"
  2025. )[1].style.overflow = "auto";
  2026. } else {
  2027. document.getElementsByClassName(
  2028. "el-table__body-wrapper"
  2029. )[0].style.overflow = "auto";
  2030. }
  2031. setTimeout(() => {
  2032. let index = scope.row.id ? scope.row.id - 1 : 0;
  2033. this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].key = "";
  2034. let ids = document.querySelectorAll("#operate2");
  2035. ids.forEach((item, index) => {
  2036. item.style["z-index"] = "99";
  2037. });
  2038. this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
  2039. item.drugList = [];
  2040. });
  2041. this.recipe_tabs[this.recipe_tabs_c].tableData = this.recipe_tabs[
  2042. this.recipe_tabs_c
  2043. ].totalTableD.filter((item, index) => {
  2044. return item.id % 2 != 0;
  2045. });
  2046. this.recipe_tabs[this.recipe_tabs_c].tableData1 = this.recipe_tabs[
  2047. this.recipe_tabs_c
  2048. ].totalTableD.filter((item, index) => {
  2049. return item.id % 2 == 0;
  2050. });
  2051. }, 500);
  2052. },
  2053. drugBlur1(e, scope) {
  2054. // 调用 父级合理用药接口
  2055. // 失去焦点 展示滚动条
  2056. if (scope.row.id % 2 == 0) {
  2057. document.getElementsByClassName(
  2058. "el-table__body-wrapper"
  2059. )[1].style.overflow = "auto";
  2060. } else {
  2061. document.getElementsByClassName(
  2062. "el-table__body-wrapper"
  2063. )[0].style.overflow = "auto";
  2064. }
  2065. setTimeout(() => {
  2066. let index = scope.row.id ? scope.row.id - 1 : 0;
  2067. this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].key = "";
  2068. this.recipe_tabs[this.recipe_tabs_c].totalTableD[
  2069. index
  2070. ].showSearch = false;
  2071. let ids = document.querySelectorAll("#operate2");
  2072. ids.forEach((item, index) => {
  2073. item.style["z-index"] = "99";
  2074. });
  2075. this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
  2076. item.drugList = [];
  2077. });
  2078. this.recipe_tabs[this.recipe_tabs_c].tableData = this.recipe_tabs[
  2079. this.recipe_tabs_c
  2080. ].totalTableD.filter((item, index) => {
  2081. return item.id % 2 != 0;
  2082. });
  2083. this.recipe_tabs[this.recipe_tabs_c].tableData1 = this.recipe_tabs[
  2084. this.recipe_tabs_c
  2085. ].totalTableD.filter((item, index) => {
  2086. return item.id % 2 == 0;
  2087. });
  2088. }, 500);
  2089. },
  2090. // 合并表一 表二
  2091. arraySpanMethod1({ row, column, rowIndex, columnIndex }) {
  2092. // if (!row.name) {
  2093. // // document.getElementById('table1')
  2094. // return [1, 8];
  2095. // }
  2096. },
  2097. // 存为我的 协定方 提交
  2098. submitAgree() {
  2099. this.$refs.accordEdit.isRecipe = true;
  2100. this.$refs.accordEdit.save();
  2101. return;
  2102. if (this.share == "") {
  2103. this.$message.error({
  2104. message: "请选择共享信息",
  2105. showClose: false,
  2106. type: "error"
  2107. });
  2108. return;
  2109. }
  2110. // 处理数据
  2111. let data = this.recipe_tabs;
  2112. let index = this.recipe_tabs_c;
  2113. let obj = {
  2114. rangtype: this.share,
  2115. curetype: data[index].bottom_form.doseType,
  2116. density: data[index].bottom_form.nongjian,
  2117. deploymentfree: data[index].bottom_form.specialDeploymentPrice,
  2118. frequency: data[index].bottom_form.num,
  2119. medicationtime: data[index].bottom_form.time,
  2120. fryingfee: data[index].bottom_form.agencyPrice,
  2121. markfree: data[index].bottom_form.systemOfCreamPrice,
  2122. name: this.getuserinfo.userid + new Date().toDateString(),
  2123. prescriptionDetailVos: [],
  2124. prescriptiontype: data[index].radio,
  2125. type: "0",
  2126. usrage: data[index].usege
  2127. };
  2128. data[index].totalTableD.forEach((item, index) => {
  2129. if (item.name) {
  2130. let obj1 = {
  2131. dose: item.dose,
  2132. drugid: item.medid,
  2133. drugname: item.name,
  2134. seqn: item.id,
  2135. specification: item.spec,
  2136. unit: item.unit,
  2137. usagestr: item.usage
  2138. };
  2139. obj.prescriptionDetailVos.push(obj1);
  2140. }
  2141. });
  2142. this.recipe_tabs[this.recipe_tabs_c].preType = "";
  2143. this.addAccordData(obj);
  2144. },
  2145. agreeSccess(e) {
  2146. this.showDialog = false;
  2147. if (e) {
  2148. this.$parent.openRecipeAfterAgree();
  2149. }
  2150. },
  2151. // 存为我的 协定方
  2152. saveToMine(from = "auto") {
  2153. /*
  2154. from : 操作来源 auto: 存为我的协定方点击
  2155. reserve:保存处方时打开存为协定方
  2156. */
  2157. this.getAccordShareList();
  2158. let hasDoseNum = true; // 是否有剂数
  2159. let hasData = true; // 是否有处方药品数据
  2160. let hasUse = true;
  2161. this.recipe_tabs.forEach(item => {
  2162. if (item.totalTableD.length < 2) {
  2163. hasData = false;
  2164. }
  2165. item.totalTableD.forEach(item1 => {
  2166. if (!item1.dose && item1.name) {
  2167. hasDoseNum = false;
  2168. }
  2169. if (!item1.usage && item1.name) {
  2170. hasUse = false;
  2171. }
  2172. });
  2173. });
  2174. if (!hasData) {
  2175. this.$message.error("请完善中药处方药品信息");
  2176. return false;
  2177. }
  2178. // if (!hasDoseNum) {
  2179. // this.$message.error("请完善中药处方剂量信息");
  2180. // return false;
  2181. // }
  2182. // if (!hasUse) {
  2183. // this.$message.error('请完善中药处方用法信息')
  2184. // return false
  2185. // }
  2186. this.showDialog = true;
  2187. let that = this;
  2188. setTimeout(() => {
  2189. let arr = that.deepCopy(
  2190. this.recipe_tabs[this.recipe_tabs_c].totalTableD
  2191. );
  2192. if (from == "reserve") {
  2193. this.$refs.accordEdit.isNeedOpenRecipe = true;
  2194. }
  2195. this.$refs.accordEdit.assignTableData(arr, "saveToMy");
  2196. // 赋值病名数据
  2197. let tcmValue = this.$parent.$refs.TCM.getParams();
  2198. this.$refs.accordEdit.$refs.tcmd.setParams(tcmValue);
  2199. // 剂型
  2200. this.$refs.accordEdit.form.doseType = this.recipe_tabs[
  2201. this.recipe_tabs_c
  2202. ].bottom_form.doseType;
  2203. // 剂数
  2204. this.$refs.accordEdit.form.doseNum = this.recipe_tabs[
  2205. this.recipe_tabs_c
  2206. ].bottom_form.doseNum;
  2207. // 处方用法
  2208. this.$refs.accordEdit.form.recipeUse = this.recipe_tabs[
  2209. this.recipe_tabs_c
  2210. ].bottom_form.usege;
  2211. // 每次
  2212. this.$refs.accordEdit.form.nongjian = this.recipe_tabs[
  2213. this.recipe_tabs_c
  2214. ].bottom_form.nongjian;
  2215. // 频次
  2216. this.$refs.accordEdit.form.times = this.recipe_tabs[
  2217. this.recipe_tabs_c
  2218. ].bottom_form.num;
  2219. // 服药时间
  2220. this.$refs.accordEdit.form.useTime = this.recipe_tabs[
  2221. this.recipe_tabs_c
  2222. ].bottom_form.time;
  2223. return;
  2224. this.$refs.accordEdit.totalTableD = arr;
  2225. this.$refs.accordEdit.form.cMedType = this.recipe_tabs[
  2226. this.recipe_tabs_c
  2227. ].radio;
  2228. this.$refs.accordEdit.form.doseType = this.recipe_tabs[
  2229. this.recipe_tabs_c
  2230. ].bottom_form.doseType;
  2231. console.log(this.$refs.accordEdit, "acc");
  2232. this.$refs.accordEdit.tableData = this.$refs.accordEdit.totalTableD.filter(
  2233. item => {
  2234. return item.id % 2 != 0;
  2235. }
  2236. );
  2237. this.$refs.accordEdit.tableData1 = this.$refs.accordEdit.totalTableD.filter(
  2238. item => {
  2239. return item.id % 2 == 0;
  2240. }
  2241. );
  2242. }, 200);
  2243. return;
  2244. },
  2245. deepCopy(source) {
  2246. if (!source instanceof Object) return source; //如果不是对象的话直接返回
  2247. let target = Array.isArray(source) ? [] : {}; //数组兼容
  2248. for (var k in source) {
  2249. if (source.hasOwnProperty(k)) {
  2250. if (typeof source[k] === "object") {
  2251. target[k] = this.deepCopy(source[k]);
  2252. } else {
  2253. target[k] = source[k];
  2254. }
  2255. }
  2256. }
  2257. return target;
  2258. },
  2259. // 提交处方
  2260. submit() {
  2261. this.$emit("submit");
  2262. },
  2263. // 修改省的数据
  2264. proC(e) {
  2265. // console.log(e)
  2266. this.recipe_tabs[this.recipe_tabs_c].bottom_form.city = "";
  2267. this.recipe_tabs[this.recipe_tabs_c].bottom_form.area = "";
  2268. this.getArea(e, 1);
  2269. },
  2270. cityC(e) {
  2271. this.recipe_tabs[this.recipe_tabs_c].bottom_form.area = "";
  2272. this.getArea(e, 2);
  2273. },
  2274. // 获取 合理用药数据
  2275. async _getRationalMed(id) {
  2276. let ids = [];
  2277. let child = this;
  2278. child.recipe_tabs[child.recipe_tabs_c].totalTableD.forEach(item => {
  2279. if (item.name) {
  2280. ids.push(item.medid);
  2281. }
  2282. });
  2283. let idsIndex = 0;
  2284. ids.forEach((item, index) => {
  2285. if (item == id) {
  2286. idsIndex = index;
  2287. }
  2288. });
  2289. ids.splice(idsIndex, 1);
  2290. let res = await getRationalMed({
  2291. matID: id,
  2292. orgId: this.getuserinfo.organizationid,
  2293. matIds: ids
  2294. });
  2295. if (res.code == 0 && res.message) {
  2296. this.maxDose = res.data.matmaxdosage;
  2297. this.minDose = res.data.matmindosage;
  2298. this.doseId = id;
  2299. }
  2300. },
  2301. // 获取平台合理用药数据
  2302. async _getRationalMedForPlat(id) {
  2303. let ids = [];
  2304. let child = this;
  2305. child.recipe_tabs[child.recipe_tabs_c].totalTableD.forEach(item => {
  2306. if (item.name) {
  2307. ids.push(item.medid);
  2308. }
  2309. });
  2310. let idsIndex = 0;
  2311. ids.forEach((item, index) => {
  2312. if (item == id) {
  2313. idsIndex = index;
  2314. }
  2315. });
  2316. ids.splice(idsIndex, 1);
  2317. let res = await getRationalMedForPlat({
  2318. matID: id,
  2319. orgId: this.getuserinfo.organizationid,
  2320. matIds: ids
  2321. });
  2322. if (res.code == 0 && res.message) {
  2323. this.maxDose = res.data.matmaxdosage;
  2324. this.minDose = res.data.matmindosage;
  2325. this.doseId = id;
  2326. }
  2327. },
  2328. //添加协定方数据
  2329. async addAccordData(data) {
  2330. const loading = this.$loading({
  2331. lock: true,
  2332. text: "正在保存",
  2333. spinner: "el-icon-loading",
  2334. background: "rgba(0, 0, 0, 0.7)"
  2335. });
  2336. let res = await addAccordData(data).catch(err => {
  2337. loading.close();
  2338. });
  2339. if (res.ResultCode == 0) {
  2340. loading.close();
  2341. this.$message({
  2342. type: "success",
  2343. message: "保存成功",
  2344. showClose: true
  2345. });
  2346. this.showDialog = false;
  2347. setTimeout(() => {
  2348. this.$router.push({
  2349. path: "/index/accord"
  2350. });
  2351. }, 2000);
  2352. }
  2353. },
  2354. // 通过中药类型获取药房id
  2355. async getPharmacyID() {
  2356. return;
  2357. let res = await getPharmacyID({
  2358. type: this.recipe_tabs[this.recipe_tabs_c].radio.split("@")[1]
  2359. });
  2360. if (res.ResultCode == 0) {
  2361. if (res.ResultInfo == "") {
  2362. this.$message({
  2363. showClose: false,
  2364. message: "当前类型无法开药,请切换类型",
  2365. type: "error"
  2366. });
  2367. return;
  2368. }
  2369. this.recipe_tabs[this.recipe_tabs_c].pharmacyID = res.ResultInfo;
  2370. this.changePharmacy(this.recipe_tabs[this.recipe_tabs_c].lastType);
  2371. this.getPharmacyMsg(res.ResultInfo);
  2372. }
  2373. },
  2374. // 选择药房
  2375. async customerQuery() {
  2376. let res = await customerQuery({
  2377. type: 0
  2378. });
  2379. if (res.ResultCode == 0) {
  2380. let pharmacyTypes = [];
  2381. res.Data.forEach(item => {
  2382. item.dosageForms = item.dosageForms.split(",");
  2383. item.dosageForms.forEach(item1 => {
  2384. pharmacyTypes.push({
  2385. type: item1,
  2386. ptype: item.pid + "@" + item1,
  2387. name: item.displayName //+ this.getRadioName(item1)
  2388. });
  2389. });
  2390. });
  2391. this.recipe_tabs[this.recipe_tabs_c].pharmacyID = res.Data[0].pid;
  2392. this.recipe_tabs[this.recipe_tabs_c].radio = pharmacyTypes[0].ptype;
  2393. this.recipe_tabs[this.recipe_tabs_c].lastType = pharmacyTypes[0].ptype;
  2394. this.pharmacyList = res.Data;
  2395. this.pharmacyTypes = pharmacyTypes;
  2396. this.$forceUpdate();
  2397. this.getPharmacyMsg(res.Data[0].pid);
  2398. }
  2399. },
  2400. // 获取药房id
  2401. async _getPharmacyIDS() {
  2402. let res = await getPharmacyIDS();
  2403. if (res.ResultCode == 0) {
  2404. this.pharmacyList = res.Data;
  2405. res.Data.forEach(item => {
  2406. if (item.key.indexOf("共享") != -1) {
  2407. this.recipe_tabs[this.recipe_tabs_c].pharmacyID = item.value;
  2408. this.getPharmacyMsg(item.value);
  2409. }
  2410. });
  2411. this.$forceUpdate();
  2412. }
  2413. },
  2414. // 切换中药类型时 切换 药房 获取 药品里面有没有这条数据
  2415. async changePharmacy(type, val) {
  2416. // TODO 此处 if 不会调用 触发在 [this.$emit("updateDp", res.Data)](src/components/ChineseMedicine.vue:2831)
  2417. if (this.recipe_tabs[this.recipe_tabs_c].radio == val) {
  2418. this.$parent.openAddress();
  2419. return;
  2420. }
  2421. if (!type) type = this.recipe_tabs[this.recipe_tabs_c].lastType || '';
  2422. if (!val) val = this.recipe_tabs[this.recipe_tabs_c].radio || '';
  2423. this.recipe_tabs[this.recipe_tabs_c].radio = val;
  2424. let drugIds = [];
  2425. const loading = this.$loading({
  2426. lock: true,
  2427. text: "处理中,请稍后....",
  2428. spinner: "el-icon-loading",
  2429. background: "rgba(0, 0, 0, 0.7)"
  2430. });
  2431. this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
  2432. if (item.name) {
  2433. let idDose =
  2434. item.medid +
  2435. "&" +
  2436. (item.dose || item.oldDose) +
  2437. "&" +
  2438. (item.usage || "");
  2439. // drugIds.push(item.medid)
  2440. item.oldDose = item.dose;
  2441. drugIds.push(idDose);
  2442. }
  2443. });
  2444. let pharmacyName = "";
  2445. val = val.split("@")[1];
  2446. type = type.split("@")[1];
  2447. this.recipe_tabs[this.recipe_tabs_c].pharmacyID = this.recipe_tabs[
  2448. this.recipe_tabs_c
  2449. ].radio.split("@")[0];
  2450. let params = {
  2451. type: val,
  2452. pharmacyid: this.recipe_tabs[this.recipe_tabs_c].pharmacyID,
  2453. drugIds,
  2454. preType: this.recipe_tabs[this.recipe_tabs_c].preType,
  2455. oldType: type
  2456. };
  2457. let res = await changePharmacy(params).catch(err => {});
  2458. if (res.ResultCode == 0) {
  2459. this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(
  2460. (item1, index1) => {
  2461. if (item1.name) {
  2462. const getUsage = (function (list = [], value = '') {
  2463. if (!Array.isArray(list) || list.length === 0) return void 0;
  2464. const option = value && list.find(item => item.value === value || item.key == value);
  2465. return option ? option.key : list[0].key;
  2466. }).bind(null, this.usageList);
  2467. res.Data.forEach((item, index) => {
  2468. if (item == item1.medid) {
  2469. item1.color = "red";
  2470. item1.oldDose = item1.oldDose;
  2471. }
  2472. // console.log(item instanceof Object);
  2473. if (item instanceof Object && item.oldYpid == item1.medid) {
  2474. item1 = {
  2475. id: 2,
  2476. name: item.ypmc,
  2477. spec: item.gg, // 规格
  2478. dose: item.dose, // 剂量
  2479. unit: item.dw, // 单位
  2480. usage: item.usagestr || item.usage, // || this.usegeList[0].key, // 用法
  2481. // usage: "",
  2482. // price: item.lsjg,
  2483. price: item.price,
  2484. total: (item.price * item.dose).toFixed(2),
  2485. inventory: item.kc, // 库存
  2486. key: "",
  2487. search_i: index,
  2488. medid: item.pid, // 药品id
  2489. originname: item.cdmc, // 产地名称
  2490. showSearch: false,
  2491. usageList: [],
  2492. oldDose: item1.oldDose
  2493. };
  2494. /* 修正 */ item1.usage = item1.useage = getUsage(item1.usage);
  2495. item1.color = "#000";
  2496. }
  2497. this.$set(
  2498. this.recipe_tabs[this.recipe_tabs_c].totalTableD,
  2499. index1,
  2500. item1
  2501. );
  2502. });
  2503. }
  2504. }
  2505. );
  2506. this.recipe_tabs[this.recipe_tabs_c].totalTableD.filter(
  2507. (item, index) => {
  2508. this.getSelectType("中药药品用法", index);
  2509. return (item.id = index + 1);
  2510. }
  2511. );
  2512. this.recipe_tabs[this.recipe_tabs_c].tableData = this.recipe_tabs[
  2513. this.recipe_tabs_c
  2514. ].totalTableD.filter((item, index) => {
  2515. return item.id % 2 != 0;
  2516. });
  2517. this.recipe_tabs[this.recipe_tabs_c].tableData1 = this.recipe_tabs[
  2518. this.recipe_tabs_c
  2519. ].totalTableD.filter((item, index) => {
  2520. return item.id % 2 == 0;
  2521. });
  2522. // this.recipe_tabs[this.recipe_tabs_c].lastType = this.recipe_tabs[this.recipe_tabs_c]
  2523. // .radio // 存储这一次的 药房类型
  2524. this.recipe_tabs[this.recipe_tabs_c].lastType = this.recipe_tabs[
  2525. this.recipe_tabs_c
  2526. ].radio; // 存储这一次的 药房类型
  2527. // console.log(this.recipe_tabs[this.recipe_tabs_c].totalTableD);
  2528. await this.getPharmacyMsg(this.recipe_tabs[this.recipe_tabs_c].pharmacyID);
  2529. setTimeout(() => {
  2530. this.countNowRecipeMoney();
  2531. }, 500);
  2532. }
  2533. loading.close();
  2534. },
  2535. // 获取寄到本院地址数据
  2536. async getAddressForHospital() {
  2537. let res = await getAddressForHospital({});
  2538. if (res.ResultCode == 0) {
  2539. this.recipe_tabs[this.recipe_tabs_c].bottom_form.province =
  2540. res.Data.province;
  2541. this.recipe_tabs[this.recipe_tabs_c].bottom_form.city = res.Data.city;
  2542. this.recipe_tabs[this.recipe_tabs_c].bottom_form.area =
  2543. res.Data.district;
  2544. this.getArea(res.Data.province, 1);
  2545. this.getArea(res.Data.city, 2);
  2546. this.recipe_tabs[this.recipe_tabs_c].bottom_form.address =
  2547. res.Data.adressdetail;
  2548. }
  2549. },
  2550. // 获取表格药品列表
  2551. async getTableDrug(key, page, index, load = true) {
  2552. if (!load) return;
  2553. let pharmacyName = "";
  2554. // let type = 0
  2555. let type = this.recipe_tabs[this.recipe_tabs_c].radio.split("@")[1];
  2556. this.pharmacyList.forEach(item => {
  2557. if (item.pid == this.recipe_tabs[this.recipe_tabs_c].pharmacyID) {
  2558. pharmacyName = item.pharmacyName;
  2559. }
  2560. });
  2561. let params = {
  2562. key: key,
  2563. limit: 5,
  2564. page: page,
  2565. type: type,
  2566. pharmacyid: this.recipe_tabs[this.recipe_tabs_c].pharmacyID
  2567. };
  2568. let res = await getTableDrug(params);
  2569. if (res.ResultCode == 0) {
  2570. // 计算方式3
  2571. if (this.countWay == "3") {
  2572. res.Data.Items.filter(item => {
  2573. return (item.price = Number(item.price).toFixed(2));
  2574. });
  2575. }
  2576. if (page <= res.Data.TotalPageCount) {
  2577. if (page == 1) {
  2578. this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].drugList =
  2579. res.Data.Items;
  2580. } else {
  2581. this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].drugList = [
  2582. ...this.recipe_tabs[this.recipe_tabs_c].totalTableD[index]
  2583. .drugList,
  2584. ...res.Data.Items
  2585. ];
  2586. this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].page += 1;
  2587. }
  2588. if (
  2589. this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].drugList
  2590. .length == res.Data.TotalRecordCount
  2591. ) {
  2592. // this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].loadMore = false
  2593. }
  2594. this.recipe_tabs[this.recipe_tabs_c].totalTableD.filter(
  2595. (item, index) => {
  2596. return (item.id = index + 1);
  2597. }
  2598. );
  2599. this.recipe_tabs[this.recipe_tabs_c].tableData = this.recipe_tabs[
  2600. this.recipe_tabs_c
  2601. ].totalTableD.filter((item, index) => {
  2602. return item.id % 2 != 0;
  2603. });
  2604. this.recipe_tabs[this.recipe_tabs_c].tableData1 = this.recipe_tabs[
  2605. this.recipe_tabs_c
  2606. ].totalTableD.filter((item, index) => {
  2607. return item.id % 2 == 0;
  2608. });
  2609. } else {
  2610. this.recipe_tabs[this.recipe_tabs_c].totalTableD[
  2611. index
  2612. ].loadMore = false;
  2613. }
  2614. }
  2615. },
  2616. // 获取省数据
  2617. async getProver() {
  2618. let res = await getProver();
  2619. if (res.ResultCode == 0) {
  2620. this.recipe_tabs[this.recipe_tabs_c].bottom_form.provinceList =
  2621. res.Data;
  2622. this.provinceList1 = res.Data;
  2623. }
  2624. },
  2625. // 获取市数据
  2626. async getArea(code, type) {
  2627. return;
  2628. let res = await getArea(code);
  2629. if (res.ResultCode == 0) {
  2630. if (type == 1) {
  2631. this.recipe_tabs[this.recipe_tabs_c].bottom_form.cityList = res.Data;
  2632. } else {
  2633. this.recipe_tabs[this.recipe_tabs_c].bottom_form.areaList = res.Data;
  2634. }
  2635. }
  2636. },
  2637. // 根据表格获取数据类型
  2638. async getSelectType(data, index) {
  2639. let res = await getSelectType(data);
  2640. if (data == "中药药品用法") {
  2641. if (this.recipe_tabs[this.recipe_tabs_c].totalTableD[index]["usage"]) {
  2642. // res.Data.forEach(item => {
  2643. // if (
  2644. // item.value ===
  2645. // this.recipe_tabs[this.recipe_tabs_c].totalTableD[index]['usage']
  2646. // ) {
  2647. // this.recipe_tabs[this.recipe_tabs_c].totalTableD[index]['usage'] =
  2648. // item.key;
  2649. // } else {
  2650. // this.recipe_tabs[this.recipe_tabs_c].totalTableD[index]['usage'] =
  2651. // "";
  2652. // }
  2653. // });
  2654. }
  2655. this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].usageList =
  2656. res.Data;
  2657. this.usageList = res.Data;
  2658. } else if (data == "剂型") {
  2659. this.recipe_tabs[this.recipe_tabs_c].bottom_form.doseTypeList =
  2660. res.Data;
  2661. if (this.recipe_tabs[this.recipe_tabs_c].bottom_form.doseType) return;
  2662. this.recipe_tabs[this.recipe_tabs_c].bottom_form.doseType =
  2663. res.Data[0].key;
  2664. } else if (data == "处方用法") {
  2665. this.recipe_tabs[this.recipe_tabs_c].bottom_form.usegeList = res.Data;
  2666. // debugger
  2667. if (this.recipe_tabs[this.recipe_tabs_c].bottom_form.usege !== "")
  2668. return;
  2669. this.recipe_tabs[this.recipe_tabs_c].bottom_form.usege =
  2670. res.Data[0].key;
  2671. } else if (data == "中药服药时间") {
  2672. this.recipe_tabs[this.recipe_tabs_c].bottom_form.timeList = res.Data;
  2673. if (this.recipe_tabs[this.recipe_tabs_c].bottom_form.time) return;
  2674. this.recipe_tabs[this.recipe_tabs_c].bottom_form.time = res.Data[0].key;
  2675. } else if (data == "中药频次") {
  2676. this.recipe_tabs[this.recipe_tabs_c].bottom_form.numList = res.Data;
  2677. if (this.recipe_tabs[this.recipe_tabs_c].bottom_form.num) return;
  2678. this.recipe_tabs[this.recipe_tabs_c].bottom_form.num = res.Data[0].key;
  2679. }
  2680. this.$forceUpdate();
  2681. },
  2682. // 获取制膏费用
  2683. async getPharmacyMsg(data) {
  2684. let res = await getPharmacyMsg(data);
  2685. if (res.ResultCode == 0) {
  2686. res.Data.agencyPrice = res.Data.agencyPrice ? res.Data.agencyPrice : 0;
  2687. res.Data.deliveryPrice = res.Data.deliveryPrice
  2688. ? res.Data.deliveryPrice
  2689. : 0;
  2690. res.Data.specialDeploymentPrice = res.Data.specialDeploymentPrice
  2691. ? res.Data.specialDeploymentPrice
  2692. : 0;
  2693. res.Data.systemOfCreamPrice = res.Data.systemOfCreamPrice
  2694. ? res.Data.systemOfCreamPrice
  2695. : 0;
  2696. this.recipe_tabs[this.recipe_tabs_c].bottom_form.moneyMsg = res.Data;
  2697. //
  2698. this.$forceUpdate();
  2699. this.$emit("updateDp", res.Data);
  2700. }
  2701. },
  2702. // 获取共享至信息
  2703. async getAccordShareList() {
  2704. let res = await getAccordShareList();
  2705. if (res.ResultCode == 0) {
  2706. this.shareSelect = res.Data;
  2707. }
  2708. },
  2709. // 获取医共体计算方式配置
  2710. async getDataByKey(key = "countMenthod") {
  2711. /*
  2712. countMenthod:计费方式
  2713. automaticReview:是否开启自动审核
  2714. */
  2715. let res = await getDataByKey({
  2716. key: key,
  2717. organizationid: this.getuserinfo.organizationid
  2718. });
  2719. if (res.ResultCode == 0) {
  2720. if (key == "countMenthod") {
  2721. if (res.ResultInfo == "0") {
  2722. this.countWay = "1";
  2723. } else if (res.ResultInfo == "1") {
  2724. this.countWay = "2";
  2725. } else if (res.ResultInfo == "2") {
  2726. this.countWay = "3";
  2727. }
  2728. }
  2729. if (key == "automaticReview") {
  2730. this.isAutoCheck = res.ResultInfo;
  2731. }
  2732. }
  2733. },
  2734. // 获取患者地址信息
  2735. async getPatAddress() {
  2736. if (!this.getPatiensInfo.basisPatient.pid) return;
  2737. let res = await getPatAddress({
  2738. patId: this.getPatiensInfo.basisPatient.pid
  2739. });
  2740. if (res.ResultCode == 0) {
  2741. this.recipe_tabs[this.recipe_tabs_c].bottom_form.address =
  2742. res.Data.detailadress;
  2743. this.recipe_tabs[this.recipe_tabs_c].bottom_form.savename =
  2744. res.Data.name;
  2745. this.recipe_tabs[this.recipe_tabs_c].bottom_form.phone = res.Data.phone;
  2746. this.recipe_tabs[this.recipe_tabs_c].bottom_form.province =
  2747. res.Data.province;
  2748. this.recipe_tabs[this.recipe_tabs_c].bottom_form.city = res.Data.city;
  2749. this.recipe_tabs[this.recipe_tabs_c].bottom_form.area =
  2750. res.Data.district;
  2751. this.getArea(res.Data.province, 1);
  2752. this.getArea(res.Data.city, 2);
  2753. }
  2754. }
  2755. },
  2756. filters: {
  2757. formatTotal(val) {
  2758. if (val == 0) return val;
  2759. // console.log(val, 'val');
  2760. if (parseInt(val) === parseFloat(val)) {
  2761. return val;
  2762. } else {
  2763. let v = String(val).split(".");
  2764. if (v[1].length > 2) {
  2765. // 2
  2766. return val.toFixed(2); //
  2767. } else {
  2768. return val;
  2769. }
  2770. }
  2771. }
  2772. },
  2773. computed: {
  2774. ...mapGetters(["getuserinfo", "getPatiensInfo"])
  2775. },
  2776. watch: {
  2777. getuserinfo: {
  2778. deep: true,
  2779. immediate: true,
  2780. handler() {
  2781. if (this.getuserinfo.organizationid) {
  2782. this.getDataByKey();
  2783. this.getDataByKey("automaticReview");
  2784. }
  2785. }
  2786. },
  2787. isDaiJian: {
  2788. immediate: true,
  2789. deep: true,
  2790. handler: function() {
  2791. this.recipe_tabs[
  2792. this.recipe_tabs_c
  2793. ].bottom_form.isDaiJian = this.isDaiJian;
  2794. this.recipe_tabs.forEach(item => {
  2795. // item.bottom_form.isDaiJian = this.isDaiJian;
  2796. if (item.isDaiJian == 0) {
  2797. item.bottom_form.daijian = "";
  2798. } else {
  2799. item.bottom_form.daijian = item.bottom_form.doseNum;
  2800. }
  2801. });
  2802. this.countNowRecipeMoney();
  2803. this.$forceUpdate();
  2804. }
  2805. },
  2806. isPs: {
  2807. immediate: true,
  2808. deep: true,
  2809. handler: function() {
  2810. // this.recipe_tabs.forEach(item => {
  2811. // item.bottom_form.radio = this.isPs;
  2812. // });
  2813. console.log(this.isPs, "选药");
  2814. this.recipe_tabs[this.recipe_tabs_c].bottom_form.radio = this.isPs;
  2815. this.countNowRecipeMoney();
  2816. this.$forceUpdate();
  2817. }
  2818. }
  2819. }
  2820. };
  2821. </script>
  2822. <style lang="scss" scoped>
  2823. @import "../style/common.scss";
  2824. .table-header {
  2825. border-bottom: 2px solid #dedede;
  2826. padding: 0px 0;
  2827. .table-label {
  2828. .label-item {
  2829. cursor: pointer;
  2830. width: 104px;
  2831. border-right: 2px solid #eaeaea;
  2832. div {
  2833. color: #666;
  2834. // transform: rotate(45deg);
  2835. font-size: 16px;
  2836. margin-left: 8px;
  2837. margin-top: 1px;
  2838. font-weight: 600;
  2839. }
  2840. img {
  2841. width: 20px;
  2842. margin-left: 8px;
  2843. }
  2844. }
  2845. span {
  2846. font-size: 14px;
  2847. font-family: PingFang SC;
  2848. font-weight: 400;
  2849. color: #666666;
  2850. }
  2851. .l_active {
  2852. color: #5386f6;
  2853. }
  2854. }
  2855. }
  2856. .add-presc {
  2857. width: 70px;
  2858. height: 26px;
  2859. background: #ffae45;
  2860. border-radius: 4px;
  2861. font-size: 12px;
  2862. font-family: PingFang SC;
  2863. font-weight: 400;
  2864. color: #ffffff;
  2865. cursor: pointer;
  2866. margin-right: 10px;
  2867. }
  2868. #chineseM {
  2869. height: 100%;
  2870. .table-container {
  2871. padding: 5px 0px;
  2872. // height: 340px;
  2873. height: calc(100% - 80px);
  2874. overflow: auto;
  2875. .t-con-header {
  2876. margin-bottom: 0px;
  2877. .t-con-radio {
  2878. flex: 1;
  2879. padding-bottom: 5px;
  2880. border-bottom: 1px solid #eaeaea;
  2881. }
  2882. .t-radio-title {
  2883. width: 82px;
  2884. font-size: 16px;
  2885. font-family: PingFang SC;
  2886. font-weight: 400;
  2887. color: #333333;
  2888. }
  2889. .t-radio-group {
  2890. flex: 1;
  2891. }
  2892. .add-presc1 {
  2893. width: 84px;
  2894. height: 34px;
  2895. background: #ffae45;
  2896. border-radius: 4px;
  2897. font-size: 14px;
  2898. font-family: PingFang SC;
  2899. font-weight: bold;
  2900. color: #ffffff;
  2901. cursor: pointer;
  2902. }
  2903. }
  2904. }
  2905. }
  2906. .table-show {
  2907. width: 100%;
  2908. // min-height: 212px;
  2909. overflow: auto;
  2910. // background: #5386F6;
  2911. // overflow: hidden;
  2912. z-index: 999;
  2913. position: relative;
  2914. .table-left-body {
  2915. width: 50%;
  2916. position: relative;
  2917. perspective: 100px;
  2918. // padding-bottom: 10px;
  2919. }
  2920. .table-left {
  2921. width: 100%;
  2922. overflow-y: auto;
  2923. border: 1px solid #dedede;
  2924. box-sizing: border-box;
  2925. // overflow-x: auto;
  2926. .table-l-hader {
  2927. white-space: nowrap;
  2928. div {
  2929. display: inline-block;
  2930. // padding: 15px 10px;
  2931. background: rgba($color: #5386f6, $alpha: 0.1);
  2932. text-align: center;
  2933. height: 48px;
  2934. line-height: 48px;
  2935. border: 1px solid #dedede;
  2936. border-bottom: 0 !important;
  2937. // border-top: 0 !important;
  2938. }
  2939. .med-name {
  2940. margin-left: 50px;
  2941. }
  2942. .kucun {
  2943. padding-right: 120px;
  2944. }
  2945. .fixed-r {
  2946. position: fixed;
  2947. right: 0;
  2948. }
  2949. .fixed-left {
  2950. position: fixed;
  2951. left: 0;
  2952. }
  2953. }
  2954. .table-l-item {
  2955. white-space: nowrap;
  2956. .bg-green {
  2957. .div1 {
  2958. background: rgba($color: #5386f6, $alpha: 0.1);
  2959. border: 1px solid #dedede;
  2960. }
  2961. }
  2962. .div1 {
  2963. display: inline-block;
  2964. // padding: 15px 10px;
  2965. background: #ffffff;
  2966. text-align: center;
  2967. height: 53px;
  2968. line-height: 53px;
  2969. border: 1px solid #dedede;
  2970. z-index: 9999;
  2971. border-top: 0 !important;
  2972. }
  2973. .med-name {
  2974. margin-left: 50px;
  2975. }
  2976. .kucun {
  2977. padding-right: 120px;
  2978. border-right: 1px solid #dedede;
  2979. }
  2980. .fixed-r {
  2981. position: fixed;
  2982. right: 0;
  2983. }
  2984. .fixed-left {
  2985. position: fixed;
  2986. left: 0;
  2987. // border-left: 1px solid #DEDEDE;
  2988. }
  2989. .no-data {
  2990. width: 100%;
  2991. box-sizing: border-box;
  2992. // border-top: 1px solid #DEDEDE;
  2993. position: relative;
  2994. left: 0;
  2995. right: 0;
  2996. bottom: 0px;
  2997. // float: left;
  2998. }
  2999. }
  3000. }
  3001. }
  3002. .operate {
  3003. width: 100%;
  3004. height: 100%;
  3005. display: flex;
  3006. align-items: center;
  3007. justify-content: space-around;
  3008. img {
  3009. width: 16px;
  3010. }
  3011. }
  3012. .bottom-input {
  3013. background: #fff;
  3014. padding: 12.5px 30px 12.5px 52px;
  3015. position: relative;
  3016. // z-index: 999;
  3017. // perspective: 100px;
  3018. .div {
  3019. width: 154px;
  3020. }
  3021. .table-choose {
  3022. z-index: 9999;
  3023. width: 332px;
  3024. height: 221px;
  3025. background: #ffffff;
  3026. border: 2px solid #d8d8d8;
  3027. position: relative;
  3028. top: 2px;
  3029. left: -48px;
  3030. overflow: auto;
  3031. .table-choose-h {
  3032. background: rgba($color: #5386f6, $alpha: 0.1);
  3033. div {
  3034. height: 36px;
  3035. width: 73px;
  3036. }
  3037. div:first-child {
  3038. width: 115px;
  3039. }
  3040. }
  3041. .t-c-b {
  3042. cursor: pointer;
  3043. height: 180px;
  3044. .td {
  3045. background: rgba($color: #5386f6, $alpha: 0.1);
  3046. }
  3047. p {
  3048. border: 1px solid #ededed;
  3049. height: 36px;
  3050. width: 73px;
  3051. // flex: 1;
  3052. box-sizing: border-box;
  3053. }
  3054. p:first-child {
  3055. width: 115px;
  3056. }
  3057. }
  3058. }
  3059. }
  3060. .table-bottom {
  3061. // position: absolute;
  3062. // bottom: 80px;
  3063. // right: 0;
  3064. // left: 0;
  3065. padding: 0 10px;
  3066. // margin-top: 241px;
  3067. margin-top: 5px;
  3068. z-index: -1;
  3069. .header-about {
  3070. .item {
  3071. margin-right: 5px;
  3072. margin-bottom: 8px;
  3073. span {
  3074. font-size: 14px;
  3075. font-family: PingFang SC;
  3076. font-weight: 400;
  3077. color: #333333;
  3078. }
  3079. .div1 {
  3080. width: 40px;
  3081. }
  3082. .div2 {
  3083. width: 72px;
  3084. }
  3085. .city1 {
  3086. width: 140px;
  3087. }
  3088. .div3 {
  3089. width: 70px;
  3090. }
  3091. .div4 {
  3092. width: 160px;
  3093. }
  3094. .div5 {
  3095. width: 88px;
  3096. }
  3097. .input-suffix {
  3098. line-height: 28px;
  3099. }
  3100. }
  3101. .right {
  3102. width: 62px;
  3103. height: 26px;
  3104. background: #ffae45;
  3105. border-radius: 4px;
  3106. font-size: 12px;
  3107. font-family: PingFang SC;
  3108. font-weight: 400;
  3109. color: #ffffff;
  3110. margin-bottom: 10px;
  3111. cursor: pointer;
  3112. }
  3113. }
  3114. }
  3115. .table-b-bottom {
  3116. padding: 5px 5px;
  3117. border-top: 2px solid #dedede;
  3118. // margin-top: 10px;
  3119. // position: absolute;
  3120. // bottom: 0;
  3121. // left: 0;
  3122. // right: 0;
  3123. .t-b-l-item {
  3124. font-size: 14px;
  3125. font-family: PingFang SC;
  3126. font-weight: 400;
  3127. color: #333333;
  3128. margin-right: 8px;
  3129. span {
  3130. color: #ff6245;
  3131. }
  3132. }
  3133. .t-b-b-right {
  3134. div {
  3135. width: 130px;
  3136. height: 46px;
  3137. background: #ffae45;
  3138. border-radius: 4px;
  3139. font-size: 16px;
  3140. font-family: PingFang SC;
  3141. font-weight: 500;
  3142. color: #ffffff;
  3143. cursor: pointer;
  3144. }
  3145. .bg-green {
  3146. background: #5386f6;
  3147. margin-left: 20px;
  3148. }
  3149. }
  3150. }
  3151. // 中成药 和适宜技术配方
  3152. .chinese_medicine {
  3153. padding: 0 37px;
  3154. .clearer {
  3155. width: 84px;
  3156. height: 34px;
  3157. background: #ffae45;
  3158. border-radius: 4px;
  3159. font-size: 14px;
  3160. font-family: PingFang SC;
  3161. font-weight: bold;
  3162. color: #ffffff;
  3163. cursor: pointer;
  3164. margin-bottom: 20px;
  3165. }
  3166. .c-m-table {
  3167. width: 100%;
  3168. overflow: hidden;
  3169. .unit {
  3170. font-size: 14px;
  3171. font-family: PingFang SC;
  3172. font-weight: 400;
  3173. color: #000000;
  3174. // margin-left: 10px;
  3175. }
  3176. .input {
  3177. width: 40px;
  3178. }
  3179. }
  3180. }
  3181. .operate {
  3182. width: 100%;
  3183. height: 100%;
  3184. display: flex;
  3185. align-items: center;
  3186. justify-content: space-around;
  3187. img {
  3188. width: 16px;
  3189. }
  3190. }
  3191. .operate2 {
  3192. position: absolute;
  3193. z-index: 99;
  3194. }
  3195. .operate1 {
  3196. position: fixed;
  3197. width: 50px;
  3198. // background: red;
  3199. right: 15px;
  3200. // top: 63px;
  3201. text-align: right;
  3202. img {
  3203. width: 16px;
  3204. }
  3205. }
  3206. .bottom-input {
  3207. background: #fff;
  3208. padding: 12.5px 30px 12.5px 52px;
  3209. position: relative;
  3210. // z-index: 999;
  3211. // perspective: 100px;
  3212. .div {
  3213. width: 154px;
  3214. }
  3215. .table-choose {
  3216. // z-index: 9999;
  3217. width: 332px;
  3218. height: 221px;
  3219. background: #ffffff;
  3220. border: 2px solid #d8d8d8;
  3221. position: relative;
  3222. top: 2px;
  3223. left: -48px;
  3224. overflow: auto;
  3225. .table-choose-h {
  3226. background: rgba($color: #5386f6, $alpha: 0.1);
  3227. div {
  3228. height: 36px;
  3229. width: 73px;
  3230. }
  3231. div:first-child {
  3232. width: 115px;
  3233. }
  3234. }
  3235. .t-c-b {
  3236. cursor: pointer;
  3237. height: 180px;
  3238. .td {
  3239. background: rgba($color: #5386f6, $alpha: 0.1);
  3240. }
  3241. p {
  3242. border: 1px solid #ededed;
  3243. height: 36px;
  3244. width: 73px;
  3245. // flex: 1;
  3246. box-sizing: border-box;
  3247. }
  3248. p:first-child {
  3249. width: 115px;
  3250. }
  3251. }
  3252. }
  3253. }
  3254. .t_dose {
  3255. position: relative;
  3256. // perspective: 100px;
  3257. .dose-section {
  3258. z-index: 999999 !important;
  3259. position: fixed;
  3260. width: 50px;
  3261. //left: 136px;
  3262. left: 196px;
  3263. // right: 0;
  3264. top: 8px;
  3265. height: 22px;
  3266. line-height: 22px;
  3267. border-radius: 4px;
  3268. background: rgba($color: #000000, $alpha: 0.7);
  3269. color: #fff;
  3270. span {
  3271. font-size: 12px;
  3272. }
  3273. }
  3274. }
  3275. .table-choose3 {
  3276. z-index: 999999 !important;
  3277. // width: 332px;
  3278. width: 532px;
  3279. height: 221px;
  3280. background: #ffffff;
  3281. border: 2px solid #d8d8d8;
  3282. position: fixed;
  3283. top: 44px;
  3284. left: 84px;
  3285. margin-top: 19px;
  3286. overflow: auto;
  3287. .table-choose-h {
  3288. background: rgba($color: #5386f6, $alpha: 0.1);
  3289. div {
  3290. height: 36px;
  3291. width: 73px;
  3292. }
  3293. div:first-child {
  3294. width: 115px;
  3295. }
  3296. div:nth-child(2),
  3297. div:nth-child(3) {
  3298. width: 173px;
  3299. }
  3300. }
  3301. .t-c-b {
  3302. cursor: pointer;
  3303. height: 180px;
  3304. .td {
  3305. background: rgba($color: #5386f6, $alpha: 0.1);
  3306. }
  3307. p {
  3308. border: 1px solid #ededed;
  3309. height: 36px;
  3310. width: 73px;
  3311. // flex: 1;
  3312. box-sizing: border-box;
  3313. }
  3314. p:first-child {
  3315. width: 115px;
  3316. }
  3317. p:nth-child(2),
  3318. p:nth-child(3) {
  3319. width: 173px;
  3320. }
  3321. }
  3322. }
  3323. .header-about::v-deep .el-input__inner {
  3324. padding: 0 5px;
  3325. }
  3326. .header-about::v-deep .el-checkbox {
  3327. margin-right: 5px;
  3328. }
  3329. .header-about::v-deep .el-checkbox__label {
  3330. padding-left: 5px;
  3331. }
  3332. .table-container::v-deep .el-radio {
  3333. margin-right: 5px;
  3334. }
  3335. .table-container::v-deep .el-radio__label {
  3336. padding-left: 2px;
  3337. font-size: 12px;
  3338. }
  3339. .table-show::v-deep .el-table {
  3340. // z-index: 999;
  3341. }
  3342. .table-show::v-deep .el-table th {
  3343. padding: 2px 0;
  3344. }
  3345. .table-show::v-deep .el-table td {
  3346. padding: 2px 0;
  3347. }
  3348. .table-show::v-deep .el-table__empty-block {
  3349. min-height: 29px;
  3350. }
  3351. .table-left-body::v-deep .el-table th {
  3352. background: rgba($color: #5386f6, $alpha: 0.1);
  3353. }
  3354. .collapse ::v-deep .el-collapse-item__content {
  3355. padding-bottom: 5px;
  3356. }
  3357. .c-m-table::v-deep .el-table .cell {
  3358. text-align: center;
  3359. }
  3360. .table-show::v-deep .el-table .cell {
  3361. text-align: center;
  3362. padding: 0 0;
  3363. }
  3364. .c-m-table::v-deep .el-select input {
  3365. padding: 0 15px 0 5px;
  3366. }
  3367. .table-show ::v-deep .el-select input {
  3368. padding: 0 15px 0 5px;
  3369. }
  3370. .t_dose::v-deep .el-input__inner {
  3371. // text-align: left;
  3372. padding: 0 5px !important;
  3373. }
  3374. .city::v-deep .el-select input {
  3375. padding: 0 20px 0 10px;
  3376. // height: 32px;
  3377. }
  3378. .xuewei::v-deep .el-select {
  3379. width: 100%;
  3380. }
  3381. .form-item {
  3382. margin-bottom: 20px;
  3383. span {
  3384. font-size: 16px;
  3385. font-family: PingFang SC;
  3386. font-weight: 400;
  3387. color: #ff3a3a;
  3388. display: inline-block;
  3389. width: 8px;
  3390. }
  3391. .name {
  3392. font-size: 16px;
  3393. font-family: PingFang SC;
  3394. font-weight: 400;
  3395. color: #333;
  3396. }
  3397. .input {
  3398. width: 260px;
  3399. }
  3400. }
  3401. .operate2::v-deep .el-input__inner {
  3402. padding: 0 5px;
  3403. }
  3404. .daijiao-check {
  3405. margin-right: 8px;
  3406. .img-body {
  3407. width: 16px;
  3408. height: 16px;
  3409. box-sizing: border-box;
  3410. border: 1px solid #dcdfe6;
  3411. font-size: 0;
  3412. img {
  3413. width: 14px;
  3414. height: 14px;
  3415. }
  3416. }
  3417. .active {
  3418. border: 0px solid #5386f6;
  3419. img {
  3420. width: 17px;
  3421. height: 17px;
  3422. }
  3423. }
  3424. span {
  3425. font-size: 14px;
  3426. margin-left: 5px;
  3427. cursor: pointer;
  3428. }
  3429. }
  3430. </style>
  3431. <style lang="scss" scoped>
  3432. @media screen and (max-width: 768px) {
  3433. .table-header .table-label .label-item {
  3434. width: auto;
  3435. padding: 0 10px;
  3436. }
  3437. .table-header .table-label span {
  3438. font-size: 12px;
  3439. }
  3440. .el-button--mini {
  3441. padding: 5px 10px;
  3442. }
  3443. .table-container ::v-deep .el-radio__label {
  3444. font-size: 11px;
  3445. }
  3446. ::v-deep {
  3447. .el-radio__inner {
  3448. width: 12px;
  3449. height: 12px;
  3450. }
  3451. }
  3452. .table-left-body ::v-deep .el-table th {
  3453. font-size: 12px;
  3454. }
  3455. .table-show ::v-deep .el-table td {
  3456. font-size: 12px;
  3457. }
  3458. .table-bottom .header-about .item span {
  3459. font-size: 12px;
  3460. }
  3461. .table-b-bottom .t-b-l-item {
  3462. font-size: 12px;
  3463. }
  3464. .table-show {
  3465. // height: 335px;
  3466. height: calc(100% - 136px);
  3467. }
  3468. }
  3469. </style>