import { doFetch } from "@/utils/doFetch"; export function getColumns(setDrawer, formRef) { return [ { title: "物料(名称+编码)", key: "materieId", dataIndex: "materieId", valueType: "select", formItemProps: { rules: [{ required: true, message: "此项为必填项" }] }, options: { path: "/ngic-workmanship/pmMaterie/query/selectbox", }, fieldProps: { onChange: (value, options) => { if (value) { doFetch({ url: "/ngic-workmanship/pmMaterie/queryById", params: { id: value }, }).then((res) => { console.log(res); const data = res?.data?.data; formRef.current.setFieldValue( "specificationModel", data?.specificationModel ?? "" ); formRef.current.setFieldValue("shopSign", data?.shopSign ?? ""); formRef.current.setFieldValue("ironLoss", data?.ironLoss ?? ""); formRef.current.setFieldValue( "sheetThickness", data?.sheetThickness ?? "" ); }); } else { formRef?.current?.resetFields(); } }, }, }, { title: "规格型号", key: "specificationModel", dataIndex: "specificationModel", fieldProps: { disabled: true, }, }, { title: "牌号", key: "shopSign", dataIndex: "shopSign", fieldProps: { disabled: true, }, }, { title: "铁损", key: "ironLoss", dataIndex: "ironLoss", fieldProps: { disabled: true, }, }, { title: "片厚", key: "sheetThickness", dataIndex: "sheetThickness", fieldProps: { disabled: true, }, }, { title: "手动录入", key: "split", dataIndex: "split", valueType: "split", }, { title: "供应商", key: "supplierId", dataIndex: "supplierId", valueType: "select", options: { path: "/ngic-auth/sysSupplier/query/selection", params:{} }, }, { title: "单边厚度", key: "unilateralThickness", dataIndex: "unilateralThickness", valueType:'digit' }, { title: "备注", key: "remark", dataIndex: "remark", valueType: "textarea", }, { title: "列表", valueType: "formList", dataIndex: "list", initialValue: [ { state: "all", title: "标题", }, ], colProps: { xs: 24, sm: 24, }, columns: [ { title: "重量", dataIndex: "weight", key: "weight", valueType: "digit", colProps: { sm: 6, }, fieldProps: { precision: 3, max: 999999, }, formItemProps: { rules: [ { required: true, message: "此项为必填项", }, ], }, }, { title: "宽度", dataIndex: "width", key: "width", valueType: "digit", fieldProps: { mode: "multiple", precision: 3, max: 999999, }, colProps: { sm: 6, }, }, { title: "米数", dataIndex: "length", key: "length", valueType: "digit", fieldProps: { precision: 3, max: 999999, }, colProps: { sm: 6, }, }, { title: "批次号", dataIndex: "materieControlNo", key: "materieControlNo", valueType: "input", formItemProps: { rules: [ { required: false, message: "此项为必填项", }, ], }, colProps: { sm: 6, }, }, ], search: false, }, ]; }