changeSpeNum.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <template>
  2. <view class="changeSpeNum" v-show="disjunctor">
  3. <view class="changeSpeNum__wrap">
  4. <view class="changeSpeNum__header" v-if="title">
  5. {{ title }}
  6. </view>
  7. <view class="changeSpeNum__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. <uni-number-box v-model="speNum"></uni-number-box>
  14. </view>
  15. </view>
  16. <view class="uni-list-cell" v-if="speNum != num">
  17. <view class="uni-list-cell-left">
  18. 修改原因:
  19. </view>
  20. <view class="uni-list-cell-db-text">
  21. <textarea placeholder="请填写修改原因" v-model="reason" />
  22. </view>
  23. </view>
  24. <view class="uni-list-cell" v-if="speNum != num">
  25. <view class="uni-list-cell-left">
  26. 上传图片:
  27. </view>
  28. <view class="uni-list-cell-db">
  29. <uni-file-picker :auto-upload="false" :limit="3" title="最多选择3张图片" v-model="imageValue" fileMediatype="image" mode="grid"
  30. @select="selectFile" @delete="deleteFile"></uni-file-picker>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="changeSpeNum__footer">
  35. <view v-if="operate.ok" class="changeSpeNum__ok" @click="ok" hover-class="seimin-btn-hover">
  36. {{ operate.ok || "" }}
  37. </view>
  38. <view v-if="operate.cancel" class="changeSpeNum__cancel" @click="cancel" hover-class="seimin-btn-hover">
  39. {{ operate.cancel || "" }}
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import {
  47. post
  48. } from "../../http/http.js";
  49. export default {
  50. data() {
  51. return {
  52. imageValue: [], //图片列表
  53. speNum: 0, //修改后的数量
  54. reason: undefined, //修改原因
  55. loading: false,
  56. userData: null,
  57. hosId: null,
  58. timer: null,
  59. };
  60. },
  61. watch: {
  62. disjunctor(newValue) {
  63. if (newValue && this.operate.know == "知道了") {
  64. this.time = 5;
  65. this.timer = setInterval(() => {
  66. this.time--;
  67. if (this.time <= 0) {
  68. clearInterval(this.timer);
  69. this.know();
  70. }
  71. }, 1000);
  72. }
  73. },
  74. },
  75. props: {
  76. // 显示隐藏
  77. disjunctor: {
  78. type: Boolean,
  79. default: false,
  80. },
  81. // 标题
  82. title: {
  83. type: String,
  84. default: "提示",
  85. },
  86. // 操作按钮文字
  87. operate: {
  88. type: Object,
  89. default: () => {
  90. return {
  91. ok: "确认",
  92. cancel: "取消",
  93. };
  94. },
  95. },
  96. num: {
  97. type: Number,
  98. default: 0
  99. }
  100. },
  101. methods: {
  102. // 获取上传状态
  103. selectFile(e) {
  104. console.log('选择文件:', e)
  105. this.imageValue = this.imageValue.concat(e.tempFiles);
  106. },
  107. // 移除
  108. deleteFile(e) {
  109. console.log('移除:', e);
  110. this.imageValue = this.imageValue.filter(v=>v.uuid != e.tempFile.uuid);
  111. },
  112. // 确定
  113. ok() {
  114. this.$emit("ok", {
  115. speNum: this.speNum,
  116. reason: this.reason,
  117. imageValue: this.imageValue,
  118. });
  119. },
  120. // 取消
  121. cancel() {
  122. this.$emit("cancel");
  123. },
  124. },
  125. created() {
  126. this.speNum = this.num;
  127. this.hosId = uni.getStorageSync('userData').user.currentHospital.id;
  128. }
  129. };
  130. </script>
  131. <style lang="less" scoped>
  132. .changeSpeNum {
  133. position: fixed;
  134. left: 0;
  135. right: 0;
  136. top: 0;
  137. bottom: 0;
  138. background-color: rgba(0, 0, 0, 0.2);
  139. z-index: 999;
  140. .uni-list-cell {
  141. width: 94%;
  142. display: flex;
  143. flex-direction: row;
  144. justify-content: space-evenly;
  145. align-items: center;
  146. text-align: center;
  147. margin-top: 32rpx;
  148. .uni-list-cell-left {
  149. flex: 2;
  150. font-size: 32rpx;
  151. color: #666;
  152. }
  153. .uni-list-cell-db {
  154. padding: 16rpx 0;
  155. flex: 5;
  156. }
  157. .uni-list-cell-db-text {
  158. border: 1px solid #e5e9ed;
  159. background-color: #fff;
  160. flex: 5;
  161. text-align: left;
  162. textarea {
  163. width: 100%;
  164. box-sizing: border-box;
  165. padding: 0 8rpx;
  166. max-height: 150rpx;
  167. }
  168. }
  169. }
  170. .changeSpeNum__wrap {
  171. width: 90vw;
  172. position: absolute;
  173. left: 50%;
  174. top: 50%;
  175. transform: translate(-50%, -50%);
  176. background-color: #fff;
  177. border-radius: 12rpx;
  178. color: #666;
  179. .changeSpeNum__header {
  180. font-size: 36rpx;
  181. color: #000;
  182. height: 84rpx;
  183. display: flex;
  184. justify-content: center;
  185. align-items: center;
  186. }
  187. .changeSpeNum__article {
  188. width: 90%;
  189. margin: 0 auto 25rpx;
  190. padding: 48rpx 0;
  191. background-color: rgb(249, 250, 251);
  192. border: 2rpx solid rgb(229, 233, 237);
  193. border-radius: 12rpx;
  194. box-sizing: border-box;
  195. display: flex;
  196. flex-direction: column;
  197. justify-content: center;
  198. align-items: center;
  199. &.p0 {
  200. padding: 0;
  201. }
  202. .changeSpeNum__icon {
  203. font-size: 138rpx;
  204. margin-bottom: 32rpx;
  205. &.changeSpeNum__icon--success {
  206. color: rgb(52, 179, 73);
  207. }
  208. &.changeSpeNum__icon--warn {
  209. color: rgb(245, 165, 35);
  210. }
  211. &.changeSpeNum__icon--error {
  212. color: rgb(255, 58, 82);
  213. }
  214. }
  215. .changeSpeNum__content {
  216. font-size: 36rpx;
  217. }
  218. .changeSpeNum__info {
  219. font-size: 32rpx;
  220. color: rgb(102, 102, 102);
  221. }
  222. .specialCloseFlag {
  223. width: 90%;
  224. height: 100%;
  225. padding: 16rpx;
  226. }
  227. .radio-wrap {
  228. .radio-item {
  229. margin-top: 16rpx;
  230. /deep/ .uni-radio-input-checked {
  231. background-color: #49b856 !important;
  232. border-color: #49b856 !important;
  233. }
  234. }
  235. }
  236. }
  237. .changeSpeNum__footer {
  238. box-sizing: border-box;
  239. height: 100rpx;
  240. border-top: 2rpx solid rgb(229, 233, 237);
  241. display: flex;
  242. align-items: center;
  243. view {
  244. height: 100%;
  245. display: flex;
  246. align-items: center;
  247. justify-content: center;
  248. font-size: 36rpx;
  249. color: rgb(102, 102, 102);
  250. position: relative;
  251. &:nth-of-type(2)::before {
  252. content: "";
  253. position: absolute;
  254. left: 0;
  255. bottom: 0;
  256. width: 2rpx;
  257. height: 87rpx;
  258. background-color: rgb(229, 233, 237);
  259. }
  260. }
  261. .changeSpeNum__ok {
  262. flex: 1;
  263. color: rgb(73, 184, 86);
  264. }
  265. .changeSpeNum__cancel {
  266. flex: 1;
  267. }
  268. .changeSpeNum__know {
  269. flex: 1;
  270. color: rgb(73, 184, 86);
  271. }
  272. }
  273. }
  274. }
  275. </style>