diff --git a/src/components/management/Stuff.jsx b/src/components/management/Stuff.jsx index 58b1c002..fb7ecd76 100644 --- a/src/components/management/Stuff.jsx +++ b/src/components/management/Stuff.jsx @@ -190,9 +190,11 @@ export default function Stuff() { }) } - if (stuffSearch.schSelSaleStoreId !== '') { - fetchData() - } + //if (session.storeId === 'T01') { + fetchData() + //} else if (stuffSearch.schSelSaleStoreId !== '') { + //fetchData() + //} } else if (stuffSearchParams?.code === 'M') { const params = { saleStoreId: session?.storeId, diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx index 61cdc1df..602c6354 100644 --- a/src/components/management/StuffDetail.jsx +++ b/src/components/management/StuffDetail.jsx @@ -59,7 +59,7 @@ export default function StuffDetail() { standardWindSpeedId: '', //기준풍속 verticalSnowCover: '', //수직적설량 coldRegionFlg: false, //한랭지대책시행(true : 1 / false : 0) - surfaceType: 'III・IV', //면조도구분(III・IV / Ⅱ) + surfaceType: 'Ⅲ・Ⅳ', //면조도구분(Ⅲ・Ⅳ / Ⅱ) saltAreaFlg: false, //염해지역용아이템사용 (true : 1 / false : 0) installHeight: '', //설치높이 conType: '0', //계약조건(잉여 / 전량) @@ -550,7 +550,7 @@ export default function StuffDetail() { //면조도구분 surfaceType null로 내려오면 셋팅 안하고 저장할때 필수값 체크하도록 // form.setValue('surfaceType', 'Ⅱ') - // form.setValue('surfaceType', 'III・IV') + // form.setValue('surfaceType', 'Ⅲ・Ⅳ') form.setValue('surfaceType', detailData.surfaceType) //염해지역용아이템사용 saltAreaFlg 1이면 true form.setValue('saltAreaFlg', detailData.saltAreaFlg === '1' ? true : false) @@ -872,6 +872,9 @@ export default function StuffDetail() { form.setValue('standardWindSpeedId', `WL_${info.windSpeed}`) form.setValue('verticalSnowCover', info.verticalSnowCover) form.setValue('surfaceType', info.surfaceType) + if (info.surfaceType === 'Ⅱ') { + form.setValue('saltAreaFlg', true) + } form.setValue('installHeight', info.installHeight) form.setValue('remarks', info.remarks) @@ -893,6 +896,15 @@ export default function StuffDetail() { form.setValue('standardWindSpeedId', info.windSpeed) } + //면조도구분surfaceType & 염해지역용아이템사용saltAreaFlg 컨트롤 + const handleRadioChange = (e) => { + if (e.target.value === 'Ⅱ') { + form.setValue('saltAreaFlg', true) + } else { + form.setValue('saltAreaFlg', false) + } + } + //receiveUser: '', //담당자 const _receiveUser = watch('receiveUser') //objectName: '', //물건명 @@ -1561,7 +1573,7 @@ export default function StuffDetail() { onChange={onSelectionChange2} getOptionLabel={(x) => x.saleStoreName} getOptionValue={(x) => x.saleStoreId} - isDisabled={otherSaleStoreList.length > 1 ? false : true} + isDisabled={otherSaleStoreList.length > 0 ? false : true} isClearable={true} value={otherSaleStoreList.filter(function (option) { return option.saleStoreId === otherSelOptions @@ -1715,11 +1727,29 @@ export default function StuffDetail() {
- - + { + handleRadioChange(e) + }} + /> +
- + { + handleRadioChange(e) + }} + />
@@ -2211,11 +2241,29 @@ export default function StuffDetail() {
- - + { + handleRadioChange(e) + }} + /> +
- + { + handleRadioChange(e) + }} + />
diff --git a/src/components/management/StuffSearchCondition.jsx b/src/components/management/StuffSearchCondition.jsx index 7bd8f456..59a4d23c 100644 --- a/src/components/management/StuffSearchCondition.jsx +++ b/src/components/management/StuffSearchCondition.jsx @@ -184,34 +184,36 @@ export default function StuffSearchCondition() { setSchSelSaleStoreList(allList) setFavoriteStoreList(favList) setShowSaleStoreList(favList) - setSchSelSaleStoreId(session?.storeId) + // setSchSelSaleStoreId(session?.storeId) setStuffSearch({ ...stuffSearch, code: 'S', - schSelSaleStoreId: session?.storeId, + // schSelSaleStoreId: session?.storeId, }) //T01일때 2차 판매점 호출하기 디폴트로 1차점을 본인으로 셋팅해서 세션storeId사용 - url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=0&userId=${session?.userId}` + // 디폴트 셋팅 안하기로 + // url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=0&userId=${session?.userId}` - get({ url: url }).then((res) => { - if (!isEmptyArray(res)) { - res.map((row) => { - row.value = row.saleStoreId - row.label = row.saleStoreName - }) + // get({ url: url }).then((res) => { + // if (!isEmptyArray(res)) { + // res.map((row) => { + // row.value = row.saleStoreId + // row.label = row.saleStoreName + // }) - otherList = res - setOtherSaleStoreList(otherList) - } else { - setOtherSaleStoreList([]) - } - }) + // otherList = res + // setOtherSaleStoreList(otherList) + // } else { + // setOtherSaleStoreList([]) + // } + // }) } else { if (session?.storeLvl === '1') { allList = res favList = res.filter((row) => row.priority !== 'B') otherList = res.filter((row) => row.firstAgentYn === 'N') + setSchSelSaleStoreList(allList) setFavoriteStoreList(allList) setShowSaleStoreList(allList) @@ -584,7 +586,7 @@ export default function StuffSearchCondition() { onChange={onSelectionChange2} getOptionLabel={(x) => x.saleStoreName} getOptionValue={(x) => x.saleStoreId} - isDisabled={otherSaleStoreList.length > 1 ? false : true} + isDisabled={otherSaleStoreList.length > 0 ? false : true} isClearable={true} value={otherSaleStoreList.filter(function (option) { return option.saleStoreId === otherSaleStoreId