| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739 |
- <template>
- <div>
- <div class="table-header flex-vertical-between">
- <div class="table-label flex-vertical-center-l">
- <div class="label-item flex-center" v-for="(item,index) in recipe_tabs" :key="'a'+index">
- <span
- :class="recipe_tabs_c==index?'l_active':''"
- @click="recipeChange(index)"
- >{{item.name}}</span>
- <div
- @click="recipeDelete(index)"
- v-show="!recipe_tabs[index].isPay && recipe_tabs[index].paystate==0"
- >X</div>
- <img
- src="../assets/new-icon/isPay.png"
- v-show="recipe_tabs[index].isPay || recipe_tabs[index].paystate==1"
- />
- </div>
- <!-- <el-button size="mini" type="warning" icon="el-icon-plus" @click="addRecipeTba()"></el-button> -->
- </div>
- <div class="flex flex-col-center flex-row-r">
- <!-- <div class="add-presc flex-center" @click="addRecipeTba()">新增处方</div> -->
- <!-- <el-popover placement="left" width="300" trigger="click">
- <el-button size="mini" type="warning" slot="reference">兼证加减</el-button>
- <template>
- <accompanied></accompanied>
- </template>
- </el-popover>-->
- <el-button size="mini" type="warning" @click="addRecipeTba()" style="margin-left:10px;">新增处方</el-button>
- <el-button size="mini" type="primary" @click="openSafeDrug" v-if="isShrink">安全合理用药检测</el-button>
- <!-- <div class="add-presc flex-center" @click="clearRecipe()">清空处方</div> -->
- <el-button size="mini" type="warning" @click="clearRecipe()">清空处方</el-button>
- </div>
- </div>
- <div class="table-container">
- <div class="t-con-header flex-vertical-between">
- <div class="t-con-radio flex-vertical-center-l" v-if="false">
- <span class="t-radio-title">选择药房:</span>
- <div class="t-radio-group">
- <el-select
- v-model="recipe_tabs[recipe_tabs_c].pharmacyID"
- :disabled="recipe_tabs[recipe_tabs_c].disable"
- placeholder="请选择"
- @change="changePharmacy(recipe_tabs[recipe_tabs_c].lastType)"
- >
- <el-option
- :label="item.pharmacyName"
- :value="item.pid"
- v-for="(item,index) in pharmacyList"
- :key="'b'+index"
- ></el-option>
- </el-select>
- </div>
- </div>
- <!-- @change="getPharmacyID" -->
- <!-- @change="changePharmacy(recipe_tabs[recipe_tabs_c].lastType)" -->
- <div class="t-con-radio flex-vertical-center-l">
- <div class="t-radio-group">
- <el-radio-group
- v-model="recipe_tabs[recipe_tabs_c].radio"
- :disabled="recipe_tabs[recipe_tabs_c].disable"
- >
- <el-radio
- :label="item.ptype"
- v-for="(item,index) in pharmacyTypes"
- :key="index"
- @click.native.prevent="changePharmacy(recipe_tabs[recipe_tabs_c].lastType,item.ptype)"
- >
- <span>{{item.name}}</span>
- </el-radio>
- </el-radio-group>
- </div>
- </div>
- <!-- <div class="add-presc1 flex-center" @click="clearRecipe()">清空处方</div> -->
- </div>
- <div class="table-bottom" v-if="false">
- <div class="header-about flex-vertical-center-l flex-wrap" v-if="container_i!=2">
- <div class="item flex-vertical-center-l">
- <!-- <span>配送:</span>
- <div class="div3">
- <el-radio-group v-model="recipe_tabs[recipe_tabs_c].bottom_form.radio"
- @change="getaddress">
- <el-radio label="0">是</el-radio>
- <el-radio label="1">否</el-radio>
- </el-radio-group>
- </div>-->
- <!-- <div>
- <el-checkbox @change="changeDaijian" v-model="recipe_tabs[recipe_tabs_c].bottom_form.isDaiJian">代煎
- </el-checkbox>
- </div>-->
- <div class="daijiao-check flex flex-row-left flex-col-center" @click="changeDaijian">
- <div
- :class="['img-body',recipe_tabs[recipe_tabs_c].bottom_form.isDaiJian==1?'active':'']"
- >
- <img
- src="~@/assets/new-icon/checked.png"
- alt
- v-if="recipe_tabs[recipe_tabs_c].bottom_form.isDaiJian==1"
- />
- </div>
- <span>代煎</span>
- </div>
- <!-- <el-checkbox @change="changePeiSong" :checked="recipe_tabs[recipe_tabs_c].bottom_form.radio==0">配送
- </el-checkbox>-->
- <div class="daijiao-check flex flex-row-left flex-col-center" @click="changePeiSong">
- <div
- :class="['img-body',recipe_tabs[recipe_tabs_c].bottom_form.radio==0?'active':'']"
- >
- <img
- src="~@/assets/new-icon/checked.png"
- alt
- v-if="recipe_tabs[recipe_tabs_c].bottom_form.radio==0"
- />
- </div>
- <span>配送</span>
- </div>
- </div>
- <div
- class="item flex-vertical-center-l"
- v-if="recipe_tabs[recipe_tabs_c].bottom_form.radio==0"
- >
- <span>收货人:</span>
- <div class="div3">
- <el-input
- size="mini"
- placeholder="请输入"
- v-model="recipe_tabs[recipe_tabs_c].bottom_form.savename"
- ></el-input>
- </div>
- </div>
- <div
- class="item flex-vertical-center-l"
- v-if="recipe_tabs[recipe_tabs_c].bottom_form.radio==0"
- >
- <span>电话:</span>
- <div class="div5">
- <el-input
- size="mini"
- placeholder="请输入"
- v-model="recipe_tabs[recipe_tabs_c].bottom_form.phone"
- ></el-input>
- </div>
- </div>
- <div
- class="item flex-vertical-center-l flex-wrap"
- v-if="recipe_tabs[recipe_tabs_c].bottom_form.radio==0"
- >
- <span>地址:</span>
- <div class="city1 city">
- <el-select
- size="mini"
- v-model="recipe_tabs[recipe_tabs_c].bottom_form.province"
- placeholder="选择省"
- @change="proC($event)"
- >
- <el-option
- :label="item.name"
- :value="item.code"
- v-for="(item,index) in recipe_tabs[recipe_tabs_c].bottom_form.provinceList"
- :key="'m'+index"
- ></el-option>
- </el-select>
- </div>
- <div class="city1 city">
- <el-select
- size="mini"
- v-model="recipe_tabs[recipe_tabs_c].bottom_form.city"
- placeholder="选择市"
- @change="cityC($event)"
- >
- <el-option
- :label="item.name"
- :value="item.code"
- v-for="(item,index) in recipe_tabs[recipe_tabs_c].bottom_form.cityList"
- :key="'n'+index"
- ></el-option>
- </el-select>
- </div>
- <div class="city1 city">
- <el-select
- size="mini"
- v-model="recipe_tabs[recipe_tabs_c].bottom_form.area"
- placeholder="选择区"
- >
- <el-option
- :label="item.name"
- :value="item.code"
- v-for="(item,index) in recipe_tabs[recipe_tabs_c].bottom_form.areaList"
- :key="'o'+index"
- ></el-option>
- </el-select>
- </div>
- <!-- div4 -->
- <div class="city1 city">
- <el-input
- size="mini"
- placeholder="请输入详细地址"
- v-model="recipe_tabs[recipe_tabs_c].bottom_form.address"
- ></el-input>
- </div>
- </div>
- <div
- class="right flex-center"
- v-if="recipe_tabs[recipe_tabs_c].bottom_form.radio ==0"
- @click="getAddressForHospital"
- >寄到本院</div>
- <!-- 数据会更新到这个组件里面 -->
- </div>
- </div>
- <div class="table-msg">
- <!-- 表格 -->
- <div class="table-show flex-plane-t-between flex-wrap">
- <!-- 表一和表二 -->
- <div class="table-left-body">
- <div class="table-left" v-if="true">
- <el-table
- :data="recipe_tabs[recipe_tabs_c].tableData"
- style="width:100%;"
- :span-method="arraySpanMethod1"
- id="table1"
- >
- <el-table-column prop="id" label width="20">
- <template slot-scope="scope">
- <!-- width:110px -->
- <!-- v-model="scope.row.key" -->
- <div v-if="!scope.row.name" class="flex-vertical-between">
- <div style="width:80px;" class="operate2" id="operate2">
- <el-input
- :value="scope.row.key"
- :id="'searchD'+scope.row.id"
- size="mini"
- placeholder="请输入..."
- @input="searchDrug($event,scope)"
- @focus="drugFocus(scope)"
- @blur="drugBlur($event,scope)"
- @keydown.down.native="drugDown($event,scope)"
- @keydown.up.native="drugUp($event,scope)"
- @keydown.enter.native="drugEnter(scope)"
- :disabled="recipe_tabs[recipe_tabs_c].disable"
- ></el-input>
- <div
- class="table-choose3"
- v-if="scope.row.key"
- :style="medIndex==0?'':{top:(medIndex*35)+'px'}"
- >
- <div class="table-choose-h flex-vertical-between">
- <div class="flex-center">药品名称</div>
- <div class="flex-center">规格</div>
- <div class="flex-center">产地</div>
- <div class="flex-center">单价</div>
- <div class="flex-center">库存</div>
- </div>
- <div
- class="t-c-b infinite-list"
- v-infinite-scroll="load"
- :infinite-scroll-immediate="false"
- :id="'infiniteList'+scope.row.id"
- :ref="'infiniteList'+scope.row.id"
- style="overflow:auto"
- >
- <div
- class="infinite-list-item flex-vertical-between"
- :style="scope.row.search_i===index1?'background: #EDF3FE;':''"
- @click="chooseDis1(scope,index1,item1)"
- v-for="(item1,index1) in scope.row.drugList"
- :key="scope.row.id+'f'+index1"
- >
- <p class="flex-center">{{item1.ypmc}}</p>
- <p class="flex-center">{{item1.gg}}</p>
- <p class="flex-center">{{item1.cdmc}}</p>
- <p class="flex-center">{{item1.price}}</p>
- <p class="flex-center">{{item1.kc}}</p>
- </div>
- </div>
- </div>
- </div>
- <!-- <div class="operate1"
- v-if="scope.row.id!==recipe_tabs[recipe_tabs_c].totalTableD.length && !scope.row.name">
- <img src="../assets/delete1.png" alt="" @click="deleteDis1(scope)" />
- </div>-->
- </div>
- <!-- -->
- <div v-else>{{scope.row.id}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="name" label="药品名称" width="80">
- <template slot-scope="scope" v-if="scope.row.name">
- <div
- @click="clickName(scope)"
- v-if="!scope.row.showSearch"
- :style="{'color':scope.row.color?scope.row.color:''}"
- >{{scope.row.name}}</div>
- <div v-else class="flex-vertical-between">
- <div style="width:110px;">
- <el-input
- :value="scope.row.key"
- :id="'searchD'+scope.row.id"
- size="mini"
- :placeholder="scope.row.name"
- @input="searchDrug($event,scope)"
- @blur="drugBlur1($event,scope)"
- @keydown.down.native="drugDown($event,scope)"
- @keydown.up.native="drugUp($event,scope)"
- @keydown.enter.native="drugEnter(scope)"
- :disabled="recipe_tabs[recipe_tabs_c].disable"
- ></el-input>
- <!-- v-model="scope.row.key" -->
- <div
- class="table-choose3"
- v-if="scope.row.key"
- :style="medIndex==0?'':{top:(medIndex*35)+'px'}"
- >
- <div class="table-choose-h flex-vertical-between">
- <div class="flex-center">药品名称</div>
- <div class="flex-center">规格</div>
- <div class="flex-center">产地</div>
- <div class="flex-center">单价</div>
- <div class="flex-center">库存</div>
- </div>
- <!-- -->
- <div
- class="t-c-b infinite-list"
- v-infinite-scroll="load"
- :infinite-scroll-immediate="false"
- :id="'infiniteList'+scope.row.id"
- :ref="'infiniteList'+scope.row.id"
- style="overflow:auto"
- v-if="scope.row.drugList.length>0"
- >
- <div
- class="infinite-list-item flex-vertical-between"
- :style="scope.row.search_i===index1?'background: #EDF3FE;':''"
- @click="chooseDis1(scope,index1,item1)"
- v-for="(item1,index1) in scope.row.drugList"
- :key="scope.row.id+'g'+index1"
- >
- <p class="flex-center">{{item1.ypmc}}</p>
- <p class="flex-center">{{item1.gg}}</p>
- <p class="flex-center">{{item1.cdmc}}</p>
- <p class="flex-center">{{item1.price}}</p>
- <p class="flex-center">{{item1.kc}}</p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="spec" label="规格" width="100"></el-table-column>
- <el-table-column prop="dose" label="剂量" width="40">
- <template slot-scope="scope" v-if="scope.row.name">
- <div class="t_dose">
- <el-input
- :value="scope.row.dose==0?'':scope.row.dose"
- size="mini"
- @blur="doseBlur(scope)"
- @focus="doseFocus(scope)"
- @input="countDoseMoney($event,scope)"
- :id="'dose'+scope.row.id"
- :disabled="recipe_tabs[recipe_tabs_c].disable"
- :placeholder="scope.row.oldDose?'原'+scope.row.oldDose+'克':''"
- @keydown.enter.native="doseEnter(scope)"
- ></el-input>
- <div
- class="dose-section"
- :style="{top:scope.$index==0?'':((scope.$index)*35)+'px'}"
- v-if="minDose && maxDose && doseId == scope.row.medid"
- >
- <span>{{minDose}}</span>~
- <span>{{maxDose}}</span>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="unit" label="单位" width="40"></el-table-column>
- <!-- <el-table-column prop="inventory" label="库存" width="80">
- </el-table-column>-->
- <!-- width="80" -->
- <el-table-column prop="usage" label="用法">
- <template slot-scope="scope" v-if="scope.row.name">
- <el-select
- v-model="scope.row.usage"
- placeholder="请选择"
- size="mini"
- @change="usageC($event,scope)"
- :disabled="recipe_tabs[recipe_tabs_c].disable"
- >
- <el-option
- :label="item.value"
- :value="item.key"
- v-for="(item,index) in usageList"
- :key="scope.row.id+'h'+index"
- ></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column prop="price" label="单价" width="50"></el-table-column>
- <el-table-column prop="total" label="小计" width="50">
- <template slot-scope="scope" v-if="scope.row.name">
- <div>{{scope.row.total | formatTotal}}</div>
- </template>
- </el-table-column>
- <el-table-column label="操作" width="64">
- <template slot-scope="scope">
- <div class="operate" v-if="scope.row.name">
- <div>
- <img
- src="../assets/add.png"
- alt
- @click="addDis1(scope)"
- v-if="!recipe_tabs[recipe_tabs_c].disable"
- />
- </div>
- <div>
- <img
- src="../assets/delete1.png"
- alt
- @click="deleteDis1(scope)"
- v-if="!recipe_tabs[recipe_tabs_c].disable"
- />
- </div>
- <div>
- <img src="../assets/find.png" alt @click="findDrug(scope)" />
- </div>
- </div>
- <div
- class="operate"
- v-else-if="scope.row.id==recipe_tabs[recipe_tabs_c].totalTableD.length && !scope.row.name"
- >
- <div style="opacity:0;">
- <img src="../assets/find.png" alt />
- </div>
- </div>
- <div v-else class="operate">
- <div v-if="scope.row.id!==recipe_tabs[recipe_tabs_c].totalTableD.length">
- <img
- src="../assets/delete1.png"
- alt
- @click="deleteDis1(scope)"
- v-if="!recipe_tabs[recipe_tabs_c].disable"
- />
- </div>
- </div>
- </template>
- </el-table-column>
- <div slot="empty"></div>
- </el-table>
- </div>
- </div>
- <div class="table-left-body">
- <div class="table-left" v-if="true">
- <el-table
- :data="recipe_tabs[recipe_tabs_c].tableData1"
- :span-method="arraySpanMethod1"
- id="table1"
- >
- <el-table-column prop="id" label width="20">
- <template slot-scope="scope">
- <!-- width:110px -->
- <!-- v-model="scope.row.key" -->
- <div v-if="!scope.row.name" class="flex-vertical-between">
- <div style="width:80px;" class="operate2" id="operate2">
- <el-input
- :value="scope.row.key"
- :id="'searchD'+scope.row.id"
- size="mini"
- placeholder="请输入..."
- @input="searchDrug($event,scope)"
- @focus="drugFocus(scope)"
- @blur="drugBlur($event,scope)"
- @keydown.down.native="drugDown($event,scope)"
- @keydown.up.native="drugUp($event,scope)"
- @keydown.enter.native="drugEnter(scope)"
- :disabled="recipe_tabs[recipe_tabs_c].disable"
- ></el-input>
- <div
- class="table-choose3"
- v-if="scope.row.key"
- :style="medIndex==0?'':{top:(medIndex*35)+'px'}"
- >
- <div class="table-choose-h flex-vertical-between">
- <div class="flex-center">药品名称</div>
- <div class="flex-center">规格</div>
- <div class="flex-center">产地</div>
- <div class="flex-center">单价</div>
- <div class="flex-center">库存</div>
- </div>
- <div
- class="t-c-b infinite-list"
- v-infinite-scroll="load"
- :infinite-scroll-immediate="false"
- :id="'infiniteList'+scope.row.id"
- :ref="'infiniteList'+scope.row.id"
- style="overflow:auto"
- >
- <div
- class="infinite-list-item flex-vertical-between"
- :style="scope.row.search_i===index1?'background: #EDF3FE;':''"
- @click="chooseDis1(scope,index1,item1)"
- v-for="(item1,index1) in scope.row.drugList"
- :key="scope.row.id+'f'+index1"
- >
- <p class="flex-center">{{item1.ypmc}}</p>
- <p class="flex-center">{{item1.gg}}</p>
- <p class="flex-center">{{item1.cdmc}}</p>
- <p class="flex-center">{{item1.price}}</p>
- <p class="flex-center">{{item1.kc}}</p>
- </div>
- </div>
- </div>
- </div>
- <!-- <div class="operate1"
- v-if="scope.row.id!==recipe_tabs[recipe_tabs_c].totalTableD.length && !scope.row.name">
- <img src="../assets/delete1.png" alt="" @click="deleteDis1(scope)" />
- </div>-->
- </div>
- <!-- -->
- <div v-else>{{scope.row.id}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="name" label="药品名称" width="80">
- <template slot-scope="scope" v-if="scope.row.name">
- <div
- @click="clickName(scope)"
- v-if="!scope.row.showSearch"
- :style="{'color':scope.row.color?scope.row.color:''}"
- >{{scope.row.name}}</div>
- <div v-else class="flex-vertical-between">
- <div style="width:110px;">
- <el-input
- :value="scope.row.key"
- :id="'searchD'+scope.row.id"
- size="mini"
- :placeholder="scope.row.name"
- @input="searchDrug($event,scope)"
- @blur="drugBlur1($event,scope)"
- @keydown.down.native="drugDown($event,scope)"
- @keydown.up.native="drugUp($event,scope)"
- @keydown.enter.native="drugEnter(scope)"
- :disabled="recipe_tabs[recipe_tabs_c].disable"
- ></el-input>
- <!-- v-model="scope.row.key" -->
- <div
- class="table-choose3"
- v-if="scope.row.key"
- :style="medIndex==0?'':{top:(medIndex*35)+'px'}"
- >
- <div class="table-choose-h flex-vertical-between">
- <div class="flex-center">药品名称</div>
- <div class="flex-center">规格</div>
- <div class="flex-center">产地</div>
- <div class="flex-center">单价</div>
- <div class="flex-center">库存</div>
- </div>
- <!-- -->
- <div
- class="t-c-b infinite-list"
- v-infinite-scroll="load"
- :infinite-scroll-immediate="false"
- :id="'infiniteList'+scope.row.id"
- :ref="'infiniteList'+scope.row.id"
- style="overflow:auto"
- v-if="scope.row.drugList.length>0"
- >
- <div
- class="infinite-list-item flex-vertical-between"
- :style="scope.row.search_i===index1?'background: #EDF3FE':''"
- @click="chooseDis1(scope,index1,item1)"
- v-for="(item1,index1) in scope.row.drugList"
- :key="scope.row.id+'g'+index1"
- >
- <p class="flex-center">{{item1.ypmc}}</p>
- <p class="flex-center">{{item1.gg}}</p>
- <p class="flex-center">{{item1.cdmc}}</p>
- <p class="flex-center">{{item1.price}}</p>
- <p class="flex-center">{{item1.kc}}</p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- </el-table-column>
- <!-- fixed="left" -->
- <el-table-column prop="spec" label="规格" width="100"></el-table-column>
- <el-table-column prop="dose" label="剂量" width="40">
- <template slot-scope="scope" v-if="scope.row.name">
- <div class="t_dose">
- <el-input
- :value="scope.row.dose==0?'':scope.row.dose"
- size="mini"
- @blur="doseBlur(scope)"
- @focus="doseFocus(scope)"
- @input="countDoseMoney($event,scope)"
- :id="'dose'+scope.row.id"
- :disabled="recipe_tabs[recipe_tabs_c].disable"
- :placeholder="scope.row.oldDose?'原'+scope.row.oldDose+'克':''"
- @keydown.enter.native="doseEnter(scope)"
- ></el-input>
- <div
- class="dose-section"
- :style="{top:scope.$index==0?'':((scope.$index)*35)+'px'}"
- v-if="minDose && maxDose && doseId == scope.row.medid"
- >
- <span>{{minDose}}</span>~
- <span>{{maxDose}}</span>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="unit" label="单位" width="40"></el-table-column>
- <!-- <el-table-column prop="inventory" label="库存" width="80">
- </el-table-column>-->
- <el-table-column prop="usage" label="用法">
- <template slot-scope="scope" v-if="scope.row.name">
- <el-select
- v-model="scope.row.usage"
- placeholder="请选择"
- size="mini"
- @change="usageC($event,scope)"
- :disabled="recipe_tabs[recipe_tabs_c].disable"
- >
- <el-option
- :label="item.value"
- :value="item.key"
- v-for="(item,index) in scope.row.usageList"
- :key="scope.row.id+'h'+index"
- ></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column prop="price" label="单价" width="50"></el-table-column>
- <el-table-column prop="total" label="小计" width="50">
- <template slot-scope="scope" v-if="scope.row.name">
- <div>{{scope.row.total | formatTotal}}</div>
- </template>
- </el-table-column>
- <el-table-column label="操作" width="64">
- <template slot-scope="scope">
- <div class="operate" v-if="scope.row.name">
- <div>
- <img
- src="../assets/add.png"
- alt
- @click="addDis1(scope)"
- v-if="!recipe_tabs[recipe_tabs_c].disable"
- />
- </div>
- <div>
- <img
- src="../assets/delete1.png"
- alt
- @click="deleteDis1(scope)"
- v-if="!recipe_tabs[recipe_tabs_c].disable"
- />
- </div>
- <div>
- <img src="../assets/find.png" alt @click="findDrug(scope)" />
- </div>
- </div>
- <div
- class="operate"
- v-else-if="scope.row.id==recipe_tabs[recipe_tabs_c].totalTableD.length && !scope.row.name"
- >
- <div style="opacity:0;">
- <img src="../assets/find.png" alt />
- </div>
- </div>
- <div v-else class="operate">
- <div v-if="scope.row.id!==recipe_tabs[recipe_tabs_c].totalTableD.length">
- <img
- src="../assets/delete1.png"
- alt
- @click="deleteDis1(scope)"
- v-if="!recipe_tabs[recipe_tabs_c].disable"
- />
- </div>
- </div>
- </template>
- </el-table-column>
- <div slot="empty"></div>
- </el-table>
- </div>
- </div>
- </div>
- <!-- 底部处方 -->
- <div class="table-bottom">
- <div class="table-b-header">
- <div class="flex-vertical-center-l header-about flex-wrap" v-if="container_i==0">
- <div class="item flex-vertical-center-l">
- <span>剂数:</span>
- <div class="div1">
- <el-input
- size="mini"
- placeholder="剂数"
- v-model="recipe_tabs[recipe_tabs_c].bottom_form.doseNum"
- @change="doseNumC()"
- ></el-input>
- </div>
- </div>
- <div class="item flex-vertical-center-l">
- <span>剂型:</span>
- <div class="div2">
- <!-- :disabled="recipe_tabs[recipe_tabs_c].disable" -->
- <el-select
- size="mini"
- @change="countNowRecipeMoney()"
- v-model="recipe_tabs[recipe_tabs_c].bottom_form.doseType"
- placeholder="请选择"
- >
- <el-option
- :label="item.value"
- :value="item.key"
- v-for="(item,index) in recipe_tabs[recipe_tabs_c].bottom_form.doseTypeList"
- :key="'i'+index"
- ></el-option>
- <!-- for 有问题 -->
- </el-select>
- </div>
- </div>
- <div class="item flex-vertical-center-l">
- <span>处方用法:</span>
- <div class="div2">
- <!-- :disabled="recipe_tabs[recipe_tabs_c].disable" -->
- <el-select
- size="mini"
- v-model="recipe_tabs[recipe_tabs_c].bottom_form.usege"
- placeholder="请选择"
- >
- <el-option
- :label="item.value"
- :value="item.key"
- v-for="(item,index) in recipe_tabs[recipe_tabs_c].bottom_form.usegeList"
- :key="'j'+index"
- ></el-option>
- </el-select>
- </div>
- </div>
- <div
- class="item flex-vertical-center-l"
- v-if="recipe_tabs[recipe_tabs_c].bottom_form.doseType=='0'"
- >
- <span>浓煎每次:</span>
- <!--浓煎-->
- <div class="div2" style="width:70px;">
- <!-- :disabled="recipe_tabs[recipe_tabs_c].disable" -->
- <el-select
- size="mini"
- v-model="recipe_tabs[recipe_tabs_c].bottom_form.nongjian"
- placeholder="请选择"
- >
- <el-option label="50ml" value="50"></el-option>
- <el-option label="100ml" value="100"></el-option>
- <el-option label="150ml" value="150"></el-option>
- <el-option label="200ml" value="200"></el-option>
- <el-option label="250ml" value="250"></el-option>
- <el-option label="300ml" value="300"></el-option>
- <el-option label="400ml" value="400"></el-option>
- <el-option label="500ml" value="500"></el-option>
- <el-option label="1000ml" value="1000"></el-option>
- </el-select>
- </div>
- </div>
- <!-- <div class="item flex-vertical-center-l" v-if="recipe_tabs[recipe_tabs_c].bottom_form.doseType=='1'">
- <span>代煎:</span>
- <div class="div1" style="width:50px;">
- <el-input size="mini" placeholder="剂数" @blur="countNowRecipeMoney"
- v-model="recipe_tabs[recipe_tabs_c].bottom_form.daijian">
- <div slot="suffix" class="input-suffix">剂</div>
- </el-input>
- </div>
- </div>-->
- <div class="item flex-vertical-center-l">
- <span>频次:</span>
- <div class="div3" style="width:80px;">
- <!-- :disabled="recipe_tabs[recipe_tabs_c].disable" -->
- <el-select
- size="mini"
- v-model="recipe_tabs[recipe_tabs_c].bottom_form.num"
- placeholder="请选择"
- >
- <el-option
- :label="item.value"
- :value="item.key"
- v-for="(item,index) in recipe_tabs[recipe_tabs_c].bottom_form.numList"
- :key="'l'+index"
- ></el-option>
- </el-select>
- </div>
- </div>
- <div
- class="item flex-vertical-center-l"
- 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'"
- >
- <!-- <span>服药时间:</span> -->
- <div class="div3">
- <!-- :disabled="recipe_tabs[recipe_tabs_c].disable" -->
- <el-select
- size="mini"
- v-model="recipe_tabs[recipe_tabs_c].bottom_form.time"
- placeholder="请选择"
- >
- <el-option
- :label="item.value"
- :value="item.key"
- v-for="(item,index) in recipe_tabs[recipe_tabs_c].bottom_form.timeList"
- :key="'k'+index"
- ></el-option>
- </el-select>
- </div>
- </div>
- </div>
- <div v-if="recipe_tabs[recipe_tabs_c].bottom_form.usege=='5'" class="header-about">
- <div class="item flex-vertical-center-l">
- <span>操作指南:</span>
- <div style="flex:1;">
- <el-input
- size="mini"
- placeholder="请输入"
- v-model="recipe_tabs[recipe_tabs_c].bottom_form.caozuo"
- ></el-input>
- </div>
- </div>
- </div>
- <div class="flex-vertical-center-l header-about flex-wrap" v-if="container_i==2">
- <div class="item flex-vertical-center-l">
- <span>类型:</span>
- <div class="div2">
- <el-select
- size="mini"
- v-model="recipe_tabs[recipe_tabs_c].bottom_form.doseType1"
- placeholder="请选择"
- >
- <el-option label="针刺" value="zc"></el-option>
- <el-option label="汤药" value="ty"></el-option>
- </el-select>
- </div>
- </div>
- <div class="item flex-vertical-center-l">
- <span>次数:</span>
- <div class="div1">
- <el-input
- size="mini"
- placeholder="请输入次数"
- v-model="recipe_tabs[recipe_tabs_c].bottom_form.doseNum1"
- ></el-input>
- </div>
- </div>
- </div>
- <div class="header-about">
- <div class="item flex-vertical-center-l">
- <span>嘱托:</span>
- <div style="flex:1;">
- <el-input
- size="mini"
- placeholder="请输入"
- v-model="recipe_tabs[recipe_tabs_c].bottom_form.zhutuo"
- ></el-input>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 留在这个页面 -->
- <div class="table-b-bottom flex-vertical-between">
- <div class="t-b-b-left flex-vertical-center-l flex-wrap">
- <div class="t-b-l-item">
- <!-- 单击金额 *数 -->
- 当前处方金额:
- <span>{{recipe_tabs[recipe_tabs_c].bottom_form.nowRecipeMoney1}}元</span>
- </div>
- <div class="t-b-l-item" v-if="container_i==0">
- 单剂金额:
- <span>{{recipe_tabs[recipe_tabs_c].bottom_form.nowRecipeMoney | formatTotal}}元</span>
- </div>
- <div
- class="t-b-l-item"
- v-if="recipe_tabs[recipe_tabs_c].bottom_form.isDaiJian==1&&recipe_tabs[recipe_tabs_c].bottom_form.daijian && recipe_tabs[recipe_tabs_c]. bottom_form.doseType=='0'"
- >
- 代煎费:
- <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>
- </div>
- <div class="t-b-l-item" v-if="recipe_tabs[recipe_tabs_c].bottom_form.radio==0">
- 配送费:
- <span>{{recipe_tabs[recipe_tabs_c].bottom_form.moneyMsg.deliveryPrice}}元</span>
- </div>
- <div class="t-b-l-item" v-if="recipe_tabs[recipe_tabs_c].bottom_form.doseType=='1'">
- 制膏费:
- <span>{{recipe_tabs[recipe_tabs_c].bottom_form.moneyMsg.systemOfCreamPrice}}元</span>
- </div>
- <div
- class="t-b-l-item"
- v-if="recipe_tabs[recipe_tabs_c].bottom_form.doseType=='2' || recipe_tabs[recipe_tabs_c].bottom_form.doseType=='3'"
- >
- 特殊调配费:
- <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>
- </div>
- <div class="t-b-l-item">
- 合计费用:
- <span>{{recipe_tabs[recipe_tabs_c].bottom_form.allMoney}}元</span>
- <!-- 合计费用:<span>{{totalAllMoney.toFixed(4)}}元</span> -->
- </div>
- </div>
- <div class="t-b-b-right flex-vertical-center-r">
- <!-- $router.push({path:'/index/accordedit'}) -->
- <!-- <div class="flex-center" v-if="!recipe_tabs[recipe_tabs_c].bottom_form.disable" @click="saveToMine">
- 存为我的协定方
- </div>-->
- <!-- <div class="flex-center bg-green" v-if="showSubmit" @click="submit()">提交处方</div> -->
- <el-button
- type="warning"
- size="mini"
- v-if="!recipe_tabs[recipe_tabs_c].bottom_form.disable"
- @click="saveToMine"
- >存为我的协定方</el-button>
- <!-- showSubmit -->
- <!-- <template v-if="isAutoCheck==0">
- <el-button
- type="primary"
- size="mini"
- v-if="recipe_tabs[recipe_tabs_c].prescribed==0 || !recipe_tabs[recipe_tabs_c].prescribed"
- @click="submit"
- >保存处方</el-button>
- </template>-->
- <!-- v-if="isAutoCheck==1" -->
- <template>
- <el-button
- type="primary"
- size="mini"
- v-if="recipe_tabs[recipe_tabs_c].paystate==0 || !recipe_tabs[recipe_tabs_c].paystate"
- @click="submit"
- >保存处方</el-button>
- </template>
- </div>
- </div>
- <popup
- :showDialog="showDialog"
- distanceTop="4vh"
- @cancle="showDialog=false"
- @confim="submitAgree()"
- title="存为我的协定方"
- width="70%"
- >
- <div slot="body">
- <accordEdit :showBtn="false" ref="accordEdit" @success="agreeSccess"></accordEdit>
- </div>
- </popup>
- </div>
- </template>
- <script>
- import { addAccordData, getAccordShareList } from "@/api/business.js";
- import { getDataByKey } from "@/api/system.js";
- import accordEdit from "@/views/business/AccordEdit.vue";
- import { getRationalMed, getRationalMedForPlat } from "@/api/knowledge";
- import {
- getProver,
- getArea,
- getSelectType,
- getPharmacyMsg,
- getPatAddress
- } from "@/api/city.js";
- import {
- getTableDrug,
- getAddressForHospital,
- getPharmacyID,
- changePharmacy,
- customerQuery,
- getPharmacyIDS
- } from "@/api/diagnosis.js";
- import { debounce } from "@/utils/format.js";
- import { mapState, mapGetters, mapActions, mapMutations } from "vuex";
- import popup from "@/components/Propup.vue";
- import accompanied from "./ui/accompanied.vue";
- export default {
- components: {
- popup,
- accordEdit,
- accompanied
- },
- props: {
- isShrink: {
- type: Boolean,
- default: false
- },
- container_i: {
- type: Number,
- default: 0
- },
- showSubmit: {
- type: Boolean,
- default: true
- },
- isDaiJian: {
- type: Number,
- default: 1
- },
- isPs: {
- type: Number,
- default: 1
- }
- // totalAllMoney: Number,
- },
- data() {
- return {
- totalAllMoney: 0,
- preData: [],
- showDialog: false,
- shareSelect: [], // 共享至选择器数据
- share: "",
- name: "中药处方",
- recipe_tabs: [
- {
- isMyMade: true,
- disable: false,
- name: "处方1",
- pharmacyID: "", // 药房id
- isPay: false, // 是否支付
- prescribed: 0, // 是否开方 0 否 1是
- paystate: 0, // 云his 是否支付 0 否 1是(为否可以编辑)
- totalTableD: [
- {
- id: 1,
- key: "",
- drugList: [],
- page: 1,
- loadMore: true,
- usageList: [],
- search_i: 0,
- showSearch: false
- }
- ],
- tableData: [
- {
- id: 1,
- key: "",
- drugList: [],
- page: 1,
- loadMore: true,
- usageList: [],
- search_i: 0,
- showSearch: false
- }
- ],
- radio: "1",
- lastType: "1", // 上一次的 药房类型
- tableData1: [],
- bottom_form: {
- preType: "", // 协定方的时候 切换 中药类型带入
- disable: false, // 协定方 配方转方 为 true
- doseNum: "",
- doseType: "",
- doseTypeList: [],
- usegeList: [],
- usege: "",
- num: "",
- numList: [], // 频次后台数据
- daijian: "",
- nongjian: "200",
- time: "",
- timeList: [], // 服药时间后台数据
- caozuo: "",
- zhutuo: "",
- radio: 1,
- isDaiJian: 2,
- provinceList: [],
- cityList: [],
- areaList: [],
- province: "",
- city: "",
- area: "",
- address: "",
- phone: "",
- doseType1: "zc",
- doseNum1: "",
- savename: "",
- nowRecipeMoney: 0, //单剂金额
- nowRecipeMoney1: 0, //当前处方金额
- allMoney: 0, // 合计金额
- moneyMsg: {} // 价格数据
- }
- }
- ], // 处方 tabs
- recipe_tabs_c: 0, // 处方 tabs 下标
- index: 0, // 全局index 下拉加载时使用
- provinceList1: [], // 全局省列表 赋值用
- countWay: "1", // 计算方式
- isAutoCheck: "0", // 是否自动审核 0 手动 1自动 (自动的时候用his 的是否支付成功字段 判断显示)
- pharmacyList: [], // 药房选择器 数据
- pharmacyTypes: [],
- clickPid: "", // 点击的药品id
- maxDose: null,
- minDose: null,
- doseId: "", // 要展示的 剂量id
- medIndex: 0, // 点击的 药品下标
- usageList: [] // 用法列表
- };
- },
- created() {
- // setTimeout(() => {
- // this.getDataByKey()
- // }, 200);
- // this.getAccordShareList()
- // this.getPharmacyID()
- // this.getTableDrug('', 1, 0)
- this.customerQuery();
- // this._getPharmacyIDS();
- this.getProver();
- this.getSelectType("中药药品用法", 0);
- this.getSelectType("剂型", 0);
- this.getSelectType("处方用法");
- this.getSelectType("中药服药时间");
- this.getSelectType("中药频次");
- },
- mounted() {},
- methods: {
- // 打开父级安全合理用药监测
- openSafeDrug() {
- this.$parent.opensafeD();
- },
- getRadioName(val) {
- if (val == 1) {
- return "散装饮片";
- }
- if (val == 2) {
- return "散装颗粒";
- }
- if (val == 3) {
- return "小包装饮片";
- }
- if (val == 4) {
- return "小包装颗粒";
- }
- if (val == 5) {
- return "膏方";
- }
- if (val == 6) {
- return "中药制剂";
- }
- },
- // 配送点击
- changePeiSong() {
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.radio =
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.radio == 1 ? 0 : 1;
- this.countNowRecipeMoney();
- this.getaddress(this.recipe_tabs[this.recipe_tabs_c].bottom_form.radio);
- },
- // 代煎选项点击
- changeDaijian() {
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.isDaiJian =
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.isDaiJian == 1 ? 0 : 1;
- if (this.recipe_tabs[this.recipe_tabs_c].bottom_form.isDaiJian == 0) {
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.daijian = "";
- } else {
- this.recipe_tabs[
- this.recipe_tabs_c
- ].bottom_form.daijian = this.recipe_tabs[
- this.recipe_tabs_c
- ].bottom_form.doseNum;
- }
- this.countNowRecipeMoney();
- },
- // 是否配送
- getaddress(e) {
- if (e == 1) {
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.address = "";
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.savename = "";
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.phone = "";
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.province = "";
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.city = "";
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.area = "";
- } else {
- this.getPatAddress();
- }
- this.countNowRecipeMoney();
- },
- scroll(e) {
- // console.log("滚动", e);
- },
- // 监听键盘事件
- drugDown(e, scope) {
- let index = scope.row.id ? scope.row.id - 1 : 0;
- let totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
- // 如果到最后一个 判断是否需要分页
- if (totalData[index].search_i == totalData[index].drugList.length - 1) {
- // totalData[scope.$index].search_i
- if (totalData[index].loadMore) {
- totalData[index].page += 1;
- this.getTableDrug(
- totalData[index].key,
- totalData[index].page,
- index,
- totalData[index].loadMore
- );
- totalData[index].search_i += 1;
- }
- } else {
- totalData[index].search_i += 1;
- }
- // 表格 fixed 时 去 下标 为 1
- if (totalData[index].drugList.length > 5) {
- document.querySelectorAll(
- `#infiniteList${scope.row.id}`
- )[1].scrollTop += 36;
- console.log(
- document.querySelectorAll(`#infiniteList${scope.row.id}`)[1]
- .scrollTop,
- "top"
- );
- }
- this.recipe_tabs[this.recipe_tabs_c].totalTableD = totalData;
- totalData.filter((item, index) => {
- // this.getSelectType('中药药品用法', index)
- return (item.id = index + 1);
- });
- this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
- (item, index) => {
- return item.id % 2 != 0;
- }
- );
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
- (item, index) => {
- return item.id % 2 == 0;
- }
- );
- this.$forceUpdate();
- },
- drugUp(e, scope) {
- let index = scope.row.id ? scope.row.id - 1 : 0;
- let totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
- // 如果到最后一个 判断是否需要分页
- if (totalData[index].search_i == 0) {
- // totalData[scope.$index].search_i
- } else {
- totalData[index].search_i -= 1;
- }
- if (
- document.querySelectorAll(`#infiniteList${scope.row.id}`)[1].scrollTop >
- 0
- ) {
- document.querySelectorAll(
- `#infiniteList${scope.row.id}`
- )[1].scrollTop -= 36;
- }
- this.recipe_tabs[this.recipe_tabs_c].totalTableD = totalData;
- totalData.filter((item, index) => {
- // this.getSelectType('中药药品用法', index)
- return (item.id = index + 1);
- });
- this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
- (item, index) => {
- return item.id % 2 != 0;
- }
- );
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
- (item, index) => {
- return item.id % 2 == 0;
- }
- );
- },
- drugEnter(scope) {
- this.chooseDis1(
- scope,
- scope.row.search_i,
- scope.row.drugList[scope.row.search_i]
- );
- },
- usageC(e, scope) {
- let index = scope.row.id ? scope.row.id - 1 : 0;
- let totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
- this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].usage = e;
- this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
- (item, index) => {
- return item.id % 2 != 0;
- }
- );
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
- (item, index) => {
- return item.id % 2 == 0;
- }
- );
- },
- doseFocus(scope) {
- let width = window.innerWidth;
- if (width > 800) {
- if (scope.row.id % 2 == 0) {
- document.getElementsByClassName(
- "el-table__body-wrapper"
- )[1].style.overflow = "hidden";
- } else {
- document.getElementsByClassName(
- "el-table__body-wrapper"
- )[0].style.overflow = "hidden";
- }
- }
- if (scope.row.medid.indexOf("-") != -1) {
- this._getRationalMed(scope.row.medid);
- } else {
- this._getRationalMedForPlat(scope.row.medid);
- }
- this.countDoseMoney(scope.row.dose || 0, scope);
- },
- doseBlur(scope) {
- let parent = this.$parent;
- if (scope.row.dose === "") {
- this.$message.error("请输入剂量");
- parent.rationalMed10.forEach(item => {
- if (item.reqID == scope.row.medid) {
- item.showDose = false;
- }
- });
- parent.countDose();
- this.maxDose = null;
- this.minDose = null;
- this.doseId = "";
- return;
- }
- let unit = scope.row.unit;
- let dose = Number(scope.row.dose);
- if (unit != "g" && unit != "克" && !Number.isInteger(dose)) {
- this.$message.error("剂量输入有误");
- parent.countDose();
- this.maxDose = null;
- this.minDose = null;
- this.doseId = "";
- console.log(
- document.querySelectorAll("#dose" + scope.row.id)[0],
- "dayin "
- );
- document.querySelectorAll("#dose" + scope.row.id)[0].style.border =
- "1px solid red";
- document.querySelectorAll("#dose" + scope.row.id)[0].style.color =
- "red";
- return;
- }
- if (
- Number(scope.row.dose) > Number(this.maxDose) ||
- Number(scope.row.dose) < Number(this.minDose)
- ) {
- parent.rationalMed10.forEach(item => {
- if (item.reqID == scope.row.medid) {
- item.showDose = true;
- }
- });
- }
- if (
- Number(scope.row.dose) <= Number(this.maxDose) &&
- Number(scope.row.dose) >= Number(this.minDose)
- ) {
- parent.rationalMed10.forEach(item => {
- if (item.reqID == scope.row.medid) {
- item.showDose = false;
- }
- });
- }
- parent.countDose();
- this.maxDose = null;
- this.minDose = null;
- this.doseId = "";
- },
- doseEnter(scope) {
- if (
- scope.row.id ==
- this.recipe_tabs[this.recipe_tabs_c].totalTableD.length - 1
- ) {
- // console.log(document.querySelectorAll('#searchD' + (scope.row.id + 1)), '啦啦啦')
- document.querySelectorAll("#searchD" + (scope.row.id + 1))[0].focus();
- } else {
- try {
- this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
- if (item.name && !item.dose && scope.row.id < item.id) {
- document.querySelectorAll("#dose" + item.id)[0].focus();
- throw Error();
- }
- if (!item.name) {
- // console.log(document.querySelectorAll('#searchD' + item.id), '啦啦啦')
- document.querySelectorAll("#searchD" + item.id)[0].focus();
- throw Error();
- }
- });
- } catch (error) {}
- }
- },
- // 修改剂数
- doseNumC() {
- let doseNum = this.recipe_tabs[this.recipe_tabs_c].bottom_form.doseNum;
- var regu = /^[1-9]\d*$/;
- if (!regu.test(Number(doseNum))) {
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.doseNum = 1;
- doseNum = 1;
- }
- if (this.recipe_tabs[this.recipe_tabs_c].bottom_form.isDaiJian == 1) {
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.daijian = doseNum;
- }
- this.countNowRecipeMoney();
- },
- // 计算中药处方总金额
- countMdAllMoney() {
- let totalAllMoney = 0;
- this.recipe_tabs.forEach(item => {
- totalAllMoney += Number(item.bottom_form.allMoney);
- });
- // this.totalAllMoney = totalAllMoney;
- this.$emit("update:totalAllMoney", totalAllMoney);
- },
- // 计算当前处方金额
- countNowRecipeMoney() {
- let data = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
- let total = 0;
- data.forEach(item => {
- if (item.total) {
- total += Number(item.total);
- }
- });
- // console.log(total, '几家总额');
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.nowRecipeMoney = total;
- let doseNum =
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.doseNum || 1;
- // 计算当前处方金额
- if (doseNum) {
- if (this.countWay == "1") {
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.nowRecipeMoney1 = (
- total * Number(doseNum)
- ).toFixed(2);
- total = (total * Number(doseNum)).toFixed(2);
- } else {
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.nowRecipeMoney1 = (
- total * Number(doseNum)
- ).toFixed(3); // 3
- total = (total * Number(doseNum)).toFixed(3); // 3
- }
- } else {
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.nowRecipeMoney1 = 0;
- }
- // 膏剂类型
- let doseType = this.recipe_tabs[this.recipe_tabs_c].bottom_form.doseType;
- // 是否配送
- let isDelivery = this.recipe_tabs[this.recipe_tabs_c].bottom_form.radio;
- // 制膏费
- let systemOfCreamPrice =
- doseType == "1"
- ? this.recipe_tabs[this.recipe_tabs_c].bottom_form.moneyMsg
- .systemOfCreamPrice
- ? this.recipe_tabs[this.recipe_tabs_c].bottom_form.moneyMsg
- .systemOfCreamPrice
- : 0
- : 0;
- // 代煎费
- let agencyPrice = 0;
- if (
- doseType == "0" &&
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.isDaiJian == 1
- ) {
- agencyPrice = this.recipe_tabs[this.recipe_tabs_c].bottom_form.daijian
- ? this.recipe_tabs[this.recipe_tabs_c].bottom_form.moneyMsg
- .agencyPrice *
- Number(this.recipe_tabs[this.recipe_tabs_c].bottom_form.daijian)
- : 0;
- }
- // 特殊调配费
- let specialDeploymentPrice =
- doseType == "2" || doseType == "3"
- ? this.recipe_tabs[this.recipe_tabs_c].bottom_form.moneyMsg
- .specialDeploymentPrice
- : 0;
- //配送费
- let deliveryPrice =
- isDelivery == 0
- ? this.recipe_tabs[this.recipe_tabs_c].bottom_form.moneyMsg
- .deliveryPrice || 0
- : 0;
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.allMoney =
- Number(Number(total).toFixed(2)) + //3
- Number(systemOfCreamPrice) +
- Number(agencyPrice) +
- Number(specialDeploymentPrice) +
- Number(deliveryPrice);
- this.recipe_tabs[
- this.recipe_tabs_c
- ].bottom_form.allMoney = this.recipe_tabs[
- this.recipe_tabs_c
- ].bottom_form.allMoney.toFixed(2);
- this.countMdAllMoney();
- },
- // 清空处方
- clearRecipe() {
- let paystate = this.recipe_tabs[this.recipe_tabs_c].paystate;
- if (paystate == 1) {
- this.$message.warning("已支付处方不可以清空");
- return;
- }
- this.index = 0;
- this.recipe_tabs[this.recipe_tabs_c].disable = false;
- this.recipe_tabs[this.recipe_tabs_c].isMyMade = true;
- this.recipe_tabs[this.recipe_tabs_c].totalTableD.splice(
- this.recipe_tabs[this.recipe_tabs_c].totalTableD.length - 1,
- 1
- );
- let father = this.$parent;
- this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item2 => {
- father.rationalMed.forEach((item1, index1) => {
- if (item2.medid == item1.reqID || item2.medid == item1.matid) {
- father.rationalMed.splice(index1, 1);
- father.resetRationalMed();
- }
- });
- });
- this.recipe_tabs[this.recipe_tabs_c].totalTableD = [
- {
- drugList: [],
- page: 1,
- loadMore: true,
- key: "",
- search_i: 0
- }
- ];
- this.recipe_tabs[this.recipe_tabs_c].tableData = [
- {
- drugList: [],
- page: 1,
- id: 1,
- loadMore: true,
- key: "",
- search_i: 0
- }
- ];
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = [];
- this.recipe_tabs[this.recipe_tabs_c].radio = this.pharmacyTypes[0].ptype;
- this.recipe_tabs[
- this.recipe_tabs_c
- ].lastType = this.pharmacyTypes[0].ptype;
- let moneyMsg = this.recipe_tabs[this.recipe_tabs_c].bottom_form.moneyMsg;
- this.recipe_tabs[this.recipe_tabs_c].bottom_form = {
- preType: "", // 协定方的时候 切换 中药类型带入
- disable: false, // 协定方 配方转方 为 true
- doseNum: "",
- doseType: "",
- doseTypeList: [],
- usegeList: [],
- usege: "",
- num: "",
- numList: [], // 频次后台数据
- daijian: "",
- nongjian: "200",
- time: "",
- timeList: [], // 服药时间后台数据
- caozuo: "",
- zhutuo: "",
- radio: 1,
- isDaiJian: 2,
- provinceList: [],
- cityList: [],
- areaList: [],
- province: "",
- city: "",
- area: "",
- address: "",
- phone: "",
- doseType1: "zc",
- doseNum1: "",
- savename: "",
- nowRecipeMoney: 0, //单剂金额
- nowRecipeMoney1: 0, //当前处方金额
- allMoney: 0, // 合计金额
- moneyMsg: moneyMsg // 价格数据
- };
- this.nowRecipeMoney = 0;
- this.getProver();
- this.getSelectType("中药药品用法", 0);
- this.getSelectType("剂型", 0);
- this.getSelectType("处方用法");
- this.getSelectType("中药服药时间");
- this.getSelectType("中药频次");
- sessionStorage.setItem("isupdateExpre", "0");
- this.countNowRecipeMoney();
- },
- load() {
- console.log("进入");
- let key = this.recipe_tabs[this.recipe_tabs_c].totalTableD[this.index]
- .key;
- let page = this.recipe_tabs[this.recipe_tabs_c].totalTableD[this.index]
- .page;
- let loadMore = this.recipe_tabs[this.recipe_tabs_c].totalTableD[
- this.index
- ].loadMore;
- if (loadMore) {
- page += 1;
- }
- // if (!loadMore == 1) return;
- this.getTableDrug(key, page, this.index, loadMore);
- },
- // 新增处方 tab
- addRecipeTba() {
- let obj = this.recipe_tabs[this.recipe_tabs_c].bottom_form;
- this.recipe_tabs.push({
- prescribed: 0,
- paystate: 0,
- isMyMade: true,
- disable: false,
- name: `处方${this.recipe_tabs.length + 1}`,
- pharmacyID: this.recipe_tabs[this.recipe_tabs_c].pharmacyID,
- isPay: false,
- totalTableD: [
- {
- id: 1,
- key: "",
- drugList: [],
- page: 1,
- loadMore: true,
- usageList: [],
- search_i: 0,
- showSearch: false
- }
- ],
- tableData: [
- {
- id: 1,
- key: "",
- drugList: [],
- page: 1,
- loadMore: true,
- usageList: [],
- search_i: 0,
- showSearch: false
- }
- ],
- radio: this.pharmacyTypes[0].ptype,
- lastType: this.pharmacyTypes[0].ptype,
- tableData1: [],
- bottom_form: {
- doseNum: "",
- doseType: "",
- doseTypeList: [],
- usegeList: [],
- usege: "",
- num: "",
- numList: [], // 频次后台数据
- daijian: "",
- nongjian: "200",
- time: "",
- timeList: [], // 服药时间后台数据
- caozuo: "",
- zhutuo: "",
- radio: 1,
- isDaiJian: 2,
- pro: "",
- city: "",
- area: "",
- address: "",
- phone: "",
- doseType1: "",
- doseNum1: "",
- provinceList: this.provinceList1,
- cityList: [],
- areaList: [],
- province: "",
- city: "",
- area: "",
- moneyMsg: obj.moneyMsg, // 价格数据
- nowRecipeMoney: 0, //单剂金额
- nowRecipeMoney1: 0, //当前处方金额
- allMoney: 0, // 合计金额
- disable: false
- }
- });
- this.recipe_tabs_c = this.recipe_tabs.length - 1;
- // this.getPharmacyID()
- this.recipeChange(this.recipe_tabs_c);
- },
- // 处方 tab 点击改变
- recipeChange(index) {
- this.recipe_tabs_c = index;
- this.getSelectType("剂型");
- this.getSelectType("处方用法");
- this.getSelectType("中药服药时间");
- this.getSelectType("中药频次");
- // 调用 父级合理用药接口
- let father = this.$parent;
- father.rationalMed = [];
- for (let i = 1; i < 11; i++) {
- father["rationalMed" + i] = [];
- }
- this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
- if (item.name) {
- if (item.medid.indexOf("-") != -1) {
- father.getRationalMed(item.medid);
- } else {
- father.getRationalMedForPlat(item.medid);
- }
- }
- });
- try {
- let pid = this.recipe_tabs[this.recipe_tabs_c].radio.split("@")[0];
- this.getPharmacyMsg(pid);
- } catch (error) {}
- },
- recipeDelete(index) {
- if (this.recipe_tabs.length == 1) return;
- this.recipe_tabs.splice(index, 1);
- this.recipe_tabs_c = this.recipe_tabs.length - 1;
- this.recipe_tabs.filter((item, index) => {
- return (item.name = "处方" + (index + 1));
- });
- this.countNowRecipeMoney();
- // this.$forceUpdate()
- },
- // 输入剂量计算 当前药品总价格
- countDoseMoney(e, scope) {
- let totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
- let kucun = scope.row.inventory; // 药品库存
- if (Number(e) > Number(kucun)) {
- this.$message.warning("当前库存不足");
- document.querySelectorAll("#dose" + scope.row.id)[0].style.border =
- "1px solid red";
- document.querySelectorAll("#dose" + scope.row.id)[0].style.color =
- "red";
- } else {
- document.querySelectorAll("#dose" + scope.row.id)[0].style.border = "";
- document.querySelectorAll("#dose" + scope.row.id)[0].style.color = "";
- }
- let price = this.recipe_tabs[this.recipe_tabs_c].totalTableD[
- scope.row.id - 1
- ].price;
- this.recipe_tabs[this.recipe_tabs_c].totalTableD[
- scope.row.id - 1
- ].dose = e;
- let dose = this.recipe_tabs[this.recipe_tabs_c].totalTableD[
- scope.row.id - 1
- ].dose;
- let total = 0;
- // 计算方式2
- if (this.countWay == "2") {
- total = (Number(price) * Number(dose)).toFixed(2);
- } else {
- total = Number(price) * Number(dose);
- }
- this.recipe_tabs[this.recipe_tabs_c].totalTableD[
- scope.row.id - 1
- ].total = total;
- const forceUpdate = (data) => Object.assign({}, data);
- this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
- (item, index) => {
- return item.id % 2 != 0;
- }
- ).map(forceUpdate);
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
- (item, index) => {
- return item.id % 2 == 0;
- }
- ).map(forceUpdate);
- if (this.recipe_tabs[this.recipe_tabs_c].bottom_form.doseNum) {
- // this.countNowRecipeMoney();
- }
- this.countNowRecipeMoney();
- },
- // 表一 选中药品
- chooseDis1(scope, index, item, from = "now") {
- let totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
- let isHas = false;
- totalData.forEach(item1 => {
- if (item1.medid === item.pid) {
- isHas = true;
- }
- });
- if (isHas) {
- this.$message.warning("请勿重复添加药品");
- return;
- }
- let obj = {
- color: item.kc == 0 ? "red" : "#000",
- id: scope.row.id,
- name: item.ypmc,
- spec: item.gg, // 规格
- // dose: "", // 剂量
- dose: scope.row.color == "red" ? scope.row.dose : "",
- unit: item.dw, // 单位
- usage:
- scope.row.color == "red"
- ? this.usageList[0].key
- : scope.row.usage || item.usagestr || this.usageList[0].key, // 用法
- //usage: "",
- // price: item.lsjg,
- price: item.price,
- total: 0,
- inventory: item.kc, // 库存
- key: "",
- search_i: index,
- medid: item.pid, // 药品id
- originname: item.cdmc, // 产地名称
- showSearch: false,
- showDoseSection: false // 展示剂量区间
- };
- Object.assign(totalData[scope.row.id - 1], obj);
- // 调用 父级合理用药接口
- let father = this.$parent;
- father.rationalMed.forEach((item1, index1) => {
- if (this.clickPid == item1.reqID || this.clickPid == item1.matid) {
- father.rationalMed.splice(index1, 1);
- father.resetRationalMed();
- }
- });
- if (obj.medid.indexOf("-") != -1) {
- father.getRationalMed(obj.medid);
- } else {
- father.getRationalMedForPlat(obj.medid);
- }
- if (scope.row.id == totalData.length) {
- totalData.push({
- id: 2,
- drugList: [],
- page: 1,
- loadMore: true,
- usageList: [],
- search_i: 0,
- showSearch: false
- });
- }
- this.recipe_tabs[this.recipe_tabs_c].totalTableD = totalData;
- totalData.filter((item, index) => {
- this.getSelectType("中药药品用法", index);
- // if (!item.usage) {
- // item.usage = item.usageList[0].key;
- // }
- return (item.id = index + 1);
- });
- this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
- (item, index) => {
- return item.id % 2 != 0;
- }
- );
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
- (item, index) => {
- return item.id % 2 == 0;
- }
- );
- if (from != "now") return;
- setTimeout(() => {
- let ids = document.querySelectorAll("#dose" + scope.row.id);
- document.querySelectorAll("#dose" + scope.row.id)[0].focus();
- }, 500);
- this.countNowRecipeMoney();
- },
- // 表一和表二 数据添加
- addDis1(scope, type = "click") {
- let totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
- let index = scope.row.id;
- // totalData[index + 1].id && totalData[index + 1].name
- if (index != totalData.length - 2) {
- // 插入到 数据中间
- let data = totalData.splice(scope.row.id);
- totalData.push({
- id: 2,
- drugList: [],
- page: 1,
- loadMore: true,
- usageList: [],
- showSearch: false,
- key: "",
- search_i: 0
- });
- totalData = totalData.concat(data);
- // this.totalTableD = totalData;
- } else if (totalData[index + 1].id && !totalData[index + 1].name) {
- totalData.push({
- id: 2,
- drugList: [],
- page: 1,
- loadMore: true,
- usageList: [],
- showSearch: false,
- key: "",
- search_i: 0
- });
- }
- totalData.filter((item, index1) => {
- this.getSelectType("中药药品用法", index1);
- return (item.id = index1 + 1);
- });
- this.recipe_tabs[this.recipe_tabs_c].totalTableD = totalData;
- this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
- (item, index) => {
- return item.id % 2 != 0;
- }
- );
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
- (item, index) => {
- return item.id % 2 == 0;
- }
- );
- if (type != "click") return;
- setTimeout(() => {
- if (
- scope.row.id ==
- this.recipe_tabs[this.recipe_tabs_c].totalTableD.length - 1
- ) {
- document.querySelectorAll("#searchD" + (scope.row.id + 1))[0].focus();
- } else {
- try {
- this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
- if (!item.name) {
- // console.log(document.querySelectorAll('#searchD' + item.id), '啦啦啦')
- document.querySelectorAll("#searchD" + item.id)[0].focus();
- throw Error();
- }
- });
- } catch (error) {}
- }
- }, 500);
- },
- // 表一 和表二 查看药品数据
- findDrug(scope) {
- this.$emit("find", scope);
- },
- // 表一和表二 数据删除
- deleteDis1(scope) {
- let father = this.$parent;
- father.rationalMed.forEach((item1, index1) => {
- if (scope.row.medid == item1.reqID || scope.row.medid == item1.matid) {
- father.rationalMed.splice(index1, 1);
- father.resetRationalMed();
- }
- });
- let totalData = this.recipe_tabs[this.recipe_tabs_c].totalTableD;
- let index = scope.row.id - 1;
- this.recipe_tabs[this.recipe_tabs_c].totalTableD.splice(index, 1);
- totalData.filter((item, index) => {
- // 调用 父级合理用药接口
- // father.getRationalMed(item.medid)
- return (item.id = index + 1);
- });
- this.recipe_tabs[this.recipe_tabs_c].tableData = totalData.filter(
- (item, index) => {
- return item.id % 2 != 0;
- }
- );
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = totalData.filter(
- (item, index) => {
- return item.id % 2 == 0;
- }
- );
- this.countNowRecipeMoney();
- },
- clickName(scope) {
- // 隐藏滚动条
- if (scope.row.id % 2 == 0) {
- document.getElementsByClassName(
- "el-table__body-wrapper"
- )[1].style.overflow = "hidden";
- } else {
- document.getElementsByClassName(
- "el-table__body-wrapper"
- )[0].style.overflow = "hidden";
- }
- this.medIndex = scope.$index;
- this.clickPid = scope.row.medid;
- this.recipe_tabs[this.recipe_tabs_c].totalTableD[
- scope.row.id - 1
- ].showSearch = !this.recipe_tabs[this.recipe_tabs_c].totalTableD[
- scope.row.id - 1
- ].showSearch;
- this.recipe_tabs[this.recipe_tabs_c].totalTableD[scope.row.id - 1].key =
- scope.row.name;
- this.recipe_tabs[this.recipe_tabs_c].totalTableD[
- scope.row.id - 1
- ].search_i = 0;
- debounce(this.getTableDrug(scope.row.key, 1, scope.row.id - 1), 10000);
- setTimeout(() => {
- // console.log(document.querySelectorAll('#searchD' + scope.row.id));
- document.querySelectorAll("#searchD" + scope.row.id)[0].focus();
- }, 800);
- },
- // 输入框获取 药品列表
- searchDrug(e, scope) {
- // 隐藏滚动条
- if (scope.row.id % 2 == 0) {
- document.getElementsByClassName(
- "el-table__body-wrapper"
- )[1].style.overflow = "hidden";
- } else {
- document.getElementsByClassName(
- "el-table__body-wrapper"
- )[0].style.overflow = "hidden";
- }
- let index = scope.row.id ? scope.row.id - 1 : 0;
- // console.log(this.recipe_tabs[this.recipe_tabs_c].totalTableD[index], '我是key')
- this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].key = e;
- let ids = document.querySelectorAll("#operate2");
- ids.forEach((item, index) => {
- item.style["z-index"] = "auto";
- });
- // if (e != '') {
- // this.recipe_tabs[this.recipe_tabs_c].totalTableD[
- // scope.row.id - 1
- // ].showSearch = true
- // } else {
- // this.recipe_tabs[this.recipe_tabs_c].totalTableD[
- // scope.row.id - 1
- // ].showSearch = false
- // }
- this.recipe_tabs[this.recipe_tabs_c].tableData = this.recipe_tabs[
- this.recipe_tabs_c
- ].totalTableD.filter((item, index) => {
- return item.id % 2 != 0;
- });
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = this.recipe_tabs[
- this.recipe_tabs_c
- ].totalTableD.filter((item, index) => {
- return item.id % 2 == 0;
- });
- this.index = scope.row.id - 1;
- // this.getTableDrug(scope.row.key, 1, scope.row.id - 1)
- debounce(this.getTableDrug(scope.row.key, 1, index), 10000);
- },
- drugFocus(scope) {
- this.medIndex = scope.$index;
- },
- drugBlur(e, scope) {
- // 调用 父级合理用药接口
- // father.getRationalMedForPlat(scope.row.medid)
- // 失去焦点 释放滚动条
- if (scope.row.id % 2 == 0) {
- document.getElementsByClassName(
- "el-table__body-wrapper"
- )[1].style.overflow = "auto";
- } else {
- document.getElementsByClassName(
- "el-table__body-wrapper"
- )[0].style.overflow = "auto";
- }
- setTimeout(() => {
- let index = scope.row.id ? scope.row.id - 1 : 0;
- this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].key = "";
- let ids = document.querySelectorAll("#operate2");
- ids.forEach((item, index) => {
- item.style["z-index"] = "99";
- });
- this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
- item.drugList = [];
- });
- this.recipe_tabs[this.recipe_tabs_c].tableData = this.recipe_tabs[
- this.recipe_tabs_c
- ].totalTableD.filter((item, index) => {
- return item.id % 2 != 0;
- });
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = this.recipe_tabs[
- this.recipe_tabs_c
- ].totalTableD.filter((item, index) => {
- return item.id % 2 == 0;
- });
- }, 500);
- },
- drugBlur1(e, scope) {
- // 调用 父级合理用药接口
- // 失去焦点 展示滚动条
- if (scope.row.id % 2 == 0) {
- document.getElementsByClassName(
- "el-table__body-wrapper"
- )[1].style.overflow = "auto";
- } else {
- document.getElementsByClassName(
- "el-table__body-wrapper"
- )[0].style.overflow = "auto";
- }
- setTimeout(() => {
- let index = scope.row.id ? scope.row.id - 1 : 0;
- this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].key = "";
- this.recipe_tabs[this.recipe_tabs_c].totalTableD[
- index
- ].showSearch = false;
- let ids = document.querySelectorAll("#operate2");
- ids.forEach((item, index) => {
- item.style["z-index"] = "99";
- });
- this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
- item.drugList = [];
- });
- this.recipe_tabs[this.recipe_tabs_c].tableData = this.recipe_tabs[
- this.recipe_tabs_c
- ].totalTableD.filter((item, index) => {
- return item.id % 2 != 0;
- });
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = this.recipe_tabs[
- this.recipe_tabs_c
- ].totalTableD.filter((item, index) => {
- return item.id % 2 == 0;
- });
- }, 500);
- },
- // 合并表一 表二
- arraySpanMethod1({ row, column, rowIndex, columnIndex }) {
- // if (!row.name) {
- // // document.getElementById('table1')
- // return [1, 8];
- // }
- },
- // 存为我的 协定方 提交
- submitAgree() {
- this.$refs.accordEdit.isRecipe = true;
- this.$refs.accordEdit.save();
- return;
- if (this.share == "") {
- this.$message.error({
- message: "请选择共享信息",
- showClose: false,
- type: "error"
- });
- return;
- }
- // 处理数据
- let data = this.recipe_tabs;
- let index = this.recipe_tabs_c;
- let obj = {
- rangtype: this.share,
- curetype: data[index].bottom_form.doseType,
- density: data[index].bottom_form.nongjian,
- deploymentfree: data[index].bottom_form.specialDeploymentPrice,
- frequency: data[index].bottom_form.num,
- medicationtime: data[index].bottom_form.time,
- fryingfee: data[index].bottom_form.agencyPrice,
- markfree: data[index].bottom_form.systemOfCreamPrice,
- name: this.getuserinfo.userid + new Date().toDateString(),
- prescriptionDetailVos: [],
- prescriptiontype: data[index].radio,
- type: "0",
- usrage: data[index].usege
- };
- data[index].totalTableD.forEach((item, index) => {
- if (item.name) {
- let obj1 = {
- dose: item.dose,
- drugid: item.medid,
- drugname: item.name,
- seqn: item.id,
- specification: item.spec,
- unit: item.unit,
- usagestr: item.usage
- };
- obj.prescriptionDetailVos.push(obj1);
- }
- });
- this.recipe_tabs[this.recipe_tabs_c].preType = "";
- this.addAccordData(obj);
- },
- agreeSccess(e) {
- this.showDialog = false;
- if (e) {
- this.$parent.openRecipeAfterAgree();
- }
- },
- // 存为我的 协定方
- saveToMine(from = "auto") {
- /*
- from : 操作来源 auto: 存为我的协定方点击
- reserve:保存处方时打开存为协定方
- */
- this.getAccordShareList();
- let hasDoseNum = true; // 是否有剂数
- let hasData = true; // 是否有处方药品数据
- let hasUse = true;
- this.recipe_tabs.forEach(item => {
- if (item.totalTableD.length < 2) {
- hasData = false;
- }
- item.totalTableD.forEach(item1 => {
- if (!item1.dose && item1.name) {
- hasDoseNum = false;
- }
- if (!item1.usage && item1.name) {
- hasUse = false;
- }
- });
- });
- if (!hasData) {
- this.$message.error("请完善中药处方药品信息");
- return false;
- }
- // if (!hasDoseNum) {
- // this.$message.error("请完善中药处方剂量信息");
- // return false;
- // }
- // if (!hasUse) {
- // this.$message.error('请完善中药处方用法信息')
- // return false
- // }
- this.showDialog = true;
- let that = this;
- setTimeout(() => {
- let arr = that.deepCopy(
- this.recipe_tabs[this.recipe_tabs_c].totalTableD
- );
- if (from == "reserve") {
- this.$refs.accordEdit.isNeedOpenRecipe = true;
- }
- this.$refs.accordEdit.assignTableData(arr, "saveToMy");
- // 赋值病名数据
- let tcmValue = this.$parent.$refs.TCM.getParams();
- this.$refs.accordEdit.$refs.tcmd.setParams(tcmValue);
- // 剂型
- this.$refs.accordEdit.form.doseType = this.recipe_tabs[
- this.recipe_tabs_c
- ].bottom_form.doseType;
- // 剂数
- this.$refs.accordEdit.form.doseNum = this.recipe_tabs[
- this.recipe_tabs_c
- ].bottom_form.doseNum;
- // 处方用法
- this.$refs.accordEdit.form.recipeUse = this.recipe_tabs[
- this.recipe_tabs_c
- ].bottom_form.usege;
- // 每次
- this.$refs.accordEdit.form.nongjian = this.recipe_tabs[
- this.recipe_tabs_c
- ].bottom_form.nongjian;
- // 频次
- this.$refs.accordEdit.form.times = this.recipe_tabs[
- this.recipe_tabs_c
- ].bottom_form.num;
- // 服药时间
- this.$refs.accordEdit.form.useTime = this.recipe_tabs[
- this.recipe_tabs_c
- ].bottom_form.time;
- return;
- this.$refs.accordEdit.totalTableD = arr;
- this.$refs.accordEdit.form.cMedType = this.recipe_tabs[
- this.recipe_tabs_c
- ].radio;
- this.$refs.accordEdit.form.doseType = this.recipe_tabs[
- this.recipe_tabs_c
- ].bottom_form.doseType;
- console.log(this.$refs.accordEdit, "acc");
- this.$refs.accordEdit.tableData = this.$refs.accordEdit.totalTableD.filter(
- item => {
- return item.id % 2 != 0;
- }
- );
- this.$refs.accordEdit.tableData1 = this.$refs.accordEdit.totalTableD.filter(
- item => {
- return item.id % 2 == 0;
- }
- );
- }, 200);
- return;
- },
- deepCopy(source) {
- if (!source instanceof Object) return source; //如果不是对象的话直接返回
- let target = Array.isArray(source) ? [] : {}; //数组兼容
- for (var k in source) {
- if (source.hasOwnProperty(k)) {
- if (typeof source[k] === "object") {
- target[k] = this.deepCopy(source[k]);
- } else {
- target[k] = source[k];
- }
- }
- }
- return target;
- },
- // 提交处方
- submit() {
- this.$emit("submit");
- },
- // 修改省的数据
- proC(e) {
- // console.log(e)
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.city = "";
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.area = "";
- this.getArea(e, 1);
- },
- cityC(e) {
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.area = "";
- this.getArea(e, 2);
- },
- // 获取 合理用药数据
- async _getRationalMed(id) {
- let ids = [];
- let child = this;
- child.recipe_tabs[child.recipe_tabs_c].totalTableD.forEach(item => {
- if (item.name) {
- ids.push(item.medid);
- }
- });
- let idsIndex = 0;
- ids.forEach((item, index) => {
- if (item == id) {
- idsIndex = index;
- }
- });
- ids.splice(idsIndex, 1);
- let res = await getRationalMed({
- matID: id,
- orgId: this.getuserinfo.organizationid,
- matIds: ids
- });
- if (res.code == 0 && res.message) {
- this.maxDose = res.data.matmaxdosage;
- this.minDose = res.data.matmindosage;
- this.doseId = id;
- }
- },
- // 获取平台合理用药数据
- async _getRationalMedForPlat(id) {
- let ids = [];
- let child = this;
- child.recipe_tabs[child.recipe_tabs_c].totalTableD.forEach(item => {
- if (item.name) {
- ids.push(item.medid);
- }
- });
- let idsIndex = 0;
- ids.forEach((item, index) => {
- if (item == id) {
- idsIndex = index;
- }
- });
- ids.splice(idsIndex, 1);
- let res = await getRationalMedForPlat({
- matID: id,
- orgId: this.getuserinfo.organizationid,
- matIds: ids
- });
- if (res.code == 0 && res.message) {
- this.maxDose = res.data.matmaxdosage;
- this.minDose = res.data.matmindosage;
- this.doseId = id;
- }
- },
- //添加协定方数据
- async addAccordData(data) {
- const loading = this.$loading({
- lock: true,
- text: "正在保存",
- spinner: "el-icon-loading",
- background: "rgba(0, 0, 0, 0.7)"
- });
- let res = await addAccordData(data).catch(err => {
- loading.close();
- });
- if (res.ResultCode == 0) {
- loading.close();
- this.$message({
- type: "success",
- message: "保存成功",
- showClose: true
- });
- this.showDialog = false;
- setTimeout(() => {
- this.$router.push({
- path: "/index/accord"
- });
- }, 2000);
- }
- },
- // 通过中药类型获取药房id
- async getPharmacyID() {
- return;
- let res = await getPharmacyID({
- type: this.recipe_tabs[this.recipe_tabs_c].radio.split("@")[1]
- });
- if (res.ResultCode == 0) {
- if (res.ResultInfo == "") {
- this.$message({
- showClose: false,
- message: "当前类型无法开药,请切换类型",
- type: "error"
- });
- return;
- }
- this.recipe_tabs[this.recipe_tabs_c].pharmacyID = res.ResultInfo;
- this.changePharmacy(this.recipe_tabs[this.recipe_tabs_c].lastType);
- this.getPharmacyMsg(res.ResultInfo);
- }
- },
- // 选择药房
- async customerQuery() {
- let res = await customerQuery({
- type: 0
- });
- if (res.ResultCode == 0) {
- let pharmacyTypes = [];
- res.Data.forEach(item => {
- item.dosageForms = item.dosageForms.split(",");
- item.dosageForms.forEach(item1 => {
- pharmacyTypes.push({
- type: item1,
- ptype: item.pid + "@" + item1,
- name: item.displayName //+ this.getRadioName(item1)
- });
- });
- });
- this.recipe_tabs[this.recipe_tabs_c].pharmacyID = res.Data[0].pid;
- this.recipe_tabs[this.recipe_tabs_c].radio = pharmacyTypes[0].ptype;
- this.recipe_tabs[this.recipe_tabs_c].lastType = pharmacyTypes[0].ptype;
- this.pharmacyList = res.Data;
- this.pharmacyTypes = pharmacyTypes;
- this.$forceUpdate();
- this.getPharmacyMsg(res.Data[0].pid);
- }
- },
- // 获取药房id
- async _getPharmacyIDS() {
- let res = await getPharmacyIDS();
- if (res.ResultCode == 0) {
- this.pharmacyList = res.Data;
- res.Data.forEach(item => {
- if (item.key.indexOf("共享") != -1) {
- this.recipe_tabs[this.recipe_tabs_c].pharmacyID = item.value;
- this.getPharmacyMsg(item.value);
- }
- });
- this.$forceUpdate();
- }
- },
- // 切换中药类型时 切换 药房 获取 药品里面有没有这条数据
- async changePharmacy(type, val) {
- // TODO 此处 if 不会调用 触发在 [this.$emit("updateDp", res.Data)](src/components/ChineseMedicine.vue:2831)
- if (this.recipe_tabs[this.recipe_tabs_c].radio == val) {
- this.$parent.openAddress();
- return;
- }
- if (!type) type = this.recipe_tabs[this.recipe_tabs_c].lastType || '';
- if (!val) val = this.recipe_tabs[this.recipe_tabs_c].radio || '';
- this.recipe_tabs[this.recipe_tabs_c].radio = val;
- let drugIds = [];
- const loading = this.$loading({
- lock: true,
- text: "处理中,请稍后....",
- spinner: "el-icon-loading",
- background: "rgba(0, 0, 0, 0.7)"
- });
- this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(item => {
- if (item.name) {
- let idDose =
- item.medid +
- "&" +
- (item.dose || item.oldDose) +
- "&" +
- (item.usage || "");
- // drugIds.push(item.medid)
- item.oldDose = item.dose;
- drugIds.push(idDose);
- }
- });
- let pharmacyName = "";
- val = val.split("@")[1];
- type = type.split("@")[1];
- this.recipe_tabs[this.recipe_tabs_c].pharmacyID = this.recipe_tabs[
- this.recipe_tabs_c
- ].radio.split("@")[0];
- let params = {
- type: val,
- pharmacyid: this.recipe_tabs[this.recipe_tabs_c].pharmacyID,
- drugIds,
- preType: this.recipe_tabs[this.recipe_tabs_c].preType,
- oldType: type
- };
- let res = await changePharmacy(params).catch(err => {});
- if (res.ResultCode == 0) {
- this.recipe_tabs[this.recipe_tabs_c].totalTableD.forEach(
- (item1, index1) => {
- if (item1.name) {
- const getUsage = (function (list = [], value = '') {
- if (!Array.isArray(list) || list.length === 0) return void 0;
- const option = value && list.find(item => item.value === value || item.key == value);
- return option ? option.key : list[0].key;
- }).bind(null, this.usageList);
- res.Data.forEach((item, index) => {
- if (item == item1.medid) {
- item1.color = "red";
- item1.oldDose = item1.oldDose;
- }
- // console.log(item instanceof Object);
- if (item instanceof Object && item.oldYpid == item1.medid) {
- item1 = {
- id: 2,
- name: item.ypmc,
- spec: item.gg, // 规格
- dose: item.dose, // 剂量
- unit: item.dw, // 单位
- usage: item.usagestr || item.usage, // || this.usegeList[0].key, // 用法
- // usage: "",
- // price: item.lsjg,
- price: item.price,
- total: (item.price * item.dose).toFixed(2),
- inventory: item.kc, // 库存
- key: "",
- search_i: index,
- medid: item.pid, // 药品id
- originname: item.cdmc, // 产地名称
- showSearch: false,
- usageList: [],
- oldDose: item1.oldDose
- };
- /* 修正 */ item1.usage = item1.useage = getUsage(item1.usage);
- item1.color = "#000";
- }
- this.$set(
- this.recipe_tabs[this.recipe_tabs_c].totalTableD,
- index1,
- item1
- );
- });
- }
- }
- );
- this.recipe_tabs[this.recipe_tabs_c].totalTableD.filter(
- (item, index) => {
- this.getSelectType("中药药品用法", index);
- return (item.id = index + 1);
- }
- );
- this.recipe_tabs[this.recipe_tabs_c].tableData = this.recipe_tabs[
- this.recipe_tabs_c
- ].totalTableD.filter((item, index) => {
- return item.id % 2 != 0;
- });
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = this.recipe_tabs[
- this.recipe_tabs_c
- ].totalTableD.filter((item, index) => {
- return item.id % 2 == 0;
- });
- // this.recipe_tabs[this.recipe_tabs_c].lastType = this.recipe_tabs[this.recipe_tabs_c]
- // .radio // 存储这一次的 药房类型
- this.recipe_tabs[this.recipe_tabs_c].lastType = this.recipe_tabs[
- this.recipe_tabs_c
- ].radio; // 存储这一次的 药房类型
- // console.log(this.recipe_tabs[this.recipe_tabs_c].totalTableD);
- await this.getPharmacyMsg(this.recipe_tabs[this.recipe_tabs_c].pharmacyID);
- setTimeout(() => {
- this.countNowRecipeMoney();
- }, 500);
- }
- loading.close();
- },
- // 获取寄到本院地址数据
- async getAddressForHospital() {
- let res = await getAddressForHospital({});
- if (res.ResultCode == 0) {
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.province =
- res.Data.province;
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.city = res.Data.city;
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.area =
- res.Data.district;
- this.getArea(res.Data.province, 1);
- this.getArea(res.Data.city, 2);
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.address =
- res.Data.adressdetail;
- }
- },
- // 获取表格药品列表
- async getTableDrug(key, page, index, load = true) {
- if (!load) return;
- let pharmacyName = "";
- // let type = 0
- let type = this.recipe_tabs[this.recipe_tabs_c].radio.split("@")[1];
- this.pharmacyList.forEach(item => {
- if (item.pid == this.recipe_tabs[this.recipe_tabs_c].pharmacyID) {
- pharmacyName = item.pharmacyName;
- }
- });
- let params = {
- key: key,
- limit: 5,
- page: page,
- type: type,
- pharmacyid: this.recipe_tabs[this.recipe_tabs_c].pharmacyID
- };
- let res = await getTableDrug(params);
- if (res.ResultCode == 0) {
- // 计算方式3
- if (this.countWay == "3") {
- res.Data.Items.filter(item => {
- return (item.price = Number(item.price).toFixed(2));
- });
- }
- if (page <= res.Data.TotalPageCount) {
- if (page == 1) {
- this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].drugList =
- res.Data.Items;
- } else {
- this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].drugList = [
- ...this.recipe_tabs[this.recipe_tabs_c].totalTableD[index]
- .drugList,
- ...res.Data.Items
- ];
- this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].page += 1;
- }
- if (
- this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].drugList
- .length == res.Data.TotalRecordCount
- ) {
- // this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].loadMore = false
- }
- this.recipe_tabs[this.recipe_tabs_c].totalTableD.filter(
- (item, index) => {
- return (item.id = index + 1);
- }
- );
- this.recipe_tabs[this.recipe_tabs_c].tableData = this.recipe_tabs[
- this.recipe_tabs_c
- ].totalTableD.filter((item, index) => {
- return item.id % 2 != 0;
- });
- this.recipe_tabs[this.recipe_tabs_c].tableData1 = this.recipe_tabs[
- this.recipe_tabs_c
- ].totalTableD.filter((item, index) => {
- return item.id % 2 == 0;
- });
- } else {
- this.recipe_tabs[this.recipe_tabs_c].totalTableD[
- index
- ].loadMore = false;
- }
- }
- },
- // 获取省数据
- async getProver() {
- let res = await getProver();
- if (res.ResultCode == 0) {
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.provinceList =
- res.Data;
- this.provinceList1 = res.Data;
- }
- },
- // 获取市数据
- async getArea(code, type) {
- return;
- let res = await getArea(code);
- if (res.ResultCode == 0) {
- if (type == 1) {
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.cityList = res.Data;
- } else {
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.areaList = res.Data;
- }
- }
- },
- // 根据表格获取数据类型
- async getSelectType(data, index) {
- let res = await getSelectType(data);
- if (data == "中药药品用法") {
- if (this.recipe_tabs[this.recipe_tabs_c].totalTableD[index]["usage"]) {
- // res.Data.forEach(item => {
- // if (
- // item.value ===
- // this.recipe_tabs[this.recipe_tabs_c].totalTableD[index]['usage']
- // ) {
- // this.recipe_tabs[this.recipe_tabs_c].totalTableD[index]['usage'] =
- // item.key;
- // } else {
- // this.recipe_tabs[this.recipe_tabs_c].totalTableD[index]['usage'] =
- // "";
- // }
- // });
- }
- this.recipe_tabs[this.recipe_tabs_c].totalTableD[index].usageList =
- res.Data;
- this.usageList = res.Data;
- } else if (data == "剂型") {
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.doseTypeList =
- res.Data;
- if (this.recipe_tabs[this.recipe_tabs_c].bottom_form.doseType) return;
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.doseType =
- res.Data[0].key;
- } else if (data == "处方用法") {
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.usegeList = res.Data;
- // debugger
- if (this.recipe_tabs[this.recipe_tabs_c].bottom_form.usege !== "")
- return;
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.usege =
- res.Data[0].key;
- } else if (data == "中药服药时间") {
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.timeList = res.Data;
- if (this.recipe_tabs[this.recipe_tabs_c].bottom_form.time) return;
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.time = res.Data[0].key;
- } else if (data == "中药频次") {
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.numList = res.Data;
- if (this.recipe_tabs[this.recipe_tabs_c].bottom_form.num) return;
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.num = res.Data[0].key;
- }
- this.$forceUpdate();
- },
- // 获取制膏费用
- async getPharmacyMsg(data) {
- let res = await getPharmacyMsg(data);
- if (res.ResultCode == 0) {
- res.Data.agencyPrice = res.Data.agencyPrice ? res.Data.agencyPrice : 0;
- res.Data.deliveryPrice = res.Data.deliveryPrice
- ? res.Data.deliveryPrice
- : 0;
- res.Data.specialDeploymentPrice = res.Data.specialDeploymentPrice
- ? res.Data.specialDeploymentPrice
- : 0;
- res.Data.systemOfCreamPrice = res.Data.systemOfCreamPrice
- ? res.Data.systemOfCreamPrice
- : 0;
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.moneyMsg = res.Data;
- //
- this.$forceUpdate();
- this.$emit("updateDp", res.Data);
- }
- },
- // 获取共享至信息
- async getAccordShareList() {
- let res = await getAccordShareList();
- if (res.ResultCode == 0) {
- this.shareSelect = res.Data;
- }
- },
- // 获取医共体计算方式配置
- async getDataByKey(key = "countMenthod") {
- /*
- countMenthod:计费方式
- automaticReview:是否开启自动审核
- */
- let res = await getDataByKey({
- key: key,
- organizationid: this.getuserinfo.organizationid
- });
- if (res.ResultCode == 0) {
- if (key == "countMenthod") {
- if (res.ResultInfo == "0") {
- this.countWay = "1";
- } else if (res.ResultInfo == "1") {
- this.countWay = "2";
- } else if (res.ResultInfo == "2") {
- this.countWay = "3";
- }
- }
- if (key == "automaticReview") {
- this.isAutoCheck = res.ResultInfo;
- }
- }
- },
- // 获取患者地址信息
- async getPatAddress() {
- if (!this.getPatiensInfo.basisPatient.pid) return;
- let res = await getPatAddress({
- patId: this.getPatiensInfo.basisPatient.pid
- });
- if (res.ResultCode == 0) {
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.address =
- res.Data.detailadress;
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.savename =
- res.Data.name;
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.phone = res.Data.phone;
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.province =
- res.Data.province;
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.city = res.Data.city;
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.area =
- res.Data.district;
- this.getArea(res.Data.province, 1);
- this.getArea(res.Data.city, 2);
- }
- }
- },
- filters: {
- formatTotal(val) {
- if (val == 0) return val;
- // console.log(val, 'val');
- if (parseInt(val) === parseFloat(val)) {
- return val;
- } else {
- let v = String(val).split(".");
- if (v[1].length > 2) {
- // 2
- return val.toFixed(2); //
- } else {
- return val;
- }
- }
- }
- },
- computed: {
- ...mapGetters(["getuserinfo", "getPatiensInfo"])
- },
- watch: {
- getuserinfo: {
- deep: true,
- immediate: true,
- handler() {
- if (this.getuserinfo.organizationid) {
- this.getDataByKey();
- this.getDataByKey("automaticReview");
- }
- }
- },
- isDaiJian: {
- immediate: true,
- deep: true,
- handler: function() {
- this.recipe_tabs[
- this.recipe_tabs_c
- ].bottom_form.isDaiJian = this.isDaiJian;
- this.recipe_tabs.forEach(item => {
- // item.bottom_form.isDaiJian = this.isDaiJian;
- if (item.isDaiJian == 0) {
- item.bottom_form.daijian = "";
- } else {
- item.bottom_form.daijian = item.bottom_form.doseNum;
- }
- });
- this.countNowRecipeMoney();
- this.$forceUpdate();
- }
- },
- isPs: {
- immediate: true,
- deep: true,
- handler: function() {
- // this.recipe_tabs.forEach(item => {
- // item.bottom_form.radio = this.isPs;
- // });
- console.log(this.isPs, "选药");
- this.recipe_tabs[this.recipe_tabs_c].bottom_form.radio = this.isPs;
- this.countNowRecipeMoney();
- this.$forceUpdate();
- }
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- @import "../style/common.scss";
- .table-header {
- border-bottom: 2px solid #dedede;
- padding: 0px 0;
- .table-label {
- .label-item {
- cursor: pointer;
- width: 104px;
- border-right: 2px solid #eaeaea;
- div {
- color: #666;
- // transform: rotate(45deg);
- font-size: 16px;
- margin-left: 8px;
- margin-top: 1px;
- font-weight: 600;
- }
- img {
- width: 20px;
- margin-left: 8px;
- }
- }
- span {
- font-size: 14px;
- font-family: PingFang SC;
- font-weight: 400;
- color: #666666;
- }
- .l_active {
- color: #5386f6;
- }
- }
- }
- .add-presc {
- width: 70px;
- height: 26px;
- background: #ffae45;
- border-radius: 4px;
- font-size: 12px;
- font-family: PingFang SC;
- font-weight: 400;
- color: #ffffff;
- cursor: pointer;
- margin-right: 10px;
- }
- #chineseM {
- height: 100%;
- .table-container {
- padding: 5px 0px;
- // height: 340px;
- height: calc(100% - 80px);
- overflow: auto;
- .t-con-header {
- margin-bottom: 0px;
- .t-con-radio {
- flex: 1;
- padding-bottom: 5px;
- border-bottom: 1px solid #eaeaea;
- }
- .t-radio-title {
- width: 82px;
- font-size: 16px;
- font-family: PingFang SC;
- font-weight: 400;
- color: #333333;
- }
- .t-radio-group {
- flex: 1;
- }
- .add-presc1 {
- width: 84px;
- height: 34px;
- background: #ffae45;
- border-radius: 4px;
- font-size: 14px;
- font-family: PingFang SC;
- font-weight: bold;
- color: #ffffff;
- cursor: pointer;
- }
- }
- }
- }
- .table-show {
- width: 100%;
- // min-height: 212px;
- overflow: auto;
- // background: #5386F6;
- // overflow: hidden;
- z-index: 999;
- position: relative;
- .table-left-body {
- width: 50%;
- position: relative;
- perspective: 100px;
- // padding-bottom: 10px;
- }
- .table-left {
- width: 100%;
- overflow-y: auto;
- border: 1px solid #dedede;
- box-sizing: border-box;
- // overflow-x: auto;
- .table-l-hader {
- white-space: nowrap;
- div {
- display: inline-block;
- // padding: 15px 10px;
- background: rgba($color: #5386f6, $alpha: 0.1);
- text-align: center;
- height: 48px;
- line-height: 48px;
- border: 1px solid #dedede;
- border-bottom: 0 !important;
- // border-top: 0 !important;
- }
- .med-name {
- margin-left: 50px;
- }
- .kucun {
- padding-right: 120px;
- }
- .fixed-r {
- position: fixed;
- right: 0;
- }
- .fixed-left {
- position: fixed;
- left: 0;
- }
- }
- .table-l-item {
- white-space: nowrap;
- .bg-green {
- .div1 {
- background: rgba($color: #5386f6, $alpha: 0.1);
- border: 1px solid #dedede;
- }
- }
- .div1 {
- display: inline-block;
- // padding: 15px 10px;
- background: #ffffff;
- text-align: center;
- height: 53px;
- line-height: 53px;
- border: 1px solid #dedede;
- z-index: 9999;
- border-top: 0 !important;
- }
- .med-name {
- margin-left: 50px;
- }
- .kucun {
- padding-right: 120px;
- border-right: 1px solid #dedede;
- }
- .fixed-r {
- position: fixed;
- right: 0;
- }
- .fixed-left {
- position: fixed;
- left: 0;
- // border-left: 1px solid #DEDEDE;
- }
- .no-data {
- width: 100%;
- box-sizing: border-box;
- // border-top: 1px solid #DEDEDE;
- position: relative;
- left: 0;
- right: 0;
- bottom: 0px;
- // float: left;
- }
- }
- }
- }
- .operate {
- width: 100%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: space-around;
- img {
- width: 16px;
- }
- }
- .bottom-input {
- background: #fff;
- padding: 12.5px 30px 12.5px 52px;
- position: relative;
- // z-index: 999;
- // perspective: 100px;
- .div {
- width: 154px;
- }
- .table-choose {
- z-index: 9999;
- width: 332px;
- height: 221px;
- background: #ffffff;
- border: 2px solid #d8d8d8;
- position: relative;
- top: 2px;
- left: -48px;
- overflow: auto;
- .table-choose-h {
- background: rgba($color: #5386f6, $alpha: 0.1);
- div {
- height: 36px;
- width: 73px;
- }
- div:first-child {
- width: 115px;
- }
- }
- .t-c-b {
- cursor: pointer;
- height: 180px;
- .td {
- background: rgba($color: #5386f6, $alpha: 0.1);
- }
- p {
- border: 1px solid #ededed;
- height: 36px;
- width: 73px;
- // flex: 1;
- box-sizing: border-box;
- }
- p:first-child {
- width: 115px;
- }
- }
- }
- }
- .table-bottom {
- // position: absolute;
- // bottom: 80px;
- // right: 0;
- // left: 0;
- padding: 0 10px;
- // margin-top: 241px;
- margin-top: 5px;
- z-index: -1;
- .header-about {
- .item {
- margin-right: 5px;
- margin-bottom: 8px;
- span {
- font-size: 14px;
- font-family: PingFang SC;
- font-weight: 400;
- color: #333333;
- }
- .div1 {
- width: 40px;
- }
- .div2 {
- width: 72px;
- }
- .city1 {
- width: 140px;
- }
- .div3 {
- width: 70px;
- }
- .div4 {
- width: 160px;
- }
- .div5 {
- width: 88px;
- }
- .input-suffix {
- line-height: 28px;
- }
- }
- .right {
- width: 62px;
- height: 26px;
- background: #ffae45;
- border-radius: 4px;
- font-size: 12px;
- font-family: PingFang SC;
- font-weight: 400;
- color: #ffffff;
- margin-bottom: 10px;
- cursor: pointer;
- }
- }
- }
- .table-b-bottom {
- padding: 5px 5px;
- border-top: 2px solid #dedede;
- // margin-top: 10px;
- // position: absolute;
- // bottom: 0;
- // left: 0;
- // right: 0;
- .t-b-l-item {
- font-size: 14px;
- font-family: PingFang SC;
- font-weight: 400;
- color: #333333;
- margin-right: 8px;
- span {
- color: #ff6245;
- }
- }
- .t-b-b-right {
- div {
- width: 130px;
- height: 46px;
- background: #ffae45;
- border-radius: 4px;
- font-size: 16px;
- font-family: PingFang SC;
- font-weight: 500;
- color: #ffffff;
- cursor: pointer;
- }
- .bg-green {
- background: #5386f6;
- margin-left: 20px;
- }
- }
- }
- // 中成药 和适宜技术配方
- .chinese_medicine {
- padding: 0 37px;
- .clearer {
- width: 84px;
- height: 34px;
- background: #ffae45;
- border-radius: 4px;
- font-size: 14px;
- font-family: PingFang SC;
- font-weight: bold;
- color: #ffffff;
- cursor: pointer;
- margin-bottom: 20px;
- }
- .c-m-table {
- width: 100%;
- overflow: hidden;
- .unit {
- font-size: 14px;
- font-family: PingFang SC;
- font-weight: 400;
- color: #000000;
- // margin-left: 10px;
- }
- .input {
- width: 40px;
- }
- }
- }
- .operate {
- width: 100%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: space-around;
- img {
- width: 16px;
- }
- }
- .operate2 {
- position: absolute;
- z-index: 99;
- }
- .operate1 {
- position: fixed;
- width: 50px;
- // background: red;
- right: 15px;
- // top: 63px;
- text-align: right;
- img {
- width: 16px;
- }
- }
- .bottom-input {
- background: #fff;
- padding: 12.5px 30px 12.5px 52px;
- position: relative;
- // z-index: 999;
- // perspective: 100px;
- .div {
- width: 154px;
- }
- .table-choose {
- // z-index: 9999;
- width: 332px;
- height: 221px;
- background: #ffffff;
- border: 2px solid #d8d8d8;
- position: relative;
- top: 2px;
- left: -48px;
- overflow: auto;
- .table-choose-h {
- background: rgba($color: #5386f6, $alpha: 0.1);
- div {
- height: 36px;
- width: 73px;
- }
- div:first-child {
- width: 115px;
- }
- }
- .t-c-b {
- cursor: pointer;
- height: 180px;
- .td {
- background: rgba($color: #5386f6, $alpha: 0.1);
- }
- p {
- border: 1px solid #ededed;
- height: 36px;
- width: 73px;
- // flex: 1;
- box-sizing: border-box;
- }
- p:first-child {
- width: 115px;
- }
- }
- }
- }
- .t_dose {
- position: relative;
- // perspective: 100px;
- .dose-section {
- z-index: 999999 !important;
- position: fixed;
- width: 50px;
- //left: 136px;
- left: 196px;
- // right: 0;
- top: 8px;
- height: 22px;
- line-height: 22px;
- border-radius: 4px;
- background: rgba($color: #000000, $alpha: 0.7);
- color: #fff;
- span {
- font-size: 12px;
- }
- }
- }
- .table-choose3 {
- z-index: 999999 !important;
- // width: 332px;
- width: 532px;
- height: 221px;
- background: #ffffff;
- border: 2px solid #d8d8d8;
- position: fixed;
- top: 44px;
- left: 84px;
- margin-top: 19px;
- overflow: auto;
- .table-choose-h {
- background: rgba($color: #5386f6, $alpha: 0.1);
- div {
- height: 36px;
- width: 73px;
- }
- div:first-child {
- width: 115px;
- }
- div:nth-child(2),
- div:nth-child(3) {
- width: 173px;
- }
- }
- .t-c-b {
- cursor: pointer;
- height: 180px;
- .td {
- background: rgba($color: #5386f6, $alpha: 0.1);
- }
- p {
- border: 1px solid #ededed;
- height: 36px;
- width: 73px;
- // flex: 1;
- box-sizing: border-box;
- }
- p:first-child {
- width: 115px;
- }
- p:nth-child(2),
- p:nth-child(3) {
- width: 173px;
- }
- }
- }
- .header-about::v-deep .el-input__inner {
- padding: 0 5px;
- }
- .header-about::v-deep .el-checkbox {
- margin-right: 5px;
- }
- .header-about::v-deep .el-checkbox__label {
- padding-left: 5px;
- }
- .table-container::v-deep .el-radio {
- margin-right: 5px;
- }
- .table-container::v-deep .el-radio__label {
- padding-left: 2px;
- font-size: 12px;
- }
- .table-show::v-deep .el-table {
- // z-index: 999;
- }
- .table-show::v-deep .el-table th {
- padding: 2px 0;
- }
- .table-show::v-deep .el-table td {
- padding: 2px 0;
- }
- .table-show::v-deep .el-table__empty-block {
- min-height: 29px;
- }
- .table-left-body::v-deep .el-table th {
- background: rgba($color: #5386f6, $alpha: 0.1);
- }
- .collapse ::v-deep .el-collapse-item__content {
- padding-bottom: 5px;
- }
- .c-m-table::v-deep .el-table .cell {
- text-align: center;
- }
- .table-show::v-deep .el-table .cell {
- text-align: center;
- padding: 0 0;
- }
- .c-m-table::v-deep .el-select input {
- padding: 0 15px 0 5px;
- }
- .table-show ::v-deep .el-select input {
- padding: 0 15px 0 5px;
- }
- .t_dose::v-deep .el-input__inner {
- // text-align: left;
- padding: 0 5px !important;
- }
- .city::v-deep .el-select input {
- padding: 0 20px 0 10px;
- // height: 32px;
- }
- .xuewei::v-deep .el-select {
- width: 100%;
- }
- .form-item {
- margin-bottom: 20px;
- span {
- font-size: 16px;
- font-family: PingFang SC;
- font-weight: 400;
- color: #ff3a3a;
- display: inline-block;
- width: 8px;
- }
- .name {
- font-size: 16px;
- font-family: PingFang SC;
- font-weight: 400;
- color: #333;
- }
- .input {
- width: 260px;
- }
- }
- .operate2::v-deep .el-input__inner {
- padding: 0 5px;
- }
- .daijiao-check {
- margin-right: 8px;
- .img-body {
- width: 16px;
- height: 16px;
- box-sizing: border-box;
- border: 1px solid #dcdfe6;
- font-size: 0;
- img {
- width: 14px;
- height: 14px;
- }
- }
- .active {
- border: 0px solid #5386f6;
- img {
- width: 17px;
- height: 17px;
- }
- }
- span {
- font-size: 14px;
- margin-left: 5px;
- cursor: pointer;
- }
- }
- </style>
- <style lang="scss" scoped>
- @media screen and (max-width: 768px) {
- .table-header .table-label .label-item {
- width: auto;
- padding: 0 10px;
- }
- .table-header .table-label span {
- font-size: 12px;
- }
- .el-button--mini {
- padding: 5px 10px;
- }
- .table-container ::v-deep .el-radio__label {
- font-size: 11px;
- }
- ::v-deep {
- .el-radio__inner {
- width: 12px;
- height: 12px;
- }
- }
- .table-left-body ::v-deep .el-table th {
- font-size: 12px;
- }
- .table-show ::v-deep .el-table td {
- font-size: 12px;
- }
- .table-bottom .header-about .item span {
- font-size: 12px;
- }
- .table-b-bottom .t-b-l-item {
- font-size: 12px;
- }
- .table-show {
- // height: 335px;
- height: calc(100% - 136px);
- }
- }
- </style>
|