Commit 2b7e6c2d authored by wuhao's avatar wuhao 🎯

killder

parent df45bb50
......@@ -99,8 +99,8 @@ const Details = (props) => {
<pre className={col ? "" : styles.one}>{value}</pre>
</Tooltip>
) : (
<div>-</div>
);
<div>-</div>
);
} else if (type == "file") {
return (
<div style={{ display: "flex", flexFlow: "row wrap", width: "100%" }}>
......@@ -126,8 +126,8 @@ const Details = (props) => {
);
})
) : (
"-"
)}
"-"
)}
</div>
);
} else if (type == "img") {
......
......@@ -37,7 +37,7 @@ function DrawInitForm(props) {
placement="right"
closable={true}
getContainer={false}
style={{ position: "absolute", transform: "translateX(0)" }}
style={{ position: "absolute", transform: "translateX(0)",maxWidth:"100%" }}
width={props.val == "detail" ? 1000 : props.width}
destroyOnClose={true}
{...props}
......
import React, { useEffect, useRef } from "react";
import { EditableProTable } from "@ant-design/pro-table";
import ProField from "@ant-design/pro-field";
import ProCard from "@ant-design/pro-card";
import { Button } from "antd";
import { useUpdate } from 'ahooks';
const EditTable = ({
columns,
......@@ -14,7 +13,16 @@ const EditTable = ({
linkconfig,
style
}) => {
const editorFormRef = useRef()
const update = useUpdate();
const editorFormRef = useRef();
useEffect(()=>{
if(value===undefined){
update()
}
},[value])
console.log(columns[0]);
return (
<EditableProTable
style={{ ...(style ?? {}) }}
......@@ -40,7 +48,6 @@ const EditTable = ({
return [defaultDoms.delete];
},
onValuesChange: async (record, recordList) => {
let { urlchangeval } = linkconfig ?? {};
let newvalue = [...recordList];
if (urlchangeval && record) {//根据url 改变 数据值
......
This diff is collapsed.
......@@ -9,30 +9,30 @@ import Details from "@/components/Details";
import { materielDetail } from "@/utils/detailTotalCard";
import InitForm from "@/components/InitForm";
import moment from "moment";
import TreeRender from '@/components/TreeRender'
import TreeRender from "@/components/TreeRender";
import { useEffect } from "react";
const initState = {
vs: false,
fields: {},
iftype: {},
curitem: {},
detail: {
dataSource: {},
totalCard: [],
vs: false,
fields: {},
iftype: {},
curitem: {},
detail: {
dataSource: {},
totalCard: [],
},
visible: false,
specificFileds: {},
commonFields: {},
defaultCommonFields: [],
},
visible: false,
specificFileds: {},
commonFields: {},
defaultCommonFields: [],
},
otherBasic = {
materieCode: "物料编号",
materieName: "物料名称",
materieTypeName: "物料类型",
productionUnitName: "生产单位(主)",
processLineName: "工艺路线",
};
otherBasic = {
materieCode: "物料编号",
materieName: "物料名称",
materieTypeName: "物料类型",
productionUnitName: "生产单位(主)",
processLineName: "工艺路线",
};
function reducer(state, action) {
let { type } = action,
newState = {};
......@@ -143,15 +143,15 @@ const Materiel = (props) => {
ChildRef?.onRefresh();
}
const { run, loading } = useRequest(doFetch, {
manual: true,
formatResult: (res) => res,
onSuccess: (result, params) => {
if (result.code == "0000") {
reload();
dispatch({ type: "close" });
}
},
}),
manual: true,
formatResult: (res) => res,
onSuccess: (result, params) => {
if (result.code == "0000") {
reload();
dispatch({ type: "close" });
}
},
}),
[state, dispatch] = useReducer(reducer, initState),
{
vs,
......@@ -203,7 +203,12 @@ const Materiel = (props) => {
itemData: newSpecialData,
},
];
dataSource.newqualityGuaranteePeriod = dataSource.qualityGuaranteePeriod==0||dataSource.qualityGuaranteePeriod ? dataSource.qualityGuaranteePeriod + dataSource.qualityGuaranteePeriodUnitName : null;
dataSource.newqualityGuaranteePeriod =
dataSource.qualityGuaranteePeriod == 0 ||
dataSource.qualityGuaranteePeriod
? dataSource.qualityGuaranteePeriod +
dataSource.qualityGuaranteePeriodUnitName
: null;
let totalCard = materielDetail.concat(itemCol);
dispatch({ type: "see", dataSource, totalCard });
}
......@@ -220,15 +225,18 @@ const Materiel = (props) => {
title: "物料类型",
dataIndex: "materieTypeName",
key: "materieTypeName",
search: false
search: false,
},
{
title: "物料管控",
dataIndex: "materieControlName",
key: "materieControlName",
options: {
database: () => doFetch({ url: "/ngic-base-business/sysDic/queryMaterieControlSelect" }),
params: {}
database: () =>
doFetch({
url: "/ngic-base-business/sysDic/queryMaterieControlSelect",
}),
params: {},
},
valueType: "select",
formItemProps: {
......@@ -241,17 +249,21 @@ const Materiel = (props) => {
key: "qualityGuaranteePeriod",
search: false,
render: (text, row) => {
return (row.qualityGuaranteePeriod??"") + " - " + (row.qualityGuaranteePeriodUnitName??"")
}
return (
(row.qualityGuaranteePeriod ?? "") +
" - " +
(row.qualityGuaranteePeriodUnitName ?? "")
);
},
},
{
title: "最大库存",
title: "库存上限",
dataIndex: "inventoryMax",
key: "inventoryMax",
search: false,
},
{
title: "最小库存",
title: "库存下限",
dataIndex: "inventoryMin",
key: "inventoryMin",
search: false,
......@@ -262,13 +274,15 @@ const Materiel = (props) => {
dataIndex: "productionUnitName",
key: "productionUnit",
options: {
database: () => doFetch({ url: "/ngic-base-business/sysDic/queryMaterieUnitSelect" }),
params: {}
database: () =>
doFetch({
url: "/ngic-base-business/sysDic/queryMaterieUnitSelect",
}),
params: {},
},
valueType: "select",
},
{
title: "操作",
dataIndex: "option_dataindex",
......@@ -279,12 +293,13 @@ const Materiel = (props) => {
},
];
useEffect(() => {
doFetch({ url: "/ngic-workmanship/pmMaterieChar/queryCommonList", params: {} }).then(res => {
setdefaultSpecificFileds(res?.data?.dataList)
})
}, [])
doFetch({
url: "/ngic-workmanship/pmMaterieChar/queryCommonList",
params: {},
}).then((res) => {
setdefaultSpecificFileds(res?.data?.dataList);
});
}, []);
function extraAction(text, record, _, action) {
return [
......@@ -330,9 +345,9 @@ const Materiel = (props) => {
};
all().then((res) => {
let commonDataFields = formatFieds(
res?.commonData,
"common"
)?.obj,
res?.commonData,
"common"
)?.obj,
newCommonData = formatFieds(res?.commonData, "common")?.data;
dispatch({
type: "edit",
......@@ -342,7 +357,7 @@ const Materiel = (props) => {
specificFileds: { ...commonDataFields },
defaultCommonFields: newCommonData,
});
setdefaultSpecificFileds([...newCommonData])
setdefaultSpecificFileds([...newCommonData]);
});
}
});
......@@ -392,12 +407,13 @@ const Materiel = (props) => {
};
return el;
});
let materieProductUnitList = firstValues.materieProductUnitList.map(it => {
return {
productionUnit: it.productionUnit,
conversionRate: it.conversionRate
}
})
let materieProductUnitList =
firstValues.materieProductUnitList.map((it) => {
return {
productionUnit: it.productionUnit,
conversionRate: it.conversionRate,
};
});
params = {
...firstValues,
......@@ -408,9 +424,9 @@ const Materiel = (props) => {
url = "/ngic-workmanship/pmMaterie/save";
run({ url, params });
})
.catch((error) => { });
.catch((error) => {});
})
.catch((error) => { });
.catch((error) => {});
} else {
url = "/ngic-workmanship/pmMaterie/saveMaterieBom";
let firstValues = formRef?.getFieldsValue();
......@@ -461,7 +477,8 @@ const Materiel = (props) => {
defaultFields[i].value = 1;
}
if (i == "materieTypeId") {
defaultFields[i].value = materieTypeId;
defaultFields[i].value =
materieTypeId == "00000000" ? null : materieTypeId;
}
}
dispatch({
......@@ -501,8 +518,8 @@ const Materiel = (props) => {
item?.fieldRealValue == 0 || item?.fieldRealValue
? item?.fieldRealValue
: item.fieldChar == 4
? []
: "",
? []
: "",
title: item.fieldName,
name: [fieldsKey],
required: false,
......@@ -529,18 +546,25 @@ const Materiel = (props) => {
childposition="left"
extraparams={{ materieTypeId: materieTypeId }}
>
<div style={{ width: 260, flexShrink: 0, marginTop: -4, borderRight: "1px solid #f0f0f0", paddingRight: 12, marginRight: 12 }}>
<div
style={{
width: 260,
flexShrink: 0,
marginTop: -4,
borderRight: "1px solid #f0f0f0",
paddingRight: 12,
marginRight: 12,
}}
>
<TreeRender
url="/ngic-workmanship/pmMaterieType/queryTreeList"
deleteurl="/ngic-workmanship/pmMaterieType/deleteById"
saveurl="/ngic-workmanship/pmMaterieType/save"
onselected={(vals) => {
setmaterieTypeId(vals[0] ?? '')
setmaterieTypeId(vals[0] ?? "");
}}
/>
</div>
</AutoTable>
<Drawer
title={iftype.title}
......@@ -552,13 +576,12 @@ const Materiel = (props) => {
style={{ position: "absolute" }}
width={"100%"}
>
{(
{
<>
<InitForm
formRef={formRef}
fields={fields}
onChange={(changedValues, allValues) => {
}}
onChange={(changedValues, allValues) => {}}
actions={() => {
return null;
}}
......@@ -569,13 +592,13 @@ const Materiel = (props) => {
<InitForm
formRef={formRefs}
fields={specificFileds}
onChange={(changedValues, allValues) => { }}
onChange={(changedValues, allValues) => {}}
actions={() => {
return null;
}}
></InitForm>
</>
)}
}
<Button
style={{ width: "100%" }}
type="primary"
......
......@@ -47,14 +47,14 @@ export default {
inventoryMin: {
value: null,
type: "inputnumber",
title: "库存最小值",
title: "库存下限",
name: ["inventoryMin"],
required: false,
},
inventoryMax: {
value: null,
type: "inputnumber",
title: "库存最大值",
title: "库存上限",
name: ["inventoryMax"],
required: false,
},
......@@ -63,7 +63,7 @@ export default {
type: "select",
title: "库存单位",
name: ["productionUnit"],
required: false,
required: true,
options: {
database: (params) => doFetch({ url: "/ngic-base-business/sysDic/queryMaterieUnitSelect", params }),
params: {}
......@@ -78,7 +78,7 @@ export default {
},
qualityGuaranteePeriodUnit: {
value: null,
type: "radio",
type: "select",
title: "保质期单位",
name: ["qualityGuaranteePeriodUnit"],
required: false,
......@@ -120,7 +120,7 @@ export default {
type: "table",
col: { span: 24 },
name: ["materieProductUnitList"],
required: true,
required: false,
columns: [
{
title: "辅助单位",
......@@ -134,7 +134,7 @@ export default {
},
},
{
title: "转换比",
title: "转换比 库存单位=辅助单位*转换比”",
dataIndex: "conversionRate",
key: "conversionRate",
search: false,
......
......@@ -33,7 +33,7 @@ const EditUpload = ({ record, fid, storeId }) => {
...s,
submit: {
id: fid,
materialList: (s.submit && s?.submit?.materialList) ? s?.submit?.materialList?.filter(it=>newlist.map(item=>item.id).indexOf(it.id)==-1)?.concat(newlist)?.filter(it=>it.uploadList?.length>0) : []
materialList: (s.submit && s?.submit?.materialList) ? s?.submit?.materialList?.filter(it => newlist.map(item => item.id).indexOf(it.id) == -1)?.concat(newlist)?.filter(it => it.uploadList?.length > 0) : []
}
})
})
......@@ -44,29 +44,39 @@ const EditUpload = ({ record, fid, storeId }) => {
style={{ marginLeft: 48 }}
columns={[
{
title: "库位名称",
title: <span>库位名称 <b style={{ color: "red" }}>*</b></span>,
dataIndex: "storePositionName",
key: "storePositionId",
search: false,
valueType: "select",
request: async (params) => {
let res = await doFetch({ url: "/ngic-auth/sysStorePosition/queryByStoreId/selection", params:{storeId:params.storeId}});
let res = await doFetch({ url: "/ngic-auth/sysStorePosition/queryByStoreId/selection", params: { storeId: params.storeId } });
return res?.data?.dataList
},
editable: (text, record, index) => {
return !record.materieOutstoreDetailId
},
params:{storeId: storeId}
params: { storeId: storeId },
"formItemProps": () => {
return {
rules: [{ required: true, message: '此项为必填项' }],
};
},
},
{
title: "上架数量",
title: <span>上架数量 <b style={{ color: "red" }}>*</b></span>,
dataIndex: "instroeNum",
key: "instroeNum",
search: false,
editable: (text, record, index) => {
return !record.materieOutstoreDetailId
},
valueType: "digit"
valueType: "digit",
"formItemProps": () => {
return {
rules: [{ required: true, message: '此项为必填项' }],
};
},
},
{
title: "备注",
......@@ -127,7 +137,7 @@ const one = {
"storeId": {
"value": null,
"type": "select",
"title": "仓库",
"title": "入库仓库",
"name": [
"storeId"
],
......@@ -177,7 +187,7 @@ const one = {
type: "table",
col: { span: 24 },
name: ["materialList"],
required: true,
required: false,
linkconfig: {
urlchangeval: {//根据url接口 改变某个value
database: (params) => doFetch({ url: "/ngic-workmanship/pmMaterie/queryUnitByMaterieId", params }),
......@@ -228,11 +238,11 @@ const one = {
}
},
{
"title": "单位",
"title": "库存单位",
"dataIndex": "productionUnitName",
"key": "productionUnitName",
"readonly": 'productionUnitName',
"width": 60
"width": 88
},
{
title: "操作",
......@@ -262,7 +272,7 @@ const one = {
"storeId": {
"value": null,
"type": "select",
"title": "仓库",
"title": "入库仓库",
"name": [
"storeId"
],
......@@ -315,7 +325,7 @@ const one = {
type: "table",
col: { span: 24 },
name: ["materialList"],
required: true,
required: false,
linkconfig: {
urlchangeval: {//根据url接口 改变某个value
database: (params) => doFetch({ url: "/ngic-workmanship/pmMaterie/queryUnitByMaterieId", params }),
......@@ -366,11 +376,11 @@ const one = {
valueType: "digit"
},
{
"title": "单位",
"title": "库存单位",
"dataIndex": "productionUnitName",
"key": "productionUnitName",
"readonly": 'productionUnitName',
"width": 60
"width": 88
},
{
title: "操作",
......@@ -400,7 +410,7 @@ const one = {
"storeId": {
"value": null,
"type": "select",
"title": "仓库",
"title": "入库仓库",
"name": [
"storeId"
],
......@@ -437,7 +447,7 @@ const one = {
type: "table",
col: { span: 24 },
name: ["materialList"],
required: true,
required: false,
linkconfig: {
urlchangeval: {//根据url接口 改变某个value
database: (params) => doFetch({ url: "/ngic-workmanship/pmMaterie/queryUnitByMaterieId", params }),
......@@ -509,11 +519,11 @@ const one = {
valueType: "digit"
},
{
"title": "单位",
"title": "库存单位",
"dataIndex": "productionUnitName",
"key": "productionUnitName",
"readonly": 'productionUnitName',
"width": 60
"width": 88
},
{
title: "操作",
......@@ -543,7 +553,7 @@ const one = {
"storeId": {
"value": null,
"type": "select",
"title": "仓库",
"title": "入库仓库",
"name": [
"storeId"
],
......@@ -580,7 +590,7 @@ const one = {
type: "table",
col: { span: 24 },
name: ["materialList"],
required: true,
required: false,
linkconfig: {
urlchangeval: {//根据url接口 改变某个value
database: (params) => doFetch({ url: "/ngic-workmanship/pmMaterie/queryUnitByMaterieId", params }),
......@@ -652,11 +662,11 @@ const one = {
valueType: "digit"
},
{
"title": "单位",
"title": "库存单位",
"dataIndex": "productionUnitName",
"key": "productionUnitName",
"readonly": 'productionUnitName',
"width": 60
"width": 88
},
{
title: "操作",
......@@ -767,7 +777,7 @@ const one = {
search: false,
},
{
title: "单位",
title: "库存单位",
dataIndex: "productionUnitName",
key: "productionUnitName",
search: false,
......@@ -783,12 +793,22 @@ const one = {
dataIndex: "storePositionName",
key: "storePositionName",
search: false,
"formItemProps": () => {
return {
rules: [{ required: true, message: '此项为必填项' }],
};
},
},
{
title: "上架数量",
dataIndex: "instroeNum",
key: "instroeNum",
search: false
search: false,
"formItemProps": () => {
return {
rules: [{ required: true, message: '此项为必填项' }],
};
},
}
]}
dataSource={record.uploadList}
......@@ -853,7 +873,7 @@ const one = {
search: false,
},
{
title: "单位",
title: "库存单位",
dataIndex: "productionUnitName",
key: "productionUnitName",
search: false,
......@@ -869,12 +889,22 @@ const one = {
dataIndex: "storePositionName",
key: "storePositionName",
search: false,
"formItemProps": () => {
return {
rules: [{ required: true, message: '此项为必填项' }],
};
},
},
{
title: "上架数量",
dataIndex: "instroeNum",
key: "instroeNum",
search: false
search: false,
"formItemProps": () => {
return {
rules: [{ required: true, message: '此项为必填项' }],
};
},
}
,
{
......@@ -995,7 +1025,7 @@ const one = {
search: false,
},
{
title: "单位",
title: "库存单位",
dataIndex: "productionUnitName",
key: "productionUnitName",
search: false,
......
......@@ -51,7 +51,12 @@ const keytoval = {
</a>
),
},
]
],itemz = {
one:"采购入库",
two:"生产入库",
three:"退料入库",
four:"其他入库"
}
function Instore(props) {
const { initialState, setInitialState } = useModel("@@initialState");
......@@ -365,7 +370,7 @@ function Instore(props) {
setdrawprops(s => ({
...s,
visible: true,
title: "新增",
title: "新增"+itemz[e.key],
fields: defaultFields[e.key],
instoreType: keytoval[e.key],
val: "add", //类型
......
......@@ -71,7 +71,12 @@ const EditUpload = ({ record, fid, storeId }) => {
editable: (text, record, index) => {
return !record.materieOutstoreDetailId
},
params:{storeId: storeId}
params:{storeId: storeId},
"formItemProps": () => {
return {
rules: [{ required: true, message: '此项为必填项' }],
};
},
},
{
title: "批次号/SN号",
......@@ -162,12 +167,12 @@ const one = {
"materieOutstoreNo"
],
"required": false,
placeholder: "不填写系统自动生成"
"placeholder": "不填写系统自动生成"
},
"storeId": {
"value": null,
"type": "select",
"title": "仓库",
"title": "出库仓库",
"name": [
"storeId"
],
......@@ -176,7 +181,7 @@ const one = {
database: () => doFetch({ url: "/ngic-auth/sysStore/selectionBox", params: { factoryIdList: [] } }),
params: {}
},
linked:true
"linked":true
},
"businessNo": {
"value": null,
......@@ -205,7 +210,7 @@ const one = {
type: "table",
col: { span: 24 },
name: ["materialList"],
required: true,
required: false,
linkconfig: {
urlchangeval: {//根据url接口 改变某个value
database: (params) => doFetch({ url: "/ngic-workmanship/wmsMaterieStockStore/queryStoreOne", params }),
......@@ -258,7 +263,7 @@ const one = {
"readonly": 'usableNum'
},
{
"title": "单位",
"title": "库存单位",
"dataIndex": "productionUnitName",
"key": "productionUnitName",
"readonly": 'productionUnitName'
......@@ -291,7 +296,7 @@ const one = {
"storeId": {
"value": null,
"type": "select",
"title": "仓库",
"title": "出库仓库",
"name": [
"storeId"
],
......@@ -328,7 +333,7 @@ const one = {
type: "table",
col: { span: 24 },
name: ["materialList"],
required: true,
required: false,
linkconfig: {
urlchangeval: {//根据url接口 改变某个value
database: (params) => doFetch({ url: "/ngic-workmanship/wmsMaterieStockStore/queryStoreOne", params }),
......@@ -379,7 +384,7 @@ const one = {
"readonly": 'usableNum'
},
{
"title": "单位",
"title": "库存单位",
"dataIndex": "productionUnitName",
"key": "productionUnitName",
"readonly": 'productionUnitName'
......@@ -412,7 +417,7 @@ const one = {
"storeId": {
"value": null,
"type": "select",
"title": "仓库",
"title": "出库仓库",
"name": [
"storeId"
],
......@@ -449,7 +454,7 @@ const one = {
type: "table",
col: { span: 24 },
name: ["materialList"],
required: true,
required: false,
linkconfig: {
urlchangeval: {//根据url接口 改变某个value
database: (params) => doFetch({ url: "/ngic-workmanship/wmsMaterieStockStore/queryStoreOne", params }),
......@@ -500,7 +505,7 @@ const one = {
"readonly": 'usableNum'
},
{
"title": "单位",
"title": "库存单位",
"dataIndex": "productionUnitName",
"key": "productionUnitName",
"readonly": 'productionUnitName'
......@@ -533,7 +538,7 @@ const one = {
"storeId": {
"value": null,
"type": "select",
"title": "仓库",
"title": "出库仓库",
"name": [
"storeId"
],
......@@ -570,7 +575,7 @@ const one = {
type: "table",
col: { span: 24 },
name: ["materialList"],
required: true,
required: false,
linkconfig: {
urlchangeval: {//根据url接口 改变某个value
database: (params) => doFetch({ url: "/ngic-workmanship/wmsMaterieStockStore/queryStoreOne", params }),
......@@ -621,7 +626,7 @@ const one = {
"readonly": 'usableNum'
},
{
"title": "单位",
"title": "库存单位",
"dataIndex": "productionUnitName",
"key": "productionUnitName",
"readonly": 'productionUnitName'
......@@ -715,7 +720,7 @@ const one = {
search: false,
},
{
title: "单位",
title: "库存单位",
dataIndex: "productionUnitName",
key: "productionUnitName",
search: false,
......@@ -736,6 +741,11 @@ const one = {
dataIndex: "storePositionName",
key: "storePositionName",
search: false,
"formItemProps": () => {
return {
rules: [{ required: true, message: '此项为必填项' }],
};
},
},
{
title: "批次号/SN号",
......@@ -805,7 +815,7 @@ const one = {
search: false,
},
{
title: "单位",
title: "库存单位",
dataIndex: "productionUnitName",
key: "productionUnitName",
search: false,
......@@ -821,6 +831,11 @@ const one = {
dataIndex: "storePositionName",
key: "storePositionName",
search: false,
"formItemProps": () => {
return {
rules: [{ required: true, message: '此项为必填项' }],
};
},
},
{
title: "批次号/SN号",
......@@ -942,7 +957,7 @@ const one = {
search: false,
},
{
title: "单位",
title: "库存单位",
dataIndex: "productionUnitName",
key: "productionUnitName",
search: false,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -243,12 +243,7 @@ const StoreApp = (props) => {
actionRef={actionRef}
onRef={(node) => (ChildRef = node)}
extraparams={{ storeId: props?.curitem?.id ?? "0" }}
rowSelection={{
onChange: (selectedRowKeys, selectedRows) => {
setselectedRowKeys(selectedRows)
},
}}
></AutoTable>
<DrawInitForm
visible={false}
......
......@@ -191,7 +191,13 @@ export async function factory(params) {
}
//
// 4 :
//集团下拉框
export async function zuzhi(params) {
return request(`/wms/ngic-auth/sysDepartment/query/tree`, {
method: 'POST',
data: params,
});
}
//集团下拉框
export async function depart(params) {
return request(`/wms/ngic-auth/sysDepartment/query/selectbox/depart`, {
......
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