Yanko 2 месяцев назад
Родитель
Сommit
a4e40bc33b
14 измененных файлов: 188 добавлений и 420 удалений
  1. +0
    -1
      frontend/dist/770.91621533.async.js
  2. +0
    -1
      frontend/dist/899.e49ce433.async.js
  3. +2
    -2
      frontend/dist/index.html
  4. +0
    -1
      frontend/dist/p__final__index.ef06293d.async.js
  5. +0
    -1
      frontend/dist/p__workInfo__index.88dd24f5.async.js
  6. +0
    -1
      frontend/dist/preload_helper.c8b83608.js
  7. +0
    -304
      frontend/dist/umi.17801edc.js
  8. +7
    -0
      frontend/src/api/finalCraftSteps/dto.d.ts
  9. +5
    -0
      frontend/src/api/workService.ts
  10. +17
    -38
      frontend/src/pages/final/index.tsx
  11. +12
    -3
      frontend/src/pages/godown/index.tsx
  12. +143
    -68
      frontend/src/pages/workInfo/index.tsx
  13. +1
    -0
      frontend/src/types/OrderType.ts
  14. +1
    -0
      frontend/src/types/WorkInfo.d.ts

+ 0
- 1
frontend/dist/770.91621533.async.js
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 0
- 1
frontend/dist/899.e49ce433.async.js
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 2
- 2
frontend/dist/index.html Просмотреть файл

@@ -5,10 +5,10 @@
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="/umi.22bc53e6.css">
<script src="/preload_helper.c8b83608.js"></script>
<script src="/preload_helper.65849a2a.js"></script>
</head>
<body>
<div id="root"></div>
<script src="/umi.17801edc.js"></script>
<script src="/umi.9bdc022b.js"></script>
</body>
</html>

+ 0
- 1
frontend/dist/p__final__index.ef06293d.async.js
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 0
- 1
frontend/dist/p__workInfo__index.88dd24f5.async.js
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 0
- 1
frontend/dist/preload_helper.c8b83608.js Просмотреть файл

@@ -1 +0,0 @@
!function(){"use strict";var t="/".replace(/([^/])$/,"$1/"),e=location.pathname,n=e.startsWith(t)&&decodeURI("/".concat(e.slice(t.length)));if(n){var a=document,c=a.head,r=a.createElement.bind(a),i=function(t,e,n){var a,c=e.r[t]||(null===(a=Object.entries(e.r).find((function(e){var n=e[0];return new RegExp("^".concat(n.replace(/\/:[^/]+/g,"/[^/]+").replace("/*","/.+"),"$")).test(t)})))||void 0===a?void 0:a[1]);return null==c?void 0:c.map((function(t){var a=e.f[t][1],c=e.f[t][0];return{type:c.split(".").pop(),url:"".concat(n.publicPath).concat(c),attrs:[["data-".concat(e.b),"".concat(e.p,":").concat(a)]]}}))}(n,{"p":"ant-design-pro","b":"webpack","f":[["p__system__role__index.455b2d03.async.js",24],["p__deviceInfo__index.8878b771.async.js",36],["p__user__login__index.26100c69.chunk.css",37],["p__user__login__index.b934e735.async.js",37],["p__workInfo__plan.c586c2de.async.js",43],["119.4e6a5656.async.js",119],["145.301a8164.async.js",145],["p__system__module__index.ef46db37.chunk.css",257],["p__system__module__index.ed9bfb89.async.js",257],["p__materials__index.8b1d798e.async.js",262],["t__plugin-layout__Layout.5012e1ab.chunk.css",301],["t__plugin-layout__Layout.2c017a91.async.js",301],["390.c53868f3.async.js",390],["393.e127e60f.async.js",393],["p__deviceProductInfo__index.835c0c6c.chunk.css",402],["p__deviceProductInfo__index.1f88a9d8.async.js",402],["p__workInfo__index.88dd24f5.async.js",420],["p__welcome__index.dde73410.async.js",446],["p__stock__index.3cc68eb4.async.js",450],["p__final__index.49759dc4.chunk.css",460],["p__final__index.ef06293d.async.js",460],["p__system__user__index.695d982e.chunk.css",472],["p__system__user__index.60325376.async.js",472],["t__plugin-maxtabs__Layout.b832af3b.async.js",558],["565.b1a57ede.async.js",565],["p__404.a52587bb.async.js",571],["635.973728c8.async.js",635],["770.91621533.async.js",770],["821.b970c16a.async.js",821],["838.1fdf35ab.async.js",838],["899.e49ce433.async.js",899],["p__dict__index.84f57017.async.js",918],["p__plantModel__process.2e985b3e.async.js",988],["p__productLine__line.74e003b9.async.js",990]],"r":{"/*":[25,28],"/":[13,17,23,5,10,11,28,29],"/user/login":[2,3],"/system/user":[5,6,21,22,28,23,10,11,29],"/system/role":[0,5,6,28,23,10,11,29],"/system/module":[5,6,7,8,28,23,10,11,29],"/system/dict":[5,6,28,31,23,10,11,29],"/wmx/deviceProduct":[5,6,14,15,28,23,10,11,29],"/wmx/deviceinfo":[1,5,6,28,23,10,11,29],"/factory/process":[5,6,28,32,23,10,11,29],"/factory/line":[5,6,24,26,28,33,23,10,11,29],"/production/materials":[5,6,9,28,23,10,11,29],"/production/godown":[5,6,18,28,23,10,11,29],"/production/final":[5,6,13,19,20,26,27,28,23,10,11,29],"/work/workPlan":[4,5,6,28,23,10,11,29],"/work/workInfo":[5,6,13,16,28,30,23,10,11,29]}},{publicPath:"/"});null==i||i.forEach((function(t){var e,n=t.type,a=t.url;if("js"===n)(e=r("script")).src=a,e.async=!0;else{if("css"!==n)return;(e=r("link")).href=a,e.rel="preload",e.as="style"}t.attrs.forEach((function(t){e.setAttribute(t[0],t[1]||"")})),c.appendChild(e)}))}}();

+ 0
- 304
frontend/dist/umi.17801edc.js
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 7
- 0
frontend/src/api/finalCraftSteps/dto.d.ts Просмотреть файл

@@ -73,4 +73,11 @@ declare namespace finalCraftStepsTypes {
*/
id: string
}
interface CopyFinalCraftStepsInput{
lineId:string;
finalId:string;
copyDeviceId:string;
productLineStepsId:string;
toDeviceId:string;
}
}

+ 5
- 0
frontend/src/api/workService.ts Просмотреть файл

@@ -116,6 +116,11 @@ export default {
return request(`/api/workinfo/statuslist/${workId}`, {
method: 'GET'
});
},
EditDetail(id:string){
return request(`/api/workinfo/editdetail/${id}`, {
method: 'GET'
});
}
}


+ 17
- 38
frontend/src/pages/final/index.tsx Просмотреть файл

@@ -215,6 +215,7 @@ const final = () => {
onClick={async () => {
setIsLineStepOpen(true)
setSelectRowItem(record);
setSelectLine(0);
// const b: any[] = []
// record.lineId!.map((item) => {
// b.push(lineList.find(x => x.key == item))
@@ -226,6 +227,7 @@ const final = () => {
console.log(res.data);

setFinalLineList(res.data)
UpdateGY(res.data[0].key,record?.id!)
}
})
const copyFormData = JSON.parse(JSON.stringify(record));
@@ -290,6 +292,13 @@ const final = () => {
const [formula, setformula] = useState([])


const UpdateGY = (lineId:string,finalId:string)=>{
productlineInfoStepsAPI.List({ lineId: lineId, finalId: finalId }).then((res: MyResponse.Content) => {
if (res.statusCode === 200) {
setLineProcessList(res.data);
}
})
}

// 定义配方列表
// eslint-disable-next-line react-hooks/rules-of-hooks
@@ -433,6 +442,7 @@ const final = () => {
</div>
<Card title='所属设备' size="small" bordered={false} style={{ height: '200px', overflowY: 'auto', overflowX: 'hidden' }} className={styles.gongyi_tag_device}>
{
item.devicesInfo.length>0?
<Space title='设备' direction="vertical">
{item.devicesInfo.map((devicesItem: any, devicesIndex: number) => (
<Badge.Ribbon text={devicesItem.status == '0' ? '未配置' : '已配置'} color={devicesItem.status == '0' ? '' : 'pink'}>
@@ -452,6 +462,7 @@ const final = () => {
</Badge.Ribbon>
))}
</Space>
: <Empty />
}
</Card>
{/* <Card title='备注' size="small" style={{ height: '150px' }}>
@@ -468,43 +479,7 @@ const final = () => {
</Card>
: <Empty />}
{/* <Card title={'设备列表'}>
<div className={styles.tag}>
{lineProcessDevList.map((item, index) => (
<div key={index} onClick={() => {
setcurrentproductionDev(item.deviceId)
// 当前选中的产线
const jsondata = {
lineId: currentproductionline.key,
deviceId: item.deviceId,
finalId: selectRowItem.id,
productLineStepsId: currentproductionProcess.id
}
setStepparams(jsondata)
console.log('11111', jsondata);
// setSelectLine(index);
setSelectDev(index)

// productlineInfoStepsAPI.Devicelist({ stepId: item.id }).then((res: MyResponse.Content) => {
// if (res.statusCode === 200) {
// setLineProcessDevList(res.data);
// }
// })
}} className={`${styles.tag_item} ${index === selectDev ? styles.tag_item_activeItem : ''}`}>
<Space size="middle">
<div >{item.deviceName}</div>
</Space>
<div className={index === selectDev ? styles.tag_item_active : ''}></div>
</div>
))}
</div>
</Card> */}





</Card>
}
<Modal maskClosable={false} open={isEditModalOpen}
@@ -512,7 +487,11 @@ const final = () => {


// title={<Tag color='#0960bd' bordered style={{fontSize:'18px',borderRadius:'0px'}}>{stepTitle}</Tag>}
onCancel={() => setIsEditModalOpen(false)}
onCancel={() =>{
setIsEditModalOpen(false)
UpdateGY(currentproductionline.key,selectRowItem.id)
}
}
onOk={() => setIsEditModalOpen(false)}
footer={false}
// footer={[


+ 12
- 3
frontend/src/pages/godown/index.tsx Просмотреть файл

@@ -8,7 +8,7 @@ import {
ProCard,
ProTable,
} from '@ant-design/pro-components';
import { Button, message, Modal, Popconfirm, Space } from 'antd';
import { Button, Form, message, Modal, Popconfirm, Select, Space } from 'antd';
import { useState, useRef } from 'react';
//引入接口
import godownApi from '@/api/godown/service'
@@ -17,7 +17,7 @@ export default () => {
const [fromType, setFromType] = useState<any>('table')
const ref = useRef<ProFormInstance>();
const actionRef = useRef<ActionType>();
const [isModalOpen,setIsModalOpen] = useState<boolean>(false)
const [isModalOpen, setIsModalOpen] = useState<boolean>(false)
const Reolod = () => {
ref.current?.resetFields()
actionRef.current?.reload()
@@ -192,7 +192,16 @@ export default () => {
提交
</Button>,
]}
></Modal>
>
<Form>
<Form.Item >
<Select>
</Select>
</Form.Item>
</Form>

</Modal>
</>
);
};

+ 143
- 68
frontend/src/pages/workInfo/index.tsx Просмотреть файл

@@ -4,12 +4,13 @@
* @returns
*/
import type { ActionType, ProColumns } from '@ant-design/pro-components';
import { FooterToolbar, ProForm, ProFormSelect, ProFormText, ProTable } from '@ant-design/pro-components';
import { Button, Modal, Form, Input, message, Popconfirm, Tag, DatePicker as TDatePicker, Select, Steps, StepsProps, Popover, ConfigProvider, List, Space, Radio, Card, Row, Col } from 'antd';
import { CheckCard, FooterToolbar, ProForm, ProFormSelect, ProFormText, ProTable } from '@ant-design/pro-components';
import { Button, Modal, Form, Input, message, Popconfirm, Tag, DatePicker as TDatePicker, Select, Steps, StepsProps, Popover, ConfigProvider, List, Space, Radio, Card, Row, Col, Flex, Empty, Badge, Divider } from 'antd';
import { useEffect, useRef, useState } from 'react';
import WorkInfoAPI from '@/api/workService';
import FinalAPI from '@/api/finalService';
import ProductLineAPI from '@/api/productlineService';
import productlineInfoStepsAPI from '@/api/productlinesteps/service'
import styles from "./index.less";
import dayjs from 'dayjs'
import workService from '@/api/workService';
@@ -18,6 +19,7 @@ import workplanApi from '@/api/work/plan/service'




const DatePicker: any = TDatePicker;
const Stepitems = [
{
@@ -76,7 +78,8 @@ export default () => {
const [lineData, setLineData] = useState<MySelectType.Select[]>([])
const [workStatusList, setWorkStatusList] = useState([])


//获取产线工艺流程
const [lineProcessList, setLineProcessList] = useState<any[]>([])
const [selectfinal, setSelectFinal] = useState<any>();

const [lineDeviceData, setLineDeviceData] = useState<any[]>([])
@@ -96,12 +99,12 @@ export default () => {
const batchActionRef = useRef<ActionType>();
const [itemData, setItemData] = useState<WorkInfoTypes.WorkInfoOutput[]>([]);
const [itemLoading, SetItemLoading] = useState<boolean>(false)
const finalIdFlag = Form.useWatch('finalId', typeForm);
const columns: ProColumns<WorkInfoTypes.WorkInfoOutput>[] = [
{
title: '工单编码',
dataIndex: 'id',
hideInSearch: true,
width: 140,
align: 'center',
},
{
@@ -110,7 +113,6 @@ export default () => {
ellipsis: true,
hideInSearch: true,
align: 'center',
width: 100
},
{
title: '炒锅名称',
@@ -118,7 +120,6 @@ export default () => {
ellipsis: true,
hideInSearch: true,
align: 'center',
width: 100,
renderText(text, record, index, action) {
return <>{record.deviceName ? record.deviceName : "自动分配"}</>
},
@@ -131,12 +132,11 @@ export default () => {
ellipsis: true,
},
{
title: '产量',
title: '下料(锅)',
dataIndex: 'number',
ellipsis: true,
hideInSearch: true,
align: 'center',
width: 100
},
{
dataIndex: 'batchId',
@@ -179,12 +179,12 @@ export default () => {
dataIndex: 'createTime',
ellipsis: true,
hideInSearch: true,
width: 140
},
{
title: '操作',
valueType: 'option',
key: 'option',
fixed: 'right',
render: (_, record) => {
switch (record.status) {
case 0:
@@ -192,25 +192,37 @@ export default () => {
return [
<Button
key="edit"
type="primary" ghost
type="primary" size='small'
onClick={async () => {
setIsModalOpen(true);
console.log(record);
typeForm.resetFields()
setModelTitle('编辑信息');
const copyFormData = JSON.parse(JSON.stringify(record));
// copyFormData.repairDate =dayjs(record.repairDate)
console.log('record', record);
var jsonData: ProductlineTypes.ProductionlineQuery = {
lineId: record.lineId
}
ProductLineAPI.devicelist(jsonData).then((res: MyResponse.Content) => {
FinalAPI.LineList(record.finalId).then((res: MyResponse.Content) => {
if (res.statusCode === 200) {
setLineData(res.data)
}
})
workService.EditDetail(record.id).then((res: MyResponse.Content) => {
if (res.statusCode === 200) {
setLineDeviceData(res.data)
setIsModalOpen(true);
UpdateGY(res.data.lineId, record.finalId);
setTimeout(() => {
res.data.number = record.number
res.data.finaId = record.finalId
res.data.id = record.id
res.data.workDevices.map((item: any) => {
res.data["pro:" + item.processId] = item.deviceId
})
console.log(res.data);
typeForm.setFieldsValue(res.data);
}, 500);
}
})
typeForm.setFieldsValue(copyFormData);
}}
>
编辑
编辑工单
</Button>,
<Popconfirm
key="workdel"
@@ -233,7 +245,7 @@ export default () => {
okText="确认"
cancelText="关闭"
>
<Button type="primary" danger ghost>删除</Button>
<Button type="primary" danger size='small'>删除</Button>
</Popconfirm>
,
<Popconfirm
@@ -259,7 +271,7 @@ export default () => {
okText="确认"
cancelText="关闭"
>
<Button type="primary" ghost>下发</Button>
<Button type="primary" size='small'>下发</Button>
</Popconfirm>]
case 1:
return [
@@ -587,7 +599,6 @@ export default () => {
}
}
]

//初始化
useEffect(() => {
FinalAPI.SelectList().then((res: MyResponse.Content) => {
@@ -606,8 +617,13 @@ export default () => {
}
})
}, [])


const UpdateGY = (lineId: string, finalId: string) => {
productlineInfoStepsAPI.List({ lineId: lineId, finalId: finalId }).then((res: MyResponse.Content) => {
if (res.statusCode === 200) {
setLineProcessList(res.data);
}
})
}
// const GetItemData=async (jsonData:any)=>{
// setItemData([])
// SetItemLoading(true)
@@ -653,8 +669,23 @@ export default () => {
*表单提交
*/
const OnSubmit = async (values: any) => {
console.log(values);
values.batchId = selectBatchItemRow?.id

const WorkDeviceAddInputs: any[] = []

Object.keys(values).forEach((item: string) => {
if (item.includes('pro')) {
console.log(item);
const WorkDeviceAddInput: any = {
processId: item.split(':')[1],
deviceId: values[item]
}
WorkDeviceAddInputs.push(WorkDeviceAddInput)
}
})
values.workDevices = WorkDeviceAddInputs;
console.log(values);
if (values.id) {
const response = await WorkInfoAPI.Update(values);
if (response.statusCode === 200) {
@@ -678,7 +709,7 @@ export default () => {
}
};
const [expandedRowKeys, setExpandedRowKeys] = useState<any>([]);
const expandedRowRender = (data: OrderType.Info) => {
const expandedRowRender = (data: WorkInfoTypes.Info) => {
console.log('data', data.workList);
var res = data.workList;
// setitemparams({batchId:data.id})
@@ -781,7 +812,7 @@ export default () => {

columns={batchColumns}
actionRef={batchActionRef}
request={async (params = {}) => {
const jsonData: WorkInfoTypes.Page = {
pageIndex: params.current || 1,
@@ -833,7 +864,7 @@ export default () => {
/>
<Modal
maskClosable={false}
width={800}
width={1200}
title={<Tag color="#cd201f">{modelTitle}</Tag>}
open={isModalOpen}
onCancel={() => {
@@ -863,51 +894,61 @@ export default () => {
onFinish={OnSubmit}
autoComplete="off"
>
<ProFormText
width="md" label="id" name="id" hidden>
</ProFormText>
<ProFormText
width="md" label="id" name="id" hidden>
</ProFormText>
<ProFormSelect
colProps={{ xl: 8, md: 12 }}
label="生产计划"
name="finalId"
name="planId"
options={finalPlan}
fieldProps={{
fieldNames:{
label:"name",
value:"id"
fieldNames: {
label: "name",
value: "id"
}
}}
rules={[{ required: true, message: '此项为必填项!' }]}
onChange={(v)=>{
const finalId = finalPlan.find(x => x.id == v)?.finalId;
const name = finalData.find(x => x.key == finalId)?.value;
const quantity =finalPlan.find(x => x.id == v)?.quantity;
setSelectFinal({ name: name, finalId: finalId,quantity:quantity })
FinalAPI.LineList(finalId).then((res:MyResponse.Content)=>{
onChange={(v: string) => {
// const finalId = finalPlan.find(x => x.id == v)?.finalId;
// const name = finalData.find(x => x.key == finalId)?.value;
// const quantity = finalPlan.find(x => x.id == v)?.quantity;
typeForm.setFieldValue('lineId', '')
workplanApi.Detail(v).then((res: MyResponse.Content) => {
if (res.statusCode === 200) {
setLineData(res.data)
setSelectFinal({ name: res.data.Name, finalId: res.data.finalId, quantity: res.data.quantity })
setLineProcessList([])
FinalAPI.LineList(res.data.finalId).then((res: MyResponse.Content) => {
if (res.statusCode === 200) {
setLineData(res.data)
}
})
}
})

}}
>
</ProFormSelect>
<Row gutter={18}>
<Row gutter={18}>
<Col xl={6} md={12} sm={24}>
<ProFormText
width="md" label="成品" >
<Input readOnly disabled value={selectfinal?.name}></Input>
</ProFormText>
</Col>
<Col xl={6} md={12} sm={24}>
<Form.Item label="数量" >
<Input readOnly disabled value={selectfinal?.quantity}></Input>
</Form.Item>
</Col>
</Row>
<Form.Item name='finalName'
label="成品" >
<Input readOnly disabled value={selectfinal?.name}></Input>
</Form.Item>
</Col>
<Col xl={6} md={12} sm={24}>
<Form.Item label="数量" name='quantity' >
<Input readOnly disabled value={selectfinal?.quantity}></Input>
</Form.Item>
</Col>
</Row>
<Form.Item label="产线" name="lineId" rules={[{ required: true, message: '此项为必填项!' }]}>
<Select onChange={(e) => {
console.log('selectfinal', selectfinal);

UpdateGY(e, selectfinal?.finalId)
typeForm.setFieldValue("deviceId", "")
var jsonData: ProductlineTypes.ProductionlineQuery = {
lineId: e
@@ -925,16 +966,50 @@ export default () => {
})}
</Select>
</Form.Item>
{/* <Form.Item name="deviceId" label="选择设备" rules={[{ required: true, message: '此项为必选项!' }]}>
<Select placeholder="请选择设备" >
{lineDeviceData.map((item, index) => (
// <Radio key={index} value={item.deviceId}>{item.deviceName}</Radio>
<Select.Option value={item.deviceId} key={index}>
<span>{item.deviceName}</span>
</Select.Option>
))}
</Select>
</Form.Item> */}

<Card title={'产线工序路线'}>
<div className={styles.gongyi_tag}>
<Flex wrap gap="small">
{lineProcessList.map((item, index) => (
<div className={styles.gongyi_tag_box} key={index} >
<div

className={styles.gongyi_tag_item}>
<Space size="middle">
<div color="#2db7f5" style={{ fontSize: '22px' }}> {index + 1}-{item.processName}</div>
</Space>
</div>
<Card title='选择设备' size="small" bordered={false} style={{ height: '200px', overflowY: 'auto', overflowX: 'hidden' }} className={styles.gongyi_tag_device}>

<Form.Item name={'pro:' + item.id} >
<CheckCard.Group >
{
item.devicesInfo.length > 0 ?
<Space title='设备' direction="vertical">
{item.devicesInfo.map((devicesItem: any, devicesIndex: number) => (
<CheckCard onClick={(v) => {
}} size='small' title={devicesItem.name} value={devicesItem.id} />
))}
</Space>
: <Empty />
}
</CheckCard.Group>
</Form.Item>

</Card>
{/* <Card title='备注' size="small" style={{ height: '150px' }}>
<Input aria-label='备注' />
</Card> */}

<Divider />
</div>

))}
</Flex>
</div>

</Card>

<Form.Item label="下料(锅)" name="number" rules={[{ required: true, message: '此项为必填项!' }]} >
<Input type='number' min={1} />
</Form.Item>


+ 1
- 0
frontend/src/types/OrderType.ts Просмотреть файл

@@ -2,6 +2,7 @@
declare namespace OrderType {
// 订单信息
interface Info {
workList: any
id: string,
status?: number,
AllocationRate?: number,


+ 1
- 0
frontend/src/types/WorkInfo.d.ts Просмотреть файл

@@ -6,6 +6,7 @@
declare namespace WorkInfoTypes {

interface Info{
workList: any;
id: any;
name: string,
lineId: string,


Загрузка…
Отмена
Сохранить