formManagementBuilding.vue 11 KB

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