2024-03-26 11:18:19 +08:00
|
|
|
|
<script src="configData.js"></script>
|
|
|
|
|
<template>
|
|
|
|
|
<div class="wrap">
|
|
|
|
|
<div class="btn">
|
|
|
|
|
<div class="chunk">
|
|
|
|
|
<el-button
|
|
|
|
|
icon="el-icon-back"
|
|
|
|
|
@click="
|
|
|
|
|
$router.replace({ path: '/integrationOption/masterDataOptions' })
|
|
|
|
|
"
|
|
|
|
|
>返回
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="chunk">
|
|
|
|
|
<el-button
|
|
|
|
|
icon="el-icon-first-aid-kit"
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="saveHandle"
|
|
|
|
|
:loading="saveLoading"
|
|
|
|
|
>保存
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="main">
|
|
|
|
|
<div class="left" v-loading="mainLoading">
|
|
|
|
|
<div class="title">
|
|
|
|
|
数据表
|
|
|
|
|
</div>
|
|
|
|
|
<div class="receipts">
|
|
|
|
|
<div class="label">单据规则:</div>
|
|
|
|
|
<div class="receiptsList" @click="openReceiptsHandle">
|
|
|
|
|
<template v-if="!receiptsShowTableData.length">点击选择单据规则</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<div class="receiptsItem" v-for="(item,index) in receiptsShowTableData">{{ item.dbValue }}</div>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mainTable">
|
|
|
|
|
<BaseTable
|
|
|
|
|
ref="mainTable"
|
|
|
|
|
:tableData="mainTableData"
|
|
|
|
|
:tabLoading="mainTabLoading"
|
|
|
|
|
:tableColumn="mainTableColumn"
|
|
|
|
|
:border="false"
|
|
|
|
|
:funData="mainFunData"
|
|
|
|
|
tableHeight="25vh"
|
|
|
|
|
:highlightCurrent="true"
|
|
|
|
|
@radioChange="mainOnClick"
|
|
|
|
|
@onFunc="mainOnFunc"
|
|
|
|
|
>
|
|
|
|
|
<template #dbType="{row}">
|
|
|
|
|
{{ row.dbType === '1' ? '主表' : '子表' }}
|
|
|
|
|
</template>
|
|
|
|
|
</BaseTable>
|
|
|
|
|
<div class="mainAddRow">
|
|
|
|
|
<el-link
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="addMainAddRow"
|
|
|
|
|
:underline="false"
|
|
|
|
|
>+ 添加
|
|
|
|
|
</el-link
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="title">
|
|
|
|
|
表字段
|
|
|
|
|
</div>
|
|
|
|
|
<div class="activedTable">
|
|
|
|
|
<BaseTable
|
|
|
|
|
ref="activedTable"
|
|
|
|
|
:tableData="activedTableData"
|
|
|
|
|
:tabLoading="activedTabLoading"
|
|
|
|
|
:tableColumn="activedTableColumn"
|
|
|
|
|
:border="false"
|
|
|
|
|
:funData="activedFunData"
|
|
|
|
|
tableHeight="30vh"
|
|
|
|
|
:highlightCurrent="true"
|
|
|
|
|
@radioChange="activedOnClick"
|
|
|
|
|
@onFunc="activedOnFunc"
|
|
|
|
|
>
|
|
|
|
|
<template #filedType="{row}">
|
|
|
|
|
{{ dataTypeDist[row.filedType] }}
|
|
|
|
|
</template>
|
|
|
|
|
</BaseTable>
|
|
|
|
|
<div class="mainAddRow" v-if="mainActivedRow">
|
|
|
|
|
<el-link
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="activedAddRow"
|
|
|
|
|
:underline="false"
|
|
|
|
|
>+ 添加
|
|
|
|
|
</el-link
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div v-loading=>
|
|
|
|
|
<div class="right">
|
|
|
|
|
<template v-if="activedTableRow">
|
|
|
|
|
<div class="btn">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="activedRowSaveHandle"
|
|
|
|
|
>暂存
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="title">
|
|
|
|
|
表字段
|
|
|
|
|
</div>
|
|
|
|
|
<div class="optionForm">
|
|
|
|
|
<baseNewForm
|
|
|
|
|
ref="optionForm"
|
|
|
|
|
:spanNumber="24"
|
|
|
|
|
:isFunBtn="false"
|
|
|
|
|
:formRow="optionFormRow"
|
|
|
|
|
:ruleForm="optionRuleForm"
|
|
|
|
|
:labelPosition="'left'"
|
|
|
|
|
@onSelect="selectChangeHanlde"
|
|
|
|
|
@inputBlur="optionFormInputBlur"
|
2024-05-24 16:47:01 +08:00
|
|
|
|
@onSubmit="optionOnSubmit"
|
2024-05-28 14:42:19 +08:00
|
|
|
|
:disabled="sonFormDisabled"
|
2024-05-24 16:47:01 +08:00
|
|
|
|
>
|
2024-03-26 11:18:19 +08:00
|
|
|
|
</baseNewForm>
|
|
|
|
|
<baseNewForm
|
|
|
|
|
ref="typeOptionForm"
|
|
|
|
|
:spanNumber="24"
|
|
|
|
|
:isFunBtn="false"
|
|
|
|
|
:formRow="typeOptionFormRow"
|
|
|
|
|
:ruleForm="typeOptionRuleForm"
|
|
|
|
|
:labelPosition="'left'"
|
|
|
|
|
@onSelect="typeSelectChangeHanlde"
|
2024-05-24 16:47:01 +08:00
|
|
|
|
@onSubmit="typeOptionOnSubmit"
|
2024-05-28 14:42:19 +08:00
|
|
|
|
:disabled="sonFormDisabled"
|
2024-05-24 16:47:01 +08:00
|
|
|
|
>
|
2024-03-26 11:18:19 +08:00
|
|
|
|
</baseNewForm>
|
|
|
|
|
<baseNewForm
|
|
|
|
|
ref="propertyForm"
|
|
|
|
|
:spanNumber="24"
|
|
|
|
|
:isFunBtn="false"
|
|
|
|
|
:formRow="propertyFormRow"
|
|
|
|
|
:ruleForm="propertyRuleForm"
|
|
|
|
|
:labelPosition="'left'"
|
2024-05-24 16:47:01 +08:00
|
|
|
|
@onSubmit="propertyOnSubmit"
|
2024-05-28 14:42:19 +08:00
|
|
|
|
:disabled="sonFormDisabled"
|
|
|
|
|
|
2024-05-24 16:47:01 +08:00
|
|
|
|
>
|
2024-03-26 11:18:19 +08:00
|
|
|
|
</baseNewForm>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="smtitle">
|
|
|
|
|
可选控间属性
|
|
|
|
|
</div>
|
|
|
|
|
<div class="checkBoxList">
|
2024-05-28 14:42:19 +08:00
|
|
|
|
<el-checkbox-group :disabled="sonFormDisabled" v-model="propertyActiveList"
|
|
|
|
|
@change="propertyActiveListChangeHanlde"
|
|
|
|
|
>
|
2024-03-26 11:18:19 +08:00
|
|
|
|
<el-checkbox v-for="(item,index) in propertyList" :label="item.id" :key="item.id">{{
|
|
|
|
|
item.label
|
|
|
|
|
}}
|
|
|
|
|
</el-checkbox>
|
|
|
|
|
</el-checkbox-group>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else-if="mainActivedRow">
|
|
|
|
|
<div class="btn">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="mainActivedRowSaveHandle"
|
|
|
|
|
>暂存
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="title">
|
|
|
|
|
数据表
|
|
|
|
|
</div>
|
|
|
|
|
<div class="optionForm">
|
|
|
|
|
<baseNewForm
|
|
|
|
|
ref="mainOptionForm"
|
|
|
|
|
:spanNumber="24"
|
|
|
|
|
:isFunBtn="false"
|
|
|
|
|
:formRow="mainOptionRow"
|
|
|
|
|
:ruleForm="mainOptionForm"
|
|
|
|
|
:labelPosition="'left'"
|
2024-05-24 16:47:01 +08:00
|
|
|
|
@onSubmit="mainOptionOnSubmit"
|
|
|
|
|
>
|
2024-03-26 11:18:19 +08:00
|
|
|
|
</baseNewForm>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<baseDialog v-model="receiptsShow" width="50%" @confirm="receiptsConfirm">
|
|
|
|
|
<div class="receiptsTable">
|
|
|
|
|
<BaseTable
|
|
|
|
|
ref="receiptsTable"
|
|
|
|
|
:showIndex="true"
|
|
|
|
|
:tableData="receiptsTableData"
|
|
|
|
|
:tableColumn="receiptsTableColumn"
|
|
|
|
|
:border="false"
|
|
|
|
|
:funData="receiptsFunData"
|
|
|
|
|
tableHeight="30vh"
|
2024-05-24 16:47:01 +08:00
|
|
|
|
@onFunc="receiptsOnFunc"
|
|
|
|
|
>
|
2024-03-26 11:18:19 +08:00
|
|
|
|
<template #dbType="{row}">
|
|
|
|
|
<el-select v-model="row['dbType']" placeholder="请选择"
|
2024-05-24 16:47:01 +08:00
|
|
|
|
@change="(val)=>ruleTypeSeleceChangHandle(val,row)"
|
|
|
|
|
>
|
2024-03-26 11:18:19 +08:00
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in ruleTypeOptions"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:label="item.label"
|
2024-05-24 16:47:01 +08:00
|
|
|
|
:value="item.value"
|
|
|
|
|
>
|
2024-03-26 11:18:19 +08:00
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</template>
|
|
|
|
|
<template #dbValue="{row}">
|
|
|
|
|
<div v-if="!row['dbType']">请选择格式类型</div>
|
|
|
|
|
<div v-else-if="row['dbType'] === '1'">{{ row.dbValue }}</div>
|
|
|
|
|
<div v-else-if="row['dbType'] === '2'">
|
|
|
|
|
<el-input v-model="row.dbValue"></el-input>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else-if="row['dbType'] === '3'">
|
|
|
|
|
<el-select v-model="row.dbValue" placeholder="请选择">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in dateOptions"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:label="item.label"
|
2024-05-24 16:47:01 +08:00
|
|
|
|
:value="item.value"
|
|
|
|
|
>
|
2024-03-26 11:18:19 +08:00
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else-if="row['dbType'] === '4'">
|
|
|
|
|
<el-input v-model="row.dbValue" @input="(val)=>integerNumber(val,row)"></el-input>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</BaseTable>
|
|
|
|
|
<div class="receiptsAddRow">
|
|
|
|
|
<el-link
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="receiptsAddRow"
|
|
|
|
|
:underline="false"
|
|
|
|
|
>+ 添加
|
|
|
|
|
</el-link
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</baseDialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2024-05-24 16:47:01 +08:00
|
|
|
|
import BaseTable from '@/views/intergrationTask/compoments/baseTable.vue'
|
|
|
|
|
import configData from './configData'
|
|
|
|
|
import { getApiModuleApi } from '@/api/apiChunks/index.js'
|
|
|
|
|
import baseNewForm from '../compoments/baseNewForm'
|
|
|
|
|
import { deepClone } from '@/utils/index.js'
|
|
|
|
|
import baseDialog from '@/views/integrationOption/compoments/baseDialog'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2024-05-28 14:42:19 +08:00
|
|
|
|
sonFormDisabled: false,
|
2024-03-26 11:18:19 +08:00
|
|
|
|
saveLoading: false,
|
|
|
|
|
mainLoading: false,
|
|
|
|
|
//options表
|
|
|
|
|
optionFormRow: configData.optionFormRow,
|
|
|
|
|
//数据表option表
|
|
|
|
|
mainOptionRow: configData.mainOptionRow,
|
|
|
|
|
//type选中后的表
|
|
|
|
|
typeOptionFormRow: [],
|
|
|
|
|
propertyFormRow: [],//可选属性表表格(渲染)
|
|
|
|
|
mainTableData: [],//主表数据
|
|
|
|
|
activedTableData: [],//子表数据(单击主表后赋值)
|
|
|
|
|
mainTabLoading: false,//主表loading
|
|
|
|
|
activedTabLoading: false,//选中表loading
|
|
|
|
|
optionRuleForm: {},//表字段options数据
|
|
|
|
|
mainOptionForm: {},//数据表数据
|
|
|
|
|
typeOptionRuleForm: {},//表字段根据type数据
|
|
|
|
|
propertyRuleForm: {},//可选属性表数据
|
|
|
|
|
mainTableColumn: [
|
2024-05-24 16:47:01 +08:00
|
|
|
|
{ title: '英文名', id: 'dbName' },
|
|
|
|
|
{ title: '表类型', id: 'dbType' },
|
|
|
|
|
{ title: '表说明', id: 'remark' }
|
2024-03-26 11:18:19 +08:00
|
|
|
|
],
|
|
|
|
|
mainActivedRow: false, // 数据表选中行暂存
|
|
|
|
|
activedTableRow: false, //子表选中行暂存
|
|
|
|
|
activedTableColumn: [
|
2024-05-24 16:47:01 +08:00
|
|
|
|
{ title: '中文名', id: 'chName' },
|
|
|
|
|
{ title: '英文名', id: 'enName' },
|
|
|
|
|
{ title: '字段类型', id: 'filedType' },
|
|
|
|
|
{ title: '长度', id: 'filedLength' }
|
2024-03-26 11:18:19 +08:00
|
|
|
|
],//子表行数据
|
|
|
|
|
mainFunData: [
|
|
|
|
|
{
|
2024-05-24 16:47:01 +08:00
|
|
|
|
text: '删除',
|
|
|
|
|
color: 'red'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
],//主表操作兰
|
|
|
|
|
activedFunData: [
|
|
|
|
|
{
|
2024-05-24 16:47:01 +08:00
|
|
|
|
text: '删除',
|
|
|
|
|
color: 'red'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
],//子表操作栏
|
|
|
|
|
propertyActiveList: [],//可选属性选中列表(v-model)
|
|
|
|
|
propertyList: [
|
|
|
|
|
{
|
2024-05-24 16:47:01 +08:00
|
|
|
|
label: '大于',
|
|
|
|
|
id: 'up'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}, {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
label: '小于',
|
|
|
|
|
id: 'low'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-24 16:47:01 +08:00
|
|
|
|
label: '正则',
|
|
|
|
|
id: 'pattern'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
2024-05-24 16:47:01 +08:00
|
|
|
|
{ label: '正则提示', id: 'message' }
|
2024-03-26 11:18:19 +08:00
|
|
|
|
],//可选属性列表
|
|
|
|
|
//radiolist属性数字字典
|
|
|
|
|
propertyDist: {
|
|
|
|
|
up: {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
type: 'select',
|
|
|
|
|
id: 'up',
|
|
|
|
|
title: '大于',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
|
|
|
|
disabled: false,
|
|
|
|
|
required: true,
|
|
|
|
|
fontSize: 16,
|
2024-05-24 16:47:01 +08:00
|
|
|
|
options: []
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
low: {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
type: 'select',
|
|
|
|
|
id: 'low',
|
|
|
|
|
title: '小于',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
|
|
|
|
disabled: false,
|
|
|
|
|
required: true,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
options: []
|
|
|
|
|
},
|
|
|
|
|
pattern: {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
id: 'pattern',
|
|
|
|
|
title: '正则',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
|
|
|
|
disabled: false,
|
|
|
|
|
required: true,
|
2024-05-24 16:47:01 +08:00
|
|
|
|
fontSize: 16
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
message: {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
id: 'message',
|
|
|
|
|
title: '正则提示',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
|
|
|
|
disabled: false,
|
|
|
|
|
required: true,
|
2024-05-24 16:47:01 +08:00
|
|
|
|
fontSize: 16
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//可选属性表数据字典
|
|
|
|
|
typeDist: {
|
|
|
|
|
select: [
|
|
|
|
|
{
|
2024-05-24 16:47:01 +08:00
|
|
|
|
type: 'select',
|
|
|
|
|
id: 'service',
|
|
|
|
|
title: '服务名称',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
|
|
|
|
disabled: false,
|
|
|
|
|
required: true,
|
|
|
|
|
fontSize: 16,
|
2024-05-24 16:47:01 +08:00
|
|
|
|
options: []
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-24 16:47:01 +08:00
|
|
|
|
type: 'select',
|
|
|
|
|
id: 'label',
|
|
|
|
|
title: 'label',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
|
|
|
|
disabled: false,
|
|
|
|
|
required: true,
|
|
|
|
|
fontSize: 16,
|
2024-05-24 16:47:01 +08:00
|
|
|
|
options: []
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}, {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
id: 'value',
|
|
|
|
|
title: 'value',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
|
|
|
|
disabled: true,
|
|
|
|
|
required: true,
|
|
|
|
|
fontSize: 16,
|
2024-05-24 16:47:01 +08:00
|
|
|
|
options: []
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
radio: [
|
|
|
|
|
{
|
2024-05-24 16:47:01 +08:00
|
|
|
|
type: 'select',
|
|
|
|
|
id: 'service',
|
|
|
|
|
title: '服务名称',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
|
|
|
|
disabled: false,
|
|
|
|
|
required: true,
|
|
|
|
|
fontSize: 16,
|
2024-05-24 16:47:01 +08:00
|
|
|
|
options: []
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-24 16:47:01 +08:00
|
|
|
|
type: 'select',
|
|
|
|
|
id: 'label',
|
|
|
|
|
title: 'label',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
|
|
|
|
disabled: false,
|
|
|
|
|
required: true,
|
|
|
|
|
fontSize: 16,
|
2024-05-24 16:47:01 +08:00
|
|
|
|
options: []
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}, {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
id: 'value',
|
|
|
|
|
title: 'value',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
|
|
|
|
disabled: true,
|
|
|
|
|
required: true,
|
|
|
|
|
fontSize: 16,
|
2024-05-24 16:47:01 +08:00
|
|
|
|
options: []
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
treeselect: [
|
|
|
|
|
{
|
2024-05-24 16:47:01 +08:00
|
|
|
|
type: 'select',
|
|
|
|
|
id: 'service',
|
|
|
|
|
title: '服务名称',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
|
|
|
|
disabled: false,
|
|
|
|
|
required: true,
|
|
|
|
|
fontSize: 16,
|
2024-05-24 16:47:01 +08:00
|
|
|
|
options: []
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-24 16:47:01 +08:00
|
|
|
|
type: 'select',
|
|
|
|
|
id: 'label',
|
|
|
|
|
title: 'label',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
|
|
|
|
disabled: false,
|
|
|
|
|
required: true,
|
|
|
|
|
fontSize: 16,
|
2024-05-24 16:47:01 +08:00
|
|
|
|
options: []
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}, {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
type: 'input',
|
|
|
|
|
id: 'value',
|
|
|
|
|
title: 'value',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
|
|
|
|
disabled: true,
|
|
|
|
|
required: false,
|
|
|
|
|
fontSize: 16,
|
2024-05-24 16:47:01 +08:00
|
|
|
|
options: []
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-24 16:47:01 +08:00
|
|
|
|
type: 'select',
|
|
|
|
|
id: 'upId',
|
|
|
|
|
title: 'upId',
|
2024-03-26 11:18:19 +08:00
|
|
|
|
row: 24,
|
|
|
|
|
disabled: false,
|
|
|
|
|
required: true,
|
|
|
|
|
fontSize: 16,
|
2024-05-24 16:47:01 +08:00
|
|
|
|
options: []
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
serviceOptions: [],
|
|
|
|
|
labelOptions: [],
|
|
|
|
|
//单据规则相关
|
|
|
|
|
receiptsShow: false,//单据规则dialog
|
|
|
|
|
receiptsTableData: [{}],//表单数据
|
|
|
|
|
receiptsFunData: [
|
|
|
|
|
{
|
2024-05-24 16:47:01 +08:00
|
|
|
|
text: '删除',
|
|
|
|
|
color: 'red'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
receiptsTableColumn: [
|
|
|
|
|
{
|
2024-05-24 16:47:01 +08:00
|
|
|
|
title: '类型',
|
|
|
|
|
id: 'dbType'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-05-24 16:47:01 +08:00
|
|
|
|
title: '格式规则',
|
|
|
|
|
id: 'dbValue'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
ruleTypeOptions: [
|
|
|
|
|
{
|
2024-05-24 16:47:01 +08:00
|
|
|
|
label: '连接符号',
|
|
|
|
|
value: '1'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}, {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
label: '字符串',
|
|
|
|
|
value: '2'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}, {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
label: '日期',
|
|
|
|
|
value: '3'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}, {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
label: '流水号',
|
|
|
|
|
value: '4'
|
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
],
|
|
|
|
|
dateOptions: [
|
|
|
|
|
{
|
2024-05-24 16:47:01 +08:00
|
|
|
|
label: 'yyyy-MM-dd',
|
|
|
|
|
value: 'yyyy-MM-dd'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}, {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
label: 'yyyyMMdd',
|
|
|
|
|
value: 'yyyyMMdd'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}, {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
label: 'yyyy-MM-dd HH:mm:ss',
|
|
|
|
|
value: 'yyyy-MM-dd HH:mm:ss'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}, {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
label: 'yyyyMMddHHmmss',
|
|
|
|
|
value: 'yyyyMMddHHmmss'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}, {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
label: 'yyyyMMddHHmmssSSS',
|
|
|
|
|
value: 'yyyyMMddHHmmssSSS'
|
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
],
|
|
|
|
|
receiptsShowTableData: [],
|
|
|
|
|
//数据类型字段
|
2024-05-24 16:47:01 +08:00
|
|
|
|
dataTypeDist: {}
|
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// 下拉初始化
|
|
|
|
|
async initSelect() {
|
|
|
|
|
//数据类型下拉
|
|
|
|
|
const type = await getApiModuleApi({
|
2024-05-24 16:47:01 +08:00
|
|
|
|
tl: 'generalServiceImpl',
|
|
|
|
|
as: 'dictionaryshop',
|
|
|
|
|
dj: 'selectDictionaryshop'
|
|
|
|
|
}, { tab_name: 'mdm', column_name: 'mdm_filed_type' })
|
2024-03-26 11:18:19 +08:00
|
|
|
|
this.optionFormRow[2].elCol[0].options = []
|
|
|
|
|
type.attribute.forEach(item => {
|
|
|
|
|
//创造数据字段给表单插槽显示(字段类型)
|
|
|
|
|
this.$set(this.dataTypeDist, item.column_value, item.column_content)
|
|
|
|
|
this.optionFormRow[2].elCol[0].options.push({
|
|
|
|
|
label: item.column_content,
|
|
|
|
|
id: item.column_value
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
//服务名下拉
|
|
|
|
|
const service = await getApiModuleApi({
|
2024-05-24 16:47:01 +08:00
|
|
|
|
tl: 'mdmService',
|
|
|
|
|
as: 'mdmService',
|
|
|
|
|
dj: 'queryMdmModuleServer'
|
|
|
|
|
}, { remark: '' })
|
2024-03-26 11:18:19 +08:00
|
|
|
|
service.attribute.forEach(item => {
|
|
|
|
|
this.serviceOptions.push({
|
|
|
|
|
id: item.dbName,
|
|
|
|
|
label: item.remark
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
//数据源初始化
|
|
|
|
|
async init() {
|
|
|
|
|
this.mainLoading = true
|
|
|
|
|
const res = await getApiModuleApi({
|
2024-05-24 16:47:01 +08:00
|
|
|
|
tl: 'mdmService',
|
|
|
|
|
as: 'mdmService',
|
|
|
|
|
dj: 'queryMdmModuleDb'
|
|
|
|
|
}, { id: this.$route.query.id })
|
2024-03-26 11:18:19 +08:00
|
|
|
|
this.mainTableData = []
|
|
|
|
|
this.receiptsShowTableData = res.attribute.mdmTableCodeRuleEntityList
|
|
|
|
|
if (res.attribute.mainMdmModuleDb.id) {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.mainTableData.push({ ...res.attribute.mainMdmModuleDb })
|
2024-03-26 11:18:19 +08:00
|
|
|
|
} else {
|
2024-05-28 14:42:19 +08:00
|
|
|
|
console.log(123)
|
|
|
|
|
let tempObj = {
|
|
|
|
|
dbType: '1', sublistMdmModuleDbFileds: [{
|
|
|
|
|
'index': 0,
|
|
|
|
|
'chName': '数据状态',
|
|
|
|
|
'enName': 'dataStatus',
|
|
|
|
|
'filedType': '3',
|
|
|
|
|
'filedLength': '1',
|
|
|
|
|
'mdmModuleDbFiledsRules': [
|
|
|
|
|
{
|
|
|
|
|
'ruleName': '显示名',
|
|
|
|
|
'ruleCode': 'title',
|
|
|
|
|
'ruleValue': '数据状态',
|
|
|
|
|
'ruleType': 2,
|
|
|
|
|
'formName': 'optionRuleForm'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
'ruleName': '宽度',
|
|
|
|
|
'ruleCode': 'row',
|
|
|
|
|
'ruleValue': '12',
|
|
|
|
|
'ruleType': 2,
|
|
|
|
|
'formName': 'optionRuleForm'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
'ruleName': '单元格宽度',
|
|
|
|
|
'ruleCode': 'width',
|
|
|
|
|
'ruleType': 2,
|
|
|
|
|
'formName': 'optionRuleForm'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
'ruleName': '数据类型',
|
|
|
|
|
'ruleCode': 'type',
|
|
|
|
|
'ruleValue': 'input',
|
|
|
|
|
'ruleType': 2,
|
|
|
|
|
'formName': 'optionRuleForm'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
'ruleName': '必填',
|
|
|
|
|
'ruleCode': 'required',
|
|
|
|
|
'ruleType': 2,
|
|
|
|
|
'formName': 'optionRuleForm'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
'ruleName': '禁止修改',
|
|
|
|
|
'ruleCode': 'disabled',
|
|
|
|
|
'ruleValue': true,
|
|
|
|
|
'ruleType': 2,
|
|
|
|
|
'formName': 'optionRuleForm'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}]
|
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
this.mainTableData.push(tempObj)
|
|
|
|
|
}
|
|
|
|
|
res.attribute.sublistMdmModuleDb.forEach(item => {
|
|
|
|
|
if (item.id) {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.mainTableData.push({ ...item })
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.mainLoading = false
|
|
|
|
|
},
|
|
|
|
|
//流水号添加行
|
|
|
|
|
receiptsAddRow() {
|
|
|
|
|
this.receiptsTableData.push({})
|
|
|
|
|
},
|
|
|
|
|
//流水号修改事件
|
|
|
|
|
integerNumber(val, row) {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
row['dbValue'] = row['dbValue'].replace(/[^\d]/g, '')
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
//单据规则相关
|
|
|
|
|
openReceiptsHandle() {
|
|
|
|
|
this.receiptsTableData = deepClone(this.receiptsShowTableData)
|
|
|
|
|
this.receiptsShow = true
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
//单据规则下拉改变事件
|
|
|
|
|
ruleTypeSeleceChangHandle(val, row) {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.$set(row, 'dbValue', '')
|
2024-03-26 11:18:19 +08:00
|
|
|
|
if (val === '1') {
|
|
|
|
|
row['dbValue'] = '-'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//表字段下拉触发(根据type类型动态对表
|
|
|
|
|
selectChangeHanlde(val, index, indexRow, row, init = false) {
|
|
|
|
|
if (row.id === 'type') {
|
|
|
|
|
this.typeOptionFormRow = []
|
|
|
|
|
if (!init) {
|
|
|
|
|
this.typeOptionRuleForm = {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
value: 'id'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (val && this.typeDist[val]) {
|
|
|
|
|
this.typeDist[val].forEach(item => {
|
|
|
|
|
// 如果是服务名称则将请求下来的服务名用上
|
|
|
|
|
if (item.id === 'service') {
|
|
|
|
|
item.options = deepClone(this.serviceOptions)
|
|
|
|
|
}
|
|
|
|
|
let tempObj = {
|
|
|
|
|
elCol: [
|
|
|
|
|
{
|
|
|
|
|
...item
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
this.typeOptionFormRow.push(tempObj)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//type表下拉触发(目的是为了服务名称下拉后拿到label
|
|
|
|
|
async typeSelectChangeHanlde(val, index, indexRow, row, initFlag = false) {
|
|
|
|
|
if (row.id === 'service') {
|
|
|
|
|
if (val) {
|
|
|
|
|
const res = await getApiModuleApi({
|
2024-05-24 16:47:01 +08:00
|
|
|
|
tl: 'mdmService',
|
|
|
|
|
as: 'mdmService',
|
|
|
|
|
dj: 'queryMdmModuleServerFiled'
|
|
|
|
|
}, { dbName: val })
|
2024-03-26 11:18:19 +08:00
|
|
|
|
this.labelOptions = []
|
|
|
|
|
res.attribute.forEach(item => {
|
|
|
|
|
this.labelOptions.push({
|
|
|
|
|
id: item.enName,
|
|
|
|
|
label: item.chName
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.labelOptions = []
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.typeOptionFormRow.forEach(item => {
|
|
|
|
|
if (item.elCol[0].id === 'label' || item.elCol[0].id === 'upId') {
|
|
|
|
|
if (!initFlag) {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.$set(this.typeOptionRuleForm, item.elCol[0].id, '')
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
item.elCol[0].options = deepClone(this.labelOptions)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//数据表主表暂存方法
|
|
|
|
|
mainActivedRowSaveHandle() {
|
|
|
|
|
//验证后跳转到mainOptionOnSubmit
|
|
|
|
|
this.$refs.mainOptionForm.submitForm()
|
|
|
|
|
},
|
|
|
|
|
//数据副表暂存方法(){
|
|
|
|
|
activedRowSaveHandle() {
|
|
|
|
|
//检测重名
|
|
|
|
|
let flag = this.activedTableData.some(item => {
|
|
|
|
|
if (item['enName'] === this.optionRuleForm['enName'] && item.index != this.optionRuleForm.index) {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.$vmNews('英文名不允许重复', 'warning')
|
2024-03-26 11:18:19 +08:00
|
|
|
|
return true
|
|
|
|
|
} else {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
})
|
2024-05-24 16:47:01 +08:00
|
|
|
|
if (flag) return
|
2024-03-26 11:18:19 +08:00
|
|
|
|
this.$refs.optionForm.submitForm()
|
|
|
|
|
},
|
|
|
|
|
//主表验证通过
|
|
|
|
|
mainOptionOnSubmit() {
|
|
|
|
|
let disabledWords = ['id', 'document_rule', 'document_rule_num', 'sorts', 'create_user_id', 'create_time', 'modify_user_id', 'modify_time', 'sts', 'org_id']
|
|
|
|
|
if (disabledWords.includes(this.mainOptionForm.dbName)) {
|
|
|
|
|
this.$vmNews(`暂存失败,英文名${this.mainOptionForm.dbName}不合法。`)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
//检测重名
|
|
|
|
|
let flag = this.mainTableData.some(item => {
|
|
|
|
|
if (item['dbName'] === this.mainOptionForm['dbName'] && item.index != this.mainOptionForm.index) {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.$vmNews('英文名不允许重复', 'warning')
|
2024-03-26 11:18:19 +08:00
|
|
|
|
return true
|
|
|
|
|
} else {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
})
|
2024-05-24 16:47:01 +08:00
|
|
|
|
if (flag) return
|
2024-03-26 11:18:19 +08:00
|
|
|
|
// 将表值赋值给mainActivedRow
|
|
|
|
|
this.$set(this.mainActivedRow, 'dbName', this.mainOptionForm['dbName'])
|
|
|
|
|
this.$set(this.mainActivedRow, 'remark', this.mainOptionForm['remark'])
|
|
|
|
|
//重新将当前选中主表赋值给activedTableData (不给的话会丢失掉对象)
|
|
|
|
|
// this.activedTableData = this.mainActivedRow.sublistMdmModuleDbFileds
|
|
|
|
|
// 这里的代码是取消选中号 需要再给上
|
|
|
|
|
// this.$refs.mainTable.setCurrent({index: -1})
|
|
|
|
|
// this.mainActivedRow = false
|
|
|
|
|
},
|
|
|
|
|
// 可选属性表变更方法
|
|
|
|
|
propertyActiveListChangeHanlde(val) {
|
|
|
|
|
this.propertyFormRow = []
|
|
|
|
|
// 消除表单里被取消的值
|
|
|
|
|
Object.keys(this.propertyRuleForm).forEach(item => {
|
|
|
|
|
if (!val.includes(item)) {
|
|
|
|
|
this.$delete(this.propertyRuleForm, item)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if (val === 'up' || val === 'low') {
|
|
|
|
|
this.activedTableData.forEach(item => {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
tempOptions.push({ label: item.id, chName: item.enName })
|
2024-03-26 11:18:19 +08:00
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 通过字典找到值的类型渲染在表单上
|
|
|
|
|
val.forEach(item => {
|
|
|
|
|
let tempOptions = []
|
|
|
|
|
if (item === 'up' || item === 'low') {
|
|
|
|
|
this.activedTableData.some(ele => {
|
|
|
|
|
if (this.activedTableRow.id === ele.id) return false
|
|
|
|
|
ele.mdmModuleDbFiledsRules.forEach(ele02 => {
|
|
|
|
|
if (ele02.ruleValue === 'datepick') {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
tempOptions.push({ label: ele.chName, id: ele.enName })
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
let tempObj = {
|
|
|
|
|
elCol: [
|
|
|
|
|
{
|
|
|
|
|
...this.propertyDist[item],
|
|
|
|
|
options: tempOptions
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.propertyFormRow.push(tempObj)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
2024-05-28 14:42:19 +08:00
|
|
|
|
// 上方表格行点击
|
2024-03-26 11:18:19 +08:00
|
|
|
|
mainOnClick(val) {
|
|
|
|
|
if (val.index === -1) return
|
|
|
|
|
this.activedTableRow = false
|
|
|
|
|
this.mainActivedRow = val
|
|
|
|
|
this.activedTableData = []
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.$refs.mainOptionForm.resetForm()
|
|
|
|
|
this.mainOptionForm = deepClone(val)
|
|
|
|
|
this.activedTableData = val.sublistMdmModuleDbFileds
|
|
|
|
|
})
|
|
|
|
|
},
|
2024-05-28 14:42:19 +08:00
|
|
|
|
//子表单机事件
|
2024-03-26 11:18:19 +08:00
|
|
|
|
activedOnClick(val) {
|
2024-05-28 14:42:19 +08:00
|
|
|
|
//若英文名称为dataStatus 且是主表 则禁止输出
|
|
|
|
|
|
|
|
|
|
if (val.enName === 'dataStatus' && this.mainActivedRow.dbType == 1) {
|
|
|
|
|
this.sonFormDisabled = true
|
|
|
|
|
} else {
|
|
|
|
|
this.sonFormDisabled = false
|
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
this.activedTableRow = val
|
|
|
|
|
//清空type带出来的ruleForm
|
|
|
|
|
this.typeOptionFormRow = []
|
|
|
|
|
this.typeOptionRuleForm = {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
value: 'id'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
this.propertyFormRow = []
|
|
|
|
|
this.propertyRuleForm = {}
|
|
|
|
|
this.propertyActiveList = []
|
|
|
|
|
let propertyRuleForm = []
|
|
|
|
|
let optionRuleForm = []
|
|
|
|
|
let typeOptionRuleForm = []
|
2024-05-28 14:42:19 +08:00
|
|
|
|
|
2024-03-26 11:18:19 +08:00
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
// 重置表单
|
|
|
|
|
this.$refs.optionForm.resetForm()
|
|
|
|
|
this.optionRuleForm = deepClone(val)
|
|
|
|
|
console.log(this.optionRuleForm, 'this.optionRuleForm')
|
2024-05-24 16:47:01 +08:00
|
|
|
|
let dom = document.querySelector('.optionForm')
|
2024-03-26 11:18:19 +08:00
|
|
|
|
dom.scrollTo({
|
|
|
|
|
top: 0,
|
2024-05-24 16:47:01 +08:00
|
|
|
|
behavior: 'smooth'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
})
|
2024-05-28 14:42:19 +08:00
|
|
|
|
//表单规则处理
|
2024-03-26 11:18:19 +08:00
|
|
|
|
if (!val.mdmModuleDbFiledsRules) return
|
|
|
|
|
val.mdmModuleDbFiledsRules.forEach(item => {
|
|
|
|
|
if (item.ruleCode === 'required' || item.ruleCode === 'disabled') {
|
|
|
|
|
if (!item.ruleValue) {
|
|
|
|
|
this.$set(this[item.formName], item.ruleCode, false)
|
|
|
|
|
} else if (typeof item.ruleValue === 'boolean') {
|
|
|
|
|
this.$set(this[item.formName], item.ruleCode, item.ruleValue)
|
|
|
|
|
} else {
|
|
|
|
|
this.$set(this[item.formName], item.ruleCode, JSON.parse(item.ruleValue))
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.$set(this[item.formName], item.ruleCode, item.ruleValue)
|
|
|
|
|
}
|
|
|
|
|
if (item.formName === 'propertyRuleForm') {
|
|
|
|
|
propertyRuleForm.push(item.ruleCode)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if (this.typeOptionRuleForm.service) {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.typeSelectChangeHanlde(this.typeOptionRuleForm.service, '', '', { id: 'service' }, true)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.selectChangeHanlde(this.optionRuleForm.type, '', '', { id: 'type' }, true)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
this.propertyActiveList = propertyRuleForm
|
|
|
|
|
this.propertyActiveListChangeHanlde(this.propertyActiveList)
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
//配置项表通过
|
|
|
|
|
optionOnSubmit() {
|
|
|
|
|
this.$refs.typeOptionForm.submitForm()
|
|
|
|
|
},
|
|
|
|
|
//type表通过
|
|
|
|
|
typeOptionOnSubmit() {
|
|
|
|
|
this.$refs.propertyForm.submitForm()
|
|
|
|
|
},
|
|
|
|
|
//可选属性表通过校验
|
|
|
|
|
propertyOnSubmit() {
|
|
|
|
|
//开始暂存
|
|
|
|
|
let tempDist = {
|
|
|
|
|
title: true,
|
|
|
|
|
row: true,
|
|
|
|
|
type: true,
|
|
|
|
|
required: true,
|
|
|
|
|
disabled: true,
|
2024-05-24 16:47:01 +08:00
|
|
|
|
width: true
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
let tempArr = []
|
|
|
|
|
let disabledWords = ['id', 'document_rule', 'document_rule_num', 'sorts', 'create_user_id', 'create_time', 'modify_user_id', 'modify_time', 'sts', 'org_id']
|
|
|
|
|
if (disabledWords.includes(this.optionRuleForm.enName)) {
|
|
|
|
|
this.$vmNews(`暂存失败,英文名${this.optionRuleForm.enName}不合法。`)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (this.optionRuleForm.type === 'datepick' || this.optionRuleForm.type === 'daterange') {
|
|
|
|
|
if (this.optionRuleForm.filedType != 4) {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.$vmNews('字段类型与数据类型不合法,请选择日期类型', 'warning')
|
2024-03-26 11:18:19 +08:00
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (this.optionRuleForm.filedType == 4) {
|
|
|
|
|
if (this.optionRuleForm.type !== 'datepick' && this.optionRuleForm.type !== 'daterange') {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.$vmNews('字段类型与数据类型不合法', 'warning')
|
2024-03-26 11:18:19 +08:00
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.$set(this.activedTableRow, 'chName', this.optionRuleForm.chName)
|
|
|
|
|
this.$set(this.activedTableRow, 'enName', this.optionRuleForm.enName)
|
|
|
|
|
this.$set(this.activedTableRow, 'filedType', this.optionRuleForm.filedType)
|
|
|
|
|
this.$set(this.activedTableRow, 'filedLength', this.optionRuleForm.filedLength)
|
|
|
|
|
this.optionFormRow.forEach(item => {
|
|
|
|
|
if (tempDist[item.elCol[0].id]) {
|
|
|
|
|
tempArr.push({
|
|
|
|
|
ruleName: item.elCol[0].title,
|
|
|
|
|
ruleCode: item.elCol[0].id,
|
|
|
|
|
ruleValue: this.optionRuleForm[item.elCol[0].id],
|
|
|
|
|
ruleType: 2,
|
2024-05-24 16:47:01 +08:00
|
|
|
|
formName: 'optionRuleForm'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.typeOptionFormRow.forEach(item => {
|
|
|
|
|
tempArr.push({
|
|
|
|
|
ruleName: item.elCol[0].title,
|
|
|
|
|
ruleCode: item.elCol[0].id,
|
|
|
|
|
ruleValue: this.typeOptionRuleForm[item.elCol[0].id],
|
|
|
|
|
ruleType: 2,
|
2024-05-24 16:47:01 +08:00
|
|
|
|
formName: 'typeOptionRuleForm'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
this.propertyFormRow.forEach(item => {
|
|
|
|
|
tempArr.push({
|
|
|
|
|
ruleName: item.elCol[0].title,
|
|
|
|
|
ruleCode: item.elCol[0].id,
|
|
|
|
|
ruleValue: this.propertyRuleForm[item.elCol[0].id],
|
|
|
|
|
ruleType: 2,
|
2024-05-24 16:47:01 +08:00
|
|
|
|
formName: 'propertyRuleForm'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
this.activedTableRow.mdmModuleDbFiledsRules = tempArr
|
|
|
|
|
},
|
|
|
|
|
// 保存
|
|
|
|
|
async saveHandle() {
|
2024-05-28 14:42:19 +08:00
|
|
|
|
console.log(this.mainTableData)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
//判断认证规则
|
|
|
|
|
if (!this.receiptsShowTableData.length) {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.$vmNews('单据规则不能为空', 'warning')
|
2024-03-26 11:18:19 +08:00
|
|
|
|
return
|
|
|
|
|
}
|
2024-05-24 16:47:01 +08:00
|
|
|
|
let flag = this.mainTableData.some((mainItem, index) => {
|
2024-03-26 11:18:19 +08:00
|
|
|
|
if (!mainItem.dbName) {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.$vmNews(`数据表第${index + 1}行的英文名不能为空`, 'warning')
|
2024-03-26 11:18:19 +08:00
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
return mainItem.sublistMdmModuleDbFileds.some((item, index02) => {
|
|
|
|
|
if (!item.chName) {
|
|
|
|
|
this.$vmNews(`数据表第${index + 1}行表中的${index02 + 1}行表字段数据填写不全`, 'warning')
|
2024-05-27 11:24:30 +08:00
|
|
|
|
return true
|
|
|
|
|
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
2024-05-24 16:47:01 +08:00
|
|
|
|
if (flag) return
|
2024-03-26 11:18:19 +08:00
|
|
|
|
this.saveLoading = true
|
|
|
|
|
let params = {
|
|
|
|
|
id: this.$route.query.id,
|
|
|
|
|
mainMdmModuleDb: this.mainTableData[0],
|
|
|
|
|
sublistMdmModuleDb: [],
|
2024-05-24 16:47:01 +08:00
|
|
|
|
mdmTableCodeRuleEntityList: this.receiptsShowTableData
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
this.mainTableData.forEach((item, index) => {
|
|
|
|
|
if (index > 0) {
|
|
|
|
|
params.sublistMdmModuleDb.push(item)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
const res = await getApiModuleApi({
|
2024-05-24 16:47:01 +08:00
|
|
|
|
tl: 'mdmService',
|
|
|
|
|
as: 'mdmService',
|
|
|
|
|
dj: 'saveMdmModuleDb'
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}, params)
|
|
|
|
|
if (res.status === '200') {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.$vmNews('保存成功!', 'success')
|
2024-03-26 11:18:19 +08:00
|
|
|
|
this.init()
|
|
|
|
|
}
|
|
|
|
|
this.saveLoading = false
|
|
|
|
|
},
|
|
|
|
|
// 主表按钮
|
|
|
|
|
mainOnFunc(row, item) {
|
|
|
|
|
if (!row.newFlag) {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.$vmNews('此行不允许删除', 'warning')
|
2024-03-26 11:18:19 +08:00
|
|
|
|
return
|
|
|
|
|
}
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.$confirm('确定删除?')
|
2024-03-26 11:18:19 +08:00
|
|
|
|
.then((_) => {
|
|
|
|
|
this.mainTableData.splice(row.index, 1)
|
|
|
|
|
})
|
|
|
|
|
.catch((_) => {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
})
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
//选中表按钮
|
|
|
|
|
activedOnFunc(row) {
|
|
|
|
|
if (!row.newFlag) {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.$vmNews('此行不允许删除', 'warning')
|
2024-03-26 11:18:19 +08:00
|
|
|
|
return
|
|
|
|
|
}
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.$confirm('确定删除?')
|
2024-03-26 11:18:19 +08:00
|
|
|
|
.then((_) => {
|
|
|
|
|
this.activedTableData.splice(row.index, 1)
|
|
|
|
|
})
|
|
|
|
|
.catch((_) => {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
})
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
//规则表格删除
|
|
|
|
|
receiptsOnFunc(row) {
|
|
|
|
|
this.receiptsTableData.splice(row.index, 1)
|
|
|
|
|
},
|
|
|
|
|
//规则表提交
|
|
|
|
|
receiptsConfirm() {
|
|
|
|
|
let type = false
|
|
|
|
|
let flag = this.receiptsTableData.some((item, index) => {
|
|
|
|
|
if (!item.dbType || !item.dbValue) {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.$vmNews(`请选择${index + 1}行的类型并填写或选择规则`, 'warning')
|
2024-03-26 11:18:19 +08:00
|
|
|
|
return true
|
|
|
|
|
} else if (item.dbType === '4' && index + 1 !== this.receiptsTableData.length) {
|
|
|
|
|
type = true
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.$vmNews(`流水号只允许在最后一行`, 'warning')
|
2024-03-26 11:18:19 +08:00
|
|
|
|
return true
|
|
|
|
|
} else if (item.dbType === '4') {
|
|
|
|
|
type = true
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if (!type) {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.$vmNews(`请添加流水号`, 'warning')
|
|
|
|
|
return
|
2024-03-26 11:18:19 +08:00
|
|
|
|
}
|
|
|
|
|
if (flag) return
|
|
|
|
|
|
|
|
|
|
this.receiptsShow = false
|
|
|
|
|
this.receiptsShowTableData = deepClone(this.receiptsTableData)
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
//主表添加按钮
|
|
|
|
|
addMainAddRow() {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.mainTableData.push({
|
|
|
|
|
'dbName': ``,
|
|
|
|
|
'dbType': '2',
|
|
|
|
|
'remark': '',
|
|
|
|
|
sublistMdmModuleDbFileds: [],
|
|
|
|
|
newFlag: true
|
|
|
|
|
})
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
//选中表添加按钮
|
|
|
|
|
activedAddRow() {
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.activedTableData.push({ newFlag: true, disabled: false, required: false })
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
//表单输入框失焦事件(为了让中文名称可以给显示名)
|
|
|
|
|
optionFormInputBlur(id, row) {
|
|
|
|
|
if (id === 'chName' && !row.title) {
|
|
|
|
|
this.$set(row, 'title', row['chName'])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
components: {
|
|
|
|
|
baseNewForm,
|
|
|
|
|
BaseTable,
|
|
|
|
|
baseDialog
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.initSelect()
|
|
|
|
|
this.init()
|
2024-05-24 16:47:01 +08:00
|
|
|
|
this.$emit('flashActive', 1)
|
2024-03-26 11:18:19 +08:00
|
|
|
|
},
|
|
|
|
|
watch: {},
|
|
|
|
|
computed: {
|
|
|
|
|
labelOptionsAuto() {
|
|
|
|
|
return this.labelOptions
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-05-24 16:47:01 +08:00
|
|
|
|
}
|
2024-03-26 11:18:19 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
::v-deep .el-button {
|
|
|
|
|
border-radius: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep .el-form-item {
|
|
|
|
|
display: block !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.wrap {
|
|
|
|
|
background-color: #fbfbfb;
|
|
|
|
|
width: 100%;
|
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
|
|
> .btn {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
|
|
|
|
|
> .chunk {
|
|
|
|
|
margin-left: 10px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .main {
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
|
|
> .left {
|
|
|
|
|
flex: 0.75;
|
|
|
|
|
height: 85vh;
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
padding: 0 15px;
|
|
|
|
|
overflow: auto;
|
|
|
|
|
|
|
|
|
|
> .title {
|
|
|
|
|
color: #000;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
margin: 20px 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .receipts {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
.receiptsList {
|
|
|
|
|
text-align: center;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
margin-left: 20px;
|
|
|
|
|
padding: 20px;
|
|
|
|
|
background-color: #fafafa;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
.receiptsItem {
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mainTable {
|
|
|
|
|
margin-top: 30px;
|
|
|
|
|
|
|
|
|
|
.mainAddRow {
|
|
|
|
|
margin-top: 30px;
|
|
|
|
|
border: 1px dotted #ccc;
|
|
|
|
|
text-align: center;
|
|
|
|
|
height: 50px;
|
|
|
|
|
line-height: 50px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.activedTable {
|
|
|
|
|
margin-top: 30px;
|
|
|
|
|
|
|
|
|
|
.mainAddRow {
|
|
|
|
|
margin-top: 30px;
|
|
|
|
|
border: 1px dotted #ccc;
|
|
|
|
|
text-align: center;
|
|
|
|
|
height: 50px;
|
|
|
|
|
line-height: 50px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .right {
|
|
|
|
|
flex: 0.25;
|
|
|
|
|
height: 85vh;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
padding: 0 10px;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
|
|
|
|
|
> .btn {
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .title {
|
|
|
|
|
color: #000;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
padding: 20px 0;
|
|
|
|
|
border-bottom: 1px solid #EBEBEB;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.optionForm {
|
|
|
|
|
margin: 30px 0;
|
|
|
|
|
height: 50vh;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .smtitle {
|
|
|
|
|
color: #000;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
padding: 20px 0;
|
|
|
|
|
border-top: 1px solid #EBEBEB;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.receiptsAddRow {
|
|
|
|
|
margin-top: 30px;
|
|
|
|
|
border: 1px dotted #ccc;
|
|
|
|
|
text-align: center;
|
|
|
|
|
height: 50px;
|
|
|
|
|
line-height: 50px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|