<!-- 前台导入wxmlUtil.wxs -->
<wxs src='../../../../utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
<wxs src='../../../../utils/numberFormat.wxs' module="numberFormat"></wxs>
<van-dialog id="van-dialog" />

<!-- 蓝色信息相关 -->
<view style="margin: 0px 34rpx 26rpx 34rpx;border-radius: 15rpx;box-shadow:2px 2px 5px #e5e5e6;">
  <view style="flex-direction: column;justify-content: center;align-items: flex-start;background: linear-gradient(98deg, #D5DEFF 0.78%, #F3FAFF 74.78%);border-radius: 15rpx;">
    <!-- 供应商 -->
    <view style="display: flex;padding-right: 32rpx;">

      <view style="padding-left: 32rpx;padding-top: 19rpx;width: 39rpx;">
        <view catchtap="toCustomer" style="width: 39rpx;height: 39rpx;background-color: #95A8CB;border-radius:50%;">
          <view style="width: 39rpx; height: 39rpx;text-align: center;">
            <van-image round width="28rpx" height="28rpx" src="/static/image/purchase-order-icon.png" />
          </view>
        </view>
      </view>
      <view style="padding-left: 14rpx;padding-top: 19rpx;font-size: 13px;line-height: 36rpx;color: #002340; font-weight: 600;">
        {{item.supplierName}}
      </view>
      <!-- <view wx:if="{{item.flgValid}}" data-item="{{item}}"  bind:tap="toEdit" style="text-align:center;position:absolute;right: 50px;top:10px;">
          <van-image custom-class="image-class" src="/static/image/edit.png" />
      </view> -->
    </view>
    <!-- 收货人 -->
    <view style="display: flex;padding-right: 32rpx;">

      <view style="padding-left: 32rpx;padding-top: 19rpx;width: 39rpx;">
        <view catchtap="toCustomer" style="width: 39rpx;height: 39rpx;background-color: #95A8CB;border-radius:50%;">
          <view style="width: 39rpx; height: 39rpx;text-align: center;">
            <van-image round width="20rpx" height="24rpx" src="/static/image/Vector.png" />
          </view>
        </view>
      </view>
      <view style="padding-left: 14rpx;padding-top: 19rpx;font-size: 26rpx;line-height: 36rpx;color: #002340;">
        {{item.staffName ? item.staffName : ''}}
      </view>

      <view style="padding-left: 22rpx;padding-top: 19rpx;font-size: 26rpx;line-height: 36rpx;color: #002340;">
        {{item.orgName ? "|  "+item.orgName : ''}}
      </view>


    </view>

    <!-- 日期 -->
    <view style="display: flex;padding-left: 32rpx;padding-top: 16rpx;padding-bottom: 15rpx;padding-right: 32rpx;">
      <view style="display: flex; width: 50%;line-height: 36rpx;" data-type='deliveryType'>
        <view style="font-size: 24rpx;line-height: 36rpx;color: #002340;">
          {{$t['makingTime']}}：{{item.makeTime ? wxmlUtil.format(item.makeTime) : '' }}
        </view>
      </view>
      <view style="display: flex; width: 50%;line-height: 36rpx;" data-key="DeliveryFlag" catchtap="openData">
        <view style="font-size: 24rpx;line-height: 36rpx;color: #002340;">
          {{$t['receivingDate']}}：{{ item.pickupDate ? wxmlUtil.format(item.pickupDate) : '' }}
        </view>
      </view>
    </view>
  </view>
</view> 
 

<view class="dk-card-outer-class-1">
  <!--对象-->
  <view class="dk-card-class">
    <view style="display: flex;padding:10rpx;">
    <!-- 订单数量 -->
      <view style="background-color:#F4F9FF;width:50%;padding:10rpx;border-radius: 16rpx;">
        <view style="font-size:13px;text-align: center;margin-top: 10rpx;">{{$t['orderQty']}}</view>
        <dk-cell left="0rpx" center="center" fontSize="13" contentFontSize="18" contentColor="#1B365D" spaceWidth="0" contentFontWeight="700" content="{{item.sumQuantity}}"percentSignFlag="{{true}}"amount="{{false}}"></dk-cell>
      </view>
      <!-- 入库数量 -->
      <view style="background-color:#F4F9FF;width: 50%;padding:10rpx;border-radius: 16rpx;margin-left: 20rpx;"data-quantity="{{item.sumWarehousing ? item.sumWarehousing: 0}}" data-type="inventoryQty" data-item="{{item}}" bind:tap="toJumpPage">
        <view style="font-size:13px;text-align: center;margin-top: 10rpx;">{{$t['inventoryQty']}}</view>
        <dk-cell left="0rpx" center="center" fontSize="15" contentFontSize="18" contentColor="#1B365D" spaceWidth="0" contentFontWeight="700" content="{{item.sumWarehousing ? item.sumWarehousing: 0}}"percentSignFlag="{{true}}"amount="{{false}}"></dk-cell>
      </view>
    </view>


    <view style="display: flex;padding:10rpx;">
    <!-- 退货数量 -->
      <view style="background-color:#F4F9FF;width:50%;padding:10rpx;border-radius: 16rpx;" data-quantity="{{item.returnQty ? item.returnQty: 0}}" data-type="returnQty" data-item="{{item}}" bind:tap="toJumpPage">
        <view style="font-size:13px;text-align: center;margin-top: 10rpx;">{{$t['returnQty']}}</view>
        <dk-cell left="0rpx" center="center" fontSize="13" contentFontSize="18" contentColor="#1B365D" spaceWidth="0" contentFontWeight="700" content="{{item.returnQty ? item.returnQty  : 0}}"percentSignFlag="{{true}}"amount="{{false}}"></dk-cell>
      </view>
      <!-- 退货数量 -->
      <view style="background-color:#F4F9FF;width: 50%;padding:10rpx;border-radius: 16rpx;margin-left: 20rpx;"data-quantity="{{item.inboundReturnQty ? item.inboundReturnQty: 0}}" data-type="returnAndOutbound" data-item="{{item}}" bind:tap="toJumpPage">
        <view style="font-size:13px;text-align: center;margin-top: 10rpx;">{{$t['returnAndOutbound']}}</view>
        <dk-cell left="0rpx" center="center" fontSize="15" contentFontSize="18" contentColor="#1B365D" spaceWidth="0" contentFontWeight="700" content="{{item.inboundReturnQty ? item.inboundReturnQty : 0}}"percentSignFlag="{{true}}"amount="{{false}}"></dk-cell>
      </view>
    </view>
  </view>
</view>

<!-- 商品信息 和 其他信息 -->
<dk-form-bill id="{{formName}}"  type="pur" routeObjName="{{routeObjName}}" readonly="{{true}}" cardList="{{cardList}}"   titleCol="skuModel" descCol="skuName"subCol="calculationFormula" priceCol="pricePur"pupPriceCol="sumPrice" quantityCol="itemQty" iconCol="imagesUrl"sumAmountCol="itemAmt"sumQuantityCol="itemQty"  contentObj="{{contentObj}}" model:value="{{formData}}" popContent="{{popContent}}" bind:chooseData="chooseData" popType="sale" priceTitle="{{$t['wholesalePrice']}}：">
</dk-form-bill>

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

<!-- 新建按钮 -->
<dk-save-button btnAutoWidthFlag="{{false}}" btnRightFlag="{{true}}" buttonList="{{buttonList}}" contentList="{{contentList}}" bind:open="open"></dk-save-button>


<!-- 底部编辑 以后要做 todo......... -->
<!-- <view wx:if="{{item.flgValid}}" style="position: fixed;bottom: 230rpx;right: 30rpx;">
  <view data-item="{{item}}" bind:tap="toEdit" class="btn-add-class">
    <van-icon name="edit" color="#FFFFFF" size="60rpx" />
  </view>
</view> -->
<!-- 编辑  -->
<view wx:if="{{item.flgValid}}" style="position: fixed;bottom: 230rpx;right: 30rpx;z-index: 99;" bindtap="toEdit">
  <image src="{{imageUrl + 'edit.png'}} " class="edit-class"  />
</view>