Commit 406ebf91 authored by wuhao's avatar wuhao 🎯

kildler

parent 2b7e6c2d
...@@ -2,6 +2,7 @@ import React, { Component } from "react"; ...@@ -2,6 +2,7 @@ import React, { Component } from "react";
import { Resizable } from "react-resizable"; import { Resizable } from "react-resizable";
function Resizecell({ onResize, onResizeStop, width, onClick, ...restProps }) { function Resizecell({ onResize, onResizeStop, width, onClick, ...restProps }) {
return ( return (
<Resizable <Resizable
width={width??1} width={width??1}
......
...@@ -4,7 +4,6 @@ import Mtable from "./mtable"; ...@@ -4,7 +4,6 @@ import Mtable from "./mtable";
import getPrem from "@/utils/getPrem"; //权限判断fn import getPrem from "@/utils/getPrem"; //权限判断fn
import { ExportOutlined } from "@ant-design/icons"; import { ExportOutlined } from "@ant-design/icons";
const { useBreakpoint } = Grid; const { useBreakpoint } = Grid;
function isString(obj) { function isString(obj) {
...@@ -43,57 +42,62 @@ function isString(obj) { ...@@ -43,57 +42,62 @@ function isString(obj) {
// onTabChange // onTabChange
// } // }
export default (props) => { export default (props) => {
const screens = useBreakpoint(); const screens = useBreakpoint();
const actionbtn = { const actionbtn = {
add: <Button add: (
key={"add"} <Button
disabled={props?.addconfig?.disabled || !getPrem(props?.addconfig?.premkey ?? "", "ifs")} key={"add"}
type="primary" disabled={
{...props?.addconfig?.btnprops} props?.addconfig?.disabled ||
onClick={() => { !getPrem(props?.addconfig?.premkey ?? "", "ifs")
props?.addconfig?.onClick?.() }
}} type="primary"
> {...props?.addconfig?.btnprops}
新增 onClick={() => {
</Button>, props?.addconfig?.onClick?.();
export: <Button }}
key={"add"} >
disabled={props?.exportconfig?.disabled || !getPrem(props?.exportconfig?.premkey ?? "", "ifs")} 新增
type="danger" </Button>
icon={<ExportOutlined />} ),
{...props?.exportconfig?.btnprops} export: (
onClick={() => { <Button
props?.exportconfig?.onClick?.() key={"add"}
}} disabled={
> props?.exportconfig?.disabled ||
导出 !getPrem(props?.exportconfig?.premkey ?? "", "ifs")
</Button> }
type="danger"
} icon={<ExportOutlined />}
{...props?.exportconfig?.btnprops}
onClick={() => {
props?.exportconfig?.onClick?.();
}}
>
导出
</Button>
),
};
//右上角 pageextra 类型 1.reactDom 2.string 以逗号隔开 为none时不显示 //右上角 pageextra 类型 1.reactDom 2.string 以逗号隔开 为none时不显示
const renderextra = () => { const renderextra = () => {
if (props.pageextra && !isString(props.pageextra)) { if (props.pageextra && !isString(props.pageextra)) {
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 if (props.pageextra) { } 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 (
{actionbtn[it]} <div style={{ marginRight: i == strarr.length - 1 ? 0 : 6 }}>
</div> {actionbtn[it]}
}) </div>
);
});
} }
} };
// screens.xs ? ( // screens.xs ? (
// <div // <div
// style={{ display: "flex", flexDirection: "column", height: "100%" }} // style={{ display: "flex", flexDirection: "column", height: "100%" }}
...@@ -105,7 +109,7 @@ export default (props) => { ...@@ -105,7 +109,7 @@ export default (props) => {
// <Mcard {...props} pageextra={renderextra()}/> // <Mcard {...props} pageextra={renderextra()}/>
// </div> // </div>
// </div> // </div>
// ) : // ) :
return ( return (
<div className="diycard"> <div className="diycard">
......
This diff is collapsed.
This diff is collapsed.
...@@ -511,7 +511,7 @@ export default function CheckTable({ ...@@ -511,7 +511,7 @@ export default function CheckTable({
)} )}
</div> </div>
)} )}
rowClassNameFn={(record, index) => { rowClassName={(record, index) => {
if (currentkey === record[rowKey]) { if (currentkey === record[rowKey]) {
return "selectedRow"; return "selectedRow";
} }
...@@ -733,7 +733,7 @@ export default function CheckTable({ ...@@ -733,7 +733,7 @@ export default function CheckTable({
)} )}
</div> </div>
)} )}
rowClassNameFn={(record, index) => { rowClassName={(record, index) => {
if (currentkey === record[rowKey]) { if (currentkey === record[rowKey]) {
return "selectedRow"; return "selectedRow";
} }
......
import React, { useEffect, useMemo, useRef, useState } from "react"; import React, { useEffect, useMemo, useRef, useState } from "react";
import { import { Dropdown, Menu, Button, Tooltip } from "antd";
Dropdown, import { ProTable } from "@ant-design/pro-table";
Menu, import { doFetch } from "@/utils/doFetch";
Button,
message,
} from "antd";
import AutoTable from "@/components/AutoTable"; import AutoTable from "@/components/AutoTable";
function Instore(props) {
const actionRef = useRef(),
ChildRef = null;
const columns = [
{
"title": "操作时间",
"dataIndex": "operateTime",
"key": "operateTimeList",
"valueType": "dateRange",
"render": (_, row) => { return (<div>{row.operateTime}</div>) },
},
{
"title": "操作人",
"dataIndex": "operateUserName",
"key": "operateUserName"
},
{
"title": "物料编码",
"dataIndex": "materieCode",
"key": "materieCode"
},
{
"title": "物料名称",
"dataIndex": "materieName",
"key": "materieName"
},
{
"title": "批次号/SN号",
"dataIndex": "materieControlNo",
"key": "materieControlNo"
},
{
"title": "当时库存数量",
"dataIndex": "currentNum",
"key": "currentNum",
"search": false
},
{
"title": "操作数量",
"dataIndex": "operateNum",
"key": "operateNum",
"search": false
},
{
"title": "库存单位",
"dataIndex": "productionUnitName",
"key": "productionUnitName",
"search": false
},
{
"title": "操作类型",
"dataIndex": "stockDetailTypeName",
"key": "stockDetailTypeName",
},
{
"title": "仓库名称",
"dataIndex": "storeName",
"key": "storeId",
options: {
database: () => doFetch({ url: "/ngic-auth/sysStore/selectionBox", params: { factoryIdList: [] } }),
params: {}
},
valueType: "select",
},
{
"title": "库位",
"dataIndex": "storePositionName",
"key": "storePositionName"
},
{
"title": "相关单号",
"dataIndex": "relatedNo",
"key": "relatedNo"
}
]
const tableprops = {
...props,
pageextra: "none",
columns,
path: "/ngic-workmanship/wmsMaterieStockRecord/queryList"
}
function Instore(props) {
const columns = [
{
title: "操作时间",
dataIndex: "operateTime",
key: "operateTimeList",
valueType: "dateRange",
render: (_, row) => {
return <div>{row.operateTime}</div>;
},
},
{
title: "操作人",
dataIndex: "operateUserName",
key: "operateUserName",
},
{
title: "物料编码",
dataIndex: "materieCode",
key: "materieCode",
},
{
title: "物料名称",
dataIndex: "materieName",
key: "materieName",
},
{
title: "批次号/SN号",
dataIndex: "materieControlNo",
key: "materieControlNo",
},
{
title: "当时库存数量",
dataIndex: "currentNum",
key: "currentNum",
search: false,
},
{
title: "操作数量",
dataIndex: "operateNum",
key: "operateNum",
search: false,
},
{
title: "库存单位",
dataIndex: "productionUnitName",
key: "productionUnitName",
search: false,
},
{
title: "操作类型",
dataIndex: "stockDetailTypeName",
key: "stockDetailTypeName",
},
{
title: "出库仓库",
dataIndex: "storeName",
key: "storeName",
fieldProps: {
allowClear: true,
showSearch: true,
},
options: {
database: () =>
doFetch({
url: "/ngic-auth/sysStore/selectionBox",
params: { factoryIdList: [] },
}),
params: {},
},
valueType: "select",
},
{
title: "库位",
dataIndex: "storePositionName",
key: "storePositionName",
},
{
title: "相关单号",
dataIndex: "relatedNo",
key: "relatedNo",
},
]
return ( return (
<div> <div>
<AutoTable <AutoTable
{ {...props}
...tableprops pageextra="none"
} path="/ngic-workmanship/wmsMaterieStockRecord/queryList"
actionRef={actionRef} columns={columns}
onRef={(node) => (ChildRef = node)} ></AutoTable>
></AutoTable> </div>
</div> );
);
} }
export default Instore; export default Instore;
\ No newline at end of file
...@@ -212,7 +212,7 @@ const one = { ...@@ -212,7 +212,7 @@ const one = {
return res?.data?.dataList return res?.data?.dataList
}, },
"fieldProps": { "fieldProps": {
allowClear: false, allowClear: true,
showSearch: true showSearch: true
}, },
"formItemProps": () => { "formItemProps": () => {
...@@ -350,7 +350,7 @@ const one = { ...@@ -350,7 +350,7 @@ const one = {
return res?.data?.dataList return res?.data?.dataList
}, },
"fieldProps": { "fieldProps": {
allowClear: false, allowClear: true,
showSearch: true showSearch: true
}, },
"formItemProps": () => { "formItemProps": () => {
...@@ -473,7 +473,7 @@ const one = { ...@@ -473,7 +473,7 @@ const one = {
return res?.data?.dataList return res?.data?.dataList
}, },
"fieldProps": { "fieldProps": {
allowClear: false, allowClear: true,
showSearch: true showSearch: true
}, },
"formItemProps": () => { "formItemProps": () => {
...@@ -493,7 +493,7 @@ const one = { ...@@ -493,7 +493,7 @@ const one = {
return res?.data?.dataList return res?.data?.dataList
}, },
"fieldProps": { "fieldProps": {
allowClear: false, allowClear: true,
showSearch: true showSearch: true
}, },
"formItemProps": () => { "formItemProps": () => {
...@@ -616,7 +616,7 @@ const one = { ...@@ -616,7 +616,7 @@ const one = {
return res?.data?.dataList return res?.data?.dataList
}, },
"fieldProps": { "fieldProps": {
allowClear: false, allowClear: true,
showSearch: true showSearch: true
}, },
"formItemProps": () => { "formItemProps": () => {
...@@ -636,7 +636,7 @@ const one = { ...@@ -636,7 +636,7 @@ const one = {
return res?.data?.dataList return res?.data?.dataList
}, },
"fieldProps": { "fieldProps": {
allowClear: false, allowClear: true,
showSearch: true showSearch: true
}, },
"formItemProps": () => { "formItemProps": () => {
...@@ -704,10 +704,6 @@ const one = { ...@@ -704,10 +704,6 @@ const one = {
title: "相关单号", title: "相关单号",
key: "businessNo", key: "businessNo",
}, },
{
title: "备注",
key: "remark",
},
{ {
title: "创建人", title: "创建人",
key: "createUserName", key: "createUserName",
...@@ -723,8 +719,14 @@ const one = { ...@@ -723,8 +719,14 @@ const one = {
title: "完成时间", title: "完成时间",
key: "finishTime", key: "finishTime",
}, },
{
title: "备注",
key: "remark",
noshow:"100%",
},
{ {
title: "工单二维码", title: "工单二维码",
noshow:true,
key: "qrCodeUrl", key: "qrCodeUrl",
type: "img", type: "img",
width: 100, width: 100,
......
This diff is collapsed.
import { doFetch } from "@/utils/doFetch";
import React, {
useState,
useImperativeHandle,
forwardRef,
useRef,
} from "react";
import { useEffect } from "react";
import AutoTable from "@/components/AutoTable";
function PrintDom({ totalPath, val, totalParams, totalCard }, ref) {
let printRef = useRef();
const [data, setdata] = useState({});
useImperativeHandle(ref, () => ({
dom: printRef,
}));
useEffect(() => {
if (val == "detail") {
doFetch({ url: totalPath, params: totalParams }).then((res) => {
setdata(res?.data?.data);
});
} else {
}
}, [val]);
return (
val == "detail" && (
<div
ref={printRef}
style={{
position: "fixed",
top: 0,
left: 0,
zIndex: 999,
width: "100%",
height: "100%",
}}
>
<h1
style={{
textAlign: "center",
width: "100%",
paddingTop: 12,
paddingBottom: 16,
}}
>
入库工单
</h1>
<img
style={{
position: "absolute",
right: 12,
top: 12,
width: 86,
height: "auto",
}}
src={data?.qrCodeUrl}
alt=""
/>
<div style={{ display: "flex", flexWrap: "wrap", paddingLeft: "2%" }}>
{totalCard &&
totalCard[0].itemData
.filter((it) => !(it.noshow === true))
.map((it) => {
return (
<div
style={{
width: it.noshow ?? "32%",
backgroundColor: "#f9f9f9",
marginRight: "1%",
marginBottom: 10,
padding: "4px",
fontSize: 16,
overflow: "hidden",
}}
>
<b>{it.title}: </b>
<span>{data[it.key] || "-"}</span>
</div>
);
})}
</div>
<p style={{ margin: 0, padding: "4px 2%", fontSize: 18 }}>
<b>{totalCard && totalCard[1].cardTitle}</b>
</p>
<div style={{ margin: 0, padding: "4px 2%", fontSize: 18 }}>
<AutoTable
dataSource={data?.materialList}
x="96%"
style={{ marginTop: 8 }}
withCard={false}
pagination={"false"}
columns={[
{
title: "物料编码 - 名称",
dataIndex: "materieName",
key: "materieName",
search: false,
render: (dom, row) => {
return (
(row.materieCode ?? "") + " - " + (row.materieName ?? "")
);
},
},
{
title: "供应商编号 - 名称",
dataIndex: "supplierNo",
key: "supplierNo",
search: false,
render: (dom, row) => {
return (
(row.supplierNo ?? "") + " - " + (row.supplierName ?? "")
);
},
},
{
title: "批次号/SN号",
dataIndex: "materieControlNo",
key: "materieControlNo",
search: false,
},
{
title: "入库数量",
dataIndex: "instroeNum",
key: "instroeNum",
search: false,
},
{
title: "库存单位",
dataIndex: "productionUnitName",
key: "productionUnitName",
search: false,
},
]}
></AutoTable>
</div>
</div>
)
);
}
export default forwardRef(PrintDom);
...@@ -234,7 +234,7 @@ const one = { ...@@ -234,7 +234,7 @@ const one = {
return res?.data?.dataList return res?.data?.dataList
}, },
"fieldProps": { "fieldProps": {
allowClear: false, allowClear: true,
showSearch: true showSearch: true
}, },
"formItemProps": () => { "formItemProps": () => {
...@@ -357,7 +357,7 @@ const one = { ...@@ -357,7 +357,7 @@ const one = {
return res?.data?.dataList return res?.data?.dataList
}, },
"fieldProps": { "fieldProps": {
allowClear: false, allowClear: true,
showSearch: true showSearch: true
}, },
"formItemProps": () => { "formItemProps": () => {
...@@ -478,7 +478,7 @@ const one = { ...@@ -478,7 +478,7 @@ const one = {
return res?.data?.dataList return res?.data?.dataList
}, },
"fieldProps": { "fieldProps": {
allowClear: false, allowClear: true,
showSearch: true showSearch: true
}, },
"formItemProps": () => { "formItemProps": () => {
...@@ -599,7 +599,7 @@ const one = { ...@@ -599,7 +599,7 @@ const one = {
return res?.data?.dataList return res?.data?.dataList
}, },
"fieldProps": { "fieldProps": {
allowClear: false, allowClear: true,
showSearch: true showSearch: true
}, },
"formItemProps": () => { "formItemProps": () => {
...@@ -667,10 +667,6 @@ const one = { ...@@ -667,10 +667,6 @@ const one = {
title: "相关单号", title: "相关单号",
key: "businessNo", key: "businessNo",
}, },
{
title: "备注",
key: "remark",
},
{ {
title: "创建人", title: "创建人",
key: "createUserName", key: "createUserName",
...@@ -687,10 +683,16 @@ const one = { ...@@ -687,10 +683,16 @@ const one = {
title: "完成时间", title: "完成时间",
key: "finishTime", key: "finishTime",
}, },
{
title: "备注",
key: "remark",
noshow:"100%",
},
{ {
title: "工单二维码", title: "工单二维码",
key: "qrCodeUrl", key: "qrCodeUrl",
type: "img", type: "img",
noshow:true,
width: 100, width: 100,
height: 100 height: 100
}, },
......
...@@ -7,6 +7,7 @@ import DrawInitForm from "@/components/DrawInitForm"; ...@@ -7,6 +7,7 @@ import DrawInitForm from "@/components/DrawInitForm";
import getPrem from "@/utils/getPrem"; //权限判断fn import getPrem from "@/utils/getPrem"; //权限判断fn
import { useReactToPrint } from "react-to-print"; import { useReactToPrint } from "react-to-print";
import { useModel } from "umi"; import { useModel } from "umi";
import PrintDom from "./printdom";
const keytoval = { const keytoval = {
one: 1, one: 1,
...@@ -72,7 +73,7 @@ function Outstore(props) { ...@@ -72,7 +73,7 @@ function Outstore(props) {
} }
const handlePrint = useReactToPrint({ const handlePrint = useReactToPrint({
content: () => printRef.current, content: () => printRef.current.dom.current,
}); });
const columns = useMemo(() => { const columns = useMemo(() => {
...@@ -96,7 +97,6 @@ function Outstore(props) { ...@@ -96,7 +97,6 @@ function Outstore(props) {
totalPath: totalPath:
"/ngic-workmanship/wmsMaterieOutstore/getOutStoreInfoById", "/ngic-workmanship/wmsMaterieOutstore/getOutStoreInfoById",
totalParams: { id: record.id }, totalParams: { id: record.id },
printRef: printRef,
extra: ( extra: (
<Button <Button
onClick={async () => { onClick={async () => {
...@@ -142,6 +142,10 @@ function Outstore(props) { ...@@ -142,6 +142,10 @@ function Outstore(props) {
title: "出库仓库", title: "出库仓库",
dataIndex: "storeName", dataIndex: "storeName",
key: "storeId", key: "storeId",
fieldProps: {
allowClear: true,
showSearch: true
},
options: { options: {
database: () => database: () =>
doFetch({ doFetch({
...@@ -315,12 +319,12 @@ function Outstore(props) { ...@@ -315,12 +319,12 @@ function Outstore(props) {
title: "出库仓库", title: "出库仓库",
dataIndex: "storeName", dataIndex: "storeName",
key: "storeId", key: "storeId",
fieldProps: {
allowClear: true,
showSearch: true
},
options: { options: {
database: () => database: () =>doFetch({url: "/ngic-auth/sysStore/selectionBox",params: { factoryIdList: [] }}),
doFetch({
url: "/ngic-auth/sysStore/selectionBox",
params: { factoryIdList: [] },
}),
params: {}, params: {},
}, },
valueType: "select", valueType: "select",
...@@ -428,6 +432,9 @@ function Outstore(props) { ...@@ -428,6 +432,9 @@ function Outstore(props) {
return ( return (
<div> <div>
<div style={{ display: "none" }}>
<PrintDom ref={printRef} {...drawprops} />
</div>
<AutoTable <AutoTable
{...tableprops} {...tableprops}
actionRef={actionRef} actionRef={actionRef}
...@@ -493,7 +500,7 @@ function Outstore(props) { ...@@ -493,7 +500,7 @@ function Outstore(props) {
key: "materieId", key: "materieId",
valueType: "select", valueType: "select",
fieldProps: { fieldProps: {
allowClear: false, allowClear: true,
showSearch: true, showSearch: true,
options options
}, },
......
import { doFetch } from "@/utils/doFetch";
import React, {
useState,
useImperativeHandle,
forwardRef,
useRef,
} from "react";
import { useEffect } from "react";
import AutoTable from "@/components/AutoTable";
function PrintDom({ totalPath, val, totalParams, totalCard }, ref) {
let printRef = useRef();
const [data, setdata] = useState({});
useImperativeHandle(ref, () => ({
dom: printRef,
}));
useEffect(() => {
if (val == "detail") {
doFetch({ url: totalPath, params: totalParams }).then((res) => {
setdata(res?.data?.data);
});
} else {
}
}, [val]);
return (
val == "detail" && (
<div
ref={printRef}
style={{
position: "fixed",
top: 0,
left: 0,
zIndex: 999,
width: "100%",
height: "100%",
}}
>
<h1
style={{
textAlign: "center",
width: "100%",
paddingTop: 12,
paddingBottom: 16,
}}
>
出库工单
</h1>
<img
style={{
position: "absolute",
right: 12,
top: 12,
width: 86,
height: "auto",
}}
src={data?.qrCodeUrl}
alt=""
/>
<div style={{ display: "flex", flexWrap: "wrap", paddingLeft: "2%" }}>
{totalCard &&
totalCard[0].itemData
.filter((it) => !(it.noshow === true))
.map((it) => {
return (
<div
style={{
width: it.noshow ?? "32%",
backgroundColor: "#f9f9f9",
marginRight: "1%",
marginBottom: 10,
padding: "4px",
fontSize: 16,
overflow: "hidden",
}}
>
<b>{it.title}: </b>
<span>{data[it.key] || "-"}</span>
</div>
);
})}
</div>
<p style={{ margin: 0, padding: "4px 2%", fontSize: 18 }}>
<b>{totalCard && totalCard[1].cardTitle}</b>
</p>
<div style={{ margin: 0, padding: "4px 2%", fontSize: 18 }}>
<AutoTable
dataSource={data?.materialList}
x="96%"
style={{ marginTop: 8 }}
withCard={false}
pagination={"false"}
columns={[
{
title: "物料编码 - 名称",
dataIndex: "materieName",
key: "materieName",
search: false,
render: (dom, row) => {
return (
(row.materieCode ?? "") + " - " + (row.materieName ?? "")
);
},
},
{
title: "出库数量",
dataIndex: "outstroeNum",
key: "outstroeNum",
search: false,
},
{
title: "库存单位",
dataIndex: "productionUnitName",
key: "productionUnitName",
search: false,
},
]}
></AutoTable>
</div>
</div>
)
);
}
export default forwardRef(PrintDom);
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