Commit 5dcc3bcd by linjinhong

fix:修改问题

parent 592853c3
......@@ -17,7 +17,7 @@ export default {
},
formLabelWidth: {
type: String,
default: '50px'
default: null
},
formItemWidth: {
type: String,
......@@ -95,7 +95,7 @@ export default {
}
},
created() {
// console.log(104, this.formData)
console.log(104, this.formLabelWidth)
},
render() {
return (
......
<template>
<div class="wraper">
<CustomForm
:formConfig="queryformConfig"
v-model="queryFormData"
formLabelWidth="70px"
:isCustomButton="false"
:isFlex="false">
<template slot="btn">
<el-button type="primary" icon="el-icon-search" @click="search">
查询
</el-button>
</template>
</CustomForm>
<div class="recharge-record card">
<div class="search">
<CustomForm
:formConfig="queryformConfig"
v-model="queryFormData"
:isCustomButton="false"
:isFlex="false">
<template slot="btn">
<el-button type="primary" icon="el-icon-search" @click="search">
查询
</el-button>
</template>
</CustomForm>
</div>
<div class="table_wrap" v-loading="loading">
<table-vue
:sourceData="sourceData"
......@@ -258,6 +259,7 @@ export default {
.table_wrap {
flex: 1;
padding: 0;
}
.circle {
......@@ -318,4 +320,58 @@ export default {
.failStatus {
background-color: #f56c6c;
}
.recharge-record {
height: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
&::v-deep {
.el-table .el-table__cell {
padding: 6px 0;
}
.el-input__inner {
padding: 0 4px;
}
.el-input--small .el-input__inner {
height: 30px;
line-height: 30px;
}
.el-icon-time:before {
content: '';
}
.el-dialog__footer {
text-align: center;
.el-button--small {
padding: 9px 50px;
}
}
.el-dialog__body {
padding: 10px 20px;
}
.el-icon-edit:before {
color: #ff9800;
font-weight: bold;
}
.el-range-editor--small .el-range-separator {
line-height: 31px;
}
.header-row-class-name th {
background-color: #f8f8f9;
}
.el-input-group__append {
padding-left: 0;
}
}
}
</style>
<template>
<div class="wraper">
<CustomForm
:formConfig="queryformConfig"
v-model="queryFormData"
form-label-width="70px"
:is-custom-button="false"
:isFlex="false">
<template slot="btn">
<el-button type="primary" icon="el-icon-search" @click="search">
查询
</el-button>
</template>
</CustomForm>
<div class="recharge-record card">
<div class="search">
<CustomForm
:formConfig="queryformConfig"
v-model="queryFormData"
:is-custom-button="false"
:isFlex="false">
<template slot="btn">
<el-button type="primary" icon="el-icon-search" @click="search">
查询
</el-button>
</template>
</CustomForm>
</div>
<div class="table_wrap" v-loading="loading">
<table-vue
:sourceData="sourceData"
......@@ -370,6 +371,60 @@ export default {
}
</script>
<style scoped lang="less">
.recharge-record {
height: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
&::v-deep {
.el-table .el-table__cell {
padding: 6px 0;
}
.el-input__inner {
padding: 0 4px;
}
.el-input--small .el-input__inner {
height: 30px;
line-height: 30px;
}
.el-icon-time:before {
content: '';
}
.el-dialog__footer {
text-align: center;
.el-button--small {
padding: 9px 50px;
}
}
.el-dialog__body {
padding: 10px 20px;
}
.el-icon-edit:before {
color: #ff9800;
font-weight: bold;
}
.el-range-editor--small .el-range-separator {
line-height: 31px;
}
.header-row-class-name th {
background-color: #f8f8f9;
}
.el-input-group__append {
padding-left: 0;
}
}
}
.wraper {
display: flex;
flex-direction: column;
......@@ -378,6 +433,7 @@ export default {
.table_wrap {
flex: 1;
padding: 0;
}
.circle {
......
<template>
<div class="wraper">
<CustomForm
:formConfig="queryformConfig"
v-model="queryFormData"
form-label-width="70px"
@addDialog="addDialog"
@searchFn="search"
:isFlex="false">
<template slot="btn">
<el-button type="primary" @click="updateListFn">同步</el-button>
<el-button type="primary" @click="toList">查看ERP启动列表</el-button>
</template>
</CustomForm>
<div class="recharge-record card">
<div class="search">
<CustomForm
:formConfig="queryformConfig"
v-model="queryFormData"
@addDialog="addDialog"
@searchFn="search"
:isFlex="false">
<template slot="btn">
<el-button type="primary" @click="updateListFn">同步</el-button>
<el-button type="primary" @click="toList">查看ERP启动列表</el-button>
</template>
</CustomForm>
</div>
<div class="table_wrap" v-loading="loading">
<table-vue
:sourceData="sourceData"
......@@ -30,7 +31,6 @@
@size-change="sizeChange"
@current-change="onCurrentChange"></el-pagination>
</div>
<!-- 弹出层 -->
<el-dialog
:close-on-click-modal="false"
......@@ -82,135 +82,10 @@ export default {
select: '',
sourceData: [],
serviceNameList: new Map(),
newServiceNameList: [],
formData: {},
queryFormData: {},
queryformConfig: [
{
prop: 'name',
type: 'select',
name: '名称',
options: []
},
{
prop: 'type',
type: 'select',
name: '服务类型',
options: [
{ label: '基础', value: 'basics' },
{ label: '增值', value: 'appreciation' }
]
},
{
prop: 'enable',
type: 'select',
name: '状态',
options: [
{ label: '启用', value: true },
{ label: '停用', value: false }
]
}
],
editformConfig: [
{
prop: 'nameObj',
type: 'select',
name: '名称',
options: [],
valueKey: 'value',
events: {
onChange: (item, value) => {
item.name = value.value
item.serveType = value.type === 'basics' ? '基础' : '增值'
item.type = value.type
}
},
renderRules: () => [
{
required: true,
message: '请选择名称',
trigger: 'change'
}
]
},
{
prop: 'serveType',
type: 'input',
name: '服务类型',
attrs: { disabled: true, placeholder: '选择完名称后展示' }
},
{
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,
......@@ -334,7 +209,137 @@ export default {
}
]
},
queryformConfig() {
return [
{
prop: 'name',
type: 'select',
name: '名称',
options: [...(this.newServiceNameList || [])]
},
{
prop: 'type',
type: 'select',
name: '服务类型',
options: [
{ label: '基础', value: 'basics' },
{ label: '增值', value: 'appreciation' }
]
},
{
prop: 'enable',
type: 'select',
name: '状态',
options: [
{ label: '启用', value: true },
{ label: '停用', value: false }
]
}
]
},
editformConfig() {
return [
{
prop: 'nameObj',
type: 'select',
name: '名称',
options: [...(this.newServiceNameList || [])],
valueKey: 'value',
events: {
onChange: (item, value) => {
item.name = value.value
item.serveType = value.type === 'basics' ? '基础' : '增值'
item.type = value.type
}
},
renderRules: () => [
{
required: true,
message: '请选择名称',
trigger: 'change'
}
]
},
{
prop: 'serveType',
type: 'input',
name: '服务类型',
attrs: { disabled: true, placeholder: '选择完名称后展示' }
},
{
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: '备注'
}
]
},
funcRoleList() {
if (this.roleList.length > 0) {
return this.roleList.filter((item) => item.type === 'FUNCTION_ROLE')
......@@ -348,15 +353,7 @@ export default {
return []
}
},
watch: {
formData: {
handler(newValue) {
// console.log(368, newValue)
},
immediate: true,
deep: true
}
},
methods: {
sizeChange(value) {
this.paginationOptions.pageSize = value
......@@ -528,7 +525,7 @@ export default {
async getServiceNameList() {
try {
const { data } = await axios.get('serviceManagement/serviceNameList')
const newData = data.map((el) => {
this.newServiceNameList = data.map((el) => {
return {
label: el.remark,
value: el.code,
......@@ -536,18 +533,12 @@ export default {
}
})
this.serviceNameList = new Map(
newData.map((item) => [
this.newServiceNameList.map((item) => [
item.value,
{ label: item.label, type: item.type, value: item.value }
])
)
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)
}
},
......@@ -584,6 +575,60 @@ export default {
}
</script>
<style scoped lang="less">
.recharge-record {
height: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
&::v-deep {
.el-table .el-table__cell {
padding: 6px 0;
}
.el-input__inner {
padding: 0 4px;
}
.el-input--small .el-input__inner {
height: 30px;
line-height: 30px;
}
.el-icon-time:before {
content: '';
}
.el-dialog__footer {
text-align: center;
.el-button--small {
padding: 9px 50px;
}
}
.el-dialog__body {
padding: 10px 20px;
}
.el-icon-edit:before {
color: #ff9800;
font-weight: bold;
}
.el-range-editor--small .el-range-separator {
line-height: 31px;
}
.header-row-class-name th {
background-color: #f8f8f9;
}
.el-input-group__append {
padding-left: 0;
}
}
}
.wraper {
display: flex;
flex-direction: column;
......@@ -592,6 +637,7 @@ export default {
.table_wrap {
flex: 1;
padding: 0;
}
.circle {
......
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