Commit 91478e68 authored by wuhao's avatar wuhao 🎯

asder

parent 912bdf58
......@@ -172,7 +172,6 @@ export default [
name: "推送记录",
component: "./platform/Sendlist",
},
{
path: "/platform/norule",
name: "编号规则",
......
......@@ -137,7 +137,7 @@ export default (props) => {
<div style={{ display: "flex", width: "100%" }}>
{(props.childposition == "left" || !props.childposition) &&
props.children}
<div style={{ flex: 1, width: "100%" }}>
<div style={{ flex: 1, overflow:"hidden" }}>
{props.childposition == "top" && props.children}
<Mtable {...props} />
</div>
......
import React, {
PureComponent,
useEffect,
useRef,
useState,
useMemo,
} from "react";
import ProTable from "@ant-design/pro-table";
import request from "umi-request";
import React, { useEffect, useRef, useState, useMemo } from "react";
import { ProTable } from "@ant-design/pro-components";
import Resizecell from "./Resizecell";
import { Tooltip } from "antd";
import { doFetch } from "@/utils/doFetch";
import { useAsyncEffect } from "ahooks";
import bodyParse from "@/utils/bodyParse";
const Mtable = (props) => {
const {
......@@ -26,13 +20,14 @@ const Mtable = (props) => {
x, //横向滚动
activeTabKey, //激活的tabKey 拖拽表格唯一标识使用 其他情况用不到
refreshDep, //依赖刷新 (已废弃)
getDefaultSelected, //存在默认选中向上返回选中值
} = props;
const actionRefs = actionRef ?? useRef(),
formRefs = formRef ?? useRef(),
ifspagination = pagination == "false" || pagination === false,
[size, setsize] = useState("small"),
[valueColumns, setvalueColumns] = useState([]);
[valueColumns, setvalueColumns] = useState({});
const [columnes, setcolumnes] = useState(columns ?? []);
//调用接口
......@@ -59,11 +54,9 @@ const Mtable = (props) => {
data = result?.data?.dataList;
total = result?.data?.dataList?.length;
}
console.log(result, {
data,
success,
total,
});
//存在默认选中向上返回选中值
getDefaultSelected && getDefaultSelected(result?.data);
return {
data,
success,
......@@ -187,6 +180,9 @@ const Mtable = (props) => {
});
setvalueColumns(allcol);
}
actionRefs?.current?.reload();
actionRefs?.current?.reset();
};
//调用重新渲染表格
......@@ -214,12 +210,10 @@ const Mtable = (props) => {
(index) =>
(e, { size }) => {
e.stopImmediatePropagation();
setcolumnes((s) => {
const nextColumns = [...s];
nextColumns[index] = {
...nextColumns[index],
width: size.width,
};
let submitdata = {...valueColumns} ?? {},
curkey = Object.keys(submitdata)[index];
submitdata[curkey].width = parseInt(size.width);
setvalueColumns(submitdata);
doFetch({
url: "/ngic-base-business/paFieldScene/save",
params: {
......@@ -228,20 +222,18 @@ const Mtable = (props) => {
: activeTabKey
? path + activeTabKey
: path,
controList: Object.keys(nextColumns).map((it, i) => {
controList: Object.keys(submitdata).map((it, i) => {
return {
fieldKey: it,
fieldWidth:
i == index ? parseInt(size.width) : nextColumns[it].width,
fieldOrder: nextColumns[it].order,
fieldFixed: nextColumns[it].fixed,
fieldShow: nextColumns[it].show,
i == index ? parseInt(size.width) : submitdata[it].width,
fieldOrder: submitdata[it].order,
fieldFixed: submitdata[it].fixed,
fieldShow: submitdata[it].show,
};
}),
},
});
return nextColumns;
});
};
return (
......@@ -273,7 +265,7 @@ const Mtable = (props) => {
columnsState={{
value: valueColumns,
onChange: (val, state) => {
setcolumnes((s) => {
setvalueColumns((s) => {
let submitdata = {
...s,
...val,
......
......@@ -87,7 +87,7 @@ ol {
padding: 0 20px !important;
}
}
.ant-drawer-content{
.ant-drawer-content {
overflow-x: hidden !important;
}
......@@ -316,30 +316,30 @@ pre {
table {
min-width: calc(100% - 6px) !important;
}
.ant-drawer-open{
.ant-drawer-open {
transform: none !important;
}
.ant-pro-table-list-toolbar{
.ant-pro-table-list-toolbar {
overflow: hidden !important;
}
.ant-select-selector{
.ant-select-selector {
overflow: hidden !important;
}
.ant-breadcrumb{
span{
>span{
.ant-breadcrumb {
span {
> span {
max-width: 600px !important;
}
}
}
.ant-tree .ant-tree-treenode{
.ant-tree .ant-tree-treenode {
width: 100%;
>span:last-child{
flex:1
> span:last-child {
flex: 1;
}
}
.ant-input-number-affix-wrapper,
.ant-input-number{
.ant-input-number {
width: 100% !important;
}
......@@ -350,7 +350,6 @@ table {
}
@media print {
html,
body {
height: initial !important;
......@@ -361,8 +360,18 @@ table {
@media print {
.page-break {
margin-top: 2rem;
display: block;
margin-top: 2rem;
page-break-after: always;
}
}
.ant-pro-card-body {
padding: 12px !important;
}
.ant-pagination.ant-pagination-mini .ant-pagination-options-size-changer {
max-width: 100px !important;
}
.ant-pagination-options {
display: flex !important;
min-width: 210px !important;
}
import React, { useState, useRef, useReducer } from "react";
import { Button, Tooltip, Row, Divider, Drawer, Form, message } from "antd";
import AutoTable from "@/components/Tableform";
import AutoTable from "@/components/AutoTable";
import getPrem from "@/utils/getPrem"; //权限判断fn
import { useRequest } from "umi";
import defaultFields from "./fields";
......@@ -545,6 +545,7 @@ const Materiel = (props) => {
onRef={(node) => (ChildRef = node)}
childposition="left"
extraparams={{ materieTypeId: materieTypeId }}
x={600}
>
<div
style={{
......
......@@ -256,6 +256,45 @@ const one = {
},
],
rowKey: "id",
},
"materialLists": {
value: [],
title: "物料信息",
type: "checktable",
col: { span: 24 },
name: ["materialLists"],
required: false,
path:"/ngic-workmanship/wmsMaterieInstore/queryList",
columns: [
{
"title": <span>物料编码-名称 <b style={{ color: "red" }}>*</b></span>,
"dataIndex": "materieId",
"key": "materieId",
"valueType": "select",
"width": 300,
"selectedRender":"InputNumber"
},
{
"title": "批次号/SN号",
"dataIndex": "materieControlNo",
"key": "materieControlNo"
},
{
"title": <span>入库数量 <b style={{ color: "red" }}>*</b></span>,
"dataIndex": "instroeNum",
"key": "instroeNum",
},
{
"title": "库存单位",
"dataIndex": "productionUnitName",
"key": "productionUnitName",
"readonly": 'productionUnitName',
"width": 88
},
],
rowKey: "id",
rowName:"materieInstoreNo",
pagination:true
}
},
two = {
......
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