<template>
  <el-dialog :title="openTitle" :visible.sync="visible" @close="handleClose"  @open="open"  v-dialogDrag
    custom-class="common-dialog" :close-on-click-modal="false" append-to-body width="1000px" >
    <el-form :model="paramForm"  :disable="openType==='view' " label-position="left"  ref="formRef"
          label-width="90px" size="small" >
      <el-row :gutter="20">
        <el-col :span="8">
          <el-form-item label="所属模块"    >
            <common-select v-model="paramForm.moduleId" @selectChange="moduleChange"
               dict-type="CRM_Module_Code"  ref="moduleRef"  >
            </common-select>
          </el-form-item>
          <el-form-item label="字段名"    >
            <el-input v-model="paramForm.contactNumber"  placeholder="请输入" />
          </el-form-item>
          <el-form-item label="关联主数据模块"  class="lh18"   >
             <el-select v-model="paramForm.tissue"
               placeholder="请选择" clearable filterable>
               <el-option
                      v-for="item in list"
                      :key="item.orgId"
                      :label="item.organizationName"
                      :value="item.orgId" >
               </el-option>
             </el-select>
          </el-form-item>
        </el-col>
        <!-- 第二列 -->
        <el-col :span="8">
          <el-form-item label="表单"    >
             <el-select v-model="paramForm.tissue"
               placeholder="请选择" clearable filterable>
               <el-option
                      v-for="item in list"
                      :key="item.orgId"
                      :label="item.organizationName"
                      :value="item.orgId" >
               </el-option>
             </el-select>
          </el-form-item>
          <el-form-item label="字段标识"    >
             <el-input v-model="paramForm.contactNumber" disabled  placeholder="请输入" />
          </el-form-item>
          <el-form-item label="关联主数据字段"   class="lh18" >
             <el-select v-model="paramForm.tissue"
               placeholder="请选择" clearable filterable>
               <el-option
                      v-for="item in list"
                      :key="item.orgId"
                      :label="item.organizationName"
                      :value="item.orgId" >
               </el-option>
             </el-select>
          </el-form-item>
        </el-col>
        <!-- 第三列 -->
        <el-col :span="8">
          <el-form-item label="状态"    >
             <el-select v-model="paramForm.tissue"
               placeholder="请选择" clearable filterable>
               <el-option
                      v-for="item in list"
                      :key="item.orgId"
                      :label="item.organizationName"
                      :value="item.orgId" >
               </el-option>
             </el-select>
          </el-form-item>
          <el-form-item label="录入方式"    >
             <el-select v-model="paramForm.tissue"
               placeholder="请选择" clearable filterable>
               <el-option
                      v-for="item in list"
                      :key="item.orgId"
                      :label="item.organizationName"
                      :value="item.orgId" >
               </el-option>
             </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    </div>

    <div v-show="openType=='edit'" style="margin-bottom: 0;text-align: center" >
      <el-button @click="submitForm" type="warning">保存</el-button>
      <el-button @click="visible = false " type="info"  plain>取消</el-button>
    </div>
  </el-dialog>
</template>

<script>

  export default {
    name: "dig-data",
    created(){

    },
    mounted () {

    },

    methods: {

      submitForm() {

        this.$refs['formRef'].validate((valid) => {
          if (!valid) { return; }

          let param = JSON.parse(JSON.stringify(this.paramForm));


        });

      },
      open(){


      },
      //关闭弹窗
      handleClose() {
        this.$refs['formRef'].resetFields();
        Object.keys(this.paramForm).forEach(key => this.paramForm[key] = '' );
        this.visible = false;
      },

    },
    data() {

      return {
        visible: false,
        openTitle: '',
        openType: '',

        paramForm: {
          cName: '',
          contactNumber: '',
          qq: '',
          files: [],
        },
        list: [],

      }
    },


  }
</script>

<style type="text/css"  lang="scss">

</style>
