Commit 4bb54179 authored by 左玲玲's avatar 左玲玲 😬

供应商优化 && 入库上架采集

parent 6a16beab
......@@ -42,6 +42,7 @@ const Details = (props) => {
topNode,
printRef,
onloadeddata,
reload
} = props;
const [pageData, cp] = useState({});
......@@ -98,8 +99,8 @@ const Details = (props) => {
<pre className={col ? "" : styles.one}>{value}</pre>
</Tooltip>
) : (
<div>-</div>
);
<div>-</div>
);
} else if (type == "file") {
return (
<div style={{ display: "flex", flexFlow: "row wrap", width: "100%" }}>
......@@ -125,26 +126,24 @@ const Details = (props) => {
);
})
) : (
"-"
)}
"-"
)}
</div>
);
} else if (type == "img") {
return (
<div style={{ display: "flex", flexFlow: "row wrap" }}>
{value && value?.length
? value?.map((el) => {
return (
<Image
style={{ margin: "0 10px 0 0" }}
src={el?.url}
width={30}
height={30}
key={el?.uid}
></Image>
);
})
: "-"}
{
value ?
Array.isArray(value) && value.length > 0 ?
value?.map(el => {
return <Image style={{ margin: '0 10px 0 0' }} src={el?.url} width={30} height={30} key={el?.uid}></Image>
})
:
<Image style={{ margin: '0 10px 0 0' }} src={value} width={itemData.width ?? 30} height={itemData.height ?? 30}></Image>
:
"-"
}
</div>
);
} else if (type == "table") {
......@@ -227,7 +226,12 @@ const Details = (props) => {
extra={item?.extra ? <Button type="primary" onClick={() => {
doFetch({ url: item.extrapath, params: initialState[item.extrakey] }).then(res => {
if (res.code == "0000") {
message.success("操作成功")
if (reload) {
reload && reload()
} else {
message.success("操作成功");
}
}
})
}}>保存</Button> : null}
......
......@@ -69,16 +69,16 @@ const Details = (props) => {
//获取每一项
const getItem = (itemData) => {
const {
type,
key,
title,
columns,
path,
urlName,
col,
rowKey,
expandable,
} = itemData,
type,
key,
title,
columns,
path,
urlName,
col,
rowKey,
expandable,
} = itemData,
value = dataSource[key];
if (!type || type == "input") {
return value == 0 || value ? (
......@@ -86,8 +86,8 @@ const Details = (props) => {
<pre className={col ? "" : styles.one}>{value}</pre>
</Tooltip>
) : (
<div>-</div>
);
<div>-</div>
);
} else if (type == "file") {
return (
<div style={{ display: "flex", flexFlow: "row wrap", width: "100%" }}>
......@@ -113,26 +113,24 @@ const Details = (props) => {
);
})
) : (
"-"
)}
"-"
)}
</div>
);
} else if (type == "img") {
return (
<div style={{ display: "flex", flexFlow: "row wrap" }}>
{value && value?.length
? value?.map((el) => {
return (
<Image
style={{ margin: "0 10px 0 0" }}
src={el?.url}
width={30}
height={30}
key={el?.uid}
></Image>
);
})
: "-"}
{
value ?
Array.isArray(value) && value.length > 0 ?
value?.map(el => {
return <Image style={{ margin: '0 10px 0 0' }} src={el?.url} width={30} height={30} key={el?.uid}></Image>
})
:
<Image style={{ margin: '0 10px 0 0' }} src={value} width={itemData.width ?? 30} height={itemData.height ?? 30}></Image>
:
"-"
}
</div>
);
} else if (type == "table") {
......
......@@ -28,7 +28,8 @@ function DrawInitForm(props) {
topNode: props.topNode,
printRef: props.printRef,
onloadeddata: props.onloadeddata,
expandkeys: props.expandkeys
expandkeys: props.expandkeys,
reload:props.reload
}
return (
<Drawer
......
......@@ -20,9 +20,10 @@ const EditUpload = ({ record, fid, storeId }) => {
id: fid,
materialList: Object.keys(value)?.map?.(it => {
let id = it;
let newArr = value[id]?.filter(it=>it.id) ?? [];
return {
id,
uploadList: value[id]?.map(its => {
uploadList: newArr.map(its => {
return {
storePositionId: its?.storePositionId,
instroeNum: its?.instroeNum,
......@@ -703,6 +704,11 @@ const one = {
title: "状态",
key: "statusName",
},
{
title: "工单二维码",
key: "qrCodeUrl",
type:"img"
},
],
},
{
......@@ -924,6 +930,10 @@ const one = {
title: "创建时间",
key: "createTime",
},
{
title: "状态",
key: "statusName",
}
],
},
{
......
......@@ -401,6 +401,7 @@ function Instore(props) {
}
}
}}
reload={reload}
/>
</div>
);
......
......@@ -182,7 +182,7 @@ const Deviceprovide = (props) => {
}}
okText="确定"
cancelText="取消"
disabled={!getPrem("equipmentSupplier_updatestatus", "ifs")}
disabled={!getPrem("equipmentSupplier_updatestatus", "ifs") || row.sourceType==1}
>
< Switch checked={row.status == 1 ? true : false} checkedChildren="开启" unCheckedChildren="关闭" defaultChecked={false} />
</Popconfirm>
......@@ -250,6 +250,7 @@ const Deviceprovide = (props) => {
<Button disabled={!getPrem("equipmentSupplier_save", "ifs")} type="primary" onClick={() => {
for (let i in defaultFields) {
defaultFields[i].value = null;
defaultFields[i].disabled = false;
if (i == "supplierUserList") {
defaultFields[i].value = []
}
......@@ -276,6 +277,11 @@ const Deviceprovide = (props) => {
let data = res?.data?.data || {};
for (let i in defaultFields) {
defaultFields[i].value = data[i];
if (i == "status" && curitem.sourceType==1) {
defaultFields[i].disabled = true;
}else{
defaultFields[i].disabled = false;
}
}
dispatch({ type: "edit", fields: { ...defaultFields, ...result?.fields } })
}
......
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