添加咨询页面
This commit is contained in:
parent
ee2c7a6738
commit
6e27d9d5d4
|
|
@ -12,5 +12,8 @@ export enum PageEnum {
|
||||||
//文件路由
|
//文件路由
|
||||||
SYS_FILES_PATH = '/file/share',
|
SYS_FILES_PATH = '/file/share',
|
||||||
// 邮件中的跳转地址
|
// 邮件中的跳转地址
|
||||||
TOKEN_LOGIN = '/tokenLogin'
|
TOKEN_LOGIN = '/tokenLogin',
|
||||||
|
|
||||||
|
// h5白名单
|
||||||
|
orgAdvisoryInfo = '/zh/orgAdvisory/OrgAdvisoryInfo'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,12 +23,13 @@ const SYS_FILES_PATH = PageEnum.SYS_FILES_PATH;
|
||||||
|
|
||||||
// 邮件中的跳转地址,对应此路由,携带token免登录直接去办理页面
|
// 邮件中的跳转地址,对应此路由,携带token免登录直接去办理页面
|
||||||
const TOKEN_LOGIN = PageEnum.TOKEN_LOGIN;
|
const TOKEN_LOGIN = PageEnum.TOKEN_LOGIN;
|
||||||
|
const orgAdvisoryInfo = PageEnum.orgAdvisoryInfo;
|
||||||
|
|
||||||
const ROOT_PATH = RootRoute.path;
|
const ROOT_PATH = RootRoute.path;
|
||||||
|
|
||||||
//update-begin---author:wangshuai ---date:20220629 for:[issues/I5BG1I]vue3不支持auth2登录------------
|
//update-begin---author:wangshuai ---date:20220629 for:[issues/I5BG1I]vue3不支持auth2登录------------
|
||||||
//update-begin---author:wangshuai ---date:20221111 for: [VUEN-2472]分享免登录------------
|
//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,orgAdvisoryInfo ];
|
||||||
//update-end---author:wangshuai ---date:20221111 for: [VUEN-2472]分享免登录------------
|
//update-end---author:wangshuai ---date:20221111 for: [VUEN-2472]分享免登录------------
|
||||||
//update-end---author:wangshuai ---date:20220629 for:[issues/I5BG1I]vue3不支持auth2登录------------
|
//update-end---author:wangshuai ---date:20220629 for:[issues/I5BG1I]vue3不支持auth2登录------------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -74,5 +74,13 @@ export const newScreenRoute: AppRouteRecordRaw = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const orgAdvisoryInfo: AppRouteRecordRaw = {
|
||||||
|
path: '/zh/orgAdvisory/OrgAdvisoryInfo',
|
||||||
|
name: 'orgAdvisoryInfo',
|
||||||
|
component: () => import('/@/views/zh/orgAdvisory/OrgAdvisoryInfo.vue'),
|
||||||
|
meta: {
|
||||||
|
title: '加盟咨询',
|
||||||
|
},
|
||||||
|
};
|
||||||
// Basic routing without permission
|
// Basic routing without permission
|
||||||
export const basicRoutes = [LoginRoute, RootRoute, ...mainOutRoutes, REDIRECT_ROUTE, PAGE_NOT_FOUND_ROUTE, TokenLoginRoute, Oauth2LoginRoute,newScreenRoute];
|
export const basicRoutes = [LoginRoute, RootRoute, ...mainOutRoutes, REDIRECT_ROUTE, PAGE_NOT_FOUND_ROUTE, TokenLoginRoute, Oauth2LoginRoute,newScreenRoute,orgAdvisoryInfo];
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
import $ from 'jquery'
|
|
||||||
const cancelFrame = window.cancelAnimationFrame || window.cancelRequestAnimationFrame;
|
const cancelFrame = window.cancelAnimationFrame || window.cancelRequestAnimationFrame;
|
||||||
const requestFrame = window.requestAnimationFrame;
|
const requestFrame = window.requestAnimationFrame;
|
||||||
export let NumTile = "";
|
export let NumTile = "";
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
|
import { useMessage } from "/@/hooks/web/useMessage";
|
||||||
|
|
||||||
|
const { createConfirm } = useMessage();
|
||||||
|
|
||||||
|
enum Api {
|
||||||
|
list = '/orgAdvisory/blOrgAdvisory/list',
|
||||||
|
save='/orgAdvisory/blOrgAdvisory/add',
|
||||||
|
edit='/orgAdvisory/blOrgAdvisory/edit',
|
||||||
|
deleteOne = '/orgAdvisory/blOrgAdvisory/delete',
|
||||||
|
deleteBatch = '/orgAdvisory/blOrgAdvisory/deleteBatch',
|
||||||
|
importExcel = '/orgAdvisory/blOrgAdvisory/importExcel',
|
||||||
|
exportXls = '/orgAdvisory/blOrgAdvisory/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 });
|
||||||
|
}
|
||||||
|
|
@ -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'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '电话',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'tel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '职业',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'vocational'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '家庭住址',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'address'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '备注',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'content'
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
// 高级查询数据
|
||||||
|
export const superQuerySchema = {
|
||||||
|
name: {title: '姓名',order: 0,view: 'text', type: 'string',},
|
||||||
|
sex: {title: '性别',order: 1,view: 'text', type: 'string',},
|
||||||
|
tel: {title: '电话',order: 2,view: 'text', type: 'string',},
|
||||||
|
vocational: {title: '职业',order: 3,view: 'text', type: 'string',},
|
||||||
|
address: {title: '家庭住址',order: 4,view: 'textarea', type: 'string',},
|
||||||
|
content: {title: '备注',order: 5,view: 'textarea', type: 'string',},
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,236 @@
|
||||||
|
<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-row>
|
||||||
|
</a-form>
|
||||||
|
</div> -->
|
||||||
|
<!--引用表格-->
|
||||||
|
<BasicTable @register="registerTable" >
|
||||||
|
<!--插槽:table标题-->
|
||||||
|
<template #tableTitle>
|
||||||
|
<!-- <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button> -->
|
||||||
|
<!-- <a-button type="primary" v-auth="'orgAdvisory:bl_org_advisory:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||||
|
<j-upload-button type="primary" v-auth="'orgAdvisory:bl_org_advisory:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button> -->
|
||||||
|
<!-- <a-dropdown v-if="selectedRowKeys.length > 0">
|
||||||
|
<template #overlay>
|
||||||
|
<a-menu>
|
||||||
|
<a-menu-item key="1" @click="batchHandleDelete">
|
||||||
|
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||||
|
删除
|
||||||
|
</a-menu-item>
|
||||||
|
</a-menu>
|
||||||
|
</template>
|
||||||
|
<a-button v-auth="'orgAdvisory:bl_org_advisory:deleteBatch'">批量操作
|
||||||
|
<Icon icon="mdi:chevron-down"></Icon>
|
||||||
|
</a-button>
|
||||||
|
</a-dropdown> -->
|
||||||
|
<!-- 高级查询 -->
|
||||||
|
<!-- <super-query :config="superQueryConfig" @search="handleSuperQuery" /> -->
|
||||||
|
</template>
|
||||||
|
<!--操作栏-->
|
||||||
|
<template #action="{ record }">
|
||||||
|
<TableAction :actions="getTableAction(record)" />
|
||||||
|
</template>
|
||||||
|
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
<!-- 表单区域 -->
|
||||||
|
<BlOrgAdvisoryModal ref="registerModal" @success="handleSuccess"></BlOrgAdvisoryModal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" name="orgAdvisory-blOrgAdvisory" setup>
|
||||||
|
import { ref, reactive } from 'vue';
|
||||||
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||||
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
|
import { columns, superQuerySchema } from './BlOrgAdvisory.data';
|
||||||
|
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './BlOrgAdvisory.api';
|
||||||
|
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||||
|
import BlOrgAdvisoryModal from './components/BlOrgAdvisoryModal.vue'
|
||||||
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
|
|
||||||
|
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: 'orgAdvisory:bl_org_advisory:edit'
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下拉操作栏
|
||||||
|
*/
|
||||||
|
function getDropDownAction(record) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: '详情',
|
||||||
|
onClick: handleDetail.bind(null, record),
|
||||||
|
}, {
|
||||||
|
label: '删除',
|
||||||
|
popConfirm: {
|
||||||
|
title: '是否确认删除',
|
||||||
|
confirm: handleDelete.bind(null, record),
|
||||||
|
placement: 'topLeft',
|
||||||
|
},
|
||||||
|
auth: 'orgAdvisory:bl_org_advisory: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>
|
||||||
|
|
@ -0,0 +1,292 @@
|
||||||
|
<template>
|
||||||
|
<div class="p-2 backClass" v-if="status == 1">
|
||||||
|
<img src="./img/beijing.png" alt="" class="img-bg" />
|
||||||
|
<div class="conten">
|
||||||
|
<div class="userinfo">
|
||||||
|
<div class="tit">个人资料填写</div>
|
||||||
|
<div class="con">
|
||||||
|
<div class="let">姓名</div>
|
||||||
|
<div class="rit">
|
||||||
|
<a-input v-model:value="formData.name" placeholder="请输入姓名" allow-clear ></a-input>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="con">
|
||||||
|
<div class="let">性别</div>
|
||||||
|
<div class="rit">
|
||||||
|
<a-radio-group v-model:value="formData.sex">
|
||||||
|
<a-radio :value="`男`">
|
||||||
|
男
|
||||||
|
</a-radio>
|
||||||
|
<a-radio :value="`女`">
|
||||||
|
女
|
||||||
|
</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="con">
|
||||||
|
<div class="let">电话</div>
|
||||||
|
<div class="rit">
|
||||||
|
<a-input v-model:value="formData.tel" placeholder="请输入电话" allow-clear ></a-input>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="con">
|
||||||
|
<div class="let">职业</div>
|
||||||
|
<div class="rit">
|
||||||
|
<a-input v-model:value="formData.vocational" placeholder="请输入职业" allow-clear ></a-input>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="con" style="border:none">
|
||||||
|
<div class="let">地址</div>
|
||||||
|
<div class="rit">
|
||||||
|
<a-input v-model:value="formData.address" placeholder="请输入地址" allow-clear ></a-input>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<img src="./img/a1.png" alt="" class="img-bgr" />
|
||||||
|
|
||||||
|
<div class="submit-btn" @click="submit">
|
||||||
|
<img src="./img/a2.png" alt="" class="img-bgr" />
|
||||||
|
<div>确定</div>
|
||||||
|
</div
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="status == 2">
|
||||||
|
<div>
|
||||||
|
<img src="./img/a3.png" alt="" class="img-bgr" />
|
||||||
|
</div>
|
||||||
|
<div style="text-align: center;">
|
||||||
|
提交成功,{{timeBack}}秒后返回主页
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" name="orgAdvisory-blOrgAdvisory" setup>
|
||||||
|
import { ref, reactive } from 'vue';
|
||||||
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
import { def } from 'node_modules/@vue/shared/dist/shared';
|
||||||
|
const gender = ref('1');
|
||||||
|
const { createMessage } = useMessage();
|
||||||
|
|
||||||
|
const status = ref(1);
|
||||||
|
const timeBack = ref(3);
|
||||||
|
const formData = reactive<Record<string, any>>({
|
||||||
|
id: '',
|
||||||
|
name: '',
|
||||||
|
sex: '男',
|
||||||
|
tel: '',
|
||||||
|
vocational: '',
|
||||||
|
address: '',
|
||||||
|
});
|
||||||
|
const type = ref(null);
|
||||||
|
function submit(){
|
||||||
|
console.log(formData)
|
||||||
|
if(!formData.name){
|
||||||
|
createMessage.warning('请填写姓名');
|
||||||
|
return;
|
||||||
|
}else if(!formData.sex){
|
||||||
|
createMessage.warning('请选择性别');
|
||||||
|
return;
|
||||||
|
}else if(!formData.tel){
|
||||||
|
createMessage.warning('请填写电话');
|
||||||
|
return;
|
||||||
|
}else if(!formData.vocational){
|
||||||
|
createMessage.warning('请填写职业');
|
||||||
|
return;
|
||||||
|
}else if(!formData.address){
|
||||||
|
createMessage.warning('请填写地址');
|
||||||
|
}
|
||||||
|
defHttp.post({
|
||||||
|
url: '/orgAdvisory/blOrgAdvisory/add',
|
||||||
|
data: formData,
|
||||||
|
}).then((res) => {
|
||||||
|
console.log("🚀 ~ submit ~ res:", res)
|
||||||
|
timeBack.value = 3;
|
||||||
|
status.value = 2;
|
||||||
|
formData.name = '';
|
||||||
|
formData.sex = '男';
|
||||||
|
formData.tel = '';
|
||||||
|
formData.vocational = '';
|
||||||
|
formData.address = '';
|
||||||
|
})
|
||||||
|
timeBack.value = 3;
|
||||||
|
status.value = 2;
|
||||||
|
type.value = setInterval(()=>{
|
||||||
|
if(timeBack.value > 0){
|
||||||
|
timeBack.value--;
|
||||||
|
}else{
|
||||||
|
timeBack.value = 3;
|
||||||
|
status.value = 1;
|
||||||
|
clearInterval(type.value);
|
||||||
|
}
|
||||||
|
},1000)
|
||||||
|
}
|
||||||
|
</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%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.backClass {
|
||||||
|
background: linear-gradient(
|
||||||
|
to bottom,
|
||||||
|
/* 渐变方向:从上到下 */ #00b980 0%,
|
||||||
|
/* 顶部颜色 */ #27cab3 50%,
|
||||||
|
/* 中间颜色,位于 50% 位置 */ #50dcc9 100% /* 底部颜色 */
|
||||||
|
);
|
||||||
|
position: relative;
|
||||||
|
height: 100vh;
|
||||||
|
background-position: center center; /* 图片位置 */
|
||||||
|
background-size: cover; /* 图片铺满容器 */
|
||||||
|
background-repeat: no-repeat; /* 不重复 */
|
||||||
|
width: 100%;
|
||||||
|
.conten {
|
||||||
|
width: 90vw;
|
||||||
|
height: 365px;
|
||||||
|
position: absolute;
|
||||||
|
top: 150px;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
margin: auto;
|
||||||
|
z-index: 2;
|
||||||
|
.userinfo{
|
||||||
|
width: 100%;
|
||||||
|
height: 10vw;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 3;
|
||||||
|
padding:20px 30px;
|
||||||
|
|
||||||
|
.tit{
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 21px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
.con{
|
||||||
|
width: 100%;
|
||||||
|
min-height: 35px;
|
||||||
|
border-bottom: 1px solid #f2f2f2;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 10px 5px;
|
||||||
|
|
||||||
|
.let{
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 17px;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
.rit{
|
||||||
|
color: #555;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 16px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
|
||||||
|
/* 当单选按钮被选中时,改变标签的背景色 */
|
||||||
|
.radios{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
div{
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #f8f8f8;
|
||||||
|
margin-right: 5px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.xz{
|
||||||
|
border: 1px solid #00b980;
|
||||||
|
div{
|
||||||
|
width: 10px;
|
||||||
|
height: 10px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #00b980;
|
||||||
|
margin: 3.5px auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
input{
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
input:focus {
|
||||||
|
border-color: #fff;
|
||||||
|
outline: none;
|
||||||
|
box-shadow: 0 0 0 rgba(red, green, blue, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.submit-btn {
|
||||||
|
width: 31vw;
|
||||||
|
height: 14vw;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 3;
|
||||||
|
bottom: 0vw;
|
||||||
|
right: 9vw;
|
||||||
|
|
||||||
|
>div{
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 4;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 20px;
|
||||||
|
color: #fff;
|
||||||
|
padding-bottom: 6px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.img-bgr {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.img-bg {
|
||||||
|
width: 100%;
|
||||||
|
height: 100vh;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,175 @@
|
||||||
|
<template>
|
||||||
|
<a-spin :spinning="confirmLoading">
|
||||||
|
<JFormContainer :disabled="disabled">
|
||||||
|
<template #detail>
|
||||||
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="BlOrgAdvisoryForm">
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="姓名" v-bind="validateInfos.name" id="BlOrgAdvisoryForm-name" name="name">
|
||||||
|
<a-input v-model:value="formData.name" placeholder="请输入姓名" disabled allow-clear ></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="性别" v-bind="validateInfos.sex" id="BlOrgAdvisoryForm-sex" name="sex">
|
||||||
|
<a-input v-model:value="formData.sex" placeholder="请输入性别" disabled allow-clear ></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="电话" v-bind="validateInfos.tel" id="BlOrgAdvisoryForm-tel" name="tel">
|
||||||
|
<a-input v-model:value="formData.tel" placeholder="请输入电话" disabled allow-clear ></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="职业" v-bind="validateInfos.vocational" id="BlOrgAdvisoryForm-vocational" name="vocational">
|
||||||
|
<a-input v-model:value="formData.vocational" placeholder="请输入职业" disabled allow-clear ></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="家庭住址" v-bind="validateInfos.address" id="BlOrgAdvisoryForm-address" name="address">
|
||||||
|
<a-textarea v-model:value="formData.address" :rows="4" disabled placeholder="请输入家庭住址" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="备注" v-bind="validateInfos.content" id="BlOrgAdvisoryForm-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 { getValueType } from '/@/utils';
|
||||||
|
import { saveOrUpdate } from '../BlOrgAdvisory.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: '',
|
||||||
|
vocational: '',
|
||||||
|
address: '',
|
||||||
|
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>
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
<template>
|
||||||
|
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||||
|
<BlOrgAdvisoryForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></BlOrgAdvisoryForm>
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, nextTick, defineExpose } from 'vue';
|
||||||
|
import BlOrgAdvisoryForm from './BlOrgAdvisoryForm.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>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.0 MiB |
Loading…
Reference in New Issue