Commit 73b4032d authored by krysent's avatar krysent

new

parent 2616c243
......@@ -39,6 +39,53 @@ function Instore(props) {
dataIndex: "materieControlNo",
key: "materieControlNo",
},
{
title: "规格型号",
dataIndex: "specificationModel",
key: "specificationModel",
search: false,
},
{
title: "铁损",
dataIndex: "ironLoss",
key: "ironLoss",
readonly: "ironLoss",
search: false,
},
{
title: "片厚",
dataIndex: "sheetThickness",
key: "sheetThickness",
readonly: "sheetThickness",
search: false,
},
{
title: "宽度",
dataIndex: "width",
key: "width",
readonly: "width",
search: false,
},
{
title: "单边厚度",
key: "unilateralThickness",
dataIndex: "unilateralThickness",
search: false,
},
{
title: "米数",
dataIndex: "length",
key: "length",
search: false,
},
{
title: "牌号",
dataIndex: "shopSign",
key: "shopSign",
readonly: "shopSign",
search: false,
},
{
title: "当时库存数量",
dataIndex: "currentNum",
......@@ -77,6 +124,7 @@ function Instore(props) {
dataIndex: "stockDetailTypeName",
key: "stockDetailTypeName",
width: 280,
search: false,
},
{
title: "相关单号",
......
......@@ -9,7 +9,7 @@ import { useReactToPrint } from "react-to-print";
import { useModel } from "umi";
import PrintDom from "./printdom";
import { PrintQrCode } from "@/components/PrintCode";
import { EditableProTable } from "@ant-design/pro-table";
const keytoval = {
one: 1,
two: 2,
......@@ -40,6 +40,147 @@ const keytoval = {
three: "退料入库",
four: "其他入库",
};
const EditUpload = ({ record, fid, storeId }) => {
const [value, setvalue] = useState({
[record.id]: record.uploadList,
});
const { initialState, setInitialState } = useModel("@@initialState");
useEffect(() => {
if (!value) {
return;
}
let newlist =
Object.keys(value)?.map?.((it) => {
let id = it;
let newArr = value[id]?.filter((it) => typeof it.id == "number") ?? [];
return {
id,
uploadList: newArr.map((its) => {
return {
storePositionId: its?.storePositionId,
instroeNum: its?.instroeNum,
remark: its?.remark,
};
}),
};
}) ?? [];
setInitialState((s) => {
return {
...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)
: [],
},
};
});
}, [value]);
return (
<EditableProTable
rowKey={"id"}
maxLength={1000}
style={{ marginLeft: 48 }}
columns={[
{
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 },
});
return res?.data?.dataList;
},
editable: (text, record, index) => {
return !record.materieOutstoreDetailId;
},
params: { storeId: storeId },
formItemProps: () => {
return {
rules: [{ required: true, message: "此项为必填项" }],
};
},
},
{
title: (
<span>
上架数量 <b style={{ color: "red" }}>*</b>
</span>
),
dataIndex: "instroeNum",
key: "instroeNum",
search: false,
editable: (text, record, index) => {
return !record.materieOutstoreDetailId;
},
valueType: "digit",
formItemProps: () => {
return {
rules: [{ required: true, message: "此项为必填项" }],
};
},
},
{
title: "备注",
dataIndex: "remark",
key: "remark",
search: false,
editable: (text, record, index) => {
return !record.materieOutstoreDetailId;
},
},
{
title: "操作",
valueType: "option",
width: 70,
render: (text, record, _, action) => [
typeof record.id == "number" && (
<a key="delete" onClick={() => {}}>
删除
</a>
),
],
},
]}
value={value[record.id]}
recordCreatorProps={{
newRecordType: "dataSource",
record: () => ({
id: Date.now(),
}),
}}
editable={{
type: "multiple",
actionRender: (row, config, defaultDoms) => {
return [defaultDoms.delete];
},
onValuesChange: async (records, recordList) => {
setvalue((s) => {
return {
...s,
[record.id]: recordList,
};
});
},
}}
pagination={false}
/>
);
};
const defaultFields = {
four: {
......@@ -88,7 +229,7 @@ const defaultFields = {
//根据url接口 改变某个value
database: (params) =>
doFetch({
url: "/ngic-workmanship/wmsMaterieLabel/queryById",
url: "/ngic-workmanship/wmsMaterieLabel/queryByLabelId",
params,
}),
params: { labelId: "linked" },
......@@ -102,6 +243,7 @@ const defaultFields = {
sheetThickness: "sheetThickness",
shopSign: "shopSign",
weight: "weight",
specificationModel: "specificationModel",
},
},
},
......@@ -115,7 +257,7 @@ const defaultFields = {
dataIndex: "labelId",
key: "labelId",
valueType: "select",
width: 300,
width: 220,
request: async () => {
let res = await doFetch({
url: "/ngic-workmanship/wmsMaterieLabel/selectionByStatus",
......@@ -142,7 +284,6 @@ const defaultFields = {
dataIndex: "materieCode",
key: "materieCode",
valueType: "select",
width: 300,
readonly: true,
},
{
......@@ -1005,8 +1146,8 @@ function Instore(props) {
columns,
path:
activeTabKey == "1"
? "/ngic-workmanship/wmsMaterieInstore/queryList"
: "/ngic-workmanship/wmsMaterieInstoreHis/queryList",
? "/ngic-workmanship/wmsMaterieInstore/queryOtherList"
: "/ngic-workmanship/wmsMaterieInstoreHis/queryOtherList",
};
return (
......@@ -1028,9 +1169,20 @@ function Instore(props) {
{...drawprops}
submitData={async (value) => {
if (drawprops.val == "add") {
const data = JSON.parse(JSON.stringify(value));
const materialList = data?.materialList?.map((it) => {
return {
labelId: it?.labelId,
};
});
let res = await doFetch({
url: "/ngic-workmanship/wmsMaterieInstore/saveInStore",
params: { ...value },
url: "/ngic-workmanship/wmsMaterieInstore/saveOtherInstore",
params: {
materieInstoreNo: data.materieInstoreNo,
storeId: data.storeId,
remark: data.remark,
materialList: materialList,
},
});
if (res.code == "0000") {
reload();
......
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