单应用项目,可以创建很多独立工具类页面 ,不用登录 初始化的页面
zhangchen
2025-09-15 d6a773d0b90e64622289eb0362803420efb193b1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
<template>
  <div class="start-dialysis-container">
    <el-dialog
      v-model="show"
      center
      title="开始透析"
      width="80%"
      :show-close="false"
      class="start-dialysis-dialog"
      :destroy-on-close="true"
      :close-on-click-modal="false"
    >
      <template #header>
        <div class="start-dialysis-header">
          <span class="header-title">开始透析</span>
          <img
            :src="closeImg"
            class="header-close"
            @click="handleCancel"
            alt=""
          />
        </div>
      </template>
      <div class="start-dialysis-content" v-loading="loading">
        <el-form :model="formData" size="large">
          <el-row :gutter="10">
            <el-col :span="6">
              <el-form-item label="开始时间">
                <el-time-select
                  v-model="formData.startTime"
                  start="00:00"
                  step="00:01"
                  end="23:59"
                  placeholder="请选择"
                  :clearable="false"
                  style="width: 100%"
                />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="治疗护士">
                <el-select
                  @change="onStartMedNurseChange"
                  style="width: 100%"
                  v-model="formData.startMedNurse"
                  placeholder="请选择"
                >
                  <el-option
                    v-for="item in nurseOptions"
                    :key="item.code"
                    :label="item.userName"
                    :disabled="item.isValid === 0"
                    :value="item.code"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="上机护士">
                <el-select
                  style="width: 100%"
                  v-model="formData.startUpNurse"
                  placeholder="请选择"
                >
                  <el-option
                    v-for="item in nurseOptions"
                    :key="item.code"
                    :label="item.userName"
                    :disabled="item.isValid === 0"
                    :value="item.code"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="预充管路">
                <el-select
                  style="width: 100%"
                  v-model="formData.startYcNurse"
                  placeholder="请选择"
                >
                  <el-option
                    v-for="item in nurseOptions"
                    :key="item.code"
                    :label="item.userName"
                    :disabled="item.isValid === 0"
                    :value="item.code"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="穿刺/换药">
                <el-select
                  style="width: 100%"
                  v-model="formData.startIsCcOrHy"
                  placeholder="请选择"
                >
                  <el-option
                    v-for="(item, index) in startIsCcOrHyOptions"
                    :key="index"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <template v-if="formData.startIsCcOrHy === 1">
              <el-col :span="6">
                <el-form-item label="换药护士">
                  <el-select
                    style="width: 100%"
                    v-model="formData.startCcNurse"
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in nurseOptions"
                      :key="item.code"
                      :label="item.userName"
                      :disabled="item.isValid === 0"
                      :value="item.code"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </template>
            <template v-else-if="formData.startIsCcOrHy === 0">
              <el-col :span="6">
                <el-form-item label="穿刺护士">
                  <el-select
                    style="width: 100%"
                    v-model="formData.startCcNurse"
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in nurseOptions"
                      :key="item.code"
                      :label="item.userName"
                      :disabled="item.isValid === 0"
                      :value="item.code"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </template>
            <template v-else-if="formData.startIsCcOrHy === 2">
              <el-col :span="6">
                <el-form-item label="换药护士">
                  <el-select
                    style="width: 100%"
                    v-model="formData.startCcNurse"
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in nurseOptions"
                      :key="item.code"
                      :label="item.userName"
                      :disabled="item.isValid === 0"
                      :value="item.code"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </template>
            <template
              v-if="
                formData.startIsCcOrHy === 2 || formData.startIsCcOrHy === 0
              "
            >
              <el-col :span="6">
                <el-form-item label="穿刺方式" prop="doneCcType">
                  <el-select
                    style="width: 100%"
                    multiple
                    v-model="formData.startCcType"
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in punctureMethodOptions"
                      :key="item.code"
                      :label="item.dictText"
                      :value="item.dictText"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="穿刺针A">
                  <el-select
                    clearable
                    style="width: 100%"
                    v-model="formData.startCcZhenA"
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in punctureNeedleOptions"
                      :key="item.code"
                      :label="item.itemName + ' ' + item.itemSpec"
                      :value="item.code"
                      :disabled="item.isShow !== 1"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item clearable label="穿刺针V">
                  <el-select
                    style="width: 100%"
                    v-model="formData.startCcZhenV"
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in punctureNeedleOptions"
                      :key="item.code"
                      :label="item.itemName + ' ' + item.itemSpec"
                      :value="item.code"
                      :disabled="item.isShow !== 1"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="穿刺方向">
                  <el-select
                    style="width: 100%"
                    multiple
                    v-model="formData.startCcASideDirection"
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in punctureDirectionOptions"
                      :key="item.code"
                      :label="item.dictText"
                      :value="item.dictText"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </template>
            <el-col :span="6">
              <el-form-item label="引血(ml/min)">
                <el-input style="width: 100%" v-model="formData.startYingxue" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="透析器编号">
                <el-input style="width: 100%" v-model="formData.startTxqNo" />
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="入科方式">
                <el-select
                  style="width: 100%"
                  v-model="formData.startEntranceType"
                  placeholder="请选择"
                >
                  <el-option
                    v-for="(item, index) in startEntranceTypeOptions"
                    :key="index"
                    :label="item.label"
                    :value="item.value"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="一次性使用管路">
                <el-select v-model="formData.doneGl" placeholder="请选择">
                  <el-option
                    v-for="(item, index) in disposablePipelineOptions"
                    :key="index"
                    :label="item.itemName + ' ' + item.itemSpec"
                    :value="item.code"
                    :disabled="item.isShow !== 1"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="血滤管">
                <el-select
                  v-model="formData.doneByg"
                  :disabled="formData.schemeName !== 'HDF'"
                  placeholder="请选择"
                >
                  <el-option
                    v-for="(item, index) in hemofiltrationTubeOptions"
                    :key="index"
                    :label="item.itemName + ' ' + item.itemSpec"
                    :value="item.code"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="透析浓缩液">
                <el-select
                  v-model="formData.startUseNsy"
                  multiple
                  filterable
                  clearable
                  placeholder="请选择"
                >
                  <el-option
                    v-for="(item, index) in doneUseNsyOptions"
                    :key="index"
                    :label="item.itemName + ' ' + item.itemSpec"
                    :value="item.code"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="透析护理包">
                <el-select
                  v-model="formData.startUseHlb"
                  filterable
                  clearable
                  placeholder="请选择"
                >
                  <el-option
                    v-for="(item, index) in doneUseHlbOptions"
                    :key="index"
                    :label="item.itemName + ' ' + item.itemSpec"
                    :value="item.code"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
      <template #footer>
        <div class="my-button cancel" @click="handleCancel">取消</div>
        <div
          class="my-button confirm"
          :class="loading ? 'cancel' : ''"
          @click="handleConfirm"
        >
          确认
        </div>
      </template>
    </el-dialog>
  </div>
</template>
 
<script lang="ts">
import { computed, reactive, toRefs } from "vue";
import closeImg from "@/img/close.png";
import {
  addDefaultRowApi,
  updateMedstartDataApi,
} from "@/api/patient_hemo_med_start/index";
import type { StartRecord } from "@/api/patient_hemo_med_start/types/index.type";
import { useBedsideAuxiliaryScreenStore } from "@/store/bedsideAuxiliaryScreen";
import { getInventoryItemListApi } from "@/api/inventory/itemDict";
import { getUsersByRoleCodeApi } from "@/api/user/index";
import { getDictTypeApi } from "@/api/dict/index";
import { DictType } from "@/api/dict/types/index.type";
import dayjs from "dayjs";
import { ElMessage } from "element-plus/es";
 
interface FormData
  extends Omit<
    StartRecord,
    "startCcType" | "startCcASideDirection" | "startUseNsy"
  > {
  /** 穿刺方式 */
  startCcType: string[];
  /** 穿刺方向 */
  startCcASideDirection: string[];
  startUseNsy: string[];
}
 
interface State {
  loading: boolean;
  show: boolean;
  formData: FormData;
  doneUseNsyOptions: any[];
  doneUseHlbOptions: any[];
  disposablePipelineOptions: any[];
  hemofiltrationTubeOptions: any[];
  nurseOptions: any[];
  punctureMethodOptions: any[];
  typePunctureNeedleOptions: any[];
  punctureDirectionOptions: any[];
  punctureNeedleOptions: any[];
  startIsCcOrHyOptions: any[];
  startEntranceTypeOptions: any[];
  startDate: string;
}
export default {
  name: "StartDialysis",
  setup() {
    const bedsideAuxiliaryScreenStore = useBedsideAuxiliaryScreenStore();
 
    const state = reactive<State>({
      loading: false,
      show: false,
      formData: {
        code: "",
        createTime: "",
        createUser: null,
        deletedTime: null,
        doneByg: "",
        doneBygName: "",
        doneBygSpecName: "",
        doneGl: "",
        doneGlName: "",
        doneGlSpecName: "",
        id: null,
        isDeleted: null,
        monitorDataCode: "",
        recordCode: "",
        remark: "",
        schemeName: "",
        /** 穿刺方向 */
        startCcASideDirection: [],
        startCcNurse: "",
        startCcNurseName: "",
        /** 穿刺方式 */
        startCcType: [],
        startCcZhenA: "",
        startCcZhenAName: "",
        startCcZhenASpecName: "",
        startCcZhenType: "",
        startCcZhenV: "",
        startCcZhenVName: "",
        startCcZhenVSpecName: "",
        startEntranceType: "",
        startIsCcOrHy: null,
        startIsSave: null,
        startMedNurse: "",
        startMedNurseName: "",
        startTime: null,
        startTxqNo: "",
        startUpNurse: "",
        startUpNurseName: "",
        startUseHlb: "",
        startUseHlbName: "",
        startUseHlbSpecName: "",
        startUseNsy: [],
        startUseNsyName: "",
        startUseNsySpecName: "",
        startYcNurse: "",
        startYcNurseName: "",
        startYingxue: "",
        updateTime: "",
        updateUser: null,
      },
      doneUseNsyOptions: [], // 透析浓缩液列表
      doneUseHlbOptions: [], // 透析护理包列表
      disposablePipelineOptions: [], // 一次性使用管路列表
      hemofiltrationTubeOptions: [], // 血滤管列表
      nurseOptions: [], // 护士列表
      punctureMethodOptions: [], // 穿刺方式列表
      typePunctureNeedleOptions: [], // 穿刺针类型列表
      punctureDirectionOptions: [], // 穿刺方向列表
      punctureNeedleOptions: [], // 穿刺针列表
      startIsCcOrHyOptions: [
        { label: "穿刺", value: 0 },
        { label: "换药", value: 1 },
        { label: "穿刺+换药", value: 2 },
      ],
      startEntranceTypeOptions: [
        { label: "步行", value: "步行" },
        { label: "扶行", value: "扶行" },
        { label: "轮椅", value: "轮椅" },
        { label: "平床", value: "平床" },
        { label: "床旁", value: "床旁" },
        { label: "助行器", value: "助行器" },
      ],
      startDate: "", // 日期部分
    });
 
    const recordCode = computed(() => {
      return bedsideAuxiliaryScreenStore.deviceData.signedIn.透析单编号;
    });
 
    const clientCode = computed(() => {
      return bedsideAuxiliaryScreenStore.deviceData.客户编号;
    });
 
    const userCode = computed(() => {
      return bedsideAuxiliaryScreenStore.userInfo.userCode;
    });
 
    const openDialog = async () => {
      state.show = true;
      state.loading = true;
      try {
        const promiseFuns = [
          getDoneUseNsys(), 
          getdoneUseHlbs(), 
          getDisposablePipelines(), 
          getHemofiltrationTubes(),
          getPunctureNeedles(),
          getNurses(),
          getPunctureMethods(),
          getTypePunctureNeedles(),
          getPunctureDirectionOptions(),
        ];
        // if (state.doneUseNsyOptions.length <= 0) {
        //   promiseFuns.push(getDoneUseNsys());
        // }
        // if (state.doneUseHlbOptions.length <= 0) {
        //   promiseFuns.push(getdoneUseHlbs());
        // }
        // if (state.disposablePipelineOptions.length <= 0) {
        //   promiseFuns.push(getDisposablePipelines());
        // }
        // if (state.hemofiltrationTubeOptions.length <= 0) {
        //   promiseFuns.push(getHemofiltrationTubes());
        // }
        // if (state.punctureNeedleOptions.length <= 0) {
        //   promiseFuns.push(getPunctureNeedles());
        // }
        // if (state.nurseOptions.length <= 0) {
        //   promiseFuns.push(getNurses());
        // }
        // if (state.punctureMethodOptions.length <= 0) {
        //   promiseFuns.push(getPunctureMethods());
        // }
        // if (state.typePunctureNeedleOptions.length <= 0) {
        //   promiseFuns.push(getTypePunctureNeedles());
        // }
        // if (state.punctureDirectionOptions.length <= 0) {
        //   promiseFuns.push(getPunctureDirectionOptions());
        // }
        await Promise.all(promiseFuns);
        await getStartData();
      } catch (error) {
        console.error("开始透析初始化失败", error);
        state.show = false;
      } finally {
        state.loading = false;
      }
    };
 
    /**
     * 获取开始透析默认数据
     */
    const getStartData = async () => {
      const { data } = await addDefaultRowApi(`recordCode=${recordCode.value}`);
      const dataCopy = data;
      const nots = ["", null];
 
      if (!nots.includes(data.startCcType)) {
        // @ts-ignore
        dataCopy.startCcType = data.startCcType.split(",");
      } else {
        // @ts-ignore
        dataCopy.startCcType = [];
      }
 
      if (!nots.includes(data.startCcASideDirection)) {
        // @ts-ignore
        dataCopy.startCcASideDirection = data.startCcASideDirection.split(",");
      } else {
        // @ts-ignore
        dataCopy.startCcASideDirection = [];
      }
 
      if (nots.includes(data.startTime)) {
        dataCopy.startTime = dayjs().format("HH:mm");
        state.startDate = dayjs().format("YYYY-MM-DD");
      } else {
        dataCopy.startTime = dayjs(data.startTime).format("HH:mm");
        state.startDate = dayjs(data.startTime).format("YYYY-MM-DD");
      }
 
      if (nots.includes(data.startMedNurse)) {
        dataCopy.startMedNurse = userCode.value;
      }
 
      if (nots.includes(data.startCcNurse)) {
        dataCopy.startCcNurse = userCode.value;
      }
      if (nots.includes(data.startUpNurse)) {
        dataCopy.startUpNurse = userCode.value;
      }
      if (nots.includes(data.startYcNurse)) {
        dataCopy.startYcNurse = userCode.value;
      }
      if (!nots.includes(data.startUseNsy)) {
        // @ts-ignore
        dataCopy.startUseNsy = data.startUseNsy.split(",");
      } else {
        // @ts-ignore
        dataCopy.startUseNsy = [];
      }
 
      if (data.schemeName !== "HDF") {
        // 如果透析模式不算HDF的话血滤管置空
        dataCopy.doneByg = "";
        dataCopy.doneBygName = "";
      } else {
        const defaultXlg = state.hemofiltrationTubeOptions.find(
          (e) => e.itemName === "义鑫血液净化补液管路(HDIT-1)"
        );
        if (defaultXlg) {
          dataCopy.doneByg = defaultXlg.code;
          dataCopy.doneBygName = defaultXlg.itemName;
        }
      }
      state.formData = dataCopy as unknown as FormData;
    };
 
    /**
     * 获取透析浓缩液字典数据
     */
    const getDoneUseNsys = async () => {
      const params = {
        page: 0,
        size: 0,
        wherecondition: `inventory_type_code='IT2112291619002680' and is_show = 1 and client_code='${clientCode.value}'`,
        ordercondition: "item_is_use desc, item_sort_order asc",
        isPure: 0,
      };
      const { data } = await getInventoryItemListApi(params);
      state.doneUseNsyOptions = data.list;
    };
 
    /**
     * 获取透析护理包字典数据
     */
    const getdoneUseHlbs = async () => {
      const params = {
        page: 0,
        size: 0,
        wherecondition: `inventory_type_code='IT2112291619003161' and is_show = 1 and client_code='${clientCode.value}'`,
        ordercondition: "item_is_use desc, item_sort_order asc",
        isPure: 0,
      };
      const { data } = await getInventoryItemListApi(params);
      state.doneUseHlbOptions = data.list;
    };
 
    /**
     * 获取一次性使用管路字典数据
     */
    const getDisposablePipelines = async () => {
      const params = {
        page: 0,
        size: 0,
        wherecondition: `inventory_type_code='IT2112291619006054' and is_show = 1 and client_code='${clientCode.value}'`,
        ordercondition: "item_is_use desc, item_sort_order asc",
        isPure: 0,
      };
      const { data } = await getInventoryItemListApi(params);
      state.disposablePipelineOptions = data.list;
    };
 
    /**
     * 获取血滤管字典数据
     */
    const getHemofiltrationTubes = async () => {
      const params = {
        page: 1,
        size: 10,
        wherecondition: `inventory_type_code='IT9024215920713quQV' and is_show = 1 and client_code='${clientCode.value}'`,
        ordercondition: "item_is_use desc, item_sort_order asc",
        isPure: 0,
      };
      const { data } = await getInventoryItemListApi(params);
      state.hemofiltrationTubeOptions = data.list;
    };
 
    /**
     * 获取穿刺针字典数据
     */
    const getPunctureNeedles = async () => {
      const params = {
        page: 1,
        size: 10,
        wherecondition: `(inventory_type_code='IT3561011130526051' OR inventory_type_code='IT2112291619000061') and client_code='${clientCode.value}'`,
        ordercondition: "item_is_use desc, item_sort_order asc",
      };
      const { data } = await getInventoryItemListApi(params);
      state.punctureNeedleOptions = data.list;
    };
 
    /**
     * 获取护士数据
     */
    const getNurses = async () => {
      const { data } = await getUsersByRoleCodeApi(
        `clientCode=${clientCode.value}&roleClass=nurse`
      );
      state.nurseOptions = data;
    };
 
    /**
     * 获取穿刺方式字典数据
     */
    const getPunctureMethods = async () => {
      const { data } = await getDictTypeApi({ dictType: DictType.穿刺方式 });
      state.punctureMethodOptions = data;
    };
 
    /**
     * 获取穿刺针类型字典数据
     */
    const getTypePunctureNeedles = async () => {
      const { data } = await getDictTypeApi({ dictType: DictType.穿刺针类型 });
      state.typePunctureNeedleOptions = data;
    };
 
    /**
     * 获取穿刺针方向字典数据
     */
    const getPunctureDirectionOptions = async () => {
      const { data } = await getDictTypeApi({ dictType: DictType.穿刺方向 });
      state.punctureDirectionOptions = data;
    };
 
    const handleCancel = () => {
      state.show = false;
      state.loading = false;
    };
 
    const handleConfirm = async () => {
      state.loading = true;
      try {
        const paramsData = Object.assign({}, state.formData, {
          startCcASideDirection:
            state.formData.startCcASideDirection.toString(),
          startCcType: state.formData.startCcType.toString(),
          startUseNsy: state.formData.startUseNsy.join(","),
          startTime: `${state.startDate} ${state.formData.startTime}:00`,
        });
        await updateMedstartDataApi(paramsData);
        ElMessage.success("操作成功!");
        state.show = false;
      } finally {
        state.loading = false;
      }
    };
 
    /**
     * 治疗护士的改变
     * @param val
     */
    const onStartMedNurseChange = (val: string) => {
      state.formData.startCcNurse = val;
      state.formData.startUpNurse = val;
      state.formData.startYcNurse = val;
    };
 
    return {
      ...toRefs(state),
      closeImg,
      handleCancel,
      openDialog,
      handleConfirm,
      onStartMedNurseChange,
    };
  },
};
</script>
 
<style lang="less" scoped>
.start-dialysis-container {
  ::v-deep(.el-dialog) {
    padding: 0;
    border-radius: 6px;
    overflow: hidden;
  }
  ::v-deep(.el-dialog__footer) {
    padding: 4px;
  }
  ::v-deep(.el-upload-dragger) {
    height: 65px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  ::v-deep(.el-upload-dragger .el-icon--upload) {
    display: none;
  }
  ::v-deep(.el-dialog__header) {
    padding-bottom: 6px;
  }
  .start-dialysis-header {
    position: relative;
    height: 16px;
    background: #769aff;
    .header-title {
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translateX(-50%) translateY(-50%);
      font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
      font-weight: 500;
      font-size: 8px;
      color: #ffffff;
      line-height: 11px;
      text-align: center;
    }
    .header-close {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      right: 6px;
      width: 15px;
      height: 15px;
      transition: transform 0.2s;
 
      &:active {
        opacity: 0.6;
        transform: translateY(-50%) scale(0.95);
      }
    }
  }
  .start-dialysis-content {
    padding: 0 12px 0px 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid #d8d8d8;
  }
  .my-button {
    display: inline-block;
    border-radius: 2px;
    padding: 0px 10px;
    font-family: PingFangSC, PingFang SC;
    font-weight: 500;
    font-size: 7px;
    color: #ffffff;
    line-height: 16px;
    letter-spacing: 1px;
    text-align: center;
    font-style: normal;
    transition: transform 0.1s ease, opacity 0.1s ease;
    cursor: pointer;
    &:active {
      transform: scale(0.95);
      opacity: 0.8;
    }
 
    &:not(:first-child) {
      margin-left: 6px;
    }
 
    &.confirm {
      background: #769aff;
    }
    &.cancel {
      background: #bbc6dd;
    }
    &.refresh {
      background: #e6a23c;
    }
  }
}
</style>