From bde16c1fea2bf2376785025b0b37d382128ec28a Mon Sep 17 00:00:00 2001 From: zhaoy <137053305@qq.com> Date: Tue, 20 Feb 2024 11:22:53 +0800 Subject: [PATCH] z --- config/routes.js | 7 + .../goods/goodsbom/components/CreateBom.jsx | 2 +- src/pages/device/technology/index.jsx | 312 ++++++++++++++++++ src/pages/device/technology/services.js | 18 + 4 files changed, 338 insertions(+), 1 deletion(-) create mode 100644 src/pages/device/technology/index.jsx create mode 100644 src/pages/device/technology/services.js diff --git a/config/routes.js b/config/routes.js index 81023dc..c7a2bfc 100644 --- a/config/routes.js +++ b/config/routes.js @@ -210,6 +210,13 @@ export default [ component: './device/productmanage', access: 'k14', }, + { + name: '设备工艺', + icon: 'smile', + path: '/device/technology', + component: './device/technology', + access: 'k14', + }, // { // name: '设备工艺信息', // icon: 'smile', diff --git a/src/pages/database/goods/goodsbom/components/CreateBom.jsx b/src/pages/database/goods/goodsbom/components/CreateBom.jsx index 81d7f06..93392d6 100644 --- a/src/pages/database/goods/goodsbom/components/CreateBom.jsx +++ b/src/pages/database/goods/goodsbom/components/CreateBom.jsx @@ -71,7 +71,7 @@ const GoodsbomFrom = (props) => { setEditableRowKeys(soredata.map((item) => item.id)) setDataSource(soredata); } - },[props]) + },[]) const columns=[ { title: '物料名称', diff --git a/src/pages/device/technology/index.jsx b/src/pages/device/technology/index.jsx new file mode 100644 index 0000000..3550e15 --- /dev/null +++ b/src/pages/device/technology/index.jsx @@ -0,0 +1,312 @@ + +import { Modal, Button, message, Form, Upload, Select ,Popconfirm} from 'antd'; +import React, { useState, useRef, useEffect } from 'react'; +import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; +import { PlusOutlined } from '@ant-design/icons'; +import ProTable from '@ant-design/pro-table'; +import {GetTechnologyPage,GetProductList,GetDeviceVesionList } from "./services" +import { history } from 'umi'; +const key = 'message'; + + + + +const GoodsTypeManage = () => { + const [createModalVisible, handleModalVisible] = useState(false); + const actionRef = useRef(); + const [DictData, setDictData] = useState([]); + const [DeviceVesionData, setDeviceVesionData] = useState([]); + const [currentRow, setCurrentRow] = useState(); + const [selectedRowsState, setSelectedRows] = useState([]); + const [isModalOpen, setIsModalOpen] = useState(false); + const [isAddGoodsTemplate,setIsAddGoodsTemplate]=useState(false); + const [form] = Form.useForm(); + 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', + data: { "id": currentRow?.id, "deviceClientType": currentRow?.deviceTypeKey, "version": currentRow?.vesion,"isAddGoodsTemplate":isAddGoodsTemplate}, + action: '/saasbase/api/goods/goodstemplateexport', + headers: { + Authorization: 'Bearer ' + localStorage.getItem('token') + }, + onChange(info) { + if (info.file.status !== 'uploading') { + console.log(info.file, info.fileList); + } + setIsAddGoodsTemplate(false); + if (info.file.status === 'done') { + setIsModalOpen(false); + actionRef.current.reload(); + message.success(`${info.file.name} 文件上传成功.`); + } else if (info.file.status === 'error') { + message.error(`${info.file.name} 文件上载失败.`); + } + } + }; + const columns = [ + { + title: '主键', + dataIndex: 'id', + hideInSearch: true, + hideInTable: true, + tip: '规则名称是唯一的 key' + }, + { + title: '所属产品', + dataIndex: 'productName', + valueType: 'textarea', + }, + { + title: '版本号', + dataIndex: 'vesion', + valueType: 'textarea', + }, + { + title: '时间', + dataIndex: 'createTime', + valueType: 'textarea', + }, + // { + // title: '是否存在模板', + // dataIndex: 'templatePath', + // valueType: 'textarea', + // hideInSearch: true, + // render: (_, record) => [ + //