<template>
  <el-container>
    <el-main style="position: relative">
      <el-tabs v-model="activeName" @tab-click="handleClick" class="tabs_wrapper">
        <el-tab-pane v-for="(item,index) in tabList" :label="item.label" :name="item.type" :lazy="true">
          <el-form :inline="true" size="small" label-width="84px" class="demo-form-inline report_filter_select">
            <el-form-item label="选择年度">
              <el-select v-model="addForm.year" @change="changeYear" style="width: 120px;">
                <el-option :label="item.pnm" :value="item.id" :key="index"
                           v-for="(item,index) in yearList"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="选择批次">
              <el-select v-model="addForm.batch" @change="changeBatch" style="width: 120px;">
                <el-option :label="item.pnm" :value="item.id" :key="index" v-for="(item,index) in pcList"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="督查组">
              <el-select v-model="addForm.group" @change="changeGroup" style="width: 120px;">
                <el-option :label="item.pnm" :value="item.id" :key="index"
                           v-for="(item,index) in groupList"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="区/县">
              <el-select v-model="addForm.area" @change="changeArea" clearable style="width: 120px;">
                <el-option :label="item.pnm" :value="item.adCode" :key="index"
                           v-for="(item,index) in areaList"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="项目名称">
              <el-select v-model="addForm.rgstrId" @clear="remove" @change="changeProject" clearable placeholder="请选择"
                         style="width: 120px;">
                <el-option
                  v-for="item in projectList"
                  :key="item.id"
                  :label="item.pnm"
                  :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="专业">
              <el-select v-model="addForm.pblmChType" placeholder="请选择" clearable style="width: 120px;">
                <el-option
                  v-for="item in professionList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-form>
          <component :is="item.value" :currentNodeId="addForm.rgstrId" :objId="objId" :stepId='item.nowId'
                     :year="addForm.year" :batch="addForm.batch"
                     :type="addForm.pblmChType" :groupId="addForm.group" :areaId="addForm.area" :flag="flag"
                     :backStatus="backStatus" :isShowaddrollback="isShowaddrollback" :isEdit="editable"
                     :curprvId='curprvId' :curnextId="curnextId" :isRevision="item.isRevision"  :isShowRc="item.isShowRc" :label="item.label"
                     @sendSubmitStatus="sendSubmitStatus" ref="mychild"></component>
        </el-tab-pane>
      </el-tabs>
      <div class="report_btn_group">
        <!-- <el-button type="success">生成阶段稿</el-button> -->
        <!--                <el-button v-if="activeName != '1'" type="warning" @click="backProfession">驳回</el-button>-->
        <!-- <el-button type="success" @click="stageSubmit">{{curStage}}</el-button> -->
        <!--经办人可见-->
        <!--浙江驳回按钮隐藏-->
        <el-button v-if="hasPriv1('pers_hand') && isShowaddrollback && isShowPriv" type="warning" @click="showDialogCallBack">驳回
        </el-button>
        <el-button v-if="hasPriv1('pers_hand') && isShowaddrollback && !isStopStep && examineStatus  && isShowPriv" type="success"
                   @click="stageSubmit1">
          {{curStage}}
        </el-button>
        <!--审定人驳回后显示-->
        <el-button v-if="hasPriv1('pers_hand') && isShowaddrollback && isExamine && sendExamineStatus && isShowPriv" type="danger"
                   @click="sendExamine">提交审定
        </el-button>
        <!--审定人可见-->
        <el-button v-if="hasPriv1('pers_examine') && isShowaddrollback && isExamine && stageStatus=='0' && isShowPriv" type="danger"
                   @click="examine">审定
        </el-button>
        <!--经办人||审定人-->
        <el-button v-if="isExamine && isShowPriv" type="primary" @click="examRecord">审定意见</el-button>
        <el-button type="primary" @click="showDailyRecord">流程日志</el-button>
      </div>
      <el-dialog
        title="操作日志"
        v-model="dailyRecordVisible"
        :append-to-body="true"
        width="80%">
        <daily-record :rgstrId="addForm.rgstrId" :professionType="addForm.pblmChType"></daily-record>
      </el-dialog>
      <el-dialog
        title="当前工程阶段审定"
        v-model="examVisible"
        :append-to-body="true"
        @close="dialogClose"
        width="80%">
        <examine-add :rgstrId="addForm.rgstrId" :planProcessId='planProcessId'
                     :planProcessName='planProcessName' @dialogClose="dialogClose"></examine-add>
      </el-dialog>
      <el-dialog
        title="当前工程阶段审定意见"
        v-model="examRecordVisible"
        :append-to-body="true"
        @close="dialogClose"
        width="80%">
        <exam-record-show :rgstrId="addForm.rgstrId" :planProcessId='planProcessId'
                          :planProcessName='planProcessName'></exam-record-show>
      </el-dialog>
      <el-dialog
        title="驳回说明"
        v-model="callbackNoteVisible"
        :append-to-body="true"
        @close="callBackDialogClose"
        width="30%">
        <span style="display: flex;align-items: center;"><span style="width: 80px;display: block">说明：</span><el-input type="textarea" v-model="callBackNote"></el-input></span>
        <template #footer>
          <el-button @click="callbackNoteVisible = false">取 消</el-button>
          <el-button type="primary" @click="backProfession">确 定</el-button>
        </template>
      </el-dialog>
    </el-main>
  </el-container>
</template>
<script>
import { backProfessionApi } from '@/api/InspectionReport.js';
import request from '@/utils/gw_ajax_request';
import dailyRecord from './dialogCom/dailyRecord';
import examineAdd from './dialogCom/examineAdd';
import examRecordShow from './dialogCom/examRecordShow';
import changeAdvice from './resultDiscuss1.vue';
import resultDiscuss from './resultDiscuss1.vue';
import centerModify from './resultDiscuss1.vue';
import bureauModify from './resultDiscuss1.vue';
import lastModify from './resultDiscuss1.vue';

export default {
  name: 'result2',
  data() {
    return {
      isLoading: false,
      activeName: '',
      tabList: [],
      operation: [],
      arr: [
        'changeAdvice',
        'resultDiscuss',
        'centerModify',
        'bureauModify',
        'lastModify',
        'changeAdvice1',
        'resultDiscuss2',
        'centerModify3',
        'bureauModify4',
        'lastModify5',
        'changeAdvice6',
        'resultDiscuss7',
        'centerModify8',
        'bureauModify9',
        'lastModify10',
        'changeAdvice11',
        'resultDiscuss12',
        'centerModify13',
        'bureauModify14',
        'lastModify15',
      ],
      curStage: '提交到下一阶段',
      addForm: {
        year: '',
        batch: '',
        group: '',
        area: '',
        rgstrId: '',
        pblmChType: '1',
        persId: localStorage.getItem('userid'),
      },
      yearList: [],
      pcList: [],
      groupList: [],
      areaList: [],
      projectList: [],
      professionList: [
        { label: '前期与设计', value: '1' },
        { label: '建设管理', value: '2' },
        { label: '计划下达与执行', value: '3' },
        { label: '资金使用与管理', value: '4' },
        { label: '工程质量', value: '5' },
        { label: '工程安全', value: '6' },
      ],
      flag: '1',
      objId: '',
      editable: true,
      backStatus: false, //回退状态
      dailyRecordVisible: false, //操作日志弹窗
      stepId: '',
      subjectList: [],
      curprvId: '0',
      curnextId: '',
      isShowaddrollback: false, //当前阶段是否是工程所处阶段
      isShowPriv: false, //当前阶段是否是工程所处阶段
      isStopStep: false,
      examRecordVisible: false, //审定意见
      examVisible: false, //审定
      planProcessId: '',
      planProcessName: '',
      isExamine: false,
      stageStatus: '',
      zjstates: false,
      examineStatus: false, //审定通过后提交下一阶段按钮显隐
      sendExamineStatus: false, //经办人提交审定按钮显隐
      callbackNoteVisible: false, //驳回弹框说明
      callBackNote: '', //驳回说明
    };
  },
  components: {
    changeAdvice: (resolve) => {
      require(['./resultDiscuss1'], resolve);
    },
    resultDiscuss: (resolve) => {
      require(['./resultDiscuss1'], resolve);
    },
    centerModify: (resolve) => {
      require(['./resultDiscuss1'], resolve);
    },
    bureauModify: (resolve) => {
      require(['./resultDiscuss1'], resolve);
    },
    lastModify: (resolve) => {
      require(['./resultDiscuss1'], resolve);
    },
    dailyRecord,
    changeAdvice1: (resolve) => {
      require(['./resultDiscuss1'], resolve);
    },
    resultDiscuss2: (resolve) => {
      require(['./resultDiscuss1'], resolve);
    },
    centerModify3: (resolve) => {
      require(['./resultDiscuss1'], resolve);
    },
    bureauModify4: (resolve) => {
      require(['./resultDiscuss1'], resolve);
    },
    lastModify5: (resolve) => {
      require(['./resultDiscuss1'], resolve);
    },
    changeAdvice6: (resolve) => {
      require(['./resultDiscuss1'], resolve);
    },
    resultDiscuss7: (resolve) => {
      require(['./resultDiscuss1'], resolve);
    },
    centerModify8: (resolve) => {
      require(['./resultDiscuss1'], resolve);
    },
    bureauModify9: (resolve) => {
      require(['./resultDiscuss1'], resolve);
    },
    lastModify10: (resolve) => {
      require(['./resultDiscuss1'], resolve);
    },
    changeAdvice11: (resolve) => {
      require(['./resultDiscuss1'], resolve);
    },
    resultDiscuss12: (resolve) => {
      require(['./resultDiscuss1'], resolve);
    },
    centerModify13: (resolve) => {
      require(['./resultDiscuss1'], resolve);
    },
    bureauModify14: (resolve) => {
      require(['./resultDiscuss1'], resolve);
    },
    lastModify15: (resolve) => {
      require(['./resultDiscuss1'], resolve);
    },
    examineAdd,
    examRecordShow,
  },
  watch: {
    'addForm.rgstrId': {
      deep: true,
      handler(n, o) {
        if (!n && this.addForm.pblmChType) {
          this.addForm.rgstrId = o;
        }
      },
    },
  },
  //监听属性 类似于data概念
  computed: {
    persId() {
      return localStorage.getItem('userid')
        ? localStorage.getItem('userid')
        : '1098101939614724096';
    },
    currentRlcode() {
      return localStorage.getItem('currentRlcode');
    },
  },
  mounted() {
    this.$nextTick(() => {
      this.getTreeData();
    });
  },
  methods: {
    remove() {
      if (this.addForm.pblmChType) {
        this.$message.warning('请先清空专业名称');
        return false;
      }
    },
    async getYearPc() {
      await request.post(`/tac/insp/year/list`, {}).then((res) => {
        if (res.success) {
          this.$nextTick(() => {
            this.yearList = res.data;
          });
        }
      });
      request.post(`/tac/insp/batch/list`, {}).then((res) => {
        if (res.success) {
          this.pcList = res.data;
        }
      });
    },
    //稽查流程
    getJiprocess() {
      request
        .post(`/tac/province/plan/process/list`, {})
        .then((res) => {
          if (res.success && res.data) {
            var tabArr = [];
            var opArr = [];
            res.data.forEach((ele, index) => {
              const obj = {
                label: ele['nowStep'],
                value: index < 20 ? this.arr[index] : this.arr[0],
                type: index + 1 + '',
                nowId: ele['nowId'],
                isRevision: ele['isRevision'],
                isShowRc: false,
              };
              if (this.currentRlcode.indexOf('330000000000') > -1) {
                if (index == res.data.length - 2) {
                  obj.isShowRc = true;
                }
              } else if (ele.nextId == '1' && ele.nextStep == '结束') {
                obj.isShowRc = true;
              }
              tabArr.push(obj);
              opArr.push(index + 1 + '');
            });
            if (
              this.hasPriv1('rexpert') &&
              this.hasPriv1('cexpert') &&
              this.hasPriv1('supervise')
            ) {
              this.tabList = tabArr;
              this.operation = opArr;
              this.isShowPriv = true;
            } else if (
              !this.hasPriv1('rexpert') &&
              !this.hasPriv1('cexpert') &&
              !this.hasPriv1('supervise')
            ) {
              this.tabList = [];
              this.operation = [];
              this.isShowPriv = false;
            } else {
              if (
                this.hasPriv1('rexpert') &&
                !this.hasPriv1('cexpert') &&
                !this.hasPriv1('supervise')
              ) {
                this.tabList = tabArr.slice(tabArr.length - 1, tabArr.length);
                this.operation = [];
                this.isShowPriv = false;
              }
              if (
                this.hasPriv1('cexpert') &&
                !this.hasPriv1('rexpert') &&
                !this.hasPriv1('supervise')
              ) {
                this.tabList = tabArr.slice(0, tabArr.length - 1);
                this.operation = opArr.slice(0, opArr.length - 1);
                this.isShowPriv = true;
              }
              if (
                this.hasPriv1('supervise') &&
                !this.hasPriv1('rexpert') &&
                !this.hasPriv1('cexpert')
              ) {
                this.tabList = tabArr;
                this.operation = opArr.slice(opArr.length - 2, opArr.length);
                this.isShowPriv = false;
              }
              if (
                this.hasPriv1('rexpert') &&
                this.hasPriv1('cexpert') &&
                !this.hasPriv1('supervise')
              ) {
                this.tabList = tabArr;
                this.operation = opArr.slice(0, opArr.length - 1);
                this.isShowPriv = true;
              }
              if (
                this.hasPriv1('rexpert') &&
                this.hasPriv1('supervise') &&
                !this.hasPriv1('cexpert')
              ) {
                this.tabList = tabArr;
                this.operation = opArr.slice(opArr.length - 2, opArr.length);
                this.isShowPriv = false;
              }
              if (
                this.hasPriv1('supervise') &&
                this.hasPriv1('cexpert') &&
                !this.hasPriv1('rexpert')
              ) {
                this.tabList = tabArr;
                this.operation = opArr;
                this.isShowPriv = true;
              }
            }
            this.activeName = this.tabList[0].type;
            this.subjectList = res.data;
            console.log(this.tabList, 'this.tabList');
            this.planProcessName = this.subjectList[0]['nowStep'];
            this.planProcessId = this.subjectList[0]['nowId'];
            this.hideOrShow();
            this.initTabAll();
            this.isLoading = false;
          } else {
            this.$message.warning('获取阶段信息为空');
          }
        })
        .catch((err) => {
          this.$message.error(err);
        });
    },
    //获取左侧树数据
    getTreeData() {
      this.isLoading = true;
      request
        .post(`/tac/insp/year/batch/obj/getObjTreeListV2`, {
          persId: this.persId,
        })
        .then((res) => {
          let treeDataLists;
          treeDataLists = res.data.children;
          if (treeDataLists) {
            this.yearList = treeDataLists;
            this.pcList = this.yearList[0].children;
            this.groupList = this.pcList[0].children;
            this.areaList = this.groupList[0].children;
            this.projectList = this.areaList[0].children;
            // 赋予默认值
            this.addForm.year = this.yearList[0].id;
            this.addForm.batch = this.pcList[0].id;
            this.addForm.group = this.groupList[0].id;
            this.addForm.area = this.areaList[0].adCode;
            this.addForm.rgstrId = this.projectList[0].id;
            this.objId = this.projectList[0].objId;
            this.getJiprocess();
          } else {
            this.$message.warning('获取查询条件信息失败');
          }
        })
        .catch((err) => {
          this.$message.error(err);
        });
    },
    changeYear(val) {
      this.addForm.batch = '';
      this.addForm.rgstrId = '';
      this.addForm.group = '';
      this.addForm.area = '';
      this.yearList.forEach((ele) => {
        if (val == ele.id) {
          this.pcList = ele.children;
        }
      });
    },
    changeBatch(val) {
      this.addForm.rgstrId = '';
      this.addForm.group = '';
      this.addForm.area = '';
      this.pcList.forEach((ele) => {
        if (val == ele.id) {
          this.groupList = ele.children;
          this.addForm.group = this.groupList[0].id;
          this.areaList = this.groupList[0].children;
          this.addForm.area = this.areaList[0].adCode;
          this.projectList = this.areaList[0].children;
          this.addForm.rgstrId = this.projectList[0].id;
        }
      });
    },
    changeGroup(val) {
      this.addForm.area = '';
      this.addForm.rgstrId = '';
      this.groupList.forEach((ele) => {
        if (val == ele.id) {
          this.areaList = ele.children;
        }
      });
    },
    changeArea(val) {
      this.addForm.rgstrId = '';
      this.areaList.forEach((ele) => {
        if (val == ele.adCode) {
          this.projectList = ele.children;
        }
      });
    },
    changeProject(val) {
      this.projectList.forEach((ele) => {
        if (val == ele.id) {
          this.objId = ele.objId;
          this.hideOrShow();
          this.initTabAll();
        }
      });
    },
    handleClick(data) {
      console.log(data);
      this.flag = data.name;
      this.planProcessName =
        this.subjectList[parseInt(this.flag) - 1]['nowStep'];
      this.planProcessId = this.subjectList[parseInt(this.flag) - 1]['nowId'];
      this.hideOrShow();
      this.curprvId = this.subjectList[parseInt(this.flag) - 1]['prvId'];
      this.curnextId = this.subjectList[parseInt(this.flag) - 1]['nextId'];
      this.isShowPriv = false;
      if (this.operation.indexOf(data.name) > -1) {
        this.isShowPriv = true;
      }
      this.initTabAll();
      // if(this.flag == '1'){
      //     // this.curStage = '提交到交换意见阶段'
      // }else if(this.flag == '2'){
      //     // this.curStage = '提交到送审阶段'
      // }else if(this.flag == '3'){
      //     // this.curStage = '提交到符合性审查阶段'
      // }else if(this.flag == '4'){
      //     // this.curStage = '提交到稽查办审批阶段'
      // }else if(this.flag == '5'){
      //     this.curStage = '提交'
      // }
    },
    initTabAll() {
      if (this.$refs.mychild && this.$refs.mychild.length > 0) {
        for (var i = 0; i < this.$refs.mychild.length; i++) {
          this.$refs.mychild[i].getProblemList();
        }
      }
    },
    stageSubmit1() {
      if (this.addForm.rgstrId) {
        if (this.activeName == this.tabList.length) {
          this.$message.success('当前阶段为最终阶段，无法提交');
        } else {
          this.$confirm(
            `注意：提交后将不能更改！确定内容已修改完成，并将成果“${this.curStage}”吗?`,
            '提示',
            {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning',
            },
          )
            .then(() => {
              request
                .get(
                  `/tac/province/pblm/info/planProcess/${this.addForm.rgstrId}/${this.subjectList[parseInt(this.activeName) - 1]['nextId']}`,
                  { params: { pblmChType: this.addForm.pblmChType } },
                )
                .then((res) => {
                  if (res.success) {
                    this.hideOrShow();
                    this.initTabAll();
                    this.editable = false;
                    this.$message.success('提交成功');
                  } else {
                    this.$message.error(res.message);
                  }
                });
            })
            .catch((err) => {
              this.$message.error('取消提交');
            });
        }
      } else {
        this.$message.warning('项目名称不能为空');
      }
    },
    stageSubmit() {
      if (this.addForm.rgstrId) {
        let url;
        if (this.flag == '7') {
          url = `/tac/pawp/rgstr/siju/${this.addForm.rgstrId}/8`;
        } else {
          url = `/tac/pawp/rgstr/chengguo/submit/${this.addForm.rgstrId}/${Number(this.flag) + 1}`;
        }
        this.$confirm(
          `注意：提交后将不能更改！确定内容已修改完成，并将成果“${this.curStage}”吗?`,
          '提示',
          {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning',
          },
        )
          .then(() => {
            request.get(url).then((res) => {
              if (res.success) {
                this.editable = false;
                this.$message.success('提交成功');
              } else {
                this.$message.error(res.message);
              }
            });
          })
          .catch(() => {});
      } else {
        this.$message.warning('项目名称不能为空');
      }
    },
    showDialogCallBack() {
      this.callBackNote = '';
      this.callbackNoteVisible = true;
    },
    // 助理退回工作底稿
    backProfession() {
      const prvId = this.subjectList[parseInt(this.activeName) - 1]['prvId'];
      if (parseInt(this.activeName) == 1) {
        if (!this.addForm.pblmChType) {
          this.$message.warning('请选择专业');
          return;
        }
        if (this.addForm.pblmChType && this.addForm.rgstrId) {
          request
            .get(
              `/tac/province/pblm/info/rollback/${this.addForm.rgstrId}/${prvId}/${this.addForm.pblmChType}`,
              {
                params: {
                  note: this.callBackNote,
                  pblmChType: this.addForm.pblmChType,
                },
              },
            )
            .then((res) => {
              if (res.success) {
                this.hideOrShow();
                this.callbackNoteVisible = false;
                this.initTabAll();
                this.$message.success('回退成功');
              } else {
                this.$message.warning(res.message);
              }
            })
            .catch((err) => {
              this.$message.warning(err);
            });
        } else {
          this.$message.warning('项目名称和专业不能为空');
        }
      } else {
        request
          .get(
            `/tac/province/pblm/info/rollback/allType/${this.addForm.rgstrId}/${prvId}`,
            {
              params: {
                note: this.callBackNote,
                pblmChType: this.addForm.pblmChType,
              },
            },
          )
          .then((res) => {
            if (res.success) {
              this.hideOrShow();
              this.callbackNoteVisible = false;
              this.initTabAll();
              this.$message.success('回退成功');
            } else {
              this.$message.warning(res.message);
            }
          })
          .catch((err) => {
            this.$message.warning(err);
          });
      }
    },
    //项目阶段是当前选中阶段则显示提交、驳回按钮
    hideOrShow() {
      const currentOrgId = localStorage.getItem('currentOrgId');
      if (currentOrgId == '036') {
        //浙江将驳回按钮隐藏
        this.zjstates = false;
      } else {
        this.zjstates = true;
      }
      if (this.addForm.rgstrId && this.planProcessId) {
        request
          .get(
            `/tac/province/pblm/info/taskProcess/${this.addForm.rgstrId}/${this.planProcessId}`,
          )
          .then((res) => {
            if (res.success && res.data) {
              //阶段是否为工程提交的当前阶段
              if (
                res.data.nowId &&
                res.data.nowId ==
                  this.subjectList[parseInt(this.activeName) - 1]['nowId']
              ) {
                this.isShowaddrollback = true;
              } else {
                this.isShowaddrollback = false;
              }
              //阶段是否需要审定，审定状态
              if (res.data.isExamine && res.data.isExamine == '1') {
                this.isExamine = true;
                //需要审定阶段，必须通过审定人审定后才能显示提交到下一阶段按钮
                if (res.data.stageStatus && res.data.stageStatus == '1') {
                  this.examineStatus = true;
                } else {
                  this.examineStatus = false;
                }

                //需要审定阶段，经办人提交审定按钮显隐
                if (
                  res.data.stageStatus == null ||
                  res.data.stageStatus == '' ||
                  res.data.stageStatus == '2'
                ) {
                  this.sendExamineStatus = true;
                } else {
                  this.sendExamineStatus = false;
                }
              } else {
                this.examineStatus = true;
                this.isExamine = false;
              }
              //审定状态
              this.stageStatus = res.data.stageStatus;
              //是否为最后阶段，最后阶段不显示提交到下一阶段
              if (
                1 == this.subjectList[parseInt(this.activeName) - 1]['nextId']
              ) {
                this.isStopStep = true;
              } else {
                this.isStopStep = false;
              }
            } else {
              this.isShowaddrollback = false;
            }
          });
      }
    },
    sendSubmitStatus(val) {
      this.editable = val;
    },
    // 展示操作日志
    showDailyRecord() {
      if (!this.addForm.pblmChType) {
        this.$message.warning('请选择专业');
        return;
      }
      this.dailyRecordVisible = true;
    },
    //当前工程阶段审定
    examine() {
      if (!this.addForm.rgstrId) {
        this.$message.warning('请选择工程');
        return;
      }
      this.examVisible = true;
    },

    sendExamine() {
      if (!this.addForm.rgstrId) {
        this.$message.warning('请选择工程');
        return;
      }
      if (this.addForm.rgstrId && this.planProcessId) {
        const data = {
          rgstrId: this.addForm.rgstrId,
          planProcessId: this.planProcessId,
          stageStatus: '0',
        };
        request
          .post(`/tac/province/examine/add`, data)
          .then((res) => {
            if (res.success) {
              this.hideOrShow();
              this.initTabAll();
              this.$message.success('提交成功');
            } else {
              this.$message.error(res.message);
            }
          })
          .catch((err) => {
            this.$message.error(err);
          });
      } else {
        this.$message.warning('项目名称以及阶段不能为空');
      }
    },
    //当前工程阶段审定意见
    examRecord() {
      if (!this.addForm.rgstrId) {
        this.$message.warning('请选择工程');
        return;
      }
      this.examRecordVisible = true;
    },
    dialogClose() {
      this.examRecordVisible = false;
      this.examVisible = false;
      this.hideOrShow();
      this.initTabAll();
    },
    callBackDialogClose() {
      this.callbackNoteVisible = false;
    },
    hasPriv1(item) {
      return this.ownPriv(item);
    },
  },
};
</script>

<style>
  .tabs_wrapper .el-tabs__item, .report_filter_select .el-form-item__label {
    font-size: 16px;
    color: #333;
  }

  .report_btn_group {
    position: absolute;
    top: 20px;
    right: 10px;
  }
</style>
