Browse Source

提交

dev
gwbvipvip 11 months ago
parent
commit
7d257998b5
2 changed files with 51 additions and 8 deletions
  1. +5
    -6
      src/pages/device/deviceVesion/index.jsx
  2. +46
    -2
      src/pages/device/devicetechnology/index.jsx

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

@@ -118,12 +118,11 @@ const GoodsTypeManage = () => {
// form.setFielsValue(record)
}} > 更新</a>,

// <a
// key="config"
// onClick={() => {
// handleModalVisible(true);
// setCurrentRow(record);
// }} > 下载工艺模板</a>
<a
key="config"
href={record.templatePath}
> 下载工艺模板</a>

],
},


+ 46
- 2
src/pages/device/devicetechnology/index.jsx View File

@@ -1,5 +1,5 @@
import { DropboxOutlined, PlusOutlined } from '@ant-design/icons';
import { Button, message, Input, Drawer, Modal, Popconfirm } from 'antd';
import { DropboxOutlined, PlusOutlined,UploadOutlined } from '@ant-design/icons';
import { Button, message, Input, Upload, Modal, Popconfirm } from 'antd';
import React, { useState, useRef, useEffect } from 'react';
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
import ProTable from '@ant-design/pro-table';
@@ -54,6 +54,36 @@ const handleRemove = async (ids) => {
}
};

const props = {
beforeUpload: (file) => {
if (
file.type !== 'application/vnd.ms-excel' &&
file.type !== 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
) {
message.error(`${file.name} 不是 exelce 文件`);
}
return file.type == 'application/vnd.ms-excel' ||
file.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
? true
: Upload.LIST_IGNORE;
},
name: 'file',
action: '/kitchen/api/goodes/DeviceVersionTemplateImport',
headers: {
Authorization:'Bearer ' + localStorage.getItem('token')
},
onChange(info) {
if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList);
}
if (info.file.status === 'done') {
message.success(`${info.file.name} file uploaded successfully`);
} else if (info.file.status === 'error') {
message.error(`${info.file.name} file upload failed.`);
}
}
};

/**
* 更新节点
*
@@ -231,6 +261,20 @@ const bomtechnology = () => {
>
<PlusOutlined /> 新建
</Button>,
<Button
key="primary"
onClick={async () => {
const link = document.createElement('a');
link.href = "https://hbl-test-1305371387.cos.ap-chengdu.myqcloud.com//Franchisee/gzaxn@163.com/goods/133458884696092845.xlsx";
link.click();
}}
>
<UploadOutlined /> 下载设备版本工艺模板
</Button>,
<Upload {...props}>
<Button icon={<UploadOutlined />}>导入工艺模版</Button>
</Upload>
]}
//数据绑定
request={async (params) => {


Loading…
Cancel
Save