Commit ea5c74a6 authored by yaya's avatar yaya

添加拍品管理拍卖专场

parent 910ed931
...@@ -53,3 +53,28 @@ export function irregularOff(data) { ...@@ -53,3 +53,28 @@ export function irregularOff(data) {
}) })
} }
/**
* 转拍品
* @param data
* @returns {*}
*/
export function collectorItemConvertToAuction(data) {
return request({
url: '/supplierItem/collectorItemConvertToAuction',
method: 'post',
data
})
}
/**
* 转拍品
* @param data
* @returns {*}
*/
export function findAuctionList(data) {
return request({
url: '/supplierItem/findAuctionList',
method: 'post',
data
})
}
...@@ -469,11 +469,61 @@ export const asyncRouterMap = [ ...@@ -469,11 +469,61 @@ export const asyncRouterMap = [
meta: { meta: {
perms: [], perms: [],
title: '用户藏品', title: '用户藏品',
icon: 'logininfor',
noCache: true,
keepAlive: true
}
},
{
path: 'auctionList',
component: () => import('@/views/sale/auctionList'),
name: 'auctionList',
meta: {
perms: [],
title: '拍卖管理',
icon: 'swagger',
noCache: true,
keepAlive: true
}
},
{
path: 'auctionDetail',
component: () => import('@/views/sale/auctionDetail'),
name: 'auctionDetail',
meta: {
perms: [],
title: '拍品详情',
icon: 'list', icon: 'list',
noCache: true, noCache: true,
keepAlive: true keepAlive: true
},
hidden: true
},
{
path: 'specialList',
component: () => import('@/views/sale/specialList'),
name: 'specialList',
meta: {
perms: [],
title: '拍卖专场',
icon: 'tab',
noCache: true,
keepAlive: true
} }
}, },
{
path: 'specialAdd',
component: () => import('@/views/sale/specialAdd'),
name: 'specialAdd',
meta: {
perms: [],
title: '添加/编辑专场',
icon: 'list',
noCache: true,
keepAlive: true
},
hidden: true
},
{ {
path: 'itemDetail', path: 'itemDetail',
component: () => import('@/views/sale/itemDetail'), component: () => import('@/views/sale/itemDetail'),
......
<template>
<div class="page_itemDetail">
<el-card class="box-card" style="margin: 16px">
<h3>拍品信息</h3>
<div class="user_info flex" >
<el-form ref="addInviteRef" label-width="120px">
<el-form-item label="商品名称:">
<div>{{ itemContent && itemContent.name || '-' }}</div>
</el-form-item>
<el-form-item label="商品详情:">
<div>{{ itemContent && itemContent.description || '-' }}</div>
</el-form-item>
<el-form-item label="商品图片/视频:">
<div v-if="itemContent && itemContent.imagelist && (typeof itemContent.imagelist === 'object')" class="image">
<div v-for="item in itemContent.imagelist" :key="item.url" class="image_item" @click="handleShowLargeDialog(item.type, item.url, item.videoUrl)">
<img :src="item.url" class="image_item_content" >
<img v-if="item.type === 1" class="image_content_video_icon" src="https://cdn.wanwudezhi.com/static/web-static/image/10651432d8c28651da81753c260d81b3_120x120.png">
</div>
</div>
</el-form-item>
<el-form-item label="起拍价:">
<div>{{ `${itemContent && itemContent.startPrice ? `¥ ${itemContent.startPrice}` : '-'}` }}</div>
</el-form-item>
<el-form-item label="加价幅度:">
<div>{{ `${itemContent && itemContent.addExtent ? `¥ ${itemContent.addExtent}` : '-'}` }}</div>
</el-form-item>
<el-form-item label="理想价:">
<div>{{ `${itemContent && itemContent.distributionPrice ? `¥ ${itemContent.distributionPrice}` : '-'}` }}</div>
</el-form-item>
<el-form-item label="中拍价:">
<div>{{ `${itemContent && itemContent.salePrice ? `¥ ${itemContent.salePrice}` : '-'}` }}</div>
</el-form-item>
</el-form>
</div>
</el-card>
<CheckLargeImageDialog
:show-large-dialog="showLargeDialog"
:image-url="imageUrl"
@closeLargeDialog="showLargeDialog = false"
/>
<CheckVideoDialog
:show-video-dialog="showVideoDialog"
:video-url="videosUrl"
@closeLargeDialog="showVideoDialog = false" />
</div>
</template>
<script>
import { findSaleDetail } from '../../api/business/sale'
import CheckLargeImageDialog from '../goods/components/CheckLargeImageDialog'
import CheckVideoDialog from '../goods/components/CheckVideoDialog'
export default {
name: 'AuctionDetail',
components: { CheckVideoDialog, CheckLargeImageDialog },
data() {
return {
id: '',
itemContent: {},
imageUrl: '',
showLargeDialog: false,
showVideoDialog: false,
videosUrl: ''
}
},
created() {
if (this.$route.query.id == null) {
return
}
this.id = this.$route.query.id
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
this.handleGetDetail(loading)
},
methods: {
/**
* 获取详情
* @param loading
*/
handleGetDetail(loading) {
findSaleDetail({ id: this.id })
.then(response => {
if (loading) {
loading.close()
}
console.log('====', response.data.data)
if (response.data.data) {
this.itemContent = response.data.data
this.itemContent.images = response.data.data.images ? response.data.data.images.split(';') : []
const imageList = []
if (this.itemContent.videos) {
const videoList = this.itemContent.videos.split(',')
if (videoList.length === 2) {
imageList.push({
url: videoList[1],
type: 1,
videoUrl: videoList[0]
})
}
}
if (this.itemContent.images && this.itemContent.images.length > 0) {
for (var i = 0; i < this.itemContent.images.length; i++) {
imageList.push({
url: this.itemContent.images[i],
videoUrl: '',
type: 2
})
}
}
this.itemContent.imagelist = imageList
}
})
.catch(response => {
console.log('====erro', response)
if (loading) {
loading.close()
}
})
},
/**
* 展示大图
* @param imageUrl
*/
handleShowLargeDialog(type, imageUrl, videoUrl) {
if (type === 1) {
this.videosUrl = videoUrl
this.showVideoDialog = true
} else {
this.imageUrl = imageUrl
this.showLargeDialog = true
}
}
}
}
</script>
<style lang="scss" scoped>
.page_itemDetail {
padding: 20px;
.image {
width: 100%;
display: flex;
flex-direction: row;
}
.image_item {
width: 100px;
height: 100px;
margin-right: 10px;
margin-top: 16px;
position: relative;
.image_item_content {
width: 100px;
height: 100px;
}
.image_content_video_icon {
position: absolute;
width: 30px;
height: 30px;
top: 10px;
left: 10px;
}
}
}
/deep/ .el-form-item {
margin-bottom: 0
}
</style>
<template>
<div class="page_consignList">
<div class="filter-container">
<div class="button_left">
<el-input v-model="listQuery.name" clearable class="filter-item" style="width: 200px;" placeholder="请输入标题"/>
<el-select v-model="listQuery.status" placeholder="请选择拍卖状态" class="filter-item" style="width: 200px;" clearable>
<el-option
v-for="item in options"
:key="item.label"
:label="item.label"
:value="item.value"
size="mini"/>
</el-select>
<el-button class="filter-item" type="primary" icon="el-icon-search" style="margin-left: 12px" @click="handleFilter">查找</el-button>
<el-button class="filter-item" type="primary" style="margin-left: 12px" @click="handleReset">重置</el-button>
</div>
</div>
<el-table
v-loading="listLoading"
:data="list"
size="small"
element-loading-text="正在查询中..."
border
fit
highlight-current-row>
<!-- <el-table-column align="center" label="排行" width="100px" type="index" />-->
<el-table-column align="center" min-width="100px" prop="id" label="拍卖ID" fixed="left"/>
<el-table-column align="center" label="封面图" prop="itemImg">
<template slot-scope="scope">
<div class="image_preview">
<el-image
:preview-src-list="scope.row.images.split(';')"
:src="scope.row.images.split(';')[0]"
class="table-td-thumb"
/>
</div>
</template>
</el-table-column>
<el-table-column align="center" label="拍卖名称" min-width="150px" prop="name">
<template slot-scope="scope">
<Line2Hidden :text="scope.row.name" />
</template>
</el-table-column>
<el-table-column align="center" label="起拍价" prop="startPrice">
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.startPrice ? `¥ ${scope.row.startPrice}` : '-'}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="加价幅度" prop="addExtent">
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.addExtent ? `¥ ${scope.row.addExtent}` : '-'}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="理想价格" prop="distributionPrice">
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.distributionPrice ? `¥ ${scope.row.distributionPrice}` : '-'}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="中拍价" prop="salePrice">
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.salePrice ? `¥ ${scope.row.salePrice}` : '-'}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="数量" prop="stock" />
<el-table-column align="center" label="发布者" prop="creatorName" />
<el-table-column align="center" label="更新时间" prop="updateTime" />
<el-table-column align="center" label="状态" prop="statusName" />
<el-table-column align="center" label="操作" width="300" fixed="right">
<template slot-scope="scope">
<el-button
type="primary"
size="mini"
@click="handleToDetail(scope.row)">详情
</el-button>
<el-button
:disabled="(!scope.row.editAble && scope.row.type === 2)"
type="primary"
size="mini"
@click="handleToDetail(scope.row)">编辑
</el-button>
<el-button
:disabled="(!scope.row.editAble && scope.row.type === 2)"
type="danger"
size="mini"
@click="handleDelete(scope.row)">重新上架
</el-button>
</template>
</el-table-column>
</el-table>
<Pagination
v-show="total>0"
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="getList" />
</div>
</template>
<script>
import Line2Hidden from '@/components/line2Hidden'
import Pagination from '@/components/Pagination'
import { updateOnSale, deleteSaleItem, findAuctionList } from '@/api/business/sale'
import { MessageBox } from 'element-ui'
export default {
name: 'SaleList',
components: {
Pagination,
Line2Hidden
},
data() {
return {
itemKey: 0,
options: [{
value: 1,
label: '待上架'
}, {
value: 2,
label: '预展中'
}, {
value: 3,
label: '竞拍中'
}, {
value: 4,
label: '中拍未付款'
}, {
value: 5,
label: '成交'
}, {
value: 6,
label: '中拍未付款流拍'
}, {
value: 7,
label: '无出价流拍'
}],
listLoading: true,
listQuery: {
page: 1,
limit: 20
},
list: [],
total: 0,
// 图文估价
imageValueDialogShow: false,
// 建议寄售价
identifyValueDialogShow: false,
// 货品售出
finishDialogShow: false,
// 寄售凭证
finishSettlementDialogShow: false,
// 取消
cancelConsignDialogShow: false,
currentSaleId: ''
}
},
created() {
this.getList()
},
methods: {
handleFilter() {
this.listQuery.page = 1
this.getList()
},
handleReset() {
this.listQuery = {
page: 1,
limit: 20
}
this.getList()
},
handleSaleSwitch(e, item) {
const params = { id: item.id, isOnSale: e }
updateOnSale(params)
.then(response => {
this.$notify.success({
message: e ? '上架成功' : '下架成功'
})
})
.catch(response => {
item.isOnSale = !e
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定',
type: 'error'
})
})
},
handleCreate() {
this.$router.push({ path: '/sale/saleAdd' })
},
handlerGetList() {
this.listQuery.page = 1
this.getList()
},
handleClick(tab, event) {
this.listQuery.page = 1
this.getList()
},
getList() {
localStorage.setItem('systemState', '')
this.listLoading = true
findAuctionList(this.listQuery).then(response => {
this.list = response.data.data.dataList
this.total = response.data.data.total
this.listLoading = false
}).catch((e) => {
this.list = []
this.total = 0
this.listLoading = false
})
},
/**
* 详情
*/
handleToDetail(item) {
this.$router.push({ path: '/sale/AuctionDetail', query: { id: item.id }})
},
/**
* 删除
*/
handleDelete(item) {
this.$confirm('你确定删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const data = {
id: item.id
}
deleteSaleItem(data).then((res) => {
this.$notify.success({
title: '成功',
message: '删除成功'
})
this.getList()
}).catch(err => {
this.$notify.error({
title: '失败',
message: err.data.errmsg
})
})
})
}
}
}
</script>
<style lang="scss" scoped>
/deep/ .el-switch {
height: 30px;
}
/deep/ .cell {
display: flex;
justify-content: center;
}
.page_consignList {
padding: 20px;
.filter-container {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.image_preview {
width: 60px;
height: 60px;
align-content: center;
justify-content: center;
}
}
</style>
<template>
<el-dialog
v-if="showAddSpecialDialog"
:visible.sync="showAddSpecialDialog"
:before-close="handleCancelConsignDialog"
width="1000px"
height="600px"
title="添加拍品">
<el-table
v-loading="listLoading"
:data="list"
:row-key="getRowKeys"
size="small"
element-loading-text="正在查询中..."
border
fit
height="600"
highlight-current-row
@selection-change="handleSelectionChange">
<el-table-column
:reserve-selection="true"
type="selection"
width="55"/>
<el-table-column align="center" min-width="100px" prop="id" label="拍卖ID" fixed="left"/>
<el-table-column align="center" label="封面图" prop="itemImg">
<template slot-scope="scope">
<div class="image_preview">
<el-image
:preview-src-list="scope.row.images.split(';')"
:src="scope.row.images.split(';')[0]"
class="table-td-thumb"
/>
</div>
</template>
</el-table-column>
<el-table-column align="center" label="拍卖名称" min-width="150px" prop="name">
<template slot-scope="scope">
<Line2Hidden :text="scope.row.name" />
</template>
</el-table-column>
<el-table-column align="center" label="起拍价" prop="startPrice">
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.startPrice ? `¥ ${scope.row.startPrice}` : '-'}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="加价幅度" prop="addExtent">
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.addExtent ? `¥ ${scope.row.addExtent}` : '-'}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="理想价格" prop="distributionPrice">
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.distributionPrice ? `¥ ${scope.row.distributionPrice}` : '-'}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="中拍价" prop="salePrice">
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.salePrice ? `¥ ${scope.row.salePrice}` : '-'}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="数量" prop="stock" />
<el-table-column align="center" label="发布者" prop="creatorName" />
<el-table-column align="center" label="更新时间" prop="updateTime" />
<el-table-column align="center" label="状态" prop="statusName" />
</el-table>
<Pagination
v-show="total>0"
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="getList" />
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancelConsignDialog"> </el-button>
<el-button type="primary" @click="handleCancelValue"> </el-button>
</div>
</el-dialog>
</template>
<script>
import Line2Hidden from '@/components/line2Hidden'
import Pagination from '@/components/Pagination'
import { findAuctionList } from '@/api/business/sale'
export default {
name: 'SelectSpecialDialog',
components: {
Pagination,
Line2Hidden
},
props: {
showAddSpecialDialog: {
type: Boolean,
default: false
},
saleId: {
type: String,
default: ''
}
},
data() {
return {
listLoading: true,
listQuery: {
page: 1,
limit: 20
},
list: [],
total: 0
}
},
created() {
this.getList()
},
methods: {
getRowKeys(row) {
return row.id
},
/**
* 多选
*/
handleSelectionChange(val) {
if (val && val.length > 0) {
this.selectionIdList = val.map((item) => {
return item.id
})
} else {
this.selectionIdList = []
}
console.log('=====选中列表=', this.selectionIdList)
},
handleCancelConsignDialog() {
this.$emit('cancelDialog')
},
getList() {
this.listLoading = true
findAuctionList(this.listQuery).then(response => {
this.list = response.data.data.dataList
this.total = response.data.data.total
this.listLoading = false
}).catch((e) => {
this.list = []
this.total = 0
this.listLoading = false
})
},
handleCancelValue() {
}
}
}
</script>
<style lang="scss" scoped>
.content {
width: 100%;
text-align: center;
}
.image_preview {
width: 60px;
height: 60px;
align-content: center;
justify-content: center;
}
.image {
width: 400px;
height: auto;
}
</style>
...@@ -17,11 +17,18 @@ ...@@ -17,11 +17,18 @@
:key="item.label" :key="item.label"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
size="mini"/> size="mini" />
</el-select> </el-select>
<el-button class="filter-item" type="primary" icon="el-icon-search" style="margin-left: 12px" @click="handleFilter">查找</el-button> <el-button
class="filter-item"
type="primary"
icon="el-icon-search"
style="margin-left: 12px"
@click="handleFilter">查找
</el-button>
<el-button class="filter-item" type="primary" style="margin-left: 12px" @click="handleReset">重置</el-button> <el-button class="filter-item" type="primary" style="margin-left: 12px" @click="handleReset">重置</el-button>
</div> </div>
<el-button size="mini" class="filter-item" type="primary" icon="el-icon-edit" @click="handleMultiAuction">转拍卖</el-button>
</div> </div>
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
...@@ -30,9 +37,13 @@ ...@@ -30,9 +37,13 @@
element-loading-text="正在查询中..." element-loading-text="正在查询中..."
border border
fit fit
highlight-current-row> highlight-current-row
<!-- <el-table-column align="center" label="排行" width="100px" type="index" />--> @selection-change="handleSelectionChange">
<el-table-column align="center" min-width="100px" prop="id" label="商品ID" /> <el-table-column
:selectable="checkboxInit"
type="selection"
width="55"/>
<el-table-column align="center" min-width="100px" prop="id" label="拍品ID" fixed="left"/>
<el-table-column align="center" label="封面图" prop="itemImg"> <el-table-column align="center" label="封面图" prop="itemImg">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <img v-if="scope.row.images" :src="scope.row.images.split(';')[0]" width="60px" height="60px" @click="handleShowPreview(scope.row.images)">--> <!-- <img v-if="scope.row.images" :src="scope.row.images.split(';')[0]" width="60px" height="60px" @click="handleShowPreview(scope.row.images)">-->
...@@ -68,27 +79,30 @@ ...@@ -68,27 +79,30 @@
</el-table-column> </el-table-column>
<el-table-column align="center" min-width="100px" prop="stock" label="库存" /> <el-table-column align="center" min-width="100px" prop="stock" label="库存" />
<el-table-column align="center" min-width="100px" prop="creatorName" label="作者" /> <el-table-column align="center" min-width="100px" prop="creatorName" label="作者" />
<el-table-column align="center" min-width="100px" prop="creatorId" label="用户ID">
<template slot-scope="scope">
<div class="user_self" @click="handleToSelf(scope.row)">{{ scope.row.creatorId }}</div>
</template>
</el-table-column>
<el-table-column align="center" min-width="100px" prop="updateTime" label="更新时间" /> <el-table-column align="center" min-width="100px" prop="updateTime" label="更新时间" />
<el-table-column align="center" min-width="100px" prop="statusName" label="状态"> <el-table-column align="center" min-width="100px" prop="statusName" label="状态">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.statusName || '-'}` }}</span> <span class="tooltip-span">{{ `${scope.row.statusName || '-'}` }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作" width="200"> <el-table-column align="center" label="操作" width="230">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="primary" type="text"
size="mini" size="mini"
@click="handleToDetail(scope.row)">详情 @click="handleToDetail(scope.row)">详情
</el-button> </el-button>
<el-button <el-button
v-if="scope.row.status === 0" v-if="scope.row.status === 0"
type="danger" :disabled="scope.row.isTransformAuction"
type="text"
size="mini"
@click="handleToAuction(scope.row)">转拍卖
</el-button>
<el-button
v-if="scope.row.status === 0"
class="red_button"
type="text"
size="mini" size="mini"
@click="handleSetItemOff(scope.row)">违规下架 @click="handleSetItemOff(scope.row)">违规下架
</el-button> </el-button>
...@@ -105,7 +119,7 @@ ...@@ -105,7 +119,7 @@
@pagination="getList" /> @pagination="getList" />
<ImagePreview <ImagePreview
v-if="isShowPreview" v-if="isShowPreview"
:imglist="imagesPreviewList"/> :imglist="imagesPreviewList" />
</div> </div>
</template> </template>
...@@ -113,7 +127,7 @@ ...@@ -113,7 +127,7 @@
<script> <script>
import Line2Hidden from '@/components/line2Hidden' import Line2Hidden from '@/components/line2Hidden'
import Pagination from '@/components/Pagination' import Pagination from '@/components/Pagination'
import { getSaleList, updateOnSale, deleteSaleItem, irregularOff } from '@/api/business/sale' import { getSaleList, updateOnSale, deleteSaleItem, irregularOff, collectorItemConvertToAuction } from '@/api/business/sale'
import { MessageBox } from 'element-ui' import { MessageBox } from 'element-ui'
export default { export default {
...@@ -159,13 +173,55 @@ export default { ...@@ -159,13 +173,55 @@ export default {
cancelConsignDialogShow: false, cancelConsignDialogShow: false,
isShowPreview: false, isShowPreview: false,
currentSaleId: '', currentSaleId: '',
imagesPreviewList: [] imagesPreviewList: [],
selectionIdList: []
} }
}, },
created() { created() {
this.getList() this.getList()
}, },
methods: { methods: {
/**
* 设置不可选中
*/
checkboxInit(row) {
if (row.status === 0 && !row.isTransformAuction) {
return 1
} else {
return 0
}
},
/**
* 多选
*/
handleSelectionChange(val) {
if (val && val.length > 0) {
this.selectionIdList = val.map((item) => {
return item.id
})
} else {
this.selectionIdList = []
}
console.log('=====选中列表=', this.selectionIdList)
},
/**
* 批量拍卖
*/
handleMultiAuction() {
if (!this.selectionIdList || this.selectionIdList.length === 0) {
this.$notify.warning({
message: '请选择藏品'
})
return
}
this.$confirm('确定将选中的藏品设置成拍卖吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.handleRequestToAuction('')
})
},
handleFilter() { handleFilter() {
this.listQuery.page = 1 this.listQuery.page = 1
this.getList() this.getList()
...@@ -258,6 +314,50 @@ export default { ...@@ -258,6 +314,50 @@ export default {
}) })
}) })
}, },
/**
* 转拍卖
*/
handleToAuction(row) {
this.$confirm('确定将该藏品设置成拍卖吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.handleRequestToAuction(row.id)
})
},
/**
* 转拍品
* @param this.userDetail
*/
handleRequestToAuction(itemId) {
if (!itemId && this.selectionIdList.length === 0) {
return
}
const params = {
itemIdsStr: itemId ? String(itemId) : this.selectionIdList.join(',')
}
collectorItemConvertToAuction(params).then(response => {
if (itemId) {
this.list = this.list.filter((item) => {
if (item.id === itemId) {
item.isTransformAuction = true
return item
}
return item
})
} else {
this.getList()
this.selectionIdList = []
}
this.$notify.success({
message: '转拍品成功'
})
}).catch((e) => {
console.log('===报错=', e)
this.$message.error(e.data && e.data.errmsg || '请求失败, 请重试')
})
},
/** /**
* 违规下架 * 违规下架
* @param this.userDetail * @param this.userDetail
...@@ -307,17 +407,28 @@ export default { ...@@ -307,17 +407,28 @@ export default {
.page_consignList { .page_consignList {
padding: 20px; padding: 20px;
.red_button {
font-weight: 500;
color: #f56c6c;
}
.image_preview { .image_preview {
width: 60px; width: 60px;
height: 60px; height: 60px;
align-content: center; align-content: center;
justify-content: center; justify-content: center;
} }
.filter-auction {
margin-left: auto;
height: 40px;
}
.filter-container { .filter-container {
width: 100%;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
} }
.user_self { .user_self {
color: #409EFF; color: #409EFF;
} }
......
<template>
<div>
<div class="op-container">
<el-button type="primary" @click="handleSave">保存</el-button>
<el-button @click="handleBack">取消</el-button>
</div>
<el-form ref="goods" :rules="rules" :model="goods" label-width="150px">
<el-card class="box-card">
<el-form-item label="专场标题:" prop="name">
<el-input v-model="goods.name" :maxlength="15"/>
</el-form-item>
<el-form-item label="背景图:" prop="images">
<el-upload
:action="uploadPath"
:headers="headers"
:limit="1"
:file-list="itemImages"
:on-exceed="uploadOverrun"
:on-success="handleGalleryUrl"
:on-remove="handleRemove"
multiple
accept=".jpg,.jpeg,.png,.gif"
list-type="picture-card">
<i class="el-icon-plus" />
</el-upload>
<div>建议尺寸2000*1024</div>
</el-form-item>
<el-form-item label="时间:" prop="images">
<el-date-picker
v-model="specialTime"
:picker-options="pickerOptions"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
align="right"/>
</el-form-item>
</el-card>
<el-card class="box-card">
<div class="op-add">
<div>{{ `${total > 0 ? '共计${total}件藏品' : ''}` }}</div>
<el-button type="primary" @click="handleAdd">添加拍品</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
size="small"
element-loading-text="正在查询中..."
border
fit
height="800"
highlight-current-row>
<el-table-column align="center" label="专场标题" min-width="150px" prop="name">
<template slot-scope="scope">
<Line2Hidden :text="scope.row.name" />
</template>
</el-table-column>
<el-table-column align="center" label="竞拍时间" prop="updateTime" />
<el-table-column align="center" label="藏品数" prop="stock" />
<el-table-column align="center" label="状态" prop="stock" />
<el-table-column align="center" label="出价次数" prop="stock" />
<el-table-column align="center" label="更新时间" prop="updateTime" />
<el-table-column align="center" label="操作" width="100">
<template slot-scope="scope">
<el-button
:disabled="(!scope.row.editAble && scope.row.type === 2)"
type="danger"
size="mini"
@click="handleDelete(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<Pagination
v-if="total > 0"
v-show="total>0"
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="getList" />
</el-card>
</el-form>
<SelectSpecialDialog
v-if="isShowAddSpecialDialog"
:show-add-special-dialog="isShowAddSpecialDialog"
@cancelDialog="isShowAddSpecialDialog = false"
@refreshList="handleFilter"
/>
</div>
</template>
<script>
import { uploadPath } from '@/api/business/storage'
import { getToken } from '@/utils/auth'
import Editor from '@tinymce/tinymce-vue'
import { MessageBox } from 'element-ui'
import { createSale, findSaleDetail, updateSale, getSaleList } from '../../api/business/sale'
import UploadFile from './UploadImg'
import draggable from 'vuedraggable'
import SelectSpecialDialog from './components/selectSpecialDialog'
import Pagination from '@/components/Pagination'
export default {
name: 'SaleAdd',
components: { Pagination, SelectSpecialDialog, UploadFile, Editor, draggable },
data() {
return {
isShowAddSpecialDialog: false,
listLoading: false,
listQuery: {
page: 1,
limit: 20
},
list: [],
total: 0,
specialTime: '',
uploadPath,
numType: -1,
goods: {
images: [],
type: 1,
buyLimitNum: 0
},
pickerOptions: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
picker.$emit('pick', [start, end])
}
}, {
text: '最近一个月',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
picker.$emit('pick', [start, end])
}
}, {
text: '最近三个月',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
picker.$emit('pick', [start, end])
}
}]
},
itemImages: [],
rules: {
images: [{ required: true, message: '至少一张图片', trigger: 'blur' }],
name: [{ required: true, message: '商品名称不能为空', trigger: 'blur' }],
stock: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
rebate: [{ required: true, message: '佣金比例不能为空', trigger: 'blur' }],
distributionPrice: [{ required: true, message: '供货价不能为空', trigger: 'blur' }],
buyLimitNum: [{ required: true, message: '限购数量不能为空', trigger: 'blur' }],
auctionStartTime: [{ required: true, message: '开始时间不能为空', trigger: 'blur' }],
auctionEndTime: [{ required: true, message: '截拍时间不能为空', trigger: 'blur' }],
startPrice: [{ required: true, message: '起拍价不能为空', trigger: 'blur' }],
addExtent: [{ required: true, message: '加价幅度不能为空', trigger: 'blur' }]
}
}
},
computed: {
headers() {
return {
'X-Dts-Admin-Token': getToken()
}
}
},
created() {
if (this.$route.query.id == null) {
this.listQuery = false
return
}
this.id = this.$route.query.id
this.timeStr = this.$route.query.timeStr
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
this.handleGetDetail(loading)
this.getList()
},
methods: {
change() {
const newList = []
for (var i = 0; i < this.goods.images.length; i++) {
newList.push({
url: this.goods.images[i]
})
}
this.itemImages = newList
},
previewImg(url) {
window.open(url, '_blank')
},
removeImg(url) {
this.goods.images.forEach((val, key) => {
if (url === val) {
this.goods.images.splice(key, 1)
this.change()
}
})
this.itemImages.forEach((val, key) => {
if (url === val.url) {
this.itemImages.splice(key, 1)
this.change()
}
})
},
handlerNumTypeChange(e) {
console.log('==e==', e)
},
handlerClose(imageList) {
this.itemImages = imageList
},
/**
* 获取详情
* @param loading
*/
handleGetDetail(loading) {
findSaleDetail({ id: this.id })
.then(response => {
if (loading) {
loading.close()
}
console.log('====', response.data.data)
if (response.data.data) {
this.goods = response.data.data
if (!response.data.data.buyLimitNum || response.data.data.buyLimitNum === -1) {
this.goods.buyLimitNum = 0
this.numType = -1
} else {
this.numType = 2
}
this.goods.images = response.data.data.images ? response.data.data.images.split(';') : []
if (this.goods.images && this.goods.images.length > 0) {
for (var i = 0; i < this.goods.images.length; i++) {
this.itemImages.push({
url: this.goods.images[i]
})
}
}
}
})
.catch(response => {
if (loading) {
loading.close()
}
})
},
/**
* 返回
*/
handleBack() {
if (this.$route.query.noGoBack) {
this.$router.push({ path: '/dashboard' })
} else {
this.$router.go(-1)
}
},
/**
* 保存
*/
handleSave() {
if (this.goods.images.length === 0) {
this.$message({
type: 'error',
message: '最少上传1张图片!'
})
return
}
if (this.goods.stock <= 0) {
this.$message({
type: 'error',
message: '库存需大于0!'
})
return
}
if (this.numType === 2 && this.goods.buyLimitNum <= 0) {
this.$message({
type: 'error',
message: '限购数量需大于0!'
})
return
}
if (this.goods.images) {
if (typeof this.goods.images !== 'string') {
this.goods.images = this.goods.images.join(';')
}
} else {
this.goods.images = ''
}
this.$refs.goods.validate((valid) => {
if (valid) {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
if (this.numType === -1) {
this.goods.buyLimitNum = -1
}
if (this.id) {
updateSale(this.goods)
.then(response => {
if (loading) {
loading.close()
}
this.$notify.success({
title: '成功',
message: '编辑成功'
})
this.$router.push({ path: '/sale/saleList' })
})
.catch(response => {
if (loading) {
loading.close()
}
this.goods.images = this.goods.images.split(';') || []
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定',
type: 'error'
})
})
} else {
createSale(this.goods)
.then(response => {
if (loading) {
loading.close()
}
this.$notify.success({
title: '成功',
message: '创建成功'
})
this.$router.push({ path: '/sale/saleList' })
})
.catch(response => {
if (loading) {
loading.close()
}
this.goods.images = this.goods.images.split(';') || []
MessageBox.alert('业务错误:' + response.data.errmsg || '请求失败,请重试', '警告', {
confirmButtonText: '确定',
type: 'error'
})
})
}
}
})
},
/**
* 添加拍品
* @param value
*/
handleAdd() {
this.isShowAddSpecialDialog = true
},
uploadOverrun: function() {
this.$message({
type: 'error',
message: '上传文件个数超出限制!最多上传1张图片!'
})
},
handleGalleryUrl(response, file, fileList) {
if (response.errno === 0) {
this.goods.images.push(response.data.url)
}
},
handleRemove: function(file, fileList) {
var url
if (file.response === undefined) {
url = file.url
} else {
url = file.response.data.url
}
for (var i = 0; i < this.goods.images.length; i++) {
// 这里存在两种情况
// 1. 如果所删除图片是刚刚上传的图片,那么图片地址是file.response.data.url
// 此时的file.url虽然存在,但是是本机地址,而不是远程地址。
// 2. 如果所删除图片是后台返回的已有图片,那么图片地址是file.url
if (this.goods.images[i] === url) {
this.goods.images.splice(i, 1)
}
}
},
handleFilter() {
this.listQuery.page = 1
this.getList()
},
getList() {
localStorage.setItem('systemState', '')
this.listLoading = true
getSaleList(this.listQuery).then(response => {
this.list = response.data.data.dataList
this.total = response.data.data.total
this.listLoading = false
}).catch((e) => {
this.list = []
this.total = 0
this.listLoading = false
})
}
}
}
</script>
<style lang="scss" scoped>
.box-card {
margin: 24px;
}
.item {
display: flex;
}
.op-container {
display: flex;
justify-content: right;
padding: 24px 24px 0;
}
.op-add {
display: flex;
justify-content: space-between;
padding-bottom: 24px;
}
.add_auction {
margin-left: auto;
}
/deep/ .el-form-item__content {
margin-left: 0;
}
/deep/ .syllable_ul {
width: 100%;
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
/deep/ .el-icon-delete {
color: white;
}
.ant-upload-list {
display: flex;
flex-direction: row;
}
.ant-upload-list-item {
display: flex;
flex-direction: row;
width: 146px;
height: 146px;
margin: 0 12px 12px 0;
.ant-upload-list-item-info {
position: relative;
}
.ant-upload-list-item-actions {
width: 146px;
height: 30px;
position: absolute;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
top: 0;
margin-top: 136px;
background: rgba(0, 0, 0, 0.5);
border-radius: 0 0 12px 12px;
}
.ant-upload-list-item-thumbnail {
width: 146px;
height: 146px;
border-radius: 12px;
}
}
</style>
<template>
<div class="page_consignList">
<div class="filter-container">
<div class="button_left"/>
<el-button size="mini" class="filter-item" type="primary" icon="el-icon-edit" @click="handleCreate">新增专场</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
size="small"
element-loading-text="正在查询中..."
border
fit
highlight-current-row>
<el-table-column align="center" label="专场标题" min-width="150px" prop="name">
<template slot-scope="scope">
<Line2Hidden :text="scope.row.name" />
</template>
</el-table-column>
<el-table-column align="center" label="竞拍时间" prop="updateTime" />
<el-table-column align="center" label="藏品数" prop="stock" />
<el-table-column align="center" label="状态" prop="stock" />
<el-table-column align="center" label="出价次数" prop="stock" />
<el-table-column align="center" label="更新时间" prop="updateTime" />
<el-table-column align="center" label="操作" width="300">
<template slot-scope="scope">
<el-button
:disabled="(!scope.row.editAble && scope.row.type === 2)"
type="primary"
size="mini"
@click="handleToDetail(scope.row)">详情
</el-button>
<el-button
:disabled="(!scope.row.editAble && scope.row.type === 2)"
type="primary"
size="mini"
@click="handleToDetail(scope.row)">编辑
</el-button>
<el-button
:disabled="(!scope.row.editAble && scope.row.type === 2)"
type="danger"
size="mini"
@click="handleDelete(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<Pagination
v-show="total>0"
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="getList" />
</div>
</template>
<script>
import Line2Hidden from '@/components/line2Hidden'
import Pagination from '@/components/Pagination'
import { getSaleList, updateOnSale, deleteSaleItem } from '@/api/business/sale'
import { MessageBox } from 'element-ui'
export default {
name: 'SaleList',
components: {
Pagination,
Line2Hidden
},
data() {
return {
itemKey: 0,
options: [{
value: 1,
label: '上架'
}, {
value: 0,
label: '下架'
}],
listLoading: true,
listQuery: {
page: 1,
limit: 20
},
list: [],
total: 0,
// 图文估价
imageValueDialogShow: false,
// 建议寄售价
identifyValueDialogShow: false,
// 货品售出
finishDialogShow: false,
// 寄售凭证
finishSettlementDialogShow: false,
// 取消
cancelConsignDialogShow: false,
currentSaleId: ''
}
},
created() {
this.getList()
},
methods: {
handleFilter() {
this.listQuery.page = 1
this.getList()
},
handleReset() {
this.listQuery = {
page: 1,
limit: 20
}
this.getList()
},
handleSaleSwitch(e, item) {
const params = { id: item.id, isOnSale: e }
updateOnSale(params)
.then(response => {
this.$notify.success({
message: e ? '上架成功' : '下架成功'
})
})
.catch(response => {
item.isOnSale = !e
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定',
type: 'error'
})
})
},
handleCreate() {
this.$router.push({ path: '/sale/specialAdd' })
},
handlerGetList() {
this.listQuery.page = 1
this.getList()
},
handleClick(tab, event) {
this.listQuery.page = 1
this.getList()
},
getList() {
localStorage.setItem('systemState', '')
this.listLoading = true
getSaleList(this.listQuery).then(response => {
this.list = response.data.data.dataList
this.total = response.data.data.total
this.listLoading = false
}).catch((e) => {
this.list = []
this.total = 0
this.listLoading = false
})
},
/**
* 详情
*/
handleToDetail(item) {
this.$router.push({ path: '/sale/saleAdd', query: { id: item.id }})
},
/**
* 删除
*/
handleDelete(item) {
this.$confirm('确定要删除该专场吗?删除后不可恢复。', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const data = {
id: item.id
}
deleteSaleItem(data).then((res) => {
this.$notify.success({
title: '成功',
message: '删除成功'
})
this.getList()
}).catch(err => {
this.$notify.error({
title: '失败',
message: err.data.errmsg
})
})
})
}
}
}
</script>
<style lang="scss" scoped>
/deep/ .el-switch {
height: 30px;
}
/deep/ .cell {
display: flex;
justify-content: center;
}
.page_consignList {
padding: 20px;
.filter-container {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.image_preview {
width: 60px;
height: 60px;
align-content: center;
justify-content: center;
}
}
</style>
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