staffDailyReport.wxml 2.2 KB
<!-- TEST-ID: IT-ROUTE-002 packageDynamicForm.staffDailyReport -->
<view class="layout">
	<navigation-bar bindback="jump" bindnavbarReady="navbarReady" showBack="{{ true }}">
		<view class="navigation-title">
			<view class="navigation-title-text text-hide">{{ merchantName || pageTitle }}</view>
		</view>
	</navigation-bar>

	<view style="margin-top:{{ navBarHeight }}px">
		<weekCalendar
			timeBean="{{ timeBean }}"
			bind:lastWeek="lastWeek"
			bind:nextWeek="nextWeek"
			bind:dayClick="dayClick"
		></weekCalendar>
	</view>

	<view class="loading-panel" wx:if="{{ loading }}">
		<view class="loading-skeleton"></view>
		<view class="loading-skeleton loading-skeleton--short"></view>
		<view class="loading-skeleton"></view>
	</view>

	<view class="error-panel" wx:elif="{{ loadError }}">
		<view class="error-panel__text">{{ loadError }}</view>
		<view class="error-panel__btn" bindtap="loadFormData">重新加载</view>
	</view>

	<scroll-view
		wx:else
		class="main {{ formDisabled ? 'main--readonly' : '' }}"
		scroll-y
		enhanced
		show-scrollbar="{{ false }}"
	>
		<dynamic-form
			fixedFields="{{ fixedFields }}"
			section-groups="{{ sectionGroups }}"
			groupFields="{{ groupFields }}"
			values="{{ values }}"
			errors="{{ errors }}"
			disabled="{{ formDisabled }}"
			request-context="{{ requestContext }}"
			group-active-index="{{ groupActiveIndex }}"
			group-row-visible-map="{{ groupRowVisibleMap }}"
			group-row-total-map="{{ groupRowTotalMap }}"
			bind:change="onFieldChange"
			bind:groupadd="onGroupAdd"
			bind:groupremove="onGroupRemove"
			bind:groupnav="onGroupNav"
			bind:groupchange="onGroupChange"
		></dynamic-form>
		<view class="btns" wx:if="{{ isDateWithinEditableWindow }}">
			<view class="btns-con btns-con--stack">
				<block wx:if="{{ !isReportSubmitted }}">
					<view class="confirm text-center" bindtap="submit">提交</view>
				</block>
				<block wx:else>
					<view wx:if="{{ !isEditReport }}" class="confirm text-center" bindtap="editReport">编辑</view>
					<block wx:else>
						<view class="confirm text-center" bindtap="submit">保存</view>
						<view class="save text-center" bindtap="cancelReport">取消</view>
					</block>
				</block>
			</view>
		</view>
	</scroll-view>
</view>