<template>
  <el-drawer
    title="调查单脚印"
    :reverse="true"
    :visible.sync="drawer"
    :with-header="false">
    <el-timeline style="width: 90%;margin-top: 20px">
      <el-timeline-item
v-for="step in stepList"
                        :timestamp="timeString ? (step.workTime).substring(0,19):step.workMan+'  '+(step.workTime).substring(0,19)"
                        placement="top">
        <el-card class="stepList">
          <h4 style="margin: 5px 0">{{ step.workMemo }}</h4>
          <template v-if="step.workExplain && step.workExplain.substring(0, 6) == 'qrcode'">
            <img :src="step.workExplain.substring(7, step.workExplain.length)" width="100" height="100">
          </template>
          <template v-else>
            <p>{{ step.workExplain }}</p>
          </template>
        </el-card>
      </el-timeline-item>

    </el-timeline>
  </el-drawer>
</template>

<script>
import { getComplaintBillStepList } from '@/api/complaint/complaintSurvey'

export default {
  name: 'ComplaintStep',
  data() {
    return {
      idComplaintBill: '',
      drawer: false,
      stepList: [],
      timeString: ''
    }
  },
  methods: {
    // 获取脚印
    getComplaintStep() {
      const _that = this
      _that.drawer = true
      var data = {
        id: _that.idComplaintBill
      }
      // console.log(data);
      getComplaintBillStepList(data).then(response => {
        // console.log(response)
        const data = response.data
        _that.stepList = data
      }).catch(err => {
        _that.$message.error(err)
      })
    }
  }
}
</script>

<style scoped>

</style>
