quickOrderAcceptanceWx.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. <template>
  2. <view class="formManagementWechat">
  3. <view class="page_tab">
  4. <view class="page_tab_bar active">
  5. <view class="tab_dept">快捷接单</view>
  6. </view>
  7. </view>
  8. <view v-if="zxzData.length == 0" class="zwsj">
  9. <image class="zwsj-img" mode="widthFix" src="../../static/img/zanwushuju.png"></image>
  10. <view class="zwsj-txt">暂无数据</view>
  11. </view>
  12. <view v-if="zxzData.length" class="page_items">
  13. <scroll-view class="page_items_scroll" scroll-y>
  14. <checkbox-group @change="checkboxChange">
  15. <label class="goWorkSelect-item relative" v-for="item in zxzData" :key="item.id">
  16. <checkbox :value="item.id" :checked="item.checked" />
  17. <view>{{ item.name }}</view>
  18. </label>
  19. </checkbox-group>
  20. </scroll-view>
  21. </view>
  22. <!-- 底部 -->
  23. <view class="foot_btn2 footerPadding">
  24. <view class="btn2" @click="confirm">确认接单</view>
  25. <view class="btn2" @click="goBack">返回</view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import {
  31. get,
  32. post,
  33. webHandle
  34. } from "../../http/http.js";
  35. export default {
  36. data() {
  37. return {
  38. hosId: uni.getStorageSync("userData").user.currentHospital.id,
  39. options: {},
  40. //列表数据
  41. zxzData: [],
  42. };
  43. },
  44. methods: {
  45. // 确认接单
  46. confirm(){
  47. let ids = this.zxzData.filter(v => v.checked).map(v => v.id).toString();
  48. if(!ids){
  49. uni.showToast({
  50. icon: "none",
  51. title: "请至少选择一项!",
  52. });
  53. return;
  54. }
  55. uni.showLoading({
  56. title: "加载中",
  57. mask: true,
  58. });
  59. post("/workerOrder/getReceiveOrderIds", {ids}).then((res) => {
  60. uni.hideLoading();
  61. if (res.status == 200) {
  62. uni.showModal({
  63. title: "提示",
  64. content: `您本次接单包括${res.names.join('、')},一共含有${res.data.length}个工单,是否确认接单?`,
  65. success: function(result) {
  66. if (result.confirm) {
  67. uni.showLoading({
  68. title: "加载中",
  69. mask: true,
  70. });
  71. post("/workerOrder/receiveOrders", {ids: res.data.toString()}).then((res) => {
  72. uni.hideLoading();
  73. if (res.status == 200) {
  74. uni.showToast({
  75. title: "操作成功",
  76. success() {
  77. uni.navigateTo({
  78. url: "../receiptpage/receiptpage",
  79. });
  80. },
  81. });
  82. } else {
  83. uni.showToast({
  84. icon: "none",
  85. title: "请求失败!",
  86. });
  87. }
  88. });
  89. } else if (result.cancel) {
  90. console.log("用户点击取消");
  91. }
  92. },
  93. });
  94. } else {
  95. uni.showToast({
  96. icon: "none",
  97. title: "请求失败!",
  98. });
  99. }
  100. });
  101. },
  102. // 选择多选框
  103. checkboxChange: function(e) {
  104. let items = this.zxzData,
  105. values = e.detail.value;
  106. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  107. const item = items[i]
  108. if (values.includes(item.id)) {
  109. this.$set(item, 'checked', true)
  110. } else {
  111. this.$set(item, 'checked', false)
  112. }
  113. }
  114. },
  115. // 返回
  116. goBack() {
  117. uni.navigateBack();
  118. },
  119. //获取快捷接单类型
  120. getReceiveRuleType() {
  121. let postData = {
  122. "type": "list",
  123. "key": "receiveRuleType"
  124. };
  125. uni.showLoading({
  126. title: "加载中",
  127. mask: true,
  128. });
  129. // 请求列表数据
  130. post("/common/common/getDictionary", postData).then((res) => {
  131. let type = res.find(v => v.value == 1);
  132. this.getList(type);
  133. });
  134. },
  135. //表单列表获取
  136. getList(type) {
  137. let postData = {
  138. "idx": 0,
  139. "sum": 9999,
  140. "receiveOrderRule": {
  141. "hosId": this.hosId,
  142. type,
  143. }
  144. };
  145. uni.showLoading({
  146. title: "加载中",
  147. mask: true,
  148. });
  149. // 请求列表数据
  150. post("/simple/data/fetchDataList/receiveOrderRule", postData).then((res) => {
  151. uni.hideLoading();
  152. if (res.status == 200) {
  153. res.list = res.list || [];
  154. this.zxzData = res.list.map(v => ({
  155. id: v.id,
  156. name: v.title,
  157. checked: false,
  158. }))
  159. } else {
  160. this.zxzData = [];
  161. uni.showToast({
  162. icon: "none",
  163. title: "请求失败!",
  164. });
  165. }
  166. });
  167. },
  168. // 阻止浏览器滑动
  169. stop(e) {
  170. e.preventDefault();
  171. },
  172. },
  173. onLoad(options) {
  174. console.log(options);
  175. this.options = options;
  176. this.getReceiveRuleType();
  177. // #ifdef APP-PLUS
  178. webHandle("no", "app");
  179. // #endif
  180. // #ifdef H5
  181. webHandle("no", "wx");
  182. // #endif
  183. },
  184. onShow() {
  185. // #ifdef H5
  186. document.body.addEventListener("touchmove", this.stop, {
  187. passive: false,
  188. });
  189. // #endif
  190. },
  191. onHide() {
  192. // #ifdef H5
  193. document.body.removeEventListener("touchmove", this.stop, {
  194. passive: false,
  195. });
  196. // #endif
  197. },
  198. };
  199. </script>
  200. <style lang="less" scoped>
  201. .formManagementWechat {
  202. width: 100%;
  203. height: 100%;
  204. position: relative;
  205. .foot_btn2 {
  206. position: fixed;
  207. bottom: 0;
  208. right: 20rpx;
  209. left: 20rpx;
  210. line-height: 66rpx;
  211. height: 100rpx;
  212. border-top: 2rpx solid #e5e9ed;
  213. background: #f9fafb;
  214. display: flex;
  215. justify-content: space-between;
  216. .btn2 {
  217. height: 66rpx;
  218. width: 100%;
  219. margin: 0 1%;
  220. background-image: linear-gradient(to right, #72c172, #3bb197);
  221. color: #fff;
  222. border-radius: 8rpx;
  223. font-size: 32rpx;
  224. margin-top: 16rpx;
  225. text-align: center;
  226. }
  227. .btn3 {
  228. height: 66rpx;
  229. width: 48%;
  230. margin: 0 1%;
  231. background-image: linear-gradient(to right, #72c172, #3bb197);
  232. color: #fff;
  233. border-radius: 8rpx;
  234. font-size: 32rpx;
  235. margin-top: 16rpx;
  236. text-align: center;
  237. }
  238. }
  239. .icon_transport {
  240. color: #49b856;
  241. font-size: 50rpx;
  242. &.colorRed {
  243. color: red;
  244. font-size: 40rpx;
  245. }
  246. }
  247. .page_tab {
  248. width: 100%;
  249. height: 96rpx;
  250. display: flex;
  251. position: fixed;
  252. left: 0;
  253. top: 0;
  254. z-index: 999;
  255. .page_tab_bar {
  256. flex: 1;
  257. font-size: 36rpx;
  258. background: #fff;
  259. display: flex;
  260. justify-content: center;
  261. align-items: center;
  262. position: relative;
  263. &:after {
  264. content: "";
  265. position: absolute;
  266. left: 0;
  267. bottom: 0;
  268. height: 2rpx;
  269. width: 100%;
  270. background-color: transparent;
  271. }
  272. .tab_dept {
  273. position: relative;
  274. .changeDept {
  275. white-space: nowrap;
  276. margin: 0;
  277. position: absolute;
  278. right: 0;
  279. top: 50%;
  280. transform: translate(105%, -50%);
  281. padding: 0 0.5em;
  282. line-height: 2;
  283. }
  284. }
  285. &.active {
  286. color: #49b856;
  287. &:after {
  288. background-color: #49b856;
  289. }
  290. }
  291. }
  292. }
  293. .zwsj {
  294. position: absolute;
  295. left: 50%;
  296. top: 180rpx;
  297. transform: translateX(-50%);
  298. .zwsj-img {
  299. width: 560rpx;
  300. }
  301. .zwsj-txt {
  302. font-size: 36rpx;
  303. font-weight: 700;
  304. margin-top: 20rpx;
  305. text-align: center;
  306. }
  307. }
  308. .page_items {
  309. height: calc(100vh - 284rpx);
  310. padding: 0 20rpx;
  311. padding-top: 96rpx;
  312. .page_items_scroll {
  313. height: 100%;
  314. .goWorkSelect-item {
  315. height: 52rpx;
  316. display: flex;
  317. align-items: center;
  318. border-bottom: 2rpx solid #e5e9ed;
  319. padding: 16rpx;
  320. &.relative {
  321. position: relative;
  322. .picker {
  323. position: absolute;
  324. width: 100%;
  325. padding-left: 64rpx;
  326. }
  327. }
  328. button {
  329. font-size: 32rpx;
  330. height: 52rpx;
  331. line-height: 52rpx;
  332. margin: 0;
  333. margin-left: 16rpx;
  334. color: rgb(7, 134, 60);
  335. font-weight: 700;
  336. }
  337. }
  338. }
  339. }
  340. }
  341. </style>