index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671
  1. <!-- 调配管理 -->
  2. <template>
  3. <div class="app-container">
  4. <el-form
  5. :model="queryParams"
  6. ref="queryForm"
  7. :inline="true"
  8. v-show="showSearch"
  9. label-width="68px"
  10. >
  11. <div class="query-box">
  12. <div class="query-box__left">
  13. <el-form-item label="" prop="yljgId">
  14. <el-select
  15. v-model="queryParams.yljgId"
  16. placeholder="请选择医疗机构"
  17. class="defwidth"
  18. >
  19. <el-option
  20. v-for="item in listMedicalMechanismArr"
  21. :key="item.id"
  22. :value="item.id"
  23. :label="item.name"
  24. :disabled="item.state == 1 ? false : true"
  25. ></el-option>
  26. </el-select>
  27. </el-form-item>
  28. <el-form-item label="" prop="checkTime">
  29. <el-date-picker
  30. style="width:260px"
  31. clearable
  32. class="defwidth"
  33. size="small"
  34. v-model="queryParams.checkTime"
  35. type="daterange"
  36. value-format="yyyy-MM-dd"
  37. start-placeholder="审核开始时间"
  38. end-placeholder="审核结束时间"
  39. >
  40. </el-date-picker>
  41. </el-form-item>
  42. <el-form-item label="" prop="isAllocation">
  43. <el-select v-model="queryParams.isAllocation" placeholder="调配状态"
  44. style="width:160px"
  45. >
  46. <el-option
  47. v-for="item in deployStateArr"
  48. :key="item.id"
  49. :value="item.id"
  50. :label="item.name"
  51. ></el-option>
  52. </el-select>
  53. </el-form-item>
  54. <el-form-item label="" prop="allocateNickName">
  55. <el-input
  56. v-model="queryParams.allocateNickName"
  57. style="width: 190px;"
  58. placeholder="请输入调配师姓名 / 工号"
  59. clearable
  60. size="small"
  61. @keyup.enter.native="handleQuery"
  62. />
  63. </el-form-item>
  64. <el-form-item label="" prop="reqStr">
  65. <el-input
  66. v-model="queryParams.reqStr"
  67. style="width: 190px;"
  68. placeholder="请输入患者姓名 / 处方号"
  69. clearable
  70. size="small"
  71. @keyup.enter.native="handleQuery"
  72. />
  73. </el-form-item>
  74. <el-form-item>
  75. <el-button
  76. type="primary"
  77. icon="el-icon-search"
  78. size="mini"
  79. @click="handleQuery"
  80. >搜索
  81. </el-button
  82. >
  83. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  84. >重置
  85. </el-button
  86. >
  87. </el-form-item>
  88. </div>
  89. </div>
  90. </el-form>
  91. <el-table
  92. v-loading="loading"
  93. :data="allocateAllocate"
  94. @selection-change="handleSelectionChange"
  95. border
  96. size="mini"
  97. class="prescriptionCore"
  98. >
  99. <el-table-column type="index" width="55" align="center" label="序号"/>
  100. <el-table-column label="医疗机构" align="center" prop="yijgName" show-overflow-tooltip/>
  101. <el-table-column label="处方号" align="center" prop="preNo"/>
  102. <el-table-column label="门诊/住院" align="center" prop="preMzZy">
  103. <template slot-scope="scope">{{ scope.row.preMzZy == 1 ? '门诊' : '住院' }}</template>
  104. </el-table-column>
  105. <el-table-column label="患者姓名" align="center" prop="name"/>
  106. <el-table-column label="性别" align="center" prop="sex"/>
  107. <el-table-column label="临床诊断" align="center" prop="symName">
  108. <template slot-scope="scope">{{ scope.row.disName }}-{{ scope.row.symName }}</template>
  109. </el-table-column>
  110. <el-table-column label="处方名称" align="center" prop="preName"/>
  111. <el-table-column label="剂数" align="center" prop="number"/>
  112. <el-table-column label="审核人" align="center" prop="checkBy"/>
  113. <el-table-column label="审核时间" align="center" prop="checkTime"/>
  114. <el-table-column label="调配状态" align="center" width="78" prop="isAllocation">
  115. <template slot-scope="scope">
  116. {{ isAllocationRefData[ scope.row.isAllocation ] || '' }}
  117. </template>
  118. </el-table-column>
  119. <el-table-column label="调配师" align="center" prop="allocateNickName"/>
  120. <el-table-column label="调配时间" align="center" prop="allocateTime"/>
  121. <el-table-column label="置顶时间" align="center" prop="topTime"/>
  122. <el-table-column
  123. label="操作"
  124. align="center"
  125. class-name="small-padding fixed-width"
  126. width="200"
  127. fixed="right"
  128. >
  129. <template slot-scope="scope">
  130. <el-button
  131. size="mini"
  132. type="primary"
  133. style="width: 40px"
  134. @click="handleUpdate(1, scope.row)"
  135. v-hasPermi="['rescription:prescriptionCore:query']"
  136. >详情
  137. </el-button
  138. >
  139. <el-button
  140. size="mini"
  141. type="primary"
  142. style="width: 40px;background-color: #1ab394;"
  143. v-if="scope.row.isAllocation!=1"
  144. @click="handleTop(scope.row)"
  145. v-hasPermi="['rescription:prescriptionCore:top']"
  146. >置顶
  147. </el-button>
  148. <el-button
  149. size="mini"
  150. type="primary"
  151. style="width: 80px;background: #409eff;"
  152. v-if="scope.row.isAllocation!=1"
  153. @click="handleAssign(scope.row)"
  154. v-hasPermi="['rescription:prescriptionCore:allocate']"
  155. >指定调配师
  156. </el-button>
  157. </template>
  158. </el-table-column>
  159. </el-table>
  160. <pagination
  161. v-show="total > 0"
  162. :total="total"
  163. :page.sync="queryParams.pageNum"
  164. :limit.sync="queryParams.pageSize"
  165. @pagination="getList"
  166. />
  167. <!-- 详情对话框 -->
  168. <el-dialog
  169. :title="title"
  170. :visible.sync="open"
  171. width="1280px"
  172. append-to-body
  173. >
  174. <div>
  175. <div style="display: flex; align-items: center;margin-bottom:20px;">
  176. <h3>处方信息</h3>
  177. <div style="margin: 0 0 0 30px">处方号:{{ detailData.preNo }}</div>
  178. </div>
  179. <div style="display: flex; align-items: center;">
  180. <h3>调配状态:</h3>
  181. <span style="color:#fff"
  182. :class="{'yellow-btn':detailData.isAllocation==0,'green-btn':detailData.isAllocation==1}">
  183. {{ isAllocationRefData[ detailData.isAllocation ] || '' }}
  184. </span>
  185. <template v-if="detailData.isAllocation==1">
  186. <h3 style="margin-left:50px">调配师:</h3>
  187. <span>{{ detailData.allocateNickName }}</span>
  188. <h3 style="margin-left:50px">调配时间:</h3>
  189. <span>{{ detailData.allocateTime }}</span>
  190. </template>
  191. <template v-else-if="detailData.isTop==1">
  192. <h3 style="margin-left:50px">置顶时间:</h3>
  193. <span>{{ detailData.topTime }}</span>
  194. </template>
  195. </div>
  196. <el-divider></el-divider>
  197. <el-row :gutter="20">
  198. <el-col :span="24">
  199. <el-descriptions title="" :column="5">
  200. <el-descriptions-item label="患者姓名">{{
  201. detailData.name
  202. }}
  203. </el-descriptions-item>
  204. <el-descriptions-item label="性别">{{
  205. detailData.sex
  206. }}
  207. </el-descriptions-item>
  208. <el-descriptions-item label="年龄">{{
  209. detailData.age
  210. }}
  211. </el-descriptions-item>
  212. <el-descriptions-item label="科室">{{
  213. detailData.department
  214. }}
  215. </el-descriptions-item>
  216. <el-descriptions-item label="临床诊断">
  217. {{ detailData.disName }}-{{ detailData.symName }}
  218. </el-descriptions-item>
  219. <el-descriptions-item label="开方医生">{{
  220. detailData.doctor
  221. }}
  222. </el-descriptions-item>
  223. <el-descriptions-item label="处方类型">{{
  224. detailData.type == 1 ? '中药处方' : '中药制剂'
  225. }}
  226. </el-descriptions-item>
  227. <el-descriptions-item label="发药状态">{{
  228. detailData.fyState == 0 ? '未发药' : detailData.fyState == 1
  229. ? '已发药'
  230. : '取消发药'
  231. }}
  232. </el-descriptions-item>
  233. <el-descriptions-item label="煎药方式">{{
  234. detailData.oralPre && detailData.oralPre.decoctingMethod
  235. }} <span v-if="detailData.oralPre && detailData.oralPre.decoctingMethod=='浓煎'">{{
  236. detailData.oralPre && detailData.oralPre.concentration
  237. }}</span></el-descriptions-item>
  238. <el-descriptions-item label="处方金额">{{
  239. detailData.type == 1
  240. ? detailData.oralPre &&
  241. detailData.oralPre.prescriptionSum
  242. : detailData.solidPre &&
  243. detailData.solidPre.prescriptionSum
  244. }}
  245. </el-descriptions-item>
  246. <el-descriptions-item label="剂型">{{
  247. detailData.oralPre && detailData.oralPre.dosageForm
  248. }}
  249. </el-descriptions-item>
  250. <el-descriptions-item label="剂数">{{
  251. detailData.oralPre && detailData.oralPre.number
  252. }}
  253. </el-descriptions-item>
  254. <el-descriptions-item label="代煎剂数">{{
  255. detailData.oralPre && detailData.oralPre.daijianNumber
  256. }}
  257. </el-descriptions-item>
  258. <el-descriptions-item label="代煎费用">{{
  259. detailData.oralPre && detailData.oralPre.daijianCost
  260. }}
  261. </el-descriptions-item>
  262. <el-descriptions-item label="处方用法">{{
  263. detailData.oralPre && detailData.oralPre.prescriptionusage
  264. }}
  265. </el-descriptions-item>
  266. <el-descriptions-item label="服药时间">{{
  267. detailData.oralPre && detailData.oralPre.medicationTime
  268. }}
  269. </el-descriptions-item>
  270. <el-descriptions-item label="频次">{{
  271. detailData.oralPre && detailData.oralPre.frequency
  272. }}
  273. </el-descriptions-item>
  274. <el-descriptions-item label="快递单号">{{
  275. detailData.expressCode
  276. }}
  277. </el-descriptions-item>
  278. <el-descriptions-item label="收件人">{{
  279. detailData.consignee
  280. }}
  281. </el-descriptions-item>
  282. <el-descriptions-item label="收货电话">{{
  283. detailData.contactNumber
  284. }}
  285. </el-descriptions-item>
  286. <el-descriptions-item label="配送费用">{{
  287. detailData.oralPre && detailData.oralPre.distributionCost
  288. }}
  289. </el-descriptions-item>
  290. <el-descriptions-item label="总金额">{{
  291. detailData.oralPre && detailData.oralPre.prescriptionTotleSum
  292. }}
  293. </el-descriptions-item>
  294. </el-descriptions>
  295. <el-descriptions>
  296. <el-descriptions-item label="嘱托">{{
  297. detailData.oralPre && detailData.oralPre.entrust
  298. }}
  299. </el-descriptions-item>
  300. </el-descriptions>
  301. <el-descriptions>
  302. <el-descriptions-item label="收货地址">{{
  303. detailData.address
  304. }}
  305. </el-descriptions-item>
  306. </el-descriptions>
  307. </el-col>
  308. <el-col :span="24">
  309. <el-table
  310. v-loading="loading"
  311. :data="detailData && detailData.oralPreItemList"
  312. @selection-change="handleSelectionChange"
  313. >
  314. <el-table-column type="index" width="55" align="center"/>
  315. <el-table-column label="药品名称" align="center" prop="matName"/>
  316. <el-table-column
  317. label="药品规格"
  318. align="center"
  319. prop="ypggCenter"
  320. />
  321. <el-table-column label="单位" align="center" prop="matUnitName"/>
  322. <el-table-column label="用法" align="center" prop="matUsageName"/>
  323. <el-table-column label="剂量" align="center" prop="matDose"/>
  324. <el-table-column label="零售价" align="center" prop="matXsj"/>
  325. <el-table-column label="产地" align="center" prop="matOrigin"/>
  326. <el-table-column
  327. label="小计"
  328. align="center"
  329. prop="subtotalMoney"
  330. />
  331. </el-table>
  332. </el-col>
  333. </el-row>
  334. <div style="margin-top: 20px" v-if="btnState === 2">
  335. <span>备注</span>
  336. <el-input
  337. placeholder="请输入拒绝原因"
  338. style="margin-top: 10px"
  339. v-model="remarks"
  340. ></el-input>
  341. </div>
  342. </div>
  343. <div slot="footer" class="dialog-footer">
  344. <el-button @click="cancel">关 闭</el-button>
  345. </div>
  346. </el-dialog>
  347. <el-dialog title="在线调配师"
  348. :title="title"
  349. :visible.sync="openDispatcher"
  350. width="500px"
  351. append-to-body
  352. >
  353. <el-table
  354. class="dispatcher-table-wrapper"
  355. ref="dispatcherTable"
  356. :data="listDispatcherArr"
  357. :max-height="maxHeight"
  358. highlight-selection-row
  359. @row-click="handleDispatcherChange"
  360. @select="handleDispatcherChange"
  361. style="width: 100%">
  362. <el-table-column
  363. type="selection"
  364. width="50">
  365. </el-table-column>
  366. <el-table-column
  367. property="name"
  368. label="姓名"
  369. width="120">
  370. </el-table-column>
  371. <el-table-column
  372. property="jobNumber"
  373. label="工号"
  374. width="120">
  375. </el-table-column>
  376. <el-table-column
  377. property="status"
  378. label="接单状态">
  379. <template slot-scope="scope">
  380. {{
  381. scope.row.onlineStatus == 1
  382. ? '不在线'
  383. : scope.row.workStatus == 1
  384. ? '暂停接单'
  385. : '接单中'
  386. }}
  387. </template>
  388. </el-table-column>
  389. </el-table>
  390. <div slot="footer" class="dialog-footer">
  391. <el-button type="primary" @click="confirm(1)">指定</el-button>
  392. <el-button type="primary" @click="confirm(2)">指定并置顶</el-button>
  393. <el-button @click="cancel">取消</el-button>
  394. </div>
  395. </el-dialog>
  396. </div>
  397. </template>
  398. <script>
  399. import { getPrescriptionCore } from '@/api/prescription/prescriptionCore';
  400. import { listMedicalMechanism } from '@/api/medical/mechanism';
  401. import { assignAndPinOrder, assignOrder, listAllocateCore, listDispatcher, pinOrder } from '@/api/pharmacy/blend';
  402. import dayjs from 'dayjs'
  403. export default {
  404. name: 'BlendCore',
  405. components: {},
  406. data() {
  407. const now = dayjs().format('YYYY-MM-DD');
  408. return {
  409. maxHeight: Math.floor(window.innerHeight * 0.6),
  410. $baseUrl: this.$baseUrl,
  411. deployStateArr: [
  412. {name: '待调配', id: 0},
  413. {name: '已调配', id: 1},
  414. ],
  415. isAllocationRefData: {
  416. 0: '待调配',
  417. 1: '已调配',
  418. },
  419. remarks: '',
  420. btnState: 1,
  421. rowId: null,
  422. detailData: {
  423. oralPreItemList: [],
  424. },
  425. // 遮罩层
  426. loading: true,
  427. // 选中数组
  428. ids: [],
  429. // 非单个禁用
  430. single: true,
  431. // 非多个禁用
  432. multiple: true,
  433. // 显示搜索条件
  434. showSearch: true,
  435. // 总条数
  436. total: 0,
  437. // 处方调配表格数据
  438. allocateAllocate: [],
  439. // 弹出层标题
  440. title: '',
  441. // 是否显示弹出层
  442. open: false,
  443. openDispatcher: false,
  444. // 查询参数
  445. queryParams: {
  446. pageNum: 1,
  447. pageSize: 10,
  448. isAllocation: null,
  449. appId: null,
  450. yljgId: null,
  451. timeStamp: null,
  452. token: null,
  453. // 患者姓名/处方号
  454. reqStr: null,
  455. preNo: null,
  456. preName: null,
  457. name: null,
  458. sex: null,
  459. age: null,
  460. department: null,
  461. doctor: null,
  462. // 调配师 Id
  463. pharmacistUserId: null,
  464. allocateNickName: null,
  465. checkTime: [now, now],
  466. disCode: null,
  467. disName: null,
  468. symCode: null,
  469. symName: null,
  470. westernDisease: null,
  471. westernCode: null,
  472. patientContent: null,
  473. nowDesc: null,
  474. pastDesc: null,
  475. fourDiagnosis: null,
  476. physical: null,
  477. auxiliaryExam: null,
  478. premzzy: null,
  479. visitNo: null,
  480. checkState: null,
  481. remarks: null,
  482. extendedTxt: null,
  483. address: null,
  484. contactNumber: null,
  485. consignee: null,
  486. takingMethod: null,
  487. yfId: window.localStorage.getItem('pharmacyId'),
  488. },
  489. // 表单参数
  490. form: {},
  491. // 表单校验
  492. rules: {},
  493. listMedicalMechanismArr: [],
  494. // 调配师
  495. listDispatcherArr: [],
  496. };
  497. },
  498. created() {
  499. this.getList();
  500. this.getListMedicalMechanism();
  501. this.getListDispatcherArr();
  502. },
  503. methods: {
  504. // 表单重置
  505. reset() {
  506. this.form = {
  507. prescriptionId: null,
  508. pharmacistId: null,
  509. };
  510. this.remarks = null;
  511. this.resetForm('form');
  512. },
  513. /** 置顶 */
  514. handleTop(row) {
  515. const ids = row.id || this.ids;
  516. this.$confirm(
  517. '是否确定置顶处方编号为"' + row.preNo + '"的数据项?',
  518. '温馨提示',
  519. {
  520. confirmButtonText: '确定',
  521. cancelButtonText: '取消',
  522. type: 'warning',
  523. },
  524. )
  525. .then(function () {
  526. return pinOrder({prescriptionId: ids});
  527. })
  528. .then(() => {
  529. this.getList();
  530. this.msgSuccess(res.msg || '置顶成功');
  531. })
  532. .catch(() => {
  533. });
  534. },
  535. handleAssign(row) {
  536. this.reset();
  537. this.form.prescriptionId = row.id || this.ids;
  538. this.getListDispatcherArr().then(() => { this.openDispatcher = true; });
  539. },
  540. /** 查询调配处方列表 */
  541. getList() {
  542. this.loading = true;
  543. const form = Object.assign({}, this.queryParams);
  544. if ( this.queryParams.checkTime && this.queryParams.checkTime.length ) {
  545. form.startTime = this.queryParams.checkTime[ 0 ];
  546. form.endTime = this.queryParams.checkTime[ 1 ];
  547. } else {
  548. form.startTime = '';
  549. form.endTime = '';
  550. }
  551. delete form.checkTime;
  552. listAllocateCore(form).then((response) => {
  553. this.allocateAllocate = response.rows;
  554. this.total = response.total;
  555. this.loading = false;
  556. });
  557. },
  558. getListMedicalMechanism() {
  559. listMedicalMechanism().then((res) => {
  560. this.listMedicalMechanismArr = res.data;
  561. });
  562. },
  563. /** 查询调配师列表 */
  564. getListDispatcherArr() {
  565. return listDispatcher().then((res) => {
  566. this.listDispatcherArr = res.data;
  567. });
  568. },
  569. // 取消按钮
  570. cancel() {
  571. this.openDispatcher = false;
  572. this.open = false;
  573. this.reset();
  574. },
  575. confirm(num) {
  576. if ( !this.form.pharmacistId ) {
  577. this.msgError('请选择调配师');
  578. return;
  579. }
  580. let request;
  581. if ( num == 1 ) {
  582. request = assignOrder(this.form);
  583. } else if ( num == 2 ) {
  584. request = assignAndPinOrder(this.form);
  585. }
  586. if ( request ) {
  587. request.then(res => {
  588. this.cancel();
  589. this.getList();
  590. this.msgSuccess(res.msg || '操作成功');
  591. }).catch();
  592. }
  593. },
  594. /** 搜索按钮操作 */
  595. handleQuery() {
  596. this.queryParams.pageNum = 1;
  597. this.getList();
  598. },
  599. /** 重置按钮操作 */
  600. resetQuery() {
  601. this.resetForm('queryForm');
  602. const now = dayjs().format('YYYY-MM-DD');
  603. this.queryParams.checkTime = [now, now];
  604. this.handleQuery();
  605. },
  606. handleDispatcherChange(selection, a) {
  607. this.$refs.dispatcherTable.clearSelection();
  608. if ( Array.isArray(selection) ) {
  609. const item = selection.pop();
  610. this.form.pharmacistId = item ? item.id : null;
  611. this.$refs.dispatcherTable.toggleRowSelection(item);
  612. } else {
  613. this.form.pharmacistId = selection ? selection.id : null;
  614. this.$refs.dispatcherTable.toggleRowSelection(selection);
  615. }
  616. },
  617. // 多选框选中数据
  618. handleSelectionChange(selection) {
  619. this.ids = selection.map((item) => item.id);
  620. this.single = selection.length !== 1;
  621. this.multiple = !selection.length;
  622. },
  623. /** 新增按钮操作 */
  624. handleAdd() {
  625. this.reset();
  626. this.open = true;
  627. this.title = '添加处方调配';
  628. },
  629. /** 修改按钮操作 */
  630. handleUpdate(num, row) {
  631. this.reset();
  632. const id = row.id || this.ids;
  633. this.btnState = num;
  634. this.rowId = id;
  635. getPrescriptionCore(id).then((response) => {
  636. /* 合并数据 */
  637. for ( const key in response.data ) {
  638. if ( response.data[ key ] == null ) {
  639. response.data[ key ] = row[ key ];
  640. }
  641. }
  642. this.detailData = response.data;
  643. this.open = true;
  644. this.title = '查看处方调配';
  645. });
  646. },
  647. },
  648. };
  649. </script>
  650. <style scoped>
  651. h3 {
  652. margin: 0;
  653. }
  654. .defwidth {
  655. width: 160px;
  656. }
  657. .prescriptionCore >>> .warning-row, .prescriptionCore >>> .el-table__body tr.warning-row.current-row > td, .prescriptionCore >>> .el-table__body tr.warning-row.hover-row > td {
  658. background: #e6a23c;
  659. color: #fff
  660. }
  661. </style>
  662. <style>
  663. .dispatcher-table-wrapper th.el-table-column--selection .cell {
  664. display: none;
  665. }
  666. </style>