Commit 33b0b0e4 authored by yaya's avatar yaya

feat: 众筹需求优化

parent 6f71e395
......@@ -226,3 +226,16 @@ export function autoConfigTimeByLot(data) {
})
}
/**
* 开团
* @param data
* @returns {*}
*/
export function collectorItemConvertToGroupPurchase(data) {
return request({
url: '/groupPurchase/collectorItemConvertToGroupPurchase',
method: 'post',
data
})
}
......@@ -71,26 +71,18 @@
<el-form-item label="藏家定价" >
<div style="width: 300px">{{ `${goods && goods.distributionPrice ? `¥ ${goods.distributionPrice}` : '-'}` }}</div>
</el-form-item>
<el-form-item label="售价" prop="valuation">
<el-input v-model="goods.valuation" style="width: 300px">
<el-form-item label="众筹售价" prop="salePrice">
<el-input v-model="goods.salePrice" style="width: 300px" @input="limitInput($event, 1)">
<template slot="prepend">¥</template>
</el-input>
</el-form-item>
</div>
<div class="item">
<el-form-item label="供货价" prop="startPrice">
<el-input v-model="goods.startPrice" style="width: 300px">
<template slot="prepend">¥</template>
</el-input>
</el-form-item>
<el-form-item label="订金" prop="addExtent">
<el-input v-model="goods.addExtent" style="width: 300px">
<el-form-item label="供货价" prop="supplyPrice" @input="limitInput($event, 2)">
<el-input v-model="goods.supplyPrice" style="width: 300px">
<template slot="prepend">¥</template>
</el-input>
</el-form-item>
</div>
<div class="item">
<el-form-item label="团购时间" prop="auctionEndTime">
<el-form-item label="众筹时间" required>
<el-date-picker
v-model="timeValue"
:picker-options="pickerOptions"
......@@ -104,22 +96,42 @@
value-format="yyyy-MM-dd HH:mm:ss"
align="right"/>
</el-form-item>
</div>
<div class="item">
<el-form-item label="团购方式" prop="auctionEndTime">
<el-form-item label="众筹方式" prop="targetNum">
<div>
拼满
<el-input v-model="goods.valuation" style="width: 150px">
众筹件数
<el-input v-model="goods.targetNum" style="width: 150px">
<template slot="append"></template>
</el-input>
<span style="margin-left: 20px">享受</span>
<el-input v-model="goods.valuation" style="width: 150px">
<template slot="append"></template>
</el-input>
</div>
</el-form-item>
<div class="item">
<el-form-item label="是否限购" prop="numType">
<div class="item">
<el-radio-group v-model="numType" @change="handlerNumTypeChange">
<el-radio :label="-1">不限</el-radio>
<el-radio :label="2">自定义</el-radio>
</el-radio-group>
<el-form-item v-if="numType === 2" label="数量" prop="buyLimitNum" label-width="60px">
<el-input-number v-model="goods.buyLimitNum" :step="1" style="width: 200px" />
</el-form-item>
</div>
</el-form-item>
</div>
<el-form-item label="微信群聊" prop="wxQrcode">
<el-upload
:action="uploadPath"
:headers="headers"
:limit="1"
:file-list="itemChatImages"
:on-exceed="uploadChatOverrun"
:on-success="handleChatGalleryUrl"
:on-remove="handleChatRemove"
accept=".jpg,.jpeg,.png,.gif"
list-type="picture-card">
<i class="el-icon-plus" />
</el-upload>
<div>上传二维码</div>
</el-form-item>
</div>
</el-card>
</el-form>
......@@ -148,8 +160,8 @@ export default {
numType: -1,
goods: {
images: [],
type: 1,
buyLimitNum: 0
buyLimitNum: 0,
type: 6
},
timeValue: '',
pickerOptions: {
......@@ -162,15 +174,15 @@ export default {
}
},
itemImages: [],
itemChatImages: [],
rules: {
buyLimitNum: [{ required: true, message: '限购数量不能为空', trigger: 'blur' }],
targetNum: [{ required: true, message: '众筹件数不能为空', trigger: 'blur' }],
images: [{ required: true, message: '至少一张图片', trigger: 'blur' }],
wxQrcode: [{ required: true, message: '请选择微信群聊图片', trigger: 'blur' }],
name: [{ 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' }],
estimatedPrice: [{ required: true, message: '估价不能为空', trigger: 'blur' }],
supplyPrice: [{ required: true, message: '供货价不能为空', trigger: 'blur' }]
supplyPrice: [{ required: true, message: '供货价不能为空', trigger: 'blur' }],
salePrice: [{ required: true, message: '众筹售价不能为空', trigger: 'blur' }]
},
editorInit: {
language: 'zh_CN',
......@@ -218,6 +230,8 @@ export default {
this.handleGetDetail(loading)
},
methods: {
// 选择图片
change() {
const newList = []
for (var i = 0; i < this.goods.images.length; i++) {
......@@ -244,6 +258,22 @@ export default {
}
})
},
uploadChatOverrun: function() {
this.$message({
type: 'error',
message: '上传文件个数超出限制!最多上传1张图片!'
})
},
handleChatGalleryUrl(response, file, fileList) {
if (response.errno === 0) {
// this.goods.images.push(response.data.url)
this.goods.wxQrcode = response.data.url
}
},
handleChatRemove: function(file, fileList) {
this.goods.wxQrcode = ''
},
handlerNumTypeChange(e) {
console.log('==e==', e)
},
......@@ -306,10 +336,18 @@ export default {
})
return
}
if (this.goods.stock <= 0) {
if (this.goods.images) {
if (typeof this.goods.images !== 'string') {
this.goods.images = this.goods.images.join(';')
}
} else {
this.goods.images = ''
}
if (!this.timeValue || this.timeValue.length === 0) {
this.$message({
type: 'error',
message: '库存需大于0!'
message: '请选择团购时间!'
})
return
}
......@@ -320,14 +358,8 @@ export default {
})
return
}
if (this.goods.images) {
if (typeof this.goods.images !== 'string') {
this.goods.images = this.goods.images.join(';')
}
} else {
this.goods.images = ''
}
this.goods.groupPurchaseStartTime = this.timeValue[0]
this.goods.groupPurchaseEndTime = this.timeValue[1]
this.$refs.goods.validate((valid) => {
if (valid) {
const loading = this.$loading({
......@@ -336,9 +368,6 @@ export default {
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 => {
......@@ -349,14 +378,14 @@ export default {
title: '成功',
message: '编辑成功'
})
this.$router.push({ path: '/sale/auctionList' })
this.$router.push({ path: '/sale/groupList' })
})
.catch(response => {
if (loading) {
loading.close()
}
this.goods.images = this.goods.images.split(';') || []
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
MessageBox.alert('业务错误:' + (response.data.errmsg || '请求失败,请重试'), '警告', {
confirmButtonText: '确定',
type: 'error'
})
......@@ -371,7 +400,7 @@ export default {
title: '成功',
message: '创建成功'
})
this.$router.push({ path: '/sale/auctionList' })
this.$router.push({ path: '/sale/groupList' })
})
.catch(response => {
if (loading) {
......@@ -398,11 +427,9 @@ export default {
.replace(/^\./, '0.') // 第四步:如果输入的第一位为小数点,则替换成 0. 实现自动补全
.match(/^\d*(\.?\d{0,2})/g)[0] || '' // 第五步:最终匹配得到结果 以数字开头,只有一个小数点, 而且小数点后面只能有0到2位小数
if (type === 1) {
this.goods.distributionPrice = price
this.goods.salePrice = price
} else if (type === 2) {
this.goods.supplyPrice = price
} else if (type === 3) {
this.goods.rebate = price
}
},
uploadOverrun: function() {
......@@ -451,6 +478,15 @@ export default {
justify-content: center;
padding: 0 24px 24px;
}
/deep/ .syllable_ul {
width: 100%;
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
/deep/ .el-icon-delete {
color: white;
}
/deep/ .el-form-item__content {
margin-left: 0;
}
......@@ -464,11 +500,15 @@ export default {
color: white;
}
/deep/ .el-upload--picture-card {
margin-left: 40px;
margin-left: 0px;
}
/deep/ .el-radio-group {
margin-top: 10px;
}
.ant-upload-list {
display: flex;
flex-direction: row;
margin-left: -40px;
}
.ant-upload-list-item {
......
......@@ -37,36 +37,29 @@
</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>
</el-table-column>
<el-table-column align="center" label="上架类型" prop="type" >
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.type === 1 ? '一口价' : scope.row.type === 3 ? '帖子' : '竞拍'}` }}</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="distributionPrice">
<el-table-column align="center" label="众筹售价" prop="salePrice">
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.distributionPrice ? `¥ ${scope.row.distributionPrice}` : '-'}` }}</span>
<span class="tooltip-span">{{ `${scope.row.salePrice ? `¥ ${scope.row.salePrice}` : '-'}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="定金" prop="supplyPrice">
<el-table-column align="center" label="供货价" prop="supplyPrice">
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.supplyPrice ? `¥ ${scope.row.supplyPrice}` : '-'}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="库存" prop="stock" />
<el-table-column align="center" label="销量" prop="selledNum" />
<el-table-column align="center" label="团购时间" prop="updateTime" />
<el-table-column align="center" label="发布者" prop="updateTime" />
<el-table-column align="center" label="众筹时间" prop="groupPurchaseStartTime" min-width="150px">
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.groupPurchaseStartTime} ~ ${scope.row.groupPurchaseEndTime}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="众筹发起人" prop="creatorName" />
<el-table-column align="center" label="更新时间" prop="updateTime" />
<el-table-column align="center" label="状态" prop="isOnSale" min-width="100px">
<template slot-scope="scope" style="height: 100px">
......@@ -125,7 +118,8 @@ export default {
listLoading: true,
listQuery: {
page: 1,
limit: 20
limit: 20,
type: 6
},
list: [],
total: 0,
......@@ -153,7 +147,8 @@ export default {
handleReset() {
this.listQuery = {
page: 1,
limit: 20
limit: 20,
type: 6
}
this.getList()
},
......
......@@ -30,7 +30,7 @@
<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" @click="handleMultiGroup">开团</el-button>
<el-button size="mini" class="filter-item" type="primary" @click="handleMultiGroup">转众筹</el-button>
<el-button size="mini" class="filter-item" type="primary" icon="el-icon-edit" @click="handleMultiAuction">转拍卖</el-button>
</div>
</div>
......@@ -119,7 +119,7 @@
:disabled="scope.row.isTransformAuction"
type="primary"
size="mini"
@click="handleToGroup(scope.row)">开团
@click="handleToGroup(scope.row)">转众筹
</el-button>
<el-button
v-if="scope.row.status === 0"
......@@ -148,7 +148,7 @@
<script>
import Line2Hidden from '@/components/line2Hidden'
import Pagination from '@/components/Pagination'
import { getSaleList, updateOnSale, deleteSaleItem, irregularOff, collectorItemConvertToAuction } from '@/api/business/sale'
import { getSaleList, updateOnSale, deleteSaleItem, irregularOff, collectorItemConvertToAuction, collectorItemConvertToGroupPurchase } from '@/api/business/sale'
import { MessageBox } from 'element-ui'
export default {
......@@ -253,12 +253,12 @@ export default {
})
return
}
this.$confirm('确定将选中的藏品开启团购吗?', '提示', {
this.$confirm('确定将选中的藏品转众筹吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.handleRequestToAuction('')
this.handleRequestToGroup('')
})
},
handleFilter() {
......@@ -374,7 +374,7 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.handleRequestToAuction(row.id)
this.handleRequestToGroup(row.id)
})
},
/**
......@@ -388,7 +388,7 @@ export default {
const params = {
itemIdsStr: itemId ? String(itemId) : this.selectionIdList.join(',')
}
collectorItemConvertToAuction(params).then(response => {
collectorItemConvertToGroupPurchase(params).then(response => {
if (itemId) {
this.list = this.list.filter((item) => {
if (item.id === itemId) {
......@@ -402,7 +402,7 @@ export default {
this.selectionIdList = []
}
this.$notify.success({
message: '拍品成功'
message: '众筹成功'
})
}).catch((e) => {
console.log('===报错=', e)
......
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