rejectDialog.vue 7.61 KB
<!-- 运营审核 -->
<template>
  <el-dialog
    id="baseDialog"
    top="15vh"
    :close-on-click-modal="false"
    :close-on-press-escape="true"
    :title="dialogConfig.title"
    :width="dialogConfig.width"
    :visible.sync="visible"
    :show-close="true"
    @close="dialogClose"
    class="noborder"
  >
    <div class="reject-dialog" v-loading="loading">
      <div class="list-name">审核信息</div>
      <div class="dialog-title-box">
        <div class="dialog-name">{{ info.staffName }}</div>
        <div class="dialog-title1">
          <div class="flex">
            <span class="title-text">手机号:</span>
            <span class="title-text1">{{ info.staffPhone }}</span>
          </div>
          <div class="flex">
            <span class="title-text">所属门店:</span>
            <span class="title-text1">{{ info.merchantName }}</span>
          </div>
        </div>
        <div class="dialog-title1">
          <div class="flex">
            <span class="title-text">客户姓名:</span>
            <span class="title-text1">{{ info.customerName }}</span>
          </div>
          <div class="flex-1 flex">
            <span class="title-text">缺失原因:</span>
            <span class="title-text1">{{ info.reason }}</span>
          </div>
        </div>
      </div>
      <glsx-combi-form
        class="edit-form-container"
        ref="formRef"
        label-width="150px"
        default-width="350px"
        :form-ref="rejectRef"
        :form-obj="infoForm"
        :form-data="editFormData"
        :form-rules="formRules"
      ></glsx-combi-form>
      <div class="list-name">历史审核记录</div>
      <div class="timeline-box">
        <el-timeline>
          <el-timeline-item
            v-for="(activity, index) in activities"
            :key="index"
            :color="index == 0 ? '#2a58ad' : ''"
          >
            <div class="status-box">
              <span class="status-box-text w100">{{
                activity.auditStatus == "1" ? "【已通过】" : "【已驳回】"
              }}</span>
              <span class="status-box-text flex-1">{{
                activity.auditOpinion || "-"
              }}</span>
            </div>
            <div class="time-box">
              <span class="time-box-text w100">{{ activity.auditUser }}</span>
              <span class="time-box-text">{{
                Util.dateFormate(activity.auditTime, "YYYY-MM-DD HH:mm:ss")
              }}</span>
            </div>
          </el-timeline-item>
        </el-timeline>
      </div>
    </div>
    <div slot="footer">
      <el-button v-preventReClick @click="dialogClose" type="info">
        取消
      </el-button>
      <el-button v-preventReClick @click="confirmBtn(2)" type="danger">
        驳回
      </el-button>
      <el-button
        type="primary"
        @click="confirmBtn(1)"
        :loading="$store.state.d2admin.loading.value || btnLoding"
      >
        通过
      </el-button>
    </div>
  </el-dialog>
</template>

<script>
import { reportApproval, reportDetail } from "@/api/earlyWarningManager"
import { color } from "echarts"
import { Util, deepClone } from "@/common/util"
export default {
  name: "ExamineDialog",
  data() {
    return {
      Util,
      loading: true,
      userInfo: this.$store.state.d2admin.user.info,
      // txtObj: {
      //   procurementReview: '说明:订单审核后会自动流转至商务进行复审',
      //   procurementBusiness: '说明:订单审核后会自动流转至供应商进行确认并发货'
      // },
      infoForm: {
        remark: ""
      },
      activities: [],
      rejectRef: "rejectRef",
      dialogConfig: {
        title: "重新审核",
        width: "600px"
      },
      examineRef: "examineRef",
      formRules: {},
      editFormData: [
        {
          label: "审核意见",
          name: "remark",
          type: "input",
          maxlength: 50,
          inputType: "textarea",
          showLimit: true,
          rows: 4
        }
      ],
      baseData: {
        // shippingEntityList: []
      },
      btnLoading: false
    }
  },

  props: {
    // fromPage: {
    //   type: String,
    //   default: 'procurementReview'
    // },
    rejectVisible: {
      type: Boolean,
      default: false
    },
    // paramsObj: {
    //   type: Object,
    //   default: {}
    // }
    info: {
      type: Object,
      default: () => {}
    }
  },
  computed: {
    visible: {
      get() {
        return this.rejectVisible
      },
      set(newVal) {
        this.$emit("dialogClose", { flag: newVal, attrName: "rejectVisible" })
      }
    }
  },

  mounted() {
    this.getReportDetail()
  },

  methods: {
    confirmBtn(type) {
      this.$refs.formRef.$refs[this.rejectRef].validate((valid) => {
        if (valid) {
          var params = {}
          if (type === 2 && !this.infoForm.remark) {
            this.$message.warning("请填写审核意见")
            return
          }
          params.auditOpinion = this.infoForm.remark
          params.id = this.info.id
          params.auditStatus = type
          console.log(params)

          reportApproval(params).then((res) => {
            this.notice.okTips("操作成功")
            this.visible = false
          })
        }
      })
    },
    getReportDetail() {
      reportDetail({ id: this.info.id })
        .then((res) => {
          this.loading = false
          this.activities = res
        })
        .catch(() => {
          this.loading = false
        })
    },
    dialogClose() {
      this.visible = false
    }
  }
}
</script>
<style lang="scss" scoped>
::v-deep .el-dialog__body {
  padding: 0px 20px 30px;
}
::v-deep .el-timeline {
  width: calc(100% - 40px);
  box-sizing: border-box;
  .el-timeline-item {
  }
}
::v-deep .el-timeline-item__node--normal {
  width: 8px;
  height: 8px;
}
::v-deep .el-timeline-item__tail {
  left: 2px;
}
.reject-dialog {
  max-height: 70vh;
  overflow-y: scroll;
  .list-name {
    font-size: 16px;
    font-weight: 400;
    color: #333333;
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
    padding: 13px 0;
  }
  .dialog-title-box {
    width: 100%;
    background: #fafafa;
    padding: 10px 20px;
    color: #333333;
    font-size: 16px;
    font-weight: 400;
    box-sizing: border-box;
    margin-bottom: 20px;
    .dialog-name {
      margin-bottom: 12px;
    }
    .dialog-title1 {
      display: flex;
      color: #333333;
      font-size: 14px;
      font-weight: 400;
      margin-bottom: 8px;
    }
  }

  .reject-input {
    ::v-deep .el-textarea__inner {
      height: 70px;
    }
  }

  .el-textarea .el-input__count {
    right: 90px;
    bottom: -10px;
    font-size: 12px;
    color: #999999;
  }

  .tips {
    color: #999999;
  }

  .status-box {
    display: flex;
    align-items: center;
    .status-box-text {
      margin-right: 8px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }
  .flex-1 {
    flex: 1;
  }
  .w100 {
    width: 100px;
  }
  .time-box {
    display: flex;
    align-items: center;
    margin-top: 5px;
    color: #999999;
    font-size: 12px;
    font-weight: 400;
    .time-box-text {
      margin-right: 8px;
    }
  }
  .timeline-box {
    width: 100%;
  }
  &::-webkit-scrollbar {
    display: none;
  }
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}
::v-deep .el-dialog__footer {
  .el-button {
    width: 80px;
  }
}
::v-deep .el-dialog__header {
  border-bottom: 1px solid #e5e5e5;
}
.title-text {
  width: 80px;
}
.title-text1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100px;
  display: block;
}
.flex {
  display: flex;
}
.flex-1 {
  flex: 1;
}
</style>