|
@@ -17,7 +17,7 @@
|
|
<el-button v-if="formData.id && ~['ON'].indexOf(formData.status)" type="primary" size="small"
|
|
<el-button v-if="formData.id && ~['ON'].indexOf(formData.status)" type="primary" size="small"
|
|
@click="setStatus('OFF')">下架</el-button>
|
|
@click="setStatus('OFF')">下架</el-button>
|
|
<el-button v-if="formData.id && ~['ON', 'OFF'].indexOf(formData.status)" type="primary" size="small"
|
|
<el-button v-if="formData.id && ~['ON', 'OFF'].indexOf(formData.status)" type="primary" size="small"
|
|
- @click="zhuanxiaoshou">转销售</el-button>
|
|
|
|
|
|
+ @click="setStatus('SALE')">转销售</el-button>
|
|
<el-button v-if="formData.id && ~['OFF'].indexOf(formData.status)" type="primary" size="small"
|
|
<el-button v-if="formData.id && ~['OFF'].indexOf(formData.status)" type="primary" size="small"
|
|
@click="setStatus('ON')">重新上架</el-button>
|
|
@click="setStatus('ON')">重新上架</el-button>
|
|
<el-button size="small" @click="handleClose">取消</el-button>
|
|
<el-button size="small" @click="handleClose">取消</el-button>
|
|
@@ -27,7 +27,8 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import ImageUpload from '@/components/Common/image-upload.vue'
|
|
import ImageUpload from '@/components/Common/image-upload.vue'
|
|
-import { esGoodsDetail, esGoodsCopy, esGoodsBatchUpdateStatus, esGoodsReply } from '@/api/commodityManagement'
|
|
|
|
|
|
+import { esGoodsDetail, esGoodsCopy, esGoodsBatchUpdateStatus, esGoodsReply, esGoodsUpdate } from '@/api/commodityManagement'
|
|
|
|
+import { getClassifyList } from '@/api/goods'
|
|
export default {
|
|
export default {
|
|
components: { ImageUpload },
|
|
components: { ImageUpload },
|
|
props: {
|
|
props: {
|
|
@@ -38,6 +39,7 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ classifyList: [],
|
|
formData: {
|
|
formData: {
|
|
"brand": "",
|
|
"brand": "",
|
|
"categoryId": "",
|
|
"categoryId": "",
|
|
@@ -75,15 +77,21 @@ export default {
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
disabled(){
|
|
disabled(){
|
|
- return this.detailId? !~['ON', 'OFF'].indexOf(this.formData?.status) : false
|
|
|
|
|
|
+ return ~['ON', 'OFF'].indexOf(this.formData?.status) ? false : true
|
|
},
|
|
},
|
|
formItems() {
|
|
formItems() {
|
|
return [
|
|
return [
|
|
{
|
|
{
|
|
- name: 'el-input',
|
|
|
|
|
|
+ name: 'el-select',
|
|
md: 12,
|
|
md: 12,
|
|
|
|
+ options: this.classifyList.map(item=>({label: item.name,value: item.categoryId})),
|
|
attributes: { disabled: this.disabled },
|
|
attributes: { disabled: this.disabled },
|
|
- formItemAttributes: { label: '商品分类', prop: 'categoryName' }
|
|
|
|
|
|
+ formItemAttributes: { label: '商品分类', prop: 'categoryId' },
|
|
|
|
+ events: {
|
|
|
|
+ change: (val) => {
|
|
|
|
+ this.formData.categoryName = this.classifyList.find(item=>item.categoryId == val)?.name
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: 'el-radio',
|
|
name: 'el-radio',
|
|
@@ -176,18 +184,22 @@ export default {
|
|
formItemAttributes: { label: '能效标识', prop: 'mark' }
|
|
formItemAttributes: { label: '能效标识', prop: 'mark' }
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- name: 'slot-component',
|
|
|
|
md: 24,
|
|
md: 24,
|
|
- attributes: { disabled: this.disabled },
|
|
|
|
- formItemAttributes: { label: '商品图片', prop: 'imgList' },
|
|
|
|
- render: (h, { props }) => {
|
|
|
|
- return (<div>
|
|
|
|
- <ImageUpload file-list={this.formData.imgList} limit={this.formData?.imgList?.length + 1} isEdit={false} />
|
|
|
|
- </div>)
|
|
|
|
|
|
+ name: 'slot-component',
|
|
|
|
+ formItemAttributes: {
|
|
|
|
+ label: '商品图片',
|
|
|
|
+ prop: 'imgList',
|
|
|
|
+ rules: []
|
|
|
|
+ },
|
|
|
|
+ render: (h, { props, onInput }) => {
|
|
|
|
+ return (
|
|
|
|
+ <ImageUpload fileList={this.formData.imgList} limit={100} isEdit={!this.disabled}/>
|
|
|
|
+ )
|
|
}
|
|
}
|
|
- },
|
|
|
|
|
|
+ }
|
|
]
|
|
]
|
|
},
|
|
},
|
|
|
|
+ // esOrderInfo
|
|
formItems2() {
|
|
formItems2() {
|
|
return [{
|
|
return [{
|
|
name: 'slot-component',
|
|
name: 'slot-component',
|
|
@@ -195,25 +207,23 @@ export default {
|
|
attributes: { disabled: this.disabled },
|
|
attributes: { disabled: this.disabled },
|
|
formItemAttributes: { label: '', prop: '', 'label-width': '0px' },
|
|
formItemAttributes: { label: '', prop: '', 'label-width': '0px' },
|
|
render: (h, { props }) => {
|
|
render: (h, { props }) => {
|
|
- var { formData } = props
|
|
|
|
- console.log(formData, 999)
|
|
|
|
return (<div>
|
|
return (<div>
|
|
<el-row gutter={10}>
|
|
<el-row gutter={10}>
|
|
<el-col xs={24} sm={24} md={8} lg={8} xl={8}>
|
|
<el-col xs={24} sm={24} md={8} lg={8} xl={8}>
|
|
<div class='info'>
|
|
<div class='info'>
|
|
- <div class='info_title'>上架人信息</div>
|
|
|
|
|
|
+ <div class='info_title'>卖家信息</div>
|
|
<div class='info_bottom'>
|
|
<div class='info_bottom'>
|
|
<div class='info_bottom_lt'>
|
|
<div class='info_bottom_lt'>
|
|
<el-image
|
|
<el-image
|
|
style='width: 40px; height: 40px'
|
|
style='width: 40px; height: 40px'
|
|
- src={this.$imageUrl + this.formData?.order?.buyerUserPic}
|
|
|
|
|
|
+ src={this?.formData?.esOrderInfo?.sellUrl}
|
|
>
|
|
>
|
|
</el-image>
|
|
</el-image>
|
|
</div>
|
|
</div>
|
|
<div class='info_bottom_rt'>
|
|
<div class='info_bottom_rt'>
|
|
- <div>微信昵称:{formData.userName}</div>
|
|
|
|
- <div>微信手机号:{formData.phone}</div>
|
|
|
|
- <div>发布时间:{formData.goodsCreateTime}</div>
|
|
|
|
|
|
+ <div>微信昵称:{this?.formData?.esOrderInfo?.sellName}</div>
|
|
|
|
+ <div>微信手机号:{this?.formData?.esOrderInfo?.sellMobile}</div>
|
|
|
|
+ <div>发布时间:{this?.formData?.esOrderInfo?.sellTime}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -225,16 +235,16 @@ export default {
|
|
<div class='info_bottom_lt'>
|
|
<div class='info_bottom_lt'>
|
|
<el-image
|
|
<el-image
|
|
style='width: 40px; height: 40px'
|
|
style='width: 40px; height: 40px'
|
|
- src={this.$imageUrl + this?.formData?.userPic}
|
|
|
|
|
|
+ src={this?.formData?.esOrderInfo?.wechatUserUrl}
|
|
>
|
|
>
|
|
</el-image>
|
|
</el-image>
|
|
</div>
|
|
</div>
|
|
<div class='info_bottom_rt'>
|
|
<div class='info_bottom_rt'>
|
|
- <div>微信昵称:{formData.buyerUserName}</div>
|
|
|
|
- <div>微信手机号:{formData.buyerUserPhone}</div>
|
|
|
|
- <div>收货人信息:{formData.consigneeName}</div>
|
|
|
|
- <div>收货人地址:{formData.address}</div>
|
|
|
|
- <div>支付方式:{formData.payType === 'WECHAT' ? '微信支付' : ''}</div>
|
|
|
|
|
|
+ <div>微信昵称:{this?.formData?.esOrderInfo?.wechatUserName}</div>
|
|
|
|
+ <div>微信手机号:{this?.formData?.esOrderInfo?.wechatUserMobile}</div>
|
|
|
|
+ <div>收货人信息:{`(${this?.formData?.esOrderInfo?.userMobile||''}) ${this?.formData?.esOrderInfo?.userMobile||''}`}</div>
|
|
|
|
+ <div>收货人地址:{this?.formData?.esOrderInfo?.sellName}</div>
|
|
|
|
+ <div>支付方式:{({WECHAT:"微信支付", CASH:"现金支付", TRANSFER:"转账支付"})[this?.formData?.esOrderInfo?.payType]}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -245,15 +255,16 @@ export default {
|
|
<div class='info_bottom'>
|
|
<div class='info_bottom'>
|
|
<div class='info_bottom_rt'>
|
|
<div class='info_bottom_rt'>
|
|
<div>
|
|
<div>
|
|
- <el-radio-group value={formData.logisticsType}>
|
|
|
|
|
|
+ <el-radio-group disabled={true} value={this?.formData?.esOrderInfo?.logisticsType}>
|
|
<el-radio label='SELF'>自提</el-radio>
|
|
<el-radio label='SELF'>自提</el-radio>
|
|
<el-radio label='DELIVERY'>物流</el-radio>
|
|
<el-radio label='DELIVERY'>物流</el-radio>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
</div>
|
|
</div>
|
|
- <div>快递单号:{formData.logisticsNum}</div>
|
|
|
|
- <div>快递公司:{formData.logisticsName}</div>
|
|
|
|
- <el-button type='primary' size='small' onClick={() => { }}
|
|
|
|
- >查看物流
|
|
|
|
|
|
+ <div>快递单号:{this?.formData?.esOrderInfo?.logisticsNo}</div>
|
|
|
|
+ <div>快递公司:{this?.formData?.esOrderInfo?.logisticsName}</div>
|
|
|
|
+ <el-button type='primary' size='small' onClick={() => {
|
|
|
|
+
|
|
|
|
+ }}>查看物流
|
|
</el-button>
|
|
</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -336,13 +347,12 @@ export default {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
esGoodsDetail({ id: newVal }).then(res => {
|
|
esGoodsDetail({ id: newVal }).then(res => {
|
|
- console.log(res.data)
|
|
|
|
this.formData = {
|
|
this.formData = {
|
|
...res.data,
|
|
...res.data,
|
|
imgList: res.data.imgList.map(item => {
|
|
imgList: res.data.imgList.map(item => {
|
|
return {
|
|
return {
|
|
...item,
|
|
...item,
|
|
- imgUrl: item.imgUrl
|
|
|
|
|
|
+ url: item.imgUrl
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -352,6 +362,14 @@ export default {
|
|
immediate: true,
|
|
immediate: true,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ created(){
|
|
|
|
+ getClassifyList({
|
|
|
|
+ status:true,
|
|
|
|
+ type:5
|
|
|
|
+ }).then(res=>{
|
|
|
|
+ this.classifyList = res.data
|
|
|
|
+ })
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
msgSend(row){
|
|
msgSend(row){
|
|
this.$prompt('留言回复', '回复', {
|
|
this.$prompt('留言回复', '回复', {
|
|
@@ -372,7 +390,7 @@ export default {
|
|
imgList: res2.data.imgList.map(item => {
|
|
imgList: res2.data.imgList.map(item => {
|
|
return {
|
|
return {
|
|
...item,
|
|
...item,
|
|
- imgUrl: item.imgUrl
|
|
|
|
|
|
+ url: item.imgUrl
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -393,11 +411,18 @@ export default {
|
|
this.handleClose()
|
|
this.handleClose()
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- zhuanxiaoshou(){
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
handleSubmit() {
|
|
handleSubmit() {
|
|
-
|
|
|
|
|
|
+ this.$refs.formRef.validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ esGoodsUpdate({
|
|
|
|
+ ...this.formData,
|
|
|
|
+ imgList: this.formData.imgList.map(item=>({...item, imgUrl:item.url}))
|
|
|
|
+ }).then(res=>{
|
|
|
|
+ this.$message({ type: 'success', message: `成功!` })
|
|
|
|
+ this.$emit('back')
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
handleClose() {
|
|
handleClose() {
|
|
this.$emit('back')
|
|
this.$emit('back')
|