Ver código fonte

style: 调整任务页面样式

ZhaoJun 1 ano atrás
pai
commit
3e75d084d5

+ 2 - 2
src/pages/TaskManage/Detail/TaskList/TaskList.tsx

@@ -17,7 +17,7 @@ import { connect, useLocation, useRequest } from '@umijs/max';
 import TopFilter from '@/pages/TaskManage/components/TopFilter';
 import { IMandateType } from '@/pages/TaskManage/index.types';
 import { useNavigate } from '@@/exports';
-import { UpOutlined } from '@ant-design/icons';
+import { DownOutlined, UpOutlined } from "@ant-design/icons";
 import {
   Button,
   Col,
@@ -308,7 +308,7 @@ const TaskList: React.FC<IPropsType> = (props) => {
               className={styles.collapseLabel}
               ghost
               expandIcon={({ isActive }) => (
-                <UpOutlined
+                <DownOutlined
                   style={{ color: '#5697e4' }}
                   rotate={isActive ? 180 : 0}
                 />

+ 51 - 33
src/pages/TaskManage/Detail/TaskOrder/TaskOrder.tsx

@@ -11,6 +11,7 @@ import {
 import { useLocation } from '@@/exports';
 import { connect, useRequest } from '@umijs/max';
 import { Col, Row } from 'antd';
+import moment from 'moment';
 import { DefaultOptionType } from 'rc-select/es/Select';
 import React, { useEffect, useState } from 'react';
 import styles from './taskOrder.less';
@@ -26,6 +27,7 @@ interface IOrderInfo {
   RepairTime: string;
   Reason: string;
   Repairman: string | IUserType;
+  DispatchMan: string | IUserType;
   OrderStatus: string | DefaultOptionType;
   Lubrication?: number;
   Fasten?: number;
@@ -50,11 +52,12 @@ const TaskOrder: React.FC<IPropsType> = (props) => {
   const { run: getMaintainDetail } = useRequest(getMaintainRecordList, {
     manual: true,
     formatResult: (result) => {
+      console.log(moment('2022-12-12 00:00:00').format('YYYY-MM-DD HH:mm'));
       const temp = result.data.list[0];
       const tempDetail = {
-        CreateTime: temp.CreateTime,
-        PlanTime: temp.PlanTime,
-        RepairTime: '-',
+        CreateTime: moment(temp.CreateTime).format('YYYY-MM-DD HH:mm'),
+        PlanTime: moment(temp.PlanTime).format('YYYY-MM-DD HH:mm'),
+        RepairTime: moment(temp.RepairTime).format('YYYY-MM-DD HH:mm') || '-',
         Reason: temp.Note,
         Lubrication: temp.Lubrication,
         Fasten: temp.Fasten,
@@ -64,6 +67,9 @@ const TaskOrder: React.FC<IPropsType> = (props) => {
         Check: temp.Check,
         Repairman:
           userList.find((item) => item.ID === temp.MaintenancePerson) || '-',
+        DispatchMan:
+          userList.find((item) => (item.ID = temp.Operators[0].Operator.ID)) ||
+          '-',
         OrderStatus:
           OrderStatus.find((item) => item.value === temp.Status) || '-',
       };
@@ -77,11 +83,15 @@ const TaskOrder: React.FC<IPropsType> = (props) => {
     formatResult: (result: any) => {
       const temp = result.data.list[0];
       const tempDetail: IOrderInfo = {
-        CreateTime: temp.CreateTime,
-        PlanTime: temp.PlanTime,
-        RepairTime: temp.RepairTime,
+        CreateTime: moment(temp.CreateTime).format('YYYY-MM-DD HH:mm'),
+        PlanTime: moment(temp.PlanTime).format('YYYY-MM-DD HH:mm'),
+        RepairTime: moment(temp.RepairTime).format('YYYY-MM-DD HH:mm'),
         Reason: temp.Reason,
         Repairman: userList.find((item) => item.ID === temp.Repairman) || '-',
+        DispatchMan:
+          userList.find((item) => {
+            item.ID === temp.operator_id;
+          }) || '-',
         OrderStatus:
           OrderStatus.find((item) => item.value === temp.AcceptanceStatus) ||
           '-',
@@ -96,11 +106,16 @@ const TaskOrder: React.FC<IPropsType> = (props) => {
     formatResult: (result) => {
       const temp = result.data.list[0];
       const tempDetail = {
-        CreateTime: temp.start_time,
-        PlanTime: temp.plan_end_time,
-        RepairTime: temp.actual_end_time || '-',
+        CreateTime: moment(temp.start_time).format('YYYY-MM-DD HH:mm'),
+        PlanTime: moment(temp.plan_end_time).format('YYYY-MM-DD HH:mm'),
+        RepairTime:
+          (temp.actual_end_time &&
+            moment(temp.actual_end_time).format('YYYY-MM-DD HH:mm')) ||
+          '-',
         Reason: temp.detail,
-        Repairman: userList.find((item) => item.ID === temp.operator_id) || '-',
+        Repairman: userList.find((item) => item.ID === temp.checker_id) || '-',
+        DispatchMan:
+          userList.find((item) => item.ID === temp.operator_id) || '-',
         OrderStatus:
           OrderStatus.find((item) => item.value === temp.status) || '-',
       };
@@ -115,6 +130,7 @@ const TaskOrder: React.FC<IPropsType> = (props) => {
         payload: { project_id },
       });
     }
+    console.log(order_type);
     switch (order_type) {
       // 工艺
       case 1:
@@ -144,44 +160,46 @@ const TaskOrder: React.FC<IPropsType> = (props) => {
           />
           <div style={{ padding: '15px' }}>
             <Row className={styles.rowMargin}>
-              <Col className={styles.fontS24} span={16}>
-                时间:{'-'}
+              <Col className={styles.fontS26} span={16}>
+                派单时间:{orderInfo?.CreateTime || '-'}
               </Col>
-              <Col className={styles.fontS24} span={8}>
+              <Col className={styles.fontS26} span={8}>
                 {/*// @ts-ignore*/}
                 工单负责人:{orderInfo?.Repairman?.CName || '-'}
               </Col>
             </Row>
-            <Row className={styles.rowMargin} >
-              <Col className={styles.fontS24} span={8}>
+            <Row className={styles.rowMargin}>
+              <Col className={styles.fontS26} span={8}>
                 {/*// @ts-ignore*/}
                 工单状态:{orderInfo?.OrderStatus?.label}
               </Col>
-              <Col className={styles.fontS24} span={8}>
+              <Col className={styles.fontS26} span={8}>
                 {/*// @ts-ignore*/}
                 工单类型:
                 {order_type === 1 ? '工艺' : order_type === 2 ? '维修' : '保养'}
               </Col>
-              <Col className={styles.fontS24} span={8}>派单人员:{'-'}</Col>
-            </Row>
-            <Row className={styles.rowMargin}>
-              <Col className={styles.fontS24}>
-                派单时间:{orderInfo?.CreateTime || '-'}
+              <Col className={styles.fontS26} span={8}>
+                派单人员:{orderInfo?.DispatchMan?.CName}
               </Col>
             </Row>
+            {/*<Row className={styles.rowMargin}>*/}
+            {/*  <Col className={styles.fontS26}>*/}
+            {/*    派单时间:{orderInfo?.CreateTime || '-'}*/}
+            {/*  </Col>*/}
+            {/*</Row>*/}
             <Row className={styles.rowMargin}>
-              <Col className={styles.fontS24}>
+              <Col className={styles.fontS26}>
                 计划完成时间:{orderInfo?.PlanTime || '-'}
               </Col>
             </Row>
             <Row className={styles.rowMargin}>
-              <Col className={styles.fontS24}>
+              <Col className={styles.fontS26}>
                 实际完成时间:{orderInfo?.RepairTime || '-'}
               </Col>
             </Row>
             <Row>
-              <Col className={styles.fontS24}>工单详情:</Col>
-              <Col className={styles.fontS24} span={20}>
+              <Col className={styles.fontS26}>工单详情:</Col>
+              <Col className={styles.fontS26} span={18}>
                 {orderInfo?.Reason}
                 {/*<Table />*/}
               </Col>
@@ -192,25 +210,25 @@ const TaskOrder: React.FC<IPropsType> = (props) => {
           <div>
             <SubTitle title="维修内容" />
             <div style={{ padding: '15px' }}>
-              <Row className={styles.rowMargin} justify={'space-between'}>
-                <Col className={styles.fontS24}>
+              <Row className={styles.rowMargin} justify={'space-around'}>
+                <Col className={styles.fontS26} span={8}>
                   是否润滑/加油:{orderInfo?.Lubrication === 1 ? '是' : '否'}
                 </Col>
-                <Col className={styles.fontS24}>
+                <Col className={styles.fontS26} span={8}>
                   是否拆检:{orderInfo?.Check === 1 ? '是' : '否'}
                 </Col>
-                <Col className={styles.fontS24}>
+                <Col className={styles.fontS26} span={8}>
                   是否清洁:{orderInfo?.Clean === 1 ? '是' : '否'}
                 </Col>
               </Row>
-              <Row>
-                <Col className={styles.fontS24}>
+              <Row justify={'space-around'}>
+                <Col className={styles.fontS26} span={8}>
                   是否紧固:{orderInfo?.Fasten === 1 ? '是' : '否'}
                 </Col>
-                <Col className={styles.fontS24}>
+                <Col className={styles.fontS26} span={8}>
                   是否除锈:{orderInfo?.AntiCorrosive === 1 ? '是' : '否'}
                 </Col>
-                <Col className={styles.fontS24}>
+                <Col className={styles.fontS26} span={8}>
                   是否防腐:{orderInfo?.RustRemoval === 1 ? '是' : '否'}
                 </Col>
               </Row>

+ 4 - 0
src/pages/TaskManage/Detail/TaskOrder/taskOrder.less

@@ -18,6 +18,10 @@
   font-size: 28px;
 }
 
+.fontS26{
+  font-size: 26px;
+}
+
 .fontS24 {
   font-size: 24px;
 }

+ 1 - 1
src/pages/TaskManage/components/SubTitle.tsx

@@ -25,7 +25,7 @@ const SubTitle: React.FC<IPropsType> = ({
         paddingLeft: '20px',
         paddingRight: '10px',
         backgroundColor: '#d9e7f9',
-        fontSize: '26px',
+        fontSize: '28px',
         height: '66px',
         borderRadius: radius ? '8px 8px 0 0 ' : 'unset',
       }}

+ 0 - 19
src/pages/TaskManage/components/TopFilter.tsx

@@ -31,25 +31,6 @@ const TopFilter: React.FC<IProps> = ({ filters, onChange }) => {
               placeholder={item.placeholder}
               options={item.options}
               popupMatchSelectWidth={250}
-              suffixIcon={
-                values[index]===null || values[index]===undefined ? (
-                  <CaretDownFilled
-                    style={{
-                      fontSize: '28px',
-                      color: 'black',
-                    }}
-                  />
-                ) : null
-              }
-              clearIcon={
-                <CloseCircleFilled
-                  style={{
-                    fontSize: '28px',
-                    color: 'black',
-                    paddingBottom: '20px',
-                  }}
-                />
-              }
               allowClear
               onChange={(value) => {
                 const temp = filters.map((f, i) => {

+ 20 - 14
src/pages/TaskManage/index.less

@@ -24,46 +24,52 @@
   }
 }
 
-.ant-select-clear{
-  top: 32% !important;
-  opacity: 1!important;
-  transition: unset;
-  padding-left: 10px;
+.ant-select-clear {
+  opacity: 1 !important;
+  margin-top: -10px!important;
+  width: 24px!important;
+  height: 24px!important;
+  font-size: 24px!important;
+  color: black!important;
 }
 
 .antdSelect .ant-select-selection-item,
 .antdSelect .ant-select-selection-placeholder,
-.ant-select-item-option-content
-{
+.ant-select-item-option-content {
   font-size: 28px;
   color: black;
   margin-right: 10px;
 }
 
-.fontS28{
+.ant-select-arrow {
+  font-size: 24px!important;
+  color: black!important;
+}
+
+.fontS28 {
   font-size: 28px;
 }
 
-.fontS26{
+.fontS26 {
   font-size: 26px;
 }
 
-.fontS24{
+.fontS24 {
   font-size: 24px;
 }
 
-.fontS22{
+.fontS22 {
   font-size: 22px;
 }
 
-.fontS20{
+.fontS20 {
   font-size: 20px;
 }
 
-.fontS18{
+.fontS18 {
   font-size: 18px;
 }
 
-.fontS16{
+.fontS16 {
   font-size: 16px;
 }