<wxs src='../../../../utils/numberFormat.wxs' module="numberFormat"></wxs>
<wxs src='/utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
<loading wx:if="{{loading}}" loadingName="加载中" backgroundColor="#f2f2f2;" opacity="0.8"></loading>
<!-- 客户资料 -->
<!-- 客户信息组件 -->
<!-- <dk-customer-detail customerName="{{form.customer.customerName}}" textColor="black" backgroundColor="white,white,white"
 customerPhone="{{form.customer.customerPhone}}"  
 addressFull="{{form.customer.addressFull}}"></dk-customer-detail> -->
 <van-dialog id="van-dialog" />

<!-- 客户信息 -->
<view style="margin: 42rpx 34rpx 0rpx 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(90.12deg, #718AC6 0.84%, #4A5E98 99.43%);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="20rpx" height="24rpx" src="/static/image/Vector.png" />
          </view>

        </view>

      </view>


      <view style="padding-left: 14rpx;padding-top: 19rpx;font-size: 13px;line-height: 36rpx;color: #FFFFFF;">
        {{form.customer.customerName}}
      </view>


      <view style="padding-left: 22rpx;padding-top: 19rpx;font-size: 13px;line-height: 36rpx;color: #FFFFFF;">
        {{form.customer.customerPhone}}
      </view>

    </view>
    <view style="display: flex;padding-right: 32rpx;padding-bottom: 15rpx;">

      <view style="padding-left: 32rpx;padding-top: 15rpx;font-size: 13px;line-height: 36rpx;color: #FFFFFF;">
        {{wxmlUtil.addressToIndexOf(form.customer.addressFull)}}
      </view>
    </view>


    <van-field wx:if="{{page == 'orderBilling' && form.sumAmount < 0}}"  label="退货账号" data-key="bankAccount" placeholder="请输入退货账号"
      value="{{form.customer.bankAccount}}" input-align="right" border="{{ false }}"   bind:change="onChangeBankAccount"/>

  </view>
</view>
<view style="margin: 0rpx 34rpx 0rpx 34rpx;border-radius: 15rpx;" wx:if="{{type == 0 ||  type == 1 || type == 2 ||type == 4}}">
  <van-tabs color="#1989FD" nav-class="van-tabs-class" active="{{ active }}" bind:change="onChangeTabs" color="#DEC9A3;" title-active-color="#1B365D" title-inactive-color=" #96A7C5;">
    <van-tab title="结算方式">
    </van-tab>
    <van-tab title="附件">
    </van-tab>
  </van-tabs>

</view>

<!-- 收款方式 -->
<view wx:if="{{active == 0}}" style="margin: 24rpx 34rpx 26rpx 34rpx;">
  <scroll-view scroll-y="true" style="height:775rpx;" bindscrolltolower="paging" scroll-top="{{topNum}}">
    <view wx:for="{{settlementTypeList}}" style="width: 100%;">
    <view class="choose-item {{(item.checked == true && item.imageReceiptCode_ping) ? 'choose-item-select' : 'choose-item-unchecked'}}">
      <view class="thick-line" wx:if="{{item.checked}}"></view>
      <view style="width:40rpx;place-self: center;padding-left: 34rpx;">

        <view style="position: relative;">
          <van-checkbox value="{{item.checked}}" data-index="{{index}}" data-item="{{item}}" catchtap="catchtapCheck"  checked-color="#1989FA" />
        </view>
      </view>

      <view class="choose-item-two" style="{{(item.checked == true && item.imageReceiptCode_ping) ? 'padding-top:63rpx;' : 'display: flex;  align-items: center;'}}">

        <view class="type-name">
          {{item.typeName ? item.typeName : ''}}
        </view>


        <view style="margin-left:{{item.checked == true ? '0rpx' : '27rpx'}}; ">
          <dk-van-tag color="#EAF1FF" textColor="#606EB2" radius="3rpx" roundFlag="{{true}}" value="{{item.accountname ? item.accountname : ''}}账户"></dk-van-tag>
        </view>

        <view wx:if="{{item.checked && settlementTypeListLength > 1 }}" style="text-align:left;padding-top: 10rpx;">
          <dk-number-input  negative="{{form.sumTempAmount < 0 ?true:false}}"  signSize="11px" center="left" fontSize="15" inputColor="#CAA977;" fontWeight="500" data-key="priceSale"  inputValue="{{item.sumAmount ? item.sumAmount : 0}}" data-value="{{item.sumAmount}}" data-index="{{index}}" bind:triggerBindValue="sumAmountBindValue" bind:triggerBindBlur=""></dk-number-input>
        </view>
      </view>
      <view class="image-code" wx:if="{{item.checked && item.imageReceiptCode && item.imageReceiptCode_ping}}" style="margin-top: 32rpx;margin-right: 40rpx;margin-bottom: 26rpx;border: 1rpx solid #000000;border-radius: 15rpx;">
        <image wx:if="{{item.imageReceiptCode && item.imageReceiptCode_ping}}" style="height:166rpx;width:166rpx;border-radius: 15rpx;" src="{{item.imageReceiptCode_ping}}" bindtap="previewImg" data-imgUrl="{{item.imageReceiptCode_ping}}" />
      </view>
    </view>
  </view>
  <view style="height: 180rpx;"></view>
  </scroll-view>

</view>



<view wx:if="{{active == 1}}"  style="margin: 10px 32rpx 20px 32rpx;margin-top: 41rpx;border-radius: 15rpx;box-shadow:2px 2px 5px #e5e5e6;">
    <view style="background: #FFFFFF;box-shadow: 0rpx 10rpx 20rpx rgba(225, 229, 238, 0.6);border-radius: 15rpx 15rpx 15rpx 15rpx;">
   
   
      <dk-remarks-magnifier bind:onChange="changeField" data-key="remarks" label="备注" value="{{ form.remarks }}"></dk-remarks-magnifier>

        <view style=" padding: 10px 32rpx 10px 32rpx;color: #95A8CB;font-size: 14px;">附件</view>


        <view style="display:flex;width:100%;margin: 1vw; padding-top: 20rpx;padding-bottom: 25rpx;">
            <!-- <view style="width: 30%; flex:1;color: #95A8CB;font-size: 28rpx;padding-left: 27rpx;"></view> -->
            <view style="width: 98%;text-align: left;">
                <van-uploader max-count="5" accept="image" style="margin-left: 4%;border-radius: 15rpx;" preview-size="160rpx;" file-list="{{ fileList }}" bind:delete="deleteImg" bind:after-read="afterRead" multiple="true" imageFit="aspectFit" />
            </view>
        </view>

    </view>


</view>


<!-- 确认收款 -->
<view style="position:fixed;bottom:0;width:100%;z-index: 10; ">

  <!-- 请输入收款金额 -->
  <view style="z-index: 11;background-color:white;margin-bottom:90rpx;margin-left: 55rpx;margin-right: 55rpx;border-radius: 15rpx;height:256rpx;">

    <view style="height: 38rpx;"></view>
    <view style="text-align:center;font-size: 15px;line-height: 20px;color: #1B365D;">
      <dk-text fontSize="15px" value="需收款"></dk-text>
    </view>
    <view style="padding-top: 10rpx; text-align:center; display: flex; justify-content: center;">

      <dk-number-input readonly="{{settlementTypeListLength > 1}}" negative="{{form.sumTempAmount < 0 ?true:false}}" signSize="15px" fontSize="27" color fontWeight="600" data-key="priceSale"  inputValue="{{form.sumAmount}}" data-value="{{form.sumAmount}}" bind:triggerBindValue="changeSalesPriceField" bind:triggerBindBlur="sumAmountBindinputBlur"></dk-number-input>
    </view>

    <view style="z-index: 12;margin-top:40rpx;box-shadow: 0px 4rpx 16rpx rgba(190, 144, 73, 0.5);border-radius: 15rpx;">

      <van-button round size="large" disabled="{{loadingButtonFlag}}" loading="{{loadingButtonFlag}}" color="#CAA977" custom-style="width:100%;" bind:click="btnOK" type="info">确认收款
        </van-button>
    </view>
  </view>

</view>