견적서 상세
This commit is contained in:
parent
6ad0b8f9d4
commit
dce88e6406
@ -569,6 +569,20 @@ export default function Estimate({ params }) {
|
|||||||
}
|
}
|
||||||
}, [itemChangeYn, state.itemList])
|
}, [itemChangeYn, state.itemList])
|
||||||
|
|
||||||
|
//안건명 인풋 변경
|
||||||
|
const handleBlurObjectName = (e) => {
|
||||||
|
setState({ objectName: e.target.value })
|
||||||
|
}
|
||||||
|
|
||||||
|
//담당자 인풋 변경
|
||||||
|
const handleBlurCharger = (e) => {
|
||||||
|
setState({ charger: e.target.value })
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
console.log('상세정보???????????', state)
|
||||||
|
console.log('업뎃날짜시간???????????', state.lastEditDatetime)
|
||||||
|
}, [state])
|
||||||
return (
|
return (
|
||||||
<div className="sub-content estimate">
|
<div className="sub-content estimate">
|
||||||
<div className="sub-content-inner">
|
<div className="sub-content-inner">
|
||||||
@ -594,7 +608,8 @@ export default function Estimate({ params }) {
|
|||||||
</div>
|
</div>
|
||||||
<div className="estimate-box">
|
<div className="estimate-box">
|
||||||
<div className="estimate-tit">{getMessage('estimate.detail.lastEditDatetime')}</div>
|
<div className="estimate-tit">{getMessage('estimate.detail.lastEditDatetime')}</div>
|
||||||
<div className="estimate-name">{state?.lastEditDatetime ? `${dayjs(state.lastEditDatetime).format('YYYY.MM.DD HH:mm')}` : ''}</div>
|
{/* <div className="estimate-name">{state?.lastEditDatetime ? `${dayjs(state.lastEditDatetime).format('YYYY.MM.DD HH:mm')}` : ''}</div> */}
|
||||||
|
<div className="estimate-name">{state?.lastEditDatetime ? `${dayjs(state?.lastEditDatetime).format('HH:mm:ss')}` : ''}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -645,10 +660,11 @@ export default function Estimate({ params }) {
|
|||||||
type="text"
|
type="text"
|
||||||
className="input-light"
|
className="input-light"
|
||||||
defaultValue={state?.charger}
|
defaultValue={state?.charger}
|
||||||
onChange={(e) => {
|
// onChange={(e) => {
|
||||||
//담당자 charger
|
// //담당자 charger
|
||||||
setState({ charger: e.target.value })
|
// setState({ charger: e.target.value })
|
||||||
}}
|
// }}
|
||||||
|
onBlur={handleBlurCharger}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@ -665,10 +681,11 @@ export default function Estimate({ params }) {
|
|||||||
type="text"
|
type="text"
|
||||||
className="input-light"
|
className="input-light"
|
||||||
defaultValue={state?.objectName}
|
defaultValue={state?.objectName}
|
||||||
onChange={(e) => {
|
// onChange={(e) => {
|
||||||
//안건명 objectName
|
// //안건명 objectName
|
||||||
setState({ objectName: e.target.value })
|
// setState({ objectName: e.target.value })
|
||||||
}}
|
// }}
|
||||||
|
onBlur={handleBlurObjectName}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="select-wrap" style={{ width: '200px' }}>
|
<div className="select-wrap" style={{ width: '200px' }}>
|
||||||
@ -688,7 +705,7 @@ export default function Estimate({ params }) {
|
|||||||
}}
|
}}
|
||||||
getOptionLabel={(x) => x.clCodeNm}
|
getOptionLabel={(x) => x.clCodeNm}
|
||||||
getOptionValue={(x) => x.clCode}
|
getOptionValue={(x) => x.clCode}
|
||||||
isClearable={true}
|
isClearable={false}
|
||||||
isSearchable={false}
|
isSearchable={false}
|
||||||
value={honorificCodeList.filter(function (option) {
|
value={honorificCodeList.filter(function (option) {
|
||||||
return option.clCodeNm === state.objectNameOmit
|
return option.clCodeNm === state.objectNameOmit
|
||||||
|
|||||||
@ -47,6 +47,7 @@ export const useEstimateController = (planNo) => {
|
|||||||
|
|
||||||
const [isLoading, setIsLoading] = useState(false)
|
const [isLoading, setIsLoading] = useState(false)
|
||||||
const [state, setState] = useReducer(reducer, defaultEstimateData)
|
const [state, setState] = useReducer(reducer, defaultEstimateData)
|
||||||
|
const [newState, setNewState] = useState({})
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (planNo && !isLoading) {
|
if (planNo && !isLoading) {
|
||||||
@ -66,7 +67,8 @@ export const useEstimateController = (planNo) => {
|
|||||||
item.delFlg = '0'
|
item.delFlg = '0'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
console.log('조회 결과::::', res)
|
||||||
|
console.log('수정일::::', res.lastEditDatetime)
|
||||||
setState(res)
|
setState(res)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -142,24 +144,41 @@ export const useEstimateController = (planNo) => {
|
|||||||
const handleEstimateSubmit = async () => {
|
const handleEstimateSubmit = async () => {
|
||||||
//0. 필수체크
|
//0. 필수체크
|
||||||
let flag = true
|
let flag = true
|
||||||
|
if (estimateData.charger.trim().length === 0) {
|
||||||
|
flag = false
|
||||||
|
return alert(getMessage('estimate.detail.save.requiredCharger'))
|
||||||
|
}
|
||||||
|
|
||||||
|
if (estimateData.objectName.trim().length === 0) {
|
||||||
|
flag = false
|
||||||
|
return alert(getMessage('estimate.detail.save.requiredObjectName'))
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isNaN(Date.parse(estimateData.estimateDate))) {
|
||||||
|
flag = false
|
||||||
|
return alert(getMessage('estimate.detail.save.requiredEstimateDate'))
|
||||||
|
}
|
||||||
|
|
||||||
// console.log('첨부파일:::::', estimateData.fileList)
|
// console.log('첨부파일:::::', estimateData.fileList)
|
||||||
//첨부파일을 첨부안했는데
|
//첨부파일을 첨부안했는데
|
||||||
//아이템 fileUploadFlg가1(첨부파일 필수)이 1개라도 있는데 후일 자료 제출(fileFlg) 체크안했으면(0) alert 저장안돼
|
//아이템 fileUploadFlg가1(첨부파일 필수)이 1개라도 있는데 후일 자료 제출(fileFlg) 체크안했으면(0) alert 저장안돼
|
||||||
|
let fileFlg = true
|
||||||
if (estimateData.fileList.length < 1) {
|
if (estimateData.fileList.length < 1) {
|
||||||
if (estimateData.itemList.length > 1) {
|
if (estimateData.itemList.length > 1) {
|
||||||
estimateData.itemList.map((row) => {
|
estimateData.itemList.map((row) => {
|
||||||
if (row.fileUploadFlg === '1') {
|
if (row.fileUploadFlg === '1') {
|
||||||
|
if (fileFlg) {
|
||||||
if (estimateData.fileFlg === '0') {
|
if (estimateData.fileFlg === '0') {
|
||||||
alert(getMessage('estimate.detail.save.requiredMsg'))
|
fileFlg = false
|
||||||
flag = false
|
return alert(getMessage('estimate.detail.save.requiredFileUpload'))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag) {
|
if (flag && fileFlg) {
|
||||||
//1. 첨부파일 저장시작
|
//1. 첨부파일 저장시작
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
formData.append('file', estimateData.fileList)
|
formData.append('file', estimateData.fileList)
|
||||||
@ -184,8 +203,7 @@ export const useEstimateController = (planNo) => {
|
|||||||
return alert(getMessage('estimate.detail.save.requiredItem'))
|
return alert(getMessage('estimate.detail.save.requiredItem'))
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log('최종 남은 아이템정보:::', estimateData.itemList)
|
// console.log('최종 정보::;', estimateData)
|
||||||
console.log('최종 정보::;', estimateData)
|
|
||||||
|
|
||||||
//2. 상세데이터 저장
|
//2. 상세데이터 저장
|
||||||
// return
|
// return
|
||||||
|
|||||||
@ -887,8 +887,11 @@
|
|||||||
"estimate.detail.productFeaturesPopup.requiredStoreId": "一次販売店は必須です.",
|
"estimate.detail.productFeaturesPopup.requiredStoreId": "一次販売店は必須です.",
|
||||||
"estimate.detail.productFeaturesPopup.requiredReceiveUser": "担当者は必須です.",
|
"estimate.detail.productFeaturesPopup.requiredReceiveUser": "担当者は必須です.",
|
||||||
"estimate.detail.save.alertMsg": "保存されている見積書で製品を変更した場合、図面や回路には反映されません.",
|
"estimate.detail.save.alertMsg": "保存されている見積書で製品を変更した場合、図面や回路には反映されません.",
|
||||||
"estimate.detail.save.requiredMsg": "ファイル添付が必須のアイテムがあります。ファイルを添付するか、後日添付をチェックしてください.",
|
"estimate.detail.save.requiredFileUpload": "ファイル添付が必須のアイテムがあります。ファイルを添付するか、後日添付をチェックしてください.",
|
||||||
"estimate.detail.save.requiredItem": "製品は1つ以上登録する必要があります.",
|
"estimate.detail.save.requiredItem": "製品は1つ以上登録する必要があります.",
|
||||||
|
"estimate.detail.save.requiredCharger": "担当者は必須です.",
|
||||||
|
"estimate.detail.save.requiredObjectName": "案件名は必須です.",
|
||||||
|
"estimate.detail.save.requiredEstimateDate": "見積日は必須です.",
|
||||||
"estimate.detail.reset.confirmMsg": "保存した見積書情報が初期化され、図面情報が反映されます。本当に初期化しますか?",
|
"estimate.detail.reset.confirmMsg": "保存した見積書情報が初期化され、図面情報が反映されます。本当に初期化しますか?",
|
||||||
"simulator.title.sub1": "物件番号",
|
"simulator.title.sub1": "物件番号",
|
||||||
"simulator.title.sub2": "作成日",
|
"simulator.title.sub2": "作成日",
|
||||||
|
|||||||
@ -897,8 +897,11 @@
|
|||||||
"estimate.detail.productFeaturesPopup.requiredStoreId": "1차 판매점은 필수값 입니다.",
|
"estimate.detail.productFeaturesPopup.requiredStoreId": "1차 판매점은 필수값 입니다.",
|
||||||
"estimate.detail.productFeaturesPopup.requiredReceiveUser": "담당자는 필수값 입니다.",
|
"estimate.detail.productFeaturesPopup.requiredReceiveUser": "담당자는 필수값 입니다.",
|
||||||
"estimate.detail.save.alertMsg": "저장되었습니다. 견적서에서 제품을 변경할 경우, 도면 및 회로에 반영되지 않습니다.",
|
"estimate.detail.save.alertMsg": "저장되었습니다. 견적서에서 제품을 변경할 경우, 도면 및 회로에 반영되지 않습니다.",
|
||||||
"estimate.detail.save.requiredMsg": "파일첨부가 필수인 아이템이 있습니다. 파일을 첨부하거나 후일첨부를 체크해주십시오.",
|
"estimate.detail.save.requiredFileUpload": "파일첨부가 필수인 아이템이 있습니다. 파일을 첨부하거나 후일첨부를 체크해주십시오.",
|
||||||
"estimate.detail.save.requiredItem": "제품은 1개이상 등록해야 됩니다.",
|
"estimate.detail.save.requiredItem": "제품은 1개이상 등록해야 됩니다.",
|
||||||
|
"estimate.detail.save.requiredCharger": "담당자는 필수값 입니다.",
|
||||||
|
"estimate.detail.save.requiredObjectName": "안건명은 필수값 입니다.",
|
||||||
|
"estimate.detail.save.requiredEstimateDate": "견적일은 필수값 입니다.",
|
||||||
"estimate.detail.reset.confirmMsg": "저장된 견적서 정보가 초기화되고, 도면정보가 반영됩니다. 정말로 초기화 하시겠습니까?",
|
"estimate.detail.reset.confirmMsg": "저장된 견적서 정보가 초기화되고, 도면정보가 반영됩니다. 정말로 초기화 하시겠습니까?",
|
||||||
"simulator.title.sub1": "물건번호",
|
"simulator.title.sub1": "물건번호",
|
||||||
"simulator.title.sub2": "작성일",
|
"simulator.title.sub2": "작성일",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user