Commit 3a2a3472 by linjinhong

新增服务管理页面

parent d6f417bc
......@@ -14,6 +14,8 @@
"dom",
"dom.iterable",
"scripthost"
]
],
"noUnusedLocals": false,
"noUnusedParameters": false
}
}
<script>
export default {
name: 'CustomForm',
components: {},
props: {
formConfig: {
type: Array,
default: () => []
},
isCustomButton: {
type: Boolean,
default: true
},
isFlex: {
type: Boolean,
default: true
},
formLabelWidth: {
type: String,
default: '50px'
},
formItemWidth: {
type: String,
default: null
},
value: {
type: Object,
default: () => {}
}
},
computed: {},
watch: {
value: {
handler(newValue, oldValue) {
if (Object.keys(newValue).length !== 0) {
this.formData = newValue
} else {
this.initFormData()
}
},
immediate: true,
deep: true
},
formData: {
handler(newValue) {
this.$emit('input', newValue)
},
immediate: true,
deep: true
}
},
data() {
return {
loading: false,
formData: {},
formColumns: []
}
},
methods: {
search() {
this.$emit('searchFn', this.formData)
},
addDialog(obj) {
this.$emit('addDialog')
},
handleSubmit(event) {
event.preventDefault()
},
showToggle() {
this.loading = !this.loading
},
validateForm() {
return this.$refs.form.validate()
},
initFormData() {
this.formConfig.forEach((el) => {
switch (el.type) {
case 'input':
this.$set(this.formData, el.prop, '')
break
case 'select':
case 'radio':
this.$set(this.formData, el.prop, el.defaultValue || '')
break
default:
// 如果有其他类型,可以在这里添加处理逻辑
this.$set(this.formData, el.prop, '')
}
})
},
async resetFields() {
await this.$refs.form?.resetFields()
}
},
created() {
// console.log(104, this.formData)
},
render() {
return (
<el-form
class={this.isFlex ? 'formClass' : ''}
ref="form"
props={{
model: this.formData
}}
size="mini"
inline
onSubmit={this.handleSubmit}
onKeyupenterCapture={this.search}>
{this.formConfig?.map((item, index) => (
<el-form-item
style={{
width: item.type === 'textarea' ? '100%' : this.formItemWidth
}}
class={item.type === 'textarea' ? 'textClass' : ''}
prop={item.prop}
rules={(item.renderRules && item.renderRules(this.formData)) || []}
label-width={item.labelWidth || this.formLabelWidth}
key={index}
label={item.name}>
{item.type === 'input' && (
<el-input
v-model={this.formData[item.prop]}
placeholder={item.placeholder || `请输入${item.name}`}
clearable></el-input>
)}
{item.type === 'textarea' && (
<el-input
type="textarea"
v-model={this.formData[item.prop]}
placeholder={item.placeholder || `请输入${item.name}`}
clearable></el-input>
)}
{item.type === 'select' && (
<el-select
v-model={this.formData[item.prop]}
placeholder={item.placeholder || `请选择${item.name}`}
clearable>
{item.options?.map((el, idx) => (
<el-option
label={el.label}
value={el.value}
key={idx}></el-option>
))}
</el-select>
)}
{item.type === 'datePicker' && (
<el-date-picker
value-format="yyyy-MM-dd"
type={item.dateType || 'date'}
placeholder="选择日期"
v-model={this.formData[item.prop]}
clearable
style="width: 100%;"></el-date-picker>
)}
{item.type === 'radio' &&
item.radioOptions?.map((el, idx) => (
<el-radio
v-model={this.formData[item.prop]}
label={el.value}
key={idx}>
{el.label}
</el-radio>
))}
</el-form-item>
))}
{this.isCustomButton && (
<el-form-item>
<el-button
type="primary"
onClick={this.search}
icon="el-icon-search">
查询
</el-button>
<el-button type="success" onClick={this.addDialog}>
新增
</el-button>
</el-form-item>
)}
{!this.isCustomButton && <slot name="btn"></slot>}
</el-form>
)
}
}
</script>
<style lang="less" scoped>
.formClass {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
.el-form-item {
margin-right: 0;
}
}
.textClass {
display: flex;
::v-deep.el-form-item {
.el-form-item__content {
width: 100%;
flex: 1;
}
}
}
</style>
<script>
export default {
name: 'queryForm',
components: {},
props: {
formConfig: {
type: Array,
default: () => []
},
isCustomButton: {
type: Boolean,
default: true
}
},
computed: {
formColumns() {
return [...this.formConfig]
}
},
watch: {},
data() {
return {
loading: false,
formData: {}
}
},
methods: {
search() {
console.log(25, this.formData)
// this.$emit('search', this.formData)
},
addDialog(obj) {
this.$emit('addDialog')
},
handleSubmit(event) {
event.preventDefault()
},
showToggle() {
this.loading = !this.loading
}
},
render() {
// const { btnSlot } = this.$slots
return (
<el-form
ref="form"
props={{
model: this.formData
}}
size="mini"
inline
onSubmit={this.handleSubmit}
onKeyupenterCapture={this.search}>
{this.formColumns?.map((item, index) => (
<el-form-item key={index} label={item.name}>
{item.type === 'input' && (
<el-input
v-model={this.formData[item.prop]}
placeholder={item.placeholder || '请输入'}
clearable></el-input>
)}
{item.type === 'select' && (
<el-select
v-model={this.formData[item.prop]}
placeholder={item.placeholder || '请选择'}
clearable>
{item.options?.map((el, idx) => (
<el-option label={el} value={el} key={idx}>
{el}
</el-option>
))}
</el-select>
)}
{item.type === 'datePicker' && (
<el-date-picker
value-format="yyyy-MM-dd"
type={item.dateType || 'date'}
placeholder="选择日期"
v-model={this.formData[item.prop]}
clearable
style="width: 100%;"></el-date-picker>
)}
</el-form-item>
))}
{this.isCustomButton && (
<el-form-item>
<el-button
type="primary"
onClick={this.search}
icon="el-icon-search">
查询
</el-button>
<el-button type="success" onClick={this.addDialog}>
新增
</el-button>
</el-form-item>
)}
{!this.isCustomButton}
</el-form>
)
}
}
</script>
<style scoped></style>
......@@ -5,15 +5,13 @@
style="border-bottom: 1px solid #ccc"
:editor="editor"
:defaultConfig="toolbarConfig"
:mode="mode"
/>
:mode="mode" />
<Editor
style="height: 300px; overflow-y: hidden"
v-model="html"
:defaultConfig="editorConfig"
:mode="mode"
@onCreated="onCreated"
/>
@onCreated="onCreated" />
</div>
</template>
<script>
......@@ -27,32 +25,32 @@ export default {
data() {
return {
editor: null,
mode: 'default',
mode: 'default'
}
},
model: {
prop: 'content',
event: 'change',
event: 'change'
},
props: {
content: {
type: String,
default: '',
default: ''
},
placeholder: {
type: String,
default: '',
default: ''
},
isInsert: {
type: Boolean,
default: false,
default: false
},
insertData: {
type: Array,
default: () => [
{
label: '客户名称',
value: '{payerName} {payerSurname}',
value: '{payerName} {payerSurname}'
},
{ label: '订单编号', value: '{id}' },
{ label: '店铺单号', value: '{shopNumber}' },
......@@ -61,9 +59,9 @@ export default {
{ label: '发货时间', value: '{shipmentTime}' },
{ label: '妥投时间', value: '{properTime}' },
{ label: '商品', value: '{products}' },
{ label: '收货地址', value: '{address}' },
],
},
{ label: '收货地址', value: '{address}' }
]
}
},
computed: {
......@@ -73,12 +71,12 @@ export default {
},
set(value) {
this.$emit('change', value)
},
}
},
toolbarConfig() {
return {
excludeKeys: ['group-video'],
insertKeys: insertKeys(this.isInsert),
insertKeys: insertKeys(this.isInsert)
}
},
editorConfig() {
......@@ -87,34 +85,28 @@ export default {
placeholder: this.placeholder || '请输入内容...',
MENU_CONF: {
uploadImage: {
allowedFileTypes: [
'jpg',
'jpeg',
'png',
'gif',
'bmp',
],
allowedFileTypes: ['jpg', 'jpeg', 'png', 'gif', 'bmp'],
async customUpload(files, insertFn) {
// JS 语法
// res 即服务端的返回结果
const res = await uploadImg(files, {
url: 'upload/oss',
businessType: 'other',
businessType: 'other'
})
console.log(res)
const { filePath } = res
const url = _this.setimgUrl(filePath, {
w: 640,
w: 640
})
// 从 res 中找到 url alt href ,然后插入图片
insertFn(url)
},
}
},
insertSelect: { options: this.insertData },
},
insertSelect: { options: this.insertData }
}
}
},
}
},
watch: {},
methods: {
......@@ -122,7 +114,7 @@ export default {
this.editor = Object.seal(editor) // 一定要用 Object.seal() ,否则会报错
console.log(editor.getConfig())
this.editor.getAllMenuKeys()
},
}
},
mounted() {
// 模拟 ajax 请求,异步渲染编辑器
......@@ -131,7 +123,7 @@ export default {
const editor = this.editor
if (editor == null) return
editor.destroy() // 组件销毁时,及时销毁编辑器
},
}
}
</script>
<style scoped>
......
......@@ -76,7 +76,7 @@ const routes = [
path: '/saas/services',
component: () => import('@/views/system/services.vue'),
name: 'system_services',
meta: { title: '系统服务' }
meta: { title: '服务管理' }
},
{
path: '/saas/countryCode',
......
......@@ -271,7 +271,7 @@ export default {
{
id: 5,
path: '',
label: '系统服务',
label: '服务管理',
icon: 'el-icon-s-order',
index: '/saas/services',
children: []
......
<template>
<div class="wraper">
<QueryForm :formConfig="queryformConfig" @addDialog="addDialog"></QueryForm>
<CustomForm
:formConfig="queryformConfig"
v-model="queryFormData"
@addDialog="addDialog"
@searchFn="search"
:isFlex="false"></CustomForm>
<div class="table_wrap" v-loading="loading">
<table-vue
:sourceData="sourceData"
ref="multipleTable"
:tableColumns="usersTableColumns"
@currentChange="currentTabFn"
:rowClassName="cellClass"
@selectionChange="selectionChange"></table-vue>
</div>
<div class="pagination">
<el-pagination
layout="sizes, total, prev, pager, next, jumper"
background
:total="total"
:page-size="pageSize"
:current-page="currentPage"
:total="paginationOptions.total"
:page-size="paginationOptions.pageSize"
:current-page="paginationOptions.currentPage"
@size-change="sizeChange"
@current-change="onCurrentChange"></el-pagination>
</div>
......@@ -26,40 +30,15 @@
:close-on-click-modal="false"
:title="is_title == 1 ? '新增' : '编辑'"
:visible.sync="dialogVisible"
@closed="closedFn"
width="590px">
<el-form
label-position="right"
label-width="100px"
size="mini"
:inline="true"
:model="addcurrencyform"
:rules="addrules"
ref="addcurrencyform">
<el-form-item label="登录账号" prop="account" required>
<el-input
style="width: 164px"
v-model="addcurrencyform.account"
placeholder="请输入登录账号"
maxlength="30"></el-input>
</el-form-item>
<el-form-item label="姓名" prop="" required>
<el-input
style="width: 164px"
v-model="addcurrencyform.realName"
placeholder="请输入姓名"
maxlength="30"></el-input>
</el-form-item>
<el-form-item label="是否启用" prop="enable">
<div style="width: 164px" placeholder="请选择">
<el-radio :label="true" v-model="addcurrencyform.enable">
</el-radio>
<el-radio :label="false" v-model="addcurrencyform.enable">
</el-radio>
</div>
</el-form-item>
</el-form>
<CustomForm
formItemWidth="50%"
ref="formRefs"
v-model="formData"
:formConfig="editformConfig"
:isCustomButton="false"
formLabelWidth="100px"></CustomForm>
<span slot="footer" class="dialog-footer">
<el-button
@click="dialogVisible = false"
......@@ -69,7 +48,7 @@
</el-button>
<el-button
type="primary"
@click="addUser()"
@click="addServiceManagement"
size="mini"
style="width: 100px">
确认
......@@ -80,158 +59,204 @@
</template>
<script>
import axios from '../../common/api/axios'
import QueryForm from '@/common/components/base/queryForm.vue'
import CustomForm from '@/common/components/base/CustomForm.vue'
import { mapState } from 'vuex'
import tableVue from '@/common/components/base/tableView.vue'
export default {
name: 'system_users',
components: {
tableVue,
QueryForm
CustomForm
},
data() {
const validatePass = (rule, value, callback) => {
if (this.is_title === 1 && value === '') {
callback(new Error('请输入密码'))
} else {
callback()
}
}
const confirmPass = (rule, value, callback) => {
if (this.is_title === 1 && value === '') {
callback(new Error('确认密码不能为空'))
} else if (
this.is_title === 1 &&
value !== this.addcurrencyform.password
) {
callback(new Error('2次输入的密码不一致'))
} else {
callback()
}
}
return {
is_title: 1,
ishowForm: false,
select: '',
sourceData: [],
searchForm: {
employeeName: '',
enable: true,
platform: ''
},
formData: {},
queryFormData: {},
queryformConfig: [
{ prop: 'activityName', type: 'input', name: '名称' },
{ prop: 'name', type: 'input', name: '名称' },
{
prop: 'region',
prop: 'enable',
type: 'select',
options: ['区域1', '区域2'],
name: '区域'
name: '状态',
options: [
{ label: '启用', value: true },
{ label: '停用', value: false }
]
}
],
editformConfig: [
{
prop: 'name',
type: 'input',
name: '名称',
renderRules: (item) => [
{
required: true,
message: '请输入名称',
trigger: 'blur'
}
]
},
{ prop: 'date', type: 'datePicker', name: '日期' }
{
prop: 'type',
type: 'select',
name: '服务类型',
options: [
{ label: '基础', value: 'basics' },
{ label: '增值', value: 'appreciation' }
],
renderRules: (item) => [
{
required: true,
message: '请选择服务类型',
trigger: 'change'
}
]
},
{
prop: 'tollCollectionManner',
type: 'select',
name: '收费方式',
options: [
{ label: '按单', value: 'order' },
{ label: '按月', value: 'monthly' },
{ label: '免费', value: '免费' }
],
renderRules: (item) => [
{
required: true,
message: '请选择收费方式',
trigger: 'change'
}
]
},
{
prop: 'rates',
type: 'input',
name: '收费标准',
renderRules: (item) => [
{
required: item.tollCollectionManner !== '免费',
message: '请输入收费标准',
trigger: 'blur'
}
]
},
{
prop: 'enable',
type: 'radio',
name: '服务启用状态',
defaultValue: true,
radioOptions: [
{ label: '启用', value: true },
{ label: '停用', value: false }
]
},
{
prop: 'discount',
type: 'radio',
name: '参与折扣',
defaultValue: true,
radioOptions: [
{ label: '是', value: true },
{ label: '否', value: false }
]
},
{
prop: 'remarks',
type: 'textarea',
name: '备注'
}
],
dialogVisible: false,
addcurrencyform: {
id: '',
loginName: '',
password: '',
confirmpwd: '',
remark: '',
enable: true,
employeeId: '',
roleId: '',
funcRoleIds: [],
platform: ''
},
addcurrencyform2: null,
formId: null,
addrules: {
password: [{ validator: validatePass, trigger: 'blur' }],
confirmpwd: [{ validator: confirmPass, trigger: 'blur' }],
loginName: [
{
required: true,
message: '请输入登录账号',
trigger: 'blur'
}
],
employeeName: [
{
required: true,
message: '请选择员工',
trigger: 'change'
}
],
roleId: [
{
required: true,
message: '请选择角色',
trigger: 'change'
}
]
},
roleList: [],
paginationOptions: {
pageSize: 100,
currentPage: 1,
total: 0
},
details: [],
roleOptions: [],
platforms: [],
total: 0,
pageSize: 100,
currentPage: 1,
loading: false
}
},
created() {
this.getList(1)
this.addcurrencyform2 = JSON.parse(JSON.stringify(this.addcurrencyform))
// axios.get('sysRole/role_option')
// .then((res) => {
// if (res.code === 200) {
// this.roleOptions = res.data
// }
// })
// .catch((err) => {
// console.log(err)
// })
// axios.get('sysRole/all_list').then((res) => {
// this.roleList = res.data
// })
// axios.get('platform/user/employeePlatformList')
// .then((res) => {
// this.platforms = res.data
// })
// .catch((err) => {
// console.log(err)
// })
this.getList()
},
computed: {
...mapState(['reqMenu', 'employee']),
usersTableColumns() {
return [
{
label: '登录账户',
key: 'account',
label: '服务名称',
key: 'name',
width: ''
},
{
label: '服务类型',
key: 'type',
width: '',
render: (item) => (
<span>{item.type === 'basics' ? '基础' : '增值'}</span>
)
},
{
label: '收费方式',
key: 'tollCollectionManner',
width: '',
align: 'left',
render: (item) => (
<span>
<i
class="circle"
style={{
backgroundColor: item.enable ? 'green' : 'red'
}}></i>
{item.account}
{item.tollCollectionManner === 'order'
? '按单'
: item.tollCollectionManner === 'monthly'
? '按月'
: '免费'}
</span>
)
},
{
label: '姓名',
key: 'realName',
label: '收费标准',
key: 'rates',
width: ''
},
{
label: '状态',
key: 'enable',
width: '100',
render: (item) => (
<span>{item.enable === true ? '启用' : '停用'}</span>
)
},
{
label: '创建时间',
key: 'createTime',
width: ''
},
{
label: '更新时间',
key: 'updateTime',
width: ''
},
{
label: '是否参与折扣',
key: 'discount',
width: '100',
render: (item) => <span>{item.discount === true ? '是' : '否'}</span>
},
{
label: '备注',
key: 'remarks',
width: '250'
},
{
label: '相关操作',
key: '',
fixed: 'right',
......@@ -242,19 +267,14 @@ export default {
<i
class="el-icon-edit-outline"
style="color:#E6A23C"
onClick={(e) => this.addDialog(2, item, e)}></i>
</span>
<span title="重置密码" class="icon-view ">
<i
style="color:#67C23A"
class="el-icon-refresh-left"
onClick={(e) => this.resetPwd(e, item)}></i>
onClick={(e) => this.addDialog(item.id, e)}></i>
</span>
<span title="删除" class="icon-view ">
<i
style="color:#F56C6C"
class="el-icon-delete"
onClick={(e) => this.deleteSection(item)}></i>
onClick={(e) => this.deleteSection(item, e)}></i>
</span>
</div>
)
......@@ -275,81 +295,30 @@ export default {
return []
}
},
watch: {
formData: {
handler(newValue) {
// console.log(368, newValue)
},
immediate: true,
deep: true
}
},
methods: {
onCurrentChange() {},
sizeChange() {},
spentChange(v, item) {
axios
.post('platform/user/update', {
...item,
cost: v
})
.then(() => {
this.getList()
})
sizeChange(value) {
this.paginationOptions.pageSize = value
this.getList()
},
cellClass({ row }) {
if (row.authAuditFlag === 1) {
return 'first'
} else {
return ''
}
onCurrentChange(value) {
this.paginationOptions.currentPage = value
this.getList()
},
selectionChange(selection) {
if (selection.length > 0) {
this.select = selection
}
},
authorization(item, e) {
e && e.stopPropagation()
},
authorizationDel(item, e) {
e && e.stopPropagation()
this.$confirm('确定删除选中的信息?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {})
.catch(() => {})
},
resetPwd(e, row) {
e && e.stopPropagation()
this.$confirm('确认要重置密码?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
axios.post('platform/user/resetPassword/' + row.id).then((res) => {
this.$alert('重置成功\n\r 新密码为:' + res.data.passWord)
})
})
.catch(() => {})
},
enableChange(val, row) {
axios
.post('platform/user/setEnableStatus', {
enable: val,
userId: row.id
})
.then((res) => {
this.$message.success(res.message)
this.getList()
})
},
bindChange(row) {
axios
.post('platform/user/setBindingStatus', {
bindStatus: !row.bindStatus,
userId: row.id
})
.then((res) => {
this.$message.success(res.message)
this.getList()
})
},
setempNo(id) {
for (const iterator of this.employee) {
if (iterator.id === id) {
......@@ -358,11 +327,8 @@ export default {
}
}
},
search(value) {
console.log(409, value)
/* this.currentPage = 1
this.getList(1) */
search() {
this.getList()
},
currentTabFn(val) {
if (val.row) {
......@@ -370,74 +336,90 @@ export default {
}
},
// 修改新增
async addDialog(i, v = null, e) {
async addDialog(id, e) {
e && e.stopPropagation()
if (i === 2) {
if (v) this.formId = v.id
if (!this.formId) {
return this.$message('请勾选至少一条记录')
}
axios
.get('platform/user/get', {
params: {
id: v.id
}
})
.then((res) => {
const funcRoleIds = []
const dataRoleIds = []
if (res.data.roleIds) {
const roleIds = res?.data?.roleIds.split(',') || []
for (const iterator of roleIds) {
const item = this.roleList.find((item) => item.id === iterator)
if (item) {
if (item.type === 'FUNCTION_ROLE') {
funcRoleIds.push(Number(iterator))
} else {
dataRoleIds.push(Number(iterator))
}
}
}
}
this.ishowForm = true
try {
if (id) {
this.is_title = 2
const url = '/serviceManagement/get'
const res = await axios.get(url, { params: { id } })
this.addcurrencyform = {
...res.data,
funcRoleIds,
dataRoleIds
}
this.dialogVisible = true
})
} else {
this.addcurrencyform = JSON.parse(JSON.stringify(this.addcurrencyform2))
this.formData = { ...res.data }
} else {
this.is_title = 1
}
this.dialogVisible = true
}
this.is_title = i
this.$nextTick(() => {
this.$refs.addcurrencyform && this.$refs.addcurrencyform.clearValidate()
})
} catch (error) {}
},
addUser() {
if (this.is_title === 1) {
this.addSection()
} else {
this.upSection()
}
async checkData() {
const [isValid, postData] = await Promise.all([
new Promise((resolve) => {
this.$refs.formRefs
.validateForm()
.then((res) => resolve(true))
.catch((err) => {
resolve(false)
console.log(err)
})
}),
new Promise((resolve) => {
const params = {
name: '',
id: '',
type: '',
tollCollectionManner: '',
rates: '',
enable: '',
discount: '',
remarks: ''
}
for (const key in params) {
params[key] = this.formData[key]
}
resolve(params)
})
])
console.log(isValid, postData)
return { isValid, postData }
},
setpaginationOptions(opt) {
for (const key in opt) {
this.paginationOptions[key] = opt[key]
// 新增
async addServiceManagement() {
const isAdd = this.is_title === 1
const url = isAdd ? '/serviceManagement/add' : '/serviceManagement/update'
try {
const { isValid, postData } = await this.checkData()
if (isValid) {
console.log('add', this.formData)
const finalData = isAdd ? { ...postData, id: undefined } : postData
const res = await axios.post(url, finalData)
if (res.code !== 200) {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true
})
}
this.dialogVisible = false
this.getList()
this.$message.success(isAdd ? '新增成功' : '更新成功')
} else {
console.log()
}
} catch (error) {
console.log(error)
}
this.getList()
},
// 查询
getList() {
this.loading = true
const { pageSize, currentPage } = this.paginationOptions
axios
.post('platform/user/list_page', {
.post('serviceManagement/list_page', {
pageSize,
currentPage,
...this.searchForm
...this.queryFormData
})
.then((res) => {
this.loading = false
......@@ -452,76 +434,10 @@ export default {
})
},
// 修改
upSection() {
const url = 'platform/user/update'
this.$refs.addcurrencyform.validate((valid) => {
if (valid) {
const data = JSON.parse(JSON.stringify(this.addcurrencyform))
let roleIds = this.addcurrencyform.funcRoleIds.concat(
this.addcurrencyform.dataRoleIds
)
roleIds = roleIds.join()
data.roleIds = roleIds
axios.post(url, data).then((res) => {
if (res.code === 200) {
this.dialogVisible = false
this.$message({
message: '修改成功',
type: 'success'
})
this.getList(this.currentPage)
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true
})
}
})
}
})
},
// 新增
addSection() {
const url = 'platform/user/add'
this.$refs.addcurrencyform.validate((valid) => {
if (valid) {
const data = JSON.parse(JSON.stringify(this.addcurrencyform))
let roleIds = this.addcurrencyform.funcRoleIds.concat(
this.addcurrencyform.dataRoleIds
)
roleIds = roleIds.join()
data.roleIds = roleIds
axios.post(url, data).then((res) => {
if (res.code === 200) {
this.dialogVisible = false
this.$alert(
'添加成功\n\r 用户密码为:' + res.data?.passWord || ''
)
this.getList(this.currentPage)
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true
})
}
})
}
})
},
// 删除
deleteSection(v) {
let arr = []
if (v) arr.push(v)
else arr = this.select
const leng = arr.length
if (leng === 0) {
return this.$message('请勾选至少一条记录')
}
let ids = []
ids = arr.map((v) => {
return v.id
})
ids = ids.join()
deleteSection(data, e) {
e && e.stopPropagation()
const ids = [data.id].join()
this.$confirm('确定删除选中的信息?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
......@@ -529,9 +445,9 @@ export default {
})
.then(() => {
axios
.get('platform/user/delete', {
.get('serviceManagement/delete', {
params: {
ids: ids
ids
}
})
.then((res) => {
......@@ -540,7 +456,7 @@ export default {
type: 'success',
message: '删除成功!'
})
this.getList(this.currentPage)
this.getList()
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true
......@@ -549,6 +465,12 @@ export default {
})
})
.catch(() => {})
},
async closedFn() {
this.dialogVisible = false
this.formData = { enable: true, discount: true }
await this.$refs.formRefs?.resetFields()
}
}
}
......@@ -563,6 +485,7 @@ export default {
.table_wrap {
flex: 1;
}
.circle {
display: inline-block;
height: 10px;
......@@ -570,6 +493,7 @@ export default {
border-radius: 5px;
margin-right: 5px;
}
.my-table >>> .first {
background-color: red !important;
color: #fff !important;
......
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