<template>
  <div id="unit" class="flex-row">
    <div class="basic-main">
      <data-grid  :model="mergeinfo" partial='list' class="list_area table_sy" v-ref:grid>
        <template partial='head'>
          <tr>
            <th><nobr>客户编号</nobr></th>
            <th><nobr>客户姓名</nobr></th>
            <th><nobr>客户电话</nobr></th>
            <th><nobr>客户地址</nobr></th>
            <th><nobr>客户状态</nobr></th>
            <th><nobr>表号</nobr></th>
            <th><nobr>表型号</nobr></th>
            <th><nobr>表状态</nobr></th>
            <th><nobr>选择</nobr></th>
          </tr>
        </template>
        <template partial='body'>
          <tr>
            <td style="text-align:center"><nobr>{{row.f_userinfo_code}}</nobr></td>
            <td style="text-align:center"><nobr>{{row.f_user_name}}</nobr></td>
            <td style="text-align:center"><nobr>{{row.f_user_phone}}</nobr></td>
            <td style="text-align:center"><nobr>{{row.f_address}}</nobr></td>
            <td style="text-align:center"><nobr>{{row.f_user_state}}</nobr></td>
            <td style="text-align:center"><nobr>{{row.f_meternumber}}</nobr></td>
            <td style="text-align:center"><nobr>{{row.f_meter_brand}}{{row.f_meter_style}}</nobr></td>
            <td style="text-align:center"><nobr>{{row.f_table_state}}</nobr></td>
            <td style="text-align:center">
              <button type="button" name="button" class="button_export"
                      @click.stop="$parent.$parent.confirmmergeinfo(row)">确认选择</button>
            </td>
          </tr>
        </template>
        <template partial='foot'></template>
      </data-grid>
    </div>
  </div>
</template>
<script>
  export default {
    title: '合并信息',
    props: ['mergeinfo'],
    data () {
      return {
      }
    },
    ready () {

    },
    methods: {
      async confirmmergeinfo (row) {
        let datas = {
          beforeinfo: this.mergeinfo.data,
          afterinfo: row
        }
        let res = await this.$resetpost('rs/logic/filemanage_mergeuser', {data: datas}, {resolveMsg: null, rejectMsg: '合并档案失败'})
        /* let res = {
          data: {
            oldcode : ['001','002'],
            newcode : '001'
          }
        } */
        this.$dispatch('init', res.data)
      }
    }

  }
</script>
