Commit dae2818b authored by yaya's avatar yaya

feat:添加重新上拍功能

parent 9a9fe6f6
......@@ -77,6 +77,18 @@ export function findAuctionList(data) {
data
})
}
/**
* 拍品重新上架
* @param data
* @returns {*}
*/
export function auctionReSale(data) {
return request({
url: '/specialPerformance/reSale',
method: 'post',
data
})
}
/**
* 专场列表
* @param data
......
......@@ -86,7 +86,7 @@
v-if="(scope.row.auctionState === 40 || scope.row.auctionState === 50)"
type="danger"
size="mini"
@click="handleDelete(scope.row)">重新上架
@click="handleResale(scope.row)">重新上架
</el-button>
</template>
</el-table-column>
......@@ -106,7 +106,7 @@
<script>
import Line2Hidden from '@/components/line2Hidden'
import Pagination from '@/components/Pagination'
import { updateOnSale, deleteSaleItem, findAuctionList } from '@/api/business/sale'
import { updateOnSale, findAuctionList, auctionReSale } from '@/api/business/sale'
import { MessageBox } from 'element-ui'
export default {
......@@ -228,21 +228,29 @@ export default {
this.$router.push({ path: '/sale/AuctionAdd', query: { id: item.id }})
},
/**
* 删除
* 重新上架
*/
handleDelete(item) {
this.$confirm('你确定删除吗?', '提示', {
handleResale(row) {
this.$confirm('确定将该拍品重新上架吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const data = {
id: item.id
itemId: row.id
}
deleteSaleItem(data).then((res) => {
auctionReSale(data).then((res) => {
this.list = this.list.filter((item) => {
if (item.id === row.id) {
item.auctionStateName = '待上架'
item.auctionState = 1
return item
}
return item
})
this.$notify.success({
title: '成功',
message: '删除成功'
message: '上架成功'
})
this.getList()
}).catch(err => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment