
<view class="{{stopClick}}" style="padding:10px">
  <card>
    <view slot="content">
      {{mainData.workpresetjson.workname}}
      <view class="flex-align-center">
        <t-tag variant="dark" class="mr-5" theme="{{mainData.status == 0?'danger':mainData.status == 1?'success':'primary'}}" size="small">{{mainData.status == 0?'未完成':mainData.status == 1?'完成':'进行中'}}</t-tag> <t-tag wx:if="{{mainData.finishby}}" variant="dark" theme="primary" size="small">{{mainData.finishby}}</t-tag>
      </view>
    </view>
    
  </card>
  <view style="margin-bottom: 5px;" class="small"><text class="label">工序说明</text></view>
  <card>
    <view slot="content">
      {{mainData.workpresetjson.remarks}}
    </view>
  </card>
  <view style="margin-bottom: 5px;" class="small"><text class="label">参与人</text></view>
  <card>
    <text class="label">参与人:</text>
    <view slot="content">
      <view wx:if="{{mainData.team.length === 0}}">
        <text class="small">暂无参与人</text>
      </view>
      <view wx:else>
        <t-tag class="mr-5 mt-5" wx:for="{{mainData.team}}" wx:key="userid" variant="{{item.isleader === 1?'dark':'outline'}}" theme="{{item.isleader === 1?'primary':''}}">{{item.name}}</t-tag>
      </view>
    </view>
  </card>
  <!-- 是否确认 -->
  <view wx:if="{{mainData.workpresetjson.confirm !== 0}}">
    <view style="margin-bottom: 5px;" class="small">
      <text class="label">是否确认</text>
      <text wx:if="{{mainData.workpresetjson.confirm == 11}}" style="color:#e34d59">*</text>
    </view>
    <card>
      <view style="flex:1" slot="content">
        <t-tag bindtap="confirmValue" data-item="{{item}}" class="mr-5 mt-5" wx:for="{{mainData.workpresetjson.confirm_options}}" variant="{{item === form.confirm_value?'dark':'outline'}}" theme="{{item === form.confirm_value?'primary':''}}">{{item}}</t-tag>
      </view>
    </card>
  </view>
  <!-- 上传附件 -->
  <view wx:if="{{mainData.workpresetjson.fileupload !== 0}}">
    <view style="margin-bottom: 5px;" class="small">
    <text class="label">上传附件</text>
    <text wx:if="{{mainData.workpresetjson.fileupload == 11}}" style="color:#e34d59">*</text>
    </view>
    <card>
      <view style="flex:1" slot="content">
        <upload id="upload" bindData="{{bindNormalData}}"></upload>
      </view>
    </card>
  </view>
  <!-- 文本信息 -->
  <view wx:if="{{mainData.workpresetjson.textedit !== 0}}">
    <view style="margin-bottom: 5px;" class="small">
    <text class="label">文本信息</text>
    <text wx:if="{{mainData.workpresetjson.textedit == 11}}" style="color:#e34d59">*</text>
    </view>
    <card>
      <view style="flex:1" slot="content">
        <t-textarea custom-style="padding:0" value="{{form.textcontent}}" t-class="external-class" placeholder="请输入文字" disableDefaultPadding="{{true}}" bind:blur="textContent" autosize/>
      </view>
    </card>
  </view>
  <!-- 上传合同 -->
  <view wx:if="{{mainData.workpresetjson.contractupload !== 0}}">
    <view style="margin-bottom: 5px;" class="small">
    <text class="label">上传合同</text>
    <text wx:if="{{mainData.workpresetjson.contractupload == 11}}" style="color:#e34d59">*</text>
    </view>
    <card>
      <view style="flex:1" slot="content">
        <upload id="upload" source="messageFile" bindData="{{bindContractData}}"></upload>
      </view>
    </card>
  </view>
  <!-- 是否有偿 -->
  <view wx:if="{{mainData.workpresetjson.amountpay !== 0}}">
    <view style="margin-bottom: 5px;" class="small">
    <text class="label">是否有偿</text>
    <text wx:if="{{mainData.workpresetjson.amountpay == 11}}" style="color:#e34d59">*</text>
    </view>
    <card>
      <view style="flex:1" slot="content">
        <t-input default-value="{{form.amount}}" label="输入金额" placeholder="输入金额" bind:blur="amountPay" borderless></t-input>
      </view>
    </card>
  </view>
  <!-- 客户签字 -->
  <view wx:if="{{mainData.workpresetjson.signature !== 0 && SignName}}">
    <view style="margin-bottom: 5px;" class="small">
    <text class="label">客户签字</text>
    <text wx:if="{{mainData.workpresetjson.signature == 11}}" style="color:#e34d59">*</text>
    </view>
    <card>
      <view style="flex:1" slot="content">
        <!-- <upload id="upload"></upload> -->
        <sign-name bindData="{{bindSignNameData}}"></sign-name>
      </view>
    </card>
  </view>

   <!-- 物料及人员 -->
   <view wx:if="{{mainData.workpresetjson.additem !== 0 || mainData.workpresetjson.addperson !== 0}}">
    <view style="margin-bottom: 5px;" class="small"><text class="label">物料及人员</text></view>
    <card>
      <view style="flex:1" slot="content">
        <t-tabs defaultValue="{{mainData.workpresetjson.addperson !== 0?0:1}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs">
          <t-tab-panel wx:if="{{mainData.workpresetjson.addperson !== 0}}" label="培训人员" value="0">
            <card wx:for="{{mainData.trainers}}">
              <menber-card style="flex:1" slot="content" data="{{item}}" bind:delete="deleteMenber"></menber-card>
            </card>
            <view class="flex-align-center flex-around panel">
              <t-button size="extra-small" variant="primary" bind:tap="addTrainers">添加人员</t-button>
            </view>
          </t-tab-panel>
          <t-tab-panel wx:if="{{mainData.workpresetjson.additem !== 0}}" label="工单物料" value="1">
            <card style="margin-top:10px" wx:for="{{titems}}" wx:key="itemid">
              <product-card style="flex:1" slot="content" data="{{item}}" changeQty="{{true}}" bind:delete="deleteMaterial" bind:input="qtyChange"></product-card>
            </card>
            <view class="flex-align-center flex-around panel">
              <t-button size="extra-small" variant="primary" bind:tap="addProduct">添加物料</t-button>
            </view>
          </t-tab-panel>
        </t-tabs>
      </view>
    </card>
  </view>

  <!-- 备注 -->
  <view>
    <view style="margin-bottom: 5px;" class="small"><text class="label">备注</text></view>
    <card>
      <view style="flex:1" slot="content">
        <t-textarea custom-style="padding:0" value="{{form.remarks}}" t-class="external-class" placeholder="请输入备注" disableDefaultPadding="{{true}}" bind:blur="remarkEdit" autosize/>
      </view>
    </card>
  </view>

  <t-button theme="primary" size="large" bind:tap="confirmBill" block>确认完成</t-button>
</view>