appointmentInspect.vue 9.1 KB

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