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
......
import request from './request'
import request from "./request"
// const path = 'dj.api.'
const path2 = 'dj.api.smartcarlife.'
const path2 = "dj.api.smartcarlife."
export function getSummary(data) {
data.method = `${path2}goodsOrderProfitAllocation.statistics`
......@@ -45,10 +45,16 @@ export function getServiceListApi(data) {
export function getServiceSummaryApi(data) {
data.method = `${path2}goodsOrderProfitAllocation.count.service.merchant`
return request(data, 'post')
return request(data, "post")
}
export function exportAccountStatement(data) {
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 {
async ([channelType, productType]) => {
state.channelType = channelType
state.productType = productType
console.log(productType, "productType")
await dispatch("save2db", {
name: "",
value: state
......
......@@ -16,11 +16,11 @@
<el-select v-model="infoForm.scene"
style="width:400px"
@change="changeScene">
<el-option v-for="item in baseData.sceneTypeList"
<el-option v-for="(item,index) in baseData.sceneTypeList"
:key="item.confId"
:label="item.confLabel"
:value="item.confId"
:disabled="item.disabled" />
:disabled="index" />
</el-select>
</el-form-item>
</el-form>
......@@ -60,6 +60,7 @@
import { serviceGetMerchantList, getyqMerchantList, getServiceList, querySceneRefByShop, addOrUpdateSceneMerchantRef } from '@api/merchant'
import merchantChoose from "./merchantChoose"
import { deepClone } from '@/common/util'
import { sceneCodeList } from '@/common/constants.js'
export default {
name: 'RelateMerDialog',
components: {
......@@ -81,23 +82,24 @@ export default {
// ]
},
baseData: {
sceneTypeList: [
{
confId: 0,
confLabel: '1.0新车车损升级',
disabled: true
}, {
confId: 1,
confLabel: '1.1次新车精品升级'
}, {
confId: 2,
confLabel: '1.2次新车膨胀金活动',
disabled: true
}, {
confId: 3,
confLabel: '1.3售后直播众筹活动'
}
]
sceneTypeList: sceneCodeList
// [
// {
// confId: 0,
// confLabel: '1.0新车车损升级',
// disabled: true
// }, {
// confId: 1,
// confLabel: '1.1次新车精品升级'
// }, {
// confId: 2,
// confLabel: '1.2次新车膨胀金活动',
// disabled: true
// }, {
// confId: 3,
// confLabel: '1.3售后直播众筹活动'
// }
// ]
},
store4sVisible: true,
yqStoreVisible: true,
......
......@@ -10,7 +10,8 @@
分账品类
<!-- <span class="title-tips"></span> -->
</p>
<el-form-item label="选择商品:"
<el-form-item v-if="tabindex"
label="选择商品:"
prop="goodsTypeGroupRelations"
required>
<!-- collapse-tags -->
......@@ -21,11 +22,14 @@
placeholder="请选择商品">
<el-option v-for="item in goodsList"
:key="item.goodsType"
:label="2222"
:label="item.goodsTypeName"
:disabled="item|filterItem(disabledList)"
:value="item" />
</el-select>
</el-form-item>
<p v-if="!tabindex">全部商品</p>
<!-- <p>区别</p> -->
</el-form>
<!-- <div>classificationCpt</div> -->
......@@ -55,6 +59,12 @@ export default {
type: Array,
// 必要
required: true
},
goodsSelectList: {
type: Array
},
tabindex: {
default: 0
}
},
data() {
......@@ -74,9 +84,52 @@ export default {
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() {
// console.log(this.test, 'test')
},
......@@ -85,10 +138,19 @@ export default {
...mapActions('FinancialRules', ['reset']),
...mapMutations('FinancialRules', ['toggle', 'set']),
goodsSelectChange() {
this.$forceUpdate()
console.log(this.classificationObj)
goodsSelectChange(item) {
// console.log(item)
// 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>
......
......@@ -115,18 +115,23 @@
:name="item.name"
:closable="idx!=0">
<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 key="add"
v-if="addVisible"
name="add">
<!-- //这是增加的按钮 -->
<span slot="label"
style="padding: 8px;font-size:20px;font-weight:bold;">+</span>
</el-tab-pane>
</el-tabs>
<div class="classificationCptContainer">
<classificationCpt :goods-list="goodsTypeGroupRelations" />
</div>
<div class="footer">
<el-button>取消</el-button>
<el-button type="primary">确认</el-button>
......@@ -172,25 +177,25 @@ export default {
financialCalculationVisible: false,
tipsDialogVisible: false,
goodsTypeGroupRelations: [
{ goodsType: 1, goodsTypeName: '商品1', label: '商品1' },
{ goodsType: 2, goodsTypeName: '商品2', label: '商品1' },
{ goodsType: 3, goodsTypeName: '商品3', label: '商品1' },
{ goodsType: 4, goodsTypeName: '商品4', label: '商品1' },
{ goodsType: 5, goodsTypeName: '商品5', label: '商品1' },
{ goodsType: 6, goodsTypeName: '商品6', label: '商品1' }
{ goodsType: 1, goodsTypeName: '商品1' },
{ goodsType: 2, goodsTypeName: '商品2' },
{ goodsType: 3, goodsTypeName: '商品3' },
{ goodsType: 4, goodsTypeName: '商品4' },
{ goodsType: 5, goodsTypeName: '商品5' },
{ goodsType: 6, goodsTypeName: '商品6' }
],
sceneList: Object.freeze(sceneList),
tabsList: [{ name: '全部商品分类', showIcon: false }],
// tabsList: [{ name: '全部商品分类', showIcon: false }],
// tabsIndex: '1',
editableTabsValue: '1',
currentIndex: 1,
addIndex: 1,
tabIndex: 1,
editableTabs: [{
title: '全部分类',
title: '全部商品分类',
name: '1'
}],
goodsSelectList: [{ goodsType: 6, goodsTypeName: '商品6' }],
financialObj: {
smsCode: '',
merchantId: '123456',
......@@ -285,11 +290,24 @@ export default {
computed: {
...mapState({
// .FinancialRules.active
test: (state) => state.FinancialRules.active
test: (state) => state.FinancialRules.active,
productType: (state) => state.d2admin.base.productType
}),
routerInfo() {
// 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() {
......@@ -299,6 +317,7 @@ export default {
this.initSettleTimeObj()
this.getMerchantLevel(this.merchantId, 'merchantLevelList')
this.getMerchantLevel(this.yqMerchantId, 'PlatformLevelList')
this.initBaseData()
},
methods: {
......@@ -307,8 +326,25 @@ export default {
this.settleTimeObj[settleTimeType == 1 ? 'first' : 'second'] = settleTime
},
...mapActions('FinancialRules', ['reset']),
// ...mapActions({
// get: 'd2admin/base/get'
// }),
...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() {
var realityPlatform = this.baseData.PlatformLevelList.find(item => item.merchantId == this.financialObj.realityPlatformMerchantId)
var realityMerchant = this.baseData.merchantLevelList.find(item => item.merchantId == this.financialObj.realityShopMerchantId)
......@@ -338,7 +374,7 @@ export default {
// this.baseData[name] = []
// 去掉园区店级别的
getMerchantLevelApi(params).then(res => {
console.log('res', res)
// console.log('res', res)
// 取消渠道判断
// var userTypeList = this.smsForm.channelType === 2 ? ghUserType : userType
const attrToVal = deepClone(attrToValOptions)
......@@ -402,6 +438,15 @@ export default {
if (this.editableTabs.length <= 1) {
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
const tabs = self.editableTabs
let activeName = self.editableTabsValue
......@@ -432,6 +477,19 @@ export default {
type: 'success',
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 {
userTypeList,
ghUserTypeList,
merchantClassifyList,
sceneList
sceneList,
sceneCodeList
} from "@/common/constants.js"
import relateStoreMerDialog from "./components/relateStoreMerDialog"
import relateMerDialog from "./components/relateMerDialog"
......@@ -555,21 +556,22 @@ export default {
confLabel: "线下对账"
}
],
sceneTypeList: [
{
confId: 0,
confLabel: '1.0新车车损升级'
}, {
confId: 1,
confLabel: '1.1次新车精品升级'
}, {
confId: 2,
confLabel: '1.2次新车膨胀金活动'
}, {
confId: 3,
confLabel: '1.3售后直播众筹活动'
}
]
sceneTypeList: sceneCodeList
// [
// {
// confId: 0,
// confLabel: '1.0新车车损升级'
// }, {
// confId: 1,
// confLabel: '1.1次新车精品升级'
// }, {
// confId: 2,
// confLabel: '1.2次新车膨胀金活动'
// }, {
// confId: 3,
// confLabel: '1.3售后直播众筹活动'
// }
// ]
},
defaultProps: {
children: "childs",
......
......@@ -39,6 +39,7 @@
<script>
import { addGoodsCategory, editGoodsCategory } from '@api/sceneCategory'
import { deepClone } from '@/common/util'
import { sceneCodeList } from '@/common/constants.js'
export default {
name: 'EditCategoryDialog',
data() {
......@@ -64,19 +65,7 @@ export default {
{
confId: '',
confLabel: '全部'
}, {
confId: 0,
confLabel: '1.0新车车损升级'
}, {
confId: 1,
confLabel: '1.1次新车精品升级'
}, {
confId: 2,
confLabel: '1.2次新车膨胀金活动'
}, {
confId: 3,
confLabel: '1.3售后直播众筹活动'
}
}, ...sceneCodeList
]
}
}
......
......@@ -30,7 +30,7 @@
:search-form="searchForm"
:table-params="tableParams"
:get-list-api="getListApi"
:hasNum="false"
:has-num="false"
:before-search-fn="beforeSearchFn">
<div slot="auth-button"
slot-scope="scope">
......@@ -51,8 +51,9 @@
import { Util } from '@/common/util'
import relationCategoryDialog from './relationCategoryDialog'
import { featuredGoodsList, getCategoryList } from '@api/sceneCategory'
import { sceneList } from '@/common/constants.js'
export default {
name: 'sceneList',
name: 'SceneList',
data() {
return {
searchForm: {
......@@ -102,16 +103,16 @@ export default {
}
}, {
label: '场景名',
prop: 'sceneName',
prop: 'sceneName'
}, {
label: '类别',
prop: 'typeName',
prop: 'typeName'
}, {
label: '特色产品',
prop: 'featuredGoodsName',
prop: 'featuredGoodsName'
}, {
label: '关联类目',
prop: 'categoryName',
prop: 'categoryName'
}, {
label: '最近更新日期',
prop: 'updatedDate',
......@@ -137,21 +138,7 @@ export default {
confLabel: '1.3'
}
],
sceneTypeList: [
{
confId: 0,
confLabel: '1.0新车车损升级'
}, {
confId: 1,
confLabel: '1.1次新车精品升级'
}, {
confId: 2,
confLabel: '1.2次新车膨胀金活动'
}, {
confId: 3,
confLabel: '1.3售后直播众筹活动'
}
],
sceneTypeList: sceneList,
categoryList: []
},
categoryVisible: false,
......@@ -212,7 +199,7 @@ export default {
},
queryCategoryList() {
let params = { currentPage: 1, pageSize: 10000 }
const params = { currentPage: 1, pageSize: 10000 }
getCategoryList(params).then((res) => {
this.baseData.categoryList = res.list
this.getOptionsList()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!