<!-- 委员会申请列表 -->
<template>
  <div class="autoBox box1" style="position: relative; background: #f5f5f5">
    <div class="center" style="margin-top: 20px; height: 1026px">
      <div class="left">
        <div class="centerLeft1">
          <div class="top">
            <div class="top1"></div>
            <div class="top2"></div>
            <div class="allApplication">
              <span>{{ $t("common.Withdrawdetail") }}</span>
            </div>
            <div @click="back" class="more">
              <span>{{ "<" }}{{ $t("common.return") }}</span>
            </div>
          </div>
          <div class="content">
            <div class="content2" style="overflow-y: auto; overflow-x: hidden">
              <div
                style="
                  margin-top: 39px;
                  width: 93%;
                  height: auto;
                  display: flex;
                  flex-wrap: wrap;
                  align-items: center;
                  background-clip: content-box;
                "
              >
                <div class="tableTr">
                  <div class="tableTd20">
                    {{ $i18n.locale == "en" ? "Apply Name " : "申请人" }}
                  </div>
                  <div class="tableTd30">
                    <span style="margin-left: 20px">{{ applyname }}</span>
                  </div>
                  <div class="tableTd20">
                    {{ $i18n.locale == "en" ? "Apply Num " : "申请编号" }}
                  </div>
                  <div class="tableTd30">
                    <span style="margin-left: 20px">{{ applynumber }}</span>
                  </div>
                </div>
                <div class="tableTr">
                  <div class="tableTd20">
                    {{ $i18n.locale == "en" ? "Apply Time " : "申请时间" }}
                  </div>
                  <div class="tableTd30">
                    <span style="margin-left: 20px">{{ applytime }}</span>
                  </div>
                  <div class="tableTd20">
                    {{
                      $i18n.locale == "en" ? "Belong Committe " : "所属委员会"
                    }}
                  </div>
                  <div class="tableTd30">
                    <el-select
                      v-model="commact_committee"
                      :placeholder="this.$i18n.locale == 'en' ? 'Please Choose' :'请选择'"
                      style="width: 300px; margin-left: 20px"
                    >
                      <el-option
                        style="width: 300px"
                        v-for="item in committeeoptions"
                        :key="item.value"
                        :label="$i18n.locale == 'en' ?item.label2:item.label"
                        :value="item.value"
                      >
                      </el-option>
                    </el-select>
                  </div>
                </div>

                <div class="tableTr">
                  <div class="tableTd20">
                    {{ $i18n.locale == "en" ? "Application Type " : "申请类型" }}
                  </div>
                  <div class="tableTd30">
                    <el-select
                      v-model="applytype"
                      :placeholder="this.$i18n.locale == 'en' ? 'Please Choose' :'请选择'"
                      style="width: 300px; margin-left: 20px"
                    >
                      <el-option
                        style="width: 300px"
                        v-for="item in options"
                        :key="item.value"
                        :label="$i18n.locale == 'en' ?item.label2:item.label"
                        :value="item.value"
                      >
                      </el-option>
                    </el-select>
                  </div>
                  <div class="tableTd20">
                    {{ $i18n.locale == "en" ? "Title " : "标题" }}
                  </div>
                  <div class="tableTd30">
<!--                    <span style="margin-left: 20px">{{ commact_title }}</span>-->
                    <el-input       v-model="commact_title" :placeholder="this.$i18n.locale == 'en' ? 'Please The Input' :'请输入'"></el-input>
                  </div>
                </div>

                <div class="tableTr" v-if="applytype == '4'">
                  <div class="tableTd20">
                    {{ $i18n.locale == "en" ? "Work Plans " : "工作计划" }}
                  </div>
                  <div class="tableTd120">
                    <el-date-picker
                      style="width: 80%; margin-left: 20px"
                      v-model="workPlanSummaryYear"
                      type="date"
                      placeholder="选择日期"
                    >
                    </el-date-picker>
                  </div>
                </div>
                <div class="tableTr" v-if="applytype == '6'">
                  <div class="tableTd20">
                    {{ $i18n.locale == "en" ? "Release Range " : "发布范围" }}
                  </div>
                  <div class="tableTd120">
                    <el-select
                      v-model="releaseScope"
                      :placeholder="this.$i18n.locale == 'en' ? 'Please Choose' :'请选择'"
                      style="width: 300px; margin-left: 20px"
                    >
                      <el-option
                        style="width: 300px"
                        v-for="item in options4"
                        :key="item.value"
                        :label="$i18n.locale == 'en' ?item.label2:item.label"
                        :value="item.value"
                      >
                      </el-option>
                    </el-select>
                  </div>
                </div>
                <div class="tableTr" v-if="applytype == '2'">
                  <div class="tableTd20">
                    {{
                      $i18n.locale == "en" ? "Receive Committe " : "接收委员会"
                    }}
                  </div>
                  <div class="tableTd30" style="overflow-y: auto">
                    <el-select
                      multiple
                      v-model="acceptCommittee"
                      :placeholder="this.$i18n.locale == 'en' ? 'Please Choose' :'请选择'"
                      style="width: 300px; margin-left: 20px"
                    >
                      <el-option
                        style="width: 300px"
                        v-for="item in committeeoptions"
                        :key="item.value"
                        :label="$i18n.locale == 'en' ?item.label2:item.label"
                        :value="item.value"
                      >
                      </el-option>
                    </el-select>
                  </div>
                  <div class="tableTd20">
                    {{ $i18n.locale == "en" ? "Receiver " : " 接收人" }}
                  </div>
                  <div class="tableTd30">
                    <el-select
                      multiple
                      v-model="accepter"
                      :placeholder="this.$i18n.locale == 'en' ? 'Please Choose' :'请选择'"
                      style="width: 300px; margin-left: 20px"
                    >
                      <el-option
                        style="width: 300px"
                        v-for="item in advice_personoption"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value"
                      >
                      </el-option>
                    </el-select>
                  </div>
                </div>
                <div class="tableTr">
                  <!--                <span>{{ $i18n.locale == "en" ? "Content " : " 摘要" }}</span>-->
                  <div class="tableTd20" style="margin-top: 20px;height: 60px;"> {{ $i18n.locale == 'en' ? 'Content ' : '摘要' }}</div>
                  <div class="tableTd120" style="padding-top:0px;margin-top: 20px;height: 60px;">
                    <div class="inputDeep">
                      <el-input
                          type="textarea"
                          :rows="1"
                          :placeholder="this.$i18n.locale == 'en' ? 'Please The Input' :'请输入'"
                          style="resize: none"
                          :maxlength="200"
                          v-model="content">
                      </el-input>
                      <div style="float:right"><span>{{zititotal}}</span>/200</div>
                    </div>
                  </div>
                </div>
              </div>

<!--              <div style="height: auto; width: 100%">-->
<!--                      <div class="content_title">{{content_title}}</div>-->
<!--                <div class="content_content">{{ content }}</div>-->
<!--              </div>-->

              <div style="display: flex; margin-top: 31px; margin-left: -20px" v-if="applytype!='6'">
                <div style="width: 7%; margin-top: 4px">
                  {{ $i18n.locale == "en" ? "Body " : " 正文" }}:
                </div>
                <div style="width: 93%">
                  <el-upload
                    class="upload-demo"
                    action="/api/nationregioncomittee-service/nrc/nrcApplys/uploadFile"
                    :on-preview="handlePreview"
                    :on-remove="handleRemove"
                    :before-remove="beforeRemove"
                    :before-upload="beforeUpload"
                    :on-success="handleAvatarSuccessAnnex"
                    multiple
                    :on-exceed="handleExceed"
                    :file-list="fileList"
                  >
                     <el-button size="small"><i class="el-icon-upload2"></i>{{ $i18n.locale == 'en' ? 'Uploadfile ' : ' 上传文件' }}</el-button>
                     <div slot="tip" class="el-upload__tip">{{ $i18n.locale == 'en' ? 'Supported file name extension :doc :docx: PDF. The size of a single file cannot exceed 4MB ' : ' 支持扩展名：doc :docx :pdf,单个文件大小不超过4MB' }}</div>
                  </el-upload>
                </div>
              </div>
              <div style="display: flex; margin-top: 98px; margin-left: -20px" v-if="applytype!='6'">
                <div :style="$i18n.locale =='en'? 'width:9%;margin-top:4px':'width:7%;margin-top:4px'">
                  {{ $i18n.locale == "en" ? "Attachment " : "附件" }}:
                </div>
                <div style="width: 91%">
                  <el-upload
                    class="upload-demo"
                    action="/api/nationregioncomittee-service/nrc/nrcApplys/uploadFile"
                    :on-preview="handlePreview1"
                    :on-remove="handleRemove1"
                    :before-remove="beforeRemove1"
                    :before-upload="beforeUpload1"
                    :on-success="handleAvatarSuccessAnnex1"
                    multiple
                    :on-exceed="handleExceed1"
                    :file-list="fileList1"
                  >
                     <el-button size="small"><i class="el-icon-upload2"></i>{{ $i18n.locale == 'en' ? 'Uploadfile ' : ' 上传文件' }}</el-button>
                     <div slot="tip" class="el-upload__tip">{{ $i18n.locale == 'en' ? 'Supported file name extension :.rar.zip.doc.docx.pdf .jpg.png. The size of a single file cannot exceed 4MB ' : ' 支持扩展名：.rar.zip.doc.docx.pdf .jpg.png,单个文件大小不超过4MB' }}</div>
                  </el-upload>
                </div>
              </div>

              <div style="display:flex;margin-top:31px;padding-left:20px" v-if="applytype=='6'">
                <div style="width:7%;margin-top:4px"><span style="color:red">*</span>{{ $i18n.locale == 'en' ? 'Body ' : ' 正文' }}:</div>
                <div style="width:93%">
                  <el-upload
                          class="upload-demo"
                          action="/api/nationregioncomittee-service/nrc/nrcApplys/uploadFile"
                          :on-remove="handleRemove2"
                          :before-remove="beforeRemove2"
                          :before-upload="beforeUpload2"
                          :limit="1"
                          :on-success="handleAvatarSuccessAnnex2"
                          multiple
                          :on-exceed="handleExceed2"
                          :file-list="fileList2">
                    <el-button size="small"><i class="el-icon-upload2"></i>{{ $i18n.locale == 'en' ? 'Upload File ' : ' 上传文件' }}</el-button>
                    <div slot="tip" class="el-upload__tip">{{ $i18n.locale == 'en' ? 'Upload JPG / PNG format file. The file cannot exceed 10m, and up to 1 piece can be uploaded' : ' 上传jpg/png格式文件，文件不能超过10M，最多可上传1张' }}</div>
                  </el-upload>
                </div>
              </div>

              <div style="display:flex;margin-top:98px;padding-left:20px" v-if="applytype=='6'">
                <div style="width:7%;margin-top:4px" :style="$i18n.locale =='en'? 'width:10%;margin-top:4px':'width:7%;margin-top:4px'"><span style="color:red">*</span>{{ $i18n.locale == 'en' ? 'Attachment ' : ' 附件' }}:</div>
                <div :style="$i18n.locale =='en'? 'width:91%':'width:93%'">
                  <el-upload
                          class="upload-demo"
                          action="/api/nationregioncomittee-service/nrc/nrcApplys/uploadFile"
                          :on-remove="handleRemove3"
                          :before-remove="beforeRemove3"
                          :before-upload="beforeUpload3"
                          :limit="1"
                          :on-success="handleAvatarSuccessAnnex3"
                          multiple
                          :on-exceed="handleExceed3"
                          :file-list="fileList3">
                    <el-button size="small"><i class="el-icon-upload2"></i>{{ $i18n.locale == 'en' ? 'Upload File ' : ' 上传文件' }}</el-button>
                    <div slot="tip" class="el-upload__tip">{{ $i18n.locale == 'en' ? 'Upload PDF format file. The file cannot exceed 50m' : '上传Pdf格式文件，文件不能超过50M' }}</div>
                  </el-upload>
                </div>
              </div>

              <div
                style="margin-top: 107px; margin-bottom: 30px; display: flex"
              >
                <div @click="submit" class="submit">
                  {{ $i18n.locale == "en" ? "ToSubmit  " : " 再次提交" }}
                </div>
                <div @click="close" class="cancel">
                  {{ $i18n.locale == "en" ? "Close  " : " 关闭" }}
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import Screen from "@/components/screen";
import {
  getwaitdetail,
  getcommittee1,
  getwaitacceser,
  editwaitapply,
  editwaittijiao,
  uploadfile,
} from "@/api/committee/nrc";
export default {
  name: "Withdrawdetail",
  props: ["detailids", "reserveone_s", "flag","logo"],
  components: {
    Screen,
  },
  data() {
    return {
      options4: [
        {
          label: "网站公开",
          label2: "Site Public",
          value: "网站公开"},
        {
          label: "委员会内部",
          label2: "Committee Internal",
          value: "委员会内部"},
      ],
      committeeoptions: [],
      content_title: "研讨会",
      content_content:
        "贝克莱主席指出，为了实现预期的目标，非洲国家需要动员能源，扩大合作，促进电力连接和整合，提升能源领域的全球竞争力，并遵守2030年联合国和非盟的2063年议程。作为一个成员国，埃塞俄比亚正在推动跨境基础设施的发展，建立电力互联设施，并开发可再生能源，推动区域合作与一体化。",
      options: [
        {
          label: "活动方案",
          label2: "Programme Of Committee Activities",
          value: "1"},
        {
          label: "公文",
          label2: "Document",
          value: "5"},
        {
          label: "工作计划/总结",
          label2: "Work Plan/Summary",
          value: "4"},
        {
          label: "资料发布",
          label2: "Data Release",
          value: "6"},
        {
          label: "意见建议",
          label2: "Opinion Suggestion",
          value: "2"}
      ],
      finished: false,
      areadeal1: false,
      areadeal2: false,
      activeName: "first",
      accepter: undefined, //接收人
      acceptCommittee: undefined, //接收委员会
      applytype: undefined, //4.工作计划
      applytype1: undefined,
      releaseScope: undefined, //发布范围
      workPlanSummaryYear: undefined, //工作计划
      handleNode: undefined,
      files: [],
      id: undefined,
      zititotal:0,
      applyStatus: undefined,
      frontOrBack: undefined, //前台还是后台
      filename: [],
      filename1: [],
      filename2: [],
      filename3: [],
      status: undefined, //状态
      fileList: [],
      fileList1: [],
      fileList2: [],
      fileList3: [],
      filepath: undefined,
      filepath1: undefined,
      globalReadonly: true,
      applyname: undefined,
      applynumber: undefined, //申请编号
      applytime: undefined, //申请时间
      commact_committee: undefined, //委员会
      content: undefined, //内容
      commact_title: undefined, //标题
      advice_personoption: [],
      defaultProps: {
        children: "param",
        label: "name",
      },

      defaultShowNodes: [],
      refresh: 1,

      search: "",
      screen1s: {
        value: "common.type",
        item: [],
      },
      screen1def: null,
      screen2Item: null,
    };
  },
  watch: {
    "$i18n.locale"() {
      console.log("aaa")
    },
    content(){
      console.log(this.content.length)
      if(this.content.length>200){
        this.$message.error('不能超过200个字')
      }
      this.zititotal=this.content.length
    },
    CountryId() {},
    acceptCommittee(newVal, oldVal) {
      if (this.acceptCommittee.length != 0) {
        let aa = "";
        this.acceptCommittee.forEach((item) => {
          aa += item + ",";
        });
        aa = aa.substr(0, aa.length - 1);
        let params = {
          committeeId: aa,
        };
        this.advice_personoption = [];
        getwaitacceser(params).then((res) => {
          for (let i = 0; i < res.data.page.length; i++) {
            let obj = {};
            obj.data = [];
            obj.label = res.data.page[i].name;
            obj.value = res.data.page[i].id;
            this.advice_personoption.push(obj);
          }
        });
      } else {
        this.advice_personoption = [];
      }
    },
  },
  updated() {},
  mounted() {
    getcommittee1().then((res) => {
      /*  this.commiteeoptions=res.data.page*/
      for(let i=0;i<res.data.page.length;i++){
        let obj={}
        obj.data=[];
        obj.label=res.data.page[i].committeeName
        obj.label2=res.data.page[i].committeeNameEn
        obj.value=res.data.page[i].id
        this.committeeoptions.push(obj)
      }
    });
    getwaitdetail(this.detailids).then((res) => {
      this.applyname = res.data.nrcApply.applyPeopleName;
      this.applynumber = res.data.nrcApply.applyNumber;
      this.applytime = res.data.nrcApply.createDate;
      this.content = res.data.nrcApply.abstractInfo;
      this.applytype = res.data.nrcApply.applyType;
      this.applyStatus = res.data.nrcApply.applyStatus;
      this.reserveOne = res.data.nrcApply.reserveOne;
      this.commact_title = res.data.nrcApply.title;
      this.commact_committee = res.data.nrcApply.belongCommittee;
      this.releaseScope = res.data.nrcApply.releaseScope;
      if(res.data.nrcApply.workPlanSummaryYear){
        this.workPlanSummaryYear=res.data.nrcApply.workPlanSummaryYear
      }

      let arr = res.data.nrcApply.acceptCommittee
      let arr2 = res.data.nrcApply.accepter
      let arry = undefined;
      if(arr != null && arr != undefined){
        arry = arr.split(" ");
      }
      let arry1 = [];
      // 获取接收委员会
      if(arry != undefined && arry != null && arry != "" && arry.length > 0){
        for (let i = 0; i < this.committeeoptions.length; i++) {
          for (let j = 0; j < arry.length; j++) {
            if(arry[j] == this.committeeoptions[i].label){
              arry1.push(this.committeeoptions[i].value);
            }
          }
        }
        this.acceptCommittee = arry1;
        let aa=''
        this.acceptCommittee.forEach(item=>{
          aa+=item+','
        })
        aa = aa.substr(0, aa.length - 1);
        let params={
          committeeId:aa,

        }
        this.advice_personoption=[]
        // 获取接收人
        getwaitacceser(params).then(res=>{
          for(let i=0;i<res.data.page.length;i++){
            let obj={}
            obj.data=[];
            obj.label=res.data.page[i].name
            obj.value=res.data.page[i].id
            this.advice_personoption.push(obj)
          }

          let arry2 = arr2.split(" ");
          let arry3 = [];
          if(arry2 != undefined && arry2 != null && arry2 != "" && arry2.length > 0){
            for (let i = 0; i < this.advice_personoption.length; i++) {
              for (let j = 0; j < arry2.length; j++) {
                if(arry2[j] == this.advice_personoption[i].label){
                  arry3.push(this.advice_personoption[i].value);
                }
              }
            }
            this.accepter = arry3;
          }
        })
      }

      if(this.applytype == 6){
        if (res.data.files) {
          res.data.files.forEach((item) => {
            if (item.type == "2") {
              let obj = {};
              obj.name = item.fileNameDisplay;
              obj.url = item.filePath;
              obj.type = item.type;
              this.fileList2.push(obj);
            }
            if (item.type == "5") {
              let obj = {};
              obj.name = item.fileNameDisplay;
              obj.url = item.filePath;
              obj.type = item.type;
              this.fileList3.push(obj);
            }
          });
        }
      }else {
        if (res.data.files) {
          res.data.files.forEach((item) => {
            if (item.type == "2") {
              let obj = {};
              obj.name = item.fileNameDisplay;
              obj.url = item.filePath;
              obj.type = item.type;
              this.fileList.push(obj);
            }
            if (item.type == "3") {
              let obj = {};
              obj.name = item.fileNameDisplay;
              obj.url = item.filePath;
              obj.type = item.type;
              this.fileList1.push(obj);
            }
          });
        }
      }


    });
    /*this.applyname=this.$store.state.user.user.realName
            this.applytime=this.getNowFormatDate()*/
  },
  destroyed() {},
  methods: {
    handleCurrentChange() {},
    back() {
      if(this.flag==1){
        var params = {
          name: "workspace",
          type: false,
        };
        this.$emit("applicationType", params);
      }
      if(this.flag==2){
        if(this.logo == "my"){
          var params = {
            name: "application",
            type: true,
          };
          this.$emit("applicationType", params);
        }else {
          var params = {
            name: "application",
            type: false,
          };
          this.$emit("applicationType", params);
        }

      }
    },
    submit() {
      let aa = "";
      let newArr = [];
      if (this.reserveone_s) {
        var arrays = this.reserveone_s.split(",");
        arrays.forEach((item) => {
          if (item) {
            newArr.push(item);
          }
        });
        newArr.forEach((item) => {
          aa += item + ",";
        });
      }

      aa = aa.substr(0, aa.length - 1);
      if (this.applyStatus == 8) {
        this.applyStatus = 10;
      }
      if (this.applyStatus == 9) {
        this.applyStatus = 11;
      }
      if (this.applyStatus == 5) {
        this.applyStatus = 6;
      }
      let file = [];
      if (this.filename) {
        this.filename.forEach((item) => {
          let obj = {};
          obj.fileNameDisplay = item.fileNameDisplay;
          obj.filePath = item.filePath;
          obj.type = item.type;
          file.push(obj);
        });
      }
      if (this.filename1) {
        this.filename1.forEach((item) => {
          let obj = {};
          obj.fileNameDisplay = item.fileNameDisplay;
          obj.filePath = item.filePath;
          obj.type = item.type;
          file.push(obj);
        });
      }
      if (this.filename2) {
        this.filename2.forEach((item) => {
          let obj = {};
          obj.fileNameDisplay = item.fileNameDisplay;
          obj.filePath = item.filePath;
          obj.type = item.type;
          file.push(obj);
        });
      }
      if (this.filename3) {
        this.filename3.forEach((item) => {
          let obj = {};
          obj.fileNameDisplay = item.fileNameDisplay;
          obj.filePath = item.filePath;
          obj.type = item.type;
          file.push(obj);
        });
      }
      if (this.fileList) {
        this.fileList.forEach((item) => {
          let obj = {};
          obj.fileNameDisplay = item.name;
          obj.filePath = item.url;
          obj.type = item.type;
          file.push(obj);
        });
      }
      if (this.fileList1) {
        this.fileList1.forEach((item) => {
          let obj = {};
          obj.fileNameDisplay = item.name;
          obj.filePath = item.url;
          obj.type = item.type;
          file.push(obj);
        });
      }
      if (this.fileList2) {
        this.fileList2.forEach((item) => {
          let obj = {};
          obj.fileNameDisplay = item.name;
          obj.filePath = item.url;
          obj.type = item.type;
          file.push(obj);
        });
      }
      if (this.fileList3) {
        this.fileList3.forEach((item) => {
          let obj = {};
          obj.fileNameDisplay = item.name;
          obj.filePath = item.url;
          obj.type = item.type;
          file.push(obj);
        });
      }
      if (this.applytype == 1) {
        if (this.commact_title == "" || this.commact_title == undefined) {
          this.$message.error("请输入标题");
        }
        let params = {
          id: this.detailids,
          applyType: this.applytype,
          applyPeople: this.applyname,
          applyNumber: this.applynumber,
          applyTime: this.applytime,
          title: this.commact_title,
          abstractInfo: this.content,
          belongCommittee: this.commact_committee,
          statusDict: 7,
          applyStatus: this.applyStatus,
          approver: aa,
          frontOrBack: 2,
          /*  approver:this.reserveOne,*/
          files: file,
        };
        this.editwaitapplys(params);
      }
      if (this.applytype == 5) {
        let params = {
          id: this.detailids,
          applyType: this.applytype,
          applyPeople: this.applyname,
          applyNumber: this.applynumber,
          applyTime: this.applytime,
          title: this.commact_title,
          abstractInfo: this.content,
          belongCommittee: this.commact_committee,
          statusDict: 7,
          frontOrBack: 2,
          // approver:this.reserveOne,
          applyStatus: this.applyStatus,
          files: file,
          approver: aa,
        };
        this.editwaitapplys(params);
      }
      if (this.applytype == 4) {
        let params = {
          approver: aa,
          id: this.detailids,
          applyType: this.applytype,
          applyPeople: this.applyname,
          applyNumber: this.applynumber,
          applyTime: this.applytime,
          title: this.commact_title,
          abstractInfo: this.content,
          // approver:this.reserveOne,
          belongCommittee: this.commact_committee,
          workPlanSummaryYear: this.workPlanSummaryYear
            ? this.getNowFormatDate1(this.workPlanSummaryYear)
            : this.workPlanSummaryYear,
          statusDict: 7,
          frontOrBack: 2,
          applyStatus: this.applyStatus,
          files: file,
        };
        this.editwaitapplys(params);
      }
      if (this.applytype == 6) {
        if(file.length <= 1){
          if(this.$i18n.locale == "en"){
            this.$message.error('Please select a Text and Annexes');
          }else {
            this.$message.error('请选择正文和附件');
          }
          return;
        }
        let params = {
          approver: aa,
          id: this.detailids,
          applyType: this.applytype,
          applyPeople: this.applyname,
          applyNumber: this.applynumber,
          applyTime: this.applytime,
          title: this.commact_title,
          abstractInfo: this.content,
          belongCommittee: this.commact_committee,
          statusDict: 7,
          frontOrBack: 2,
          // approver:this.reserveOne,
          applyStatus: this.applyStatus,
          releaseScope: this.releaseScope,
          files: file,
        };
        this.editwaitapplys(params);
      }
      if (this.applytype == 2) {
        let adviceperson = "";
        if (this.accepter) {
          this.accepter.forEach((item) => {
            adviceperson += "," + item + ",";
          });
        }
        let adviceacceptcommittee = "";
        if (this.acceptCommittee) {
          this.acceptCommittee.forEach((item) => {
            adviceacceptcommittee += "," + item + ",";
          });
        }
        let params = {
          approver: aa,
          id: this.detailids,
          applyType: this.applytype,
          applyPeople: this.applyname,
          applyNumber: this.applynumber,
          applyTime: this.applytime,
          title: this.commact_title,
          abstractInfo: this.content,
          // approver:this.reserveOne,
          acceptCommittee: adviceacceptcommittee,
          belongCommittee: this.commact_committee,
          applyStatus: this.applyStatus,
          accepter: adviceperson,
          statusDict: 7,
          frontOrBack: 2,
          files: file,
        };
        this.editwaitapplys(params);
      }
    },
    editwaitapplys(data, aa) {
      editwaitapply(data).then((res) => {
        if (res.status == "200") {
          if (this.$i18n.locale.toUpperCase() == 'ZH') {
            alert('提交成功')
          }else{
            alert('Submitted successfully')
          }
          if (this.flag == 1) {
            var params = {
              name: "workspace",
              type: false,
            };
            this.$emit("applicationType", params);
          }
          if(this.flag==2){
            if(this.logo == "my"){
              var params = {
                name: "application",
                type: true,
              };
              this.$emit("applicationType", params);
            }else {
              var params = {
                name: "application",
                type: false,
              };
              this.$emit("applicationType", params);
            }
          }
        }
      });
    },
    close() {
      if (this.flag == 1) {
        var params = {
          name: "workspace",
          type: false,
        };
        this.$emit("applicationType", params);
      }
      if(this.flag==2){
        if(this.logo == "my"){
          var params = {
            name: "application",
            type: true,
          };
          this.$emit("applicationType", params);
        }else {
          var params = {
            name: "application",
            type: false,
          };
          this.$emit("applicationType", params);
        }

      }
    },
    screenBack() {},
    handleAvatarSuccessAnnex(res, file) {
      let obj = {};
      obj.fileNameDisplay = file.name;
      obj.filePath = res.data.filePath;
      obj.type = 2;
      this.filename.push(obj);
      console.log(this.filename);
    },
    handleAvatarSuccessAnnex1(res, file) {
      let obj = {};
      obj.fileNameDisplay = file.name;
      obj.filePath = res.data.filePath;
      obj.type = 3;
      this.filename1.push(obj);
    },
    handleAvatarSuccessAnnex2(res, file) {
      if (res.status==500){
        if (this.$i18n.locale.toUpperCase() == 'EN') {
          this.$message.error("Upload Failed");
        }else {
          this.$message.error(res.msg);
        }
        this.fileList2.splice(this.fileList2.indexOf(file), 1)
        return
      }
      let obj={}
      obj.fileNameDisplay=file.name
      obj.filePath=res.data.filePath
      obj.type=2
      this.filename2.push(obj)
    },
    handleAvatarSuccessAnnex3(res, file) {
      if (res.status==500){
        if (this.$i18n.locale.toUpperCase() == 'EN') {
          this.$message.error("Upload Failed");
        }else {
          this.$message.error(res.msg);
        }
        this.fileList3.splice(this.fileList3.indexOf(file), 1)
        return
      }
      let obj={}
      obj.fileNameDisplay=file.name
      obj.filePath=res.data.filePath
      obj.type=5
      this.filename3.push(obj)
    },
    beforeUpload(file) {
      var FileExt = file.name.replace(/.+\./, "");
      if (
        ["zip", "pdf", "doc", "docx", "excel", "xls", "xlsx"].indexOf(
          FileExt.toLowerCase()
        ) === -1
      ) {
        if (this.$i18n.locale.toUpperCase() == 'EN') {
          this.$message({
            type: 'warning',
            message: 'Please upload zip,pdf,word,excel The attachment！'
          });
        }else {
          this.$message({
            type: 'warning',
            message: '请上传zip,pdf,word,excel的附件！'
          });
        }
        this.fileList.splice(this.fileList.indexOf(file), 1);
        abort();
        return false;
      }
      this.isLt2k = file.size / 1024 / 1024 < 10 ? "1" : "0";
      if (this.isLt2k === "0") {
        if (this.$i18n.locale.toUpperCase() == "ZH") {
          this.$message({
            message: "上传文件大小不能超过10M!",
            type: "error",
          });
        } else {
          this.$message({
            message: "Upload file size cannot exceed 10m!",
            type: "error",
          });
        }
        return false;
      }
    },
    beforeUpload1(file) {
      var FileExt = file.name.replace(/.+\./, "");
      if (['rar', 'zip', 'doc', 'docx', 'pdf', 'jpg', 'png'].indexOf(FileExt.toLowerCase()) === -1) {
        if (this.$i18n.locale.toUpperCase() == 'EN') {
          this.$message({
            type: 'warning',
            message: 'Please upload pictures！'
          });
        }else {
          this.$message({
            type: 'warning',
            message: '请上传图片！'
          });
        }
        this.fileList1.splice(this.fileList1.indexOf(file), 1);
        abort();
        return false;
      }
      this.isLt2k = file.size / 1024 / 1024 < 10 ? "1" : "0";
      if (this.isLt2k === "0") {
        if (this.$i18n.locale.toUpperCase() == "ZH") {
          this.$message({
            message: "上传文件大小不能超过10M!",
            type: "error",
          });
        } else {
          this.$message({
            message: "Upload file size cannot exceed 10m!",
            type: "error",
          });
        }
        return false;
      }
    },
    beforeUpload2(file) {
      var FileExt = file.name.replace(/.+\./, "");
      if (["jpg", "png"].indexOf(FileExt.toLowerCase()) === -1) {
        if (this.$i18n.locale.toUpperCase() == 'EN') {
          this.$message({
            type: "warning",
            message: "Please upload JPG, PNG files!",
          });
        }else {
          this.$message({
            type: "warning",
            message: "请上传jpg,png的文件！",
          });
        }

        this.fileList2.splice(this.fileList2.indexOf(file), 1)
        abort();
        return false;
      }
      this.isLt2k = file.size / 1024 / 1024 < 10 ? '1' : '0';
      if (this.isLt2k === '0') {
        if (this.$i18n.locale.toUpperCase() == 'zh') {
          this.$message({
            message: '上传文件大小不能超过10M!',
            type: 'error'
          });
        } else {
          this.$message({
            message: 'Upload file size cannot exceed 10m!',
            type: 'error'
          });
        }
        this.fileList2.splice(this.fileList2.indexOf(file), 1)
        abort();
        return false;
      }
    },
    beforeUpload3(file) {
      var FileExt = file.name.replace(/.+\./, "");
      if (['pdf'].indexOf(FileExt.toLowerCase()) === -1) {
        if (this.$i18n.locale.toUpperCase() == 'EN') {
          this.$message({
            type: 'warning',
            message: 'Please Upload PDF File！！'
          });
        }else {
          this.$message({
            type: 'warning',
            message: '请上传pdf的文件！！'
          });
        }

        this.fileList3.splice(this.fileList3.indexOf(file), 1)
        abort();
        return false;
      }
      this.isLt2k = file.size / 1024 / 1024 < 10 ? '1' : '0';
      if (this.isLt2k === '0') {
        if (this.$i18n.locale.toUpperCase() == 'zh') {
          this.$message({
            message: '上传文件大小不能超过10M!',
            type: 'error'
          });
        } else {
          this.$message({
            message: 'Upload file size cannot exceed 10m!',
            type: 'error'
          });
        }
        this.fileList3.splice(this.fileList3.indexOf(file), 1)
        abort();
        return false;
      }
    },
    handlePreview(file, fileList) {
      console.log(file, fileList);
      let param = {
        fileName: file.name,
        filePath: file.url,
      };
      uploadfile(param).then((res) => {
        const content = res;
        if (content) {
          const blob = new Blob([content]); //构造一个blob对象来处理数据
          const fileName = decodeURIComponent(res.fileName);
          //对于<a>标签，只有 Firefox 和 Chrome（内核） 支持 download 属性
          //IE10以上支持blob但是依然不支持download
          if ("download" in document.createElement("a")) {
            //支持a标签download的浏览器
            const link = document.createElement("a"); //创建a标签
            link.download = file.name; //a标签添加属性
            link.style.display = "none";
            link.href = URL.createObjectURL(blob);
            document.body.appendChild(link);
            link.click(); //执行下载
            URL.revokeObjectURL(link.href); //释放url
            document.body.removeChild(link); //释放标签
          } else {
            //其他浏览器
            navigator.msSaveBlob(blob, fileName);
          }
        } else {
          this.$message.error("服务器繁忙");
        }
      });
    },
    handlePreview1(file, fileList) {
      console.log(file, fileList);
      let param = {
        fileName: file.name,
        filePath: file.url,
      };
      uploadfile(param).then((res) => {
        const content = res;
        if (content) {
          const blob = new Blob([content]); //构造一个blob对象来处理数据
          const fileName = decodeURIComponent(res.fileName);
          //对于<a>标签，只有 Firefox 和 Chrome（内核） 支持 download 属性
          //IE10以上支持blob但是依然不支持download
          if ("download" in document.createElement("a")) {
            //支持a标签download的浏览器
            const link = document.createElement("a"); //创建a标签
            link.download = file.name; //a标签添加属性
            link.style.display = "none";
            link.href = URL.createObjectURL(blob);
            document.body.appendChild(link);
            link.click(); //执行下载
            URL.revokeObjectURL(link.href); //释放url
            document.body.removeChild(link); //释放标签
          } else {
            //其他浏览器
            navigator.msSaveBlob(blob, fileName);
          }
        } else {
          this.$message.error("服务器繁忙");
        }
      });
    },
    handleRemove(file, fileList) {
      console.log(file, fileList);
      this.filename.forEach((item, index) => {
        if (file.name == item.fileNameDisplay) {
          this.filename.splice(index, 1);
        }
      });
      this.fileList.forEach((item,index)=>{
        if(file.name==item.name){
          this.fileList.splice(index,1)
        }
      });
      console.log(this.filename);
    },
    handleRemove1(file, fileList) {
      console.log(file, fileList);
      this.filename1.forEach((item, index) => {
        if (file.name == item.fileNameDisplay) {
          this.filename1.splice(index, 1);
        }
      });

      this.fileList1.forEach((item,index)=>{
        if(file.name==item.name){
          this.fileList1.splice(index,1)
        }
      });
      console.log(this.filename1);
    },
    handleRemove2(file, fileList) {
      this.filename2.forEach((item,index)=>{
        if(file.name==item.fileNameDisplay){
          this.filename2.splice(index,1)
        }
      });

      this.fileList2.forEach((item,index)=>{
        if(file.name==item.name){
          this.fileList2.splice(index,1)
        }
      });
    },
    handleRemove3(file, fileList) {
      this.filename3.forEach((item,index)=>{
        if(file.name==item.fileNameDisplay){
          this.filename3.splice(index,1)
        }
      });

      this.fileList3.forEach((item,index)=>{
        if(file.name==item.name){
          this.fileList3.splice(index,1)
        }
      });
    },
    handleExceed(files, fileList) {
      if (this.$i18n.locale.toUpperCase() == 'EN') {
        this.$message.warning(`Limit the selection to 3 file，This time I have chosen ${files.length} file，A total chose ${files.length + fileList.length} file`);
      }else {
        this.$message.warning(`限制选择 3 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`);
      }
    },
    handleExceed1(files, fileList) {
      if (this.$i18n.locale.toUpperCase() == 'EN') {
        this.$message.warning(`Limit the selection to 3 file，This time I have chosen ${files.length} file，A total chose ${files.length + fileList.length} file`);
      }else {
        this.$message.warning(`限制选择 3 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`);
      }
    },
    handleExceed2(files, fileList) {
      if (this.$i18n.locale.toUpperCase() == 'EN') {
        this.$message.warning(`Limit the selection to 1 file，This time I have chosen ${files.length} file，A total chose ${files.length + fileList.length} file`);
      }else {
        this.$message.warning(`限制选择 1 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`);
      }
    },
    handleExceed3(files, fileList) {
      if (this.$i18n.locale.toUpperCase() == 'EN') {
        this.$message.warning(`Limit the selection to 1 file，This time I have chosen ${files.length} file，A total chose ${files.length + fileList.length} file`);
      }else {
        this.$message.warning(`限制选择 1 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`);
      }
    },
    beforeRemove(file, fileList) {
      if (this.$i18n.locale.toUpperCase() == "ZH") {
        return this.$confirm(`确定移除 ${file.name}？`);
      }else{
        return this.$confirm(`Are you sure you want to remove ${file.name}？`);
      }

    },
    beforeRemove1(file, fileList) {
      if (this.$i18n.locale.toUpperCase() == "ZH") {
        return this.$confirm(`确定移除 ${file.name}？`);
      }else{
        return this.$confirm(`Are you sure you want to remove ${file.name}？`);
      }
    },
    beforeRemove2(file, fileList) {
      if (this.$i18n.locale.toUpperCase() == "ZH") {
        return this.$confirm(`确定移除 ${file.name}？`);
      }else{
        return this.$confirm(`Are you sure you want to remove ${file.name}？`);
      }
    },
    beforeRemove3(file, fileList) {
      if (this.$i18n.locale.toUpperCase() == "ZH") {
        return this.$confirm(`确定移除 ${file.name}？`);
      }else{
        return this.$confirm(`Are you sure you want to remove ${file.name}？`);
      }
    },
    getNowFormatDate() {
      let now = new Date();
      let year = now.getFullYear(); //获取完整的年份(4位,1970-????)
      let month = now.getMonth() + 1; //获取当前月份(0-11,0代表1月)
      let today = now.getDate(); //获取当前日(1-31)
      let hour = now.getHours(); //获取当前小时数(0-23)
      let minute = now.getMinutes(); //获取当前分钟数(0-59)
      let second = now.getSeconds(); //获取当前秒数(0-59)
      let nowTime = "";
      nowTime =
        year +
        "-" +
        this.fillZero(month) +
        "-" +
        this.fillZero(today) +
        " " +
        this.fillZero(hour) +
        ":" +
        this.fillZero(minute) +
        ":" +
        this.fillZero(second);
      return nowTime;
    },
    getNowFormatDate1(value) {
      let now = new Date(value);
      let year = now.getFullYear(); //获取完整的年份(4位,1970-????)
      let month = now.getMonth() + 1; //获取当前月份(0-11,0代表1月)
      let today = now.getDate(); //获取当前日(1-31)
      let hour = now.getHours(); //获取当前小时数(0-23)
      let minute = now.getMinutes(); //获取当前分钟数(0-59)
      let second = now.getSeconds(); //获取当前秒数(0-59)
      let nowTime = "";
      nowTime = year + "-" + this.fillZero(month) + "-" + this.fillZero(today);
      return nowTime;
    },
    fillZero(str) {
      var realNum;
      if (str < 10) {
        realNum = "0" + str;
      } else {
        realNum = str;
      }
      return realNum;
    },
  },
};
</script>
<style scoped>
::v-deep .el-upload-list__item-name {
  color: #4790f7;
  text-decoration: underline;
}
/deep/ .el-upload-list__item.is-success.focusing .el-icon-close-tip {
    display: none !important;
}

/deep/ .el-upload-list__item {
  width: 299px;
}
.content_title {
  padding-left: 316px;
  width: 1087px;
  height: 26px;
  font-family: "PingFang SC";
  font-style: normal;
  font-weight: 500;
  font-size: 20px;
  line-height: 22px;
  /* or 110% */
  display: flex;
  align-items: center;
  text-align: center;
  text-indent: 30px;
  font-feature-settings: "tnum" on, "lnum" on;
  color: rgba(0, 0, 0, 0.85);
}
.content_content {
  //margin-top:16px;
  width: 1018px;
  height: auto;

  font-family: "PingFang SC";
  font-style: normal;
  font-weight: 400;
  font-size: 14px;
  line-height: 25px;
  /* or 179% */

  display: flex;
  align-items: center;
  text-indent: 30px;
  font-feature-settings: "tnum" on, "lnum" on;
  color: rgba(0, 0, 0, 0.65);
}
.neirong {
  margin-top: 64px;
  height: 26px;
  margin-left: -50px;
  font-family: "PingFang SC";
  font-style: normal;
  font-weight: 400;
  font-size: 16px;
  line-height: 0px;
  /* or 0% */
  display: flex;
  align-items: center;
  text-indent: 30px;
  font-feature-settings: "tnum" on, "lnum" on;
  color: rgba(0, 0, 0, 0.95);
}
.submit {
  box-sizing: border-box;
  width: 120px;
  height: 40px;
  margin-left: 339px;

  width: 120px;
  height: 40px;
  padding-left: 32px;

  background: #e6973a;
  border: 1px solid #e6973a;
  border-radius: 4px;
  font-family: "Noto Sans SC";
  font-style: normal;
  font-weight: 500;
  font-size: 14px;
  line-height: 22px;
  /* identical to box height, or 157% */

  display: flex;
  align-items: center;
  text-align: center;
  font-feature-settings: "tnum" on, "lnum" on;

  /* Neutral Color/White */

  color: #ffffff;
  cursor: pointer;
  /* Neutral Color/White */

  color: #ffffff;
}
.cancel {
  box-sizing: border-box;
  width: 120px;
  height: 40px;
  margin-left: 30px;
  padding-left: 44px;
  background: white;
  border: 1px solid #e9ebef;
  border-radius: 4px;
  cursor: pointer;

  font-family: "Noto Sans SC";
  font-style: normal;
  font-weight: 500;
  font-size: 14px;
  line-height: 22px;
  /* identical to box height, or 157% */

  display: flex;
  align-items: center;
  text-align: center;
  font-feature-settings: "tnum" on, "lnum" on;

  color: rgba(17, 17, 17, 0.65);
}
/deep/ .applytype .el-select {
  width: 415px !important;
}
/* 利用穿透，设置input边框隐藏 */
.inputDeep >>> .el-input__inner {
  border: 0;
}
/* 如果你的 el-input type 设置成textarea ，就要用这个了 */
.inputDeep >>> .el-textarea__inner {
  border: 0;
  resize: none; /* 这个是去掉 textarea 下面拉伸的那个标志，如下图 */
}
.english {
  box-sizing: border-box;
  position: absolute;
  width: 80px;
  height: 40px;
  left: 69px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 2px;
  font-family: "Noto Sans SC";
  font-style: normal;
  font-weight: 400;
  font-size: 14px;
  line-height: 22px;
  /* identical to box height, or 157% */
  display: flex;
  align-items: center;
  font-feature-settings: "tnum" on, "lnum" on;
  color: rgba(0, 0, 0, 0.85);
  padding-left: 13px;
}
.box1 {
  padding: 0 0 20px 0;
  position: absolute;
}
.center {
  display: flex;
}
.topImg img {
  display: inline-block;
  width: 1200px;
  height: 324px;
}
.centerLeft1 {
  border-radius: 0px;

  width: 1198px;
  height: 877px;
  left: 360px;
  top: 317px;

  background: #ffffff;
}
.left {
  position: relative;
}

.top .top1 {
  position: absolute;
  width: 5.5px;
  height: 10.5px;
  left: 20px;
  top: 35px;
  background: #376ac7;
  z-index: 1;
}
.top .top2 {
  position: absolute;
  width: 5.5px;
  height: 15px;
  left: 20px;
  top: 35px;
  background: #83bd50;
}
.top .allApplication {
  position: absolute;
  height: 22px;
  left: 34px;
  top: 31px;
}
.top .allApplication span {
  font-family: "PingFang SC";
  font-style: normal;
  font-weight: 600;
  font-size: 16px;
  line-height: 22px;
  color: #375586;
}
.top .notice {
  position: absolute;
  height: 22px;
  left: 160px;
  top: 32px;
}
.top .notice span {
  font-family: "PingFang SC";
  font-style: normal;
  font-weight: 600;
  font-size: 16px;
  line-height: 22px;
  color: rgba(10, 10, 10, 0.85);
}
.top .more {
  position: absolute;
  height: 16px;
  right: 21px;
  top: 31px;
}
.top .more span {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 500;
  font-size: 14px;
  line-height: 16px;
  color: #4790f7;
}
.content .content1 {
  box-sizing: border-box;
  position: absolute;
  width: 100%;
  height: 70px;
  left: 0px;
  top: 78px;
}
.content .content2 {
  box-sizing: border-box;
  position: absolute;
  width: 100%;
  height: 976px;
  left: 0px;
  top: 50px;
  background: #ffffff;
  padding-left: 125px;
}
.content .title {
  font-family: "PingFang SC";
  font-style: normal;
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  color: rgba(0, 0, 0, 0.85);
  position: absolute;
  left: 16px;
  top: 16px;
  right: 14px;
  bottom: 113px;
}
.content .time {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  line-height: 14px;
  color: rgba(0, 0, 0, 0.65);
  position: absolute;
  left: 16px;
  top: 61px;
}
.content .type {
  font-family: "PingFang SC";
  font-style: normal;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: rgba(0, 0, 0, 0.85);
  position: absolute;
  left: 16px;
  top: 89px;
}
.content .toView {
  margin-left: 100px;
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-size: 14px;
  line-height: 16px;
  color: #274e92;
}
.content .toProgress {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-size: 14px;
  line-height: 16px;
  color: #274e92;
}
.centerLeft2 {
  position: relative;
  margin-top: 20px;
  height: 177px;
  width: 850px;
  border-radius: 0px;
  background: #fff;
}
.content .audit {
  position: absolute;
  right: 5%;
}
.area {
  position: absolute;
  top: 100px;
}
.pag {
  position: absolute;
  bottom: 0;
  right: 0;
}
.tableTr {
  height: 40px;
  width: 98%;
  display: flex;
  align-items: center;
  color: #a0a4aa;
}
.tableTd20 {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 9px 20px;
  gap: 4px;
  width: 13%;
  height: 40px;
  background: #f5f7fa;
  border: 1px solid #dcdfe6;
  border-radius: 0px;

  font-family: "PingFang SC";
  font-style: normal;
  font-weight: 600;
  font-size: 14px;
  line-height: 22px;
  /* identical to box height, or 157% */

  display: flex;
  align-items: center;
  text-align: center;
  font-feature-settings: "tnum" on, "lnum" on;
  color: rgba(0, 0, 0, 0.85);
}
.tableTd30 {
  background: #ffffff;
  border: 1px solid #dcdfe6;
  mix-blend-mode: normal;
  width: 37%;
  text-align: left;
  height: 40px;

  font-family: "Noto Sans SC";
  font-style: normal;
  font-weight: 400;
  font-size: 14px;
  line-height: 22px;
  display: flex;
  align-items: center;
  font-feature-settings: "tnum" on, "lnum" on;
  color: rgba(0, 0, 0, 0.45);
}
.tableTd120 {
  border: 1px solid #dcdfe6;
  width: 87%;
  text-align: left;
  height: 40px;
  font-size: 15px;
}
.tableTd50 {
  width: 50%;
  height: 40px;
  text-align: center;
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-around;
}
</style>