Commit dd73a737 by zhangquan

详情编辑接口

1 parent 283aa717
......@@ -54,10 +54,22 @@ const addGoodsApi = params => {
}
const getGoodsDetail = params => {
params.method = 'scrm.api.shopmall.goods.configuration.detail'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
export default {
getGoodsListApi,
updateGoodsStatusApi,
delGoodsApi,
getCarlifeGoodsApi,
addGoodsApi
addGoodsApi,
getGoodsDetail
}
\ No newline at end of file
......@@ -126,7 +126,9 @@ export default {
created(){
this.formObj.id = this.$route.query.id || ''
this.getVideoList()
this.getCaseDetailApi()
if(this.formObj.id){
this.getCaseDetailApi()
}
},
methods:{
openBrandDialog(){
......
......@@ -36,7 +36,7 @@ export default {
},
model: {
prop: 'value', // 默认是value
event: 'change', // 默认是input
event: 'changeItem', // 默认是input
},
props: {
// defaultProps: {
......@@ -56,16 +56,30 @@ export default {
default: ()=>{
return []
}
},
curInfo: {
type: Object,
default: ()=>{
return {}
}
}
},
// watch: {
// value:{
// handler(nVal, oVal){
// console.log(nVal)
// },
// deep: true
// }
// },
watch: {
// value:{
// handler(nVal, oVal){
// const arr = this.listTree.flat(Infinity);
// console.log(arr,456)
// },
// deep: true
// },
'curInfo.id':{
handler(nVal, oVal){
this.curBrand = this.curInfo
},
deep: true
},
},
created(){
this.getCategory()
},
......@@ -115,7 +129,7 @@ export default {
if(e.level==2) {
this.curBrand = e.data
this.brandTree = !this.brandTree
this.$emit('change', this.curBrand.id)
this.$emit('changeItem', this.curBrand.id)
this.$emit('clickItem', {data: e.data, parent: e.parent?.data || {}})
}
}
......
......@@ -130,6 +130,7 @@ export default {
mounted() {
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 425
console.log(this.goodsInfo)
this.curInfo = this.goodsInfo || {}
this.getList()
},
......
......@@ -99,21 +99,21 @@ export default {
this.$emit('closeDialog')
},
setTableFinishFun() {
// this.copyList = [...this.selectedGoodsList, ...this[this.curType == 1 ? 'couponList' : 'directChargeList']]
// this.copyList.forEach(row => {
// this.$nextTick(() => {
// let idx = this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data.findIndex(item => item.id == row.id)
// if (idx > -1) {
// try {
// this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data[idx], true)
// let id = this.copyList.findIndex(item => item.id == row.id)
// if (id > -1) this.copyList.splice(id, 1)
// } catch (err) {
// console.log(err)
// }
// }
// })
// })
this.copyList = [...this.selectedGoodsList, ...this[this.curType == 1 ? 'couponList' : 'directChargeList']]
this.copyList.forEach(row => {
this.$nextTick(() => {
let idx = this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data.findIndex(item => item.id == row.id)
if (idx > -1) {
try {
this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data[idx], true)
let id = this.copyList.findIndex(item => item.id == row.id)
if (id > -1) this.copyList.splice(id, 1)
} catch (err) {
console.log(err)
}
}
})
})
}
}
}
......
<template>
<div class="goods-list-cntr">
<GLTabs v-model="activeName" :tabPaneList="tabPaneList" @tab-click="handleClick"></GLTabs>
<!-- <GLTabs v-model="activeName" :tabPaneList="tabPaneList" @tab-click="handleClick"></GLTabs> -->
<div class="table-wrap">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="operate-wrap">
......@@ -65,7 +65,7 @@
fn: '查看'
},
listeners: {
click: row => this.addContent(row.scope, 1)
click: row => this.handleAdd(row.scope, 1)
}
},
{
......@@ -76,7 +76,7 @@
fn: '编辑'
},
listeners: {
click: row => this.addContent(row.scope, 1)
click: row => this.handleAdd(row.scope, 2)
}
},
{
......@@ -297,10 +297,19 @@
//接收到的数据为空
this.$refs.channelRef.data.length ? (this.$refs.channelRef.tableHeightValues = '') : this.$refs.channelRef.setTableHeightFun()
},
handleAdd(val={}){
this.$router.push({
path: `/goods/add?id=${val.id}&channelType=${val.channelType}&$title=频道设置`
})
handleAdd(row={},type){
const params = {
id: row.id
}
let title = '新增商品'
if(type){
params.id = row.id
params.type = type
title = type == 1 ? '新增' : '查看'
}
const queryStr = encodeURIComponent(JSON.stringify(params))
this.$router.push({ path: `/goods/add/`+queryStr,query: { $title: title }})
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!