<template>
  <el-dialog
    custom-class="ele-dialog-form"
    v-if="visible"
    :visible.sync="visible"
    :title="title"
    :close-on-click-modal="false"
    :append-to-body="true"
    width="70%"
    @close="cancel"
  >
      <el-form
          label-width="160px"
          ref="formRef"
          :model="form"
          style="margin-top: 30px"
        >
          <el-row>
            <el-col :span="8">
              <el-form-item
                label="跟进内容："
                prop="content"
              >
                {{form.content}}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="达成共识：" prop="agreement">
                {{form.agreement}}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="下一步计划：" prop="nextPlan">
                {{form.nextPlan}}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="创建时间：" prop="createTime">
                {{form.createTime}}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="跟进时间：" prop="followupTime">
                {{form.followupTime}}
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="客户联系人名称：" prop="linkName">
                {{ form.linkName}}
              </el-form-item>
            </el-col>
          
           
          </el-row>
        </el-form>

    <div slot="footer" class="footer">
      <el-button @click="cancel">返回</el-button>
    </div>
  </el-dialog>
</template>

<script>
import {contactDetail} from '@/api/saleManage/contact';
import {getFile} from '@/api/system/file';
import {getInfoById as getCategoryInfo} from '@/api/classifyManage/index';
import fileUpload from '@/components/upload/fileUpload';
import dictMixins from '@/mixins/dictMixins';
import deptSelect from '@/components/CommomSelect/dept-select.vue';
import personSelect from '@/components/CommomSelect/person-select.vue';
import {copyObj} from '@/utils/util';


export default {
    props: {
      categoryTreeList: Array
    },
    mixins: [dictMixins],
    components: {
      fileUpload,
      deptSelect,
      personSelect
    },
    data() {
      let formDef = {
        id:'',
          contactName: '',
          contactId: 0,
          name: '',
          remark: '',
          responsibleName: '',
          responsibleId: '',
          source: '',
          status: 1
        };
    
      return {
        visible: false,
        title: '详情',
        row: {},
        activeName: 'base',
        formDef,
        form: copyObj(formDef),
        tableBankData: [],
        tableLinkData: [],
        ifChiefList: [
          {
            value: 0,
            label: '否'
          },
          {
            value: 1,
            label: '是'
          }
        ],
      };
    },
    methods: {
      async open(row) {
        this.form = row;
        this.visible = true;
      },

      cancel() {
        this.$nextTick(() => {
          // 关闭后，销毁所有的表单数据
          this.form = copyObj(this.formDef),
          this.otherForm = copyObj(this.otherFormDef),
          this.tableBankData = []
          this.tableLinkData = []
          this.visible = false;
        })
      },

   

    }
  };
</script>
