index.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="queryParams"
  5. ref="queryForm"
  6. :inline="true"
  7. v-show="showSearch"
  8. label-width="68px"
  9. >
  10. <div class="query-box">
  11. <div class="query-box__left">
  12. <el-form-item label="" prop="yljgId">
  13. <el-select
  14. v-model="queryParams.yljgId"
  15. placeholder="请选择医疗机构"
  16. style="width: 150px"
  17. >
  18. <el-option
  19. v-for="item in listMedicalMechanismArr"
  20. :key="item.id"
  21. :value="item.id"
  22. :label="item.name"
  23. :disabled="item.state == 1 ? false : true"
  24. ></el-option>
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item label="" prop="premzzy">
  28. <el-select
  29. v-model="queryParams.premzzy"
  30. placeholder="请选择门诊/住院"
  31. style="width: 150px"
  32. >
  33. <el-option
  34. v-for="item in premzzyArr"
  35. :key="item.id"
  36. :value="item.id"
  37. :label="item.name"
  38. ></el-option>
  39. </el-select>
  40. </el-form-item>
  41. <el-form-item label="" prop="orderNo">
  42. <el-input
  43. v-model="queryParams.orderNo"
  44. placeholder="请输入订单号"
  45. clearable
  46. size="small"
  47. @keyup.enter.native="handleQuery"
  48. style="width: 150px"
  49. />
  50. </el-form-item>
  51. <el-form-item label="" prop="preNo">
  52. <el-input
  53. v-model="queryParams.preNo"
  54. placeholder="请输入处方号"
  55. clearable
  56. size="small"
  57. @keyup.enter.native="handleQuery"
  58. style="width: 150px"
  59. />
  60. </el-form-item>
  61. <el-form-item label="" prop="name">
  62. <el-input
  63. v-model="queryParams.name"
  64. placeholder="请输入患者姓名"
  65. clearable
  66. size="small"
  67. @keyup.enter.native="handleQuery"
  68. style="width: 150px"
  69. />
  70. </el-form-item>
  71. <el-form-item label="" prop="prescriptionTime">
  72. <el-date-picker
  73. clearable
  74. size="small"
  75. v-model="queryParams.prescriptionTime"
  76. type="date"
  77. value-format="yyyy-MM-dd"
  78. placeholder="选择处方时间"
  79. style="width: 150px"
  80. >
  81. </el-date-picker>
  82. </el-form-item>
  83. <el-form-item label="" prop="takingMethod">
  84. <el-select
  85. style="width: 150px"
  86. v-model="queryParams.takingMethod"
  87. placeholder="请选择配送状态"
  88. >
  89. <el-option
  90. v-for="item in takingMethodArr"
  91. :key="item.id"
  92. :value="item.id"
  93. :label="item.name"
  94. ></el-option>
  95. </el-select>
  96. </el-form-item>
  97. <el-form-item>
  98. <el-button
  99. type="primary"
  100. icon="el-icon-search"
  101. size="mini"
  102. @click="handleQuery"
  103. >搜索</el-button
  104. >
  105. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  106. >重置</el-button
  107. >
  108. <el-button
  109. type="warning"
  110. plain
  111. icon="el-icon-download"
  112. size="mini"
  113. :loading="exportLoading"
  114. @click="handleExport"
  115. v-hasPermi="['prescription:prescriptionCore:export']"
  116. >导出</el-button
  117. >
  118. </el-form-item>
  119. </div>
  120. <!-- <div class="query-box__right">
  121. <el-form-item>
  122. <el-button
  123. type="primary"
  124. icon="el-icon-search"
  125. size="mini"
  126. @click="handleQuery"
  127. >搜索</el-button
  128. >
  129. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  130. >重置</el-button
  131. >
  132. </el-form-item>
  133. </div> -->
  134. </div>
  135. </el-form>
  136. <!-- <el-row :gutter="10" class="mb8">
  137. <el-col :span="1.5">
  138. <el-button
  139. type="primary"
  140. plain
  141. icon="el-icon-plus"
  142. size="mini"
  143. @click="handleAdd"
  144. v-hasPermi="['prescription:prescriptionCore:add']"
  145. >新增</el-button
  146. >
  147. </el-col>
  148. <el-col :span="1.5">
  149. <el-button
  150. type="success"
  151. plain
  152. icon="el-icon-edit"
  153. size="mini"
  154. :disabled="single"
  155. @click="handleUpdate"
  156. v-hasPermi="['prescription:prescriptionCore:edit']"
  157. >修改</el-button
  158. >
  159. </el-col>
  160. <el-col :span="1.5">
  161. <el-button
  162. type="danger"
  163. plain
  164. icon="el-icon-delete"
  165. size="mini"
  166. :disabled="multiple"
  167. @click="handleDelete"
  168. v-hasPermi="['prescription:prescriptionCore:remove']"
  169. >删除</el-button
  170. >
  171. </el-col>
  172. <el-col :span="1.5">
  173. <el-button
  174. type="warning"
  175. plain
  176. icon="el-icon-download"
  177. size="mini"
  178. :loading="exportLoading"
  179. @click="handleExport"
  180. v-hasPermi="['prescription:prescriptionCore:export']"
  181. >导出</el-button
  182. >
  183. </el-col>
  184. <right-toolbar
  185. :showSearch.sync="showSearch"
  186. @queryTable="getList"
  187. ></right-toolbar>
  188. </el-row> -->
  189. <el-table
  190. v-loading="loading"
  191. :data="prescriptionCoreList"
  192. @selection-change="handleSelectionChange"
  193. border
  194. size="mini"
  195. >
  196. <el-table-column type="index" width="55" align="center" label="序号" />
  197. <el-table-column label="订单号" show-overflow-tooltip align="center" prop="orderNo" />
  198. <el-table-column label="处方号" show-overflow-tooltip align="center" prop="preNo" />
  199. <el-table-column label="医疗机构" show-overflow-tooltip align="center" prop="yljgId" />
  200. <el-table-column label="科室" align="center" prop="department" />
  201. <el-table-column label="病区" align="center" prop="department" />
  202. <el-table-column label="患者姓名" align="center" prop="name" />
  203. <el-table-column label="开方医生" align="center" prop="doctor" />
  204. <el-table-column label="门诊/住院" align="center" prop="premzzy">
  205. <template slot-scope="scope">{{scope.row.preMzZy==1?'门诊':'住院'}}</template>
  206. </el-table-column>
  207. <el-table-column
  208. label="开方时间"
  209. align="center"
  210. prop="prescriptionTime"
  211. width="180"
  212. >
  213. <template slot-scope="scope">
  214. <span>{{
  215. parseTime(scope.row.prescriptionTime, "{y}-{m}-{d}")
  216. }}</span>
  217. </template>
  218. </el-table-column>
  219. <el-table-column label="处方状态" align="center" prop="state">
  220. <template slot-scope="scope">
  221. {{ scope.row.fyState == 0 ? "未发药": scope.row.fyState==1?'已发药' : "取消发药" }}
  222. </template>
  223. </el-table-column>
  224. <el-table-column label="处方类型" align="center" prop="type">
  225. <template slot-scope="scope">
  226. {{ scope.row.type == 1 ? "中药处方" : "中药制剂" }}
  227. </template>
  228. </el-table-column>
  229. <el-table-column label="处方名" align="center" prop="preName" />
  230. <el-table-column label="剂数" align="center" prop="oralPre">
  231. <template slot-scope="scope">
  232. {{ scope.row.oralPre && scope.row.oralPre.number }}
  233. </template>
  234. </el-table-column>
  235. <el-table-column label="煎药方式" align="center" prop="oralPre">
  236. <template slot-scope="scope">
  237. {{ scope.row.oralPre && scope.row.oralPre.decoctingMethod }}
  238. </template>
  239. </el-table-column>
  240. <el-table-column label="取药方式" align="center" prop="takingMethod">
  241. <!-- <template slot-scope="scope">
  242. {{ scope.row.takingMethod === 2 ? "配送" : "自提" }}
  243. </template> -->
  244. </el-table-column>
  245. <el-table-column label="快递单号" align="center" prop="expressCode" />
  246. <el-table-column label="打印次数" align="center" prop="remarks" />
  247. <el-table-column
  248. label="操作"
  249. align="center"
  250. fixed="right"
  251. class-name="small-padding fixed-width"
  252. width="200"
  253. >
  254. <template slot-scope="scope">
  255. <el-button
  256. size="mini"
  257. type="primary"
  258. style="width: 40px"
  259. @click="handleDetail(scope.row)"
  260. v-hasPermi="['rescription:Dispensing:list']"
  261. >详情</el-button
  262. >
  263. <el-button
  264. size="mini"
  265. type="primary"
  266. style="width: 40px"
  267. @click="handleUpdate(scope.row)"
  268. v-hasPermi="['rescription:Dispensing:list']"
  269. >录入</el-button
  270. >
  271. <el-button
  272. size="mini"
  273. type="primary"
  274. style="width: 40px"
  275. @click="consoleBtn(scope.row)"
  276. v-hasPermi="['rescription:Dispensing:list']"
  277. >打印</el-button
  278. >
  279. </template>
  280. </el-table-column>
  281. </el-table>
  282. <pagination
  283. v-show="total > 0"
  284. :total="total"
  285. :page.sync="queryParams.pageNum"
  286. :limit.sync="queryParams.pageSize"
  287. @pagination="getList"
  288. />
  289. <!-- 添加或修改处方审核对话框 -->
  290. <el-dialog
  291. :title="title"
  292. :visible.sync="open"
  293. width="1280px"
  294. append-to-body
  295. >
  296. <div>
  297. <div style="display: flex; align-items: center;margin-bottom:20px;">
  298. <h3>处方信息</h3>
  299. <div style="margin: 0 0 0 30px">订单号:{{detailData.orderNo}}</div>
  300. <div style="margin: 0 0 0 30px">处方号:{{detailData.preNo}}</div>
  301. </div>
  302. <div style="display: flex; align-items: center;">
  303. <h3>审核状态:</h3>
  304. <span style="color:#fff" :class="detailData.checkState==0?'yellow-btn':detailData.checkState==1?'green-btn':detailData.checkState==2?'red-btn':''">{{detailData.checkState == 0
  305. ? "待审核"
  306. : detailData.checkState == 1
  307. ? "审核通过"
  308. : detailData.checkState == 2
  309. ? "审核不通过"
  310. : ""}}</span>
  311. <h3 style="margin-left:50px">审核人:</h3>
  312. <span>{{detailData.checkBy}}</span>
  313. <h3 style="margin-left:50px">审核时间:</h3>
  314. <span>{{detailData.checkTime}}</span>
  315. </div>
  316. <el-divider></el-divider>
  317. <el-row :gutter="20">
  318. <el-col :span="24">
  319. <el-descriptions title="" :column="5">
  320. <el-descriptions-item label="患者姓名">{{
  321. detailData.name
  322. }}</el-descriptions-item>
  323. <el-descriptions-item label="性别">{{
  324. detailData.sex
  325. }}</el-descriptions-item>
  326. <el-descriptions-item label="年龄">{{
  327. detailData.age
  328. }}</el-descriptions-item>
  329. <el-descriptions-item label="科室">{{
  330. detailData.department
  331. }}</el-descriptions-item>
  332. <el-descriptions-item label="临床诊断">
  333. {{detailData.disName}}-{{detailData.symName}}
  334. </el-descriptions-item>
  335. <el-descriptions-item label="开方医生">{{
  336. detailData.doctor
  337. }}</el-descriptions-item>
  338. <el-descriptions-item label="处方类型">{{
  339. detailData.type == 1 ? "中药处方" : "中药制剂"
  340. }}</el-descriptions-item>
  341. <el-descriptions-item label="发药状态">{{ detailData.fyState == 0 ? "未发药": detailData.fyState==1?'已发药' : "取消发药" }}</el-descriptions-item>
  342. <el-descriptions-item label="煎药方式">{{
  343. detailData.oralPre && detailData.oralPre.decoctingMethod
  344. }} <span v-if="detailData.oralPre && detailData.oralPre.decoctingMethod=='浓煎'">{{detailData.oralPre && detailData.oralPre.concentration}}</span></el-descriptions-item>
  345. <!-- <el-descriptions-item
  346. label="取药方式
  347. "
  348. >{{ detailData.takingMethod }}</el-descriptions-item
  349. >
  350. <el-descriptions-item label="处方名">{{
  351. detailData.preName
  352. }}</el-descriptions-item> -->
  353. <el-descriptions-item label="处方金额">{{
  354. detailData.type == 1
  355. ? detailData.oralPre &&
  356. detailData.oralPre.prescriptionTotleSum
  357. : detailData.solidPre &&
  358. detailData.solidPre.prescriptionTotleSum
  359. }}</el-descriptions-item>
  360. <el-descriptions-item label="剂型">{{
  361. detailData.oralPre && detailData.oralPre.dosageForm
  362. }}</el-descriptions-item>
  363. <el-descriptions-item label="剂数">{{
  364. detailData.oralPre && detailData.oralPre.number
  365. }}</el-descriptions-item>
  366. <el-descriptions-item label="代煎剂数">{{
  367. detailData.oralPre && detailData.oralPre.daijianNumber
  368. }}</el-descriptions-item>
  369. <el-descriptions-item label="代煎费用">{{
  370. detailData.oralPre && detailData.oralPre.daijianCost
  371. }}</el-descriptions-item>
  372. <el-descriptions-item label="处方用法">{{
  373. detailData.oralPre && detailData.oralPre.prescriptionusage
  374. }}</el-descriptions-item>
  375. <el-descriptions-item label="服药时间">{{
  376. detailData.oralPre && detailData.oralPre.medicationTime
  377. }}</el-descriptions-item>
  378. <el-descriptions-item label="频次">{{
  379. detailData.oralPre && detailData.oralPre.frequency
  380. }}</el-descriptions-item>
  381. <el-descriptions-item label="快递单号">{{
  382. detailData.expressCode
  383. }}</el-descriptions-item>
  384. <el-descriptions-item label="收件人">{{
  385. detailData.consignee
  386. }}</el-descriptions-item>
  387. <el-descriptions-item label="收货电话">{{
  388. detailData.contactNumber
  389. }}</el-descriptions-item>
  390. <el-descriptions-item label="配送费用">{{
  391. detailData.oralPre && detailData.oralPre.distributionCost
  392. }}</el-descriptions-item>
  393. <el-descriptions-item label="总金额">{{
  394. detailData.oralPre && detailData.oralPre.prescriptionTotleSum
  395. }}</el-descriptions-item>
  396. </el-descriptions>
  397. <el-descriptions>
  398. <el-descriptions-item label="嘱托">{{
  399. detailData.oralPre && detailData.oralPre.entrust
  400. }}</el-descriptions-item>
  401. </el-descriptions>
  402. <el-descriptions>
  403. <el-descriptions-item label="收货地址">{{
  404. detailData.address
  405. }}</el-descriptions-item>
  406. </el-descriptions>
  407. </el-col>
  408. <el-col :span="24">
  409. <el-table
  410. v-loading="loading"
  411. :data="detailData && detailData.oralPreItemList"
  412. @selection-change="handleSelectionChange"
  413. >
  414. <el-table-column type="index" width="55" align="center" />
  415. <el-table-column label="药品名称" align="center" prop="matName" />
  416. <el-table-column
  417. label="药品规格"
  418. align="center"
  419. prop="ypggCenter"
  420. />
  421. <el-table-column label="单位" align="center" prop="matUnitName" />
  422. <el-table-column label="用法" align="center" prop="matUsageName" />
  423. <el-table-column label="剂量" align="center" prop="matDose" />
  424. <el-table-column label="零售价" align="center" prop="matXsj" />
  425. <el-table-column label="产地" align="center" prop="matOrigin" />
  426. <el-table-column
  427. label="小计"
  428. align="center"
  429. prop="subtotalMoney"
  430. />
  431. <!-- <el-table-column label="库存数量" align="center" prop="stock" /> -->
  432. </el-table>
  433. </el-col>
  434. </el-row>
  435. </div>
  436. <div slot="footer" class="dialog-footer">
  437. <!-- <el-button type="primary" @click="submitForm">确 定</el-button>
  438. <el-button @click="cancel">取 消</el-button> -->
  439. <el-button type="primary" @click="cancel">确 定</el-button>
  440. </div>
  441. </el-dialog>
  442. <el-dialog
  443. :title="title"
  444. :visible.sync="openLR"
  445. width="500px"
  446. append-to-body
  447. >
  448. <el-form ref="form" :model="exform" :rules="exrules" label-width="50">
  449. <el-form-item label="快递单号" prop="expressCode">
  450. <el-input v-model="exform.expressCode" placeholder="请输入单号" />
  451. </el-form-item>
  452. </el-form>
  453. <div slot="footer" class="dialog-footer">
  454. <el-button type="primary" @click="submitForm">确 定</el-button>
  455. <el-button @click="cancelLR">取 消</el-button>
  456. </div>
  457. </el-dialog>
  458. <el-dialog
  459. title="打印"
  460. :visible.sync="openConsole"
  461. width="500px"
  462. append-to-body
  463. @close="closeCode"
  464. >
  465. <div id="qrcode" ref="qrcode"></div>
  466. </el-dialog>
  467. <!-- <el-dialog
  468. title="打印"
  469. :visible.sync="openConsole"
  470. width="587px"
  471. append-to-body
  472. @close="closeCode">
  473. <div id="printMe">
  474. <div style="display:flex;align-items:center;font-size:14px;position:relative;">
  475. <div style="flex:1">普通处方</div>
  476. <div style="flex:1;text-align:center;font-size:18px;font-weight:bold;">门诊处方笺</div>
  477. <div style="flex:1"></div>
  478. <div id="qrcode" ref="qrcode" style="position:absolute;top:0;right:0;width:100px;height:100px;"></div>
  479. </div>
  480. <div style="display:flex;align-items:center;font-size:14px;margin-top:30px;">
  481. <div style="flex:1">类别:自费</div>
  482. <div style="flex:3;text-align:right">NO:{{detailData.preNo}}</div>
  483. <div style="flex:1"></div>
  484. </div>
  485. <div style="display:flex;align-items:center;font-size:14px;margin-top:10px;">
  486. <div style="flex:2">科室:{{detailData.department}}</div>
  487. <div style="flex:2;text-align:right">2022-01-16 23:15:00</div>
  488. <div style="flex:1"></div>
  489. </div>
  490. <table style="width:100%;border-collapse:collapse;margin-top:20px;line-height:32px;">
  491. <tr>
  492. <td rowspan="2" style="width:10%;border:1px solid #000;padding-left:10px;;">姓名</td>
  493. <td rowspan="2" style="width:14%;border:1px solid #000;padding-left:10px;">{{detailData.name}}</td>
  494. <td style="width:11%;border:1px solid #000;padding-left:10px;">性别</td>
  495. <td style="width:24%;border:1px solid #000;padding-left:10px;">{{detailData.sex}}</td>
  496. <td style="width:14%;border:1px solid #000;padding-left:10px;">年龄</td>
  497. <td style="width:29%;border:1px solid #000;padding-left:10px;">{{detailData.age}}</td>
  498. </tr>
  499. <tr>
  500. <td style="border:1px solid #000;padding-left:10px;">电话</td>
  501. <td style="border:1px solid #000;padding-left:10px;">{{detailData.contactNumber}}</td>
  502. <td style="border:1px solid #000;">门诊病历号</td>
  503. <td style="border:1px solid #000;padding-left:10px;line-height:14px;">{{detailData.visitNo}}</td>
  504. </tr>
  505. <tr>
  506. <td colspan="2" style="border:1px solid #000;padding-left:10px;">单位或家庭地址</td>
  507. <td colspan="4" style="border:1px solid #000;padding-left:10px;">{{detailData.address}}</td>
  508. </tr>
  509. <tr>
  510. <td style="border:1px solid #000;padding-left:10px;" colspan="2">临床诊断</td>
  511. <td style="border:1px solid #000;padding-left:10px;" colspan="2">{{detailData.symName}}</td>
  512. <td style="border:1px solid #000;padding-left:10px;" colspan="1">证型</td>
  513. <td style="border:1px solid #000;padding-left:10px;" colspan="1">{{detailData.disName}}</td>
  514. </tr>
  515. </table>
  516. <div>
  517. <h2>Rp</h2>
  518. <div style="height:360px"></div>
  519. </div>
  520. <div>
  521. <h3>贴数:</h3>
  522. <table style="width:100%;border-collapse:collapse;margin-top:10px;line-height:32px;">
  523. <tr>
  524. <td colspan="2" style="width:12%;border:1px solid #000;padding-left:10px;;">医师</td>
  525. <td colspan="3" style="width:21%;border:1px solid #000;padding-left:10px;">{{detailData.doctor}}</td>
  526. <td colspan="3" style="width:21%;border:1px solid #000;padding-left:10px;">药品金额及收收讫章</td>
  527. </tr>
  528. <tr>
  529. <td style="width:10%;border:1px solid #000;padding-left:10px;;">审核</td>
  530. <td style="width:15%;border:1px solid #000;padding-left:10px;;">{{detailData.checkBy}}</td>
  531. <td style="width:10%;border:1px solid #000;padding-left:10px;;">调配</td>
  532. <td style="width:15%;border:1px solid #000;padding-left:10px;;"></td>
  533. <td style="width:10%;border:1px solid #000;padding-left:10px;;">核对</td>
  534. <td style="width:15%;border:1px solid #000;padding-left:10px;;"></td>
  535. <td style="width:10%;border:1px solid #000;padding-left:10px;;">发药</td>
  536. <td style="width:15%;border:1px solid #000;padding-left:10px;;"></td>
  537. </tr>
  538. </table>
  539. <div style="line-height:24px;">
  540. <p style="margin:10px 0 0;">注:1、本处方2日内有效</p>
  541. <p style="margin:0">2、取药时请您当面核对药品名称、规格、数量。</p>
  542. <p style="margin:0">3、延长处方用量时间原因:慢性 其他老年病 外地。</p>
  543. </div>
  544. </div>
  545. </div>
  546. <span slot="footer">
  547. <el-button type="primary" v-print="'#printMe'">打印</el-button>
  548. </span>
  549. </el-dialog> -->
  550. </div>
  551. </template>
  552. <script>
  553. import {
  554. listPrescriptionCore,
  555. getPrescriptionCore,
  556. delPrescriptionCore,
  557. addPrescriptionCore,
  558. updatePrescriptionCore,
  559. exportPrescriptionCore,
  560. addNum,
  561. } from "@/api/prescription/prescriptionCore";
  562. import { listMedicalMechanism } from "@/api/medical/mechanism";
  563. import QRCode from "qrcodejs2";
  564. export default {
  565. name: "PrescriptionCore",
  566. data() {
  567. return {
  568. btnState: 1,
  569. rowId: null,
  570. detailData: {},
  571. activeName: "first",
  572. openLR: false,
  573. rowId: "",
  574. state: {
  575. 1: "配药",
  576. 2: "煎药",
  577. 3: "发药",
  578. 4: "配送",
  579. },
  580. premzzyArr: [
  581. { name: "全部", id: 1 },
  582. { name: "门诊", id: 2 },
  583. { name: "住院", id: 3 },
  584. ],
  585. takingMethodArr: [
  586. { name: "全部", id: '' },
  587. { name: "配送", id: '配送' },
  588. { name: "自提", id: '自提' },
  589. ],
  590. openConsole: false,
  591. // 遮罩层
  592. loading: true,
  593. // 导出遮罩层
  594. exportLoading: false,
  595. // 选中数组
  596. ids: [],
  597. // 非单个禁用
  598. single: true,
  599. // 非多个禁用
  600. multiple: true,
  601. // 显示搜索条件
  602. showSearch: true,
  603. // 总条数
  604. total: 0,
  605. // 处方审核表格数据
  606. prescriptionCoreList: [],
  607. // 弹出层标题
  608. title: "",
  609. // 是否显示弹出层
  610. open: false,
  611. // 查询参数
  612. queryParams: {
  613. pageNum: 1,
  614. pageSize: 10,
  615. //state: 3,
  616. checkState: 1,
  617. appId: null,
  618. yljgId: null,
  619. timeStamp: null,
  620. token: null,
  621. orderNo: null,
  622. preNo: null,
  623. preName: null,
  624. name: null,
  625. sex: null,
  626. age: null,
  627. department: null,
  628. doctor: null,
  629. prescriptionTime: null,
  630. disCode: null,
  631. disName: null,
  632. symCode: null,
  633. symName: null,
  634. westernDisease: null,
  635. westernCode: null,
  636. patientContent: null,
  637. nowDesc: null,
  638. pastDesc: null,
  639. fourDiagnosis: null,
  640. physical: null,
  641. auxiliaryExam: null,
  642. premzzy: null,
  643. visitNo: null,
  644. //checkState: null,
  645. remarks: null,
  646. extendedTxt: null,
  647. address: null,
  648. contactNumber: null,
  649. consignee: null,
  650. takingMethod: null,
  651. yfId: window.localStorage.getItem("pharmacyId"),
  652. },
  653. // 表单参数
  654. form: {},
  655. // 表单校验
  656. exrules: {},
  657. exform: {
  658. expressCode: ''
  659. },
  660. listMedicalMechanismArr: [],
  661. };
  662. },
  663. created() {
  664. this.getList();
  665. this.getListMedicalMechanism();
  666. },
  667. methods: {
  668. //打印
  669. consoleBtn({ id }) {
  670. this.rowId = id;
  671. this.openConsole = true;
  672. this.payOrder();
  673. addNum(id)
  674. // getPrescriptionCore(id).then((response) => {
  675. // // this.form = response.data;
  676. // this.detailData = response.data
  677. // });
  678. },
  679. payOrder() {
  680. this.innerVisible = true;
  681. // 二维码内容,一般是由后台返回的跳转链接,这里是写死的一个链接
  682. //this.qrcode = `http://106.14.106.155:8006?id=${this.rowId}`;
  683. this.qrcode = `https://yaofang.hzxunmai.com/doc#/input?id=${this.rowId}`;
  684. // 使用$nextTick确保数据渲染
  685. this.$nextTick(() => {
  686. this.crateQrcode();
  687. });
  688. },
  689. // 生成二维码
  690. crateQrcode() {
  691. this.qr = new QRCode("qrcode", {
  692. width: 100,
  693. height: 100, // 高度
  694. text: this.qrcode, // 二维码内容
  695. });
  696. },
  697. // 关闭弹框,清除已经生成的二维码
  698. closeCode() {
  699. this.$refs.qrcode.innerHTML = "";
  700. },
  701. handleClick(tab, event) {
  702. //console.log(tab, event);
  703. },
  704. /** 查询处方审核列表 */
  705. getList() {
  706. this.loading = true;
  707. listPrescriptionCore(this.queryParams).then((response) => {
  708. this.prescriptionCoreList = response.rows;
  709. this.total = response.total;
  710. this.loading = false;
  711. });
  712. },
  713. getListMedicalMechanism() {
  714. listMedicalMechanism().then((res) => {
  715. this.listMedicalMechanismArr = res.data;
  716. });
  717. },
  718. //录入弹出框
  719. handleUpdate(row) {
  720. this.form = row
  721. this.exform.expressCode = row.expressCode
  722. this.openLR = true;
  723. },
  724. // 取消按钮
  725. cancel() {
  726. this.open = false;
  727. this.reset();
  728. },
  729. cancelLR() {
  730. this.openLR = false;
  731. this.exform.expressCode = ''
  732. this.reset();
  733. },
  734. // 表单重置
  735. reset() {
  736. this.form = {
  737. id: null,
  738. remarks: null
  739. };
  740. this.resetForm("form");
  741. },
  742. /** 搜索按钮操作 */
  743. handleQuery() {
  744. this.queryParams.pageNum = 1;
  745. this.getList();
  746. },
  747. /** 重置按钮操作 */
  748. resetQuery() {
  749. this.resetForm("queryForm");
  750. this.handleQuery();
  751. },
  752. // 多选框选中数据
  753. handleSelectionChange(selection) {
  754. this.ids = selection.map((item) => item.id);
  755. this.single = selection.length !== 1;
  756. this.multiple = !selection.length;
  757. },
  758. /** 新增按钮操作 */
  759. handleAdd() {
  760. this.reset();
  761. this.open = true;
  762. this.title = "添加处方审核";
  763. },
  764. /** 修改按钮操作 */
  765. handleDetail(row) {
  766. this.reset();
  767. const id = row.id || this.ids;
  768. getPrescriptionCore(id).then((response) => {
  769. // this.form = response.data;
  770. this.detailData = response.data;
  771. this.open = true;
  772. this.title = "发药详情";
  773. });
  774. },
  775. /** 提交按钮 */
  776. submitForm() {
  777. this.$refs["form"].validate((valid) => {
  778. if (valid) {
  779. if (this.exform.expressCode) {
  780. this.form.expressCode = this.exform.expressCode
  781. }
  782. if (this.form.id != null) {
  783. updatePrescriptionCore(this.form).then((response) => {
  784. this.msgSuccess("修改成功");
  785. this.open = false;
  786. this.getList();
  787. });
  788. } else {
  789. addPrescriptionCore(this.form).then((response) => {
  790. this.msgSuccess("新增成功");
  791. this.open = false;
  792. this.getList();
  793. });
  794. }
  795. this.openLR = false
  796. }
  797. });
  798. },
  799. /** 删除按钮操作 */
  800. handleDelete(row) {
  801. const ids = row.id || this.ids;
  802. this.$confirm(
  803. '是否确认删除处方审核编号为"' + ids + '"的数据项?',
  804. "警告",
  805. {
  806. confirmButtonText: "确定",
  807. cancelButtonText: "取消",
  808. type: "warning",
  809. }
  810. )
  811. .then(function () {
  812. return delPrescriptionCore(ids);
  813. })
  814. .then(() => {
  815. this.getList();
  816. this.msgSuccess("删除成功");
  817. })
  818. .catch(() => {});
  819. },
  820. /** 导出按钮操作 */
  821. handleExport() {
  822. const queryParams = this.queryParams;
  823. this.$confirm("是否确认导出所有处方审核数据项?", "警告", {
  824. confirmButtonText: "确定",
  825. cancelButtonText: "取消",
  826. type: "warning",
  827. })
  828. .then(() => {
  829. this.exportLoading = true;
  830. return exportPrescriptionCore(queryParams);
  831. })
  832. .then((response) => {
  833. this.download(response.msg);
  834. this.exportLoading = false;
  835. })
  836. .catch(() => {});
  837. },
  838. },
  839. };
  840. </script>
  841. <style scoped>
  842. h3 {
  843. margin: 0;
  844. }
  845. #qrcode {
  846. width: 160px;
  847. margin: 0 auto;
  848. }
  849. </style>