|
@@ -2,7 +2,7 @@ import PageContent from '@/components/PageContent';
|
|
|
import PageTitle from '@/components/PageTitle';
|
|
|
import { IUserType } from '@/pages/TaskManage/Detail/TaskList/taskList.types';
|
|
|
import SubTitle from '@/pages/TaskManage/components/SubTitle';
|
|
|
-import { OrderStatus } from '@/pages/TaskManage/constent';
|
|
|
+import { OrderStatus, OrderType } from '@/pages/TaskManage/constent';
|
|
|
import {
|
|
|
getCraftRecordList,
|
|
|
getMaintainRecordList,
|
|
@@ -45,6 +45,7 @@ const TaskOrder: React.FC<IPropsType> = (props) => {
|
|
|
const project_id = Number(queryParams.get('project_id'));
|
|
|
const order_id = Number(queryParams.get('order_id'));
|
|
|
const order_type = Number(queryParams.get('order_type'));
|
|
|
+ const mandate_class = Number(queryParams.get('mandate_class'));
|
|
|
|
|
|
const [orderInfo, setOrderInfo] = useState<IOrderInfo>();
|
|
|
|
|
@@ -106,6 +107,27 @@ const TaskOrder: React.FC<IPropsType> = (props) => {
|
|
|
},
|
|
|
});
|
|
|
|
|
|
+ const renderReason = (detail: any) => {
|
|
|
+ const title = detail.match(/^(.*?)(?=\{)/g)[0];
|
|
|
+ const content = JSON.parse(detail.match(/\{.*\}/g)[0]);
|
|
|
+ console.log(content, title);
|
|
|
+ console.log(Object.values(content));
|
|
|
+ const result = [];
|
|
|
+ result.push(<Row className={styles.fontS28}>{title}</Row>);
|
|
|
+ Object.values(content).forEach((item: any) => {
|
|
|
+ result.push(
|
|
|
+ <Row className={styles.fontS28}>
|
|
|
+ {item['item_alias'] +
|
|
|
+ ' 现有数值:' +
|
|
|
+ item['old_value'] +
|
|
|
+ ' 建议调整数值' +
|
|
|
+ item['new_value']}
|
|
|
+ </Row>,
|
|
|
+ );
|
|
|
+ });
|
|
|
+ return result;
|
|
|
+ };
|
|
|
+
|
|
|
// 根据type请求详情
|
|
|
const { run: getCraftDetail } = useRequest(getCraftRecordList, {
|
|
|
manual: true,
|
|
@@ -118,7 +140,7 @@ const TaskOrder: React.FC<IPropsType> = (props) => {
|
|
|
(temp.actual_end_time &&
|
|
|
dayjs(temp.actual_end_time).format('YYYY-MM-DD HH:mm')) ||
|
|
|
'-',
|
|
|
- Reason: temp.detail,
|
|
|
+ Reason: mandate_class !== 2 ? temp.detail : renderReason(temp.detail),
|
|
|
Repairman: userList.find((item) => item.ID === temp.checker_id) || '-',
|
|
|
DispatchMan:
|
|
|
userList.find((item) => item.ID === temp.operator_id) || '-',
|
|
@@ -139,6 +161,7 @@ const TaskOrder: React.FC<IPropsType> = (props) => {
|
|
|
switch (order_type) {
|
|
|
// 工艺
|
|
|
case 1:
|
|
|
+ case 6:
|
|
|
getCraftDetail({ project_id, work_id: order_id });
|
|
|
break;
|
|
|
// 维修
|
|
@@ -168,7 +191,8 @@ const TaskOrder: React.FC<IPropsType> = (props) => {
|
|
|
<Col className={styles.fontS28} span={16}>
|
|
|
{/*// @ts-ignore*/}
|
|
|
工单类型:
|
|
|
- {order_type === 1 ? '工艺' : order_type === 2 ? '维修' : '保养'}
|
|
|
+ {OrderType.find((item) => item.value === order_type)?.label ||
|
|
|
+ '-'}
|
|
|
</Col>
|
|
|
<Col className={styles.fontS28} span={8}>
|
|
|
{/*// @ts-ignore*/}
|
|
@@ -204,7 +228,6 @@ const TaskOrder: React.FC<IPropsType> = (props) => {
|
|
|
<Col className={styles.fontS28}>工单详情:</Col>
|
|
|
<Col className={styles.fontS28} span={18}>
|
|
|
{orderInfo?.Reason}
|
|
|
- {/*<Table />*/}
|
|
|
</Col>
|
|
|
</Row>
|
|
|
</div>
|