element,循环数据的使用

<!--
 * @Author: ljw
 * @LastEditors: ljw
 * @Date: 2019-11-05 15:11:39
 * @LastEditTime: 2019-11-09 13:00:49
 * @Description: 服务记录详情的变更记录Item
 -->
<template>
  <div v-loading="addLoading" class="item-box">
    <!-- <h3 class="title">变更记录</h3> -->
    <div>
      <el-timeline :reverse="false">
        <el-timeline-item
          v-for="(item, index) in listhis"
          :key="index"
          placement="top">
          <p class="time-line-p">{{ item.updatetimestamp | utcDateConvert('YYYY-MM-DD HH:mm') }}</p>
          <p class="time-line-p">
            <span v-if="item.lastobjid === '' " >{{ item.createdby_value }}</span>
             <span v-if="item.lastobjid !== '' ">{{ item.updateby_value }}</span>
            &nbsp;&nbsp;
            <span v-if="item.lastobjid === '' " >新增了服务记录:</span>
            <span v-if="item.lastobjid !== '' ">修改了服务记录:</span>
            <span v-if="item.lastobjid !== '' " class="toLink" @click="showContent(item, index)"> 查看详情</span>
          </p>
        </el-timeline-item>
      </el-timeline>
    </div>
    <!-- 2. 上传附件弹窗 -->
    <el-dialog v-loading="contentLoading" :visible.sync="contentVisible" title="变更记录详情" class="contentDialog" width="70%">
      <DetailInfo :data="contentData"/>
    </el-dialog>
  </div>
</template>

<script>
import { fetchPost } from 'sinitek-eccrm/src/api/mvcquery'
import DetailInfo from './detailInfo'
export default {
  components: {
    DetailInfo
  },
  props: {
    data: {
      type: Object,
      default: () => {
        return {}
      }
    },
    queryId: {
      type: [String, Number],
      default: ''
    }
  },
  data() {
    return {
      addLoading: false,
      listhis: [],
      contentVisible: false,
      contentLoading: false,
      contentData: {},
      listQuery: {
        total: 0,
        page: 1,
        limit: 10
      }
    }
  },
  mounted() {
    setTimeout(() => {
      this.getListhis()
    }, 300)
  },
  methods: {
    getListhis() {
      if (this.queryId) {
        this.addLoading = true
        const orderBy = 'createtimestamp desc'
        // fetchPost('activitylog/list', [`activity_id=${this.queryId}`, `viewid=469`], this.listQuery, orderBy)
        fetchPost('activity/getactivityhis', [`objid=${this.queryId}`])
          .then(result => {
            this.addLoading = false
            this.listhis = (result.data.value) || []
          }).catch(err => {
            this.addLoading = false
            this.$notify.error({ title: '错误', message: err.msg })
          })
      }
    },
    showContent(item, key) {
      this.contentVisible = true
      this.contentLoading = true
      const url = 'activity/getactivityhisDetail'
      fetchPost(url, [`objid=${item.objid}`]).then(result => {
        this.contentLoading = false
        this.contentData = result.data
      }).catch(err => {
        this.contentLoading = false
        this.$notify.error({ title: '错误', message: err.msg })
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.item-box{
  background: #fff;
  margin-bottom: 20px;
  .contentDialog{
    /deep/.el-dialog{
      width: 950px;
    }
  }
  /deep/.el-timeline{
    padding-left: 0;
  }
  .time-line-p{
    margin: 0 0 10px 0;
  }
}
</style>

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值