<wxs src='../../utils/formatFuc.wxs' module="utils"></wxs>
<view class="supply-top">
	<view  style="background-color: white;margin-bottom: 20rpx;">
		<text>请选择工单对应技能创建补差</text>
		<radio-group style="line-height: 70rpx;" data-question-id="{{item.id}}" 	bindchange="handleOptionChange"     >
      <label class="option"  wx:for="{{orderSkillList}}" wx:key="index"  >
     		 <radio value="{{item.skillId}}" checked="{{item.skillId==skillId}}"  />{{item.skillName}}
      </label> 
    </radio-group> 
	</view>
	
	<view class="supply-item" wx:for="{{supplyList}}" wx:key="index">

		<view class="item-main">
			<view class="row-type" bindtap="showTypePicker" data-index="{{index}}">
				<view class="type-title">
					<text>*</text>补差项 {{index+1}}
				</view>
				<view class="type-content">
					{{item.itemName}}
				</view>
				<van-icon name="arrow" size="20px" color="#999" />

			</view>
			<view class="row-num">
				<view class="num-title">
					<text>*</text>选择份数
				</view>
				<view class="num-block">
					<view class="minus-btn" bindtap="minusNum" data-index="{{index}}" data-price="{{item.price}}" data-num="{{item.number}}">-</view>
					<view class="current-num">{{item.number}}</view>
					<view class="add-btn" data-price="{{item.price}}" bindtap="addNum" data-index="{{index}}" data-num="{{item.number}}">+</view>
				</view>
			</view>
			<view class="row-amount">
				<view>补差项金额</view>
				<view>¥ {{item.difTotalPrice}}元</view>
			</view>
		</view>
		<view class="item-operate-special" wx:if="{{supplyList.length==1}}">
			<view class="disable-item">
				删除补差项</view>
			<view class="add-item" bindtap="addItem">
				添加补差项
			</view>

		</view>
		<view class="item-operate" wx:if="{{supplyList.length>1}}">
			<view class="del-item" bindtap="delItem" data-index="{{index}}">
				删除补差项</view>
		</view>

	</view>
	<view class="add-item" wx:if="{{supplyList.length>1}}" bindtap="addItem">
		添加补差项
	</view>

</view>
<view class="supply-bottom">
	<view class="total-amount">
		<view class="title">总计补差金额</view>
		<view> ¥ <text>{{totalAmount}}</text> 元</view>

	</view>
	<view class="order-button" bindtap="createOrder">生成支付订单</view>
</view>
<van-popup show="{{showPicker}}" position="bottom">

	<van-picker show-toolbar columns="{{columns}}" title="请选择补差项" bind:cancel="pickerCancel" bind:confirm="pickerConfirm" />
</van-popup>