|
@@ -0,0 +1,171 @@
|
|
|
|
+<template>
|
|
|
|
+ <div>
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="6">
|
|
|
|
+ <el-input v-model="eicode" placeholder="请输入兑换码"></el-input>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="1">
|
|
|
|
+
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="5">
|
|
|
|
+ <el-button type="primary" @click="search">查询</el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+
|
|
|
|
+ <div v-bind:class="{show: isSearched, hidden:!isSearched}" class="ecdate">
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="12" class="eccontent">
|
|
|
|
+ <el-card class="box-card">
|
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
|
+ <span>批次信息</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="8">商品名称:</el-col>
|
|
|
|
+ <el-col :span="16">{{exchangecode.gname}}</el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row class="dataitem">
|
|
|
|
+ <el-col :span="8">说明:</el-col>
|
|
|
|
+ <el-col :span="16">{{exchangecode.remark}}</el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row class="dataitem">
|
|
|
|
+ <el-col :span="8">创建人:</el-col>
|
|
|
|
+ <el-col :span="16">{{exchangecode.cuname}}</el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row class="dataitem">
|
|
|
|
+ <el-col :span="8">生成数量:</el-col>
|
|
|
|
+ <el-col :span="16">{{exchangecode.num}}</el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row class="dataitem">
|
|
|
|
+ <el-col :span="8">状态:</el-col>
|
|
|
|
+ <el-col :span="16">
|
|
|
|
+ <template v-if="exchangecode.status === 1">
|
|
|
|
+ <p class="online">启用</p>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-else>
|
|
|
|
+ <p class="offline">禁用</p>
|
|
|
|
+ </template>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row class="dataitem">
|
|
|
|
+ <el-col :span="8">截止日期:</el-col>
|
|
|
|
+ <el-col :span="16">{{exchangecode.endtime}}</el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ </el-card>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12" class="eccontent">
|
|
|
|
+ <el-card class="box-card">
|
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
|
+ <span>兑换码信息</span>
|
|
|
|
+ </div>
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="8">兑换码:</el-col>
|
|
|
|
+ <el-col :span="16">{{item.eicode}}</el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row class="dataitem">
|
|
|
|
+ <el-col :span="8">密码:</el-col>
|
|
|
|
+ <el-col :span="16">{{item.eipwd}}</el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row class="dataitem">
|
|
|
|
+ <el-col :span="8">使用状态:</el-col>
|
|
|
|
+ <el-col :span="16">
|
|
|
|
+ <template v-if="item.status === 1">
|
|
|
|
+ <p class="online">已使用</p>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-else>
|
|
|
|
+ <p class="offline">未使用</p>
|
|
|
|
+ </template>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row class="dataitem">
|
|
|
|
+ <el-col :span="8">使用时间:</el-col>
|
|
|
|
+ <el-col :span="16">{{item.utime}}</el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row class="dataitem">
|
|
|
|
+ <el-col :span="8">使用信息:</el-col>
|
|
|
|
+ <el-col :span="16">{{item.extend}}</el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </el-card>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+<script>
|
|
|
|
+import { timeFormater } from '../../../util'
|
|
|
|
+export default {
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ eicode: '',
|
|
|
|
+ exchangecode: {},
|
|
|
|
+ item: {},
|
|
|
|
+ isSearched: false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ endTimeFormat(row) {
|
|
|
|
+ return timeFormater(row.endtime)
|
|
|
|
+ },
|
|
|
|
+ utimeFormat(row) {
|
|
|
|
+ if (row.utime === 0) {
|
|
|
|
+ return '-'
|
|
|
|
+ } else {
|
|
|
|
+ return timeFormater(row.utime)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ utimeFormat(row) {
|
|
|
|
+ if (row.utime === 0) {
|
|
|
|
+ return '-'
|
|
|
|
+ } else {
|
|
|
|
+ return timeFormater(row.utime)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ search: function() {
|
|
|
|
+ this.$http
|
|
|
|
+ .echangeCodeGetItemdetail({ eicode: this.eicode }, this)
|
|
|
|
+ .then(res => {
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
+ let exchangecode = res.obj.exchangecode
|
|
|
|
+ exchangecode.endtime = this.endTimeFormat(exchangecode)
|
|
|
|
+ this.exchangecode = res.obj.exchangecode
|
|
|
|
+
|
|
|
|
+ let item = res.obj.item
|
|
|
|
+ item.utime = this.utimeFormat(item)
|
|
|
|
+ this.item = item
|
|
|
|
+ this.isSearched = true
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+<style>
|
|
|
|
+.online {
|
|
|
|
+ color: #67c23a;
|
|
|
|
+}
|
|
|
|
+.offline {
|
|
|
|
+ color: #f56c6c;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.ecdate {
|
|
|
|
+ margin-top: 20px;
|
|
|
|
+}
|
|
|
|
+.dataitem {
|
|
|
|
+ margin-top: 10px;
|
|
|
|
+}
|
|
|
|
+.eccontent {
|
|
|
|
+ padding: 10px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.show {
|
|
|
|
+ display: block;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.hidden {
|
|
|
|
+ display: none;
|
|
|
|
+}
|
|
|
|
+</style>
|