inspectRemoveModel.vue 6.8 KB

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