Browse Source

商品工艺

dev
zhaoy 9 months ago
parent
commit
048d9f4e17
17 changed files with 1635 additions and 90 deletions
  1. +15
    -7
      config/routes.js
  2. +17
    -8
      src/app.jsx
  3. +29
    -3
      src/pages/device/deviceInfo/components/CreateForm.jsx
  4. +2
    -1
      src/pages/device/deviceInfo/index.jsx
  5. +5
    -0
      src/pages/device/deviceInfo/services.js
  6. +58
    -0
      src/pages/device/deviceVesion/components/CreateForm.jsx
  7. +233
    -0
      src/pages/device/deviceVesion/index.jsx
  8. +40
    -0
      src/pages/device/deviceVesion/services.js
  9. +239
    -0
      src/pages/device/devicetechnology/components/ActionForm.jsx
  10. +245
    -0
      src/pages/device/devicetechnology/components/CreateAction.jsx
  11. +57
    -0
      src/pages/device/devicetechnology/components/CreateForm.jsx
  12. +292
    -0
      src/pages/device/devicetechnology/index.jsx
  13. +50
    -0
      src/pages/device/devicetechnology/services.js
  14. +255
    -39
      src/pages/goods/goodsInfo/components/EditCarTable.jsx
  15. +86
    -30
      src/pages/goods/goodsInfo/components/goodstechnologymaken.jsx
  16. +2
    -2
      src/pages/goods/goodsInfo/index.jsx
  17. +10
    -0
      src/pages/goods/goodsInfo/service.js

+ 15
- 7
config/routes.js View File

@@ -388,13 +388,7 @@ export default [
access: 'k9',
},

{
name: '商品工艺基础信息',
icon: 'smile',
path: '/goods/goodstechnology',
component: './goods/goodstechnology',
access: 'k9',
},
],
},

@@ -495,6 +489,20 @@ export default [
component: './device/deviceInfo',
access: 'k14',
},
{
name: '设备版本管理',
icon: 'smile',
path: '/device/deviceVesion',
component: './device/deviceVesion',
access: 'k14',
},
{
name: '设备工艺信息',
icon: 'smile',
path: '/device/devicetechnology',
component: './device/devicetechnology',
access: 'k9',
},
// {
// name: '设备商品管理',
// icon: 'smile',


+ 17
- 8
src/app.jsx View File

@@ -74,6 +74,22 @@ export async function getInitialState() {
component: './device/deviceInfo',
access: 'k14',
},
{
code: 'deviceVesion',
name: '设备版本管理',
icon: 'smile',
path: '/device/deviceVesion',
component: './device/deviceVesion',
access: 'k14',
},
{
code: 'devicetechnology',
name: '设备工艺信息',
icon: 'smile',
path: '/device/devicetechnology',
component: './device/devicetechnology',
access: 'k7',
},
// {
// code: 'deviceFood',
// name: '设备商品管理',
@@ -479,14 +495,7 @@ export async function getInitialState() {
component: './goods/goodsPracticeInfo',
access: 'k9',
},
{
code: 'goodstechnology',
name: '商品工艺基础信息',
icon: 'smile',
path: '/goods/goodstechnology',
component: './goods/goodstechnology',
access: 'k7',
},
],
},
{


+ 29
- 3
src/pages/device/deviceInfo/components/CreateForm.jsx View File

@@ -1,8 +1,24 @@
import React, { useState, useEffect } from 'react';
import { Modal, Form, Input, Button, Select, TreeSelect,InputNumber } from 'antd';

import {
GetDeviceVesion
} from '../services';
const CreateForm = (props) => {
const { Option, OptGroup } = Select;
const [DeviceVesionData, setDeviceVesionData] = useState([]);
useEffect(() => {
console.log(props.values)
if(Object.keys(props.values).length>0){
GetDeviceVesion(props.values.deviceTypeKey).then((res)=>{
setDeviceVesionData(res.data)
})
}
},[props.values])
const handleChange=(value)=>{
GetDeviceVesion(value).then((res)=>{
setDeviceVesionData(res.data)
})
}
return (
<Modal
title={props.values.id ? '编辑' : '新建'}
@@ -31,7 +47,7 @@ const CreateForm = (props) => {
</Form.Item>

<Form.Item label={'设备类型'} name="deviceTypeKey" rules={[{ required: true }]}>
<Select>
<Select onChange={handleChange}>
{props.dicData.map((item, index) => {
return (
<Select.Option index={index} value={item.code} key={item.code}>
@@ -41,7 +57,17 @@ const CreateForm = (props) => {
})}
</Select>
</Form.Item>

<Form.Item label={'设备版本'} name="deviceVersionKey" rules={[{ required: true }]}>
<Select>
{DeviceVesionData.map((item, index) => {
return (
<Select.Option index={index} value={item.id} key={item.id}>
{item.vesion}
</Select.Option>
);
})}
</Select>
</Form.Item>
<Form.Item name="orgId" label="归属门店" rules={[{ required: true }]}>
<TreeSelect
style={{ width: '100%' }}


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

@@ -17,6 +17,7 @@ import {
import { gettree } from '../../sys/org/service';
import DeviceFood from './components/DeviceFood';
import StockMaterial from './components/StockMaterial';
import { values } from 'lodash';
const key = 'message';

//添加
@@ -89,7 +90,7 @@ const GoodsTypeManage = () => {
const [OrgListArray, setOrgListArray] = useState([]);
const [dicDataAny, setDicDataAny] = useState([]);
const [dicData, setDicData] = useState([]);
const [DeviceVesionData, setDeviceVesionData] = useState([]);
const [deviceVersion, setDeviceVersion] = useState([]);
// 是否显示 设备商品弹窗
const [deviceFoodModal, setDeviceFoodModal] = useState();


+ 5
- 0
src/pages/device/deviceInfo/services.js View File

@@ -195,3 +195,8 @@ export async function CheckStockAdjust(data) {
method: 'POST',
});
}
export async function GetDeviceVesion(TypeCode) {
return request(`/kitchen/api/DeviceVesion/GetDeviceVesion?Code=${TypeCode}`, {
method: 'Get',
});
}

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

@@ -0,0 +1,58 @@
import React from 'react';
import { Modal, Form, Input, Button, Select } from 'antd';

const CreateForm = (props) => {
const { Option, OptGroup } = Select;
return (
<Modal
title={props.values.id ? '编辑' : '新建'}
width={640}
visible={props.createModalVisible}
bodyStyle={{ padding: '32px 40px 48px' }}
footer={null}
onCancel={() => {
props.onCancel();
}}
destroyOnClose
>
<Form
layout="vertical"
preserve={false}
initialValues={props.values}
onFinish={props.onFinish} >
<Form.Item name="id" hidden={true}>
<Input />
</Form.Item>
<Form.Item label={"版本号"} name="vesion" rules={[{ required: true,max:50}]} >
<Input />
</Form.Item>
<Form.Item label={"设备类型"} name="deviceTypeKey" rules={[{ required: true,max:50}]} >
<Select>
{props.dicData.map((item, index) => {
return (
<Select.Option index={index} value={item.code} key={item.code}>
{item.value}
</Select.Option>
);
})}
</Select>
</Form.Item>
<Form.Item label={'状态'} name="status" rules={[{ required: true }]}>
<Select placeholder="请选择状态">
<OptGroup>
<Select.Option value={0}>正常</Select.Option>
<Select.Option value={1}>停用</Select.Option>
</OptGroup>
</Select>
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">
保存
</Button>
</Form.Item>
</Form>
</Modal>
);
};

export default CreateForm;

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

@@ -0,0 +1,233 @@

import { Modal,Button, message, } 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 CreateForm from './components/CreateForm';
import { GetDeviceVesionPage, AddDeviceVesion, DelDeviceVesion, UpdateDeviceVesion, GetDicList} from "./services"

const key = 'message';

//添加
const handleAdd = async (fields) => {
try {
message.loading('正在添加', key);
await AddDeviceVesion(JSON.stringify(fields)).then((r) => {
message.destroy(key);
if (r.data) {
message.success('添加成功');
return true;
} else {
message.error('添加失败');
return false;
}
});
} catch (error) {
message.error('添加失败请重试!');
return false;
}
};


//修改
const handleUpdate = async (fields) => {
try {
message.loading('正在修改', key);
message.destroy(key);
await UpdateDeviceVesion(JSON.stringify(fields)).then((r) => {
message.destroy(key);
if (r.data) {
message.success('修改成功',);
return true;
} else {
message.success('修改失败');
return false;
}
});
} catch (error) {
message.error('修改失败请重试!');
return false;
}
};


//删除
const handleRemove = async (selectedRows) => {
try {
message.loading('正在删除');
let ids = [];
selectedRows.forEach((item) => {
ids.push(item.id);
});
await DelDeviceVesion(ids).then((r) => {
if (r.data) {
message.success('删除成功');
return true;
} else {
message.error(r.errors);
return false;
}
});
} catch (error) {
message.error('删除失败请重试!');
return false;
}
};

const GoodsTypeManage = () => {
const [createModalVisible, handleModalVisible] = useState(false);
const actionRef = useRef();
const [DictData, setDictData] = useState([]);
const [currentRow, setCurrentRow] = useState();
const [selectedRowsState, setSelectedRows] = useState([]);
const columns = [
{
title: '主键',
dataIndex: 'id',
hideInSearch: true,
hideInTable: true,
tip: '规则名称是唯一的 key'
},
{
title: '版本号',
dataIndex: 'vesion',
valueType: 'textarea',
},
{
title: '设备类型',
dataIndex: 'deviceTypeKey',
valueType: 'textarea',
},
{
title: '操作',
dataIndex: 'option',
valueType: 'option',
render: (_, record) => [
<a
key="config"
onClick={() => {
handleModalVisible(true);
setCurrentRow(record);
}} > 更新</a>,
<a
key="config"
onClick={() => {
handleModalVisible(true);
setCurrentRow(record);
}} > 下载工艺模板</a>
],
},
];
useEffect(() => {
GetDicList('DeviceClientType').then((r) => {
var arr = r.data;
let data = {};
if (r.succeeded) {
var list = [];
arr.forEach((item) => {
data[item.code] = { text: item.code };
list.push({
code: item.code,
value: item.code,
});
});
//setDicDataAny(data);
setDictData(list);
}
});
}, [])
return (
<PageContainer>
<ProTable
headerTitle="设备版本"
actionRef={actionRef}
rowKey="id"
search={{
labelWidth: 120,
}}
toolBarRender={() => [
<Button
type="primary"
key="primary"
onClick={() => {
handleModalVisible(true);
}} >
<PlusOutlined /> 新建
</Button>,
]}
request={async (params) => {
var data = [];
var total = 0;
await GetDeviceVesionPage(params).then((r) => {
data = r.data.data;
total = r.data.total;
});
return {
data: data,
success: true,
total: total,
};
}}
columns={columns}
rowSelection={{
onChange: (_, selectedRows) => {
setSelectedRows(selectedRows);
},
}}
/>
{selectedRowsState?.length > 0 && (
<FooterToolbar
extra={
<div>
已选择{' '}
<a
style={{
fontWeight: 600,
}}
>
{selectedRowsState.length}
</a>{' '}
项 &nbsp;&nbsp;
</div>
}
>
<Button
onClick={async () => {
await handleRemove(selectedRowsState);
setSelectedRows([]);
actionRef.current?.reloadAndRest?.();
}}
>
删除
</Button>
</FooterToolbar>
)}

<CreateForm
onFinish={async (value) => {
var success = false;
if (value.id) {
success = handleUpdate(value);
} else {
success = handleAdd(value);
}
if (success) {
handleModalVisible(false);
setCurrentRow(undefined);
}
actionRef.current.reload();
}}
onCancel={() => {
handleModalVisible(false);
setCurrentRow(undefined);
}}
createModalVisible={createModalVisible}
values={currentRow || {}}
dicData={DictData}
/>
</PageContainer>
);
};

export default GoodsTypeManage;

+ 40
- 0
src/pages/device/deviceVesion/services.js View File

@@ -0,0 +1,40 @@
import { request } from 'umi';

/** 设备类型列表 */
export async function GetDeviceVesionPage(data) {
return request(`/kitchen/api/DeviceVesion/GetDeviceVesionPage`, {
method: 'POST',
data: data,
});
}
/** 添加设备类型 */
export async function AddDeviceVesion(data) {
return request(`/kitchen/api/DeviceVesion/AddDeviceVesion`, {
method: 'POST',
data: data,
// params: { ...params },
// ...(options || {}),
});
}

/** 删除设备类型 */
export async function DelDeviceVesion(data) {
return request(`​/kitchen/api/DeviceVesion/DelDeviceVesion`, {
method: 'POST',
data: data,
});
}

/** 修改设备类型 */
export async function UpdateDeviceVesion(data) {
return request(`​/kitchen/api/DeviceVesion/UpdateDeviceVesion`, {
method: 'POST',
data: data,
});
}
/**获取设备类型 */
export async function GetDicList(TypeCode) {
return request(`/kitchen/api/dict-data/dic-list/${TypeCode}`, {
method: 'Get',
});
}

+ 239
- 0
src/pages/device/devicetechnology/components/ActionForm.jsx View File

@@ -0,0 +1,239 @@
import ProTable from '@ant-design/pro-table';
import { Modal,Space, Form,Button,Select,message,Popconfirm} from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import React, { useState,useRef } from 'react';
import CreateAction from './CreateAction';
import {
gettechnologyactionList,
addtechnologyaction,
updatetechnologyaction,
deletetechnologyaction
} from '../services';
const { Option, OptGroup } = Select;

const ActionForm = (props) => {
const [currentRow , setcurrentRow ] = useState([]);;
const [dataSource, setDataSource] = useState([]);
const actionRef = useRef();
const [form] = Form.useForm();
const [actionValueName,setactionValueName]=useState();
const [createModalVisible, handleModalVisible] = useState(false);
const options = {
text:{value:'text',text: `文本框`},
select:{ value: `select`, text: `下拉框`},
// money:{ value: `money`, text: `金额输入`},
textarea:{ value: `textarea`, text: `文本域`},
// date:{ value: `date`, text: `日期`},
// dateTime:{ value: `dateTime`, text: `日期时间`},
// radio:{ value: `radio`, text: `单选框`},
// radioButton:{ value: `radioButton`, text: `按钮单选框`},
digit:{ value: `digit`, text: `数字输入框`},
switch:{ value: `switch`, text: `开关`},
}
const columns= [
{
title: '模型名称',
dataIndex: 'actionName',
width: '15%',
},
{
title: '输入类型',
key: 'actionType',
dataIndex: 'actionType',
valueType: 'select',
width: '15%',
valueEnum:options,
},
// {
// title: '类型值',
// dataIndex: 'actionValue',
// width: '15%',
// valueType:'select',
// valueEnum: {
// text:{
// text: '文本框',
// status: 'text',
// },
// select:{
// text: '下拉框',
// status: 'select',
// }
// }
// },
// {
// title: '单位',
// dataIndex: 'unit',
// width: '8%',
// },
// {
// title: '是否绑定物料',
// dataIndex: 'isBatch',
// width: '15%',
// valueEnum: {
// true:{
// text: '是',
// status: 'Success',
// },
// false:{
// text: '否',
// status: 'Processing',
// }
// }
// },
{
title: '排序',
dataIndex: 'sort',
valueType:'digit',
width: '8%',
},
{
title: '操作',
valueType: 'option',
width: 200,
render: (text, record, _, action) => [
<a
key="editable"
onClick={() => {
handleModalVisible(true);
setcurrentRow(record);
}}
>
编辑
</a>,
<Popconfirm
type="primary"
key="primary"
title="确认删除吗?"
okText="是"
cancelText="否"
onConfirm={() => {
handleRemove([record.id]);
actionRef.current?.reloadAndRest();
}}
onCancel={() => { }}
>
<a href="#">删除</a>
</Popconfirm>,,
],
},
]
const onFinish= async (fields) => {
console.log(fields)
await addtechnologyaction(JSON.stringify(fields)).then((r) => {
if (r.data) {
message.success('添加成功');
} else {
message.error(r.errors);
}
});
return true;
}
const handleUpdate=async (fields) => {
await updatetechnologyaction(JSON.stringify(fields)).then((r) => {
if (r.data) {
message.success('修改成功');
} else {
message.error(r.errors);
}
});
return true;
}
const handleRemove = async (ids) => {

try {
deletetechnologyaction(ids).then((r) => {
if (r.data) {
message.success('删除成功');
actionRef.current.reload();
} else {
message.error(r.errors);
}
});
return true;
} catch (error) {
message.error('删除失败,请重试');
}
}
return (
<>
<Modal
title={'模型配置'}
width={1140}
visible={props?.actionFormModalVisible}
bodyStyle={{ padding: '32px 40px 1px 48px' }}
footer={null}
onCancel={() => {
props?.onCancel();
}}
destroyOnClose
maskClosable={false}
>
<ProTable rowKey="id"
headerTitle="模型配置列表"
actionRef={actionRef}
pagination={false}
search={false}
toolBarRender={() => [
<Button
type="primary"
key="primary"
onClick={() => {
handleModalVisible(true);
setcurrentRow({});
}}
>
<PlusOutlined /> 新建
</Button>,
]}
columns={columns}
request={async () => {
var data = [];
console.log(props.values.id)
await gettechnologyactionList(props.values.id).then((r) => {
data = r.data;
});
return {
data: data,
success: true,
};
}}
>
</ProTable>
<CreateAction
onFinish={async (value) => {
var success = false;
console.log(value)
console.log(value.actionValue)
value.goodstechnologyId=props.values.id;
if (value.id) {
success = await handleUpdate(value);
} else {
success = await onFinish(value);
}
if (success) {
handleModalVisible(false);
if (actionRef.current) {
actionRef.current.reload();
}
}
}}
onCancel={() => {
setcurrentRow(undefined);
handleModalVisible(false);
}}
createModalVisible={createModalVisible}
actionValueName={actionValueName}
values={currentRow || {}}
/>
</Modal>
</>
);
};
export default ActionForm;

+ 245
- 0
src/pages/device/devicetechnology/components/CreateAction.jsx View File

@@ -0,0 +1,245 @@
import { Modal,Input, Form,Button,Select,message,Switch,Divider,Space,progress,percent} from 'antd';
import { BetaSchemaForm, ProFormSelect,ProFormDependency } from '@ant-design/pro-form';
import React, { useState,useEffect } from 'react';
import { PlusOutlined } from '@ant-design/icons';
const CreateAction = (props) => {
const [form] = Form.useForm();
const formRef = React.useRef(null);
const [valueType, setValueType] = useState('text');
const [layoutType, setLayoutType] = useState('Form');
const [optionitem,setoptionitem]=useState([])
const [modalVisit, setModalVisit] = useState(false);
const [shuUpdate, setshuUpdate] = useState(false);
useEffect(() => {
formRef.current?.setFieldsValue(props.values);
if(props.createModalVisible){
if(props.values.actionType==null){
formRef.current?.setFieldsValue({
actionType: 'text',
});
props.values.actionType="text";
setValueType("text");
setLayoutType('Form');
setoptionitem([]);
}else{
formRef.current?.setFieldsValue({
actionType: props.values.actionType,
});
setValueType(props.values.actionType)
if(props.values.actionType=="select"){
setLayoutType('ModalForm');
let ary=[];
let op=JSON.parse(props.values.actionValue)
for (let t = 0; t < op.length; t++) {
ary.push({actionValueName:op[t].actionValueName})
}
setoptionitem(ary);
}else{
setValueType(props.values.actionType);
setLayoutType('Form');
setoptionitem([]);
}
}
}
}, [props.createModalVisible]);
const handleChange=(value)=>{
console.log(JSON.stringify(value))
if(value){
formRef.current?.setFieldsValue({
actionValue:JSON.stringify(value)
})
}
setModalVisit(false);
message.success("保存成功")
}
const options = [
{value:'text',label: `文本框`},
{ value: `select`, label: `下拉框`},
// { value: `money`, label: `金额输入`},
{ value: `textarea`, label: `文本域`},
// { value: `date`, label: `日期`},
// { value: `dateTime`, label: `日期时间`},
// { value: `radio`, label: `单选框`},
// { value: `radioButton`, label: `按钮单选框`},
{ value: `digit`, label: `数字输入框`},
{ value: `switch`, label: `开关`},
]
const columns=[
{
dataIndex: 'actionValue',
valueType:'dependency',
name: ['valueType'],
columns: ({ actionType }) => {
console.log(valueType)
switch(valueType)
{
case 'select':
return [
{
dataIndex: 'list',
valueType: 'formList',
initialValue:optionitem,
columns: [
{
valueType: 'group',
columns: [
{
title: '选项名称',
dataIndex: 'actionValueName',
width: 'md',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
}
]
}
],
},
{
renderFormItem: (schema,config,form) => {
return [
<div style={{float:'right'}}>
<Button
type="primary"
style={{'margin-left':'5px'}}
onClick={() => {
handleChange(form?.formRef?.current?.getFieldValue("list"));
return true;
}}>
保存
</Button>
</div>
];
},
}
];
case 'text':
return [
{
dataIndex: 'actionValue',
valueType: 'text',
renderFormItem: () => <Input placeholder="输入类型值" disabled />
},
];
default:
return [{
dataIndex: 'actionValue',
valueType: valueType,
fieldProps:{
disabled:true
}
}];
}
}
},
]
// const handleChange=(value)=>{

// }
// const onNameChange = (event) => {
// settypename(event.target.value);
// };
// const addItem = async (e) => {
// e.preventDefault();
// setItems([...items, {label:typename,value:index++} || `New item ${index++}`]);
// settypename('');
// setTimeout(() => {
// inputRef.current?.focus();
// }, 0);
// console.log(items)
// }
return (
<>
<Modal
title={'动作配置'}
width={640}
ref={formRef}
visible={props?.createModalVisible}
bodyStyle={{ padding: '32px 40px 1px 48px' }}
footer={null}
onCancel={() => {
props?.onCancel();
}}
destroyOnClose
maskClosable={false}
>
<Form
layout="vertical"
preserve={false}
// form={form}
initialValues={props?.values}
onFinish={props?.onFinish}
ref={formRef}
>
<Form.Item name="id" hidden={true}>
<Input />
</Form.Item>
<Form.Item>
<Form.Item name="actionName" label="模型名称" rules={[{ required: true, max: 64, whitespace: true }]}>
<Input placeholder="请输入模型名称" />
</Form.Item>
<Form.Item name="actionType" label="输入类型" rules={[{ required: true, max: 64, whitespace: true }]}>
<ProFormSelect options={options} fieldProps={{
value: valueType,
onChange: (e) => {
if(e=='select'){
setLayoutType('ModalForm');
}else{
setLayoutType('Form')
}
setValueType(e);
},
}}/>
</Form.Item>
<Form.Item name="actionValue" label="输入类型控件">
<BetaSchemaForm
trigger={<a onClick={()=>setModalVisit(true)}>添加选项</a>}
columns={columns}
layoutType={layoutType}
visible={modalVisit}
modalProps={{
forceRender: true,//切换显示模式后强制渲染其他模式表单
onCancel:()=>setModalVisit(false)
}}
onVisibleChange={(vis)=>{
setshuUpdate(vis)
}}
width={420}
shouldUpdate={shuUpdate}
submitter={false}
style={{padding:'40px 10px 1px 10px;' }}
/>
</Form.Item>
{/* <Form.Item name="unit" label="单位">
<Input placeholder="请输入单位" />
</Form.Item>
<Form.Item name="isBatch" label="是否绑定物料" valuePropName="checked">
<Switch checkedChildren="是" unCheckedChildren="否"/>
</Form.Item> */}
<Form.Item name="sort" label="排序">
<Input placeholder="请输入排序" />
</Form.Item>
<Button htmlType="button" style={{float:'right',left:10}} onClick={props.onCancel} >
取消
</Button>
<Button type="primary" htmlType="submit" style={{float:'right'}} >
保存
</Button>
</Form.Item>
</Form>
</Modal>
</>
)
}
export default CreateAction;

+ 57
- 0
src/pages/device/devicetechnology/components/CreateForm.jsx View File

@@ -0,0 +1,57 @@
import React, { useState } from 'react';
import { Modal, Form, Input, Button, Select } from 'antd';
const CreateForm = (props) => {
const { Option, OptGroup } = Select;
return (
<Modal
title={props?.values?.id ? '编辑' : '新建'}
width={640}
visible={props?.createModalVisible}
bodyStyle={{ padding: '32px 40px 48px' }}
footer={null}
onCancel={() => {
props?.onCancel();
}}
destroyOnClose
maskClosable={false}
>
<Form
layout="vertical"
preserve={false}
initialValues={props?.values}
onFinish={props?.onFinish}
>
<Form.Item name="id" hidden={true}>
<Input />
</Form.Item>
<Form.Item name="name" label="工艺名称" rules={[{ required: true, max: 64, whitespace: true }]}>
<Input placeholder="请输入工艺名称" />
</Form.Item>
<Form.Item name="foreignKeyRe" label="关联外键" rules={[{ required: false }]}>
<Input placeholder="请输入关联外键" />
</Form.Item>
<Form.Item
name="status"
label="状态"
defaultValue={props?.values?.status}
rules={[{ required: true, message: '请选择状态' }]}
>
<Select placeholder="请选择状态">
<Option value="0">正常</Option>
<Option value="1">停用</Option>
</Select>
</Form.Item>
<Form.Item>
<Button htmlType="button" style={{float:'right',left:10}} onClick={props.onCancel} >
取消
</Button>
<Button type="primary" htmlType="submit" style={{float:'right'}} >
保存
</Button>
</Form.Item>
</Form>
</Modal>
);
};

export default CreateForm;

+ 292
- 0
src/pages/device/devicetechnology/index.jsx View File

@@ -0,0 +1,292 @@
import { DropboxOutlined, PlusOutlined } from '@ant-design/icons';
import { Button, message, Input, Drawer, 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';
import ProDescriptions from '@ant-design/pro-descriptions';
import CreateForm from './components/CreateForm';
import ActionForm from './components/ActionForm';
import {
getGoodstechnologypage,
addgoodstechnology,
updategoodstechnology,
deletegoodstechnology,
} from './services';

//页面 相当于 class
/**
* 添加节点
*
* @param fields
*/
const handleAdd = async (fields) => {
try {
await addgoodstechnology(JSON.stringify(fields)).then((r) => {
if (r.data) {
message.success('添加成功');
} else {
message.error(r.errors);
}
});
return true;
} catch (error) {
message.error('添加失败请重试!');
return false;
}
};
/**
* 批量删除节点
*
* @param selectedRows
*/
const handleRemove = async (ids) => {
try {
deletegoodstechnology(ids).then((r) => {
if (r.data) {
message.success('删除成功');
} else {
message.error(r.errors);
}
});
return true;
} catch (error) {
message.error('删除失败,请重试');
}
};

/**
* 更新节点
*
* @param fields
*/

const handleUpdate = async (fields) => {
try {
updategoodstechnology(fields).then((r) => {
if (r.data) {
message.success('修改成功');
} else {
message.error(r.errors);
}
});
return true;
} catch (error) {
message.error('修改失败请重试!');
return false;
}
};
//页面 相当于 class
const bomtechnology = () => {
/** 新建/更新窗口的弹窗 */
const [createModalVisible, handleModalVisible] = useState(false);
/** 分布更新窗口的弹窗 */
const [actionFormModalVisible, setactionFormModalVisible] = useState(false);
const [showDetail, setShowDetail] = useState(false);
//绑定
const actionRef = useRef();
const [currentRow, setCurrentRow] = useState();
//选中的行
const [selectedRowsState, setSelectedRows] = useState([]);

/** 国际化配置 */

const columns = [
{
title: '主键',
dataIndex: 'id',
tip: '规则名称是唯一的 key',
hideInSearch: true,
hideInTable: true,
render: (dom, entity) => {
return (
<a
onClick={() => {
setCurrentRow(entity);
setShowDetail(true);
}}
>
{dom}
</a>
);
},
},
{
title: '名称',
dataIndex: 'name',
valueType: 'textarea',
ellipsis: true,
search: true,
},
{
title: '关联外键',
dataIndex: 'foreignKeyRe',
valueType: 'textarea',
ellipsis: true,
search: true,
},
{
title: '状态',
dataIndex: 'status',
hideInForm: true,
search: true,
valueEnum: {
0: {
text: '正常',
status: 'Processing',
},
1: {
text: '停用',
status: 'Success',
},
},
},
{
title: '创建时间',
dataIndex: 'createAt',
valueType: 'date',
hideInSearch: true,
},
{
title: '操作',
dataIndex: 'option',
valueType: 'option',
render: (_, record) => [
<a
key="state"
onClick={async () => {
let a = 0;
if (record.status == 0) {
a = 1;
}
setCurrentRow((record.status = a));

await handleUpdate(record).then((r) => {
if (r) {
actionRef.current.reload();
} else {
message.error('配置失败请重试!');
}
});
}}
>
{record.status == 0 ? '停用' : '使用'}
</a>,
<a
key="config"
onClick={() => {
handleModalVisible(true);
setCurrentRow(record);
actionRef.current?.reloadAndRest?.();
}}
>
更新
</a>,
<a
key="config"
onClick={() => {
setactionFormModalVisible(true);
setCurrentRow(record);
actionRef.current?.reloadAndRest?.();
}}
>
模型配置
</a>,
<Popconfirm
type="primary"
key="primary"
title="确认删除吗?"
okText="是"
cancelText="否"
onConfirm={() => {
handleRemove([record.id]);
actionRef.current?.reloadAndRest();
}}
onCancel={() => {}}
>
<a href="#">删除</a>
</Popconfirm>,
],
},
];

return (
<PageContainer>
<ProTable
headerTitle="工艺"
actionRef={actionRef}
rowKey="id"
search={{
labelWidth: 120,
}}
columns={columns}
toolBarRender={() => [
<Button
type="primary"
key="primary"
onClick={() => {
handleModalVisible(true);
setCurrentRow({});
}}
>
<PlusOutlined /> 新建
</Button>,
]}
//数据绑定
request={async (params) => {
var data = [];
var total = 0;
await getGoodstechnologypage(params).then((r) => {
data = r.data.data;
data.forEach((x) => {
x.status = x.status.toString();
});
total = r.data.total;
});
return {
data: data,
success: true,
total: total,
};
}}
// 每行选择点击事件
rowSelection={{
onChange: (_, selectedRows) => {
setSelectedRows(selectedRows);
},
}}
></ProTable>
<CreateForm
onFinish={async (value) => {
var success = false;
if (value.id) {
success = await handleUpdate(value);
} else {
success = await handleAdd(value);
}
if (success) {
handleModalVisible(false);
if (actionRef.current) {
actionRef.current.reload();
}
}
}}
onCancel={() => {
setCurrentRow(undefined);
handleModalVisible(false);
}}
createModalVisible={createModalVisible}
values={currentRow || {}}
/>
<ActionForm actionFormModalVisible={actionFormModalVisible}
values={currentRow || {} }
onCancel={() => {
setCurrentRow(undefined);
setactionFormModalVisible(false);
}}
/>
</PageContainer>
);
};

export default bomtechnology;

+ 50
- 0
src/pages/device/devicetechnology/services.js View File

@@ -0,0 +1,50 @@
import { request } from 'umi';

//获取分页数据
export async function getGoodstechnologypage(data) {
return request(`/kitchen/api/goodstechnology/getGoodstechnologypage`, {
method: 'Post',
data: data,
});
}
export async function addgoodstechnology(data) {
return request(`/kitchen/api/goodstechnology/addgoodstechnology`, {
method: 'Post',
data: data,
});
}
export async function updategoodstechnology(data) {
return request(`/kitchen/api/goodstechnology/updategoodstechnology`, {
method: 'Post',
data: data,
});
}
export async function deletegoodstechnology(data) {
return request(`/kitchen/api/goodstechnology/deletegoodstechnology`, {
method: 'Post',
data: data,
});
}
export async function gettechnologyactionList(data) {
return request(`/kitchen/api/goodstechnology/gettechnologyactionList?GoodstechnologyId=`+data, {
method: 'Get',
});
}
export async function addtechnologyaction(data) {
return request(`/kitchen/api/goodstechnology/addtechnologyaction`, {
method: 'Post',
data: data,
});
}
export async function updatetechnologyaction(data) {
return request(`/kitchen/api/goodstechnology/updatetechnologyaction`, {
method: 'Post',
data: data,
});
}
export async function deletetechnologyaction(data) {
return request(`/kitchen/api/goodstechnology/deletetechnologyaction`, {
method: 'Post',
data: data,
});
}

+ 255
- 39
src/pages/goods/goodsInfo/components/EditCarTable.jsx View File

@@ -1,21 +1,67 @@
import React, { useState, useRef, useEffect } from 'react';
import { Card, Select, Button, message } from 'antd';
import { Card, Select, Button, message, Checkbox, Modal } from 'antd';
import { BetaSchemaForm, ProFormList, ProForm } from '@ant-design/pro-form';
import ProTable from '@ant-design/pro-table';
import { ProCard } from '@ant-design/pro-Card';
// import { ProFormList } from '@ant-design/pro-list';
import style from '../style.less'
import { CloseOutlined } from '@ant-design/icons';
import {
AddGoodsTechnologyAction,
AddGoodsTechnologyAction
} from '../service';
const EditCarTable = (props) => {
const [chnologyId, settechnologyid] = useState('')
const [modalVisible, setmodalVisible] = useState(false)
const [selectedRowKeys, setselectedRowKeys] = useState([])
const [editdata, seteditdata] = useState({})
//选中的行
const [selectedRowsState, setSelectedRows] = useState([]);
const [disabled, setdisabled] = useState(false)
const formRef = useRef();
const actionRef = useRef();
const modelval = useRef(false);
//const checkchnologyId = useRef();
useEffect(() => {
console.log(props.technologyattrdata)
if(Object.keys(props.technologyattrdata).length>0){
if (props.technologyattrdata.attributes.length>0) {
seteditdata(props.technologyattrdata.attributes[0]);
setdisabled(true);
modelval.current=false;
}
}
formRef.current?.setFieldsValue(props.technologyattrdata)
}, [props.technologyattrdata])
//const [technologyname, settechnologyname] = useState('')
const [technologyname, settechnologyname] = useState('')
const tablecolumns = [
{
title: '主键',
dataIndex: 'id',
tip: '规则名称是唯一的 key',
hideInSearch: true,
hideInTable: true,
render: (dom, entity) => {
return (
<a
onClick={() => {
// setCurrentRow(entity);
// setShowDetail(true);
}}
>
{dom}
</a>
);
},
},
{
title: '名称',
dataIndex: 'name',
valueType: 'textarea',
ellipsis: true,
search: false,
},
]
const columns = [
{
dataIndex: 'items',
@@ -23,41 +69,89 @@ const EditCarTable = (props) => {
name: ['chnologyId'],
columns: ({ chnologyId }) => {
var cloumdata = [];
var sd = props.technologyattralldata.filter(x => x.goodstechnologyId == chnologyId);
if (sd) {
sd.map((x, index) => {
var options = {}
let columnspro =
{
title: () => { return <span className={style['formlable']}>{x.actionName}</span> },
dataIndex: "actionvalue-" + x.id + ":" + x.actionName,
valueType: x.actionType,
width: 'md',
}
if (x.actionType == "select") {
var va = JSON.parse(x.actionValue);
for (let i = 0; i < va.length; i++) {
var op = { text: va[i].actionValueName };
options[va[i].actionValueName] = op
if (chnologyId) {
console.log("chnologyId",chnologyId)
var sd = props.technologyattralldata.filter(x => x.goodstechnologyId == chnologyId);
if (sd.length > 0) {
sd.map((x, index) => {
var options = {}
let columnspro =
{
title: () => { return <span className={style['formlable']}>{x.actionName}</span> },
dataIndex: "actionvalue-" + x.id + ":" + x.actionName,
valueType: x.actionType,
width: 'md',
}
columnspro.valueEnum = options;
}
cloumdata.push(columnspro)
})
if (x.actionType == "select") {
if(x.actionValue){
var va = JSON.parse(x.actionValue);
for (let i = 0; i < va.length; i++) {
var op = { text: va[i].actionValueName };
options[va[i].actionValueName] = op
}
columnspro.valueEnum = options;
}
}
cloumdata.push(columnspro)
if(!disabled){
modelval.current = true;
}
})
} else {
let ajs = []
// console.log("弹窗状态:",modelval.current)
// if (modelval.current) {
// setmodalVisible(true)
// }else{
console.log(technologyname)
console.log(props.batchingdata)
if(Object.keys(editdata).length==0){
var dataSource = props.batchingdata.filter(x => x.typeName == technologyname)
dataSource.forEach(x=>{
x.ischeck=false;
})
console.log(dataSource)
ajs=dataSource
}else{
const keys = Object.keys(editdata);
var sd = keys.filter(x => x !== "chnologyId" && x !== "id" && x !== "sort" && x !== "name");
sd.map(x => {
var va = x.replace("actionvalue-", "").split(':')
ajs.push({ id: va[0], name: va[1],ischeck:true });
})
}
ajs.map(x => {
let columnspro =
{
title: checkbox(x.ischeck, x.id,x.name),
dataIndex: "actionvalue-" + x.id + ":" + x.name,
valueType: 'text',
width: 'md',
initialValue: 0
}
cloumdata.push(columnspro)
})

}
}
return cloumdata
}
}
]
function checkbox(check,id,name) {
return <Checkbox checked={check} key={id} onChange={onChange}>{name}</Checkbox>;
}
function onChange(val){
console.log(val)
}
const onHandleChange = (value, option) => {
settechnologyid(value)
//settechnologyname(option.label)
settechnologyname(option.label)
}
const getFormatValues = () => {
console.log(
'格式化后的所有数据:',
formRef.current?.getFieldsFormatValue?.(),
);
let check=true;
let arr = formRef.current?.getFieldsFormatValue?.()
let data = []
for (let index = 0; index < arr.attributes.length; index++) {
@@ -66,38 +160,48 @@ const EditCarTable = (props) => {
item.id = element.id
item.stepName = props.goodstechnologydata.find(x => x.value == element.chnologyId)?.label;
item.chnologyId = element.chnologyId;

if(element.chnologyId==""){
check=false;
}
let ajs = []
const keys = Object.keys(element);
//const values = Object.values(element);
var sd = keys.filter(x => x !== "chnologyId" && x !== "id" && x !== "sort");
var sd = keys.filter(x => x !== "chnologyId" && x !== "id" && x !== "sort" && x !== "name");
sd.map(x => {
var va = x.replace("actionvalue-", "").split(':')
ajs.push({ actionName: va[1], actionValue: element[x], technologyactionId: va[0] });
})
if(ajs.length==0){
check=false;
}
item.actionJson = JSON.stringify(ajs);
item.sort = element.sort == undefined ? props.maxsort + (index + 1) : element.sort;
item.goodsId = props.goodsid;
item.goodsAttributeId = props.checkvalue.join(',')
data.push(item);
}
console.log(data);
if(data.length>0){
console.log(
'保存的数据:',
data,
);
if (data.length > 0 && check) {
AddGoodsTechnologyAction(data).then((res) => {
if (res.data) {
console.log(formRef?.current)
message.success("保存成功")
setSelectedRows([])
formRef?.current?.resetFields()
seteditdata({});
setdisabled(false);
props.updadata()
} else {
message.error("保存失败")
}
})
}else{
message.error("没有要保存的数据")
}

} else {
message.error("没有要保存的数据或数据格式不正确")
}
};
return (
<div>
@@ -126,6 +230,24 @@ const EditCarTable = (props) => {
creatorButtonProps={{ creatorButtonText: '添加工艺', }}
copyIconProps={false}
initialValue={props.technologyattrdata}
actionGuard={{
beforeAddRow: async (defaultValue, insertIndex) => {
if (Object.keys(editdata).length > 0) {
message.error("当前处于编辑状态无法新增,删除当前编辑工艺后在新增");
return false;
} else {
//modelval.current=true;
return true;
}

},
beforeRemoveRow: async (index) => {
seteditdata({})
setdisabled(false);
return true;
},
}}
itemRender={({ listDom, action }, { record, index }) => (
<ProCard title={"工序号" + (record.sort == undefined ? (props.maxsort + (index + 1)) : record.sort)} bordered extra={action} bodyStyle={{ padding: 15 }} headStyle={{ padding: '0px 24px' }} style={{ marginBlockEnd: 8 }}>
{listDom}
@@ -134,7 +256,7 @@ const EditCarTable = (props) => {
creatorRecord={{ chnologyId: '' }}
>
<ProForm.Item name="chnologyId" style={{ float: 'left' }}>
<Select name="chnologyId" style={{ width: '90px' }} options={props.goodstechnologydata} onChange={async (value, option) => { onHandleChange(value, option) }}></Select>
<Select name="chnologyId" style={{ width: '90px' }} disabled={disabled} options={props.goodstechnologydata} onChange={async (value, option) => { onHandleChange(value, option) }}></Select>
</ProForm.Item>
<ProForm.Item isListField name="items" style={{ float: 'left', width: '75%' }}>
<BetaSchemaForm
@@ -150,6 +272,100 @@ const EditCarTable = (props) => {
</ProForm.Item>
</ProFormList>
</ProForm>
<Modal
title={'动作配置'}
width={640}
visible={modalVisible}
bodyStyle={{ padding: '32px 40px 1px 48px' }}
focusTriggerAfterClose={false}
onCancel={() => {
modelval.current = false;
setmodalVisible(false)
setSelectedRows([])
}}
onOk={() => {
modelval.current = false;
setmodalVisible(false)
}}
destroyOnClose
maskClosable={false}
>
<ProTable
headerTitle="物料列表"
rowKey="id"
actionRef={actionRef}
search={{
labelWidth: 120,
}}
columns={tablecolumns}
request={(params) => {
let name = '';
let ajs = [];
if (!technologyname) {
name = props.technologyattrdata.attributes[0].name;
const keys = Object.keys(props.technologyattrdata.attributes[0]);
var sd = keys.filter(x => x !== "chnologyId" && x !== "id" && x !== "sort" && x !== "name");
sd.map(x => {
var va = x.replace("actionvalue-", "").split(':')
ajs.push({ id: va[0], name: va[1] });
})

} else {
name = technologyname;
}
var dataSource = props.batchingdata.filter(x => x.typeName == name)
setSelectedRows(ajs);
setselectedRowKeys(ajs.map(x => { return x.id }))
return {
data: dataSource,
success: true,
total: dataSource.length,
};
}}
// 每行选择点击事件
rowSelection={{
selectedRowKeys,
onSelect: (record, selected) => {
const tempArray = [...selectedRowKeys];
const tempArray1 = [];
const findIndex = tempArray.findIndex(item => item === record.id);
if (selected) {
findIndex < 0 && tempArray.push(record.id);
tempArray1.push({ id: record.id, name: record.name })
} else {
findIndex > -1 && tempArray.splice(findIndex, 1);
}
setselectedRowKeys(tempArray);
console.log(tempArray)
//setSelectedRows(tempArray1);
},
onSelectAll: (selected, selectedRows, changeRows) => {
const tempArray = [...selectedRowKeys];
if (selected) {
selectedRows.forEach(item => {
if (!item) return;
const findIndex = tempArray.findIndex(fItem => fItem === item.id);
if (findIndex < 0) {
tempArray.push(item.id);
}
});
} else {
changeRows.forEach(item => {
const findIndex = tempArray.findIndex(fItem => fItem === item.id);
if (findIndex > -1) {
tempArray.splice(findIndex, 1);
}
});
}
setselectedRowKeys(tempArray);
//setSelectedRows(selectedRows)
},
onChange: (_, selectedRows) => {
setSelectedRows(selectedRows);
},
}}
></ProTable>
</Modal>
</div>
);
};

+ 86
- 30
src/pages/goods/goodsInfo/components/goodstechnologymaken.jsx View File

@@ -9,7 +9,9 @@ import {
GetTechnologyactionList,
GetTechnologyActionListAll,
GetGoodsTechnologyAction,
DeleteGoodsTechnologyAction
DeleteGoodsTechnologyAction,
GetByTypebatching,
GetDeviceTechnology
} from '../service';
import style from '../style.less'
import EditCarTable from './EditCarTable'
@@ -24,6 +26,10 @@ const goodstechnologymaken = (props) => {
const [cardcount, setCardcount] = useState([]);
const [goodstechnolog, setgoodstechnolog] = useState([]);
const [maxsort, setmaxsort] = useState(1);
const [batchingdata, setbatchingdata] = useState([]);
const [DeviceTechnologydata,setDeviceTechnology]=useState([])
const [DeviceTechnologyoption,setDeviceTechnologyoption]=useState([])
const [display,setdisplay]=useState("block")
useEffect(() => {
interdata()
}, [])
@@ -31,6 +37,9 @@ const goodstechnologymaken = (props) => {
getbyidgoods(props.goodsid).then((res) => {
if (res.succeeded) {
setGoodsinfo(res.data)
if(res.data.goodsAttributeList.length==0){
setdisplay("none")
}
var it = [
// {key:'1',label:'',children:(<div><img style={{width:100,height:100}} src={res.data.imgUrl}></img></div>)},
{ key: '1', label: '商品名称', children: res.data.name },
@@ -59,7 +68,7 @@ const goodstechnologymaken = (props) => {
setTechnologyattralldata(r.data)
})
GetGoodsTechnologyAction(props.goodsid).then((r) => {
if(r.data.length>0){
if (r.data.length > 0) {
setgoodstechnolog(r.data)
// 查询最大值
var max = r.data.reduce(function (prev, current) {
@@ -68,6 +77,18 @@ const goodstechnologymaken = (props) => {
setmaxsort(max.sort)
}
})
GetByTypebatching().then((r) => {
setbatchingdata(r.data)
})
GetDeviceTechnology().then((res)=>{
setDeviceTechnology(res.data)
if(res.data.length>0){
var op=res.data.map(x=>{
return {value:x.id,label:x.deviceName}
})
setDeviceTechnologyoption(op)
}
})
}
const onChangevalue = (e) => {
const { name, value } = e.target;
@@ -98,9 +119,9 @@ const goodstechnologymaken = (props) => {
setCheckvalue(updatedValues)
}
const onClickedit = (e, item, action) => {
console.log(item)
let attr = { attributes: [] };
const obj = {};
obj['name'] = item.stepName;
obj['id'] = item.id;
obj['chnologyId'] = item.chnologyId;
obj['sort'] = item.sort;
@@ -108,23 +129,22 @@ const goodstechnologymaken = (props) => {
obj["actionvalue-" + x.technologyactionId + ":" + x.actionName] = x.actionValue;
})
attr.attributes.push(obj)
console.log(attr)
setTechnologyattrdata(attr)
}
const onClickdele=(e, item, action)=>{
DeleteGoodsTechnologyAction(item.id).then((res)=>{
if(res.data){
const onClickdele = (e, item, action) => {
DeleteGoodsTechnologyAction(item.id).then((res) => {
if (res.data) {
message.success("删除成功")
//formRef?.current?.resetFields(...props.technologyattrdata)
updadata()
}else{
message.error("删除失败")
} else {
message.error("删除失败")
}
})
}
const updadata = () => {
GetGoodsTechnologyAction(props.goodsid).then((r) => {
if (r.data.length>0) {
if (r.data.length > 0) {
setgoodstechnolog(r.data)
// 查询最大值
var max = r.data.reduce(function (prev, current) {
@@ -136,6 +156,23 @@ const goodstechnologymaken = (props) => {
}
})
}
const handleChange=(value)=>{
let sd=DeviceTechnologydata.find(x=>x.id==value);
console.log("wwwwwwwwwwwwwwwwwwwwwww")
console.log(value)
console.log(sd)
if(sd){
if(sd.goodsTechnologyInfo.length>0){
let godata=sd.goodsTechnologyInfo.map(x=>{
return {value:x.goodsTechnologyId,label:x.name}
})
console.log(godata)
//setgoodstechnologydata(godata)
}
}
}
return <>

<Card bodyStyle={{ padding: 15 }}>
@@ -153,7 +190,7 @@ const goodstechnologymaken = (props) => {

</Descriptions>
</Card>
<Card bodyStyle={{ padding: 15 }}>
<Card bodyStyle={{ padding: 15 }} style={{display:display}} >
<div style={{ fontSize: 16, marginBottom: 5, color: '#1890ff', fontWeight: 600 }}>商品属性</div>
{
goodsinfo.goodsAttributeList == undefined ? '' : (
@@ -181,39 +218,58 @@ const goodstechnologymaken = (props) => {
}
</Card>
<Card bodyStyle={{ padding: 15 }}>
<div style={{ fontSize: 16, marginBottom: 5, color: '#1890ff', fontWeight: 600 }}>工艺设计</div>
<div style={{ fontSize: 16, marginBottom: 5, color: '#1890ff', fontWeight: 600 }}>
工艺设计
<Select
showSearch
style={{
width: 200,
}}
placeholder="请选择设备"
optionFilterProp="children"
filterOption={(input, option) => (option?.label ?? '').includes(input)}
filterSort={(optionA, optionB) =>
(optionA?.label ?? '').toLowerCase().localeCompare((optionB?.label ?? '').toLowerCase())
}
onChange={handleChange}
options={DeviceTechnologyoption}
/>
</div>
<ProCard split="vertical">
{/* extra={<Button type="primary">保存</Button>} */}
<ProCard title="编辑工艺" type='inner' colSpan="33%" headerBordered headStyle={{ paddingLeft: '45%' }}>
<ProCard title="编辑工艺" type='inner' colSpan="33%" bodyStyle={{ padding: 5 }} headerBordered headStyle={{ paddingLeft: '45%' }}>
<div style={{ textAlign: 'center', marginBottom: 10, color: 'brown' }}>{attrvalue}</div>

<EditCarTable maxsort={maxsort} updadata={updadata} goodsid={props.goodsid} technologyattralldata={technologyattralldata} checkvalue={checkvalue} technologyattrdata={technologyattrdata} goodstechnologydata={goodstechnologydata} />
<EditCarTable maxsort={maxsort} batchingdata={batchingdata} updadata={updadata} goodsid={props.goodsid} technologyattralldata={technologyattralldata} checkvalue={checkvalue} technologyattrdata={technologyattrdata} goodstechnologydata={goodstechnologydata} />
{/* <Button type="dashed" style={{ marginTop: 10 }} onClick={onClickadd} icon={<PlusOutlined />} block>添加工艺</Button> */}
</ProCard>
<ProCard title="查看工艺" type='inner' headStyle={{ paddingLeft: '45%' }} headerBordered>
<ProCard title="查看工艺" type='inner' headStyle={{ paddingLeft: '45%' }} bodyStyle={{ padding: 5 }} headerBordered>
<div style={{ height: 360 }}>
{
goodstechnolog == undefined ? '' : (
goodstechnolog.map((item, index) => {
var action = JSON.parse(item.actionJson)
return (
<ProCard title={"工序号" + item.sort} bordered bodyStyle={{ padding: 15 }} headStyle={{ padding: '0px 24px' }} extra={[<Button type="link" onClick={(e) => { onClickedit(e, item, action) }}>编辑</Button>, <CloseOutlined onClick={(e) => { onClickdele(e, item, action) }} />]} style={{
marginBlockEnd: 8, width: 350, float: 'left',
marginRight: '10px'
<ProCard title={"工序号" + item.sort} bordered bodyStyle={{ padding: 5 }} headStyle={{ padding: '0px 5px' }} extra={[<Button type="link" onClick={(e) => { onClickedit(e, item, action) }}>编辑</Button>, <CloseOutlined onClick={(e) => { onClickdele(e, item, action) }} />]} style={{
marginBlockEnd: 8, width: 353, float: 'left', height: '200px', marginRight: '10px', 'overflow-y': 'scroll'
}}>
<div className={style['formlable']} style={{ float: 'left', height: '65px', lineHeight: '65px' }}>{item.stepName}</div>
{
action.map(x => {
return (
<div style={{ float: 'left' }}>
<div className={style['formlable']} style={{ display: 'block', float: 'left' }}>{x.actionName}</div>
<div className={style['formlable']} style={{ display: 'block', float: 'left' }}> {x.actionValue}</div>
</div>
)

})
}
<div style={{ lineHeight: '200px' }}>
<div className={style['formlable']} style={{ float: 'left', height: '70px', lineHeight: '65px' }}>{item.stepName}</div>
<div style={{ float: 'left', marginBottom: '5px', width: '67%' }}>
{
action.map(x => {
return (
<div style={{ float: 'left', marginBottom: '5px' }}>
<div className={style['formlable']} style={{ display: 'block', float: 'left' }}>{x.actionName}</div>
<div className={style['formlable']} style={{ display: 'block', float: 'left' }}> {x.actionValue}</div>
</div>
)

})
}
</div>
</div>
</ProCard>
)
})


+ 2
- 2
src/pages/goods/goodsInfo/index.jsx View File

@@ -363,8 +363,8 @@ const Advanced = (props) => {
<Form.Item label="是否称重" name="isWeigh" valuePropName="checked" initialValue='false' >
<Switch checkedChildren="是" unCheckedChildren="否" defaultChecked='false' />
</Form.Item>
<Form.Item label="是否多属性" name="isAttrubute" valuePropName="checked" initialValue='false' >
<Switch checkedChildren="是" unCheckedChildren="否" defaultChecked='false' />
<Form.Item label="是否多属性" name="isAttrubute" >
<Switch checkedChildren="是" unCheckedChildren="否" defaultChecked={false} />
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">


+ 10
- 0
src/pages/goods/goodsInfo/service.js View File

@@ -107,4 +107,14 @@ export async function DeleteGoodsTechnologyAction(data) {
return request(`/kitchen/api/goodstechnology/deletegoodstechnologyaction?id=`+data, {
method: 'Get',
});
}
export async function GetDeviceTechnology() {
return request(`/kitchen/api/goodstechnology/getdevicetechnology`, {
method: 'Get',
});
}
export async function GetByTypebatching() {
return request(`/kitchen/api/goodes/getbytypebatching`, {
method: 'Get',
});
}

Loading…
Cancel
Save