Commit 9a9fe6f6 authored by yaya's avatar yaya

功能优化

parent 90127c17
......@@ -90,3 +90,90 @@ export function findSpecialList(data) {
})
}
/**
* 添加专场
* @param data
* @returns {*}
*/
export function addSpecial(data) {
return request({
url: '/specialPerformance/create',
method: 'post',
data
})
}
/**
* 删除专场
* @param data
* @returns {*}
*/
export function deleteSpecial(data) {
return request({
url: '/specialPerformance/delete',
method: 'post',
data
})
}
/**
* 编辑专场
* @param data
* @returns {*}
*/
export function updateSpecial(data) {
return request({
url: '/specialPerformance/update',
method: 'post',
data
})
}
/**
* 专场详情
* @param data
* @returns {*}
*/
export function specialDetail(data) {
return request({
url: '/specialPerformance/findDetail',
method: 'post',
data
})
}
/**
* 专场下拍品
* @param data
* @returns {*}
*/
export function findSpecialListById(data) {
return request({
url: '/specialPerformance/findItemListById',
method: 'post',
data
})
}
/**
* 删除专场下拍品
* @param data
* @returns {*}
*/
export function deleteSpecialItem(data) {
return request({
url: '/specialPerformance/deleteItem',
method: 'post',
data
})
}
/**
* 添加专场下拍品
* @param data
* @returns {*}
*/
export function addSpecialItem(data) {
return request({
url: '/specialPerformance/addItem',
method: 'post',
data
})
}
......@@ -537,6 +537,19 @@ export const asyncRouterMap = [
},
hidden: true
},
{
path: 'specialDetail',
component: () => import('@/views/sale/specialDetail'),
name: 'specialDetail',
meta: {
perms: [],
title: '专场详情',
icon: 'list',
noCache: true,
keepAlive: true
},
hidden: true
},
{
path: 'itemDetail',
component: () => import('@/views/sale/itemDetail'),
......
......@@ -65,7 +65,11 @@
<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="状态" prop="auctionStateName" width="100">
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.auctionStateName || '-'}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="300" fixed="right">
<template slot-scope="scope">
<el-button
......@@ -79,7 +83,7 @@
@click="handleToEdit(scope.row)">编辑
</el-button>
<el-button
:disabled="(!scope.row.editAble && scope.row.type === 2)"
v-if="(scope.row.auctionState === 40 || scope.row.auctionState === 50)"
type="danger"
size="mini"
@click="handleDelete(scope.row)">重新上架
......
......@@ -23,7 +23,7 @@
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">
<div class="image_preview">
<el-image
......@@ -35,7 +35,7 @@
</template>
</el-table-column>
<el-table-column align="center" label="拍卖名称" min-width="150px" prop="name">
<el-table-column align="center" label="拍卖标题" min-width="150px" prop="name">
<template slot-scope="scope">
<Line2Hidden :text="scope.row.name" />
</template>
......@@ -74,7 +74,7 @@
@pagination="getList" />
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancelConsignDialog"> </el-button>
<el-button type="primary" @click="handleCancelValue"> </el-button>
<el-button type="primary" @click="handleSubmit"> </el-button>
</div>
</el-dialog>
</template>
......@@ -82,7 +82,7 @@
<script>
import Line2Hidden from '@/components/line2Hidden'
import Pagination from '@/components/Pagination'
import { findAuctionList } from '@/api/business/sale'
import { findAuctionList, addSpecialItem } from '@/api/business/sale'
export default {
name: 'SelectSpecialDialog',
components: {
......@@ -94,7 +94,7 @@ export default {
type: Boolean,
default: false
},
saleId: {
specialPerformanceId: {
type: String,
default: ''
}
......@@ -145,8 +145,29 @@ export default {
this.listLoading = false
})
},
handleCancelValue() {
handleSubmit() {
if (!this.selectionIdList || this.selectionIdList.length === 0) {
this.$notify.warning({
message: '请选择藏品'
})
return
}
const params = {
itemIds: this.selectionIdList.join(','),
specialPerformanceId: this.specialPerformanceId
}
addSpecialItem(params).then(response => {
this.$notify.success({
message: '添加拍品成功'
})
this.$emit('refreshList')
this.$emit('cancelDialog')
this.listLoading = false
}).catch((e) => {
this.list = []
this.total = 0
this.listLoading = false
})
}
}
}
......@@ -158,10 +179,15 @@ export default {
text-align: center;
}
.image_preview {
width: 60px;
width: 90px;
height: 60px;
align-content: center;
justify-content: center;
display: flex;
.table-td-thumb {
width: 60px;
height: 60px;
}
}
.image {
......
......@@ -44,7 +44,7 @@
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" min-width="100px">
<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)">-->
<div class="image_preview">
......@@ -85,24 +85,23 @@
<span class="tooltip-span">{{ `${scope.row.statusName || '-'}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="230">
<el-table-column align="center" label="操作" width="260">
<template slot-scope="scope">
<el-button
type="text"
type="primary"
size="mini"
@click="handleToDetail(scope.row)">详情
</el-button>
<el-button
v-if="scope.row.status === 0"
:disabled="scope.row.isTransformAuction"
type="text"
type="primary"
size="mini"
@click="handleToAuction(scope.row)">转拍卖
</el-button>
<el-button
v-if="scope.row.status === 0"
class="red_button"
type="text"
type="danger"
size="mini"
@click="handleSetItemOff(scope.row)">违规下架
</el-button>
......
This diff is collapsed.
<template>
<div class="page_itemDetail">
<el-card class="box-card" style="margin: 16px">
<div class="user_info flex" >
<el-form ref="addInviteRef" label-width="120px">
<el-form-item label="专场标题:">
<div>{{ itemContent && itemContent.title || '-' }}</div>
</el-form-item>
<el-form-item label="时间:">
<div>{{ `${itemContent.startTime || '-'} 至 ${itemContent.endTime || '-'}` }}</div>
</el-form-item>
<el-form-item label="商品图片/视频:">
<div v-if="itemContent && itemContent.imageList" 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>
</div>
</el-card>
<el-card v-if="id" class="box-card">
<div class="op-add">
<div class="item_num">{{ `${total > 0 ? `共计${total}件藏品` : ''}` }}</div>
</div>
<el-table
v-loading="listLoading"
:data="list"
size="small"
element-loading-text="正在查询中..."
border
fit
height="600"
highlight-current-row>
<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="creatorName" />
<el-table-column align="center" label="状态" prop="statusName" />
</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>
<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 { findSpecialListById, specialDetail } from '../../api/business/sale'
import CheckLargeImageDialog from '../goods/components/CheckLargeImageDialog'
import CheckVideoDialog from '../goods/components/CheckVideoDialog'
import Line2Hidden from '@/components/line2Hidden'
export default {
name: 'SpecialDetail',
components: { CheckVideoDialog, CheckLargeImageDialog, Line2Hidden },
data() {
return {
id: '',
itemContent: {
imageList: []
},
imageUrl: '',
showLargeDialog: false,
showVideoDialog: false,
videosUrl: '',
listLoading: false,
listQuery: {
page: 1,
limit: 20
},
list: [],
total: 0
}
},
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)
this.getList()
},
methods: {
/**
* 获取详情
* @param loading
*/
handleGetDetail(loading) {
specialDetail({ specialPerformanceId: this.id })
.then(response => {
if (loading) {
loading.close()
}
console.log('====', response.data.data)
if (response.data.data) {
this.itemContent = response.data.data
const list = []
list.push({
url: this.itemContent.backgroundImage,
videoUrl: '',
type: 2
})
this.itemContent.imageList = list
}
})
.catch(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
}
},
getList() {
if (!this.id) {
return
}
localStorage.setItem('systemState', '')
this.listLoading = true
this.listQuery.specialPerformanceId = this.id
findSpecialListById(this.listQuery).then(response => {
debugger
this.list = response.data.data.data.dataList
this.total = response.data.data.data.total
this.listLoading = false
}).catch((e) => {
this.list = []
this.total = 0
this.listLoading = false
})
}
}
}
</script>
<style lang="scss" scoped>
.page_itemDetail {
padding: 20px;
.image_preview {
width: 90px;
height: 60px;
align-content: center;
justify-content: center;
display: flex;
.table-td-thumb {
width: 60px;
height: 60px;
}
}
.op-add {
display: flex;
justify-content: space-between;
align-content: baseline;
padding-bottom: 24px;
.item_num {
font-weight: 600;
padding-top: 15px;
}
}
.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>
......@@ -63,8 +63,7 @@
<script>
import Line2Hidden from '@/components/line2Hidden'
import Pagination from '@/components/Pagination'
import { findSpecialList, updateOnSale, deleteSaleItem } from '@/api/business/sale'
import { MessageBox } from 'element-ui'
import { findSpecialList, deleteSpecial } from '@/api/business/sale'
export default {
name: 'SaleList',
......@@ -117,22 +116,6 @@ export default {
}
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' })
},
......@@ -161,7 +144,7 @@ export default {
* 详情
*/
handleToDetail(item) {
this.$router.push({ path: '/sale/saleAdd', query: { id: item.id }})
this.$router.push({ path: '/sale/specialDetail', query: { id: item.id }})
},
/**
* 删除
......@@ -173,9 +156,9 @@ export default {
type: 'warning'
}).then(() => {
const data = {
id: item.id
specialPerformanceId: item.id
}
deleteSaleItem(data).then((res) => {
deleteSpecial(data).then((res) => {
this.$notify.success({
title: '成功',
message: '删除成功'
......@@ -211,10 +194,15 @@ export default {
justify-content: space-between;
}
.image_preview {
width: 60px;
width: 90px;
height: 60px;
align-content: center;
justify-content: center;
display: flex;
.table-td-thumb {
width: 60px;
height: 60px;
}
}
}
......
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