<template>
  <c-content>
    <c-row>
      <!-- 左边 -->
      <c-col :span="14">
        <c-col :span="20">
          <el-form-item label="不符点" prop="bddgrp.blk.docdis">
            <c-input type="textarea"
              :disabled="model.bddgrp.blk.docdisflg ? false : true" :rows="6"
              v-model="model.bddgrp.blk.docdis" maxlength="65" show-word-limit placeholder="请输入不符点"></c-input>
          </el-form-item>
        </c-col>

        <c-col :span="4">
          <c-button size="small" type="primary" icon="el-icon-search" @click="onDocdisButtxmsel"
            :disabled="model.bddgrp.blk.docdisflg ? false : true">
            ...
          </c-button>
        </c-col>

        <c-col :span="24">
          <el-form-item label="Comments and Conclusions" prop="bddgrp.blk.comcon">
            <c-input type="textarea" v-model="model.bddgrp.blk.comcon" maxlength="65" show-word-limit
              placeholder="请输入Comments and Conclusions" :rows="12" style="width:95%"></c-input>
          </el-form-item>
        </c-col>

        <c-col :span="24">
          <el-form-item label="到期付款确认备注" prop="bddgrp.blk.accrmk">
            <c-input type="textarea" v-model="model.bddgrp.blk.accrmk" maxlength="65" show-word-limit
              placeholder="请输入到期付款确认备注" style="width:95%"></c-input>
          </el-form-item>
        </c-col>

        <!-- <c-col :span="24">
                <span  v-text="model.bdtp.docgrdm.docdsclab"   data-path=".bdtp.docgrdm.docdsclab" > </span>
            </c-col> -->

        <!-- <c-col :span="24" style="height: 24px; margin-top: -10px">
        <el-form-item :label="model.bdtp.docgrdm.docdsclab" class="messageLabel">
          <c-button style="float: right" @click="addTableValue" type="primary">新增单据</c-button>
        </el-form-item>
      </c-col>
      <c-col :span="24" style="margin-bottom: 30px;">
        <c-table height="200px" style="text-align: center" :list="this.model.bdtp.docgrdm.docgrd || []"
          :paginationShow="false" :border="true">
          <el-table-column label="1st" width="auto">
            <template slot-scope="scope">
              <c-input v-model="scope.row.cmail1"></c-input>
            </template>

          </el-table-column>
          <el-table-column label="2st" width="auto">
            <template slot-scope="scope">
              <c-input v-model="scope.row.cmail2"></c-input>
            </template>
          </el-table-column>
          <el-table-column label="Document" prop="docnam" width="auto">
            <template slot-scope="scope">
              <c-select style="width: 100%" placeholder="请选择" v-model="scope.row.docnam">
                <el-option v-for="item in codeTable" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </c-select>
            </template>
          </el-table-column>
          <el-table-column label="操作" width="170px" fixed="right">
            <template slot-scope="scope">
              <c-button @click="deleteTable(scope.$index)" type="primary">删除</c-button>
            </template>
          </el-table-column>
        </c-table>
      </c-col> -->

        <c-col>
          <c-docpre :model="model" :argadr="{
          path: 'bddgrp.blk.prsdoc',
          grp: 'bdtp',
          code: 'bdtdck',
        }"></c-docpre>
        </c-col>
      </c-col>

      <!-- 右边 -->
      <c-col :span="10">
        <c-row>
            <c-col :span="24" :offset="8">
              <c-checkbox v-model="model.bddgrp.rec.igndisflg" @change="igndisflgOtherDefault">
                忽略不符点
              </c-checkbox>
            </c-col>
          <c-col :span="24" :offset="8">
            <c-checkbox v-model="model.bddgrp.blk.docdisflg"
              @change="docdisflgOtherDefault">
              <!-- :disabled="model.bddgrp.rec.igndisflg ? true : false -->
              录入不符点
            </c-checkbox>
          </c-col>
        </c-row>
        <br /><br /><br /><br />
        <c-row>
          <c-col :span="24">
            <el-form-item label="收到的通知类型" prop="bddgrp.rec.advtyp">
              <c-select v-model="model.bddgrp.rec.advtyp" style="width:100%" placeholder="请选择Type of Advice Received"
                :disabled="true">
              </c-select>
            </el-form-item>
          </c-col>

          <c-col :span="24">
            <el-form-item label="付款日期" prop="bddgrp.rec.totdat">
              <c-date-picker type="date" v-model="model.bddgrp.rec.totdat" style="width:100%" placeholder="请选择付款日期">
              </c-date-picker>
            </el-form-item>
          </c-col>

          <c-col :span="24">
            <el-form-item label="不符点通知日期" prop="bddgrp.rec.disdat">
              <c-date-picker type="date" v-model="model.bddgrp.rec.disdat" style="width:100%" placeholder="请选择不符点通知日期"
                :disabled="true">
              </c-date-picker>
            </el-form-item>
          </c-col>

          <c-col :span="24" :offset="8">
            <c-checkbox v-model="model.bddgrp.rec.approvcod">议付行担保议付</c-checkbox>
          </c-col>

          <c-col :span="24" :offset="8" v-if="false">
            <c-checkbox v-model="model.bdtp.cre752flg">Create 752</c-checkbox>
          </c-col>

          <c-col :span="24" v-if="false">
            <el-form-item label="Further Identification" prop="bdtp.furide">
              <c-select v-model="model.bdtp.furide" style="width:100%" placeholder="请选择Further Identification">
              </c-select>
            </el-form-item>
          </c-col>

          <c-col :span="24" :offset="8">
            <c-checkbox v-model="model.bdtp.cre732flg" :disabled="!model.bddgrp.rec.acpnowflg != ''">Create MT 732
            </c-checkbox>
          </c-col>
        </c-row>
      </c-col>

      <!-- <c-col :span="12">
	    <c-checkbox v-model="model.bddgrp.rec.igndisflg">Ignore Discrepancies</c-checkbox>
       </c-col>
                  
       <c-col :span="12">
        <c-button size="small" type="primary" icon="el-icon-search" @click="onDocdisButtxmsel">
            ...
        </c-button>
       </c-col>
                  
       <c-col :span="12">
        <el-form-item label="Discrepancies" prop="bddgrp.blk.docdis">
            <c-input type="textarea" v-model="model.bddgrp.blk.docdis" maxlength="50" show-word-limit placeholder="请输入Discrepancies" ></c-input>
        </el-form-item>
        </c-col>
                  
       <c-col :span="12">
	    <c-checkbox v-model="model.bddgrp.blk.docdisflg">discrepancies modified</c-checkbox>
       </c-col>
                                   
       <c-col :span="12">
        <el-form-item label="Type of Advice Received" prop="bddgrp.rec.advtyp">
            <c-select v-model="model.bddgrp.rec.advtyp" style="width:100%" placeholder="请选择Type of Advice Received">
              </c-select>
        </el-form-item>
       </c-col>
                                   
       <c-col :span="12">
        <el-form-item label="付款日期" prop="bddgrp.rec.totdat">
            <c-date-picker type="date"  v-model="model.bddgrp.rec.totdat" style="width:100%"  placeholder="请选择付款日期"></c-date-picker>
        </el-form-item>
       </c-col>
                                                    
       <c-col :span="12">
        <el-form-item label="不符点通知日期" prop="bddgrp.rec.disdat">
            <c-date-picker type="date"  v-model="model.bddgrp.rec.disdat" style="width:100%"  placeholder="请选择不符点通知日期"></c-date-picker>
        </el-form-item>
       </c-col>
                  
       <c-col :span="12">
        <el-form-item label="Comments and Conclusions" prop="bddgrp.blk.comcon">
            <c-input type="textarea" v-model="model.bddgrp.blk.comcon" maxlength="65" show-word-limit placeholder="请输入Comments and Conclusions" ></c-input>
        </el-form-item>
        </c-col>
                  
       <c-col :span="12">
	    <c-checkbox v-model="model.bddgrp.rec.approvcod">Documents on Approval Basis</c-checkbox>
       </c-col>
                  
       <c-col :span="12">
	    <c-checkbox v-model="model.bdtp.cre752flg">Create 752</c-checkbox>
       </c-col>
                                   
       <c-col :span="12">
        <el-form-item label="Further Identification" prop="bdtp.furide">
            <c-select v-model="model.bdtp.furide" style="width:100%" placeholder="请选择Further Identification">
              </c-select>
        </el-form-item>
       </c-col>
                                   
       <c-col :span="12">
	    <c-checkbox v-model="model.bdtp.cre732flg">Create MT 732</c-checkbox>
       </c-col>
                  
       <c-col :span="12">
        <el-form-item label="到期付款确认备注" prop="bddgrp.blk.accrmk">
            <c-input type="textarea" v-model="model.bddgrp.blk.accrmk" maxlength="65" show-word-limit placeholder="请输入到期付款确认备注" ></c-input>
        </el-form-item>
        </c-col>
                  
	<c-col :span="12">
	    <span  v-text="model.bdtp.docgrdm.docdsclab"   data-path=".bdtp.docgrdm.docdsclab" > </span>
	</c-col> -->
    </c-row>
  </c-content>
</template>
<script>
  import Api from "~/service/Api"
  import commonProcess from "~/mixin/commonProcess";
  import CodeTable from "~/config/CodeTable"
  import Event from "~/model/Bdtdck/Event"
  import Docpre from "~/views/Public/Docpre";
  import Utils from "~/utils";
  export default {
    components: {
      "c-docpre": Docpre,
    },
    inject: ['root'],
    props: ["model", "codes"],
    mixins: [commonProcess],
    data() {
      return {
        TableValue: [
          {
            id: 0,
            cmail1: "1",
            cmail2: "2",
            docnam: "1",
          },
        ],
        newValue: {
          id: 0,
          cmail1: "",
          cmail2: "",
          docnam: "",
          description: "",
          serialNum: "",
          tableName: "",
          tcddoc: "",
        },
        codeTable: [
          { label: "增值税发票", value: "1" },
          { label: "发票", value: "2" },
          { label: "装箱单", value: "3" },
          { label: "空运单", value: "4" },
          { label: "海运提单", value: "5" },
          { label: "铁路运单", value: "6" },
          { label: "货物收据", value: "7" },
          { label: "邮政收据", value: "8" },
        ],

      }
    },
    methods: {
      ...Event,
      async igndisflgOtherDefault() {
        this.executeDefault('trnmod.trndoc.tag77atxt').then((res) => {
          if (res.respCode == SUCCESS) {
            Utils.copyValueFromVO(this.model, res.data)
          }
        })
        // if (this.model.bddgrp.rec.igndisflg == 'X') {
        //   this.model.bddgrp.blk.docdisflg = '';
        // }
      },
      docdisflgOtherDefault(){
        this.executeDefault('txmmod.buttxmsel').then((res) => {
          if (res.respCode == SUCCESS) {
            Utils.copyValueFromVO(this.model, res.data)
          }
        })
      },
      addTableValue(index) {
        var newTableValue = Object.assign({}, this.newValue);
        const serial = Utils.generateUUID();
        newTableValue.serialNum = serial;
        this.model.bdtp.docgrdm.docgrd.splice(index - 1, 0, newTableValue);
      },
      deleteTable(index) {
        this.model.bdtp.docgrdm.docgrd.splice(index, 1);
      },
    },

    created: function () {


    }
  }
</script>
<style>
  .messageLabel>>>.el-form-item__label {
    text-align: left;
    font-weight: bold;
    font-size: 12px;
  }
</style>