Commit 406ebf91 authored by wuhao's avatar wuhao 🎯

kildler

parent 2b7e6c2d
......@@ -2,6 +2,7 @@ import React, { Component } from "react";
import { Resizable } from "react-resizable";
function Resizecell({ onResize, onResizeStop, width, onClick, ...restProps }) {
return (
<Resizable
width={width??1}
......
......@@ -4,7 +4,6 @@ import Mtable from "./mtable";
import getPrem from "@/utils/getPrem"; //权限判断fn
import { ExportOutlined } from "@ant-design/icons";
const { useBreakpoint } = Grid;
function isString(obj) {
......@@ -43,57 +42,62 @@ function isString(obj) {
// onTabChange
// }
export default (props) => {
const screens = useBreakpoint();
const actionbtn = {
add: <Button
key={"add"}
disabled={props?.addconfig?.disabled || !getPrem(props?.addconfig?.premkey ?? "", "ifs")}
type="primary"
{...props?.addconfig?.btnprops}
onClick={() => {
props?.addconfig?.onClick?.()
}}
>
新增
</Button>,
export: <Button
key={"add"}
disabled={props?.exportconfig?.disabled || !getPrem(props?.exportconfig?.premkey ?? "", "ifs")}
type="danger"
icon={<ExportOutlined />}
{...props?.exportconfig?.btnprops}
onClick={() => {
props?.exportconfig?.onClick?.()
}}
>
导出
</Button>
}
add: (
<Button
key={"add"}
disabled={
props?.addconfig?.disabled ||
!getPrem(props?.addconfig?.premkey ?? "", "ifs")
}
type="primary"
{...props?.addconfig?.btnprops}
onClick={() => {
props?.addconfig?.onClick?.();
}}
>
新增
</Button>
),
export: (
<Button
key={"add"}
disabled={
props?.exportconfig?.disabled ||
!getPrem(props?.exportconfig?.premkey ?? "", "ifs")
}
type="danger"
icon={<ExportOutlined />}
{...props?.exportconfig?.btnprops}
onClick={() => {
props?.exportconfig?.onClick?.();
}}
>
导出
</Button>
),
};
//右上角 pageextra 类型 1.reactDom 2.string 以逗号隔开 为none时不显示
const renderextra = () => {
if (props.pageextra && !isString(props.pageextra)) {
return props.pageextra
return props.pageextra;
} 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) {
let strarr = props.pageextra ? props.pageextra.split(",") : ["add"];
return strarr.map((it, i) => {
return <div style={{ marginRight: i == strarr.length - 1 ? 0 : 6 }}>
{actionbtn[it]}
</div>
})
return (
<div style={{ marginRight: i == strarr.length - 1 ? 0 : 6 }}>
{actionbtn[it]}
</div>
);
});
}
}
};
// screens.xs ? (
// <div
// style={{ display: "flex", flexDirection: "column", height: "100%" }}
......@@ -105,7 +109,7 @@ export default (props) => {
// <Mcard {...props} pageextra={renderextra()}/>
// </div>
// </div>
// ) :
// ) :
return (
<div className="diycard">
......
This diff is collapsed.
This diff is collapsed.
......@@ -511,7 +511,7 @@ export default function CheckTable({
)}
</div>
)}
rowClassNameFn={(record, index) => {
rowClassName={(record, index) => {
if (currentkey === record[rowKey]) {
return "selectedRow";
}
......@@ -733,7 +733,7 @@ export default function CheckTable({
)}
</div>
)}
rowClassNameFn={(record, index) => {
rowClassName={(record, index) => {
if (currentkey === record[rowKey]) {
return "selectedRow";
}
......
import React, { useEffect, useMemo, useRef, useState } from "react";
import {
Dropdown,
Menu,
Button,
message,
} from "antd";
import { Dropdown, Menu, Button, Tooltip } from "antd";
import { ProTable } from "@ant-design/pro-table";
import { doFetch } from "@/utils/doFetch";
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 (
<div>
<AutoTable
{
...tableprops
}
actionRef={actionRef}
onRef={(node) => (ChildRef = node)}
></AutoTable>
</div>
);
return (
<div>
<AutoTable
{...props}
pageextra="none"
path="/ngic-workmanship/wmsMaterieStockRecord/queryList"
columns={columns}
></AutoTable>
</div>
);
}
export default Instore;
\ No newline at end of file
export default Instore;
......@@ -212,7 +212,7 @@ const one = {
return res?.data?.dataList
},
"fieldProps": {
allowClear: false,
allowClear: true,
showSearch: true
},
"formItemProps": () => {
......@@ -350,7 +350,7 @@ const one = {
return res?.data?.dataList
},
"fieldProps": {
allowClear: false,
allowClear: true,
showSearch: true
},
"formItemProps": () => {
......@@ -473,7 +473,7 @@ const one = {
return res?.data?.dataList
},
"fieldProps": {
allowClear: false,
allowClear: true,
showSearch: true
},
"formItemProps": () => {
......@@ -493,7 +493,7 @@ const one = {
return res?.data?.dataList
},
"fieldProps": {
allowClear: false,
allowClear: true,
showSearch: true
},
"formItemProps": () => {
......@@ -616,7 +616,7 @@ const one = {
return res?.data?.dataList
},
"fieldProps": {
allowClear: false,
allowClear: true,
showSearch: true
},
"formItemProps": () => {
......@@ -636,7 +636,7 @@ const one = {
return res?.data?.dataList
},
"fieldProps": {
allowClear: false,
allowClear: true,
showSearch: true
},
"formItemProps": () => {
......@@ -704,10 +704,6 @@ const one = {
title: "相关单号",
key: "businessNo",
},
{
title: "备注",
key: "remark",
},
{
title: "创建人",
key: "createUserName",
......@@ -723,8 +719,14 @@ const one = {
title: "完成时间",
key: "finishTime",
},
{
title: "备注",
key: "remark",
noshow:"100%",
},
{
title: "工单二维码",
noshow:true,
key: "qrCodeUrl",
type: "img",
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 = {
return res?.data?.dataList
},
"fieldProps": {
allowClear: false,
allowClear: true,
showSearch: true
},
"formItemProps": () => {
......@@ -357,7 +357,7 @@ const one = {
return res?.data?.dataList
},
"fieldProps": {
allowClear: false,
allowClear: true,
showSearch: true
},
"formItemProps": () => {
......@@ -478,7 +478,7 @@ const one = {
return res?.data?.dataList
},
"fieldProps": {
allowClear: false,
allowClear: true,
showSearch: true
},
"formItemProps": () => {
......@@ -599,7 +599,7 @@ const one = {
return res?.data?.dataList
},
"fieldProps": {
allowClear: false,
allowClear: true,
showSearch: true
},
"formItemProps": () => {
......@@ -667,10 +667,6 @@ const one = {
title: "相关单号",
key: "businessNo",
},
{
title: "备注",
key: "remark",
},
{
title: "创建人",
key: "createUserName",
......@@ -687,10 +683,16 @@ const one = {
title: "完成时间",
key: "finishTime",
},
{
title: "备注",
key: "remark",
noshow:"100%",
},
{
title: "工单二维码",
key: "qrCodeUrl",
type: "img",
noshow:true,
width: 100,
height: 100
},
......
......@@ -7,6 +7,7 @@ import DrawInitForm from "@/components/DrawInitForm";
import getPrem from "@/utils/getPrem"; //权限判断fn
import { useReactToPrint } from "react-to-print";
import { useModel } from "umi";
import PrintDom from "./printdom";
const keytoval = {
one: 1,
......@@ -72,7 +73,7 @@ function Outstore(props) {
}
const handlePrint = useReactToPrint({
content: () => printRef.current,
content: () => printRef.current.dom.current,
});
const columns = useMemo(() => {
......@@ -96,7 +97,6 @@ function Outstore(props) {
totalPath:
"/ngic-workmanship/wmsMaterieOutstore/getOutStoreInfoById",
totalParams: { id: record.id },
printRef: printRef,
extra: (
<Button
onClick={async () => {
......@@ -142,6 +142,10 @@ function Outstore(props) {
title: "出库仓库",
dataIndex: "storeName",
key: "storeId",
fieldProps: {
allowClear: true,
showSearch: true
},
options: {
database: () =>
doFetch({
......@@ -315,12 +319,12 @@ function Outstore(props) {
title: "出库仓库",
dataIndex: "storeName",
key: "storeId",
fieldProps: {
allowClear: true,
showSearch: true
},
options: {
database: () =>
doFetch({
url: "/ngic-auth/sysStore/selectionBox",
params: { factoryIdList: [] },
}),
database: () =>doFetch({url: "/ngic-auth/sysStore/selectionBox",params: { factoryIdList: [] }}),
params: {},
},
valueType: "select",
......@@ -428,6 +432,9 @@ function Outstore(props) {
return (
<div>
<div style={{ display: "none" }}>
<PrintDom ref={printRef} {...drawprops} />
</div>
<AutoTable
{...tableprops}
actionRef={actionRef}
......@@ -493,7 +500,7 @@ function Outstore(props) {
key: "materieId",
valueType: "select",
fieldProps: {
allowClear: false,
allowClear: true,
showSearch: true,
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