Commit 00736a2f by 前端

Merge branch 'sass+v4.25.1' into 'master'

Sass+v4.25.1

See merge request !15
2 parents db4ca2ce ba8c638e
...@@ -1901,6 +1901,51 @@ ...@@ -1901,6 +1901,51 @@
"integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
"dev": true "dev": true
}, },
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"ssri": { "ssri": {
"version": "8.0.1", "version": "8.0.1",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz",
...@@ -1909,6 +1954,28 @@ ...@@ -1909,6 +1954,28 @@
"requires": { "requires": {
"minipass": "^3.1.1" "minipass": "^3.1.1"
} }
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
}
} }
} }
}, },
...@@ -13222,75 +13289,6 @@ ...@@ -13222,75 +13289,6 @@
} }
} }
}, },
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-router": { "vue-router": {
"version": "3.6.5", "version": "3.6.5",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.6.5.tgz", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.6.5.tgz",
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
</template> </template>
<script> <script>
import { mapState, mapActions } from 'vuex'
export default { export default {
name: 'report-app', name: 'report-app',
props: { props: {
...@@ -20,6 +21,14 @@ export default { ...@@ -20,6 +21,14 @@ export default {
created() { created() {
this.myMsg = this.msg this.myMsg = this.msg
this.myMessage = this.message this.myMessage = this.message
},
mounted(){
this.getCarSeriList()
},
methods:{
...mapActions({
getCarSeriList: 'channel/getCarSeriList'
}),
} }
} }
</script> </script>
......
...@@ -18,7 +18,6 @@ const getCategoryListApi = params => { ...@@ -18,7 +18,6 @@ const getCategoryListApi = params => {
reject() reject()
}) })
} }
console.log(params, '8888')
params.method = 'scrm.api.shopmall.discover.category.page' params.method = 'scrm.api.shopmall.discover.category.page'
return http({ return http({
url, url,
...@@ -48,9 +47,20 @@ const batchAddCategoryApi = params => { ...@@ -48,9 +47,20 @@ const batchAddCategoryApi = params => {
}) })
} }
const batchDetailApi = params => {
params.method = 'scrm.api.shopmall.discover.category.detail'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
export default { export default {
addCategoryApi, addCategoryApi,
getCategoryListApi, getCategoryListApi,
delCategoryApi, delCategoryApi,
batchAddCategoryApi batchAddCategoryApi,
batchDetailApi
} }
...@@ -23,12 +23,12 @@ export default { ...@@ -23,12 +23,12 @@ export default {
}, },
methods:{ methods:{
inputFn(e){ inputFn(e){
e = e ? String(e) : '' e = e || e==0 ? String(e) : ''
this.intDigit = this.intDigit || 6 this.intDigit = this.intDigit || 6
this.precise = this.precise || 2 this.precise = this.precise || this.precise==0 || this.precise=='0' ? this.precise : 2
let value = e let value = e
if(this.maxVal){ if(this.maxVal && +this.maxVal<= +e){
if(+this.maxVal<= +e) value = this.maxVal //加等号是因为 '500' == '500.' 导致多了点 value = this.maxVal //加等号是因为 '500' == '500.' 导致多了点
}else{ }else{
const intDigitReg = this.intDigit == -1 ? `(^\\d+)(\\.\\d+)?` : `(^\\d{${this.intDigit}})\\d+(\\.\\d+)?` const intDigitReg = this.intDigit == -1 ? `(^\\d+)(\\.\\d+)?` : `(^\\d{${this.intDigit}})\\d+(\\.\\d+)?`
value = e.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(new RegExp(intDigitReg,'g'), '$1').replace('.', '$#$') value = e.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(new RegExp(intDigitReg,'g'), '$1').replace('.', '$#$')
...@@ -39,6 +39,7 @@ export default { ...@@ -39,6 +39,7 @@ export default {
blurFn(e){ blurFn(e){
let value = e.target.value let value = e.target.value
if(this.minVal && +this.minVal>=value) value = this.minVal if(this.minVal && +this.minVal>=value) value = this.minVal
if(value && value.charAt(value.length-1)=='.') value = value.substr(0 ,value.length-1)
this.$emit('input', value) this.$emit('input', value)
} }
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<span class="combi-form-label" :style="{ width: item.labelWidth || labelWidth }">{{ item.label }}:</span> <span class="combi-form-label" :style="{ width: item.labelWidth || labelWidth }">{{ item.label }}:</span>
</span> </span>
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot> <slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<span v-else-if="item.type === 'showTxt'">{{ formObj[item.name] }}</span> <span v-else-if="item.type === 'showTxt'">{{ !formObj[item.name] && formObj[item.name]!==0 ? '--' : formObj[item.name] }}</span>
<div v-else-if="item.type === 'input'"> <div v-else-if="item.type === 'input'">
<el-input :placeholder="item.placeholder || '请输入' + item.label" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :prefix-icon="item.prefixIcon" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)"> <el-input :placeholder="item.placeholder || '请输入' + item.label" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :prefix-icon="item.prefixIcon" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)">
<span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span> <span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<div v-else-if="item.type === 'radio'"> <div v-else-if="item.type === 'radio'">
<el-radio-group v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :disabled="item.isDisabled" @change="item.handleRadioChange"> <el-radio-group v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :disabled="item.isDisabled" @change="item.handleRadioChange">
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :disabled="subItem.isDisabled" :label="subItem[item.optionId]"> <el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :disabled="subItem.isDisabled" :label="subItem[item.optionId]">
{{ subItem[item.optionLabel] }} {{subItem[item.optionLabel]}}
<slot :name="subItem.suffixSonSlot" :scope="subItem"></slot> <slot :name="subItem.suffixSonSlot" :scope="subItem"></slot>
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
......
...@@ -3,6 +3,8 @@ export default { ...@@ -3,6 +3,8 @@ export default {
namespaced: true, namespaced: true,
state: { state: {
videoList: [], videoList: [],
carSeriesData: [],
searchList: [],
topicDetail: {}, topicDetail: {},
merchantId: '', merchantId: '',
channelStyle: 1, channelStyle: 1,
...@@ -27,7 +29,23 @@ export default { ...@@ -27,7 +29,23 @@ export default {
}, },
['SET_CHANNEL_TYPE'](state, payload) { ['SET_CHANNEL_TYPE'](state, payload) {
state.channelType = payload.channelType state.channelType = payload.channelType
} },
['SET_CARSERI_LIST'](state, payload) {
state.carSeriesData = payload.list || []
},
['SET_SEARCH_LIST'](state, payload) {
let list = []
payload.list?.forEach(item =>{
list.push({id: `${item.id}`, value:item.name})
item.childs?.forEach(ele =>{
list.push({id: `${item.id}-${ele.id}`, value:ele.name})
ele.childs?.forEach(o =>{
list.push({id: `${item.id}-${ele.id}-${o.id}`, value:o.name})
})
})
})
state.searchList = list
},
}, },
actions: { actions: {
// 获取视频列表 // 获取视频列表
...@@ -58,6 +76,14 @@ export default { ...@@ -58,6 +76,14 @@ export default {
} }
} }
}) })
},
getCarSeriList(conText, payload) {
apis.case.getCarSeriesApi({needCarSeries:true}).then(res => {
if(res?.length){
conText.commit('SET_CARSERI_LIST', { list: res })
conText.commit('SET_SEARCH_LIST', { list: res })
}
})
} }
} }
} }
...@@ -116,10 +116,8 @@ export default{ ...@@ -116,10 +116,8 @@ export default{
} }
return pre + curW return pre + curW
},0); },0);
console.log(curIdx)
this.colList = curIdx >-1 ? this.tabList.slice(curIdx) : [] this.colList = curIdx >-1 ? this.tabList.slice(curIdx) : []
this.rowList = curIdx >-1 ? this.tabList.slice(0, curIdx) : this.tabList this.rowList = curIdx >-1 ? this.tabList.slice(0, curIdx) : this.tabList
console.log(this.rowList)
}) })
}, },
selectNav(item){ selectNav(item){
...@@ -195,6 +193,7 @@ export default{ ...@@ -195,6 +193,7 @@ export default{
margin-right: 1px; margin-right: 1px;
color: #666666; color: #666666;
letter-spacing: 0; letter-spacing: 0;
font-size: 14px;
text-align: center; text-align: center;
cursor: pointer; cursor: pointer;
.del-icon{ .del-icon{
......
<template> <template>
<div class="category-list-ctnr"> <div class="category-list-ctnr">
<GLTabs class="tabs" v-model="activeName" :tabPaneList="tabPaneList" @tab-click="handleClick"></GLTabs> <GLTabs ref='GLTabs' class="tabs" v-model="activeName" :tabPaneList="tabPaneList"
<pullDownNav @confirmDialog="handleEdit" @inputBlur="inputBlur" @delete="delCategory" v-model="curMainCategoryId" :tabList="mainCategoryList" :defaultProps="{id: 'id', name: 'categoryName'}"></pullDownNav> @tab-click="handleClick" removeTab="removeTab"></GLTabs>
<template v-if="activeName =='1'">
<pullDownNav @confirmDialog="handleEdit" @inputBlur="inputBlur" @delete="delCategory" v-model="curMainCategoryId"
:tabList="mainCategoryList" :defaultProps="{id: 'id', name: 'categoryName'}"></pullDownNav>
<div class="main-wrap"> <div class="main-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">
<span class="table-title">二级分类列表</span> <span class="table-title">二级分类列表</span>
<el-button class="operate-btn" type="primary" size="small" @click="editCategory">新增二级分类</el-button> <el-button class="operate-btn" type="primary" size="small" @click="editCategory">新增二级分类</el-button>
</div> </div>
<GLTable ref="categoryRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :beforeSearchFn="beforeSearchFn" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun"> <GLTable ref="categoryRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm"
:beforeSearchFn="beforeSearchFn" :tableParams="tableParams" :pageConf="pageConf"
@setTableFinishFun="setTableFinishFun">
<div slot="brandSlot"> <div slot="brandSlot">
<span>{{ brandList.slice(0, 3).join('、') }}</span> <span>{{ brandList.slice(0, 3).join('、') }}</span>
<el-popover <el-popover
...@@ -16,7 +23,7 @@ ...@@ -16,7 +23,7 @@
width="400" width="400"
trigger="hover"> trigger="hover">
<span> <span>
{{brandList.join('、')}} {{ brandList.join('、') }}
</span> </span>
<span class="more-brand" slot="reference">...[{{ brandList.length }}]</span> <span class="more-brand" slot="reference">...[{{ brandList.length }}]</span>
</el-popover> </el-popover>
...@@ -26,25 +33,33 @@ ...@@ -26,25 +33,33 @@
</div> </div>
</GLTable> </GLTable>
</div> </div>
</template>
<template v-if="activeName=='2'">
<ownerPreference></ownerPreference>
</template>
</div> </div>
</template> </template>
<script> <script>
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import pullDownNav from './components/pullDownNav' import pullDownNav from './components/pullDownNav'
export default { import ownerPreference from "views/category/ownerPreference";
export default {
name: 'App', name: 'App',
components:{ components: {
pullDownNav pullDownNav,
ownerPreference
}, },
data() { data() {
return { return {
activeName: '', activeName: '1',
curMainCategoryId: '', curMainCategoryId: '',
tabPaneList: [], tabPaneList: [],
mainCategoryList: [], mainCategoryList: [],
brandList:['丰田','本田','一汽大众','奔驰','宝马','奥迪','比亚迪'], brandList: ['丰田', '本田', '一汽大众', '奔驰', '宝马', '奥迪', '比亚迪'],
buttonList: [ buttonList: [
{ {
type: 'el-button', type: 'el-button',
...@@ -120,27 +135,40 @@ ...@@ -120,27 +135,40 @@
}, },
] ]
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' } pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'}
} }
}, },
created() { created() {
this.getChannelList() this.getChannelList()
}, },
watch:{
curMainCategoryId:{ beforeRouteEnter(to, from, next) {
handler(){ next(vm => {
if (from.path.indexOf('/category/ownerPreference/add') == 0) {
vm.activeName = '2'
}
})
},
watch: {
curMainCategoryId: {
handler() {
this.handleSearch() this.handleSearch()
}, },
deep: true deep: true
}, },
activeName:{ activeName: {
handler(){ handler(val) {
if (val == '1') {
this.getMainCategory() this.getMainCategory()
}
}, },
immediate: true,
deep: true deep: true
}, },
}, },
mounted() {}, mounted() {
},
methods: { methods: {
//获取频道名称 //获取频道名称
getChannelList() { getChannelList() {
...@@ -150,19 +178,27 @@ ...@@ -150,19 +178,27 @@
pageNum: 1 pageNum: 1
}) })
.then(res => { .then(res => {
if(res?.list?.length){ if (res?.list?.length) {
let tabPaneList = [] let tabPaneList = []
res.list.forEach(item => { res.list.forEach(item => {
if(item.channelType == 5 || item.channelType == 5){ if (item.channelType == 5 || item.channelType == 6) {
tabPaneList.push({label: item.channelName,name: item.channelType==5 ? 1 : 2 ,merchantChannelId: item.id}) tabPaneList.push({
label: item.channelName,
name: item.channelType == 5 ? '1' : '2',
merchantChannelId: item.id
})
} }
}) })
this.tabPaneList = tabPaneList this.tabPaneList = tabPaneList
this.activeName = tabPaneList[0].name
// 处理返回的tab值
// let tagName = sessionStorage.getItem('tagActive')
// this.activeName = tagName '' || tabPaneList[0].name
// this.activeName = _name
} }
}) })
}, },
getMainCategory(){ getMainCategory() {
const params = { const params = {
pageSize: 1000, pageSize: 1000,
pageNum: 1, pageNum: 1,
...@@ -170,21 +206,21 @@ ...@@ -170,21 +206,21 @@
categoryType: this.activeName categoryType: this.activeName
} }
this.$apis.category.getCategoryListApi(params).then(res => { this.$apis.category.getCategoryListApi(params).then(res => {
if(res?.list?.length){ if (res?.list?.length) {
this.mainCategoryList = res.list this.mainCategoryList = res.list
this.curMainCategoryId = res.list[0].id this.curMainCategoryId = res.list[0].id
}else{ } else {
this.curMainCategoryId = '' this.curMainCategoryId = ''
} }
}) })
}, },
inputBlur(e){ inputBlur(e) {
this.addCategory(e.value) this.addCategory(e.value)
}, },
handleEdit(e){ handleEdit(e) {
this.addCategory(e.categoryName, e.id) this.addCategory(e.categoryName, e.id)
}, },
delCategory(e, type){ delCategory(e, type) {
this.$confirm(`删除后数据将无法恢复,是否确认删除${e.categoryName}?`, '提示', { this.$confirm(`删除后数据将无法恢复,是否确认删除${e.categoryName}?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -192,10 +228,10 @@ ...@@ -192,10 +228,10 @@
callback: action => { callback: action => {
if (action == 'confirm') { if (action == 'confirm') {
this.$apis.category.delCategoryApi({id: e.id}).then(res => { this.$apis.category.delCategoryApi({id: e.id}).then(res => {
if(res){ if (res) {
this.$message.success('删除成功') this.$message.success('删除成功')
this.getMainCategory() this.getMainCategory()
if(type) { if (type) {
this.handleSearch() this.handleSearch()
} }
} }
...@@ -204,15 +240,15 @@ ...@@ -204,15 +240,15 @@
} }
}) })
}, },
addCategory(val, id){ addCategory(val, id) {
let params = { let params = {
categoryType: this.activeName, categoryType: this.activeName,
categoryLevel: 1, categoryLevel: 1,
categoryName: val categoryName: val
} }
if(id) params.id = id if (id) params.id = id
this.$apis.category.addCategoryApi(params).then(res => { this.$apis.category.addCategoryApi(params).then(res => {
if(res){ if (res) {
this.$message.success('新增成功') this.$message.success('新增成功')
this.getMainCategory() this.getMainCategory()
} }
...@@ -251,39 +287,40 @@ ...@@ -251,39 +287,40 @@
//接收到的数据为空 //接收到的数据为空
this.$refs.categoryRef.data.length ? (this.$refs.categoryRef.tableHeightValues = '') : this.$refs.categoryRef.setTableHeightFun() this.$refs.categoryRef.data.length ? (this.$refs.categoryRef.tableHeightValues = '') : this.$refs.categoryRef.setTableHeightFun()
}, },
editCategory(row={}) { editCategory(row = {}) {
if(!this.activeName) return this.$message.error('暂无频道') if (!this.activeName) return this.$message.error('暂无频道')
const target = this.mainCategoryList.find(item => item.id == this.curMainCategoryId) const target = this.mainCategoryList.find(item => item.id == this.curMainCategoryId)
if(!target) return this.$message.error('请选择一级分类') if (!target) return this.$message.error('请选择一级分类')
const params = { const params = {
categoryType: this.activeName, categoryType: this.activeName,
parentCategoryId: target.id, parentCategoryId: target.id,
parentCategoryName: target.categoryName parentCategoryName: target.categoryName
} }
if(row.id) { if (row.id) {
params.id = row.id params.id = row.id
params.name = row.categoryName params.name = row.categoryName
} }
const queryStr = encodeURIComponent(JSON.stringify(params)) const queryStr = encodeURIComponent(JSON.stringify(params))
this.$router.push({ path: `/category/add/`+queryStr,query: { $title: row.id ? '编辑二级分类' : '新增二级分类' }}) this.$router.push({path: `/category/add/` + queryStr, query: {$title: row.id ? '编辑二级分类' : '新增二级分类'}})
}
} }
} }
</script> }
</script>
<style scoped lang="scss"> <style scoped lang="scss">
.category-list-ctnr{ .category-list-ctnr {
.tabs{ .tabs {
margin-bottom: 16px; margin-bottom: 16px;
} }
.main-wrap{
.main-wrap {
background-color: #fff; background-color: #fff;
padding: 20px; padding: 20px;
} }
.more-brand{
.more-brand {
color: #5850FF; color: #5850FF;
cursor: pointer; cursor: pointer;
} }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="case-ctnr">
<div class="main-wrap">
<div class="global-title">{{ formObj.id ? '编辑分类' : '新增分类' }}</div>
<glsx-combi-form :isInline="false" class="glsx-combi-form" ref="baseInfoRef" labelWidth="154px"
defaultWidth="432px" :formObj.sync="formObj" :formData="formData" :formRules="myRule">
<div slot="videoCoverSlot">
<glsx-preview :picOptions="posterOptions" :imageUrlArr="formObj.videoCoverArr"
@change="changeChannelImg"></glsx-preview>
<div class="text-tip" style="margin: 0;">建议尺寸:120*120</div>
</div>
<div slot="selectBrandSlot">
<el-radio-group v-model="formObj.categoryStyle">
<el-radio :label="0">标准商品-竖向排列
</el-radio>
<el-radio :label="1">标准商品-横向排列
</el-radio>
<el-radio :label="2">种草样式</el-radio>
</el-radio-group>
<div class="category-style">
<el-popover
popper-class="tool-gltip"
placement="top-start"
width="200"
trigger="hover">
<img src="@/assets/category/vertical.png" style="width:300px;height:300px;"/>
<img slot="reference" src="@/assets/category/vertical.png">
</el-popover>
<el-popover
popper-class="tool-gltip"
placement="top-start"
width="200"
trigger="hover">
<img src="@/assets/category/transverse.png" style="width:300px;height:300px;"/>
<img slot="reference" src="@/assets/category/transverse.png">
</el-popover>
<el-popover
popper-class="tool-gltip"
placement="top-start"
width="200"
trigger="hover">
<img src="@/assets/category/recommend.png" style="width:300px;height:300px;"/>
<img slot="reference" src="@/assets/category/recommend.png">
</el-popover>
</div>
</div>
</glsx-combi-form>
</div>
<GLFooter>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleSave">确定</el-button>
</GLFooter>
</div>
</template>
<script>
import glsxCombiForm from '@/components/glsx-combi-form'
export default {
name: 'add',
components: {
glsxCombiForm,
},
data() {
return {
dialogVisible: false,
formObj: {
id: '',
categoryName: '',
categoryStyle: 0,
videoCoverArr: []
},
brandList: [],
posterOptions: {
width: '120px',
height: '120px',
key: 'posterImg',
isClose: true
},
myRule: {
categoryName: [{required: true, message: '请输入分类名称', trigger: 'change'}],
categoryImage: [{
required: true, validator: (rule, value, callback) => {
if (this.formObj.videoCoverArr?.length != 1) {
callback(new Error(`请上传分类图标`))
} else {
callback()
}
}, trigger: 'change'
}],
categoryStyle: [{
required: true, validator: (rule, value, callback) => {
if (this.formObj.brandType == 'null') {
callback(new Error(`请选择布局样式`))
} else {
callback()
}
}, trigger: 'blur'
}],
},
formData: [
{
label: '分类名称',
name: 'categoryName',
maxlength: 20,
showLimit: true,
type: 'input',
isDisabled: false
},
{
label: '分类图标',
name: 'categoryImage',
addHtml: 'videoCoverSlot'
},
{
label: '布局样式',
name: 'categoryStyle',
addHtml: 'selectBrandSlot'
}
],
}
},
created() {
this.formObj.id = this.$route.query.id || ''
if (this.formObj.id) {
this.getCaseDetailApi()
}
},
methods: {
changeChannelImg(val) {
this.$refs.baseInfoRef.$refs.formRef.validateField('coverUrl')
},
handleSave() {
this.$refs.baseInfoRef.$refs.formRef.validate(valid => {
if (valid) {
let params = JSON.parse(JSON.stringify(this.formObj))
params.categoryType = 2 //类型 1 配置升级 2 车主优选
params.categoryLevel = 1 //分类等级(1:一级分类,2:二级分类)
params.categoryImage = this.formObj.videoCoverArr[0]
delete params.videoCoverArr
if (!params.id) delete params.id
this.$apis.category.addCategoryApi(params).then(res => {
if (res) {
this.$message.success('操作成功')
this.handleCancel()
}
})
}
})
},
handleCancel() {
this.$route.query.name = '2';
this.$router.back()
},
getCaseDetailApi() {
this.$apis.category.batchDetailApi({id: this.$route.query.id}).then(res => {
if (res) {
const attrList = ['id', 'categoryName', 'categoryStyle']
attrList.forEach(key => {
this.formObj[key] = res[key]
})
this.formObj.videoCoverArr = [res.categoryImage]
}
})
}
}
}
</script>
<style scoped lang="scss">
.case-ctnr {
.glsx-combi-form {
padding: 20px;
background-color: #fff;
margin-bottom: 16px;
.brand-wrap {
margin-top: 8px;
width: 580px;
height: 80px;
background: #FFFFFF;
border: 1px solid #E8E8EA;
border-radius: 4px;
padding: 6px 8px;
overflow-y: auto;
.brand-item {
display: inline-block;
padding: 0 8px;
height: 24px;
color: #666666;
line-height: 24px;
background: #FAFBFE;
border: 1px solid #E5E5E5;
border-radius: 4px;
margin-right: 4px;
}
}
}
}
.category-style {
img {
width: 104px;
height: 102.6px;
margin-right: 65px;
}
}
</style>
<style>
.tool-gltip {
max-width: 340px!important;
width: 340px!important;
}
</style>
<template>
<div class="owner-ctnr">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="tableSearchForm" :formData="searchFormData"
@handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="operate-wrap">
<span class="table-title">分类列表</span>
<el-button class="operate-btn" type="primary" size="small" @click="addClassify()">新建分类</el-button>
</div>
<GLTable ref="categoryRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm"
:beforeSearchFn="beforeSearchFn" :tableParams="tableParams" :pageConf="pageConf"
@setTableFinishFun="setTableFinishFun">
<div slot="categoryImage" class="table-image" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.categoryImage"/>
<img class="img-36 pointer" slot="reference" :src="scope.scope.categoryImage"/>
</el-popover>
</div>
<div slot="categoryStyle" slot-scope="scope">
<div class="category-style" v-if="scope.scope.categoryStyle == 0">
<img src="@/assets/category/vertical.png">
<span>商品-竖向排列</span>
</div>
<div class="category-style" v-if="scope.scope.categoryStyle == 1">
<img src="@/assets/category/transverse.png">
<span>商品-横向排列</span>
</div>
<div class="category-style" v-if="scope.scope.categoryStyle == 2">
<img src="@/assets/category/recommend.png">
<span>种草模式</span>
</div>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
</div>
</template>
<script>
import url from 'assets/empty.png'
import bigView from 'components/big-view'
export default {
name: 'App',
components: {
// bigView
},
data() {
return {
tableSearchForm: {
// categoryType: 2,
// caseName: '',
// brandName: '',
// createDate: []
},
buttonList: [
{
type: 'el-button',
name: '编辑',
attrs: {
type: 'text',
fn: '编辑'
},
listeners: {
click: row => this.addClassify(row.scope, 0)
}
},
{
type: 'el-button',
name: '删除',
attrs: {
type: 'text',
fn: '删除'
},
listeners: {
click: row => this.delCate(row.scope)
}
}
],
searchForm: {},
url: url,
searchFormData: [
{
label: '分类名称',
name: 'categoryName',
type: 'input'
},
{
label: '创建日期',
name: 'createDate',
type: 'datePicker',
isClear: true,
customPickerOptions: {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate()))
if (date > yesterday) {
return true
}
return false
}
}
},
],
getListApi: this.$apis.category.getCategoryListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '分类名称',
prop: 'categoryName'
},
{
label: '分类图标',
addHtml: 'categoryImage',
width: 150
},
{
label: '分类布局',
addHtml: 'categoryStyle',
width: 220
},
{
label: '创建日期',
prop: 'createdDate'
},
{
label: '更新日期',
prop: 'updatedDate'
},
{
label: '操作人',
prop: 'updatedBy',
width: 150
},
]
},
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'}
}
},
created() {
},
mounted() {
},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.tableSearchForm))
params.categoryType = 2
params.categoryLevel = 1
if (this.tableSearchForm.createDate?.length) {
params.beginCreateTime = new Date(this.tableSearchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endCreateTime = new Date(this.tableSearchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm = this.getParams()
delete this.searchForm.createDate
resolve()
})
},
handleSearch() {
this.$refs.categoryRef.refreshTable()
},
handleReset() {
this.tableSearchForm = {
categoryName: '',
createDate: []
}
this.searchForm = {}
this.handleSearch()
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.categoryRef.data.length ? (this.$refs.categoryRef.tableHeightValues = '') : this.$refs.categoryRef.setTableHeightFun()
},
addClassify(row = {}, type) {
this.$router.push({
path: `/category/ownerPreference/add?id=${row.id || ''}&$title=${type ? '编辑' : '新增'}分类`
})
},
delCate({id, categoryName}) {
this.$confirm(`是否确认删除${categoryName} ?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis.category.delCategoryApi({id}).then(res => {
if (res) {
this.$message.success('删除成功')
this.handleSearch()
}
})
}
}
})
}
}
}
</script>
<style scoped lang="scss">
.owner-ctnr {
background-color: #fff;
padding: 20px;
.more-brand {
white-space: nowrap;
color: #5850FF;
cursor: pointer;
}
}
.category-style {
display: flex;
align-items: center;
img {
width: 36px;
margin-right: 8px;
}
}
</style>
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
<el-form-item label="频道子名称:" prop="channelChildName"> <el-form-item label="频道子名称:" prop="channelChildName">
<el-input v-model="channelForm.channelChildName" maxlength="12" show-word-limit></el-input> <el-input v-model="channelForm.channelChildName" maxlength="12" show-word-limit></el-input>
</el-form-item> </el-form-item>
<el-form-item label="频道顺序:" prop="sort">
<!-- <el-input v-model="channelForm.sort" show-word-limit></el-input> -->
<format-input :intDigit="4" :precise="0" show-word-limit v-model="channelForm.sort"></format-input>
</el-form-item>
<span v-if="channelForm.channelType == 1"> <span v-if="channelForm.channelType == 1">
<el-form-item label="频道主题:" prop="channelStyle"> <el-form-item label="频道主题:" prop="channelStyle">
<el-col :span="11" class="theme"></el-col> <el-col :span="11" class="theme"></el-col>
...@@ -31,6 +35,13 @@ ...@@ -31,6 +35,13 @@
<div class="el-form-item__error" v-if="channelImgFlag">请上传频道banner</div> <div class="el-form-item__error" v-if="channelImgFlag">请上传频道banner</div>
</el-form-item> </el-form-item>
<div class="text-tip">建议尺寸:750*448</div> <div class="text-tip">建议尺寸:750*448</div>
<template v-if="channelForm.channelType == 6">
<el-form-item label="门店频道banner图:" prop="storeBannerImg" style="margin-top: 15px">
<glsx-preview :picOptions="merchantPicOptions" :imageUrlArr="channelForm.storeBannerImgArr" @change="changeChannelImg"></glsx-preview>
<div class="el-form-item__error" v-if="channelImgFlag">请上传门店频道banner</div>
</el-form-item>
<div class="text-tip">建议尺寸:750*264</div>
</template>
</el-form> </el-form>
</div> </div>
</div> </div>
...@@ -70,8 +81,11 @@ export default { ...@@ -70,8 +81,11 @@ export default {
publicityImgArr: [], publicityImgArr: [],
publicityImg: '', publicityImg: '',
channelImg: '', channelImg: '',
storeBannerImg: '',
channelChildName: '', channelChildName: '',
channelImgArr: [] sort: '',
channelImgArr: [],
storeBannerImgArr: []
}, },
channelImgbgArr: ['banner1', 'banner2'], channelImgbgArr: ['banner1', 'banner2'],
channelOtherImgbgArr: ['membrane', 'crowd', 'activity'], channelOtherImgbgArr: ['membrane', 'crowd', 'activity'],
...@@ -82,6 +96,12 @@ export default { ...@@ -82,6 +96,12 @@ export default {
key: 'channelImg', key: 'channelImg',
isClose: true isClose: true
}, },
merchantPicOptions: {
width: '174px',
height: '104px',
key: 'storeBannerImg',
isClose: true
},
shareOptions: { shareOptions: {
width: '120px', width: '120px',
height: '90px', height: '90px',
...@@ -101,6 +121,14 @@ export default { ...@@ -101,6 +121,14 @@ export default {
channelImg: [{ required: true, message: '请上传频道banner', trigger: 'change' }], channelImg: [{ required: true, message: '请上传频道banner', trigger: 'change' }],
promotion: [{ required: true, message: '请输入频道分享文案', trigger: 'blur' }], promotion: [{ required: true, message: '请输入频道分享文案', trigger: 'blur' }],
channelChildName: [{ required: true, message: '请输入频道子名称', trigger: 'change' }], channelChildName: [{ required: true, message: '请输入频道子名称', trigger: 'change' }],
sort: [{ required: true, message: '请输入频道顺序', trigger: 'change' }],
storeBannerImg: [{ required: true,validator: (rule, value, callback) => {
if(this.channelForm.channelType == 6 && !this.channelForm.storeBannerImg){
callback(new Error('请上传门店频道banner图'))
}else{
callback()
}
}, trigger: 'change' }]
} }
} }
}, },
...@@ -129,10 +157,11 @@ export default { ...@@ -129,10 +157,11 @@ export default {
this.id ? (params.id = this.id) : this.merchantChannelId ? (params.merchantChannelId = this.merchantChannelId) : '' this.id ? (params.id = this.id) : this.merchantChannelId ? (params.merchantChannelId = this.merchantChannelId) : ''
this.$apis.channel[apis](params).then(res => { this.$apis.channel[apis](params).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.channelForm = { ...res.data, posterImgArr: [], publicityImgArr: [], channelImgArr: [] } this.channelForm = { ...res.data, posterImgArr: [], publicityImgArr: [], channelImgArr: [], storeBannerImgArr:[] }
this.channelForm.posterImgArr.push(res.data.posterImg) //海报 this.channelForm.posterImgArr.push(res.data.posterImg) //海报
this.channelForm.publicityImgArr.push(res.data.publicityImg) //频道分享预览图 this.channelForm.publicityImgArr.push(res.data.publicityImg) //频道分享预览图
this.channelForm.channelImgArr.push(res.data.channelImg) //频道banner this.channelForm.channelImgArr.push(res.data.channelImg) //频道banner
this.channelForm.storeBannerImgArr.push(res.data.storeBannerImg) //门店频道banner图
if (!res.data.channelImg) this.diffChannelStyle() if (!res.data.channelImg) this.diffChannelStyle()
} }
}) })
...@@ -157,6 +186,7 @@ export default { ...@@ -157,6 +186,7 @@ export default {
let params = { let params = {
channelName: this.channelForm.channelName, channelName: this.channelForm.channelName,
channelChildName: this.channelForm.channelChildName, channelChildName: this.channelForm.channelChildName,
sort: this.channelForm.sort,
channelType: this.channelForm.channelType, channelType: this.channelForm.channelType,
channelStyle: this.channelForm.channelStyle, channelStyle: this.channelForm.channelStyle,
channelImg: this.channelForm.channelImg, channelImg: this.channelForm.channelImg,
...@@ -164,6 +194,7 @@ export default { ...@@ -164,6 +194,7 @@ export default {
publicityImg: this.channelForm.publicityImg, publicityImg: this.channelForm.publicityImg,
posterImg: this.channelForm.posterImg posterImg: this.channelForm.posterImg
} }
if (this.channelForm.channelType == 6) params.storeBannerImg = this.channelForm.storeBannerImg
if (this.channelForm.channelType == 1) params.channelStyle = this.channelForm.channelStyle if (this.channelForm.channelType == 1) params.channelStyle = this.channelForm.channelStyle
let apis = this.id ? 'updateChannel' : this.merchantChannelId ? 'updateMerchantChannel' : '' let apis = this.id ? 'updateChannel' : this.merchantChannelId ? 'updateMerchantChannel' : ''
this.id ? (params.id = this.id) : this.merchantChannelId ? (params.merchantChannelId = this.merchantChannelId) : '' this.id ? (params.id = this.id) : this.merchantChannelId ? (params.merchantChannelId = this.merchantChannelId) : ''
...@@ -178,6 +209,8 @@ export default { ...@@ -178,6 +209,8 @@ export default {
message: res.code == '0' ? '编辑成功' : res.message, message: res.code == '0' ? '编辑成功' : res.message,
type: res.code == '0' ? 'success' : 'error' type: res.code == '0' ? 'success' : 'error'
}) })
}).finally(end=>{
this.loading = false
}) })
} }
}) })
......
...@@ -69,6 +69,7 @@ export default { ...@@ -69,6 +69,7 @@ export default {
{ {
label: '频道名称', label: '频道名称',
prop: 'channelName', prop: 'channelName',
width: 150,
formatter: cellValue => { formatter: cellValue => {
return cellValue.channelName || '--' return cellValue.channelName || '--'
} }
...@@ -79,6 +80,11 @@ export default { ...@@ -79,6 +80,11 @@ export default {
prop: 'channelChildName' prop: 'channelChildName'
}, },
{ {
label: '频道顺序',
width: 100,
prop: 'sort'
},
{
label: '频道宣传语', label: '频道宣传语',
prop: 'promotion', prop: 'promotion',
width: 300, width: 300,
......
...@@ -94,7 +94,7 @@ export default { ...@@ -94,7 +94,7 @@ export default {
methods: { methods: {
getCategory(){ getCategory(){
const params = { const params = {
pageSize: 1000, pageSize: 10000,
pageNum: 1, pageNum: 1,
categoryType: 1 categoryType: 1
} }
......
...@@ -53,7 +53,8 @@ export default { ...@@ -53,7 +53,8 @@ export default {
url: url, url: url,
searchForm: { searchForm: {
goodsName: '', goodsName: '',
configurationUpgradeGoodsId: '' discoverGoodsId: '',
goodsType: ''
}, },
total: 0, total: 0,
storeList: [], storeList: [],
...@@ -132,7 +133,8 @@ export default { ...@@ -132,7 +133,8 @@ export default {
// minSellPrice: minSellPrice ? Number(Number(minSellPrice*10*10).toFixed(0)) : 0, // minSellPrice: minSellPrice ? Number(Number(minSellPrice*10*10).toFixed(0)) : 0,
// retailPrice: retailPrice ? Number(Number(retailPrice*10*10).toFixed(0)) : 0, // retailPrice: retailPrice ? Number(Number(retailPrice*10*10).toFixed(0)) : 0,
// } // }
this.searchForm.configurationUpgradeGoodsId = this.routeInfo.type == 2 ? this.routeInfo.id : '' this.searchForm.discoverGoodsId = this.routeInfo.type == 2 ? this.routeInfo.id : ''
this.searchForm.goodsType = this.routeInfo.goodsType
}, },
mounted() { mounted() {
......
...@@ -77,7 +77,6 @@ export default { ...@@ -77,7 +77,6 @@ export default {
}, },
created() { created() {
this.copyList = JSON.parse(JSON.stringify(this.selectedList)) this.copyList = JSON.parse(JSON.stringify(this.selectedList))
console.log(this.copyList)
}, },
methods: { methods: {
handleOk() { handleOk() {
...@@ -107,6 +106,7 @@ export default { ...@@ -107,6 +106,7 @@ export default {
// } // }
// } // }
list.map(item => this.$set(item, 'activityPrice', '')) list.map(item => this.$set(item, 'activityPrice', ''))
list.map(item => this.$set(item, 'originalPrice', ''))
this.$emit('confirmDialog', [...list, ...this.copyList]) this.$emit('confirmDialog', [...list, ...this.copyList])
}, },
handleClose() { handleClose() {
...@@ -115,13 +115,12 @@ export default { ...@@ -115,13 +115,12 @@ export default {
setTableFinishFun() { setTableFinishFun() {
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.merchantId == row.merchantId)
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.merchantId == row.merchantId)
if (id > -1) this.copyList.splice(id, 1) if (id > -1) this.copyList.splice(id, 1)
console.log(this.copyList)
} 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"> <preferList v-if="activeName == '2'"></preferList>
<div v-else class="table-wrap">
<GLCombiForm ref="showSearch" class="search-wrap" :rowNumber="1" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"> <GLCombiForm ref="showSearch" class="search-wrap" :rowNumber="1" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset">
<div slot="categorySlot"> <div slot="categorySlot">
<brandCascader ref="cascaderRef" @clickItem="selectCategory" class="category-slot-class"></brandCascader> <brandCascader ref="cascaderRef" @clickItem="selectCategory" class="category-slot-class"></brandCascader>
...@@ -23,20 +24,20 @@ ...@@ -23,20 +24,20 @@
<span>{{scope.scope.goodsStatus==1 ? '上架' : '下架' }}</span> <span>{{scope.scope.goodsStatus==1 ? '上架' : '下架' }}</span>
</div> </div>
<div slot="merchantPriceSlot" slot-scope="scope"> <div slot="merchantPriceSlot" slot-scope="scope">
<template v-if="scope.scope.merchantList && scope.scope.merchantList.length > 1"> <template v-if="scope.scope.saleMerchantList && scope.scope.saleMerchantList.length > 1">
<span>{{ filterData(scope.scope).slice(0, 1).join('、') }}</span> <span>{{ filterData(scope.scope).slice(0, 1).join('、') }}</span>
<el-popover <el-popover
placement="top" placement="top"
width="400" width="fit-content"
trigger="hover"> trigger="hover">
<div v-for="(item,index) in filterData(scope.scope)" :key="index"> <div v-for="(item,index) in filterData(scope.scope)" :key="index">
{{item}} {{item}}
</div> </div>
<span class="more-info" slot="reference">...[{{ scope.scope.merchantList.length }}]</span> <span class="more-info" slot="reference">...({{ scope.scope.saleMerchantList.length }})</span>
</el-popover> </el-popover>
</template> </template>
<template v-else> <template v-else>
<span v-if="!scope.scope.merchantList || !scope.scope.merchantList.length">--</span> <span v-if="!scope.scope.saleMerchantList || !scope.scope.saleMerchantList.length">--</span>
<span v-else>{{ filterData(scope.scope).join('、') }}</span> <span v-else>{{ filterData(scope.scope).join('、') }}</span>
</template> </template>
</div> </div>
...@@ -51,21 +52,29 @@ ...@@ -51,21 +52,29 @@
<script> <script>
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import brandCascader from './components/brandCascader' import brandCascader from './components/brandCascader'
import preferList from './preferList'
export default { export default {
name: 'App', name: 'App',
components: { components: {
brandCascader, brandCascader,
preferList
},
beforeRouteEnter(to, from, next) {
next(vm =>{
if(from.path.indexOf('/goods/addPrefer')==0) {vm.activeName='2'}
})
}, },
data() { data() {
return { return {
tableSearchForm: { tableSearchForm: {
channelName: '', goodsType: '1',
createDate: [], createDate: [],
associationClassifyFirstId: '', associationClassifyFirstId: '',
associationClassifySecondId: '', associationClassifySecondId: '',
merchantName: '' merchantName: ''
}, },
tabPaneList: [{name: 'sa', label: '配置升级'}, {name: 'sa', label: '车主优选'}], activeName: '1',
tabPaneList: [{name: '1', label: '配置升级'}, {name: '2', label: '车主优选'}],
buttonList: [ buttonList: [
{ {
type: 'el-button', type: 'el-button',
...@@ -225,7 +234,7 @@ ...@@ -225,7 +234,7 @@
{ {
label: '操作人', label: '操作人',
width: 120, width: 120,
prop: 'operator', prop: 'updatedBy',
}, },
] ]
}, },
...@@ -280,7 +289,7 @@ ...@@ -280,7 +289,7 @@
} }
}) })
}, },
filterData({merchantList: list}){ filterData({saleMerchantList: list}){
return list?.map(item => { return list?.map(item => {
let activityPrice = item.activityPrice ? Number((Number(item.activityPrice)/100).toFixed(2)) : 0 let activityPrice = item.activityPrice ? Number((Number(item.activityPrice)/100).toFixed(2)) : 0
return `${item.merchantName || '--'}:${activityPrice || '0'}` return `${item.merchantName || '--'}:${activityPrice || '0'}`
...@@ -306,7 +315,7 @@ ...@@ -306,7 +315,7 @@
}, },
handleReset() { handleReset() {
this.tableSearchForm = { this.tableSearchForm = {
channelName: '', goodsType: '1',
createDate: [], createDate: [],
associationClassifyFirstId: '', associationClassifyFirstId: '',
associationClassifySecondId: '', associationClassifySecondId: '',
...@@ -321,7 +330,9 @@ ...@@ -321,7 +330,9 @@
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(row={},type){ handleAdd(row={},type){
const params = {} const params = {
goodsType: this.activeName
}
let title = '新增商品' let title = '新增商品'
if(type){ if(type){
params.id = row.id params.id = row.id
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</glsx-combi-form> </glsx-combi-form>
</div> </div>
<select-store v-if="relateStoreVisible" ref="relateStore" :dialogVisible="relateStoreVisible" :storeSelected="selectedList" :merchantInfo="editForm.merchantId" @handleRelateStoreConfirm="handleRelateStoreConfirm" @handleRelateStoreClose="handleRelateStoreClose"></select-store> <select-store v-if="relateStoreVisible" ref="relateStore" :dialogVisible="relateStoreVisible" :storeSelected="selectedList" :merchantInfo="editForm.merchantId" @handleRelateStoreConfirm="handleRelateStoreConfirm" @handleRelateStoreClose="handleRelateStoreClose"></select-store>
<selectCarDialog v-if="carDialogVisible" singleChoice @handleClose="handleClose" @handleConfirm="handleConfirm" :dialogVisible="carDialogVisible"></selectCarDialog> <selectCarDialog v-if="carDialogVisible" singleChoice @handleClose="handleClose" :echoData="editForm.vehicleSeriesRequests" @handleConfirm="handleConfirm" :dialogVisible="carDialogVisible"></selectCarDialog>
<GLFooter> <GLFooter>
<el-button @click="handleCancel">取消</el-button> <el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleSave">确定</el-button> <el-button type="primary" @click="handleSave">确定</el-button>
...@@ -170,7 +170,12 @@ export default { ...@@ -170,7 +170,12 @@ export default {
channelIds: this.editForm.channelIds, channelIds: this.editForm.channelIds,
vehicleSeriesRequests: this.editForm?.channelIds?.includes(5) ? this.editForm.vehicleSeriesRequests : [] vehicleSeriesRequests: this.editForm?.channelIds?.includes(5) ? this.editForm.vehicleSeriesRequests : []
} }
this.loading = true const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)'
})
this.$apis.store.configMerchant(params).then(res => { this.$apis.store.configMerchant(params).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.loading = false this.loading = false
...@@ -181,6 +186,8 @@ export default { ...@@ -181,6 +186,8 @@ export default {
message: res.code == '0' ? '编辑成功' : res.message, message: res.code == '0' ? '编辑成功' : res.message,
type: res.code == '0' ? 'success' : 'error' type: res.code == '0' ? 'success' : 'error'
}) })
}).finally(end =>{
loading.close()
}) })
} }
}) })
......
...@@ -7,9 +7,22 @@ ...@@ -7,9 +7,22 @@
@onOk="handleConfirm" @onOk="handleConfirm"
@onCancel="handleClose"> @onCancel="handleClose">
<div class="search-wrap"> <div class="search-wrap">
<el-input size="small" placeholder="请输入搜索关键字" v-model="curbrandName"> <!-- <el-select clearable v-model="curbrandName" @change="changeFilterItem" filterable placeholder="请选择">
<i slot="suffix" class="el-input__icon el-icon-search"></i> <el-option
</el-input> v-for="item in searchList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select> -->
<el-autocomplete
clearable
debounce="1000"
v-model="curbrandName"
:fetch-suggestions="querySearchAsync"
placeholder="请输入内容"
@select="changeFilterItem"
></el-autocomplete>
</div> </div>
<div v-if="loading" class="loading-wrap"> <div v-if="loading" class="loading-wrap">
<img class="loading-img" :src="url" alt=""> <img class="loading-img" :src="url" alt="">
...@@ -42,18 +55,22 @@ ...@@ -42,18 +55,22 @@
<script> <script>
import url from '@/assets/loading.png' import url from '@/assets/loading.png'
import { mapState, mapActions } from 'vuex'
export default { export default {
name: 'selectStore', name: 'selectStore',
data() { data() {
return { return {
url, url,
loading: true, loading: false,
restaurants: [
{ "value": "三全鲜食(北新泾店)", "address": "长宁区新渔路144号" },
{ "value": "Hot honey 首尔炸鸡(仙霞路)", "address": "上海市长宁区淞虹路661号" }],
curbrandName: '', curbrandName: '',
carSeriesData: [], // searchList: [], //搜索列表
filterBrandList: [], filterBrandList: [], // 品牌数据
sonBrandList: [], sonBrandList: [], // 子品牌数据
carSeriesList: [], carSeriesList: [], //车系数据
selectdData: {}, selectdData: {}, //已选的数据
curBrandInfo: { curBrandInfo: {
id: '', id: '',
name: '' name: ''
...@@ -66,6 +83,10 @@ ...@@ -66,6 +83,10 @@
} }
}, },
computed:{ computed:{
...mapState({
carSeriesData: state => state.channel.carSeriesData, //品牌源数据
searchList: state => state.channel.searchList,
})
}, },
props: { props: {
dialogVisible:{ dialogVisible:{
...@@ -81,42 +102,89 @@ ...@@ -81,42 +102,89 @@
default: ()=>[] default: ()=>[]
}, },
}, },
watch:{
curbrandName:{
handler(nVal, oVal){
this.sonBrandList = []
this.carSeriesList = []
this.filterBrandList = this.carSeriesData.filter(item => item.name.indexOf(nVal)>-1)
},
deep: true
}
},
created(){ created(){
this.filterBrandList = this.carSeriesData
// this.flatData(this.carSeriesData)
this.echoDataFn() this.echoDataFn()
}, },
mounted() { mounted() {
this.getCarSeriesData() // this.getCarSeriesData()
}, },
methods:{ methods:{
querySearchAsync(queryString, cb){
var restaurants = this.searchList;
var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : [];
if(!queryString) this.filterBrandList = this.carSeriesData
if(results?.length>0) cb(results);
},
createStateFilter(queryString) {
return (state) => {
return (state.value.toLowerCase().indexOf(queryString.toLowerCase())>-1);
};
},
handleSelect(e){
console.log(e)
},
echoDataFn(){ echoDataFn(){
let obj = {} let obj = {}
this.echoData.forEach(item => { this.echoData.forEach(item => {
let { brandId, brandName, childBrandId, childBrandName, vehicleSeriesId, vehicleSeriesName} = item let { brandId, brandName, childBrandId, childBrandName, vehicleSeriesId, vehicleSeriesName} = item
if(obj[brandId]){ if(obj[brandId]){
if(obj[brandId][childBrandId]){ if(obj[brandId][childBrandId]){
obj[brandId][childBrandId].push({rootId:brandId, rootName: brandName, parentId: vehicleSeriesId, parentName : childBrandName, id: vehicleSeriesId, name: vehicleSeriesName }) obj[brandId][childBrandId].push({rootId:brandId, rootName: brandName, parentId: childBrandId, parentName : childBrandName, id: vehicleSeriesId, name: vehicleSeriesName })
}else{ }else{
obj[brandId][childBrandId] = [] obj[brandId][childBrandId] = []
obj[brandId][childBrandId].push({rootId:brandId, rootName: brandName, parentId: vehicleSeriesId, parentName : childBrandName, id: vehicleSeriesId, name: vehicleSeriesName }) obj[brandId][childBrandId].push({rootId:brandId, rootName: brandName, parentId: childBrandId, parentName : childBrandName, id: vehicleSeriesId, name: vehicleSeriesName })
} }
}else{ }else{
obj[brandId] = {} obj[brandId] = {}
obj[brandId][childBrandId] = [] obj[brandId][childBrandId] = []
obj[brandId][childBrandId].push({rootId:brandId, rootName: brandName, parentId: vehicleSeriesId, parentName : childBrandName, id: vehicleSeriesId, name: vehicleSeriesName }) obj[brandId][childBrandId].push({rootId:brandId, rootName: brandName, parentId: childBrandId, parentName : childBrandName, id: vehicleSeriesId, name: vehicleSeriesName })
} }
}) })
this.selectdData = obj this.selectdData = obj
console.log(this.echoData, this.selectdData,123)
},
changeFilterItem(e){
const _idList = e.id?.split('-') || []
const _target = this.carSeriesData.find(item => item.id == _idList[0])
if(!e.id){
this.filterBrandList = this.carSeriesData
return;
}
this.$nextTick(()=>{
if(_target) {
this.curBrandInfo = {
id: _target?.id,
name: _target?.name
}
this.filterBrandList = [_target]
if(_idList[1]){
const _sonTarget = _target.childs.find(item => item.id == _idList[1])
if(_sonTarget){
this.curSonBrandInfo = {
id: _sonTarget.id,
name: _sonTarget.name
}
this.sonBrandList = [_sonTarget]
if(_idList[2]){
const _carTarget = _sonTarget.childs.find(item => item.id == _idList[2])
if(_carTarget) this.carSeriesList = [_carTarget]
}else{
this.carSeriesList = _sonTarget?.childs || []
}
}
}else{
this.curSonBrandInfo = {
id: _target?.childs?.[0]?.id,
name: _target?.childs?.[0]?.name
}
this.sonBrandList = _target.childs || []
this.carSeriesList = this.sonBrandList?.[0]?.childs || []
}
}
})
}, },
changeBrandStatus(e, row, idx){ changeBrandStatus(e, row, idx){
this.curBrandInfo = { this.curBrandInfo = {
...@@ -247,18 +315,26 @@ ...@@ -247,18 +315,26 @@
} }
}, },
// 获取数据源 // 获取数据源
getCarSeriesData() { // getCarSeriesData() {
this.$apis.case.getCarSeriesApi({needCarSeries:true}).then(res => { // this.$apis.case.getCarSeriesApi({needCarSeries:true}).then(res => {
if(res?.length){ // if(res?.length){
this.carSeriesData = res // this.carSeriesData = res
this.filterBrandList = res // this.filterBrandList = res
} // this.flatData(res)
}).finally(end =>{ // }
this.loading = false // }).finally(end =>{
}) // this.loading = false
}, // })
// },
// flatData(list, parentId){
// list?.forEach(item =>{
// let id = `${parentId ? parentId + '-': ''}${item.id}`
// this.searchList.push({id, name:item.name})
// this.flatData(item.childs, id)
// })
// },
handleConfirm(){ handleConfirm(){
console.log(this.selectdData) // console.log(this.selectdData)
this.$emit('handleConfirm', this.selectdData) this.$emit('handleConfirm', this.selectdData)
}, },
handleClose(){ handleClose(){
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
<div class="info">{{ tabPaneText }}列表</div> <div class="info">{{ tabPaneText }}列表</div>
<div> <div>
<el-button type="primary" size="small" @click="handleEdit">频道设置</el-button> <el-button type="primary" size="small" @click="handleEdit">频道设置</el-button>
<el-button type="primary" size="small" @click="handleAdd">编辑频道</el-button> <el-button type="primary" :plain="activeName==5 || activeName==6" size="small" @click="handleAdd">编辑频道</el-button>
<el-button v-if="activeName!=5" type="primary" plain size="small" @click="handleAddContent()">新增内容</el-button> <el-button v-if="activeName!=5 && activeName!=6" type="primary" plain size="small" @click="handleAddContent()">新增内容</el-button>
</div> </div>
</div> </div>
<GLTable ref="editRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :beforeSearchFn="beforeSearchFn" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun"> <GLTable ref="editRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :beforeSearchFn="beforeSearchFn" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun">
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<el-switch v-model="scope.scope.isOpen" @change="updateState(scope.scope)"></el-switch> <el-switch v-model="scope.scope.isOpen" @change="updateState(scope.scope)"></el-switch>
</template> </template>
<div class="table-btns btn-wrap" slot="auth-button" slot-scope="scope"> <div class="table-btns btn-wrap" slot="auth-button" slot-scope="scope">
<template v-if="activeName==5"> <el-button type="text" @click="viewGoods(scope.scope, 1)">查看</el-button></template> <template v-if="activeName==5 || activeName==6"> <el-button type="text" @click="viewGoods(scope.scope, 1)">查看</el-button></template>
<template v-else> <template v-else>
<template v-if="scope.scope.confType != 1"> <template v-if="scope.scope.confType != 1">
<el-button type="text" v-if="scope.scope.contentType == 1" @click="handleConfig(scope.scope)">{{ scope.scope.status == 0 ? '待配置' : '编辑' }}</el-button> <el-button type="text" v-if="scope.scope.contentType == 1" @click="handleConfig(scope.scope)">{{ scope.scope.status == 0 ? '待配置' : '编辑' }}</el-button>
...@@ -80,7 +80,8 @@ export default { ...@@ -80,7 +80,8 @@ export default {
merchantName: '', merchantName: '',
createDate: [] createDate: []
}, },
searchForm: {}, searchForm: {
},
ClassifyInfo: {}, ClassifyInfo: {},
url: url, url: url,
mode: 'mid', mode: 'mid',
...@@ -119,7 +120,7 @@ export default { ...@@ -119,7 +120,7 @@ export default {
label: '商品名称', label: '商品名称',
name: 'goodsName', name: 'goodsName',
type: 'input', type: 'input',
filter: '5' filter: '5, 6'
}, },
{ {
label: '创建日期', label: '创建日期',
...@@ -127,7 +128,26 @@ export default { ...@@ -127,7 +128,26 @@ export default {
type: 'date', type: 'date',
addHtml: 'createdDate', addHtml: 'createdDate',
isClear: true, isClear: true,
filter: '1,2,3,4,5' filter: '1,2,3,4,5,6'
},
{
label: '来源',
name: 'sourse',
type: 'select',
placeholder: '请选择',
optionList: [
{
confId: '',
confName: '全部'
},
{
confId: '2',
confName: '嘀加智享'
},
],
optionId: 'confId',
optionLabel: 'confName',
filter: '6'
}, },
{ {
label: '商品分类', label: '商品分类',
...@@ -135,6 +155,26 @@ export default { ...@@ -135,6 +155,26 @@ export default {
addHtml: 'categorySlot', addHtml: 'categorySlot',
filter: '5' filter: '5'
}, },
{
label: '商品分类',
name: 'associationClassifyFirstId',
type: 'select',
placeholder: '请选择',
optionList: [],
optionId: 'id',
optionLabel: 'categoryName',
filter: '6'
},
// {
// label: '来源',
// name: 'sourse',
// type: 'select',
// placeholder: '请选择',
// optionId: 'confId',
// optionLabel: 'confName',
// optionsName: 'contentTypeList',
// filter: '2'
// },
], ],
getListApi: this.$apis.store.getChannelTopicList, getListApi: this.$apis.store.getChannelTopicList,
tableParams: { tableParams: {
...@@ -212,12 +252,12 @@ export default { ...@@ -212,12 +252,12 @@ export default {
label: '商品名称', label: '商品名称',
width: 200, width: 200,
prop: 'goodsName', prop: 'goodsName',
filter: '5' filter: '5, 6'
}, },
{ {
label: '缩略图', label: '缩略图',
addHtml: 'imageSlot', addHtml: 'imageSlot',
filter: '5' filter: '5, 6'
}, },
{ {
label: '收款方式', label: '收款方式',
...@@ -239,12 +279,30 @@ export default { ...@@ -239,12 +279,30 @@ export default {
label: '门店活动价(元)', label: '门店活动价(元)',
width: 150, width: 150,
formatter: cellValue => { formatter: cellValue => {
let item = cellValue.merchantList && cellValue.merchantList[0] ? cellValue.merchantList[0] : {} let item = cellValue.saleMerchantList && cellValue.saleMerchantList[0] ? cellValue.saleMerchantList[0] : {}
return item.activityPrice ? Number((Number(item.activityPrice)/100).toFixed(2)) : 0 return item.activityPrice ? Number((Number(item.activityPrice)/100).toFixed(2)) : 0
}, },
filter: '5' filter: '5'
}, },
{ {
label: '销售价格(元)',
width: 150,
formatter: cellValue => {
let item = cellValue.saleMerchantList && cellValue.saleMerchantList[0] ? cellValue.saleMerchantList[0] : {}
return item.activityPrice ? Number((Number(item.activityPrice)/100).toFixed(2)) : 0
},
filter: '6'
},
{
label: '赠送积分',
width: 150,
formatter: cellValue => {
let item = cellValue.saleMerchantList && cellValue.saleMerchantList[0] ? cellValue.saleMerchantList[0] : {}
return item.giveIntegral || 0
},
filter: '6'
},
{
label: '分类', label: '分类',
width: 150, width: 150,
formatter: cellValue => { formatter: cellValue => {
...@@ -253,9 +311,23 @@ export default { ...@@ -253,9 +311,23 @@ export default {
filter: '5' filter: '5'
}, },
{ {
label: '商品分类',
width: 150,
prop: 'associationClassifyFirstName',
filter: '6'
},
{
label: '来源',
width: 150,
formatter: cellValue => {
return '嘀加智享平台'
},
filter: '6'
},
{
label: '状态', label: '状态',
addHtml: 'statusSlot', addHtml: 'statusSlot',
filter: '5' filter: '5,6'
}, },
{ {
label: '状态', label: '状态',
...@@ -268,26 +340,27 @@ export default { ...@@ -268,26 +340,27 @@ export default {
{ {
label: '创建日期', label: '创建日期',
prop: 'createdDate', prop: 'createdDate',
filter: '1,2,3,4,5', filter: '1,2,3,4,5,6',
minWidth: 180 minWidth: 180
}, },
{ {
label: '更新日期', label: '更新日期',
prop: 'updatedDate', prop: 'updatedDate',
minWidth: 180, minWidth: 180,
filter: '1,2,3,4,5' filter: '1,2,3,4,5,6'
}, },
{ {
label: '操作人', label: '操作人',
prop: 'updatedBy', prop: 'updatedBy',
filter: '1,2,3,4'
},
{
label: '操作人',
width: 120, width: 120,
prop: 'operator', filter: '1,2,3,4,5,6'
filter: '5' },
}, // {
// label: '操作人',
// width: 120,
// prop: 'operator',
// filter: '5,6'
// },
{ {
label: '操作', label: '操作',
addHtml: 'auth-button', addHtml: 'auth-button',
...@@ -316,6 +389,7 @@ export default { ...@@ -316,6 +389,7 @@ export default {
}, },
created() { created() {
this.getconfigMerchant() this.getconfigMerchant()
this.getCategory()
}, },
mounted() {}, mounted() {},
computed: { computed: {
...@@ -329,6 +403,21 @@ export default { ...@@ -329,6 +403,21 @@ export default {
SET_CHANNEL_STYLE: 'channel/SET_CHANNEL_STYLE', SET_CHANNEL_STYLE: 'channel/SET_CHANNEL_STYLE',
SET_CHANNEL_TYPE: 'channel/SET_CHANNEL_TYPE' SET_CHANNEL_TYPE: 'channel/SET_CHANNEL_TYPE'
}), }),
getCategory(){
const params = {
pageSize: 10000,
pageNum: 1,
categoryType: 2
}
this.$apis.category.getCategoryListApi(params).then(res => {
if(res?.list?.length){
const _target = this.formData.find(item => item.name == 'associationClassifyFirstId')
_target && (_target.optionList = res.list)
const _copyTarget = this.searchFormData.find(item => item.name == 'associationClassifyFirstId')
_copyTarget && (_copyTarget.optionList = res.list)
}
})
},
selectCategory(e){ selectCategory(e){
this.ClassifyInfo.associationClassifyFirstId = e?.parent?.id this.ClassifyInfo.associationClassifyFirstId = e?.parent?.id
this.ClassifyInfo.associationClassifySecondId = e?.data?.id this.ClassifyInfo.associationClassifySecondId = e?.data?.id
...@@ -352,11 +441,12 @@ export default { ...@@ -352,11 +441,12 @@ export default {
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.searchForm = this.getParams() this.searchForm = this.getParams()
if(this.activeName == 5){ if(this.activeName == 5 || this.activeName == 6){
this.searchForm.apiType = 5 this.searchForm.goodsType = this.activeName == 5 ? '1' : '2' //1是配置2是车主
this.searchForm.apiType = 5 //在api.js判断是否更换接口
this.searchForm.merchantId =this.merchantId this.searchForm.merchantId =this.merchantId
const {associationClassifyFirstId, associationClassifySecondId} = this.ClassifyInfo const {associationClassifyFirstId, associationClassifySecondId} = this.ClassifyInfo
this.searchForm.associationClassifyFirstId = associationClassifyFirstId if(this.activeName == 5) this.searchForm.associationClassifyFirstId = associationClassifyFirstId
this.searchForm.associationClassifySecondId = associationClassifySecondId this.searchForm.associationClassifySecondId = associationClassifySecondId
this.searchForm.startCreatedDate = this.searchForm.createdDate ? this.searchForm.createdDate + ' 00:00:00' : '' this.searchForm.startCreatedDate = this.searchForm.createdDate ? this.searchForm.createdDate + ' 00:00:00' : ''
this.searchForm.endCreatedDate = this.searchForm.createdDate ? this.searchForm.createdDate + ' 23:59:59' : '' this.searchForm.endCreatedDate = this.searchForm.createdDate ? this.searchForm.createdDate + ' 23:59:59' : ''
...@@ -379,7 +469,7 @@ export default { ...@@ -379,7 +469,7 @@ export default {
} }
} else { } else {
this[formName].forEach((item, index) => { this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) { if (this.activeName != 6 && item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName])) this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') { if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {} const temp = {}
...@@ -436,7 +526,7 @@ export default { ...@@ -436,7 +526,7 @@ export default {
title = type == 1 ? '查看商品' : '编辑商品' title = type == 1 ? '查看商品' : '编辑商品'
} }
const queryStr = encodeURIComponent(JSON.stringify(params)) const queryStr = encodeURIComponent(JSON.stringify(params))
this.$router.push({ path: `/goods/add/`+queryStr,query: { $title: title }}) this.$router.push({ path: `/goods/${this.activeName==5? 'add' : 'addPrefer'}/`+queryStr,query: { $title: title }})
}, },
handleClick() { handleClick() {
this.SET_CHANNEL_TYPE({ channelType: this.activeName }) this.SET_CHANNEL_TYPE({ channelType: this.activeName })
...@@ -536,7 +626,7 @@ export default { ...@@ -536,7 +626,7 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin: 0 0 18px 0; margin: 0 0 10px 0;
.info { .info {
font-weight: 600; font-weight: 600;
font-size: 16px; font-size: 16px;
......
...@@ -332,7 +332,7 @@ export default { ...@@ -332,7 +332,7 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin: 0 0 18px 0; margin: 0 0 10px 0;
.info { .info {
font-weight: 600; font-weight: 600;
font-size: 16px; font-size: 16px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!