Commit 33b0b0e4 authored by yaya's avatar yaya

feat: 众筹需求优化

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