CollapseItem.vue 14.2 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469
<!--
 * @Author: yangming yangming@didihu.com.cn
 * @Date: 2023-09-05 17:24:08
 * @LastEditors: yangming yangming@didihu.com.cn
 * @LastEditTime: 2023-10-17 15:00:21
 * @FilePath: \scrm-micro-journey\src\views\journeyConfig\index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div :class="{ 'collapse-item': true, 'is-active': stepItem.isExpaned }" @click="handleExpand(item)">
    <div class="collapse-item-tab flex-column-center pl20">
      <i class="el-icon-caret-bottom" v-show="stepItem.isExpaned"></i>
      <i class="el-icon-caret-right" v-show="!stepItem.isExpaned"></i>
      <div class="tab-label">
        {{ stepItem.label }}
      </div>
    </div>
    <div class="collapse-item-panel" :style="{ display: stepItem.isExpaned ? 'block' : 'none' }">
      <div class="task-item">
        <template>
          <div class="task-item-head flex-column-center">
            <div class="task-item-icon">
              <img src="@/assets/config/log.png" />
            </div>
            <div class="task-item-name">进入条件</div>
            <div class="task-item-desc">(描述用户触发何种条件后,将自动变更为该旅程阶段)</div>
          </div>
          <div class="progress-item-content bg-fff" v-if="stepItem.conditionsList.length">
            <div class="progress-item" v-for="(v, k) in stepItem.conditionsList" :key="k">
              <span>条件{{ k + 1 }}</span>
              <span>{{ spiltString(v, 0) }}</span>
              <img src="@/assets/config/arrow.png" v-if="spiltString(v, 1)" />
              <span>{{ spiltString(v, 1) }}</span>
            </div>
          </div>
          <div class="empty-panel" v-else>
            <div class="empty-img">
              <img src="@/assets/empty.png" />
            </div>
            <div class="empty-txt">
              暂无进入条件
            </div>
          </div>
        </template>
        <template>
          <div class="task-item-sop flex">
            <div class="task-sop-l">
              <div class="task-item-head flex-column-center">
                <div class="task-item-icon">
                  <img src="@/assets/config/sop.png" />
                </div>
                <div class="task-item-name">SOP任务</div>
                <div class="task-item-desc">(系统面向当前旅程阶段客户的营销计划)</div>
              </div>
              <div class="task-item-content bg-fff" v-if="stepItem.sopList.length">
                <div class="step-item" v-for="(v, k) in stepItem.sopList" :key="k">
                  <div class="step-item-day">
                    <img src="@/assets/config/step-border.png" />
                    <span>第{{ v[0].day }}天</span>
                  </div>
                  <div class="step-item-content">
                    <div v-for="(value, key) in v" :key="key" class="step-time-item flex-column-center">
                      <div>
                        <div class="step-item-desc">
                          <span>[{{ stage_time[value.taskType] }}]发送 | {{ stage[value.taskType] }} |{{ stage_info[value.taskType] }}</span>
                        </div>
                        <div class="step-item-name" v-if="value.taskType">{{ stage_prefix[value.taskType].key ? activityInfo[stage_prefix[value.taskType].key] : remind(stage_prefix[value.taskType], k) }}</div>
                      </div>
                      <!-- <div class="step-detail-btn" @click="getEmpDetail">详情</div> -->
                    </div>
                  </div>
                </div>
              </div>
              <div class="empty-panel" v-else>
                <div class="empty-img">
                  <img src="@/assets/empty.png" />
                </div>
                <div class="empty-txt">
                  暂无SOP任务
                </div>
              </div>
            </div>
            <div class="task-sop-calendar">
              <div class="task-item-head flex-column-center">
                <div class="task-item-icon">
                  <img src="@/assets/config/calendar.png" />
                </div>
                <div class="task-item-name">SOP日历</div>
              </div>
              <div class="task-item-content bg-fff">
                <div class="calendar-panel">
                  <div class="calendar-item" v-for="(v, k) in stepItem.sopList" :key="k">
                    <div class="calendar-day">第{{ v[0].day }}天</div>
                    <div class="calendar-time flex-column-center" v-for="(value, key) in v" :key="key">
                      <el-popover placement="top-start" width="100" trigger="click">
                        <div class="popover-panel" v-for="(t, pkey) in v" :key="pkey">
                          <div class="flex-column-center">
                            <span>{{ stage_time[t.taskType] }}</span>
                            <div :class="['stage-icon', `stage-${stage_icon[t.taskType]}`]"></div>
                          </div>
                          <div class="stage-desc">{{ stage[t.taskType] }}</div>
                        </div>

                        <div slot="reference" class="flex-column-center" v-if="v.length <= 2">
                          <span>{{ stage_time[value.taskType] }}</span>
                          <div :class="['stage-icon', `stage-${stage_icon[value.taskType]}`]"></div>
                        </div>
                        <div slot="reference" class="flex-column-center" v-if="v.length > 2 && key == 0">
                          <span>3条内容</span>
                        </div>
                      </el-popover>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </template>
      </div>
    </div>
    <!-- <emp-detail v-if="empVisible" :empVisible="empVisible"></emp-detail> -->
  </div>
</template>
<script>
const STAGE = Object.freeze({
  4: '门店助手1v1',
  3: '门店助手朋友圈',
  1: '发送短信',
  2: 'AI外呼',
  5: '跟进提醒',
  6: '客户信息查询'
})
const ICON = Object.freeze({
  4: 1,
  3: 2,
  1: 3,
  2: 4,
  5: 5,
  6: 6
})
const STAGE_INFO = Object.freeze({
  4: '本功能将给跟进员工推送1v1任务,由员工向每个客户微信转发对应的营销内容。',
  3: '本功能将给跟进员工推送朋友圈任务,由员工一键将营销内容发布微信朋友圈',
  1: '本功能将给跟进员工推送短信营销任务,由员工一键确认后系统自动推送营销短信给客户',
  2: '本功能将给跟进员工推送AI外呼任务,由员工一键确认后AI外呼平台自动对客户进行外呼',
  5: '本功能将给跟进员工推送跟进提醒,提醒员工给客户打一个电话或其他跟进行为。',
  6: '本功能配合第三方平台,定时获取到保信息并更新。'
})
const STAGE_TIME = Object.freeze({
  4: '09:00',
  3: '09:00',
  1: '09:00',
  2: '16:00',
  5: '09:00',
  6: '09:00'
})
const STAGE_PREFIX = Object.freeze({
  4: {
    key: 'activityName'
  },
  3: {
    key: 'activityName'
  },
  1: {
    key: 'textMessage',
    label: '短信模版:'
  },
  2: {
    key: 'aiSpeech',
    label: 'AI话术模版:'
  },
  5: {
    意向客户: '提醒内容:您有[客户人数] 位客户已进入[旅程阶段],请及时跟进。',
    保费报价: ['提醒内容:您有客户保费已出,请尽快联系并提供车险报价。', '提醒内容:3天前您有客户保费已出,请尽快跟进并通过门店助手反馈跟进情况(成功 或者 战败)']
  },
  6: '查询内容:到保日期'
})
// import empDetail from './empDetail'
export default {
  components: {
    // empDetail
  },
  props: {
    stepItem: {
      type: Object,
      default: () => {}
    },
    activityInfo: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      stage: STAGE,
      stage_icon: ICON,
      stage_info: STAGE_INFO,
      stage_time: STAGE_TIME,
      stage_prefix: STAGE_PREFIX,
      empVisible: false
    }
  },
  created() {},
  methods: {
    remind(v, k) {
      if (typeof v == 'string') return v
      if (this.stepItem.label == '保费报价') {
        return v[this.stepItem.label][k]
      } else {
        return v[this.stepItem.label]
      }
    },
    spiltString(str, n) {
      return (str.split('-')[n] || '').replace('文字备注:', '')
    },
    //查看详情
    getEmpDetail() {
      this.empVisible = true
    },
    //展开收起
    handleExpand() {
      this.stepItem.isExpaned = !this.stepItem.isExpaned
    }
  }
}
</script>
<style lang="scss" scoped>
.empty-panel {
  background: #fff;
  padding: 10px;
  font-size: 12px;
  color: #666666;
  text-align: center;
  margin: 10px 0px;
  .empty-img {
    width: 48px;
    height: 30px;
    margin: 10px auto 4px;
  }
}
.collapse-item {
  overflow: hidden;
  height: 51px;
  cursor: pointer;
  &.is-active {
    height: auto;
  }
  .collapse-item-tab {
    height: 50px;
    border-bottom: 1px solid #e5e5e5;
    i {
      cursor: pointer;
      margin-right: 2px;
    }
    .tab-label {
      font-weight: 600;
      font-size: 14px;
      color: #1d2129;
    }
  }
  .collapse-item-panel {
    background: #f7f7fc;
    padding: 16px;
    transition: all 0.3s;
    .task-item {
      &-head {
        .task-item-icon {
          width: 20px;
          height: 20px;
        }
        .task-item-name {
          color: #333333;
          font-size: 14px;
          margin-left: 10px;
        }
        .task-item-desc {
          color: #999999;
          font-size: 12px;
        }
      }
      .task-sop-l {
        flex: 1;
      }
      .task-sop-calendar {
        width: 296px;
        margin-left: 16px;
      }
    }
    .progress-item-content {
      padding: 16px;
      margin: 10px 0px;
      display: grid;
      grid-template-columns: 50% 50%;
      row-gap: 20px;
      .progress-item {
        position: relative;
        padding-left: 20px;
        min-width: 50%;
        height: 32px;
        display: flex;
        align-items: center;
        img {
          width: 32px;
          height: 4px;
          margin: 0 10px;
        }
        span {
          display: inline-block;
          &:first-child {
            margin-right: 40px;
            width: 48px;
          }
          &:last-child {
            width: 80px;
          }
        }
        &::before {
          content: '';
          position: absolute;
          width: 6px;
          height: 6px;
          background: #5850ff;
          border-radius: 50%;
          left: 0px;
          top: 12px;
        }
      }
    }
    .task-item-content {
      padding: 16px;
      margin-top: 10px;
      height: calc(100% - 70px);
      .step-item-day {
        position: relative;
        img {
          width: 216px;
          height: 52px;
        }
        span {
          position: absolute;
          top: 18px;
          left: 52px;
        }
      }

      .step-item {
        .step-time-item {
          padding: 12px 16px;
          background: #f9fafe;
          .step-detail-btn {
            margin-left: auto;
            font-size: 14px;
            color: #5850ff;
            cursor: pointer;
          }
          &:not(:first-child) {
            margin-top: 20px;
          }
        }
        &:last-child {
          .step-item-content {
            border: none;
          }
        }
      }
      .step-item-content {
        padding: 16px 22px 20px;
        border-left: 1px dashed #b8b9ff;
        margin: -10px 0px -10px 20px;
      }
      .step-item-desc {
        font-size: 14px;
        color: #c6c6c6;
      }
      .step-item-name {
        font-size: 14px;
        color: #333333;
        margin-top: 8px;
      }
      .calendar-panel {
        display: grid;
        grid-template-columns: repeat(4, 25%);
        row-gap: 12px;
        .calendar-item {
          .calendar-day {
            font-size: 12px;
            color: #c6c6c6;
          }
          .calendar-time {
            line-height: 20px;
            /deep/ {
              .el-popover__reference-wrapper {
                display: flex;
                align-items: center;
                .el-popover__reference {
                  height: 32px;
                  line-height: 32px;
                }
                &:hover {
                  span {
                    color: #5850ff;
                  }
                  .stage-1 {
                    background: url('../../../assets/config/calendar-icon.png') -114px -62px;
                  }
                  .stage-2 {
                    background: url('../../../assets/config/calendar-icon.png') -10px -10px;
                  }
                  .stage-3 {
                    background: url('../../../assets/config/calendar-icon.png') -62px -10px;
                  }
                  .stage-4 {
                    background: url('../../../assets/config/calendar-icon.png') -62px -166px;
                  }
                  .stage-5 {
                    background: url('../../../assets/config/calendar-icon.png') -10px -114px;
                  }
                  .stage-6 {
                    background: url('../../../assets/config/calendar-icon.png') -62px -114px;
                  }
                  .stage-7 {
                    background: url('../../../assets/config/calendar-icon.png') -114px -114px;
                  }
                }
              }
            }
            span {
              font-size: 14px;
              color: #666666;
              text-decoration: underline;
              cursor: pointer;
            }
          }
        }
      }
    }
  }
}
.stage-desc {
  font-size: 12px;
  color: #333333;
}
.stage-icon {
  width: 32px;
  height: 32px;
  transform: scale(0.5);
}
.stage-2 {
  background: url('../../../assets/config/calendar-icon.png') -62px -62px;
}
.stage-3 {
  background: url('../../../assets/config/calendar-icon.png') -114px -10px;
}
.stage-1 {
  background: url('../../../assets/config/calendar-icon.png') -10px -62px;
}
.stage-4 {
  background: url('../../../assets/config/calendar-icon.png') -166px -10px;
}
.stage-5 {
  background: url('../../../assets/config/calendar-icon.png') -166px -62px;
}
.stage-6 {
  background: url('../../../assets/config/calendar-icon.png') -166px -114px;
}
.stage-7 {
  background: url('../../../assets/config/calendar-icon.png') -10px -166px;
}
</style>