index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="处⽅ID" prop="rpId">
  5. <el-input
  6. v-model="queryParams.rpId"
  7. placeholder="请输入处⽅单ID"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="订单号" prop="orderCode">
  14. <el-input
  15. v-model="queryParams.orderCode"
  16. placeholder="请输入订单号"
  17. clearable
  18. size="small"
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item label="状态" prop="status">
  23. <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small" >
  24. <el-option
  25. v-for="item in prescribeStatusOptions"
  26. :key="item.dictValue"
  27. :label="item.dictLabel"
  28. :value="item.dictValue"
  29. />
  30. </el-select>
  31. </el-form-item>
  32. <el-form-item>
  33. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  34. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  35. </el-form-item>
  36. </el-form>
  37. <el-table height="500" border v-loading="loading" :data="prescribeList" @selection-change="handleSelectionChange">
  38. <el-table-column type="selection" width="55" align="center" />
  39. <el-table-column label="ID" align="center" prop="prescribeId" />
  40. <el-table-column label="订单号" align="center" prop="orderCode" />
  41. <el-table-column label="会员昵称" align="center" prop="userNickname" />
  42. <el-table-column label="会员手机号" align="center" prop="userPhone" />
  43. <el-table-column label="患者姓名" align="center" prop="patientName" />
  44. <el-table-column label="患者年龄" align="center" prop="patientAge" />
  45. <!-- <el-table-column label="患者电话" align="center" prop="patientTel" /> -->
  46. <el-table-column label="患者性别" align="center" prop="patientGender" />
  47. <el-table-column label="处⽅单ID" align="center" prop="rpId" />
  48. <el-table-column label="病情描述(主诉)" align="center" prop="chiefComplaint" />
  49. <el-table-column label="现病史" align="center" prop="nowIllness" />
  50. <el-table-column label="既往史" align="center" prop="historyIllness" />
  51. <!-- <el-table-column label="体重" align="center" prop="weight" /> -->
  52. <el-table-column label="是否有过敏史" align="center" prop="isHistoryAllergic" />
  53. <!-- <el-table-column label="过敏史" align="center" prop="historyAllergic" /> -->
  54. <el-table-column label="肝功能是否异常" align="center" prop="liverUnusual" />
  55. <el-table-column label="肾功能是否异常" align="center" prop="renalUnusual" />
  56. <el-table-column label="是否是备孕/怀孕/哺乳期" align="center" prop="lactationFlag" />
  57. <el-table-column label="复诊凭证" align="center" prop="recordPic" width="120">
  58. <template slot-scope="scope">
  59. <el-image
  60. v-if="scope.row.recordPic!=null"
  61. style="width: 50px; height: 50px"
  62. :src="parsePhoto(scope.row.recordPic)[0]"
  63. :preview-src-list="parsePhoto(scope.row.recordPic)">
  64. </el-image>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="处方图片" align="center" width="120">
  68. <template slot-scope="scope">
  69. <el-popover
  70. placement="right"
  71. title=""
  72. trigger="hover"
  73. >
  74. <img slot="reference" :src="scope.row.rpUrl" width="100">
  75. <img :src="scope.row.rpUrl" style="max-width: 500px;">
  76. </el-popover>
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="处⽅开具时间" align="center" prop="rpCreateTime" width="180">
  80. </el-table-column>
  81. <el-table-column label="诊断" align="center" prop="diagnose" />
  82. <el-table-column label="审核意见" align="center" prop="auditReason" />
  83. <el-table-column label="医生名称" align="center" prop="doctorName" />
  84. <el-table-column label="科室名称" align="center" prop="doctorId" />
  85. <el-table-column label="提交时间" align="center" prop="createTime" width="180">
  86. </el-table-column>
  87. <el-table-column label="状态" align="center" prop="status" >
  88. <template slot-scope="scope">
  89. <el-tag prop="status" v-for="(item, index) in prescribeStatusOptions" v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
  93. <template slot-scope="scope">
  94. <el-button
  95. size="mini"
  96. type="text"
  97. @click="handleShowOrder(scope.row)"
  98. v-hasPermi="['store:prescribe:showOrder']"
  99. >查看订单</el-button>
  100. </template>
  101. </el-table-column>
  102. </el-table>
  103. <pagination
  104. v-show="total>0"
  105. :total="total"
  106. :page.sync="queryParams.pageNum"
  107. :limit.sync="queryParams.pageSize"
  108. @pagination="getList"
  109. />
  110. <el-dialog :title="show.title" v-if="show.open" :visible.sync="show.open" width="1000px" append-to-body>
  111. <product-order ref="order" />
  112. </el-dialog>
  113. </div>
  114. </template>
  115. <script>
  116. import { listPrescribe, getPrescribe, delPrescribe, addPrescribe, updatePrescribe, exportPrescribe } from "@/api/hisStore/prescribe";
  117. import productOrder from "../components/productOrder";
  118. export default {
  119. components: { productOrder },
  120. name: "HisPrescribe",
  121. data() {
  122. return {
  123. show:{
  124. open:false,
  125. title:"订单详情"
  126. },
  127. prescribeStatusOptions:[],
  128. // 遮罩层
  129. loading: true,
  130. // 选中数组
  131. ids: [],
  132. // 非单个禁用
  133. single: true,
  134. // 非多个禁用
  135. multiple: true,
  136. // 显示搜索条件
  137. showSearch: true,
  138. // 总条数
  139. total: 0,
  140. // 处方表格数据
  141. prescribeList: [],
  142. // 弹出层标题
  143. title: "",
  144. // 是否显示弹出层
  145. open: false,
  146. // 查询参数
  147. queryParams: {
  148. pageNum: 1,
  149. pageSize: 10,
  150. prescribeType: null,
  151. orderId: null,
  152. userId: null,
  153. patientId: null,
  154. rpId: null,
  155. pharmacyCode: null,
  156. pharmacyName: null,
  157. chiefComplaint: null,
  158. nowIllness: null,
  159. historyIllness: null,
  160. patientAge: null,
  161. patientName: null,
  162. weight: null,
  163. isHistoryAllergic: null,
  164. historyAllergic: null,
  165. liverUnusual: null,
  166. renalUnusual: null,
  167. lactationFlag: null,
  168. patientTel: null,
  169. patientGender: null,
  170. recordPic: null,
  171. rpUrl: null,
  172. rpCreateTime: null,
  173. diagnose: null,
  174. drugs: null,
  175. doctorName: null,
  176. doctorId: null,
  177. },
  178. // 表单参数
  179. form: {},
  180. // 表单校验
  181. rules: {
  182. }
  183. };
  184. },
  185. created() {
  186. this.getDicts("prescribe_status").then((response) => {
  187. this.prescribeStatusOptions = response.data;
  188. });
  189. this.getList();
  190. },
  191. methods: {
  192. handleShowOrder(row){
  193. this.show.open=true;
  194. const orderId = row.orderId ;
  195. setTimeout(() => {
  196. this.$refs.order.getOrder(orderId);
  197. }, 500);
  198. },
  199. /** 查询处方列表 */
  200. getList() {
  201. this.loading = true;
  202. listPrescribe(this.queryParams).then(response => {
  203. this.prescribeList = response.rows;
  204. this.total = response.total;
  205. this.loading = false;
  206. });
  207. },
  208. // 取消按钮
  209. cancel() {
  210. this.open = false;
  211. this.reset();
  212. },
  213. // 表单重置
  214. reset() {
  215. this.form = {
  216. prescribeId: null,
  217. prescribeType: null,
  218. orderId: null,
  219. userId: null,
  220. patientId: null,
  221. rpId: null,
  222. pharmacyCode: null,
  223. pharmacyName: null,
  224. chiefComplaint: null,
  225. nowIllness: null,
  226. historyIllness: null,
  227. patientAge: null,
  228. patientName: null,
  229. weight: null,
  230. isHistoryAllergic: null,
  231. historyAllergic: null,
  232. liverUnusual: null,
  233. renalUnusual: null,
  234. lactationFlag: null,
  235. patientTel: null,
  236. patientGender: null,
  237. recordPic: null,
  238. rpUrl: null,
  239. rpCreateTime: null,
  240. diagnose: null,
  241. drugs: null,
  242. doctorName: null,
  243. doctorId: null,
  244. createTime: null
  245. };
  246. this.resetForm("form");
  247. },
  248. /** 搜索按钮操作 */
  249. handleQuery() {
  250. this.queryParams.pageNum = 1;
  251. this.getList();
  252. },
  253. /** 重置按钮操作 */
  254. resetQuery() {
  255. this.resetForm("queryForm");
  256. this.handleQuery();
  257. },
  258. // 多选框选中数据
  259. handleSelectionChange(selection) {
  260. this.ids = selection.map(item => item.prescribeId)
  261. this.single = selection.length!==1
  262. this.multiple = !selection.length
  263. },
  264. /** 新增按钮操作 */
  265. handleAdd() {
  266. this.reset();
  267. this.open = true;
  268. this.title = "添加处方";
  269. },
  270. /** 修改按钮操作 */
  271. handleUpdate(row) {
  272. this.reset();
  273. const prescribeId = row.prescribeId || this.ids
  274. getPrescribe(prescribeId).then(response => {
  275. this.form = response.data;
  276. this.open = true;
  277. this.title = "修改处方";
  278. });
  279. },
  280. /** 提交按钮 */
  281. submitForm() {
  282. this.$refs["form"].validate(valid => {
  283. if (valid) {
  284. if (this.form.prescribeId != null) {
  285. updatePrescribe(this.form).then(response => {
  286. if (response.code === 200) {
  287. this.msgSuccess("修改成功");
  288. this.open = false;
  289. this.getList();
  290. }
  291. });
  292. } else {
  293. addPrescribe(this.form).then(response => {
  294. if (response.code === 200) {
  295. this.msgSuccess("新增成功");
  296. this.open = false;
  297. this.getList();
  298. }
  299. });
  300. }
  301. }
  302. });
  303. },
  304. /** 删除按钮操作 */
  305. handleDelete(row) {
  306. const prescribeIds = row.prescribeId || this.ids;
  307. this.$confirm('是否确认删除处方编号为"' + prescribeIds + '"的数据项?', "警告", {
  308. confirmButtonText: "确定",
  309. cancelButtonText: "取消",
  310. type: "warning"
  311. }).then(function() {
  312. return delPrescribe(prescribeIds);
  313. }).then(() => {
  314. this.getList();
  315. this.msgSuccess("删除成功");
  316. }).catch(function() {});
  317. },
  318. /** 导出按钮操作 */
  319. handleExport() {
  320. const queryParams = this.queryParams;
  321. this.$confirm('是否确认导出所有处方数据项?', "警告", {
  322. confirmButtonText: "确定",
  323. cancelButtonText: "取消",
  324. type: "warning"
  325. }).then(function() {
  326. return exportPrescribe(queryParams);
  327. }).then(response => {
  328. this.download(response.msg);
  329. }).catch(function() {});
  330. }
  331. }
  332. };
  333. </script>