diff --git a/src/pages/company/account/index.jsx b/src/pages/company/account/index.jsx index 2415dda..1e59d87 100644 --- a/src/pages/company/account/index.jsx +++ b/src/pages/company/account/index.jsx @@ -70,7 +70,7 @@ const handleRemove = async (selectedRows) => { try { await api.removeCompany(selectedRows.map((row) => row.id)).then((r) => { if (r) { - message.success('删除成功,即将刷新'); + message.success('删除成功'); return true; } else { message.error('删除失败,请重试'); @@ -220,7 +220,7 @@ const companyManage = () => { onConfirm={() => { api.removeCompany([record.id]).then((r) => { - message.success('删除成功,即将刷新'); + message.success('删除成功'); actionRef.current.reload(); }); }} diff --git a/src/pages/database/goods/goodsbom/index.jsx b/src/pages/database/goods/goodsbom/index.jsx index 564f239..7a91f7e 100644 --- a/src/pages/database/goods/goodsbom/index.jsx +++ b/src/pages/database/goods/goodsbom/index.jsx @@ -147,7 +147,7 @@ const Advanced = (props) => { try { DelGoodsBom(record.id).then((r)=>{ if(r.data){ - message.success('删除成功,即将刷新'); + message.success('删除成功'); actionRef.current.reload(); }else{ message.error('删除失败,请重试'); diff --git a/src/pages/database/goods/goodstechnology/components/goodstechnologymaken.jsx b/src/pages/database/goods/goodstechnology/components/goodstechnologymaken.jsx index 44f4476..0070da7 100644 --- a/src/pages/database/goods/goodstechnology/components/goodstechnologymaken.jsx +++ b/src/pages/database/goods/goodstechnology/components/goodstechnologymaken.jsx @@ -470,6 +470,7 @@ const goodstechnologymaken = (props) => { setPromptVisible(false); }; const handleChangewarehousetemplate = (value) => { + setUpdataStatus('add') setWarehousrTemplateId(value) setdefaulttemplateValue(value) //判断属性和设备是否存在工艺 diff --git a/src/pages/database/goods/newgoods/index.jsx b/src/pages/database/goods/newgoods/index.jsx index dbb5046..ad26969 100644 --- a/src/pages/database/goods/newgoods/index.jsx +++ b/src/pages/database/goods/newgoods/index.jsx @@ -28,13 +28,17 @@ const GoodsManage = () => { const [goodData, setGoodData] = useState([]); const [deviceId, setDeviceId] = useState(''); const [deviceName, setDeviceName] = useState(''); - const [goodId, setGoodId] = useState(''); - const [goodName, setGoodName] = useState(''); + const [goodsId, setGoodsId] = useState([]); /** 国际化配置 */ useEffect(() => { gettree().then((r) => { setTreeData(r.data); }); + initGetDeviceTechnology(); + initGetgoodslist(); + }, []); + + const initGetDeviceTechnology = () =>{ GetDeviceTechnology().then((r) => { var arr = r.data; if (r.succeeded) { @@ -48,6 +52,8 @@ const GoodsManage = () => { setDeviceData(list); } }); + } + const initGetgoodslist = () =>{ Getgoodslist().then((r)=>{ var arr = r.data; if (r.succeeded) { @@ -61,7 +67,7 @@ const GoodsManage = () => { setGoodData(list); } }); - }, []); + } /** * 添加节点 @@ -383,8 +389,7 @@ const GoodsManage = () => { setDeviceName(option?.label); } const handleGoodChange = (value, option) => { - setGoodId(option?.value); - setGoodName(option?.label); + setGoodsId(value); } const handleDownload = async () => { if(deviceName == '') @@ -407,7 +412,7 @@ const GoodsManage = () => { link1.click(); document.body.removeChild(link1); // 第二次下载操作 - const base64String = await GoodsTechnologyExport({ goodId: goodId, deviceId: deviceId, fileName: fileName1 }); + const base64String = await GoodsTechnologyExport({ goodsId: goodsId, deviceId: deviceId, fileName: fileName1 }); if (!base64String) { message.error('未能获取第二个文件Base64数据'); return; @@ -425,7 +430,7 @@ const GoodsManage = () => { const url = window.URL.createObjectURL(blob); // 创建第二个 元素,用于下载第二个文件 const link2 = document.createElement('a'); - const fileName2 = goodName ? goodName : "所有商品" + ".xlsx"; + const fileName2 = "商品.xlsx"; link2.href = url; link2.setAttribute('download', fileName2); // 将第二个 元素添加到页面中 @@ -434,8 +439,9 @@ const GoodsManage = () => { link2.click(); // 下载完成后,移除第二个 元素 document.body.removeChild(link2); - setGoodName(''); - setGoodId(''); + setDeviceId(''); + setDeviceName(''); + setGoodsId([]); setIsModalOpen(false); } catch (error) { message.error('下载过程中发生错误:', error); @@ -490,6 +496,7 @@ const GoodsManage = () => {