Commit e9632873 by qinjianhui

feat: erp管理修改

parent d925feaf
......@@ -303,15 +303,23 @@
label="套餐"
prop="packages"
:rules="[
{ required: true, message: '请输入套餐' },
{ required: true, message: '请选择套餐' },
]"
>
<el-input
<el-select
style="width: 200px"
v-model="editForm.packages"
size="small"
placeholder="请输入套餐"
/>
@change="changeCharges"
placeholder="请选择套餐"
>
<el-option
v-for="item in paymentPackages"
:key="item.id"
:value="item.key"
:label="item.name"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label="负责人"
......@@ -354,6 +362,7 @@
]"
>
<el-input
disabled
style="width: 200px"
v-model="editForm.charges"
size="small"
......@@ -400,6 +409,60 @@ export default {
name: 'saasManage',
data() {
return {
paymentPackages: [
{
id: 0,
cny: 'CNY',
price: 10,
name: '内测版',
key: 'beta',
o: 0.2,
oName: '0',
orders: 50,
},
{
id: 1,
cny: 'CNY',
price: 10000,
name: '基础版',
key: 'PAYBASE',
o: 0.2,
oName: '0.2元/单',
orders: 50000,
},
{
id: 2,
cny: 'CNY',
price: 30000,
name: '进阶版',
key: 'PAYADVANCED',
o: 0.16,
oName: '0.16元/单',
orders: 187500,
},
{
id: 3,
cny: 'CNY',
price: 9800,
p: 9800,
name: '尊享版',
key: 'PAYXVCVT',
month: 1,
oName: '9800元/月',
m: '按月收费',
},
{
id: 4,
cny: 'CNY',
price: 29800,
p: 29800,
name: '至尊版',
key: 'PAYULTIMATE',
month: 1,
oName: '29800元/月',
m: '按月收费',
},
],
period: [],
manageData: [],
searchForm: {},
......@@ -425,6 +488,15 @@ export default {
this.getList()
},
methods: {
changeCharges(v) {
if (!v) return
const charges = this.paymentPackages.find(
(item) => item.key === v,
)
if (charges) {
this.$set(this.editForm, 'charges', charges.oName)
}
},
onChange(e) {
this.$set(this.editForm, 'apiName', e)
this.$set(this.editForm, 'databaseName', e)
......@@ -500,26 +572,31 @@ export default {
this.editForm.databaseName =
'saas_' + this.editForm.databaseName
}
this.editForm.domain =
this.editForm.domain + this.baseDomain
const domain = this.editForm.domain + this.baseDomain
try {
if (this.editId) {
const res = await updateManageData(this.editForm)
const res = await updateManageData({
...this.editForm,
domain: domain,
})
if (res.code === 200) {
this.$message.success(res.message)
this.getList()
}
} else {
const res = await addManageData(this.editForm)
const res = await addManageData({
...this.editForm,
domain: domain,
})
if (res.code === 200) {
this.$message.success(res.message)
this.getList()
}
}
this.addVisible = false
} catch (e) {
this.$message.warning(e)
} finally {
this.addVisible = false
l.close()
}
},
......@@ -529,7 +606,7 @@ export default {
return
}
let ids = []
ids = this.selection.map(item => item.id)
ids = this.selection.map((item) => item.id)
ids = ids.join()
const l = this.$loading({
background: 'rgba(0, 0, 0, 0.3)',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment