Commit b06f9296 by liimin

xiugai

1 parent 082859f1
...@@ -11,7 +11,11 @@ import { ...@@ -11,7 +11,11 @@ import {
import { import {
voiceList, voiceList,
manufacturers, manufacturers,
merchants merchants,
addActivity,
mergeActivity,
searchActivity,
searchCoupon
} from './voice' } from './voice'
export { export {
...@@ -24,5 +28,9 @@ export { ...@@ -24,5 +28,9 @@ export {
getExp, getExp,
mergeExp, mergeExp,
addBg, addBg,
mergeBg mergeBg,
addActivity,
mergeActivity,
searchActivity,
searchCoupon
} }
import { import {
GlAxios GlAxios
} from 'glsx-vue-common' } from 'glsx-vue-common'
const path = '/admin-ddh-aimanager/voice/activity' const path = '/admin-ddh-aimanager'
const __sVoiceList = `${path}/get` const __sVoiceList = `${path}/voice/activity/search`
const __sGetManufacturer = `/admin-ddh-aimanager/manufacturer/search` const __sGetManufacturer = `${path}/manufacturer/search`
const __sGetMerchant = `/admin-ddh-aimanager/merchant/search` const __sGetMerchant = `${path}/merchant/search`
const __sAdd = `${path}/voice/activity/add`
const __sMerge = `${path}/voice/activity/merge`
const __sSearch = `${path}/voice/activity/get`
const __sCouponSearch = `${path}/coupon/search`
/** /**
* 获取语音活动列表 * 获取语音活动列表
*/ */
const voiceList = { const voiceList = {
p: [__sVoiceList], p: [__sVoiceList],
req: params => GlAxios.post(__sVoiceList, { req: params => GlAxios.post(__sVoiceList, params, {
params headers: {
'Content-Type': 'application/json; charset=utf-8'
},
requestType: 'jsonString'
}) })
} }
/** /**
...@@ -30,8 +37,47 @@ const merchants = { ...@@ -30,8 +37,47 @@ const merchants = {
req: params => GlAxios.get(__sGetMerchant, params) req: params => GlAxios.get(__sGetMerchant, params)
} }
/**
* 添加语音活动
*/
const addActivity = {
p: [__sAdd],
req: params => GlAxios.post(__sAdd, {
params
})
}
/**
* 修改语音活动
*/
const mergeActivity = {
p: [__sMerge],
req: params => GlAxios.post(__sMerge, {
params
})
}
/**
* 查询语音活动
*/
const searchActivity = {
p: [__sSearch],
req: params => GlAxios.post(__sSearch, {
params
})
}
/**
* 查询语音活动
*/
const searchCoupon = {
p: [__sCouponSearch],
req: params => GlAxios.get(__sCouponSearch, params)
}
export { export {
voiceList, voiceList,
manufacturers, manufacturers,
merchants merchants,
addActivity,
mergeActivity,
searchActivity,
searchCoupon
} }
...@@ -47,7 +47,7 @@ var mixin = { ...@@ -47,7 +47,7 @@ var mixin = {
}) })
} }
} }
const URL = ' http://192.168.3.171:7300/mock/5be17454f31545347559d499/config' const URL = ' http://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config'
const getConfig = (url = URL + '/ai_manager_config') => { const getConfig = (url = URL + '/ai_manager_config') => {
return new Promise(resolve => { return new Promise(resolve => {
const xhr = new XMLHttpRequest() const xhr = new XMLHttpRequest()
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
placeholder="请选择品牌厂商" placeholder="请选择品牌厂商"
name="manufacturerId" name="manufacturerId"
data-vv-as="品牌厂商" data-vv-as="品牌厂商"
v-validate="'required'" v-validate="!manufactureOnly && 'required'"
:style="{'width':(in_row?width:'100%')}" :style="{'width':(in_row?width:'100%')}"
> >
<gl-option <gl-option
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
v-validate="'required'" v-validate="'required'"
> >
<gl-option <gl-option
v-for="item in grayscaleUserList" v-for="item in users"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
size="small" size="small"
type="primary" type="primary"
plain plain
>添加动效音频<i class="el-icon-upload el-icon--right"></i></gl-button> >上传灰度用户<i class="el-icon-upload el-icon--right"></i></gl-button>
<div <div
slot="tip" slot="tip"
class="el-upload__tip" class="el-upload__tip"
...@@ -127,8 +127,22 @@ ...@@ -127,8 +127,22 @@
<script> <script>
import { manufacturers, merchants, grayscaleuser } from '@/api' import { manufacturers, merchants, grayscaleuser } from '@/api'
import { NoticeMixin } from '@/mixins' import { NoticeMixin } from '@/mixins'
let manufacturer_list_back_up = [] let manufacturer_list_back_up = [
let merchant_list_back_up = [] {
manufacturer: null,
manufacturerName: '请选择品牌厂商',
merchantId: 0,
merchantName: ''
}
]
let merchant_list_back_up = [
{
merchantId: null,
merchantName: '请选择渠道商',
merchantStatus: 0,
merchantType: 401
}
]
export default { export default {
name: 'Manufacturers', name: 'Manufacturers',
mixins: [NoticeMixin], mixins: [NoticeMixin],
...@@ -144,10 +158,9 @@ export default { ...@@ -144,10 +158,9 @@ export default {
watch: { watch: {
eventBus: { eventBus: {
handler(__eventBus) { handler(__eventBus) {
__eventBus && if (__eventBus) {
__eventBus.$on('submit', callback => { __eventBus.$on('submit', callback => {
this.$validator.validateAll().then(result => { this.$validator.validateAll().then(result => {
// __eventBus.$emit('manufacturers', this.model)
this.result.manufacturers = this.manufacturer_list.filter( this.result.manufacturers = this.manufacturer_list.filter(
obj => this.model.manufacturerId === obj.manufacturer obj => this.model.manufacturerId === obj.manufacturer
)[0] )[0]
...@@ -155,9 +168,16 @@ export default { ...@@ -155,9 +168,16 @@ export default {
obj => this.model.merchantId === obj.merchantId obj => this.model.merchantId === obj.merchantId
)[0] )[0]
this.$emit('update:value', this.result) this.$emit('update:value', this.result)
callback && callback() callback && callback(this.result)
})
}),
__eventBus.$on('clear_error', () => {
this.$validator.errors.clear()
}) })
__eventBus.$on('reset', () => {
this.reset()
}) })
}
}, },
immediate: true immediate: true
//this.eventBus.$emit('manufacturerChanged', val) //this.eventBus.$emit('manufacturerChanged', val)
...@@ -177,7 +197,7 @@ export default { ...@@ -177,7 +197,7 @@ export default {
'http://qcimg01.glsx.net:7060/ddh-ai-m/AI管家-灰度用户导入模板.XLSX', 'http://qcimg01.glsx.net:7060/ddh-ai-m/AI管家-灰度用户导入模板.XLSX',
manufacturer_list: [], manufacturer_list: [],
merchant_list: [], merchant_list: [],
grayscaleUserList: [ users: [
{ label: '全量', value: 'ALL' }, { label: '全量', value: 'ALL' },
{ label: '指定用户(灰度)', value: 'LIST' } { label: '指定用户(灰度)', value: 'LIST' }
], ],
...@@ -197,33 +217,23 @@ export default { ...@@ -197,33 +217,23 @@ export default {
methods: { methods: {
get_manufacturer_list() { get_manufacturer_list() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (manufacturer_list_back_up.length) { if (manufacturer_list_back_up.length > 1) {
// this.manufacturer_list = manufacturer_list_back_up
resolve(manufacturer_list_back_up) resolve(manufacturer_list_back_up)
} }
manufacturers manufacturers
.req({}) .req({})
.then(res => .then(res => resolve(res))
// manufacturer_list_back_up = this.manufacturer_list = res
// this.model.manufacturerId = this.default_value.manufacturerId
resolve(res)
)
.catch(err => reject(err)) .catch(err => reject(err))
}) })
}, },
get_merchant_list() { get_merchant_list() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (merchant_list_back_up.length) { if (merchant_list_back_up.length > 1) {
// this.merchant_list = merchant_list_back_up
resolve(merchant_list_back_up) resolve(merchant_list_back_up)
} }
merchants merchants
.req({ merchantType: 401, merchantStatus: 0 }) .req({ merchantType: 401, merchantStatus: 0 })
.then( .then(res => resolve(res))
res => resolve(res)
// merchant_list_back_up = this.merchant_list = res
// this.model.merchantId = this.default_value.merchantId
)
.catch(err => reject(err)) .catch(err => reject(err))
}) })
}, },
...@@ -232,10 +242,8 @@ export default { ...@@ -232,10 +242,8 @@ export default {
const { savePath } = res.data const { savePath } = res.data
grayscaleuser grayscaleuser
.req({ grayscaleUserFilePath: savePath }) .req({ grayscaleUserFilePath: savePath })
.then(res => { .then(res => (this.result.grayscaleUserList = res))
this.model.grayscaleUserList = res .catch(err => this.error(err))
})
.catch(err => console.log(err))
}, },
// 限制用户上传的灰度用户文件格式和大小 // 限制用户上传的灰度用户文件格式和大小
beforeUpload_grayscaleuser(file) { beforeUpload_grayscaleuser(file) {
...@@ -251,6 +259,18 @@ export default { ...@@ -251,6 +259,18 @@ export default {
}, },
onRemove_grayscaleuser() { onRemove_grayscaleuser() {
this.model.grayscaleUserList = '' this.model.grayscaleUserList = ''
},
reset() {
//初始化
this.model.manufacturerId = null
this.model.merchantId = null
this.result = {
manufacturers: null, //生产厂商
merchants: null, //商户渠道
grayscaleUserList: null, //灰度用户列表
influenceScope: '' //用户类型
}
this.$emit('update:value', this.result)
} }
}, },
created() { created() {
...@@ -265,16 +285,16 @@ export default { ...@@ -265,16 +285,16 @@ export default {
* [{name: 'food.jpg', url: 'https://xxx.cdn.com/xxx.jpg'}] * [{name: 'food.jpg', url: 'https://xxx.cdn.com/xxx.jpg'}]
*/ */
} }
Promise.all([this.get_manufacturer_list(), this.get_merchant_list()]).then( Promise.all([this.get_manufacturer_list(), this.get_merchant_list()])
result => { .then(result => {
manufacturer_list_back_up = this.manufacturer_list = result[0] this.manufacturer_list = manufacturer_list_back_up.concat(result[0])
merchant_list_back_up = this.merchant_list = result[1] this.merchant_list = merchant_list_back_up.concat(result[1])
if (this.default_value) { if (this.default_value) {
this.model.merchantId = this.default_value.merchantId this.model.merchantId = this.default_value.merchantId
this.model.manufacturerId = this.default_value.manufacturerId this.model.manufacturerId = this.default_value.manufacturerId
} }
} })
) .catch(err => this.error(err))
} }
} }
</script> </script>
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
<gl-form <gl-form
:model="editForm" :model="editForm"
label-width="120px" label-width="120px"
:rules="updateRules"
> >
<gl-form-item <gl-form-item
label="活动标题:" label="活动标题:"
...@@ -108,6 +107,8 @@ ...@@ -108,6 +107,8 @@
<gl-input-number <gl-input-number
v-model="editForm.count" v-model="editForm.count"
:min="1" :min="1"
controls-position="right"
:disabled="true"
label="触发次数" label="触发次数"
></gl-input-number> ></gl-input-number>
</gl-form-item> </gl-form-item>
...@@ -228,29 +229,26 @@ import Vue from 'vue' ...@@ -228,29 +229,26 @@ import Vue from 'vue'
import Gift from './gift' import Gift from './gift'
const form_init = { const form_init = {
activityTitle: '', // 活动标题 activityTitle: '', // 活动标题
manufacturer: '', // 品牌厂商 activityForm: 'GIFT',
grayscaleUserList: '', // 用户 activityReply: '', // 活动回复语
activityTip: '', // 活动提示语 activityTip: '', // 活动提示语
beginTime: '',
endTime: '',
manufacturer: '', // 品牌厂商
grayscaleUserList: [], // 用户
id: '',
influenceScope: 'ALL',
voiceCommand: '', // 声控命令词 voiceCommand: '', // 声控命令词
activityReply: '', // 活动回复语
tipType: '', // 触发方式 tipType: '', // 触发方式
count: 1, // 触发次数 count: 1, // 触发次数
activityForm: 'GIFT', // 活动内容
coupons: [], // 优惠券 coupons: [], // 优惠券
pic: '', // 动效图标
voice: '', // 动效音频
time: '', // 活动结束时间
activityConfig: { activityConfig: {
audioFilePath: '', audioFilePath: '',
dynamicEffectIcon: '', dynamicEffectIcon: '',
giftId: 0, giftId: 0,
giftName: '', giftName: '',
giftType: '' giftType: ''
}, }
beginTime: '',
endTime: '',
triCount: 1,
time: ''
} }
export default { export default {
...@@ -269,37 +267,67 @@ export default { ...@@ -269,37 +267,67 @@ export default {
eventBus(val) { eventBus(val) {
if (val) { if (val) {
this.eventBus.$on('giftDialogClose', () => (this.giftVisible = false)) this.eventBus.$on('giftDialogClose', () => (this.giftVisible = false))
this.eventBus.$on( //礼品优惠券弹出框提交后 更新数据
'manufacturerChanged',
value => (this.editForm.manufacturer = value)
)
this.eventBus.$on('submitGift', value => { this.eventBus.$on('submitGift', value => {
this.coupons.data = value const { name, id, type } = value
this.setCouponsData({
giftType: type,
giftName: name,
giftId: id
})
this.giftVisible = false this.giftVisible = false
}) })
this.eventBus.$on('edit_event_data', data => { this.eventBus.$on('edit_event_data', data => {
this.title = data ? '编辑活动' : '新增活动' this.title = data ? '编辑活动' : '新增活动'
if (!data) { if (!data) {
this.editForm = this.$deep_clone(form_init) //新增活动
this.$validator.errors.clear() this.editForm = this.$deep_clone(form_init) //拷贝初始化数据
return delete this.editForm.id //删除id
} this.eventBus.$emit('reset') //广播 ---- 清空 组件 数据
const __clone = this.$deep_clone(data) } else {
//编辑活动
const __clone = this.$deep_clone(data) // 拷贝列表传入数据
this.editForm = __clone this.editForm = __clone
this.editForm.time = [__clone.beginTime, __clone.endTime] const {
this.$validator.errors.clear() manufacturerId,
merchantId,
influenceScope,
grayscaleUserList,
endTime,
beginTime,
activityConfig
} = __clone
this.default_value = {
//设置组件默认值
manufacturerId,
merchantId,
influenceScope,
grayscaleUserList
}
this.editForm.time = [beginTime, endTime] //设置时间
this.editForm.count = this.editForm.count || 1 //触发次数暂时没有 默认 1 触发次数暂时不能选择
this.setCouponsData(this.$deep_clone(JSON.parse(activityConfig)))
}
setTimeout(() => {
this.eventBus.$emit('clear_error') //
}, 100)
}) })
// this.eventBus.$on( this.eventBus.$on('clear_error', () => this.$validator.errors.clear()) //箭头事件 清除页面错误信息
// 'manufacturers',
// result => (this.editForm.manufacturer = result)
// )
} }
} }
// 'editForm.activityConfig.giftId': {
// handle(val) {
// const { giftName, giftId, giftType } = this.editForm.activityConfig
// this.coupons.data = [{ giftName, giftId, giftType }]
// },
// immediate: true
// }
}, },
data() { data() {
return { return {
//弹出框标题
title: '', title: '',
manufacturerShow: false, //子组件默认值
default_value: { default_value: {
// // merchantId: 19180001, // // merchantId: 19180001,
// manufacturerId: 10012, // manufacturerId: 10012,
...@@ -307,61 +335,39 @@ export default { ...@@ -307,61 +335,39 @@ export default {
// influenceScope: 'LIST', // influenceScope: 'LIST',
// grayscaleuser: ['11'] // grayscaleuser: ['11']
}, },
//触发类型
tipType: { tipType: {
BUBBLING: true, BUBBLING: true, //冒泡
DIALOGUE: false, DIALOGUE: false, //对话
BOTH: false BOTH: false //对话和冒泡
}, },
pickerOptions: {}, // 日期设置对象 pickerOptions: {}, // 日期设置对象
// 提交参数 // 提交参数
editForm: {}, editForm: {},
updateRules: { uploadAction: '', //文件上传地址
channelName: [{ required: true }],
merchantId: [{ required: true }],
channelUrl: [{ required: true }],
moduleList: [{ required: true }]
},
uploadAction: '',
giftVisible: false, giftVisible: false,
contents: [ contents: [
//活动内容下拉框选项
{ label: '关联礼品', value: 'GIFT' }, { label: '关联礼品', value: 'GIFT' },
{ label: '关联瀑布特效', value: 'DYNAMIC_EFFECT' }, { label: '关联瀑布特效', value: 'DYNAMIC_EFFECT' },
{ label: '关联礼品+瀑布特效', value: 'GIFT_DYNAMIC' } { label: '关联礼品+瀑布特效', value: 'GIFT_DYNAMIC' }
], ],
coupons: { coupons: {
height: 122, //礼物表格 目前只能选择一个礼物
height: 50,
border: true, border: true,
data: [ data: [],
{
name: '嘀嘀虎1',
id: '001'
},
{
name: '嘀嘀虎2',
id: '002'
},
{
name: '嘀嘀虎3',
id: '003'
},
{
name: '嘀嘀虎4',
id: '004'
}
],
column: [ column: [
{ {
label: '优惠券编号', label: '优惠券编号',
prop: 'id', prop: 'giftId',
width: '180' width: '180'
}, },
{ {
label: '优惠券名称', label: '优惠券名称',
prop: 'name' prop: 'giftName'
} }
], ]
selection: {},
multipleSelection: []
} }
} }
}, },
...@@ -372,14 +378,13 @@ export default { ...@@ -372,14 +378,13 @@ export default {
// this.eventBus = new Vue() // this.eventBus = new Vue()
}, },
methods: { methods: {
handleModuleChange(params, checked) { //提交数据
// console.log(checked.checkedKeys)
this.editForm.moduleList = checked.checkedKeys
},
handleSubmit() { handleSubmit() {
this.eventBus.$emit('submit') //发出提交事件广播 组件触发验证 并回调传入验证后的数据
this.eventBus.$emit('submit', data => {
this.$validator.validateAll().then(result => { this.$validator.validateAll().then(result => {
console.log(this.editForm.manufacturer) console.log(this.editForm)
})
}) })
}, },
handleClose() { handleClose() {
...@@ -387,6 +392,14 @@ export default { ...@@ -387,6 +392,14 @@ export default {
}, },
addGift() { addGift() {
this.giftVisible = true this.giftVisible = true
},
setCouponsData(data) {
console.log(data)
const { giftName, giftId, giftType } = data
this.editForm.activityConfig.giftName = giftName
this.editForm.activityConfig.giftId = giftId
this.editForm.activityConfig.giftType = giftType
this.coupons.data = [this.editForm.activityConfig]
} }
} }
} }
......
...@@ -8,16 +8,66 @@ ...@@ -8,16 +8,66 @@
width='800px ' width='800px '
> >
<gl-row> <gl-row>
<gl-col :span="11"> <gl-col :span="24">
<gl-card shadow="always"> <gl-card shadow="always">
可选择活动礼品 <gl-form
:inline="true"
:model="searchCondition"
>
<gl-form-item label="优惠券名称:">
<gl-input
v-model="searchCondition.name"
class="input-with-select"
placeholder="请输入优惠券名称"
clearable
/>
</gl-form-item>
<gl-form-item label='优惠券类型:'>
<gl-select
v-model="searchCondition.type"
placeholder="请选择优惠券类型"
style="width:100%"
>
<gl-option
v-for="item in types"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</gl-select>
</gl-form-item>
<gl-form-item>
<gl-button
type="primary"
@click="handleSearch"
>搜索</gl-button>
</gl-form-item>
</gl-form>
<gl-table <gl-table
:table="giftTable" :table="giftTable"
ref="giftTable" ref="giftTable"
v-loading="tableLoading"
></gl-table> ></gl-table>
<gl-row class="gift-info">
<gl-col :span="12">
<gl-pagination
background
@current-change="handleCurrentChange"
:current-page="page.pageNum"
:page-sizes="[10,20,30,40]"
:page-size="page.pageSize"
layout="total, prev, pager, next"
:total="page.total"
>
</gl-pagination>
</gl-col>
<gl-col :span="12">
<gl-tag type="success">已选择优惠券编号:{{checked.id}} 名称:{{checked.name}}</gl-tag>
</gl-col>
</gl-row>
</gl-card> </gl-card>
</gl-col> </gl-col>
<gl-col <!-- <gl-col
:span="2" :span="2"
class="transfer__col" class="transfer__col"
> >
...@@ -39,8 +89,8 @@ ...@@ -39,8 +89,8 @@
@click="handleDisSelectGift" @click="handleDisSelectGift"
></gl-button> ></gl-button>
</div> </div>
</gl-col> </gl-col> -->
<gl-col :span="11"> <!-- <gl-col :span="12">
<gl-card shadow="always"> <gl-card shadow="always">
已选择活动礼品 已选择活动礼品
<gl-table <gl-table
...@@ -48,7 +98,7 @@ ...@@ -48,7 +98,7 @@
ref="checkedTable" ref="checkedTable"
></gl-table> ></gl-table>
</gl-card> </gl-card>
</gl-col> </gl-col> -->
</gl-row> </gl-row>
<div <div
slot="footer" slot="footer"
...@@ -66,18 +116,41 @@ ...@@ -66,18 +116,41 @@
</template> </template>
<script> <script>
import { searchCoupon } from '@/api'
import { NoticeMixin } from '@/mixins'
export default { export default {
name: 'Gift', name: 'Gift',
props: { props: {
giftVisible: Boolean, giftVisible: Boolean,
eventBus: Object eventBus: Object
}, },
mixins: [NoticeMixin],
data() { data() {
return { return {
submiting: false, submiting: false,
tableLoading: false,
checked: { id: 274, name: '3.98优惠券', type: 1 },
searchCondition: {
name: '',
type: ''
},
page: {
pageNum: 1,
pageSize: 10,
total: 10
},
types: [
{ name: '抵扣券', value: 1 },
{ name: '折扣券', value: 2 },
{ name: '流量', value: 3 }
],
giftTable: { giftTable: {
highlightCurrentRow: true,
rowClick: (row, event, column) => {
this.checked = row
},
selectionChange: this.handleGiftTableSelectionChange, selectionChange: this.handleGiftTableSelectionChange,
height: 400, height: 330,
border: true, border: true,
data: [ data: [
{ {
...@@ -107,8 +180,8 @@ export default { ...@@ -107,8 +180,8 @@ export default {
label: '优惠券名称', label: '优惠券名称',
prop: 'name' prop: 'name'
} }
], ]
selection: [] // selection: []
}, },
checkedTable: { checkedTable: {
height: 400, height: 400,
...@@ -130,13 +203,51 @@ export default { ...@@ -130,13 +203,51 @@ export default {
label: '优惠券名称', label: '优惠券名称',
prop: 'name' prop: 'name'
} }
], ]
selection: [] // selection: []
} }
} }
}, },
mounted() {}, mounted() {
this.getList(this.page)
},
methods: { methods: {
getList(p) {
searchCoupon
.req(p)
.then(res => {
this.page.total = res.total
this.giftTable.data = res
this.tableLoading = false
})
.catch(err => {
this.tableLoading = false
this.error(err)
})
},
/* 接口请求-start */
getParams() {
return new Promise(resolve => {
var __p = {}
if (this.searchCondition.name) {
__p.name = this.searchCondition.name
}
if (this.searchCondition.type) {
__p.type = this.searchCondition.type
}
resolve(__p)
})
},
handleSearch() {
this.tableLoading = true
this.getParams().then(__p => {
this.getList(Object.assign(__p, this.page))
})
},
handleCurrentChange(val) {
this.page.pageNum = val
this.handleSearch()
},
handleClose() { handleClose() {
this.eventBus.$emit('giftDialogClose') this.eventBus.$emit('giftDialogClose')
}, },
...@@ -166,7 +277,7 @@ export default { ...@@ -166,7 +277,7 @@ export default {
) )
}, },
handleSubmit() { handleSubmit() {
this.eventBus.$emit('submitGift', this.checkedTable.data) this.eventBus.$emit('submitGift', this.checked)
} }
} }
} }
...@@ -197,5 +308,14 @@ export default { ...@@ -197,5 +308,14 @@ export default {
.el-transfer__buttons { .el-transfer__buttons {
padding: 0; padding: 0;
} }
.gift-info {
margin: 4px;
.el-tag--success {
width: 100%;
}
}
.current-row {
color: #865b10;
}
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -5,16 +5,19 @@ ...@@ -5,16 +5,19 @@
:inline="true" :inline="true"
:model="searchCondition" :model="searchCondition"
> >
<gl-form-item> <gl-form-item label="活动主题:">
<gl-input <gl-input
v-model="searchCondition.content" v-model="searchCondition.activityTitle"
class="input-with-select" class="input-with-select"
placeholder="请输入活动主题" placeholder="请输入活动主题"
clearable clearable
/> />
</gl-form-item> </gl-form-item>
<gl-form-item> <gl-form-item>
<Manufacturers :manufactureOnly="true" /> <Manufacturers
:manufactureOnly="true"
:eventBus='eventBus'
/>
</gl-form-item> </gl-form-item>
<gl-form-item> <gl-form-item>
<gl-button <gl-button
...@@ -26,7 +29,7 @@ ...@@ -26,7 +29,7 @@
<gl-button <gl-button
class="newButton" class="newButton"
type="primary" type="primary"
@click="dialog" @click="dialog(null,null)"
>添加活动</gl-button> >添加活动</gl-button>
</gl-form-item> </gl-form-item>
</gl-form> </gl-form>
...@@ -47,11 +50,11 @@ ...@@ -47,11 +50,11 @@
background background
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="pageNum" :current-page="page.pageNum"
:page-sizes="[10,20,30,40]" :page-sizes="[10,20,30,40]"
:page-size="pageSize" :page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="total" :total="page.total"
> >
</gl-pagination> </gl-pagination>
</div> </div>
...@@ -80,12 +83,14 @@ export default { ...@@ -80,12 +83,14 @@ export default {
return { return {
searchCondition: { searchCondition: {
manufacturer: '', manufacturer: '',
content: '' activityTitle: ''
}, },
eventBus: null, eventBus: null,
page: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
total: 10, total: 10
},
/* 组件params-start */ /* 组件params-start */
updateVisible: false, updateVisible: false,
// updateParams: this.$deep_clone(channelStructrue), // updateParams: this.$deep_clone(channelStructrue),
...@@ -168,13 +173,12 @@ export default { ...@@ -168,13 +173,12 @@ export default {
{ {
label: '上架', label: '上架',
type: 'text', type: 'text',
formatter: row => { formatter: row =>
return row.status === { ON: '上架', OF: '下架' }[+row.status] row.status === { ON: '上架', OF: '下架' }[row.status],
}, callback: (index, row) =>
callback: (index, row) => {
this.$confirm( this.$confirm(
`确定${ `确定${
{ ON: '上架', OF: '下架' }[+row[index].status] { ON: '上架', OF: '下架' }[row[index].status]
}该活动?`, }该活动?`,
'', '',
{ {
...@@ -183,10 +187,8 @@ export default { ...@@ -183,10 +187,8 @@ export default {
) )
.then(() => { .then(() => {
this.tableLoading = true this.tableLoading = true
// this.carServerUpdate(this.$deep_clone(row), 'moduleStatus')
}) })
.catch(err => console.log(err)) .catch(err => console.log(err))
}
}, },
{ {
type: '', type: '',
...@@ -213,31 +215,36 @@ export default { ...@@ -213,31 +215,36 @@ export default {
} }
}, },
mounted() { mounted() {
this.getList() this.getList(this.page)
this.eventBus = new Vue() this.eventBus = new Vue()
}, },
methods: { methods: {
loadingGetList() { loadingGetList() {
this.tableLoading = true this.tableLoading = true
this.getList() this.getParams().then(__p => {
this.getList(Object.assign(__p, this.page))
})
}, },
/* 接口请求-start */ /* 接口请求-start */
getParams() { getParams() {
return Object.assign( return new Promise(resolve => {
{ var __p = { condition: {} }
pageNum: this.pageNum, this.eventBus.$emit('submit', data => {
pageSize: this.pageSize if (data.manufacturers) {
}, __p.condition.manufacturerId = data.manufacturers.manufacturerId
this.searchCondition }
) if (this.searchCondition.activityTitle) {
__p.condition.activityTitle = this.searchCondition.activityTitle
}
resolve(__p)
})
})
}, },
getList() { getList(p) {
const params = this.getParams()
// params = deleteEmptyAttribute(params)
voiceList voiceList
.req(params) .req(p)
.then(res => { .then(res => {
this.total = res.total this.page.total = res.total
this.tableData.data = res.list this.tableData.data = res.list
this.tableLoading = false this.tableLoading = false
}) })
...@@ -270,22 +277,6 @@ export default { ...@@ -270,22 +277,6 @@ export default {
// notice.errorTips(err) // notice.errorTips(err)
// }) // })
}, },
channelLog(params) {
// this.recordVisibleChange()
// channelLog
// .req({ channelId: params })
// .then(res => {
// // notice.okTips(res)
// this.recordTable.list = res.list
// this.recordTable.total = res.total
// this.recordLoading = false
// // console.log(this.recordTable)
// // this.recordVisibleChange()
// })
// .catch(err => {
// notice.errorTips(err)
// })
},
getManufacturer() { getManufacturer() {
manufacturers manufacturers
.req({}) .req({})
...@@ -297,11 +288,11 @@ export default { ...@@ -297,11 +288,11 @@ export default {
this.loadingGetList() this.loadingGetList()
}, },
handleSizeChange(val) { handleSizeChange(val) {
this.pageSize = val this.page.pageSize = val
this.loadingGetList() this.loadingGetList()
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.pageNum = val this.page.pageNum = val
this.loadingGetList() this.loadingGetList()
}, },
updateVisibleChange() { updateVisibleChange() {
......
...@@ -21,13 +21,16 @@ module.exports = { ...@@ -21,13 +21,16 @@ module.exports = {
}, },
devServer: { devServer: {
port: 8085, port: 8085,
host: '192.168.2.36', host: '0.0.0.0',
open: true, // open: process.platform === '192.168.0.21',
proxy: { proxy: {
'/api': { '/api': {
target: 'http://127.0.0.1:8080', target: 'http://192.168.0.21:8080',
changeOrigin: true, changeOrigin: true,
pathRewrite: { '^/api': '' } pathRewrite: {
'^/api': ''
},
ws: false
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!