<view class="add-inpatient-information">
    <form onSubmit="onSubmit">
        <view class="page-section">
            <view class="form-row">
                <view class="form-row-label">关系</view>
                <!-- 编辑状态，禁用 -->
                <view
                  class="form-row-content span-input"
                  onTap="{{ isEdit === 'NO' ? 'onChoosePatientRelation': '' }}"
                  style="{{ opacity: `${isEdit === 'YES' ? '0.4': '1'}`}}"
                >
                  <text>{{ form.relationShip }}</text>
                  <view class="row-icon" a:if="{{ isEdit === 'NO' }}">
                      <am-icon type="right" size="20" color="#CCCCCC"/>
                  </view>
                </view>
            </view>
        </view>
        <view class="page-section">
            <view class="form-row">
                <view class="form-row-label">就诊人姓名</view>
                <view class="form-row-content">
                    <input
                        enableNative="{{ false }}"
                        value="{{ form.name }}"
                        name="name"
                        onInput="onInputAll"
                        data-name="name"
                        disabled="{{ isEdit === 'YES' }}"
                        class="input"
                        placeholder="请输入真实姓名" />
                </view>
            </view>
            <view class="form-row">
                <view class="form-row-label">就诊人性别</view>
                <view class="form-row-content">
                  <radio-group class="form-radio-group" data-name="sex" name="sex" onChange="onInputAll">
                    <label class="form-radio" a:for="{{sex}}" key="label-{{index}}">
                      <radio color="#1677FF" value="{{item.name}}" class="vc" checked="{{form.sex === item.value}}" disabled="{{isEdit === 'YES'}}" />
                      <text class="radio-text">{{item.value}}</text>
                    </label>
                  </radio-group>
                </view>
            </view>
        </view>
        <view class="page-section">
            <view class="form-row">
                <view class="form-row-label">证件类型</view>
                <view class="form-row-content">
                  <picker value="{{index}}" range="{{certTypes}}" disabled="{{ isEdit === 'YES' }}">
                    <view class="input-control span-input" style="{{ opacity: `${isEdit === 'YES' ? '0.4': '1'}`}}">
                      <text>{{ form.idCardType }}</text>
                      <am-icon a:if="{{ isEdit === 'NO' }}" size="18" type="right" color="#ccc" />
                    </view>
                  </picker>

                </view>
            </view>
            <view class="form-row">
                <view class="form-row-label">证件号码</view>
                <view class="form-row-content">
                    <input
                        enableNative="{{ false }}"
                        value="{{ form.idCardNo }}"
                        disabled="{{ isEdit === 'YES' }}"
                        onInput="onInputAll"
                        data-name="idCardNo"
                        name="idCardNo"
                        class="input"
                        placeholder="请输入证件号码"
                    />
                      <view a:if="{{ isEdit === 'NO' }}" class="row-icon" onTap="onLaunchOcr">
                        <image mode="scaleToFill" src="https://gw.alipayobjects.com/mdn/rms_373ab8/afts/img/A*w6MrS5tmnFAAAAAAAAAAAAAAARQnAQ" class="telephone-img"/>
                    </view>
                </view>
            </view>
        </view>
        <view class="page-section">
            <view class="form-row">
                <view class="form-row-label">手机号码</view>
                <view class="form-row-content">
                    <input
                        enableNative="{{ false }}"
                        name="phoneNumber"
                        class="input"
                        value="{{ form.phoneNumber }}"
                        onInput="onInputAll"
                        data-name="phoneNumber"
                        placeholder="用于就诊人接收就诊短信通知"
                    />
                    <view class="row-icon" onTap="onChooseType">
                        <image mode="scaleToFill" src="https://gw.alipayobjects.com/mdn/rms_373ab8/afts/img/A*nta9QpHSTvkAAAAAAAAAAAAAARQnAQ" class="telephone-img"/>
                    </view>
                </view>
            </view>
        </view>
        <view class="page-section">
            <view class="form-row">
                <view class="form-row-label">住院号</view>
                <view class="form-row-content">
                    <input
                        enableNative="{{ false }}"
                        value="{{ form.inpatientNo }}"
                        disabled="{{ isEdit === 'YES' }}"
                        name="inpatientNo"
                        class="input"
                        onInput="onInputAll"
                        data-name="inpatientNo"
                        placeholder="请输入住院号" />
                </view>
            </view>
        </view>
        <!-- 按钮 -->
        <view class="save-btn">
            <button class="save-btn-inner {{disableButton ? 'disable-button' : ''}}" disabled="{{disableButton}}" size="default" formType="submit">保存</button>
        </view>
        <!-- 选择就诊人关系弹窗 -->
        <inpatient-selection />
    </form>
</view>
