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 @@
"integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
"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": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz",
......@@ -1909,6 +1954,28 @@
"requires": {
"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 @@
}
}
},
"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": {
"version": "3.6.5",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.6.5.tgz",
......
......@@ -5,6 +5,7 @@
</template>
<script>
import { mapState, mapActions } from 'vuex'
export default {
name: 'report-app',
props: {
......@@ -20,6 +21,14 @@ export default {
created() {
this.myMsg = this.msg
this.myMessage = this.message
},
mounted(){
this.getCarSeriList()
},
methods:{
...mapActions({
getCarSeriList: 'channel/getCarSeriList'
}),
}
}
</script>
......
......@@ -18,7 +18,6 @@ const getCategoryListApi = params => {
reject()
})
}
console.log(params, '8888')
params.method = 'scrm.api.shopmall.discover.category.page'
return http({
url,
......@@ -48,9 +47,20 @@ const batchAddCategoryApi = params => {
})
}
export default {
const batchDetailApi = params => {
params.method = 'scrm.api.shopmall.discover.category.detail'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
export default {
addCategoryApi,
getCategoryListApi,
delCategoryApi,
batchAddCategoryApi
}
\ No newline at end of file
batchAddCategoryApi,
batchDetailApi
}
......@@ -23,12 +23,12 @@ export default {
},
methods:{
inputFn(e){
e = e ? String(e) : ''
e = e || e==0 ? String(e) : ''
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
if(this.maxVal){
if(+this.maxVal<= +e) value = this.maxVal //加等号是因为 '500' == '500.' 导致多了点
if(this.maxVal && +this.maxVal<= +e){
value = this.maxVal //加等号是因为 '500' == '500.' 导致多了点
}else{
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('.', '$#$')
......@@ -39,6 +39,7 @@ export default {
blurFn(e){
let value = e.target.value
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)
}
}
......
......@@ -15,7 +15,7 @@
<span class="combi-form-label" :style="{ width: item.labelWidth || labelWidth }">{{ item.label }}:</span>
</span>
<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'">
<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>
......@@ -34,7 +34,7 @@
<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 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>
</el-radio>
</el-radio-group>
......
......@@ -3,6 +3,8 @@ export default {
namespaced: true,
state: {
videoList: [],
carSeriesData: [],
searchList: [],
topicDetail: {},
merchantId: '',
channelStyle: 1,
......@@ -27,7 +29,23 @@ export default {
},
['SET_CHANNEL_TYPE'](state, payload) {
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: {
// 获取视频列表
......@@ -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 })
}
})
}
}
}
......@@ -97,7 +97,7 @@ export default{
},
beforeDestroy(){
window.removeEventListener('resize', this.resizeDom)
},
},
methods:{
resizeDom(){
this.calcWidth()
......@@ -116,10 +116,8 @@ export default{
}
return pre + curW
},0);
console.log(curIdx)
this.colList = curIdx >-1 ? this.tabList.slice(curIdx) : []
this.rowList = curIdx >-1 ? this.tabList.slice(0, curIdx) : this.tabList
console.log(this.rowList)
})
},
selectNav(item){
......@@ -195,6 +193,7 @@ export default{
margin-right: 1px;
color: #666666;
letter-spacing: 0;
font-size: 14px;
text-align: center;
cursor: pointer;
.del-icon{
......@@ -260,4 +259,4 @@ export default{
}
}
}
</style>
\ No newline at end of file
</style>
<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 @@
<el-form-item label="频道子名称:" prop="channelChildName">
<el-input v-model="channelForm.channelChildName" maxlength="12" show-word-limit></el-input>
</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">
<el-form-item label="频道主题:" prop="channelStyle">
<el-col :span="11" class="theme"></el-col>
......@@ -31,6 +35,13 @@
<div class="el-form-item__error" v-if="channelImgFlag">请上传频道banner</div>
</el-form-item>
<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>
</div>
</div>
......@@ -70,8 +81,11 @@ export default {
publicityImgArr: [],
publicityImg: '',
channelImg: '',
storeBannerImg: '',
channelChildName: '',
channelImgArr: []
sort: '',
channelImgArr: [],
storeBannerImgArr: []
},
channelImgbgArr: ['banner1', 'banner2'],
channelOtherImgbgArr: ['membrane', 'crowd', 'activity'],
......@@ -82,6 +96,12 @@ export default {
key: 'channelImg',
isClose: true
},
merchantPicOptions: {
width: '174px',
height: '104px',
key: 'storeBannerImg',
isClose: true
},
shareOptions: {
width: '120px',
height: '90px',
......@@ -101,6 +121,14 @@ export default {
channelImg: [{ required: true, message: '请上传频道banner', trigger: 'change' }],
promotion: [{ required: true, message: '请输入频道分享文案', trigger: 'blur' }],
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 {
this.id ? (params.id = this.id) : this.merchantChannelId ? (params.merchantChannelId = this.merchantChannelId) : ''
this.$apis.channel[apis](params).then(res => {
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.publicityImgArr.push(res.data.publicityImg) //频道分享预览图
this.channelForm.channelImgArr.push(res.data.channelImg) //频道banner
this.channelForm.storeBannerImgArr.push(res.data.storeBannerImg) //门店频道banner图
if (!res.data.channelImg) this.diffChannelStyle()
}
})
......@@ -157,6 +186,7 @@ export default {
let params = {
channelName: this.channelForm.channelName,
channelChildName: this.channelForm.channelChildName,
sort: this.channelForm.sort,
channelType: this.channelForm.channelType,
channelStyle: this.channelForm.channelStyle,
channelImg: this.channelForm.channelImg,
......@@ -164,6 +194,7 @@ export default {
publicityImg: this.channelForm.publicityImg,
posterImg: this.channelForm.posterImg
}
if (this.channelForm.channelType == 6) params.storeBannerImg = this.channelForm.storeBannerImg
if (this.channelForm.channelType == 1) params.channelStyle = this.channelForm.channelStyle
let apis = this.id ? 'updateChannel' : this.merchantChannelId ? 'updateMerchantChannel' : ''
this.id ? (params.id = this.id) : this.merchantChannelId ? (params.merchantChannelId = this.merchantChannelId) : ''
......@@ -178,6 +209,8 @@ export default {
message: res.code == '0' ? '编辑成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
}).finally(end=>{
this.loading = false
})
}
})
......
......@@ -69,6 +69,7 @@ export default {
{
label: '频道名称',
prop: 'channelName',
width: 150,
formatter: cellValue => {
return cellValue.channelName || '--'
}
......@@ -79,6 +80,11 @@ export default {
prop: 'channelChildName'
},
{
label: '频道顺序',
width: 100,
prop: 'sort'
},
{
label: '频道宣传语',
prop: 'promotion',
width: 300,
......
......@@ -94,7 +94,7 @@ export default {
methods: {
getCategory(){
const params = {
pageSize: 1000,
pageSize: 10000,
pageNum: 1,
categoryType: 1
}
......
......@@ -53,7 +53,8 @@ export default {
url: url,
searchForm: {
goodsName: '',
configurationUpgradeGoodsId: ''
discoverGoodsId: '',
goodsType: ''
},
total: 0,
storeList: [],
......@@ -132,7 +133,8 @@ export default {
// minSellPrice: minSellPrice ? Number(Number(minSellPrice*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() {
......
......@@ -77,7 +77,6 @@ export default {
},
created() {
this.copyList = JSON.parse(JSON.stringify(this.selectedList))
console.log(this.copyList)
},
methods: {
handleOk() {
......@@ -107,6 +106,7 @@ export default {
// }
// }
list.map(item => this.$set(item, 'activityPrice', ''))
list.map(item => this.$set(item, 'originalPrice', ''))
this.$emit('confirmDialog', [...list, ...this.copyList])
},
handleClose() {
......@@ -115,13 +115,12 @@ export default {
setTableFinishFun() {
this.copyList.forEach(row => {
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) {
try {
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)
console.log(this.copyList)
} catch (err) {
console.log(err)
}
......
<template>
<div class="goods-list-cntr">
<!-- <GLTabs v-model="activeName" :tabPaneList="tabPaneList" @tab-click="handleClick"></GLTabs> -->
<div class="table-wrap">
<GLTabs v-model="activeName" :tabPaneList="tabPaneList" @tab-click="handleClick"></GLTabs>
<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">
<div slot="categorySlot">
<brandCascader ref="cascaderRef" @clickItem="selectCategory" class="category-slot-class"></brandCascader>
......@@ -23,20 +24,20 @@
<span>{{scope.scope.goodsStatus==1 ? '上架' : '下架' }}</span>
</div>
<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>
<el-popover
placement="top"
width="400"
width="fit-content"
trigger="hover">
<div v-for="(item,index) in filterData(scope.scope)" :key="index">
{{item}}
</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>
</template>
<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>
</template>
</div>
......@@ -51,21 +52,29 @@
<script>
import url from '@/assets/empty.png'
import brandCascader from './components/brandCascader'
import preferList from './preferList'
export default {
name: 'App',
components: {
brandCascader,
preferList
},
beforeRouteEnter(to, from, next) {
next(vm =>{
if(from.path.indexOf('/goods/addPrefer')==0) {vm.activeName='2'}
})
},
data() {
return {
tableSearchForm: {
channelName: '',
goodsType: '1',
createDate: [],
associationClassifyFirstId: '',
associationClassifySecondId: '',
merchantName: ''
},
tabPaneList: [{name: 'sa', label: '配置升级'}, {name: 'sa', label: '车主优选'}],
activeName: '1',
tabPaneList: [{name: '1', label: '配置升级'}, {name: '2', label: '车主优选'}],
buttonList: [
{
type: 'el-button',
......@@ -225,7 +234,7 @@
{
label: '操作人',
width: 120,
prop: 'operator',
prop: 'updatedBy',
},
]
},
......@@ -280,7 +289,7 @@
}
})
},
filterData({merchantList: list}){
filterData({saleMerchantList: list}){
return list?.map(item => {
let activityPrice = item.activityPrice ? Number((Number(item.activityPrice)/100).toFixed(2)) : 0
return `${item.merchantName || '--'}:${activityPrice || '0'}`
......@@ -306,7 +315,7 @@
},
handleReset() {
this.tableSearchForm = {
channelName: '',
goodsType: '1',
createDate: [],
associationClassifyFirstId: '',
associationClassifySecondId: '',
......@@ -321,7 +330,9 @@
this.$refs.channelRef.data.length ? (this.$refs.channelRef.tableHeightValues = '') : this.$refs.channelRef.setTableHeightFun()
},
handleAdd(row={},type){
const params = {}
const params = {
goodsType: this.activeName
}
let title = '新增商品'
if(type){
params.id = row.id
......
......@@ -25,7 +25,7 @@
</glsx-combi-form>
</div>
<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>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleSave">确定</el-button>
......@@ -170,7 +170,12 @@ export default {
channelIds: this.editForm.channelIds,
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 => {
if (res.code == 0) {
this.loading = false
......@@ -181,6 +186,8 @@ export default {
message: res.code == '0' ? '编辑成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
}).finally(end =>{
loading.close()
})
}
})
......
......@@ -7,9 +7,22 @@
@onOk="handleConfirm"
@onCancel="handleClose">
<div class="search-wrap">
<el-input size="small" placeholder="请输入搜索关键字" v-model="curbrandName">
<i slot="suffix" class="el-input__icon el-icon-search"></i>
</el-input>
<!-- <el-select clearable v-model="curbrandName" @change="changeFilterItem" filterable placeholder="请选择">
<el-option
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 v-if="loading" class="loading-wrap">
<img class="loading-img" :src="url" alt="">
......@@ -42,18 +55,22 @@
<script>
import url from '@/assets/loading.png'
import { mapState, mapActions } from 'vuex'
export default {
name: 'selectStore',
data() {
return {
url,
loading: true,
loading: false,
restaurants: [
{ "value": "三全鲜食(北新泾店)", "address": "长宁区新渔路144号" },
{ "value": "Hot honey 首尔炸鸡(仙霞路)", "address": "上海市长宁区淞虹路661号" }],
curbrandName: '',
carSeriesData: [],
filterBrandList: [],
sonBrandList: [],
carSeriesList: [],
selectdData: {},
// searchList: [], //搜索列表
filterBrandList: [], // 品牌数据
sonBrandList: [], // 子品牌数据
carSeriesList: [], //车系数据
selectdData: {}, //已选的数据
curBrandInfo: {
id: '',
name: ''
......@@ -66,6 +83,10 @@
}
},
computed:{
...mapState({
carSeriesData: state => state.channel.carSeriesData, //品牌源数据
searchList: state => state.channel.searchList,
})
},
props: {
dialogVisible:{
......@@ -81,42 +102,89 @@
default: ()=>[]
},
},
watch:{
curbrandName:{
handler(nVal, oVal){
this.sonBrandList = []
this.carSeriesList = []
this.filterBrandList = this.carSeriesData.filter(item => item.name.indexOf(nVal)>-1)
},
deep: true
}
},
created(){
this.filterBrandList = this.carSeriesData
// this.flatData(this.carSeriesData)
this.echoDataFn()
},
mounted() {
this.getCarSeriesData()
// this.getCarSeriesData()
},
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(){
let obj = {}
this.echoData.forEach(item => {
let { brandId, brandName, childBrandId, childBrandName, vehicleSeriesId, vehicleSeriesName} = item
if(obj[brandId]){
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{
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{
obj[brandId] = {}
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
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){
this.curBrandInfo = {
......@@ -247,18 +315,26 @@
}
},
// 获取数据源
getCarSeriesData() {
this.$apis.case.getCarSeriesApi({needCarSeries:true}).then(res => {
if(res?.length){
this.carSeriesData = res
this.filterBrandList = res
}
}).finally(end =>{
this.loading = false
})
},
// getCarSeriesData() {
// this.$apis.case.getCarSeriesApi({needCarSeries:true}).then(res => {
// if(res?.length){
// this.carSeriesData = res
// this.filterBrandList = res
// this.flatData(res)
// }
// }).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(){
console.log(this.selectdData)
// console.log(this.selectdData)
this.$emit('handleConfirm', this.selectdData)
},
handleClose(){
......
......@@ -14,8 +14,8 @@
<div class="info">{{ tabPaneText }}列表</div>
<div>
<el-button type="primary" size="small" @click="handleEdit">频道设置</el-button>
<el-button type="primary" size="small" @click="handleAdd">编辑频道</el-button>
<el-button v-if="activeName!=5" type="primary" plain size="small" @click="handleAddContent()">新增内容</el-button>
<el-button type="primary" :plain="activeName==5 || activeName==6" size="small" @click="handleAdd">编辑频道</el-button>
<el-button v-if="activeName!=5 && activeName!=6" type="primary" plain size="small" @click="handleAddContent()">新增内容</el-button>
</div>
</div>
<GLTable ref="editRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :beforeSearchFn="beforeSearchFn" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun">
......@@ -39,7 +39,7 @@
<el-switch v-model="scope.scope.isOpen" @change="updateState(scope.scope)"></el-switch>
</template>
<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-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>
......@@ -80,7 +80,8 @@ export default {
merchantName: '',
createDate: []
},
searchForm: {},
searchForm: {
},
ClassifyInfo: {},
url: url,
mode: 'mid',
......@@ -119,7 +120,7 @@ export default {
label: '商品名称',
name: 'goodsName',
type: 'input',
filter: '5'
filter: '5, 6'
},
{
label: '创建日期',
......@@ -127,7 +128,26 @@ export default {
type: 'date',
addHtml: 'createdDate',
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: '商品分类',
......@@ -135,6 +155,26 @@ export default {
addHtml: 'categorySlot',
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,
tableParams: {
......@@ -212,12 +252,12 @@ export default {
label: '商品名称',
width: 200,
prop: 'goodsName',
filter: '5'
filter: '5, 6'
},
{
label: '缩略图',
addHtml: 'imageSlot',
filter: '5'
filter: '5, 6'
},
{
label: '收款方式',
......@@ -239,12 +279,30 @@ export default {
label: '门店活动价(元)',
width: 150,
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
},
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: '分类',
width: 150,
formatter: cellValue => {
......@@ -253,9 +311,23 @@ export default {
filter: '5'
},
{
label: '商品分类',
width: 150,
prop: 'associationClassifyFirstName',
filter: '6'
},
{
label: '来源',
width: 150,
formatter: cellValue => {
return '嘀加智享平台'
},
filter: '6'
},
{
label: '状态',
addHtml: 'statusSlot',
filter: '5'
filter: '5,6'
},
{
label: '状态',
......@@ -268,26 +340,27 @@ export default {
{
label: '创建日期',
prop: 'createdDate',
filter: '1,2,3,4,5',
filter: '1,2,3,4,5,6',
minWidth: 180
},
{
label: '更新日期',
prop: 'updatedDate',
minWidth: 180,
filter: '1,2,3,4,5'
filter: '1,2,3,4,5,6'
},
{
label: '操作人',
prop: 'updatedBy',
filter: '1,2,3,4'
},
{
label: '操作人',
width: 120,
prop: 'operator',
filter: '5'
filter: '1,2,3,4,5,6'
},
// {
// label: '操作人',
// width: 120,
// prop: 'operator',
// filter: '5,6'
// },
{
label: '操作',
addHtml: 'auth-button',
......@@ -316,6 +389,7 @@ export default {
},
created() {
this.getconfigMerchant()
this.getCategory()
},
mounted() {},
computed: {
......@@ -329,6 +403,21 @@ export default {
SET_CHANNEL_STYLE: 'channel/SET_CHANNEL_STYLE',
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){
this.ClassifyInfo.associationClassifyFirstId = e?.parent?.id
this.ClassifyInfo.associationClassifySecondId = e?.data?.id
......@@ -352,11 +441,12 @@ export default {
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm = this.getParams()
if(this.activeName == 5){
this.searchForm.apiType = 5
if(this.activeName == 5 || this.activeName == 6){
this.searchForm.goodsType = this.activeName == 5 ? '1' : '2' //1是配置2是车主
this.searchForm.apiType = 5 //在api.js判断是否更换接口
this.searchForm.merchantId =this.merchantId
const {associationClassifyFirstId, associationClassifySecondId} = this.ClassifyInfo
this.searchForm.associationClassifyFirstId = associationClassifyFirstId
if(this.activeName == 5) this.searchForm.associationClassifyFirstId = associationClassifyFirstId
this.searchForm.associationClassifySecondId = associationClassifySecondId
this.searchForm.startCreatedDate = this.searchForm.createdDate ? this.searchForm.createdDate + ' 00:00:00' : ''
this.searchForm.endCreatedDate = this.searchForm.createdDate ? this.searchForm.createdDate + ' 23:59:59' : ''
......@@ -379,7 +469,7 @@ export default {
}
} else {
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]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
......@@ -436,7 +526,7 @@ export default {
title = type == 1 ? '查看商品' : '编辑商品'
}
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() {
this.SET_CHANNEL_TYPE({ channelType: this.activeName })
......@@ -536,7 +626,7 @@ export default {
display: flex;
justify-content: space-between;
align-items: center;
margin: 0 0 18px 0;
margin: 0 0 10px 0;
.info {
font-weight: 600;
font-size: 16px;
......
......@@ -332,7 +332,7 @@ export default {
display: flex;
justify-content: space-between;
align-items: center;
margin: 0 0 18px 0;
margin: 0 0 10px 0;
.info {
font-weight: 600;
font-size: 16px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!