Commit 76e4563b authored by krysent's avatar krysent

默认库区

parent 14d5c9ff
...@@ -102,7 +102,8 @@ function formartData(item, val) { ...@@ -102,7 +102,8 @@ function formartData(item, val) {
) )
: []; : [];
} else if (item.type == "select" || item.type == "treeselect") { } else if (item.type == "select" || item.type == "treeselect") {
formartValue = val == 0 || val ? val : item.multiple ? [] : ""; formartValue = val == 0 || val ? val : item.multiple ? [] : null;
console.log(formartValue);
} else if (item.type == "input" || !item.type) { } else if (item.type == "input" || !item.type) {
formartValue = val ? val?.replace(/^\s+|\s+$/g, "") : ""; formartValue = val ? val?.replace(/^\s+|\s+$/g, "") : "";
} }
......
...@@ -89,6 +89,7 @@ export default { ...@@ -89,6 +89,7 @@ export default {
value: 0, value: 0,
type: "inputnumber", type: "inputnumber",
title: "铁损", title: "铁损",
max:999999,
name: ["ironLoss"], name: ["ironLoss"],
required: false, required: false,
precision: 3, precision: 3,
...@@ -97,6 +98,7 @@ export default { ...@@ -97,6 +98,7 @@ export default {
value: 0, value: 0,
type: "inputnumber", type: "inputnumber",
title: "片厚", title: "片厚",
max:999999,
name: ["sheetThickness"], name: ["sheetThickness"],
required: false, required: false,
precision: 3, precision: 3,
......
...@@ -264,6 +264,7 @@ const Materiel = (props) => { ...@@ -264,6 +264,7 @@ const Materiel = (props) => {
title: "默认库区", title: "默认库区",
dataIndex: "storeAreaName", dataIndex: "storeAreaName",
key: "storeAreaName", key: "storeAreaName",
search:false
}, },
{ {
...@@ -365,11 +366,16 @@ const Materiel = (props) => { ...@@ -365,11 +366,16 @@ const Materiel = (props) => {
formRef formRef
.validateFields() .validateFields()
.then((firstValues) => { .then((firstValues) => {
console.log("1231231", firstValues); for (let i in firstValues) {
if (firstValues[i] === undefined) {
firstValues[i] = null;
}
}
params = { params = {
...firstValues, ...firstValues,
...difrid, ...difrid,
}; };
console.log(params);
url = "/ngic-workmanship/pmMaterie/save"; url = "/ngic-workmanship/pmMaterie/save";
run({ url, params }); run({ url, params });
}) })
......
...@@ -106,11 +106,11 @@ const Store = (props) => { ...@@ -106,11 +106,11 @@ const Store = (props) => {
"title": "所属仓库", "title": "所属仓库",
"dataIndex": "storeName", "dataIndex": "storeName",
"key": "storeName", "key": "storeName",
"valueType": "select", // "valueType": "select",
"options": { // "options": {
database: () => doFetch({ url: "/ngic-base-business/sysDic/queryStoreTypeSelect", params: {} }), // database: () => doFetch({ url: "/ngic-base-business/sysDic/queryStoreTypeSelect", params: {} }),
params: {} // params: {}
} // }
}, },
{ {
"title": "描述", "title": "描述",
......
...@@ -82,9 +82,11 @@ export default { ...@@ -82,9 +82,11 @@ export default {
}, },
], ],
}, },
/* `isMovePosition` 是对象中表示表单字段的属性。它的类型为“radio”,这意味着它将在表单中呈现为单选按钮组。用户可以选择“是”(是)或“否”(否)作为该字段的值。 */
/* `isMovePosition` 是对象中表示表单字段的属性。它的类型为“radio”,这意味着它将在表单中呈现为单选按钮组。用户可以选择“是”(是)或“否”(否)作为该字段的值。 */
isMovePosition: { isMovePosition: {
value: 1, value: 1,
type: "radio", type: "select",
name: ["isMovePosition"], name: ["isMovePosition"],
title: "是否为移库库位", title: "是否为移库库位",
required: false, required: false,
......
...@@ -226,26 +226,26 @@ const Materiel = (props) => { ...@@ -226,26 +226,26 @@ const Materiel = (props) => {
title: "所属仓库", title: "所属仓库",
dataIndex: "storeName", dataIndex: "storeName",
key: "storeName", key: "storeName",
valueType: "select", // valueType: "select",
options: { // options: {
database: storeselectionBoxAll, // database: storeselectionBoxAll,
}, // },
}, },
{ {
title: "所属库区", title: "所属库区",
dataIndex: "storeAreaName", dataIndex: "storeAreaName",
key: "storeAreaName", key: "storeAreaName",
options: { // options: {
database: () => // database: () =>
doFetch({ // doFetch({
url: "/ngic-base-business/sysDic/queryMaterieControlSelect", // url: "/ngic-base-business/sysDic/queryMaterieControlSelect",
}), // }),
params: {}, // params: {},
}, // },
valueType: "select", // valueType: "select",
formItemProps: { // formItemProps: {
name: "materieControl", // name: "materieControl",
}, // },
}, },
{ {
title: "排", title: "排",
...@@ -278,26 +278,31 @@ const Materiel = (props) => { ...@@ -278,26 +278,31 @@ const Materiel = (props) => {
title: "更新人", title: "更新人",
dataIndex: "updateUserName", dataIndex: "updateUserName",
key: "updateUserName", key: "updateUserName",
search: false,
}, },
{ {
title: "更新时间", title: "更新时间",
dataIndex: "updateTime", dataIndex: "updateTime",
key: "updateTime", key: "updateTime",
search:false search: false,
}, },
{ {
title: "是否为移库仓位", title: "是否为移库仓位",
dataIndex: "isMovePosition", dataIndex: "isMovePosition",
key: "isMovePosition", key: "isMovePosition",
valueType: 'select', valueType: "select",
options: [{ search: false,
value: '1', options: [
label:'是' {
}, { value: "1",
value: '2', label: "是",
label:'否' },
}], {
value: "2",
label: "否",
},
],
render: (_, row) => { render: (_, row) => {
return row?.isMovePosition ? "是" : "否"; return row?.isMovePosition ? "是" : "否";
}, },
...@@ -415,7 +420,11 @@ const Materiel = (props) => { ...@@ -415,7 +420,11 @@ const Materiel = (props) => {
conversionRate: it.conversionRate, conversionRate: it.conversionRate,
}; };
}); });
for (let i in firstValues) {
if (firstValues[i] === undefined) {
firstValues[i] = null;
}
}
params = { params = {
...firstValues, ...firstValues,
...difrid, ...difrid,
......
...@@ -37,14 +37,14 @@ export default { ...@@ -37,14 +37,14 @@ export default {
type: "select", type: "select",
title: "启用状态", title: "启用状态",
name: ["status"], name: ["status"],
required: false, required: true,
options: [ options: [
{ {
label: "启用", label: "启用",
value: 1, value: 1,
}, },
{ {
label: "用", label: "用",
value: 0, value: 0,
}, },
], ],
......
...@@ -104,37 +104,38 @@ const Station = (props) => { ...@@ -104,37 +104,38 @@ const Station = (props) => {
title: "工位名称", title: "工位名称",
dataIndex: "stationName", dataIndex: "stationName",
key: "stationName", key: "stationName",
render: (_, row) => { // render: (_, row) => {
return ( // return (
<Tooltip title={row.stationName}> // <Tooltip title={row.stationName}>
<a // <a
className="table-cell" // className="table-cell"
onClick={() => { // onClick={() => {
doFetch({ // doFetch({
url: "/ngic-auth/sysStation/queryById", // url: "/ngic-auth/sysStation/queryById",
params: { id: row.id }, // params: { id: row.id },
}).then((res) => { // }).then((res) => {
if (res.code == "0000") { // if (res.code == "0000") {
let dataSource = res?.data?.data ?? {}; // let dataSource = res?.data?.data ?? {};
dispatch({ type: "see", dataSource }); // dispatch({ type: "see", dataSource });
} // }
}); // });
}} // }}
> // >
{row.stationName} // {row.stationName}
</a> // </a>
</Tooltip> // </Tooltip>
); // );
}, // },
}, },
{ {
title: "启用状态", title: "启用状态",
dataIndex: "factoryName", dataIndex: "factoryName",
key: "factoryName", key: "factoryName",
search:false, required: true,
search: false,
render: (_, row) => { render: (_, row) => {
return row?.status ? '启用' : '禁用' return row?.status ? "启用" : "禁用";
} },
}, },
{ {
title: "描述", title: "描述",
...@@ -192,6 +193,7 @@ const Station = (props) => { ...@@ -192,6 +193,7 @@ const Station = (props) => {
} }
let saveData = (values, fn) => { let saveData = (values, fn) => {
let newfields = JSON.parse(JSON.stringify(values)); let newfields = JSON.parse(JSON.stringify(values));
//新增&修改 //新增&修改
let difrid = iftype.val == "edit" ? { id: curitem.id } : {}; let difrid = iftype.val == "edit" ? { id: curitem.id } : {};
run({ run({
...@@ -207,6 +209,9 @@ const Station = (props) => { ...@@ -207,6 +209,9 @@ const Station = (props) => {
for (let i in defaultFields) { for (let i in defaultFields) {
defaultFields[i].value = null; defaultFields[i].value = null;
defaultFields[i].disabled = false; defaultFields[i].disabled = false;
if (i == "status") {
defaultFields[i].value = 1;
}
} }
dispatch({ type: "add", fields: defaultFields }); dispatch({ type: "add", fields: defaultFields });
}} }}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment