|
@@ -50,7 +50,7 @@
|
|
|
:max-height="vheight">
|
|
|
<el-table-column label="商品货号" prop="product_code" min-width="140"></el-table-column>
|
|
|
<el-table-column label="农产品名字" prop="product_title" min-width="200" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column label="农产品描述" prop="product_desc" min-width="200" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column label="农产品描述" prop="product_desc" min-width="200"></el-table-column>
|
|
|
<el-table-column label="商品主图" prop="product_img_url" min-width="100">
|
|
|
<template slot-scope="scope">
|
|
|
<el-image
|
|
@@ -62,7 +62,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="分类" prop="product_category_name"></el-table-column>
|
|
|
<el-table-column label="商品品牌" prop="product_brand_name"></el-table-column>
|
|
|
- <el-table-column label="商品规格" prop="product_spec"></el-table-column>
|
|
|
+ <el-table-column label="商品规格" prop="product_spec" min-width="200" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column label="单位" prop="product_unit"></el-table-column>
|
|
|
<el-table-column label="批发价(元)" prop="product_all_price" min-width="100">
|
|
|
<template slot-scope="scope">{{ scope.row.product_all_price | fen2Yuan }}</template>
|
|
@@ -75,20 +75,27 @@
|
|
|
<template slot-scope="scope">{{ scope.row.product_sale_at > 0 ? '现货' : '预售' }}</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="发售时间" prop="product_sale_at" min-width="160">
|
|
|
- <template slot-scope="scope">{{ scope.row.product_sale_at > 0 ? scope.row.product_sale_at : '' }}</template>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <template v-if="scope.row.product_sale_at > 0">
|
|
|
+ {{ scope.row.product_sale_at * 1000 | parseTime('{y}-{m}-{d} {h}:{i}') }}
|
|
|
+ </template>
|
|
|
+ <template v-else>/</template>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="农户信息" prop="user_id" show-overflow-tooltip>
|
|
|
+ <el-table-column label="农户信息" prop="user_id" min-width="160" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
{{ scope.row.user_id }}{{ scope.row.user_name ? '/' + scope.row.user_name : '' }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="状态" prop="product_status">
|
|
|
- <template slot-scope="scope">{{ getProductStatusText(scope.row.product_status) }}</template>
|
|
|
+ <el-table-column label="状态" prop="product_status" min-width="100">
|
|
|
+ <template slot-scope="scope">{{ getStatusTextAndColor(scope.row).product_status_text }}</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="优秀推荐" prop="product_is_recommend" min-width="160">
|
|
|
<template slot-scope="scope">{{ scope.row.product_is_recommend === 1 ? '是' : '否' }}</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="创建时间" prop="product_check_at" min-width="160"></el-table-column>
|
|
|
+ <el-table-column label="审核通过时间" prop="product_check_at" min-width="160"></el-table-column>
|
|
|
+ <el-table-column label="创建时间" prop="created_at" min-width="160"></el-table-column>
|
|
|
+ <el-table-column label="更新时间" prop="updated_at" min-width="160"></el-table-column>
|
|
|
<el-table-column label="操作" width="120">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button type="text" @click="edit(scope.row)">操作</el-button>
|
|
@@ -111,7 +118,6 @@
|
|
|
v-if="detailsDialog.show"
|
|
|
v-model="detailsDialog.show"
|
|
|
:exData="detailsDialog.exData"
|
|
|
- :arrProductStatus="arrProductStatus"
|
|
|
@success="init"></detail>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -165,6 +171,7 @@ export default {
|
|
|
this.detailsDialog.exData = row
|
|
|
this.detailsDialog.show = true
|
|
|
},
|
|
|
+ // todo 推荐接口报错
|
|
|
del(row) {
|
|
|
this.$confirm('确定要推荐吗', '确认', {
|
|
|
type: 'warning'
|
|
@@ -180,12 +187,32 @@ export default {
|
|
|
}).catch(() => {
|
|
|
})
|
|
|
},
|
|
|
- getProductStatusText(val) {
|
|
|
- const index = this.arrProductStatus.findIndex(item => item.value === val + '')
|
|
|
- if (index > -1) {
|
|
|
- return this.arrProductStatus[index].name
|
|
|
+ getStatusTextAndColor(row) {
|
|
|
+ // product_check_status 0未审核 1审核成功 2审核失败
|
|
|
+ // product_status 0 未上架 1 上架
|
|
|
+
|
|
|
+ const productStatus = row.product_status
|
|
|
+ const productCheckStatus = row.product_check_status
|
|
|
+ let color = 'col-0'
|
|
|
+ let text = ''
|
|
|
+
|
|
|
+ if (productCheckStatus === 0) {
|
|
|
+ color = 'col-1'
|
|
|
+ text = '审核中'
|
|
|
+ } else if (productCheckStatus === 2) {
|
|
|
+ color = 'col-3'
|
|
|
+ text = '审核未通过'
|
|
|
+ } else if (productCheckStatus === 1 && productStatus === 1) {
|
|
|
+ color = 'col-2'
|
|
|
+ text = '已上架'
|
|
|
+ } else if (productCheckStatus === 1 && productStatus === 0) {
|
|
|
+ text = '未上架'
|
|
|
+ }
|
|
|
+
|
|
|
+ return {
|
|
|
+ product_status_text: text,
|
|
|
+ product_status_color: color
|
|
|
}
|
|
|
- return ''
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|