searchMuti.vue 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  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. <<<<<<< HEAD
  241. border-radius: 4rpx;
  242. box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.24);
  243. background-color: #e5e9ed;
  244. .toolbar-sao {
  245. font-size: 36rpx;
  246. color: #49b856;
  247. }
  248. =======
  249. border-radius: 10rpx;
  250. background-color: #8F939C;
  251. color: #fff;
  252. >>>>>>> 4d9d7bbc8b04c37d7024b340569a845c221b83d2
  253. }
  254. .search-box {
  255. width: 95%;
  256. background-color: rgb(242, 242, 242);
  257. padding: 15upx 2.5%;
  258. display: flex;
  259. justify-content: space-between;
  260. position: sticky;
  261. top: 0;
  262. }
  263. .search-box .mSearch-input-box {
  264. width: 100%;
  265. }
  266. .search-box .input-box {
  267. width: 85%;
  268. flex-shrink: 1;
  269. display: flex;
  270. justify-content: center;
  271. align-items: center;
  272. }
  273. .search-box .search-btn {
  274. width: 15%;
  275. margin: 0 0 0 2%;
  276. display: flex;
  277. justify-content: center;
  278. align-items: center;
  279. flex-shrink: 0;
  280. font-size: 28upx;
  281. color: #fff;
  282. background: linear-gradient(to right, #ff9801, #ff570a);
  283. border-radius: 60upx;
  284. }
  285. .search-box .input-box>input {
  286. width: 100%;
  287. height: 60upx;
  288. font-size: 32upx;
  289. border: 0;
  290. border-radius: 60upx;
  291. -webkit-appearance: none;
  292. -moz-appearance: none;
  293. appearance: none;
  294. padding: 0 3%;
  295. margin: 0;
  296. background-color: #ffffff;
  297. }
  298. .placeholder-class {
  299. color: #9e9e9e;
  300. }
  301. .search-keyword {
  302. width: 100%;
  303. background-color: rgb(242, 242, 242);
  304. }
  305. .keyword-list-box {
  306. height: calc(100vh - 230rpx);
  307. padding-top: 10upx;
  308. border-radius: 20upx 20upx 0 0;
  309. background-color: #fff;
  310. }
  311. .keyword-entry-tap {
  312. background-color: #eee;
  313. }
  314. .keyword-entry {
  315. width: 94%;
  316. height: 80rpx;
  317. margin: 0 3%;
  318. font-size: 30rpx;
  319. color: #333;
  320. display: flex;
  321. justify-content: center;
  322. align-items: center;
  323. border-bottom: solid 1rpx #DEDEDE;
  324. }
  325. .keyword-entry image {
  326. width: 60upx;
  327. height: 60upx;
  328. }
  329. .keyword-entry .keyword-text,
  330. .keyword-entry .keyword-img {
  331. height: 80upx;
  332. display: flex;
  333. align-items: center;
  334. }
  335. .keyword-entry .keyword-text {
  336. // width: 90%;
  337. }
  338. .keyword-entry .keyword-img {
  339. width: 10%;
  340. justify-content: center;
  341. }
  342. .keyword-box {
  343. height: calc(100vh - 110upx);
  344. border-radius: 20upx 20upx 0 0;
  345. background-color: #fff;
  346. }
  347. .keyword-box .keyword-block {
  348. padding: 10upx 0;
  349. }
  350. .keyword-box .keyword-block .keyword-list-header {
  351. width: 94%;
  352. padding: 10upx 3%;
  353. font-size: 27upx;
  354. color: #333;
  355. display: flex;
  356. justify-content: space-between;
  357. }
  358. .keyword-box .keyword-block .keyword-list-header image {
  359. width: 40upx;
  360. height: 40upx;
  361. }
  362. .keyword-box .keyword-block .keyword {
  363. width: 94%;
  364. padding: 3px 3%;
  365. display: flex;
  366. flex-flow: wrap;
  367. justify-content: flex-start;
  368. }
  369. .keyword-box .keyword-block .hide-hot-tis {
  370. display: flex;
  371. justify-content: center;
  372. font-size: 28upx;
  373. color: #6b6b6b;
  374. }
  375. .keyword-box .keyword-block .keyword>view {
  376. display: flex;
  377. justify-content: center;
  378. align-items: center;
  379. border-radius: 60upx;
  380. padding: 0 20upx;
  381. margin: 10upx 20upx 10upx 0;
  382. height: 60upx;
  383. font-size: 28upx;
  384. background-color: rgb(242, 242, 242);
  385. color: #6b6b6b;
  386. }
  387. </style>