<wxs src='/utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
<loading wx:if="{{loading}}" loadingName="加载中" backgroundColor="#f2f2f2;" opacity="0.8"></loading>

<van-sticky scroll-top="0">
  <!-- 查询条件 -->
  <dk-dropdown-menu model:value="{{searchForm}}" menuList="{{searchContent}}" pullMenuList="{{pullMenuList}}" bind:search="searchData" searchTextPlaceholder="{{wxmlUtil.setSearchPlaceholder($t,['rpNo','skuName'])}}">
  </dk-dropdown-menu>

</van-sticky>



<view wx:for="{{tableData}}" data-item="{{item}}" wx:key="index" class="main-class-source">
  <view class="main-foot-source" style="border-radius: 15rpx;">
    <view class="table-content" data-item="{{item}}">
      <view style="padding:16rpx;">
        <view style="display:flex;justify-content: left;align-items: center;">
          <view style="width: 20%;display: flex;">
            <van-checkbox checked-color="#E4002B" value="{{ item.checked }}" data-index="{{index}}" data-index_="{{index_}}" bind:change="onListItemChange"></van-checkbox> <view style="color:#95A8CB;font-size:13px;padding-left: 6px;">全出</view>
          </view>
          <view style="width: 60%;">
            <view style="font-size: 26rpx;color:#1B365D">{{item.outNo}}</view>
            <view style="font-size: 24rpx;color:#95A8CB;padding-top:10rpx"> {{item.makeTime ? wxmlUtil.format(item.makeTime) : ''}}</view>
          </view>
          <view style="width: 20%;text-align: right;font-size: 26rpx;color:#1B365D">销售出库</view>
        </view>
      </view>
      <view wx:for="{{item.goodsList}}" wx:for-item="item_" wx:for-index="index_">
        <view style="display: flex;" data-index="{{index}}" data-index_="{{index_}}">
          <view style="place-self: center;padding-left: 15rpx;padding-right: 15rpx;">
            <view style="display: flex;padding-left: 10rpx;">
              <van-checkbox checked-color="#E4002B" value="{{ item_.checked }}" data-index="{{index}}" data-index_="{{index_}}" bind:change="onChangeItemCheckbox" checked-color="#E4002B"></van-checkbox>
              <view class="red-checkbox" style="{{item_.checked ? 'color:#E4002B;' : ''}}">出</view>
            </view>
          </view>
          <view class="border-solid" style="{{index_ === 0 ? (item.goodsList.length  == 1 ? 'margin-top:30rpx;margin-bottom:30rpx;' : 'margin-top:30rpx;') : index_ ===(item.goodsList.length -1) ? 'margin-bottom:30rpx;': ''}}"></view>
          <view style="display: flex;width: 100%;">
            <view style="padding:20rpx;">
              <van-image radius="5px" width="80" height="80" src="{{item_.skuImages? item_.skuImages.path : ''}}" />
            </view>
            <view style="width: 100%;padding:20rpx;padding-left: 10rpx;">
              <view>
                <dk-title titleTag="{{item_.brandName}}" title="{{item_.skuCode}}"></dk-title>
              </view>
              <view>
                <view style="width: 100%;margin-top: 10rpx;" class="font">{{item_.skuModel?item_.skuModel:''}}</view>
              </view>
              <view style="display: flex;width: 100%;margin-top: 20rpx;">
                <view style="width: 50%;">
                  <dk-cell contentFontSize="15" height="25rpx" fontWeight="bold" left="0rpx" contentColor="#FF7B1A" title="" content="{{ item_.priceOut ? item_.priceOut : 0}}"></dk-cell>
                </view>
                <view style="width: 50%;font-size:24rpx;color: #1B365D;line-height: 34rpx;font-weight: bold;text-align: right;">{{ ' x ' + (item_.outQty ? item_.outQty : 0)}}</view>
              </view>
            </view>
          </view>
        </view>
        <view wx:if="{{index_ !== (item.goodsList.length -1)  && item.goodsList.length > 1}}" style="text-align: center;margin-left: 30rpx;margin-right: 30rpx;">
          <view style="border: solid 1rpx #A0A2A7;"></view>
        </view>
      </view>
    </view>
  </view>
</view>

<van-empty wx:if="{{!tableData[0].goodsList || tableData[0].goodsList.length ==0}}" description="暂无出库单" />

<view style="height: 200rpx;"></view>


<dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{true}}" btnRightFlag="{{true}}" buttonList="{{buttonSaveList}}" contentList="{{contentSaveList}}" bind:open="toAdd"></dk-save-button>