Commit 9dbb5e30 authored by krysent's avatar krysent

仓库刷新

parent 76e4563b
...@@ -23,6 +23,9 @@ const Mtable = (props) => { ...@@ -23,6 +23,9 @@ const Mtable = (props) => {
getDefaultSelected, //存在默认选中向上返回选中值 getDefaultSelected, //存在默认选中向上返回选中值
} = props; } = props;
console.log('额外参数',extraparams);
const actionRefs = actionRef ?? useRef(), const actionRefs = actionRef ?? useRef(),
formRefs = formRef ?? useRef(), formRefs = formRef ?? useRef(),
ifspagination = pagination == "false" || pagination === false, ifspagination = pagination == "false" || pagination === false,
...@@ -32,6 +35,7 @@ const Mtable = (props) => { ...@@ -32,6 +35,7 @@ const Mtable = (props) => {
//调用接口 //调用接口
const request = async (params, sort, filter) => { const request = async (params, sort, filter) => {
console.log('request',extraparams);
if (!path) return; if (!path) return;
let newparams = { let newparams = {
...params, ...params,
...@@ -63,6 +67,8 @@ const Mtable = (props) => { ...@@ -63,6 +67,8 @@ const Mtable = (props) => {
total, total,
}; };
}; };
//更新 columns //更新 columns
useEffect(() => { useEffect(() => {
setcolumnes((s) => { setcolumnes((s) => {
...@@ -187,8 +193,8 @@ const Mtable = (props) => { ...@@ -187,8 +193,8 @@ const Mtable = (props) => {
useEffect(async () => { useEffect(async () => {
// console.log(history?.location?.pathname); // console.log(history?.location?.pathname);
await initDrage(); await initDrage();
}, []); }, [columns, extraparams, path, activeTabKey, refreshDep]);
// columns, extraparams, path, activeTabKey, refreshDep //
//缩放表格 //缩放表格
const handleResize = const handleResize =
(index) => (index) =>
......
...@@ -485,10 +485,6 @@ const Materiel = (props) => { ...@@ -485,10 +485,6 @@ const Materiel = (props) => {
// if (i == "issueType") { // if (i == "issueType") {
// defaultFields[i].value = 1; // defaultFields[i].value = 1;
// } // }
if (i == "materieTypeId") {
defaultFields[i].value =
materieTypeId == "00000000" ? null : materieTypeId;
}
} }
dispatch({ dispatch({
type: "add", type: "add",
...@@ -543,6 +539,9 @@ const Materiel = (props) => { ...@@ -543,6 +539,9 @@ const Materiel = (props) => {
data, data,
}; };
} }
useEffect(() => {
console.log("123", materieTypeId);
}, [materieTypeId]);
return ( return (
<div> <div>
<AutoTable <AutoTable
...@@ -553,7 +552,7 @@ const Materiel = (props) => { ...@@ -553,7 +552,7 @@ const Materiel = (props) => {
actionRef={actionRef} actionRef={actionRef}
onRef={(node) => (ChildRef = node)} onRef={(node) => (ChildRef = node)}
childposition="left" childposition="left"
extraparams={{ factoryId: materieTypeId }} extraparams={{ ...materieTypeId }}
x={600} x={600}
> >
<div <div
...@@ -570,8 +569,20 @@ const Materiel = (props) => { ...@@ -570,8 +569,20 @@ const Materiel = (props) => {
url="/ngic-auth/sysFactory/queryFactoryStoreTree" url="/ngic-auth/sysFactory/queryFactoryStoreTree"
// deleteurl="/ngic-auth/sysFactory/deleteById" // deleteurl="/ngic-auth/sysFactory/deleteById"
// saveurl="/ngic-auth/sysFactory/save" // saveurl="/ngic-auth/sysFactory/save"
onselected={(vals) => { onselected={(vals, e, alldata) => {
setmaterieTypeId(vals[0] ?? ""); console.log(e?.node);
const valType = e?.node?.level;
let obj = {};
if (valType == 1) {
// 工厂
obj.factoryId = vals[0] ?? "";
} else if (valType == 2) {
obj.storeId = vals[0] ?? "";
} else if (valType == 3) {
obj.storeAreaId = vals[0] ?? "";
}
console.log(obj);
setmaterieTypeId(obj);
}} }}
/> />
</div> </div>
......
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