<wxs module="format" src="/utils/format.wxs"></wxs>
<view class="header_title">
	<view class="header_title_row">
		<van-row>
			<van-col span="4">
				<view class="header_img" bindtap="returnToPage">
					<image src="/images/left.png"></image>
				</view>
			</van-col>
			<van-col span="16">
				<view class="header_name">新增申请明细</view>
			</van-col>
		</van-row>
	</view>
</view>
<view class="max_content">
	<view class="inspect_info" wx:for="{{detailDataList}}" wx:key="index">
		<view class="module_title module_title_flex">
			<view class="text_active">申请明细 {{ format.indexNumFormat(index) }}</view>
			<view class="module_see_info_delete" wx:if="{{index != 0}}" bindtap="delApplyDetail" data-index="{{index}}">
				<van-icon name="delete" /> 删除
			</view>
		</view>
		<view class="inspect_info_list">
			<input placeholder="请选择申请明细" placeholder-style="color:#6777aa;" class="inspect_input_fill_in" value="{{item.showDetailsName}}" data-index="{{index}}" bindtap="onShowPopup" disabled="disabled" />
			<van-popup show="{{ item.showDetailsPopup }}" data-index="{{index}}" bind:close="onClosePopup" position="bottom" round="5">
				<van-tree-select items="{{ dataList }}" main-active-index="{{ item.mainActiveIndex }}" active-id="{{ item.activeId }}" data-index="{{index}}" bind:click-nav="onClickNav" bind:click-item="onClickItem">
				</van-tree-select>
			</van-popup>
		</view>
		<view class="inspect_info_list">
			<van-row>
				<van-col span="12">
					<input type="number" placeholder="填写申请数量" placeholder-style="color:#6777aa;" class="inspect_input_fill_in" data-index="{{index}}" bindinput="onInputNumber" />
				</van-col>
				<van-col span="12">
					<voucher-select columns="{{item.assetsUnits}}" placeholder="选择单位名称" selectValue="{{item.useUnitIndex}}" data-index="{{index}}" bindchange="onSelectUnit"></voucher-select>
				</van-col>
			</van-row>
		</view>
		<view class="inspect_info_list" wx:if="{{options.category=='wzl'}}">
			<input placeholder="请填写规格型号" placeholder-style="color:#6777aa;" class="inspect_input_fill_in" value="{{item.assetsVersion}}" bindinput="onInputVersion" data-index="{{index}}" maxlength="32" />
		</view>
		<view class="inspect_info_list">
			<textarea placeholder="请填写使用说明（500字内）" placeholder-style="color:#6777aa;" class="add_textarea" value="{{item.useReason}}" bindinput="onInputUseReason" data-index="{{index}}" maxlength="500" />
		</view>
	</view>

	<view class="inspect_new_issues_max">
		<view class="inspect_new_issues" bindtap="newApplyDetail">
			<van-icon name="add-o" style="position: relative;top:5rpx;font-size: 30rpx;" /> 添加申请明细
		</view>
	</view>

	<view class="problem_submit_to">
		<view class="problem_submit_to_btn" bindtap="returnToPage">取消</view>
		<view class="problem_submit_to_btn problem_submit_to_save" bindtap="onSave">提交申请</view>
	</view>
</view>