Commit e9632873 by qinjianhui

feat: erp管理修改

parent d925feaf
...@@ -303,15 +303,23 @@ ...@@ -303,15 +303,23 @@
label="套餐" label="套餐"
prop="packages" prop="packages"
:rules="[ :rules="[
{ required: true, message: '请输入套餐' }, { required: true, message: '请选择套餐' },
]" ]"
> >
<el-input <el-select
style="width: 200px" style="width: 200px"
v-model="editForm.packages" v-model="editForm.packages"
size="small" 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>
<el-form-item <el-form-item
label="负责人" label="负责人"
...@@ -354,6 +362,7 @@ ...@@ -354,6 +362,7 @@
]" ]"
> >
<el-input <el-input
disabled
style="width: 200px" style="width: 200px"
v-model="editForm.charges" v-model="editForm.charges"
size="small" size="small"
...@@ -400,6 +409,60 @@ export default { ...@@ -400,6 +409,60 @@ export default {
name: 'saasManage', name: 'saasManage',
data() { data() {
return { 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: [], period: [],
manageData: [], manageData: [],
searchForm: {}, searchForm: {},
...@@ -425,6 +488,15 @@ export default { ...@@ -425,6 +488,15 @@ export default {
this.getList() this.getList()
}, },
methods: { 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) { onChange(e) {
this.$set(this.editForm, 'apiName', e) this.$set(this.editForm, 'apiName', e)
this.$set(this.editForm, 'databaseName', e) this.$set(this.editForm, 'databaseName', e)
...@@ -500,26 +572,31 @@ export default { ...@@ -500,26 +572,31 @@ export default {
this.editForm.databaseName = this.editForm.databaseName =
'saas_' + this.editForm.databaseName 'saas_' + this.editForm.databaseName
} }
this.editForm.domain = const domain = this.editForm.domain + this.baseDomain
this.editForm.domain + this.baseDomain
try { try {
if (this.editId) { if (this.editId) {
const res = await updateManageData(this.editForm) const res = await updateManageData({
...this.editForm,
domain: domain,
})
if (res.code === 200) { if (res.code === 200) {
this.$message.success(res.message) this.$message.success(res.message)
this.getList() this.getList()
} }
} else { } else {
const res = await addManageData(this.editForm) const res = await addManageData({
...this.editForm,
domain: domain,
})
if (res.code === 200) { if (res.code === 200) {
this.$message.success(res.message) this.$message.success(res.message)
this.getList() this.getList()
} }
} }
this.addVisible = false
} catch (e) { } catch (e) {
this.$message.warning(e) this.$message.warning(e)
} finally { } finally {
this.addVisible = false
l.close() l.close()
} }
}, },
...@@ -529,7 +606,7 @@ export default { ...@@ -529,7 +606,7 @@ export default {
return return
} }
let ids = [] let ids = []
ids = this.selection.map(item => item.id) ids = this.selection.map((item) => item.id)
ids = ids.join() ids = ids.join()
const l = this.$loading({ const l = this.$loading({
background: 'rgba(0, 0, 0, 0.3)', 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