medicalWasteSelect.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <template>
  2. <view class="Scanning_Result">
  3. <view class="Scanning_top">
  4. <view class="Scanning_top_icon">
  5. <view class="text1"> 医废类型选择 </view>
  6. </view>
  7. <view class="Scanning_top_text">
  8. 医废出库需要指定医废类型,请您选择以下医废类型
  9. </view>
  10. </view>
  11. <view class="Scanning_cont">
  12. <view class="Scanning_cont_list">
  13. <scroll-view scroll-y="true" class="Scanning_cont_list_scroll">
  14. <checkbox-group @change="checkboxChange">
  15. <label class="Scanning_cont_list_item" v-for="item in list" :key="item.id">
  16. <view>
  17. <checkbox :value="item.id" :checked="item.checked" />
  18. </view>
  19. <view>{{item.name}}({{item.wasteWeight}}kg)</view>
  20. </label>
  21. </checkbox-group>
  22. </scroll-view>
  23. </view>
  24. </view>
  25. <view class="foot_btn">
  26. <view class="btn" @click="goBack()"> 取消 </view>
  27. <view class="btn" @click="nextOk()"> 确定 </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import {
  33. get,
  34. post,
  35. SM,
  36. webHandle
  37. } from "../../../http/http.js";
  38. export default {
  39. data() {
  40. return {
  41. hosId: uni.getStorageSync('userData').user.currentHospital.id,
  42. queryObj: {}, //路由传递过来的数据
  43. list: [],
  44. };
  45. },
  46. methods: {
  47. nextOk(){
  48. let clinicalWasteTypeIds = this.list.filter(v => v.checked).map(v => v.id).toString();
  49. if(!clinicalWasteTypeIds){
  50. uni.showModal({
  51. title: "提示",
  52. content: "请选择医废类型!",
  53. showCancel: false,
  54. success: function(res) {
  55. if (res.confirm) {
  56. console.log("用户点击确定");
  57. } else if (res.cancel) {
  58. console.log("用户点击取消");
  59. }
  60. },
  61. });
  62. }else{
  63. uni.navigateTo({
  64. url: `/pages/medicalWaste/medicalWasteSignOut/medicalWasteSignOut?clinicalWasteTypeIds=${clinicalWasteTypeIds}`,
  65. });
  66. }
  67. },
  68. goBack(){
  69. uni.navigateBack();
  70. },
  71. checkboxChange: function (e) {
  72. var list = this.list,
  73. values = e.detail.value;
  74. for (var i = 0, lenI = list.length; i < lenI; ++i) {
  75. const item = list[i]
  76. if(values.includes(item.id)){
  77. this.$set(item,'checked',true)
  78. }else{
  79. this.$set(item,'checked',false)
  80. }
  81. }
  82. },
  83. getInfo(){
  84. uni.showLoading({
  85. title: "加载中",
  86. mask: true,
  87. });
  88. post("/medicalWaste/weight", {
  89. hosId: this.hosId
  90. }).then((result) => {
  91. uni.hideLoading();
  92. if (result.status == 200) {
  93. this.list = result.data || [];
  94. } else {
  95. uni.showToast({
  96. icon: "none",
  97. title: result.msg || "接口获取数据失败!",
  98. });
  99. }
  100. });
  101. },
  102. },
  103. onLoad(options) {
  104. console.log(options, "result");
  105. this.queryObj = options;
  106. this.getInfo();
  107. // #ifdef APP-PLUS
  108. webHandle("no", "app");
  109. // #endif
  110. // #ifdef H5
  111. webHandle("no", "wx");
  112. // #endif
  113. },
  114. };
  115. </script>
  116. <style lang="less" scoped>
  117. .Scanning_Result {
  118. height: 100vh;
  119. display: flex;
  120. flex-direction: column;
  121. background-color: #fff;
  122. /deep/ uni-checkbox .uni-checkbox-input{
  123. color: #35b34a!important;
  124. width: 30rpx!important;
  125. height: 30rpx!important;
  126. }
  127. .Scanning_top {
  128. flex-shrink: 0;
  129. .Scanning_top_icon {
  130. padding-top: 26rpx;
  131. display: flex;
  132. justify-content: center;
  133. align-items: center;
  134. .cubeic-ok {
  135. font-size: 58rpx;
  136. color: #35b34a;
  137. }
  138. .text1 {
  139. font-size: 40rpx;
  140. font-weight: bold;
  141. }
  142. }
  143. .Scanning_top_text{
  144. text-align: center;
  145. font-size: 30rpx;
  146. font-weight: bold;
  147. padding: 8rpx 0 23rpx 0;
  148. }
  149. }
  150. .Scanning_cont {
  151. flex: 1;
  152. min-height: 0;
  153. display: flex;
  154. flex-direction: column;
  155. margin: 0 45rpx;
  156. .Scanning_cont_head{
  157. flex-shrink: 0;
  158. height: 78rpx;
  159. display: flex;
  160. border-top: 1rpx solid #EEEEEE;
  161. border-bottom: 1rpx solid #EEEEEE;
  162. .Scanning_cont_head_item{
  163. flex: 1;
  164. font-size: 32rpx;
  165. font-weight: bold;
  166. display: flex;
  167. justify-content: center;
  168. align-items: center;
  169. position: relative;
  170. &.active{
  171. color: #49B856;
  172. &::before{
  173. content: '';
  174. width: 70rpx;
  175. height: 10rpx;
  176. background-color: #49B856;
  177. position: absolute;
  178. left: 50%;
  179. bottom: 0;
  180. transform: translateX(-50%);
  181. border-radius: 6rpx;
  182. }
  183. }
  184. &::after{
  185. content: '';
  186. width: 2rpx;
  187. height: 44rpx;
  188. background-color: #D1D1D1;
  189. position: absolute;
  190. right: 0;
  191. top: 50%;
  192. transform: translateY(-50%);
  193. }
  194. &:last-of-type::after{
  195. opacity: 0;
  196. }
  197. }
  198. }
  199. .Scanning_cont_list{
  200. flex: 1;
  201. min-height: 0;
  202. display: flex;
  203. flex-direction: column;
  204. .Scanning_cont_list_scroll{
  205. flex: 1;
  206. min-height: 0;
  207. border: 1rpx solid #E9E9E9;
  208. }
  209. .Scanning_cont_list_item{
  210. height: 100rpx;
  211. display: flex;
  212. justify-content: center;
  213. align-items: center;
  214. font-size: 30rpx;
  215. border-bottom: 2rpx solid #D3D3D3;
  216. border-top: none;
  217. background: #FBFCFE;
  218. &:last-of-type{
  219. border-bottom: 1rpx solid #E9E9E9;
  220. }
  221. &.Scanning_cont_list_head{
  222. font-weight: bold;
  223. font-size: 28rpx;
  224. border-top: 1rpx solid #272727;
  225. flex-shrink: 0;
  226. }
  227. .name,
  228. .value{
  229. padding: 0 45rpx;
  230. flex: 1;
  231. display: flex;
  232. justify-content: center;
  233. align-items: center;
  234. height: 100%;
  235. // border-right: 1rpx solid #272727;
  236. }
  237. .value {
  238. view{
  239. width: 4em;
  240. text-align: center;
  241. }
  242. }
  243. }
  244. }
  245. }
  246. .foot_btn {
  247. margin: 57rpx 20rpx 10rpx;
  248. flex-shrink: 0;
  249. display: flex;
  250. justify-content: center;
  251. .btn {
  252. height: 88rpx;
  253. line-height: 1;
  254. display: flex;
  255. justify-content: center;
  256. align-items: center;
  257. flex: 1;
  258. margin-right: 32rpx;
  259. background-image: linear-gradient(to right, #72c172, #3bb197);
  260. color: #fff;
  261. border-radius: 8rpx;
  262. font-size: 34rpx;
  263. font-weight: bold;
  264. &:last-of-type{
  265. margin-right: 0;
  266. }
  267. }
  268. }
  269. }
  270. </style>