DiabetesForm.vue 36 KB
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 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966
<template>
    <van-form ref="form">
        <div class="first-title">
            <span class="font-semibold">随访信息</span>
            <div class="btn-title">引入数据</div>
        </div>
        <!-- 随访方式 -->
        <div class="label-title mt-2" required>随访方式</div>
        <van-field
            v-model="form.visitWayName"
            isLink
            readonly
            placeholder="请选择"
            :rules="rules.visitWayName"
            @click="showVisitWay = true"
            class="form-input"
        />
        <van-popup v-model:show="showVisitWay" position="bottom">
            <div class="p-4" style="height: 100%">
                <div class="flex justify-between items-center mb-4 pop-title">
                    <div class="greyColor" @click="showVisitWay = false">取消</div>
                    <div>随访方式(单选)</div>
                    <div></div>
                </div>
                <div style="height: 80%; overflow: auto">
                    <CheckBtn
                        clearable
                        column-1
                        :options="store.getDict('CP00052')"
                        v-model:value="form.visitWay"
                        :fieldNames="{ text: 'name', value: 'value' }"
                        @change="visitWayChange"
                    />
                </div>
            </div>
        </van-popup>
        <!-- 症状 -->
        <div class="label-title mt-2" required>症状</div>
        <van-field
            v-model="form.symptomName"
            isLink
            readonly
            placeholder="请选择"
            :rules="rules.symptomName"
            @click="showSymptom = true"
            class="form-input"
        />
        <van-popup v-model:show="showSymptom" position="bottom">
            <div class="p-4" style="height: 100%">
                <div class="flex justify-between items-center mb-4 pop-title">
                    <div class="greyColor" @click="showSymptom = false">取消</div>
                    <div>症状(可多选)</div>
                    <div class="blueColor" @click="symptomConfirm">确定</div>
                </div>
                <div style="height: 80%; overflow: auto">
                    <CheckBtn
                        multiple
                        column-2
                        :options="store.getDict('CP00059')"
                        v-model:value="form.symptom"
                        :fieldNames="{ text: 'name', value: 'value' }"
                        @change="form.symptom = checkboxReject(form.symptom, [1])"
                    />
                </div>
            </div>
        </van-popup>
        <template v-if="(form.symptom || []).includes(99)">
            <div class="label-title mt-2">其他症状</div>
            <van-field
                v-model="form.symptomOther"
                placeholder="请填写其他症状"
                class="form-input"
            />
        </template>
        <!-- 血压 -->
        <div class="flex items-center justify-between tip-box mt-2 mb-2">
            <div class="label-title" required>血压</div>
            <BloodPressurePanel :pressureObj="pressureObj" />
        </div>
        <table class="w-full mb-2">
            <tr class="sub-text">
                <td>收缩压(SBP)</td>
                <td style="width: 1em"></td>
                <td>舒张压(DBP)</td>
            </tr>
            <tr>
                <td class="flex items-center">
                    <van-field
                        v-model="form.signSystolicPressure"
                        placeholder="60~300,整数"
                        :rules="rules.signSystolicPressure"
                        class="form-input"
                    >
                        <template #extra>
                            <span>mmHg</span>
                        </template>
                    </van-field>
                </td>
                <td class="text-center">
                    <span class="divide">/</span>
                </td>
                <td class="flex items-center">
                    <van-field
                        v-model="form.signDiastolicPressure"
                        placeholder="30~300,整数"
                        :rules="rules.signDiastolicPressure"
                        class="form-input"
                    >
                        <template #extra>
                            <span>mmHg</span>
                        </template>
                    </van-field>
                </td>
            </tr>
        </table>
        <BloodPressureBt :pressureObj="pressureObj" @getValue="setPressure">开始测量</BloodPressureBt>
        <div class="tip">提示:点击“开始测量”按钮后将自动启动血压计设备,请勿再重复点击设备“开始/停止”按钮。</div>
        <!-- 身高 -->
        <div class="label-title mt-2" required>身高</div>
        <van-field
            v-model="form.signHeight"
            placeholder="10~300,1位小数"
            :rules="rules.signHeight"
            class="form-input"
        >
            <template #extra>
                <span>cm</span>
            </template>
        </van-field>
        <!-- 体重 -->
        <div class="label-title mt-2" required>体重</div>
        <van-field
            v-model="form.signWeight"
            placeholder="20~500,2位小数"
            :rules="rules.signWeight"
            class="form-input"
        >
            <template #extra>
                <span>kg</span>
            </template>
        </van-field>
        <!-- BMI -->
        <div class="label-title mt-2">BMI(体质指数)</div>
        <van-field
            readonly
            v-model="form.signBmi"
            placeholder="-"
            class="form-input"
        >
            <template #extra>
                <span>kg/m²</span>
            </template>
        </van-field>
        <!-- 腰围 -->
        <div class="label-title mt-2" required>腰围</div>
        <van-field
            v-model="form.signWaistline"
            placeholder="10~150,1位小数"
            :rules="rules.signWaistline"
            class="form-input"
        >
            <template #extra>
                <span>cm</span>
            </template>
        </van-field>
        <!-- 足背动脉搏动 -->
        <div class="label-title mt-2" required>足背动脉搏动</div>
        <van-field
            v-model="form.signArteryPulsationName"
            isLink
            readonly
            placeholder="请选择"
            :rules="rules.signArteryPulsationName"
            @click="showSignArteryPulsation = true"
            class="form-input"
        />
        <van-popup v-model:show="showSignArteryPulsation" position="bottom">
            <div class="p-4" style="height: 100%">
                <div class="flex justify-between items-center mb-4 pop-title">
                    <div class="greyColor" @click="showSignArteryPulsation = false">取消</div>
                    <div>随访方式(单选)</div>
                    <div></div>
                </div>
                <div style="height: 80%; overflow: auto">
                    <CheckBtn
                        clearable
                        column-1
                        :options="store.getDict('CP00065')"
                        v-model:value="form.signArteryPulsation"
                        :fieldNames="{ text: 'name', value: 'value' }"
                        @change="signArteryPulsationChange"
                    />
                </div>
            </div>
        </van-popup>
        <!-- 其他体征 -->
        <div class="label-title mt-2">其他</div>
        <van-field
            type="textarea"
            v-model="form.signOther"
            :maxlength="120"
            placeholder="如有其他体征情况请填写在此处,限120个字"
            class="form-input"
        />
        <!-- 吸烟 -->
        <div class="label-title mt-2" required>吸烟</div>
        <div class="bg-fa">
            <div class="label-title" required style="color: #262626; font-size: 14px">是否正在吸烟</div>
            <van-field :rules="rules.isSmoking" style="padding: 0">
                <template #input>
                    <van-radio-group
                        v-model="form.isSmoking"
                        shape="dot"
                        direction="horizontal"
                        class="doc-radio-group-now"
                    >
                        <van-radio
                            v-for="item in store.getDict('CP00066')"
                            :key="item.value"
                            :name="item.value"
                            label-position="left"
                            style="width: 100%"
                        >
                            {{ item.name }}
                        </van-radio>
                    </van-radio-group>
                </template>
            </van-field>
        </div>
        <div v-if="form.isSmoking === 1" class="bg-fa mt-2">
            <div class="label-title" style="color: #262626; font-size: 14px">您大约从几岁起开始养成每天或基本每天都吸烟的习惯</div>
            <van-field
                v-model="form.startSmokeAge"
                placeholder="2~100,整数"
                :rules="rules.startSmokeAge"
                class="card-input"
            >
                <template #extra>
                    <span></span>
                </template>
            </van-field>
        </div>
        <div v-if="form.isSmoking === 1 || form.isSmoking === 2" class="bg-fa mt-2">
            <div class="label-title" style="color: #262626; font-size: 14px">您最近7天是否吸烟</div>
            <van-field style="padding: 0">
                <template #input>
                    <van-radio-group
                        v-model="form.lastSevenSmoke"
                        shape="dot"
                        direction="horizontal"
                        class="doc-radio-group-now"
                    >
                        <van-radio
                            v-for="item in store.getDict('DC00001')"
                            :key="item.value"
                            :name="item.value"
                            label-position="left"
                            style="width: 48%"
                        >
                            {{ item.name }}
                        </van-radio>
                    </van-radio-group>
                </template>
            </van-field>
        </div>
        <div v-if="form.isSmoking === 1 || form.isSmoking === 2" class="bg-fa mt-2">
            <div class="label-title" style="color: #262626; font-size: 14px">日吸烟量</div>
            <van-field
                v-model="form.daySmoking"
                placeholder="0~100,整数"
                :rules="rules.daySmoking"
                class="card-input"
            >
                <template #extra>
                    <span></span>
                </template>
            </van-field>
        </div>
        <div v-if="form.isSmoking === 1 || form.isSmoking === 2" class="bg-fa mt-2">
            <div class="label-title" style="color: #262626; font-size: 14px">目标日吸烟量</div>
            <van-field
                v-model="form.goalDaySmoking"
                placeholder="0~100,整数"
                :rules="rules.goalDaySmoking"
                class="card-input"
            >
                <template #extra>
                    <span></span>
                </template>
            </van-field>
        </div>
        <!-- 饮酒 -->
        <div class="label-title mt-2" required>饮酒</div>
        <div class="bg-fa">
            <div class="label-title" required style="color: #262626; font-size: 14px">是否正在饮酒</div>
            <van-field :rules="rules.isDrink" style="padding: 0">
                <template #input>
                    <van-radio-group
                        v-model="form.isDrink"
                        shape="dot"
                        direction="horizontal"
                        class="doc-radio-group-now"
                    >
                        <van-radio
                            v-for="item in store.getDict('CP00068')"
                            :key="item.value"
                            :name="item.value"
                            label-position="left"
                            style="width: 100%"
                        >
                            {{ item.name }}
                        </van-radio>
                    </van-radio-group>
                </template>
            </van-field>
        </div>
        <div v-if="form.isDrink === 1" class="bg-fa mt-2">
            <div class="label-title" style="color: #262626; font-size: 14px">饮酒频率</div>
            <van-field style="padding: 0">
                <template #input>
                    <van-radio-group
                        v-model="form.drinkCondition"
                        shape="dot"
                        direction="horizontal"
                        class="doc-radio-group-now"
                    >
                        <van-radio
                            v-for="item in store.getDict('CP00069')"
                            :key="item.value"
                            :name="item.value"
                            label-position="left"
                            style="width: 100%"
                        >
                            {{ item.name }}
                        </van-radio>
                    </van-radio-group>
                </template>
            </van-field>
        </div>
        <div v-if="form.isDrink === 1 || form.isDrink === 2" class="flex mt-2">
            <div class="bg-fa">
                <div class="label-title" style="color: #262626; font-size: 14px">日饮酒量</div>
                <van-field
                    v-model="form.dayDrink"
                    placeholder="0~3000,整数"
                    :rules="rules.dayDrink"
                    class="card-input"
                >
                    <template #extra>
                        <span>ml</span>
                    </template>
                </van-field>
            </div>
            <div class="bg-fa ml-2">
                <div class="label-title" style="color: #262626; font-size: 14px">目标日饮酒量</div>
                <van-field
                    v-model="form.goalDayDrink"
                    placeholder="0~3000,整数"
                    :rules="rules.goalDayDrink"
                    class="card-input"
                >
                    <template #extra>
                        <span>ml</span>
                    </template>
                </van-field>
            </div>
        </div>
        <div v-if="form.isDrink === 1 || form.isDrink === 2" class="bg-fa mt-2">
            <div class="label-title" style="color: #262626; font-size: 14px">饮酒种类</div>
            <van-field
                label="白酒"
                v-model="form.drinkLiquor"
                placeholder="0~3000,整数"
                :rules="rules.drinkLiquor"
                class="card-input"
                label-width="36px"
                label-class="label-mr"
            >
                <template #extra>
                    <span>ml/日</span>
                </template>
            </van-field>
            <van-field
                label="啤酒"
                v-model="form.drinkBeer"
                placeholder="0~3000,整数"
                :rules="rules.drinkBeer"
                class="card-input mt-2"
                label-width="36px"
                label-class="label-mr"
            >
                <template #extra>
                    <span>ml/日</span>
                </template>
            </van-field>
            <van-field
                label="红酒"
                v-model="form.drinkRed"
                placeholder="0~3000,整数"
                :rules="rules.drinkRed"
                class="card-input mt-2"
                label-width="36px"
                label-class="label-mr"
            >
                <template #extra>
                    <span>ml/日</span>
                </template>
            </van-field>
            <van-field
                label="黄酒"
                v-model="form.drinkYellow"
                placeholder="0~3000,整数"
                :rules="rules.drinkYellow"
                class="card-input mt-2"
                label-width="36px"
                label-class="label-mr"
            >
                <template #extra>
                    <span>ml/日</span>
                </template>
            </van-field>
            <van-field
                label="其他"
                v-model="form.drinkOther"
                placeholder="0~3000,整数"
                :rules="rules.drinkOther"
                class="card-input mt-2"
                label-width="36px"
                label-class="label-mr"
            >
                <template #extra>
                    <span>ml/日</span>
                </template>
            </van-field>
        </div>
        <!-- 运动 -->
        <div class="label-title mt-2" required>运动</div>
        <div class="bg-fa">
            <div class="label-title" required style="color: #262626; font-size: 14px">有无规律活动</div>
            <van-field :rules="rules.regularExercise" style="padding: 0">
                <template #input>
                    <van-radio-group
                        v-model="form.regularExercise"
                        shape="dot"
                        direction="horizontal"
                        class="doc-radio-group-now"
                    >
                        <van-radio
                            v-for="item in store.getDict('DC00069')"
                            :key="item.value"
                            :name="item.value"
                            label-position="left"
                            style="width: 48%"
                        >
                            {{ item.name }}
                        </van-radio>
                    </van-radio-group>
                </template>
            </van-field>
        </div>
        <div v-if="form.regularExercise === 1" class="bg-fa mt-2">
            <div class="label-title" required style="color: #262626; font-size: 14px">运动强度</div>
            <van-field :rules="rules.exerciseStrength" style="padding: 0">
                <template #input>
                    <van-radio-group
                        v-model="form.exerciseStrength"
                        shape="dot"
                        direction="horizontal"
                        class="doc-radio-group-now"
                    >
                        <van-radio
                            v-for="item in store.getDict('CP00070')"
                            :key="item.value"
                            :name="item.value"
                            label-position="left"
                            style="width: 48%"
                        >
                            {{ item.name }}
                        </van-radio>
                    </van-radio-group>
                </template>
            </van-field>
        </div>
        <div class="bg-fa mt-2">
            <div class="label-title" required style="color: #262626; font-size: 14px">目前运动情况</div>
            <div class="flex">
                <van-field
                    v-model="form.nowExerciseWeek"
                    placeholder="0~50,整数"
                    :rules="rules.nowExerciseWeek"
                    class="card-input"
                >
                    <template #extra>
                        <span>次/周</span>
                    </template>
                </van-field>
                <van-field
                    v-model="form.nowExerciseMinute"
                    placeholder="0~500,整数"
                    :rules="rules.nowExerciseMinute"
                    class="card-input ml-2"
                >
                    <template #extra>
                        <span>分钟/次</span>
                    </template>
                </van-field>
            </div>
        </div>
        <div class="bg-fa mt-2">
            <div class="label-title" required style="color: #262626; font-size: 14px">目标运动情况</div>
            <div class="flex">
                <van-field
                    v-model="form.targetExerciseWeek"
                    placeholder="0~50,整数"
                    :rules="rules.targetExerciseWeek"
                    class="card-input"
                >
                    <template #extra>
                        <span>次/周</span>
                    </template>
                </van-field>
                <van-field
                    v-model="form.targetExerciseMinute"
                    placeholder="0~500,整数"
                    :rules="rules.targetExerciseMinute"
                    class="card-input ml-2"
                >
                    <template #extra>
                        <span>分钟/次</span>
                    </template>
                </van-field>
            </div>
        </div>
        <!-- 主食 -->
        <div class="label-title mt-2" required>主食</div>
        <van-field
            v-model="form.staplFood"
            placeholder="0~5000,整数"
            :rules="rules.staplFood"
            class="form-input"
        >
            <template #extra>
                <span>克/天</span>
            </template>
        </van-field>
        <!-- 目标主食 -->
        <div class="label-title mt-2" required>目标主食</div>
        <van-field
            v-model="form.targetStaplFood"
            placeholder="0~5000,整数"
            :rules="rules.targetStaplFood"
            class="form-input"
        >
            <template #extra>
                <span>克/天</span>
            </template>
        </van-field>
        <!-- 心理调整 -->
        <div class="label-title mt-2" required>心理调整</div>
        <van-field :rules="rules.psychologicalRecovery" style="padding: 0">
            <template #input>
                <van-radio-group
                    v-model="form.psychologicalRecovery"
                    shape="dot"
                    direction="horizontal"
                    class="w-full doc-radio-group"
                >
                    <van-radio
                        v-for="item in store.getDict('CP00072')"
                        :key="item.value"
                        :name="item.value"
                        label-position="left"
                    >
                        {{ item.name }}
                    </van-radio>
                </van-radio-group>
            </template>
        </van-field>
        <!-- 遵医行为 -->
        <div class="label-title mt-2" required>遵医行为</div>
        <van-field :rules="rules.doctorAdvice" style="padding: 0">
            <template #input>
                <van-radio-group
                    v-model="form.doctorAdvice"
                    shape="dot"
                    direction="horizontal"
                    class="w-full doc-radio-group"
                >
                    <van-radio
                        v-for="item in store.getDict('CP00072')"
                        :key="item.value"
                        :name="item.value"
                        label-position="left"
                    >
                        {{ item.name }}
                    </van-radio>
                </van-radio-group>
            </template>
        </van-field>
        <!-- 服药依从性 -->
        <div class="label-title mt-2" required>服药依从性</div>
        <van-field :rules="rules.medicationCompliance" style="padding: 0">
            <template #input>
                <van-radio-group
                    v-model="form.medicationCompliance"
                    shape="dot"
                    direction="horizontal"
                    class="w-full doc-radio-group"
                >
                    <van-radio
                        v-for="item in store.getDict('CP00080')"
                        :key="item.value"
                        :name="item.value"
                        label-position="left"
                    >
                        {{ item.name }}
                    </van-radio>
                </van-radio-group>
            </template>
        </van-field>
        <!-- 药物不良反应 -->
        <div class="label-title mt-2" required>药物不良反应</div>
        <van-field :rules="rules.drugsAdverse" style="padding: 0">
            <template #input>
                <van-radio-group
                    v-model="form.drugsAdverse"
                    shape="dot"
                    direction="horizontal"
                    class="w-full doc-radio-group"
                >
                    <van-radio
                        v-for="item in store.getDict('DC00069')"
                        :key="item.value"
                        :name="item.value"
                        label-position="left"
                    >
                        {{ item.name }} 
                    </van-radio>
                </van-radio-group>
            </template>
        </van-field>
        <div v-if="form.drugsAdverse === 1" class="bg-fa mt-2">
            <div class="label-title" style="color: #262626; font-size: 14px">不良反应</div>
            <van-field
                type="textarea"
                v-model="form.drugsAdverseOther"
                :maxlength="120"
                placeholder="请填写具体描述哪种药物,何种不良反应,限120字"
                class="card-input"
            />
        </div>
        <!-- 低血糖反应 -->
        <div class="label-title mt-2" required>低血糖反应</div>
        <van-field :rules="rules.glycopeniaReaction" style="padding: 0">
            <template #input>
                <van-radio-group
                    v-model="form.glycopeniaReaction"
                    shape="dot"
                    direction="horizontal"
                    class="w-full doc-radio-group"
                >
                    <van-radio
                        v-for="item in store.getDict('CP00114')"
                        :key="item.value"
                        :name="item.value"
                        label-position="left"
                    >
                        {{ item.name }}
                    </van-radio>
                </van-radio-group>
            </template>
        </van-field>
        <!-- 此次随访分类 -->
        <div class="label-title mt-2" required>此次随访分类</div>
        <van-field :rules="rules.visitType" style="padding: 0">
            <template #input>
                <van-radio-group
                    v-model="form.visitType"
                    shape="dot"
                    direction="horizontal"
                    class="w-full doc-radio-group"
                >
                    <van-radio
                        v-for="item in store.getDict('CP00085')"
                        :key="item.value"
                        :name="item.value"
                        label-position="left"
                        style="width: 48%"
                    >
                        {{ item.name }} 
                    </van-radio>
                </van-radio-group>
            </template>
        </van-field>
        <!-- 目前诊断 -->
        <div class="label-title mt-2" required>目前诊断</div>
        <van-field
            v-model="form.currentDiagnosisName"
            isLink
            readonly
            placeholder="请选择"
            :rules="rules.currentDiagnosisName"
            @click="showCurrentDiagnosis = true"
            class="form-input"
        />
        <van-popup v-model:show="showCurrentDiagnosis" position="bottom">
            <div class="p-4" style="height: 100%">
                <div class="flex justify-between items-center mb-4 pop-title">
                    <div class="greyColor" @click="showCurrentDiagnosis = false">取消</div>
                    <div>目前诊断(可多选)</div>
                    <div class="blueColor" @click="currentDiagnosisConfirm">确定</div>
                </div>
                <div style="height: 80%; overflow: auto">
                    <CheckBtn
                        multiple
                        column-2
                        :options="store.getDict('CP00086')"
                        v-model:value="form.currentDiagnosis"
                        :fieldNames="{ text: 'name', value: 'value' }"
                    />
                </div>
            </div>
        </van-popup>
        <!-- 转诊 -->
        <div class="label-title mt-2" required>转诊</div>
        <van-field :rules="rules.isReferral" style="padding: 0">
            <template #input>
                <van-radio-group
                    v-model="form.isReferral"
                    shape="dot"
                    direction="horizontal"
                    class="w-full doc-radio-group"
                >
                    <van-radio
                        v-for="item in store.getDict('DC00069')"
                        :key="item.value"
                        :name="item.value"
                        label-position="left"
                    >
                        {{ item.name }} 
                    </van-radio>
                </van-radio-group>
            </template>
        </van-field>
        <div v-if="form.isReferral === 1" class="bg-fa mt-2">
            <div style="background-color: #fff; padding: 8px; border-radius: 8px">
                <div style="color: #262626; font-size: 14px">转诊原因</div>
                <van-field
                    type="textarea"
                    v-model="form.referralReason"
                    :maxlength="120"
                    placeholder="请填写具体描述转诊原因,限120字"
                    class="form-input mt-2"
                />
            </div>
            <div style="background-color: #fff; padding: 8px; border-radius: 8px" class="mt-2">
                <div style="color: #262626; font-size: 14px">转诊机构</div>
                <van-field
                    v-model="form.referralUnitName"
                    is-link
                    readonly
                    placeholder="请选择"
                    @click="showReferralUnit = true"
                    class="form-input mt-2"
                />
                <DocUnit
                    v-model:show="showReferralUnit"
                    v-model:value="form.referralUnitId"
                    :valueName="form?.referralUnitName"
                    @change="referralUnitChange"
                />
            </div>
            <div style="background-color: #fff; padding: 8px; border-radius: 8px" class="mt-2">
                <div style="color: #262626; font-size: 14px">转诊科室</div>
                <van-field
                    v-model="form.referralOfficeName"
                    is-link
                    readonly
                    placeholder="请选择"
                    @click="showReferralOffice = true"
                    class="form-input mt-2"
                />
                <DocOffice
                    v-model:show="showReferralOffice"
                    v-model:value="form.referralOfficeId"
                    :unitId="form.referralUnitId"
                    @change="referralOfficeChange"
                />
            </div>
        </div>
        <!-- 现场随访照片 -->
        <div class="label-title mt-2">现场随访照片</div>
        <DocImageUpload
            description="最多支持上传8个文件,支持上传图片或PDF文件,图片支持上传jpg、png、jpeg格式,文件大小请勿超过10M。"
            lengthMessage="抱歉,最多可上传8个文件。"
            :imageData="[]" 
            @change="(ids, option) => form.visitImage = ids"
            :maxLength="8"
        />
    </van-form>
</template>
<script>
import { useStore } from '@/doctor/store'
import CheckBtn from '@/doctor/components/checkBtn/CheckBtn.vue'
import { checkboxReject } from '@/utils/common'
import BloodPressurePanel from '@/doctor/components/bloodPressure/BloodPressurePanel.vue'
import BloodPressureBt from '@/doctor/components/bloodPressure/BloodPressureBt.vue'
import DocUnit from '@/doctor/components/docUnit/DocUnit.vue'
import DocOffice from '@/doctor/components/docOffice/DocOffice.vue'
import DocImageUpload from '@/doctor/components/docImageUpload/DocImageUpload.vue'
export default {
    components: { CheckBtn, BloodPressurePanel, BloodPressureBt, DocUnit, DocOffice, DocImageUpload },
    inject: ['pressureObj'],
    data() {
        return {
            store: useStore(),
            form: {},
            rules: {},
            showVisitWay: false,
            showSymptom: false,
            showSignArteryPulsation: false,
            showCurrentDiagnosis: false,
            showReferralUnit: false,
            showReferralOffice: false
        }
    },
    methods: {
        checkboxReject,
        visitWayChange() {
            this.store.getDict('CP00052').forEach(item => {
                if (item.value === this.form.visitWay) {
                    this.form.visitWayName = item.name
                }
            })
            this.showVisitWay = false
        },
        symptomConfirm() {
            let list = []
            this.store.getDict('CP00059').forEach(item => {
                let selected = this.form.symptom.filter(e => e === item.value)
                if (selected && selected.length) {
                    list.push(item.name)
                }
            })
            this.form.symptomName = list.join()
            this.showSymptom = false
        },
        setPressure(val) {
            if (!val) return
            this.form.signSystolicPressure = val.systolicPressure
            this.form.signDiastolicPressure = val.diastolicPressure
        },
        signArteryPulsationChange() {
            this.store.getDict('CP00065').forEach(item => {
                if (item.value === this.form.signArteryPulsation) {
                    this.form.signArteryPulsationName = item.name
                }
            })
            this.showSignArteryPulsation = false
        },
        currentDiagnosisConfirm() {
            let list = []
            this.store.getDict('CP00086').forEach(item => {
                let selected = this.form.currentDiagnosis.filter(e => e === item.value)
                if (selected && selected.length) {
                    list.push(item.name)
                }
            })
            this.form.currentDiagnosisName = list.join()
            this.showCurrentDiagnosis = false
        },
        referralUnitChange(option = {}) {
            this.form.referralUnitName = option.unitName
        },
        referralOfficeChange(option = {}) {
            this.form.referralOfficeName = option.officeName
        },
    }
}
</script>
<style lang="less" scoped>
.first-title {
    display: flex;
    align-items: center;
    .btn-title {
        background-color: #F0F3FF;
        color: #607FF0;
        border-radius: 9999px;
        padding: 4px 16px;
        margin-left: 8px;
    }
}
.label-title {
    font-size: 13px;
    color: #595959;
    font-weight: 500;
    margin-bottom: 8px;
    &[required] {
        &::after {
            content: '*';
            color: #FF4D4F;
            font-weight: bold;
            margin-left: 4px;
        }
    }
}
.form-input {
    background-color: #FAFAFA;
    padding: 8px 12px;
    border-radius: 8px;
}
:deep(.van-cell:after) {
    border-bottom: 0px;
}
:deep(.van-popup) {
    height: 50% !important;
}
.pop-title {
    color: #262626;
    font-size: 16px;
    font-weight: 600;
}
.greyColor {
    color: var(--van-text-color-2);
    font-weight: 400;
}
.blueColor {
    color: #607FF0;
    font-weight: 500;
}
.sub-text {
    color: #595959;
    font-size: 13px;
    font-weight: 400;
    padding-bottom: 8px;
}
.tip {
    color: #FA8C16;
    font-size: 12px;
    margin-top: 8px;
    line-height: 16px;
}
.bg-fa {
    background-color: #FAFAFA;
    padding: 8px;
    border-radius: 8px;
}
.doc-radio-group-now {
    column-gap: 8px;
    row-gap: 8px;
    background-color: #FAFAFA;
    width: 100%;
    .van-radio {
        background-color: #FFFFFF;
        
        padding: 8px 12px;
        border-radius: 8px;
        justify-content: space-between;
        margin-right: 0;
    }
}
.card-input {
    padding: 8px 12px;
    border-radius: 8px;
}
</style>