물건정보
This commit is contained in:
parent
e3bc19d603
commit
cc5870e32f
@ -53,9 +53,9 @@ export default function Stuff() {
|
||||
const onDoubleClick = (e) => {
|
||||
let objectNo = e.target.innerText
|
||||
if (objectNo.substring(0, 1) === 'R') {
|
||||
router.push(`${pathname}/detail?objectNo=${objectNo.toString()}`)
|
||||
router.push(`${pathname}/detail?objectNo=${objectNo.toString()}`, { scroll: false })
|
||||
} else {
|
||||
router.push(`${pathname}/tempdetail?objectNo=${objectNo.toString()}`)
|
||||
router.push(`${pathname}/tempdetail?objectNo=${objectNo.toString()}`, { scroll: false })
|
||||
}
|
||||
}
|
||||
|
||||
@ -157,9 +157,9 @@ export default function Stuff() {
|
||||
//T 면 임시 R은 진짜
|
||||
if (event.data.objectNo) {
|
||||
if (event.data.objectNo.substring(0, 1) === 'R') {
|
||||
router.push(`${pathname}/detail?objectNo=${event.data.objectNo.toString()}`)
|
||||
router.push(`${pathname}/detail?objectNo=${event.data.objectNo.toString()}`, { scroll: false })
|
||||
} else {
|
||||
router.push(`${pathname}/tempdetail?objectNo=${event.data.objectNo.toString()}`)
|
||||
router.push(`${pathname}/tempdetail?objectNo=${event.data.objectNo.toString()}`, { scroll: false })
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -244,7 +244,8 @@ export default function Stuff() {
|
||||
}
|
||||
|
||||
async function fetchData() {
|
||||
const apiUrl = `/api/object/list?saleStoreId=${sessionState?.storeId}&${queryStringFormatter(params)}`
|
||||
// const apiUrl = `/api/object/list?saleStoreId=${sessionState?.storeId}&${queryStringFormatter(params)}`
|
||||
const apiUrl = `/api/object/list?saleStoreId=T100&${queryStringFormatter(params)}`
|
||||
await get({
|
||||
url: apiUrl,
|
||||
}).then((res) => {
|
||||
|
||||
@ -100,13 +100,13 @@ export default function StuffDetail() {
|
||||
field: 'planNo',
|
||||
headerName: getMessage('stuff.detail.planGridHeader.planNo'),
|
||||
width: 100,
|
||||
cellStyle: { display: 'flex', justifyContent: 'center', alignItems: 'center' },
|
||||
cellStyle: { justifyContent: 'center' },
|
||||
},
|
||||
{
|
||||
field: 'orderFlg',
|
||||
headerName: getMessage('stuff.detail.planGridHeader.orderFlg'),
|
||||
width: 80,
|
||||
cellStyle: { display: 'flex', justifyContent: 'center', alignItems: 'center' },
|
||||
cellStyle: { justifyContent: 'center' },
|
||||
cellRenderer: (params) => {
|
||||
//1일때만 동그라미
|
||||
let orderFlg
|
||||
@ -118,13 +118,13 @@ export default function StuffDetail() {
|
||||
field: 'moduleModel',
|
||||
headerName: getMessage('stuff.detail.planGridHeader.moduleModel'),
|
||||
flex: 1,
|
||||
cellStyle: { display: 'flex', justifyContent: 'center', alignItems: 'center' },
|
||||
cellStyle: { justifyContent: 'flex-start' /* 좌측정렬*/ },
|
||||
},
|
||||
{
|
||||
field: 'capacity',
|
||||
headerName: getMessage('stuff.detail.planGridHeader.capacity'),
|
||||
width: 120,
|
||||
cellStyle: { display: 'flex', justifyContent: 'center', alignItems: 'center' },
|
||||
cellStyle: { justifyContent: 'flex-end' /* 우측정렬*/ },
|
||||
},
|
||||
{
|
||||
field: 'roofMaterialIdMulti',
|
||||
@ -132,17 +132,18 @@ export default function StuffDetail() {
|
||||
width: 140,
|
||||
wrapText: true,
|
||||
autoHeight: true,
|
||||
cellStyle: { display: 'flex', justifyContent: 'center', alignItems: 'center' },
|
||||
cellStyle: { justifyContent: 'flex-start' /* 좌측정렬*/ },
|
||||
cellRenderer: (params) => {
|
||||
//콤마가 아니라 、.. 일본콤마?
|
||||
let origin = params.value
|
||||
if (origin !== null) {
|
||||
return (
|
||||
<>
|
||||
{origin?.split(',').map((it) => (
|
||||
<>
|
||||
{origin?.split('、').map((it, idx) => (
|
||||
<span key={idx} className="block">
|
||||
{it}
|
||||
<br />
|
||||
</>
|
||||
</span>
|
||||
))}
|
||||
</>
|
||||
)
|
||||
@ -156,17 +157,17 @@ export default function StuffDetail() {
|
||||
headerName: getMessage('stuff.detail.planGridHeader.constructSpecification'),
|
||||
wrapText: true,
|
||||
autoHeight: true,
|
||||
cellStyle: { display: 'flex', justifyContent: 'center', alignItems: 'center' },
|
||||
cellStyle: { justifyContent: 'flex-start' /* 좌측정렬*/ },
|
||||
cellRenderer: (params) => {
|
||||
let origin = params.value
|
||||
if (origin !== null) {
|
||||
return (
|
||||
<>
|
||||
{origin?.split(',').map((it) => (
|
||||
<>
|
||||
{origin?.split('、').map((it, idx) => (
|
||||
<span key={idx} className="block">
|
||||
{it}
|
||||
<br />
|
||||
</>
|
||||
</span>
|
||||
))}
|
||||
</>
|
||||
)
|
||||
@ -180,17 +181,17 @@ export default function StuffDetail() {
|
||||
headerName: getMessage('stuff.detail.planGridHeader.supportMethodIdMulti'),
|
||||
wrapText: true,
|
||||
autoHeight: true,
|
||||
cellStyle: { display: 'flex', justifyContent: 'center', alignItems: 'center' },
|
||||
cellStyle: { justifyContent: 'flex-start' /* 좌측정렬*/ },
|
||||
cellRenderer: (params) => {
|
||||
let origin = params.value
|
||||
if (origin !== null) {
|
||||
return (
|
||||
<>
|
||||
{origin?.split(',').map((it) => (
|
||||
<>
|
||||
{origin?.split('、').map((it, idx) => (
|
||||
<span key={idx} className="block">
|
||||
{it}
|
||||
<br />
|
||||
</>
|
||||
</span>
|
||||
))}
|
||||
</>
|
||||
)
|
||||
@ -205,17 +206,17 @@ export default function StuffDetail() {
|
||||
flex: 1,
|
||||
wrapText: true,
|
||||
autoHeight: true,
|
||||
cellStyle: { display: 'flex', justifyContent: 'center', alignItems: 'center' },
|
||||
cellStyle: { justifyContent: 'flex-start' /* 좌측정렬*/ },
|
||||
cellRenderer: (params) => {
|
||||
let origin = params.value
|
||||
if (origin !== null) {
|
||||
return (
|
||||
<>
|
||||
{origin?.split(',').map((it) => (
|
||||
<>
|
||||
{origin?.split('、').map((it, idx) => (
|
||||
<span key={idx} className="block">
|
||||
{it}
|
||||
<br />
|
||||
</>
|
||||
</span>
|
||||
))}
|
||||
</>
|
||||
)
|
||||
@ -229,7 +230,7 @@ export default function StuffDetail() {
|
||||
headerName: getMessage('stuff.detail.planGridHeader.management'),
|
||||
width: 200,
|
||||
autoHeight: true,
|
||||
cellStyle: { display: 'flex', justifyContent: 'center', alignItems: 'center' },
|
||||
cellStyle: { justifyContent: 'center' },
|
||||
cellRenderer: () => {
|
||||
return (
|
||||
<div className="grid-cell-btn">
|
||||
@ -266,7 +267,7 @@ export default function StuffDetail() {
|
||||
setEditMode('EDIT')
|
||||
|
||||
if (objectNo.substring(0, 1) === 'R') {
|
||||
//진짜
|
||||
//벨리데이션 체크용..
|
||||
setIsFormValid(true)
|
||||
}
|
||||
promiseGet({ url: `/api/object/${objectNo}/detail` }).then((res) => {
|
||||
@ -298,7 +299,8 @@ export default function StuffDetail() {
|
||||
|
||||
//1차점 : X167 T01
|
||||
//2차점 : 10X22, 201X112
|
||||
get({ url: `/api/object/saleStore/${sessionState?.storeId}/list` }).then((res) => {
|
||||
// get({ url: `/api/object/saleStore/${sessionState?.storeId}/list` }).then((res) => {
|
||||
get({ url: `/api/object/saleStore/T100/list` }).then((res) => {
|
||||
if (!isEmptyArray(res)) {
|
||||
const firstList = res.filter((row) => row.saleStoreLevel === '1')
|
||||
const otherList = res.filter((row) => row.saleStoreLevel !== '1')
|
||||
@ -354,7 +356,8 @@ export default function StuffDetail() {
|
||||
|
||||
//1차점 : X167 T01
|
||||
//2차점 : 10X22, 201X112
|
||||
get({ url: `/api/object/saleStore/${sessionState?.storeId}/list` }).then((res) => {
|
||||
// get({ url: `/api/object/saleStore/${sessionState?.storeId}/list` }).then((res) => {
|
||||
get({ url: `/api/object/saleStore/T100/list` }).then((res) => {
|
||||
if (!isEmptyArray(res)) {
|
||||
const firstList = res.filter((row) => row.saleStoreLevel === '1')
|
||||
const otherList = res.filter((row) => row.saleStoreLevel !== '1')
|
||||
@ -363,8 +366,10 @@ export default function StuffDetail() {
|
||||
//1차점 아닌 판매점 셀렉트박스
|
||||
setOriginOtherSaleStoreList(otherList)
|
||||
setOtherSaleStoreList(otherList)
|
||||
|
||||
// console.log('1차점리스트::', firstList)
|
||||
// console.log('2차점리스트::', otherList)
|
||||
}
|
||||
console.log('상세데이타::세팅:::::', detailData)
|
||||
//설계의뢰No.
|
||||
form.setValue('planReqNo', detailData.planReqNo)
|
||||
//담당자
|
||||
@ -384,14 +389,16 @@ export default function StuffDetail() {
|
||||
//물건명 후리가나
|
||||
form.setValue('objectNameKana', detailData.objectNameKana)
|
||||
|
||||
// console.log('1차점리스트::', firstList)
|
||||
// console.log('2차점리스트::', otherList)
|
||||
setSelOptions(detailData.saleStoreId)
|
||||
form.setValue('saleStoreId', detailData.saleStoreId)
|
||||
form.setValue('saleStoreLevel', sessionState?.storeLvl)
|
||||
console.log('상세데이타::세팅:::::', detailData)
|
||||
//상세데이터에는 2차점까지 골랐으면 2차점 정보만 내려옴
|
||||
//로그인세션이 1차점이면 1차점은 본인으로 디폴트 셋팅하고 2차점에 상세데이터 넣어줌
|
||||
//1차점
|
||||
// setSelOptions(detailData.saleStoreId)
|
||||
// form.setValue('saleStoreId', detailData.saleStoreId)
|
||||
// form.setValue('saleStoreLevel', sessionState?.storeLvl)
|
||||
|
||||
//2차점까지 고른경우 확인필요
|
||||
console.log('2차점까지 고른경우 확인필요')
|
||||
// console.log('2차점까지 고른경우 확인필요')
|
||||
// setOtherSelOptions(sessionState?.storeId)
|
||||
// form.setValue('saleStoreId', firstList[0].saleStoreId)
|
||||
// form.setValue('otherSaleStoreId', sessionState?.storeId)
|
||||
@ -454,19 +461,60 @@ export default function StuffDetail() {
|
||||
//1차점 변경 이벤트
|
||||
const onSelectionChange = (key) => {
|
||||
const planReqNo = form.watch('planReqNo')
|
||||
|
||||
let delFlg = false
|
||||
if (planReqNo !== '') {
|
||||
if (confirm('stuff.detail.confirm.message1')) {
|
||||
delFlg = true
|
||||
} else {
|
||||
delFlg = false
|
||||
|
||||
if (editMode === 'NEW') {
|
||||
if (planReqNo !== '') {
|
||||
if (confirm(getMessage('stuff.detail.confirm.message1'))) {
|
||||
delFlg = true
|
||||
} else {
|
||||
delFlg = false
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// EDIT
|
||||
if (planReqNo !== null) {
|
||||
if (confirm(getMessage('stuff.detail.confirm.message1'))) {
|
||||
delFlg = true
|
||||
} else {
|
||||
delFlg = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (planReqNo !== '') {
|
||||
if (delFlg) {
|
||||
form.setValue('planReqNo', '')
|
||||
let tempObjectNo = 'T'
|
||||
if (objectNo) {
|
||||
tempObjectNo = objectNo.substring(0, 1)
|
||||
}
|
||||
if (tempObjectNo !== 'R') {
|
||||
if (planReqNo) {
|
||||
if (delFlg) {
|
||||
form.setValue('planReqNo', '')
|
||||
if (isObjectNotEmpty(key)) {
|
||||
setOtherSaleStoreList(otherSaleStoreList)
|
||||
form.setValue('saleStoreId', key.saleStoreId)
|
||||
form.setValue('saleStoreName', key.saleStoreName)
|
||||
form.setValue('saleStoreLevel', key.saleStoreLevel)
|
||||
setSelOptions(key.saleStoreId)
|
||||
//선택한 1차점 정보로 2차점 list 추리기
|
||||
//長府工産株式会社 大阪支社
|
||||
let newOtherSaleStoreList = originOtherSaleStoreList.filter((row) => row.firstAgentId === key.saleStoreId)
|
||||
setOtherSaleStoreList(newOtherSaleStoreList)
|
||||
} else {
|
||||
//X누름
|
||||
setSelOptions('')
|
||||
form.setValue('saleStoreId', '')
|
||||
form.setValue('saleStoreName', '')
|
||||
form.setValue('saleStoreLevel', '')
|
||||
form.setValue('otherSaleStoreId', '')
|
||||
form.setValue('otherSaleStoreName', '')
|
||||
form.setValue('otherSaleStoreLevel', '')
|
||||
//1차점 지웠을때 2차점 자동완성 초기화
|
||||
setOtherSaleStoreList(originOtherSaleStoreList)
|
||||
handleClear()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (isObjectNotEmpty(key)) {
|
||||
setOtherSaleStoreList(otherSaleStoreList)
|
||||
form.setValue('saleStoreId', key.saleStoreId)
|
||||
@ -521,19 +569,47 @@ export default function StuffDetail() {
|
||||
//2차점 변경 이벤트
|
||||
const onSelectionChange2 = (key) => {
|
||||
const planReqNo = form.watch('planReqNo')
|
||||
|
||||
let delFlg = false
|
||||
if (planReqNo !== '') {
|
||||
if (confirm('stuff.detail.confirm.message1')) {
|
||||
delFlg = true
|
||||
} else {
|
||||
delFlg = false
|
||||
if (editMode === 'NEW') {
|
||||
if (planReqNo !== '') {
|
||||
if (confirm(getMessage('stuff.detail.confirm.message1'))) {
|
||||
delFlg = true
|
||||
} else {
|
||||
delFlg = false
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//EDIT
|
||||
if (planReqNo !== null) {
|
||||
if (confirm(getMessage('stuff.detail.confirm.message1'))) {
|
||||
delFlg = true
|
||||
} else {
|
||||
delFlg = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (planReqNo !== '') {
|
||||
if (delFlg) {
|
||||
form.setValue('planReqNo', '')
|
||||
let tempObjectNo = 'T'
|
||||
if (objectNo) {
|
||||
tempObjectNo = objectNo.substring(0, 1)
|
||||
}
|
||||
if (tempObjectNo !== 'R') {
|
||||
if (planReqNo) {
|
||||
if (delFlg) {
|
||||
form.setValue('planReqNo', '')
|
||||
if (isObjectNotEmpty(key)) {
|
||||
setOtherSelOptions(key.saleStoreId)
|
||||
form.setValue('otherSaleStoreId', key.saleStoreId)
|
||||
form.setValue('otherSaleStoreName', key.saleStoreName)
|
||||
form.setValue('otherSaleStoreLevel', key.saleStoreLevel)
|
||||
} else {
|
||||
setOtherSelOptions('')
|
||||
form.setValue('otherSaleStoreId', '')
|
||||
form.setValue('otherSaleStoreName', '')
|
||||
form.setValue('otherSaleStoreLevel', '')
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (isObjectNotEmpty(key)) {
|
||||
setOtherSelOptions(key.saleStoreId)
|
||||
form.setValue('otherSaleStoreId', key.saleStoreId)
|
||||
@ -782,9 +858,9 @@ export default function StuffDetail() {
|
||||
//필수값 다 입력했을때
|
||||
const onValid = async () => {
|
||||
const formData = form.getValues()
|
||||
// console.log('필수값 통과:::', formData)
|
||||
const apiUrl = '/api/object/save-object'
|
||||
const params = {
|
||||
planReqNo: formData.planReqNo,
|
||||
saleStoreId: formData.otherSaleStoreId ? formData.otherSaleStoreId : formData.saleStoreId,
|
||||
saleStoreName: formData.otherSaleStoreName ? formData.otherSaleStoreName : formData.saleStoreName,
|
||||
saleStoreLevel: formData.otherSaleStoreLevel ? formData.otherSaleStoreLevel : formData.saleStoreLevel,
|
||||
@ -805,11 +881,24 @@ export default function StuffDetail() {
|
||||
conType: formData.conType,
|
||||
coldRegionFlg: formData.coldRegionFlg === true ? '1' : '0',
|
||||
saltAreaFlg: formData.saltAreaFlg === true ? '1' : '0',
|
||||
remarks: formData.remarks,
|
||||
tempFlg: '0',
|
||||
workNo: null,
|
||||
workName: null,
|
||||
}
|
||||
// console.log('params::', params)
|
||||
console.log('REAL저장::', params)
|
||||
|
||||
//수직적설량, 설치높이 0인지 체크
|
||||
let snow = params.verticalSnowCover
|
||||
let height = params.installHeight
|
||||
|
||||
if (snow === '0') {
|
||||
alert(getMessage('stuff.detail.save.valierror1'))
|
||||
}
|
||||
if (height === '0') {
|
||||
alert(getMessage('stuff.detail.save.valierror2'))
|
||||
}
|
||||
|
||||
alert('작업중')
|
||||
return
|
||||
if (editMode === 'NEW') {
|
||||
@ -832,6 +921,7 @@ export default function StuffDetail() {
|
||||
const onTempSave = async () => {
|
||||
const formData = form.getValues()
|
||||
const params = {
|
||||
planReqNo: formData.planReqNo,
|
||||
saleStoreId: formData.otherSaleStoreId ? formData.otherSaleStoreId : formData.saleStoreId,
|
||||
saleStoreName: formData.otherSaleStoreName ? formData.otherSaleStoreName : formData.saleStoreName,
|
||||
saleStoreLevel: formData.otherSaleStoreLevel ? formData.otherSaleStoreLevel : formData.saleStoreLevel,
|
||||
@ -852,6 +942,7 @@ export default function StuffDetail() {
|
||||
conType: formData.conType,
|
||||
coldRegionFlg: formData.coldRegionFlg === true ? '1' : '0',
|
||||
saltAreaFlg: formData.saltAreaFlg === true ? '1' : '0',
|
||||
remarks: formData.remarks,
|
||||
tempFlg: '1',
|
||||
workNo: null,
|
||||
workName: null,
|
||||
@ -862,7 +953,17 @@ export default function StuffDetail() {
|
||||
params.saleStoreId = sessionState.storeId
|
||||
params.saleStoreLevel = sessionState.storeLvl
|
||||
}
|
||||
console.log('임시저장파람:::', params)
|
||||
//수직적설량, 설치높이 0인지 체크
|
||||
let snow = params.verticalSnowCover
|
||||
let height = params.installHeight
|
||||
|
||||
if (snow === '0') {
|
||||
alert(getMessage('stuff.detail.save.valierror1'))
|
||||
}
|
||||
if (height === '0') {
|
||||
alert(getMessage('stuff.detail.save.valierror2'))
|
||||
}
|
||||
|
||||
alert('작업중')
|
||||
return
|
||||
await promisePost({ url: '/api/object/save-object', data: params }).then((res) => {
|
||||
@ -1323,7 +1424,7 @@ export default function StuffDetail() {
|
||||
<div className="flx-box">
|
||||
<div className="product-input-wrap mr5">
|
||||
<input type="text" className="product-input" readOnly value={form.watch('planReqNo') || ''} />
|
||||
{objectNo.substring(0, 1) === 'T' && form.watch('planReqNo') !== '' ? (
|
||||
{objectNo.substring(0, 1) === 'T' && form.watch('planReqNo') ? (
|
||||
<button
|
||||
type="button"
|
||||
className="product-delete"
|
||||
@ -1742,7 +1843,7 @@ export default function StuffDetail() {
|
||||
</div>
|
||||
{/* 진짜R 플랜끝 */}
|
||||
<div className="sub-right-footer">
|
||||
<Link href="/management/stuff">
|
||||
<Link href="/management/stuff" scroll={false}>
|
||||
<button type="button" className="btn-origin grey mr5">
|
||||
R상세: {getMessage('stuff.detail.btn.moveList')}
|
||||
</button>
|
||||
@ -1767,7 +1868,7 @@ export default function StuffDetail() {
|
||||
TEMP상세:{getMessage('stuff.detail.btn.save')}
|
||||
</Button>
|
||||
)}
|
||||
<Link href="/management/stuff">
|
||||
<Link href="/management/stuff" scroll={false}>
|
||||
<button type="button" className="btn-origin grey">
|
||||
TEMP상세:{getMessage('stuff.detail.btn.moveList')}
|
||||
</button>
|
||||
|
||||
@ -516,6 +516,8 @@
|
||||
"stuff.detail.btn.moveList": "商品リスト",
|
||||
"stuff.detail.btn.save": "保存",
|
||||
"stuff.detail.btn.tempSave": "一時保存",
|
||||
"stuff.detail.save.valierror1": "垂直説説は0より大きい値を入力してください",
|
||||
"stuff.detail.save.valierror2": "設置高さ0より大きい値を入力してください",
|
||||
"stuff.planReqPopup.popTitle": "設計依頼検索",
|
||||
"stuff.planReqPopup.btn1": "検索",
|
||||
"stuff.planReqPopup.btn2": "初期化",
|
||||
|
||||
@ -521,6 +521,8 @@
|
||||
"stuff.detail.btn.moveList": "물건목록",
|
||||
"stuff.detail.btn.save": "저장",
|
||||
"stuff.detail.btn.tempSave": "임시저장",
|
||||
"stuff.detail.save.valierror1": "수직적설량은 0보다 큰 값을 입력하세요",
|
||||
"stuff.detail.save.valierror2": "설치높이 0보다 큰 값을 입력하세요",
|
||||
"stuff.planReqPopup.popTitle": "설계 요청 검색",
|
||||
"stuff.planReqPopup.btn1": "검색",
|
||||
"stuff.planReqPopup.btn2": "초기화",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user