appointmentInspect.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. <template>
  2. <view class="appointmentInspect">
  3. <view class="qco_msg" id="qco_msg">
  4. <view class="qco_msg1" v-html="patientMsg"></view>
  5. <view class="qco_msg2 red" v-if="isMoreDept">您选择的检查包含了多个科室,请您只包含一个科室</view>
  6. </view>
  7. <view class="select_block_wrap" :style="{mariginTop:qcoHeight+'px'}">
  8. <view class="uni-list">
  9. <checkbox-group @change="checkboxChange">
  10. <scroll-view scroll-y class="scrollHeight">
  11. <label class="inspect_listItem" v-for="inspect in inspects" :key="inspect.value">
  12. <image class="ji" src="../../static/imgs/icon_ji.png" mode="widthFix" v-if="inspect.priority == 1">
  13. </image>
  14. <view class="inspect_listItem_header">
  15. <view class="inspect_listItem_header_title">
  16. <checkbox color="#09BB07" :value="inspect.value" :checked="inspect.checked" />
  17. <view class="inspectInfo">
  18. <text class="info">
  19. <text v-if="inspect.yyTime">{{inspect.yyTime|formatDate('MM-dd HH:mm')}}</text>
  20. <text class="dept" v-if="inspect.execDept">
  21. {{deptDisplay == 2?inspect.execDept.deptalias:inspect.execDept.dept}}
  22. </text>
  23. </text>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="inspect_listItem_item">
  28. <view class="inspect_listItem_item_content">
  29. <text class="inspect_listItem_item_name">进行 {{inspect.inspectName || "检查"}}</text>
  30. </view>
  31. </view>
  32. </label>
  33. </scroll-view>
  34. </checkbox-group>
  35. </view>
  36. </view>
  37. <!-- 底部 -->
  38. <seiminFooterBtn :btns="btns"></seiminFooterBtn>
  39. <seiminModel ref="seiminModel"></seiminModel>
  40. </view>
  41. </template>
  42. <script>
  43. import cloneDeep from 'lodash/cloneDeep';
  44. import {
  45. mapState,
  46. mapMutations
  47. } from "vuex";
  48. import {
  49. ASSOCIATION_TYPES
  50. } from "../../utils/enum.association_types.js";
  51. export default {
  52. data() {
  53. return {
  54. ASSOCIATION_TYPES,
  55. qcoHeight: 0,
  56. // 关联检查有多个科室,但是开关设置是不允许,是否展示提示文字
  57. isMoreDept: false,
  58. // 检查列表
  59. inspects: [],
  60. // 是否加急
  61. isUrgent: false,
  62. // 设备
  63. goods: [],
  64. //患者建单信息展示
  65. patientMsg: '',
  66. // 传递过来的参数
  67. queryParams: {},
  68. //底部按钮
  69. btns: [{
  70. name: "上一步",
  71. type: "primary",
  72. click: () => {
  73. uni.navigateBack();
  74. },
  75. }, ],
  76. };
  77. },
  78. computed: {
  79. ...mapState('login', ['loginInfo']),
  80. ...mapState('other', [
  81. "deptDisplay",
  82. 'patientBuildTrip',
  83. 'selectedPatient',
  84. 'patientTaskType',
  85. ]),
  86. },
  87. methods: {
  88. ...mapMutations('other', ['changePatientBuildData']),
  89. // qco高度变化
  90. resizeQcoHeight() {
  91. // 选中的检查
  92. let data = this.inspects.filter(v => v.checked);
  93. // 关联检查有多个科室,但是开关设置是不允许,是否展示提示文字
  94. if (data.length && this.patientTaskType.isMoreDept === 0) {
  95. let arr = data.filter((item) => item.execDept).map((item) => item.execDept.id);
  96. arr = Array.from(new Set(arr));
  97. this.isMoreDept = arr.length > 1;
  98. } else {
  99. this.isMoreDept = false;
  100. }
  101. // qoc高度设置
  102. this.$nextTick(() => {
  103. uni.createSelectorQuery().in(this).select('#qco_msg').boundingClientRect(data => {
  104. this.qcoHeight = data.height;
  105. console.log(data)
  106. }).exec();
  107. })
  108. // 底部按钮展示
  109. if (data.length && !this.isMoreDept) {
  110. this.btns = [{
  111. name: "上一步",
  112. type: "primary",
  113. click: () => {
  114. uni.navigateBack();
  115. },
  116. }, {
  117. name: "下一步",
  118. type: "primary",
  119. click: () => {
  120. // 存储选中的检查
  121. this.changePatientBuildData({
  122. key: 'checks',
  123. value: this.inspects.filter(v => v.checked)
  124. });
  125. uni.navigateTo({
  126. url: '/pages/patientBuild/patientBuild'
  127. })
  128. },
  129. }, ]
  130. } else {
  131. this.btns = [{
  132. name: "上一步",
  133. type: "primary",
  134. click: () => {
  135. uni.navigateBack();
  136. },
  137. }, ]
  138. }
  139. },
  140. // 切换是否加急
  141. switchChange(e) {
  142. this.isUrgent = e.detail.value;
  143. this.urgentRemark = '';
  144. },
  145. // 选择检查
  146. checkboxChange: function(e) {
  147. console.log(e, this.inspects);
  148. var inspects = this.inspects,
  149. values = e.detail.value;
  150. for (var i = 0, lenI = inspects.length; i < lenI; ++i) {
  151. const item = inspects[i]
  152. if (values.includes(item.value)) {
  153. this.$set(item, 'checked', true)
  154. } else {
  155. this.$set(item, 'checked', false)
  156. }
  157. }
  158. this.resizeQcoHeight();
  159. },
  160. // 立即建单
  161. buildOrder() {
  162. console.log(this.urgentRemark)
  163. console.log(this.isUrgent)
  164. console.log(this.goods)
  165. // 加急原因非空
  166. if (this.isUrgent && !this.urgentRemark) {
  167. this.$refs.seiminModel.show({
  168. skin: 'toast',
  169. icon: 'warn',
  170. content: '请填写加急原因',
  171. })
  172. return;
  173. }
  174. }
  175. },
  176. onLoad(queryParams) {
  177. this.resizeQcoHeight();
  178. this.patientMsg = `以下是患者<b class="green">${this.selectedPatient.patientName}</b>当天预约的检查,请选择本次服务的检查项`;
  179. let inspects = this.patientBuildTrip.data ? cloneDeep(this.patientBuildTrip.data) : [];
  180. inspects.forEach(v => {
  181. v.label = v.inspectName;
  182. v.value = v.id.toString();
  183. });
  184. this.inspects = inspects
  185. console.log(this.inspects)
  186. this.queryParams = queryParams;
  187. },
  188. };
  189. </script>
  190. <style lang="scss" scoped>
  191. .appointmentInspect {
  192. padding-bottom: 108rpx;
  193. ::v-deep uni-checkbox .uni-checkbox-input {
  194. width: 40rpx;
  195. height: 40rpx;
  196. }
  197. ::v-deep .uni-checkbox-input-checked {
  198. background-color: #09BB07;
  199. &:before {
  200. color: #fff;
  201. }
  202. }
  203. ::v-deep uni-checkbox:not([disabled]) .uni-checkbox-input:hover {
  204. border-color: #09BB07;
  205. }
  206. .qco_msg {
  207. background-color: #f9fafb;
  208. position: fixed;
  209. width: 100%;
  210. z-index: 99;
  211. padding: 32rpx 32rpx 0;
  212. color: #999;
  213. line-height: 40rpx;
  214. font-size: 28rpx;
  215. text-align: center;
  216. }
  217. .qco_msg1 {
  218. padding-bottom: 16rpx;
  219. }
  220. .qco_msg2 {
  221. padding: 16rpx 0;
  222. line-height: 40rpx;
  223. font-size: 28rpx;
  224. text-align: center;
  225. @include border(top);
  226. }
  227. .select_block_wrap {
  228. padding: 144rpx 24rpx 0;
  229. .scrollHeight {
  230. height: 100%;
  231. }
  232. .inspect_listItem {
  233. width: 702rpx;
  234. background-color: #fff;
  235. margin-top: 8rpx;
  236. border-radius: 8rpx;
  237. position: relative;
  238. padding: 0 24rpx;
  239. font-size: 32rpx;
  240. @include border;
  241. @include semicircle(#f9fafb, 82rpx);
  242. @include flex(flex-start, stretch, column);
  243. .ji {
  244. width: 60rpx;
  245. position: absolute;
  246. right: 0;
  247. top: 0;
  248. }
  249. .inspect_listItem_header {
  250. height: 86rpx;
  251. @include border($directive:bottom, $style:dashed);
  252. @include flex(space-between, center);
  253. .inspect_listItem_header_title {
  254. color: #333;
  255. flex: 1;
  256. @include flex(flex-start, center);
  257. .inspectInfo {
  258. flex: 1;
  259. @include flex;
  260. .info {
  261. color: #333;
  262. font-size: 36rpx;
  263. font-weight: bold;
  264. @include clamp;
  265. .dept {
  266. margin-left: 8rpx;
  267. }
  268. }
  269. .workerName {
  270. flex: 1;
  271. @include clamp;
  272. }
  273. }
  274. }
  275. }
  276. .inspect_listItem_item {
  277. height: 88rpx;
  278. color: #333;
  279. font-size: 30rpx;
  280. flex: 1;
  281. @include border(bottom);
  282. @include flex(flex-start, stretch, column);
  283. &:last-of-type {
  284. border-bottom: none;
  285. }
  286. .inspect_listItem_item_content {
  287. flex: 1;
  288. padding: 14rpx 0;
  289. @include flex(space-between, center);
  290. .inspect_listItem_item_name {
  291. color: #333;
  292. font-size: 36rpx;
  293. text-indent: 1.5em;
  294. @include clamp;
  295. }
  296. }
  297. }
  298. }
  299. }
  300. }
  301. </style>