Commit ea5e1444 authored by xiami's avatar xiami

新增珍宝仓

parent 0dd09043
No preview for this file type
...@@ -746,6 +746,68 @@ export const asyncRouterMap = [ ...@@ -746,6 +746,68 @@ export const asyncRouterMap = [
} }
] ]
}, },
{
path: '/factory',
component: Layout,
redirect: 'noredirect',
alwaysShow: true,
name: 'finance',
meta: {
title: '珍宝仓',
icon: 'shopping'
},
children: [
{
path: 'platformFinance',
component: () => import('@/views/factory/saleOrderList'),
name: 'platformFinance',
meta: {
perms: [],
title: '入仓订单',
icon: 'drag',
noCache: true,
keepAlive: true
}
},
{
path: 'saleList',
component: () => import('@/views/factory/saleList'),
name: 'saleList',
meta: {
perms: [],
title: '藏品明细',
icon: 'drag',
noCache: true,
keepAlive: true
}
}, {
path: 'factoryOrderDetail',
component: () => import('@/views/factory/factoryOrderDetail'),
name: 'factoryOrderDetail',
meta: {
perms: [],
title: '订单详情',
icon: 'list',
noCache: true,
keepAlive: true
},
hidden: true
},
{
path: 'factorySaleAdd',
component: () => import('@/views/sale/factorySaleAdd'),
name: 'factorySaleAdd',
meta: {
perms: [],
title: '添加/编辑商品',
icon: 'user',
noCache: true,
keepAlive: true
},
hidden: true
}
]
},
/* { /* {
path: '/service', path: '/service',
component: Layout, component: Layout,
......
<template>
<div class="component_uploadImg">
<div class="ant-upload-picture-card-wrapper">
<div class="ant-upload-list">
<draggable
:list="imgList"
:options="{group:'title', animation:150}"
:no-transition-on-drag="true"
class="syllable_ul"
element="ul"
@change="change"
>
<div v-for="(item, index) in imgList" :key="index" class="ant-upload-list-item">
<div class="ant-upload-list-item-info">
<span>
<a :href="item.url" target="_blank" rel="noopener noreferrer" >
<img :src="item.url" class="ant-upload-list-item-thumbnail">
</a>
</span>
</div>
<span class="ant-upload-list-item-actions">
<i class="el-icon-view" @click="previewImg(item.url)"/>
<i class="el-icon-delete" @click="removeImg(item.url)"/>
</span>
</div>
</draggable>
</div>
<el-upload
:action="uploadPath"
:headers="headers"
:limit="9"
:file-list="imgList"
:on-exceed="uploadOverrun"
:on-success="handleGalleryUrl"
:on-remove="handleRemove"
:show-file-list="false"
multiple
accept=".jpg,.jpeg,.png,.gif"
list-type="picture-card">
<i class="el-icon-plus" />
</el-upload>
</div>
</div>
</template>
<script>
import draggable from 'vuedraggable'
import { getToken } from '@/utils/auth'
import { uploadPath } from '@/api/business/storage'
export default {
name: 'UploadFile',
components: { draggable },
props: {
disabled: {
type: Boolean,
default: false
},
productTopImages: {
type: Array,
default() {
return []
}
},
fileType: {
type: String,
default: 'image/jpeg'
}
},
data() {
return {
uploadPath,
/* upHeaders: {
authorization: User.getToken()
},*/
imgList: this.productTopImages || []
}
},
computed: {
headers() {
return {
'X-Dts-Admin-Token': getToken()
}
}
},
methods: {
handleChangeImage(info) {
this.imgList = info.fileList.map((img, index) => {
if (img.response && img.response.result) {
img.url = img.response.result
}
return img
})
this.change()
},
change() {
const list = this.imgList.map(item => {
return item.url // 返回偶数
})
this.$emit('update:productTopImages', list)
},
previewImg(url) {
window.open(url, '_blank')
},
removeImg(url) {
this.imgList.forEach((val, key) => {
if (url === val.url) {
this.imgList.splice(key, 1)
this.change()
}
})
},
uploadOverrun: function() {
this.$message({
type: 'error',
message: '上传文件个数超出限制!最多上传9张图片!'
})
},
handleGalleryUrl(response, file, fileList) {
if (response.errno === 0) {
this.imgList.push({
url: response.data.url,
name: 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.imgList.length; i++) {
// 这里存在两种情况
// 1. 如果所删除图片是刚刚上传的图片,那么图片地址是file.response.data.url
// 此时的file.url虽然存在,但是是本机地址,而不是远程地址。
// 2. 如果所删除图片是后台返回的已有图片,那么图片地址是file.url
if (this.imgList[i] === url) {
this.imgList.splice(i, 1)
}
}
}
}
}
</script>
<style lang="scss" scoped>
/*.component_uploadImg {
.upload_img {
/deep/ .ant-upload-list-picture-card {
display: none;
}
}
/deep/ .ant-upload-picture-card-wrapper {
width: auto;
}
}*/
/deep/ .syllable_ul {
width: 100%;
display: flex;
flex-direction: row;
}
.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: 146px;
position: absolute;
top: 0;
}
.ant-upload-list-item-thumbnail {
width: 146px;
height: 146px;
border-radius: 12px;
}
}
</style>
<template>
<el-dialog
v-if="logisticDialogShow"
:visible.sync="logisticDialogShow"
:before-close="handleCancelLogisticDialog"
width="600px"
height="800px"
title="寄出快递">
<el-form ref="imageValue" :model="logisticForm" :rules="logisticRules">
<el-form-item label="物流公司" label-width="100px" prop="outLogisticsCode">
<el-select v-model="logisticForm.logisticsCode" placeholder="请选择物流公司" style="width: 240px;margin-right: 10px;margin-bottom: 10px">
<el-option
v-for="item in logisticList"
:key="item.code"
:label="item.name"
:value="item.code"/>
</el-select>
</el-form-item>
<el-form-item label="快递单号" label-width="100px" prop="outWaybill">
<el-input
v-model="logisticForm.waybill"
clearable
class="filter-item"
style="width: 240px;margin-right: 10px"
placeholder="请输入快递单号" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancelLogisticDialog">取 消</el-button>
<el-button type="primary" @click="handleLogistic">确 定</el-button>
</div>
</el-dialog>
</template>
<script>
import { MessageBox } from 'element-ui'
import { requestIdentifyDelivery, requestIdentifySendBack, requestLogisticsList, requestDelivery } from '@/api/business/order'
export default {
name: 'ExchangeLogisticIdentifyDialog',
props: {
logisticDialogShow: {
type: Boolean,
default: false
},
distributionOrderId: {
type: String,
default: ''
},
identifyOrderId: {
type: String,
default: ''
},
type: {
type: Number,
default: 1
}
},
data() {
return {
logisticForm: {
logisticsCode: '',
waybill: ''
},
logisticRules: {
logisticsCode: [
{ required: true, message: '请选择物流公司', trigger: 'blur' }
],
waybill: [
{ required: true, message: '请输入快递单号', trigger: 'blur' }
]
},
logisticList: [
{
'code': 'JD',
'name': '京东快递'
},
{
'code': 'SF',
'name': '顺丰快递'
},
{
'code': 'STO',
'name': '申通快递'
},
{
'code': 'YTO',
'name': '圆通快递'
},
{
'code': 'ZTO',
'name': '中通快递'
},
{
'code': 'YD',
'name': '韵达快递'
}
]
}
},
created() {
this.getLogisticsList()
},
methods: {
handleCancelLogisticDialog() {
this.$emit('cancelDialog')
},
/**
* 获取物流公司列表
*/
getLogisticsList() {
requestLogisticsList().then((response) => {
console.log('==response===', response)
this.logisticList = response.data.data
}).catch((err) => {
console.log('==err===', err)
})
},
/**
* 实物评估
*/
handleLogistic() {
const params = { ...this.logisticForm, distributionOrderId: this.distributionOrderId, identifyOrderId: this.identifyOrderId }
this.$refs.imageValue.validate((valid) => {
if (valid) {
if (this.type === 1) {
requestIdentifyDelivery(params)
.then(response => {
this.itemContent = {}
this.logisticForm = {}
this.$notify.success({
message: '发货成功'
})
this.$emit('refreshDelivery')
})
.catch(response => {
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定',
type: 'error'
})
})
} if (this.type === 3) {
requestDelivery(params)
.then(response => {
this.itemContent = {}
this.logisticForm = {}
this.$notify.success({
message: '发货成功'
})
this.$emit('refreshDelivery')
})
.catch(response => {
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定',
type: 'error'
})
})
} else {
requestIdentifySendBack(params)
.then(response => {
this.itemContent = {}
this.logisticForm = {}
this.$notify.success({
message: '退回成功'
})
this.$emit('refreshSendBack')
})
.catch(response => {
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定',
type: 'error'
})
})
}
}
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
width: 100%;
text-align: center;
}
.image {
width: 400px;
height: auto;
}
</style>
<template>
<el-dialog
v-if="showNoPassIdentifyDialogShow"
:visible.sync="showNoPassIdentifyDialogShow"
:before-close="handleCancelConsignDialog"
width="600px"
height="600px"
title="平台鉴定结果">
<el-form ref="cancel" :model="cancelForm" :rules="cancelRules">
<el-form-item label="" label-width="80px" prop="content">
<div>该藏品未通过平台鉴定,请描述原因:</div>
</el-form-item>
<el-form-item label="" label-width="80px" prop="remark">
<el-input
v-model="cancelForm.remark"
:autosize="{ minRows: 8, maxRows: 8}"
style="width: 400px"
maxlength="50"
type="textarea"
show-word-limit
placeholder="该藏品未通过平台鉴定,请描述原因:" />
</el-form-item>
</el-form>
<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 { MessageBox } from 'element-ui'
import { requestIdentify } from '@/api/business/order'
export default {
name: 'NoPassIdentifyDialog',
props: {
showNoPassIdentifyDialogShow: {
type: Boolean,
default: false
},
distributionOrderId: {
type: String,
default: ''
},
identifyOrderId: {
type: String,
default: ''
}
},
data() {
return {
cancelForm: {
remark: ''
},
cancelRules: {
remark: [
{ required: true, message: '原因不能为空', trigger: 'blur' }
]
}
}
},
methods: {
handleCancelConsignDialog() {
this.$emit('cancelDialog')
},
/**
* 取消
*/
handleCancelValue() {
if (this.distributionOrderId) {
const params = { ...this.cancelForm, distributionOrderId: this.distributionOrderId, identifyOrderId: this.identifyOrderId, approved: 0 }
this.$refs.cancel.validate((valid) => {
if (valid) {
requestIdentify(params)
.then(response => {
this.$notify.success({
message: '操作成功'
})
this.cancelForm = {}
this.$emit('refreshItem', this.distributionOrderId)
})
.catch(response => {
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定',
type: 'error'
})
})
}
})
}
}
}
}
</script>
<style lang="scss" scoped>
.content {
width: 100%;
text-align: center;
}
.image {
width: 400px;
height: auto;
}
</style>
<template>
<el-dialog
v-if="logisticDialogShow"
:visible.sync="logisticDialogShow"
:before-close="handleCancelLogisticDialog"
width="600px"
height="800px"
title="寄出快递">
<el-form ref="imageValue" :model="logisticForm" :rules="logisticRules">
<el-form-item label="物流公司" label-width="100px" prop="outLogisticsCode">
<el-select v-model="logisticForm.outLogisticsCode" placeholder="请选择物流公司" style="width: 240px;margin-right: 10px;margin-bottom: 10px">
<el-option
v-for="item in logisticList"
:key="item.code"
:label="item.name"
:value="item.code"/>
</el-select>
</el-form-item>
<el-form-item label="快递单号" label-width="100px" prop="outWaybill">
<el-input
v-model="logisticForm.outWaybill"
clearable
class="filter-item"
style="width: 240px;margin-right: 10px"
placeholder="请输入快递单号" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancelLogisticDialog">取 消</el-button>
<el-button type="primary" @click="handleLogistic">确 定</el-button>
</div>
</el-dialog>
</template>
<script>
import { MessageBox } from 'element-ui'
import { requestIdentifyDelivery, requestIdentifySendBack, requestLogisticsList, requestDelivery} from '@/api/business/order'
export default {
name: 'ReturnLogisticIdentifyDialog',
props: {
logisticDialogShow: {
type: Boolean,
default: false
},
distributionOrderId: {
type: String,
default: ''
},
identifyOrderId: {
type: String,
default: ''
},
type: {
type: Number,
default: 1
}
},
data() {
return {
logisticForm: {
outLogisticsCode: '',
outWaybill: ''
},
logisticRules: {
outLogisticsCode: [
{ required: true, message: '请选择物流公司', trigger: 'blur' }
],
outWaybill: [
{ required: true, message: '请输入快递单号', trigger: 'blur' }
]
},
logisticList: [
{
'code': 'JD',
'name': '京东快递'
},
{
'code': 'SF',
'name': '顺丰快递'
},
{
'code': 'STO',
'name': '申通快递'
},
{
'code': 'YTO',
'name': '圆通快递'
},
{
'code': 'ZTO',
'name': '中通快递'
},
{
'code': 'YD',
'name': '韵达快递'
}
]
}
},
created() {
this.getLogisticsList()
},
methods: {
handleCancelLogisticDialog() {
this.$emit('cancelDialog')
},
/**
* 获取物流公司列表
*/
getLogisticsList() {
requestLogisticsList().then((response) => {
console.log('==response===', response)
this.logisticList = response.data.data
}).catch((err) => {
console.log('==err===', err)
})
},
/**
* 实物评估
*/
handleLogistic() {
const params = { ...this.logisticForm, distributionOrderId: this.distributionOrderId, identifyOrderId: this.identifyOrderId }
this.$refs.imageValue.validate((valid) => {
if (valid) {
if (this.type === 1) {
requestIdentifyDelivery(params)
.then(response => {
this.itemContent = {}
this.logisticForm = {}
this.$notify.success({
message: '发货成功'
})
this.$emit('refreshDelivery')
})
.catch(response => {
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定',
type: 'error'
})
})
} if (this.type === 3) {
requestDelivery(params)
.then(response => {
this.itemContent = {}
this.logisticForm = {}
this.$notify.success({
message: '发货成功'
})
this.$emit('refreshDelivery')
})
.catch(response => {
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定',
type: 'error'
})
})
}
else {
requestIdentifySendBack(params)
.then(response => {
this.itemContent = {}
this.logisticForm = {}
this.$notify.success({
message: '退回成功'
})
this.$emit('refreshSendBack')
})
.catch(response => {
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定',
type: 'error'
})
})
}
}
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
width: 100%;
text-align: center;
}
.image {
width: 400px;
height: auto;
}
</style>
<template>
<div class="exchange_list">
<el-table :data="itemList" size="small" border fit highlight-current-row>
<el-table-column type="expand">
<template slot-scope="props">
<el-form label-position="right" class="table-expand" label-width="100px">
<el-form-item v-if="props.row.images" label="藏品图片:">
<div class="image_list">
<div v-for="pic in props.row.images.split(';')" :key="pic">
<el-image
:preview-src-list="[pic]"
:src="pic"
class="table-td-thumb"
/>
</div>
</div>
</el-form-item>
<el-form-item label="详情:">
<span>{{ props.row.description }}</span>
</el-form-item>
</el-form>
</template>
</el-table-column>
<el-table-column align="center" min-width="200" label="商品ID" prop="itemId"/>
<el-table-column align="center" min-width="200" label="名称" prop="name">
<template slot-scope="scope" >
<Line2Hidden :text="scope.row.name" />
</template>
</el-table-column>
<el-table-column align="center" property="homePageImage" label="图片">
<template slot-scope="scope">
<div v-if="scope.row.images && scope.row.images.split(';').length > 0" class="image_preview">
<el-image
:preview-src-list="[scope.row.images.split(';')[0]]"
:src="scope.row.images.split(';')[0]"
class="table-td-thumb"
/>
</div>
</template>
</el-table-column>
<el-table-column align="center" label="售价" min-width="200" 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="官方估价" min-width="200" prop="officialEstimatedPrice">
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.officialEstimatedPrice ? `¥ ${scope.row.officialEstimatedPrice}` : '-'}` }}</span>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import Line2Hidden from '@/components/line2Hidden'
export default {
name: 'ExchangeItemListView',
components: {
Line2Hidden
},
props: {
itemList: {
type: Array,
default: () => {
return []
}
}
},
data() {
return {
imageUrl: '',
showLargeDialog: false
}
},
methods: {
handleShowLargeDialog(imageUrl) {
this.imageUrl = imageUrl
this.showLargeDialog = true
}
}
}
</script>
<style lang="scss" scoped>
.exchange_list {
padding: 10px;
margin-left: 20px;
}
.table-expand {
margin-left: 10px;
}
.image_list {
display: flex;
flex-direction: row;
}
.table-td-thumb {
width: 60px;
height: 60px;
margin-right: 10px;
}
</style>
<template>
<div class="page_orderDetail">
<div class="detail_left">
<el-card class="box-card" style="margin: 12px 12px 0; height: 180px">
<div class="title">
<div class="title_content">{{ `订单编号:${orderId || '-'}` }}</div>
<el-tag v-if="orderInfo.state === 100" type="success">{{ orderInfo.stateName }}</el-tag>
<el-tag v-else-if="orderInfo.state === 10" type="danger">{{ orderInfo.stateName }}</el-tag>
<el-tag v-else>{{ orderInfo.stateName }}</el-tag>
</div>
<div class="user_info flex">
<el-form ref="addInviteRef" :inline="true" label-width="80px" style="width: 100%">
<el-form-item label="收货信息"/>
</el-form>
<el-form ref="addInviteRef" :inline="true" label-width="80px" style="width: 100%">
<el-form-item label="收件人:" style="width: 45%">
<div>{{ orderInfo.receiverName || '-' }}</div>
</el-form-item>
<el-form-item label="手机号:" style="width: 45%">
<div>{{ orderInfo.receiverPhone || '-' }}</div>
</el-form-item>
</el-form>
<el-form ref="addInviteRef" :inline="true" label-width="80px" style="width: 100%">
<el-form-item label="地址:">
<div>{{ orderInfo.receiverAddress || '-' }}</div>
</el-form-item>
</el-form>
</div>
</el-card>
<el-card class="box-card" style="margin: 12px 12px 0;">
<!-- <div v-for="item in orderInfo.itemInfoVoList" class="item_info">
<img :src="item.defaultImg" width="110px" height="110px">
<div class="item_info_content">
&lt;!&ndash; <Line2Hidden :text="'商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商品标题商…'" />&ndash;&gt;
<div>{{ item.itemName }}</div>
<div class="item_info_content&#45;&#45;sku">材质156mm</div>
<div class="item_info_content&#45;&#45;price">
<div>¥200</div>
<div>x2</div>
</div>
</div>
</div>-->
<el-table
ref="multipleTable"
:data="orderInfo.itemInfoVoList"
size="mini"
element-loading-text="正在查询中..."
border
fit
highlight-current-row>
<el-table-column align="center" label="商品图片" prop="defaultImg">
<template slot-scope="scope">
<!-- <img v-if="scope.row.defaultImg" :src="scope.row.defaultImg" width="40px" height="40px">-->
<el-image
v-if="scope.row.defaultImg"
:preview-src-list="[scope.row.defaultImg]"
:src="scope.row.defaultImg"
class="table-td-thumb"
/>
</template>
</el-table-column>
<el-table-column align="center" label="商品名称" min-width="150px" prop="itemName">
<template slot-scope="scope">
<Line2Hidden v-if="scope.row.itemName" :text="scope.row.itemName || ''" />
</template>
</el-table-column>
<el-table-column align="center" label="单价" min-width="150px" prop="salePrice">
<template slot-scope="scope">
<span class="tooltip-span">{{ `¥ ${scope.row.salePrice}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="规格" min-width="150px" prop="skuName">
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.skuName || '-'}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="数量" prop="skuNum" />
</el-table>
</el-card>
<el-card class="box-card" style="margin: 12px 12px 0; height: auto">
<div class="title">
<div class="title_content">付款信息</div>
</div>
<div class="user_info flex">
<el-form ref="addInviteRef" :inline="true" label-width="100px" style="width: 100%">
<el-form-item label="商品总价:">
<div>{{ `¥${orderInfo.orderAmount || '-'}` }}</div>
</el-form-item>
<el-form-item label="实付金额:">
<div>{{ `¥${orderInfo.payAmount || '-'}` }}</div>
</el-form-item>
<el-form-item label="支付方式:">
<div>{{ orderInfo.payTypeName || '-' }}</div>
</el-form-item>
</el-form>
<el-form ref="addInviteRef" label-width="100px" style="width: 100%">
<el-form-item label="总优惠:">
<div class="discount_price">{{ `-¥${orderInfo.totalDiscountAmount || '-'}` }}</div>
</el-form-item>
<el-form-item label="优惠券:">
<div class="discount_price">{{ `-¥${orderInfo.couponDiscountAmount || '-'}` }}</div>
</el-form-item>
<el-form-item label="官方满减:">
<div class="discount_price">{{ `-¥${orderInfo.activityDiscountAmount || '-'}` }}</div>
</el-form-item>
<el-form-item label="手动优惠:">
<div class="discount_price">{{ `-¥${orderInfo.manualDiscountAmount || '-'}` }}</div>
</el-form-item>
</el-form>
</div>
</el-card>
</div>
<div class="detail_right">
<el-card class="box-card" style="margin: 12px 12px 0; height: 180px">
<div class="title">
<div class="title_content">客户信息</div>
</div>
<div class="user_info flex">
<el-form ref="addInviteRef" label-width="100px" style="width: 100%">
<el-form-item label="用户昵称:">
<div>{{ orderInfo.buyerName || '-' }}</div>
</el-form-item>
<el-form-item label="用户手机号:">
<div>{{ orderInfo.buyerMobile || '-' }}</div>
</el-form-item>
</el-form>
</div>
</el-card>
<el-card class="box-card" style="margin: 12px 12px 0">
<div class="title">
<div class="title_content">备注</div>
</div>
<div class="user_info flex">
<el-form ref="addInviteRef" label-width="100px" style="width: 100%; height: 82px">
<el-form-item label="买家备注:">
<div>{{ orderInfo.remark || '-' }}</div>
</el-form-item>
</el-form>
</div>
</el-card>
<el-card class="box-card" style="margin: 12px 12px 0;">
<div class="title">
<div class="title_content">物流配送</div>
</div>
<div class="user_info flex">
<el-form ref="addInviteRef" label-width="100px" style="width: 100%">
<el-form-item label="配送方式:">
<div>{{ orderInfo.logisticsTypeName || '-' }}</div>
</el-form-item>
<el-form-item label="物流公司:">
<div>{{ orderInfo.logisticsName || '-' }}</div>
</el-form-item>
<el-form-item label="物流单号:">
<div>{{ orderInfo.waybill || '-' }}</div>
</el-form-item>
</el-form>
</div>
<div v-if="orderInfo.logisticsInfo && orderInfo.logisticsInfo.trailInfoList && orderInfo.logisticsInfo.trailInfoList.length > 0" class="logistics_info">物流轨迹</div>
<div v-if="orderInfo.logisticsInfo && orderInfo.logisticsInfo.trailInfoList && orderInfo.logisticsInfo.trailInfoList.length > 0" :style="{height: `${orderInfo.logisticsInfo.trailInfoList.length * 80}px`, marginBottom: '20px'}" class="logistics_list">
<el-steps :active="0" direction="vertical">
<el-step v-for="item in orderInfo.logisticsInfo.trailInfoList" :title="item.desc" :description="item.createTime" :key="item.createTime"/>
</el-steps>
</div>
</el-card>
</div>
</div>
</template>
<script>
import Line2Hidden from '@/components/line2Hidden'
import { findOrderDetail } from '@/api/business/order'
export default {
name: 'OrderDetail',
components: {
Line2Hidden
},
data() {
return {
orderId: '',
orderInfo: {}
}
},
created() {
const id = this.$route.query.orderId
if (!id) {
return
}
this.orderId = id
this.handleGetDetail()
},
methods: {
/**
* 获取详情
* @param loading
*/
handleGetDetail() {
if (!this.orderId) {
return
}
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
findOrderDetail({ orderId: this.orderId })
.then(response => {
if (loading) {
loading.close()
}
// console.log('====', response.data.data)
if (response.data.data.result) {
this.orderInfo = response.data.data.result
}
})
.catch(response => {
if (loading) {
loading.close()
}
})
}
}
}
</script>
<style lang="scss" scoped>
/deep/ .el-card__body {
padding: 12px;
}
/deep/ .el-form-item {
margin-bottom: 0;
}
/deep/ .el-switch {
height: 30px;
}
.page_orderDetail {
padding: 10px;
display: flex;
flex-direction: row;
.table-td-thumb {
width: 40px;
height: 40px;
}
.discount_price {
color: #F56C6C;
font-weight: 600;
}
.logistics_info {
margin: 10px 0;
border-bottom: 1px solid #F6F6F7;
padding: 10px;
}
.logistics_list {
height: auto;
min-height: 500px;
overflow-y: scroll;
}
.detail_left {
width: 60%;
}
.detail_right {
width: 40%;
}
.user_info {
display: flex;
flex-direction: column;
}
.item_info {
display: flex;
flex-direction: row;
align-items: center;
height: 120px;
.item_info_content {
display: flex;
flex-direction: column;
margin-left: 10px;
height: 110px;
.item_info_content--title {
text-align: left;
font-size: 14px;
padding: 0 12px 0 0;
box-sizing: border-box;
}
.item_info_content--sku {
font-size: 10px;
color: #989CA8;
margin-top: 4px;
}
.item_info_content--price {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-top: auto;
ont-family: Brown, Brown;
font-weight: 400;
font-size: 14px;
color: #17191C;
line-height: 20px;
text-align: justify;
font-style: normal;
}
}
}
.title {
display: flex;
flex-direction: row;
margin-bottom: 10px;
border-bottom: 1px solid #F6F6F7;
padding-bottom: 10px;
align-items: center;
.title_content {
font-weight: 600;
font-size: 14px;
margin-right: 16px;
}
}
}
</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-input v-model="listQuery.name" clearable class="filter-item" style="width: 200px;" placeholder="请输入藏家ID"/>
<!-- <el-select v-model="listQuery.isAbleSale" placeholder="请选择商品状态" class="filter-item" style="width: 200px;">
<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>
<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="正在查询中..."
height="800"
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" />
<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="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}` }}</span>
</template>
</el-table-column>
<!-- <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="isOnSale" min-width="100px">
<template slot-scope="scope" style="height: 100px">
<el-switch
v-model="scope.row.isOnSale"
:active-text="scope.row.isOnSale ? '上架' : '下架'"
style="display: block"
@change="handleSaleSwitch($event, scope.row)" />
</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="藏家ID" prop="updateTime" />
<el-table-column align="center" label="仓位" prop="updateTime" />
<el-table-column align="center" label="入库时间" prop="updateTime" />
<el-table-column align="center" label="操作" width="300">
<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="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/saleAdd' })
},
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: '/factory/factorySaleAdd', 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>
<div class="page_consignList">
<div class="page_orderAll">
<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleMenuSelect">
<el-menu-item v-for="item in menuList" :key="item.index" :index="item.index">{{ item.title }}</el-menu-item>
</el-menu>
<div class="order_select">
<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-option
v-for="item in options"
:key="item.label"
:label="item.label"
:value="item.value"
size="mini" />
</el-select>
<el-input
v-model="listQuery.itemName"
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>
</div>
</div>
<el-table
v-loading="listLoading"
:data="list"
size="small"
element-loading-text="正在查询中..."
height="800"
border
fit
highlight-current-row>
<!-- <el-table-column align="center" label="排行" width="100px" type="index" />-->
<el-table-column align="center" min-width="100px" prop="distributionOrderId" label="订单编号" />
<!-- <el-table-column align="center" label="分销商名称" min-width="150px" prop="sellerName">
<template slot-scope="scope">
<Line2Hidden :text="scope.row.sellerName || ''" />
</template>
</el-table-column>
<el-table-column align="center" label="藏品图片" prop="homePageImage">
<template slot-scope="scope">
<img
v-if="scope.row.homePageImage && scope.row.homePageImage.url"
:src="scope.row.homePageImage.url"
width="60px"
height="60px">
</template>
</el-table-column> -->
<el-table-column align="center" label="藏品描述" min-width="150px" prop="itemName">
<template slot-scope="scope">
<Line2Hidden :text="scope.row.itemName" />
</template>
</el-table-column>
<el-table-column align="center" label="藏片件数" prop="itemNum" />
<el-table-column align="center" label="实付款" prop="amount">
<template slot-scope="scope">
<span class="tooltip-span">{{ `¥ ${scope.row.amount}` }}</span>
</template>
</el-table-column>
<!-- <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">
<template slot-scope="scope">
<span v-if="scope.row.receiverName">{{
scope.row.receiverName + ',' + scope.row.receiverPhone + ',' + scope.row.receiverAddress
}}</span>
</template>
</el-table-column> -->
<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="200" fixed="right">
<template slot-scope="scope">
<el-button
type="primary"
size="mini"
@click="handleToDetail(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" />
<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>
</template>
<script>
import Line2Hidden from '@/components/line2Hidden'
import Pagination from '@/components/Pagination'
import { requestOrderList, requestLogisticsList, requestDelivery } from '@/api/business/order'
export default {
name: 'SaleOrderList',
components: {
Pagination,
Line2Hidden
},
data() {
return {
itemKey: 0,
options: [{
value: 1,
label: '待付款'
}, {
value: 10,
label: '待发货'
}, {
value: 20,
label: '待收货'
}, {
value: 30,
label: '售后中'
}, {
value: 80,
label: '退款受理中'
}, {
value: 100,
label: '已完成'
}, {
value: 101,
label: '已取消'
}],
listLoading: true,
listQuery: {
page: 1,
size: 20
},
list: [],
total: 0,
// 图文估价
imageValueDialogShow: false,
// 建议寄售价
identifyValueDialogShow: false,
// 货品售出
finishDialogShow: false,
// 寄售凭证
finishSettlementDialogShow: false,
// 取消
cancelConsignDialogShow: false,
// 发货
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: '已取消'
}],
menuList: [
{
title: '全部',
index: '0'
}, {
title: '待付款',
index: '1'
}, {
title: '待发货',
index: '10'
}, {
title: '待收货',
index: '20'
}, {
title: '已签收',
index: '90'
}, {
title: '已完成',
index: '100'
}, {
title: '已取消',
index: '101'
}, {
title: '售后处理中',
index: '30'
}
],
sendForm: {},
logisticList: [],
orderId: '',
rules: {
waybill: [{ required: true, message: '请输入物流单号', trigger: 'blur' }],
logisticsCode: [{ required: true, message: '请选择快递公司', trigger: 'blur' }]
}
}
},
created() {
this.getList()
this.getLogisticsList()
},
methods: {
/**
* 获取物流公司列表
*/
getLogisticsList() {
requestLogisticsList().then((response) => {
console.log('==response===', response)
this.logisticList = response.data.data
}).catch((err) => {
console.log('==err===', err)
})
},
resetSearchForm() {
this.listQuery = {
page: 1,
limit: 20
}
this.getList()
},
handleFilter() {
this.listQuery.page = 1
this.getList()
},
handlerGetList() {
this.listQuery.page = 1
this.getList()
},
handleClick(tab, event) {
this.listQuery.page = 1
this.getList()
},
getList() {
localStorage.setItem('systemState', '')
this.listLoading = true
requestOrderList(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
})
},
/**
* 展示发货弹窗
*/
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
})
})
}
})
},
/**
* 详情
* @param item
*/
handleToDetail(item) {
this.$router.push({ path: '/factory/factoryOrderDetail', query: { distributionOrderId: item.distributionOrderId }})
},
/**
* 订单状态切换
* @param value
*/
handleMenuSelect(value) {
console.log('=====tab切换=', value)
this.activeIndex = value
this.handleReset()
},
/**
* 发货
*/
handleToSend(row) {
this.sendDialogVisible = true
this.orderId = row.distributionOrderId
}
}
}
</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;
}
}
.page_orderAll {
padding: 10px;
.order_select {
margin-top: 10px;
}
.expand_view {
color: #1890ff;
font-weight: 500;
}
}
</style>
<template>
<div class="page_consignList">
<div class="filter-container">
<div class="button_left">
<el-input
v-model="listQuery.sellerId"
clearable
class="filter-item"
style="width: 200px;"
placeholder="请输入藏家ID" />
<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-option
v-for="item in options"
:key="item.label"
:label="item.label"
:value="item.value"
size="mini" />
</el-select>
<el-date-picker
v-model="timeValue"
:picker-options="pickerOptions"
class="filter-item"
style="width: 400px; "
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-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 type="primary" class="filter-item" @click="handleExport">导出明细</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="distributionOrderId" label="订单编号" fixed="left"/>
<!-- <el-table-column align="center" label="商品图片" prop="homePageImage">-->
<!-- <template slot-scope="scope">-->
<!-- <img-->
<!-- v-if="scope.row.homePageImage && scope.row.homePageImage.url"-->
<!-- :src="scope.row.homePageImage.url"-->
<!-- width="60px"-->
<!-- height="60px">-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column align="center" label="商品图片" prop="homePageImage">
<template slot-scope="scope">
<div v-if="scope.row.homePageImage && scope.row.homePageImage.url" class="image_preview">
<el-image
:preview-src-list="[scope.row.homePageImage.url]"
:src="scope.row.homePageImage.url"
class="table-td-thumb"
/>
</div>
</template>
</el-table-column>
<el-table-column align="center" label="商品名称" min-width="150px" prop="itemName">
<template slot-scope="scope">
<Line2Hidden :text="scope.row.itemName || ''" />
</template>
</el-table-column>
<el-table-column align="center" label="订单状态" prop="stateName" />
<el-table-column align="center" label="订单金额" prop="amount">
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.amount ? `¥ ${scope.row.amount}` : '-'}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="平台到账(1%手续费)" prop="realAmount">
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.realAmount ? `¥ ${scope.row.realAmount}` : '-'}` }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="藏家" prop="sellerName" />
<el-table-column align="center" label="藏家ID" prop="sellerId" />
<el-table-column align="center" label="订单类型" prop="typeName" />
<el-table-column align="center" label="订单创建时间" prop="createTime" width="160" />
<el-table-column label="藏家订单收入" align="center" >
<el-table-column prop="sellerEntryAmount" label="已入账" width="120" align="center" >
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.sellerEntryAmount ? `¥ ${scope.row.sellerEntryAmount}` : '-'}` }}</span>
</template>
</el-table-column>
<el-table-column prop="sellerWaitEntryAmount" label="待入账" width="120" align="center" >
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.sellerWaitEntryAmount ? `¥ ${scope.row.sellerWaitEntryAmount}` : '-'}` }}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="平台收入" align="center" >
<el-table-column prop="systemEntryAmount" label="已入账" width="120" align="center" >
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.systemEntryAmount ? `¥ ${scope.row.systemEntryAmount}` : '-'}` }}</span>
</template>
</el-table-column>
<el-table-column prop="systemWaitEntryAmount" label="待入账" width="120" align="center" >
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.systemWaitEntryAmount ? `¥ ${scope.row.systemWaitEntryAmount}` : '-'}` }}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="介绍佣金" align="center" >
<el-table-column prop="introduceEntryAmount" label="已入账" width="120" align="center" >
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.introduceEntryAmount ? `¥ ${scope.row.introduceEntryAmount}` : '-'}` }}</span>
</template>
</el-table-column>
<el-table-column prop="introduceWaitEntryAmount" label="待入账" width="120" align="center" >
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.introduceWaitEntryAmount ? `¥ ${scope.row.introduceWaitEntryAmount}` : '-'}` }}</span>
</template>
</el-table-column>
<el-table-column prop="introducerName" label="佣金归属" width="120" align="center" />
</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 { findOrderBillDetail, requestLogisticsList, exportOrderBillDetail } from '@/api/business/order'
import { MessageBox } from 'element-ui'
import { Loading } from 'element-ui'
export default {
name: 'OrderDetail',
components: {
Pagination,
Line2Hidden
},
data() {
return {
itemKey: 0,
loadingInstance: {},
options: [{
value: 10,
label: '待发货'
}, {
value: 20,
label: '待收货'
}, {
value: 30,
label: '售后中'
}, {
value: 80,
label: '退款受理中'
}, {
value: 90,
label: '已签收'
}, {
value: 100,
label: '已完成'
}, {
value: 101,
label: '已取消'
}],
listLoading: true,
listQuery: {
page: 1,
size: 20
},
list: [],
total: 0,
timeValue: '',
pickerOptions: {
disabledDate(date) {
return date.getTime() > Date.now() // 禁用大于今天的日期
}
}
}
},
created() {
this.getList()
this.getLogisticsList()
},
methods: {
/**
* 获取物流公司列表
*/
getLogisticsList() {
requestLogisticsList().then((response) => {
console.log('==response===', response)
this.logisticList = response.data.data
}).catch((err) => {
console.log('==err===', err)
})
},
resetSearchForm() {
this.timeValue = ''
this.listQuery = {
page: 1,
limit: 20
}
this.getList()
},
handleExport() {
if (this.list.length === 0) {
this.$message.error('暂无明细可导出')
return
}
const options = {
lock: true,
text: '正在导出...',
spinner: 'el-icon-loading'
}
this.loadingInstance = Loading.service(options)
exportOrderBillDetail(this.listQuery).then(response => {
setTimeout(() => {
if (this.loadingInstance) {
this.loadingInstance.close()
}
if (response && response.data) {
window.open(response.data.data)
}
}, 5000)
}).catch((e) => {
console.log('===报错=', e)
if (this.loadingInstance) {
this.loadingInstance.close()
}
MessageBox.alert('业务错误:' + e.data.errmsg, '警告', {
confirmButtonText: '确定',
type: 'error'
})
})
},
handleFilter() {
this.listQuery.page = 1
if (this.timeValue && this.timeValue.length > 0) {
this.listQuery.startCreateTime = this.timeValue[0]
this.listQuery.endCreateTime = this.timeValue[1]
} else {
this.listQuery.startCreateTime = ''
this.listQuery.endCreateTime = ''
}
this.getList()
},
handlerGetList() {
this.listQuery.page = 1
this.getList()
},
handleClick(tab, event) {
this.listQuery.page = 1
this.getList()
},
getList() {
localStorage.setItem('systemState', '')
this.listLoading = true
findOrderBillDetail(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
})
}
}
}
</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>
<div>
<el-form ref="goods" :rules="rules" :model="goods" label-width="150px">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>基础信息</span>
</div>
<el-form-item label="商品名称" prop="name">
<el-input v-model="goods.name" />
</el-form-item>
<el-form-item label="商品详情" prop="description">
<editor :init="editorInit" :style="{'min-height':'300px' }" v-model="goods.description" />
</el-form-item>
</el-card>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>商品图片</span>
</div>
<el-form-item label="" prop="images">
<div v-if="goods.images && (typeof goods.images === 'object')" class="ant-upload-list">
<draggable
:list="goods.images"
:options="{group:'title', animation:150}"
:no-transition-on-drag="true"
class="syllable_ul"
element="ul"
@change="change"
>
<div v-for="(item, index) in goods.images" :key="index" class="ant-upload-list-item">
<div class="ant-upload-list-item-info">
<span>
<a :href="item" target="_blank" rel="noopener noreferrer" >
<img :src="item" class="ant-upload-list-item-thumbnail">
</a>
</span>
</div>
<span class="ant-upload-list-item-actions">
<!-- <i class="el-icon-view" @click="previewImg(item)"/>-->
<i class="el-icon-delete" @click="removeImg(item)"/>
<!-- <el-button type="success" icon="el-icon-view" size="mini" plain @click="previewImg(item)"/>-->
<!-- <el-button type="danger" icon="el-icon-delete" size="mini" plain @click="removeImg(item)"/>-->
</span>
</div>
</draggable>
</div>
<el-upload
:action="uploadPath"
:headers="headers"
:limit="9"
:file-list="itemImages"
:on-exceed="uploadOverrun"
:on-success="handleGalleryUrl"
:on-remove="handleRemove"
:show-file-list="false"
multiple
accept=".jpg,.jpeg,.png,.gif"
list-type="picture-card">
<i class="el-icon-plus" />
</el-upload>
<div>建议上传尺寸3:4的图片,最多不超过9张</div>
</el-form-item>
<!-- <el-form-item label="图片" prop="images">
<UploadFile :product-top-images.sync="goods.images" @productTopImages="goods.images"/>
</el-form-item>-->
</el-card>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>商品设置</span>
</div>
<!-- <h5>上架类型</h5>
<el-form-item label="" prop="type">
<el-radio-group v-model="goods.type">
<el-radio :label="1">一口价</el-radio>
<el-radio :label="2">竞拍</el-radio>
</el-radio-group>
</el-form-item> -->
<h5>定价</h5>
<div class="item">
<el-form-item v-if="goods.type === 1" label="分销价" prop="distributionPrice">
<el-input v-model="goods.distributionPrice" style="width: 300px" @input="limitInput($event, 1)" >
<template slot="prepend">¥</template>
</el-input>
</el-form-item>
<el-form-item label="进货价" prop="supplyPrice">
<el-input v-model="goods.supplyPrice" style="width: 300px" @input="limitInput($event, 2)" >
<template slot="prepend">¥</template>
</el-input>
</el-form-item>
<el-form-item label="库存" prop="supplyPrice">
<el-input v-model="goods.supplyPrice" style="width: 300px" @input="limitInput($event, 2)" >
<template slot="prepend">¥</template>
</el-input>
</el-form-item>
</div>
<div v-if="goods.type === 1" class="item">
<el-form-item label="分佣比例" prop="rebate">
<el-input v-model="goods.rebate" style="width: 300px" @input="limitInput($event, 3)" >
<template slot="append">%</template>
</el-input>
</el-form-item>
</div>
<div v-if="goods.type === 1">
<h5>库存</h5>
<div class="item">
<el-form-item label="数量" prop="stock">
<el-input-number v-model="goods.stock" :step="1" style="width: 200px" />
</el-form-item>
</div>
</div>
<div v-if="goods.type === 1" >
<h5>限购</h5>
<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>
</div>
<div v-if="goods.type === 2">
<h5>竞拍设置</h5>
<div class="item">
<el-form-item label="开始时间" prop="auctionStartTime">
<el-date-picker
v-model="goods.auctionStartTime"
:picker-options="pickerOptions"
style="width:300px"
type="datetime"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间" />
</el-form-item>
<el-form-item label="截拍时间" prop="auctionEndTime">
<!-- <el-input v-model="dataForm.bidtime"/> -->
<el-date-picker
v-model="goods.auctionEndTime"
:picker-options="pickerOptions"
style="width:300px"
type="datetime"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间" />
</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">
<template slot="prepend">¥</template>
</el-input>
</el-form-item>
</div>
</div>
</el-card>
</el-form>
<div class="op-container">
<el-button @click="handleBack">返回</el-button>
<el-button type="primary" @click="handleSave">保存</el-button>
</div>
</div>
</template>
<script>
import { uploadPath, createStorage } from '@/api/business/storage'
import { getToken } from '@/utils/auth'
import Editor from '@tinymce/tinymce-vue'
import { MessageBox } from 'element-ui'
import { createSale, findSaleDetail, updateSale } from '../../api/business/sale'
import UploadFile from './UploadImg'
import draggable from 'vuedraggable'
export default {
name: 'SaleAdd',
components: { UploadFile, Editor, draggable },
data() {
return {
uploadPath,
numType: -1,
goods: {
images: [],
type: 1,
buyLimitNum: 0
},
pickerOptions: {
disabledDate(time) {
var todayYear = (new Date()).getFullYear()
var todayMonth = (new Date()).getMonth()
var todayDay = (new Date()).getDate() - 1
var todayTime = (new Date(todayYear, todayMonth, todayDay, '23', '59', '59')).getTime()// 毫秒
return time.getTime() < todayTime
}
},
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' }]
},
editorInit: {
language: 'zh_CN',
convert_urls: false,
plugins: [
'advlist anchor autolink autosave code codesample colorpicker colorpicker contextmenu directionality emoticons fullscreen hr image imagetools importcss insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table template textcolor textpattern visualblocks visualchars wordcount'
],
toolbar: [
'searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample',
'hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor fullscreen'
],
images_upload_handler: function(blobInfo, success, failure) {
const formData = new FormData()
formData.append('file', blobInfo.blob())
createStorage(formData)
.then(res => {
success(res.data.data.url)
})
.catch(() => {
failure('上传失败,请重新上传~')
})
}
}
}
},
computed: {
headers() {
return {
'X-Dts-Admin-Token': getToken()
}
}
},
created() {
if (this.$route.query.id == null) {
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)
},
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
*/
limitInput(value, type) {
const price = ('' + value) // 第一步:转成字符串
.replace(/[^\d^\.]+/g, '') // 第二步:把不是数字,不是小数点的过滤掉
.replace(/^0+(\d)/, '$1') // 第三步:第一位0开头,0后面为数字,则过滤掉,取后面的数字
.replace(/^\./, '0.') // 第四步:如果输入的第一位为小数点,则替换成 0. 实现自动补全
.match(/^\d*(\.?\d{0,2})/g)[0] || '' // 第五步:最终匹配得到结果 以数字开头,只有一个小数点, 而且小数点后面只能有0到2位小数
if (type === 1) {
this.goods.distributionPrice = price
} else if (type === 2) {
this.goods.supplyPrice = price
} else if (type === 3) {
this.goods.rebate = price
}
},
uploadOverrun: function() {
this.$message({
type: 'error',
message: '上传文件个数超出限制!最多上传9张图片!'
})
},
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)
}
}
}
}
}
</script>
<style lang="scss" scoped>
.box-card {
margin: 24px;
}
.item {
display: flex;
}
.op-container {
display: flex;
justify-content: center;
padding: 0 24px 24px;
}
/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;
}
/deep/ .mce-fullscreen {
z-index: 1001;
}
.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>
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
:data="list" :data="list"
size="small" size="small"
element-loading-text="正在查询中..." element-loading-text="正在查询中..."
height="800"
border border
fit fit
highlight-current-row> highlight-current-row>
......
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