Explorar o código

财务报表项目维度 填报人 补

XuZinan %!s(int64=2) %!d(string=hai) anos
pai
achega
fc4c7186d5

+ 9 - 6
src/pages/PurchaseAdmin/PurchaseList/Report/Finance/Project.js

@@ -83,16 +83,18 @@ function FinanceProject(props) {
 
   const filterRef = useRef({ pageSize: 20 });
   const onChangePage = pagination => {
+    const { user_id } = form.getFieldsValue();
     dispatch({
       type: 'finance/queryFinanceProjReport',
       payload: {
         ...filterRef.current,
+        user_id,
         currentPage: pagination.current,
       },
     });
   };
   const handleSearch = () => {
-    const { time, name } = form.getFieldsValue();
+    const { time, user_id } = form.getFieldsValue();
     filterRef.current.s_time = time[0] ? moment(time[0]).format('YYYY-MM-DD') : null;
     filterRef.current.e_time = time[1] ? moment(time[1]).format('YYYY-MM-DD') : null;
 
@@ -100,7 +102,7 @@ function FinanceProject(props) {
       type: 'finance/queryFinanceProjReport',
       payload: {
         ...filterRef.current,
-        user_id: name,
+        user_id,
       },
     });
   };
@@ -122,7 +124,7 @@ function FinanceProject(props) {
         <Form.Item label="时间" name="time" initialValue={initDate}>
           <RangePicker placeholder="选择时间" allowClear={false} />
         </Form.Item>
-        <Form.Item label="填报人" name="name">
+        <Form.Item label="填报人" name="user_id">
           <Select
             options={userList}
             fieldNames={{ label: 'CName', value: 'ID' }}
@@ -143,11 +145,12 @@ function FinanceProject(props) {
 
   const handleDownload = () => {
     const token = getToken();
-    let s_time = time[0] ? moment(time[0]).format('YYYY-MM-DD') : null;
-    let e_time = time[1] ? moment(time[1]).format('YYYY-MM-DD') : null;
+    const s_time = !filterRef.current.s_time ? '' : filterRef.current.s_time;
+    const e_time = !filterRef.current.e_time ? '' : filterRef.current.e_time;
+    const { user_id } = form.getFieldsValue();
 
     downloadFile(
-      `/api/v2/workload/finance/exe/export?JWT-TOKEN=${token}&s_time=${s_time}&e_time=${e_time}`,
+      `/api/v2/workload/finance/exe/export?JWT-TOKEN=${token}&s_time=${s_time}&e_time=${e_time}&user_id=${user_id}`,
       `财务报表_项目${moment().format('YYYYMMDDHHMMSS')}.xlsx`
     );
   };