Commit 76e4563b authored by krysent's avatar krysent

默认库区

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