Commit 909f26a7 by 张立顺

fix 驻店目标功能

1 parent a0977143
...@@ -80,12 +80,13 @@ ...@@ -80,12 +80,13 @@
</el-table-column> </el-table-column>
<el-table-column label="商品分类" align="center"> <el-table-column label="商品分类" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ selectGoodsTypeObj[scope.row.selectGoodsType] }}
{{ scope.row | goodsTypeFilter }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="主推产品套餐" align="center"> <el-table-column label="主推产品套餐" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row | goodsTypeFilter }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="目标转化率" align="center"> <el-table-column label="目标转化率" align="center">
...@@ -253,6 +254,23 @@ export default { ...@@ -253,6 +254,23 @@ export default {
filters: { filters: {
fitterFormat(value) { fitterFormat(value) {
return value ? value + '%' : '' return value ? value + '%' : ''
},
goodsTypeFilter(item) {
// console.log(item, 'item')
if (item.selectGoodsTypeObj === 0 || !item.goodsTypeList?.length) {
return '无'
} else {
let str = ''
item.goodsTypeList.map((el, index) => {
if (index === 0) {
str += el.goodsTypeName
// console.log(str, 'str')
} else {
str += "+" + el.goodsTypeName
}
})
return str
}
} }
}, },
data() { data() {
...@@ -277,6 +295,7 @@ export default { ...@@ -277,6 +295,7 @@ export default {
selectGoodsTypeObj: { selectGoodsTypeObj: {
0: '无', 0: '无',
1: '商品分类' 1: '商品分类'
}, },
baseData: { baseData: {
merchantList: [] merchantList: []
...@@ -323,6 +342,12 @@ export default { ...@@ -323,6 +342,12 @@ export default {
merchantIds: [this.storeConfigConObj.merchantId], merchantIds: [this.storeConfigConObj.merchantId],
sceneType: this.storeConfigConObj.sceneType sceneType: this.storeConfigConObj.sceneType
} }
},
canSelect() {
const { merchantId, sceneType } = this.storeConfigConObj
return merchantId && (sceneType === 0 || sceneType === 1)
// storeConfigConObj.merchantId && (storeConfigConObj.sceneType === 0 || storeConfigConObj.sceneType === 1)
// return this.routerParams.idEdit == 'true' || this.routerForView
} }
}, },
mounted() { mounted() {
...@@ -351,7 +376,19 @@ export default { ...@@ -351,7 +376,19 @@ export default {
this.getStaff() this.getStaff()
}, },
saveDraft() { saveDraft() {
console.log('submitForm')
const params = deepClone(this.storeConfigConObj)
params.saveDraft = true
merchantTargetConfigUpdate(params).then(res => {
console.log(res, 'merchantTargetConfigUpdate')
this.$notify({
type: 'success',
title: '保存成功'
})
this.$router.push('/inStoreGoalsConfig')
}).catch((err) => {
console.log(err)
})
}, },
getStaff() { getStaff() {
const { merchantId, sceneType } = this.storeConfigConObj const { merchantId, sceneType } = this.storeConfigConObj
...@@ -370,6 +407,12 @@ export default { ...@@ -370,6 +407,12 @@ export default {
} }
}, },
handleEdit(item) { handleEdit(item) {
if (!this.canSelect) {
return this.$message({
type: 'warning',
message: '请先选择门店和场景'
})
}
this.drawerShow = true this.drawerShow = true
this.mode = 'edit' this.mode = 'edit'
this.editPeriodObj = deepClone(item) this.editPeriodObj = deepClone(item)
...@@ -403,6 +446,12 @@ export default { ...@@ -403,6 +446,12 @@ export default {
// this.$forceUpdate() // this.$forceUpdate()
}, },
addLine() { addLine() {
if (!this.canSelect) {
return this.$message({
type: 'warning',
message: '请先选择门店和场景'
})
}
this.drawerShow = true this.drawerShow = true
this.mode = 'add' this.mode = 'add'
this.editPeriodObj = { this.editPeriodObj = {
...@@ -427,6 +476,9 @@ export default { ...@@ -427,6 +476,9 @@ export default {
if (valid) { if (valid) {
console.log('submitForm') console.log('submitForm')
const params = deepClone(this.storeConfigConObj) const params = deepClone(this.storeConfigConObj)
// params = params.map(item=>{
// })
merchantTargetConfigUpdate(params).then(res => { merchantTargetConfigUpdate(params).then(res => {
console.log(res, 'merchantTargetConfigUpdate') console.log(res, 'merchantTargetConfigUpdate')
this.$notify({ this.$notify({
......
...@@ -79,12 +79,12 @@ ...@@ -79,12 +79,12 @@
<el-table-column prop="goodsName" align="center" label="商品名称"></el-table-column> <el-table-column prop="goodsName" align="center" label="商品名称"></el-table-column>
<el-table-column prop="categoryName" align="center" label="商品图"> <el-table-column prop="categoryName" align="center" label="商品图">
<template slot-scope="scope"> <template slot-scope="scope">
<img :src="scope.row.goodsInfo.thumbUrl" style="width: 50px; height: 50px" /> <img :src="scope.row.thumbUrl" style="width: 50px; height: 50px" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="categoryName" align="center" label="价格"> <el-table-column prop="categoryName" align="center" label="价格">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.goodsInfo.shopPrice }}</span> <span>{{ scope.row.shopPrice }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -94,12 +94,12 @@ ...@@ -94,12 +94,12 @@
<el-table-column prop="goodsName" align="center" label="商品名称"></el-table-column> <el-table-column prop="goodsName" align="center" label="商品名称"></el-table-column>
<el-table-column prop="categoryName" align="center" label="商品图"> <el-table-column prop="categoryName" align="center" label="商品图">
<template slot-scope="scope"> <template slot-scope="scope">
<img :src="scope.row.goodsInfo.thumbUrl" style="width: 50px; height: 50px" /> <img :src="scope.row.thumbUrl" style="width: 50px; height: 50px" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="categoryName" align="center" label="价格"> <el-table-column prop="categoryName" align="center" label="价格">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.goodsInfo.shopPrice }}</span> <span>{{ scope.row.shopPrice }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="categoryName" align="center" label="目标转化率"> <el-table-column prop="categoryName" align="center" label="目标转化率">
...@@ -407,6 +407,12 @@ export default { ...@@ -407,6 +407,12 @@ export default {
this.periodItemForm.packageList = deepClone(list) this.periodItemForm.packageList = deepClone(list)
}, },
handleAddConfirmSelectGoodsType(list) { handleAddConfirmSelectGoodsType(list) {
list.map(item => {
item.goodsTypeName = item.categoryName
item.goodsType = item.categoryType
// delete item.categoryName
// delete item.categoryType
})
this.periodItemForm.goodsTypeList = deepClone(list) this.periodItemForm.goodsTypeList = deepClone(list)
}, },
selectGoodsTypeDialog() { selectGoodsTypeDialog() {
......
...@@ -27,12 +27,12 @@ ...@@ -27,12 +27,12 @@
<el-table-column prop="goodsName" align="center" label="商品名称"></el-table-column> <el-table-column prop="goodsName" align="center" label="商品名称"></el-table-column>
<el-table-column prop="categoryName" align="center" label="商品图"> <el-table-column prop="categoryName" align="center" label="商品图">
<template slot-scope="scope"> <template slot-scope="scope">
<img :src="scope.row.goodsInfo.thumbUrl" style="width: 50px; height: 50px" /> <img :src="scope.row.thumbUrl" style="width: 50px; height: 50px" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="categoryName" align="center" label="价格"> <el-table-column prop="categoryName" align="center" label="价格">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.goodsInfo.shopPrice }}</span> <span>{{ scope.row.shopPrice }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -148,9 +148,23 @@ export default { ...@@ -148,9 +148,23 @@ export default {
getGroundingManageList(params).then(res => { getGroundingManageList(params).then(res => {
this.selectedTableData = res.list.map(item => { this.selectedTableData = res.list.map(item => {
item.merchantGoodsId = item.id item.merchantGoodsId = item.id
delete item.createdDate return {
delete item.updatedDate merchantGoodsId: item.id,
return item id: item.id,
thumbUrl: item.goodsInfo?.thumbUrl,
shopPrice: item.goodsInfo.shopPrice
// goodsInfo: item.goodsInfo
}
// let goods ={
// merchantGoodsId: item.id,
// goodsInfo: {
// thumbUrl: item.thumbUrl,
// shopPrice: item.shopPrice
// }
// }
// delete item.createdDate
// delete item.updatedDate
// return item
}) })
this.total = res.total this.total = res.total
console.log(res, 'getGroundingManageList') console.log(res, 'getGroundingManageList')
......
...@@ -194,7 +194,13 @@ export default { ...@@ -194,7 +194,13 @@ export default {
categoryName: this.categoryName categoryName: this.categoryName
} }
queryMerchantGoodsCategoryList(params).then(res => { queryMerchantGoodsCategoryList(params).then(res => {
this.selectedTableData = res this.selectedTableData = res.map(item => {
return {
categoryName: item.categoryName,
categoryType: item.categoryType
}
})
this.$nextTick(() => { this.$nextTick(() => {
this.selectedTableData.forEach(item => { this.selectedTableData.forEach(item => {
this.goodsTypeList.forEach(d => { this.goodsTypeList.forEach(d => {
......
...@@ -211,7 +211,10 @@ export default { ...@@ -211,7 +211,10 @@ export default {
// return item.rule.enableFlag == 3 // return item.rule.enableFlag == 3
// }), 'getLedgerHistoryRecordApi') // }), 'getLedgerHistoryRecordApi')
// this.effectStartDate = !res.inEffectSettleDistributeRule // this.effectStartDate = !res.inEffectSettleDistributeRule
this.effectStartDate = !res.InEffectReconciliationRule console.log(res.inEffectReconciliationRule, !res.InEffectReconciliationRule, '!res.InEffectReconciliationRule')
console.log(res, 'res')
this.effectStartDate = !res.inEffectReconciliationRule
// this.effectStartDate = !res.inEffectReconciliationRule
// this.effectStartDate = res.every(item => { // this.effectStartDate = res.every(item => {
// return item.rule.enableFlag == 3 // return item.rule.enableFlag == 3
// }) || !res.length // }) || !res.length
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!