Commit 1d772cb8 by 前端

Merge branch 'kuangyq_dev_v2.0.0' into 'v2.0.0'

Kuangyq dev v2.0.0

See merge request !21
2 parents 1fdab779 7ea7776f
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
<el-form-item label="分组名称:" prop="materialGroupName"> <el-form-item label="分组名称:" prop="materialGroupName">
<el-input v-model="materialGroupAddForm.materialGroupName" maxlength="8" show-word-limit :size="size" placeholder="请输入分组名称" style="width: 567px"></el-input> <el-input v-model="materialGroupAddForm.materialGroupName" maxlength="8" show-word-limit :size="size" placeholder="请输入分组名称" style="width: 567px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="业务类型:" prop="businessType"> <!-- <el-form-item label="业务类型:" prop="businessType">
<el-checkbox-group class="checkbox-group" :max="3" v-model="materialGroupAddForm.businessType"> <el-checkbox-group class="checkbox-group" :max="3" v-model="materialGroupAddForm.businessType">
<el-checkbox v-for="item in businessTypes" :key="item.id" :label="item.dictLabel"></el-checkbox> <el-checkbox v-for="item in businessTypes" :key="item.id" :label="item.dictLabel"></el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
<span class="tips">添加业务类型,该素材组里面的所有素材均会添加此业务类型</span> <span class="tips">添加业务类型,该素材组里面的所有素材均会添加此业务类型</span> -->
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button> <el-button @click="dialogVisible = false">取 消</el-button>
...@@ -25,9 +25,9 @@ export default { ...@@ -25,9 +25,9 @@ export default {
name: 'addMaterialGroupDia', name: 'addMaterialGroupDia',
props: { props: {
eventBus: Object, eventBus: Object,
businessTypes: { // businessTypes: {
type: Array // type: Array
} // }
}, },
data() { data() {
return { return {
...@@ -54,7 +54,7 @@ export default { ...@@ -54,7 +54,7 @@ export default {
this.dialogVisible = true this.dialogVisible = true
this.materialGroupAddForm = { this.materialGroupAddForm = {
materialGroupName: '', materialGroupName: '',
businessType: [] // businessType: []
} }
this.groupCounter = group this.groupCounter = group
if (addOrEdit == 2) { if (addOrEdit == 2) {
...@@ -68,36 +68,42 @@ export default { ...@@ -68,36 +68,42 @@ export default {
this.$apis.material.materialGroupDetail(params).then(res => { this.$apis.material.materialGroupDetail(params).then(res => {
console.log(res, '---') console.log(res, '---')
this.materialGroupAddForm = res this.materialGroupAddForm = res
if (res.businessType) { // if (res.businessType) {
this.materialGroupAddForm.businessType = this.materialGroupAddForm.businessType.split(',') // this.materialGroupAddForm.businessType = this.materialGroupAddForm.businessType.split(',')
} else { // } else {
this.materialGroupAddForm.businessType = [] // this.materialGroupAddForm.businessType = []
} // }
}) })
} }
// Object.assign(this.materialGroupAddForm, value) // Object.assign(this.materialGroupAddForm, value)
}, },
// 获取所有业务类型 // 获取所有业务类型
findAllDictData(dictType) { // findAllDictData(dictType) {
var params = { // var params = {
dictType // dictType
} // }
this.$apis.material.findAllDictData(params).then(res => { // this.$apis.material.findAllDictData(params).then(res => {
if (res) { // if (res) {
if (dictType == 'business_type') { // if (dictType == 'business_type') {
this.businessTypes = res // this.businessTypes = res
} // }
} // }
}) // })
// },
getParams() {
var params = JSON.parse(JSON.stringify(this.materialGroupAddForm))
return params
}, },
// 创建 // 创建
submitForm() { submitForm() {
console.log(this.materialGroupAddForm) console.log(this.materialGroupAddForm)
this.$refs.materialGroupAddForm.validate(valid => { this.$refs.materialGroupAddForm.validate(valid => {
if (valid) { if (valid) {
var params = this.getParams()
params.orderFlag = true
// 判断是创建还是编辑 // 判断是创建还是编辑
if (this.materialGroupAddForm.id) { if (this.materialGroupAddForm.id) {
this.eventBus.$emit('editMaterialGroup', this.materialGroupAddForm) this.eventBus.$emit('editMaterialGroup', params)
this.dialogVisible = false this.dialogVisible = false
return return
} }
...@@ -114,7 +120,7 @@ export default { ...@@ -114,7 +120,7 @@ export default {
}) })
return return
} }
this.eventBus.$emit('addMaterialGroup', this.materialGroupAddForm) this.eventBus.$emit('addMaterialGroup', params)
this.dialogVisible = false this.dialogVisible = false
} else { } else {
this.$message({ this.$message({
...@@ -125,11 +131,11 @@ export default { ...@@ -125,11 +131,11 @@ export default {
} }
}) })
}, },
handleCheckChange(val) { // handleCheckChange(val) {
console.log(val) // console.log(val)
this.materialGroupAddForm.businessType = val // this.materialGroupAddForm.businessType = val
// console.log(this.materialGroupAddForm); // // console.log(this.materialGroupAddForm);
} // }
} }
} }
</script> </script>
......
...@@ -13,9 +13,18 @@ ...@@ -13,9 +13,18 @@
<el-popover placement="right" trigger="hover"> <el-popover placement="right" trigger="hover">
<div> <div>
<ul> <ul>
<li @click="handleStick(item)">{{ item.orderTime ? '取消置顶' : '置顶' }}</li> <!-- <li @click="handleStick(item)">{{ item.orderTime ? '取消置顶' : '置顶' }}</li> -->
<li @click="handleAddGroup(2,item)">修改</li> <li>
<li @click="handleDeleteGroup(item.id)" v-if="item.isDefault == -1">删除</li> <GLButton :size="size" type="text" fn="置顶" @click="handleStick(item)">{{ item.orderTime ? '取消置顶' : '置顶' }}</GLButton>
</li>
<!-- <li @click="handleAddGroup(2,item)">修改</li> -->
<li>
<GLButton :size="size" type="text" fn="修改" @click="handleAddGroup(2,item)">修改</GLButton>
</li>
<!-- <li @click="handleDeleteGroup(item.id)" v-if="item.isDefault == -1">删除</li> -->
<li>
<GLButton :size="size" type="text" fn="删除" @click="handleAddGroup(2,item)">删除</GLButton>
</li>
</ul> </ul>
</div> </div>
<i slot="reference" class="el-icon-more"></i> <i slot="reference" class="el-icon-more"></i>
......
<template> <template>
<div class="main-container"> <div class="main-container">
<div class="top"> <div class="top">
<el-button type="primary" @click="addMaterial(1)" :size="size"> <!-- <el-button type="primary" @click="addMaterial(1)" :size="size">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
创建营销素材 创建营销素材
</el-button> </el-button> -->
<GLButton :size="size" type="primary" fn="新增营销素材" class="el-icon-plus" @click="addMaterial(1)">创建营销素材</GLButton>
</div>
<div class="container">
<span @click="showIntroductionDialog"> <span @click="showIntroductionDialog">
功能介绍 功能介绍
<i class="el-icon-arrow-right"></i> <i class="el-icon-arrow-right"></i>
...@@ -72,11 +75,21 @@ ...@@ -72,11 +75,21 @@
</div> </div>
<span slot="auth-button" slot-scope="scope"> <span slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.scope)">详情</el-button> <el-button type="text" @click="handleDetail(scope.scope)">详情</el-button>
<el-button type="text" @click="addMaterial(2, scope.scope)">编辑</el-button> <!-- <el-button type="text" @click="addMaterial(2, scope.scope)">编辑</el-button> -->
<GLButton :size="size" type="text" fn="编辑" @click="addMaterial(2, scope.scope)">编辑</GLButton>
<!-- <GLButton :size="size" type="text" fn="详情" class="el-icon-plus" @click="addMaterial(1)">详情</GLButton> -->
<el-popover placement="right" trigger="click"> <el-popover placement="right" trigger="click">
<ul> <ul>
<li @click="handleForbid(scope.scope)">{{ scope.scope.status == 0 ? '禁用' : '启用' }}</li> <!-- <li @click="handleForbid(scope.scope)">{{ scope.scope.status == 0 ? '禁用' : '启用' }}</li> -->
<li @click="handleDelete(scope.scope)">删除</li> <li>
<!-- <el-button :size="size" type="text" @click="handleForbid(scope.scope)">{{ scope.scope.status == 0 ? '禁用' : '启用' }}</el-button> -->
<GLButton :size="size" type="text" fn="禁用" @click="handleForbid(scope.scope)">{{ scope.scope.status == 0 ? '禁用' : '启用' }}</GLButton>
</li>
<!-- <li @click="handleDelete(scope.scope)">删除</li> -->
<li>
<!-- <el-button :size="size" type="text" @click="handleDelete(scope.scope)">删除</el-button> -->
<GLButton :size="size" type="text" fn="删除营销素材" @click="handleDelete(scope.scope)">删除</GLButton>
</li>
</ul> </ul>
<el-button type="text" slot="reference" class="btn-more">更多</el-button> <el-button type="text" slot="reference" class="btn-more">更多</el-button>
</el-popover> </el-popover>
...@@ -119,7 +132,7 @@ export default { ...@@ -119,7 +132,7 @@ export default {
materialName: '' materialName: ''
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
layout: 'sizes, prev, pager, next, jumper, ->, total', layout: 'sizes, prev, pager, next, jumper, ->, total',
materialTableData: [], materialTableData: [],
materialGroupDialog: false, materialGroupDialog: false,
introductionDialog: false, introductionDialog: false,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!