<template>
  <div>
     <el-form  :model="inputQuery"  label-width="120px" >
    <el-card>
      <div style="font-size: 25px;font-weight: bold;margin-bottom: 20px;">产品信息</div>
          <el-row :gutter="20" class="el-row" type="flex">
                 <el-col class="el-col" type="flex">
                   <el-form-item prop="productName"  label="产品名称:" class="query-form-item">
                     <el-input
                       style="width: 80%"
                       size="small"
                       placeholder="请输入产品名称"
                       v-model="inputQuery.productName"
                     ></el-input>
                   </el-form-item>
              </el-col>
              <el-col class="el-col" type="flex">
                   <el-form-item label="产品英文名称:" class="query-form-item">
                     <el-input
                       style="width: 80%"
                       size="small"
                       placeholder="请输入产品英文名称"
                       v-model="inputQuery.enProductName"
                     ></el-input>
                   </el-form-item>
              </el-col>
         </el-row>
         <el-row :gutter="20" class="el-row" type="flex">
                 <el-col class="el-col" type="flex">
                   <el-form-item label="规格型号:" class="query-form-item">
                     <el-input
                       style="width: 80%"
                       size="small"
                       placeholder="请输入规格型号"
                       v-model="inputQuery.modelSpec"
                     ></el-input>
                   </el-form-item>
              </el-col>
              <el-col class="el-col" type="flex">
                   <el-form-item label="注册/备案证号:" class="query-form-item">
                     <el-input
                       style="width: 80%"
                       size="small"
                       placeholder="请输入注册/备案证号"
                       v-model="inputQuery.regCertCode"
                     ></el-input>
                   </el-form-item>
              </el-col>
         </el-row>
         <el-row :gutter="20" class="el-row" type="flex">
                 <el-col class="el-col" type="flex">
                   <el-form-item label="生产企业:" class="query-form-item">
                     <el-input
                       style="width: 80%"
                       size="small"
                       placeholder="请输入生产企业"
                       v-model="inputQuery.manuName"
                     ></el-input>
                   </el-form-item>
              </el-col>
              <el-col class="el-col" type="flex">
                   <el-form-item label="生产企业英文名称:" class="query-form-item">
                     <el-input
                       style="width: 80%"
                       size="small"
                       placeholder="请输入生产企业英文名称"
                       v-model="inputQuery.enManuName"
                     ></el-input>
                   </el-form-item>
              </el-col>
         </el-row>
         <el-row :gutter="20" class="el-row" type="flex">
                 <el-col class="el-col" type="flex">
                   <el-form-item label="生产企业统一社会信用号:" class="query-form-item">
                     <el-input
                       style="width: 80%"
                       size="small"
                       placeholder="请输入生产企业统一社会信用号"
                       v-model="inputQuery.manuCertCoe"
                     ></el-input>
                   </el-form-item>
              </el-col>
              <el-col class="el-col" type="flex">
                   <el-form-item label="代理人名称:" class="query-form-item">
                     <el-input
                       style="width: 80%"
                       size="small"
                       placeholder="请输入代理人名称"
                       v-model="inputQuery.agentName"
                     ></el-input>
                   </el-form-item>
              </el-col>
         </el-row>
         <el-row :gutter="20" class="el-row" type="flex">
                 <el-col class="el-col" type="flex">
                   <el-form-item label="代理人统一社会信用号:" class="query-form-item">
                     <el-input
                       style="width: 80%"
                       size="small"
                       placeholder="请输入代理人统一社会信用号"
                       v-model="inputQuery.agentCertCode"
                     ></el-input>
                   </el-form-item>
              </el-col>
              <el-col class="el-col" type="flex">
                   <el-form-item label="最小销售产品标识:" class="query-form-item">
                     <el-input
                       style="width: 80%"
                       size="small"
                       placeholder="请输入最小销售产品标识"
                       v-model="inputQuery.nameCode"
                     ></el-input>
                   </el-form-item>
              </el-col>
         </el-row>
         <el-row :gutter="20" class="el-row" type="flex">
                 <el-col class="el-col" type="flex">
                   <el-form-item label="批次号:" class="query-form-item">
                     <el-input
                       style="width: 80%"
                       size="small"
                       placeholder="请输入批次号"
                       v-model="inputQuery.batchNo"
                     ></el-input>
                   </el-form-item>
              </el-col>
              <el-col class="el-col" type="flex">
                   <el-form-item label="生产日期:" class="query-form-item">
                     <el-date-picker
                       v-model="inputQuery.productionDate"
                        style="width: 80%"
                       value-format="yyyy-MM-dd"
                       type="date"
                       placeholder="请输入生产日期"
                     ></el-date-picker>
                   </el-form-item>
              </el-col>
         </el-row>
         <el-row :gutter="10" class="el-row" type="flex">
                 <el-col class="el-col" type="flex">
                   <el-form-item label="失效日期:" class="query-form-item">

                     <el-date-picker
                       v-model="inputQuery.expireDate"
                        style="width: 80%"
                       value-format="yyyy-MM-dd"
                       type="date"
                       placeholder="请输入失效日期"
                     ></el-date-picker>
                   </el-form-item>
              </el-col>

         </el-row>
    </el-card>
    <el-card>
      <div style="font-size: 25px;font-weight: bold;margin-bottom: 20px;">公告信息</div>
         <el-row :gutter="20" class="el-row" type="flex">
                 <el-col class="el-col" type="flex">
                   <el-form-item label="公告类型:" class="query-form-item">
                    <el-select
                      size="small"
                      v-model="inputQuery.annType"
                      style="width: 80%"
                      placeholder="公告类型"
                    >
                      <el-option label="注销注册证公告" value="1"></el-option>
                      <el-option label="暂停进口、经营和使用公告" value="2"></el-option>
                      <el-option label="项目整改/停产整改公告" value="3"></el-option>
                      <el-option label="注销生产许可证公告" value="3"></el-option>
                      <el-option label="产品召回公告" value="3"></el-option>
                    </el-select>
                   </el-form-item>
              </el-col>
              <el-col class="el-col" type="flex">
                  <el-form-item label="检查方式:" class="query-form-item">
                   <el-select
                     size="small"
                     v-model="inputQuery.checkType"
                     style="width: 80%"
                     placeholder="检查方式"
                   >
                     <el-option label="远程非现场检查" value="1"></el-option>
                     <el-option label="监督抽检" value="2"></el-option>
                     <el-option label="飞行检查" value="3"></el-option>
                   </el-select>
                    </el-form-item>
              </el-col>

         </el-row>
         <el-row :gutter="20" class="el-row" type="flex">
                 <el-col class="el-col" type="flex">
                   <el-form-item label="公告发布索引号:" class="query-form-item">
                     <el-input
                       style="width: 80%"
                       size="small"
                       placeholder="请输入公告发布索引号"
                       v-model="inputQuery.publicCode"
                     ></el-input>
                   </el-form-item>
              </el-col>
              <el-col class="el-col" type="flex">
                   <el-form-item label="发布人:" class="query-form-item">
                     <el-input
                       style="width: 80%"
                       size="small"
                       placeholder="请输入发布人"
                       v-model="inputQuery.publicName"
                     ></el-input>
                   </el-form-item>
              </el-col>
         </el-row>
         <el-row :gutter="20" class="el-row" type="flex">
                 <el-col class="el-col" type="flex">
                   <el-form-item label="发布主题分类:" class="query-form-item">
                     <el-input
                       style="width: 80%"
                       size="small"
                       placeholder="请输入发布主题分类"
                       v-model="inputQuery.publicSubject"
                     ></el-input>
                   </el-form-item>
              </el-col>
              <el-col class="el-col" type="flex">
                   <el-form-item label="发布时间:" class="query-form-item">
                     <el-date-picker
                       v-model="inputQuery.publicTime"
                        style="width: 80%"
                       value-format="yyyy-MM-dd"
                       type="date"
                       placeholder="请输入发布时间"
                     ></el-date-picker>
                   </el-form-item>
              </el-col>
         </el-row>
         <el-row :gutter="20" class="el-row" type="flex">
                 <el-col class="el-col" type="flex">
                   <el-form-item label="发布标题:" class="query-form-item">
                     <el-input
                       style="width: 80%"
                       size="small"
                       placeholder="请输入发布标题"
                       v-model="inputQuery.publicTitle"
                     ></el-input>
                   </el-form-item>
              </el-col>
         </el-row>
         <el-row :gutter="20" class="el-row" type="flex">
                 <el-col class="el-col" type="flex">
                   <el-form-item label="发布来源名称:" class="query-form-item">
                     <el-input
                       style="width: 80%"
                       size="small"
                       placeholder="请输入发布来源名称"
                       v-model="inputQuery.sourceName"
                     ></el-input>
                   </el-form-item>
              </el-col>
         </el-row>
         <el-row :gutter="20" class="el-row" type="flex">
                 <el-col class="el-col" type="flex">
                   <el-form-item label="发布来源地址:" class="query-form-item">
                     <el-input
                       style="width: 80%"
                       size="small"
                       placeholder="请输入发布来源地址"
                       v-model="inputQuery.sourceUrl"
                     ></el-input>
                   </el-form-item>
              </el-col>
         </el-row>
         <el-row :gutter="20" class="el-row" type="flex">
                 <el-col class="el-col" type="flex">
                   <el-form-item label="公告内容:" class="query-form-item">
                     <el-input
                       style="width: 80%"
                       size="small"
                       type="textarea"
                       placeholder="请输入公告内容"
                       v-model="inputQuery.annContent"
                     ></el-input>
                   </el-form-item>
              </el-col>
         </el-row>
         <el-row :gutter="20" class="el-row" type="flex">
                 <el-col class="el-col" type="flex">
                   <el-form-item label="检查异常信息:" class="query-form-item">
                     <el-input
                       style="width: 80%"
                       size="small"
                         type="textarea"
                       placeholder="请输入检查异常信息"
                       v-model="inputQuery.errContent"
                     ></el-input>
                   </el-form-item>
              </el-col>
         </el-row>
        <div style='text-align: center; margin-bottom: 10px;margin-top: 18px ;'>
          <el-button  @click="closeDialog">取消</el-button>
          <el-button type="primary" @click="submitInv">提交</el-button>
        </div>
    </el-card>
     </el-form>
  </div>
</template>

<script>

import {savegg} from "@/api/anno/anncmntDev";

export default {
  name: "indexDialog",
  props: {
    closeDialog: {
      type: Function,
      required: true,
    },
    formName: {
      type: Object,
      required: true,
    },
    inputQuery: {
      type: Object,
      required: true,
    },
  },
  data() {
    return {

    }
  },
  methods: {
    submitInv(){
      if(this.formName==1){
        savegg(this.inputQuery,"save").then((response) => {
          if(response.code == 20000){
            this.closeDialog();
          }else{
            this.$message.error(response.message);
          }

        })
          .catch(() => {
            this.$message.error("添加失败");
          });
      }else{
        savegg(this.inputQuery,"edit").then((response) => {
          if(response.code == 20000){
            this.closeDialog();
          }else{
            this.$message.error(response.message);
          }

        })
          .catch(() => {
            this.$message.error("添加失败");
          });
      }
    },
  },
  components: {},
  created() {
  },
}
</script>

<style scoped>

</style>
