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

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

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