ЦИТК-930 - Доработана панель "Мониторинг сборки изделий"

This commit is contained in:
Dollerino 2024-11-28 18:18:44 +03:00
parent 49309e5c0e
commit c84b96f21e
4 changed files with 48 additions and 37 deletions

View File

@ -15,6 +15,7 @@ import { P8PSVG } from "../../../components/p8p_svg"; //Интерактивны
import { P8P_DATA_GRID_CONFIG_PROPS } from "../../../config_wrapper"; //Подключение компонентов к настройкам приложения import { P8P_DATA_GRID_CONFIG_PROPS } from "../../../config_wrapper"; //Подключение компонентов к настройкам приложения
import { useCostProductComposition, useProductDetailsTable } from "../hooks"; //Вспомогательные хуки import { useCostProductComposition, useProductDetailsTable } from "../hooks"; //Вспомогательные хуки
import { ProgressBox } from "./progress_box"; //Информация по прогрессу объекта import { ProgressBox } from "./progress_box"; //Информация по прогрессу объекта
import { APP_STYLES } from "../../../../app.styles"; //Типовые стили
//--------- //---------
//Константы //Константы
@ -26,6 +27,7 @@ const STYLES = {
border: "1px solid", border: "1px solid",
borderRadius: "25px", borderRadius: "25px",
height: "35vh", height: "35vh",
minHeight: "250px",
backgroundColor: "background.detail_table" backgroundColor: "background.detail_table"
}, },
BOX_INFO_SUB: isMessage => ({ BOX_INFO_SUB: isMessage => ({
@ -47,6 +49,7 @@ const STYLES = {
border: "1px solid", border: "1px solid",
borderRadius: "25px", borderRadius: "25px",
height: "17vh", height: "17vh",
minHeight: "120px",
backgroundColor: "background.detail_info" backgroundColor: "background.detail_info"
}, },
PRODUCT_SELECTOR_CONTAINER: { PRODUCT_SELECTOR_CONTAINER: {
@ -57,6 +60,7 @@ const STYLES = {
border: "1px solid", border: "1px solid",
borderRadius: "25px", borderRadius: "25px",
height: "53vh", height: "53vh",
minHeight: "379px",
marginTop: "16px", marginTop: "16px",
backgroundColor: "background.product_selector" backgroundColor: "background.product_selector"
}, },
@ -72,7 +76,12 @@ const STYLES = {
width: "280px", width: "280px",
borderBottom: "1px solid" borderBottom: "1px solid"
}, },
TABLE_DETAILS: { backgroundColor: "background.detail_table", height: "240px" }, TABLE_DETAILS: {
backgroundColor: "background.detail_table",
height: "28vh",
minHeight: "187px",
...APP_STYLES.SCROLL
},
TABLE_DETAILS_HEADER_CELL: maxWidth => ({ TABLE_DETAILS_HEADER_CELL: maxWidth => ({
backgroundColor: "background.detail_table", backgroundColor: "background.detail_table",
color: "text.detail_table.fontColor", color: "text.detail_table.fontColor",
@ -107,7 +116,7 @@ const PlanSpecInfo = ({ planSpec }) => {
<Box sx={STYLES.PLAN_INFO_MAIN}> <Box sx={STYLES.PLAN_INFO_MAIN}>
<Box sx={STYLES.PLAN_INFO_SUB}> <Box sx={STYLES.PLAN_INFO_SUB}>
<Typography variant="PlanSpecInfo" mt={1}> <Typography variant="PlanSpecInfo" mt={1}>
Номер изделия: Номер заказа:
</Typography> </Typography>
<Typography variant="subtitle2">{planSpec.SNUMB}</Typography> <Typography variant="subtitle2">{planSpec.SNUMB}</Typography>
</Box> </Box>

View File

@ -72,7 +72,7 @@ const PlanSpecsListItem = ({ card, cardIndex, onClick }) => {
<PlanSpecsListItemImage card={card} /> <PlanSpecsListItemImage card={card} />
<Box textAlign="center" height="70px"> <Box textAlign="center" height="70px">
<Typography variant="PlanSpecInfo" sx={STYLES.TEXT_INFO_FIELD}> <Typography variant="PlanSpecInfo" sx={STYLES.TEXT_INFO_FIELD}>
Номер изделия Номер заказа
</Typography> </Typography>
<Typography variant="h2">{card.SNUMB || "-"}</Typography> <Typography variant="h2">{card.SNUMB || "-"}</Typography>
</Box> </Box>

View File

@ -240,26 +240,32 @@ const MechRecAssemblyMon = () => {
</Stack> </Stack>
{state.init == true ? ( {state.init == true ? (
state.selectedPlanCtlg.NRN ? ( state.selectedPlanCtlg.NRN ? (
<> state.planSpecs.length !== 0 ? (
<Typography variant="h3" sx={STYLES.MAIN_TITLE} pb={2}> <>
{title} <Typography variant="h3" sx={STYLES.MAIN_TITLE} pb={2}>
{title}
</Typography>
{state.planSpecsLoaded == true ? (
state.selectedPlanSpec.NRN ? (
<PlanSpecDetail
planSpec={state.selectedPlanSpec}
disableNavigatePrev={planDetailNavigation.disableNavigatePrev}
disableNavigateNext={planDetailNavigation.disableNavigateNext}
onNavigate={handlePlanDetailNavigateClick}
onBack={handlePlanDetailBackClick}
/>
) : (
<Box sx={STYLES.PLANS_LIST_BOX}>
<PlanSpecsList planSpecs={state.planSpecs} onItemClick={handlePlanClick} />
</Box>
)
) : null}
</>
) : (
<Typography variant="h4" sx={STYLES.MAIN_TITLE}>
В каталоге планов отсутствуют записи подходящих первичных документов
</Typography> </Typography>
{state.planSpecsLoaded == true ? ( )
state.selectedPlanSpec.NRN ? (
<PlanSpecDetail
planSpec={state.selectedPlanSpec}
disableNavigatePrev={planDetailNavigation.disableNavigatePrev}
disableNavigateNext={planDetailNavigation.disableNavigateNext}
onNavigate={handlePlanDetailNavigateClick}
onBack={handlePlanDetailBackClick}
/>
) : (
<Box sx={STYLES.PLANS_LIST_BOX}>
<PlanSpecsList planSpecs={state.planSpecs} onItemClick={handlePlanClick} />
</Box>
)
) : null}
</>
) : ( ) : (
<Typography variant="h4" sx={STYLES.MAIN_TITLE}> <Typography variant="h4" sx={STYLES.MAIN_TITLE}>
Укажите каталог планов для отображения спецификаций Укажите каталог планов для отображения спецификаций

View File

@ -6218,16 +6218,18 @@ create or replace package body PKG_P8PANELS_MECHREC as
D_YEAR(SP.REP_DATE_TO) NYEAR, D_YEAR(SP.REP_DATE_TO) NYEAR,
COALESCE(SP.LABOUR_FACT, 0) NLABOUR_FACT, COALESCE(SP.LABOUR_FACT, 0) NLABOUR_FACT,
COALESCE(SP.LABOUR_PLAN, 0) NLABOUR_PLAN COALESCE(SP.LABOUR_PLAN, 0) NLABOUR_PLAN
from FCPRODPLAN P from FCPRODPLAN P,
left outer join FCPRODPLANSP SP FCPRODPLANSP SP,
on P.RN = SP.PRN FINSTATE FS,
and ((SP.LABOUR_PLAN is not null) or (SP.LABOUR_FACT is not null)), FINSTATE FS, ENPERIOD EN ENPERIOD EN
where P.CRN = NCRN where P.CRN = NCRN
and P.CATEGORY = NFCPRODPLAN_CATEGORY_MON and P.CATEGORY = NFCPRODPLAN_CATEGORY_MON
and P.STATUS = NFCPRODPLAN_STATUS_MON and P.STATUS = NFCPRODPLAN_STATUS_MON
and FS.RN = P.TYPE and FS.RN = P.TYPE
and FS.CODE = SFCPRODPLAN_TYPE_MON and FS.CODE = SFCPRODPLAN_TYPE_MON
and EN.RN = P.CALC_PERIOD and EN.RN = P.CALC_PERIOD
and SP.PRN = P.RN
and ((SP.LABOUR_PLAN is not null) or (SP.LABOUR_FACT is not null))
and exists (select /*+ INDEX(UP I_USERPRIV_JUR_PERS_ROLEID) */ and exists (select /*+ INDEX(UP I_USERPRIV_JUR_PERS_ROLEID) */
null null
from USERPRIV UP from USERPRIV UP
@ -6327,6 +6329,10 @@ create or replace package body PKG_P8PANELS_MECHREC as
and P.CATEGORY = NFCPRODPLAN_CATEGORY_MON and P.CATEGORY = NFCPRODPLAN_CATEGORY_MON
and P.STATUS = NFCPRODPLAN_STATUS_MON and P.STATUS = NFCPRODPLAN_STATUS_MON
and P.COMPANY = GET_SESSION_COMPANY() and P.COMPANY = GET_SESSION_COMPANY()
and exists (select null
from FCPRODPLANSP S
where S.PRN = P.RN
and ((S.LABOUR_PLAN is not null) or (S.LABOUR_FACT is not null)))
and exists (select /*+ INDEX(UP I_USERPRIV_JUR_PERS_ROLEID) */ and exists (select /*+ INDEX(UP I_USERPRIV_JUR_PERS_ROLEID) */
null null
from USERPRIV UP from USERPRIV UP
@ -6424,17 +6430,7 @@ create or replace package body PKG_P8PANELS_MECHREC as
into NRESULT into NRESULT
from FCPRODPLAN T, from FCPRODPLAN T,
FCPRODPLANSP S FCPRODPLANSP S
where T.RN = (select P.RN where S.PRN_NODE = NFCPRODPLANSP
from DOCLINKS L,
FCPRODPLAN P,
FCPRODPLANSP SP
where SP.RN = NFCPRODPLANSP
and L.IN_DOCUMENT = SP.PRN
and L.IN_UNITCODE = 'CostProductPlans'
and L.OUT_UNITCODE = 'CostProductPlans'
and P.RN = L.OUT_DOCUMENT
and P.CATEGORY = 1
and ROWNUM = 1)
and S.PRN = T.RN and S.PRN = T.RN
and S.PRODCMPSP = NPRODCMPSP; and S.PRODCMPSP = NPRODCMPSP;
exception exception