sendBackOrder.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <template>
  2. <view class="Scanning_Result">
  3. <view class="Scanning_top">
  4. 工单总数量:<text class="green">{{orderList.length}}</text>
  5. </view>
  6. <view class="Scanning_cont">
  7. <scroll-view scroll-y class="scrollContent">
  8. <checkbox-group @change="checkboxChange">
  9. <view class="column" v-for="(item, index) in orderList" :key="item.id">
  10. <view class="top">
  11. <text class="">
  12. <checkbox :value="item.id" :checked="item.checked"/>
  13. <text class="orders green">{{index + 1}}</text>
  14. <text class="gdcode">{{item.gdcode}}</text>
  15. </text>
  16. <text class="taskName">{{item.taskType.taskName}}</text>
  17. </view>
  18. <view class="bottom">
  19. <view class="name">备注:</view>
  20. <view class="value">{{item.workOrderRemark}}</view>
  21. </view>
  22. <view class="bottom">
  23. <view class="name">{{item.patient.patientName}}({{item.patient.residenceNo}})</view>
  24. </view>
  25. </view>
  26. </checkbox-group>
  27. </scroll-view>
  28. </view>
  29. <view class="foot_btn_spe">
  30. <view class="column">
  31. <view class="btn" @click="goBack()">取消</view>
  32. <view class="btn" @click="orderSignAll()" v-if="orderList.length">一键签到</view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import {
  39. get,
  40. post,
  41. SM,
  42. webHandle
  43. } from "@/http/http.js";
  44. export default {
  45. data() {
  46. return {
  47. hosId: uni.getStorageSync("userData").user.currentHospital.id,
  48. orderList: [],//工单列表
  49. queryObj: {}, //路由传递过来的数据
  50. };
  51. },
  52. methods: {
  53. checkboxChange (e) {
  54. var items = this.orderList,
  55. values = e.detail.value;
  56. for (var i = 0, lenI = items.length; i < lenI; ++i) {
  57. const item = items[i]
  58. if(values.includes(item.id)){
  59. this.$set(item,'checked',true)
  60. }else{
  61. this.$set(item,'checked',false)
  62. }
  63. }
  64. console.log(8888,this.orderList)
  65. },
  66. goBack(){
  67. uni.navigateBack();
  68. },
  69. // 一键签到
  70. orderSignAll(){
  71. let isList = this.orderList.filter(i=>i.checked)
  72. if(isList.length==0){
  73. uni.showToast({
  74. icon: 'error',
  75. title: '请勾选工单',
  76. duration: 2000,
  77. });
  78. return
  79. }
  80. uni.showModal({
  81. title: "提示",
  82. content: "您确定一键签到吗?",
  83. success: (res) => {
  84. if (res.confirm) {
  85. console.log("用户点击确定");
  86. uni.showLoading({
  87. mask: true,
  88. title: '加载中'
  89. })
  90. let postData = {
  91. "deptCode": this.queryObj.code,
  92. "ids": isList.map(v => v.id),
  93. };
  94. console.log(isList);
  95. post("/workerOrder/handleInsAndTrans", postData).then((res) => {
  96. console.log(res)
  97. uni.hideLoading();
  98. if (res.status == 200) {
  99. uni.showToast({
  100. icon: 'success',
  101. title: '工单签到成功',
  102. duration: 2000,
  103. mask: true,
  104. });
  105. setTimeout(() => {
  106. uni.navigateTo({
  107. url: `/pages/receiptpage/receiptpage`,
  108. });
  109. }, 2000)
  110. } else {
  111. uni.showToast({
  112. icon: "none",
  113. title: res.msg || "接口获取数据失败!",
  114. });
  115. }
  116. })
  117. } else if (res.cancel) {
  118. console.log("用户点击取消");
  119. }
  120. },
  121. });
  122. },
  123. // 获取工单列表
  124. getOrderList(){
  125. uni.showLoading({
  126. mask: true,
  127. title: '加载中'
  128. })
  129. let postData = {
  130. "deptId": +this.queryObj.deptId,
  131. };
  132. post("/workerOrder/patientIntelligentScan", postData).then((res) => {
  133. console.log(res)
  134. uni.hideLoading();
  135. if (res.status == 200) {
  136. for(let i of res.data){
  137. i.checked = true
  138. }
  139. this.orderList = res.data || [];
  140. } else {
  141. uni.showToast({
  142. icon: "none",
  143. title: res.msg || "接口获取数据失败!",
  144. });
  145. }
  146. })
  147. }
  148. },
  149. onLoad(options) {
  150. console.log(options, "options");
  151. this.queryObj = options;
  152. this.getOrderList();
  153. // #ifdef APP-PLUS
  154. webHandle("no", "app");
  155. // #endif
  156. // #ifdef H5
  157. webHandle("no", "wx");
  158. // #endif
  159. },
  160. };
  161. </script>
  162. <style lang="less" scoped>
  163. .green{
  164. color:#49b856;
  165. }
  166. .Scanning_Result {
  167. background: #EBEBEB;
  168. display: flex;
  169. flex-direction: column;
  170. height: 100vh;
  171. .Scanning_top {
  172. display: flex;
  173. justify-content: center;
  174. align-items: center;
  175. height: 63rpx;
  176. font-size: 28rpx;
  177. font-weight: bold;
  178. background-color: #fff;
  179. margin-top: 16rpx;
  180. }
  181. .Scanning_cont {
  182. flex: 1;
  183. min-height: 0;
  184. display: flex;
  185. flex-direction: column;
  186. .scrollContent{
  187. flex: 1;
  188. min-height: 0;
  189. }
  190. .column{
  191. padding: 24rpx;
  192. font-size: 26rpx;
  193. margin-top: 16rpx;
  194. background-color: #fff;
  195. .top,.bottom{
  196. display: flex;
  197. align-items: center;
  198. .name{
  199. flex-shrink: 0;
  200. }
  201. .value{
  202. word-break: break-all;
  203. }
  204. }
  205. .top{
  206. /deep/ .uni-checkbox-input.uni-checkbox-input-checked{
  207. color: #fff !important;
  208. background: #49b856 !important;
  209. border-color: #49b856 !important;
  210. }
  211. .orders{
  212. font-size: 28rpx;
  213. font-weight: bold;
  214. margin-right: 24rpx;
  215. }
  216. .gdcode{
  217. font-weight: bold;
  218. }
  219. .taskName{
  220. flex: 1;
  221. text-align: right;
  222. }
  223. }
  224. .bottom{
  225. margin-top: 16rpx;
  226. }
  227. }
  228. }
  229. .foot_btn_spe {
  230. padding: 24rpx;
  231. display: flex;
  232. flex-direction: column;
  233. align-items: center;
  234. gap: 24rpx;
  235. font-weight: bold;
  236. .column{
  237. width: 100%;
  238. height: 78rpx;
  239. display: flex;
  240. align-items: center;
  241. justify-content: space-between;
  242. gap: 24rpx;
  243. .btn {
  244. height: 100%;
  245. flex: 1;
  246. background: linear-gradient( 90deg, #6FC073 0%, #3DB197 100%);
  247. color: #fff;
  248. border-radius: 4rpx;
  249. font-size: 30rpx;
  250. display: flex;
  251. justify-content: center;
  252. align-items: center;
  253. }
  254. }
  255. }
  256. }
  257. </style>