Commit e787a79b by 张立顺

类目筛选 开发完成

1 parent aaa985a4
[![Build Status](https://www.travis-ci.org/d2-projects/d2-admin-start-kit.svg?branch=master)](https://www.travis-ci.org/d2-projects/d2-admin-start-kit) # 嘀加智享车生活后台 http://192.168.3.233:8090/saas_plus/dj-car-life-system
[D2Admin](https://github.com/d2-projects/d2-admin) simplified version of the start template, delete all the sample code in the full version, retain all core functions. # 测试环境(http://frontend.test.glsx.com.cn/dj-carlife-web/#/login) glsadmin admin123
[Gitee](https://gitee.com/fairyever/d2-admin-start-kit) # 生产环境(http://dj.glsx.com.cn/dj-carlife-web/#/login) liushiquan1 liushiq123
预发布账号: yfbyyb a123456 预发布账号: yfbyyb a123456
......
import request from './request' import request from "./request"
// const path = 'dj.api.' // const path = 'dj.api.'
const path2 = 'dj.api.smartcarlife.' const path2 = "dj.api.smartcarlife."
export function getSummary(data) { export function getSummary(data) {
data.method = `${path2}goodsOrderProfitAllocation.statistics` data.method = `${path2}goodsOrderProfitAllocation.statistics`
...@@ -45,10 +45,16 @@ export function getServiceListApi(data) { ...@@ -45,10 +45,16 @@ export function getServiceListApi(data) {
export function getServiceSummaryApi(data) { export function getServiceSummaryApi(data) {
data.method = `${path2}goodsOrderProfitAllocation.count.service.merchant` data.method = `${path2}goodsOrderProfitAllocation.count.service.merchant`
return request(data, 'post') return request(data, "post")
} }
export function exportAccountStatement(data) { export function exportAccountStatement(data) {
data.method = `${path2}goodsOrderProfitAllocation.exportAccountStatement` data.method = `${path2}goodsOrderProfitAllocation.exportAccountStatement`
return request(data, 'post') return request(data, "post")
}
// dj.api.scenemerchantref.queryServiceRefByShop/1.0.0
// 根据4s店获取服务商列表
export function queryServiceRefByShop() {
data.method = `${path2}scenemerchantref.queryServiceRefByShop`
return request(data, "post")
} }
...@@ -33,6 +33,7 @@ export default { ...@@ -33,6 +33,7 @@ export default {
async ([channelType, productType]) => { async ([channelType, productType]) => {
state.channelType = channelType state.channelType = channelType
state.productType = productType state.productType = productType
console.log(productType, "productType")
await dispatch("save2db", { await dispatch("save2db", {
name: "", name: "",
value: state value: state
......
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
<el-select v-model="infoForm.scene" <el-select v-model="infoForm.scene"
style="width:400px" style="width:400px"
@change="changeScene"> @change="changeScene">
<el-option v-for="item in baseData.sceneTypeList" <el-option v-for="(item,index) in baseData.sceneTypeList"
:key="item.confId" :key="item.confId"
:label="item.confLabel" :label="item.confLabel"
:value="item.confId" :value="item.confId"
:disabled="item.disabled" /> :disabled="index" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
import { serviceGetMerchantList, getyqMerchantList, getServiceList, querySceneRefByShop, addOrUpdateSceneMerchantRef } from '@api/merchant' import { serviceGetMerchantList, getyqMerchantList, getServiceList, querySceneRefByShop, addOrUpdateSceneMerchantRef } from '@api/merchant'
import merchantChoose from "./merchantChoose" import merchantChoose from "./merchantChoose"
import { deepClone } from '@/common/util' import { deepClone } from '@/common/util'
import { sceneCodeList } from '@/common/constants.js'
export default { export default {
name: 'RelateMerDialog', name: 'RelateMerDialog',
components: { components: {
...@@ -81,23 +82,24 @@ export default { ...@@ -81,23 +82,24 @@ export default {
// ] // ]
}, },
baseData: { baseData: {
sceneTypeList: [ sceneTypeList: sceneCodeList
{ // [
confId: 0, // {
confLabel: '1.0新车车损升级', // confId: 0,
disabled: true // confLabel: '1.0新车车损升级',
}, { // disabled: true
confId: 1, // }, {
confLabel: '1.1次新车精品升级' // confId: 1,
}, { // confLabel: '1.1次新车精品升级'
confId: 2, // }, {
confLabel: '1.2次新车膨胀金活动', // confId: 2,
disabled: true // confLabel: '1.2次新车膨胀金活动',
}, { // disabled: true
confId: 3, // }, {
confLabel: '1.3售后直播众筹活动' // confId: 3,
} // confLabel: '1.3售后直播众筹活动'
] // }
// ]
}, },
store4sVisible: true, store4sVisible: true,
yqStoreVisible: true, yqStoreVisible: true,
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
分账品类 分账品类
<!-- <span class="title-tips"></span> --> <!-- <span class="title-tips"></span> -->
</p> </p>
<el-form-item label="选择商品:" <el-form-item v-if="tabindex"
label="选择商品:"
prop="goodsTypeGroupRelations" prop="goodsTypeGroupRelations"
required> required>
<!-- collapse-tags --> <!-- collapse-tags -->
...@@ -21,11 +22,14 @@ ...@@ -21,11 +22,14 @@
placeholder="请选择商品"> placeholder="请选择商品">
<el-option v-for="item in goodsList" <el-option v-for="item in goodsList"
:key="item.goodsType" :key="item.goodsType"
:label="2222" :label="item.goodsTypeName"
:disabled="item|filterItem(disabledList)"
:value="item" /> :value="item" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<p v-if="!tabindex">全部商品</p>
<!-- <p>区别</p> -->
</el-form> </el-form>
<!-- <div>classificationCpt</div> --> <!-- <div>classificationCpt</div> -->
...@@ -55,6 +59,12 @@ export default { ...@@ -55,6 +59,12 @@ export default {
type: Array, type: Array,
// 必要 // 必要
required: true required: true
},
goodsSelectList: {
type: Array
},
tabindex: {
default: 0
} }
}, },
data() { data() {
...@@ -74,9 +84,52 @@ export default { ...@@ -74,9 +84,52 @@ export default {
return state.FinancialRules.active return state.FinancialRules.active
// return state.FinancialRules.active // return state.FinancialRules.active
} }
}),
disabledList() {
// 根据区别已选的过滤出该组件自己勾选的 剩下的就是其他组件选的 要禁用
const selectList = this.classificationObj.goodsTypeGroupRelations
// console.log(selectList)
// goodsList
const list = this.goodsSelectList.filter((item) => {
// item.goodsType
// const flag = selectList.findIndex(el => { return el.goodsType == item.goodsType })
// console.log(selectList)
// console.log(flag)
// debugger
// console.log( == -1)
if (selectList.findIndex(el => { return el.goodsType == item.goodsType }) == -1) {
return item
}
}) })
return list
}
},
filters: {
filterItem(item, list) {
return list.findIndex(el => el.goodsType == item.goodsType) != -1
}
},
watch: {
// 解决商品取消选择的数据锁死问题
'classificationObj.goodsTypeGroupRelations': {
handler(val, oldVal) {
console.log(oldVal)
console.log(val, 'val')
if (val.length < oldVal.length) {
const deleteItem = oldVal.find(item => {
if (!val.find(el => el.goodsType != item.goodsType)) {
return item
}
})
console.log(deleteItem)
this.$emit('deleteGoodsItem', deleteItem)
} else {
this.$emit('assignGoodsList', val)
}
},
deep: true
}
}, },
mounted() { mounted() {
// console.log(this.test, 'test') // console.log(this.test, 'test')
}, },
...@@ -85,10 +138,19 @@ export default { ...@@ -85,10 +138,19 @@ export default {
...mapActions('FinancialRules', ['reset']), ...mapActions('FinancialRules', ['reset']),
...mapMutations('FinancialRules', ['toggle', 'set']), ...mapMutations('FinancialRules', ['toggle', 'set']),
goodsSelectChange() { goodsSelectChange(item) {
this.$forceUpdate() // console.log(item)
console.log(this.classificationObj) // this.$forceUpdate()
// console.log(this.classificationObj.goodsTypeGroupRelations)
// this.$emit('assignGoodsList', this.classificationObj.goodsTypeGroupRelations)
// console.log(this.classificationObj)
},
getParams() {
return this.classificationObj
} }
// song() {
// return 111
// }
} }
} }
</script> </script>
......
...@@ -115,18 +115,23 @@ ...@@ -115,18 +115,23 @@
:name="item.name" :name="item.name"
:closable="idx!=0"> :closable="idx!=0">
<span slot="label"><i class="el-icon-warning car-error-txt" />{{ item.title }} </span> <span slot="label"><i class="el-icon-warning car-error-txt" />{{ item.title }} </span>
<div class="classificationCptContainer">
<classificationCpt :goods-list="goodsTypeGroupRelations"
:ref="`classification${item.name}`"
:goods-select-list="goodsSelectList"
:tabindex="idx"
@assignGoodsList="assignGoodsList"
@deleteGoodsItem="deleteGoodsItem" />
</div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane key="add" <el-tab-pane key="add"
v-if="addVisible"
name="add"> name="add">
<!-- //这是增加的按钮 --> <!-- //这是增加的按钮 -->
<span slot="label" <span slot="label"
style="padding: 8px;font-size:20px;font-weight:bold;">+</span> style="padding: 8px;font-size:20px;font-weight:bold;">+</span>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<div class="classificationCptContainer">
<classificationCpt :goods-list="goodsTypeGroupRelations" />
</div>
<div class="footer"> <div class="footer">
<el-button>取消</el-button> <el-button>取消</el-button>
<el-button type="primary">确认</el-button> <el-button type="primary">确认</el-button>
...@@ -172,25 +177,25 @@ export default { ...@@ -172,25 +177,25 @@ export default {
financialCalculationVisible: false, financialCalculationVisible: false,
tipsDialogVisible: false, tipsDialogVisible: false,
goodsTypeGroupRelations: [ goodsTypeGroupRelations: [
{ goodsType: 1, goodsTypeName: '商品1', label: '商品1' }, { goodsType: 1, goodsTypeName: '商品1' },
{ goodsType: 2, goodsTypeName: '商品2', label: '商品1' }, { goodsType: 2, goodsTypeName: '商品2' },
{ goodsType: 3, goodsTypeName: '商品3', label: '商品1' }, { goodsType: 3, goodsTypeName: '商品3' },
{ goodsType: 4, goodsTypeName: '商品4', label: '商品1' }, { goodsType: 4, goodsTypeName: '商品4' },
{ goodsType: 5, goodsTypeName: '商品5', label: '商品1' }, { goodsType: 5, goodsTypeName: '商品5' },
{ goodsType: 6, goodsTypeName: '商品6', label: '商品1' } { goodsType: 6, goodsTypeName: '商品6' }
], ],
sceneList: Object.freeze(sceneList), sceneList: Object.freeze(sceneList),
tabsList: [{ name: '全部商品分类', showIcon: false }], // tabsList: [{ name: '全部商品分类', showIcon: false }],
// tabsIndex: '1', // tabsIndex: '1',
editableTabsValue: '1', editableTabsValue: '1',
currentIndex: 1, currentIndex: 1,
addIndex: 1, addIndex: 1,
tabIndex: 1, tabIndex: 1,
editableTabs: [{ editableTabs: [{
title: '全部分类', title: '全部商品分类',
name: '1' name: '1'
}], }],
goodsSelectList: [{ goodsType: 6, goodsTypeName: '商品6' }],
financialObj: { financialObj: {
smsCode: '', smsCode: '',
merchantId: '123456', merchantId: '123456',
...@@ -285,11 +290,24 @@ export default { ...@@ -285,11 +290,24 @@ export default {
computed: { computed: {
...mapState({ ...mapState({
// .FinancialRules.active // .FinancialRules.active
test: (state) => state.FinancialRules.active test: (state) => state.FinancialRules.active,
productType: (state) => state.d2admin.base.productType
}), }),
routerInfo() { routerInfo() {
// console.log(this.$route) // console.log(this.$route)
return JSON.parse(this.$route.query.params) return this.$route.query.params ? JSON.parse(this.$route.query.params) : ''
},
addVisible() {
// return false
// 已选中的小于全部商品即可追加
const length1 = this.goodsTypeGroupRelations.length
const length2 = this.editableTabs.length - 1
// console.log(length2)
const length3 = this.goodsSelectList.length
// console.log(length2 < length1)
// console.log(length2 < length3)
console.log((length1 - length3) > 0 && length1 > length2)
return (length1 - length3) > 0 && length1 > length2
} }
}, },
mounted() { mounted() {
...@@ -299,6 +317,7 @@ export default { ...@@ -299,6 +317,7 @@ export default {
this.initSettleTimeObj() this.initSettleTimeObj()
this.getMerchantLevel(this.merchantId, 'merchantLevelList') this.getMerchantLevel(this.merchantId, 'merchantLevelList')
this.getMerchantLevel(this.yqMerchantId, 'PlatformLevelList') this.getMerchantLevel(this.yqMerchantId, 'PlatformLevelList')
this.initBaseData()
}, },
methods: { methods: {
...@@ -307,8 +326,25 @@ export default { ...@@ -307,8 +326,25 @@ export default {
this.settleTimeObj[settleTimeType == 1 ? 'first' : 'second'] = settleTime this.settleTimeObj[settleTimeType == 1 ? 'first' : 'second'] = settleTime
}, },
...mapActions('FinancialRules', ['reset']), ...mapActions('FinancialRules', ['reset']),
// ...mapActions({
// get: 'd2admin/base/get'
// }),
...mapMutations('FinancialRules', ['toggle', 'set']), ...mapMutations('FinancialRules', ['toggle', 'set']),
initBaseData() {
this.goodsTypeGroupRelations = deepClone(this.productType)
},
assignGoodsList(list) {
// goodsSelectList =
// console.log(list)
const newDatas = [...this.goodsSelectList, ...list]
const d = []
const hash = {}
this.goodsSelectList = newDatas.reduce((item, next) => {
hash[next.goodsType] ? '' : hash[next.goodsType] = true && item.push(next)
return item
}, [])
console.log(d)
},
getParams() { getParams() {
var realityPlatform = this.baseData.PlatformLevelList.find(item => item.merchantId == this.financialObj.realityPlatformMerchantId) var realityPlatform = this.baseData.PlatformLevelList.find(item => item.merchantId == this.financialObj.realityPlatformMerchantId)
var realityMerchant = this.baseData.merchantLevelList.find(item => item.merchantId == this.financialObj.realityShopMerchantId) var realityMerchant = this.baseData.merchantLevelList.find(item => item.merchantId == this.financialObj.realityShopMerchantId)
...@@ -338,7 +374,7 @@ export default { ...@@ -338,7 +374,7 @@ export default {
// this.baseData[name] = [] // this.baseData[name] = []
// 去掉园区店级别的 // 去掉园区店级别的
getMerchantLevelApi(params).then(res => { getMerchantLevelApi(params).then(res => {
console.log('res', res) // console.log('res', res)
// 取消渠道判断 // 取消渠道判断
// var userTypeList = this.smsForm.channelType === 2 ? ghUserType : userType // var userTypeList = this.smsForm.channelType === 2 ? ghUserType : userType
const attrToVal = deepClone(attrToValOptions) const attrToVal = deepClone(attrToValOptions)
...@@ -402,6 +438,15 @@ export default { ...@@ -402,6 +438,15 @@ export default {
if (this.editableTabs.length <= 1) { if (this.editableTabs.length <= 1) {
return false return false
} }
// console.log(`classification${targetName}`)
// 去除对应关闭tab下已选的商品
const childCop = this.$refs[`classification${targetName}`][0]
const childParams = childCop.getParams()
this.deleteSelectGoodsList(childParams.goodsTypeGroupRelations)
// const childCop = this.$refs.test
// console.log()
// console.log(childCop.song())
// const selectList = childCop.song()
var self = this var self = this
const tabs = self.editableTabs const tabs = self.editableTabs
let activeName = self.editableTabsValue let activeName = self.editableTabsValue
...@@ -432,6 +477,19 @@ export default { ...@@ -432,6 +477,19 @@ export default {
type: 'success', type: 'success',
message: '删除成功!' message: '删除成功!'
}) })
},
deleteGoodsItem(item) {
// clg
this.goodsSelectList = this.goodsSelectList.filter(el => el.goodsType != item.goodsType)
},
deleteSelectGoodsList(list) {
// console.log(list)
this.goodsSelectList = this.goodsSelectList.reduce((arr, item) => {
if (list.findIndex(el => item.goodsType == el.goodsType) == -1) {
arr.push(item)
}
return arr
}, [])
} }
} }
} }
......
...@@ -244,7 +244,8 @@ import { ...@@ -244,7 +244,8 @@ import {
userTypeList, userTypeList,
ghUserTypeList, ghUserTypeList,
merchantClassifyList, merchantClassifyList,
sceneList sceneList,
sceneCodeList
} from "@/common/constants.js" } from "@/common/constants.js"
import relateStoreMerDialog from "./components/relateStoreMerDialog" import relateStoreMerDialog from "./components/relateStoreMerDialog"
import relateMerDialog from "./components/relateMerDialog" import relateMerDialog from "./components/relateMerDialog"
...@@ -555,21 +556,22 @@ export default { ...@@ -555,21 +556,22 @@ export default {
confLabel: "线下对账" confLabel: "线下对账"
} }
], ],
sceneTypeList: [ sceneTypeList: sceneCodeList
{ // [
confId: 0, // {
confLabel: '1.0新车车损升级' // confId: 0,
}, { // confLabel: '1.0新车车损升级'
confId: 1, // }, {
confLabel: '1.1次新车精品升级' // confId: 1,
}, { // confLabel: '1.1次新车精品升级'
confId: 2, // }, {
confLabel: '1.2次新车膨胀金活动' // confId: 2,
}, { // confLabel: '1.2次新车膨胀金活动'
confId: 3, // }, {
confLabel: '1.3售后直播众筹活动' // confId: 3,
} // confLabel: '1.3售后直播众筹活动'
] // }
// ]
}, },
defaultProps: { defaultProps: {
children: "childs", children: "childs",
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
<script> <script>
import { addGoodsCategory, editGoodsCategory } from '@api/sceneCategory' import { addGoodsCategory, editGoodsCategory } from '@api/sceneCategory'
import { deepClone } from '@/common/util' import { deepClone } from '@/common/util'
import { sceneCodeList } from '@/common/constants.js'
export default { export default {
name: 'EditCategoryDialog', name: 'EditCategoryDialog',
data() { data() {
...@@ -64,19 +65,7 @@ export default { ...@@ -64,19 +65,7 @@ export default {
{ {
confId: '', confId: '',
confLabel: '全部' confLabel: '全部'
}, { }, ...sceneCodeList
confId: 0,
confLabel: '1.0新车车损升级'
}, {
confId: 1,
confLabel: '1.1次新车精品升级'
}, {
confId: 2,
confLabel: '1.2次新车膨胀金活动'
}, {
confId: 3,
confLabel: '1.3售后直播众筹活动'
}
] ]
} }
} }
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
:search-form="searchForm" :search-form="searchForm"
:table-params="tableParams" :table-params="tableParams"
:get-list-api="getListApi" :get-list-api="getListApi"
:hasNum="false" :has-num="false"
:before-search-fn="beforeSearchFn"> :before-search-fn="beforeSearchFn">
<div slot="auth-button" <div slot="auth-button"
slot-scope="scope"> slot-scope="scope">
...@@ -51,8 +51,9 @@ ...@@ -51,8 +51,9 @@
import { Util } from '@/common/util' import { Util } from '@/common/util'
import relationCategoryDialog from './relationCategoryDialog' import relationCategoryDialog from './relationCategoryDialog'
import { featuredGoodsList, getCategoryList } from '@api/sceneCategory' import { featuredGoodsList, getCategoryList } from '@api/sceneCategory'
import { sceneList } from '@/common/constants.js'
export default { export default {
name: 'sceneList', name: 'SceneList',
data() { data() {
return { return {
searchForm: { searchForm: {
...@@ -102,16 +103,16 @@ export default { ...@@ -102,16 +103,16 @@ export default {
} }
}, { }, {
label: '场景名', label: '场景名',
prop: 'sceneName', prop: 'sceneName'
}, { }, {
label: '类别', label: '类别',
prop: 'typeName', prop: 'typeName'
}, { }, {
label: '特色产品', label: '特色产品',
prop: 'featuredGoodsName', prop: 'featuredGoodsName'
}, { }, {
label: '关联类目', label: '关联类目',
prop: 'categoryName', prop: 'categoryName'
}, { }, {
label: '最近更新日期', label: '最近更新日期',
prop: 'updatedDate', prop: 'updatedDate',
...@@ -137,21 +138,7 @@ export default { ...@@ -137,21 +138,7 @@ export default {
confLabel: '1.3' confLabel: '1.3'
} }
], ],
sceneTypeList: [ sceneTypeList: sceneList,
{
confId: 0,
confLabel: '1.0新车车损升级'
}, {
confId: 1,
confLabel: '1.1次新车精品升级'
}, {
confId: 2,
confLabel: '1.2次新车膨胀金活动'
}, {
confId: 3,
confLabel: '1.3售后直播众筹活动'
}
],
categoryList: [] categoryList: []
}, },
categoryVisible: false, categoryVisible: false,
...@@ -212,7 +199,7 @@ export default { ...@@ -212,7 +199,7 @@ export default {
}, },
queryCategoryList() { queryCategoryList() {
let params = { currentPage: 1, pageSize: 10000 } const params = { currentPage: 1, pageSize: 10000 }
getCategoryList(params).then((res) => { getCategoryList(params).then((res) => {
this.baseData.categoryList = res.list this.baseData.categoryList = res.list
this.getOptionsList() this.getOptionsList()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!