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