code4eat пре 2 година
родитељ
комит
b2df038b37

+ 12 - 5
src/pages/reportCheck/report/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-01-04 14:12:31
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-04-20 17:46:33
+ * @LastEditTime: 2023-04-20 18:41:27
  * @FilePath: /BudgetManaSystem/src/pages/budgetMana/oneBatch/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -73,7 +73,10 @@ const ReportTemplate = () => {
         name: reportData[`report_name`],
         params: {
           reportCode: reportData.redirectReportCode,
-          parameter
+          parameter:{
+            compute_date:currentComputeDate,
+            ...parameter
+          }
         }
       }
       ]
@@ -157,9 +160,13 @@ const ReportTemplate = () => {
 
         let rowData: { [key: string]: any } = {};
 
-        for (let i = 0; i < item.length; i++) {
-          rowData[`${title[i].columnName}`] = item[i].value
-        }
+        item.forEach((b:any) => {
+          const needTitle = title.filter((a:any)=>a.code == b.code);
+          if(needTitle.length>0){
+              rowData[`${needTitle[0].columnName}`] = b.value
+          }
+        });
+
 
         return { ...item, ...rowData, id: Math.random(), columns }
       });

+ 19 - 15
src/pages/setting/checkUnitSet/checkUnitClassMana/index.tsx

@@ -2,7 +2,7 @@
  * @Author: code4eat awesomedema@gmail.com
  * @Date: 2023-03-03 11:30:33
  * @LastEditors: code4eat awesomedema@gmail.com
- * @LastEditTime: 2023-04-20 15:27:22
+ * @LastEditTime: 2023-04-20 18:10:17
  * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -103,13 +103,13 @@ export default function CheckUnitClassficationMana() {
         }
     }
 
-    const updateTable = async (formVal: any, type: 'EDIT' | "ADD"|'ADDCHILD') => {
+    const updateTable = async (formVal: any, type: 'EDIT' | "ADD" | 'ADDCHILD') => {
 
 
-        if (type == 'ADD'||type == 'ADDCHILD') {
+        if (type == 'ADD' || type == 'ADDCHILD') {
             const resp = await addData({
-                  ...formVal,
-                  parentClassCode:formVal.parentClassCode?formVal.parentClassCode:'0'
+                ...formVal,
+                parentClassCode: formVal.parentClassCode ? formVal.parentClassCode : '0'
             });
             if (resp) {
                 tableRef.current?.reload();
@@ -142,7 +142,7 @@ export default function CheckUnitClassficationMana() {
     }
 
 
-    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD'|'ADDCHILD' }) => {
+    const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' | 'ADDCHILD' }) => {
 
         return (
             <ModalForm
@@ -152,12 +152,12 @@ export default function CheckUnitClassficationMana() {
                 initialValues={type == 'EDIT' ? {
                     ...record,
 
-                } :{}}
+                } : {}}
                 trigger={
-                    type == 'EDIT' ? <a key="edit" >编辑</a> :type=='ADDCHILD'?<a className='add'>添加</a>: <span className='add'>新增</span>
+                    type == 'EDIT' ? <a key="edit" >编辑</a> : type == 'ADDCHILD' ? <a className='add'>添加</a> : <span className='add'>新增</span>
                 }
                 onFinish={(val) => {
-                    return updateTable(type == 'EDIT' ? { ...record, ...val } :type == 'ADDCHILD'?{...val,parentClassCode:record.code}:{ ...val }, type);
+                    return updateTable(type == 'EDIT' ? { ...record, ...val } : type == 'ADDCHILD' ? { ...val, parentClassCode: record.code,unitType:record.unitType} : { ...val }, type);
                 }}
                 modalProps={{ destroyOnClose: true }}
                 colProps={{ span: 24 }}
@@ -169,11 +169,15 @@ export default function CheckUnitClassficationMana() {
                     placeholder="请输入"
                     rules={[{ required: true, message: '名称不能为空!' }]}
                 />
-                <ProFormSelect label="职类:"
-                    name='unitType'
-                    options={(getDataByKeyFromDic(dicData, '1')).list}
-                    rules={[{ required: true, message: '职类不能为空!' }]}
-                />
+                {
+                    type == 'ADD' && (
+                        <ProFormSelect label="职类:"
+                            name='unitType'
+                            options={(getDataByKeyFromDic(dicData, '1')).list}
+                            rules={[{ required: true, message: '职类不能为空!' }]}
+                        />
+                    )
+                }
                 <ProFormDigit
                     name="sort"
                     label="序号:"
@@ -184,7 +188,7 @@ export default function CheckUnitClassficationMana() {
                     name="description"
                     label="说明:"
                     placeholder="请输入"
-                    
+
                 />
             </ModalForm>
         )