保誠-保戶業務員媒合平台
Mila
2022-01-22 c047a3336ff1efc7d21edee6f0c8811264eebae7
PAMapp/pages/satisfactionList.vue
@@ -4,17 +4,17 @@
    <div class="pam-container">
      <div class="satisfaction-title">
        <span class="mdTxt">滿意度調查</span>
        <span class="ml-10 text--prudential_grey smTxt_bold">共 {{satisfactionList.length}} 筆</span>
        <span class="ml-10 text--prudential_grey smTxt_bold">共 {{mapUnReviewLogList.length}} 筆</span>
      </div>
      <div class="satisfaction-card" v-for="(item, index) in satisfactionList" :key="index">
      <div class="satisfaction-card" v-for="(item, index) in mapUnReviewLogList" :key="index">
        <div class="satisfaction-card-content">
          <UiAvatar :size="80" :agentNo="''"></UiAvatar>
          <UiAvatar :size="80" :agentNo="item.agentNo"></UiAvatar>
          <div class="satisfaction-card-text">對於顧問
              <span class="text--primary text--bold">{{item.agentName}}</span>
              的整體服務,您給予幾顆星評價?
          </div>
        </div>
        <el-rate v-model="item.score" class="pam-satisfaction-rate mt-10"></el-rate>
        <el-rate v-model="item.satisfaction" class="pam-satisfaction-rate mt-10"></el-rate>
      </div>
      <div class="text--center mt-30">
        <el-button type="primary" :disabled="isBtnDisabled">送出</el-button>
@@ -23,28 +23,47 @@
  </div>
</template>
<script>
import { Vue, Component } from 'nuxt-property-decorator';
<script lang="ts">
import { Vue, Component, Action, State, Watch } from 'nuxt-property-decorator';
import { AppointmentLog } from '~/shared/models/appointment.model';
@Component({
  layout: 'home'
})
export default class MySatisfactionList extends Vue {
  satisfactionList = [
    {
      agentName: '蔡美眉',
      score: 0
    },
    {
      agentName: '蔡美眉',
      score: 0
  @State
  unReviewLogList!: AppointmentLog[];
  mapUnReviewLogList: AppointmentReviewLog[] = [];
  ///////////////////////////////////////////////////////
  @Watch('unReviewLogList')
  onUnReviewLogListChange() {
    if (this.unReviewLogList.length) {
      this.mapUnReviewLogList = this.unReviewLogList.map(item => {
        return {
          ...item,
          satisfaction: 0
        }
      })
    }
  ]
  }
  ///////////////////////////////////////////////////////
  get isBtnDisabled() {
    return this.satisfactionList.findIndex(item => item.score > 0) === -1;
    if (this.mapUnReviewLogList.length) {
      return this.mapUnReviewLogList.findIndex(item => item.satisfaction > 0) === -1;
    }
    return false;
  }
}
interface AppointmentReviewLog extends AppointmentLog {
  satisfaction: number;
}
</script>
<style lang="scss" scoped>