inspectExecDeptModel.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. <template>
  2. <view class="changeHospital" v-show="disjunctor">
  3. <view class="changeHospital__wrap">
  4. <view class="changeHospital__header" v-if="title">
  5. <text v-if="icon" class="changeHospital__icon newicon" :class="[
  6. 'changeHospital__icon--' + icon,
  7. { 'newicon-duigou': icon === 'success' },
  8. { 'newicon-shibai': icon === 'error' },
  9. { 'newicon-wenhao': icon === 'warn' },
  10. ]"></text>{{ title }}
  11. </view>
  12. <view class="changeHospital__article">
  13. <view v-if="content" class="changeHospital__content" v-html="content"></view>
  14. <view class="uni-list-cell">
  15. <view class="uni-list-cell-left">
  16. 检查科室:
  17. </view>
  18. <view class="uni-list-cell-db-text">
  19. <picker style="height: 100%;" @change="bindPickerChange" :value="index" :range="execDeptList" range-key="dept">
  20. <view class="uni-input ellipsis-oneline" :style="{ color: execDeptList[index] ? '' : '#CFCFCF'}">{{execDeptList[index]?execDeptList[index].dept:'请选择检查科室'}}</view>
  21. </picker>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="changeHospital__footer">
  26. <view v-if="operate.ok" class="changeHospital__ok" @click="ok" hover-class="seimin-btn-hover">
  27. {{ operate.ok || "" }}
  28. </view>
  29. <view v-if="operate.cancel" class="changeHospital__cancel" @click="cancel"
  30. hover-class="seimin-btn-hover">
  31. {{ operate.cancel || "" }}
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import {
  39. post
  40. } from "../../http/http.js";
  41. export default {
  42. data() {
  43. return {
  44. userData: null,
  45. hosId: null,
  46. timer: null,
  47. index: -1,
  48. };
  49. },
  50. watch: {
  51. disjunctor(newValue) {
  52. console.log(newValue)
  53. if(newValue){
  54. this.index = this.execDeptList.findIndex(v => v.id == this.execDeptId)
  55. }
  56. if (newValue && this.operate.know == "返回") {
  57. this.time = 5;
  58. this.timer = setInterval(() => {
  59. this.time--;
  60. if (this.time <= 0) {
  61. clearInterval(this.timer);
  62. this.know();
  63. }
  64. }, 1000);
  65. }
  66. },
  67. },
  68. props: {
  69. // 显示隐藏
  70. disjunctor: {
  71. type: Boolean,
  72. default: false,
  73. },
  74. // 检查科室列表
  75. execDeptList: {
  76. type: Array,
  77. default: () => [],
  78. },
  79. // 检查科室
  80. execDeptId: {
  81. type: Number,
  82. },
  83. // 标题
  84. title: {
  85. type: String,
  86. default: "提示",
  87. },
  88. // 图标
  89. icon: {
  90. type: String,
  91. default: "success",
  92. },
  93. // 内容
  94. content: {
  95. type: String,
  96. default: "",
  97. },
  98. // 操作按钮文字
  99. operate: {
  100. type: Object,
  101. default: () => {
  102. return {
  103. ok: "确认",
  104. cancel: "取消",
  105. };
  106. },
  107. },
  108. name: {
  109. type: String,
  110. default: '交接人'
  111. }
  112. },
  113. methods: {
  114. bindPickerChange: function(e) {
  115. this.index = e.detail.value
  116. },
  117. // 确定
  118. ok() {
  119. if (this.index < 0) {
  120. uni.showToast({
  121. icon: 'none',
  122. title: '请选择检查科室!'
  123. })
  124. return;
  125. }
  126. let e = {};
  127. if (this.index > -1) {
  128. e.execDeptId = this.execDeptList[this.index].id;
  129. }
  130. this.$emit("ok", e);
  131. },
  132. // 取消
  133. cancel() {
  134. this.$emit("cancel");
  135. },
  136. },
  137. created() {
  138. this.hosId = uni.getStorageSync('userData').user.currentHospital.id;
  139. }
  140. };
  141. </script>
  142. <style lang="less" scoped>
  143. .changeHospital__icon {
  144. font-size: 40rpx;
  145. margin-right: 8rpx;
  146. &.changeHospital__icon--success {
  147. color: rgb(52, 179, 73);
  148. }
  149. &.changeHospital__icon--warn {
  150. color: rgb(245, 165, 35);
  151. }
  152. &.changeHospital__icon--error {
  153. color: rgb(255, 58, 82);
  154. }
  155. }
  156. .changeHospital {
  157. position: fixed;
  158. left: 0;
  159. right: 0;
  160. top: 0;
  161. bottom: 0;
  162. background-color: rgba(0, 0, 0, 0.2);
  163. z-index: 999;
  164. .uni-list-cell {
  165. width: 95%;
  166. display: flex;
  167. flex-direction: row;
  168. // justify-content: space-evenly;
  169. align-items: center;
  170. text-align: center;
  171. margin-top: 32rpx;
  172. .uni-list-cell-left {
  173. font-size: 32rpx;
  174. color: #666;
  175. flex-shrink: 0;
  176. }
  177. .uni-list-cell-db {
  178. border: 1px solid #e5e9ed;
  179. background-color: #fff;
  180. padding: 16rpx 0;
  181. flex: 5;
  182. }
  183. .uni-list-cell-db-text {
  184. flex: 1;
  185. text-align: left;
  186. border: 1px solid #DBDBDB;
  187. padding: 0 8rpx;
  188. height: 56rpx;
  189. line-height: 56rpx;
  190. border-radius: 4rpx;
  191. }
  192. }
  193. .changeHospital__wrap {
  194. width: 90vw;
  195. position: absolute;
  196. left: 50%;
  197. top: 50%;
  198. transform: translate(-50%, -50%);
  199. background-color: #fff;
  200. border-radius: 12rpx;
  201. color: #666;
  202. .changeHospital__header {
  203. font-size: 36rpx;
  204. color: #000;
  205. height: 84rpx;
  206. display: flex;
  207. justify-content: center;
  208. align-items: center;
  209. }
  210. .changeHospital__article {
  211. width: 90%;
  212. margin: 0 auto 25rpx;
  213. padding: 48rpx 0;
  214. background-color: rgb(249, 250, 251);
  215. border: 2rpx solid rgb(229, 233, 237);
  216. border-radius: 12rpx;
  217. box-sizing: border-box;
  218. display: flex;
  219. flex-direction: column;
  220. justify-content: center;
  221. align-items: center;
  222. &.p0 {
  223. padding: 0;
  224. }
  225. .changeHospital__content {
  226. font-size: 32rpx;
  227. }
  228. .changeHospital__info {
  229. font-size: 32rpx;
  230. color: rgb(102, 102, 102);
  231. }
  232. .specialCloseFlag {
  233. width: 90%;
  234. height: 100%;
  235. padding: 16rpx;
  236. }
  237. .radio-wrap {
  238. .radio-item {
  239. margin-top: 16rpx;
  240. /deep/ .uni-radio-input-checked {
  241. background-color: #49b856 !important;
  242. border-color: #49b856 !important;
  243. }
  244. }
  245. }
  246. }
  247. .changeHospital__footer {
  248. box-sizing: border-box;
  249. height: 100rpx;
  250. border-top: 2rpx solid rgb(229, 233, 237);
  251. display: flex;
  252. align-items: center;
  253. view {
  254. height: 100%;
  255. display: flex;
  256. align-items: center;
  257. justify-content: center;
  258. font-size: 36rpx;
  259. color: rgb(102, 102, 102);
  260. position: relative;
  261. &:nth-of-type(2)::before {
  262. content: "";
  263. position: absolute;
  264. left: 0;
  265. bottom: 0;
  266. width: 2rpx;
  267. height: 87rpx;
  268. background-color: rgb(229, 233, 237);
  269. }
  270. }
  271. .changeHospital__ok {
  272. flex: 1;
  273. color: rgb(73, 184, 86);
  274. }
  275. .changeHospital__cancel {
  276. flex: 1;
  277. }
  278. .changeHospital__know {
  279. flex: 1;
  280. color: rgb(73, 184, 86);
  281. }
  282. }
  283. }
  284. }
  285. </style>