Commit 0103c46e authored by wuhao's avatar wuhao 🎯

asder

parent 0ece29b2
...@@ -5,7 +5,7 @@ import { EditableProTable } from "@ant-design/pro-table"; ...@@ -5,7 +5,7 @@ import { EditableProTable } from "@ant-design/pro-table";
import { useEffect, useState } from 'react' import { useEffect, useState } from 'react'
import { useModel } from 'umi' import { useModel } from 'umi'
const EditUpload = ({ record }) => { const EditUpload = ({ record, fid }) => {
const [value, setvalue] = useState({}); const [value, setvalue] = useState({});
const { initialState, setInitialState } = useModel("@@initialState"); const { initialState, setInitialState } = useModel("@@initialState");
...@@ -16,7 +16,7 @@ const EditUpload = ({ record }) => { ...@@ -16,7 +16,7 @@ const EditUpload = ({ record }) => {
setInitialState(s => ({ setInitialState(s => ({
...s, ...s,
submit: { submit: {
id: record.id, id: fid,
materialList: Object.keys(value)?.map?.(it => { materialList: Object.keys(value)?.map?.(it => {
let id = it; let id = it;
return { return {
...@@ -81,7 +81,7 @@ const EditUpload = ({ record }) => { ...@@ -81,7 +81,7 @@ const EditUpload = ({ record }) => {
], ],
} }
]} ]}
value={[...(record.downloadList ?? []), ...(value[record.materieInstoreId] ?? [])]} value={[...(record.downloadList ?? []), ...(value[record.id] ?? [])]}
recordCreatorProps={{ recordCreatorProps={{
newRecordType: "dataSource", newRecordType: "dataSource",
record: () => ({ record: () => ({
...@@ -96,7 +96,7 @@ const EditUpload = ({ record }) => { ...@@ -96,7 +96,7 @@ const EditUpload = ({ record }) => {
onValuesChange: async (records, recordList) => { onValuesChange: async (records, recordList) => {
setvalue(s => ({ setvalue(s => ({
...s, ...s,
[record.materieInstoreId]: recordList [record.id]: recordList
})); }));
}, },
}} }}
...@@ -751,7 +751,7 @@ const one = { ...@@ -751,7 +751,7 @@ const one = {
], ],
}, },
] ]
}, doinsert = { }, doinsert = (fid) => ({
totalCard: [ totalCard: [
//物料详情 //物料详情
{ {
...@@ -836,13 +836,13 @@ const one = { ...@@ -836,13 +836,13 @@ const one = {
}, },
], ],
expandable: { expandable: {
expandedRowRender: record => <EditUpload record={record} />, expandedRowRender: record => <EditUpload record={record} fid={fid} />,
} }
}, },
], ],
}, },
] ]
}; });
......
...@@ -197,7 +197,7 @@ function Instore(props) { ...@@ -197,7 +197,7 @@ function Instore(props) {
"render": (text, record, _, action) => { "render": (text, record, _, action) => {
return [ return [
getPrem("equipmentCustomer_save", action, '上架采集', async () => { getPrem("equipmentCustomer_save", action, '上架采集', async () => {
let extra = defaultFields.doinsert; let extra = defaultFields.doinsert(record.id);
setdrawprops(s => ({ setdrawprops(s => ({
...s, ...s,
visible: true, visible: true,
...@@ -208,7 +208,6 @@ function Instore(props) { ...@@ -208,7 +208,6 @@ function Instore(props) {
totalPath: "/ngic-workmanship/wmsMaterieInstore/getInStoreInfoById", totalPath: "/ngic-workmanship/wmsMaterieInstore/getInStoreInfoById",
totalParams: { id: record.id } totalParams: { id: record.id }
})) }))
}), }),
getPrem("equipmentCustomer_deleteById", action, '关单', null, { getPrem("equipmentCustomer_deleteById", action, '关单', null, {
title: "确认关单?", title: "确认关单?",
......
import { factorySelect, shopSelectByFactory } from "@/services/system"; import { factorySelect, shopSelectByFactory } from "@/services/system";
import { doFetch } from "@/utils/doFetch"; import { doFetch } from "@/utils/doFetch";
import { Table } from "antd"; import { Button, Table } from "antd";
import { EditableProTable } from "@ant-design/pro-table";
import { useEffect, useState } from 'react'
import { useModel } from 'umi'
const EditUpload = ({ record, fid }) => {
const [value, setvalue] = useState({});
const { initialState, setInitialState } = useModel("@@initialState");
useEffect(() => {
if (!value) {
return
}
setInitialState(s => ({
...s,
submits: {
id: fid,
materialList: Object.keys(value)?.map?.(it => {
let id = it;
return {
id,
uploadList: value[id]?.map(its => {
return {
storeId: its?.storeId,
outstroeNum: its?.outstroeNum,
remark: its?.remark,
materieControlNo:its?.materieControlNo
}
})
}
})
}
}))
}, [value])
return <EditableProTable
maxLength={1000}
style={{ marginLeft: 48 }}
columns={[
{
title: "库位名称",
dataIndex: "storeName",
key: "storeId",
search: false,
valueType: "select",
request: async () => {
let res = await doFetch({ url: "/ngic-auth/sysStore/selectionBox", params: { factoryIdList: [] } });
return res?.data?.dataList
},
editable: (text, record, index) => {
return !record.materieOutstoreDetailId
}
},
{
title: "批次号/SN号",
dataIndex: "materieControlNo",
key: "materieControlNo",
search: false,
editable: (text, record, index) => {
return !record.materieOutstoreDetailId
}
},
{
title: "下架数量",
dataIndex: "outstroeNum",
key: "outstroeNum",
search: false,
editable: (text, record, index) => {
return !record.materieOutstoreDetailId
}
},
{
title: "备注",
dataIndex: "remark",
key: "remark",
search: false,
editable: (text, record, index) => {
return !record.materieOutstoreDetailId
}
},
{
title: "操作",
valueType: "option",
width: 70,
render: (text, record, _, action) => [
<a key="delete" onClick={() => { }}>
删除
</a>,
],
}
]}
value={[...(record.downloadList ?? []), ...(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 => ({
...s,
[record.id]: recordList
}));
},
}}
pagination={false}
/>
}
const one = { const one = {
"materieOutstoreNo": { "materieOutstoreNo": {
...@@ -61,7 +172,7 @@ const one = { ...@@ -61,7 +172,7 @@ const one = {
effectresult: { effectresult: {
"productionUnit": "productionUnit",//key 为列表更新值 value为response 返回值 "productionUnit": "productionUnit",//key 为列表更新值 value为response 返回值
"productionUnitName": "productionUnitName", "productionUnitName": "productionUnitName",
"usableNum":"usableNum" "usableNum": "usableNum"
} }
} }
}, },
...@@ -182,7 +293,7 @@ const one = { ...@@ -182,7 +293,7 @@ const one = {
effectresult: { effectresult: {
"productionUnit": "productionUnit",//key 为列表更新值 value为response 返回值 "productionUnit": "productionUnit",//key 为列表更新值 value为response 返回值
"productionUnitName": "productionUnitName", "productionUnitName": "productionUnitName",
"usableNum":"usableNum" "usableNum": "usableNum"
} }
} }
}, },
...@@ -303,7 +414,7 @@ const one = { ...@@ -303,7 +414,7 @@ const one = {
effectresult: { effectresult: {
"productionUnit": "productionUnit",//key 为列表更新值 value为response 返回值 "productionUnit": "productionUnit",//key 为列表更新值 value为response 返回值
"productionUnitName": "productionUnitName", "productionUnitName": "productionUnitName",
"usableNum":"usableNum" "usableNum": "usableNum"
} }
} }
}, },
...@@ -424,7 +535,7 @@ const one = { ...@@ -424,7 +535,7 @@ const one = {
effectresult: { effectresult: {
"productionUnit": "productionUnit",//key 为列表更新值 value为response 返回值 "productionUnit": "productionUnit",//key 为列表更新值 value为response 返回值
"productionUnitName": "productionUnitName", "productionUnitName": "productionUnitName",
"usableNum":"usableNum" "usableNum": "usableNum"
} }
} }
}, },
...@@ -532,21 +643,18 @@ const one = { ...@@ -532,21 +643,18 @@ const one = {
col: { span: 24 }, col: { span: 24 },
columns: [ columns: [
{ {
title: "物料名称", title: "物料编码 - 名称",
dataIndex: "materieName", dataIndex: "materieName",
key: "materieName", key: "materieName",
search: false, search: false,
}, render: (dom, row) => {
{ return (row.materieCode ?? '') + " - " + (row.materieName ?? '')
title: "物料编码", }
dataIndex: "materieCode",
key: "materieCode",
search: false,
}, },
{ {
title: "出库数量", title: "出库数量",
dataIndex: "instroeNum", dataIndex: "outstroeNum",
key: "instroeNum", key: "outstroeNum",
search: false, search: false,
}, },
{ {
...@@ -567,9 +675,9 @@ const one = { ...@@ -567,9 +675,9 @@ const one = {
search: false, search: false,
}, },
{ {
title: "架数量", title: "架数量",
dataIndex: "instroeNum", dataIndex: "outstroeNum",
key: "instroeNum", key: "outstroeNum",
search: false, search: false,
} }
]} ]}
...@@ -581,7 +689,84 @@ const one = { ...@@ -581,7 +689,84 @@ const one = {
], ],
}, },
] ]
}; },
dooutside = (fid) => ({
totalCard: [
//物料详情
{
cardTitle: "基本信息",
itemData: [
{
title: "出库单号",
key: "materieOutstoreNo",
},
{
title: "出库类型",
key: "outstoreTypeName",
},
{
title: "出库仓库",
key: "storeName",
},
{
title: "相关单号",
key: "businessNo",
},
{
title: "备注",
key: "remark",
},
{
title: "创建人",
key: "createUserName",
},
{
title: "创建时间",
key: "createTime",
},
],
},
{
cardTitle: "物料信息列表",
extra: true,
extrapath: "/ngic-workmanship/wmsMaterieOutstore/download",
extrakey: "submits",//redux key
itemData: [
{
key: "materialList",
type: "table",
col: { span: 24 },
columns: [
{
title: "物料编码 - 名称",
dataIndex: "materieName",
key: "materieName",
search: false,
render: (dom, row) => {
return (row.materieCode ?? '') + " - " + (row.materieName ?? '')
}
},
{
title: "出库数量",
dataIndex: "outstroeNum",
key: "outstroeNum",
search: false,
},
{
title: "单位",
dataIndex: "productionUnitName",
key: "productionUnitName",
search: false,
},
],
expandable: {
expandedRowRender: record => <EditUpload record={record} fid={fid} />,
}
},
],
},
]
});
...@@ -591,5 +776,6 @@ export default { ...@@ -591,5 +776,6 @@ export default {
two, two,
three, three,
four, four,
detail detail,
dooutside
}; };
...@@ -196,9 +196,19 @@ function Instore(props) { ...@@ -196,9 +196,19 @@ function Instore(props) {
"width": 240, "width": 240,
"render": (text, record, _, action) => { "render": (text, record, _, action) => {
return [ return [
getPrem("equipmentCustomer_save", action, '上架采集', async () => { getPrem("equipmentCustomer_save", action, '下架采集', async () => {
let extra = defaultFields.dooutside(record.id);
setdrawprops(s => ({
...s,
visible: true,
//查看详情 props
val: "detail",
title: `下架采集`,
...extra,
totalPath: "/ngic-workmanship/wmsMaterieOutstore/getOutStoreInfoById",
totalParams: { id: record.id }
}))
}), }),
getPrem("equipmentCustomer_deleteById", action, '关单', null, { getPrem("equipmentCustomer_deleteById", action, '关单', null, {
......
...@@ -52,16 +52,12 @@ const addFields = { ...@@ -52,16 +52,12 @@ const addFields = {
"value": 2 "value": 2
}, },
{ {
"label": "组织", "label": "仓库",
"value": 3 "value": 3
}, },
{ {
"label": "工厂", "label": "工厂",
"value": 4 "value": 4
},
{
"label": "车间",
"value":5
} }
] ]
}, },
......
...@@ -237,16 +237,12 @@ const Pushdeploy = (props) => { ...@@ -237,16 +237,12 @@ const Pushdeploy = (props) => {
"value": 2 "value": 2
}, },
{ {
"label": "组织", "label": "仓库",
"value": 3 "value": 3
}, },
{ {
"label": "工厂", "label": "工厂",
"value": 4 "value": 4
},
{
"label": "车间",
"value": 5
} }
] ]
}, },
......
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