Compare commits
6 Commits
88a550764c
...
c9eea4be03
| Author | SHA1 | Date | |
|---|---|---|---|
| c9eea4be03 | |||
| 334db221c9 | |||
| b031af0556 | |||
| 6f7f406e97 | |||
| dc3d88e32e | |||
| 1cdb044cba |
@ -20,7 +20,7 @@ model SD_SURVEY_SALES_BASIC_INFO {
|
|||||||
ADDRESS String? @db.NVarChar(200)
|
ADDRESS String? @db.NVarChar(200)
|
||||||
ADDRESS_DETAIL String? @db.NVarChar(300)
|
ADDRESS_DETAIL String? @db.NVarChar(300)
|
||||||
SUBMISSION_STATUS Boolean @default(false)
|
SUBMISSION_STATUS Boolean @default(false)
|
||||||
SUBMISSION_DATE DateTime? @db.Date
|
SUBMISSION_DATE DateTime?
|
||||||
SUBMISSION_TARGET_ID String? @db.NVarChar(200)
|
SUBMISSION_TARGET_ID String? @db.NVarChar(200)
|
||||||
REG_DT DateTime @default(now())
|
REG_DT DateTime @default(now())
|
||||||
UPT_DT DateTime @updatedAt
|
UPT_DT DateTime @updatedAt
|
||||||
@ -85,11 +85,11 @@ model BC_COMM_H {
|
|||||||
REF_CHR3 String? @db.NVarChar(100)
|
REF_CHR3 String? @db.NVarChar(100)
|
||||||
REF_CHR4 String? @db.NVarChar(100)
|
REF_CHR4 String? @db.NVarChar(100)
|
||||||
REF_CHR5 String? @db.NVarChar(100)
|
REF_CHR5 String? @db.NVarChar(100)
|
||||||
REF_NUM1 String? @db.NVarChar(100)
|
REF_NUM1 Decimal? @db.Decimal(22, 5)
|
||||||
REF_NUM2 String? @db.NVarChar(100)
|
REF_NUM2 Decimal? @db.Decimal(22, 5)
|
||||||
REF_NUM3 String? @db.NVarChar(100)
|
REF_NUM3 Decimal? @db.Decimal(22, 5)
|
||||||
REF_NUM4 String? @db.NVarChar(100)
|
REF_NUM4 Decimal? @db.Decimal(22, 5)
|
||||||
REF_NUM5 String? @db.NVarChar(100)
|
REF_NUM5 Decimal? @db.Decimal(22, 5)
|
||||||
REMARKS String? @db.NVarChar(200)
|
REMARKS String? @db.NVarChar(200)
|
||||||
SAP_YN String? @db.NVarChar(1)
|
SAP_YN String? @db.NVarChar(1)
|
||||||
STAT_CD String? @db.NVarChar(1)
|
STAT_CD String? @db.NVarChar(1)
|
||||||
@ -98,7 +98,7 @@ model BC_COMM_H {
|
|||||||
REG_ID String? @db.NVarChar(50)
|
REG_ID String? @db.NVarChar(50)
|
||||||
UPT_DT DateTime? @db.DateTime
|
UPT_DT DateTime? @db.DateTime
|
||||||
UPT_ID String? @db.NVarChar(50)
|
UPT_ID String? @db.NVarChar(50)
|
||||||
QC_COMM_YN String? @default("N", map: "DF__BC_COMM_H__QC_CO__48CFD27E") @db.NVarChar(1)
|
QC_COMM_YN String? @default("N", map: "DF__BC_COMM_H__QC_CO__498EEC8D") @db.NVarChar(1)
|
||||||
BC_COMM_L BC_COMM_L[]
|
BC_COMM_L BC_COMM_L[]
|
||||||
|
|
||||||
@@index([HEAD_ID], map: "BC_COMM_H_HEAD_ID_IDX")
|
@@index([HEAD_ID], map: "BC_COMM_H_HEAD_ID_IDX")
|
||||||
|
|||||||
@ -54,7 +54,7 @@ export default function MemberInformationPopup() {
|
|||||||
</div>
|
</div>
|
||||||
<div className="data-input-form-bx">
|
<div className="data-input-form-bx">
|
||||||
<div className="data-input-form-tit">建設ID</div>
|
<div className="data-input-form-tit">建設ID</div>
|
||||||
<input type="text" className="input-frame" defaultValue={session.builderNo ?? ''} disabled />
|
<input type="text" className="input-frame" defaultValue={session.builderId ?? ''} disabled />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{session.role !== 'Partner' && (
|
{session.role !== 'Partner' && (
|
||||||
|
|||||||
@ -2,13 +2,14 @@ import Image from 'next/image'
|
|||||||
import { usePopupController } from '@/store/popupController'
|
import { usePopupController } from '@/store/popupController'
|
||||||
import { useParams } from 'next/navigation'
|
import { useParams } from 'next/navigation'
|
||||||
import { useSurvey } from '@/hooks/useSurvey'
|
import { useSurvey } from '@/hooks/useSurvey'
|
||||||
import { useEffect, useRef, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { useSessionStore } from '@/store/session'
|
import { useSessionStore } from '@/store/session'
|
||||||
import { useCommCode } from '@/hooks/useCommCode'
|
import { useCommCode } from '@/hooks/useCommCode'
|
||||||
import { CommCode } from '@/types/CommCode'
|
import { CommCode } from '@/types/CommCode'
|
||||||
import { sendEmail } from '@/libs/mailer'
|
import { sendEmail } from '@/libs/mailer'
|
||||||
import { useSpinnerStore } from '@/store/spinnerStore'
|
import { useSpinnerStore } from '@/store/spinnerStore'
|
||||||
import { CONFIRM_MESSAGE, SUCCESS_MESSAGE, ERROR_MESSAGE, useAlertMsg, WARNING_MESSAGE } from '@/hooks/useAlertMsg'
|
import { CONFIRM_MESSAGE, SUCCESS_MESSAGE, ERROR_MESSAGE, useAlertMsg, WARNING_MESSAGE } from '@/hooks/useAlertMsg'
|
||||||
|
import { ADMIN_SUBMIT_TARGET_NM } from '@/types/Survey'
|
||||||
|
|
||||||
interface SubmitFormData {
|
interface SubmitFormData {
|
||||||
saleBase: string | null
|
saleBase: string | null
|
||||||
@ -65,6 +66,7 @@ export default function SurveySaleSubmitPopup() {
|
|||||||
setSubmitData((prev) => ({
|
setSubmitData((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
...baseUpdate,
|
...baseUpdate,
|
||||||
|
targetNm: ADMIN_SUBMIT_TARGET_NM,
|
||||||
}))
|
}))
|
||||||
/** Builder, Admin_Sub 제출 폼 데이터 삽입 - 2차 판매점, 2차 판매점 시공권한*/
|
/** Builder, Admin_Sub 제출 폼 데이터 삽입 - 2차 판매점, 2차 판매점 시공권한*/
|
||||||
} else if (session?.role === 'Builder' || session?.role === 'Admin_Sub') {
|
} else if (session?.role === 'Builder' || session?.role === 'Admin_Sub') {
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { Mode, SurveyBasicRequest, SurveyDetailInfo, SurveyDetailRequest } from '@/types/Survey'
|
import type { Mode, SurveyBasicRequest, SurveyDetailInfo, SurveyDetailRequest } from '@/types/Survey'
|
||||||
import { useSessionStore } from '@/store/session'
|
|
||||||
import { useEffect, useState } from 'react'
|
|
||||||
import { useParams, useRouter } from 'next/navigation'
|
|
||||||
import { requiredFields, useSurvey } from '@/hooks/useSurvey'
|
|
||||||
import { usePopupController } from '@/store/popupController'
|
|
||||||
import { CONFIRM_MESSAGE, SUCCESS_MESSAGE, useAlertMsg, WARNING_MESSAGE } from '@/hooks/useAlertMsg'
|
import { CONFIRM_MESSAGE, SUCCESS_MESSAGE, useAlertMsg, WARNING_MESSAGE } from '@/hooks/useAlertMsg'
|
||||||
|
import { ADMIN_SUBMIT_TARGET_NM } from '@/types/Survey'
|
||||||
|
import { useSessionStore } from '@/store/session'
|
||||||
|
import { useParams, useRouter } from 'next/navigation'
|
||||||
|
import { useEffect, useState } from 'react'
|
||||||
|
import { usePopupController } from '@/store/popupController'
|
||||||
|
import { requiredFields, useSurvey } from '@/hooks/useSurvey'
|
||||||
|
|
||||||
interface ButtonFormProps {
|
interface ButtonFormProps {
|
||||||
mode: Mode
|
mode: Mode
|
||||||
@ -68,7 +69,10 @@ export default function ButtonForm({ mode, setMode, data }: ButtonFormProps) {
|
|||||||
const calculatePermissions = (session: any, basicData: SurveyBasicRequest): PermissionState => {
|
const calculatePermissions = (session: any, basicData: SurveyBasicRequest): PermissionState => {
|
||||||
const isSubmiter = calculateSubmitPermission(session, basicData)
|
const isSubmiter = calculateSubmitPermission(session, basicData)
|
||||||
const isWriter = session.userId === basicData.representativeId
|
const isWriter = session.userId === basicData.representativeId
|
||||||
const isReceiver = session?.storeId === basicData.submissionTargetId || session?.storeNm === basicData.submissionTargetNm
|
const isReceiver =
|
||||||
|
session?.storeId === basicData.submissionTargetId ||
|
||||||
|
session?.storeNm === basicData.submissionTargetNm ||
|
||||||
|
(session?.role === 'T01' && basicData.submissionTargetNm === ADMIN_SUBMIT_TARGET_NM)
|
||||||
|
|
||||||
return { isSubmiter, isWriter, isReceiver }
|
return { isSubmiter, isWriter, isReceiver }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,21 +1,19 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { useRouter } from 'next/navigation'
|
|
||||||
import { SurveyBasicInfo } from '@/types/Survey'
|
import { SurveyBasicInfo } from '@/types/Survey'
|
||||||
import { useSurvey } from '@/hooks/useSurvey'
|
import { useSurvey } from '@/hooks/useSurvey'
|
||||||
|
|
||||||
export default function DataTable({ surveyDetail }: { surveyDetail: SurveyBasicInfo }) {
|
export default function DataTable({ surveyDetail }: { surveyDetail: SurveyBasicInfo }) {
|
||||||
const router = useRouter()
|
|
||||||
|
|
||||||
/** 제출 상태 처리 */
|
/** 제출 상태 처리 */
|
||||||
const submitStatus = () => {
|
const submitStatus = () => {
|
||||||
const { submissionTargetNm, submissionTargetId } = surveyDetail ?? {}
|
const { submissionTargetNm, submissionTargetId } = surveyDetail ?? {}
|
||||||
if (!submissionTargetId && !submissionTargetNm) {
|
|
||||||
return <div>( Hanwha Japan )</div>
|
|
||||||
}
|
|
||||||
if (!submissionTargetId && submissionTargetNm) {
|
if (!submissionTargetId && submissionTargetNm) {
|
||||||
return <div>( {submissionTargetNm} )</div>
|
return <div>( {submissionTargetNm} )</div>
|
||||||
}
|
}
|
||||||
|
if (!submissionTargetId && !submissionTargetNm) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
({submissionTargetNm} - {submissionTargetId})
|
({submissionTargetNm} - {submissionTargetId})
|
||||||
|
|||||||
@ -253,7 +253,6 @@ export function useSurvey(
|
|||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
)
|
)
|
||||||
console.log(resp)
|
|
||||||
const blob = await resp.blob()
|
const blob = await resp.blob()
|
||||||
|
|
||||||
if (!blob || blob.size === 0) {
|
if (!blob || blob.size === 0) {
|
||||||
@ -264,7 +263,7 @@ export function useSurvey(
|
|||||||
const url = window.URL.createObjectURL(blob)
|
const url = window.URL.createObjectURL(blob)
|
||||||
const a = document.createElement('a')
|
const a = document.createElement('a')
|
||||||
a.href = url
|
a.href = url
|
||||||
a.download = `${filename}.pdf`
|
a.download = `${filename}`
|
||||||
a.click()
|
a.click()
|
||||||
window.URL.revokeObjectURL(url)
|
window.URL.revokeObjectURL(url)
|
||||||
|
|
||||||
|
|||||||
@ -324,6 +324,7 @@ export type SurveySearchParams = {
|
|||||||
builderId?: string | null
|
builderId?: string | null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const ADMIN_SUBMIT_TARGET_NM = 'Hanwha Japan'
|
||||||
|
|
||||||
type RadioEtcKeys =
|
type RadioEtcKeys =
|
||||||
| 'structureOrder'
|
| 'structureOrder'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user