logistics.vue 2.1 KB
Newer Older
lanbaoming's avatar
lanbaoming committed
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
<template>
  <div>
    <!-- 搜索工作栏 -->
    <el-form ref="queryForm" :model="queryParams" size="small" :inline="true" style="margin-top: 20px;">
      <el-row :gutter="10">
        <el-col :span="24">
          <el-form-item :label="$t('controlorder.orderNo')" prop="orderNo" required :error="$t('postorder.orderNoRules')">
            <el-input v-model="queryParams.orderNo" style="width: 250px;" :placeholder="$t('postorder.orderNoRules')" clearable />
          </el-form-item>
        </el-col>
      </el-row>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ $t('common.search') }}</el-button>
        <el-button icon="el-icon-refresh" @click="resetQuery">{{ $t('common.reload') }}</el-button>
      </el-form-item>
    </el-form>
    <span>{{ $t('orderdetail.activeSecond') }}</span>
    <el-divider />
    <div style="margin-top: 50px;">
      <el-timeline v-if="data && data.length" :reverse="false">
        <el-timeline-item v-for="(activity, index) in data" :key="index" :timestamp="parseTime(activity.businessTime)">
          {{ $l(activity, 'title') }}
          <div :class="{red: !!activity.mark}">{{ $l(activity, 'remarks') }}</div>
        </el-timeline-item>
      </el-timeline>
      <el-result v-else icon="info " :title="$t('orderdetail.noData')" :sub-title="$t('orderdetail.notOrderData')" />
    </div>
  </div>
</template>

<script>
import { getLogistics } from '@/api/order'
import { parseTime } from '@/utils/ruoyi'
export default {
  data() {
    return {
      parseTime,
      reverse: true,
      queryParams: {
        page: 1,
        rows: 10,
        phone: null,
        name: null,
        company: null,
        pid: null
      },
      data: []
    }
  },
  methods: {
    handleQuery() {
      this.$refs['queryForm'].validate(v => {
        if (v) {
          getLogistics(this.queryParams).then(r => {
            this.data = r.data
          })
        }
      })
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.$refs['queryForm'].resetFields()
    }
  }
}
</script>

<style scoped>
.red{
  color:red !important;
}
</style>