Compare commits

...

4 Commits

3 changed files with 62 additions and 13 deletions

View File

@ -294,8 +294,13 @@ export default function StuffDetail() {
docDownButtonStyle = 'none' docDownButtonStyle = 'none'
} else { } else {
if (params?.data?.createSaleStoreId === 'T01' && session?.storeId !== 'T01') { if (params?.data?.createSaleStoreId === 'T01' && session?.storeId !== 'T01') {
estimateDetailButtonStyle = 'none' if(session?.storeId !== params?.data?.saleStoreId){
if(session?.storeId !== params?.data?.firstAgentId) {
estimateDetailButtonStyle = 'none'
}
}
} }
if (params?.data?.tempFlg === '1' || !params?.data?.docNo) { if (params?.data?.tempFlg === '1' || !params?.data?.docNo) {
docDownButtonStyle = 'none' docDownButtonStyle = 'none'
} }
@ -357,7 +362,13 @@ export default function StuffDetail() {
if (res?.data?.createSaleStoreId === 'T01') { if (res?.data?.createSaleStoreId === 'T01') {
if (session?.storeId !== 'T01') { if (session?.storeId !== 'T01') {
setShowButton('none') //T01 ID .
if(session?.storeId !== res?.data?.saleStoreId){
if(session?.storeId !== res?.data?.firstAgentId) {
setShowButton('none')
}
}
} }
} }
if (isObjectNotEmpty(res.data)) { if (isObjectNotEmpty(res.data)) {
@ -385,7 +396,15 @@ export default function StuffDetail() {
}) })
} }
if (isNotEmptyArray(res.data.planList)) { if (isNotEmptyArray(res.data.planList)) {
setPlanGridProps({ ...planGridProps, planGridData: res.data.planList })
const planGridData = res.data.planList.map(plan => ({
...plan,
createSaleStoreId: res.data.createSaleStoreId,
saleStoreId: res.data.saleStoreId,
firstAgentId: res.data.firstAgentId
}))
setPlanGridProps({ ...planGridProps, planGridData })
} else { } else {
setPlanGridProps({ ...planGridProps, planGridData: [] }) setPlanGridProps({ ...planGridProps, planGridData: [] })
} }
@ -1658,7 +1677,13 @@ export default function StuffDetail() {
const getCellDoubleClicked = (params) => { const getCellDoubleClicked = (params) => {
if (managementState?.createSaleStoreId === 'T01') { if (managementState?.createSaleStoreId === 'T01') {
if (session?.storeId !== 'T01') { if (session?.storeId !== 'T01') {
return false //T01 ID .
if(session?.storeId !== managementState?.saleStoreId){
if(session?.storeId !== managementState?.firstAgentId) {
return false
}
}
} }
} }
@ -1842,7 +1867,7 @@ export default function StuffDetail() {
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr style={{ display: session?.storeLvl === '1' ? '' : 'none' }}>
<th> <th>
<div className="flx-box"> <div className="flx-box">
<div className="title"> <div className="title">

View File

@ -39,7 +39,12 @@ export default function StuffSubHeader({ type }) {
if (isObjectNotEmpty(managementState)) { if (isObjectNotEmpty(managementState)) {
if (managementState?.createSaleStoreId === 'T01') { if (managementState?.createSaleStoreId === 'T01') {
if (session?.storeId !== 'T01') { if (session?.storeId !== 'T01') {
setButtonStyle('none') //T01 ID .
if(session?.storeId !== managementState?.saleStoreId){
if(session?.storeId !== managementState?.firstAgentId) {
setButtonStyle('none')
}
}
} }
} }
} }

View File

@ -90,9 +90,13 @@ export const useTrestle = () => {
let rackInfos = [] let rackInfos = []
if (rack) { if (rack) {
console.log('Original rack data:', rack)
rackInfos = Object.keys(rack).map((key) => { rackInfos = Object.keys(rack).map((key) => {
return { key, value: rack[key] } return { key, value: rack[key] }
}) })
console.log('Processed rackInfos:', rackInfos)
} else {
console.log('Rack is null or undefined')
} }
// 모듈들의 centerPoint들을 이용해 각 모듈의 정보(가장 아랫라인 모듈, 가장 윗라인 모듈, 접면, 반접면 등 계산) // 모듈들의 centerPoint들을 이용해 각 모듈의 정보(가장 아랫라인 모듈, 가장 윗라인 모듈, 접면, 반접면 등 계산)
@ -451,6 +455,16 @@ export const useTrestle = () => {
})?.value.racks })?.value.racks
mostRowsModule = Math.max(leftRows, rightRows, centerRows, mostRowsModule) mostRowsModule = Math.max(leftRows, rightRows, centerRows, mostRowsModule)
console.log('=== Debug rackInfos ===')
console.log('rackInfos:', rackInfos)
console.log('leftRowsInfo:', leftRowsInfo)
console.log('rightRowsInfo:', rightRowsInfo)
console.log('centerRowsInfo:', centerRowsInfo)
console.log('leftRacks:', leftRacks)
console.log('rightRacks:', rightRacks)
console.log('centerRacks:', centerRacks)
console.log('rackYn:', rackYn)
console.log('========================')
if (rackYn === 'Y') { if (rackYn === 'Y') {
drawRacks(leftRacks, rackQty, rackIntvlPct, module, direction, 'L', rackYn) drawRacks(leftRacks, rackQty, rackIntvlPct, module, direction, 'L', rackYn)
@ -1082,14 +1096,19 @@ export const useTrestle = () => {
const drawRacks = (rackInfos, rackQty, rackIntvlPct, module, direction, l, rackYn) => { const drawRacks = (rackInfos, rackQty, rackIntvlPct, module, direction, l, rackYn) => {
const { width, height, left, top, lastX, lastY, surfaceId } = module const { width, height, left, top, lastX, lastY, surfaceId } = module
const surface = canvas.getObjects().find((obj) => obj.id === surfaceId) const surface = canvas.getObjects().find((obj) => obj.id === surfaceId)
if (!rackInfos) { // if (!rackInfos) {
const maxRows = surface.trestleDetail.moduleMaxRows // const maxRows = surface.trestleDetail.moduleMaxRows
const maxCols = surface.trestleDetail.moduleMaxCols // const maxCols = surface.trestleDetail.moduleMaxCols
const msg = `段数の上限は${maxRows}段です。 上限より上の段には設置できません` // const msg = `段数の上限は${maxRows}段です。 上限より上の段には設置できません`
swalFire({ title: msg, type: 'alert' }) // swalFire({ title: msg, type: 'alert' })
throw new Error('rackInfos is null') // throw new Error('rackInfos is null')
} // }
if (!rackInfos) {
const msg = '該当モジュールタイプに関するラック情報がありません。'
swalFire({ title: msg, type: 'alert' })
return
}
const roof = canvas.getObjects().find((obj) => obj.id === surface.parentId) const roof = canvas.getObjects().find((obj) => obj.id === surface.parentId)
const degree = getDegreeByChon(roof.roofMaterial.pitch) const degree = getDegreeByChon(roof.roofMaterial.pitch)
rackIntvlPct = rackIntvlPct === 0 ? 1 : rackIntvlPct // 0인 경우 1로 변경 rackIntvlPct = rackIntvlPct === 0 ? 1 : rackIntvlPct // 0인 경우 1로 변경