AddBtn.vue 4.96 KB
<template>
  <!-- v-if="!buttonHide && ((!isReview && !funcBtnHide) || showSetBtn)" -->
  <div class= "m-Btn-eContainer">
    <div class="m-funcBtn-eContainer">
      <!-- v-show="root.judgeVisiableInfo('mtabut.usrcon')" -->
      <!-- <el-button type="primary" size="small" @click="confirm" :loading="$store.state.Status.loading.confirm">{{ $t('buttons.确认') }}</el-button> -->
      <!-- v-show="root.judgeVisiableInfo('mtabut.sav')" -->
      <el-button type="primary" size="small" @click="start">提交</el-button>
      <!-- v-show="root.judgeVisiableInfo('mtabut.chk')" -->
      <el-button size="small" @click="check">检核</el-button>
      <el-button size="small" @click="exit"> 返回</el-button>
    </div>
  </div>
</template>
<script>
export default {
  props:["handleSubmit", "handleCheck"],
  inject:{
    root: {
			default: () => null
		}
  },
  methods:{
    async start() {
      if (this.$store.state.Status.loading.submit) {
				return;
      }
      
      //资本项目删除交易需要判断是否 对数据进行了删除
      let trnnam = this.root.trnName;
      if(trnnam == 'ecadel' ||trnnam == 'eaddel' ||trnnam == 'eafdel'){
        let basflg = this.root.model.cfabut.basflg;
        let dclflg = this.root.model.cfabut.dclflg;
        let delflg = '';
        let deltxt = "系统将删除";
        if(basflg == 'X'){
          deltxt = deltxt + " "+"签约信息";
        }
        if(dclflg == 'X'){
          let dclArr =this.root.model.recgrp.dcl || [] ;
          	for (let z = 0; z < dclArr.length; z++) {
              let acp = dclArr[z].acp;
              if(acp == 'X'){
                delflg = 'X';
                let idx = z+1;
                deltxt = deltxt +" "+"变动信息"+idx;
              }
            }
        }

        if(basflg !== 'X' && delflg !== 'X'){
          this.$confirm("没有删除数据,是否退出?", "提示", {
              confirmButtonText: "确认",
              cancelButtonText: "取消",
              type: "warning",
            }).then(async (res) => {
              this.$store.commit('delTagsArry', this.$route.path)
				      this.$router.back()
            })
            .catch(()=>{
            })
        }else{
          this.$confirm(deltxt, "提示", {
              confirmButtonText: "确认",
              cancelButtonText: "取消",
              type: "warning",
            }).then(async (res) => {
              this.handleSubmit && (await this.handleSubmit());
            })
            .catch(()=>{
            })
        }
      }else{
        this.handleSubmit && (await this.handleSubmit());
      }
      
    },
    async check() {
			if (this.$store.state.Status.loading.check) {
				return;
			}
      this.handleCheck && (await this.handleCheck());
    },
    exit(){
        this.$store.commit('delTagsArry', this.$route.path)
				this.$router.back()
    },
  }
}
</script>

<style scoped lang="less">
.m-Btn-eContainer {
  display: flex; /*flex布局*/
  position: relative;
  z-index: 10;
  height: 54px;
  padding: 10px 20px;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  background-color: var(--white);
  box-shadow: 0 0 11px 0 rgba(0, 0, 0, 0.1);
}
.m-funcBtn-eContainer {
  order: 1;
}
.m-zhanWei-forfuncBtn {
  order: 2;
}
.m-openleft {
  order: 3;
}

.m-funcBtn-eContainer button,
.m-funcBtn-eContainer .el-button + .el-button {
  margin: 0px 10px 0px 0px;
}
.m-funcBtn-eContainer .el-button--default {
  /* background-image: linear-gradient(#fff,#dedede); */
  border: 1px solid #ccc;
}
// .m-funcBtn-eContainer .el-button--primary {
//   /* border: 1px solid #0D4FBD; */
// }
.m-openleft-item {
  display: inline-block;
  padding: 0px;
}

.m-setting-btn {
  padding: 0px 10px 0px 8px;
  font-size: 12px;
  line-height: 22px;
}

.m-openleft-item > span {
  display: inline-block;
}
.m-openleft-item .el-button + .el-button {
  margin: 0;
}
.m-openleft-item > button,
.m-openleft-item > span > button,
.m-openleft-item > span > div > button {
  color: #606266;
  background-color: #fff;
  border: 1px #ccc solid;
  padding: 0px 7px;
  background-image: linear-gradient(#fff, #dedede);
}

.m-openleft-item > button:hover,
.m-openleft-item > span > button:hover,
.m-openleft-item > span > div > button:hover {
  background-color: #b3d8ff;
  color: #606266;
}

/* ui美化 */
.m-Btn-eContainer .el-button--small,
.m-Btn-eContainer .el-button--small.is-round {
  padding: 0 30px !important;
  font-size: 14px;
  height: 34px;
  line-height: 34px;
  font-weight: bold;
}

.btn-group {
  width: 50%;
  height: 30px;
  position: fixed;
  right: 20px;
  top: 70px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  z-index: 1000;
  ::v-deep .el-button {
    height: 28px !important;
    padding: 0 8px !important;
    border-radius: 5px;
  }
}
.warning-wrap {
  width: 100%;
  .warning-item {
    width: 100%;
    text-align: left;
    font-size: 16px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }
}
</style>