<wxs src='../../../utils/wxmlUtil.wxs' module="wxmlUtil"></wxs>
<van-dialog id="van-dialog" />
<!-- 销售订单  -->
<view style="display:flex;" wx:if="{{(type == 'sale' || type =='purReturn' || type =='saleOut' )&&  saleStaffAndOrgFlag}}">
  <!-- 主从业务员  -->
  <view style="width: 50%;">
    <van-cell id="staffItem" catchtap="openMulti" data-type="staff" title="{{ form[staff].text?form[staff].text:'选择业务员' }}" value-width="1rpx" border="{{false}}" center="{{true}}" title-class="cell-value-staff-org" arrow-direction="down" is-link value="" />
  </view>
  <!-- 主从业务部门 -->
  <view style="width: 50%;">
    <van-cell id="orgItem" catchtap="openMulti" data-type="org" title="{{form[org].text ? form[org].text : '选择业务部门' }}" value-width="1rpx" border="{{false}}" title-class="cell-value-staff-org" arrow-direction="down" is-link value="" />
  </view>
</view>

<view class="dk-card-outer-class">
  <!--对象-->
  <view class="dk-card-class" wx:if="{{objCol}}">
    <view>
      <view class="dk-obj-class" wx:if="{{form.objInfo}}">
        <van-cell custom-class="custom-cell" value="{{chooseText}}" value-class="chooseText" is-link catchtap="openObjPop" border="{{ false }}">
          <view slot="title" style="width: 440rpx;">
            <view style="display: flex;align-items: flex-end;color: #002340;">
              <view style="font-size:34rpx;font-weight: 600;">
                {{form.objInfo[objTitle]}}
              </view>
              <view style="font-size:28rpx;padding-left: 14rpx;display: flex;">
                {{form.objInfo[objSubTitle]}}
              </view>
            </view>
          </view>
        </van-cell>

        <view style="display: flex;">
          <view class="dk-obj-amount-class">
            <view>{{amountTitle}}</view>
            <view style="display: flex;justify-content: center;margin-top: 20rpx;">
              <view class="sign-class">¥</view>
              <view class="amount-class">{{wxmlUtil.toThousandCents(form.objInfo[amountCol])}}</view>
            </view>
          </view>
        </view>
      </view>
      <!--选择对象-->
      <van-field wx:else label-class="red-label" is-link value="{{ form[objCol]}}" label="{{objLabel}}" autosize border="{{ false }}" readonly="{{true}}" input-class="dk-cell-value-right-class" catchtap="openObjPop">
      </van-field>
    </view>
  </view>
  <!-- 单据信息 -->
  <view wx:for="{{cardList}}" wx:for-item="card" data-item="{{card}}" wx:for-index="cardIndex">

    <view style="display: flex;justify-content: center;align-items: center;" id="{{card.name}}">
      <view wx:if="{{card.name == 'items' && !readonly && chooseVisible && card.chooseGoodsItemFlag}}" style="margin:10rpx 15rpx;text-align: center;">
        <van-button icon="{{imageUrl + 'choose_goods_sale.png'}}" size="normal" color="#3E69F6" custom-style="border-radius:15rpx ;" catchtap="openChooseItems" data-item="{{card}}" custom-style="height:70rpx;border-radius:8px;width:191rpx;" data-index="{{cardIndex}}" type="info">选商品
        </van-button>

      </view>
      <view wx:if="{{card.name == 'items' && !readonly && chooseVisible &&  card.chooseInventoryFlag}}" style="margin:10rpx 15rpx;text-align: center;">
        <van-button icon="{{imageUrl + 'choose_inventory_sale.png '}}" size="normal" custom-style="height:70rpx;border-radius:8px;width:191rpx;" data-type="inventory" color="#9A36FC" catchtap="openChooseItems" data-item="{{card}}" data-index="{{cardIndex}}" type="info">选库存
        </van-button>

      </view>
      <view wx:if="{{card.name == 'items' && !readonly && chooseVisible &&  card.chooseCoordinationFlag}}" style="margin:10rpx 15rpx;text-align: center;">
        <van-button icon="{{imageUrl + 'choose_coordination_sale.png'}}" size="normal" custom-style="height:70rpx;border-radius:8px;width:191rpx;" color="#FF7B1A" catchtap="openChooseCoordinationItems" data-item="{{card}}" data-index="{{cardIndex}}" type="info">选外协
        </van-button>

      </view>



    </view>


    <view class="dk-card-class">


      <view wx:if="{{card.title}}" class="item-class">
        <view class="item-title-class">{{card.title}}</view>
        <view class="item-info-class" style="color:{{card.color?card.color:'#1B365D'}}">{{card.info}}</view>
        <view style="width: 35%;text-align: right;">
          <dk-tag wx:if="{{card.expandFlag}}" type="primary" padding="0 20rpx" height="40rpx" color="#9FAEE5" textColor="#FFFFFF" radius="5rpx" roundFlag="{{true}}" value="{{!card.expand?'展开':'收起'}}" catchtap="expandCard" data-item="{{card}}" data-index="{{cardIndex}}"></dk-tag>
          <!--明细，增加选择商品按钮-->
          <dk-tag wx:if="{{card.name == 'items' && !readonly && chooseVisible && ( card.chooseGoodsFlag == undefined || card.chooseGoodsFlag)}}" type="primary" padding="8px" color="#3E69F6" textColor="#FFFFFF" radius="10rpx" roundFlag="{{true}}" fontSize="28rpx" value="选商品" catchtap="openChooseItems" data-item="{{card}}" data-index="{{cardIndex}}"></dk-tag>
          <!-- 自定义tag -->
          <dk-tag wx:if="{{card.name == 'items' && goodsTagText}}" type="primary" padding="8px" color="{{goodsTagColor ? goodsTagColor:'#77C5D5'}}" fontSize="28rpx" textColor="#FFFFFF" radius="10rpx" roundFlag="{{true}}" value="{{goodsTagText}}" data-item="{{card}}" data-index="{{cardIndex}}"></dk-tag>

        </view>
      </view>
      <view wx:if="{{card.expandFlag && card.expand || !card.expandFlag}}">
        <!--明细card-->
        <view wx:if="{{card.name == 'items'}}">
          <view wx:for="{{form[itemName]}}" data-item="{{item}}" wx:for-item="item" wx:key="index" border="{{ false }}">
            <van-swipe-cell disabled="{{swipeDisabled ? item[swipeDisabled] : flase}}" right-width="{{readonly? 0:65 }}" data-index="{{index}}" data-item="{{item}}" async-close bind:close="onCloseDel">
              <van-card wx:if="{{item.show || item.show == undefined}}" data-index="{{index}}" data-item="{{item}}" data-card="{{card}}" catchtap="openChoosedItemInfo">
                <view slot="thumb" data-item="{{item}}" data-index="{{index}}" data-card="{{card}}" catchtap="openChoosedItemInfo">
                  <van-image radius="5px" width="90" height="90" src="{{item[iconCol] }}" />
                </view>
                <view slot="title" data-item="{{item}}" data-index="{{index}}" data-card="{{card}}" catchtap="openChoosedItemInfo" style="display: flex;">
                  <view style="display: flex;">
                    <dk-title titleTag="{{item[titleTagCol]}}" title="{{item[titleCol]}}"></dk-title>
                  </view>
                </view>
                <view slot="desc" data-item="{{item}}" data-index="{{index}}" data-card="{{card}}" catchtap="openChoosedItemInfo">
                  <view style="display:flex;width: 100%;">
                    <dk-text fontWeight="nomal" value="{{item[descCol]}}"></dk-text>
                  </view>
                </view>
                <view slot="price" data-index="{{index}}" data-card="{{card}}" data-item="{{item}}" catchtap="openChoosedItemInfo">
                  <view style="display: flex;width: 100%;justify-content: center;align-items: center;">
                    <view style="width: 60%;">
                      <dk-cell contentFontSize="16" height="25rpx" fontWeight="700" left="0rpx" contentColor="#FF7B1A" title="" content="{{ item[priceCol]}}"></dk-cell>
                    </view>
                    <view style="width: 40%;text-align: right;">
                      <van-stepper wx:if="{{stepperFlag}}" integer="{{true}}" value="{{ item[quantityCol]}}" max="{{item[quantityMax]}}" min="{{item[quantityMin]}}" data-index="{{index}}" bind:change="onChangeStepper" />
                      <dk-text wx:else fontWeight="nomal" fontWeight="700" value="{{'x ' + item[quantityCol]}}"></dk-text>
                    </view>
                  </view>

                  <!-- 盈亏数量和盈亏原因： -->
                  <view wx:if="{{!!lossReasonFlag}}" style="display: flex;">
                    <view style="width: 40%;text-align: left;font-size:12px;color: #95A8CB;">
                      <span style="line-height:56rpx;">{{$t['profitAndLossQuantity']+'：'+ item['balanceQty']}} </span>
                    </view>

                    <view style="width: 60%;text-align: left;font-size:12px;color: #95A8CB;">
                      <span style="line-height:56rpx;">{{$t['lossReasonName']+'：'+(item['lossReasonName']?item['lossReasonName']:'')}} </span>
                    </view>
                  </view>
                </view>
              </van-card>
              <!-- 明细右上角 -->
              <view wx:if="{{titpsFlag&&!isDetailFlag&&!!!item.noshowtitps}}" class="titps" style="{{item[titpsItemColorFlagKey] ? 'background-color: #E4002B8F;' : 'background: #77C5D59C;'}}">
                <view class="titps-font" style="{{ item[titpsItemColorFlagKey] ?'color:#E4002B' : 'color: #00A7B5;'}}">{{ item[titpsLabel] ? item[titpsLabel] : '有货' }}</view>
              </view>
              <view style="display: flex;" wx:if="{{item[quantityRedColFlagKey]}}">
                <view style="width: 60%;">
                  <view wx:for="{{cardContentList}}" wx:for-item="item_" data-item="{{item_}}" wx:for-index="index_">

                    <van-field label-class="{{item_.required?'red-label':'nomal-label' }}" data-name="{{item_.name}}" data-key="{{ item_.code}}" data-flag="{{true}}" data-item="{{item_}}" data-index="{{index_}}" data-card="{{card.name}}" value="{{ item[item_.name]}}" input-align="left" label="{{item.title?item.title:$t[item_.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item_.title?item_.title:item.code)}}" is-link catchtap="open" autosize border="{{ false }}" readonly="{{true}}" input-class="dk-cell-value-class" data-type='{{item_.dropType}}' errorMessage="{{item_.errMsg}}">
                    </van-field>
                  </view>

                </view>
                <!-- 可售量 -->
                <view style="width: 40%;text-align: right;color:#E4002B;font-size: 12px;padding: 20rpx;">{{quantityRedTitle}}{{item[quantityRedCol]}}</view>
              </view>
              <!-- 明细左下 -->
              <view wx:if="{{card.contentBottomLeft}}" wx:for="{{card.contentBottomLeft}}" style="display: flex;width: 100%;margin-top:5px;align-items: center;" wx:for-item="item_" data-item="{{item_}}" wx:for-index="index_" catchtap="openContentBottomLeft">
                <view wx:if="{{item_.type=='remarks'}}" style="width: 50%;text-align: left;font-size:14px;color: #95A8CB;">
                  <van-image width="20px" height="20px" src="/static/image/edit.png" />
                  备注：<span style="line-height:56rpx;">{{item[item_.code] ? item[item_.code] : '请输入内容'}}</span>
                </view>
              </view>
              <view wx:if="{{!readonly}}" slot="right">删除</view>
            </van-swipe-cell>
          </view>
          <van-empty wx:if="{{!form[itemName] || form[itemName].length == 0}}" description="暂未选择商品" />
          <block style="text-align: center; " wx:if="{{card.displayNum && form[itemName].length > card.displayNum}}">
            <view wx:if="{{card.showMore}}" class="expand-class" data-card="{{card}}" data-index="{{cardIndex}}" bindtap='expand'>
              点击收起部分
              <van-icon name="arrow-up" />
            </view>
            <view wx:else class="expand-class" data-card="{{card}}" data-index="{{cardIndex}}" bindtap='expand'>
              展开查看更多
              <van-icon name="arrow-down" />
            </view>
          </block>
          <view catchtap="openReverseCalculationPop">
            <view class="amount-item-class" wx:if="{{gradeCode != 'STD' &&( type === 'sale' || type === 'saleOut') }}">
              <!--标价总额-->
              <dk-cell contentColor="#FF7B1A" titleColor="#95A8CB;" contentFontWeight="700" title="标价总额" content="{{card[sumStandardCol]?card[sumStandardCol]:0}}"></dk-cell>
              <!--标价折扣-->
              <dk-cell amount="{{false}}" contentColor="#FF7B1A" contentFontWeight="700" titleColor="#95A8CB;" title="标价折扣" content="{{(card[discountStandardCol] && card[discountStandardCol] != 'NaN' && card[discountStandardCol] != 'Infinity')?card[discountStandardCol] + ' %':''  +'-'}}"></dk-cell>
            </view>
            <view wx:if="{{sumAmountColFlag}}" class="amount-item-class">
              <!--条数-->
              <dk-cell titleColor="#95A8CB;" contentColor="#95A8CB" title="{{$t['goodsQuantity'] }}"contentFontWeight="700"  amount="{{false}}"content="{{(card[sumQuantityCol]?card[sumQuantityCol]:0) + $t['piece']}}"></dk-cell>
              <!--合计金额-->
              <dk-cell fontSize="16" fontWeight="bold" contentFontWeight="700" contentColor="#FF7B1A" titleColor="#1B365D;" title="合计金额" content="{{card[sumAmountCol]?card[sumAmountCol]:0}}"></dk-cell>
              <!-- <view style="display: flex;width: calc(100% - 260rpx);">
              <view style="font-size: 16px;font-weight: bold;color:#1B365D;display: flex;align-items: center;">
                合计金额
              </view>
              <dk-number-input style="width: calc(100% - 130rpx);" fontSize="16" center="left" data-key="{{sumAmountCol}}" inputColor="#FF7B1A"  fontWeight="700" inputValue="{{card[sumAmountCol]?card[sumAmountCol]:0}}" data-index="{{cardIndex}}"bind:triggerBindValue="changeAmount">
              </dk-number-input>
            </view> -->
            </view>
            <view wx:if="{{reverseCalculationFlag}}" class="amount-item-class">
              <!--整单折扣-->
              <dk-cell contentColor="#95A8CB" titleColor="#95A8CB;"  title="{{$t['wholeOrderDiscount']}}" amount="{{false}}"content="{{(card[wholeOrderDiscountCol]?card[wholeOrderDiscountCol]:100) + '%'}}"></dk-cell>
              <!--优惠金额-->
              <dk-cell   contentColor="#95A8CB" titleColor="#95A8CB;" title="优惠金额" content="{{card[discountAmountCol]?card[discountAmountCol]:0}}"></dk-cell>
           
            </view>
            <!--使用收款-->
            <!-- <view class="amount-item-class" wx:if="{{type === 'sale' || type === 'saleOut' }}">
            <view style="display: flex;">
           
              <dk-cell contentColor="#FF7B1A" titleColor="#95A8CB" contentFontWeight="700" title="使用收款(可用" content="{{card[canUseCollectCol]?card[canUseCollectCol]:0}}"></dk-cell>
              <dk-cell left="0rpx" titleColor="#95A8CB" title=")" amount="{{false}}"></dk-cell>
            </view>
            <dk-cell contentColor="#FF7B1A" contentFontWeight="700" content="{{card[useCollectCol]?card[useCollectCol]:0 }}"></dk-cell>
          </view> -->
          </view>
        </view>
        <!--非明细card-->
        <view wx:if="{{card.name != 'items'}}">
          <view id="{{item.code}}" wx:for="{{contentObj[card.name]}}" wx:for-item="item" data-item="{{item}}" wx:key="index">

            <!--选客户-->
            <van-field wx:if="{{item.type=='selectIcon'}}" required="{{item.required?true:false }}" data-name="{{item.name}}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" value="{{ form[item.code]}}" input-align="left" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" autosize border="{{ false }}" readonly="{{item.readonly}}" clickable="{{false}}" bind:change="changeField" input-class="dk-cell-value-class" errorMessage="{{item.errMsg}}">
              <van-icon slot="icon" name="{{imageUrl+'/select_cus.png'}}" color="#c8c9cc;" data-item="{{item}}" data-name="{{item.name}}" data-key="{{item.code}}" size="20px" catchtap="open" data-type='{{item.dropType}}'></van-icon>
            </van-field>

            <!--文本框-->
            <van-field wx:if="{{item.type=='str' && (item.show || item.show == undefined) && !item.hide }}" required="{{item.required?true:false }}" data-key="{{item.code}}" auto-focus="{{true}}" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" value="{{ form[item.code]}}" input-align="left" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" autosize clearable border="{{ false }}" readonly="{{!!readonly || !!item.readonly}}" input-class="dk-cell-value-class" maxlength="{{item.maxlength?item.maxlength:50}}" right-icon="{{item.rightIcon}}" bind:change="changeField" bind:blur="blurField" bind:clear="clearField" errorMessage="{{item.errMsg}}">
              <van-icon wx:if="{{item.tip}}" slot="label-icon" name="question-o" data-item="{{item}}" catchtap="showTip" />
            </van-field>
            <!--选单-->
            <van-field wx:if="{{item.type=='choose' && (item.show || item.show == undefined) && !item.hide}}" type="textarea" required="{{item.required?true:false }}" data-name="{{item.name}}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" value="{{ form[item.name]}}" input-align="left" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" is-link catchtap="open" autosize border="{{ false }}" readonly="{{true}}" input-class="dk-cell-value-class" data-type='{{item.dropType}}' errorMessage="{{item.errMsg}}">
              <van-icon wx:if="{{!readonly && form[item.name] && (item.clear || item.clear == undefined)}}" slot="icon" name="clear" color="#c8c9cc;" data-item="{{item}}" data-name="{{item.name}}" data-key="{{item.code}}" catchtap="clearChoose"></van-icon>
            </van-field>
            <!--单选下拉-->
            <van-field wx:if="{{item.type=='drop'  && (item.show || item.show == undefined)}}" required="{{item.required?true:false }}" data-name="{{item.name}}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" value="{{ form[item.name]}}" input-align="left" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" catchtap="open" autosize border="{{ false }}" clearable="{{false}}" readonly="{{true}}" input-class="dk-cell-value-class" data-type='{{item.dropType}}' errorMessage="{{item.errMsg}}">
              <van-icon wx:if="{{!readonly && form[item.code]&& (item.clear || item.clear == undefined)}}" slot="icon" name="clear" color="#c8c9cc;" data-item="{{item}}" data-name="{{item.name}}" data-key="{{item.code}}" catchtap="clearChoose"></van-icon>
            </van-field>
            <!--多选下拉-->
            <van-field wx:if="{{item.type=='mutidrop'  && (item.show || item.show == undefined)}}" required="{{item.required?true:false }}" data-name="{{item.name}}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" value="{{ form[item.name + 's']}}" input-align="left" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" is-link catchtap="open" autosize border="{{ false }}" clearable="{{false}}" readonly="{{true}}" input-class="dk-cell-value-class" data-type='{{item.dropType}}' errorMessage="{{item.errMsg}}">
              <van-icon wx:if="{{ !readonly && form[item.code]&& (item.clear || item.clear == undefined)}}" slot="icon" name="clear" color="#c8c9cc;" data-item="{{item}}" data-name="{{item.name}}" data-key="{{item.code}}" catchtap="clearChoose"></van-icon>
            </van-field>
            <!--选择框-->
            <van-field wx:if="{{item.type=='checkbox'  && (item.show || item.show == undefined)}}" input-width="200rpx" input-class="dk-cell-value-class" label-class="nomal-label" input-align="left" value="{{ form[item.code] ? '  需要' : '  不需要' }}" label="{{item.title?item.title:$t[item.code]}}" autosize border="{{ false }}" readonly="{{true}}" errorMessage="{{item.errMsg}}">
              <view slot="inputbefor" style="text-align: left;padding-left: 10rpx;" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" data-value="{{form[item.code]}}" data-key="{{item.code}}" catchtap="onChange">
                <van-checkbox shape="round" value="{{form[item.code]}}" />
              </view>
            </van-field>
            <!--开关-->
            <van-field wx:if="{{item.type=='switch'  && (item.show || item.show == undefined)}}" input-width="200rpx" input-class="dk-cell-value-class" label-class="nomal-label" input-align="right" label="{{item.title?item.title:$t[item.code]}}" autosize border="{{ false }}" readonly="{{true}}" errorMessage="{{item.errMsg}}">
              <view slot="inputbefor" style="text-align: left;padding-top: 5rpx;">
                <van-switch size="20px" checked="{{ form[item.code]}}" bind:change="onChange" active-color="#1B365D" data-item="{{item}}" data-index="{{index}}" data-card="{{card}}" data-value="{{form[item.code]}}" data-key="{{item.code}}" />
              </view>
            </van-field>
            <!--客户地址-->
            <van-field wx:if="{{item.type=='address'  && (item.show || item.show == undefined)}}" input-width="200rpx" input-class="dk-cell-value-class" required="{{item.required?true:false }}" input-align="left" data-key="address" type="textarea" value="{{ wxmlUtil.addressToIndexOf(form.address.address) }}" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" autosize border="{{ false }}" data-type='address' catchtap="onClickWxchartAddress" readonly="{{true}}" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" errorMessage="{{item.errMsg}}">
              <view style="display: flex;" slot="right-icon">
                <van-icon wx:if="{{ form.address.address}}" slot="right-icon" name="clear" color="#c8c9cc;" data-key="{{item.code}}" catchtap="clearAddress"></van-icon>
                <van-icon custom-style="padding-left:10rpx" name="location"></van-icon>
              </view>
            </van-field>
            <!--联系电话-->
            <dk-number-phone-input wx:if="{{item.type=='phone'  && (item.show || item.show == undefined)}}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" readonly="{{!!readonly || !!item.readonly}}" required="{{item.required?true:false }}" clearable rightIcon="phone" model:value="{{ form[item.code]}}" bind:changeField="changePhone" bind:changeFieldblur="changePhoneblur" bind:clear="clearField" errorMessage="{{item.errMsg}}" id="{{item.code}}" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.code)}}"></dk-number-phone-input>
            <!--日期-->
            <van-field wx:if="{{item.type=='date'  && (item.show || item.show == undefined)}}" required="{{item.required?true:false }}" is-link value="{{ form[item.code]}}" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" data-item="{{item}}" data-key="{{item.code}}" data-index="{{index}}" clearable data-card="{{card.name}}" errorMessage="{{item.errMsg}}" border="{{ false }}" readonly="{{true}}" input-class="dk-cell-value-class" catchtap="openDatePop">
              <van-icon wx:if="{{!readonly && form[item.code]}}" slot="icon" name="clear" color="#c8c9cc;" data-key="{{item.code}}" catchtap="clearDate"></van-icon>
            </van-field>
            <!--数字类-->
            <dk-number-input wx:if="{{item.type=='number'  && (item.show || item.show == undefined)}}" sign="{{(item.sign || item.sign == '')?item.sign:'¥'}}" digits="{{(item.digits || item.digits == 0)?item.digits:2}}" fontSize="14" left="30rpx" data-key="{{item.code}}" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" center="left" readonly="{{!!readonly || !!item.readonly}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" errorMessage="{{item.errMsg}}" titleValue="{{item.title?item.title:$t[item.code]}}" inputColor="#FF7B1A" titleFontWeight="normal" titleColor="#95A8CB" inputValue="{{form[item.code]}}" negative="{{item.negative}}" maxFlag="{{item.maxFlag}}" max="{{item.max}}" bind:triggerBindBlur="changeNumberBlur" bind:triggerBindValue="changeNumberField" min="{{item.min}}"></dk-number-input>

            <!--备注-->
            <van-field wx:if="{{item.type=='textarea'  && (item.show || item.show == undefined)}}" type="textarea" required="{{item.required?true:false }}" data-key="{{item.code}}" data-item="{{item}}" data-index="{{index}}" data-card="{{card.name}}" value="{{ form[item.code]}}" input-align="left" label="{{item.title?item.title:$t[item.code]}}" placeholder="{{wxmlUtil.setPlaceholder($t,item.title?item.title:item.code)}}" autosize border="{{ false }}" clearable readonly="{{!!readonly && !!item.readonly}}" input-class="dk-cell-value-class" maxlength="{{item.maxlength?item.maxlength:500}}" right-icon="{{item.rightIcon}}" bind:change="changeField" bind:blur="blurField" bind:clear="clearField" errorMessage="{{item.errMsg}}">
            </van-field>
            <!--附件-->
            <view style="display:flex;width:100%;margin: 1vw; padding-top: 20rpx;" wx:if="{{item.type=='uploader'}}">
              <view style="width: 168rpx; flex:1;color: #95A8CB;font-size: 28rpx;padding-left: 27rpx;">附件</view>
              <view style="width: calc(100% - 168rpx);text-align: left;">
                <van-uploader max-count="5" disabled="{{!!item.readonly}}" accept="image" style="margin-left: 4%;border-radius: 15rpx;" preview-size="160rpx;" file-list="{{ form['annexPaths'] }}" bind:delete="deleteImg" bind:after-read="afterRead" multiple="true" imageFit="aspectFit" max-size="{{maxSize}}" bind:oversize="overSize" upload-text="添加照片" />
                <!-- <view style="margin-left: 27rpx;color: #C8C9CC;font-size: 12px;">
                图片最多上传5张
              </view> -->
              </view>
            </view>
          </view>
          <block style="text-align: center; " wx:if="{{card.displayNum && contentObj[card.name].length > card.displayNum}}">
            <view wx:if="{{card.showMore}}" class="expand-class" data-card="{{card}}" data-index="{{cardIndex}}" bindtap='expand'>
              点击收起部分
              <van-icon name="arrow-up" />
            </view>
            <view wx:else class="expand-class" data-card="{{card}}" data-index="{{cardIndex}}" bindtap='expand'>
              展开查看更多
              <van-icon name="arrow-down" />
            </view>
          </block>
        </view>
      </view>
    </view>
  </view>

</view>

<!--单选弹出-->
<dk-single-dropdown-item show="{{show}}" typeName='{{dropType}}' bind:commit='chooseData' bind:muticlose='muticlose'></dk-single-dropdown-item>

<!-- 多选弹出 -->
<dk-muti-dropdown-item show="{{mutishow}}" typeName='{{dropType}}' bind:commit='chooseData' bind:muticlose='muticlose'></dk-muti-dropdown-item>

<!--日期-->
<van-popup show="{{ showDate }}" custom-style="border-radius:30rpx 30rpx 0 0;" position="bottom" bind:close="cancelDatePop">
  <van-datetime-picker type="date" bind:confirm="chooseDate" bind:cancel="cancelDatePop" loading="{true}" value="{{dataTime}}" min-date="{{ minDate }}" />
</van-popup>

<dk-popup id="dkPopup" stepperDecimal="decimalPlaces" type="{{popType}}" routeObjName="{{routeObjName}}" titleTagCol="{{titleTagCol}}" titleCol="{{titleCol}}" subCol="{{subCol}}" descCol="{{descCol}}" iconCol="{{iconCol}}"priceTailCol="{{priceTailCol}}"  priceCol="{{pupPriceCol}}"priceTitle="{{priceTitle}}" value="{{dataItem}}" show="{{showPop}}" contentObj="{{popContent_sku}}" popupTopObj="{{popupTopObj_sku}}" bind:changeStep="changeStep" bind:changeCheckBox="changeCheckBox" readonly="{{readonly}}" bind:changeField="changeDetailField" bind:blurNumberField="blurNumberField" bind:commit="editItems" bind:openPackageBox="openPackageBox" bind:openDkNumberInput = "openPopDkNumberInput"></dk-popup>
<!-- 箱片 -->
<dk-popup type="basic" title="修改包装数量" titleCol="skuModel" iconCol="imagesUrl" value="{{dataItem}}" show="{{showPopBox}}" routeObjName="{{routeObjName}}" contentObj="{{popContentBox}}" bind:changeStep="changeStep" bind:commit="editItemsBox" stepperDecimal="decimalPlaces"></dk-popup>

<!-- 修改实际金额 和实际单价 (销售订单价格反算用)-->
<dk-popup type="basic" title="修改价格"   value="{{dataItemChangePrice}}" show="{{showChangePrice}}" routeObjName="{{routeObjName}}" contentObj="{{popChangePrice}}" validFlag="{{true}}"  bind:blurNumberField ="blurChangePriceNumberField"   bind:commit="editItemsChangePrice"  ></dk-popup>
