mattersHandle.wxml 8.92 KB
<navigation-bar showBack="{{ true }}"
                bindback="onBack"
                bindnavbarReady="navbarReady"
                navStyle="background-color:#ffffff;box-shadow:none;">
	<view class="nav-title">
		专项任务
	</view>
</navigation-bar>
<view class="handle-page {{ isReadonly ? 'handle-page--readonly' : '' }}"
      style="padding-top: {{ navBarHeight }}px;">
	<scroll-view scroll-y class="handle-scroll">
		<view class="card task-card" wx:if="{{ task }}">
			<view class="card-head">
				<view class="card-head-title">
					<text class="card-head-label">任务类型</text><text class="text-hide">{{ task.taskTypeText }}</text>
				</view>
				<view class="status text-center"
				      style="color:{{ task.statusStyle.color }};background-color:{{ task.statusStyle.background }};">
					{{ task.statusName }}
				</view>
			</view>
			<view class="info-list">
				<view class="info-row flex"
				      wx:for="{{ detailFields }}"
				      wx:key="key"
				      wx:for-item="field">
					<view class="info-label">
						{{ field.label }}
					</view>
					<view class="info-value {{ field.multiline ? 'info-value--multiline' : '' }}">
						{{ task[field.key] || '-' }}
					</view>
				</view>
			</view>
		</view>
		<view class="card reply-card" wx:if="{{ task }}">
			<block wx:if="{{ isReadonly }}">
				<view class="info-list reply-info-list">
					<view class="info-row flex">
						<view class="info-label">
							专项任务回复
						</view>
						<view class="info-value info-value--multiline reply-text">
							{{ task.replyText || '-' }}
						</view>
					</view>
					<view class="info-row flex">
						<view class="info-label">
							回复时间
						</view>
						<view class="info-value">
							{{ task.replyTimeText || '-' }}
						</view>
					</view>
					<!-- 任务执行结果 -->
					<view class="info-row flex" wx:if="{{ showTaskExecutionResult }}">
						<view class="info-label">
							任务执行结果
						</view>
						<view class="info-value">
							{{ task.executionResultCodeText || '-' }}
						</view>
					</view>
					<!-- 人员更换评估 - 已关联招聘需求 -->
					<view class="info-row flex" wx:if="{{ task.relatedRecruitDemandText }}">
						<view class="info-label">
							已关联招聘需求
						</view>
						<view class="info-value info-value--multiline">
							{{ task.relatedRecruitDemandText }}
						</view>
					</view>
					<!-- 人员更换评估 - 招聘负责人 -->
					<view class="info-row flex"
					      wx:if="{{ task.staffReplaceResult && task.staffReplaceResult.recruitmentOwnerName }}">
						<view class="info-label">
							招聘负责人
						</view>
						<view class="info-value">
							{{ task.staffReplaceResult.recruitmentOwnerName || '-' }}
						</view>
					</view>
					<!-- 人员更换评估 - 已关联驻店 -->
					<view class="info-row flex"
					      wx:if="{{ task.executionResultCode === 'LINK_REPLACEMENT_STAFF' && task.staffReplaceResult && task.staffReplaceResult.replacementStaffName }}">
						<view class="info-label">
							已关联驻店
						</view>
						<view class="info-value">
							{{ task.staffReplaceResult.replacementStaffName || '-' }}
						</view>
					</view>
				</view>
			</block>
			<block wx:else>
				<view class="card-title">
					专项任务回复<text class="required">*</text>
				</view>
				<view class="textarea-wrap">
					<gl-textarea bindinput="onReplyInput"
					             maxlength="{{ 800 }}"
					             showWordLimit
					             value="{{ reply }}"
					             placeholder="请输入"
					             placeholderColor="#bbbbbb"
					             color="#222222"
					             textStyle="font-size:28rpx;line-height:40rpx;" />
				</view>
			</block>
		</view>
		<!-- 任务执行结果单独卡片 -->
		<view class="card execution-result-card"
		      wx:if="{{ task && showTaskExecutionResult && !isReadonly }}">
			<view class="card-title">
				任务执行结果<text class="required">*</text>
			</view>
			<van-radio-group value="{{ executionResultCode }}"
			                 disabled="{{ isReadonly }}"
			                 class="radio-box"
			                 direction="horizontal"
			                 bindchange="handleRadio">
				<van-radio wx:for="{{ executionResultCodeOptions }}"
				           class="radio-item"
				           wx:key="value"
				           name="{{ item.value }}"
				           shape="round"
				           checked-color="#2c66f7"
				           icon-class="radio-icon">
					{{ item.label }}
				</van-radio>
			</van-radio-group>
			<!-- 人员更换评估 - 更换选项 -->
			<view wx:if="{{ showReplaceOptions }}" class="replace-options">
				<!-- 选项按钮始终显示 -->
				<view class="replace-options-list">
					<view wx:for="{{ replaceOptions }}"
					      wx:key="value"
					      class="replace-option {{ replaceSelectedOption === item.value ? 'replace-option--active' : '' }}"
					      bindtap="onReplaceOptionTap"
					      data-value="{{ item.value }}">
						{{ item.label }}
					</view>
				</view>
				<!-- 已选择具体内容后显示回显和编辑 -->
				<view wx:if="{{ selectedRecruitDemandText || selectedStaffText }}"
				      class="replace-result">
					<view class="replace-result-header">
						<text class="replace-result-title"> {{ replaceSelectedOption === 'LINK_REPLACEMENT_STAFF' ? '已关联驻店' : '已关联招聘需求' }} </text>
						<text class="replace-result-edit" bindtap="onEditReplaceOption">{{ replaceSelectedOption == 'CREATE_RECRUITMENT_DEMAND' ? '新增' : '编辑' }}</text>
					</view>
					<view class="replace-result-text">
						{{ selectedRecruitDemandText || selectedStaffText }}
					</view>
				</view>
			</view>
		</view>
	</scroll-view>
	<view class="footer-bar isFullSucreen" wx:if="{{ !isReadonly }}">
		<view class="submit-btn" bindtap="submit">
			提交
		</view>
	</view>
	<!-- 发起招聘弹窗 -->
	<recruit-popup show="{{ showRecruitPopup }}"
	               store-id="{{ task.storeId }}"
	               store-name="{{ task.storeName || task.merchantName }}"
	               business-type="{{ task.businessType }}"
	               business-type-name="{{ task.businessName }}"
	               recruit-type-name="人员更换评估"
	               task-center-id="{{ task.id || task.taskCenterId }}"
	               bind:close="closeRecruitPopup"
	               bind:success="onRecruitSuccess" />
	<!-- 关联已有招聘弹窗 -->
	<select-popup show="{{ showLinkRecruitPopup }}"
	              title="关联已有招聘"
	              options="{{ recruitDemandOptions }}"
	              value="{{ selectedRecruitDemandValues }}"
	              label-key="displayText"
	              value-key="recruitId"
	              height="60%"
	              allow-search="{{ true }}"
	              bind:confirm="onRecruitDemandConfirm"
	              bind:cancel="closeLinkRecruitPopup" />
	<!-- 关联另一个驻店弹窗 -->
	<van-popup show="{{ showLinkStaffPopup }}"
	           position="bottom"
	           round
	           bind:close="closeLinkStaffPopup"
	           custom-style="height: 70%">
		<view class="staff-popup">
			<view class="staff-popup-title">
				员工选择
			</view>
			<!-- 搜索框 -->
			<view class="staff-search">
				<van-search model:value="{{ staffSearchKeyword }}"
				            shape="round"
				            placeholder="搜索员工姓名"
				            bind:search="onStaffSearchConfirm"
				            bind:clear="onStaffSearchClear" />
			</view>
			<!-- 员工列表 -->
			<scroll-view scroll-y
			             class="staff-list"
			             bindscrolltolower="onStaffScrollToLower"
			             lower-threshold="50">
				<view class="staff-list-content">
					<block wx:for="{{ staffOptions }}" wx:key="staffUuid">
						<view class="staff-item {{ currentSelectedStaff.staffUuid === item.staffUuid ? 'staff-item--active' : '' }}"
						      data-item="{{ item }}"
						      bindtap="onStaffItemTap">
							<view class="staff-name">
								{{ item.staffName }}
							</view>
							<view class="staff-check"
							      wx:if="{{ currentSelectedStaff.staffUuid === item.staffUuid }}">
								<van-icon name="success"
								          color="#2c66f7"
								          size="18px" />
							</view>
						</view>
					</block>
					<!-- 加载状态 -->
					<view class="staff-loading" wx:if="{{ staffLoading }}">
						<van-loading size="20px" /><text>加载中...</text>
					</view>
					<!-- 没有更多 -->
					<view class="staff-no-more"
					      wx:if="{{ !staffHasMore && staffOptions.length > 0 }}">
						没有更多了
					</view>
					<!-- 空状态 -->
					<view class="staff-empty"
					      wx:if="{{ !staffLoading && staffOptions.length === 0 }}">
						<text>暂无数据</text>
					</view>
				</view>
			</scroll-view>
			<!-- 底部按钮 -->
			<view class="staff-footer">
				<view class="staff-footer-cancel" bindtap="closeLinkStaffPopup">
					取消
				</view>
				<view class="staff-footer-confirm" bindtap="onStaffConfirm">
					确定
				</view>
			</view>
		</view>
	</van-popup>
</view>