Commit c65efff5 authored by wuhao's avatar wuhao 🎯

asder

parent d2411fb2
...@@ -11,7 +11,7 @@ export default { ...@@ -11,7 +11,7 @@ export default {
// localhost:8000/api/** -> https://preview.pro.ant.design/api/** // localhost:8000/api/** -> https://preview.pro.ant.design/api/**
"/wms/": { "/wms/": {
// 要代理的地址 // 要代理的地址
target: "http://192.168.40.114:28040/", //39:18040 23/wms/ //60 翔 //18 target: "http://192.168.40.102:28040/", //39:18040 23/wms/ //60 翔 //18
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
"^/wms": "", "^/wms": "",
......
...@@ -82,7 +82,7 @@ export default (props) => { ...@@ -82,7 +82,7 @@ export default (props) => {
return props.pageextra return props.pageextra
} else if (props.pageextra === "none") { } else if (props.pageextra === "none") {
return <div style={{ height: 32, width: 64 }}></div> return <div style={{ height: 32, width: 64 }}></div>
} else { } else if (props.pageextra) {
let strarr = props.pageextra ? props.pageextra.split(",") : ["add"]; let strarr = props.pageextra ? props.pageextra.split(",") : ["add"];
return strarr.map((it, i) => { return strarr.map((it, i) => {
return <div style={{ marginRight: i == strarr.length - 1 ? 0 : 6 }}> return <div style={{ marginRight: i == strarr.length - 1 ? 0 : 6 }}>
......
...@@ -12,11 +12,13 @@ import { ...@@ -12,11 +12,13 @@ import {
Rate, Rate,
Image, Image,
message, message,
Section
} from "antd"; } from "antd";
import { doFetch, postFetch } from "@/utils/doFetch"; import { doFetch, postFetch } from "@/utils/doFetch";
import AutoTable from "@/components/Tableform"; import AutoTable from "@/components/Tableform";
import { useModel } from 'umi' import { useModel } from 'umi'
import styles from "./index.less"; import styles from "./index.less";
import PrintProvider, { Print, NoPrint } from 'react-easy-print';
const Details = (props) => { const Details = (props) => {
/** /**
...@@ -63,10 +65,10 @@ const Details = (props) => { ...@@ -63,10 +65,10 @@ const Details = (props) => {
} }
}, []); }, []);
useEffect(()=>{ useEffect(() => {
onloadeddata?.(pageData); onloadeddata?.(pageData);
},[pageData]) }, [pageData])
const getCol = (itemcol) => { const getCol = (itemcol) => {
if (itemcol) { if (itemcol) {
...@@ -147,17 +149,17 @@ const Details = (props) => { ...@@ -147,17 +149,17 @@ const Details = (props) => {
); );
} else if (type == "table") { } else if (type == "table") {
return ( return (
value && value &&
<AutoTable <AutoTable
columns={columns || []} columns={columns || []}
path={path ? path : null} path={path ? path : null}
bordered={false} bordered={false}
dataSource={path ? null : value} dataSource={path ? null : value}
rowKey={rowKey ?? "id"} rowKey={rowKey ?? "id"}
expandable={expandable?{ expandable={expandable ? {
...expandable, ...expandable,
defaultExpandedRowKeys:value?.map(it=>it.id) defaultExpandedRowKeys: value?.map(it => it.id)
}:null} } : null}
pagination={pagination} pagination={pagination}
></AutoTable> ></AutoTable>
); );
...@@ -205,55 +207,61 @@ const Details = (props) => { ...@@ -205,55 +207,61 @@ const Details = (props) => {
`; `;
return ( return (
<div className={`${styles.bodyBox} detailCards`} ref={printRef ?? ''}> <PrintProvider>
<style type="text/css" media="print"> <div className={`${styles.bodyBox} detailCards`} ref={printRef ?? null}>
{pageStyle} <style type="text/css" media="print">
</style> {pageStyle}
<Spin spinning={false}> </style>
{topNode && <div>{topNode}</div>} <Spin spinning={false}>
{totalCard?.map((item, i) => { {topNode && <div>{topNode}</div>}
return ( {totalCard?.map((item, i) => {
<Card let Container = item?.noPrint ? NoPrint : Print;
key={i} return (
title={item.cardTitle} <Container force={true}>
bordered={false} <Card
style={{ marginBottom: 16 }} key={i}
bodyStyle={{ padding: "16px 10px" }} title={item.cardTitle}
extra={item?.extra ? <Button type="primary" onClick={() => { bordered={false}
doFetch({ url: item.extrapath, params: initialState[item.extrakey] }).then(res => { style={{ marginBottom: 16 }}
if (res.code == "0000") { bodyStyle={{ padding: "16px 10px" }}
message.success("操作成功") extra={item?.extra ? <Button type="primary" onClick={() => {
} doFetch({ url: item.extrapath, params: initialState[item.extrakey] }).then(res => {
}) if (res.code == "0000") {
}}>保存</Button> : null} message.success("操作成功")
> }
<Row gutter={[12, 12]}> })
{item?.itemData?.map((it, j) => { }}>保存</Button> : null}
return ( >
<Col key={j} {...getCol(it.col)}> <Row gutter={[12, 12]}>
<div style={{ width: "100%", display: "flex" }}> {item?.itemData?.map((it, j) => {
<div return (
style={{ <Col key={j} {...getCol(it.col)}>
flexShrink: 0, <div style={{ width: "100%", display: "flex" }}>
display: `${it.title ? "block" : "none"}`, <div
textAlign: "right", style={{
width: 126, flexShrink: 0,
}} display: `${it.title ? "block" : "none"}`,
> textAlign: "right",
{it.title} width: 126,
</div> }}
{getItem(it)} >
</div> {it.title}
</Col> </div>
); {getItem(it)}
})} </div>
</Row> </Col>
</Card> );
); })}
})} </Row>
{bottomNode && <div>{bottomNode}</div>} </Card>
</Spin> </Container>
</div> );
})}
{bottomNode && <div>{bottomNode}</div>}
</Spin>
</div>
</PrintProvider>
); );
}; };
......
...@@ -38,6 +38,18 @@ function TreeRender({ url, deleteurl, saveurl, onselected, params, noaction, max ...@@ -38,6 +38,18 @@ function TreeRender({ url, deleteurl, saveurl, onselected, params, noaction, max
return res.filter(it => it.children).map(it => it.key) return res.filter(it => it.children).map(it => it.key)
}, [data]) }, [data])
const alldata = useMemo(() => {
let res = [];
const fn = (source) => {
source.map(el => {
res.push(el)
el.children && el.children.length > 0 ? fn(el.children) : "" // 子级递归
})
}
fn(data?.data?.dataList ?? []);
return res
}, [data])
const ref1 = useRef(), ref2 = useRef(); const ref1 = useRef(), ref2 = useRef();
...@@ -281,7 +293,7 @@ function TreeRender({ url, deleteurl, saveurl, onselected, params, noaction, max ...@@ -281,7 +293,7 @@ function TreeRender({ url, deleteurl, saveurl, onselected, params, noaction, max
<Tree <Tree
onSelect={(selectedKeys, e) => { onSelect={(selectedKeys, e) => {
onselected?.(selectedKeys, e) onselected?.(selectedKeys, e, alldata)
}} }}
autoExpandParent={true} autoExpandParent={true}
defaultExpandAll={true} defaultExpandAll={true}
......
...@@ -3,7 +3,7 @@ import { ...@@ -3,7 +3,7 @@ import {
MenuFoldOutlined, MenuFoldOutlined,
HomeOutlined HomeOutlined
} from '@ant-design/icons'; } from '@ant-design/icons';
import { Breadcrumb, Layout, Menu, Input, Tooltip, Tree } from 'antd'; import { Breadcrumb, Layout, Menu, Input, Modal, Tree } from 'antd';
import React, { useState } from 'react'; import React, { useState } from 'react';
import styles from './index.less' import styles from './index.less'
import TreeRender from '@/components/TreeRender'; import TreeRender from '@/components/TreeRender';
...@@ -52,6 +52,76 @@ const Storesearch = (props) => { ...@@ -52,6 +52,76 @@ const Storesearch = (props) => {
"dataIndex": "productionUnitName", "dataIndex": "productionUnitName",
"key": "productionUnitName", "key": "productionUnitName",
"search": false "search": false
}, {
"title": "库存信息",
"valueType": "option",
"width": 88,
"search": false,
"render": (dom, record) => {
return <a
onClick={() => {
Modal.info({
title: "库存信息",
width: 1200,
okText:"知道了",
content: (
<div>
<AutoTable
withCard={false}
columns={[
{
"title": "仓库编号",
"dataIndex": "storeCode",
"key": "storeCode",
},
{
"title": "仓库名称",
"dataIndex": "storeName",
"key": "storeName"
},
{
"title": "库位名称",
"dataIndex": "storePositionName",
"key": "storePositionName"
},
{
"title": "批次号/SN号",
"dataIndex": "materieControlNo",
"key": "materieControlNo"
},
{
"title": "供应商编号",
"dataIndex": "supplierNo",
"key": "supplierNo"
},
{
"title": "供应商名称",
"dataIndex": "supplierName",
"key": "supplierName"
},
{
"title": "库存数量",
"dataIndex": "stroeNum",
"key": "stroeNum"
},
]}
path="/ngic-workmanship/wmsMaterieStore/queryPositionList"
extraparams={{
level: select.level ?? 0,
key: select.selectedKeys ?? "",
materieId: record.id
}}
>
</AutoTable>
</div>
)
})
}}
>
查看
</a>
}
} }
] ]
...@@ -59,7 +129,12 @@ const Storesearch = (props) => { ...@@ -59,7 +129,12 @@ const Storesearch = (props) => {
...props, ...props,
pageextra: "none", pageextra: "none",
columns, columns,
path: "/ngic-workmanship/wmsMaterieStock/queryStockList" path: "/ngic-workmanship/wmsMaterieStock/queryStockList",
extraparams: {
level: select.level ?? 0,
key: select.selectedKeys ?? ""
}
} }
...@@ -100,10 +175,11 @@ const Storesearch = (props) => { ...@@ -100,10 +175,11 @@ const Storesearch = (props) => {
params={{}} params={{}}
noaction={true} noaction={true}
maxWidth={140} maxWidth={140}
onselected={(selectedKeys, e) => { onselected={(selectedKeys, e, alldata) => {
setselect(selectedKeys[0] ? { setselect(selectedKeys[0] ? {
title: e.node.title, title: e.node.title,
selectedKeys: selectedKeys[0] selectedKeys: selectedKeys[0],
level: alldata.filter(it => it.key == selectedKeys[0])[0]?.level
} : { } : {
}) })
...@@ -148,13 +224,19 @@ const Storesearch = (props) => { ...@@ -148,13 +224,19 @@ const Storesearch = (props) => {
> >
<AutoTable <AutoTable
{ {
...tableprops ...tableprops
} }
withCard={false}
></AutoTable> ></AutoTable>
</div> </div>
</Content> </Content>
</Layout> </Layout>
</Layout> </Layout>
); );
}; };
......
...@@ -767,6 +767,7 @@ const one = { ...@@ -767,6 +767,7 @@ const one = {
}, },
{ {
cardTitle: "上架明细", cardTitle: "上架明细",
noPrint:true,
itemData: [ itemData: [
{ {
key: "materialUploadList", key: "materialUploadList",
......
...@@ -189,6 +189,7 @@ const Variable = (props) => { ...@@ -189,6 +189,7 @@ const Variable = (props) => {
const { businessMsgSceneId, dispatch } = props; const { businessMsgSceneId, dispatch } = props;
return <div> return <div>
<AutoTable <AutoTable
withCard={false}
columns={[ columns={[
{ {
"title": "变量名", "title": "变量名",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment