ChineseMedicine copy.vue 98 KB

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