Commit 769d3272 authored by TZW's avatar TZW

bug

parent 56838b91
...@@ -8,7 +8,7 @@ import { ...@@ -8,7 +8,7 @@ import {
ProFormList, ProFormList,
ProCard, ProCard,
} from '@ant-design/pro-components'; } from '@ant-design/pro-components';
import moment from 'moment'; import moment, { defaultFormat } from 'moment';
import { doFetch } from '@/utils/doFetch'; import { doFetch } from '@/utils/doFetch';
import styles from './index.less'; import styles from './index.less';
import FormItems from './FormItems'; import FormItems from './FormItems';
...@@ -92,6 +92,7 @@ function InitForm({ ...@@ -92,6 +92,7 @@ function InitForm({
params = {}, params = {},
detailpath = '', detailpath = '',
defaultFormValue = {}, defaultFormValue = {},
detailFormat,
submitter, submitter,
fields, fields,
extendField = '', extendField = '',
...@@ -102,7 +103,8 @@ function InitForm({ ...@@ -102,7 +103,8 @@ function InitForm({
}) { }) {
let proformRef = useRef(); let proformRef = useRef();
proformRef = formRef ?? proformRef; proformRef = formRef ?? proformRef;
console.log(detailpath);
console.log(detailFormat());
return ( return (
<ProForm <ProForm
style={{ overflow: 'hidden' }} style={{ overflow: 'hidden' }}
...@@ -133,6 +135,11 @@ function InitForm({ ...@@ -133,6 +135,11 @@ function InitForm({
...obj, ...obj,
...defaultFormValue, ...defaultFormValue,
}; };
} else if (detailFormat) {
return {
...detailFormat(res?.data),
...defaultFormValue,
};
} }
return { return {
...(res?.data?.data ?? {}), ...(res?.data?.data ?? {}),
......
...@@ -387,7 +387,13 @@ ol { ...@@ -387,7 +387,13 @@ ol {
.container, .container,
.diycard { .diycard {
height: unset height: 100%;
}
.ant-drawer-wrapper-body {
.diycard {
height: unset;
}
} }
.runtime-keep-alive-layout { .runtime-keep-alive-layout {
......
...@@ -24,6 +24,7 @@ function getcolumns(setdrawer) { ...@@ -24,6 +24,7 @@ function getcolumns(setdrawer) {
align: 'center', align: 'center',
dataIndex: 'positionNo', dataIndex: 'positionNo',
search: false, search: false,
hideInTable: true,
key: 'positionNo', key: 'positionNo',
}, },
{ {
...@@ -139,6 +140,7 @@ function getcolumns(setdrawer) { ...@@ -139,6 +140,7 @@ function getcolumns(setdrawer) {
}, },
{ {
title: '设备原值(万元)', title: '设备原值(万元)',
valueType: 'digit',
search: false, search: false,
hideInTable: true, hideInTable: true,
align: 'center', align: 'center',
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-11-10 09:39:56 * @Date: 2022-11-10 09:39:56
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-14 14:13:17 * @Last Modified time: 2022-12-14 15:00:29
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -2079,7 +2079,6 @@ function Model(props) { ...@@ -2079,7 +2079,6 @@ function Model(props) {
id: drawer?.title == '编辑' ? drawer?.item?.id : '', id: drawer?.title == '编辑' ? drawer?.item?.id : '',
equipmentCharReqList, equipmentCharReqList,
}; };
//console.log(params, '!!!!');
let res = await doFetch({ let res = await doFetch({
url: urlParams.save, url: urlParams.save,
params, params,
...@@ -2107,7 +2106,7 @@ function Model(props) { ...@@ -2107,7 +2106,7 @@ function Model(props) {
const containderef = useRef(); const containderef = useRef();
return ( return (
<div style={{ position: 'relative' }}> <div style={{ position: 'relative' }}>
<div className="ant-card-head"> <div className="ant-card-head" style={{ backgroundColor: 'white' }}>
<div className="ant-card-head-wrapper"> <div className="ant-card-head-wrapper">
<div className="ant-card-head-title"> <div className="ant-card-head-title">
<h3 className="page-title">设备台账</h3> <h3 className="page-title">设备台账</h3>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44 * @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-02 18:35:26 * @Last Modified time: 2022-12-14 15:55:13
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -62,10 +62,24 @@ function Rules(props) { ...@@ -62,10 +62,24 @@ function Rules(props) {
visible: true, visible: true,
detailpath: urlParams.detail, detailpath: urlParams.detail,
params: { noTypeId: row?.id }, params: { noTypeId: row?.id },
detailFormat: (res) => {
console.log('res:', res);
let nrList = {};
res?.data?.nrList?.forEach((it) => {
if (it?.noRuleCode == 'increasing_order') {
nrList.other = it;
} else {
nrList.value.push(it);
}
});
delete res?.data?.nrList;
console.log(res?.data?.nrList);
// res.data.nrList = nrList;
return res;
},
title: '编辑', title: '编辑',
val: 'edit', val: 'edit',
onFinish: async (vals) => { onFinish: async (vals) => {
//console.log(1);
let params = { let params = {
...vals, ...vals,
id: row.id, id: row.id,
...@@ -100,7 +114,7 @@ function Rules(props) { ...@@ -100,7 +114,7 @@ function Rules(props) {
okText: '确认', okText: '确认',
cancelText: '取消', cancelText: '取消',
onConfirm: async () => { onConfirm: async () => {
let res = await doFetch({ url: urlParams.remove, params: { id: row.id } }); let res = await doFetch({ url: urlParams.remove, params: { noTypeId: row.id } });
if (res.code === '0000') { if (res.code === '0000') {
message.success('删除成功!'); message.success('删除成功!');
setDrawer((s) => ({ setDrawer((s) => ({
...@@ -155,6 +169,7 @@ function Rules(props) { ...@@ -155,6 +169,7 @@ function Rules(props) {
title: '新增', title: '新增',
val: 'add', val: 'add',
onFinish: async (vals) => { onFinish: async (vals) => {
console.log('vals:', vals);
let params = { let params = {
...vals, ...vals,
}; };
......
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