Browse Source

设备工艺优化校验及导出工艺多选20240703

kitchenmanage
gwbvipvip 5 months ago
parent
commit
33b6808279
16 changed files with 50 additions and 37 deletions
  1. +2
    -2
      src/pages/company/account/index.jsx
  2. +1
    -1
      src/pages/database/goods/goodsbom/index.jsx
  3. +1
    -0
      src/pages/database/goods/goodstechnology/components/goodstechnologymaken.jsx
  4. +17
    -11
      src/pages/database/goods/newgoods/index.jsx
  5. +3
    -3
      src/pages/device/deviceInfo/index.jsx
  6. +2
    -2
      src/pages/device/deviceVesion/components/CreateForm.jsx
  7. +3
    -3
      src/pages/device/deviceVesion/index.jsx
  8. +6
    -3
      src/pages/device/product/index.jsx
  9. +1
    -1
      src/pages/device/productmanage/index.jsx
  10. +6
    -3
      src/pages/device/warehousepostion/index.jsx
  11. +1
    -1
      src/pages/order/orderflow/index.jsx
  12. +1
    -1
      src/pages/order/thirdOrder/index.jsx
  13. +1
    -1
      src/pages/org/orgamange/index.jsx
  14. +1
    -1
      src/pages/org/users/index.jsx
  15. +2
    -2
      src/pages/sys/dictionary/dictdata/index.jsx
  16. +2
    -2
      src/pages/sys/dictionary/dicttype/index.jsx

+ 2
- 2
src/pages/company/account/index.jsx View File

@@ -70,7 +70,7 @@ const handleRemove = async (selectedRows) => {
try { try {
await api.removeCompany(selectedRows.map((row) => row.id)).then((r) => { await api.removeCompany(selectedRows.map((row) => row.id)).then((r) => {
if (r) { if (r) {
message.success('删除成功,即将刷新');
message.success('删除成功');
return true; return true;
} else { } else {
message.error('删除失败,请重试'); message.error('删除失败,请重试');
@@ -220,7 +220,7 @@ const companyManage = () => {
onConfirm={() => { onConfirm={() => {
api.removeCompany([record.id]).then((r) => { api.removeCompany([record.id]).then((r) => {


message.success('删除成功,即将刷新');
message.success('删除成功');
actionRef.current.reload(); actionRef.current.reload();
}); });
}} }}


+ 1
- 1
src/pages/database/goods/goodsbom/index.jsx View File

@@ -147,7 +147,7 @@ const Advanced = (props) => {
try { try {
DelGoodsBom(record.id).then((r)=>{ DelGoodsBom(record.id).then((r)=>{
if(r.data){ if(r.data){
message.success('删除成功,即将刷新');
message.success('删除成功');
actionRef.current.reload(); actionRef.current.reload();
}else{ }else{
message.error('删除失败,请重试'); message.error('删除失败,请重试');


+ 1
- 0
src/pages/database/goods/goodstechnology/components/goodstechnologymaken.jsx View File

@@ -470,6 +470,7 @@ const goodstechnologymaken = (props) => {
setPromptVisible(false); setPromptVisible(false);
}; };
const handleChangewarehousetemplate = (value) => { const handleChangewarehousetemplate = (value) => {
setUpdataStatus('add')
setWarehousrTemplateId(value) setWarehousrTemplateId(value)
setdefaulttemplateValue(value) setdefaulttemplateValue(value)
//判断属性和设备是否存在工艺 //判断属性和设备是否存在工艺


+ 17
- 11
src/pages/database/goods/newgoods/index.jsx View File

@@ -28,13 +28,17 @@ const GoodsManage = () => {
const [goodData, setGoodData] = useState([]); const [goodData, setGoodData] = useState([]);
const [deviceId, setDeviceId] = useState(''); const [deviceId, setDeviceId] = useState('');
const [deviceName, setDeviceName] = useState(''); const [deviceName, setDeviceName] = useState('');
const [goodId, setGoodId] = useState('');
const [goodName, setGoodName] = useState('');
const [goodsId, setGoodsId] = useState([]);
/** 国际化配置 */ /** 国际化配置 */
useEffect(() => { useEffect(() => {
gettree().then((r) => { gettree().then((r) => {
setTreeData(r.data); setTreeData(r.data);
}); });
initGetDeviceTechnology();
initGetgoodslist();
}, []);

const initGetDeviceTechnology = () =>{
GetDeviceTechnology().then((r) => { GetDeviceTechnology().then((r) => {
var arr = r.data; var arr = r.data;
if (r.succeeded) { if (r.succeeded) {
@@ -48,6 +52,8 @@ const GoodsManage = () => {
setDeviceData(list); setDeviceData(list);
} }
}); });
}
const initGetgoodslist = () =>{
Getgoodslist().then((r)=>{ Getgoodslist().then((r)=>{
var arr = r.data; var arr = r.data;
if (r.succeeded) { if (r.succeeded) {
@@ -61,7 +67,7 @@ const GoodsManage = () => {
setGoodData(list); setGoodData(list);
} }
}); });
}, []);
}


/** /**
* 添加节点 * 添加节点
@@ -383,8 +389,7 @@ const GoodsManage = () => {
setDeviceName(option?.label); setDeviceName(option?.label);
} }
const handleGoodChange = (value, option) => { const handleGoodChange = (value, option) => {
setGoodId(option?.value);
setGoodName(option?.label);
setGoodsId(value);
} }
const handleDownload = async () => { const handleDownload = async () => {
if(deviceName == '') if(deviceName == '')
@@ -407,7 +412,7 @@ const GoodsManage = () => {
link1.click(); link1.click();
document.body.removeChild(link1); 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) { if (!base64String) {
message.error('未能获取第二个文件Base64数据'); message.error('未能获取第二个文件Base64数据');
return; return;
@@ -425,7 +430,7 @@ const GoodsManage = () => {
const url = window.URL.createObjectURL(blob); const url = window.URL.createObjectURL(blob);
// 创建第二个 <a> 元素,用于下载第二个文件 // 创建第二个 <a> 元素,用于下载第二个文件
const link2 = document.createElement('a'); const link2 = document.createElement('a');
const fileName2 = goodName ? goodName : "所有商品" + ".xlsx";
const fileName2 = "商品.xlsx";
link2.href = url; link2.href = url;
link2.setAttribute('download', fileName2); link2.setAttribute('download', fileName2);
// 将第二个 <a> 元素添加到页面中 // 将第二个 <a> 元素添加到页面中
@@ -434,8 +439,9 @@ const GoodsManage = () => {
link2.click(); link2.click();
// 下载完成后,移除第二个 <a> 元素 // 下载完成后,移除第二个 <a> 元素
document.body.removeChild(link2); document.body.removeChild(link2);
setGoodName('');
setGoodId('');
setDeviceId('');
setDeviceName('');
setGoodsId([]);
setIsModalOpen(false); setIsModalOpen(false);
} catch (error) { } catch (error) {
message.error('下载过程中发生错误:', error); message.error('下载过程中发生错误:', error);
@@ -490,6 +496,7 @@ const GoodsManage = () => {
<Button <Button
key="primary" key="primary"
onClick={async () => { onClick={async () => {
initGetgoodslist();
setIsModalOpen(true); setIsModalOpen(true);
}} }}
> >
@@ -564,9 +571,7 @@ const GoodsManage = () => {
maskClosable={false} maskClosable={false}
destroyOnClose={true} destroyOnClose={true}
onCancel={() => { onCancel={() => {
setGoodId('')
setDeviceId('') setDeviceId('')
setGoodName('')
setDeviceName('') setDeviceName('')
setIsModalOpen(false) setIsModalOpen(false)
}}> }}>
@@ -593,6 +598,7 @@ const GoodsManage = () => {
<div style={{ marginBottom: 10 }}> <div style={{ marginBottom: 10 }}>
<span style={{ marginLeft: 9, marginRight: 10 }}>选择商品:</span> <span style={{ marginLeft: 9, marginRight: 10 }}>选择商品:</span>
<Select <Select
mode='multiple'
showSearch showSearch
allowClear allowClear
style={{ style={{


+ 3
- 3
src/pages/device/deviceInfo/index.jsx View File

@@ -279,10 +279,10 @@ const GoodsTypeManage = () => {
onConfirm={async () => { onConfirm={async () => {
await DelDeviceInfo([record.id]).then((r) => { await DelDeviceInfo([record.id]).then((r) => {
if (r.data) { if (r.data) {
message.success('删除成功,即将刷新');
message.success('删除成功');
actionRef.current.reload(); actionRef.current.reload();
} else { } else {
message.error('删除失败');
message.error(r.errors);
} }


}); });
@@ -378,7 +378,7 @@ const GoodsTypeManage = () => {
const handleUpdate = async (fields) => { const handleUpdate = async (fields) => {
await UpdateDeviceInfo(JSON.stringify(fields)).then((r) => { await UpdateDeviceInfo(JSON.stringify(fields)).then((r) => {
if (r.succeeded) { if (r.succeeded) {
message.success('添加成功');
message.success('更新成功');
handleModalVisible(false); handleModalVisible(false);
actionRef.current.reload(); actionRef.current.reload();
} else { } else {


+ 2
- 2
src/pages/device/deviceVesion/components/CreateForm.jsx View File

@@ -151,9 +151,9 @@ const CreateForm = (props) => {
</Upload> </Upload>
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<Button type="primary" htmlType="submit">
{props.values.isUse ? (<span style={{ color: '#FA541C' }}>当前版本已有设备使用,无法修改!</span>) : (<Button type="primary" htmlType="submit">
保存 保存
</Button>
</Button>)}
</Form.Item> </Form.Item>
</Form> </Form>
</Modal> </Modal>


+ 3
- 3
src/pages/device/deviceVesion/index.jsx View File

@@ -82,7 +82,7 @@ const handleAdd = async (fields) => {
actionRef.current?.reloadAndRest?.(); actionRef.current?.reloadAndRest?.();
return true; return true;
} else { } else {
message.error('添加失败');
message.error(r.errors);
return false; return false;
} }
}); });
@@ -106,7 +106,7 @@ const handleUpdate = async (fields) => {
actionRef.current?.reloadAndRest?.(); actionRef.current?.reloadAndRest?.();
return true; return true;
} else { } else {
message.error('修改失败');
message.error(r.errors);
return false; return false;
} }
}); });
@@ -212,7 +212,7 @@ const handleRemove = async (selectedRows) => {
}else{ }else{
setFileList([]) setFileList([])
} }
// form.setFielsValue(record) // form.setFielsValue(record)
}} > 更新</a>, }} > 更新</a>,
<Popconfirm <Popconfirm


+ 6
- 3
src/pages/device/product/index.jsx View File

@@ -66,9 +66,12 @@ const GoodsTypeManage = () => {
cancelText="否" cancelText="否"
onConfirm={() => { onConfirm={() => {
DelProduct([record.id]).then((r) => { DelProduct([record.id]).then((r) => {
message.success('删除成功,即将刷新');
actionRef.current.reload();
if (r.data) {
message.success('删除成功');
actionRef.current.reload();
}else{
message.error(r.errors);
}
}); });
}} }}
onCancel={() => { }} onCancel={() => { }}


+ 1
- 1
src/pages/device/productmanage/index.jsx View File

@@ -309,7 +309,7 @@ const bomtechnology = (props) => {
onConfirm={ async() => { onConfirm={ async() => {
await deleteproducttopics([record.id]).then((r) => { await deleteproducttopics([record.id]).then((r) => {
message.success('删除成功,即将刷新');
message.success('删除成功');
actiontopisRef.current.reload(); actiontopisRef.current.reload();
// var params={productId:props.location.query.values.productId,current:1,pageSize:10} // var params={productId:props.location.query.values.productId,current:1,pageSize:10}
// LoadtopisData(params) // LoadtopisData(params)


+ 6
- 3
src/pages/device/warehousepostion/index.jsx View File

@@ -77,9 +77,12 @@ const GoodsTypeManage = () => {
cancelText="否" cancelText="否"
onConfirm={() => { onConfirm={() => {
WarehousetemplateDel([record.id]).then((r) => { WarehousetemplateDel([record.id]).then((r) => {
message.success('删除成功,即将刷新');
actionRef.current.reloadAndRest();
if (r.data) {
message.success('删除成功');
actionRef.current.reload();
} else {
message.error(r.errors);
}
}); });
}} }}
onCancel={() => { }} onCancel={() => { }}


+ 1
- 1
src/pages/order/orderflow/index.jsx View File

@@ -14,7 +14,7 @@ const handlerefund = async (value) => {
try { try {
api.StartRefund(data); api.StartRefund(data);
hide(); hide();
message.success('发起退款成功,即将刷新');
message.success('发起退款成功');
return true; return true;
} catch (error) { } catch (error) {
hide(); hide();


+ 1
- 1
src/pages/order/thirdOrder/index.jsx View File

@@ -11,7 +11,7 @@ const handlerefund = async (value) => {
try { try {
api.StartRefund(data); api.StartRefund(data);
hide(); hide();
message.success('发起退款成功,即将刷新');
message.success('发起退款成功');
return true; return true;
} catch (error) { } catch (error) {
hide(); hide();


+ 1
- 1
src/pages/org/orgamange/index.jsx View File

@@ -72,7 +72,7 @@ const handleRemove = async (selectedRows) => {
key: selectedRows.map((row) => row.key), key: selectedRows.map((row) => row.key),
}); });
hide(); hide();
message.success('删除成功,即将刷新');
message.success('删除成功');
return true; return true;
} catch (error) { } catch (error) {
hide(); hide();


+ 1
- 1
src/pages/org/users/index.jsx View File

@@ -107,7 +107,7 @@ const userManager = () => {
} else{ } else{
await api.RemoveUser(selectedRows.map((row) => row.id)).then((r) => { await api.RemoveUser(selectedRows.map((row) => row.id)).then((r) => {
if (r.data) { if (r.data) {
message.success('删除成功,即将刷新');
message.success('删除成功');
actionRef.current.reload(); actionRef.current.reload();
} else { } else {
message.error('删除失败,请重试'); message.error('删除失败,请重试');


+ 2
- 2
src/pages/sys/dictionary/dictdata/index.jsx View File

@@ -62,7 +62,7 @@ const handleRemove = async (selectedRows) => {
await api.removeDictData(selectedRows.map((row) => row.id)).then((r) => { await api.removeDictData(selectedRows.map((row) => row.id)).then((r) => {
if (r.succeeded) { if (r.succeeded) {
hide(); hide();
message.success('删除成功,即将刷新');
message.success('删除成功');
return true; return true;
} else { } else {
hide(); hide();
@@ -186,7 +186,7 @@ const DictDataManage = (props) => {
onConfirm={() => { onConfirm={() => {
api.removeDictData([record.id]).then((r) => { api.removeDictData([record.id]).then((r) => {
if (r.data) { if (r.data) {
message.success('删除成功,即将刷新');
message.success('删除成功');
actionRef.current.reload(); actionRef.current.reload();
} else { } else {
message.error('删除失败,请重试'); message.error('删除失败,请重试');


+ 2
- 2
src/pages/sys/dictionary/dicttype/index.jsx View File

@@ -63,7 +63,7 @@ const handleRemove = async (selectedRows) => {
await api.removeDictType(selectedRows.map((row) => row.id)).then((r) => { await api.removeDictType(selectedRows.map((row) => row.id)).then((r) => {
if (r.succeeded) { if (r.succeeded) {
hide(); hide();
message.success('删除成功,即将刷新');
message.success('删除成功');
return true; return true;
} else { } else {
hide(); hide();
@@ -161,7 +161,7 @@ const DictTypeManage = () => {
onConfirm={() => { onConfirm={() => {
api.removeDictType([record.id]).then((r) => { api.removeDictType([record.id]).then((r) => {
if (r.data) { if (r.data) {
message.success('删除成功,即将刷新');
message.success('删除成功');
actionRef.current.reload(); actionRef.current.reload();
} else { } else {
message.error('删除失败,请重试'); message.error('删除失败,请重试');


Loading…
Cancel
Save