|
@@ -78,7 +78,7 @@
|
|
</el-col>
|
|
</el-col>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
</el-row>
|
|
</el-row>
|
|
- <el-table v-loading="loading" :data="tableData">
|
|
|
|
|
|
+ <el-table v-loading="loading" :data="tableData" @sort-change="sortChannelId">
|
|
<el-table-column label="商品ID" prop="goodsId" width="60" />
|
|
<el-table-column label="商品ID" prop="goodsId" width="60" />
|
|
<el-table-column label="商品图片" prop="picUrl" align="center">
|
|
<el-table-column label="商品图片" prop="picUrl" align="center">
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
@@ -93,32 +93,36 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="商品名称" prop="title" />
|
|
<el-table-column label="商品名称" prop="title" />
|
|
- <el-table-column label="价格" prop="value">
|
|
|
|
|
|
+ <el-table-column label="价格" prop="value" sortable="custom">
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
¥{{$numberFormat(row.value)}}
|
|
¥{{$numberFormat(row.value)}}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="采购价格" prop="cost">
|
|
|
|
|
|
+ <el-table-column label="采购价格" prop="cost" sortable="custom" min-width="100px">
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
¥{{$numberFormat(row.cost)}}
|
|
¥{{$numberFormat(row.cost)}}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="是否支持兑换" prop="exchangeShow">
|
|
|
|
|
|
+ <el-table-column label="是否支持兑换" prop="exchangeShow" min-width="100px">
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
<span v-if="row.exchangeShow == '1'">支持</span>
|
|
<span v-if="row.exchangeShow == '1'">支持</span>
|
|
<span v-if="row.exchangeShow == '0'">不支持</span>
|
|
<span v-if="row.exchangeShow == '0'">不支持</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="兑换盲豆数量" prop="exchangePrice" />
|
|
|
|
- <el-table-column label="销量" prop="exchangedQty" />
|
|
|
|
- <el-table-column label="库存" prop="quantity" />
|
|
|
|
|
|
+ <el-table-column label="兑换盲豆数量" prop="exchangePrice" sortable="custom" min-width="125" />
|
|
|
|
+ <el-table-column label="销量" prop="exchangedQty" sortable="custom" />
|
|
|
|
+ <el-table-column label="库存" prop="quantity" sortable="custom" />
|
|
<el-table-column label="状态" prop="status">
|
|
<el-table-column label="状态" prop="status">
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
<el-tag :type="JSON.parse(row.status).value === 'on' ? 'success' : 'info'">{{ JSON.parse(row.status).desc }}</el-tag>
|
|
<el-tag :type="JSON.parse(row.status).value === 'on' ? 'success' : 'info'">{{ JSON.parse(row.status).desc }}</el-tag>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <!-- <el-table-column label="排序" prop="sort" /> -->
|
|
|
|
- <el-table-column fixed="right" align="right" label="操作" width="140">
|
|
|
|
|
|
+ <el-table-column label="排序" prop="sortWeight" sortable="custom" align="center" width="140px">
|
|
|
|
+ <template slot-scope="{row, $index}">
|
|
|
|
+ <el-input-number v-model="row.sortWeight" @change="handleSortChange($index,row.sortWeight)" controls-position="right" size="small"></el-input-number>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column fixed="right" align="center" label="操作" width="140">
|
|
<template slot-scope="{row}">
|
|
<template slot-scope="{row}">
|
|
<!-- <el-button v-hasPermi="['business:goods:query']" type="text">查看</el-button> -->
|
|
<!-- <el-button v-hasPermi="['business:goods:query']" type="text">查看</el-button> -->
|
|
<el-button v-hasPermi="['business:goods:edit']" type="text" @click="$router.push('/goods/edit?id=' + row.goodsId)">编辑</el-button>
|
|
<el-button v-hasPermi="['business:goods:edit']" type="text" @click="$router.push('/goods/edit?id=' + row.goodsId)">编辑</el-button>
|
|
@@ -133,7 +137,7 @@
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import { publicFileGetUrl } from "@/api/common"
|
|
import { publicFileGetUrl } from "@/api/common"
|
|
-import { getGoodsList, delGoods, setGoodsStatus } from '@/api/business/goods'
|
|
|
|
|
|
+import { getGoodsList, delGoods, setGoodsStatus, setTableData} from '@/api/business/goods'
|
|
import { goodsCategoryItems } from '@/api/business/category'
|
|
import { goodsCategoryItems } from '@/api/business/category'
|
|
import { goodsTagItems } from '@/api/business/tag'
|
|
import { goodsTagItems } from '@/api/business/tag'
|
|
import { accMul } from '@/utils/util'
|
|
import { accMul } from '@/utils/util'
|
|
@@ -144,7 +148,7 @@ export default {
|
|
IMG_URL: publicFileGetUrl,
|
|
IMG_URL: publicFileGetUrl,
|
|
loading: false,
|
|
loading: false,
|
|
showSearch: true,
|
|
showSearch: true,
|
|
- queryParams: {},
|
|
|
|
|
|
+ queryParams: {pageNum: 1, pageSize: 20, orderByColumn: '', isAsc: '',},
|
|
tableData: [],
|
|
tableData: [],
|
|
total: 0,
|
|
total: 0,
|
|
goodsCategoryItemsList: [],
|
|
goodsCategoryItemsList: [],
|
|
@@ -157,6 +161,26 @@ export default {
|
|
this.getGoodsTagItems()
|
|
this.getGoodsTagItems()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ //切换排序
|
|
|
|
+ sortChannelId(row){
|
|
|
|
+ if (row){
|
|
|
|
+ let prop = row.prop == 'commRate' ? ('t1.'+ row.prop) : row.prop;
|
|
|
|
+ this.queryParams.orderByColumn = prop
|
|
|
|
+ this.queryParams.isAsc = row.order=='ascending'?"asc":"desc";
|
|
|
|
+ this.getList()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //步进器修改
|
|
|
|
+ handleSortChange(index,sortWeight){
|
|
|
|
+ this.tableData[index].sortWeight = sortWeight
|
|
|
|
+ let data = {
|
|
|
|
+ goodsId: this.tableData[index].goodsId,
|
|
|
|
+ sortWeight: this.tableData[index].sortWeight
|
|
|
|
+ }
|
|
|
|
+ setTableData(data)
|
|
|
|
+ },
|
|
|
|
+
|
|
getGoodsCategoryItems(){
|
|
getGoodsCategoryItems(){
|
|
goodsCategoryItems({}).then(res => {
|
|
goodsCategoryItems({}).then(res => {
|
|
this.goodsCategoryItemsList = res && res.data
|
|
this.goodsCategoryItemsList = res && res.data
|
|
@@ -172,10 +196,10 @@ export default {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
this.loading = true
|
|
this.loading = true
|
|
- if (reset) {
|
|
|
|
- this.queryParams = { pageNum: 1, pageSize: 20 }
|
|
|
|
- }
|
|
|
|
- getGoodsList('pageNum='+this.queryParams.pageNum + '&pageSize='+this.queryParams.pageSize+'&', {
|
|
|
|
|
|
+ // if (reset) {
|
|
|
|
+ // this.queryParams = { pageNum: 1, pageSize: 20, orderByColumn: '', isAsc: '', }
|
|
|
|
+ // }
|
|
|
|
+ getGoodsList('pageNum='+this.queryParams.pageNum + '&pageSize='+this.queryParams.pageSize+'&orderByColumn='+ this.queryParams.orderByColumn +'&isAsc='+ this.queryParams.isAsc +'&', {
|
|
title: this.queryParams.title,
|
|
title: this.queryParams.title,
|
|
goodsId: this.queryParams.goodsId,
|
|
goodsId: this.queryParams.goodsId,
|
|
categoryId: this.queryParams.categoryId,
|
|
categoryId: this.queryParams.categoryId,
|
|
@@ -190,6 +214,7 @@ export default {
|
|
this.loading = false
|
|
this.loading = false
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
this.tableData = res.rows
|
|
this.tableData = res.rows
|
|
|
|
+ // this.tableData.map()
|
|
this.total = res.total
|
|
this.total = res.total
|
|
}
|
|
}
|
|
}).catch(() => {
|
|
}).catch(() => {
|