outpatientEndTaskType.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. <template>
  2. <view class="Scanning_Result">
  3. <view class="Scanning_top">
  4. <view class="Scanning_top_icon">
  5. <image mode="widthFix" class="icon_service" src="../../../static/img/icon_service.png"></image>
  6. <view class="text1"> 追加服务 </view>
  7. </view>
  8. <view class="Scanning_top_text">
  9. 您已完成<strong class="red">{{taskNames}}</strong>,请继续完成以下追加服务
  10. </view>
  11. </view>
  12. <view class="Scanning_cont">
  13. <view class="Scanning_cont_list">
  14. <scroll-view scroll-y="true" class="Scanning_cont_list_scroll">
  15. <checkbox-group @change="checkboxChange">
  16. <label class="Scanning_cont_list_item" v-for="item in addServiceTasks" :key="item.id">
  17. <view class="name">
  18. {{item.taskName}}
  19. </view>
  20. <view class="value">
  21. <checkbox :value="item.id" :checked="item.checked" />
  22. </view>
  23. </label>
  24. </checkbox-group>
  25. </scroll-view>
  26. </view>
  27. </view>
  28. <view class="foot_btn">
  29. <view class="btn" @click="ok()" v-if="addServiceTasksComputed.length"> 确认追加 </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import {
  35. get,
  36. post,
  37. SM,
  38. webHandle
  39. } from "../../../http/http.js";
  40. export default {
  41. data() {
  42. return {
  43. taskNames: '',
  44. infoData: {},
  45. hosId: uni.getStorageSync('userData').user.currentHospital.id,
  46. queryObj: {}, //路由传递过来的数据
  47. orderList: [],
  48. taskTypeConfig: {},
  49. addServiceTasks: [],
  50. };
  51. },
  52. computed: {
  53. addServiceTasksComputed(){
  54. return this.addServiceTasks.filter(v => v.checked);
  55. }
  56. },
  57. methods: {
  58. // 追加服务
  59. ok(){
  60. console.log(this.addServiceTasks);
  61. uni.showLoading({
  62. title: "加载中",
  63. mask: true,
  64. });
  65. let postData = {workOrders: []};
  66. this.addServiceTasks.filter(v => v.checked).forEach(v => {
  67. postData.workOrders.push({
  68. "sourceId": 4,
  69. "taskType": {
  70. "id": v.id
  71. },
  72. "patient": {
  73. "patientCode": this.infoData.patientCode
  74. },
  75. "isRemand": 0,
  76. "isAccompany": 0
  77. });
  78. })
  79. post("/api/startOrder", postData).then((result) => {
  80. uni.hideLoading();
  81. if (result.status == 200) {
  82. uni.navigateTo({
  83. url: `/pages/outpatient/outpatientEndTaskTypeSuccess/outpatientEndTaskTypeSuccess?model=${encodeURIComponent(JSON.stringify(result))}`,
  84. });
  85. } else {
  86. uni.showToast({
  87. icon: "none",
  88. title: result.msg || "接口获取数据失败!",
  89. });
  90. }
  91. });
  92. },
  93. checkboxChange: function (e) {
  94. let items = this.addServiceTasks,
  95. values = e.detail.value;
  96. for (var i = 0, lenI = items.length; i < lenI; ++i) {
  97. const item = items[i]
  98. if(values.includes(item.id)){
  99. this.$set(item,'checked',true)
  100. }else{
  101. this.$set(item,'checked',false)
  102. }
  103. }
  104. console.log(e, this.addServiceTasks);
  105. },
  106. // 获取检查页面控制
  107. getTaskTypeConfig(){
  108. uni.showLoading({
  109. title: "加载中",
  110. mask: true,
  111. });
  112. post("/simple/data/fetchDataList/taskTypeConfig", {
  113. "idx": 0,
  114. "sum": 10,
  115. "taskTypeConfig": {
  116. "taskTypeDTO": {
  117. "hosId": {
  118. "id": this.hosId
  119. },
  120. "associationType": {
  121. "key": "association_types",
  122. "value": "inspect"
  123. }
  124. }
  125. }
  126. }).then((result) => {
  127. uni.hideLoading();
  128. if (result.status == 200) {
  129. let configs = result.list || [];
  130. if(configs.length){
  131. this.taskTypeConfig = configs[0];
  132. this.addServiceTasks = this.taskTypeConfig.addServiceTasks || [];
  133. }else{
  134. this.taskTypeConfig = {};
  135. this.addServiceTasks = [];
  136. }
  137. } else {
  138. uni.showToast({
  139. icon: "none",
  140. title: result.msg || "接口获取数据失败!",
  141. });
  142. }
  143. });
  144. },
  145. },
  146. onLoad(options) {
  147. console.log(options, "result");
  148. this.queryObj = options;
  149. if(options.model){
  150. this.infoData = JSON.parse(options.model);
  151. this.orderList = this.infoData.orderList || [];
  152. this.taskNames = this.infoData.taskNames;
  153. console.log(this.infoData);
  154. }
  155. this.getTaskTypeConfig();
  156. // #ifdef APP-PLUS
  157. webHandle("no", "app");
  158. // #endif
  159. // #ifdef H5
  160. webHandle("no", "wx");
  161. // #endif
  162. },
  163. };
  164. </script>
  165. <style lang="less" scoped>
  166. .Scanning_Result {
  167. height: 100vh;
  168. display: flex;
  169. flex-direction: column;
  170. background-color: #fff;
  171. /deep/ uni-checkbox .uni-checkbox-input{
  172. color: #35b34a!important;
  173. width: 30rpx!important;
  174. height: 30rpx!important;
  175. }
  176. .Scanning_top {
  177. flex-shrink: 0;
  178. .Scanning_top_icon {
  179. padding-top: 26rpx;
  180. display: flex;
  181. flex-direction: column;
  182. justify-content: center;
  183. align-items: center;
  184. .icon_service{
  185. width: 115rpx;
  186. }
  187. .cubeic-ok {
  188. font-size: 140rpx;
  189. color: #35b34a;
  190. }
  191. .text1 {
  192. margin-top: 30rpx;
  193. font-size: 40rpx;
  194. font-weight: bold;
  195. }
  196. }
  197. .Scanning_top_text{
  198. text-align: center;
  199. font-size: 30rpx;
  200. font-weight: bold;
  201. padding: 8rpx 0 23rpx 0;
  202. }
  203. }
  204. .Scanning_cont {
  205. flex: 1;
  206. min-height: 0;
  207. display: flex;
  208. flex-direction: column;
  209. margin: 0 45rpx;
  210. .Scanning_cont_head{
  211. flex-shrink: 0;
  212. height: 78rpx;
  213. display: flex;
  214. border-top: 1rpx solid #EEEEEE;
  215. border-bottom: 1rpx solid #EEEEEE;
  216. .Scanning_cont_head_item{
  217. flex: 1;
  218. font-size: 32rpx;
  219. font-weight: bold;
  220. display: flex;
  221. justify-content: center;
  222. align-items: center;
  223. position: relative;
  224. &.active{
  225. color: #49B856;
  226. &::before{
  227. content: '';
  228. width: 70rpx;
  229. height: 10rpx;
  230. background-color: #49B856;
  231. position: absolute;
  232. left: 50%;
  233. bottom: 0;
  234. transform: translateX(-50%);
  235. border-radius: 6rpx;
  236. }
  237. }
  238. &::after{
  239. content: '';
  240. width: 2rpx;
  241. height: 44rpx;
  242. background-color: #D1D1D1;
  243. position: absolute;
  244. right: 0;
  245. top: 50%;
  246. transform: translateY(-50%);
  247. }
  248. &:last-of-type::after{
  249. opacity: 0;
  250. }
  251. }
  252. }
  253. .Scanning_cont_list{
  254. flex: 1;
  255. min-height: 0;
  256. display: flex;
  257. flex-direction: column;
  258. .Scanning_cont_list_scroll{
  259. flex: 1;
  260. min-height: 0;
  261. border: 1rpx solid #E9E9E9;
  262. }
  263. .Scanning_cont_list_item{
  264. height: 63rpx;
  265. display: flex;
  266. align-items: center;
  267. font-size: 30rpx;
  268. border-bottom: 2rpx dashed #D3D3D3;
  269. border-top: none;
  270. margin: 0 18rpx;
  271. &:last-of-type{
  272. border-bottom: 1rpx dashed #E9E9E9;
  273. }
  274. &.Scanning_cont_list_head{
  275. font-weight: bold;
  276. font-size: 28rpx;
  277. border-top: 1rpx solid #272727;
  278. flex-shrink: 0;
  279. }
  280. .name,
  281. .value{
  282. display: flex;
  283. align-items: center;
  284. height: 100%;
  285. font-weight: bold;
  286. line-height: 1;
  287. }
  288. .name{
  289. flex: 1;
  290. }
  291. .value {
  292. justify-content: flex-end;
  293. }
  294. }
  295. }
  296. }
  297. .foot_btn {
  298. margin: 30rpx;
  299. flex-shrink: 0;
  300. line-height: 88rpx;
  301. display: flex;
  302. justify-content: center;
  303. .btn {
  304. height: 88rpx;
  305. flex: 1;
  306. margin-right: 1%;
  307. background-image: linear-gradient(to right, #72c172, #3bb197);
  308. color: #fff;
  309. border-radius: 8rpx;
  310. font-size: 34rpx;
  311. font-weight: bold;
  312. text-align: center;
  313. &:last-of-type{
  314. margin-right: 0;
  315. }
  316. }
  317. }
  318. }
  319. </style>