Commit 8fed24cd authored by wuhao's avatar wuhao 🎯

asder

parent c65efff5
......@@ -11,7 +11,7 @@ export default {
// localhost:8000/api/** -> https://preview.pro.ant.design/api/**
"/wms/": {
// 要代理的地址
target: "http://192.168.40.102:28040/", //39:18040 23/wms/ //60 翔 //18
target: "http://192.168.40.114:28040/", //39:18040 23/wms/ //60 翔 //18
changeOrigin: true,
pathRewrite: {
"^/wms": "",
......
......@@ -68,12 +68,12 @@ const EditTable = ({
//参数获取
let parames = {};
let ifs = false;
let ifs = true;
Object.keys(params).map(it => {
if (params[it] == "linked") {
parames[it] = record[it]
if (record[it] == curvaluerow[it]) {
ifs = true;
if (record[it] != curvaluerow[it]) {
ifs = false;
}
} else {
parames[it] = params[it]
......@@ -89,7 +89,8 @@ const EditTable = ({
newvalue = newvalue.map((it, i) => {
if (it[rowKey] == record[rowKey]) {
Object.keys(effectresult).map(items => {
it[items] = res?.data?.data[effectresult[items]];
let result = res?.data?.data ?? {}
it[items] = result[effectresult[items]];
})
}
editorFormRef.current?.setRowData?.(i, it)
......
......@@ -5,10 +5,14 @@ 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 EditUpload = ({ record, fid ,storeId}) => {
const [value, setvalue] = useState({
[record.id]: record.uploadList
});
const { initialState, setInitialState } = useModel("@@initialState");
console.log('====================================');
console.log(storeId);
console.log('====================================');
useEffect(() => {
if (!value) {
return
......@@ -40,12 +44,12 @@ const EditUpload = ({ record, fid }) => {
columns={[
{
title: "库位名称",
dataIndex: "storeName",
dataIndex: "storePositionName",
key: "storePositionId",
search: false,
valueType: "select",
request: async () => {
let res = await doFetch({ url: "/ngic-auth/sysStorePosition/queryByStoreId/selection", params: { storeId: record.storeId } });
let res = await doFetch({ url: "/ngic-auth/sysStorePosition/queryByStoreId/selection", params: { storeId: storeId } });
return res?.data?.dataList
},
editable: (text, record, index) => {
......@@ -81,7 +85,7 @@ const EditUpload = ({ record, fid }) => {
],
}
]}
value={[...(record.downloadList ?? []), ...(value[record.id] ?? [])]}
value={value[record.id]}
recordCreatorProps={{
newRecordType: "dataSource",
record: () => ({
......@@ -733,8 +737,8 @@ const one = {
columns={[
{
title: "库位名称",
dataIndex: "storeName",
key: "storeName",
dataIndex: "storePositionName",
key: "storePositionName",
search: false,
},
{
......@@ -744,7 +748,7 @@ const one = {
search: false,
}
]}
dataSource={record.downloadList}
dataSource={record.uploadList}
pagination={false}
/>,
},
......@@ -767,7 +771,7 @@ const one = {
},
{
cardTitle: "上架明细",
noPrint:true,
noPrint: true,
itemData: [
{
key: "materialUploadList",
......@@ -818,8 +822,8 @@ const one = {
columns={[
{
title: "库位名称",
dataIndex: "storeName",
key: "storeName",
dataIndex: "storePositionName",
key: "storePositionName",
search: false,
},
{
......@@ -850,7 +854,7 @@ const one = {
search: false,
}
]}
dataSource={record.downloadList}
dataSource={record.uploadList}
pagination={false}
/>,
},
......@@ -859,7 +863,7 @@ const one = {
],
},
]
}, doinsert = (fid) => ({
}, doinsert = (fid,storeId) => ({
totalCard: [
//物料详情
{
......@@ -944,7 +948,7 @@ const one = {
},
],
expandable: {
expandedRowRender: record => <EditUpload record={record} fid={fid} />,
expandedRowRender: record => <EditUpload record={record} fid={fid} storeId={storeId}/>,
}
},
],
......
......@@ -211,7 +211,7 @@ function Instore(props) {
"render": (text, record, _, action) => {
return [
getPrem("equipmentCustomer_save", action, '上架采集', async () => {
let extra = defaultFields.doinsert(record.id);
let extra = defaultFields.doinsert(record.id,record.storeId);
setdrawprops(s => ({
...s,
visible: true,
......
......@@ -5,10 +5,14 @@ import EditTable from "@/components/EditTable";
import { useEffect, useState } from 'react'
import { useModel } from 'umi'
const EditUpload = ({ record, fid }) => {
const [value, setvalue] = useState({});
const EditUpload = ({ record, fid, storeId }) => {
const [value, setvalue] = useState({
[record.id]: record.downloadList
});
const { initialState, setInitialState } = useModel("@@initialState");
console.log('====================================');
console.log(storeId);
console.log('====================================');
useEffect(() => {
if (!value) {
return
......@@ -40,10 +44,11 @@ const EditUpload = ({ record, fid }) => {
linkconfig={{
urlchangeval: {
database: (params) => doFetch({ url: "/ngic-workmanship/wmsMaterieStore/queryStoreOne", params }),
params: { "materieId": "linked" },
params: { "storePositionId": "linked", "materieControlNo": "linked" },
effectresult: {
"productionUnit": "productionUnit",
"productionUnitName": "productionUnitName"
"supplierNo": "supplierNo",
"supplierName": "supplierName",
"productionNum": "productionNum",
}
}
}}
......@@ -51,12 +56,12 @@ const EditUpload = ({ record, fid }) => {
columns={[
{
title: "库位名称",
dataIndex: "storeName",
dataIndex: "storePositionName",
key: "storePositionId",
search: false,
valueType: "select",
request: async () => {
let res = await doFetch({ url: "/ngic-auth/sysStorePosition/queryByStoreId/selection", params: { storeId: record.storeId } });
let res = await doFetch({ url: "/ngic-auth/sysStorePosition/queryByStoreId/selection", params: { storeId: storeId } });
return res?.data?.dataList
},
editable: (text, record, index) => {
......@@ -86,7 +91,10 @@ const EditUpload = ({ record, fid }) => {
dataIndex: "supplierNo",
key: "supplierNo",
search: false,
"readonly": true,
readonly: true,
render: (dom, row) => {
return (row?.supplierNo ?? '') + " - " + (row?.supplierName ?? '')
}
},
{
title: "库存数量",
......@@ -115,7 +123,7 @@ const EditUpload = ({ record, fid }) => {
],
}
]}
value={[...(record.downloadList ?? []), ...(value[record.id] ?? [])]}
value={value[record.id]}
onChange={(vals) => {
setvalue(s => ({
...s,
......@@ -682,8 +690,8 @@ const one = {
columns={[
{
title: "库位名称",
dataIndex: "storeName",
key: "storeName",
dataIndex: "storePositionName",
key: "storePositionName",
search: false,
},
{
......@@ -716,9 +724,115 @@ const one = {
},
],
},
{
cardTitle: "强制关闭信息",
itemData: [
{
title: "操作人",
key: "closeUserName",
},
{
title: "操作时间",
key: "closeTime",
}
],
},
{
cardTitle: "下架明细",
noPrint: true,
itemData: [
{
key: "materialDownloadList",
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: {
defaultExpandAllRows: true,
expandedRowRender: record => <Table
style={{ marginLeft: 48 }}
columns={[
{
title: "库位名称",
dataIndex: "storePositionName",
key: "storePositionName",
search: false,
},
{
title: "批次号/SN号",
dataIndex: "materieControlNo",
key: "materieControlNo",
search: false,
},
{
title: "供应商编号 - 名称",
dataIndex: "supplierNo",
key: "supplierNo",
search: false,
render: (dom, row) => {
return (row.supplierNo ?? '') + " - " + (row.supplierName ?? '')
}
},
{
title: "下架数量",
dataIndex: "outstroeNum",
key: "outstroeNum",
search: false,
}
,
{
title: "备注",
dataIndex: "remark",
key: "remark",
search: false,
}
,
{
title: "操作人",
dataIndex: "uploadUserName",
key: "uploadUserName",
search: false,
}
,
{
title: "操作时间",
dataIndex: "uploadTime",
key: "uploadTime",
search: false,
}
]}
dataSource={record.downloadList}
pagination={false}
/>,
},
pagination: "false"
},
],
},
]
},
dooutside = (fid) => ({
dooutside = (fid, storeId) => ({
totalCard: [
//物料详情
{
......@@ -788,7 +902,7 @@ const one = {
},
],
expandable: {
expandedRowRender: record => <EditUpload record={record} fid={fid} />,
expandedRowRender: record => <EditUpload record={record} fid={fid} storeId={storeId} />,
}
},
],
......
......@@ -10,6 +10,7 @@ import defaultFields from "./fields";
import { doFetch } from "@/utils/doFetch";
import DrawInitForm from "@/components/DrawInitForm";
import getPrem from '@/utils/getPrem';//权限判断fn
import { useReactToPrint } from 'react-to-print';
const keytoval = {
......@@ -67,7 +68,8 @@ function Instore(props) {
width:1200
}),
actionRef = useRef(),
ChildRef = null;
ChildRef = null,
printRef = useRef();
//操作完成后刷新
function reload() {
......@@ -80,6 +82,11 @@ function Instore(props) {
}))
}
const handlePrint = useReactToPrint({
content: () => printRef.current,
});
const columns = useMemo(() => {
if (activeTabKey == "1") {
return [
......@@ -98,7 +105,15 @@ function Instore(props) {
title: `查看详情`,
...defaultFields?.detail,
totalPath: "/ngic-workmanship/wmsMaterieOutstore/getOutStoreInfoById",
totalParams: { id: record.id }
totalParams: { id: record.id },
printRef: printRef,
extra: (<Button
onClick={async () => {
handlePrint()
}}
>
打印
</Button>)
}))
}}
>{dom}</a>
......@@ -198,7 +213,7 @@ function Instore(props) {
return [
getPrem("equipmentCustomer_save", action, '下架采集', async () => {
let extra = defaultFields.dooutside(record.id);
let extra = defaultFields.dooutside(record.id,record.storeId);
setdrawprops(s => ({
...s,
visible: true,
......
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