backModel.vue 6.9 KB

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