confirmWorkOrder.wxml 9.75 KB
<!--tabRepairOrder/pages/confirmWorkOrder/index.wxml-->
<wxs src="../../index.wxs" module="filter" />
<glsx-privacy appletName="生意助手员工版" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
<view class="confirm-order">
	<view class="item base-info">
		<view class="card-title">基本信息</view>
		<view class="box">
			<block wx:for="{{ baseInfoObj }}" wx:key="index">
				<view class="box-item">
					<view class="label">{{item.label}}</view>
					<view class="value" wx:if="{{ item.subObj }}">{{confirmInfo[item.subObj][item.key] || '-'}}</view>
					<view class="value" wx:else>{{confirmInfo[item.key] || '-'}}</view>
					<view class="copy" wx:if="{{ item.copy && (confirmInfo[item.subObj][item.key] || confirmInfo[item.key]) }}" bindtap="setCopyData" data-content="{{ item.subObj ? confirmInfo[item.subObj][item.key] : confirmInfo[item.key] }}">
						<image src="{{ IMG_URL }}equity/copy.png" class="copy-icon" mode="aspectFit" />
					</view>
				</view>
			</block>
		</view>
	</view>

	<view class="item staff-card">
		<view class="staff-header">
			<view class="staff-title">
				<text>施工人员</text>
				<text class="staff-subtitle">占比合计100%</text>
			</view>
		</view>
		<view class="staff-list">
			<view class="staff-row border_b {{ canEditTechnician ? 'editable' : '' }}" catchtap="showPopup">
				<view class="staff-label">主技师<text class="required">*</text></view>
				<view class="staff-right">
					<view class="staff-name text-hide {{(!mainSelected[0] && canEditTechnician) ? 'is-placeholder' : ''}}">{{mainSelected[0] && mainSelected[0].staffName || (canEditTechnician ? '请选择' : '-')}}</view>
					<view wx:if="{{mainSelected[0] && mainSelected[0].shareRatio !== '' && mainSelected[0].shareRatio !== undefined && mainSelected[0].shareRatio !== null}}" class="staff-rate">{{mainSelected[0].shareRatio + '%'}}</view>
					<image wx:if="{{ canEditTechnician }}" class="staff-arrow" src="{{ IMG_URL }}images/arrow-right.png" mode="aspectFit" />
				</view>
			</view>

			<block wx:if="{{ deputySelected && deputySelected.length }}">
				<block wx:for="{{ deputySelected }}" wx:key="index">
					<view class="staff-row {{ canEditTechnician ? 'editable' : '' }}" catchtap="showPopup" data-type="deputy">
						<view class="staff-label">副手技师</view>
						<view class="staff-right">
							<view class="staff-name text-hide">{{item && item.staffName}}</view>
							<view class="staff-rate">{{item && item.shareRatio !== '' && item.shareRatio !== undefined && item.shareRatio !== null ? item.shareRatio + '%' : ''}}</view>
							<image wx:if="{{ canEditTechnician }}" class="staff-arrow" src="{{ IMG_URL }}images/arrow-right.png" mode="aspectFit" />
						</view>
					</view>
				</block>
			</block>
			<block wx:else>
				<view class="staff-row {{ canEditTechnician ? 'editable' : '' }}" catchtap="showPopup" data-type="deputy">
					<view class="staff-label">副手技师</view>
					<view class="staff-right">
						<view class="staff-name text-hide {{ canEditTechnician ? 'is-placeholder' : '' }}">{{ canEditTechnician ? '请选择' : '-' }}</view>
						<image wx:if="{{ canEditTechnician }}" class="staff-arrow" src="{{ IMG_URL }}images/arrow-right.png" mode="aspectFit" />
					</view>
				</view>
			</block>
		</view>
	</view>

	<view class="tabs">
		<view class="tab-item {{ currentTab === 'goods' ? 'active' : '' }}" bindtap="switchTab" data-tab="goods">
			施工商品<text style="font-size: 20rpx;">({{confirmInfo.subOrderList.length}})</text>
		</view>
		<view class="tab-item {{ currentTab === 'service' ? 'active' : '' }}" bindtap="switchTab" data-tab="service">
			服务项目<text style="font-size: 20rpx;">({{serviceCount}})</text>
		</view>
	</view>

	<view class="item tab-content">
		<block wx:if="{{ currentTab === 'goods' }}">
			<view class="section-header">
				<view class="section-title">订单商品</view>
				<block wx:if="{{ confirmInfo.reworkFlag != 1 && filter.btnPermissions(userPermissions, 'CHUANGJIANSHIGONGDAN') }}">
					<block wx:if="{{ !editGoodsFlag }}">
						<view class="edit-btn" bindtap="handleEditGoods">
							<image src="{{ IMG_URL }}miniProgram/edit_icon.png" mode="aspectFit" />
							编辑
						</view>
					</block>
					<block wx:else>
						<view class="edit-btn">
							<view class="cancel" bindtap="handelGoodsCancel">取消</view>
							<view bindtap="handelGoodsConfirm">完成</view>
						</view>
					</block>
				</block>
			</view>
			<view class="order-goods">
				<block wx:if="{{ !editGoodsFlag }}">
					<view class="goods-box" wx:if="{{ confirmInfo.subOrderList.length }}">
						<view class="goods-item" wx:for="{{ confirmInfo.subOrderList }}" wx:key="index">
							<view class="goods-text">
								<view class="goods-name text-hide">
									{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || item.packageName||''}}
								</view>
								<view class="inventory" bindtap="openInventoryPopup" data-inventory="{{item}}">
									库存{{item.stock===0||item.stock?item.stock:'-'}}
								</view>
							</view>
							<view class="count">x{{item.number}}</view>
						</view>
					</view>
				</block>
				<block wx:else>
					<block wx:for="{{ editGoodsList }}" wx:key="index">
						<view class="edit-goods-box">
							<image bindtap="handleDelgoods" data-index="{{ index }}" src="{{ IMG_URL }}repair-order/del-goods.png" mode="aspectFit" />
							<view class="goods-name text-hide">
								{{filter.replaceItemText(item.upgradeGoodsAlias) ||filter.replaceItemText(item.upgradeGoodsName) || item.packageName||''}}
							</view>
						</view>
					</block>
					<view class="btn-box" bindtap="relateGoods">
						<image src="{{ IMG_URL }}repair-order/relate-goods.png" mode="aspectFit" />
						可选关联客户其他商品
					</view>
				</block>
			</view>
		</block>
		<block wx:else>
			<view class="section-header">
				<view class="section-title">服务项目</view>
				<block wx:if="{{ filter.btnPermissions(userPermissions, 'CHUANGJIANSHIGONGDAN') }}">
					<block wx:if="{{ !editServiceFlag }}">
						<view class="edit-btn" bindtap="handleEditService">
							<image src="{{ IMG_URL }}miniProgram/edit_icon.png" mode="aspectFit" />
							编辑
						</view>
					</block>
					<block wx:else>
						<view class="edit-btn">
							<view class="cancel" bindtap="handelServicesCancel">取消</view>
							<view bindtap="handelServicesConfirm">完成</view>
						</view>
					</block>
				</block>
			</view>
			<view class="service-box">
				<block wx:if="{{ !editServiceFlag }}">
					<block wx:for="{{ confirmInfo.serviceItemsList }}" wx:key="index">
						<block wx:for="{{ item.detailList }}" wx:key="sindex" wx:for-item="i" wx:for-index="sindex">
							<view class="service-item simple">
								<view class="left">
									<view class="name">{{i.itemsConfigName}}-{{i.serviceItemsName}}</view>
									<view class="bott">
										<view class="material">用料标准{{i.materialStandard || '-'}}米/件</view>
										<text class="split">|</text>
										<view class="cost">施工标准{{i.timeStandard || '-'}}min</view>
									</view>
								</view>
								<view class="count">x{{i.useNum}}</view>
							</view>
						</block>
					</block>
				</block>
				<block wx:else>
					<block wx:for="{{ editServicesList }}" wx:key="index">
						<block wx:for="{{ item.detailList }}" wx:key="sindex" wx:for-item="i" wx:for-index="sindex">
							<view class="service-item edit-item simple">
								<image bindtap="handleDelServices" data-index="{{ index }}" data-sindex="{{ sindex }}" src="{{ IMG_URL }}repair-order/del-goods.png" mode="aspectFit" />
								<view style="flex: 1;display: flex;align-items: center;justify-content: space-between;">
									<view class="left">
										<view class="name">{{i.itemsConfigName}}-{{i.serviceItemsName}}</view>
										<view class="bott">
											<view class="material">用料标准{{i.materialStandard || '-'}}米/件</view>
											<text class="split">|</text>
											<view class="cost">施工标准{{i.timeStandard || '-'}}min</view>
										</view>
									</view>
									<view class="count">x{{i.useNum}}</view>
								</view>
							</view>
						</block>
					</block>
					<view class="btn-box" bindtap="selectServices">
						<image src="{{ IMG_URL }}repair-order/add-service.png" mode="aspectFit" />
						可选新增服务项目关联施工单
					</view>
				</block>
			</view>
		</block>
	</view>
</view>
<view class="bottom-bar {{ isFullSucreen?'isFullSucreen-btn':'' }}" wx:if="{{ filter.btnPermissions(userPermissions, 'SHIGONGQUEREN') }}">
	<view class="bottom-bar__con">
		<view class="btn cancel text-center" bindtap="handleCancel">取消</view>
		<view class="btn primary text-center" bindtap="submit">确认领取施工单</view>
	</view>
</view>
<relate-goods-popup show="{{ relateGoodsVisable }}" goodsList="{{ goodsList }}" bindconfirm="handelRelateGoodsConfirm" selected="{{ editGoodsList }}" bindcancel="handelRelateGoodsCancel" baseConfigData="{{ baseConfigData }}" bind:openInventory="openInventory"></relate-goods-popup>
<technician-select-popup show="{{ artificerSelectPopup }}" title="选择技师" copyArtificerList="{{ artificerList }}" multiple="{{ technicianMultiple }}" artificerSelectObj="{{ technicianMultiple ? deputySelected : mainSelected }}" disabledSelectObj="{{ technicianMultiple ? mainSelected : deputySelected }}" bindconfirm="changeArtificer" bindcancel="cancelTechnician" deputyFlag="{{ technicianMultiple }}" idKey="uuid" />
<select-service-popup show="{{ selectServiceVisable }}" bindconfirm="handleSelectServiceConfirm" selectGoodsList="{{ confirmInfo.subOrderList }}" selected="{{ editServicesList }}" bindcancel="handleSelectServiceCancel"></select-service-popup>
<inventory-info show="{{showInventory}}" inventory-data="{{inventoryData}}" title="库存信息" bind:close="onInventoryClose" />