<template>
  <div class="eibs-tab">
    <el-form
      :model="model"
      :rules="rules"
      ref="modelForm"
      label-width="150px"
      label-position="right"
      size="small"
      :validate-on-rule-change="false"
    >
      <c-col :span="24" style="margin-top: 10px">
        <!-- ----------左 ---------->
        <c-col :span="11">
          <c-col :span="24">
            <el-form-item label=" Name" prop="ptysea.nam">
              <c-input
                v-model="model.ptysea.nam"
                placeholder="请输入External Visible Name"
              ></c-input>
            </el-form-item>
          </c-col>
          <c-col :span="24">
            <el-form-item label="Street" prop="adrsea.str1">
              <c-input
                v-model="model.adrsea.str1"
                maxlength="35"
                placeholder="请输入Street/SWIFT Line 3"
              ></c-input>
            </el-form-item>
          </c-col>

          <c-col :span="24">
            <el-form-item label="City" prop="adrsea.loctxt">
              <c-input
                v-model="model.adrsea.loctxt"
                maxlength="25"
                placeholder="请输入Textpart of City/Second Part of SWIFT Line 4"
              ></c-input>
            </el-form-item>
          </c-col>
          <c-col :span="24">
            <el-form-item label="客户类别" prop="persontype">
              <c-select
                v-model="model.persontype"
                style="width: 100%"
                placeholder="请选择客户类别"
                :code="codes.persontype"
              >
              </c-select>
            </el-form-item>
          </c-col>

          <c-col :span="24">
            <el-form-item label="支行行号" prop="zhbchinr">
              <c-select
                v-model="model.zhbchinr"
                style="width: 100%"
                placeholder="请选择支行行号"
                :code="codes.zhbchinr"
              >
              </c-select>
            </el-form-item>
          </c-col>
        </c-col>
        <!------------- 右 ---------->
        <c-col :span="11" :offset="1">
          <c-col :span="24">
            <el-form-item label="Party No." prop="ptysea.extkey">
              <c-input
                v-model="model.ptysea.extkey"
                maxlength="24"
                placeholder="请输入Party No."
              ></c-input>
            </el-form-item>
          </c-col>

          <c-col :span="24">
            <el-form-item label="BIC " prop="adrsea.bic">
              <c-input
                v-model="model.adrsea.bic"
                maxlength="11"
                placeholder="请输入BIC "
              ></c-input>
            </el-form-item>
          </c-col>

          <c-col :span="24">
            <el-form-item label="ZIP Code" prop="adrsea.loczip">
              <c-input
                v-model="model.adrsea.loczip"
                maxlength="10"
                placeholder="请输入ZIP Code"
              ></c-input>
            </el-form-item>
          </c-col>

          <c-col :span="24">
            <el-form-item label="交易主体" prop="jyzt">
              <c-select
                v-model="model.jyzt"
                style="width: 100%"
                placeholder="请选择交易主体"
                :code="codes.jyzt"
              >
              </c-select>
            </el-form-item>

            <c-col :span="24">
              <el-form-item label="统一社会信用代码" prop="shxydm">
                <c-input
                  v-model="model.shxydm"
                  maxlength="18"
                  placeholder="请输入统一社会信用代码"
                ></c-input>
              </el-form-item>
            </c-col>
          </c-col>
        </c-col>
      </c-col>

      <el-form-item label="Type">
        <el-radio-group v-model="radio">
          <el-radio :label="0" v-model="model.seatypb">Bank</el-radio>
          <el-radio :label="1" v-model="model.seatypc">Client</el-radio>
          <el-radio :label="2" v-model="model.seatypa">Own Address</el-radio>
          <el-radio :label="3" v-model="model.seatypo">Other</el-radio>
          <el-radio :label="4" v-model="model.seatyph">海关</el-radio>
        </el-radio-group>
      </el-form-item>

      <c-col :span="24" style="text-align: right; height: 36.8px">
        <!--原生重置按钮 <c-col :span="12">
      <c-button size="small" type="primary" @click="onInfbutClr">
        重置
      </c-button>
    </c-col> -->
        <el-button size="small" @click="onInfbutClr">重置</el-button>
        <!--原生查询按钮  <c-col :span="12">
        <c-button size="small" type="primary"  @click="onInfbutSearow">
            &Search
        </c-button>
       </c-col> -->
        <el-button
          type="primary"
          icon="el-icon-search"
          size="small"
          @click="onInfbutSearow"
          >查询
        </el-button>
      </c-col>

      <c-col :span="24">
        <div style="border-bottom: 10px solid rgb(232, 232, 232)"></div>
      </c-col>

      <c-col :span="24" style="margin-top: 10px">
        <c-button
          size="small"
          type="primary"
          @click="onExcel"
          style="float: right; margin-right: 10px"
        >
          导出Excel
        </c-button>
      </c-col>
      <c-col :span="24" >
        <c-istream-table :list="stmData.data" :columns="stmData.columns"
        :showButtonFlg="true">
          <el-table-column fix="right" prop="op" label="操作" width="165px">
            <template slot-scope="{ scope }">
              <c-button
                style="margin-left: 0"
                size="small"
                @click="display(scope.$index, scope.row)"
              >
                详情
              </c-button>
              <c-button
                style="margin-left: 0"
                size="small"
                type="primary"
                @click="continueEdit(scope.row)"
              >
                处理
              </c-button>
              <el-popover placement="top-start" width="50" trigger="click">
                <ul class="table-button-item-list">
                  <li>
                    <c-button size="small" style="margin-left: 0"
                      >指派</c-button
                    >
                  </li>
                  <li>
                    <c-button size="small" style="margin-left: 0"
                      >删除</c-button
                    >
                  </li>
                </ul>
                <a
                  slot="reference"
                  href="javascript:void(0)"
                  style="margin-left: 5px"
                  ><i class="el-icon-more"></i
                ></a>
              </el-popover>
            </template>
          </el-table-column>
        </c-istream-table>
      </c-col>

      <!-- <c-col :span="12">
      <c-button size="small" type="primary" @click="onInfbutDsp">
        Display
      </c-button>
    </c-col> -->

      <!-- <c-col :span="12">
      <c-button size="small" type="primary" @click="onInfbutUserow">
        Use
      </c-button>
    </c-col> -->

      <!-- <c-col :span="12">
      <c-button size="small" type="primary" @click="onInfbutButprt">
        导Excel
      </c-button>
    </c-col> -->

      <!-- <c-col :span="12">
      <el-form-item label="display stream" prop="infbut.dspstm">
        <c-input
          v-model="model.infbut.dspstm"
          placeholder="请输入display stream"
        ></c-input>
      </el-form-item>
    </c-col> -->

      <!-- <c-col :span="12">
      <c-button size="small" type="primary" @click="onInfbutExi">
        Exit
      </c-button>
    </c-col> -->
      <!-- <c-col :span="8">
          <c-checkbox v-model="model.seatyph">海关</c-checkbox>
        </c-col> -->
      <!-- <c-col :span="8">
            <c-checkbox v-model="model.seatypo">Other</c-checkbox>
          </c-col> -->
      <!-- <c-col :span="8">
            <c-checkbox v-model="model.seatypa">Own Address</c-checkbox>
          </c-col> -->
      <!-- <c-col :span="8">
            <c-checkbox v-model="model.seatypb">Bank</c-checkbox>
          </c-col> -->
      <!-- <c-col :span="8">
            <c-checkbox v-model="model.seatypc">Client</c-checkbox>
          </c-col> -->
    </el-form>
  </div>
</template>
<script>
import Api from "~/service/Api";
import commonProcess from "~/mixin/commonProcess";
import CodeTable from "~/config/CodeTable";
import Event from "~/model/Infpty/Event";

export default {
  inject: ["root"],
  props: ["model", "codes"],
  mixins: [commonProcess],
  data() {
    return {
      initdialog: false,
      radio: 1,
      stmData: {
        columns: [
          '1 1 "客户号" 98 ',
          '8 2 "中文名称" 150 ',
          '2 3 "Name" 198 ',
          '9 4 "客户类别" 98 1 0 1 KEHULB',
          '3 5 "Street" 200 ',
          '10 6 "支行名称" 98 ',
          '4 7 "ZIP" 98  ',
          '11 8 "支行行号" 200 ',
          '5 9 "City" 120',
          '12 10 "组织机构代码" 98',
          '6 11 "BIC" 70',
          '13 12 "统一社会信用代码" 200',
          '7 13 "交易主体" 98  1 0 1 TRNMAN',
        ],
        data: [],
      },
    };
  },
  methods: {
    ...Event,
    async onInfbutSearow() {
      let rule = "infbut.searow";
      let rtnmsg = await this.executeRule(rule);
      if (rtnmsg.respCode == SUCCESS) {
        //处理响应
        this.stmData.data = rtnmsg.data.infbut_dspstm.rows;
      }
      // this.executeRule("infbut_dspstm").then(res => {
      //   console.log(res);
      // })
      // this.$refs.infsea.stmData.data = rtnmsg.codeSet['infbut.dspstm']
    },
  },
  created: function () {},
};
</script>
<style scoped>
.table-button-item-list {
  padding: 0;
  margin: 0;
}
.table-button-item-list li {
  list-style: none;
  padding: 5px 0;
  text-align: center;
  color: #606266;
  cursor: pointer;
}
</style>
