Commit 769d3272 authored by TZW's avatar TZW

bug

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