YpDictBase.vue 85 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210
  1. <template>
  2. <div class="layout_display_flex_y">
  3. <div style="margin-bottom: 6px; background-color: #fff;">
  4. <el-input v-model="text" class="w-50 m-2" style="width: 300px" placeholder="请输入编码/名称" clearable>
  5. <template #prepend>编码/名称 </template>
  6. </el-input>
  7. <el-button type="primary" icon="Search" @click="queryItem" style="margin-left: 5px">查询</el-button>
  8. <el-button type="primary" icon="Plus" @click="onAddItem" style="margin-left: 5px">新增</el-button>
  9. <!-- <el-button type="primary" icon="Download" @click="exportData" style="margin-left: 5px">导出</el-button> -->
  10. </div>
  11. <div class="layout_display_flex_y">
  12. <el-tabs class="el-tabs__fill" v-model="editableTabsValue" type="border-card" @tab-click="handleClick">
  13. <el-tab-pane key="ypClass" label="药性字典" name="ypClass">
  14. <div class="layout_display_flex_y">
  15. <div class="layout_flex_1-y">
  16. <el-table
  17. :data="ypClassData.slice(pageSizeClass * (currentPageClass - 1), pageSizeClass * currentPageClass)"
  18. border style="width: 100%" height="100%" stripe highlight-current-row
  19. class="ypClassTable normal-size">
  20. <el-table-column type="index" label="序号" width="100" />
  21. <el-table-column prop="code" label="药性编码" width="200">
  22. <template v-slot="scope">
  23. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.code"></el-input>
  24. <span v-else>{{ scope.row.code }}</span>
  25. </template>
  26. </el-table-column>
  27. <el-table-column prop="name" label="名称" width="280">
  28. <template v-slot="scope">
  29. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.name"></el-input>
  30. <span v-else>{{ scope.row.name }}</span>
  31. </template>
  32. </el-table-column>
  33. <el-table-column prop="delFlag" label="是否无效" width="120">
  34. <template v-slot="scope">
  35. <div v-if="scope.row.isEdit">
  36. <el-select v-model="scope.row.delFlag" clearable placeholder="请选择是否无效">
  37. <el-option v-for="option in delFlagOptions" :key="option.code" :label="option.name"
  38. :value="option.code"></el-option>
  39. </el-select>
  40. </div>
  41. <div v-else>
  42. <el-select v-model="scope.row.delFlag" disabled placeholder="请选择是否无效">
  43. <el-option v-for="option in delFlagOptions" :key="option.code" :label="option.name"
  44. :value="option.code"></el-option>
  45. </el-select>
  46. </div>
  47. </template>
  48. </el-table-column>
  49. <el-table-column prop="pyCode" label="拼音码" width="200" />
  50. <el-table-column prop="dcode" label="自定义码" width="200" />
  51. <el-table-column fixed="right" label="操作" min-width="180" width="180" center>
  52. <template #default="scope">
  53. <el-button type="primary" size="small" v-if="!scope.row.isEdit"
  54. @click="editYpClass(scope.row)">编辑</el-button>
  55. <el-button type="primary" size="small" v-if="scope.row.isEdit"
  56. @click="updateYpClass(scope.row)">保存</el-button>
  57. <el-button type="primary" size="small" v-if="scope.row.isEdit"
  58. @click="cancelYpClass(scope.row)">取消
  59. </el-button>
  60. <el-button type="danger" size="small"
  61. @click.prevent="deleteYpClass(scope.$index, scope.row)">
  62. 删除
  63. </el-button>
  64. </template>
  65. </el-table-column>
  66. </el-table>
  67. </div>
  68. <div>
  69. <el-pagination :current-page="currentPageClass" :page-size="pageSizeClass"
  70. :page-sizes="[10, 15, 20, 25]" :total="ypClassData.length"
  71. layout="total, sizes, prev, pager, next, jumper" style="margin-top: 5px"
  72. @size-change="handleSizeChangeClass" @current-change="handleCurrentChangeClass">
  73. </el-pagination>
  74. </div>
  75. </div>
  76. </el-tab-pane>
  77. <el-tab-pane key="drugKind" label="药品分类字典" name="drugKind">
  78. <div class="layout_display_flex_y">
  79. <div class="layout_flex_1-y">
  80. <el-table
  81. :data="drugKindData.slice(pageSizeKind * (currentPageKind - 1), pageSizeKind * currentPageKind)"
  82. border style="width: 100%" height="100%" stripe highlight-current-row
  83. class="drugKindTable normal-size">
  84. <el-table-column type="index" label="序号" width="100" />
  85. <el-table-column prop="code" label="分类编码" width="120">
  86. <template v-slot="scope">
  87. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.code"></el-input>
  88. <span v-else>{{ scope.row.code }}</span>
  89. </template>
  90. </el-table-column>
  91. <el-table-column prop="name" label="名称" width="280">
  92. <template v-slot="scope">
  93. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.name"></el-input>
  94. <span v-else>{{ scope.row.name }}</span>
  95. </template>
  96. </el-table-column>
  97. <el-table-column prop="ypType" label="类别" width="140">
  98. <template v-slot="scope">
  99. <div v-if="scope.row.isEdit">
  100. <el-select v-model="scope.row.ypType" clearable placeholder="请选择类别">
  101. <el-option v-for="option in ypTypeOptions" :key="option.code" :label="option.name"
  102. :value="option.code"></el-option>
  103. </el-select>
  104. </div>
  105. <div v-else>
  106. <el-select v-model="scope.row.ypType" disabled placeholder="请选择类别">
  107. <el-option v-for="option in ypTypeOptions" :key="option.code" :label="option.name"
  108. :value="option.code"></el-option>
  109. </el-select>
  110. </div>
  111. </template>
  112. </el-table-column>
  113. <el-table-column prop="mzBillCode" label="门诊菜单编码" width="120">
  114. <template v-slot="scope">
  115. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.mzBillCode"></el-input>
  116. <span v-else>{{ scope.row.mzBillCode }}</span>
  117. </template>
  118. </el-table-column>
  119. <el-table-column prop="zyBillCode" label="住院菜单编码" width="120">
  120. <template v-slot="scope">
  121. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.zyBillCode"></el-input>
  122. <span v-else>{{ scope.row.zyBillCode }}</span>
  123. </template>
  124. </el-table-column>
  125. <el-table-column prop="pyCode" label="拼音码" width="140" />
  126. <el-table-column prop="dcode" label="自定义码" width="140" />
  127. <el-table-column fixed="right" label="操作" min-width="180" width="180" center>
  128. <template #default="scope">
  129. <el-button type="primary" size="small" v-if="!scope.row.isEdit"
  130. @click="editDrugKind(scope.row)">编辑</el-button>
  131. <el-button type="primary" size="small" v-if="scope.row.isEdit"
  132. @click="updateDrugKind(scope.row)">保存</el-button>
  133. <el-button type="primary" size="small" v-if="scope.row.isEdit"
  134. @click="cancelDrugKind(scope.row)">取消
  135. </el-button>
  136. <el-button type="danger" size="small"
  137. @click.prevent="deleteDrugKind(scope.$index, scope.row)">
  138. 删除
  139. </el-button>
  140. </template>
  141. </el-table-column>
  142. </el-table>
  143. </div>
  144. <div>
  145. <el-pagination :current-page="currentPageKind" :page-size="pageSizeKind" :page-sizes="[10, 15, 20, 25]"
  146. :total="drugKindData.length" layout="total, sizes, prev, pager, next, jumper"
  147. style="margin-top: 5px" @size-change="handleSizeChangeKind"
  148. @current-change="handleCurrentChangeKind">
  149. </el-pagination>
  150. </div>
  151. </div>
  152. </el-tab-pane>
  153. <el-tab-pane key="ypDosage" label="药品剂型字典" name="ypDosage">
  154. <div class="layout_display_flex_y">
  155. <div class="layout_flex_1-y">
  156. <el-table
  157. :data="ypDosageData.slice(pageSizeDosage * (currentPageDosage - 1), pageSizeDosage * currentPageDosage)"
  158. border style="width: 100%" height="100%" stripe highlight-current-row
  159. class="ypDosageTable normal-size">
  160. <el-table-column type="index" label="序号" width="70" />
  161. <el-table-column prop="code" label="剂型编码" width="100">
  162. <template v-slot="scope">
  163. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.code"></el-input>
  164. <span v-else>{{ scope.row.code }}</span>
  165. </template>
  166. </el-table-column>
  167. <el-table-column prop="name" label="名称" width="140">
  168. <template v-slot="scope">
  169. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.name"></el-input>
  170. <span v-else>{{ scope.row.name }}</span>
  171. </template>
  172. </el-table-column>
  173. <el-table-column prop="delFlag" label="是否无效" width="120">
  174. <template v-slot="scope">
  175. <div v-if="scope.row.isEdit">
  176. <el-select v-model="scope.row.delFlag" clearable placeholder="请选择是否无效">
  177. <el-option v-for="option in delFlagOptions" :key="option.code" :label="option.name"
  178. :value="option.code"></el-option>
  179. </el-select>
  180. </div>
  181. <div v-else>
  182. <el-select v-model="scope.row.delFlag" disabled placeholder="请选择是否无效">
  183. <el-option v-for="option in delFlagOptions" :key="option.code" :label="option.name"
  184. :value="option.code"></el-option>
  185. </el-select>
  186. </div>
  187. </template>
  188. </el-table-column>
  189. <el-table-column prop="pyCode" label="拼音码" width="120" />
  190. <el-table-column prop="dcode" label="自定义码" width="120" />
  191. <el-table-column prop="dosaType" label="剂型分类" width="100">
  192. <template v-slot="scope">
  193. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.dosaType"></el-input>
  194. <span v-else>{{ scope.row.dosaType }}</span>
  195. </template>
  196. </el-table-column>
  197. <el-table-column prop="dosaRemark" label="剂型说明" width="100">
  198. <template v-slot="scope">
  199. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.dosaRemark"></el-input>
  200. <span v-else>{{ scope.row.dosaRemark }}</span>
  201. </template>
  202. </el-table-column>
  203. <el-table-column prop="orderNo" label="编码" width="100">
  204. <template v-slot="scope">
  205. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.orderNo"></el-input>
  206. <span v-else>{{ scope.row.orderNo }}</span>
  207. </template>
  208. </el-table-column>
  209. <el-table-column prop="ybCode" label="市医保编码(旧)" width="100">
  210. <template v-slot="scope">
  211. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.ybCode"></el-input>
  212. <span v-else>{{ scope.row.ybCode }}</span>
  213. </template>
  214. </el-table-column>
  215. <el-table-column prop="hnsybCode" label="省医保编码(旧)" width="100">
  216. <template v-slot="scope">
  217. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.hnsybCode"></el-input>
  218. <span v-else>{{ scope.row.hnsybCode }}</span>
  219. </template>
  220. </el-table-column>
  221. <el-table-column fixed="right" label="操作" min-width="180" width="180" center>
  222. <template #default="scope">
  223. <el-button type="primary" size="small" v-if="!scope.row.isEdit"
  224. @click="editYpDosage(scope.row)">编辑</el-button>
  225. <el-button type="primary" size="small" v-if="scope.row.isEdit"
  226. @click="updateYpDosage(scope.row)">保存</el-button>
  227. <el-button type="primary" size="small" v-if="scope.row.isEdit"
  228. @click="cancelYpDosage(scope.row)">取消
  229. </el-button>
  230. <el-button type="danger" size="small"
  231. @click.prevent="deleteYpDosage(scope.$index, scope.row)">
  232. 删除
  233. </el-button>
  234. </template>
  235. </el-table-column>
  236. </el-table>
  237. </div>
  238. <div>
  239. <el-pagination :current-page="currentPageDosage" :page-size="pageSizeDosage"
  240. :page-sizes="[10, 15, 20, 25]" :total="ypDosageData.length"
  241. layout="total, sizes, prev, pager, next, jumper" style="margin-top: 5px"
  242. @size-change="handleSizeChangeDosage" @current-change="handleCurrentChangeDosage">
  243. </el-pagination>
  244. </div>
  245. </div>
  246. </el-tab-pane>
  247. <el-tab-pane key="ypUnit" label="药品单位字典" name="ypUnit">
  248. <div class="layout_display_flex_y">
  249. <div class="layout_flex_1-y">
  250. <el-table :data="ypUnitData.slice(pageSizeUnit * (currentPageUnit - 1), pageSizeUnit * currentPageUnit)"
  251. border style="width: 100%" height="100%" stripe highlight-current-row
  252. class="ypUnitTable normal-size">
  253. <el-table-column type="index" label="序号" width="100" />
  254. <el-table-column prop="code" label="单位编码" width="140">
  255. <template v-slot="scope">
  256. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.code"></el-input>
  257. <span v-else>{{ scope.row.code }}</span>
  258. </template>
  259. </el-table-column>
  260. <el-table-column prop="name" label="名称" width="180">
  261. <template v-slot="scope">
  262. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.name"></el-input>
  263. <span v-else>{{ scope.row.name }}</span>
  264. </template>
  265. </el-table-column>
  266. <el-table-column prop="delFlag" label="是否无效" width="150">
  267. <template v-slot="scope">
  268. <div v-if="scope.row.isEdit">
  269. <el-select v-model="scope.row.delFlag" clearable placeholder="请选择是否无效">
  270. <el-option v-for="option in delFlagOptions" :key="option.code" :label="option.name"
  271. :value="option.code"></el-option>
  272. </el-select>
  273. </div>
  274. <div v-else>
  275. <el-select v-model="scope.row.delFlag" disabled placeholder="请选择是否无效">
  276. <el-option v-for="option in delFlagOptions" :key="option.code" :label="option.name"
  277. :value="option.code"></el-option>
  278. </el-select>
  279. </div>
  280. </template>
  281. </el-table-column>
  282. <el-table-column prop="orderNo" label="编码" width="120">
  283. <template v-slot="scope">
  284. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.orderNo"></el-input>
  285. <span v-else>{{ scope.row.orderNo }}</span>
  286. </template>
  287. </el-table-column>
  288. <el-table-column prop="refundableFees" label="是否可以退费" width="120">
  289. <template v-slot="scope">
  290. <div v-if="scope.row.isEdit">
  291. <el-select v-model="scope.row.refundableFees" clearable placeholder="请选择是否退费">
  292. <el-option v-for="option in refundableFeesOptions" :key="option.code"
  293. :label="option.name" :value="option.code"></el-option>
  294. </el-select>
  295. </div>
  296. <div v-else>
  297. <el-select v-model="scope.row.refundableFees" disabled placeholder="请选择是否退费">
  298. <el-option v-for="option in refundableFeesOptions" :key="option.code"
  299. :label="option.name" :value="option.code"></el-option>
  300. </el-select>
  301. </div>
  302. </template>
  303. </el-table-column>
  304. <el-table-column prop="pyCode" label="拼音码" width="150" />
  305. <el-table-column prop="dcode" label="自定义码" width="150" />
  306. <el-table-column fixed="right" label="操作" min-width="180" width="180" center>
  307. <template #default="scope">
  308. <el-button type="primary" size="small" v-if="!scope.row.isEdit"
  309. @click="editYpUnit(scope.row)">编辑</el-button>
  310. <el-button type="primary" size="small" v-if="scope.row.isEdit"
  311. @click="updateYpUnit(scope.row)">保存</el-button>
  312. <el-button type="primary" size="small" v-if="scope.row.isEdit"
  313. @click="cancelYpUnit(scope.row)">取消
  314. </el-button>
  315. <el-button type="danger" size="small"
  316. @click.prevent="deleteYpUnit(scope.$index, scope.row)">
  317. 删除
  318. </el-button>
  319. </template>
  320. </el-table-column>
  321. </el-table>
  322. </div>
  323. <div>
  324. <el-pagination :current-page="currentPageUnit" :page-size="pageSizeUnit" :page-sizes="[10, 15, 20, 25]"
  325. :total="ypUnitData.length" layout="total, sizes, prev, pager, next, jumper" style="margin-top: 5px"
  326. @size-change="handleSizeChangeUnit" @current-change="handleCurrentChangeUnit">
  327. </el-pagination>
  328. </div>
  329. </div>
  330. </el-tab-pane>
  331. <el-tab-pane key="ypChargeGroup" label="药品费别字典" name="ypChargeGroup">
  332. <div class="layout_display_flex_y">
  333. <div class="layout_flex_1-y">
  334. <el-table :data="ypChargeGroupData" border style="width: 100%" stripe highlight-current-row>
  335. <el-table-column type="index" label="序号" width="100" />
  336. <el-table-column prop="code" label="费别编码" width="140">
  337. <template v-slot="scope">
  338. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.code"></el-input>
  339. <span v-else>{{ scope.row.code }}</span>
  340. </template>
  341. </el-table-column>
  342. <el-table-column prop="name" label="名称" width="200">
  343. <template v-slot="scope">
  344. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.name"></el-input>
  345. <span v-else>{{ scope.row.name }}</span>
  346. </template>
  347. </el-table-column>
  348. <el-table-column prop="delFlag" label="是否无效" width="150">
  349. <template v-slot="scope">
  350. <div v-if="scope.row.isEdit">
  351. <el-select v-model="scope.row.delFlag" clearable placeholder="请选择是否无效">
  352. <el-option v-for="option in delFlagOptions" :key="option.code" :label="option.name"
  353. :value="option.code"></el-option>
  354. </el-select>
  355. </div>
  356. <div v-else>
  357. <el-select v-model="scope.row.delFlag" disabled placeholder="请选择是否无效">
  358. <el-option v-for="option in delFlagOptions" :key="option.code" :label="option.name"
  359. :value="option.code"></el-option>
  360. </el-select>
  361. </div>
  362. </template>
  363. </el-table-column>
  364. <el-table-column prop="pyCode" label="拼音码" width="200" />
  365. <el-table-column prop="dcode" label="自定义码" width="200" />
  366. <el-table-column fixed="right" label="操作" min-width="180" width="180" center>
  367. <template #default="scope">
  368. <el-button type="primary" size="small" v-if="!scope.row.isEdit"
  369. @click="editYpChargeGroup(scope.row)">编辑</el-button>
  370. <el-button type="primary" size="small" v-if="scope.row.isEdit"
  371. @click="updateYpChargeGroup(scope.row)">保存</el-button>
  372. <el-button type="primary" size="small" v-if="scope.row.isEdit"
  373. @click="cancelYpChargeGroup(scope.row, scope.$index)">取消
  374. </el-button>
  375. <el-button type="danger" size="small"
  376. @click.prevent="deleteYpChargeGroup(scope.$index, scope.row)">
  377. 删除
  378. </el-button>
  379. </template>
  380. </el-table-column>
  381. </el-table>
  382. </div>
  383. </div>
  384. </el-tab-pane>
  385. <el-tab-pane key="visibleFlag" label="药房药品停用维护" name="visibleFlag" class="visibleFlagTab">
  386. <div class="layout_display_flex_y">
  387. <div class="layout_flex_1-y">
  388. <el-table :data="visibleFlagData.slice(pageSize * (currentPage - 1), pageSize * currentPage)" border
  389. style="width: 100%" height="100%" stripe highlight-current-row
  390. class="visibleFlagTable normal-size">
  391. <el-table-column type="index" label="序号" width="60" />
  392. <el-table-column prop="chargeCode" label="药品编码" width="80" />
  393. <el-table-column prop="serial" label="包装" width="60" />
  394. <el-table-column prop="drug" label="药品名称" width="240" />
  395. <el-table-column prop="specification" label="药品规格" width="180" />
  396. <el-table-column prop="packRetprice" label="零售价" width="80" />
  397. <el-table-column prop="groupName" label="药房" width="120" />
  398. <el-table-column prop="visibleFlagMz" label="门诊停用" width="100">
  399. <template v-slot="scope">
  400. <div v-if="scope.row.isEdit">
  401. <el-select v-model="scope.row.visibleFlagMz" clearable placeholder="请选择是否停用">
  402. <el-option v-for="option in visibleFlagOptions" :key="option.code"
  403. :label="option.name" :value="option.code"></el-option>
  404. </el-select>
  405. </div>
  406. <div v-else>
  407. <el-select v-model="scope.row.visibleFlagMz" disabled placeholder="请选择是否停用">
  408. <el-option v-for="option in visibleFlagOptions" :key="option.code"
  409. :label="option.name" :value="option.code"></el-option>
  410. </el-select>
  411. </div>
  412. </template>
  413. </el-table-column>
  414. <el-table-column prop="visibleFlagZy" label="住院停用" width="100">
  415. <template v-slot="scope">
  416. <div v-if="scope.row.isEdit">
  417. <el-select v-model="scope.row.visibleFlagZy" clearable placeholder="请选择是否停用">
  418. <el-option v-for="option in visibleFlagOptions" :key="option.code"
  419. :label="option.name" :value="option.code"></el-option>
  420. </el-select>
  421. </div>
  422. <div v-else>
  423. <el-select v-model="scope.row.visibleFlagZy" disabled placeholder="请选择是否停用">
  424. <el-option v-for="option in visibleFlagOptions" :key="option.code"
  425. :label="option.name" :value="option.code"></el-option>
  426. </el-select>
  427. </div>
  428. </template>
  429. </el-table-column>
  430. <el-table-column prop="pyCode" label="拼音码" width="100" />
  431. <el-table-column prop="dCode" label="自定义码" width="100" />
  432. <el-table-column fixed="right" label="操作" min-width="140" width="140" center>
  433. <template #default="scope">
  434. <el-button type="primary" size="small" v-if="!scope.row.isEdit"
  435. @click="editVisibleFlag(scope.row)">编辑</el-button>
  436. <el-button type="primary" size="small" v-if="scope.row.isEdit"
  437. @click="updateVisibleFlag(scope.row)">保存</el-button>
  438. <el-button type="primary" size="small" v-if="scope.row.isEdit"
  439. @click="cancelVisibleFlag(scope.row, scope.$index)">取消
  440. </el-button>
  441. </template>
  442. </el-table-column>
  443. </el-table>
  444. </div>
  445. <div>
  446. <el-pagination :current-page="currentPage" :page-size="pageSize" :page-sizes="[10, 15, 20, 25]"
  447. :total="visibleFlagData.length" layout="total, sizes, prev, pager, next, jumper"
  448. style="margin-top: 5px" @size-change="handleSizeChange" @current-change="handleCurrentChange">
  449. </el-pagination>
  450. </div>
  451. </div>
  452. </el-tab-pane>
  453. <el-tab-pane key="ypSupply" label="药品供应商字典" name="ypSupply">
  454. <div class="layout_display_flex_y">
  455. <div class="layout_flex_1-y">
  456. <el-table
  457. :data="ypSupplyData.slice(pageSizeSupply * (currentPageSupply - 1), pageSizeSupply * currentPageSupply)"
  458. border style="width: 100%" height="100%" stripe highlight-current-row
  459. class="ypSupplyTable normal-size" :row-class-name="tableRowClassName">
  460. <el-table-column type="index" label="序号" width="80" />
  461. <el-table-column prop="code" label="供应商编码" width="100">
  462. <template v-slot="scope">
  463. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.code"></el-input>
  464. <span v-else>{{ scope.row.code }}</span>
  465. </template>
  466. </el-table-column>
  467. <el-table-column prop="name" label="名称" width="280">
  468. <template v-slot="scope">
  469. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.name"></el-input>
  470. <span v-else>{{ scope.row.name }}</span>
  471. </template>
  472. </el-table-column>
  473. <el-table-column prop="supplyCode" label="企业信用代码" width="180">
  474. <template v-slot="scope">
  475. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.supplyCode"></el-input>
  476. <span v-else>{{ scope.row.supplyCode }}</span>
  477. </template>
  478. </el-table-column>
  479. <el-table-column prop="pyCode" label="拼音码" width="120" />
  480. <el-table-column prop="dcode" label="自定义码" width="120" />
  481. <el-table-column prop="delFlag" label="是否无效" width="150">
  482. <template v-slot="scope">
  483. <div v-if="scope.row.isEdit">
  484. <el-select v-model="scope.row.delFlag" clearable placeholder="请选择是否无效">
  485. <el-option v-for="option in delFlagOptions" :key="option.code" :label="option.name"
  486. :value="option.code"></el-option>
  487. </el-select>
  488. </div>
  489. <div v-else>
  490. <el-select v-model="scope.row.delFlag" disabled placeholder="请选择是否无效">
  491. <el-option v-for="option in delFlagOptions" :key="option.code" :label="option.name"
  492. :value="option.code"></el-option>
  493. </el-select>
  494. </div>
  495. </template>
  496. </el-table-column>
  497. <el-table-column prop="abbrName" label="简称" width="180">
  498. <template v-slot="scope">
  499. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.abbrName"></el-input>
  500. <span v-else>{{ scope.row.abbrName }}</span>
  501. </template>
  502. </el-table-column>
  503. <el-table-column prop="address" label="地址" width="180">
  504. <template v-slot="scope">
  505. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.address"></el-input>
  506. <span v-else>{{ scope.row.address }}</span>
  507. </template>
  508. </el-table-column>
  509. <el-table-column prop="zipCode" label="邮编" width="100">
  510. <template v-slot="scope">
  511. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.zipCode"></el-input>
  512. <span v-else>{{ scope.row.zipCode }}</span>
  513. </template>
  514. </el-table-column>
  515. <el-table-column prop="telNo" label="电话" width="100">
  516. <template v-slot="scope">
  517. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.telNo"></el-input>
  518. <span v-else>{{ scope.row.telNo }}</span>
  519. </template>
  520. </el-table-column>
  521. <el-table-column prop="relName" label="联系人" width="80">
  522. <template v-slot="scope">
  523. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.relName"></el-input>
  524. <span v-else>{{ scope.row.relName }}</span>
  525. </template>
  526. </el-table-column>
  527. <el-table-column prop="busiRange" label="业务范围" width="100">
  528. <template v-slot="scope">
  529. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.busiRange"></el-input>
  530. <span v-else>{{ scope.row.busiRange }}</span>
  531. </template>
  532. </el-table-column>
  533. <el-table-column prop="comment" label="附注" width="100">
  534. <template v-slot="scope">
  535. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.comment"></el-input>
  536. <span v-else>{{ scope.row.comment }}</span>
  537. </template>
  538. </el-table-column>
  539. <el-table-column prop="useFlag" label="是否使用" width="120">
  540. <template v-slot="scope">
  541. <div v-if="scope.row.isEdit">
  542. <el-select v-model="scope.row.useFlag" clearable placeholder="请选择是否使用">
  543. <el-option v-for="option in yesOptions" :key="option.code" :label="option.name"
  544. :value="option.code"></el-option>
  545. </el-select>
  546. </div>
  547. <div v-else>
  548. <el-select v-model="scope.row.useFlag" disabled placeholder="请选择是否使用">
  549. <el-option v-for="option in yesOptions" :key="option.code" :label="option.name"
  550. :value="option.code"></el-option>
  551. </el-select>
  552. </div>
  553. </template>
  554. </el-table-column>
  555. <el-table-column fixed="right" label="操作" min-width="180" width="180" center>
  556. <template #default="scope">
  557. <el-button type="primary" size="small" v-if="!scope.row.isEdit"
  558. @click="editYpSupply(scope.row)">编辑</el-button>
  559. <el-button type="primary" size="small" v-if="scope.row.isEdit"
  560. @click="updateYpSupply(scope.row)">保存</el-button>
  561. <el-button type="primary" size="small" v-if="scope.row.isEdit"
  562. @click="cancelYpSupply(scope.row, scope.$index)">取消
  563. </el-button>
  564. <el-button type="danger" size="small"
  565. @click.prevent="deleteYpSupply(scope.$index, scope.row)">
  566. 删除
  567. </el-button>
  568. </template>
  569. </el-table-column>
  570. </el-table>
  571. </div>
  572. <div>
  573. <el-pagination :current-page="currentPageSupply" :page-size="pageSizeSupply"
  574. :page-sizes="[10, 15, 20, 25]" :total="ypSupplyData.length"
  575. layout="total, sizes, prev, pager, next, jumper" style="margin-top: 5px"
  576. @size-change="handleSizeChangeSupply" @current-change="handleCurrentChangeSupply">
  577. </el-pagination>
  578. </div>
  579. </div>
  580. </el-tab-pane>
  581. <el-tab-pane key="ypManuFactory" label="生产厂家字典" name="ypManuFactory">
  582. <div class="layout_display_flex_y">
  583. <div class="layout_flex_1-y">
  584. <el-table
  585. :data="ypManuFactoryData.slice(pageSizeManuFactory * (currentPageManuFactory - 1), pageSizeManuFactory * currentPageManuFactory)"
  586. border style="width: 100%" height="100%" stripe highlight-current-row
  587. class="ypManuFactoryTable normal-size">
  588. <el-table-column type="index" label="序号" width="80" />
  589. <el-table-column prop="code" label="药厂编码" width="100">
  590. <template v-slot="scope">
  591. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.code"></el-input>
  592. <span v-else>{{ scope.row.code }}</span>
  593. </template>
  594. </el-table-column>
  595. <el-table-column prop="name" label="药厂名称" width="280" show-overflow-tooltip>
  596. <template v-slot="scope">
  597. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.name"></el-input>
  598. <span v-else>{{ scope.row.name }}</span>
  599. </template>
  600. </el-table-column>
  601. <el-table-column prop="pyCode" label="拼音码" width="120" />
  602. <el-table-column prop="dcode" label="自定义码" width="120" />
  603. <el-table-column prop="delFlag" label="是否无效" width="150">
  604. <template v-slot="scope">
  605. <div v-if="scope.row.isEdit">
  606. <el-select v-model="scope.row.delFlag" clearable placeholder="请选择是否无效">
  607. <el-option v-for="option in delFlagOptions" :key="option.code" :label="option.name"
  608. :value="option.code"></el-option>
  609. </el-select>
  610. </div>
  611. <div v-else>
  612. <el-select v-model="scope.row.delFlag" disabled placeholder="请选择是否无效">
  613. <el-option v-for="option in delFlagOptions" :key="option.code" :label="option.name"
  614. :value="option.code"></el-option>
  615. </el-select>
  616. </div>
  617. </template>
  618. </el-table-column>
  619. <el-table-column prop="abbrName" label="简称" width="180">
  620. <template v-slot="scope">
  621. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.abbrName"></el-input>
  622. <span v-else>{{ scope.row.abbrName }}</span>
  623. </template>
  624. </el-table-column>
  625. <el-table-column prop="address" label="地址" width="180">
  626. <template v-slot="scope">
  627. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.address"></el-input>
  628. <span v-else>{{ scope.row.address }}</span>
  629. </template>
  630. </el-table-column>
  631. <el-table-column prop="zipCode" label="邮编" width="100">
  632. <template v-slot="scope">
  633. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.zipCode"></el-input>
  634. <span v-else>{{ scope.row.zipCode }}</span>
  635. </template>
  636. </el-table-column>
  637. <el-table-column prop="telNo" label="电话" width="100">
  638. <template v-slot="scope">
  639. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.telNo"></el-input>
  640. <span v-else>{{ scope.row.telNo }}</span>
  641. </template>
  642. </el-table-column>
  643. <el-table-column prop="relName" label="联系人" width="80">
  644. <template v-slot="scope">
  645. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.relName"></el-input>
  646. <span v-else>{{ scope.row.relName }}</span>
  647. </template>
  648. </el-table-column>
  649. <el-table-column prop="productRange" label="产品范围" width="100">
  650. <template v-slot="scope">
  651. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.productRange"></el-input>
  652. <span v-else>{{ scope.row.productRange }}</span>
  653. </template>
  654. </el-table-column>
  655. <el-table-column prop="comment" label="附注" width="100">
  656. <template v-slot="scope">
  657. <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.comment"></el-input>
  658. <span v-else>{{ scope.row.comment }}</span>
  659. </template>
  660. </el-table-column>
  661. <el-table-column prop="useFlag" label="是否使用" width="120">
  662. <template v-slot="scope">
  663. <div v-if="scope.row.isEdit">
  664. <el-select v-model="scope.row.useFlag" clearable placeholder="请选择是否使用">
  665. <el-option v-for="option in yesOptions" :key="option.code" :label="option.name"
  666. :value="option.code"></el-option>
  667. </el-select>
  668. </div>
  669. <div v-else>
  670. <el-select v-model="scope.row.useFlag" disabled placeholder="请选择是否使用">
  671. <el-option v-for="option in yesOptions" :key="option.code" :label="option.name"
  672. :value="option.code"></el-option>
  673. </el-select>
  674. </div>
  675. </template>
  676. </el-table-column>
  677. <el-table-column fixed="right" label="操作" min-width="180" width="180" center>
  678. <template #default="scope">
  679. <el-button type="primary" size="small" v-if="!scope.row.isEdit"
  680. @click="editYpManuFactory(scope.row)">编辑</el-button>
  681. <el-button type="primary" size="small" v-if="scope.row.isEdit"
  682. @click="updateYpManuFactory(scope.row)">保存</el-button>
  683. <el-button type="primary" size="small" v-if="scope.row.isEdit"
  684. @click="cancelYpManuFactory(scope.row)">取消
  685. </el-button>
  686. <el-button type="danger" size="small"
  687. @click.prevent="deleteYpManuFactory(scope.$index, scope.row)">
  688. 删除
  689. </el-button>
  690. </template>
  691. </el-table-column>
  692. </el-table>
  693. </div>
  694. <div>
  695. <el-pagination :current-page="currentPageManuFactory" :page-size="pageSizeManuFactory"
  696. :page-sizes="[10, 15, 20, 25]" :total="ypManuFactoryData.length"
  697. layout="total, sizes, prev, pager, next, jumper" style="margin-top: 5px"
  698. @size-change="handleSizeChangeManuFactory" @current-change="handleCurrentChangeManuFactory">
  699. </el-pagination>
  700. </div>
  701. </div>
  702. </el-tab-pane>
  703. </el-tabs>
  704. </div>
  705. </div>
  706. </template>
  707. <script setup name="YpDict">
  708. import { ref, onMounted, nextTick } from 'vue'
  709. import { ElMessage, ElMessageBox } from 'element-plus'
  710. import {
  711. selectYpClass, saveYpClass, delYpClassByCode,
  712. selectDrugKind, saveDrugKind, delDrugKindByCode,
  713. selectYpDosage, saveYpDosage, delYpDosageByCode,
  714. selectYpUnit, saveYpUnit, delYpUnitByCode,
  715. selectYpChargeGroup, saveYpChargeGroup, delYpChargeGroupByCode,
  716. selectYpVisibleFlag, updateYpVisibleFlag,
  717. selectYpSupply, saveYpSupply, delYpSupplyByCode,
  718. selectYpManuFactory, saveYpManuFactory, delYpManuFactoryByCode
  719. } from '@/api/yp-dict/yp-dict-base.js'
  720. const editableTabsValue = ref('ypClass')
  721. const msgTip = '分类编码(code)有变更,原始字典记录存在关联,请谨慎做更改,是否确认!!!'
  722. const delFlagOptions = [{ code: '0', name: '有效' }, { code: '1', name: '无效' }]
  723. const ypTypeOptions = [{ code: '1', name: '西药' }, { code: '2', name: '成药' }, { code: '3', name: '草药' }, { code: '4', name: '卫生材料' }]
  724. const refundableFeesOptions = [{ code: '0', name: '否' }, { code: '1', name: '是' }]
  725. const visibleFlagOptions = [{ code: '0', name: '正常' }, { code: '1', name: '停用' }]
  726. const yesOptions = [{ code: '0', name: '否' }, { code: '1', name: '是' }]
  727. const pageSizeClass = ref(20)
  728. const currentPageClass = ref(1)
  729. const handleSizeChangeClass = (val) => {
  730. pageSizeClass.value = val
  731. }
  732. const handleCurrentChangeClass = (val) => {
  733. currentPageClass.value = val
  734. }
  735. const pageSizeKind = ref(20)
  736. const currentPageKind = ref(1)
  737. const handleSizeChangeKind = (val) => {
  738. pageSizeKind.value = val
  739. }
  740. const handleCurrentChangeKind = (val) => {
  741. currentPageKind.value = val
  742. }
  743. const pageSizeDosage = ref(20)
  744. const currentPageDosage = ref(1)
  745. const handleSizeChangeDosage = (val) => {
  746. pageSizeDosage.value = val
  747. }
  748. const handleCurrentChangeDosage = (val) => {
  749. currentPageDosage.value = val
  750. }
  751. const pageSizeUnit = ref(20)
  752. const currentPageUnit = ref(1)
  753. const handleSizeChangeUnit = (val) => {
  754. pageSizeUnit.value = val
  755. }
  756. const handleCurrentChangeUnit = (val) => {
  757. currentPageUnit.value = val
  758. }
  759. const pageSize = ref(20)
  760. const currentPage = ref(1)
  761. const handleSizeChange = (val) => {
  762. pageSize.value = val
  763. }
  764. const handleCurrentChange = (val) => {
  765. currentPage.value = val
  766. }
  767. const pageSizeSupply = ref(20)
  768. const currentPageSupply = ref(1)
  769. const handleSizeChangeSupply = (val) => {
  770. pageSizeSupply.value = val
  771. }
  772. const handleCurrentChangeSupply = (val) => {
  773. currentPageSupply.value = val
  774. }
  775. const pageSizeManuFactory = ref(20)
  776. const currentPageManuFactory = ref(1)
  777. const handleSizeChangeManuFactory = (val) => {
  778. pageSizeManuFactory.value = val
  779. }
  780. const handleCurrentChangeManuFactory = (val) => {
  781. currentPageManuFactory.value = val
  782. }
  783. const ypClassData = ref([])
  784. const drugKindData = ref([])
  785. const ypDosageData = ref([])
  786. const ypUnitData = ref([])
  787. const ypChargeGroupData = ref([])
  788. const visibleFlagData = ref([])
  789. const ypSupplyData = ref([])
  790. const ypManuFactoryData = ref([])
  791. const text = ref('')
  792. onMounted(() => {
  793. nextTick(() => {
  794. queryYpClass()
  795. })
  796. })
  797. // 查询药品字典-药性字典
  798. const queryYpClass = () => {
  799. selectYpClass(text.value)
  800. .then((res) => {
  801. res.forEach(row => {
  802. // 是否标记
  803. row['isEdit'] = false
  804. // 是否新增
  805. row['isAdd'] = false
  806. })
  807. ypClassData.value = res
  808. })
  809. .catch(() => {
  810. ypClassData.value = []
  811. })
  812. }
  813. // 查询药品字典-药品分类字典
  814. const queryDrugKind = () => {
  815. selectDrugKind(text.value)
  816. .then((res) => {
  817. res.forEach(row => {
  818. // 是否标记
  819. row['isEdit'] = false
  820. // 是否新增
  821. row['isAdd'] = false
  822. })
  823. drugKindData.value = res
  824. })
  825. .catch(() => {
  826. drugKindData.value = []
  827. })
  828. }
  829. // 查询药品字典-药品剂型字典
  830. const queryYpDosage = () => {
  831. selectYpDosage(text.value)
  832. .then((res) => {
  833. res.forEach(row => {
  834. // 是否标记
  835. row['isEdit'] = false
  836. // 是否新增
  837. row['isAdd'] = false
  838. })
  839. ypDosageData.value = res
  840. })
  841. .catch(() => {
  842. ypDosageData.value = []
  843. })
  844. }
  845. // 查询药品字典-药品单位字典
  846. const queryYpUnit = () => {
  847. selectYpUnit(text.value)
  848. .then((res) => {
  849. res.forEach(row => {
  850. // 是否标记
  851. row['isEdit'] = false
  852. // 是否新增
  853. row['isAdd'] = false
  854. })
  855. ypUnitData.value = res
  856. })
  857. .catch(() => {
  858. ypUnitData.value = []
  859. })
  860. }
  861. // 查询药品字典-药品费别字典
  862. const queryYpChargeGroup = () => {
  863. selectYpChargeGroup(text.value)
  864. .then((res) => {
  865. res.forEach(row => {
  866. // 是否标记
  867. row['isEdit'] = false
  868. // 是否新增
  869. row['isAdd'] = false
  870. })
  871. ypChargeGroupData.value = res
  872. })
  873. .catch(() => {
  874. ypChargeGroupData.value = []
  875. })
  876. }
  877. // 查询药房药品停用情况
  878. const flagFilter = ref('')
  879. const queryVisibleFlag = () => {
  880. selectYpVisibleFlag(text.value, flagFilter.value)
  881. .then((res) => {
  882. res.forEach(row => {
  883. // 是否标记
  884. row['isEdit'] = false
  885. // 是否新增
  886. row['isAdd'] = false
  887. })
  888. visibleFlagData.value = res
  889. })
  890. .catch(() => {
  891. visibleFlagData.value = []
  892. })
  893. }
  894. // 查询药品字典-药品厂家字典
  895. const queryYpSupply = () => {
  896. selectYpSupply(text.value)
  897. .then((res) => {
  898. res.forEach(row => {
  899. // 是否标记
  900. row['isEdit'] = false
  901. // 是否新增
  902. row['isAdd'] = false
  903. })
  904. ypSupplyData.value = res
  905. })
  906. .catch(() => {
  907. ypSupplyData.value = []
  908. })
  909. }
  910. // 查询药品字典-药品供应商字典
  911. const queryYpManuFactory = () => {
  912. selectYpManuFactory(text.value)
  913. .then((res) => {
  914. res.forEach(row => {
  915. // 是否标记
  916. row['isEdit'] = false
  917. // 是否新增
  918. row['isAdd'] = false
  919. })
  920. ypManuFactoryData.value = res
  921. })
  922. .catch(() => {
  923. ypManuFactoryData.value = []
  924. })
  925. }
  926. // 查询
  927. const queryItem = () => {
  928. if (editableTabsValue.value === 'ypClass') {
  929. queryYpClass()
  930. } else if (editableTabsValue.value === 'drugKind') {
  931. queryDrugKind()
  932. } else if (editableTabsValue.value === 'ypDosage') {
  933. queryYpDosage()
  934. } else if (editableTabsValue.value === 'ypUnit') {
  935. queryYpUnit()
  936. } else if (editableTabsValue.value === 'ypChargeGroup') {
  937. queryYpChargeGroup()
  938. } else if (editableTabsValue.value === 'visibleFlag') {
  939. queryVisibleFlag()
  940. } else if (editableTabsValue.value === 'ypSupply') {
  941. queryYpSupply()
  942. } else if (editableTabsValue.value === 'ypManuFactory') {
  943. queryYpManuFactory()
  944. }
  945. }
  946. // 新增行
  947. const onAddItem = () => {
  948. if (editableTabsValue.value === 'ypClass') {
  949. let count
  950. if (ypClassData.value.length % pageSizeClass.value === 0) {
  951. count = Math.ceil(ypClassData.value.length / pageSizeClass.value) + 1
  952. } else {
  953. count = Math.ceil(ypClassData.value.length / pageSizeClass.value)
  954. }
  955. currentPageClass.value = count
  956. ypClassData.value.push({
  957. code: '',
  958. name: '',
  959. pyCode: '',
  960. dcode: '',
  961. delFlag: '',
  962. isEdit: true,
  963. isAdd: true,
  964. })
  965. const el = document.querySelector('.ypClassTable .el-scrollbar__wrap')
  966. const el2 = document.querySelector('.ypClassTable .el-table__body tbody')
  967. setTimeout(() => {
  968. const height = el2.clientHeight - el.clientHeight
  969. if (height > 0) {
  970. el.scrollTop = height
  971. }
  972. }, 100)
  973. } else if (editableTabsValue.value === 'drugKind') {
  974. let count
  975. if (drugKindData.value.length % pageSizeKind.value === 0) {
  976. count = Math.ceil(drugKindData.value.length / pageSizeKind.value) + 1
  977. } else {
  978. count = Math.ceil(drugKindData.value.length / pageSizeKind.value)
  979. }
  980. currentPageKind.value = count
  981. drugKindData.value.push({
  982. code: '',
  983. name: '',
  984. pyCode: '',
  985. dcode: '',
  986. ypType: '',
  987. mzBillCode: '',
  988. zyBillCode: '',
  989. isEdit: true,
  990. isAdd: true,
  991. })
  992. const el = document.querySelector('.drugKindTable .el-scrollbar__wrap')
  993. const el2 = document.querySelector('.drugKindTable .el-table__body tbody')
  994. setTimeout(() => {
  995. const height = el2.clientHeight - el.clientHeight
  996. if (height > 0) {
  997. el.scrollTop = height
  998. }
  999. }, 100)
  1000. } else if (editableTabsValue.value === 'ypDosage') {
  1001. let count
  1002. if (ypDosageData.value.length % pageSizeDosage.value === 0) {
  1003. count = Math.ceil(ypDosageData.value.length / pageSizeDosage.value) + 1
  1004. } else {
  1005. count = Math.ceil(ypDosageData.value.length / pageSizeDosage.value)
  1006. }
  1007. currentPageDosage.value = count
  1008. ypDosageData.value.push({
  1009. code: '',
  1010. name: '',
  1011. pyCode: '',
  1012. dcode: '',
  1013. dosaType: '',
  1014. dosaRemark: '',
  1015. orderNo: '',
  1016. delFlag: '',
  1017. ybCode: '',
  1018. hnsybCode: '',
  1019. isEdit: true,
  1020. isAdd: true,
  1021. })
  1022. const el = document.querySelector('.ypDosageTable .el-scrollbar__wrap')
  1023. const el2 = document.querySelector('.ypDosageTable .el-table__body tbody')
  1024. setTimeout(() => {
  1025. const height = el2.clientHeight - el.clientHeight
  1026. if (height > 0) {
  1027. el.scrollTop = height
  1028. }
  1029. }, 100)
  1030. } else if (editableTabsValue.value === 'ypUnit') {
  1031. let count
  1032. if (ypUnitData.value.length % pageSizeUnit.value === 0) {
  1033. count = Math.ceil(ypUnitData.value.length / pageSizeUnit.value) + 1
  1034. } else {
  1035. count = Math.ceil(ypUnitData.value.length / pageSizeUnit.value)
  1036. }
  1037. currentPageUnit.value = count
  1038. ypUnitData.value.push({
  1039. code: '',
  1040. name: '',
  1041. pyCode: '',
  1042. dcode: '',
  1043. orderNo: '',
  1044. delFlag: '',
  1045. refundableFees: '',
  1046. isEdit: true,
  1047. isAdd: true,
  1048. })
  1049. const el = document.querySelector('.ypUnitTable .el-scrollbar__wrap')
  1050. const el2 = document.querySelector('.ypUnitTable .el-table__body tbody')
  1051. setTimeout(() => {
  1052. const height = el2.clientHeight - el.clientHeight
  1053. if (height > 0) {
  1054. el.scrollTop = height
  1055. }
  1056. }, 100)
  1057. } else if (editableTabsValue.value === 'ypChargeGroup') {
  1058. ypChargeGroupData.value.push({
  1059. code: '',
  1060. name: '',
  1061. pyCode: '',
  1062. dcode: '',
  1063. delFlag: '',
  1064. isEdit: true,
  1065. isAdd: true,
  1066. })
  1067. } else if (editableTabsValue.value === 'visibleFlag') {
  1068. ElMessage({
  1069. type: "warning",
  1070. message: "不能新增药房药品停用,需先维护药品信息!",
  1071. duration: 2500,
  1072. showClose: true,
  1073. });
  1074. } else if (editableTabsValue.value === 'ypSupply') {
  1075. let count
  1076. if (ypSupplyData.value.length % pageSizeSupply.value === 0) {
  1077. count = Math.ceil(ypSupplyData.value.length / pageSizeSupply.value) + 1
  1078. } else {
  1079. count = Math.ceil(ypSupplyData.value.length / pageSizeSupply.value)
  1080. }
  1081. currentPageSupply.value = count
  1082. ypSupplyData.value.push({
  1083. code: '',
  1084. name: '',
  1085. supplyCode: '',
  1086. abbrName: '',
  1087. address: '',
  1088. zipCode: '',
  1089. telNo: '',
  1090. relName: '',
  1091. busiRange: '',
  1092. comment: '',
  1093. useFlag: '',
  1094. pyCode: '',
  1095. dcode: '',
  1096. delFlag: '',
  1097. isEdit: true,
  1098. isAdd: true,
  1099. })
  1100. const el = document.querySelector('.ypSupplyTable .el-scrollbar__wrap')
  1101. const el2 = document.querySelector('.ypSupplyTable .el-table__body tbody')
  1102. setTimeout(() => {
  1103. const height = el2.clientHeight - el.clientHeight
  1104. if (height > 0) {
  1105. el.scrollTop = height
  1106. }
  1107. }, 100)
  1108. } else if (editableTabsValue.value === 'ypManuFactory') {
  1109. let count
  1110. if (ypManuFactoryData.value.length % pageSizeManuFactory.value === 0) {
  1111. count = Math.ceil(ypManuFactoryData.value.length / pageSizeManuFactory.value) + 1
  1112. } else {
  1113. count = Math.ceil(ypManuFactoryData.value.length / pageSizeManuFactory.value)
  1114. }
  1115. currentPageManuFactory.value = count
  1116. ypManuFactoryData.value.push({
  1117. code: '',
  1118. name: '',
  1119. abbrName: '',
  1120. address: '',
  1121. zipCode: '',
  1122. telNo: '',
  1123. relName: '',
  1124. productRange: '',
  1125. comment: '',
  1126. useFlag: '',
  1127. pyCode: '',
  1128. dcode: '',
  1129. delFlag: '',
  1130. isEdit: true,
  1131. isAdd: true,
  1132. })
  1133. const el = document.querySelector('.ypManuFactoryTable .el-scrollbar__wrap')
  1134. const el2 = document.querySelector('.ypManuFactoryTable .el-table__body tbody')
  1135. setTimeout(() => {
  1136. const height = el2.clientHeight - el.clientHeight
  1137. if (height > 0) {
  1138. el.scrollTop = height
  1139. }
  1140. }, 100)
  1141. }
  1142. }
  1143. // 药品字典-药性字典增删改存开始
  1144. // 编辑
  1145. const editYpClass = (row) => {
  1146. // 备份原始数据
  1147. row['oldRow'] = JSON.parse(JSON.stringify(row))
  1148. row.isEdit = true
  1149. }
  1150. // 取消
  1151. const cancelYpClass = (row) => {
  1152. // 如果是新增的数据
  1153. if (row.isAdd) {
  1154. ypClassData.value.splice(ypClassData.value.length - 1, 1)
  1155. } else {
  1156. // 不是新增的数据 还原数据
  1157. for (const i in row.oldRow) {
  1158. row[i] = row.oldRow[i]
  1159. }
  1160. }
  1161. }
  1162. // 保存
  1163. const updateYpClass = (row) => {
  1164. if (!row.code || !row.name) {
  1165. ElMessage({
  1166. type: "warning",
  1167. message: "药性字典编码或名称不存在,请检查!",
  1168. duration: 2500,
  1169. showClose: true,
  1170. });
  1171. return
  1172. }
  1173. if (row.isAdd) {
  1174. let fe = 0
  1175. for (let num in ypClassData.value) {
  1176. if (ypClassData.value[num].code === row.code) {
  1177. fe++
  1178. }
  1179. }
  1180. if (fe === 2) {
  1181. ElMessage({
  1182. type: "warning",
  1183. message: "存在重复的药性字典,请核对!",
  1184. duration: 2500,
  1185. showClose: true,
  1186. });
  1187. } else {
  1188. callSaveYpClass(row, null)
  1189. }
  1190. } else {
  1191. let oldCode = row.oldRow.code
  1192. if (oldCode !== row.code) {
  1193. ElMessageBox.confirm(msgTip, {
  1194. cancelButtonText: '取消',
  1195. confirmButtonText: '确定',
  1196. type: 'warning',
  1197. distinguishCancelAndClose: true,
  1198. dangerouslyUseHTMLString: true
  1199. }).then(() => {
  1200. callSaveYpClass(row, oldCode)
  1201. }).catch((action) => {
  1202. if (action === 'cancel') {
  1203. queryYpClass()
  1204. }
  1205. })
  1206. } else {
  1207. callSaveYpClass(row, oldCode)
  1208. }
  1209. }
  1210. }
  1211. const callSaveYpClass = (row, oldCode) => {
  1212. let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
  1213. ElMessageBox.confirm(title, {
  1214. cancelButtonText: '取消',
  1215. confirmButtonText: '确定',
  1216. type: 'warning',
  1217. distinguishCancelAndClose: true,
  1218. dangerouslyUseHTMLString: true
  1219. }).then(() => {
  1220. saveYpClass(row).then((res) => {
  1221. ElMessage({
  1222. type: "success",
  1223. message: res.cg,
  1224. duration: 2500,
  1225. showClose: true,
  1226. });
  1227. if (oldCode !== null && oldCode !== row.code) {
  1228. // 删除原始数据
  1229. delYpClassByCode(oldCode).then((res) => {
  1230. queryYpClass()
  1231. })
  1232. } else {
  1233. queryYpClass()
  1234. }
  1235. })
  1236. }).catch((action) => {
  1237. if (action === 'cancel') {
  1238. queryYpClass()
  1239. }
  1240. })
  1241. }
  1242. const deleteYpClass = (index, row) => {
  1243. let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
  1244. ElMessageBox.confirm(title, {
  1245. cancelButtonText: '取消',
  1246. confirmButtonText: '确定',
  1247. type: 'warning',
  1248. distinguishCancelAndClose: true,
  1249. dangerouslyUseHTMLString: true
  1250. }).then(() => {
  1251. delYpClassByCode(row.code).then((res) => {
  1252. ElMessage({
  1253. type: "success",
  1254. message: res.cg,
  1255. duration: 2500,
  1256. showClose: true,
  1257. });
  1258. queryYpClass()
  1259. })
  1260. }).catch((action) => {
  1261. if (action === 'cancel') {
  1262. queryYpClass()
  1263. }
  1264. })
  1265. }
  1266. // 药品字典-药性字典增删改存结束
  1267. // 药品字典-药品分类字典增删改存开始
  1268. // 编辑
  1269. const editDrugKind = (row) => {
  1270. // 备份原始数据
  1271. row['oldRow'] = JSON.parse(JSON.stringify(row))
  1272. row.isEdit = true
  1273. }
  1274. // 取消
  1275. const cancelDrugKind = (row) => {
  1276. // 如果是新增的数据
  1277. if (row.isAdd) {
  1278. drugKindData.value.splice(drugKindData.value.length - 1, 1)
  1279. } else {
  1280. // 不是新增的数据 还原数据
  1281. for (const i in row.oldRow) {
  1282. row[i] = row.oldRow[i]
  1283. }
  1284. }
  1285. }
  1286. // 保存
  1287. const updateDrugKind = (row) => {
  1288. if (!row.code || !row.name) {
  1289. ElMessage({
  1290. type: "warning",
  1291. message: "药品分类字典编码或名称不存在,请检查!",
  1292. duration: 2500,
  1293. showClose: true,
  1294. });
  1295. return
  1296. }
  1297. if (row.isAdd) {
  1298. let fe = 0
  1299. for (let num in drugKindData.value) {
  1300. if (drugKindData.value[num].code === row.code) {
  1301. fe++
  1302. }
  1303. }
  1304. if (fe === 2) {
  1305. ElMessage({
  1306. type: "warning",
  1307. message: "存在重复的药品分类字典,请核对!",
  1308. duration: 2500,
  1309. showClose: true,
  1310. });
  1311. } else {
  1312. callSaveDrugKind(row, null)
  1313. }
  1314. } else {
  1315. let oldCode = row.oldRow.code
  1316. if (oldCode !== row.code) {
  1317. ElMessageBox.confirm(msgTip, {
  1318. cancelButtonText: '取消',
  1319. confirmButtonText: '确定',
  1320. type: 'warning',
  1321. distinguishCancelAndClose: true,
  1322. dangerouslyUseHTMLString: true
  1323. }).then(() => {
  1324. callSaveDrugKind(row, oldCode)
  1325. }).catch((action) => {
  1326. if (action === 'cancel') {
  1327. queryDrugKind()
  1328. }
  1329. })
  1330. } else {
  1331. callSaveDrugKind(row, oldCode)
  1332. }
  1333. }
  1334. }
  1335. const callSaveDrugKind = (row, oldCode) => {
  1336. let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
  1337. ElMessageBox.confirm(title, {
  1338. cancelButtonText: '取消',
  1339. confirmButtonText: '确定',
  1340. type: 'warning',
  1341. distinguishCancelAndClose: true,
  1342. dangerouslyUseHTMLString: true
  1343. }).then(() => {
  1344. saveDrugKind(row).then((res) => {
  1345. ElMessage({
  1346. type: "success",
  1347. message: res.cg,
  1348. duration: 2500,
  1349. showClose: true,
  1350. });
  1351. if (oldCode !== null && oldCode !== row.code) {
  1352. // 删除原始数据
  1353. delDrugKindByCode(oldCode).then((res) => {
  1354. queryDrugKind()
  1355. })
  1356. } else {
  1357. queryDrugKind()
  1358. }
  1359. })
  1360. }).catch((action) => {
  1361. if (action === 'cancel') {
  1362. queryDrugKind()
  1363. }
  1364. })
  1365. }
  1366. const deleteDrugKind = (index, row) => {
  1367. let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
  1368. ElMessageBox.confirm(title, {
  1369. cancelButtonText: '取消',
  1370. confirmButtonText: '确定',
  1371. type: 'warning',
  1372. distinguishCancelAndClose: true,
  1373. dangerouslyUseHTMLString: true
  1374. }).then(() => {
  1375. delDrugKindByCode(row.code).then((res) => {
  1376. ElMessage({
  1377. type: "success",
  1378. message: res.cg,
  1379. duration: 2500,
  1380. showClose: true,
  1381. });
  1382. queryDrugKind()
  1383. })
  1384. }).catch((action) => {
  1385. if (action === 'cancel') {
  1386. queryDrugKind()
  1387. }
  1388. })
  1389. }
  1390. // 药品字典-药品分类字典增删改存结束
  1391. // 药品字典-药品剂型字典增删改存开始
  1392. // 编辑
  1393. const editYpDosage = (row) => {
  1394. // 备份原始数据
  1395. row['oldRow'] = JSON.parse(JSON.stringify(row))
  1396. row.isEdit = true
  1397. }
  1398. // 取消
  1399. const cancelYpDosage = (row) => {
  1400. // 如果是新增的数据
  1401. if (row.isAdd) {
  1402. ypDosageData.value.splice(ypDosageData.value.length - 1, 1)
  1403. } else {
  1404. // 不是新增的数据 还原数据
  1405. for (const i in row.oldRow) {
  1406. row[i] = row.oldRow[i]
  1407. }
  1408. }
  1409. }
  1410. // 保存
  1411. const updateYpDosage = (row) => {
  1412. if (!row.code || !row.name) {
  1413. ElMessage({
  1414. type: "warning",
  1415. message: "药品剂型字典编码或名称不存在,请检查!",
  1416. duration: 2500,
  1417. showClose: true,
  1418. });
  1419. return
  1420. }
  1421. if (row.isAdd) {
  1422. let fe = 0
  1423. for (let num in ypDosageData.value) {
  1424. if (ypDosageData.value[num].code === row.code) {
  1425. fe++
  1426. }
  1427. }
  1428. if (fe === 2) {
  1429. ElMessage({
  1430. type: "warning",
  1431. message: "存在重复的药品剂型字典,请核对!",
  1432. duration: 2500,
  1433. showClose: true,
  1434. });
  1435. } else {
  1436. callSaveYpDosage(row, null)
  1437. }
  1438. } else {
  1439. let oldCode = row.oldRow.code
  1440. if (oldCode !== row.code) {
  1441. ElMessageBox.confirm(msgTip, {
  1442. cancelButtonText: '取消',
  1443. confirmButtonText: '确定',
  1444. type: 'warning',
  1445. distinguishCancelAndClose: true,
  1446. dangerouslyUseHTMLString: true
  1447. }).then(() => {
  1448. callSaveYpDosage(row, oldCode)
  1449. }).catch((action) => {
  1450. if (action === 'cancel') {
  1451. queryYpDosage()
  1452. }
  1453. })
  1454. } else {
  1455. callSaveYpDosage(row, oldCode)
  1456. }
  1457. }
  1458. }
  1459. const callSaveYpDosage = (row, oldCode) => {
  1460. let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
  1461. ElMessageBox.confirm(title, {
  1462. cancelButtonText: '取消',
  1463. confirmButtonText: '确定',
  1464. type: 'warning',
  1465. distinguishCancelAndClose: true,
  1466. dangerouslyUseHTMLString: true
  1467. }).then(() => {
  1468. saveYpDosage(row).then((res) => {
  1469. ElMessage({
  1470. type: "success",
  1471. message: res.cg,
  1472. duration: 2500,
  1473. showClose: true,
  1474. });
  1475. if (oldCode !== null && oldCode !== row.code) {
  1476. // 删除原始数据
  1477. delYpDosageByCode(oldCode).then((res) => {
  1478. queryYpDosage()
  1479. })
  1480. } else {
  1481. queryYpDosage()
  1482. }
  1483. })
  1484. }).catch((action) => {
  1485. if (action === 'cancel') {
  1486. queryYpDosage()
  1487. }
  1488. })
  1489. }
  1490. const deleteYpDosage = (index, row) => {
  1491. let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
  1492. ElMessageBox.confirm(title, {
  1493. cancelButtonText: '取消',
  1494. confirmButtonText: '确定',
  1495. type: 'warning',
  1496. distinguishCancelAndClose: true,
  1497. dangerouslyUseHTMLString: true
  1498. }).then(() => {
  1499. delYpDosageByCode(row.code).then((res) => {
  1500. ElMessage({
  1501. type: "success",
  1502. message: res.cg,
  1503. duration: 2500,
  1504. showClose: true,
  1505. });
  1506. queryYpDosage()
  1507. })
  1508. }).catch((action) => {
  1509. if (action === 'cancel') {
  1510. queryYpDosage()
  1511. }
  1512. })
  1513. }
  1514. // 药品字典-药品剂型字典增删改存结束
  1515. // 药品字典-药品单位字典增删改存开始
  1516. // 编辑
  1517. const editYpUnit = (row) => {
  1518. // 备份原始数据
  1519. row['oldRow'] = JSON.parse(JSON.stringify(row))
  1520. row.isEdit = true
  1521. }
  1522. // 取消
  1523. const cancelYpUnit = (row) => {
  1524. // 如果是新增的数据
  1525. if (row.isAdd) {
  1526. ypUnitData.value.splice(ypUnitData.value.length - 1, 1)
  1527. } else {
  1528. // 不是新增的数据 还原数据
  1529. for (const i in row.oldRow) {
  1530. row[i] = row.oldRow[i]
  1531. }
  1532. }
  1533. }
  1534. // 保存
  1535. const updateYpUnit = (row) => {
  1536. if (!row.code || !row.name) {
  1537. ElMessage({
  1538. type: "warning",
  1539. message: "药品单位字典编码或名称不存在,请检查!",
  1540. duration: 2500,
  1541. showClose: true,
  1542. });
  1543. return
  1544. }
  1545. if (row.isAdd) {
  1546. let fe = 0
  1547. for (let num in ypUnitData.value) {
  1548. if (ypUnitData.value[num].code === row.code) {
  1549. fe++
  1550. }
  1551. }
  1552. if (fe === 2) {
  1553. ElMessage({
  1554. type: "warning",
  1555. message: "存在重复的药品单位字典,请核对!",
  1556. duration: 2500,
  1557. showClose: true,
  1558. });
  1559. } else {
  1560. callSaveYpUnit(row, null)
  1561. }
  1562. } else {
  1563. let oldCode = row.oldRow.code
  1564. if (oldCode !== row.code) {
  1565. ElMessageBox.confirm(msgTip, {
  1566. cancelButtonText: '取消',
  1567. confirmButtonText: '确定',
  1568. type: 'warning',
  1569. distinguishCancelAndClose: true,
  1570. dangerouslyUseHTMLString: true
  1571. }).then(() => {
  1572. callSaveYpUnit(row, oldCode)
  1573. }).catch((action) => {
  1574. if (action === 'cancel') {
  1575. queryYpUnit()
  1576. }
  1577. })
  1578. } else {
  1579. callSaveYpUnit(row, oldCode)
  1580. }
  1581. }
  1582. }
  1583. const callSaveYpUnit = (row, oldCode) => {
  1584. let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
  1585. ElMessageBox.confirm(title, {
  1586. cancelButtonText: '取消',
  1587. confirmButtonText: '确定',
  1588. type: 'warning',
  1589. distinguishCancelAndClose: true,
  1590. dangerouslyUseHTMLString: true
  1591. }).then(() => {
  1592. saveYpUnit(row).then((res) => {
  1593. ElMessage({
  1594. type: "success",
  1595. message: res.cg,
  1596. duration: 2500,
  1597. showClose: true,
  1598. });
  1599. // 若修改了主键code,则需要删除原来的记录
  1600. if (oldCode !== null && oldCode !== row.code) {
  1601. // 删除原始数据
  1602. delYpUnitByCode(oldCode).then((res) => {
  1603. queryYpUnit()
  1604. })
  1605. } else {
  1606. queryYpUnit()
  1607. }
  1608. })
  1609. }).catch((action) => {
  1610. if (action === 'cancel') {
  1611. queryYpUnit()
  1612. }
  1613. })
  1614. }
  1615. const deleteYpUnit = (index, row) => {
  1616. let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
  1617. ElMessageBox.confirm(title, {
  1618. cancelButtonText: '取消',
  1619. confirmButtonText: '确定',
  1620. type: 'warning',
  1621. distinguishCancelAndClose: true,
  1622. dangerouslyUseHTMLString: true
  1623. }).then(() => {
  1624. delYpUnitByCode(row.code).then((res) => {
  1625. ElMessage({
  1626. type: "success",
  1627. message: res.cg,
  1628. duration: 2500,
  1629. showClose: true,
  1630. });
  1631. queryYpUnit()
  1632. })
  1633. }).catch((action) => {
  1634. if (action === 'cancel') {
  1635. queryYpUnit()
  1636. }
  1637. })
  1638. }
  1639. // 药品字典-药品单位字典增删改存结束
  1640. // 药品字典-药品费别字典增删改存开始
  1641. // 编辑
  1642. const editYpChargeGroup = (row) => {
  1643. // 备份原始数据
  1644. row['oldRow'] = JSON.parse(JSON.stringify(row))
  1645. row.isEdit = true
  1646. }
  1647. // 取消
  1648. const cancelYpChargeGroup = (row, index) => {
  1649. // 如果是新增的数据
  1650. if (row.isAdd) {
  1651. ypChargeGroupData.value.splice(index, 1)
  1652. } else {
  1653. // 不是新增的数据 还原数据
  1654. for (const i in row.oldRow) {
  1655. row[i] = row.oldRow[i]
  1656. }
  1657. }
  1658. }
  1659. // 保存
  1660. const updateYpChargeGroup = (row) => {
  1661. if (!row.code || !row.name) {
  1662. ElMessage({
  1663. type: "warning",
  1664. message: "药品费别字典编码或名称不存在,请检查!",
  1665. duration: 2500,
  1666. showClose: true,
  1667. });
  1668. return
  1669. }
  1670. if (row.isAdd) {
  1671. let fe = 0
  1672. for (let num in ypChargeGroupData.value) {
  1673. if (ypChargeGroupData.value[num].code === row.code) {
  1674. fe++
  1675. }
  1676. }
  1677. if (fe === 2) {
  1678. ElMessage({
  1679. type: "warning",
  1680. message: "存在重复的药品费别字典,请核对!",
  1681. duration: 2500,
  1682. showClose: true,
  1683. });
  1684. } else {
  1685. callSaveYpChargeGroup(row, null)
  1686. }
  1687. } else {
  1688. let oldCode = row.oldRow.code
  1689. if (oldCode !== row.code) {
  1690. ElMessageBox.confirm(msgTip, {
  1691. cancelButtonText: '取消',
  1692. confirmButtonText: '确定',
  1693. type: 'warning',
  1694. distinguishCancelAndClose: true,
  1695. dangerouslyUseHTMLString: true
  1696. }).then(() => {
  1697. callSaveYpChargeGroup(row, oldCode)
  1698. }).catch((action) => {
  1699. if (action === 'cancel') {
  1700. queryYpChargeGroup()
  1701. }
  1702. })
  1703. } else {
  1704. callSaveYpChargeGroup(row, oldCode)
  1705. }
  1706. }
  1707. }
  1708. const callSaveYpChargeGroup = (row, oldCode) => {
  1709. let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
  1710. ElMessageBox.confirm(title, {
  1711. cancelButtonText: '取消',
  1712. confirmButtonText: '确定',
  1713. type: 'warning',
  1714. distinguishCancelAndClose: true,
  1715. dangerouslyUseHTMLString: true
  1716. }).then(() => {
  1717. saveYpChargeGroup(row).then((res) => {
  1718. ElMessage({
  1719. type: "success",
  1720. message: res.cg,
  1721. duration: 2500,
  1722. showClose: true,
  1723. });
  1724. if (oldCode !== null && oldCode !== row.code) {
  1725. // 删除原始数据
  1726. delYpChargeGroupByCode(oldCode).then((res) => {
  1727. queryYpChargeGroup()
  1728. })
  1729. } else {
  1730. queryYpChargeGroup()
  1731. }
  1732. })
  1733. }).catch((action) => {
  1734. if (action === 'cancel') {
  1735. queryYpChargeGroup()
  1736. }
  1737. })
  1738. }
  1739. const deleteYpChargeGroup = (index, row) => {
  1740. let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
  1741. ElMessageBox.confirm(title, {
  1742. cancelButtonText: '取消',
  1743. confirmButtonText: '确定',
  1744. type: 'warning',
  1745. distinguishCancelAndClose: true,
  1746. dangerouslyUseHTMLString: true
  1747. }).then(() => {
  1748. delYpChargeGroupByCode(row.code).then((res) => {
  1749. ElMessage({
  1750. type: "success",
  1751. message: res.cg,
  1752. duration: 2500,
  1753. showClose: true,
  1754. });
  1755. queryYpChargeGroup()
  1756. })
  1757. }).catch((action) => {
  1758. if (action === 'cancel') {
  1759. queryYpChargeGroup()
  1760. }
  1761. })
  1762. }
  1763. // 药品字典-药品费别字典增删改存结束
  1764. // 药房药品住院停用增删改存开始
  1765. // 编辑
  1766. const editVisibleFlag = (row) => {
  1767. // 备份原始数据
  1768. row['oldRow'] = JSON.parse(JSON.stringify(row))
  1769. row.isEdit = true
  1770. }
  1771. // 取消
  1772. const cancelVisibleFlag = (row, index) => {
  1773. // 如果是新增的数据
  1774. if (row.isAdd) {
  1775. visibleFlagData.value.splice(index, 1)
  1776. } else {
  1777. // 不是新增的数据 还原数据
  1778. for (const i in row.oldRow) {
  1779. row[i] = row.oldRow[i]
  1780. }
  1781. }
  1782. }
  1783. // 保存
  1784. const updateVisibleFlag = (row) => {
  1785. if (!row.chargeCode || !row.groupNo) {
  1786. ElMessage({
  1787. type: "warning",
  1788. message: "药房药品停用的药品编码或药房编码不存在,请检查!",
  1789. duration: 2500,
  1790. showClose: true,
  1791. });
  1792. return
  1793. }
  1794. if (row.isAdd) {
  1795. ElMessage({
  1796. type: "warning",
  1797. message: "不能新增药房药品停用,需先维护药品信息!",
  1798. duration: 2500,
  1799. showClose: true,
  1800. });
  1801. } else {
  1802. callSaveVisibleFlag(row)
  1803. }
  1804. }
  1805. const callSaveVisibleFlag = (row) => {
  1806. let title = '请确认是否保存<span style="color:#d12020;">' + row.drug + '</span>?'
  1807. ElMessageBox.confirm(title, {
  1808. cancelButtonText: '取消',
  1809. confirmButtonText: '确定',
  1810. type: 'warning',
  1811. distinguishCancelAndClose: true,
  1812. dangerouslyUseHTMLString: true
  1813. }).then(() => {
  1814. updateYpVisibleFlag(row).then((res) => {
  1815. ElMessage({
  1816. type: "success",
  1817. message: res.cg,
  1818. duration: 2500,
  1819. showClose: true,
  1820. });
  1821. queryVisibleFlag()
  1822. })
  1823. }).catch((action) => {
  1824. if (action === 'cancel') {
  1825. queryVisibleFlag()
  1826. }
  1827. })
  1828. }
  1829. // 药房药品住院停用增删改存结束
  1830. // 药品字典-药品供应商字典增删改存开始
  1831. // 编辑
  1832. const editYpSupply = (row) => {
  1833. // 备份原始数据
  1834. row['oldRow'] = JSON.parse(JSON.stringify(row))
  1835. row.isEdit = true
  1836. }
  1837. // 取消
  1838. const cancelYpSupply = (row, index) => {
  1839. // 如果是新增的数据
  1840. if (row.isAdd) {
  1841. ypSupplyData.value.splice(ypSupplyData.value.length - 1, 1)
  1842. } else {
  1843. // 不是新增的数据 还原数据
  1844. for (const i in row.oldRow) {
  1845. row[i] = row.oldRow[i]
  1846. }
  1847. }
  1848. }
  1849. // 保存
  1850. const updateYpSupply = (row) => {
  1851. if (!row.code || !row.name) {
  1852. ElMessage({
  1853. type: "warning",
  1854. message: "药品供应商字典编码或名称不存在,请检查!",
  1855. duration: 2500,
  1856. showClose: true,
  1857. });
  1858. return
  1859. }
  1860. if (row.isAdd) {
  1861. let fe = 0
  1862. for (let num in ypSupplyData.value) {
  1863. if (ypSupplyData.value[num].code === row.code) {
  1864. fe++
  1865. }
  1866. }
  1867. if (fe === 2) {
  1868. ElMessage({
  1869. type: "warning",
  1870. message: "存在重复的药品供应商字典,请核对!",
  1871. duration: 2500,
  1872. showClose: true,
  1873. });
  1874. } else {
  1875. callSaveYpSupply(row, null)
  1876. }
  1877. } else {
  1878. let oldCode = row.oldRow.code
  1879. if (oldCode !== row.code) {
  1880. ElMessageBox.confirm(msgTip, {
  1881. cancelButtonText: '取消',
  1882. confirmButtonText: '确定',
  1883. type: 'warning',
  1884. distinguishCancelAndClose: true,
  1885. dangerouslyUseHTMLString: true
  1886. }).then(() => {
  1887. callSaveYpSupply(row, oldCode)
  1888. }).catch((action) => {
  1889. if (action === 'cancel') {
  1890. queryYpSupply()
  1891. }
  1892. })
  1893. } else {
  1894. callSaveYpSupply(row, oldCode)
  1895. }
  1896. }
  1897. }
  1898. const callSaveYpSupply = (row, oldCode) => {
  1899. let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
  1900. ElMessageBox.confirm(title, {
  1901. cancelButtonText: '取消',
  1902. confirmButtonText: '确定',
  1903. type: 'warning',
  1904. distinguishCancelAndClose: true,
  1905. dangerouslyUseHTMLString: true
  1906. }).then(() => {
  1907. saveYpSupply(row).then((res) => {
  1908. ElMessage({
  1909. type: "success",
  1910. message: res.cg,
  1911. duration: 2500,
  1912. showClose: true,
  1913. });
  1914. if (oldCode !== null && oldCode !== row.code) {
  1915. // 删除原始数据
  1916. delYpSupplyByCode(oldCode).then((res) => {
  1917. queryYpSupply()
  1918. })
  1919. } else {
  1920. queryYpSupply()
  1921. }
  1922. })
  1923. }).catch((action) => {
  1924. if (action === 'cancel') {
  1925. queryYpSupply()
  1926. }
  1927. })
  1928. }
  1929. const deleteYpSupply = (index, row) => {
  1930. let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
  1931. ElMessageBox.confirm(title, {
  1932. cancelButtonText: '取消',
  1933. confirmButtonText: '确定',
  1934. type: 'warning',
  1935. distinguishCancelAndClose: true,
  1936. dangerouslyUseHTMLString: true
  1937. }).then(() => {
  1938. delYpSupplyByCode(row.code).then((res) => {
  1939. ElMessage({
  1940. type: "success",
  1941. message: res.cg,
  1942. duration: 2500,
  1943. showClose: true,
  1944. });
  1945. queryYpSupply()
  1946. })
  1947. }).catch((action) => {
  1948. if (action === 'cancel') {
  1949. queryYpSupply()
  1950. }
  1951. })
  1952. }
  1953. // 药品字典-药品供应商字典增删改存结束
  1954. // 药品字典-生产厂家字典增删改存开始
  1955. // 编辑
  1956. const editYpManuFactory = (row) => {
  1957. // 备份原始数据
  1958. row['oldRow'] = JSON.parse(JSON.stringify(row))
  1959. row.isEdit = true
  1960. }
  1961. // 取消
  1962. const cancelYpManuFactory = (row) => {
  1963. // 如果是新增的数据
  1964. if (row.isAdd) {
  1965. ypManuFactoryData.value.splice(ypManuFactoryData.value.length - 1, 1)
  1966. } else {
  1967. // 不是新增的数据 还原数据
  1968. for (const i in row.oldRow) {
  1969. row[i] = row.oldRow[i]
  1970. }
  1971. }
  1972. }
  1973. // 保存
  1974. const updateYpManuFactory = (row) => {
  1975. if (!row.code || !row.name) {
  1976. ElMessage({
  1977. type: "warning",
  1978. message: "生产厂家字典编码或名称不存在,请检查!",
  1979. duration: 2500,
  1980. showClose: true,
  1981. });
  1982. return
  1983. }
  1984. if (row.isAdd) {
  1985. let fe = 0
  1986. for (let num in ypManuFactoryData.value) {
  1987. if (ypManuFactoryData.value[num].code === row.code) {
  1988. fe++
  1989. }
  1990. }
  1991. if (fe === 2) {
  1992. ElMessage({
  1993. type: "warning",
  1994. message: "存在重复的生产厂家字典,请核对!",
  1995. duration: 2500,
  1996. showClose: true,
  1997. });
  1998. } else {
  1999. callSaveYpManuFactory(row, null)
  2000. }
  2001. } else {
  2002. let oldCode = row.oldRow.code
  2003. if (oldCode !== row.code) {
  2004. ElMessageBox.confirm(msgTip, {
  2005. cancelButtonText: '取消',
  2006. confirmButtonText: '确定',
  2007. type: 'warning',
  2008. distinguishCancelAndClose: true,
  2009. dangerouslyUseHTMLString: true
  2010. }).then(() => {
  2011. callSaveYpManuFactory(row, oldCode)
  2012. }).catch((action) => {
  2013. if (action === 'cancel') {
  2014. queryYpManuFactory()
  2015. }
  2016. })
  2017. } else {
  2018. callSaveYpManuFactory(row, oldCode)
  2019. }
  2020. }
  2021. }
  2022. const callSaveYpManuFactory = (row, oldCode) => {
  2023. let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
  2024. ElMessageBox.confirm(title, {
  2025. cancelButtonText: '取消',
  2026. confirmButtonText: '确定',
  2027. type: 'warning',
  2028. distinguishCancelAndClose: true,
  2029. dangerouslyUseHTMLString: true
  2030. }).then(() => {
  2031. saveYpManuFactory(row).then((res) => {
  2032. ElMessage({
  2033. type: "success",
  2034. message: res.cg,
  2035. duration: 2500,
  2036. showClose: true,
  2037. });
  2038. if (oldCode !== null && oldCode !== row.code) {
  2039. // 删除原始数据
  2040. delYpManuFactoryByCode(oldCode).then((res) => {
  2041. queryYpManuFactory()
  2042. })
  2043. } else {
  2044. queryYpManuFactory()
  2045. }
  2046. })
  2047. }).catch((action) => {
  2048. if (action === 'cancel') {
  2049. queryYpManuFactory()
  2050. }
  2051. })
  2052. }
  2053. const deleteYpManuFactory = (index, row) => {
  2054. let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
  2055. ElMessageBox.confirm(title, {
  2056. cancelButtonText: '取消',
  2057. confirmButtonText: '确定',
  2058. type: 'warning',
  2059. distinguishCancelAndClose: true,
  2060. dangerouslyUseHTMLString: true
  2061. }).then(() => {
  2062. delYpManuFactoryByCode(row.code).then((res) => {
  2063. ElMessage({
  2064. type: "success",
  2065. message: res.cg,
  2066. duration: 2500,
  2067. showClose: true,
  2068. });
  2069. queryYpManuFactory()
  2070. })
  2071. }).catch((action) => {
  2072. if (action === 'cancel') {
  2073. queryYpManuFactory()
  2074. }
  2075. })
  2076. }
  2077. // 药品字典-生产厂家字典增删改存结束
  2078. const exportData = () => {
  2079. alert("功能建设中。。。")
  2080. }
  2081. const handleClick = (tab, event) => {
  2082. // 查询哪个tab页面
  2083. editableTabsValue.value = tab.props.name
  2084. if (editableTabsValue.value === 'ypClass') {
  2085. queryYpClass()
  2086. currentPageClass.value = 1
  2087. } else if (editableTabsValue.value === 'drugKind') {
  2088. queryDrugKind()
  2089. currentPageKind.value = 1
  2090. } else if (editableTabsValue.value === 'ypDosage') {
  2091. queryYpDosage()
  2092. currentPageDosage.value = 1
  2093. } else if (editableTabsValue.value === 'ypUnit') {
  2094. queryYpUnit()
  2095. currentPageUnit.value = 1
  2096. } else if (editableTabsValue.value === 'ypChargeGroup') {
  2097. queryYpChargeGroup()
  2098. } else if (editableTabsValue.value === 'visibleFlag') {
  2099. queryVisibleFlag()
  2100. currentPage.value = 1
  2101. } else if (editableTabsValue.value === 'ypSupply') {
  2102. queryYpSupply()
  2103. currentPageSupply.value = 1
  2104. } else if (editableTabsValue.value === 'ypManuFactory') {
  2105. queryYpManuFactory()
  2106. currentPageManuFactory.value = 1
  2107. }
  2108. }
  2109. const tableRowClassName = ({
  2110. row,
  2111. rowIndex,
  2112. }) => {
  2113. if (row.delFlag === '1') {
  2114. return 'warning-row'
  2115. }
  2116. }
  2117. </script>
  2118. <style lang="scss" deep>
  2119. .el-dialog__body {
  2120. padding: 0 16px;
  2121. height: calc(100% - 25px);
  2122. }
  2123. .el-tabs {
  2124. height: calc(100% - 27px);
  2125. .el-tabs__content {
  2126. padding: 5px;
  2127. height: calc(100% - 27px);
  2128. }
  2129. .el-tab-pane {
  2130. height: calc(100% - 27px);
  2131. overflow: auto;
  2132. }
  2133. .el-table__inner-wrapper {
  2134. height: calc(100% - 10px) !important;
  2135. }
  2136. }
  2137. .el-table .warning-row {
  2138. --el-table-tr-bg-color: #dd7694;
  2139. }
  2140. </style>