<template>
  <div class="app-container contentBox">
    <el-row>
      <el-col>
        <div class="grid-content bg-purple">
          <el-form
            ref="formInline"
            :model="formInline"
            :rules="rules"
            :inline="true"
            class="width-80"
            :disabled="$route.query.state == 'show'"
          >
            <el-row class="title-box clearable h3Parent width-c54">
              <el-col :span="24">
                <h3 class="titleUseStyle">基本信息</h3>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <div class="grid-content bg-purple">
                  <el-form-item label="项目名称">
                    <el-input
                      v-model="formInline.projectName"
                      type="textarea"
                      :rows="1"
                      resize="none"
                      placeholder="请输入内容"
                      :disabled="true"
                    ></el-input>
                  </el-form-item>
                </div>
              </el-col>
            </el-row>
            <el-row :gutter="2">
              <el-col :span="12">
                <div class="grid-content bg-purple">
                  <el-form-item label="本级部门及代码">
                    <el-input
                      :disabled="true"
                      v-model="formInline.departmentsCodes"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </div>
              </el-col>
              <el-col :span="12">
                <div class="grid-content bg-purple">
                  <el-form-item label="实施单位">
                    <el-input
                      :disabled="true"
                      v-model="formInline.implementationUnit"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </div>
              </el-col>
            </el-row>
            <el-row :gutter="2">
              <el-col :span="12">
                <div class="grid-content bg-purple">
                  <el-form-item label="项目属性">
                    <el-input
                      :disabled="true"
                      v-model="formInline.projectAttributes"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </div>
              </el-col>
              <el-col :span="12">
                <div class="grid-content bg-purple">
                  <el-form-item label="项目期">
                    <el-input
                      :disabled="true"
                      v-model="projectPeriod"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </div>
              </el-col>
            </el-row>
            <!-- <el-row>
              <div class="font-color">项目资金(万元)</div>
            </el-row>-->
            <el-row class="title-box clearable h3Parent width-c54">
              <el-col :span="24">
                <h3 class="titleUseStyle">项目资金(万元)</h3>
              </el-col>
            </el-row>
            <el-row :gutter="2">
              <el-col :span="12">
                <div class="grid-content bg-purple">
                  <el-form-item label="年度资金总额">
                    <el-input
                      :disabled="true"
                      v-model="formInline.totalAnnualFunds"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </div>
              </el-col>
              <el-col :span="12">
                <div class="grid-content bg-purple">
                  <el-form-item label="其中：财政拨款">
                    <el-input
                      :disabled="true"
                      v-model="formInline.financialAllocation"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </div>
              </el-col>
            </el-row>
            <el-row :gutter="2">
              <el-col :span="12">
                <div class="grid-content bg-purple">
                  <el-form-item label="其他资金">
                    <el-input :disabled="true" v-model="formInline.otherFunds" autocomplete="off"></el-input>
                  </el-form-item>
                </div>
              </el-col>
            </el-row>
            <el-row :gutter="2">
              <el-col :span="12">
                <div class="grid-content bg-purple">
                  <el-form-item label="中期（三年）资金总额">
                    <el-input
                      :disabled="true"
                      v-model="formInline.totalMediumTermFunds"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </div>
              </el-col>
              <el-col :span="12">
                <div class="grid-content bg-purple">
                  <el-form-item label="其中：财政拨款">
                    <el-input
                      :disabled="true"
                      v-model="formInline.mediumTermFinancialAllocati"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </div>
              </el-col>
            </el-row>
            <el-row :gutter="2">
              <el-col :span="12">
                <div class="grid-content bg-purple">
                  <el-form-item label="其他资金">
                    <el-input
                      :disabled="true"
                      v-model="formInline.mediumTermOtherFunds"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <div class="grid-content bg-purple">
                  <el-form-item label="项目内容">
                    <el-input
                      v-model="formInline.projectContent"
                      type="textarea"
                      :rows="2"
                      resize="none"
                      placeholder="请输入内容"
                      :disabled="true"
                    ></el-input>
                  </el-form-item>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <div class="grid-content bg-purple">
                  <el-form-item label="申请依据">
                    <el-input
                      v-model="formInline.basisApplication"
                      type="textarea"
                      :rows="2"
                      resize="none"
                      placeholder="请输入内容"
                      :disabled="true"
                    ></el-input>
                  </el-form-item>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <div class="grid-content bg-purple">
                  <el-form-item label="测算过程">
                    <el-input
                      v-model="formInline.calculatingProcess"
                      type="textarea"
                      :rows="2"
                      resize="none"
                      placeholder="请输入内容"
                      :disabled="true"
                    ></el-input>
                  </el-form-item>
                </div>
              </el-col>
            </el-row>
           <!------------------------------------------------->
            <el-row>
              <el-col :span="24">
                <div class="table-from">
                <span style="margin-right:10px;">总体目标</span>
                <table border="0" cellpadding="0" rules="all" width="100%" style="margin-top:10px;">
                  <tr v-for="(item, i) in targetContentArr" :key="i">
                    <td style="width: 270px;height:60px">目标{{i+1}}</td>
                    <td style="height: 40px;position:relative">
                      <span style="font-size:16px">{{item.targetContent}}</span>
                    </td>
                  </tr>
                </table>
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col>
                <div class="table-from">
                  <span style="margin-right:10px;">产出指标</span>
                  <table border="0" cellpadding="0" rules="all" width="100%" style="margin-top:10px;">
                    <tr>
                      <td style="width: 270px;height:60px">二级指标(产出指标)</td>
                      <td>指标内容</td>
                      <td>年度指标值</td>
                      <td>中期指标值</td>
                      <td style="width: 220px;height:60px">三级指标(产出指标)</td>
                      <td style="width: 80px;height:60px">绩效指示性质</td>
                      <td style="width: 70px;height:60px">绩效指示值</td>
                      <td style="width: 80px;height:60px">绩效度量单位</td>
                    </tr>
                    <tr v-for="(item, i) in outputIndexArr" :key="i">
                      <td style="height: 40px;position:relative">
                        <span style="font-size:16px">{{item.twoClassIndex}}</span>
                      </td>
                      <td>{{item.indexContent}}</td>
                      <td>{{item.annualIndexValue}}</td>
                      <td>{{item.mediumTermIndexValue}}</td>
                      <td style="height: 40px;position:relative">{{item.threeClassIndex}}</td>
                      <td>{{item.indexProperties}}</td>
                      <td>{{item.indexValue}}</td>
                      <td>{{item.unitMeasure}}</td>
                    </tr>
                  </table>

                  <span style="margin-right:10px;">效益指标</span>
                  <table border="0" cellpadding="0" rules="all" width="100%" style="margin-top:10px;">
                    <tr>
                      <td style="width: 270px;height:60px">二级指标(效益指标)</td>
                      <td>指标内容</td>
                      <td>年度指标值</td>
                      <td>中期指标值</td>
                      <td style="width: 220px;height:60px">三级指标(效益指标)</td>
                      <td style="width: 80px;height:60px">绩效指标性质</td>
                      <td style="width: 70px;height:60px">绩效指标值</td>
                      <td style="width: 80px;height:60px">绩效度量单位</td>
                    </tr>
                    <tr v-for="(item, i) in benefitIndexArr" :key="i">
                      <td style="height: 40px;position:relative">
                        <span style="font-size:16px">{{item.twoClassIndex}}</span>
                      </td>
                      <td>{{item.indexContent}}</td>
                      <td>{{item.annualIndexValue}}</td>
                      <td>{{item.mediumTermIndexValue}}</td>
                      <td style="height: 40px;position:relative">{{item.threeClassIndex}}</td>
                      <td>{{item.indexProperties}}</td>
                      <td>{{item.indexValue}}</td>
                      <td>{{item.unitMeasure}}</td>
                    </tr>
                  </table>

                  <span style="margin-right:10px;">满意度指标</span>
                  <table border="0" cellpadding="0" rules="all" width="100%" style="margin-top:10px;">
                    <tr>
                      <td style="width: 270px;height:60px">二级指标(满意度指标)</td>
                      <td>指标内容</td>
                      <td>年度指标值</td>
                      <td>中期指标值</td>
                      <td style="width: 220px;height:60px">三级指标(满意度指标)</td>
                      <td style="width: 80px;height:60px">绩效指标性质</td>
                      <td style="width: 70px;height:60px">绩效指标值</td>
                      <td style="width: 80px;height:60px">绩效度量单位</td>
                    </tr>
                    <tr v-for="(item, i) in satisfactionIndexArr" :key="i">
                      <td style="height: 40px;position:relative">
                        <span style="font-size:16px">{{item.twoClassIndex}}</span>
                      </td>
                      <td>{{item.indexContent}}</td>
                      <td>{{item.annualIndexValue}}</td>
                      <td>{{item.mediumTermIndexValue}}</td>
                      <td style="height: 40px;position:relative">{{item.threeClassIndex}}</td>
                      <td>{{item.indexProperties}}</td>
                      <td>{{item.indexValue}}</td>
                      <td>{{item.unitMeasure}}</td>
                    </tr>
                  </table>
                </div>
              </el-col>
            </el-row>
            <!------------------------------------------------->
            <el-row :gutter="2">
              <el-col :span="12">
                <div class="grid-content bg-purple">
                  <el-form-item label="申请处室">
                    <el-input
                      :disabled="true"
                      v-model="formInline.applicationOffice"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
                </div>
              </el-col>
              <el-col :span="12">
                <div class="grid-content bg-purple">
                  <el-form-item label="申请日期">
                    <el-date-picker
                      v-model="formInline.applicationDate"
                      placeholder="选择日期"
                      type="date"
                      value-format="yyyy-MM-dd"
                      style="width:100%"
                      :disabled="true"
                    ></el-date-picker>
                  </el-form-item>
                </div>
              </el-col>
            </el-row>
            <el-row v-if="fileName1">
              <div class="budgetSubmission-upload">
                <el-col :span="24">
                  <el-form-item label="附件" label-width="100px">
                    <a :href="newUrl1" download>
                      <label class="uploadBtn">
                        <span>下载</span>
                      </label>
                    </a>
                    <div class="fileBox">
                      <a :href="newUrl1" download>
                        <i class="el-icon-document">{{fileName1}}</i>
                      </a>
                    </div>
                  </el-form-item>
                </el-col>
              </div>
            </el-row>
            <div v-if="this.$route.query.state == 'show' && formInline.processHis">
              <el-row
                      class="title-box clearable h3Parent width-c54"
                      v-if="$route.query.state"
                      v-show="formInline.findingsAudit=='审核通过' || formInline.findingsAudit=='驳回' || $route.query.state == 'update'"
              >
                <el-col :span="24">
                  <h3 class="titleUseStyle">审核内容</h3>
                </el-col>
              </el-row>
              <el-row :gutter="2"  style="margin-bottom: 20px;">
                <el-col  :span="23" v-if="formInline.processHis">
                  <el-table
                          :data="formInline.processHis"
                          stripe
                          border highlight-current-row
                          style="width: 100%">
                    <el-table-column align="center" label="序号" width="70">
                      <template slot-scope="scope"><span>{{scope.$index+1}}</span></template>
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="assigneeName"
                            width="150"
                            label="审核人">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            :show-overflow-tooltip="true"
                            prop="comment"
                            label="审核意见">
                    </el-table-column>
                    <el-table-column
                            align="center"
                            prop="endDate"
                            width="180"
                            label="审核日期">
                    </el-table-column>
                  </el-table>
                </el-col>
              </el-row>
            </div>
            <div v-else>
              <el-row
                      class="title-box clearable h3Parent width-c54"
                      v-if="$route.query.state"
                      v-show="formInline.findingsAudit=='审核通过' || formInline.findingsAudit=='驳回' || $route.query.state == 'update'"
              >
                <el-col :span="24">
                  <h3 class="titleUseStyle">审核内容</h3>
                </el-col>
              </el-row>
              <el-row
                      v-if="$route.query.state"
                      v-show="formInline.findingsAudit=='审核通过' || formInline.findingsAudit=='驳回' || $route.query.state == 'update'"
              >
                <el-col :span="24">
                  <div class="grid-content bg-purple">
                    <el-form-item label="审核意见">
                      <el-input
                              v-model="formInline.auditOpinions"
                              type="textarea"
                              :rows="4"
                              resize="none"
                              placeholder="请输入内容"
                      ></el-input>
                    </el-form-item>
                  </div>
                </el-col>
              </el-row>
              <el-row
                      :gutter="2"
                      v-show="formInline.findingsAudit=='审核通过' || formInline.findingsAudit=='驳回' || $route.query.state == 'update'"
              >
                <el-col :span="12">
                  <div class="grid-content bg-purple">
                    <el-form-item
                            prop="findingsAuditValue"
                            label="审核结果"
                            v-if="$route.query.state=='update'"
                    >
                      <el-radio-group
                              v-model="findingsAuditValue"
                              @change="findingsAuditChange(findingsAuditValue)"
                      >
                        <el-radio
                                v-for="(item,index) in findingsAuditObj"
                                :key="index"
                                :label="item.value"
                                :value="item.code"
                        ></el-radio>
                      </el-radio-group>
                    </el-form-item>
                    <el-form-item label="审核结果" v-if="$route.query.state=='show'">
                      <el-radio-group v-model="formInline.findingsAudit" :disabled="true">
                        <el-radio label="审核通过"></el-radio>
                        <el-radio label="驳回"></el-radio>
                      </el-radio-group>
                    </el-form-item>
                  </div>
                </el-col>
                <el-col :span="12">
                  <div class="grid-content bg-purple">
                    <el-form-item label="审核人">
                      <el-input :disabled="true" v-model="formInline.auditor" autocomplete="off"></el-input>
                    </el-form-item>
                  </div>
                </el-col>
              </el-row>
              <el-row
                      :gutter="2"
                      v-show="formInline.findingsAudit=='审核通过' || formInline.findingsAudit=='驳回' || $route.query.state == 'update'"
              >
                <el-col :span="12">
                  <div class="grid-content bg-purple">
                    <el-form-item label="审核日期">
                      <!-- <el-input v-model="formInline.auditDate" autocomplete="off"></el-input> -->
                      <el-date-picker
                              :disabled="true"
                              v-model="formInline.auditDate"
                              placeholder="选择日期"
                              type="date"
                              value-format="yyyy-MM-dd"
                              style="width:100%"
                      ></el-date-picker>
                    </el-form-item>
                  </div>
                </el-col>
              </el-row>
            </div>

          </el-form>
          <el-row class="saveCancel">
            <el-col :span="24">
              <div class="grid-content bg-purple">
                <el-button
                  type="primary"
                  class="iconfont icontijiao"
                  style="margin-left: 8px;"
                  v-show="$route.query.state !== 'show'"
                  @click="submissionInfo('formInline')"
                > 提交</el-button>
                <el-button
                  class="iconfont iconquxiao"
                  type="primary"
                  style="margin-left: 8px;"
                  v-show="$route.query.state !== 'show'"
                  @click="cancel"
                > 取消</el-button>
                <el-button
                        class="iconfont iconfanhui"
                        type="primary"
                        style="margin-left: 8px;"
                        v-show="$route.query.state == 'show'"
                        @click="cancel"
                > 返回</el-button>
              </div>
            </el-col>
          </el-row>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import {
  budgetSubmissionModify,
  approveSubmissionModify
} from "@/api/budgetSubmission/index";
import { fileApi, fileDownload } from "@/api/index";

export default {
  data() {
    var validatePass = (rule, value, callback) => {
      if (this.findingsAuditValue == "") {
        callback(new Error("请选择审核结果"));
      } else {
        callback();
      }
    };
    return {
      //总体目标
      targetContentArr: [],

      // 产出指标二级指标数据
      outputIndexArr:[],

      // 效益指标二级指标数据
      benefitIndexArr:[],

      // 满意度指标二级指标数据
      satisfactionIndexArr:[],
      propertiesList:[
        {
          label:"定量",
          value:'定量'
        },
        {
          label:"定性",
          value:'定性'
        }
      ],

      findingsAuditValue: "",
      //状态
      findingsAuditObj: [
        {
          value: "通过",
          code: "30"
        },
        {
          value: "驳回",
          code: "40"
        }
      ],
      rules: {
        findingsAuditValue: [{ validator: validatePass, trigger: "change" }],
        auditOpinions: [
          { required: true, message: "请填写审核意见", trigger: "blur" },
          { min: 1, max: 200, message: '长度在 1 到 200 个字符', trigger: 'blur' }
        ]
      },
      projectPeriod:'',

      formInline: {
        // projectName: "", //项目名称-
        // departmentsCodes: "", //本级部门及代码-
        // implementationUnit: "", //实施单位-
        // projectAttributes: "", //项目属性-
        // projectPeriod: "", //项目期-
        // totalAnnualFunds: "", //年度资金总额-
        // financialAllocation: "", //年度 财政拨款-
        // otherFunds: "", //年度 其他资金-
        // totalMediumTermFunds: "", //中期资金总额-
        // mediumTermFinancialAllocati: "", //中期 财政拨款-
        // mediumTermOtherFunds: "", //中期 其他资金-
        // projectContent: "", //项目内容-
        // basisApplication: "", //申请依据-
        // calculatingProcess: "", //测算过程-
        // annualTarget: "", //年度目标-
        // mediumTermObjectives: "", //中期目标-
        // applicationOffice: "", //申请处室-
        // applicationDate: "", //申请日期-
        // auditOpinions: "", //审核意见-
        // findingsAudit: "", //审核结果-
        // auditor: "", //审核人-
        // auditDate: "", //审核日期-
        // quantityIndicatorContent: "", //数量指标-指标内容
        // quantityAnnualIndicator: "", //数量指标-年度指标值
        // quantityMediumTerm: "", //数量指标-中期指标值
        // qualityIndicatorContent: "", //质量指标-指标内容
        // qualityAnnualIndicator: "", //质量指标-年度指标值
        // qualityMediumTerm: "", //质量指标-中期指标值
        // prescriptionIndicatorContent: "", //时效指标-指标内容
        // prescriptionAnnualIndicator: "", //时效指标-年度指标值
        // prescriptionMediumTerm: "", //时效指标-中期指标值
        // costIndicatorContent: "", //成本指标-指标内容
        // costAnnualIndicator: "", //成本指标-年度指标值
        // costMediumTerm: "", //成本指标-中期指标值
        // economicsIndicatorContent: "", //经济效益指标-指标内容
        // economicsAnnualIndicator: "", //经济效益指标-年度指标值
        // economicsMediumTerm: "", //经济效益指标-中期指标值
        // sociologyIndicatorContent: "", //社会效益指标-指标内容
        // sociologyAnnualIndicator: "", //社会效益指标-年度指标值
        // sociologyMediumTerm: "", //社会效益指标-中期指标值
        // environmentalIndicatorConten: "", //环境效益指标-指标内容
        // environmentalAnnualIndicator: "", //环境效益指标-年度指标值
        // environmentalMediumTerm: "", //环境效益指标-中期指标值
        // sustainabiliIndicatorContent: "", //可持续性指标-指标内容
        // sustainabilitAnnualIndicator: "", //可持续性指标-年度指标值
        // sustainabilityMediumTerm: "", //可持续性指标-中期指标值
        // serviceIndicatorContent: "", //服务对象满意度指标-指标内容
        // serviceAnnualIndicator: "", //服务对象满意度指标-年度指标
        // serviceMediumTerm: "" //服务对象满意度指标-中期指标值
      },
      newUrl1: "",
      fileName1: ""
    };
  },
  methods: {
    findingsAuditChange(val) {
      if (val == "通过") {
        if(this.formInline.departmentsCodes !== '内蒙古自治区粮食和物资储备局601001'){
          if(this.formInline.findingsAudit == "待二级单位财务审核"){
            this.formInline.findingsAudit = "待单位负责人审核"
            this.formInline.status = 2;
          }else
          if(this.formInline.findingsAudit == "待单位负责人审核"){
            this.formInline.findingsAudit = "待规划财务处工作人员审核"
            this.formInline.status = 3;
          }else
          if(this.formInline.findingsAudit == "待规划财务处工作人员审核"){
            this.formInline.findingsAudit = "待规划财务处处长审核"
            this.formInline.status = 4;
          }else
          if(this.formInline.findingsAudit == "待规划财务处处长审核"){
            this.formInline.findingsAudit = "通过"
            this.formInline.status = 5;
          }
        }else{
          if(this.formInline.findingsAudit == "处室处长审核"){
            this.formInline.findingsAudit = "办公室财务人员审核"
            this.formInline.status = 2;
          }else
          if(this.formInline.findingsAudit == "办公室财务人员审核"){
            this.formInline.findingsAudit = "办公室财务处长审核"
            this.formInline.status = 3;
          }else
          if(this.formInline.findingsAudit == "办公室财务处长审核"){
            this.formInline.findingsAudit = "规划财务处人员审核"
            this.formInline.status = 4;
          }else
          if(this.formInline.findingsAudit == "规划财务处人员审核"){
            this.formInline.findingsAudit = "规划财务处处长审核"
            this.formInline.status = 5;
          }else
          if(this.formInline.findingsAudit == "规划财务处处长审核"){
            this.formInline.findingsAudit = "审核通过"
            this.formInline.status = 6;
          }
        }
        // this.formInline.findingsAudit = "30";
        // this.formInline.findingsAudit = "办公室财务处长审核"
      } else if (val == "驳回") {
        this.formInline.findingsAudit = "驳回";
        this.formInline.status = 0;
      } else if(val == "驳回到上级"){
        if(this.formInline.findingsAudit == "待单位负责人审核"){
          this.formInline.findingsAudit = "待二级单位财务审核"
          this.formInline.status = 1;
        }else
        if(this.formInline.findingsAudit == "待规划财务处工作人员审核"){
          this.formInline.findingsAudit = "待单位负责人审核"
          this.formInline.status = 2;
        }else
        if(this.formInline.findingsAudit == "待规划财务处处长审核"){
          this.formInline.findingsAudit = "待规划财务处工作人员审核"
          this.formInline.status = 3;
        }
      }
    },
    cancel() {
      this.$router.push({ path: "examine" });
    },
    info(id) {
      budgetSubmissionModify(id).then(response => {
        if (response.infoCode === 200) {
          this.formInline = response.data;
          if(response.data.departmentsCodes !== '内蒙古自治区粮食和物资储备局601001' && this.formInline.findingsAudit !== "待二级单位财务审核"){
            this.findingsAuditObj = [
              {
                value: "通过",
                code: "30"
              },
              {
                value: "驳回",
                code: "40"
              },
              {
                value: "驳回到上级",
                code: "50"
              }
            ];
          }
          this.fileName1 = this.formInline.attachName;
          this.outputIndexArr = this.formInline.outputIndex;
          this.benefitIndexArr = this.formInline.benefitIndex;
          this.satisfactionIndexArr = this.formInline.satisfactionIndex;

          //总体目标
          this.targetContentArr = this.formInline.overallObjective;


          // this.newUrl1 =
          //   fileApi +
          //   "/" +
          //   "file" +
          //   "/" +
          //   "download" +
          //   "?id=" +
          //   this.formInline.attachId;
          this.newUrl1 =
            fileDownload +
            "?id=" +
            this.formInline.attachId;
          if (this.$route.query.state == "update") {
            var date = new Date();
            this.formInline.auditDate = date;

            let tokenMsg = window.sessionStorage.getItem('TOKENL')
            let msg1 = tokenMsg.split('.')[1]
            let base64 = require('js-base64').Base64;
            let userInfo = JSON.parse(base64.decode(msg1));
            this.formInline.auditor = userInfo.userName;
            // this.formInline.auditor = sessionStorage.getItem("userName");
          }
          if(this.$route.query.state == "show"){
            this.formInline.processHis.reverse();
          }
          if(this.formInline.projectPeriod && this.formInline.projectPeriod.length == 1){
            this.projectPeriod = this.formInline.projectPeriod[0].substring(0,10)+' 至 '+this.formInline.projectPeriod[0].substring(24,34)
            // this.formInline.projectPeriod = [this.formInline.projectPeriod[0].substring(0,24),this.formInline.projectPeriod[0].substring(24,48)]
          }else if(this.formInline.projectPeriod.length == 2){
            this.projectPeriod = this.formInline.projectPeriod[0].substring(0,10)+' 至 '+this.formInline.projectPeriod[1].substring(0,10)
          }
        } else {
          this.$message({
            type: "error",
            message: response.msg
          });
        }
      });
    },
    //提交
    submissionInfo(formName) {
      this.$refs[formName].validate(valid => {
        if (valid) {
          let row = {
            departmentsCodes:this.formInline.departmentsCodes,
            findingsAudit:this.formInline.findingsAudit,
            id:this.formInline.id,
            message :this.formInline.auditOpinions ,
            status :this.formInline.status ,
            auditor :this.formInline.auditor ,
            auditDate :this.formInline.auditDate ,
          }

          approveSubmissionModify(row).then(response => {
            if (response.infoCode === 200) {
              this.$message.success("提交成功")

              // this.$route.query.update();
              this.cancel();
            } else {
              this.$message({
                type: "error",
                message: response.msg
              });
            }
          })
        } else {
          return false;
        }
      });
    }
  },
  created() {
    this.info(this.$route.query.id);
  }
};
</script>
<style>
@import "common.css";
.el-message--error {
  display: none !important;
}
.font-color {
  height: 34px;
  font-size: 18px;
  font-weight: 600;
}
.width-c54 {
  width: calc(100% - 50px);
  margin-bottom: 20px;
}
.table-from table {
  width: calc(100% - 50px);
  border: 1px solid #dcdfe6;
  text-align: center;
  margin-bottom: 10px;
  margin-bottom: 20px;
}
.table-from table .el-textarea__inner {
  border: 0px solid #dcdfe6;
}
.budgetSubmission-upload .uploadBtn {
  margin-left: 20px;
  display: inline-block;
  line-height: normal;
  padding: 10px 10px;
  font-size: 14px;
  color: #ffffff;
  background: #49a2fa;
  border-color: #49a2fa;
  border-radius: 5px;
  cursor: pointer;
}

.budgetSubmission-upload .uploadBtn input[type="file"] {
  display: none;
}
.budgetSubmission-upload .fileBox {
  position: absolute;
  left: 72px;
  top: 0px;
  width: calc(100% - 50px);
  height: 133px;
  font-size: 16px;
  height: 38px;
  line-height: normal;
  background-color: #dcdfe6;
  color: #409eff;
  padding: 5px 10px;
  margin-top: 0px;
}

.budgetSubmission-upload .fileBox > i {
  float: right;
  font-size: 20px;
  margin: 0px 5px;
  color: #000000;
  cursor: pointer;
}

.budgetSubmission-upload .fileBox i:hover {
  color: #409eff;
}
</style>
<style lang="scss">
.h3Parent {
  .el-col {
    position: relative;
  }
}
.title-box {
    //新增等标题外的el-row用样式（如调控管理>涉粮企业管理系统>企业基础信息管理>新增）
    .el-col {
        height: 38px;
    }
}
.titleUseStyle {
    position: absolute;
    top: 0px;
    font-size: 14px;
    width: 100%;
    height: 30px;
    line-height: 30px;
    color: #fff;
    font-weight: 400;
    background: #49a2fa;
    padding: 5px 0 5px 8px ;
    &::before {
        position: relative;
        top: 2px;
        content: '';
        display: inline-block;
        margin-right: 10px;
        width: 2px;
        height: 14px;
        background-color: #fff;
    }
}
</style>