MedicineAccord.vue 94 KB

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