From 7e598bcc13661c446b3ae67770ec7d599142d2c8 Mon Sep 17 00:00:00 2001 From: basssy Date: Fri, 1 Nov 2024 09:53:45 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9E=84=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/management/StuffDetail.jsx | 187 +++--------------- .../management/StuffSearchCondition.jsx | 2 +- .../management/popup/PlanRequestPop.jsx | 12 +- 3 files changed, 39 insertions(+), 162 deletions(-) diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx index 740bf38e..dc0ce981 100644 --- a/src/components/management/StuffDetail.jsx +++ b/src/components/management/StuffDetail.jsx @@ -247,7 +247,6 @@ export default function StuffDetail() { } } - console.log('buttonStyle:::', buttonStyle, params.value) return ( <>
@@ -323,18 +322,12 @@ export default function StuffDetail() { let favList // if (sessionState?.storeId === 'T01') { if (session?.storeId === 'T01') { - console.log('신규T01::::::::::::::::::::::::::::::::::::') - // url = `/api/object/saleStore/${sessionState?.storeId}/list?userId=${sessionState?.userId}` url = `/api/object/saleStore/${session?.storeId}/firstList?userId=${session?.userId}` } else { - // url = `/api/object/saleStore/${sessionState?.storeId}/list` if (session.storeLvl === '1') { - console.log('로그인이1차:::::::') - //url = `/api/object/saleStore/${session?.storeId}/list` url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${sessionState?.userId}` } else { - console.log('로그인이2차:::') - url = `` + url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}` } } @@ -386,61 +379,26 @@ export default function StuffDetail() { setOtherSaleStoreList(otherList) } else { - console.log('1차점아님:::::::::', res) + //10X22, 201X112,202X217 + firstList = res.filter((row) => row.firstAgentYn === 'Y') + setSaleStoreList(firstList) + setFavoriteStoreList(firstList) + setShowSaleStoreList(firstList) + setSelOptions(firstList[0].saleStoreId) + + form.setValue('saleStoreId', firstList[0].saleStoreId) + form.setValue('saleStoreLevel', firstList[0].saleStoreLevel) + + otherList = res.filter((row) => row.firstAgentYn === 'N') + setOtherSaleStoreList(otherList) + //2차 판매점명/ID는 본인을 셀렉트 + setOtherSelOptions(session?.storeId) + form.setValue('otherSaleStoreId', session?.storeId) + form.setValue('otherSaleStoreLevel', session?.storeLvl) } } } }) - - // get({ url: url }).then((res) => { - // if (!isEmptyArray(res)) { - // const firstList = res.filter((row) => row.saleStoreLevel === '1') - // let favList - // // if (sessionState?.storeId === 'T01') { - // if (session?.storeId === 'T01') { - // firstList.sort((a, b) => (a.saleStoreId !== 'T01') - (b.saleStoreId !== 'T01') || a.saleStoreId - b.saleStoreId) - // favList = firstList.filter((row) => row.saleStoreId === 'T01' || row.priority !== 'B') - // setSaleStoreList(firstList) - // setFavoriteStoreList(favList) - // setShowSaleStoreList(favList) - // } else { - // //1차점 셀렉트박스 - // setSaleStoreList(firstList) - // } - // const otherList = res.filter((row) => row.saleStoreLevel !== '1') - // let filterOtherList - // // if (sessionState?.storeId === 'T01') { - // if (session?.storeId === 'T01') { - // filterOtherList = otherList.filter((row) => row.firstAgentId === 'T01') - - // setOriginOtherSaleStoreList(filterOtherList) - // setOtherSaleStoreList(filterOtherList) - // } else { - // //T01 아니고 2차점 판매점 셀렉트박스 - // setOriginOtherSaleStoreList(otherList) - // setOtherSaleStoreList(otherList) - // } - - // // if (sessionState?.storeLvl === '1') { - // if (session?.storeLvl === '1') { - // // setSelOptions(sessionState?.storeId) - // setSelOptions(session?.storeId) - // // form.setValue('saleStoreId', sessionState?.storeId) - // form.setValue('saleStoreId', session?.storeId) - // // form.setValue('saleStoreLevel', sessionState?.storeLvl) - // form.setValue('saleStoreLevel', session?.storeLvl) - // } else { - // setSelOptions(firstList[0].saleStoreId) - // // setOtherSelOptions(sessionState?.storeId) - // setOtherSelOptions(session?.storeId) - // form.setValue('saleStoreId', firstList[0].saleStoreId) - // // form.setValue('otherSaleStoreId', sessionState?.storeId) - // form.setValue('otherSaleStoreId', session?.storeId) - // // form.setValue('otherSaleStoreLevel', sessionState?.storeLvl) - // form.setValue('otherSaleStoreLevel', session?.storeLvl) - // } - // } - // }) } // }, [objectNo, sessionState]) }, [objectNo, session]) @@ -659,6 +617,7 @@ export default function StuffDetail() { if (editMode === 'NEW') { if (planReqNo !== '') { + // console.log('삭제됩니다1111111111111') if (confirm(getMessage('stuff.detail.confirm.message1'))) { delFlg = true } else { @@ -668,6 +627,7 @@ export default function StuffDetail() { } else { // EDIT if (planReqNo !== null && planReqNo !== '') { + // console.log('삭제됩니다2222222222222') if (confirm(getMessage('stuff.detail.confirm.message1'))) { delFlg = true } else { @@ -680,6 +640,8 @@ export default function StuffDetail() { if (objectNo) { tempObjectNo = objectNo.substring(0, 1) } + + // console.log('설계의뢰있을때 1차점 변경 ::::::::::tempObjectNo:::::::', tempObjectNo, planReqNo, delFlg) if (tempObjectNo === 'T') { if (planReqNo) { if (delFlg) { @@ -692,7 +654,7 @@ export default function StuffDetail() { setSelOptions(key.saleStoreId) //선택한 1차점 정보로 2차점 list 추리기 //長府工産株式会社 大阪支社 - console.log('여기도?????????????????????') + console.log('111111??????111???????????????') // let newOtherSaleStoreList = originOtherSaleStoreList.filter((row) => row.firstAgentId === key.saleStoreId) // setOtherSaleStoreList(newOtherSaleStoreList) } else { @@ -716,12 +678,9 @@ export default function StuffDetail() { form.setValue('saleStoreName', key.saleStoreName) form.setValue('saleStoreLevel', key.saleStoreLevel) //선택한 1차점 정보로 2차점 조회하기 - //長府工産株式会社 大阪支社 - console.log('바꿔조ㅜㅝ............', key.saleStoreId) let url = `/api/object/saleStore/${key.saleStoreId}/list?firstFlg=0&userId=${session?.userId}` let otherList get({ url: url }).then((res) => { - console.log('고른1차점으로 2차점목록조회결과;:::', res) if (!isEmptyArray(res)) { res.map((row) => { row.value = row.saleStoreId @@ -729,7 +688,6 @@ export default function StuffDetail() { }) otherList = res - console.log('otherList::::::::', otherList) setOtherSaleStoreList(otherList) setOtherSelOptions('') form.setValue('otherSaleStoreId', '') @@ -766,7 +724,7 @@ export default function StuffDetail() { setSelOptions(key.saleStoreId) //선택한 1차점 정보로 2차점 list 추리기 //長府工産株式会社 大阪支社 - console.log('여기도용') + console.log('3333333333333') // let newOtherSaleStoreList = originOtherSaleStoreList.filter((row) => row.firstAgentId === key.saleStoreId) // setOtherSaleStoreList(newOtherSaleStoreList) } else { @@ -818,6 +776,7 @@ export default function StuffDetail() { if (objectNo) { tempObjectNo = objectNo.substring(0, 1) } + if (tempObjectNo === 'T') { if (planReqNo) { if (delFlg) { @@ -1306,16 +1265,7 @@ export default function StuffDetail() { // params.saleStoreLevel = sessionState.storeLvl params.saleStoreLevel = session.storeLvl } - //수직적설량, 설치높이 0인지 체크 - // let snow = params.verticalSnowCover - // let height = params.installHeight - // if (snow === '0') { - // return alert(getMessage('stuff.detail.save.valierror1')) - // } - // if (height === '0') { - // return alert(getMessage('stuff.detail.save.valierror2')) - // } await promisePost({ url: '/api/object/save-object', data: params }).then((res) => { if (res.status === 201) { alert(getMessage('stuff.detail.tempSave.message1')) @@ -1389,7 +1339,7 @@ export default function StuffDetail() { )) || null}
- @@ -1491,12 +1441,9 @@ export default function StuffDetail() { onChange={onSelectionChange} getOptionLabel={(x) => x.saleStoreName} getOptionValue={(x) => x.saleStoreId} - // isClearable={sessionState?.storeLvl === '1' ? true : false} - isClearable={session?.storeLvl === '1' ? true : false} - // isDisabled={sessionState?.storeLvl !== '1' ? true : false} + isClearable={true} isDisabled={session?.storeLvl !== '1' ? true : false} value={saleStoreList.filter(function (option) { - // console.log('showSaleStoreList:::::', option.saleStoreId) return option.saleStoreId === selOptions })} > @@ -1516,7 +1463,6 @@ export default function StuffDetail() { {/* {sessionState?.storeId !== 'T01' && sessionState?.storeLvl === '1' && ( */} {session?.storeId !== 'T01' && session?.storeLvl === '1' && ( <> - 신규 T01아닌 1차점
x.saleStoreName} - getOptionValue={(x) => x.saleStoreId} - // isClearable={sessionState?.storeLvl === '1' ? true : false} - isClearable={session?.storeLvl === '1' ? true : false} - // isDisabled={sessionState?.storeLvl !== '1' ? true : false} - isDisabled={session?.storeLvl !== '1' ? true : false} - value={saleStoreList.filter(function (option) { - return option.saleStoreId === selOptions - })} - > -
-
- -
- - )} - - {/* {(sessionState?.storeId === 'T01' && ( <>
x.saleStoreName} - getOptionValue={(x) => x.saleStoreId} - isClearable={sessionState?.storeLvl === '1' ? true : false} - isDisabled={sessionState?.storeLvl !== '1' ? true : false} - value={saleStoreList.filter(function (option) { - return option.saleStoreId === selOptions - })} - > -
-
- -
- - )} */} + )} @@ -1672,10 +1551,8 @@ export default function StuffDetail() { onChange={onSelectionChange2} getOptionLabel={(x) => x.saleStoreName} getOptionValue={(x) => x.saleStoreId} - // isDisabled={session?.storeLvl === '1' && form.watch('saleStoreId') != '' ? false : true} - isDisabled={session?.storeLvl === '1' && form.watch('saleStoreId') != '' && otherSaleStoreList.length > 1 ? false : true} - // isClearable={sessionState?.storeLvl === '1' ? true : false} - isClearable={session?.storeLvl === '1' ? true : false} + isDisabled={otherSaleStoreList.length > 1 ? false : true} + isClearable={true} value={otherSaleStoreList.filter(function (option) { return option.saleStoreId === otherSelOptions })} diff --git a/src/components/management/StuffSearchCondition.jsx b/src/components/management/StuffSearchCondition.jsx index 127329cb..7da382f9 100644 --- a/src/components/management/StuffSearchCondition.jsx +++ b/src/components/management/StuffSearchCondition.jsx @@ -240,7 +240,7 @@ export default function StuffSearchCondition() { schSelSaleStoreId: allList[0].saleStoreId, }) } else { - //201X112 그냥2차점 + //10X22, 201X112 그냥2차점 //2차점인데 34들고있는애 202X217 setSchSelSaleStoreList(res) setFavoriteStoreList(res) diff --git a/src/components/management/popup/PlanRequestPop.jsx b/src/components/management/popup/PlanRequestPop.jsx index bbe0f6c9..bec3c223 100644 --- a/src/components/management/popup/PlanRequestPop.jsx +++ b/src/components/management/popup/PlanRequestPop.jsx @@ -87,10 +87,10 @@ export default function PlanRequestPop(props) { const onSubmit = (page, type) => { //2차점 테스트 201X112 const params = { - // saleStoreId: 'T100', - // saleStoreLevel: '1', - saleStoreId: props?.otherSaleStoreId ? props.otherSaleStoreId : props.saleStoreId, - saleStoreLevel: props?.otherSaleStoreLevel ? props.otherSaleStoreLevel : props.saleStoreLevel, + saleStoreId: 'T100', + saleStoreLevel: '1', + // saleStoreId: props?.otherSaleStoreId ? props.otherSaleStoreId : props.saleStoreId, + // saleStoreLevel: props?.otherSaleStoreLevel ? props.otherSaleStoreLevel : props.saleStoreLevel, schPlanReqNo: schPlanReqNo, schTitle: schTitle, schAddress: schAddress, @@ -98,8 +98,8 @@ export default function PlanRequestPop(props) { schPlanReqName: schPlanReqName, schPlanStatCd: schPlanStatCd, schDateGbn: schDateGbn, - schStartDt: dayjs(startDate).format('YYYY-MM-DD'), - schEndDt: dayjs(endDate).format('YYYY-MM-DD'), + // schStartDt: dayjs(startDate).format('YYYY-MM-DD'), + // schEndDt: dayjs(endDate).format('YYYY-MM-DD'), startRow: type === 'S' ? (1 - 1) * pageSize + 1 : (page - 1) * pageSize + 1, endRow: type === 'S' ? 1 * pageSize : page * pageSize, }