旧的长者功能

This commit is contained in:
1378012178@qq.com 2025-09-22 14:03:05 +08:00
parent 20eabffb20
commit 39fd43100c
8 changed files with 0 additions and 1557 deletions

View File

@ -1,72 +0,0 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/nuBizCustomerInfo/nuBizCustomerInfo/list',
save='/nuBizCustomerInfo/nuBizCustomerInfo/add',
edit='/nuBizCustomerInfo/nuBizCustomerInfo/edit',
deleteOne = '/nuBizCustomerInfo/nuBizCustomerInfo/delete',
deleteBatch = '/nuBizCustomerInfo/nuBizCustomerInfo/deleteBatch',
importExcel = '/nuBizCustomerInfo/nuBizCustomerInfo/importExcel',
exportXls = '/nuBizCustomerInfo/nuBizCustomerInfo/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

@ -1,168 +0,0 @@
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: 'nuId_dictText'
},
{
title: '姓名',
align: "center",
dataIndex: 'customerName'
},
{
title: '性别',
align: "center",
dataIndex: 'customerSex'
},
{
title: '年龄',
align: "center",
dataIndex: 'customerAge_dictText'
},
{
title: '身份证号码',
align: "center",
dataIndex: 'idCard'
},
{
title: '出生日期',
align: "center",
dataIndex: 'dateOfBirth'
},
{
title: '民族',
align: "center",
dataIndex: 'national'
},
{
title: '自理程度',
align: "center",
dataIndex: 'selfCareType'
},
{
title: '头像',
align: "center",
dataIndex: 'avatarPath',
customRender: render.renderImage,
},
{
title: '医保类型',
align: "center",
dataIndex: 'medicalType_dictText'
},
{
title: '医保卡号',
align: "center",
dataIndex: 'medicalCard'
},
{
title: '文化程度',
align: "center",
dataIndex: 'educationLevel_dictText'
},
{
title: '婚姻状况',
align: "center",
dataIndex: 'maritalStatus'
},
{
title: '宗教信仰',
align: "center",
dataIndex: 'religiousBeliefs'
},
{
title: '身份证正面',
align: "center",
dataIndex: 'frontIdCard',
customRender: render.renderImage,
},
{
title: '身份证反面',
align: "center",
dataIndex: 'negativeIdCard',
customRender: render.renderImage,
},
{
title: '户口本本人页',
align: "center",
dataIndex: 'accountBookHimself',
customRender: render.renderImage,
},
{
title: '医保卡正面',
align: "center",
dataIndex: 'frontMedical',
customRender: render.renderImage,
},
{
title: '医保卡反面',
align: "center",
dataIndex: 'negaticeMedical',
customRender: render.renderImage,
},
{
title: '备注',
align: "center",
dataIndex: 'content'
},
{
title: '当前状态',
align: "center",
dataIndex: 'currentState_dictText'
},
{
title: '监护人',
align: "center",
dataIndex: 'guardian'
},
{
title: '关系',
align: "center",
dataIndex: 'relationship'
},
{
title: '联系电话',
align: "center",
dataIndex: 'contactNumber'
},
{
title: '家庭住址',
align: "center",
dataIndex: 'homeAddress'
},
];
// 高级查询数据
export const superQuerySchema = {
nuId: {title: '区域',order: 0,view: 'list', type: 'string',dictCode: '',},
customerName: {title: '姓名',order: 1,view: 'text', type: 'string',},
customerSex: {title: '性别',order: 2,view: 'text', type: 'string',},
customerAge: {title: '年龄',order: 3,view: 'list', type: 'string',dictCode: '',},
idCard: {title: '身份证号码',order: 4,view: 'text', type: 'string',},
dateOfBirth: {title: '出生日期',order: 5,view: 'text', type: 'string',},
national: {title: '民族',order: 6,view: 'text', type: 'string',},
selfCareType: {title: '自理程度',order: 7,view: 'text', type: 'string',},
avatarPath: {title: '头像',order: 8,view: 'image', type: 'string',},
medicalType: {title: '医保类型',order: 9,view: 'list', type: 'string',dictCode: 'medical_insurance_type',},
medicalCard: {title: '医保卡号',order: 10,view: 'text', type: 'string',},
educationLevel: {title: '文化程度',order: 11,view: 'list', type: 'string',dictCode: '',},
maritalStatus: {title: '婚姻状况',order: 12,view: 'text', type: 'string',},
religiousBeliefs: {title: '宗教信仰',order: 13,view: 'text', type: 'string',},
frontIdCard: {title: '身份证正面',order: 14,view: 'image', type: 'string',},
negativeIdCard: {title: '身份证反面',order: 15,view: 'image', type: 'string',},
accountBookHimself: {title: '户口本本人页',order: 16,view: 'image', type: 'string',},
frontMedical: {title: '医保卡正面',order: 17,view: 'image', type: 'string',},
negaticeMedical: {title: '医保卡反面',order: 18,view: 'image', type: 'string',},
content: {title: '备注',order: 19,view: 'textarea', type: 'string',},
currentState: {title: '当前状态',order: 20,view: 'list', type: 'string',dictCode: '',},
guardian: {title: '监护人',order: 21,view: 'text', type: 'string',},
relationship: {title: '关系',order: 22,view: 'text', type: 'string',},
contactNumber: {title: '联系电话',order: 23,view: 'text', type: 'string',},
homeAddress: {title: '家庭住址',order: 24,view: 'text', type: 'string',},
};

View File

@ -1,352 +0,0 @@
<template>
<div class="p-2">
<!--查询区域-->
<div v-show="showIndex == '0'">
<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="customerName">
<template #label><span title="姓名">姓名</span></template>
<j-input placeholder="请输入姓名" v-model:value="queryParam.customerName" allow-clear ></j-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="contactNumber">
<template #label><span title="联系电话">联系电话</span></template>
<j-input placeholder="请输入联系电话" v-model:value="queryParam.contactNumber" allow-clear ></j-input>
</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-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<a-row>
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8" :xxl="6" v-for="(item,index) in dataList" :key="index" style="padding: 5px 10px 0 0;height: 240px;">
<a-row style="padding: 5px;background-color: white;border-radius: 8px;height: 220px;">
<a-col :span="4">
<div class="bjclass">
<img :src="handleHeadPath(item.headPath)" style="width: 40px;height:40px;margin-top: 10px;" />
</div>
</a-col>
<a-col :span="20" style="padding-left: 15px;">
<div>
<span class="titleOne">
{{item.customerName}} /
{{item.customerSex_dictText?item.customerSex_dictText:'未填写'}} /
<span v-if="item.currentState=='0'" style="color: #1890ff">{{item.currentState_dictText}}</span>
<span v-if="item.currentState=='1'" style="color: green">{{item.currentState_dictText}}</span>
<span v-if="item.currentState=='2'" style="color: #ff6c00">{{item.currentState_dictText}}</span>
<span v-if="item.currentState=='3'" style="color: red">{{item.currentState_dictText}}</span>
</span>
</div>
<div style="height: 130px">
<div class="center-lines">区域{{item.nuId_dictText }}</div>
<div class="center-lines">报销类型{{item.reimbType_dictText }}</div>
<div class="center-lines">医保类型{{item.medicalType_dictText }}</div>
<div class="center-lines">联系电话{{item.contactNumber }}</div>
</div>
<div style="color: #857f7f;">
<!-- <span style="float:left;"><Icon icon="ant-design:user-add-outlined" :size="18" /><span style="margin-left:5px;">{{ item.createBy_dictText }}</span></span> -->
<span style="margin-left: 15px;float:left;"><Icon icon="ant-design:field-time-outlined" :size="20" /><span style="margin-left:5px;font-size:16px;">{{ item.createTime.substring(0,10) }}</span></span>
<span style="margin-right: 15px;float:right;">
<a-dropdown :trigger="['hover']" placement="topRight">
<a-button type="link"><Icon icon="ant-design:more-outlined" :size="20" /></a-button>
<template #overlay>
<a-menu>
<a-menu-item @click="handleEdit(item)">编辑</a-menu-item>
<a-menu-item @click="handleHllc(item)">护理流程</a-menu-item>
<!-- <a-menu-item @click="handleCheckNu(item)" v-if="item.currentState!='3'">更换区域</a-menu-item> -->
<a-menu-item @click="handleWaichu(item)" v-if="item.currentState=='1'">外出</a-menu-item>
<a-menu-item @click="handleFanhui(item)" v-if="item.currentState=='2'">返回</a-menu-item>
<a-menu-item @click="handleTuizhu(item)" v-if="item.currentState=='1' || item.currentState=='2'">退住</a-menu-item>
</a-menu>
</template>
</a-dropdown>
</span>
</div>
</a-col>
</a-row>
</a-col>
<a-col :span="24">
<div style="float:right;bottom: 20px;z-index: 999;padding: 8px 16px;border-radius: 4px;display: flex;align-items: center;">
<span style="margin-right: 10px;"> {{ total }} 条数据</span>
<Pagination showLessItems v-model:current="current" :pageSize="pageSize" size="small"
show-quick-jumper :total="total" @change="onPageChange" />
</div>
</a-col>
</a-row>
</div>
<div v-show="showIndex == '1'">
<!-- 护理流程 -->
<CustomerHllc ref="customerHllc" @success="handleSuccess"></CustomerHllc>
</div>
<!-- 表单区域 -->
<NuBizCustomerInfoModal ref="registerModal" @success="handleSuccess"></NuBizCustomerInfoModal>
<CheckNuListModal ref="checkNuListModal" @success="handleSuccess"></CheckNuListModal>
</div>
</template>
<script lang="ts" name="nuBizCustomerInfo-nuBizCustomerInfo" setup>
import { ref, reactive , onMounted} from 'vue';
import { useListPage } from '/@/hooks/system/useListPage';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuBizCustomerInfo.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import NuBizCustomerInfoModal from './components/NuBizCustomerInfoModal.vue'
import CustomerHllc from './components/CustomerHllc.vue'
import CheckNuListModal from './components/CheckNuListModal.vue'
import { useUserStore } from '/@/store/modules/user';
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
import { defHttp } from '/@/utils/http/axios';
import { Pagination } from 'ant-design-vue';
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
const APagination = Pagination;
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const checkNuListModal = ref();
const customerHllc = ref();
const userStore = useUserStore();
const dataList = ref<any[]>([]);
const showIndex = ref<string>('0');
const current = ref(1);
const pageSize = ref(12);
const total = ref(0);
const labelCol = reactive({
xs:24,
sm:4,
xl:6,
xxl:4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
//
function handleHllc(record){
customerHllc.value.init(record);
showIndex.value = '1';
}
//
function handleCheckNu(record){
checkNuListModal.value.disableSubmit = false;
checkNuListModal.value.edit(record);
}
//退
function handleTuizhu(record){
defHttp.post({ url: "/nuBizCustomerInfo/nuBizCustomerInfo/editTuizhu", params: { id: record.id } }).then((data) => {
reload();
});
}
//
function handleWaichu(record){
defHttp.post({ url: "/nuBizCustomerInfo/nuBizCustomerInfo/edit", params: { id: record.id,currentState:'2' } }).then((data) => {
reload();
});
}
//
function handleFanhui(record){
defHttp.post({ url: "/nuBizCustomerInfo/nuBizCustomerInfo/edit", params: { id: record.id,currentState:'1' } }).then((data) => {
reload();
});
}
//logo
function handleHeadPath(headPath){
console.log('headPath--->',headPath);
if(headPath){
return getFileAccessHttpUrl(headPath);
}else{
return '../resource/img/logo.png';
}
}
/**
* 高级查询事件
*/
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);
}
/**
* 成功回调
*/
function handleSuccess() {
showIndex.value = '0';
reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'nuBizCustomerInfo:nu_biz_customer_info:edit'
},
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
];
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
//
reload();
}
/**
* 分页
*/
function onPageChange(page,pageSize){
console.log('onPageChange', page,pageSize);
current.value = page;
reload();
}
/**
* 加载数据
*/
function reload(){
queryParam.pageSize = pageSize;
queryParam.pageNo = current;
queryParam.column = "createTime";
queryParam.order = "desc";
console.log('queryParam',queryParam);
defHttp.get({url:'/nuBizCustomerInfo/nuBizCustomerInfo/list',params:queryParam}).then(res=>{
console.log(res);
dataList.value = res.records;
total.value = res.total;
})
}
//
onMounted(() => {
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%;
}
}
.cardClass{
margin: 5px;
//
border-radius: 8px;
transition: box-shadow 0.3s ease-in-out;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
}
.buttonMargin{
margin: 3px;
}
.bjclass{
text-align: center;
margin-top: 16px;
border-radius: 50%;
width: 60px;
height: 60px;
background: linear-gradient(to bottom, #fff, #efe9e9);
}
.titleOne {
font-size: 16px;
font-weight: 600;
height: 40px;
line-height: 40px;
margin-bottom: 10px;
}
.ellipsis-two-lines {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2; /* 限制文本为2行 */
overflow: hidden;
text-overflow: ellipsis;
line-height:24px;color: #5a5a5a;
}
.center-lines {
line-height:24px;color: #5a5a5a;
}
</style>

View File

@ -1,68 +0,0 @@
<template>
<div>
<div v-for="(item, index) in nulistSource" :key="index" style="padding: 4px">
<a-card :title="index+1 +'、'+ item.nuName" style="width: 100%">
<template #extra><a @click="handleCheckNu(item)" >{{nuId == item.id?'已选择':'选择'}}</a></template>
</a-card>
</div>
</div>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import axios from 'axios';
const emit = defineEmits(['register', 'ok']);
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const nulistSource = ref([]);
const customerInfo = ref<any>({});
const nuId = ref<string>('');
/**
* 新增
*/
function add() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
customerInfo.value = record;
nuId.value = '';
const getNulistUrl = "/h5Api/nuBaseInfo/list";
defHttp.get({ url: getNulistUrl }).then((data) => {
nulistSource.value = data;
});
}
/**
* 提交数据
*/
async function submitForm() {
defHttp.post({ url: '/nuBizCustomerInfo/nuBizCustomerInfo/editNu', params: customerInfo.value }).then((data) => {
emit('ok');
});
}
function handleCheckNu(record) {
customerInfo.value.nuId = record.id;
nuId.value = record.id;
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 14px;
}
</style>

View File

@ -1,77 +0,0 @@
<template>
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<CheckNuListForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></CheckNuListForm>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import CheckNuListForm from './CheckNuListForm.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(record) {
handleCancel();
emit('success',record);
}
/**
* 取消按钮回调事件
*/
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

@ -1,405 +0,0 @@
<template>
<div class="hllcClass" @contextmenu.prevent>
<a-row>
<a-col :span="12" style="padding-top: 14px;">
{{customerInfo.customerName}} - 护理流程展示
</a-col>
<a-col :span="12" style="text-align: right;">
<a-button type="primary" @click="handleFanhui">返回</a-button>
<!-- <a-button type="primary" @click="getData(customerInfo)">加载</a-button> -->
</a-col>
<a-col :span="24" style="margin-top:14px;">
<a-table
:columns="columns"
:data-source="dataSource"
bordered
size="small"
:pagination="false"
:rowClassName="setRowClassName"
:customRow="handleCustomRow"
@contextmenu.prevent
>
<template #bodyCell="{ column, record, text }">
<template v-if="column.key !== 'minute'">
<a-tooltip :title="text" placement="topLeft">
<span class="cell-text">{{ text }}</span>
</a-tooltip>
</template>
</template>
</a-table>
</a-col>
<!-- <a-col :span="24" style="text-align: center;">
<a-button type="primary" @click="handleSaveBach">保存</a-button>
</a-col> -->
</a-row>
<!-- 右键菜单 -->
<div
v-if="contextMenu.visible"
:style="{
position: 'fixed',
left: `${contextMenu.x}px`,
top: `${contextMenu.y}px`,
zIndex: 1000,
boxShadow: '0 2px 8px rgba(0,0,0,0.15)'
}"
class="context-menu"
>
<a-menu @click="handleMenuClick" style="padding: 14px;">
<a-menu-item key="add">新增数据</a-menu-item>
<a-menu-item key="edit" :disabled="!contextMenu.record?.[contextMenu.columnKey]">编辑数据</a-menu-item>
<a-menu-item key="delete" :disabled="!contextMenu.record?.[contextMenu.columnKey]">删除数据</a-menu-item>
</a-menu>
</div>
<!-- 数据操作模态框 -->
<a-modal
v-model:visible="modalVisible"
:title="modalTitle"
@ok="handleModalOk"
@cancel="handleModalCancel"
>
<a-form :model="formState" layout="vertical" style="padding:14px;">
<a-form-item label="数据内容">
<a-input v-model:value="formState.content" />
</a-form-item>
<a-form-item label="备注">
<a-textarea v-model:value="formState.remark" />
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose,computed } from 'vue';
import { message } from 'ant-design-vue';
import { defHttp } from '/@/utils/http/axios';
const emit = defineEmits(['register', 'success']);
const customerInfo = ref<any>({});
//
const contextMenu = reactive({
visible: false,
x: 0,
y: 0,
record: null as DataRow | null,
columnKey: '',
rowIndex: -1
});
//
const modalVisible = ref(false);
const modalAction = ref<'add' | 'edit' | 'delete'>('add');
const modalTitle = computed(() => {
return {
add: '新增数据',
edit: '编辑数据',
delete: '确认删除'
}[modalAction.value];
});
const formState = reactive({
content: '',
remark: ''
});
// 24
const columns = [
{
title: '',
dataIndex: 'minute',
key: 'minute',
width: '50px',
fixed: 'left',
align: 'center',
}
];
//
for (let hour = 0; hour < 24; hour++) {
columns.push({
title: `${hour.toString().padStart(2, '0')}`,
dataIndex: `hour_${hour}`,
key: `hour_${hour}`,
width: 60,
align: 'center',
fixed: '',
customCell: (record: DataRow, rowIndex: number) => {
return {
onClick: () => handleCellClick(record, `hour_${hour}`, rowIndex, 'left'),
onContextmenu: (event: MouseEvent) => {
showContextMenu(event, record, `hour_${hour}`, rowIndex);
}
};
}
});
}
// 5
interface DataRow {
key: number;
minute: string;
remark?: string;
[key: `hour_${number}`]: string;
}
const dataSource = ref<DataRow[]>([]);
//
const initDataSource = () => {
const newData: DataRow[] = [];
for (let minute = 0; minute < 60; minute += 5) {
let row: DataRow = {
key: minute,
minute: `${minute.toString().padStart(2, '0')}`
} as DataRow;
for (let hour = 0; hour < 24; hour++) {
row[`hour_${hour}`] = '';
}
newData.push(row);
}
dataSource.value = newData;
};
//
function setRowClassName(record: DataRow, index: number) {
return index % 2 === 0 ? 'even-row' : 'odd-row';
}
//
initDataSource();
//
const handleCustomRow = (record: DataRow, index: number) => {
return {
onClick: () => handleRowClick(record, index),
onContextmenu: (event: MouseEvent) => {
event.preventDefault();
}
};
};
//
const showContextMenu = (event: MouseEvent, record: DataRow, columnKey: string, rowIndex: number) => {
// event.preventDefault();
// contextMenu.visible = true;
// contextMenu.x = event.clientX;
// contextMenu.y = event.clientY;
// contextMenu.record = record;
// contextMenu.columnKey = columnKey;
// contextMenu.rowIndex = rowIndex;
// //
// const closeMenu = (e: MouseEvent) => {
// if (!(e.target as HTMLElement).closest('.context-menu')) {
// contextMenu.visible = false;
// document.removeEventListener('click', closeMenu);
// }
// };
// document.addEventListener('click', closeMenu);
};
//
const handleMenuClick = ({ key }: { key: string }) => {
const { record, columnKey } = contextMenu;
switch (key) {
case 'add':
modalAction.value = 'add';
formState.content = '';
formState.remark = '';
modalVisible.value = true;
break;
case 'edit':
if (record && columnKey) {
modalAction.value = 'edit';
formState.content = record[columnKey];
formState.remark = record.remark || '';
modalVisible.value = true;
}
break;
case 'delete':
modalAction.value = 'delete';
if (record && columnKey) {
formState.content = record[columnKey];
formState.remark = record.remark || '';
}
modalVisible.value = true;
break;
}
contextMenu.visible = false;
};
//
const handleModalOk = () => {
const { record, columnKey, rowIndex } = contextMenu;
if (!record || !columnKey || rowIndex === -1) return;
switch (modalAction.value) {
case 'add':
case 'edit':
if (!formState.content) {
message.warning('请输入数据内容');
return;
}
dataSource.value[rowIndex][columnKey] = formState.content;
dataSource.value[rowIndex].remark = formState.remark;
message.success(`数据${modalAction.value === 'add' ? '添加' : '更新'}成功`);
break;
case 'delete':
dataSource.value[rowIndex][columnKey] = '';
message.success('数据已删除');
break;
}
modalVisible.value = false;
};
//
const handleModalCancel = () => {
modalVisible.value = false;
};
//
function handleRowClick(record: DataRow, index: number) {
//
}
//
function handleCellClick(record: DataRow, columnKey: string, rowIndex: number, buttonType: 'left' | 'right') {
//
}
function handleFanhui() {
emit('success');
}
function getData(record: any) {
defHttp.get({
url: "/nuIpadApi/nuBizNuCustomerServer/getNclist",
params: { nuId: record.nuId, customerId: record.id }
}).then((data) => {
console.log("获取到的数据:", data);
//
initDataSource();
//
if (Array.isArray(data)) {
data.forEach((hourData) => {
const hour = parseInt(hourData.positioning);
//
if (hourData.children && hourData.children.length > 0) {
hourData.children.forEach((item) => {
//
const [startHour, startMinute] = item.startTime.split(':').map(Number);
const rowIndex = Math.floor(startMinute / 5); // 5
//
if (rowIndex >= 0 && rowIndex < dataSource.value.length) {
//
const content = [
item.directiveName,
item.typeName,
item.categoryName,
item.tagName,
item.cycleType,
item.startTime,
item.endTime,
].filter(Boolean).join(' / ');
//
dataSource.value[rowIndex][`hour_${hour}`] = content;
}
});
}
});
}
});
}
function handleSaveBach(){
console.log("🚀 ~ handleSaveBach ~ dataSource:", dataSource)
}
function init(record: any) {
customerInfo.value = record;
console.log("初始化数据:", record);
getData(record)
}
defineExpose({
init
});
</script>
<style lang="less" scoped>
.hllcClass {
background: white;
width: 100%;
height: calc(100vh - 90px);
padding: 14px;
border-radius: 8px;
position: relative;
}
/* 斑马纹样式 */
:deep(.ant-table) {
.even-row {
background-color: #fafafa;
}
.odd-row {
background-color: #ffffff;
}
/* 单元格悬停效果 */
.ant-table-tbody > tr > td {
&:hover {
background-color: #e6f7ff !important;
cursor: pointer;
}
}
/* 有数据的单元格样式 */
.has-data {
background-color: #f6ffed;
}
}
/* 右键菜单样式 */
.context-menu {
background: white;
border-radius: 4px;
overflow: hidden;
.ant-menu {
border-right: none;
}
.ant-menu-item {
margin: 0;
padding: 5px 12px;
}
}
.cell-text {
// display: inline-block;
// max-width: 50px;
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2; /* 限制文本为2行 */
overflow: hidden;
text-overflow: ellipsis;
}
</style>

View File

@ -1,338 +0,0 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer :disabled="disabled">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="NuBizCustomerInfoForm">
<a-card title="基础信息">
<a-row>
<a-col :span="18">
<a-row>
<a-col :span="8">
<a-form-item label="姓名" v-bind="validateInfos.customerName" id="NuBizCustomerInfoForm-customerName" name="customerName">
<a-input v-model:value="formData.customerName" placeholder="请输入姓名" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="性别" v-bind="validateInfos.customerSex" id="NuBizCustomerInfoForm-customerSex" name="customerSex">
<j-dict-select-tag v-model:value="formData.customerSex" dictCode="sex" placeholder="请选择性别" allow-clear />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="身份证号码" v-bind="validateInfos.idCard" id="NuBizCustomerInfoForm-idCard" name="idCard">
<a-input v-model:value="formData.idCard" placeholder="请输入身份证号码" allow-clear @change="handleChangeIdcard"></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="年龄" v-bind="validateInfos.customerAge" id="NuBizCustomerInfoForm-customerAge" name="customerAge">
<a-input v-model:value="formData.customerAge" placeholder="请输入年龄" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="出生日期" v-bind="validateInfos.dateOfBirth" id="NuBizCustomerInfoForm-dateOfBirth" name="dateOfBirth">
<a-input v-model:value="formData.dateOfBirth" placeholder="请输入出生日期" disabled allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="民族" v-bind="validateInfos.national" id="NuBizCustomerInfoForm-national" name="national">
<a-input v-model:value="formData.national" placeholder="请输入民族" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="自理程度" v-bind="validateInfos.reimbType" id="NuBizCustomerInfoForm-reimreimbTypeb_type" name="reimbType">
<j-dict-select-tag v-model:value="formData.reimbType" dictCode="reimb_type" placeholder="请选择自理程度" allow-clear />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="医保类型" v-bind="validateInfos.medicalType" id="NuBizCustomerInfoForm-medicalType" name="medicalType">
<j-dict-select-tag v-model:value="formData.medicalType" dictCode="medical_insurance_type" placeholder="请选择医保类型" allow-clear />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="医保卡号" v-bind="validateInfos.medicalCard" id="NuBizCustomerInfoForm-medicalCard" name="medicalCard">
<a-input v-model:value="formData.medicalCard" placeholder="请输入医保卡号" allow-clear ></a-input>
</a-form-item>
</a-col>
</a-row>
</a-col>
<a-col :span="6">
<a-col :span="24">
<a-form-item label="头像" v-bind="validateInfos.avatarPath" id="NuBizCustomerInfoForm-avatarPath" name="avatarPath">
<j-image-upload :fileMax="1" :bizPath="`customerHead`" v-model:value="formData.avatarPath" text="上传头像" ></j-image-upload>
</a-form-item>
</a-col>
</a-col>
<a-col :span="24" hidden>
<a-form-item label="区域" v-bind="validateInfos.nuId" id="NuBizCustomerInfoForm-nuId" name="nuId">
<j-dict-select-tag v-model:value="formData.nuId" dictCode="" placeholder="请选择区域" allow-clear />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="监护人" v-bind="validateInfos.guardian" :labelCol="labelCol2" :wrapperCol="wrapperCol2" id="NuBizCustomerInfoForm-guardian" name="guardian">
<a-input v-model:value="formData.guardian" placeholder="请输入监护人" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="联系电话" v-bind="validateInfos.contactNumber" :labelCol="labelCol2" :wrapperCol="wrapperCol2" id="NuBizCustomerInfoForm-contactNumber" name="contactNumber">
<a-input v-model:value="formData.contactNumber" placeholder="请输入联系电话" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="关系" v-bind="validateInfos.relationship" :labelCol="labelCol2" :wrapperCol="wrapperCol2" id="NuBizCustomerInfoForm-relationship" name="relationship">
<a-input v-model:value="formData.relationship" placeholder="请输入关系" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="宗教信仰" v-bind="validateInfos.religiousBeliefs" :labelCol="labelCol2" :wrapperCol="wrapperCol2" id="NuBizCustomerInfoForm-religiousBeliefs" name="religiousBeliefs">
<a-input v-model:value="formData.religiousBeliefs" placeholder="请输入宗教信仰" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="文化程度" v-bind="validateInfos.educationLevel" :labelCol="labelCol2" :wrapperCol="wrapperCol2" id="NuBizCustomerInfoForm-educationLevel" name="educationLevel">
<j-dict-select-tag v-model:value="formData.educationLevel" dictCode="" placeholder="请选择文化程度" allow-clear />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="婚姻状况" v-bind="validateInfos.maritalStatus" :labelCol="labelCol2" :wrapperCol="wrapperCol2" id="NuBizCustomerInfoForm-maritalStatus" name="maritalStatus">
<a-input v-model:value="formData.maritalStatus" placeholder="请输入婚姻状况" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="家庭住址" v-bind="validateInfos.homeAddress" :labelCol="labelCol3" :wrapperCol="wrapperCol3" id="NuBizCustomerInfoForm-homeAddress" name="homeAddress">
<a-input v-model:value="formData.homeAddress" placeholder="请输入家庭住址" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="备注" v-bind="validateInfos.content" :labelCol="labelCol3" :wrapperCol="wrapperCol3" id="NuBizCustomerInfoForm-content" name="content">
<a-textarea v-model:value="formData.content" :rows="4" placeholder="请输入备注" />
</a-form-item>
</a-col>
</a-row>
</a-card>
<a-card title="证件信息信息" style="margin-top: 20px;">
<a-tabs v-model:activeKey="activeKey" type="card">
<a-tab-pane key="1" tab="身份证">
<a-row>
<a-col :span="12">
<a-form-item label="身份证正面" v-bind="validateInfos.frontIdCard" id="NuBizCustomerInfoForm-frontIdCard" name="frontIdCard">
<j-image-upload :fileMax="1" :bizPath="`customerZzxx`" v-model:value="formData.frontIdCard" ></j-image-upload>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="身份证反面" v-bind="validateInfos.negativeIdCard" id="NuBizCustomerInfoForm-negativeIdCard" name="negativeIdCard">
<j-image-upload :fileMax="1" :bizPath="`customerZzxx`" v-model:value="formData.negativeIdCard" ></j-image-upload>
</a-form-item>
</a-col>
</a-row>
</a-tab-pane>
<a-tab-pane key="2" tab="户口本">
<a-row>
<a-col :span="12">
<a-form-item label="户口本本人页" v-bind="validateInfos.accountBookHimself" id="NuBizCustomerInfoForm-accountBookHimself" name="accountBookHimself">
<j-image-upload :fileMax="1" :bizPath="`customerZzxx`" v-model:value="formData.accountBookHimself" ></j-image-upload>
</a-form-item>
</a-col>
</a-row>
</a-tab-pane>
<a-tab-pane key="3" tab="医保卡">
<a-row>
<a-col :span="12">
<a-form-item label="医保卡正面" v-bind="validateInfos.frontMedical" id="NuBizCustomerInfoForm-frontMedical" name="frontMedical">
<j-image-upload :fileMax="1" :bizPath="`customerZzxx`" v-model:value="formData.frontMedical" ></j-image-upload>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="医保卡反面" v-bind="validateInfos.negaticeMedical" id="NuBizCustomerInfoForm-negaticeMedical" name="negaticeMedical">
<j-image-upload :fileMax="1" :bizPath="`customerZzxx`" v-model:value="formData.negaticeMedical" ></j-image-upload>
</a-form-item>
</a-col>
</a-row>
</a-tab-pane>
</a-tabs>
</a-card>
<a-row>
<!-- <a-col :span="24">
<a-form-item label="当前状态" v-bind="validateInfos.currentState" id="NuBizCustomerInfoForm-currentState" name="currentState">
<j-dict-select-tag v-model:value="formData.currentState" dictCode="" placeholder="请选择当前状态" allow-clear />
</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 JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../NuBizCustomerInfo.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
import dayjs from "dayjs";
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 activeKey = ref('1');
const formData = reactive<Record<string, any>>({
id: '',
nuId: '',
customerName: '',
customerSex: '',
customerAge: '',
idCard: '',
dateOfBirth: '',
national: '',
reimbType: '',
avatarPath: '',
medicalType: '',
medicalCard: '',
educationLevel: '',
maritalStatus: '',
religiousBeliefs: '',
frontIdCard: '',
negativeIdCard: '',
accountBookHimself: '',
frontMedical: '',
negaticeMedical: '',
content: '',
currentState: '',
guardian: '',
relationship: '',
contactNumber: '',
homeAddress: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 7 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const labelCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 7 } });
const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const labelCol3 = ref<any>({ xs: { span: 24 }, sm: { span: 2 } });
const wrapperCol3 = ref<any>({ xs: { span: 24 }, sm: { span: 21 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = reactive({
customerName: [{ required: true, message: '请输入姓名!'},],
idCard: [{ required: true, message: '请输入身份证号码!'}, { pattern: '^\\d{6}(18|19|20)?\\d{2}(0[1-9]|1[012])(0[1-9]|[12]\\d|3[01])\\d{3}(\\d|[xX])$', message: '身份证号错误!' }],
contactNumber: [{ required: true, message: '请输入联系电话!'},],
});
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 handleChangeIdcard(){
const item = formData.idCard;
if(item.length === 18){
formData.dateOfBirth = item.substring(6, 10) + '-' + item.substring(10, 12) + '-' + item.substring(12, 14);
var year = dayjs().format('YYYY')
formData.customerAge = parseInt(year) - item.substring(6, 10);
// formData.national = item.substring(14, 16);
}
}
/**
* 新增
*/
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

@ -1,77 +0,0 @@
<template>
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<NuBizCustomerInfoForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuBizCustomerInfoForm>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import NuBizCustomerInfoForm from './NuBizCustomerInfoForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<string>('80%');
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>