searchMuti.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. <template>
  2. <view class="content">
  3. <view class="title">请选择楼栋</view>
  4. <view class="search-keyword">
  5. <scroll-view class="keyword-list-box" scroll-y>
  6. <!-- <checkbox-group @change="checkboxChange">
  7. <label v-for="(row, index) in dataList" :key="row.id">
  8. <view class="keyword-entry" hover-class="keyword-entry-tap">
  9. <view class="keyword-text">
  10. <checkbox color="#42b983" :value="row.id" :checked="row.checked" />
  11. <rich-text :nodes="row.buildingName"></rich-text>
  12. </view>
  13. <view class="keyword-img">
  14. <image src="/static/HM-search/back.png"></image>
  15. </view>
  16. </view>
  17. </label>
  18. </checkbox-group> -->
  19. <label v-for="(row, index) in dataList" :key="row.id" @click="itemClick(row)">
  20. <view class="keyword-entry" hover-class="keyword-entry-tap">
  21. <view class="keyword-text">
  22. {{row.buildingName}}
  23. </view>
  24. </view>
  25. </label>
  26. </scroll-view>
  27. </view>
  28. <view class="toolbar" @click="determine()" hover-class="seimin-btn-hover">
  29. 返回
  30. </view>
  31. <!-- 弹窗 -->
  32. <showModel :title="models.title" :icon="models.icon" :disjunctor="models.disjunctor" :content="models.content" @know="know" :operate="models.operate"></showModel>
  33. </view>
  34. </template>
  35. <script>
  36. import {
  37. post,
  38. webHandle
  39. } from "../../http/http.js";
  40. export default {
  41. data() {
  42. return {
  43. type: "", //进入该页面的类型
  44. configName: "", //快速组合名称
  45. id: "", //快速组合id
  46. changedept: 0, //是否从列表过来的切换负责科室
  47. hosId: "",
  48. dataList: [],
  49. //系统设置的科室类型
  50. sysDeptType: 0,
  51. quickCombinationDeptType: 0,
  52. // 弹窗model
  53. models: {
  54. disjunctor: false,
  55. },
  56. };
  57. },
  58. onLoad(options) {
  59. this.hosId = uni.getStorageSync("userData").user.currentHospital.id;
  60. console.log(options, 'options');
  61. this.type = options.type;
  62. if (this.type == "setBuilding") {
  63. this.configName = options.configName;
  64. this.id = options.id;
  65. this.changedept = options.changedept;
  66. options.quickCombinationId && this.getQuickCombinationDeptType(+options.quickCombinationId);
  67. } else {
  68. this.getSysDeptType();
  69. }
  70. // this.init();
  71. // #ifdef APP-PLUS
  72. webHandle("no", "app");
  73. // #endif
  74. // #ifdef H5
  75. webHandle("no", "wx");
  76. // #endif
  77. },
  78. methods: {
  79. //返回
  80. know() {
  81. this.models.disjunctor = false;
  82. },
  83. //获取系统设置的科室类型
  84. getQuickCombinationDeptType(quickCombinationId) {
  85. let postData = {
  86. "idx": 0,
  87. "sum": 1,
  88. workAllocationQuickConfig: {
  89. id: quickCombinationId
  90. }
  91. }
  92. post("/simple/data/fetchDataList/workAllocationQuickConfig", postData).then((res) => {
  93. if (res.status == 200) {
  94. let workAllocationQuickConfig = res.list[0] || {};
  95. // 科室绑定人员
  96. if(workAllocationQuickConfig.ruleType == 3){
  97. if(workAllocationQuickConfig.deptTypeList){
  98. this.quickCombinationDeptType = workAllocationQuickConfig.deptTypeList.map(v => v.id).toString();
  99. }else{
  100. // 没有获取到配置,则获取之前的
  101. this.getSysDeptType();
  102. }
  103. this.getBuildings();
  104. }else{
  105. this.getSysDeptType();
  106. }
  107. }
  108. })
  109. },
  110. // 确认
  111. determine() {
  112. uni.navigateBack({
  113. delta: 1,
  114. })
  115. },
  116. // 选择楼栋
  117. itemClick(item){
  118. console.log(3333,item)
  119. let postData = {
  120. "idx": 0,
  121. "sum": 9999,
  122. department: {
  123. buildIds: item.id,
  124. groupByFloor: true
  125. }
  126. }
  127. if(this.quickCombinationDeptType){
  128. postData.department.deptTypeIds = this.quickCombinationDeptType;
  129. } else if (this.sysDeptType === 0) {
  130. return;
  131. } else {
  132. postData.department.type = {
  133. id: this.sysDeptType
  134. }
  135. }
  136. uni.showLoading({
  137. title: "加载中",
  138. });
  139. post("/data/fetchDataList/department", postData).then((res) => {
  140. uni.hideLoading();
  141. if (res.status == 200) {
  142. console.log(2222,res.list)
  143. uni.setStorageSync("floorList", res.list)
  144. uni.navigateTo({
  145. url: `../searchFloor/searchFloor?name=${item.buildingName}&configName=${this.configName}&id=${this.id}&changedept=${this.changedept}`
  146. });
  147. } else {
  148. uni.showToast({
  149. icon: "none",
  150. title: res.msg || "接口获取数据失败!",
  151. });
  152. }
  153. })
  154. },
  155. // 选择楼栋
  156. checkboxChange: function(e) {
  157. var dataList = this.dataList,
  158. values = e.detail.value;
  159. for (var i = 0, lenI = dataList.length; i < lenI; ++i) {
  160. const item = dataList[i]
  161. if (values.includes(item.id)) {
  162. this.$set(item, 'checked', true)
  163. } else {
  164. this.$set(item, 'checked', false)
  165. }
  166. }
  167. },
  168. //获取系统设置的科室类型
  169. getSysDeptType() {
  170. uni.showLoading({
  171. title: "加载中",
  172. });
  173. let postData = {
  174. "idx": 0,
  175. "sum": 1,
  176. systemConfiguration: {
  177. keyconfig: "busiViewDeptId"
  178. }
  179. }
  180. post("/simple/data/fetchDataList/systemConfiguration", postData).then((res) => {
  181. this.getBuildings();
  182. if (res.status == 200) {
  183. this.sysDeptType = res.list[0].valueconfig
  184. } else {
  185. uni.showToast({
  186. icon: "none",
  187. title: res.msg || "接口获取数据失败!",
  188. });
  189. }
  190. })
  191. },
  192. //获取楼栋列表
  193. getBuildings() {
  194. let postData = {
  195. "idx": 0,
  196. "sum": 100,
  197. building: {
  198. cascadeHosId: this.hosId
  199. }
  200. }
  201. post("/simple/data/fetchDataList/building", postData).then((res) => {
  202. uni.hideLoading();
  203. if (res.status == 200) {
  204. this.dataList = res.list || [];
  205. } else {
  206. uni.showToast({
  207. icon: "none",
  208. title: res.msg || "接口获取数据失败!",
  209. });
  210. }
  211. })
  212. },
  213. },
  214. };
  215. </script>
  216. <style scoped lang="less">
  217. view {
  218. display: block;
  219. }
  220. .title{
  221. padding: 30rpx;
  222. font-size: 32rpx;
  223. text-align: center;
  224. font-weight: bold;
  225. }
  226. // 底部
  227. .toolbar {
  228. position: fixed;
  229. left: 0;
  230. right: 0;
  231. bottom: 30rpx;
  232. width: 96%;
  233. margin-left: 2%;
  234. z-index: 9999;
  235. height: 88rpx;
  236. display: flex;
  237. justify-content: center;
  238. align-items: center;
  239. box-sizing: border-box;
  240. border-radius: 10rpx;
  241. background-color: #8F939C;
  242. color: #fff;
  243. }
  244. .search-box {
  245. width: 95%;
  246. background-color: rgb(242, 242, 242);
  247. padding: 15upx 2.5%;
  248. display: flex;
  249. justify-content: space-between;
  250. position: sticky;
  251. top: 0;
  252. }
  253. .search-box .mSearch-input-box {
  254. width: 100%;
  255. }
  256. .search-box .input-box {
  257. width: 85%;
  258. flex-shrink: 1;
  259. display: flex;
  260. justify-content: center;
  261. align-items: center;
  262. }
  263. .search-box .search-btn {
  264. width: 15%;
  265. margin: 0 0 0 2%;
  266. display: flex;
  267. justify-content: center;
  268. align-items: center;
  269. flex-shrink: 0;
  270. font-size: 28upx;
  271. color: #fff;
  272. background: linear-gradient(to right, #ff9801, #ff570a);
  273. border-radius: 60upx;
  274. }
  275. .search-box .input-box>input {
  276. width: 100%;
  277. height: 60upx;
  278. font-size: 32upx;
  279. border: 0;
  280. border-radius: 60upx;
  281. -webkit-appearance: none;
  282. -moz-appearance: none;
  283. appearance: none;
  284. padding: 0 3%;
  285. margin: 0;
  286. background-color: #ffffff;
  287. }
  288. .placeholder-class {
  289. color: #9e9e9e;
  290. }
  291. .search-keyword {
  292. width: 100%;
  293. background-color: rgb(242, 242, 242);
  294. }
  295. .keyword-list-box {
  296. height: calc(100vh - 230rpx);
  297. padding-top: 10upx;
  298. border-radius: 20upx 20upx 0 0;
  299. background-color: #fff;
  300. }
  301. .keyword-entry-tap {
  302. background-color: #eee;
  303. }
  304. .keyword-entry {
  305. width: 94%;
  306. height: 80rpx;
  307. margin: 0 3%;
  308. font-size: 30rpx;
  309. color: #333;
  310. display: flex;
  311. justify-content: center;
  312. align-items: center;
  313. border-bottom: solid 1rpx #DEDEDE;
  314. }
  315. .keyword-entry image {
  316. width: 60upx;
  317. height: 60upx;
  318. }
  319. .keyword-entry .keyword-text,
  320. .keyword-entry .keyword-img {
  321. height: 80upx;
  322. display: flex;
  323. align-items: center;
  324. }
  325. .keyword-entry .keyword-text {
  326. // width: 90%;
  327. }
  328. .keyword-entry .keyword-img {
  329. width: 10%;
  330. justify-content: center;
  331. }
  332. .keyword-box {
  333. height: calc(100vh - 110upx);
  334. border-radius: 20upx 20upx 0 0;
  335. background-color: #fff;
  336. }
  337. .keyword-box .keyword-block {
  338. padding: 10upx 0;
  339. }
  340. .keyword-box .keyword-block .keyword-list-header {
  341. width: 94%;
  342. padding: 10upx 3%;
  343. font-size: 27upx;
  344. color: #333;
  345. display: flex;
  346. justify-content: space-between;
  347. }
  348. .keyword-box .keyword-block .keyword-list-header image {
  349. width: 40upx;
  350. height: 40upx;
  351. }
  352. .keyword-box .keyword-block .keyword {
  353. width: 94%;
  354. padding: 3px 3%;
  355. display: flex;
  356. flex-flow: wrap;
  357. justify-content: flex-start;
  358. }
  359. .keyword-box .keyword-block .hide-hot-tis {
  360. display: flex;
  361. justify-content: center;
  362. font-size: 28upx;
  363. color: #6b6b6b;
  364. }
  365. .keyword-box .keyword-block .keyword>view {
  366. display: flex;
  367. justify-content: center;
  368. align-items: center;
  369. border-radius: 60upx;
  370. padding: 0 20upx;
  371. margin: 10upx 20upx 10upx 0;
  372. height: 60upx;
  373. font-size: 28upx;
  374. background-color: rgb(242, 242, 242);
  375. color: #6b6b6b;
  376. }
  377. </style>