fix: 裸金属修改
parent
1ffdcfde72
commit
f372053b9d
|
@ -2,6 +2,23 @@
|
|||
<div class="wrapper-container">
|
||||
<el-card>
|
||||
<cb-form ref="addData" :model="addData" status-icon label-width="110px">
|
||||
<el-col :span="24">
|
||||
<el-col :span="12">
|
||||
<cb-form-item label="计费方式: " prop="cycleType" :rules="[required]">
|
||||
<el-radio-group v-model="addData.cycleType">
|
||||
<el-radio-button label="ondemand">后付费(按量付费)</el-radio-button>
|
||||
<el-radio-button label="MONTH">预付费(包年包月)</el-radio-button>
|
||||
</el-radio-group>
|
||||
</cb-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="addData.cycleType == 'MONTH'">
|
||||
<cb-form-item label="购买时长:" prop="cycleCount" :rules="[required]">
|
||||
<el-select v-model="addData.cycleCount" filterable>
|
||||
<el-option v-for="(item, index) in periodList" :key="index" :value="item.value" :label="item.name"></el-option>
|
||||
</el-select>
|
||||
</cb-form-item>
|
||||
</el-col>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<cb-form-item label="可用地域:" prop="regionId" :rules="[required]">
|
||||
<el-select v-model="addData.regionId" @change="regionChange">
|
||||
|
@ -119,7 +136,7 @@
|
|||
</cb-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<cb-form-item label=" 描述:" prop="remark" :rules="[required]">
|
||||
<cb-form-item label=" 描述:" prop="remark">
|
||||
<el-input v-model="addData.remark"></el-input>
|
||||
</cb-form-item>
|
||||
</el-col>
|
||||
|
@ -189,6 +206,20 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
periodList: [
|
||||
{ name: '1个月', value: 1 },
|
||||
{ name: '2个月', value: 2 },
|
||||
{ name: '3个月', value: 3 },
|
||||
{ name: '4个月', value: 4 },
|
||||
{ name: '5个月', value: 5 },
|
||||
{ name: '6个月', value: 6 },
|
||||
{ name: '7个月', value: 7 },
|
||||
{ name: '8个月', value: 8 },
|
||||
{ name: '9个月', value: 9 },
|
||||
{ name: '12个月', value: 12 },
|
||||
{ name: '24个月', value: 24 },
|
||||
{ name: '36个月', value: 36 }
|
||||
],
|
||||
vendorId: parseInt(this.$router.currentRoute.query.vendorId),
|
||||
required: validate.required,
|
||||
ctstackBMSName: validate.ctstackBMSName,
|
||||
|
@ -210,7 +241,7 @@ export default {
|
|||
vpcName: '', // 云管vpc接口的name
|
||||
master: true, // 默认为true
|
||||
subnetUuid: '', // 子网接口的subnetUuid
|
||||
cycleCount: 0, // 订购时长,按需订购传0
|
||||
cycleCount: 1, // 订购时长,按需订购传0
|
||||
cycleType: 'ondemand', // 订购周期类型 ,取值范围:[MONTH=按月,YEAR=按年,ondemand=按需订购]
|
||||
orderCount: 1 // 订购数量
|
||||
},
|
||||
|
@ -406,22 +437,31 @@ export default {
|
|||
})
|
||||
},
|
||||
getPostData() {
|
||||
let addData = ''
|
||||
let result = ''
|
||||
this.$refs.addData.validate(valid => {
|
||||
if (valid) {
|
||||
this.addData.hostname = this.addData.name
|
||||
this.addData.vendorId = this.vendorId
|
||||
if (this.addData.password != this.addData.endPassword && this.keypair == '密码') {
|
||||
this.$notify({
|
||||
title: '提示',
|
||||
message: '两次密码输入不一致'
|
||||
})
|
||||
this.$message.error('两次密码输入不一致')
|
||||
result = false
|
||||
return
|
||||
}
|
||||
addData = JSON.parse(JSON.stringify(this.addData))
|
||||
if (this.systemVolumeLabel && !this.addData.systemVolumeRaidUuid) {
|
||||
this.$message.error('请选择系统盘raid')
|
||||
result = false
|
||||
return
|
||||
}
|
||||
if (this.dataVolumeLabel && !this.addData.dataVolumeRaidUuid) {
|
||||
this.$message.error('请选择数据盘raid')
|
||||
result = false
|
||||
return
|
||||
}
|
||||
if (this.addData.cycleType === 'ondemand') this.addData.cycleCount = 0
|
||||
result = JSON.parse(JSON.stringify(this.addData))
|
||||
}
|
||||
})
|
||||
return addData
|
||||
return result
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</cb-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<cb-form-item label="备注:" prop="remark" :rules="[required]" required-message="请输入备注">
|
||||
<cb-form-item label="备注:" prop="remark" required-message="请输入备注">
|
||||
<el-input v-model="addData.data.remark"></el-input>
|
||||
</cb-form-item>
|
||||
</el-col>
|
||||
|
|
Loading…
Reference in New Issue