后台上架-计费单位

This commit is contained in:
gaoyuanwei 2022-07-15 14:04:46 +08:00
parent 2e2287f1cf
commit 3acee93e23
2 changed files with 46 additions and 8 deletions

View File

@ -36,13 +36,32 @@
<div class="add">添加更多{{ configure.name }}</div>
<div class="form" v-for="(val, index) in configure.list" :key="'key3' + val.name + index">
<span>{{ val.name }}</span>
<a-input v-model:value="val.note1" :maxlength="24" :placeholder="'请填写' + val.name + ',不超过24个字符'"
v-if="val.type == 'input'"/>
<!-- <a-input v-model:value="val.note1" ::maxlength="24" placeholder="'请填写' + val.name + ',不超过24个字符'"
v-if="val.type == 'input'"/> -->
<template v-if="val.type == 'input2'">
<a-input
v-model:value="val.note1"
:placeholder="'请填写' + val.name"
/>
<span style="width: 2.5rem; padding-left: 0.1rem">
{{
numType == '一次性买断'
? '元'
: numType == '按调用次数'
? '元/次'
: numType == '按并发路数'
? '元/路'
: numType == '按年计费'
? '元/年'
: ''
}}
</span>
</template>
<a-textarea v-model:value="val.note1" :showCount="true" :maxlength="200" :placeholder="'请填写' + val.name"
v-else-if="val.type == 'textArea'"/>
<a-input-number v-model:value="val.note1" :min="0" :max="9999" :step="0.01" string-mode
:placeholder="'请填写' + val.name" v-else-if="val.type == 'number'" />
<a-radio-group v-model:value="val.note1" :options="val.options" v-else-if="val.type == 'radio'" />
<a-radio-group v-model:value="val.note1" :options="val.options" v-else-if="val.type == 'radio'" @change="radioChange"/>
<!-- <upload :key="showKey" type="图片" btnName="上传图片" :maxCount="1" :data="val" :list="[]" tip="支持图片类型大小不超过100M"
v-else-if="val.type == 'image'"></upload> -->
<upload :key="showKey" :child='val' limit='1' accept='.jpg,.png' v-else-if="val.type == 'image'"></upload>
@ -68,7 +87,8 @@ export default {
data () {
return {
data: [],
showKey: 0
showKey: 0,
numType: '一次性买断'
}
},
methods: {
@ -85,7 +105,21 @@ export default {
if (flag) {
const obj = {}
list.forEach((item) => {
obj[item.field] = item.note1
if (item.type === 'input2') {
obj[item.field] =
item.note1 +
(this.numType === '一次性买断'
? '元'
: this.numType === '按调用次数'
? '元/次'
: this.numType === '按并发路数'
? '元/路'
: this.numType === '按年计费'
? '元/年'
: '')
} else {
obj[item.field] = item.note1
}
})
this.data.push(obj)
this.$emit('changeInfoList', {
@ -108,6 +142,10 @@ export default {
attrValue: JSON.stringify(this.data),
delFlag: 0
})
},
radioChange (e) {
console.log(e, 'wewewe')
this.numType = e.target.value
}
},
created () {

View File

@ -106,13 +106,13 @@ export default {
field: 'type',
type: 'radio',
options: ['一次性买断', '按调用次数', '按并发路数', '按年计费'],
note1: ''
note1: '一次性买断'
},
{
name: '计费标准',
field: 'price',
type: 'input',
company: '元',
type: 'input2',
// company: '',
note1: ''
},
{