detailDialog.vue 11.4 KB
<template>
  <div>
    <baseDialog :is-show.sync="dialogShow"
                :config="dialogConfig.setting"
                :dialog-config="dialogConfig.config"
                class="detail-content-warn">
      <div>
        <div class="form_div">
          <el-form class="edit-sub-block"
                   label-width="150px"
                   :inline="true">
            <div class="itemDiv">
              <el-form-item label="督导:"
                            class="halfItem">
                {{ detailInfo.flightSupervisorName ? detailInfo.flightSupervisorName : "-" }}
              </el-form-item>
              <el-form-item label="门店:"
                            class="halfItem">
                {{ detailInfo.merchantName ? detailInfo.merchantName : "-" }}
              </el-form-item>
            </div>
            <div class="itemDiv">
              <el-form-item label="区域运营:"
                            class="halfItem"
                            :title="detailInfo.salesperson">
                {{ detailInfo.salesperson ? (detailInfo.salesperson.length > 40 ? (detailInfo.salesperson.slice(0, 40) + '...') : detailInfo.salesperson) : '-' }}
              </el-form-item>
              <el-form-item label="支援类型:"
                            class="halfItem">
                {{ detailInfo.supportTypeShow }}
              </el-form-item>
            </div>
            <div class="itemDiv">
              <el-form-item label="支援方式:"
                            class="halfItem"
                            :title="detailInfo.salesperson">
                {{ detailInfo.supportWayShow }}
              </el-form-item>
              <el-form-item label="门店类型:"
                            class="halfItem">
                {{ detailInfo.storeTypeShow }}
              </el-form-item>
            </div>
            <div>
              <el-form-item label="情况描述:"
                            class="onLineItem"
                            :title="detailInfo.situationDescription">
                {{ detailInfo.situationDescription ? (detailInfo.situationDescription.length > 50 ? (detailInfo.situationDescription.slice(0, 50) + '...') : detailInfo.situationDescription) : '' }}
              </el-form-item>
            </div>
            <div class="itemDiv">
              <el-form-item label="开始带教时间:"
                            class="halfItem">
                {{ detailInfo.teachStartTimeShow }}
              </el-form-item>
              <el-form-item label="结束带教时间:"
                            class="halfItem">
                {{ detailInfo.teachEndTimeShow }}
              </el-form-item>
            </div>
            <div class="itemDiv">
              <el-form-item label="业务类型1:"
                            class="halfItem">
                {{ detailInfo.businessTypeShow }}
              </el-form-item>
              <el-form-item label="业务类型2:"
                            class="halfItem">
                {{ detailInfo.saleTypeOptShow ? detailInfo.saleTypeOptShow : "-" }}
              </el-form-item>
            </div>
            <div class="itemDiv">
              <el-form-item label="状态:"
                            class="halfItem">
                {{ detailInfo.taskStatusShow }}
              </el-form-item>
              <el-form-item label="创建时间:"
                            class="halfItem">
                {{ detailInfo.createdDateShow }}
              </el-form-item>
            </div>
            <div>
              <el-form-item label="评估解决方案:"
                            class="onLineItem"
                            :title="detailInfo.solutionDescription">
                {{ detailInfo.solutionDescription ? (detailInfo.solutionDescription.length > 50 ? (detailInfo.solutionDescription.slice(0, 50) + '...') : detailInfo.solutionDescription) : '' }}
              </el-form-item>
            </div>
            <div>
              <el-form-item label="门店现存问题:"
                            class="onLineItem"
                            :title="detailInfo.problemDescription">
                {{ detailInfo.problemDescription ? (detailInfo.problemDescription.length > 50 ? (detailInfo.problemDescription.slice(0, 50) + '...') : detailInfo.problemDescription) : '' }}
              </el-form-item>
            </div>
          </el-form>
        </div>
      </div>
    </basedialog>
  </div>
</template>

<script>
import { Util, deepClone } from "@/common/util"
import { teaching_businessOpt, teaching_taskStatusOpt, teaching_supportTypeOpt, teaching_supportWayOpt, teaching_storeTypeOpt, teaching_saleTypeOpt } from '@/common/constants.js'
export default {
  name: "DetailDialog",
  components: {
  },
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    paramsObj: {
      type: Object,
      default: {}
    }
  },
  computed: {
    dialogShow: {
      get() {
        return this.visible
      },
      set(val) {
        this.$emit('dialogClose', { flag: val })
      }
    }
  },
  mounted() {
    this.getDetail()
  },
  data() {
    return {
      dialogConfig: {
        setting: {
          showClose: true,
          appendToBody: false,
          btnList: []
        },
        config: {
          title: "任务详情",
          width: "1080px"
        }
      },
      detailInfo: {},
      // loading: true,
      businessOpt: deepClone(teaching_businessOpt),
      taskStatusOpt: deepClone(teaching_taskStatusOpt),
      supportTypeOpt: deepClone(teaching_supportTypeOpt),
      supportWayOpt: deepClone(teaching_supportWayOpt),
      storeTypeOpt: deepClone(teaching_storeTypeOpt),
      saleTypeOpt: deepClone(teaching_saleTypeOpt)
    }
  },
  methods: {
    getDetail() {
      console.log('this.paramsObj', this.paramsObj)
      this.detailInfo = deepClone(this.paramsObj)
      const areaOperators = this.detailInfo.areaOperatorList
      if (areaOperators.length > 0) {
        this.detailInfo.salesperson = areaOperators.map(item => item.areaOperatorName + ' ' + item.areaOperatorPhone).join(';')
      } else {
        this.detailInfo.salesperson = '-'
      }
      this.detailInfo.businessTypeShow = this.businessOpt.find(item => item.confId === this.detailInfo.businessType)?.confValue || '-' // 业务类型1
      if (this.detailInfo.saleType && this.detailInfo.saleType.indexOf(",") != -1) {
        let list = this.detailInfo.saleType.split(',')
        list = list.map(item => {
          return this.saleTypeOpt.find(i => i.confId === item)?.confValue
        }).join(',')
        this.detailInfo.saleTypeOptShow = list // 业务类型2
      } else {
        this.detailInfo.saleTypeOptShow = "-" // 业务类型2
      }
      this.detailInfo.taskStatusShow = this.taskStatusOpt.find(item => item.confId === this.detailInfo.taskStatus)?.confValue || '-' // 任务状态
      this.detailInfo.supportTypeShow = this.supportTypeOpt.find(item => item.confId === this.detailInfo.supportType)?.confValue || '-' // 支援类型
      this.detailInfo.supportWayShow = this.supportWayOpt.find(item => item.confId === this.detailInfo.supportWay)?.confValue || '-' // 支援方式
      this.detailInfo.storeTypeShow = this.storeTypeOpt.find(item => item.confId === this.detailInfo.storeType)?.confValue || '-' // 门店类型
      this.detailInfo.teachStartTimeShow = this.detailInfo.teachStartTime
        ? Util.dateFormate(this.detailInfo.teachStartTime, 'YYYY-MM-DD')
        : "-"
      this.detailInfo.teachEndTimeShow = this.detailInfo.teachEndTime
        ? Util.dateFormate(this.detailInfo.teachEndTime, 'YYYY-MM-DD')
        : "-"
      this.detailInfo.createdDateShow = this.detailInfo.createdDate
        ? Util.dateFormate(this.detailInfo.createdDate, 'YYYY-MM-DD HH:mm:ss')
        : "-"
    }
  }
}
</script>

<style lang="scss" scoped>
.detail-content-warn {
  .div-title {
    width: 1040px;
    height: 30px;
    border-bottom: 1px solid #e5e5e5;
    font-size: 16px;
    font-weight: 600;
    color: #333333;
    margin: 10px 0 20px 0;
  }
  .el-icon-circle-close {
    color: #ffffff;
  }
  .examine-record {
    box-sizing: border-box;
    width: 1040px;
    min-height: 157px;
    // border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #fafafa;
    padding: 16px 20px;

    .title {
      // width: 64px;
      height: 23px;
      font-family: PingFangSC-Medium;
      font-weight: 600;
      color: #333333;
      font-size: 16px;
      text-align: left;
    }

    .title .edit-btn {
      color: #185efe;
      font-size: 14px;
      margin-left: 8px;
      font-weight: 400;
    }

    .txt-bold {
      font-weight: bold;
    }

    .blueTxt {
      color: #185efe;
    }

    .redTxt {
      color: #eb4e4e;
    }

    .orangedot {
      width: 6px;
      height: 6px;
      background: #f47f13;
      border-radius: 6px;
      display: inline-block;
    }

    .greendot {
      width: 6px;
      height: 6px;
      background: #4aca74;
      border-radius: 6px;
      display: inline-block;
    }

    .reddot {
      width: 6px;
      height: 6px;
      background: #eb4e4e;
      border-radius: 6px;
      display: inline-block;
    }

    .record-div {
      margin: 16px 0;
      font-family: PingFangSC-Regular;
      font-weight: 400;
      font-size: 14px;
      color: #666666;
      letter-spacing: 0;

      .record-div-d {
        margin-top: 10px;
      }

      .span-txt-one {
        display: inline-block;
        margin-left: 14px;
        width: 90px;
        height: 21px;
      }

      .span-txt-two {
        margin-left: 40px;
      }

      .greenSp {
        color: #4aca74;
      }

      .redSp {
        color: #eb4e4e;
      }
    }
  }

  .form_div {
    color: #333333;

    .el-form-item__content {
      display: inline-block;
      width: calc(100% - 150px);
      line-height: 24px;
    }

    .el-form-item__label {
      padding: 0;
      line-height: 24px;
    }
    .el-form-item {
      width: 100%;
      margin-bottom: 20px;
    }

    .edit-sub-block {
      // padding: 0 10px;

      .detail-txt {
        display: inline-block;
        width: 200px;
        vertical-align: bottom;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      ::v-deep .el-form-item__content {
        max-width: calc(100% - 110px);
        word-break: break-all;
      }
      .itemDiv {
        display: flex;
        .halfItem {
          width: 50%;
        }
      }
      .onLineItem {
        ::v-deep .el-form-item__content {
          max-width: 80%;
        }
      }
    }

    .edit-sub-block-two {
      .el-form-item__label {
        padding: 0;
      }
      .el-form-item {
        // width: 300px;
        margin: 0px;
      }
    }
    .busi-info {
      box-sizing: border-box;
      width: 890px;
      border-radius: 4px;
      border: 1px solid #e5e5e5;
      padding: 6px 0;
      color: #333333;
      font-size: 14px;
      margin-bottom: 14px;
      .info-row {
        height: 20px;
        line-height: 20px;
        margin-bottom: 16px;
      }
      .info-row:last-child {
        margin-bottom: 0;
      }
      .info-item {
        display: inline-block;
        width: 50%;
        height: 20px;
        line-height: 20px;
        margin-bottom: 6px;
        .item-label {
          display: inline-block;
          width: 150px;
          color: #666666;
          text-align: right;
        }
      }
    }
  }
}
</style>

<style >
.detailDialog-tooltip-width {
  max-width: 500px;
}
</style>