ChineseMedicine.vue 116 KB

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