specimenList.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <template>
  2. <view class="specimenList">
  3. <!-- 头部筛选 -->
  4. <view class="orderList_header">
  5. <view class="orderList_header_item" @click="openPicker('speStatus')">
  6. <text class="orderList_header_itemText">{{selectedSpeState}}</text>
  7. <text class="pda pda-xiala"></text>
  8. </view>
  9. </view>
  10. <!-- 标本列表 -->
  11. <view class="orderDetail_infoItem_item business business_specimen">
  12. <view class="inspect_specimen">
  13. <uni-table stripe emptyText="暂无更多数据">
  14. <!-- 表头行 -->
  15. <uni-tr class="th">
  16. <uni-th align="center" width="68">标本类型</uni-th>
  17. <uni-th align="center" width="71">标本编码</uni-th>
  18. <uni-th align="center" width="66">状态</uni-th>
  19. <uni-th align="center" width="71">科室</uni-th>
  20. </uni-tr>
  21. <!-- 表格数据行 -->
  22. <uni-tr v-for="data in speList" :key="data.id" @click.native="toDetail(data.id,'specimen',data.scode)">
  23. <uni-td align="center">{{data.stype?data.stype.name:'暂无'}}</uni-td>
  24. <uni-td align="center">{{data.scode || '暂无'}}</uni-td>
  25. <uni-td align="center">{{data.speState?data.speState.name:'暂无'}}</uni-td>
  26. <uni-td align="center" class="td" v-if="data.checkDept">
  27. {{deptDisplay==2?data.checkDept.deptalias:data.checkDept.dept}}
  28. <image class="urgent" v-if="data.urgent == 1" src="../../static/imgs/icon_ji.png" mode="widthFix">
  29. </image>
  30. </uni-td>
  31. <uni-td align="center" class="td" v-else>
  32. 暂无
  33. <image class="urgent" v-if="data.urgent == 1" src="../../static/imgs/icon_ji.png" mode="widthFix">
  34. </image>
  35. </uni-td>
  36. </uni-tr>
  37. </uni-table>
  38. </view>
  39. </view>
  40. <seiminFooterBtn :btns="btns"></seiminFooterBtn>
  41. <seiminPicker ref="sPicker" titleColor="#808080" titleFontSize="28rpx" confirmColor="#333" confirmFontSize="38rpx"
  42. confirmFontWeight="500" itemFontSize="32rpx" @onClose="closePicker" @onConfirm="confirmPicker"
  43. :pickerList="pickerList">
  44. </seiminPicker>
  45. </view>
  46. </template>
  47. <script>
  48. import {
  49. mapState,
  50. } from "vuex";
  51. import {
  52. reqGetSpecimenWorkOrderDetails,
  53. } from "../../request/api.js";
  54. export default {
  55. data() {
  56. return {
  57. speList: [], //标本列表
  58. pickerList: [], //picker列表
  59. type: '', //打开picker的类型,急或普查
  60. // 当前筛选的急查或普查
  61. selectedSpeState: '',
  62. //急查或普查筛选列表
  63. speStates: [{
  64. value: 1,
  65. label: '急查'
  66. },
  67. {
  68. value: 0,
  69. label: '普查'
  70. },
  71. ],
  72. //底部按钮
  73. btns: [{
  74. name: "返回首页",
  75. type: "primary",
  76. click: () => {
  77. uni.navigateTo({
  78. url: "/pages/index/index",
  79. });
  80. },
  81. }],
  82. };
  83. },
  84. computed: {
  85. ...mapState("login", ["loginInfo"]),
  86. ...mapState("other", ["deptDisplay"]),
  87. },
  88. methods: {
  89. // 跳转详情
  90. toDetail(id, associationType, scode) {
  91. uni.navigateTo({
  92. url: `/pages/detail/detail?id=${id}&associationType=${associationType}&scode=${scode}`
  93. })
  94. },
  95. // 查询最新工单列表
  96. queryWorkOrdersRequest(idxPlus = false) {
  97. if (idxPlus) {
  98. //累加
  99. ++this.idx;
  100. } else {
  101. this.idx = 0;
  102. }
  103. console.log(this.speStates, this.selectedSpeState)
  104. let postData = {
  105. "deptId": this.loginInfo.user.dept.id,
  106. "urgent": Number(this.speStates.find(v => v.label == this.selectedSpeState).value)
  107. };
  108. return reqGetSpecimenWorkOrderDetails(postData);
  109. },
  110. // 查询最新工单列表
  111. queryWorkOrdersResponse(res, idxPlus = false) {
  112. if (res.status == 200) {
  113. let speList = res.data || [];
  114. console.log(speList, idxPlus)
  115. if (idxPlus) {
  116. //累加
  117. this.speList = this.speList.concat(speList);
  118. } else {
  119. this.speList = speList;
  120. }
  121. } else {
  122. this.$refs.seiminModel.show({
  123. skin: "toast",
  124. icon: "error",
  125. content: res.msg || "获取数据失败",
  126. });
  127. throw new Error(res.msg || '获取数据失败');
  128. }
  129. },
  130. // 查询最新列表(上拉)
  131. reachBottom() {
  132. //没有更多
  133. uni.showToast({
  134. icon: 'none',
  135. title: '没有更多标本了'
  136. })
  137. },
  138. // 获取页面数据
  139. init() {
  140. uni.showLoading({
  141. title: "加载中",
  142. mask: true,
  143. });
  144. Promise.all([
  145. this.queryWorkOrdersRequest(), //查询最新工单列表
  146. ]).then((values) => {
  147. uni.hideLoading();
  148. uni.stopPullDownRefresh();
  149. this.queryWorkOrdersResponse(values[0]);
  150. });
  151. },
  152. //关闭
  153. closePicker() {
  154. this.$refs.sPicker._close();
  155. },
  156. //打开
  157. openPicker(type) {
  158. this.type = type;
  159. this.$refs.sPicker._open();
  160. if (type === 'speStatus') {
  161. //标本是急查或普查
  162. this.pickerList = this.speStates;
  163. let index = this.pickerList.findIndex(v => v.label === this.selectedSpeState);
  164. let obj = this.pickerList.find(v => v.label === this.selectedSpeState);
  165. this.$refs.sPicker._changeValue(index);
  166. this.selectedSpeState = obj && obj.label;
  167. }
  168. },
  169. //确定:接收子组件传来的参数
  170. confirmPicker(checkedObj) {
  171. if (this.type === 'speStatus') {
  172. this.selectedSpeState = checkedObj.label;
  173. }
  174. let index = this.pickerList.findIndex(v => v.label === checkedObj.label);
  175. this.$refs.sPicker._changeValue(index);
  176. this.init();
  177. },
  178. },
  179. mounted() {
  180. this.init();
  181. },
  182. onLoad(querParams) {
  183. this.selectedSpeState = querParams.urgent == 1 ? '急查' : '普查';
  184. },
  185. onPullDownRefresh() {
  186. this.init();
  187. },
  188. onReachBottom() {
  189. this.reachBottom();
  190. },
  191. }
  192. </script>
  193. <style lang="scss" scoped>
  194. .specimenList {
  195. padding-bottom: 108rpx;
  196. // 头部筛选
  197. .orderList_header {
  198. height: 88rpx;
  199. background-color: #fff;
  200. position: fixed;
  201. left: 0;
  202. z-index: 99;
  203. width: 100%;
  204. @include border(bottom);
  205. @include flex(center, center);
  206. .orderList_header_item {
  207. flex: 1;
  208. height: 100%;
  209. padding: 0 50rpx;
  210. @include border(right);
  211. @include flex(space-between, center);
  212. &:last-of-type {
  213. border-right: none;
  214. }
  215. .orderList_header_itemText {
  216. color: #333;
  217. font-size: 38rpx;
  218. }
  219. }
  220. .pda-xiala {
  221. color: #DDE1E5;
  222. }
  223. }
  224. // 标本列表
  225. .orderDetail_infoItem_item {
  226. padding-top: 12rpx;
  227. padding-bottom: 12rpx;
  228. color: #333;
  229. font-size: 30rpx;
  230. flex: 1;
  231. @include border(bottom);
  232. @include flex(flex-start, stretch, column);
  233. // 业务信息-标本
  234. &.business_specimen {
  235. padding-top: 116rpx;
  236. font-size: 34rpx;
  237. .th {
  238. background-color: red;
  239. @include btn_background;
  240. th {
  241. color: #fff;
  242. }
  243. }
  244. .td {
  245. position: relative;
  246. .urgent {
  247. width: 60rpx;
  248. position: absolute !important;
  249. right: 0;
  250. top: 0;
  251. }
  252. }
  253. .table--border {
  254. border: none;
  255. }
  256. ::v-deep .uni-table {
  257. min-width: 0;
  258. }
  259. ::v-deep .uni-table-td {
  260. word-break: break-all;
  261. }
  262. }
  263. }
  264. }
  265. </style>