index.vue 22 KB

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