Commit 48eb0bc8 by liimin

a

1 parent 4a9d971c
......@@ -5,12 +5,14 @@ import {
import {
voiceList,
manufacturers
manufacturers,
merchants
} from './voice'
export {
voiceList,
manufacturers,
merchants,
getBrandList,
grayscaleuser
}
......@@ -3,14 +3,16 @@ import {
} from 'glsx-vue-common'
const path = '/admin-ddh-aimanager/voice/activity'
const __sVoiceList = `${path}/get`
const __sGetManufacturer = `/manufacturers`
const __sGetManufacturer = `/admin-ddh-aimanager/manufacturer/search`
const __sGetMerchant = `/admin-ddh-aimanager/merchant/search`
/**
* 获取语音活动列表
*/
const voiceList = {
p: [__sVoiceList],
req: params => GlAxios.post(__sVoiceList, { params })
req: params => GlAxios.post(__sVoiceList, {
params
})
}
/**
* 获取品牌厂商
......@@ -20,7 +22,16 @@ const manufacturers = {
req: params => GlAxios.get(__sGetManufacturer, params)
}
/**
* 获取渠道商户
*/
const merchants = {
p: [__sGetMerchant],
req: params => GlAxios.get(__sGetMerchant, params)
}
export {
voiceList,
manufacturers
manufacturers,
merchants
}
<template>
<gl-row>
<gl-col :span="(manufactureOnly||!in_row)?24:8">
<gl-row class="manufacturer">
<gl-col :span="(manufactureOnly||!in_row)?24:12">
<gl-form-item label='品牌厂商:'>
<gl-select
v-model="model.value"
v-model="model.manufacturerId"
placeholder="请选择品牌厂商"
name="value"
name="manufacturerId"
data-vv-as="品牌厂商"
v-validate="'required'"
:style="{'width':(in_row?width:'100%')}"
>
<gl-option
v-for="item in list"
:key="item.value"
:label="item.label"
:value="item.value"
v-for="item in manufacturer_list"
:key="item.manufacturer"
:label="item.manufacturerName"
:value="item.manufacturer"
/>
</gl-select>
<span
v-show="errorBags && errorBags.has('value')"
v-show="errorBags && errorBags.has('manufacturerId')"
class="error"
>
{{errorBags && errorBags.first('value') }}
{{errorBags && errorBags.first('manufacturerId') }}
</span>
</gl-form-item>
</gl-col>
<gl-col
:span="in_row?8:24 "
:span="in_row?12:24 "
v-show="!manufactureOnly"
>
<gl-form-item label='渠道商:'>
<gl-select
v-model="model.user"
v-model="model.merchantId"
placeholder="请选择渠道商"
style="width:100%"
name="user"
data-vv-as="用户"
name="merchantId"
data-vv-as="渠道商"
v-validate="'required'"
>
<gl-option
v-for="item in users"
:key="item.value"
:label="item.label"
:value="item.value"
v-for="item in merchant_list"
:key="item.merchantId"
:label="item.merchantName"
:value="item.merchantId"
/>
</gl-select>
<span
v-show="errorBags && errorBags.has('user')"
v-show="errorBags && errorBags.has('merchantId')"
class="error"
>
{{ errorBags && errorBags.first('user') }}
{{ errorBags && errorBags.first('merchantId') }}
</span>
</gl-form-item>
</gl-col>
<gl-col
:span="in_row?8:24"
:span="24"
v-show="!manufactureOnly"
>
<gl-form-item label='选择用户:'>
......@@ -67,7 +67,7 @@
v-validate="'required'"
>
<gl-option
v-for="item in users"
v-for="item in grayscaleUserList"
:key="item.value"
:label="item.label"
:value="item.value"
......@@ -81,18 +81,51 @@
</span>
</gl-form-item>
</gl-col>
<gl-col
:span="24"
v-if="!manufactureOnly && model.user===0"
>
<gl-form-item label='灰度用户:'>
<gl-upload
class="upload-demo"
:action="action"
multiple
>
<gl-button
size="small"
type="primary"
plain
>添加动效音频<i class="el-icon-upload el-icon--right"></i></gl-button>
<div
slot="tip"
class="el-upload__tip"
>支持格式: .Excel表格,批量上传设备号</div>
</gl-upload>
<span
v-show="errorBags && errorBags.has('user')"
class="error"
>
{{ errorBags && errorBags.first('user') }}
</span>
</gl-form-item>
</gl-col>
</gl-row>
</template>
<script>
import { manufacturers } from '@/api'
import { manufacturers, merchants } from '@/api'
import { NoticeMixin } from '@/mixins'
let manufacturer_list_back_up = []
let merchant_list_back_up = []
export default {
name: 'Manufacturers',
mixins: [NoticeMixin],
props: {
eventBus: Object,
width: String,
manufactureOnly: Boolean,
in_row: Boolean
in_row: Boolean,
uploadAction: String
// errorBags: Object
},
watch: {
......@@ -108,37 +141,67 @@ export default {
},
immediate: true
//this.eventBus.$emit('manufacturerChanged', val)
},
uploadAction: {
handler(__sAction) {
__sAction && (this.action = __sAction)
},
immediate: true
}
},
data() {
return {
list: [],
value: '',
users: [
{ label: '已关联嘀嘀虎帐号用户', value: 0 },
{ label: '未关联嘀嘀虎帐号用户', value: 1 },
{ label: '广东用户', value: 2 },
{ label: '深圳用户', value: 3 },
{ label: '广西用户', value: 4 }
action: '',
manufacturer_list: [],
merchant_list: [],
grayscaleUserList: [
{ label: '灰度用户', value: 0 },
{ label: '全部用户', value: 1 }
],
model: {
user: ''
user: '',
merchantId: '',
manufacturerId: ''
}
}
},
methods: {
getList() {
get_manufacturer_list() {
if (manufacturer_list_back_up.length) {
this.manufacturer_list = manufacturer_list_back_up
return
}
manufacturers
.req({})
.then(res => (this.list = res.list))
.then(res => (manufacturer_list_back_up = this.manufacturer_list = res))
.catch(err => this.error(err))
},
get_merchant_list() {
if (merchant_list_back_up.length) {
this.merchant_list = merchant_list_back_up
return
}
merchants
.req({ merchantType: 401, merchantStatus: 0 })
.then(res => (merchant_list_back_up = this.merchant_list = res))
.catch(err => this.error(err))
}
},
mounted() {
this.getList()
this.get_manufacturer_list()
this.get_merchant_list()
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
<style rel="stylesheet/scss" lang="scss">
.manufacturer {
.upload-demo {
padding: 0 !important;
margin-top: 0 !important;
width: 100% !important;
height: 60px !important;
}
}
</style>
......@@ -38,8 +38,9 @@
name="manufacturer"
v-validate="'required'"
v-model="editForm.manufacturer"
:in_row='false'
:in_row='true'
:value.sync="editForm.manufacturer"
:uploadAction="uploadAction"
/>
<!-- </gl-form-item> -->
</gl-col>
......@@ -426,18 +427,6 @@ export default {
.is-plain {
padding: 4px 20px;
}
.el-upload__tip {
margin-top: -24px;
margin-left: 140px;
line-height: 8px;
}
.upload-demo {
// border: 1px solid #ccc;
padding: 4px;
margin-top: 8px;
width: 92%;
height: 70px;
}
// .el-upload-list--text {
// margin-top: -30px;
// font-size: 12px;
......@@ -449,5 +438,17 @@ export default {
.el-date-editor--datetimerange {
width: 312px !important;
}
.el-upload__tip {
margin-top: -24px;
margin-left: 140px;
line-height: 8px;
}
.upload-demo {
// border: 1px solid #ccc;
padding: 4px;
margin-top: 8px;
width: 92%;
height: 70px;
}
}
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!