Commit 1b957ba3 authored by krysent's avatar krysent

helo

parent f4cb1546
...@@ -172,6 +172,7 @@ const Station = (props) => { ...@@ -172,6 +172,7 @@ const Station = (props) => {
// url: "/ngic-auth/sysStation/save", // url: "/ngic-auth/sysStation/save",
// params: { ...newfields, ...difrid }, // params: { ...newfields, ...difrid },
// }); // });
reload()
}; };
const showConfirm = () => { const showConfirm = () => {
......
...@@ -189,7 +189,7 @@ const Materiel = (props) => { ...@@ -189,7 +189,7 @@ const Materiel = (props) => {
let dataSource = res?.data?.data ?? {}, let dataSource = res?.data?.data ?? {},
specials = res?.data?.data?.materieCharList ?? []; specials = res?.data?.data?.materieCharList ?? [];
let newData = formatFieds(specials, "special")?.data; let newData = formatFieds(specials, "special")?.data;
let newSpecialData = newData.map((it) => { let newSpecialData = newData.map((it) => {
dataSource[it.fieldsKey] = it.fieldRealValue; dataSource[it.fieldsKey] = it.fieldRealValue;
return { return {
...@@ -371,10 +371,10 @@ const Materiel = (props) => { ...@@ -371,10 +371,10 @@ const Materiel = (props) => {
formRefs formRefs
.validateFields() .validateFields()
.then((secondFields) => { .then((secondFields) => {
console.log(secondFields); console.log("表单的fields",secondFields);
let secondFieldsKeys = Object.keys(secondFields); let secondFieldsKeys = Object.keys(secondFields);
console.log("defaultSpecificFileds", defaultSpecificFileds); console.log("defaultSpecificFileds", defaultSpecificFileds);
let materieCharList = defaultSpecificFileds.map((it) => { let materieCharList = defaultCommonFields.map((it) => {
if (secondFieldsKeys.indexOf(it.fieldsKey) != -1) { if (secondFieldsKeys.indexOf(it.fieldsKey) != -1) {
it.fieldRealValue = secondFields[it.fieldsKey]; it.fieldRealValue = secondFields[it.fieldsKey];
} }
...@@ -395,6 +395,7 @@ const Materiel = (props) => { ...@@ -395,6 +395,7 @@ const Materiel = (props) => {
}; };
return el; return el;
}); });
console.log("materieCharList:",materieCharList);
let materieProductUnitList = let materieProductUnitList =
firstValues?.materieProductUnitList?.map((it) => { firstValues?.materieProductUnitList?.map((it) => {
return { return {
......
...@@ -236,18 +236,6 @@ function Instore(props) { ...@@ -236,18 +236,6 @@ function Instore(props) {
})); }));
} }
const getPCHlist = async () => {
let res = await doFetch({
url: "/ngic-workmanship/wmsMaterieLabel/selectionByStatus",
params: { status: "1" },
});
return res?.data?.dataList;
};
useEffect(() => {
getPCHlist();
}, [drawprops?.visible]);
const handlePrint = useReactToPrint({ const handlePrint = useReactToPrint({
content: () => printRef.current.dom.current, content: () => printRef.current.dom.current,
}); });
...@@ -255,8 +243,26 @@ function Instore(props) { ...@@ -255,8 +243,26 @@ function Instore(props) {
const mutiPrint = useReactToPrint({ const mutiPrint = useReactToPrint({
content: () => mutiPrintRef.current.dom.current, content: () => mutiPrintRef.current.dom.current,
}); });
const [PchList, setPchList] = useState();
useEffect(() => {
if (drawprops?.visible) {
doFetch({
url: "/ngic-workmanship/wmsMaterieLabel/selectionByStatus",
params: { status: "1" },
}).then((res) => {
setPchList(res?.data?.dataList);
});
}
}, [drawprops?.visible]);
const defaultFields = useMemo(() => { const defaultFields = useMemo(() => {
console.log(1); let option = {
options: PchList,
allowClear: true,
showSearch: true,
};
console.log("pchlist:", option);
return { return {
four: { four: {
materieInstoreNo: { materieInstoreNo: {
...@@ -333,19 +339,14 @@ function Instore(props) { ...@@ -333,19 +339,14 @@ function Instore(props) {
key: "labelId", key: "labelId",
valueType: "select", valueType: "select",
width: 180, width: 180,
request: async () => { fieldProps: option,
return await getPCHlist();
},
fieldProps: {
allowClear: true,
showSearch: true,
},
formItemProps: () => { formItemProps: () => {
return { return {
rules: [{ required: true, message: "此项为必填项" }], rules: [{ required: true, message: "此项为必填项" }],
}; };
}, },
}, },
{ {
title: ( title: (
<span> <span>
...@@ -828,7 +829,13 @@ function Instore(props) { ...@@ -828,7 +829,13 @@ function Instore(props) {
], ],
}), }),
}; };
}, [drawprops.visible]); }, [ PchList]);
// const defaultFields = useMemo(() => {
// console.log(PchList);
// return
// }, [PchList]);
const PrintButton = ( const PrintButton = (
<Button <Button
disabled={!selectKeys.length} disabled={!selectKeys.length}
......
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