This commit is contained in:
1378012178@qq.com 2025-04-08 15:34:06 +08:00
commit 906e4c7318
13 changed files with 918 additions and 51 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 KiB

View File

@ -12,5 +12,7 @@ export enum PageEnum {
//文件路由
SYS_FILES_PATH = '/file/share',
// 邮件中的跳转地址
TOKEN_LOGIN = '/tokenLogin'
TOKEN_LOGIN = '/tokenLogin',
// h5白名单
H5_ADVISORYINFO = '/h5/advisoryInfo',
}

View File

@ -23,12 +23,13 @@ const SYS_FILES_PATH = PageEnum.SYS_FILES_PATH;
// 邮件中的跳转地址,对应此路由,携带token免登录直接去办理页面
const TOKEN_LOGIN = PageEnum.TOKEN_LOGIN;
const H5_ADVISORYINFO = PageEnum.H5_ADVISORYINFO;
const ROOT_PATH = RootRoute.path;
//update-begin---author:wangshuai ---date:20220629 for[issues/I5BG1I]vue3不支持auth2登录------------
//update-begin---author:wangshuai ---date:20221111 for: [VUEN-2472]分享免登录------------
const whitePathList: PageEnum[] = [LOGIN_PATH, OAUTH2_LOGIN_PAGE_PATH,SYS_FILES_PATH, TOKEN_LOGIN ];
const whitePathList: PageEnum[] = [LOGIN_PATH, OAUTH2_LOGIN_PAGE_PATH,SYS_FILES_PATH, TOKEN_LOGIN, H5_ADVISORYINFO ];
//update-end---author:wangshuai ---date:20221111 for: [VUEN-2472]分享免登录------------
//update-end---author:wangshuai ---date:20220629 for[issues/I5BG1I]vue3不支持auth2登录------------
@ -56,6 +57,7 @@ export function createPermissionGuard(router: Router) {
const token = userStore.getToken;
// Whitelist can be directly entered
console.log('whitePathList2222--->',whitePathList);
if (whitePathList.includes(to.path as PageEnum)) {
if (to.path === LOGIN_PATH && token) {
const isSessionTimeout = userStore.getSessionTimeout;
@ -98,6 +100,7 @@ export function createPermissionGuard(router: Router) {
//update-begin---author:wangshuai ---date:20220629 for[issues/I5BG1I]vue3 Auth2未实现------------
let path = LOGIN_PATH;
console.log('whitePathList--->',whitePathList);
if (whitePathList.includes(to.path as PageEnum)) {
// 在免登录白名单如果进入的页面是login页面并且当前是OAuth2app环境就进入OAuth2登录页面
if (to.path === LOGIN_PATH && isOAuth2AppEnv()) {

View File

@ -64,5 +64,15 @@ export const TokenLoginRoute: AppRouteRecordRaw = {
ignoreAuth: true,
},
};
//h5页面首页
export const H5_ADVISORYINFO: AppRouteRecordRaw = {
path: '/h5/advisoryInfo',
name: 'advisoryInfo',
component: () => import('/@/views/biz/NuBizAdvisoryInfo/h5/NuBizAdvisoryInfoList.vue'),
meta: {
title: "选择入住",
},
};
// Basic routing without permission
export const basicRoutes = [LoginRoute, RootRoute, ...mainOutRoutes, REDIRECT_ROUTE, PAGE_NOT_FOUND_ROUTE, TokenLoginRoute, Oauth2LoginRoute];
export const basicRoutes = [LoginRoute, RootRoute, ...mainOutRoutes, REDIRECT_ROUTE, PAGE_NOT_FOUND_ROUTE, TokenLoginRoute, Oauth2LoginRoute,H5_ADVISORYINFO];

View File

@ -0,0 +1,113 @@
<template>
<view>
<!--标题和返回-->
<cu-custom :bgColor="NavBarColor" isBack :backRouterName="backRouteName">
<block slot="backText">返回</block>
<block slot="content">咨询信息</block>
</cu-custom>
<!--表单区域-->
<view>
<form>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">咨询人姓名</text></view>
<input placeholder="请输入咨询人姓名" v-model="model.name"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">性别</text></view>
<input placeholder="请输入性别" v-model="model.sex"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">联系电话</text></view>
<input placeholder="请输入联系电话" v-model="model.tel"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">咨询类型 1入住nu 2入驻机构 3我要加盟</text></view>
<input placeholder="请输入咨询类型 1入住nu 2入驻机构 3我要加盟" v-model="model.advisoryType"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">状态 1审核中 2审核完成 3驳回</text></view>
<input placeholder="请输入状态 1审核中 2审核完成 3驳回" v-model="model.status"/>
</view>
</view>
<view class="cu-form-group">
<view class="flex align-center">
<view class="title"><text space="ensp">审核备注</text></view>
<input placeholder="请输入审核备注" v-model="model.content"/>
</view>
</view>
<view class="padding">
<button class="cu-btn block bg-blue margin-tb-sm lg" @click="onSubmit">
<text v-if="loading" class="cuIcon-loading2 cuIconfont-spin"></text>提交
</button>
</view>
</form>
</view>
</view>
</template>
<script>
// import myDate from '@/components/my-componets/my-date.vue'
export default {
name: "NuBizAdvisoryInfoForm",
// components:{ myDate },
props:{
formData:{
type:Object,
default:()=>{},
required:false
}
},
data(){
return {
CustomBar: this.CustomBar,
NavBarColor: this.NavBarColor,
loading:false,
model: {},
backRouteName:'index',
url: {
queryById: "/NuBizAdvisoryInfo/nuBizAdvisoryInfo/queryById",
add: "/NuBizAdvisoryInfo/nuBizAdvisoryInfo/add",
edit: "/NuBizAdvisoryInfo/nuBizAdvisoryInfo/edit",
},
}
},
created(){
this.initFormData();
},
methods:{
initFormData(){
if(this.formData){
let dataId = this.formData.dataId;
this.$http.get(this.url.queryById,{params:{id:dataId}}).then((res)=>{
if(res.data.success){
console.log("表单数据",res);
this.model = res.data.result;
}
})
}
},
onSubmit() {
let myForm = {...this.model};
this.loading = true;
let url = myForm.id?this.url.edit:this.url.add;
this.$http.post(url,myForm).then(res=>{
console.log("res",res)
this.loading = false
this.$Router.push({name:this.backRouteName})
}).catch(()=>{
this.loading = false
});
}
}
}
</script>

View File

@ -0,0 +1,93 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer >
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="NuBizAdvisoryInfoForm">
<a-row>
<a-col :span="24">
<a-form-item label="选择机构" v-bind="validateInfos.sysOrgCode" id="NuBizAdvisoryInfoForm-sysOrgCode" name="sysOrgCode">
<j-dict-select-tag type='radio' v-model:value="formData.sysOrgCode" dictCode="advisory_type" placeholder="请选择机构" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="咨询类型" v-bind="validateInfos.advisoryType" id="NuBizAdvisoryInfoForm-advisoryType" name="advisoryType">
<j-dict-select-tag type='radio' v-model:value="formData.advisoryType" dictCode="advisory_type" placeholder="请选择咨询类型" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="咨询人姓名" v-bind="validateInfos.name" id="NuBizAdvisoryInfoForm-name" name="name">
<a-input v-model:value="formData.name" placeholder="请输入咨询人姓名" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="性别" v-bind="validateInfos.sex" id="NuBizAdvisoryInfoForm-sex" name="sex">
<j-dict-select-tag type='radio' v-model:value="formData.sex" dictCode="sex" placeholder="请选择性别" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="联系电话" v-bind="validateInfos.tel" id="NuBizAdvisoryInfoForm-tel" name="tel">
<a-input v-model:value="formData.tel" placeholder="请输入联系电话" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24" style="text-align: center;">
<a-button type="primary">提交</a-button>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { getValueType } from '/@/utils';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => ({})},
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
name: '',
sex: '1',
sysOrgCode: '',
tel: '',
advisoryType: '1',
status: '1',
content: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = reactive({
name: [{ required: true, message: '请输入姓名!' }],
sysOrgCode: [{ required: true, message: '请选择入住机构!' }],
advisoryType: [{ required: true, message: '请选择咨询类型!' }],
tel: [{ required: true, message: '请输入联系电话!' }],
sex: [{ required: true, message: '请选择性别!' }],
});
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
onMounted(() => {
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 14px;
}
</style>

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/NuBizAdvisoryInfo/nuBizAdvisoryInfo/list',
save='/NuBizAdvisoryInfo/nuBizAdvisoryInfo/add',
edit='/NuBizAdvisoryInfo/nuBizAdvisoryInfo/edit',
deleteOne = '/NuBizAdvisoryInfo/nuBizAdvisoryInfo/delete',
deleteBatch = '/NuBizAdvisoryInfo/nuBizAdvisoryInfo/deleteBatch',
importExcel = '/NuBizAdvisoryInfo/nuBizAdvisoryInfo/importExcel',
exportXls = '/NuBizAdvisoryInfo/nuBizAdvisoryInfo/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
*
* @param params
* @param handleSuccess
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
* @param handleSuccess
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
* @param isUpdate
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}

View File

@ -0,0 +1,48 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '咨询人姓名',
align: "center",
dataIndex: 'name'
},
{
title: '性别',
align: "center",
dataIndex: 'sex_dictText'
},
{
title: '联系电话',
align: "center",
dataIndex: 'tel'
},
{
title: '咨询类型',
align: "center",
dataIndex: 'advisoryType_dictText'
},
{
title: '状态',
align: "center",
dataIndex: 'status_dictText'
},
{
title: '审核备注',
align: "center",
dataIndex: 'content'
},
];
// 高级查询数据
export const superQuerySchema = {
name: {title: '咨询人姓名',order: 0,view: 'text', type: 'string',},
sex: {title: '性别',order: 1,view: 'radio', type: 'string',dictCode: 'sex',},
tel: {title: '联系电话',order: 2,view: 'text', type: 'string',},
advisoryType: {title: '咨询类型',order: 3,view: 'radio', type: 'string',dictCode: 'advisory_type',},
status: {title: '状态',order: 4,view: 'radio', type: 'string',dictCode: 'advisory_approval',},
content: {title: '审核备注',order: 5,view: 'textarea', type: 'string',},
};

View File

@ -0,0 +1,255 @@
<template>
<div class="p-2">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="name">
<template #label><span title="咨询人姓名">咨询人姓</span></template>
<a-input placeholder="请输入咨询人姓名" v-model:value="queryParam.name" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="tel">
<template #label><span title="联系电话">联系电话</span></template>
<a-input placeholder="请输入联系电话" v-model:value="queryParam.tel" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="advisoryType">
<template #label><span title="咨询类型">咨询类型</span></template>
<j-select-multiple placeholder="请选择咨询类型" v-model:value="queryParam.advisoryType" dictCode="advisory_type" allow-clear />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="status">
<template #label><span title="状态">状态</span></template>
<j-select-multiple placeholder="请选择状态" v-model:value="queryParam.status" dictCode="advisory_approval" allow-clear />
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
<a-button type="primary" v-auth="'NuBizAdvisoryInfo:nu_biz_advisory_info:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls" style="margin-left: 8px"> 导出</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable" >
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="'NuBizAdvisoryInfo:nu_biz_advisory_info:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<j-upload-button type="primary" v-auth="'NuBizAdvisoryInfo:nu_biz_advisory_info:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<NuBizAdvisoryInfoModal ref="registerModal" @success="handleSuccess"></NuBizAdvisoryInfoModal>
</div>
</template>
<script lang="ts" name="NuBizAdvisoryInfo-nuBizAdvisoryInfo" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './NuBizAdvisoryInfo.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuBizAdvisoryInfo.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import NuBizAdvisoryInfoModal from './components/NuBizAdvisoryInfoModal.vue'
import { useUserStore } from '/@/store/modules/user';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '咨询信息',
api: list,
columns,
canResize:false,
useSearchForm: false,
showIndexColumn: true,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: "咨询信息",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs:24,
sm:4,
xl:6,
xxl:4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
//
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
searchQuery();
}
/**
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'NuBizAdvisoryInfo:nu_biz_advisory_info:edit'
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'NuBizAdvisoryInfo:nu_biz_advisory_info:delete'
}
]
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust{
min-width: 100px !important;
}
.query-group-split-cust{
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help){
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
}
</style>

View File

@ -0,0 +1,176 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer :disabled="disabled">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="NuBizAdvisoryInfoForm">
<a-row>
<a-col :span="24">
<a-form-item label="咨询人姓名" v-bind="validateInfos.name" id="NuBizAdvisoryInfoForm-name" name="name">
<a-input v-model:value="formData.name" placeholder="请输入咨询人姓名" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="性别" v-bind="validateInfos.sex" id="NuBizAdvisoryInfoForm-sex" name="sex">
<j-dict-select-tag type='radio' v-model:value="formData.sex" dictCode="sex" placeholder="请选择性别" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="联系电话" v-bind="validateInfos.tel" id="NuBizAdvisoryInfoForm-tel" name="tel">
<a-input v-model:value="formData.tel" placeholder="请输入联系电话" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="咨询类型 1入住nu 2入驻机构 3我要加盟" v-bind="validateInfos.advisoryType" id="NuBizAdvisoryInfoForm-advisoryType" name="advisoryType">
<j-dict-select-tag type='radio' v-model:value="formData.advisoryType" dictCode="advisory_type" placeholder="请选择咨询类型 1入住nu 2入驻机构 3我要加盟" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="状态 1审核中 2审核完成 3驳回" v-bind="validateInfos.status" id="NuBizAdvisoryInfoForm-status" name="status">
<j-dict-select-tag type='radio' v-model:value="formData.status" dictCode="advisory_approval" placeholder="请选择状态 1审核中 2审核完成 3驳回" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="审核备注" v-bind="validateInfos.content" id="NuBizAdvisoryInfoForm-content" name="content">
<a-textarea v-model:value="formData.content" :rows="4" placeholder="请输入审核备注" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../NuBizAdvisoryInfo.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => ({})},
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
name: '',
sex: '',
tel: '',
advisoryType: '',
status: '',
content: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = reactive({
});
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
//
const disabled = computed(()=>{
if(props.formBpm === true){
if(props.formData.disabled === false){
return false;
}else{
return true;
}
}
return props.formDisabled;
});
/**
* 新增
*/
function add() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
const tmpData = {};
Object.keys(formData).forEach((key) => {
if(record.hasOwnProperty(key)){
tmpData[key] = record[key]
}
})
//
Object.assign(formData, tmpData);
});
}
/**
* 提交数据
*/
async function submitForm() {
try {
//
await validate();
} catch ({ errorFields }) {
if (errorFields) {
const firstField = errorFields[0];
if (firstField) {
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(errorFields);
}
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
}
await saveOrUpdate(model, isUpdate.value)
.then((res) => {
if (res.success) {
createMessage.success(res.message);
emit('ok');
} else {
createMessage.warning(res.message);
}
})
.finally(() => {
confirmLoading.value = false;
});
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 14px;
}
</style>

View File

@ -0,0 +1,77 @@
<template>
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<NuBizAdvisoryInfoForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuBizAdvisoryInfoForm>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import NuBizAdvisoryInfoForm from './NuBizAdvisoryInfoForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add() {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add();
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -7,7 +7,7 @@
<BasicTable @register="registerTable" >
<!--插槽:table标题-->
<template #tableTitle>
可选服务标签
<div class="title1Class">可选服务标签</div>
</template>
<!--操作栏-->
<template #action="{ record }">
@ -19,7 +19,7 @@
</BasicTable>
</div>
<div style="padding: 8px;">
<div>已选服务标签</div>
<div class="title1Class">已选服务标签</div>
<a-table :dataSource="employeesDataSource" :columns="employeesTagcolumns" style="margin-top:8px;" bordered size="small" :pagination="false">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'" >
@ -203,4 +203,8 @@ import { defHttp } from '/@/utils/http/axios';
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
.title1Class{
// background-image: url(../../../../../public/resource/img/titleBackground1.jpg);
// width: 100px;
}
</style>

View File

@ -14,12 +14,12 @@ export const columns: BasicColumn[] = [
dataIndex: 'realname',
width: 100,
},
{
title: '头像',
dataIndex: 'avatar',
width: 120,
customRender: render.renderAvatar,
},
// {
// title: '头像',
// dataIndex: 'avatar',
// width: 120,
// customRender: render.renderAvatar,
// },
{
title: '性别',
dataIndex: 'sex',
@ -34,10 +34,15 @@ export const columns: BasicColumn[] = [
dataIndex: 'phone',
width: 100,
},
// {
// title: '部门',
// width: 150,
// dataIndex: 'orgCodeTxt',
// },
{
title: '部门',
title: '可登录类型',
width: 150,
dataIndex: 'orgCodeTxt',
dataIndex: 'loginType_dictText',
},
{
title: '状态',
@ -193,37 +198,37 @@ export const formSchema: FormSchema[] = [
immediate: false,
},
},
{
label: '所属部门',
field: 'selecteddeparts',
component: 'JSelectDept',
componentProps: ({ formActionType, formModel }) => {
return {
sync: false,
checkStrictly: true,
defaultExpandLevel: 2,
// {
// label: '所属部门',
// field: 'selecteddeparts',
// component: 'JSelectDept',
// componentProps: ({ formActionType, formModel }) => {
// return {
// sync: false,
// checkStrictly: true,
// defaultExpandLevel: 2,
onSelect: (options, values) => {
const { updateSchema } = formActionType;
//所属部门修改后更新负责部门下拉框数据
updateSchema([
{
field: 'departIds',
componentProps: { options },
},
]);
//update-begin---author:wangshuai---date:2024-05-11---for:【issues/1222】用户编辑界面“所属部门”与“负责部门”联动出错整---
if(!values){
formModel.departIds = [];
return;
}
//update-end---author:wangshuai---date:2024-05-11---for:【issues/1222】用户编辑界面“所属部门”与“负责部门”联动出错整---
//所属部门修改后更新负责部门数据
formModel.departIds && (formModel.departIds = formModel.departIds.filter((item) => values.value.indexOf(item) > -1));
},
};
},
},
// onSelect: (options, values) => {
// const { updateSchema } = formActionType;
// //所属部门修改后更新负责部门下拉框数据
// updateSchema([
// {
// field: 'departIds',
// componentProps: { options },
// },
// ]);
// //update-begin---author:wangshuai---date:2024-05-11---for:【issues/1222】用户编辑界面“所属部门”与“负责部门”联动出错整---
// if(!values){
// formModel.departIds = [];
// return;
// }
// //update-end---author:wangshuai---date:2024-05-11---for:【issues/1222】用户编辑界面“所属部门”与“负责部门”联动出错整---
// //所属部门修改后更新负责部门数据
// formModel.departIds && (formModel.departIds = formModel.departIds.filter((item) => values.value.indexOf(item) > -1));
// },
// };
// },
// },
{
label: '租户',
field: 'relTenantIds',
@ -266,14 +271,14 @@ export const formSchema: FormSchema[] = [
// ifShow: ({ values }) => values.userIdentity == 2,
ifShow: false,
},
{
label: '头像',
field: 'avatar',
component: 'JImageUpload',
componentProps: {
fileMax: 1,
},
},
// {
// label: '头像',
// field: 'avatar',
// component: 'JImageUpload',
// componentProps: {
// fileMax: 1,
// },
// },
{
label: '生日',
field: 'birthday',
@ -290,6 +295,15 @@ export const formSchema: FormSchema[] = [
stringToNumber: true,
},
},
{
label: '可登录类型',
field: 'loginType',
required: false,
component: 'JSelectMultiple',
componentProps: {
dictCode: 'login_type',
},
},
{
label: '手机号码',
field: 'phone',