Commit bc5a8ead by liimin

s

1 parent 56b0a7fb
......@@ -26,7 +26,12 @@ const voiceList = {
*/
const manufacturers = {
p: [__sGetManufacturer],
req: params => GlAxios.get(__sGetManufacturer, params)
req: params => GlAxios.post(__sGetManufacturer, params, {
headers: {
'Content-Type': 'application/json; charset=utf-8'
},
requestType: 'jsonString'
})
}
/**
......@@ -34,7 +39,12 @@ const manufacturers = {
*/
const merchants = {
p: [__sGetMerchant],
req: params => GlAxios.get(__sGetMerchant, params)
req: params => GlAxios.post(__sGetMerchant, params, {
headers: {
'Content-Type': 'application/json; charset=utf-8'
},
requestType: 'jsonString'
})
}
/**
......@@ -42,8 +52,11 @@ const merchants = {
*/
const addActivity = {
p: [__sAdd],
req: params => GlAxios.post(__sAdd, {
params
req: params => GlAxios.post(__sAdd, params, {
headers: {
'Content-Type': 'application/json; charset=utf-8'
},
requestType: 'jsonString'
})
}
/**
......@@ -51,8 +64,11 @@ const addActivity = {
*/
const mergeActivity = {
p: [__sMerge],
req: params => GlAxios.post(__sMerge, {
params
req: params => GlAxios.post(__sMerge, params, {
headers: {
'Content-Type': 'application/json; charset=utf-8'
},
requestType: 'jsonString'
})
}
/**
......
......@@ -12,7 +12,7 @@
>
<gl-option
v-for="item in manufacturer_list"
:key="item.manufacturer"
:key="item.manufacturerName"
:label="item.manufacturerName"
:value="item.manufacturer"
/>
......@@ -40,7 +40,7 @@
>
<gl-option
v-for="item in merchant_list"
:key="item.merchantId"
:key="item.merchantName"
:label="item.merchantName"
:value="item.merchantId"
/>
......@@ -160,7 +160,7 @@ export default {
handler(__eventBus) {
if (__eventBus) {
__eventBus.$on('submit', callback => {
this.$validator.validateAll().then(result => {
this.$validator.validate().then(result => {
this.result.manufacturers = this.manufacturer_list.filter(
obj => this.model.manufacturerId === obj.manufacturer
)[0]
......@@ -168,7 +168,16 @@ export default {
obj => this.model.merchantId === obj.merchantId
)[0]
this.$emit('update:value', this.result)
callback && callback(this.result)
let __back__data__ = null
// console.log(result, this.result, this.errorBags)
if (this.manufactureOnly) {
callback && callback(this.result)
} else {
if (result) {
__back__data__ = this.result
}
callback && __back__data__ && callback(__back__data__)
}
})
}),
__eventBus.$on('clear_error', () => {
......@@ -232,7 +241,7 @@ export default {
resolve(manufacturer_list_back_up)
}
manufacturers
.req({})
.req({ pageNum: 1, pageSize: 999 })
.then(res => resolve(res))
.catch(err => reject(err))
})
......@@ -243,7 +252,7 @@ export default {
resolve(merchant_list_back_up)
}
merchants
.req({ merchantType: 401, merchantStatus: 0 })
.req({ merchantType: 401 })
.then(res => resolve(res))
.catch(err => reject(err))
})
......@@ -281,7 +290,7 @@ export default {
grayscaleUserList: null, //灰度用户列表
influenceScope: '' //用户类型
}
this.$emit('update:value', this.result)
// this.$emit('update:value', this.result)
},
__setDefault(__default) {
this.model.merchantId = __default.merchantId
......
......@@ -62,7 +62,14 @@
</gl-pagination>
</gl-col>
<gl-col :span="12">
<gl-tag type="success">已选择优惠券编号:{{checked.id}} 名称:{{checked.name}}</gl-tag>
<gl-tag
type="success"
v-if="checked.giftId"
>已选择优惠券编号:{{checked.giftId}} 名称:{{checked.giftName}}</gl-tag>
<gl-tag
type="success"
v-else
>暂无选择</gl-tag>
</gl-col>
</gl-row>
</gl-card>
......@@ -125,11 +132,20 @@ export default {
eventBus: Object
},
mixins: [NoticeMixin],
watch: {
eventBus(__eventBus) {
if (__eventBus) {
__eventBus.$on('checked_gift', value => {
this.checked = value
})
}
}
},
data() {
return {
submiting: false,
tableLoading: false,
checked: { id: 274, name: '3.98优惠券', type: 1 },
checked: {},
searchCondition: {
name: '',
type: ''
......@@ -147,29 +163,17 @@ export default {
giftTable: {
highlightCurrentRow: true,
rowClick: (row, event, column) => {
this.checked = row
const { id, name, type } = row
this.checked = {
giftId: id,
giftName: name,
giftType: type
}
},
selectionChange: this.handleGiftTableSelectionChange,
height: 330,
border: true,
data: [
{
name: '嘀嘀虎1',
id: '001'
},
{
name: '嘀嘀虎2',
id: '002'
},
{
name: '嘀嘀虎3',
id: '003'
},
{
name: '嘀嘀虎4',
id: '004'
}
],
data: [],
column: [
{
label: '优惠券编号',
......@@ -312,6 +316,7 @@ export default {
margin: 4px;
.el-tag--success {
width: 100%;
text-align: center;
}
}
.current-row {
......
......@@ -64,7 +64,7 @@
import Edit from './Edit'
import { Manufacturers } from '../components'
// import { fn, treeCheckKeys, deleteEmptyAttribute } from '@/common/common'
import { voiceList, manufacturers } from '@/api'
import { voiceList, manufacturers, mergeActivity } from '@/api'
import { NoticeMixin } from '@/mixins'
import Vue from 'vue'
export default {
......@@ -174,11 +174,11 @@ export default {
label: '上架',
type: 'text',
formatter: row =>
row.status === { ON: '上架', OF: '下架' }[row.status],
callback: (index, row) =>
row.status === { ON: '上架', OF: '下架' }[rows.status],
callback: (index, rows) =>
this.$confirm(
`确定${
{ ON: '上架', OF: '下架' }[row[index].status]
{ ON: '上架', OF: '下架' }[rows[index].status]
}该活动?`,
'',
{
......@@ -187,6 +187,10 @@ export default {
)
.then(() => {
this.tableLoading = true
this.updateActivity({
id: rows[index].id,
status: { ON: 'OF', OF: 'ON' }[rows.status]
})
})
.catch(err => console.log(err))
},
......@@ -204,7 +208,10 @@ export default {
})
.then(() => {
this.tableLoading = true
this.deleteChannel(rows[index].id)
this.updateActivity({
id: rows[index].id,
deletedFlag: 'true'
})
})
.catch(err => this.error(err))
}
......@@ -230,13 +237,17 @@ export default {
return new Promise(resolve => {
var __p = { condition: {} }
this.eventBus.$emit('submit', data => {
if (data.manufacturers) {
__p.condition.manufacturerId = data.manufacturers.manufacturerId
}
if (this.searchCondition.activityTitle) {
__p.condition.activityTitle = this.searchCondition.activityTitle
try {
if (data && data.manufacturers) {
__p.condition.manufacturerId = data.manufacturers.manufacturerId
}
if (this.searchCondition.activityTitle) {
__p.condition.activityTitle = this.searchCondition.activityTitle
}
resolve(__p)
} catch (error) {
console.log(error)
}
resolve(__p)
})
})
},
......@@ -253,29 +264,14 @@ export default {
this.error(err)
})
},
updateChannel(params) {
// updateChannel
// .req(params)
// .then(res => {
// notice.okTips()
// this.loadingGetList()
// this.updateVisibleChange()
// })
// .catch(err => {
// this.updateLoading = false
// notice.errorTips(err)
// })
},
deleteChannel(params) {
// deleteChannel
// .req({ id: params })
// .then(res => {
// notice.okTips(res)
// this.loadingGetList()
// })
// .catch(err => {
// notice.errorTips(err)
// })
updateActivity(param) {
mergeActivity
.req(param)
.then(res => {
console.log(res)
this.loadingGetList()
})
.catch(err => console.log(err))
},
getManufacturer() {
manufacturers
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!