DrugMapList.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. <template>
  2. <div class="druglist">
  3. <!-- 顶部筛选 -->
  4. <div class="screening">
  5. <div class="screening-title flex-vertical-center-l">
  6. <img src="~@/assets/filters.png" alt />
  7. </div>
  8. <div class="screening-form flex-vertical-center-l flex-wrap">
  9. <div class="screening-item flex-vertical-center-l">
  10. <span>映射状态:</span>
  11. <div class="input">
  12. <el-select size="mini" placeholder="请选择" v-model="isMap">
  13. <el-option :value="0" label="未映射"></el-option>
  14. <el-option :value="1" label="已映射"></el-option>
  15. </el-select>
  16. </div>
  17. </div>
  18. <div class="screening-item flex-vertical-center-l">
  19. <span>平台药品名称:</span>
  20. <div class="input">
  21. <el-input size="mini" placeholder="请输入药品名称" v-model="yigt"></el-input>
  22. </div>
  23. </div>
  24. <el-button type="primary" size="mini" @click="search()">搜索</el-button>
  25. <el-button type="warning" size="mini" @click="clearFilter()">清空</el-button>
  26. <el-button
  27. type="primary"
  28. size="mini"
  29. @click="$router.push({path:'/index/drugmap?pid='+$route.query.id+'&isMapping='+isMap})"
  30. >新增</el-button>
  31. <el-button type="warning" size="mini" @click="$router.back()">返回</el-button>
  32. </div>
  33. </div>
  34. <!-- 底部表格数据 -->
  35. <div class="table">
  36. <div class="today-table">
  37. <div class="table-container">
  38. <el-table :data="tableData" stripe style="width: 100%" border height="100%">
  39. <el-table-column prop="id" label="序号" width="100"></el-table-column>
  40. <el-table-column label="平台药品">
  41. <el-table-column prop="name" label="药品名称"></el-table-column>
  42. <el-table-column prop="dw" label="单位"></el-table-column>
  43. <!-- <el-table-column prop="drugRemark" label="药品描述">
  44. </el-table-column>-->
  45. </el-table-column>
  46. <el-table-column label="第三方药品">
  47. <el-table-column prop="name" label="药品名称">
  48. <template slot-scope="scope">
  49. <div class="hisName">
  50. <span
  51. v-for="(item,index) in scope.row.orgDrugs"
  52. :key="index"
  53. >{{item.name}}{{index==scope.row.orgDrugs.length-1?'':'/'}}</span>
  54. </div>
  55. </template>
  56. </el-table-column>
  57. <el-table-column prop="type" label="规格">
  58. <template slot-scope="scope">
  59. <div>
  60. <span
  61. v-for="(item,index) in scope.row.orgDrugs"
  62. :key="index"
  63. >{{item.gg}}{{index==scope.row.orgDrugs.length-1?'':'/'}}</span>
  64. </div>
  65. </template>
  66. </el-table-column>
  67. <el-table-column prop="drugRemark" label="单位">
  68. <template slot-scope="scope">
  69. <div>
  70. <span
  71. v-for="(item,index) in scope.row.orgDrugs"
  72. :key="index"
  73. >{{item.dw}}{{index==scope.row.orgDrugs.length-1?'':'/'}}</span>
  74. </div>
  75. </template>
  76. </el-table-column>
  77. </el-table-column>
  78. <el-table-column label="操作">
  79. <template slot-scope="scope">
  80. <div class="flex-center operation">
  81. <div
  82. class="flex-center"
  83. @click="$router.push({path:'/index/drugmap?id='+scope.row
  84. .matDrugId+'&pid='+$route.query.id+'&isMapping='+isMap})"
  85. >编辑</div>
  86. <!-- <div class="flex-center bg-yellow">删除
  87. </div>-->
  88. </div>
  89. </template>
  90. </el-table-column>
  91. </el-table>
  92. </div>
  93. <div class="flex-vertical-center-r today-page">
  94. <el-pagination
  95. background
  96. layout=" prev, pager, next, jumper, total"
  97. :total="total"
  98. :page-size="limit"
  99. @current-change="sizeC($event)"
  100. ></el-pagination>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. </template>
  106. <script>
  107. import popup from "@/components/Propup.vue";
  108. import { getDrugMapList, getDrugBM } from "@/api/business.js";
  109. import { doctorBodySelect } from "@/api/city.js";
  110. import { mapState, mapGetters, mapActions, mapMutations } from "vuex";
  111. export default {
  112. components: {
  113. popup
  114. },
  115. data() {
  116. return {
  117. doctorBody: [], // 医共体选择器数据
  118. yigt: "", // 医工体
  119. tableData: [],
  120. page: 1,
  121. limit: 10,
  122. total: 0,
  123. isMap: 1
  124. };
  125. },
  126. created() {
  127. this.getDrugMapList();
  128. },
  129. beforeRouteEnter(to, from, next) {
  130. // 在渲染该组件的对应路由被 confirm 前调用
  131. // 不!能!获取组件实例 `this`
  132. // 因为当守卫执行前,组件实例还没被创建
  133. // 可以通过传一个回调给 next 来访问组件实例
  134. next(vm => {
  135. // 通过 `vm` 访问组件实例
  136. vm.getDrugMapList();
  137. });
  138. },
  139. methods: {
  140. sizeC(e) {
  141. this.page = e;
  142. this.getDrugMapList();
  143. },
  144. search() {
  145. this.page = 1;
  146. this.getDrugMapList();
  147. },
  148. // 清空搜索条件
  149. clearFilter() {
  150. this.yigt = "";
  151. this.getDrugMapList();
  152. },
  153. doctorBodyC() {
  154. // this.page = 1
  155. // this.getDrugList()
  156. },
  157. // 获取药品列表
  158. async getDrugMapList() {
  159. let params = {
  160. page: this.page,
  161. limit: this.limit,
  162. isMapping: this.isMap,
  163. // orgId: this.getuserinfo.organizationid,
  164. matName: this.yigt,
  165. orgId: this.$route.query.id
  166. };
  167. let res = await getDrugMapList(params);
  168. if (res.ResultCode == 0) {
  169. this.tableData = res.Data.Items;
  170. this.total = res.Data.TotalRecordCount;
  171. this.tableData.filter((item, index) => {
  172. item.id = index + 1;
  173. item.type = "his";
  174. return item;
  175. });
  176. }
  177. }
  178. },
  179. computed: {
  180. ...mapGetters(["getuserinfo"])
  181. }
  182. };
  183. </script>
  184. <style lang="scss" scoped>
  185. @import "../../style/common.scss";
  186. @import "../../style/base.scss";
  187. .table {
  188. padding: 5px 5px;
  189. background: #ffffff;
  190. border-radius: 5px;
  191. margin-top: 10px;
  192. height: 72vh;
  193. .table-btns {
  194. margin-bottom: 13px;
  195. div {
  196. width: 74px;
  197. height: 36px;
  198. background: #5386f6;
  199. border-radius: 4px;
  200. cursor: pointer;
  201. font-size: 14px;
  202. font-family: PingFang SC;
  203. font-weight: 400;
  204. color: #ffffff;
  205. margin-right: 7px;
  206. }
  207. .bg-yellow {
  208. background: #ffae45;
  209. }
  210. .bg-red {
  211. background: #ff6245;
  212. }
  213. }
  214. .table-container {
  215. height: 90%;
  216. }
  217. .today-table {
  218. height: 100%;
  219. .operation {
  220. div {
  221. width: 60px;
  222. height: 24px;
  223. background: #5386f6;
  224. border-radius: 2px;
  225. font-size: 14px;
  226. font-family: PingFang SC;
  227. font-weight: 400;
  228. color: #ffffff;
  229. cursor: pointer;
  230. }
  231. .bg-yellow {
  232. // width: 80px;
  233. height: 24px;
  234. background: #ffae45;
  235. margin-left: 21px;
  236. margin-right: 21px;
  237. }
  238. .bg-red {
  239. background: #ff6245;
  240. }
  241. }
  242. }
  243. }
  244. .hisName {
  245. overflow: hidden;
  246. text-overflow: ellipsis;
  247. white-space: nowrap;
  248. width: 100%;
  249. }
  250. .today-table::v-deep .el-table .cell {
  251. text-align: center;
  252. }
  253. .today-table::v-deep .el-table thead.is-group th {
  254. background: #f3fffb;
  255. }
  256. </style>
  257. <style lang="scss" scoped>
  258. @media screen and (min-width: 1681px) and (max-width: 1920px) {
  259. .table {
  260. height: 82vh;
  261. .table-container {
  262. height: 94%;
  263. }
  264. }
  265. .today-table::v-deep .el-table td {
  266. padding: 18px 0;
  267. }
  268. .today-table::v-deep .el-table th {
  269. padding: 18px 0;
  270. }
  271. }
  272. @media screen and (min-width: 1601px) and (max-width: 1680px) {
  273. .table {
  274. height: 81vh;
  275. .table-container {
  276. height: 94%;
  277. }
  278. }
  279. .today-table::v-deep .el-table td {
  280. padding: 18px 0;
  281. }
  282. .today-table::v-deep .el-table th {
  283. padding: 18px 0;
  284. }
  285. .today-table::v-deep .el-table td {
  286. padding: 18px 0;
  287. }
  288. .today-table::v-deep .el-table th {
  289. padding: 18px 0;
  290. }
  291. }
  292. @media screen and (min-width: 1361px) and (max-width: 1600px) {
  293. .table {
  294. height: 73vh;
  295. .table-container {
  296. height: 90%;
  297. }
  298. }
  299. .today-table::v-deep .el-table td {
  300. padding: 5px 0;
  301. }
  302. .today-table::v-deep .el-table th {
  303. padding: 5px 0;
  304. }
  305. }
  306. @media screen and(min-width:1281px) and (max-width: 1360px) {
  307. .table {
  308. height: 74vh;
  309. .table-container {
  310. height: 90%;
  311. }
  312. }
  313. .today-table::v-deep .el-table td {
  314. padding: 5px 0;
  315. }
  316. .today-table::v-deep .el-table th {
  317. padding: 5px 0;
  318. }
  319. }
  320. </style>