Commit e3e05bce authored by gaia's avatar gaia

Merge remote-tracking branch 'origin/feature/20240301_1544_sale' into release_pre_20240430150301

parents 21e53a01 722e5638
...@@ -7,4 +7,18 @@ export function requestOrderList(data) { ...@@ -7,4 +7,18 @@ export function requestOrderList(data) {
data data
}) })
} }
export function requestLogisticsList(data) {
return request({
url: '/sysDistributionOrder/getLogisticsList',
method: 'post',
data
})
}
export function requestDelivery(data) {
return request({
url: '/sysDistributionOrder/delivery',
method: 'post',
data
})
}
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
<div class="page_consignList"> <div class="page_consignList">
<div class="filter-container"> <div class="filter-container">
<div class="button_left"> <div class="button_left">
<el-input
v-model="listQuery.distributionOrderId"
clearable
class="filter-item"
style="width: 200px;"
placeholder="请输入订单编号" />
<el-select v-model="listQuery.state" placeholder="请选择订单状态" class="filter-item" style="width: 200px;"> <el-select v-model="listQuery.state" placeholder="请选择订单状态" class="filter-item" style="width: 200px;">
<el-option <el-option
v-for="item in options" v-for="item in options"
...@@ -49,13 +55,28 @@ ...@@ -49,13 +55,28 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="下单用户" prop="buyerName" /> <el-table-column align="center" label="下单用户" prop="buyerName" />
<el-table-column align="center" label="下单时间" prop="createTime" />
<el-table-column align="center" label="收货信息" prop="receiverName" min-width="160px"> <el-table-column align="center" label="收货信息" prop="receiverName" min-width="160px">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.receiverName" >{{ scope.row.receiverName + ',' + scope.row.receiverPhone + ',' + scope.row.receiverAddress }}</span> <span v-if="scope.row.receiverName" >{{ scope.row.receiverName + ',' + scope.row.receiverPhone + ',' + scope.row.receiverAddress }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="介绍人" prop="introducerName">
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.introducerName || '-'}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="订单状态" prop="stateName" /> <el-table-column align="center" label="订单状态" prop="stateName" />
<el-table-column align="center" label="物流公司" prop="logisticsName">
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.logisticsName || '-'}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="快递单号" prop="waybill">
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.waybill || '-'}` }}</span>
</template>
</el-table-column>
<!-- <el-table-column align="center" label="操作" width="300"> <!-- <el-table-column align="center" label="操作" width="300">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
......
...@@ -2,17 +2,39 @@ ...@@ -2,17 +2,39 @@
<div class="page_consignList"> <div class="page_consignList">
<div class="filter-container"> <div class="filter-container">
<div class="button_left"> <div class="button_left">
<el-input
v-model="listQuery.distributionOrderId"
clearable
class="filter-item"
style="width: 200px;"
placeholder="请输入订单编号" />
<el-select v-model="listQuery.state" placeholder="请选择订单状态" class="filter-item" style="width: 200px;"> <el-select v-model="listQuery.state" placeholder="请选择订单状态" class="filter-item" style="width: 200px;">
<el-option <el-option
v-for="item in options" v-for="item in options"
: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-input v-model="listQuery.itemName" clearable class="filter-item" style="width: 200px;" placeholder="请输入藏品名称"/> <el-input
<el-input v-model="listQuery.sellerName" clearable class="filter-item" style="width: 200px;" placeholder="请输入分销商名称"/> v-model="listQuery.itemName"
<el-button class="filter-item" type="primary" icon="el-icon-search" style="margin-left: 12px" @click="handleFilter">查找</el-button> clearable
class="filter-item"
style="width: 200px;"
placeholder="请输入藏品名称" />
<el-input
v-model="listQuery.sellerName"
clearable
class="filter-item"
style="width: 200px;"
placeholder="请输入分销商名称" />
<el-button
class="filter-item"
type="primary"
icon="el-icon-search"
style="margin-left: 12px"
@click="handleFilter">查找
</el-button>
<el-button class="filter-item" @click="resetSearchForm">重置</el-button> <el-button class="filter-item" @click="resetSearchForm">重置</el-button>
</div> </div>
</div> </div>
...@@ -33,7 +55,11 @@ ...@@ -33,7 +55,11 @@
</el-table-column> </el-table-column>
<el-table-column align="center" label="藏品图片" prop="homePageImage"> <el-table-column align="center" label="藏品图片" prop="homePageImage">
<template slot-scope="scope"> <template slot-scope="scope">
<img v-if="scope.row.homePageImage && scope.row.homePageImage.url" :src="scope.row.homePageImage.url" width="60px" height="60px"> <img
v-if="scope.row.homePageImage && scope.row.homePageImage.url"
:src="scope.row.homePageImage.url"
width="60px"
height="60px">
</template> </template>
</el-table-column> </el-table-column>
...@@ -49,29 +75,37 @@ ...@@ -49,29 +75,37 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="下单用户" prop="buyerName" /> <el-table-column align="center" label="下单用户" prop="buyerName" />
<el-table-column align="center" label="下单时间" prop="createTime" />
<el-table-column align="center" label="收货信息" prop="receiverName" min-width="160px"> <el-table-column align="center" label="收货信息" prop="receiverName" min-width="160px">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.receiverName" >{{ scope.row.receiverName + ',' + scope.row.receiverPhone + ',' + scope.row.receiverAddress }}</span> <span v-if="scope.row.receiverName">{{
scope.row.receiverName + ',' + scope.row.receiverPhone + ',' + scope.row.receiverAddress
}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="订单状态" prop="stateName" /> <el-table-column align="center" label="订单状态" prop="stateName" />
<!-- <el-table-column align="center" label="操作" width="300"> <el-table-column align="center" label="物流公司" prop="logisticsName">
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.logisticsName || '-'}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="快递单号" prop="waybill">
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.waybill || '-'}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
:disabled="(!scope.row.editAble && scope.row.type === 2)" v-if="scope.row.state === 10"
type="primary" type="primary"
size="mini" size="mini"
@click="handleToDetail(scope.row)">编辑 @click="handleToSend(scope.row)">发货
</el-button>
<el-button
:disabled="(!scope.row.editAble && scope.row.type === 2)"
type="danger"
size="mini"
@click="handleDelete(scope.row)">删除
</el-button> </el-button>
<span v-if="scope.row.state !== 10" class="tooltip-span">-</span>
</template> </template>
</el-table-column>--> </el-table-column>
</el-table> </el-table>
...@@ -81,6 +115,35 @@ ...@@ -81,6 +115,35 @@
:page.sync="listQuery.page" :page.sync="listQuery.page"
:limit.sync="listQuery.limit" :limit.sync="listQuery.limit"
@pagination="getList" /> @pagination="getList" />
<el-dialog :visible.sync="sendDialogVisible" title="发货">
<el-form
ref="sendFormRef"
:model="sendForm"
:rules="rules"
status-icon
label-position="left"
label-width="130px"
style="width: 600px; margin-left:50px;">
<el-form-item label="请输入快递单号:" prop="waybill" >
<el-select v-model="sendForm.logisticsCode" placeholder="请选择快的公司" class="filter-item" style="width: 200px;">
<el-option
v-for="item in logisticList"
:key="item.name"
:label="item.name"
:value="item.code"
size="mini" />
</el-select>
</el-form-item>
<el-form-item prop="waybill" label="快递单号:" >
<el-input v-model="sendForm.waybill" placeholder="请输入快递单号" style="width: 200px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="sendDialogVisible = false">取消</el-button>
<el-button type="primary" @click="handleShowSendDialog">确定</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
...@@ -88,7 +151,7 @@ ...@@ -88,7 +151,7 @@
<script> <script>
import Line2Hidden from '@/components/line2Hidden' import Line2Hidden from '@/components/line2Hidden'
import Pagination from '@/components/Pagination' import Pagination from '@/components/Pagination'
import { requestOrderList } from '@/api/business/order' import { requestOrderList, requestLogisticsList, requestDelivery } from '@/api/business/order'
export default { export default {
name: 'SaleOrderList', name: 'SaleOrderList',
...@@ -138,14 +201,57 @@ export default { ...@@ -138,14 +201,57 @@ export default {
finishSettlementDialogShow: false, finishSettlementDialogShow: false,
// 取消 // 取消
cancelConsignDialogShow: false, cancelConsignDialogShow: false,
currentSaleId: '' // 发货
sendDialogVisible: false,
currentSaleId: '',
logisticOptions: [{
value: 1,
label: '待付款'
}, {
value: 10,
label: '待发货'
}, {
value: 20,
label: '待收货'
}, {
value: 30,
label: '售后中'
}, {
value: 80,
label: '退款受理中'
}, {
value: 100,
label: '已完成'
}, {
value: 101,
label: '已取消'
}],
sendForm: {},
logisticList: [],
orderId: '',
rules: {
waybill: [{ required: true, message: '请输入物流单号', trigger: 'blur' }],
logisticsCode: [{ required: true, message: '请选择快递公司', trigger: 'blur' }]
}
} }
}, },
created() { created() {
this.getList() this.getList()
this.getLogisticsList()
}, },
methods: { methods: {
/**
* 获取物流公司列表
*/
getLogisticsList() {
requestLogisticsList().then((response) => {
console.log('==response===', response)
this.logisticList = response.data.data
}).catch((err) => {
console.log('==err===', err)
})
},
resetSearchForm() { resetSearchForm() {
this.listQuery = { this.listQuery = {
page: 1, page: 1,
...@@ -179,6 +285,51 @@ export default { ...@@ -179,6 +285,51 @@ export default {
this.total = 0 this.total = 0
this.listLoading = false this.listLoading = false
}) })
},
/**
* 展示发货弹窗
*/
handleShowSendDialog() {
this.$refs.sendFormRef.validate((valid) => {
if (valid) {
this.sendForm.distributionOrderId = this.orderId
requestDelivery(this.sendForm)
.then(response => {
this.$notify.success({
message: '发货成功'
})
this.list = this.list.filter((item) => {
if (item.distributionOrderId === this.orderId) {
item.stateName = '待收货'
item.state = 20
item.waybill = this.sendForm.waybill
this.logisticList.map((logisticItem) => {
if (logisticItem.code === this.sendForm.logisticsCode) {
item.logisticsName = logisticItem.name
}
})
this.orderId = ''
return item
}
return item
})
this.sendDialogVisible = false
})
.catch(response => {
this.$notify.error({
title: '失败',
message: response.data.errmsg
})
})
}
})
},
/**
* 发货
*/
handleToSend(row) {
this.sendDialogVisible = true
this.orderId = row.distributionOrderId
} }
} }
} }
...@@ -196,6 +347,7 @@ export default { ...@@ -196,6 +347,7 @@ export default {
.page_consignList { .page_consignList {
padding: 20px; padding: 20px;
.filter-container { .filter-container {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
......
...@@ -157,11 +157,10 @@ export default { ...@@ -157,11 +157,10 @@ export default {
updateOnSale(params) updateOnSale(params)
.then(response => { .then(response => {
this.$notify.success({ this.$notify.success({
message: e ? '上架成功' : '下架成功' message: '操作成功'
}) })
}) })
.catch(response => { .catch(response => {
item.isOnSale = !e
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', { MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定', confirmButtonText: '确定',
type: 'error' type: 'error'
......
...@@ -17,20 +17,6 @@ ...@@ -17,20 +17,6 @@
<el-table-column align="center" label="用户名" prop="nickname"/> <el-table-column align="center" label="用户名" prop="nickname"/>
<el-table-column align="center" label="手机号码" prop="mobile"/> <el-table-column align="center" label="手机号码" prop="mobile"/>
<!-- <el-table-column align="center" label="性别" prop="gender">
<template slot-scope="scope">
{{ genderDic[scope.row.gender] }}
</template>
</el-table-column>
<el-table-column align="center" label="生日" prop="birthday"/>
<el-table-column align="center" label="用户等级" prop="userLevel">
<template slot-scope="scope">
{{ levelDic[scope.row.userLevel] }}
</template>
</el-table-column>-->
<el-table-column align="center" label="角色" prop="userLevelName"/> <el-table-column align="center" label="角色" prop="userLevelName"/>
<el-table-column align="center" label="TA的关注" prop="followerNum"/> <el-table-column align="center" label="TA的关注" prop="followerNum"/>
<el-table-column align="center" label="TA的粉丝" prop="fansNum"/> <el-table-column align="center" label="TA的粉丝" prop="fansNum"/>
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
</el-card> </el-card>
<el-card :style="{'margin': '16px','height': list.length < 5 ? '500px' : '1000px'}" class="box-card"> <el-card :style="{'margin': '16px','height': list.length < 5 ? '500px' : '1000px'}" class="box-card">
<el-menu :default-active="defaultActive" class="el-menu-demo" mode="horizontal" @select="handleSelect"> <el-menu :default-active="defaultActive" class="el-menu-demo" mode="horizontal" @select="handleSelect">
<el-menu-item index="0">TA的藏品</el-menu-item>
<el-menu-item index="1">TA的关注</el-menu-item> <el-menu-item index="1">TA的关注</el-menu-item>
<el-menu-item index="2">TA的粉丝</el-menu-item> <el-menu-item index="2">TA的粉丝</el-menu-item>
<el-menu-item index="3">TA的分享</el-menu-item> <el-menu-item index="3">TA的分享</el-menu-item>
...@@ -57,7 +58,69 @@ ...@@ -57,7 +58,69 @@
</div> </div>
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
v-if="defaultActive !== '3'" v-if="defaultActive === '0'"
:data="list"
:fit="true"
:height="list.length < 5 ? 400 : 900"
size="small"
style="margin-top: 20px; padding-bottom: 20px"
element-loading-text="正在查询中..."
border
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" />
<el-table-column align="center" label="封面图" prop="itemImg">
<template slot-scope="scope">
<img v-if="scope.row.images" :src="scope.row.images.split(';')[0]" width="60px" height="60px">
</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="distributionPrice">
<template slot-scope="scope">
<span class="tooltip-span">{{ `¥ ${scope.row.distributionPrice}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="是否出售" prop="isAbleSale" min-width="100px">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isAbleSale"
:active-text="scope.row.isAbleSale === true ? '是' : '否'"
style="display: block"
@change="handleSaleSwitch($event, scope.row)" />
</template>
</el-table-column>
<el-table-column align="center" min-width="100px" prop="stock" label="库存" />
<el-table-column align="center" min-width="100px" prop="updateTime" label="更新时间" />
<el-table-column align="center" min-width="100px" prop="statusName" label="状态" >
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.statusName || '-'}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="200">
<template slot-scope="scope">
<el-button
type="primary"
size="mini"
@click="handleToItemDetail(scope.row)">详情
</el-button>
<el-button
v-if="scope.row.status === 0"
type="danger"
size="mini"
@click="handleSetItemOff(scope.row)">违规下架
</el-button>
</template>
</el-table-column>
</el-table>
<el-table
v-loading="listLoading"
v-if="defaultActive !== '3' && defaultActive !== '0'"
:data="list" :data="list"
:fit="true" :fit="true"
:height="list.length < 5 ? 400 : 900" :height="list.length < 5 ? 400 : 900"
...@@ -100,7 +163,7 @@ ...@@ -100,7 +163,7 @@
:total="total" :total="total"
:page.sync="listQuery.page" :page.sync="listQuery.page"
layout="total, prev, pager, next, jumper" layout="total, prev, pager, next, jumper"
@pagination="getList" /> @pagination="handlePage" />
</div> </div>
</div> </div>
...@@ -110,7 +173,9 @@ ...@@ -110,7 +173,9 @@
<script> <script>
import Pagination from '@/components/Pagination' import Pagination from '@/components/Pagination'
import { fansList, requestUserDetail, updateCollectorPermission, updateAccountState } from '@/api/business/user' import { fansList, requestUserDetail, updateCollectorPermission, updateAccountState } from '@/api/business/user'
import { getSaleList, irregularOff, updateOnSale } from '@/api/business/sale'
import Line2Hidden from '@/components/line2Hidden' import Line2Hidden from '@/components/line2Hidden'
import { MessageBox } from 'element-ui'
export default { export default {
name: 'UserDetail', name: 'UserDetail',
components: { components: {
...@@ -142,7 +207,7 @@ export default { ...@@ -142,7 +207,7 @@ export default {
}, },
list: [], list: [],
total: 0, total: 0,
defaultActive: '1', defaultActive: '0',
userDetail: {}, userDetail: {},
userId: '' userId: ''
} }
...@@ -154,7 +219,8 @@ export default { ...@@ -154,7 +219,8 @@ export default {
} }
this.userId = userId this.userId = userId
this.getDetail() this.getDetail()
this.getList() // this.getList()
this.getItemList()
}, },
methods: { methods: {
...@@ -179,13 +245,21 @@ export default { ...@@ -179,13 +245,21 @@ export default {
this.defaultActive = value this.defaultActive = value
this.listQuery.page = 1 this.listQuery.page = 1
this.listQuery.listType = Number(value) this.listQuery.listType = Number(value)
if (this.defaultActive === '0') {
this.getItemList()
return
}
this.getList() this.getList()
}, },
/** /**
* 开通藏家权限 * Tab选择
*/ */
handleOpen() { handlePage() {
if (this.defaultActive === '0') {
this.getItemList()
return
}
this.getList()
}, },
/** /**
* 获取详情 * 获取详情
...@@ -213,6 +287,63 @@ export default { ...@@ -213,6 +287,63 @@ export default {
this.listLoading = false this.listLoading = false
}) })
}, },
/**
* 获取列表数据
*/
getItemList() {
this.listLoading = true
this.listQuery.creatorId = this.userId
this.listQuery.type = 3
this.listQuery.id = ''
getSaleList(this.listQuery).then(response => {
this.list = response.data.data.dataList
this.total = response.data.data.total
this.listLoading = false
}).catch((e) => {
console.log('========报错=', e)
this.list = []
this.total = 0
this.listLoading = false
})
},
/**
* 藏品详情
*/
handleToItemDetail(item) {
this.$router.push({ path: '/sale/itemDetail', query: { id: item.id }})
},
/**
* 违规下架
* @param this.userDetail
*/
handleSetItemOff(row) {
this.$confirm('是否将该商品违规下架?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const params = {
id: row.id,
state: 1
}
irregularOff(params).then(response => {
this.list = this.list.filter((item) => {
if (item.id === row.id) {
item.statusName = '违规下架'
item.status = 1
return item
}
return item
})
this.$notify.success({
message: '下架成功'
})
}).catch((e) => {
console.log('===报错=', e)
this.$message.error(e.data && e.data.errmsg || '请求失败, 请重试')
})
})
},
handleSetUserState() { handleSetUserState() {
if (!this.userDetail || !this.userDetail.id) { if (!this.userDetail || !this.userDetail.id) {
return return
...@@ -277,6 +408,21 @@ export default { ...@@ -277,6 +408,21 @@ export default {
this.$message.error(e.data && e.data.errmsg || '请求失败, 请重试') this.$message.error(e.data && e.data.errmsg || '请求失败, 请重试')
}) })
}) })
},
handleSaleSwitch(e, item) {
const params = { id: item.id, isOnSale: e }
updateOnSale(params)
.then(response => {
this.$notify.success({
message: '操作成功'
})
})
.catch(response => {
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定',
type: 'error'
})
})
} }
} }
} }
...@@ -292,10 +438,11 @@ export default { ...@@ -292,10 +438,11 @@ export default {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
padding-bottom: 20px; padding-bottom: 20px;
padding-right: 30px; padding-right: 200px;
background: white; background: white;
margin: 0 24px; margin: 0 24px;
z-index: 1000; z-index: 1000;
box-sizing: border-box;
} }
.detail_button { .detail_button {
text-align: end; text-align: end;
...@@ -354,4 +501,7 @@ export default { ...@@ -354,4 +501,7 @@ export default {
/deep/ .el-form-item { /deep/ .el-form-item {
margin-bottom: 0; margin-bottom: 0;
} }
/deep/ .el-switch {
height: 30px;
}
</style> </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