Commit e7c3097c by Administrator

Merge branch 'dev' into 'master'

Dev

See merge request !57
parents 424df567 41772c96
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
"dom", "dom",
"dom.iterable", "dom.iterable",
"scripthost" "scripthost"
] ],
"noUnusedLocals": false,
"noUnusedParameters": false
} }
} }
...@@ -3,3 +3,6 @@ import axios from '../axios' ...@@ -3,3 +3,6 @@ import axios from '../axios'
export function getUserRechargeRecordListApi(params) { export function getUserRechargeRecordListApi(params) {
return axios.post('/pay/businessPayRecord/list_page', params) return axios.post('/pay/businessPayRecord/list_page', params)
} }
export function getSubjectListApi(params) {
return axios.get('/pay/businessPayRecord/subjectList', params)
}
<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;
display: flex;
}
}
.textClass {
display: flex;
::v-deep.el-form-item {
.el-form-item__content {
width: 100%;
flex: 1;
}
}
}
</style>
...@@ -5,15 +5,13 @@ ...@@ -5,15 +5,13 @@
style="border-bottom: 1px solid #ccc" style="border-bottom: 1px solid #ccc"
:editor="editor" :editor="editor"
:defaultConfig="toolbarConfig" :defaultConfig="toolbarConfig"
:mode="mode" :mode="mode" />
/>
<Editor <Editor
style="height: 300px; overflow-y: hidden" style="height: 300px; overflow-y: hidden"
v-model="html" v-model="html"
:defaultConfig="editorConfig" :defaultConfig="editorConfig"
:mode="mode" :mode="mode"
@onCreated="onCreated" @onCreated="onCreated" />
/>
</div> </div>
</template> </template>
<script> <script>
...@@ -27,32 +25,32 @@ export default { ...@@ -27,32 +25,32 @@ export default {
data() { data() {
return { return {
editor: null, editor: null,
mode: 'default', mode: 'default'
} }
}, },
model: { model: {
prop: 'content', prop: 'content',
event: 'change', event: 'change'
}, },
props: { props: {
content: { content: {
type: String, type: String,
default: '', default: ''
}, },
placeholder: { placeholder: {
type: String, type: String,
default: '', default: ''
}, },
isInsert: { isInsert: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
insertData: { insertData: {
type: Array, type: Array,
default: () => [ default: () => [
{ {
label: '客户名称', label: '客户名称',
value: '{payerName} {payerSurname}', value: '{payerName} {payerSurname}'
}, },
{ label: '订单编号', value: '{id}' }, { label: '订单编号', value: '{id}' },
{ label: '店铺单号', value: '{shopNumber}' }, { label: '店铺单号', value: '{shopNumber}' },
...@@ -61,9 +59,9 @@ export default { ...@@ -61,9 +59,9 @@ export default {
{ label: '发货时间', value: '{shipmentTime}' }, { label: '发货时间', value: '{shipmentTime}' },
{ label: '妥投时间', value: '{properTime}' }, { label: '妥投时间', value: '{properTime}' },
{ label: '商品', value: '{products}' }, { label: '商品', value: '{products}' },
{ label: '收货地址', value: '{address}' }, { label: '收货地址', value: '{address}' }
], ]
}, }
}, },
computed: { computed: {
...@@ -73,12 +71,12 @@ export default { ...@@ -73,12 +71,12 @@ export default {
}, },
set(value) { set(value) {
this.$emit('change', value) this.$emit('change', value)
}, }
}, },
toolbarConfig() { toolbarConfig() {
return { return {
excludeKeys: ['group-video'], excludeKeys: ['group-video'],
insertKeys: insertKeys(this.isInsert), insertKeys: insertKeys(this.isInsert)
} }
}, },
editorConfig() { editorConfig() {
...@@ -87,34 +85,28 @@ export default { ...@@ -87,34 +85,28 @@ export default {
placeholder: this.placeholder || '请输入内容...', placeholder: this.placeholder || '请输入内容...',
MENU_CONF: { MENU_CONF: {
uploadImage: { uploadImage: {
allowedFileTypes: [ allowedFileTypes: ['jpg', 'jpeg', 'png', 'gif', 'bmp'],
'jpg',
'jpeg',
'png',
'gif',
'bmp',
],
async customUpload(files, insertFn) { async customUpload(files, insertFn) {
// JS 语法 // JS 语法
// res 即服务端的返回结果 // res 即服务端的返回结果
const res = await uploadImg(files, { const res = await uploadImg(files, {
url: 'upload/oss', url: 'upload/oss',
businessType: 'other', businessType: 'other'
}) })
console.log(res) console.log(res)
const { filePath } = res const { filePath } = res
const url = _this.setimgUrl(filePath, { const url = _this.setimgUrl(filePath, {
w: 640, w: 640
}) })
// 从 res 中找到 url alt href ,然后插入图片 // 从 res 中找到 url alt href ,然后插入图片
insertFn(url) insertFn(url)
}, }
}, },
insertSelect: { options: this.insertData }, insertSelect: { options: this.insertData }
}, }
} }
}, }
}, },
watch: {}, watch: {},
methods: { methods: {
...@@ -122,7 +114,7 @@ export default { ...@@ -122,7 +114,7 @@ export default {
this.editor = Object.seal(editor) // 一定要用 Object.seal() ,否则会报错 this.editor = Object.seal(editor) // 一定要用 Object.seal() ,否则会报错
console.log(editor.getConfig()) console.log(editor.getConfig())
this.editor.getAllMenuKeys() this.editor.getAllMenuKeys()
}, }
}, },
mounted() { mounted() {
// 模拟 ajax 请求,异步渲染编辑器 // 模拟 ajax 请求,异步渲染编辑器
...@@ -131,7 +123,7 @@ export default { ...@@ -131,7 +123,7 @@ export default {
const editor = this.editor const editor = this.editor
if (editor == null) return if (editor == null) return
editor.destroy() // 组件销毁时,及时销毁编辑器 editor.destroy() // 组件销毁时,及时销毁编辑器
}, }
} }
</script> </script>
<style scoped> <style scoped>
......
...@@ -73,6 +73,12 @@ const routes = [ ...@@ -73,6 +73,12 @@ const routes = [
meta: { title: '公告管理' } meta: { title: '公告管理' }
}, },
{ {
path: '/saas/services',
component: () => import('@/views/system/services.vue'),
name: 'system_services',
meta: { title: '服务管理' }
},
{
path: '/saas/countryCode', path: '/saas/countryCode',
component: () => import('@/views/system/countryCode.vue'), component: () => import('@/views/system/countryCode.vue'),
name: 'system_countryCode', name: 'system_countryCode',
...@@ -149,7 +155,8 @@ const routes = [ ...@@ -149,7 +155,8 @@ const routes = [
component: () => import('@/views/production/AssistantManage.vue'), component: () => import('@/views/production/AssistantManage.vue'),
name: 'production_assistant_manage', name: 'production_assistant_manage',
meta: { title: '应用版本管理' } meta: { title: '应用版本管理' }
}, { },
{
path: '/saas/import-template', path: '/saas/import-template',
component: () => import('@/views/import-template/index.vue'), component: () => import('@/views/import-template/index.vue'),
name: 'import-template', name: 'import-template',
......
...@@ -107,10 +107,20 @@ ...@@ -107,10 +107,20 @@
<div class="sql-left"> <div class="sql-left">
<el-form :model="editForm"> <el-form :model="editForm">
<el-form-item required label="数据源"> <el-form-item required label="数据源">
<el-select @change="selectChange" style="width: 92%;" v-model="editForm.database" multiple clearable filterable> <el-select
@change="selectChange"
style="width: 92%"
v-model="editForm.database"
multiple
clearable
filterable>
<el-option label="all" value="all"></el-option> <el-option label="all" value="all"></el-option>
<el-option :disabled="editForm.database.includes('all')" v-for="it in dataBase" :key="it" :label="`${it.databaseName}(${it.dataHost})`" <el-option
:value="it.id"></el-option> :disabled="editForm.database.includes('all')"
v-for="it in dataBase"
:key="it"
:label="`${it.databaseName}(${it.dataHost})`"
:value="it.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item required> <el-form-item required>
...@@ -127,20 +137,28 @@ ...@@ -127,20 +137,28 @@
type="password" type="password"
placeholder="请输入管理密码" placeholder="请输入管理密码"
v-model="editForm.password"></el-input> v-model="editForm.password"></el-input>
<el-button :loading="loading" style="margin-left: 20px" type="primary" @click="submitOm">执行 <el-button
:loading="loading"
style="margin-left: 20px"
type="primary"
@click="submitOm">
执行
</el-button> </el-button>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div class="sql-right"> <div class="sql-right">
<ul v-if="msg_list.length>0"> <ul v-if="msg_list.length > 0">
<li v-for="(item,i) in msg_list" :key="i"> <li v-for="(item, i) in msg_list" :key="i">
<div class="flex"> <div class="flex">
<span>执行结果:</span> <span>执行结果:</span>
<el-tag size="mini" v-if="item.status==='SUCCESS'" type="success">执行成功</el-tag> <el-tag
size="mini"
v-if="item.status === 'SUCCESS'"
type="success">
执行成功
</el-tag>
<el-tag size="mini" v-else type="danger">执行失败</el-tag> <el-tag size="mini" v-else type="danger">执行失败</el-tag>
</div> </div>
<div class="flex"> <div class="flex">
...@@ -249,6 +267,14 @@ export default { ...@@ -249,6 +267,14 @@ export default {
icon: 'el-icon-s-promotion', icon: 'el-icon-s-promotion',
index: '/saas/announceManage', index: '/saas/announceManage',
children: [] children: []
},
{
id: 5,
path: '',
label: '服务管理',
icon: 'el-icon-s-order',
index: '/saas/services',
children: []
} }
] ]
}, },
...@@ -430,7 +456,6 @@ export default { ...@@ -430,7 +456,6 @@ export default {
...mapState(['userInfo']) ...mapState(['userInfo'])
}, },
watch: { watch: {
currentTag(v) { currentTag(v) {
if (!v) return if (!v) return
const parent = this.menuList.find((e) => { const parent = this.menuList.find((e) => {
...@@ -449,7 +474,10 @@ export default { ...@@ -449,7 +474,10 @@ export default {
selectChange(v) { selectChange(v) {
if (v.includes('all')) { if (v.includes('all')) {
this.editForm.database = ['all'] this.editForm.database = ['all']
} else if (this.dataBase.length > 0 && this.dataBase.length === v.length) { } else if (
this.dataBase.length > 0 &&
this.dataBase.length === v.length
) {
this.editForm.database = ['all'] this.editForm.database = ['all']
} }
console.log(v) console.log(v)
...@@ -508,7 +536,7 @@ export default { ...@@ -508,7 +536,7 @@ export default {
this.editForm.content = '' this.editForm.content = ''
this.editForm.password = '' this.editForm.password = ''
this.editForm.database = ['all'] this.editForm.database = ['all']
get('platform/tools/datasource-list').then(res => { get('platform/tools/datasource-list').then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.dataBase = res.data this.dataBase = res.data
} }
...@@ -607,7 +635,6 @@ export default { ...@@ -607,7 +635,6 @@ export default {
margin-right: 10px; margin-right: 10px;
font-size: 18px; font-size: 18px;
} }
</style> </style>
<style lang="scss"> <style lang="scss">
.sql-dialog { .sql-dialog {
...@@ -672,5 +699,4 @@ export default { ...@@ -672,5 +699,4 @@ export default {
} }
} }
} }
</style> </style>
<template>
<div class="wraper">
<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"
@selectionChange="selectionChange"></table-vue>
</div>
<div class="pagination">
<el-pagination
layout="sizes, total, prev, pager, next, jumper"
background
:total="paginationOptions.total"
:page-size="paginationOptions.pageSize"
:current-page="paginationOptions.currentPage"
@size-change="sizeChange"
@current-change="onCurrentChange"></el-pagination>
</div>
<!-- 弹出层 -->
<el-dialog
:close-on-click-modal="false"
:title="is_title == 1 ? '新增' : '编辑'"
:visible.sync="dialogVisible"
@closed="closedFn"
width="590px">
<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"
size="mini"
style="width: 100px">
取消
</el-button>
<el-button
type="primary"
@click="addServiceManagement"
size="mini"
style="width: 100px">
确认
</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import axios from '../../common/api/axios'
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,
CustomForm
},
data() {
return {
is_title: 1,
ishowForm: false,
select: '',
sourceData: [],
serviceNameList: [],
formData: {},
queryFormData: {},
queryformConfig: [
{
prop: 'name',
type: 'select',
name: '名称',
options: []
},
{
prop: 'enable',
type: 'select',
name: '状态',
options: [
{ label: '启用', value: true },
{ label: '停用', value: false }
]
}
],
editformConfig: [
{
prop: 'name',
type: 'select',
name: '名称',
options: [],
renderRules: (item) => [
{
required: true,
message: '请选择名称',
trigger: 'change'
}
]
},
{
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 !== '免费',
validator: (rule, value, callback) => {
if (item.tollCollectionManner !== '免费') {
if (value === '' || value === null || value === undefined) {
return callback(new Error('请输入收费标准'))
}
}
const numValue = Number(value)
if (isNaN(numValue)) {
return callback(new Error('请输入有效数字'))
}
if (numValue < 0) {
return callback(new Error('数值必须大于等于0'))
}
// 校验通过
callback()
},
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,
formId: null,
paginationOptions: {
pageSize: 100,
currentPage: 1,
total: 0
},
details: [],
loading: false
}
},
created() {
this.getServiceNameList()
this.getList()
},
computed: {
...mapState(['reqMenu', 'employee']),
usersTableColumns() {
return [
{
label: '服务名称',
key: 'name',
width: '',
render: (item) => <span>{this.serviceNameList.get(item.name)}</span>
},
{
label: '服务类型',
key: 'type',
width: '',
render: (item) => (
<span>{item.type === 'basics' ? '基础' : '增值'}</span>
)
},
{
label: '收费方式',
key: 'tollCollectionManner',
width: '',
render: (item) => (
<span>
{item.tollCollectionManner === 'order'
? '按单'
: item.tollCollectionManner === 'monthly'
? '按月'
: '免费'}
</span>
)
},
{
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',
width: '130',
render: (item) => (
<div>
<span title="编辑" class="icon-view ">
<i
class="el-icon-edit-outline"
style="color:#E6A23C"
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, e)}></i>
</span>
</div>
)
}
]
},
funcRoleList() {
if (this.roleList.length > 0) {
return this.roleList.filter((item) => item.type === 'FUNCTION_ROLE')
}
return []
},
dataRoleList() {
if (this.roleList.length > 0) {
return this.roleList.filter((item) => item.type === 'DATA_ROLE')
}
return []
}
},
watch: {
formData: {
handler(newValue) {
// console.log(368, newValue)
},
immediate: true,
deep: true
}
},
methods: {
sizeChange(value) {
this.paginationOptions.pageSize = value
this.getList()
},
onCurrentChange(value) {
this.paginationOptions.currentPage = value
this.getList()
},
selectionChange(selection) {
if (selection.length > 0) {
this.select = selection
}
},
setempNo(id) {
for (const iterator of this.employee) {
if (iterator.id === id) {
this.addcurrencyform.empNumber = iterator.empNumber
break
}
}
},
search() {
this.getList()
},
currentTabFn(val) {
if (val.row) {
this.formId = val.row.id
}
},
// 修改新增
async addDialog(id, e) {
e && e.stopPropagation()
this.ishowForm = true
try {
if (id) {
this.is_title = 2
const url = '/serviceManagement/get'
const res = await axios.get(url, { params: { id } })
this.formData = { ...res.data }
} else {
this.is_title = 1
}
this.dialogVisible = true
} catch (error) {}
},
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 }
},
// 新增
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) {
return
}
this.dialogVisible = false
this.getList()
this.$message.success(isAdd ? '新增成功' : '更新成功')
} else {
console.log()
}
} catch (error) {
console.log(error)
}
},
// 查询
getList() {
this.loading = true
const { pageSize, currentPage } = this.paginationOptions
axios
.post('serviceManagement/list_page', {
pageSize,
currentPage,
...this.queryFormData
})
.then((res) => {
this.loading = false
if (res.code === 200) {
this.sourceData = res.data.records
this.paginationOptions.total = res.data.total
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true
})
}
})
},
// 删除
deleteSection(data, e) {
e && e.stopPropagation()
const ids = [data.id].join()
this.$confirm('确定删除选中的信息?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
axios
.get('serviceManagement/delete', {
params: {
ids
}
})
.then((res) => {
if (res.code === 200) {
this.$message({
type: 'success',
message: '删除成功!'
})
this.getList()
}
})
})
.catch(() => {})
},
async closedFn() {
this.dialogVisible = false
this.formData = { enable: true, discount: true }
await this.$refs.formRefs?.resetFields()
},
async getServiceNameList() {
try {
const { data } = await axios.get('serviceManagement/serviceNameList')
const newData = data.map((el) => {
return {
label: el.value,
value: el.key
}
})
this.serviceNameList = new Map(
newData.map((item) => [item.value, item.label])
)
console.log(509, this.serviceNameList)
this.queryformConfig[0].options = [...newData]
this.editformConfig[0].options = [...newData]
} catch (error) {
this.queryformConfig[0].options = []
this.editformConfig[0].options = []
console.log(error)
}
}
}
}
</script>
<style scoped>
.wraper {
display: flex;
flex-direction: column;
height: 100%;
}
.table_wrap {
flex: 1;
}
.circle {
display: inline-block;
height: 10px;
width: 10px;
border-radius: 5px;
margin-right: 5px;
}
.my-table >>> .first {
background-color: red !important;
color: #fff !important;
}
</style>
...@@ -9,10 +9,25 @@ ...@@ -9,10 +9,25 @@
clearable></el-input> clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="套餐版本"> <el-form-item label="套餐版本">
<el-input <el-select
v-model="searchForm.subject" v-model="searchForm.subject"
placeholder="请输入客户" placeholder="请选择套餐版本"
clearable></el-input> clearable>
<el-option
v-for="(item, index) in subjectList"
:key="index"
:label="item.value"
:value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="支付状态">
<el-select
v-model="searchForm.payStatus"
placeholder="请选择支付状态"
clearable>
<el-option label="已支付" value="已支付"></el-option>
<el-option label="待支付" value="待支付"></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="交易号"> <el-form-item label="交易号">
<el-input <el-input
...@@ -32,6 +47,17 @@ ...@@ -32,6 +47,17 @@
placeholder="请输入业务类型" placeholder="请输入业务类型"
clearable></el-input> clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="付款时间">
<el-date-picker
:default-time="['00:00:00', '23:59:59']"
v-model="searchForm.daterange"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="至"
:confirm="false"
start-placeholder="初始创建时间"
end-placeholder="结束创建时间"></el-date-picker>
</el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button
type="primary" type="primary"
...@@ -51,6 +77,7 @@ ...@@ -51,6 +77,7 @@
width="100%" width="100%"
height="100%" height="100%"
:highlight-current-row="true" :highlight-current-row="true"
@sort-change="sortChange"
header-row-class-name="header-row-class-name"> header-row-class-name="header-row-class-name">
<el-table-column <el-table-column
label="序号" label="序号"
...@@ -104,6 +131,13 @@ ...@@ -104,6 +131,13 @@
width="100" width="100"
:show-overflow-tooltip="true"></el-table-column> :show-overflow-tooltip="true"></el-table-column>
<el-table-column <el-table-column
label="支付状态"
prop="payStatus"
header-align="center"
align="center"
width="100"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column
label="业务类型" label="业务类型"
prop="businessType" prop="businessType"
header-align="center" header-align="center"
...@@ -149,6 +183,7 @@ ...@@ -149,6 +183,7 @@
<el-table-column <el-table-column
label="付款时间" label="付款时间"
sortable="custom"
prop="clientTime" prop="clientTime"
header-align="center" header-align="center"
align="center" align="center"
...@@ -183,13 +218,18 @@ ...@@ -183,13 +218,18 @@
</div> </div>
</template> </template>
<script> <script>
import { getUserRechargeRecordListApi } from '@/common/api/user/user' import {
getUserRechargeRecordListApi,
getSubjectListApi
} from '@/common/api/user/user'
export default { export default {
name: 'rechargeRecord', name: 'rechargeRecord',
data() { data() {
return { return {
period: [], period: [],
subjectList: [],
sortParmas: {},
searchForm: {}, searchForm: {},
total: 0, total: 0,
pageSize: 50, pageSize: 50,
...@@ -200,14 +240,22 @@ export default { ...@@ -200,14 +240,22 @@ export default {
}, },
async created() { async created() {
this.loadData() this.loadData()
this.getSubjectList()
}, },
methods: { methods: {
async loadData() { async loadData(obj) {
const data = { let data = {
...this.searchForm, ...this.searchForm,
currentPage: this.currentPage, currentPage: this.currentPage,
pageSize: this.pageSize pageSize: this.pageSize
} }
if (this.searchForm.daterange?.length) {
data.minTime = this.searchForm.daterange[0]
data.maxTime = this.searchForm.daterange[1]
}
if (obj) {
data = { ...data, ...obj }
}
this.loading = true this.loading = true
try { try {
const res = await getUserRechargeRecordListApi(data) const res = await getUserRechargeRecordListApi(data)
...@@ -215,22 +263,37 @@ export default { ...@@ -215,22 +263,37 @@ export default {
this.rechargeRecordList = res.data.records this.rechargeRecordList = res.data.records
this.total = res.data.total this.total = res.data.total
} catch (e) { } catch (e) {
console.error(e) console.log(e)
} finally { } finally {
this.loading = false this.loading = false
} }
}, },
search() { search() {
this.currentPage = 1 this.currentPage = 1
this.loadData() this.loadData(this.sortParmas)
}, },
onCurrentChange(currentPage) { onCurrentChange(currentPage) {
this.currentPage = currentPage this.currentPage = currentPage
this.loadData() this.loadData(this.sortParmas)
}, },
sizeChange(pageSize) { sizeChange(pageSize) {
this.pageSize = pageSize this.pageSize = pageSize
this.loadData() this.loadData(this.sortParmas)
},
sortChange({ column, prop, order }) {
this.sortParmas = {
field: prop,
asc: order === 'ascending'
}
this.loadData(this.sortParmas)
},
async getSubjectList() {
try {
const { data } = await getSubjectListApi()
this.subjectList = data
} catch (error) {
console.log(error)
}
} }
} }
} }
......
...@@ -7,11 +7,12 @@ module.exports = defineConfig({ ...@@ -7,11 +7,12 @@ module.exports = defineConfig({
proxy: { proxy: {
'/api': { '/api': {
target: 'http://10.168.31.222:8096', target: 'http://10.168.31.222:8096',
changeOrigin: true,
changeOrigin: true
// pathRewrite: { // pathRewrite: {
// '^/api': '', // '^/api': '',
// }, // },
}, }
}, }
}, }
}) })
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