Commit c65efff5 authored by wuhao's avatar wuhao 🎯

asder

parent d2411fb2
......@@ -11,7 +11,7 @@ export default {
// localhost:8000/api/** -> https://preview.pro.ant.design/api/**
"/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,
pathRewrite: {
"^/wms": "",
......
......@@ -82,7 +82,7 @@ export default (props) => {
return props.pageextra
} else if (props.pageextra === "none") {
return <div style={{ height: 32, width: 64 }}></div>
} else {
} else if (props.pageextra) {
let strarr = props.pageextra ? props.pageextra.split(",") : ["add"];
return strarr.map((it, i) => {
return <div style={{ marginRight: i == strarr.length - 1 ? 0 : 6 }}>
......
......@@ -12,11 +12,13 @@ import {
Rate,
Image,
message,
Section
} from "antd";
import { doFetch, postFetch } from "@/utils/doFetch";
import AutoTable from "@/components/Tableform";
import { useModel } from 'umi'
import styles from "./index.less";
import PrintProvider, { Print, NoPrint } from 'react-easy-print';
const Details = (props) => {
/**
......@@ -63,9 +65,9 @@ const Details = (props) => {
}
}, []);
useEffect(()=>{
useEffect(() => {
onloadeddata?.(pageData);
},[pageData])
}, [pageData])
const getCol = (itemcol) => {
......@@ -154,10 +156,10 @@ const Details = (props) => {
bordered={false}
dataSource={path ? null : value}
rowKey={rowKey ?? "id"}
expandable={expandable?{
expandable={expandable ? {
...expandable,
defaultExpandedRowKeys:value?.map(it=>it.id)
}:null}
defaultExpandedRowKeys: value?.map(it => it.id)
} : null}
pagination={pagination}
></AutoTable>
);
......@@ -205,14 +207,17 @@ const Details = (props) => {
`;
return (
<div className={`${styles.bodyBox} detailCards`} ref={printRef ?? ''}>
<PrintProvider>
<div className={`${styles.bodyBox} detailCards`} ref={printRef ?? null}>
<style type="text/css" media="print">
{pageStyle}
</style>
<Spin spinning={false}>
{topNode && <div>{topNode}</div>}
{totalCard?.map((item, i) => {
let Container = item?.noPrint ? NoPrint : Print;
return (
<Container force={true}>
<Card
key={i}
title={item.cardTitle}
......@@ -249,11 +254,14 @@ const Details = (props) => {
})}
</Row>
</Card>
</Container>
);
})}
{bottomNode && <div>{bottomNode}</div>}
</Spin>
</div>
</PrintProvider>
);
};
......
......@@ -38,6 +38,18 @@ function TreeRender({ url, deleteurl, saveurl, onselected, params, noaction, max
return res.filter(it => it.children).map(it => it.key)
}, [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();
......@@ -281,7 +293,7 @@ function TreeRender({ url, deleteurl, saveurl, onselected, params, noaction, max
<Tree
onSelect={(selectedKeys, e) => {
onselected?.(selectedKeys, e)
onselected?.(selectedKeys, e, alldata)
}}
autoExpandParent={true}
defaultExpandAll={true}
......
......@@ -3,7 +3,7 @@ import {
MenuFoldOutlined,
HomeOutlined
} 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 styles from './index.less'
import TreeRender from '@/components/TreeRender';
......@@ -52,6 +52,76 @@ const Storesearch = (props) => {
"dataIndex": "productionUnitName",
"key": "productionUnitName",
"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) => {
...props,
pageextra: "none",
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) => {
params={{}}
noaction={true}
maxWidth={140}
onselected={(selectedKeys, e) => {
onselected={(selectedKeys, e, alldata) => {
setselect(selectedKeys[0] ? {
title: e.node.title,
selectedKeys: selectedKeys[0]
selectedKeys: selectedKeys[0],
level: alldata.filter(it => it.key == selectedKeys[0])[0]?.level
} : {
})
......@@ -150,11 +226,17 @@ const Storesearch = (props) => {
{
...tableprops
}
withCard={false}
></AutoTable>
</div>
</Content>
</Layout>
</Layout>
);
};
......
......@@ -767,6 +767,7 @@ const one = {
},
{
cardTitle: "上架明细",
noPrint:true,
itemData: [
{
key: "materialUploadList",
......
......@@ -189,6 +189,7 @@ const Variable = (props) => {
const { businessMsgSceneId, dispatch } = props;
return <div>
<AutoTable
withCard={false}
columns={[
{
"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