This commit is contained in:
@@ -38,7 +38,9 @@ const UpdateCustomer = () => {
|
||||
const { updateCustomer } = customerSlice.actions;
|
||||
const urlParams = useParams();
|
||||
const [searchParams] = useSearchParams();
|
||||
const [activeTab, setActiveTab] = useState(searchParams.get('tab') || 'personalInfo');
|
||||
const initialTab = searchParams.get('tab');
|
||||
const normalizedInitialTab = ['additionalInfo', 'complianceDeadlines'].includes(initialTab) ? 'personalInfo' : initialTab;
|
||||
const [activeTab, setActiveTab] = useState(normalizedInitialTab || 'personalInfo');
|
||||
const [currentCustomer, setCurrentCustomer] = useState(undefined);
|
||||
|
||||
// Basic Info
|
||||
@@ -1323,6 +1325,38 @@ const UpdateCustomer = () => {
|
||||
</div>
|
||||
)}
|
||||
|
||||
<h6 className="text-primary">Additional Information</h6>
|
||||
<div className="app-main-content-fields-section base-line">
|
||||
<div className="me-4">
|
||||
<div className="field-label">Profile Picture</div>
|
||||
<label className="custom-file-upload">
|
||||
<Upload width={20} color={"#fff"} className="me-2"></Upload> Upload Files
|
||||
<input type="file" onChange={(e) => setSelectedFile(e.target.files[0])}/>
|
||||
</label>
|
||||
<div className="file-name">{selectedFile?.name}</div>
|
||||
</div>
|
||||
<div className="me-4">
|
||||
<div className="field-label">Notes And Attachments</div>
|
||||
<textarea
|
||||
placeholder="e.g., Customer enjoys art activities"
|
||||
value={note}
|
||||
onChange={e => setNote(e.target.value)}
|
||||
rows={4}
|
||||
style={{width: '400px'}}
|
||||
/>
|
||||
</div>
|
||||
<div className="me-4">
|
||||
<div className="field-label">Notes for Driver</div>
|
||||
<textarea
|
||||
placeholder="e.g., Call before arrival"
|
||||
value={notesForDriver}
|
||||
onChange={e => setNotesForDriver(e.target.value)}
|
||||
rows={4}
|
||||
style={{width: '400px'}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="list row mb-5">
|
||||
<div className="col-md-12 col-sm-12 col-xs-12">
|
||||
<button className="btn btn-default btn-sm float-right" onClick={() => redirectToView()}> Cancel </button>
|
||||
@@ -1544,46 +1578,6 @@ const UpdateCustomer = () => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="list row mb-5">
|
||||
<div className="col-md-12 col-sm-12 col-xs-12">
|
||||
<button className="btn btn-default btn-sm float-right" onClick={() => redirectToView()}> Cancel </button>
|
||||
{/* <button className="btn btn-danger btn-sm me-2 mb-2" onClick={() => triggerShowDeleteModal()}> Delete </button> */}
|
||||
<button className="btn btn-primary btn-sm float-right" onClick={() => saveCustomer()}> Save </button>
|
||||
</div>
|
||||
</div>
|
||||
</Tab>
|
||||
|
||||
<Tab eventKey="confidentialDetails" title="Confidential Details">
|
||||
<h6 className="text-primary">Confidential Details</h6>
|
||||
<div className="app-main-content-fields-section">
|
||||
<div className="me-4">
|
||||
<div className="field-label">Medicare Number</div>
|
||||
<input type="text" placeholder="e.g., MC11223344" value={medicareNumber} onChange={e => setMedicareNumber(e.target.value)}/>
|
||||
</div>
|
||||
<div className="me-4">
|
||||
<div className="field-label">Medicaid Number</div>
|
||||
<input type="text" placeholder="e.g., MD99887766" value={medicaidNumber} onChange={e => setMedicaidNumber(e.target.value)}/>
|
||||
</div>
|
||||
<div className="me-4">
|
||||
<div className="field-label">Social Security Number</div>
|
||||
<input type="text" placeholder="e.g., 123-45-6789" value={socialSecurityNumber} onChange={e => setSocialSecurityNumber(e.target.value)}/>
|
||||
</div>
|
||||
<div className="me-4">
|
||||
<div className="field-label">Adcaps ID</div>
|
||||
<input type="text" placeholder="e.g., AC00011122" value={adcapsId} onChange={e => setAdcapsId(e.target.value)}/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="list row mb-5">
|
||||
<div className="col-md-12 col-sm-12 col-xs-12">
|
||||
<button className="btn btn-default btn-sm float-right" onClick={() => redirectToView()}> Cancel </button>
|
||||
{/* <button className="btn btn-danger btn-sm me-2 mb-2" onClick={() => triggerShowDeleteModal()}> Delete </button> */}
|
||||
<button className="btn btn-primary btn-sm float-right" onClick={() => saveCustomer()}> Save </button>
|
||||
</div>
|
||||
</div>
|
||||
</Tab>
|
||||
|
||||
<Tab eventKey="complianceDeadlines" title="Compliance & Deadlines">
|
||||
<h6 className="text-primary">Compliance & Deadlines</h6>
|
||||
<div className="app-main-content-fields-section">
|
||||
<div className="me-4">
|
||||
@@ -1637,6 +1631,37 @@ const UpdateCustomer = () => {
|
||||
</div>
|
||||
</Tab>
|
||||
|
||||
<Tab eventKey="confidentialDetails" title="Confidential Details">
|
||||
<h6 className="text-primary">Confidential Details</h6>
|
||||
<div className="app-main-content-fields-section">
|
||||
<div className="me-4">
|
||||
<div className="field-label">Medicare Number</div>
|
||||
<input type="text" placeholder="e.g., MC11223344" value={medicareNumber} onChange={e => setMedicareNumber(e.target.value)}/>
|
||||
</div>
|
||||
<div className="me-4">
|
||||
<div className="field-label">Medicaid Number</div>
|
||||
<input type="text" placeholder="e.g., MD99887766" value={medicaidNumber} onChange={e => setMedicaidNumber(e.target.value)}/>
|
||||
</div>
|
||||
<div className="me-4">
|
||||
<div className="field-label">Social Security Number</div>
|
||||
<input type="text" placeholder="e.g., 123-45-6789" value={socialSecurityNumber} onChange={e => setSocialSecurityNumber(e.target.value)}/>
|
||||
</div>
|
||||
<div className="me-4">
|
||||
<div className="field-label">Adcaps ID</div>
|
||||
<input type="text" placeholder="e.g., AC00011122" value={adcapsId} onChange={e => setAdcapsId(e.target.value)}/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="list row mb-5">
|
||||
<div className="col-md-12 col-sm-12 col-xs-12">
|
||||
<button className="btn btn-default btn-sm float-right" onClick={() => redirectToView()}> Cancel </button>
|
||||
{/* <button className="btn btn-danger btn-sm me-2 mb-2" onClick={() => triggerShowDeleteModal()}> Delete </button> */}
|
||||
<button className="btn btn-primary btn-sm float-right" onClick={() => saveCustomer()}> Save </button>
|
||||
</div>
|
||||
</div>
|
||||
</Tab>
|
||||
|
||||
|
||||
<Tab eventKey="formSubmission" title="Form Submission">
|
||||
{/* Admission Forms Section */}
|
||||
<h6 className="text-primary">Admission Forms</h6>
|
||||
@@ -1742,47 +1767,6 @@ const UpdateCustomer = () => {
|
||||
</div>
|
||||
</Tab>
|
||||
|
||||
<Tab eventKey="additionalInfo" title="Additional Information">
|
||||
<h6 className="text-primary">Additional Information</h6>
|
||||
<div className="app-main-content-fields-section base-line">
|
||||
<div className="me-4">
|
||||
<div className="field-label">Profile Picture</div>
|
||||
<label className="custom-file-upload">
|
||||
<Upload width={20} color={"#fff"} className="me-2"></Upload> Upload Files
|
||||
<input type="file" onChange={(e) => setSelectedFile(e.target.files[0])}/>
|
||||
</label>
|
||||
<div className="file-name">{selectedFile?.name}</div>
|
||||
</div>
|
||||
<div className="me-4">
|
||||
<div className="field-label">Notes And Attachments</div>
|
||||
<textarea
|
||||
placeholder="e.g., Customer enjoys art activities"
|
||||
value={note}
|
||||
onChange={e => setNote(e.target.value)}
|
||||
rows={4}
|
||||
style={{width: '400px'}}
|
||||
/>
|
||||
</div>
|
||||
<div className="me-4">
|
||||
<div className="field-label">Notes for Driver</div>
|
||||
<textarea
|
||||
placeholder="e.g., Call before arrival"
|
||||
value={notesForDriver}
|
||||
onChange={e => setNotesForDriver(e.target.value)}
|
||||
rows={4}
|
||||
style={{width: '400px'}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="list row mb-5">
|
||||
<div className="col-md-12 col-sm-12 col-xs-12">
|
||||
<button className="btn btn-default btn-sm float-right" onClick={() => redirectToView()}> Cancel </button>
|
||||
{/* <button className="btn btn-danger btn-sm me-2 mb-2" onClick={() => triggerShowDeleteModal()}> Delete </button> */}
|
||||
<button className="btn btn-primary btn-sm float-right" onClick={() => saveCustomer()}> Save </button>
|
||||
</div>
|
||||
</div>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -31,7 +31,9 @@ const ViewCustomer = () => {
|
||||
const [searchParams] = useSearchParams();
|
||||
const [currentCustomer, setCurrentCustomer] = useState(undefined);
|
||||
const [currentAvatar, setCurrentAvatar] = useState(undefined);
|
||||
const [activeTab, setActiveTab] = useState(searchParams.get('tab') || 'personalInfo');
|
||||
const initialTab = searchParams.get('tab');
|
||||
const normalizedInitialTab = ['additionalInfo', 'complianceDeadlines'].includes(initialTab) ? 'personalInfo' : initialTab;
|
||||
const [activeTab, setActiveTab] = useState(normalizedInitialTab || 'personalInfo');
|
||||
const [formFiles, setFormFiles] = useState({});
|
||||
|
||||
|
||||
@@ -528,6 +530,22 @@ const ViewCustomer = () => {
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<h6 className="text-primary">Additional Information</h6>
|
||||
<div className="app-main-content-fields-section base-line">
|
||||
<div className="field-body">
|
||||
<div className="field-label">Profile Picture</div>
|
||||
{currentAvatar && <img height="100px" width="100px" src={`data:image/png;base64, ${currentAvatar}`}/>}
|
||||
</div>
|
||||
<div className="field-body">
|
||||
<div className="field-label">Notes And Attachments</div>
|
||||
<div className="field-value">{currentCustomer?.note || currentCustomer?.private_note}</div>
|
||||
</div>
|
||||
<div className="field-body">
|
||||
<div className="field-label">Notes for Driver</div>
|
||||
<div className="field-value">{currentCustomer?.notes_for_driver}</div>
|
||||
</div>
|
||||
</div>
|
||||
</Tab>
|
||||
|
||||
<Tab eventKey="careServices" title="Care & Services">
|
||||
@@ -649,6 +667,26 @@ const ViewCustomer = () => {
|
||||
<div className="field-value">{currentCustomer?.rounding_notes}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h6 className="text-primary">Compliance & Deadlines</h6>
|
||||
<div className="app-main-content-fields-section">
|
||||
<div className="field-body">
|
||||
<div className="field-label">Adcaps Completed Date</div>
|
||||
<div className="field-value">{currentCustomer?.adcaps_completed_date}</div>
|
||||
</div>
|
||||
<div className="field-body">
|
||||
<div className="field-label">Center Qualification Renew Date</div>
|
||||
<div className="field-value">{currentCustomer?.center_qualification_renew_date}</div>
|
||||
</div>
|
||||
<div className="field-body">
|
||||
<div className="field-label">Medicaid Renew Date</div>
|
||||
<div className="field-value">{currentCustomer?.medicaid_renew_date}</div>
|
||||
</div>
|
||||
<div className="field-body">
|
||||
<div className="field-label">ID Expiration Date</div>
|
||||
<div className="field-value">{currentCustomer?.id_expiration_date}</div>
|
||||
</div>
|
||||
</div>
|
||||
</Tab>
|
||||
|
||||
<Tab eventKey="confidentialDetails" title="Confidential Details">
|
||||
@@ -673,27 +711,6 @@ const ViewCustomer = () => {
|
||||
</div>
|
||||
</Tab>
|
||||
|
||||
<Tab eventKey="complianceDeadlines" title="Compliance & Deadlines">
|
||||
<h6 className="text-primary">Compliance & Deadlines</h6>
|
||||
<div className="app-main-content-fields-section">
|
||||
<div className="field-body">
|
||||
<div className="field-label">Adcaps Completed Date</div>
|
||||
<div className="field-value">{currentCustomer?.adcaps_completed_date}</div>
|
||||
</div>
|
||||
<div className="field-body">
|
||||
<div className="field-label">Center Qualification Renew Date</div>
|
||||
<div className="field-value">{currentCustomer?.center_qualification_renew_date}</div>
|
||||
</div>
|
||||
<div className="field-body">
|
||||
<div className="field-label">Medicaid Renew Date</div>
|
||||
<div className="field-value">{currentCustomer?.medicaid_renew_date}</div>
|
||||
</div>
|
||||
<div className="field-body">
|
||||
<div className="field-label">ID Expiration Date</div>
|
||||
<div className="field-value">{currentCustomer?.id_expiration_date}</div>
|
||||
</div>
|
||||
</div>
|
||||
</Tab>
|
||||
|
||||
<Tab eventKey="formSubmission" title="Form Submission">
|
||||
{/* Admission Forms Section */}
|
||||
@@ -747,23 +764,6 @@ const ViewCustomer = () => {
|
||||
</div>
|
||||
</Tab>
|
||||
|
||||
<Tab eventKey="additionalInfo" title="Additional Information">
|
||||
<h6 className="text-primary">Additional Information</h6>
|
||||
<div className="app-main-content-fields-section base-line">
|
||||
<div className="field-body">
|
||||
<div className="field-label">Profile Picture</div>
|
||||
{currentAvatar && <img height="100px" width="100px" src={`data:image/png;base64, ${currentAvatar}`}/>}
|
||||
</div>
|
||||
<div className="field-body">
|
||||
<div className="field-label">Notes And Attachments</div>
|
||||
<div className="field-value">{currentCustomer?.note || currentCustomer?.private_note}</div>
|
||||
</div>
|
||||
<div className="field-body">
|
||||
<div className="field-label">Notes for Driver</div>
|
||||
<div className="field-value">{currentCustomer?.notes_for_driver}</div>
|
||||
</div>
|
||||
</div>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
<div className="list-func-panel">
|
||||
<button className="btn btn-primary me-2" onClick={() => goToEdit(currentCustomer?.id)}><PencilSquare className="me-2" size={16}></PencilSquare>Edit</button>
|
||||
|
||||
@@ -23,6 +23,7 @@ const RouteReportWithSignature = () => {
|
||||
const [signature, setSignature] = useState(undefined);
|
||||
|
||||
const [directorSignature, setDirectorSignature] = useState(undefined);
|
||||
const [customerMetaById, setCustomerMetaById] = useState(new Map());
|
||||
|
||||
const site = EventsService.site;
|
||||
|
||||
@@ -76,6 +77,23 @@ const RouteReportWithSignature = () => {
|
||||
}
|
||||
});
|
||||
}, [currentRoute]);
|
||||
|
||||
useEffect(() => {
|
||||
CustomerService.getAllCustomers()
|
||||
.then((res) => {
|
||||
const nextMap = new Map();
|
||||
(res?.data || []).forEach((customer) => {
|
||||
nextMap.set(customer?.id, {
|
||||
program_type: customer?.program_type || '',
|
||||
pay_source: customer?.pay_source || ''
|
||||
});
|
||||
});
|
||||
setCustomerMetaById(nextMap);
|
||||
})
|
||||
.catch(() => {
|
||||
setCustomerMetaById(new Map());
|
||||
});
|
||||
}, []);
|
||||
const normalizeChecklistText = (value = '') =>
|
||||
String(value)
|
||||
.toLowerCase()
|
||||
@@ -123,8 +141,19 @@ const RouteReportWithSignature = () => {
|
||||
|
||||
const getDisplayNameWithProgramAndPaySource = (customer) => {
|
||||
const baseName = customer?.customer_name || '';
|
||||
const programTypeRaw = (customer?.customer_program_type || customer?.program_type || '').toString().trim();
|
||||
const paySourceRaw = (customer?.customer_pay_source || customer?.pay_source || '').toString().trim();
|
||||
const customerMeta = customerMetaById.get(customer?.customer_id);
|
||||
const programTypeRaw = (
|
||||
customerMeta?.program_type ||
|
||||
customer?.customer_program_type ||
|
||||
customer?.program_type ||
|
||||
''
|
||||
).toString().trim();
|
||||
const paySourceRaw = (
|
||||
customerMeta?.pay_source ||
|
||||
customer?.customer_pay_source ||
|
||||
customer?.pay_source ||
|
||||
''
|
||||
).toString().trim();
|
||||
|
||||
const qualifiers = [];
|
||||
if (programTypeRaw && programTypeRaw.toLowerCase() !== 'amdc') {
|
||||
|
||||
Reference in New Issue
Block a user