AcupointTable.vue 64 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201
  1. <template>
  2. <div class="recipe-acupoint-wrapper">
  3. <!-- 处方 tab + 按钮同一行 -->
  4. <div class="prescription-header flex-vertical-between">
  5. <div class="table-label flex-vertical-center-l">
  6. <div
  7. class="label-item flex-center"
  8. v-for="(item, index) in prescriptions"
  9. :key="index"
  10. >
  11. <el-tooltip :content="item.itemName" placement="top" :open-delay="300">
  12. <span
  13. :class="{ l_active: activeIndex === index }"
  14. @click="switchTab(index)"
  15. >{{ item.itemName }}</span>
  16. </el-tooltip>
  17. <div
  18. @click.stop="removePrescription(index)"
  19. >X</div>
  20. </div>
  21. </div>
  22. <div class="top-btns">
  23. <el-button size="mini" type="warning" @click="openAddDialog()"
  24. >新增处方</el-button
  25. >
  26. <el-button size="mini" type="warning" @click="clearAll();$emit('clear')">清空处方</el-button>
  27. </div>
  28. </div>
  29. <!--新增适宜技术处方弹窗 -->
  30. <el-dialog
  31. :visible.sync="showAddDialog"
  32. width="800px"
  33. top="10vh"
  34. :show-close="false"
  35. :close-on-click-modal="false"
  36. append-to-body
  37. custom-class="add-prescription-dialog"
  38. >
  39. <div slot="title" class="add-dialog-header">
  40. <span>新增适宜技术处方</span>
  41. <div class="close-btn" @click="showAddDialog = false">+</div>
  42. </div>
  43. <div class="add-dialog-body">
  44. <div class="add-form-row">
  45. <span class="label">分类:</span>
  46. <el-select
  47. size="mini"
  48. v-model="addForm.category"
  49. placeholder="请选择"
  50. clearable
  51. style="flex: 1"
  52. @change="onCategoryChange"
  53. >
  54. <el-option
  55. v-for="item in classifyOptions"
  56. :key="item.value"
  57. :label="item.label"
  58. :value="item.value"
  59. ></el-option>
  60. </el-select>
  61. <span class="label"
  62. ><span style="color: red">*</span> 项目名称:</span
  63. >
  64. <el-select
  65. ref="itemSelect"
  66. size="mini"
  67. v-model="addForm.itemId"
  68. filterable
  69. :filter-method="searchItem"
  70. :loading="itemLoading"
  71. loading-text="搜索中..."
  72. no-data-text="暂无数据"
  73. placeholder="请搜索选择"
  74. style="flex: 1"
  75. @change="onItemSelected"
  76. @visible-change="onItemSelectVisibleChange"
  77. >
  78. <el-option
  79. v-for="item in itemOptions"
  80. :key="item.id"
  81. :label="item.name"
  82. :value="item.id"
  83. ></el-option>
  84. </el-select>
  85. </div>
  86. </div>
  87. <div class="add-dialog-btns">
  88. <div class="confirm-btn" :class="{ 'is-disabled': addLoading }" @click="confirmAdd()">确定</div>
  89. </div>
  90. </el-dialog>
  91. <div class="recipe-acupoint">
  92. <div
  93. class="table-toolbar flex-vertical-center-l flex-wrap"
  94. v-if="prescriptions.length"
  95. >
  96. <div class="toolbar-item flex-vertical-center-l" v-if="showEditable">
  97. <span><span style="color: red">*</span> 是否可修改:</span>
  98. <el-select
  99. size="mini"
  100. v-model="innerIsEditable"
  101. placeholder="请选择"
  102. style="width: 80px"
  103. @change="onEditableChange"
  104. >
  105. <el-option label="是" value="1"></el-option>
  106. <el-option label="否" value="0"></el-option>
  107. </el-select>
  108. </div>
  109. <div class="toolbar-item flex-vertical-center-l">
  110. <span
  111. ><span v-if="detailRequired" style="color: red">*</span>
  112. 详情:</span
  113. >
  114. <el-checkbox-group
  115. v-model="innerDetailTypes"
  116. size="mini"
  117. :disabled="isLocked"
  118. @change="onDetailTypesChange"
  119. >
  120. <el-checkbox label="穴位">穴位</el-checkbox>
  121. <el-checkbox label="经络">经络</el-checkbox>
  122. <el-checkbox label="耳穴">耳穴</el-checkbox>
  123. <el-checkbox label="部位">部位</el-checkbox>
  124. <el-checkbox label="其他详情">其他详情</el-checkbox>
  125. <el-checkbox label="无详情">无详情</el-checkbox>
  126. </el-checkbox-group>
  127. </div>
  128. </div>
  129. <div class="table-container" v-if="prescriptions.length">
  130. <!-- 表格 -->
  131. <div
  132. v-for="detailType in activeDetailTypes"
  133. :key="detailType"
  134. class="detail-table-section"
  135. >
  136. <div class="detail-section-label" v-if="prescriptions.length">
  137. {{ detailType }}
  138. </div>
  139. <div class="table-show flex-vertical-between">
  140. <!-- 左侧表格 -->
  141. <div class="table-left">
  142. <el-table
  143. :data="getLeftList(detailType)"
  144. border
  145. size="mini"
  146. style="width: 100%"
  147. >
  148. <el-table-column
  149. prop="id"
  150. label="序号"
  151. width="50"
  152. align="center"
  153. ></el-table-column>
  154. <el-table-column :label="detailType" min-width="100">
  155. <template slot-scope="scope">
  156. <el-select
  157. v-if="detailType !== '其他详情' && detailType !== '部位'"
  158. size="mini"
  159. :value="scope.row.name"
  160. remote
  161. filterable
  162. :filter-method="getFilterMethod(detailType)"
  163. placeholder="请选择"
  164. :disabled="isLocked"
  165. @change="onItemChange($event, scope, detailType)"
  166. @focus="searchByType('', detailType)"
  167. >
  168. <el-option
  169. v-for="(item, idx) in getSearchOptions(detailType)"
  170. :key="idx"
  171. :label="item.acuname"
  172. :value="item.acuid"
  173. ></el-option>
  174. </el-select>
  175. <el-input
  176. v-else
  177. size="mini"
  178. v-model="scope.row.name"
  179. placeholder="请输入"
  180. :disabled="isLocked"
  181. @change="onDetailInput(scope, detailType)"
  182. ></el-input>
  183. </template>
  184. </el-table-column>
  185. <el-table-column label="数量" width="80" align="center">
  186. <template slot-scope="scope">
  187. <el-input-number
  188. size="mini"
  189. v-model="scope.row.count"
  190. :min="1"
  191. :controls="false"
  192. style="width: 100%"
  193. :disabled="isLocked"
  194. ></el-input-number>
  195. </template>
  196. </el-table-column>
  197. <el-table-column label="备注" min-width="80">
  198. <template slot-scope="scope">
  199. <el-input
  200. size="mini"
  201. v-model="scope.row.remark"
  202. placeholder="请输入"
  203. :disabled="isLocked"
  204. ></el-input>
  205. </template>
  206. </el-table-column>
  207. <el-table-column
  208. label="主配穴"
  209. width="100"
  210. align="center"
  211. v-if="detailType === '穴位'"
  212. >
  213. <template slot-scope="scope">
  214. <el-select
  215. size="mini"
  216. v-model="scope.row.mainType"
  217. style="width: 100%"
  218. >
  219. <el-option label="主穴" value="1"></el-option>
  220. <el-option label="配穴" value="2"></el-option>
  221. </el-select>
  222. </template>
  223. </el-table-column>
  224. <el-table-column label="操作" width="100" fixed="right">
  225. <template slot-scope="scope" v-if="scope.row.name">
  226. <div class="operate">
  227. <img
  228. src="~@/assets/add.png"
  229. alt
  230. :class="{ 'operate-disabled': isLocked }"
  231. @click="!isLocked && addDetailRow(scope, detailType)"
  232. />
  233. <img
  234. src="~@/assets/delete1.png"
  235. alt
  236. :class="{ 'operate-disabled': isDeleteDisabled(scope.row, detailType) }"
  237. @click="!isDeleteDisabled(scope.row, detailType) && deleteDetailRow(scope, detailType)"
  238. />
  239. <img
  240. v-if="
  241. detailType !== '其他详情' && detailType !== '部位'
  242. "
  243. src="~@/assets/find.png"
  244. alt
  245. @click="find(scope, detailType)"
  246. />
  247. </div>
  248. </template>
  249. </el-table-column>
  250. </el-table>
  251. </div>
  252. <!-- 右侧表格 -->
  253. <div class="table-left">
  254. <el-table
  255. :data="getRightList(detailType)"
  256. border
  257. size="mini"
  258. style="width: 100%"
  259. >
  260. <el-table-column
  261. prop="id"
  262. label="序号"
  263. width="50"
  264. align="center"
  265. ></el-table-column>
  266. <el-table-column :label="detailType" min-width="100">
  267. <template slot-scope="scope">
  268. <el-select
  269. v-if="detailType !== '其他详情' && detailType !== '部位'"
  270. size="mini"
  271. :value="scope.row.name"
  272. remote
  273. filterable
  274. :filter-method="getFilterMethod(detailType)"
  275. placeholder="请选择"
  276. :disabled="isLocked"
  277. @change="onItemChange($event, scope, detailType)"
  278. @focus="searchByType('', detailType)"
  279. >
  280. <el-option
  281. v-for="(item, idx) in getSearchOptions(detailType)"
  282. :key="idx"
  283. :label="item.acuname"
  284. :value="item.acuid"
  285. ></el-option>
  286. </el-select>
  287. <el-input
  288. v-else
  289. size="mini"
  290. v-model="scope.row.name"
  291. placeholder="请输入"
  292. :disabled="isLocked"
  293. @change="onDetailInput(scope, detailType)"
  294. ></el-input>
  295. </template>
  296. </el-table-column>
  297. <el-table-column label="数量" width="80" align="center">
  298. <template slot-scope="scope">
  299. <el-input-number
  300. size="mini"
  301. v-model="scope.row.count"
  302. :min="1"
  303. :controls="false"
  304. style="width: 100%"
  305. :disabled="isLocked"
  306. ></el-input-number>
  307. </template>
  308. </el-table-column>
  309. <el-table-column label="备注" min-width="80">
  310. <template slot-scope="scope">
  311. <el-input
  312. size="mini"
  313. v-model="scope.row.remark"
  314. placeholder="请输入"
  315. :disabled="isLocked"
  316. ></el-input>
  317. </template>
  318. </el-table-column>
  319. <el-table-column
  320. label="主配穴"
  321. width="100"
  322. align="center"
  323. v-if="detailType === '穴位'"
  324. >
  325. <template slot-scope="scope">
  326. <el-select
  327. size="mini"
  328. v-model="scope.row.mainType"
  329. style="width: 100%"
  330. >
  331. <el-option label="主穴" value="1"></el-option>
  332. <el-option label="配穴" value="2"></el-option>
  333. </el-select>
  334. </template>
  335. </el-table-column>
  336. <el-table-column label="操作" width="100" fixed="right">
  337. <template slot-scope="scope" v-if="scope.row.name">
  338. <div class="operate">
  339. <img
  340. src="~@/assets/add.png"
  341. alt
  342. :class="{ 'operate-disabled': isLocked }"
  343. @click="!isLocked && addDetailRow(scope, detailType)"
  344. />
  345. <img
  346. src="~@/assets/delete1.png"
  347. alt
  348. :class="{ 'operate-disabled': isDeleteDisabled(scope.row, detailType) }"
  349. @click="!isDeleteDisabled(scope.row, detailType) && deleteDetailRow(scope, detailType)"
  350. />
  351. <img
  352. v-if="
  353. detailType !== '其他详情' && detailType !== '部位'
  354. "
  355. src="~@/assets/find.png"
  356. alt
  357. @click="find(scope, detailType)"
  358. />
  359. </div>
  360. </template>
  361. </el-table-column>
  362. </el-table>
  363. </div>
  364. </div>
  365. </div>
  366. </div>
  367. <div class="no-data-tip" v-else>
  368. <span>暂无项目,请先点击"新增"添加项目</span>
  369. </div>
  370. <!-- 底部统计 -->
  371. <div class="table-bottom" v-if="prescriptions.length">
  372. <div class="table-b-header">
  373. <div class="header-about">
  374. <div
  375. class="item flex-vertical-center-l"
  376. style="align-items: flex-start;"
  377. v-if="showGuide"
  378. >
  379. <span><span style="opacity:0">*</span> 配穴指南:</span>
  380. <div style="flex: 1;">
  381. <el-input
  382. size="mini"
  383. placeholder="请输入"
  384. v-model="pointMatchGuide"
  385. type="textarea"
  386. auto-size="{ minRows: 1, maxRows: 4 }"
  387. :disabled="isLocked"
  388. @input="emitStatistics"
  389. ></el-input>
  390. </div>
  391. </div>
  392. <div
  393. class="item flex-vertical-center-l"
  394. style="align-items: flex-start;"
  395. >
  396. <span><span style="color: red">*</span> 操作指南:</span>
  397. <div style="flex: 1;">
  398. <el-input
  399. size="mini"
  400. placeholder="请输入"
  401. v-model="operationGuide"
  402. type="textarea"
  403. auto-size="{ minRows: 1, maxRows: 4 }"
  404. :disabled="isLocked"
  405. @input="emitStatistics"
  406. ></el-input>
  407. </div>
  408. </div>
  409. <div
  410. class="item flex-vertical-center-l"
  411. style="align-items: flex-start;"
  412. v-if="showEntrust"
  413. >
  414. <span><span style="opacity:0">*</span> 嘱托:</span>
  415. <div style="flex: 1;">
  416. <el-input
  417. size="mini"
  418. placeholder="请输入"
  419. v-model="command"
  420. type="textarea"
  421. auto-size="{ minRows: 1, maxRows: 2 }"
  422. :disabled="isLocked"
  423. @input="emitStatistics"
  424. ></el-input>
  425. </div>
  426. </div>
  427. </div>
  428. <div class="header-about">
  429. <div class="stat-row flex-vertical-center-l flex-wrap">
  430. <div class="stat-field flex-vertical-center-l">
  431. <span><span style="color: red">*</span> 单次:</span>
  432. <el-input-number
  433. size="mini"
  434. v-model="singleCount"
  435. :min="1"
  436. :controls="false"
  437. style="width: 60px"
  438. @change="onSingleCountChange"
  439. placeholder="请输入"
  440. ></el-input-number>
  441. <span class="stat-unit">{{ currentPricingUnit }}</span>
  442. </div>
  443. <div class="stat-field flex-vertical-center-l">
  444. <span><span v-if="requiredTreatFields" style="color: red">*</span> 治疗次数:</span>
  445. <el-input-number
  446. size="mini"
  447. v-model="treatCount"
  448. :min="0"
  449. :controls="false"
  450. style="width: 60px"
  451. :disabled="isLocked"
  452. @change="updatePrice"
  453. ></el-input-number>
  454. </div>
  455. <div class="stat-field flex-vertical-center-l">
  456. <span><span v-if="requiredTreatFields" style="color: red">*</span> 频次:</span>
  457. <el-input-number
  458. size="mini"
  459. v-model="frequency"
  460. :min="0"
  461. :controls="false"
  462. style="width: 60px"
  463. :disabled="isLocked"
  464. @change="emitStatistics"
  465. placeholder="请输入"
  466. ></el-input-number>
  467. <span class="stat-unit">天</span>
  468. <el-input-number
  469. size="mini"
  470. v-model="frequencyUnit"
  471. :min="0"
  472. :controls="false"
  473. style="width: 60px"
  474. :disabled="isLocked"
  475. @change="emitStatistics"
  476. placeholder="请输入"
  477. ></el-input-number>
  478. <span class="stat-unit">次</span>
  479. </div>
  480. </div>
  481. </div>
  482. </div>
  483. </div>
  484. </div>
  485. <!-- 底部金额 - 固定在最底部 -->
  486. <div class="table-b-bottom flex-vertical-between">
  487. <div class="t-b-b-left flex-vertical-center-l flex-wrap">
  488. <div class="t-b-l-item">
  489. 单次金额:<span>{{ singlePrice || "0.00" }}元</span>
  490. </div>
  491. <div class="t-b-l-item">
  492. 疗程金额:<span>{{ coursePrice || "0.00" }}元</span>
  493. </div>
  494. <div class="t-b-l-item" v-if="showAgreementTotal">
  495. 协定方总金额:<span>{{ totalPrice || "0.00" }}元</span>
  496. </div>
  497. </div>
  498. <div class="t-b-b-right flex-vertical-center-r">
  499. <el-button
  500. type="primary"
  501. size="mini"
  502. :loading="saveLoading"
  503. @click="handleSave"
  504. >保存</el-button
  505. >
  506. </div>
  507. </div>
  508. <!-- 查看详情弹窗 -->
  509. <el-dialog
  510. :visible.sync="showDetailDialog"
  511. width="50%"
  512. top="5vh"
  513. :title="detailType + '详情'"
  514. append-to-body
  515. custom-class="detail-dialog"
  516. >
  517. <div class="drug-body">
  518. <!-- 穴位详情 -->
  519. <template v-if="detailType === '穴位'">
  520. <div class="drug-item">
  521. <span>穴位名称:</span>
  522. <div>{{ detailData.acuname }}</div>
  523. </div>
  524. <div class="drug-item">
  525. <span>定位:</span>
  526. <div>{{ detailData.acuposotion }}</div>
  527. </div>
  528. <div class="drug-item">
  529. <span>解剖:</span>
  530. <div>{{ detailData.acudiscection }}</div>
  531. </div>
  532. <div class="drug-item">
  533. <span>主治:</span>
  534. <div>{{ detailData.acumaintreat }}</div>
  535. </div>
  536. <div class="drug-item">
  537. <span>操作:</span>
  538. <div>{{ detailData.acuoperation }}</div>
  539. </div>
  540. <div class="drug-item">
  541. <span>针刺:</span>
  542. <div>{{ detailData.acuneedling }}</div>
  543. </div>
  544. <div class="drug-item" v-if="detailData.acuimg">
  545. <span>图示:</span>
  546. <div class="detail-img"><img :src="detailData.acuimg" /></div>
  547. </div>
  548. </template>
  549. <!-- 经络详情 -->
  550. <template v-else-if="detailType === '经络'">
  551. <div class="drug-item">
  552. <span>经络名称:</span>
  553. <div>{{ detailData.mername }}</div>
  554. </div>
  555. <div class="drug-item">
  556. <span>类型:</span>
  557. <div>{{ merTypeMap[detailData.mertype] || "-" }}</div>
  558. </div>
  559. <div class="drug-item" v-if="detailData.mermaindisease">
  560. <span>主要病候:</span>
  561. <div v-html="detailData.mermaindisease"></div>
  562. </div>
  563. <div class="drug-item" v-if="detailData.mermaintreat">
  564. <span>主治概要:</span>
  565. <div v-html="detailData.mermaintreat"></div>
  566. </div>
  567. <div class="drug-item" v-if="detailData.merimg">
  568. <span>图片:</span>
  569. <div class="detail-img"><img :src="detailData.merimg" /></div>
  570. </div>
  571. </template>
  572. <!-- 耳穴详情 -->
  573. <template v-else-if="detailType === '耳穴'">
  574. <div class="drug-item">
  575. <span>名称:</span>
  576. <div>{{ detailData.name }}</div>
  577. </div>
  578. <div class="drug-item" v-if="detailData.area">
  579. <span>定位:</span>
  580. <div>{{ detailData.area }}</div>
  581. </div>
  582. <div class="drug-item" v-if="detailData.effect">
  583. <span>功能:</span>
  584. <div>{{ detailData.effect }}</div>
  585. </div>
  586. <div class="drug-item" v-if="detailData.mainTreat">
  587. <span>主治:</span>
  588. <div>{{ detailData.mainTreat }}</div>
  589. </div>
  590. <div class="drug-item" v-if="detailData.photo">
  591. <span>图片:</span>
  592. <div class="detail-img"><img :src="detailData.photo" /></div>
  593. </div>
  594. </template>
  595. </div>
  596. </el-dialog>
  597. </div>
  598. </template>
  599. <script>
  600. import {
  601. getXueweiList,
  602. collateralChannels,
  603. getAcupointD,
  604. getMerD,
  605. getAcuMeridianList,
  606. getAcuMeridianDetail,
  607. } from "@/api/knowledge.js";
  608. import {
  609. getMappedNondrugItemList,
  610. getNondrugItemDetail,
  611. } from "@/api/technology.js";
  612. import popup from "@/components/Propup.vue";
  613. // 详情默认值
  614. const DETAIL_DEFAULT_MAP = {
  615. "1": "穴位",
  616. "2": "部位",
  617. "3": "耳穴",
  618. "4": "经络",
  619. "5": "其他详情",
  620. "6": "无详情",
  621. };
  622. function createEmptyRow(id) {
  623. return {
  624. id,
  625. acuid: "",
  626. acuname: "",
  627. name: "",
  628. count: 1,
  629. remark: "",
  630. mainType: "1",
  631. };
  632. }
  633. function createPrescriptionData(options = {}) {
  634. const {
  635. detailRequired = false,
  636. detailTypes = [],
  637. singleCount = 0,
  638. unitPrice = 0,
  639. } = options;
  640. const singlePrice = (singleCount * unitPrice).toFixed(2);
  641. const allTypes = ["穴位", "经络", "耳穴", "部位", "其他详情", "无详情"];
  642. const detailTables = {};
  643. allTypes.forEach((type) => {
  644. if (type === "无详情") {
  645. detailTables[type] = detailTypes.includes(type)
  646. ? [{ description: "" }]
  647. : [];
  648. } else {
  649. detailTables[type] = detailTypes.includes(type)
  650. ? [createEmptyRow(1)]
  651. : [];
  652. }
  653. });
  654. return {
  655. detailTables,
  656. innerIsEditable: "1",
  657. innerDetailTypes: detailTypes.length > 0 ? detailTypes : [],
  658. detailRequired: !!detailRequired,
  659. operationGuide: "",
  660. pointMatchGuide: "",
  661. command: "",
  662. singleCount,
  663. treatCount: 1,
  664. frequency: undefined,
  665. frequencyUnit: undefined,
  666. singlePrice,
  667. coursePrice: "0.00",
  668. totalPrice: "0.00",
  669. currentUnitPrice: unitPrice,
  670. _manualSingleCount: false,
  671. };
  672. }
  673. export default {
  674. name: "适宜技术处方",
  675. components: { popup },
  676. props: {
  677. value: {
  678. type: Array,
  679. default: () => [],
  680. },
  681. isEditable: {
  682. type: String,
  683. default: "1",
  684. },
  685. showEditable: {
  686. type: Boolean,
  687. default: true,
  688. },
  689. detailTypes: {
  690. type: Array,
  691. default: () => ["穴位"],
  692. },
  693. statistics: {
  694. type: Object,
  695. default: () => ({}),
  696. },
  697. showGuide: {
  698. type: Boolean,
  699. default: false,
  700. },
  701. showEntrust: {
  702. type: Boolean,
  703. default: false,
  704. },
  705. showAgreementTotal: {
  706. type: Boolean,
  707. default: true,
  708. },
  709. unitPrice: {
  710. type: Number,
  711. default: 0,
  712. },
  713. ownerType: {
  714. type: String,
  715. default: "",
  716. },
  717. requiredTreatFields: {
  718. type: Boolean,
  719. default: false,
  720. },
  721. reportAddRecipe: {
  722. type: Boolean,
  723. default: false,
  724. },
  725. useIsUpdateLock: {
  726. type: Boolean,
  727. default: false,
  728. },
  729. },
  730. data() {
  731. return {
  732. name: "适宜技术处方",
  733. // 是否自拟处方
  734. isMyMade: true,
  735. // 配穴相关
  736. acupointList: [],
  737. meridianList: [],
  738. earAcupointList: [],
  739. detailTables: {
  740. 穴位: [createEmptyRow(1)],
  741. 经络: [],
  742. 耳穴: [],
  743. 部位: [],
  744. 其他详情: [],
  745. 无详情: [],
  746. },
  747. innerIsEditable: this.isEditable,
  748. innerDetailTypes: ["穴位"],
  749. detailRequired: false,
  750. // 统计相关
  751. currentUnitPrice: 0,
  752. operationGuide: "",
  753. pointMatchGuide: "",
  754. command: "",
  755. singleCount: 0,
  756. treatCount: 1,
  757. frequency: undefined,
  758. frequencyUnit: undefined,
  759. singlePrice: "0.00",
  760. coursePrice: "0.00",
  761. totalPrice: "0.00",
  762. _manualSingleCount: false,
  763. // 处方 tab
  764. activeIndex: 0,
  765. prescriptionDataMap: {},
  766. // 新增处方弹窗
  767. showAddDialog: false,
  768. classifyOptions: [],
  769. itemOptions: [],
  770. itemLoading: false,
  771. addForm: {
  772. category: "",
  773. itemId: "",
  774. itemName: "",
  775. detailRequired: false,
  776. },
  777. addLoading: false,
  778. prescriptions: [],
  779. // 详情弹窗
  780. showDetailDialog: false,
  781. detailData: {},
  782. detailType: "",
  783. saveLoading: false,
  784. _isLoadingTab: false,
  785. merTypeMap: {
  786. 1: "十二经脉",
  787. 2: "奇经八脉",
  788. 3: "经外奇穴",
  789. 4: "阿是穴",
  790. },
  791. };
  792. },
  793. computed: {
  794. isLocked() {
  795. return this.useIsUpdateLock && this.innerIsEditable === "0";
  796. },
  797. activeDetailTypes() {
  798. const validTypes = ["穴位", "经络", "耳穴", "部位", "其他详情"];
  799. return validTypes.filter((t) => this.innerDetailTypes.includes(t));
  800. },
  801. currentPricingUnit() {
  802. const p = this.prescriptions[this.activeIndex];
  803. return p?.pricingUnit || "";
  804. },
  805. currentSingleNumber() {
  806. const p = this.prescriptions[this.activeIndex];
  807. return p?.singleNumber || "0";
  808. },
  809. // 当前处方的计数系数
  810. currentCountCoefficient() {
  811. const p = this.prescriptions[this.activeIndex];
  812. return Number(p?.countCoefficient) || 1;
  813. },
  814. currentDetailCumulativeTypes() {
  815. const p = this.prescriptions[this.activeIndex];
  816. const val = p?.detailCumulative || "";
  817. if (!val) return [];
  818. const CUMULATIVE_MAP = {
  819. "1": "穴位",
  820. "2": "部位",
  821. "3": "耳穴",
  822. "4": "经络",
  823. "5": "其他详情",
  824. };
  825. return String(val)
  826. .split(/[,、]/)
  827. .filter(Boolean)
  828. .map((v) => CUMULATIVE_MAP[v.trim()])
  829. .filter(Boolean);
  830. },
  831. saveable() {
  832. return this.prescriptions && this.prescriptions.length > 0;
  833. },
  834. },
  835. watch: {
  836. detailTables: {
  837. handler() {
  838. this.updatePrice();
  839. },
  840. deep: true,
  841. },
  842. },
  843. created() {
  844. this._prevDetailTypes = [...this.innerDetailTypes];
  845. this.getAcupointList();
  846. this.getMeridianList();
  847. this.getEarAcupointList();
  848. this.loadClassifyOptions();
  849. },
  850. methods: {
  851. async loadClassifyOptions() {
  852. try {
  853. const res = await fetch(`${window.BASE_URL}data/classify.json`);
  854. const data = await res.json();
  855. this.classifyOptions = data.classify || [];
  856. } catch (e) {
  857. console.error("加载分类数据失败", e);
  858. }
  859. },
  860. saveCurrentTabData() {
  861. if (!this.prescriptions.length) return;
  862. this.$set(this.prescriptionDataMap, this.activeIndex, {
  863. detailTables: JSON.parse(JSON.stringify(this.detailTables)),
  864. innerIsEditable: this.innerIsEditable,
  865. innerDetailTypes: [...this.innerDetailTypes],
  866. detailRequired: this.detailRequired,
  867. operationGuide: this.operationGuide,
  868. pointMatchGuide: this.pointMatchGuide,
  869. command: this.command,
  870. singleCount: this.singleCount,
  871. treatCount: this.treatCount,
  872. frequency: this.frequency,
  873. frequencyUnit: this.frequencyUnit,
  874. singlePrice: this.singlePrice,
  875. coursePrice: this.coursePrice,
  876. totalPrice: this.totalPrice,
  877. currentUnitPrice: this.currentUnitPrice,
  878. _manualSingleCount: this._manualSingleCount,
  879. });
  880. },
  881. cacheCurrentData() {
  882. this.saveCurrentTabData();
  883. this._cachedPrescriptions = JSON.parse(JSON.stringify(this.prescriptions));
  884. this._cachedPrescriptionDataMap = JSON.parse(JSON.stringify(this.prescriptionDataMap));
  885. },
  886. restoreCachedData() {
  887. if (!this._cachedPrescriptions) return false;
  888. this.prescriptions = this._cachedPrescriptions;
  889. this.prescriptionDataMap = this._cachedPrescriptionDataMap;
  890. this.activeIndex = 0;
  891. this.loadTabData(0);
  892. this._cachedPrescriptions = null;
  893. this._cachedPrescriptionDataMap = null;
  894. return true;
  895. },
  896. loadTabData(index) {
  897. this._isLoadingTab = true;
  898. const data = this.prescriptionDataMap[index];
  899. if (data) {
  900. this.detailTables = JSON.parse(JSON.stringify(data.detailTables));
  901. this.innerIsEditable = data.innerIsEditable;
  902. this.innerDetailTypes = [...data.innerDetailTypes];
  903. this._prevDetailTypes = [...data.innerDetailTypes];
  904. this.detailRequired = data.detailRequired;
  905. this.operationGuide = data.operationGuide;
  906. this.pointMatchGuide = data.pointMatchGuide || "";
  907. this.command = data.command || "";
  908. this.singleCount = data.singleCount;
  909. this.treatCount = data.treatCount;
  910. this.frequency = data.frequency;
  911. this.frequencyUnit = data.frequencyUnit;
  912. this.singlePrice = data.singlePrice;
  913. this.coursePrice = data.coursePrice;
  914. this.totalPrice = data.totalPrice;
  915. this.currentUnitPrice = data.currentUnitPrice || 0;
  916. this._manualSingleCount = data._manualSingleCount || false;
  917. } else {
  918. const def = createPrescriptionData();
  919. this.detailTables = def.detailTables;
  920. this.innerIsEditable = def.innerIsEditable;
  921. this.innerDetailTypes = def.innerDetailTypes;
  922. this._prevDetailTypes = [...def.innerDetailTypes];
  923. this.detailRequired = def.detailRequired;
  924. this.operationGuide = def.operationGuide;
  925. this.pointMatchGuide = def.pointMatchGuide;
  926. this.singleCount = def.singleCount;
  927. this.treatCount = def.treatCount;
  928. this.frequency = def.frequency;
  929. this.frequencyUnit = def.frequencyUnit;
  930. this.singlePrice = def.singlePrice;
  931. this.coursePrice = def.coursePrice;
  932. this.totalPrice = def.totalPrice;
  933. this.currentUnitPrice = def.currentUnitPrice || 0;
  934. this._manualSingleCount = def._manualSingleCount || false;
  935. }
  936. this.$nextTick(() => {
  937. this._isLoadingTab = false;
  938. if (this.currentSingleNumber !== "0") {
  939. this.updatePrice();
  940. }
  941. });
  942. },
  943. switchTab(index) {
  944. if (this.activeIndex === index) return;
  945. this.saveCurrentTabData();
  946. this.activeIndex = index;
  947. this.loadTabData(index);
  948. },
  949. async openAddDialog() {
  950. this.addForm = {
  951. category: "",
  952. itemId: "",
  953. itemName: "",
  954. detailRequired: false,
  955. };
  956. this.itemOptions = [];
  957. this.showAddDialog = true;
  958. await this.fetchItemOptions();
  959. },
  960. async fetchItemOptions(query) {
  961. this.itemLoading = true;
  962. try {
  963. const params = {
  964. pageNum: 1,
  965. pageSize: 999,
  966. };
  967. if (this.addForm.category) {
  968. params.classify = this.addForm.category;
  969. }
  970. if (query) {
  971. if (/^[A-Za-z]+$/.test(query)) {
  972. params.py = query;
  973. } else {
  974. params.itemName = query;
  975. }
  976. }
  977. const res = await getMappedNondrugItemList(params);
  978. if (res.ResultCode == 0) {
  979. const list = res?.Data?.Items || [];
  980. this.itemOptions = list.map((item) => ({
  981. id: item.pid,
  982. name: item.itemName,
  983. detailRequired: item.detailIsnull === "1",
  984. detailDefault: item.detailDefault || "",
  985. detailCumulative: item.detailCumulative || "",
  986. classify: item.classify || "",
  987. price: item.price || 0,
  988. pricingUnit: item.pricingUnit || "",
  989. singleNumber: item.singleNumber || "",
  990. countCoefficient: item.countCoefficient || 1,
  991. minTreatmentDuration: item.minTreatmentDuration || 0,
  992. }));
  993. }
  994. } catch (e) {
  995. console.error("获取项目列表失败", e);
  996. } finally {
  997. this.itemLoading = false;
  998. }
  999. },
  1000. onCategoryChange() {
  1001. this.addForm.itemId = "";
  1002. this.addForm.itemName = "";
  1003. this.fetchItemOptions();
  1004. },
  1005. onItemSelectVisibleChange(visible) {
  1006. if (visible) {
  1007. this.fetchItemOptions();
  1008. }
  1009. },
  1010. async searchItem(query) {
  1011. await this.fetchItemOptions(query);
  1012. },
  1013. onItemSelected(id) {
  1014. const item = this.itemOptions.find((i) => i.id === id);
  1015. if (item) {
  1016. this.addForm.itemName = item.name;
  1017. }
  1018. },
  1019. async confirmAdd() {
  1020. if (this.addLoading) return;
  1021. if (!this.addForm.itemId) {
  1022. this.$message.warning("请选择项目名称");
  1023. return;
  1024. }
  1025. //不允许重复添加
  1026. const isDuplicate = this.prescriptions.some(
  1027. (p) => p.itemId === this.addForm.itemId,
  1028. );
  1029. if (isDuplicate) {
  1030. this.$message.warning("该项目已添加,不能重复添加");
  1031. return;
  1032. }
  1033. this.addLoading = true;
  1034. let detailData = {};
  1035. try {
  1036. const res = await getNondrugItemDetail(this.addForm.itemId);
  1037. if (res.ResultCode == 0) {
  1038. detailData = res.Data || {};
  1039. }
  1040. } catch (e) {
  1041. console.error("获取项目详情失败", e);
  1042. }
  1043. const categoryLabel =
  1044. this.classifyOptions.find((c) => c.value === this.addForm.category)
  1045. ?.label || "";
  1046. const detailDefault = detailData.detailDefault || "";
  1047. const detailTypeValues = detailDefault
  1048. ? String(detailDefault).split(",")
  1049. : [];
  1050. const detailTypes = detailTypeValues
  1051. .map((v) => DETAIL_DEFAULT_MAP[v.trim()])
  1052. .filter(Boolean);
  1053. // 详情是否必填
  1054. const detailRequired = detailData.detailIsnull === "1";
  1055. // 单次数量
  1056. const singleNumber = detailData.singleNumber || "0";
  1057. const singleCount = singleNumber === "0" ? 1 : 0;
  1058. // 价格
  1059. const price = detailData.price || 0;
  1060. if (this.prescriptions.length > 0) {
  1061. this.saveCurrentTabData();
  1062. }
  1063. const selectedItem = this.itemOptions.find(
  1064. (i) => i.id === this.addForm.itemId,
  1065. );
  1066. const newIndex = this.prescriptions.length;
  1067. this.prescriptions.push({
  1068. category: this.addForm.category,
  1069. categoryLabel,
  1070. itemId: this.addForm.itemId,
  1071. itemName: this.addForm.itemName,
  1072. price,
  1073. pricingUnit: detailData.pricingUnit || "",
  1074. singleNumber,
  1075. countCoefficient: detailData.countCoefficient || 1,
  1076. minTreatmentDuration: detailData.minTreatmentDuration || 0,
  1077. detailCumulative: detailData.detailCumulative || "",
  1078. classify: selectedItem?.classify || "",
  1079. ygtid: detailData.appId || "",
  1080. departmentId: detailData.deptId || "",
  1081. stitutionsId: detailData.institutionCode || "",
  1082. stitutionsName: detailData.institutionName || "",
  1083. });
  1084. this.prescriptionDataMap[newIndex] = createPrescriptionData({
  1085. detailRequired,
  1086. detailTypes,
  1087. singleCount,
  1088. unitPrice: price,
  1089. });
  1090. this.activeIndex = newIndex;
  1091. this.loadTabData(newIndex);
  1092. this.showAddDialog = false;
  1093. this.addLoading = false;
  1094. this.$emit("prescriptions-change", this.prescriptions);
  1095. if (this.reportAddRecipe) this.$emit('add-recipe');
  1096. },
  1097. removePrescription(index) {
  1098. this.$confirm("确认删除该处方?", "提示", {
  1099. confirmButtonText: "确定",
  1100. cancelButtonText: "取消",
  1101. type: "warning",
  1102. })
  1103. .then(() => {
  1104. this.prescriptions.splice(index, 1);
  1105. const oldMap = this.prescriptionDataMap;
  1106. this.prescriptionDataMap = {};
  1107. this.prescriptions.forEach((_, i) => {
  1108. if (i < index) {
  1109. this.prescriptionDataMap[i] = oldMap[i];
  1110. } else {
  1111. this.prescriptionDataMap[i] = oldMap[i + 1];
  1112. }
  1113. });
  1114. if (this.prescriptions.length === 0) {
  1115. this.activeIndex = 0;
  1116. this.detailTables = {
  1117. 穴位: [createEmptyRow(1)],
  1118. 经络: [],
  1119. 耳穴: [],
  1120. 部位: [],
  1121. 其他详情: [],
  1122. };
  1123. } else {
  1124. this.activeIndex = Math.min(index, this.prescriptions.length - 1);
  1125. this.loadTabData(this.activeIndex);
  1126. }
  1127. this.$emit("prescriptions-change", this.prescriptions);
  1128. })
  1129. .catch(() => {});
  1130. },
  1131. clearAll() {
  1132. if (!this.prescriptions.length) {
  1133. this.detailTables = {
  1134. 穴位: [createEmptyRow(1)],
  1135. 经络: [],
  1136. 耳穴: [],
  1137. 部位: [],
  1138. 其他详情: [],
  1139. };
  1140. this.operationGuide = "";
  1141. this.singleCount = 0;
  1142. this.treatCount = 1;
  1143. this.frequency = undefined;
  1144. this.frequencyUnit = undefined;
  1145. this.singlePrice = "0.00";
  1146. this.coursePrice = "0.00";
  1147. this.totalPrice = "0.00";
  1148. this.currentUnitPrice = 0;
  1149. this.innerIsEditable = "1";
  1150. this.innerDetailTypes = ["穴位"];
  1151. this._prevDetailTypes = ["穴位"];
  1152. this.detailRequired = false;
  1153. this.emitStatistics();
  1154. return;
  1155. }
  1156. const p = this.prescriptions[this.activeIndex];
  1157. const unitPrice = p?.price || 0;
  1158. this.prescriptionDataMap[this.activeIndex] = createPrescriptionData({
  1159. detailRequired: false,
  1160. detailTypes: [],
  1161. singleCount: 0,
  1162. unitPrice,
  1163. });
  1164. this.loadTabData(this.activeIndex);
  1165. this.updatePrice();
  1166. this.$emit("prescriptions-change", this.prescriptions);
  1167. },
  1168. onEditableChange(val) {
  1169. this.$emit("update:isEditable", val);
  1170. },
  1171. onDetailTypesChange(val) {
  1172. const NO_DETAIL = "无详情";
  1173. const lastSelected =
  1174. val.length > this._prevDetailTypes?.length
  1175. ? val.find((v) => !this._prevDetailTypes.includes(v))
  1176. : null;
  1177. if (lastSelected === NO_DETAIL) {
  1178. val = [NO_DETAIL];
  1179. } else if (
  1180. lastSelected &&
  1181. lastSelected !== NO_DETAIL &&
  1182. val.includes(NO_DETAIL)
  1183. ) {
  1184. val = val.filter((v) => v !== NO_DETAIL);
  1185. }
  1186. this.innerDetailTypes = val;
  1187. this._prevDetailTypes = [...val];
  1188. val.forEach((type) => {
  1189. const table = this.detailTables[type];
  1190. const isEmpty = !table || table.length === 0;
  1191. if (type === "无详情") {
  1192. if (isEmpty) {
  1193. this.$set(this.detailTables, type, [{ description: "" }]);
  1194. }
  1195. } else {
  1196. if (isEmpty) {
  1197. this.$set(this.detailTables, type, [createEmptyRow(1)]);
  1198. }
  1199. }
  1200. });
  1201. this.$emit("update:detailTypes", val);
  1202. },
  1203. getDetailTable(type) {
  1204. if (!this.detailTables[type]) {
  1205. this.$set(this.detailTables, type, [createEmptyRow(1)]);
  1206. }
  1207. return this.detailTables[type];
  1208. },
  1209. getLeftList(type) {
  1210. return this.getDetailTable(type).filter((item) => item.id % 2 !== 0);
  1211. },
  1212. getRightList(type) {
  1213. return this.getDetailTable(type).filter((item) => item.id % 2 === 0);
  1214. },
  1215. async getAcupointList(keyword = "", serchtype = "") {
  1216. try {
  1217. const res = await getXueweiList({
  1218. pageid: 1,
  1219. pagesize: 999,
  1220. serchtype: serchtype,
  1221. keyword: keyword,
  1222. });
  1223. if (res.code === 0) {
  1224. this.acupointList = res.data.acupoints || [];
  1225. }
  1226. } catch (e) {
  1227. console.error("获取穴位列表失败", e);
  1228. }
  1229. },
  1230. async getMeridianList(keyword = "", serchtype = "") {
  1231. try {
  1232. const res = await collateralChannels({
  1233. mertype: "1",
  1234. pageid: 1,
  1235. pagesize: 999,
  1236. keyword: keyword,
  1237. serchtype: serchtype,
  1238. });
  1239. if (res.code == 0) {
  1240. this.meridianList = (res.data.meridians || []).map((item) => ({
  1241. acuid: item.merid,
  1242. acuname: item.mername,
  1243. }));
  1244. }
  1245. } catch (e) {
  1246. console.error("获取经络列表失败", e);
  1247. }
  1248. },
  1249. async getEarAcupointList(keyword = "", serchtype = "") {
  1250. try {
  1251. const params = { page: 1, limit: 999, serchtype };
  1252. if (keyword) params.keyWord = keyword;
  1253. const res = await getAcuMeridianList(params);
  1254. if (res.code == 0) {
  1255. const list = res.data?.records || [];
  1256. this.earAcupointList = (Array.isArray(list) ? list : []).map(
  1257. (item) => ({
  1258. acuid: item.id,
  1259. acuname: item.name,
  1260. }),
  1261. );
  1262. }
  1263. } catch (e) {
  1264. console.error("获取耳穴列表失败", e);
  1265. }
  1266. },
  1267. getSearchOptions(type) {
  1268. switch (type) {
  1269. case "经络":
  1270. return this.meridianList;
  1271. case "耳穴":
  1272. return this.earAcupointList;
  1273. default:
  1274. return this.acupointList;
  1275. }
  1276. },
  1277. getFilterMethod(type) {
  1278. return (query) => {
  1279. this.searchByType(query, type);
  1280. };
  1281. },
  1282. searchByType(query, type) {
  1283. const pinyin = /^[A-Za-z]+$/g;
  1284. const serchtype = pinyin.test(query) ? "1" : "";
  1285. switch (type) {
  1286. case "经络":
  1287. this.getMeridianList(query, serchtype);
  1288. break;
  1289. case "耳穴":
  1290. this.getEarAcupointList(query, serchtype);
  1291. break;
  1292. default:
  1293. this.getAcupointList(query, serchtype);
  1294. }
  1295. },
  1296. onItemChange(acuid, scope, detailType) {
  1297. const row = scope.row;
  1298. // 在任何修改之前记录该行是否已有值(区分修改和新增)
  1299. const hadPreviousValue = !!row.acuid;
  1300. const table = this.getDetailTable(detailType);
  1301. const exists = table.find(
  1302. (item) => item.acuid === acuid && item.id !== row.id,
  1303. );
  1304. if (exists) {
  1305. this.$message.error("不可重复选择");
  1306. // 不重置行数据,保留原有值,让 :value 绑定自动回显
  1307. return;
  1308. }
  1309. const optionsList = this.getSearchOptions(detailType);
  1310. const selected = optionsList.find((item) => item.acuid === acuid);
  1311. if (selected) {
  1312. row.acuid = selected.acuid;
  1313. row.acuname = selected.acuname;
  1314. row.name = selected.acuname;
  1315. if (
  1316. detailType === "穴位" &&
  1317. selected.num != null &&
  1318. selected.num !== ""
  1319. ) {
  1320. row.count = Number(selected.num) || 1;
  1321. }
  1322. }
  1323. // 只有新增(原来没有值)才添加新行,修改不添加
  1324. if (!hadPreviousValue) {
  1325. this.addDetailRow(scope, detailType);
  1326. }
  1327. },
  1328. onDetailInput(scope, detailType) {
  1329. if (scope.row.name) {
  1330. this.addDetailRow(scope, detailType);
  1331. }
  1332. },
  1333. addDetailRow(scope, detailType) {
  1334. const table = this.getDetailTable(detailType);
  1335. if (scope) {
  1336. const index = scope.row.id - 1;
  1337. if (index === table.length - 1) {
  1338. table.push(createEmptyRow(1));
  1339. } else {
  1340. const rest = table.splice(scope.row.id);
  1341. table.push(createEmptyRow(1));
  1342. this.$set(this.detailTables, detailType, table.concat(rest));
  1343. }
  1344. } else {
  1345. table.push(createEmptyRow(1));
  1346. }
  1347. this.reIndexDetail(detailType);
  1348. this.searchByType("", detailType);
  1349. },
  1350. isDeleteDisabled(row, detailType) {
  1351. if (this.isLocked) {
  1352. if (detailType === '穴位') {
  1353. return row.mainType === '1'; // 主穴不可删除
  1354. }
  1355. return true;
  1356. }
  1357. return false;
  1358. },
  1359. deleteDetailRow(scope, detailType) {
  1360. if (this.isDeleteDisabled(scope.row, detailType)) return;
  1361. const table = this.getDetailTable(detailType);
  1362. const index = scope.row.id - 1;
  1363. if (table.length === 1) {
  1364. // 仅剩一行时清空内容(保留空行占位),否则点击删除无反应
  1365. this.$set(table, 0, createEmptyRow(1));
  1366. return;
  1367. }
  1368. table.splice(index, 1);
  1369. this.reIndexDetail(detailType);
  1370. },
  1371. async find(scope, detailType) {
  1372. const row = scope.row;
  1373. if (!row.acuid) return;
  1374. try {
  1375. let res;
  1376. if (detailType === "经络") {
  1377. res = await getMerD({ merid: row.acuid });
  1378. } else if (detailType === "耳穴") {
  1379. res = await getAcuMeridianDetail(row.acuid);
  1380. } else {
  1381. res = await getAcupointD({ acuid: row.acuid });
  1382. }
  1383. if (res.code === 0 || res.ResultCode === 0) {
  1384. this.detailData = res.data || res.Data || {};
  1385. this.detailType = detailType;
  1386. this.showDetailDialog = true;
  1387. }
  1388. } catch (e) {
  1389. console.error("获取详情失败", e);
  1390. }
  1391. },
  1392. copyDetailRow(scope, detailType) {
  1393. const table = this.getDetailTable(detailType);
  1394. const copy = { ...scope.row, id: 1 };
  1395. const index = scope.row.id;
  1396. table.splice(index, 0, copy);
  1397. this.reIndexDetail(detailType);
  1398. },
  1399. reIndexDetail(detailType) {
  1400. const table = this.getDetailTable(detailType);
  1401. table.forEach((item, index) => {
  1402. item.id = index + 1;
  1403. });
  1404. },
  1405. onSingleCountChange(val) {
  1406. if (val !== undefined && val !== null) {
  1407. this._manualSingleCount = true;
  1408. }
  1409. this.updatePrice();
  1410. },
  1411. updatePrice() {
  1412. if (this.currentSingleNumber !== "0" && !this._isLoadingTab && !this._manualSingleCount) {
  1413. this.singleCount = this.calcTotalCount();
  1414. }
  1415. const price = this.currentUnitPrice || this.unitPrice || 0;
  1416. this.singlePrice = (this.singleCount * price).toFixed(2);
  1417. this.coursePrice = (
  1418. this.treatCount * parseFloat(this.singlePrice)
  1419. ).toFixed(2);
  1420. this.saveCurrentTabData();
  1421. let total = 0;
  1422. Object.values(this.prescriptionDataMap).forEach((d) => {
  1423. total += parseFloat(d.coursePrice) || 0;
  1424. });
  1425. this.totalPrice = total.toFixed(2);
  1426. this.emitStatistics();
  1427. },
  1428. calcTotalCount() {
  1429. let total = 0;
  1430. const types = this.activeDetailTypes;
  1431. types.forEach((type) => {
  1432. const table = this.detailTables[type];
  1433. if (table) {
  1434. table.forEach((row) => {
  1435. if (row.acuid || row.name) {
  1436. total += row.count || 0;
  1437. }
  1438. });
  1439. }
  1440. });
  1441. const coefficient = this.currentCountCoefficient;
  1442. const result = coefficient > 0 ? total / coefficient : total;
  1443. return Math.ceil(result);
  1444. },
  1445. emitStatistics() {
  1446. this.$emit("update:statistics", {
  1447. operationGuide: this.operationGuide,
  1448. command: this.command,
  1449. singleCount: this.singleCount,
  1450. treatCount: this.treatCount,
  1451. frequency: this.frequency,
  1452. frequencyUnit: this.frequencyUnit,
  1453. singlePrice: this.singlePrice,
  1454. coursePrice: this.coursePrice,
  1455. totalPrice: this.totalPrice,
  1456. });
  1457. },
  1458. validate() {
  1459. if (!this.prescriptions.length) {
  1460. this.$message.warning("请先新增处方");
  1461. return false;
  1462. }
  1463. if (this.detailRequired && this.innerDetailTypes.length === 0) {
  1464. this.$message.warning("请至少勾选一个详情类型");
  1465. return false;
  1466. }
  1467. if (!this.operationGuide.trim()) {
  1468. this.$message.warning("请输入操作指南");
  1469. return false;
  1470. }
  1471. if (!this.singleCount || this.singleCount <= 0) {
  1472. this.$message.warning("请输入单次数量");
  1473. return false;
  1474. }
  1475. if (this.requiredTreatFields) {
  1476. if (!this.treatCount || this.treatCount <= 0) {
  1477. this.$message.warning("请输入治疗次数");
  1478. return false;
  1479. }
  1480. if (!this.frequency || this.frequency <= 0) {
  1481. this.$message.warning("请输入频次");
  1482. return false;
  1483. }
  1484. if (!this.frequencyUnit || this.frequencyUnit <= 0) {
  1485. this.$message.warning("请输入频次次数");
  1486. return false;
  1487. }
  1488. }
  1489. return true;
  1490. },
  1491. handleSave() {
  1492. if (!this.validate()) return;
  1493. this.saveLoading = true;
  1494. const treatmentList = this.buildTreatmentList();
  1495. const firstP = this.prescriptions[0] || {};
  1496. const institutionInfo = {
  1497. ygtid: firstP.ygtid || "",
  1498. departmentId: firstP.departmentId || "",
  1499. stitutionsId: firstP.stitutionsId || "",
  1500. stitutionsName: firstP.stitutionsName || "",
  1501. };
  1502. this.$emit("save", treatmentList, institutionInfo);
  1503. },
  1504. saveDone() {
  1505. this.saveLoading = false;
  1506. },
  1507. buildTreatmentList() {
  1508. this.saveCurrentTabData();
  1509. const DETAIL_TYPE_MAP = {
  1510. 穴位: "1",
  1511. 经络: "2",
  1512. 耳穴: "3",
  1513. 部位: "4",
  1514. 其他详情: "5",
  1515. };
  1516. const TYPE_TO_FIELD = {
  1517. 穴位: "detailPoint",
  1518. 经络: "detailMeridian",
  1519. 耳穴: "detailEarPoint",
  1520. 部位: "detailBodyPart",
  1521. 其他详情: "detailOther",
  1522. };
  1523. return this.prescriptions.map((p, index) => {
  1524. const d = this.prescriptionDataMap[index] || createPrescriptionData();
  1525. const detailPoint = [];
  1526. const detailMeridian = [];
  1527. const detailEarPoint = [];
  1528. const detailBodyPart = [];
  1529. const detailOther = [];
  1530. const detailNone = [];
  1531. const detailArrays = {
  1532. 穴位: detailPoint,
  1533. 经络: detailMeridian,
  1534. 耳穴: detailEarPoint,
  1535. 部位: detailBodyPart,
  1536. 其他详情: detailOther,
  1537. };
  1538. Object.keys(detailArrays).forEach((type) => {
  1539. // 未勾选的详情类型不提交
  1540. if (!d.innerDetailTypes.includes(type)) return;
  1541. const table = d.detailTables[type] || [];
  1542. table.forEach((row) => {
  1543. if (row.acuid || row.name) {
  1544. detailArrays[type].push({
  1545. acupoint: type === "穴位" ? row.mainType || "0" : "0",
  1546. name: row.acuname || row.name || "",
  1547. num: row.count || 1,
  1548. pointCode: "",
  1549. pointId: row.acuid || "",
  1550. remark: row.remark || "",
  1551. seqn: String(row.id || ""),
  1552. type: DETAIL_TYPE_MAP[type] || "1",
  1553. });
  1554. }
  1555. });
  1556. });
  1557. return {
  1558. treatItemId: p.itemId,
  1559. treatItemName: p.itemName,
  1560. treatClass: p.classify || "",
  1561. isUpdate: d.innerIsEditable || "1",
  1562. singleQty: d.singleCount || 0,
  1563. singleAmount: parseFloat(d.singlePrice) || 0,
  1564. treatNum: d.treatCount || 0,
  1565. courseAmount: parseFloat(d.coursePrice) || 0,
  1566. frequency:
  1567. d.frequency && d.frequencyUnit
  1568. ? `${d.frequency}天${d.frequencyUnit}次`
  1569. : "",
  1570. useExplain: d.operationGuide || "",
  1571. command: d.command || "",
  1572. pointMatchGuide: d.pointMatchGuide || "",
  1573. seqn: index + 1,
  1574. ownerType: this.ownerType || "1",
  1575. detailPoint,
  1576. detailMeridian,
  1577. detailEarPoint,
  1578. detailBodyPart,
  1579. detailOther,
  1580. detailNone: d.innerDetailTypes.includes("无详情")
  1581. ? { description: "" }
  1582. : null,
  1583. };
  1584. });
  1585. },
  1586. loadFromServerData(treatmentList) {
  1587. if (!Array.isArray(treatmentList) || !treatmentList.length) return;
  1588. const TYPE_VALUE_MAP = {
  1589. "1": "穴位",
  1590. "2": "经络",
  1591. "3": "耳穴",
  1592. "4": "部位",
  1593. "5": "其他详情",
  1594. "6": "无详情",
  1595. };
  1596. this.prescriptions = [];
  1597. this.prescriptionDataMap = {};
  1598. treatmentList.forEach((item, index) => {
  1599. const unitPrice = Number(item.basisStitutionsnondrug.price) || 0;
  1600. const pricingUnit = item.basisStitutionsnondrug?.pricingUnit || "";
  1601. this.prescriptions.push({
  1602. category: "",
  1603. categoryLabel: "",
  1604. itemId: item.treatItemId || "",
  1605. itemName: item.treatItemName || "",
  1606. price: unitPrice,
  1607. pricingUnit: pricingUnit,
  1608. singleNumber: item.basisStitutionsnondrug?.singleNumber || "0",
  1609. countCoefficient: item.basisStitutionsnondrug?.countCoefficient || 1,
  1610. minTreatmentDuration:
  1611. item.basisStitutionsnondrug?.minTreatmentDuration || 0,
  1612. detailCumulative: item.basisStitutionsnondrug?.detailCumulative || "",
  1613. });
  1614. const allDetails = [].concat(
  1615. item.detailPoint || [],
  1616. item.detailMeridian || [],
  1617. item.detailEarPoint || [],
  1618. item.detailBodyPart || [],
  1619. item.detailOther || [],
  1620. );
  1621. const detailTables = {
  1622. 穴位: [],
  1623. 经络: [],
  1624. 耳穴: [],
  1625. 部位: [],
  1626. 其他详情: [],
  1627. 无详情: [],
  1628. };
  1629. const activeTypes = new Set();
  1630. if (
  1631. item.detailNone !== null &&
  1632. item.detailNone !== undefined &&
  1633. typeof item.detailNone === "object" &&
  1634. !Array.isArray(item.detailNone)
  1635. ) {
  1636. activeTypes.add("无详情");
  1637. }
  1638. allDetails.forEach((d) => {
  1639. const typeName = TYPE_VALUE_MAP[d.type] || "";
  1640. if (typeName && detailTables[typeName]) {
  1641. activeTypes.add(typeName);
  1642. detailTables[typeName].push({
  1643. id: detailTables[typeName].length + 1,
  1644. acuid: d.pointId || "",
  1645. acuname: d.name || "",
  1646. name: d.name || "",
  1647. count: d.num || 1,
  1648. remark: d.remark || "",
  1649. mainType: d.acupoint || "1",
  1650. });
  1651. }
  1652. });
  1653. ["穴位", "经络", "耳穴", "部位", "其他详情"].forEach((type) => {
  1654. if (detailTables[type].length === 0) {
  1655. detailTables[type] = [createEmptyRow(1)];
  1656. }
  1657. });
  1658. if (!detailTables["无详情"]) {
  1659. detailTables["无详情"] = [];
  1660. }
  1661. let parsedFreqDays = undefined;
  1662. let parsedFreqTimes = undefined;
  1663. if (item.frequency) {
  1664. const match = String(item.frequency).match(/(\d+)天(\d+)次/);
  1665. if (match) {
  1666. parsedFreqDays = parseInt(match[1], 10);
  1667. parsedFreqTimes = parseInt(match[2], 10);
  1668. }
  1669. }
  1670. const singleNumber = item.basisStitutionsnondrug?.singleNumber || "0";
  1671. this.prescriptionDataMap[index] = {
  1672. detailTables,
  1673. innerIsEditable: item.isUpdate || "1",
  1674. innerDetailTypes: activeTypes.size > 0 ? [...activeTypes] : ["穴位"],
  1675. detailRequired: item.basisStitutionsnondrug?.detailIsnull === "1",
  1676. operationGuide: item.useExplain || "",
  1677. command: item.command || "",
  1678. pointMatchGuide: item.pointMatchGuide || "",
  1679. singleCount: item.singleQty || 0,
  1680. treatCount: item.treatNum || 1,
  1681. frequency: parsedFreqDays,
  1682. frequencyUnit: parsedFreqTimes,
  1683. singlePrice: String(item.singleAmount || "0.00"),
  1684. coursePrice: (
  1685. (item.treatNum || 1) * (item.singleAmount || 0)
  1686. ).toFixed(2),
  1687. totalPrice: "0.00",
  1688. currentUnitPrice: unitPrice,
  1689. _manualSingleCount: singleNumber !== "0",
  1690. };
  1691. });
  1692. this.activeIndex = 0;
  1693. this.loadTabData(0);
  1694. let total = 0;
  1695. Object.values(this.prescriptionDataMap).forEach((d) => {
  1696. total += parseFloat(d.coursePrice) || 0;
  1697. });
  1698. this.totalPrice = total.toFixed(2);
  1699. this.$emit("prescriptions-change", this.prescriptions);
  1700. },
  1701. getData() {
  1702. if (!this.validate()) return null;
  1703. this.saveCurrentTabData();
  1704. return {
  1705. prescriptions: this.prescriptions.map((p, i) => {
  1706. const d = this.prescriptionDataMap[i] || createPrescriptionData();
  1707. return {
  1708. ...p,
  1709. isEditable: d.innerIsEditable,
  1710. detailTypes: d.innerDetailTypes,
  1711. detailRequired: d.detailRequired,
  1712. detailTables: d.detailTables,
  1713. acupoints: (d.detailTables["穴位"] || []).filter(
  1714. (item) => item.acuid,
  1715. ),
  1716. statistics: {
  1717. operationGuide: d.operationGuide,
  1718. singleCount: d.singleCount,
  1719. treatCount: d.treatCount,
  1720. frequency: d.frequency,
  1721. frequencyUnit: d.frequencyUnit,
  1722. singlePrice: d.singlePrice,
  1723. coursePrice: d.coursePrice,
  1724. totalPrice: d.totalPrice,
  1725. },
  1726. };
  1727. }),
  1728. };
  1729. },
  1730. },
  1731. };
  1732. </script>
  1733. <style lang="scss" scoped>
  1734. .recipe-acupoint-wrapper {
  1735. display: flex;
  1736. flex-direction: column;
  1737. height: 100%;
  1738. .prescription-header {
  1739. display: flex;
  1740. align-items: center;
  1741. justify-content: space-between;
  1742. border-bottom: 2px solid #dedede;
  1743. padding: 0px 0;
  1744. flex-shrink: 0;
  1745. .table-label {
  1746. display: flex;
  1747. align-items: center;
  1748. .label-item {
  1749. cursor: pointer;
  1750. min-width: 104px;
  1751. max-width: 220px;
  1752. border-right: 2px solid #eaeaea;
  1753. display: flex;
  1754. align-items: center;
  1755. padding: 0 8px;
  1756. span {
  1757. font-size: 14px;
  1758. font-family: PingFang SC;
  1759. font-weight: 400;
  1760. color: #666666;
  1761. margin-left: 8px;
  1762. overflow: hidden;
  1763. text-overflow: ellipsis;
  1764. white-space: nowrap;
  1765. }
  1766. div {
  1767. color: #666;
  1768. font-size: 16px;
  1769. margin-left: 8px;
  1770. margin-top: 1px;
  1771. font-weight: 600;
  1772. flex-shrink: 0;
  1773. }
  1774. .l_active {
  1775. color: #5386f6;
  1776. }
  1777. }
  1778. }
  1779. }
  1780. .top-btns {
  1781. display: flex;
  1782. flex-shrink: 0;
  1783. margin-left: auto;
  1784. }
  1785. .table-b-bottom {
  1786. flex-shrink: 0;
  1787. padding: 10px;
  1788. border-top: 2px solid #dedede;
  1789. background: #fff;
  1790. .t-b-l-item {
  1791. font-size: 14px;
  1792. color: #333;
  1793. margin-right: 20px;
  1794. span {
  1795. color: #ff6245;
  1796. }
  1797. }
  1798. }
  1799. }
  1800. .recipe-acupoint {
  1801. border: 2px solid #dedede;
  1802. padding: 7px 0 0;
  1803. display: flex;
  1804. flex-direction: column;
  1805. flex: 1;
  1806. min-height: 0;
  1807. .table-toolbar {
  1808. margin-bottom: 10px;
  1809. padding: 0 5px;
  1810. flex-shrink: 0;
  1811. .toolbar-item {
  1812. margin-right: 30px;
  1813. margin-bottom: 5px;
  1814. span {
  1815. font-size: 14px;
  1816. color: #333;
  1817. white-space: nowrap;
  1818. }
  1819. }
  1820. }
  1821. // 滚动容器
  1822. .table-container {
  1823. padding: 0 5px;
  1824. flex: 1;
  1825. min-height: 100px;
  1826. overflow: auto;
  1827. }
  1828. .no-data-tip {
  1829. flex: 1;
  1830. display: flex;
  1831. align-items: center;
  1832. justify-content: center;
  1833. color: #999;
  1834. font-size: 14px;
  1835. padding: 40px 0;
  1836. }
  1837. // 详情表格区域
  1838. .detail-table-section {
  1839. margin-bottom: 10px;
  1840. .detail-section-label {
  1841. display: inline-block;
  1842. padding: 2px 12px;
  1843. border: 1px solid #ff6245;
  1844. border-radius: 4px;
  1845. color: #ff6245;
  1846. font-size: 13px;
  1847. margin-bottom: 6px;
  1848. }
  1849. }
  1850. // 配穴表格
  1851. .table-show {
  1852. width: 100%;
  1853. overflow: auto;
  1854. display: flex;
  1855. align-items: flex-start;
  1856. justify-content: space-between;
  1857. .table-left {
  1858. flex: 0 0 49.9%;
  1859. overflow-y: auto;
  1860. border: 1px solid #dedede;
  1861. box-sizing: border-box;
  1862. }
  1863. }
  1864. // 底部统计
  1865. .table-bottom {
  1866. flex-shrink: 0;
  1867. padding: 0 5px;
  1868. margin-top: 5px;
  1869. .table-b-header {
  1870. .header-about {
  1871. .item {
  1872. margin-right: 20px;
  1873. margin-bottom: 10px;
  1874. span {
  1875. font-size: 14px;
  1876. color: #333;
  1877. white-space: nowrap;
  1878. }
  1879. }
  1880. }
  1881. }
  1882. }
  1883. .stat-row {
  1884. .stat-field {
  1885. margin-right: 50px;
  1886. margin-bottom: 5px;
  1887. span {
  1888. font-size: 14px;
  1889. color: #333;
  1890. white-space: nowrap;
  1891. }
  1892. .stat-unit {
  1893. margin: 0 4px;
  1894. }
  1895. }
  1896. }
  1897. .operate {
  1898. width: 100%;
  1899. height: 100%;
  1900. display: flex;
  1901. align-items: center;
  1902. justify-content: space-around;
  1903. img {
  1904. width: 16px;
  1905. cursor: pointer;
  1906. }
  1907. .operate-disabled {
  1908. opacity: 0.4;
  1909. cursor: not-allowed;
  1910. }
  1911. }
  1912. }
  1913. .recipe-acupoint ::v-deep .el-table .cell {
  1914. text-align: center;
  1915. }
  1916. .recipe-acupoint ::v-deep .el-select {
  1917. width: 100%;
  1918. }
  1919. .recipe-acupoint ::v-deep .el-table td {
  1920. padding: 2px 0;
  1921. }
  1922. .recipe-acupoint ::v-deep .el-table th {
  1923. padding: 2px 0;
  1924. }
  1925. .recipe-acupoint .table-show .table-left::v-deep .el-table__empty-block {
  1926. min-height: 33px !important;
  1927. height: 33px !important;
  1928. }
  1929. .drug-body {
  1930. padding: 10px;
  1931. .drug-item {
  1932. display: flex;
  1933. align-items: flex-start;
  1934. margin-bottom: 12px;
  1935. > span {
  1936. min-width: 80px;
  1937. font-size: 14px;
  1938. color: #333;
  1939. text-align: right;
  1940. margin-right: 10px;
  1941. flex-shrink: 0;
  1942. }
  1943. > div {
  1944. flex: 1;
  1945. font-size: 14px;
  1946. color: #666;
  1947. word-break: break-all;
  1948. line-height: 1.6;
  1949. }
  1950. .detail-img {
  1951. img {
  1952. max-width: 100%;
  1953. max-height: 300px;
  1954. }
  1955. }
  1956. }
  1957. }
  1958. </style>
  1959. <style lang="scss">
  1960. .add-prescription-dialog {
  1961. margin: 0 auto;
  1962. .el-dialog__header {
  1963. padding: 0;
  1964. }
  1965. .el-dialog__body {
  1966. padding: 18px;
  1967. }
  1968. .add-dialog-header {
  1969. display: flex;
  1970. align-items: center;
  1971. justify-content: center;
  1972. height: 34px;
  1973. background: #5386f6;
  1974. position: relative;
  1975. span {
  1976. font-size: 16px;
  1977. font-family: PingFang SC;
  1978. font-weight: 400;
  1979. color: #fff;
  1980. }
  1981. .close-btn {
  1982. transform: rotate(45deg);
  1983. color: #fff;
  1984. position: absolute;
  1985. top: -13px;
  1986. right: 20px;
  1987. font-size: 44px;
  1988. cursor: pointer;
  1989. }
  1990. }
  1991. .add-dialog-body {
  1992. min-height: 350px;
  1993. .add-form-row {
  1994. display: flex;
  1995. align-items: center;
  1996. margin-bottom: 16px;
  1997. .label {
  1998. font-size: 14px;
  1999. color: #333;
  2000. white-space: nowrap;
  2001. min-width: 100px;
  2002. text-align: right;
  2003. }
  2004. }
  2005. }
  2006. .add-dialog-btns {
  2007. display: flex;
  2008. justify-content: center;
  2009. margin-top: 20px;
  2010. .confirm-btn {
  2011. width: 108px;
  2012. height: 40px;
  2013. line-height: 40px;
  2014. text-align: center;
  2015. background: #5386f6;
  2016. color: #fff;
  2017. border-radius: 3px;
  2018. font-size: 18px;
  2019. cursor: pointer;
  2020. &.is-disabled {
  2021. opacity: 0.6;
  2022. cursor: not-allowed;
  2023. }
  2024. }
  2025. }
  2026. }
  2027. .detail-dialog {
  2028. margin: 0 auto;
  2029. .el-dialog__header {
  2030. padding: 0;
  2031. background: #5386f6;
  2032. text-align: center;
  2033. height: 40px;
  2034. line-height: 40px;
  2035. }
  2036. .el-dialog__title {
  2037. font-size: 16px;
  2038. color: #fff;
  2039. }
  2040. .el-dialog__headerbtn {
  2041. top: 8px;
  2042. right: 10px;
  2043. font-size: 22px;
  2044. .el-dialog__close {
  2045. color: #fff;
  2046. font-size: 22px;
  2047. }
  2048. }
  2049. .el-dialog__body {
  2050. padding: 18px;
  2051. max-height: 75vh;
  2052. overflow-y: auto;
  2053. }
  2054. .drug-body {
  2055. padding: 10px;
  2056. .drug-item {
  2057. display: flex;
  2058. align-items: flex-start;
  2059. margin-bottom: 12px;
  2060. > span {
  2061. min-width: 80px;
  2062. font-size: 14px;
  2063. color: #333;
  2064. text-align: right;
  2065. margin-right: 10px;
  2066. flex-shrink: 0;
  2067. }
  2068. > div {
  2069. flex: 1;
  2070. font-size: 14px;
  2071. color: #666;
  2072. word-break: break-all;
  2073. line-height: 1.6;
  2074. }
  2075. .detail-img {
  2076. img {
  2077. max-width: 100%;
  2078. max-height: 300px;
  2079. }
  2080. }
  2081. }
  2082. }
  2083. }
  2084. </style>