specimenList.vue 7.9 KB

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