견적서 복사

This commit is contained in:
basssy 2025-01-11 20:56:21 +09:00
parent 6c4bbbb63f
commit 83260e0adb
4 changed files with 88 additions and 9 deletions

View File

@ -127,6 +127,48 @@ export default function Estimate({}) {
// API // API
// () // ()
// //
if (estimateContextState.resetFlag === 'Y') {
let url = `/api/estimate/special-note-title-list`
get({ url: url }).then((res) => {
if (isNotEmptyArray(res)) {
if (estimateContextState?.estimateOption) {
res.map((row) => {
let estimateOption = estimateContextState?.estimateOption?.split('、')
row.check = false
estimateOption.map((row2) => {
if (row.pkgYn === '0') {
if (row2 === row.code) {
row.check = true
}
} else {
if (row.code.includes(row2)) {
row.check = true
return
}
}
})
if (row.code === 'ATTR003') {
//row.check = true
}
if (row.code === 'ATTR007') {
//row.check = true
}
if (estimateContextState.estimateType === 'YJOD') {
if (row.code === 'ATTR002') {
row.check = true
}
}
})
setSpecialNoteList(res)
setSpecialNoteFirstFlg(true)
}
}
})
}
if (!specialNoteFirstFlg) { if (!specialNoteFirstFlg) {
let url = `/api/estimate/special-note-title-list` let url = `/api/estimate/special-note-title-list`
get({ url: url }).then((res) => { get({ url: url }).then((res) => {
@ -194,7 +236,6 @@ export default function Estimate({}) {
useEffect(() => { useEffect(() => {
// setEstimateContextState // setEstimateContextState
if (isNotEmptyArray(specialNoteList)) { if (isNotEmptyArray(specialNoteList)) {
const liveCheckedData = specialNoteList.filter((row) => row.check === true) const liveCheckedData = specialNoteList.filter((row) => row.check === true)
@ -365,7 +406,6 @@ export default function Estimate({}) {
} }
} }
}) })
setUniqueData(pushData) setUniqueData(pushData)
specialNoteList.map((item) => { specialNoteList.map((item) => {
if (item.pkgYn === '1') { if (item.pkgYn === '1') {
@ -384,6 +424,7 @@ export default function Estimate({}) {
} }
} }
}) })
setEstimateContextState({ setEstimateContextState({
specialNoteList: specialNoteList, specialNoteList: specialNoteList,
uniqueData: uniqueData, uniqueData: uniqueData,
@ -761,6 +802,9 @@ export default function Estimate({}) {
} }
useEffect(() => { useEffect(() => {
if (estimateContextState.resetFlag === 'Y') {
makeUniqueSpecialNoteCd(estimateContextState.itemList)
}
if (itemChangeYn) { if (itemChangeYn) {
let totals = { let totals = {
totAmount: 0, totAmount: 0,
@ -923,7 +967,7 @@ export default function Estimate({}) {
} }
useEffect(() => { useEffect(() => {
// console.log('::', estimateContextState.resetFlag) setSpecialNoteFirstFlg(false)
}, [estimateContextState.resetFlag]) }, [estimateContextState.resetFlag])
return ( return (
@ -1006,7 +1050,14 @@ export default function Estimate({}) {
</th> </th>
<td> <td>
<div className="input-wrap" style={{ width: '350px' }}> <div className="input-wrap" style={{ width: '350px' }}>
<input type="text" className="input-light" defaultValue={estimateContextState?.charger} onBlur={handleBlurCharger} /> {/* <input type="text" className="input-light" defaultValue={estimateContextState?.charger} onBlur={handleBlurCharger} /> */}
<input
type="text"
className="input-light"
value={estimateContextState?.charger}
onBlur={handleBlurCharger}
onChange={handleBlurCharger}
/>
</div> </div>
</td> </td>
</tr> </tr>
@ -1018,7 +1069,14 @@ export default function Estimate({}) {
<td colSpan={3}> <td colSpan={3}>
<div className="form-flex-wrap"> <div className="form-flex-wrap">
<div className="input-wrap mr5" style={{ width: '610px' }}> <div className="input-wrap mr5" style={{ width: '610px' }}>
<input type="text" className="input-light" defaultValue={estimateContextState?.objectName} onBlur={handleBlurObjectName} /> {/* <input type="text" className="input-light" defaultValue={estimateContextState?.objectName} onBlur={handleBlurObjectName} /> */}
<input
type="text"
className="input-light"
value={estimateContextState?.objectName}
onBlur={handleBlurObjectName}
onChange={handleBlurObjectName}
/>
</div> </div>
<div className="select-wrap" style={{ width: '200px' }}> <div className="select-wrap" style={{ width: '200px' }}>
<Select <Select
@ -1125,7 +1183,14 @@ export default function Estimate({}) {
<th>{getMessage('estimate.detail.remarks')}</th> <th>{getMessage('estimate.detail.remarks')}</th>
<td colSpan={3}> <td colSpan={3}>
<div className="input-wrap"> <div className="input-wrap">
<input type="text" className="input-light" defaultValue={estimateContextState?.remarks || ''} onBlur={handleBlurRemarks} /> {/* <input type="text" className="input-light" defaultValue={estimateContextState?.remarks || ''} onBlur={handleBlurRemarks} /> */}
<input
type="text"
className="input-light"
value={estimateContextState?.remarks || ''}
onBlur={handleBlurRemarks}
onChange={handleBlurRemarks}
/>
</div> </div>
</td> </td>
</tr> </tr>

View File

@ -43,6 +43,7 @@ import JA from '@/locales/ja.json'
import { MENU } from '@/common/common' import { MENU } from '@/common/common'
import { QcastContext } from '@/app/QcastProvider'
export default function CanvasMenu(props) { export default function CanvasMenu(props) {
const { menuNumber, setMenuNumber } = props const { menuNumber, setMenuNumber } = props
const pathname = usePathname() const pathname = usePathname()
@ -93,6 +94,8 @@ export default function CanvasMenu(props) {
const { promiseGet, promisePost } = useAxios(globalLocale) const { promiseGet, promisePost } = useAxios(globalLocale)
const pwrGnrSimTypeRecoil = useRecoilValue(pwrGnrSimTypeState) const pwrGnrSimTypeRecoil = useRecoilValue(pwrGnrSimTypeState)
const { setIsGlobalLoading } = useContext(QcastContext)
const handleExcelPdfFileDown = async (donwloadType, drawingFlg) => { const handleExcelPdfFileDown = async (donwloadType, drawingFlg) => {
const url = '/api/estimate/excel-download' const url = '/api/estimate/excel-download'
@ -264,9 +267,18 @@ export default function CanvasMenu(props) {
userId: sessionState.userId, userId: sessionState.userId,
} }
// //
await promisePost({ url: '/api/estimate/reset-estimate', data: params }).then((res) => { try {
fetchSetting(objectNo, pid, 'R') await promisePost({ url: '/api/estimate/reset-estimate', data: params }).then((res) => {
}) setIsGlobalLoading(true)
if (res.status === 201) {
swalFire({ text: getMessage('estimate.detail.copy.alertMsg'), type: 'alert' })
fetchSetting(objectNo, pid, 'R')
}
})
} catch (error) {
setIsGlobalLoading(false)
console.log('error::::::::::::', e.response.data.message)
}
}, },
denyFn: () => { denyFn: () => {
console.log('초기화하지 않음. 변경일시 갱신안함') console.log('초기화하지 않음. 변경일시 갱신안함')

View File

@ -921,6 +921,7 @@
"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.copy.alertMsg": "コピーしました.",
"estimate.detail.save.requiredFileUpload": "ファイル添付が必須のアイテムがあります。ファイルを添付するか、後日添付をチェックしてください.", "estimate.detail.save.requiredFileUpload": "ファイル添付が必須のアイテムがあります。ファイルを添付するか、後日添付をチェックしてください.",
"estimate.detail.save.requiredItem": "製品は1つ以上登録する必要があります.", "estimate.detail.save.requiredItem": "製品は1つ以上登録する必要があります.",
"estimate.detail.save.requiredCharger": "担当者は必須です.", "estimate.detail.save.requiredCharger": "担当者は必須です.",

View File

@ -930,6 +930,7 @@
"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.copy.alertMsg": "복사되었습니다.",
"estimate.detail.save.requiredFileUpload": "파일첨부가 필수인 아이템이 있습니다. 파일을 첨부하거나 후일첨부를 체크해주십시오.", "estimate.detail.save.requiredFileUpload": "파일첨부가 필수인 아이템이 있습니다. 파일을 첨부하거나 후일첨부를 체크해주십시오.",
"estimate.detail.save.requiredItem": "제품은 1개이상 등록해야 됩니다.", "estimate.detail.save.requiredItem": "제품은 1개이상 등록해야 됩니다.",
"estimate.detail.save.requiredCharger": "담당자는 필수값 입니다.", "estimate.detail.save.requiredCharger": "담당자는 필수값 입니다.",