formManagementDept.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  1. <template>
  2. <view class="formManagementWechat">
  3. <view class="page_tab">
  4. <view class="page_tab_bar active">
  5. <view class="tab_dept">科室信息</view>
  6. </view>
  7. </view>
  8. <view v-if="zxzData.length == 0" class="zwsj">
  9. <image class="zwsj-img" mode="widthFix" src="../../static/img/zanwushuju.png"></image>
  10. <view class="zwsj-txt">暂无数据</view>
  11. </view>
  12. <view v-if="zxzData.length" class="page_items">
  13. <scroll-view class="page_items_scroll" scroll-y>
  14. <view class="page_item_wrap" v-for="(item, index) of zxzData" :key="index">
  15. <view class="page_item">
  16. <view class="L"></view>
  17. <view class="R"></view>
  18. <view class="page_item_top">
  19. <view class="page_item_top_L">
  20. {{item.name || '无'}}
  21. </view>
  22. <view class="send_wrap"></view>
  23. </view>
  24. <view class="page_item_cont">
  25. <view class="page_item_conts">
  26. <view v-for="(order, i) of item.orders" :key="i">
  27. {{order[11].slice(-4)}}-{{order[7]}} {{order[8]}}
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="L-l"></view>
  33. <view class="R-l"></view>
  34. </view>
  35. </scroll-view>
  36. </view>
  37. <!-- 底部 -->
  38. <view class="foot_btn2 footerPadding">
  39. <view class="btn2" @click="goBack">返回</view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. import {
  45. get,
  46. post,
  47. webHandle
  48. } from "../../http/http.js";
  49. export default {
  50. data() {
  51. return {
  52. hosId: uni.getStorageSync("userData").user.currentHospital.id,
  53. options: {},
  54. //列表数据
  55. zxzData: [],
  56. };
  57. },
  58. methods: {
  59. // 返回
  60. goBack() {
  61. uni.navigateBack();
  62. },
  63. // 进入详情页
  64. itemInfo(id) {
  65. // #ifdef H5
  66. document.body.removeEventListener("touchmove", this.stop, {
  67. passive: false,
  68. });
  69. // #endif
  70. uni.navigateTo({
  71. url: `../formManagementDept/formManagementDept?id=${this.options.id}`,
  72. });
  73. },
  74. //表单列表获取
  75. getList() {
  76. let data = {
  77. reserveFormId: this.options.id,
  78. };
  79. uni.showLoading({
  80. title: "加载中",
  81. mask: true,
  82. });
  83. // 请求列表数据
  84. post("/nurse/reserveView", data).then((res) => {
  85. uni.hideLoading();
  86. if (res.state == 200) {
  87. const data = res.data || {};
  88. if(Object.keys(data).length > 0){
  89. // 楼栋-楼层-科室-工单 转成前端可用的 楼栋-科室-工单
  90. let buildings = Object.keys(data)
  91. .map(v => ({
  92. id: v,
  93. name: Object.values(Object.values(data[v])[0])[0][0][3],
  94. departments: (
  95. Object.values(data[v]).map(vv => Object.keys(vv).map(vvv => ({id: vvv, name: vv[vvv][0][6], orders: vv[vvv], checked: false, isDisabled: vv[vvv].every(vvvv => !(vvvv[12] == 2 || (!vvvv[8] && vvvv[12] != 2)))})))
  96. ).flat()
  97. }));
  98. console.log(buildings)
  99. this.zxzData = buildings.find(v => v.id == this.options.buildingId).departments;
  100. }else{
  101. this.zxzData = [];
  102. }
  103. } else {
  104. this.zxzData = [];
  105. uni.showToast({
  106. icon: "none",
  107. title: "请求失败!",
  108. });
  109. }
  110. });
  111. },
  112. // 阻止浏览器滑动
  113. stop(e) {
  114. e.preventDefault();
  115. },
  116. },
  117. onLoad(options) {
  118. console.log(options);
  119. this.options = options;
  120. this.getList();
  121. // #ifdef APP-PLUS
  122. webHandle("no", "app");
  123. // #endif
  124. // #ifdef H5
  125. webHandle("no", "wx");
  126. // #endif
  127. },
  128. onShow() {
  129. // #ifdef H5
  130. document.body.addEventListener("touchmove", this.stop, {
  131. passive: false,
  132. });
  133. // #endif
  134. },
  135. onHide() {
  136. // #ifdef H5
  137. document.body.removeEventListener("touchmove", this.stop, {
  138. passive: false,
  139. });
  140. // #endif
  141. },
  142. };
  143. </script>
  144. <style lang="less" scoped>
  145. .formManagementWechat {
  146. width: 100%;
  147. height: 100%;
  148. position: relative;
  149. .foot_btn2 {
  150. position: fixed;
  151. bottom: 0;
  152. right: 20rpx;
  153. left: 20rpx;
  154. line-height: 66rpx;
  155. height: 100rpx;
  156. border-top: 2rpx solid #e5e9ed;
  157. background: #f9fafb;
  158. display: flex;
  159. justify-content: space-between;
  160. .btn2 {
  161. height: 66rpx;
  162. width: 100%;
  163. margin: 0 1%;
  164. background-image: linear-gradient(to right, #72c172, #3bb197);
  165. color: #fff;
  166. border-radius: 8rpx;
  167. font-size: 32rpx;
  168. margin-top: 16rpx;
  169. text-align: center;
  170. }
  171. .btn3 {
  172. height: 66rpx;
  173. width: 48%;
  174. margin: 0 1%;
  175. background-image: linear-gradient(to right, #72c172, #3bb197);
  176. color: #fff;
  177. border-radius: 8rpx;
  178. font-size: 32rpx;
  179. margin-top: 16rpx;
  180. text-align: center;
  181. }
  182. }
  183. .icon_transport {
  184. color: #49b856;
  185. font-size: 50rpx;
  186. &.colorRed {
  187. color: red;
  188. font-size: 40rpx;
  189. }
  190. }
  191. .page_tab {
  192. width: 100%;
  193. height: 96rpx;
  194. display: flex;
  195. position: fixed;
  196. left: 0;
  197. top: 0;
  198. z-index: 999;
  199. .page_tab_bar {
  200. flex: 1;
  201. font-size: 36rpx;
  202. background: #fff;
  203. display: flex;
  204. justify-content: center;
  205. align-items: center;
  206. position: relative;
  207. &:after {
  208. content: "";
  209. position: absolute;
  210. left: 0;
  211. bottom: 0;
  212. height: 2rpx;
  213. width: 100%;
  214. background-color: transparent;
  215. }
  216. .tab_dept {
  217. position: relative;
  218. .changeDept {
  219. white-space: nowrap;
  220. margin: 0;
  221. position: absolute;
  222. right: 0;
  223. top: 50%;
  224. transform: translate(105%, -50%);
  225. padding: 0 0.5em;
  226. line-height: 2;
  227. }
  228. }
  229. &.active {
  230. color: #49b856;
  231. &:after {
  232. background-color: #49b856;
  233. }
  234. }
  235. }
  236. }
  237. .zwsj {
  238. position: absolute;
  239. left: 50%;
  240. top: 180rpx;
  241. transform: translateX(-50%);
  242. .zwsj-img {
  243. width: 560rpx;
  244. }
  245. .zwsj-txt {
  246. font-size: 36rpx;
  247. font-weight: 700;
  248. margin-top: 20rpx;
  249. text-align: center;
  250. }
  251. }
  252. .page_items {
  253. height: calc(100vh - 284rpx);
  254. padding: 0 20rpx;
  255. padding-top: 96rpx;
  256. .page_items_scroll {
  257. height: 100%;
  258. .page_item_wrap {
  259. position: relative;
  260. margin-bottom: 32rpx;
  261. .page_item {
  262. margin-bottom: 16rpx;
  263. background: #fff;
  264. border-radius: 8rpx;
  265. overflow: hidden;
  266. border: 2rpx solid #e5e9ed;
  267. display: flex;
  268. flex-direction: column;
  269. justify-content: space-between;
  270. .L {
  271. width: 40rpx;
  272. height: 40rpx;
  273. border-radius: 50%;
  274. background: #f9fafb;
  275. position: absolute;
  276. left: -24rpx;
  277. top: 68rpx;
  278. border: 2rpx solid #e5e9ed;
  279. }
  280. .R {
  281. width: 40rpx;
  282. height: 40rpx;
  283. border-radius: 50%;
  284. background: #f9fafb;
  285. position: absolute;
  286. float: right;
  287. right: -24rpx;
  288. top: 68rpx;
  289. border: 2rpx solid #e5e9ed;
  290. }
  291. .page_item_top {
  292. height: 86rpx;
  293. border-bottom: 2rpx dashed #e5e9ed;
  294. padding: 0 16rpx;
  295. display: flex;
  296. align-items: center;
  297. justify-content: space-between;
  298. .send_wrap {
  299. display: flex;
  300. justify-content: space-between;
  301. align-items: center;
  302. }
  303. .sendBack {
  304. button {
  305. font-size: 28rpx;
  306. height: 52rpx;
  307. line-height: 52rpx;
  308. margin: 0;
  309. color: rgb(7, 134, 60);
  310. }
  311. }
  312. .page_item_top_L {
  313. height: 100%;
  314. float: left;
  315. display: flex;
  316. align-items: center;
  317. line-height: 88rpx;
  318. .L_time {
  319. color: #6cc076;
  320. font-size: 32rpx;
  321. }
  322. }
  323. .page_item_top_R {
  324. height: 40rpx;
  325. float: right;
  326. line-height: 40rpx;
  327. font-size: 24rpx;
  328. padding: 0 8rpx;
  329. background-color: red;
  330. color: #fff;
  331. }
  332. }
  333. .page_item_cont {
  334. min-height: 100rpx;
  335. max-height: 344rpx;
  336. padding: 0 16rpx;
  337. text-align: left;
  338. position: relative;
  339. .page_item_conts {
  340. color: rgb(102, 102, 102);
  341. font-size: 28rpx;
  342. min-height: 100rpx;
  343. max-height: 344rpx;
  344. view {
  345. margin-top: 10rpx;
  346. margin-bottom: 10rpx;
  347. &:first-of-type {
  348. margin-left: 0;
  349. }
  350. }
  351. text {
  352. color: #49b856;
  353. }
  354. .num {
  355. float: right;
  356. }
  357. }
  358. }
  359. .page_item_btn {
  360. height: 88rpx;
  361. background-image: linear-gradient(to right, #72c172, #3bb197);
  362. border-radius: 8rpx;
  363. line-height: 88rpx;
  364. color: #fff;
  365. font-size: 36rpx;
  366. font-weight: 700;
  367. text-align: center;
  368. }
  369. }
  370. .L-l {
  371. width: 2rpx;
  372. height: 40rpx;
  373. background: #f9fafb;
  374. position: absolute;
  375. left: 20rpx;
  376. top: 72rpx;
  377. display: none;
  378. }
  379. .R-l {
  380. width: 2rpx;
  381. height: 40rpx;
  382. background: #f9fafb;
  383. position: absolute;
  384. right: 20rpx;
  385. top: 72rpx;
  386. display: none;
  387. }
  388. }
  389. }
  390. }
  391. }
  392. </style>