<template>
  <div class="app-container">
    <!-- 添加或修改渠道信息对话框 -->
    <el-dialog
      :title="title"
      :visible.sync="open"
      width="1000px"
      append-to-body
    >
      <el-form
        class="special-el-form"
        ref="form"
        :model="form"
        :rules="rules"
        label-width="120px"
      >
        <el-form-item label="尽调主题" prop="channelName">
          <el-input v-model="form.channelName" placeholder="请输入渠道名称" />
        </el-form-item>
        <el-form-item label="项目名称" prop="projectName">
          <div
            class="el-input__inner inputSimulation yichu1"
            @click="handleProjectItem"
            :title="form.projectName"
          >
            {{ form.projectName ? form.projectName : "请选择 " }}
          </div>
          <projectItem
            ref="projectItem"
            @getProjectInfo="getProjectInfo"
          ></projectItem>
        </el-form-item>
        <el-form-item label="尽调费用" prop="contacts">
          <el-input v-model="form.contacts" placeholder="请输入尽调费用" />
        </el-form-item>
        <el-form-item label="文件" prop="file">
          <fileItem
            ref="fileItems"
            :id="form.id"
            @getFileList="getFileList"
          ></fileItem>
        </el-form-item>
        <el-form-item
          label="尽调描述"
          prop="channelBlurb"
          class="special-el-form-item"
        >
          <el-input
            rows="4"
            type="textarea"
            v-model="form.channelBlurb"
            placeholder="请输入尽调描述"
          />
        </el-form-item>
        <el-form-item label="备注" prop="mark" class="special-el-form-item">
          <el-input
            rows="4"
            type="textarea"
            v-model="form.mark"
            placeholder="请输入备注"
          />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm" v-preventReClick>确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import projectItem from "../components/projectItem";
import fileItem from "../components/fileItem";
export default {
  name: "investPoolSurveyForm",
  components: {
    Parser,
    flow,
    FlowUser,
    FlowRole,
  },
  props: {},
  components: { projectItem, fileItem },
  data() {
    return {
      open: false,
      // 查询参数
      queryParams: {
        deptId: undefined,
      },
      form:{}
    };
  },
  created() {
    this.open = true;
  },
  methods: {
    //展示人员
    handleProjectItem() {
      this.$refs.projectItem.showProjectItem = true;
    },
    // 获取fileList
    getFileList(fileList) {
      this.fileList = fileList;
    },
     /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          this.form.listFile = this.fileList;
          if (this.form.id != null) {
            // updateRecord(this.form).then((response) => {
            //   this.$modal.msgSuccess("修改成功");
            //   this.open = false;
            //   this.getList();
            // });
          } else {
            // addRecord(this.form).then((response) => {
            //   this.$modal.msgSuccess("新增成功");
            //   this.open = false;
            //   this.getList();
            // });
          }
        }
      });
    },
    /** 返回页面 */
    goBack() {},
  },
};
</script>
<style lang="scss" scoped>
</style>
