{item.attributeName}:
@@ -210,10 +257,16 @@ const GoodsbomFrom = (props) => {
)
}
+
+
+ 选择配方
+ 新建配方
+
+
+
+
-
+
-
+
-
+
-
+
*/}
- *配方详情}
columns={columns}
rowKey="id"
value={dataSource}
onChange={setDataSource}
- recordCreatorProps={{
- newRecordType: 'dataSource',
- record: () => ({
- id: Date.now(),
- }),
- }}
+ recordCreatorProps={recordCreatorProps}
editable={{
type: 'multiple',
diff --git a/src/pages/database/goods/goodsbom/index.jsx b/src/pages/database/goods/goodsbom/index.jsx
index 46fbe55..564f239 100644
--- a/src/pages/database/goods/goodsbom/index.jsx
+++ b/src/pages/database/goods/goodsbom/index.jsx
@@ -89,20 +89,29 @@ const Advanced = (props) => {
valueType: 'textarea',
},
{
- title: '配方类型',
- dataIndex: 'isMain',
- hideInForm: true,
- valueEnum: {
- false: {
- text: '辅料',
- status: 'Processing',
- },
- true: {
- text: '主料',
- status: 'Success',
- },
- },
+ title: '商品属性',
+ key: 'goodsAttributeValue',
+ dataIndex: 'goodsAttributeValue',
+ valueType: 'textarea',
+ fieldProps:{
+ placeholder:'请输入属性,属性格式为:xx-xx'
+ }
},
+ // {
+ // title: '配方类型',
+ // dataIndex: 'isMain',
+ // hideInForm: true,
+ // valueEnum: {
+ // false: {
+ // text: '辅料',
+ // status: 'Processing',
+ // },
+ // true: {
+ // text: '主料',
+ // status: 'Success',
+ // },
+ // },
+ // },
{
title: '操作',
dataIndex: 'option',
@@ -135,17 +144,18 @@ const Advanced = (props) => {
okText="是"
cancelText="否"
onConfirm={async () => {
- const hide = message.loading('正在删除');
try {
- DelGoodsBom(record.id);
- hide();
- message.success('删除成功,即将刷新');
- actionRef.current.reload();
+ DelGoodsBom(record.id).then((r)=>{
+ if(r.data){
+ message.success('删除成功,即将刷新');
+ actionRef.current.reload();
+ }else{
+ message.error('删除失败,请重试');
+ actionRef.current.reload();
+ }
+ });
return true;
} catch (error) {
- hide();
- message.error('删除失败,请重试');
- actionRef.current.reload();
return false;
}
}}
@@ -174,7 +184,7 @@ const Advanced = (props) => {
columns={bomcolumns}
actionRef={actionRef}
rowKey="id"
- search={false}
+ search
toolBarRender={() => [