Commit dd73a737 by zhangquan

详情编辑接口

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