Commit 66e565ea authored by TZW's avatar TZW

bug

parent 6885c97e
......@@ -13,9 +13,9 @@ export default {
dev: {
[defaultSetting.proxypath]: {
// 要代理的地址
target: 'http://192.168.40.64:28000', //jf哥
// target: 'http://192.168.40.64:28000', //jf哥
// target: 'http://192.168.40.64:28000', //gc哥
// target: 'http://192.168.40.203:8000', //dj哥
target: 'http://192.168.40.203:8000', //dj哥
changeOrigin: true,
},
'/token': {
......
......@@ -29,6 +29,7 @@ const EditTable = (props) => {
//调用接口
const request = async (params, sort, filter) => {
console.log(params);
if (!path)
return {
data: dataSource ?? [],
......@@ -125,6 +126,7 @@ const EditTable = (props) => {
{...props}
recordCreatorProps={false}
size={size}
params={{ ...extraparams }}
onSubmit={(params) => {
//console.log(params, 'onSubmit');
}}
......@@ -142,20 +144,20 @@ const EditTable = (props) => {
scroll={
x
? {
x: x,
}
x: x,
}
: {}
}
pagination={
ifspagination
? false
: {
showTotal: (total, range) => <span>{total}</span>,
showQuickJumper: true,
showSizeChanger: true,
pageSizeOptions: [5, 10, 15, 30, 50, 100, 200],
defaultPageSize: pageSize || 15,
}
showTotal: (total, range) => <span>{total}</span>,
showQuickJumper: true,
showSizeChanger: true,
pageSizeOptions: [5, 10, 15, 30, 50, 100, 200],
defaultPageSize: pageSize || 15,
}
}
editable={{
type: 'multiple',
......@@ -164,7 +166,7 @@ const EditTable = (props) => {
}}
search={{
filterType: 'light', //轻量模式
placement: 'bottomLeft'
placement: 'bottomLeft',
}}
/>
);
......
/* eslint-disable react-hooks/exhaustive-deps */
import React, { useState, useRef, memo, createElement, useEffect } from 'react';
import React, { useState, useRef, memo, createElement, useEffect, useMemo } from 'react';
import {
ProForm,
ProFormDependency,
......@@ -1472,6 +1472,108 @@ function FormList({ item, colProps, formRef }) {
);
}
const Todo = ({ actionRef, value, item, params, rowKey, chooses, onChange }) => {
console.log(params);
return (
<EditTable
actionRef={actionRef}
defaultValue={value} //调用接口合并初始值
path={item.path}
extraparams={params ?? {}}
rowKey={rowKey}
columns={item.columns}
resizeable={false}
alwaysShowAlert={false}
tableAlertRender={false}
tableAlertOptionRender={false}
rowClassName={(record, index) => {
if (chooses.includes(record[rowKey])) {
return 'lightblue';
} else {
return '';
}
}}
rowSelection={{
...item.rowSelection,
columnWidth: 44,
preserveSelectedRowKeys: true,
selectedRowKeys: value && value?.map((it) => it[rowKey]),
onChange: (selectedKeys, selectedRows) => {
const rowkeylist = value ? value?.map((it) => it[rowKey]) : [];
const newValue = selectedRows?.map((its) => {
if (rowkeylist.includes(its[rowKey])) {
return value.filter((it) => it[rowKey] == its[rowKey])[0];
} else {
return its;
}
});
onChange(newValue);
},
}}
editable={{
onValuesChange: (record, recordList) => {
const newValue = value?.map((its) => {
if (its[rowKey] == record[rowKey]) {
return record;
} else {
return its;
}
});
onChange(newValue);
},
}}
/>
);
};
const Done = ({ actionRef, value, item, params, rowKey, chooses, onChange }) => (
<EditTable
value={value}
rowKey={rowKey}
columns={item.columns}
resizeable={false}
alwaysShowAlert={false}
tableAlertRender={false}
tableAlertOptionRender={false}
rowClassName={(record, index) => {
if (chooses.includes(record[rowKey])) {
return 'lightblue';
} else {
return '';
}
}}
rowSelection={{
...item.rowSelection,
columnWidth: 44,
preserveSelectedRowKeys: true,
selectedRowKeys: value && value?.map((it) => it[rowKey]),
onChange: (selectedKeys, selectedRows) => {
const rowkeylist = value ? value?.map((it) => it[rowKey]) : [];
const newValue = selectedRows?.map((its) => {
if (rowkeylist.includes(its[rowKey])) {
return value.filter((it) => it[rowKey] == its[rowKey])[0];
} else {
return its;
}
});
onChange(newValue);
},
}}
editable={{
onValuesChange: (record, recordList) => {
const newValue = value?.map((its) => {
if (its[rowKey] == record[rowKey]) {
return record;
} else {
return its;
}
});
onChange(newValue);
},
}}
/>
);
function TableSelect({ item, value, onChange, params = {} }) {
const rowKey = item?.rowKey ?? 'id';
const [chooses, setchooses] = useState([]); //mark 标记
......@@ -1540,105 +1642,15 @@ function TableSelect({ item, value, onChange, params = {} }) {
/>
);
const Todo = () => (
<EditTable
actionRef={actionRef}
defaultValue={value} //调用接口合并初始值
path={item.path}
extraparams={params ?? {}}
rowKey={rowKey}
columns={item.columns}
resizeable={false}
alwaysShowAlert={false}
tableAlertRender={false}
tableAlertOptionRender={false}
rowClassName={(record, index) => {
if (chooses.includes(record[rowKey])) {
return 'lightblue';
} else {
return '';
}
}}
rowSelection={{
...item.rowSelection,
columnWidth: 44,
preserveSelectedRowKeys: true,
selectedRowKeys: value && value?.map((it) => it[rowKey]),
onChange: (selectedKeys, selectedRows) => {
const rowkeylist = value ? value?.map((it) => it[rowKey]) : [];
const newValue = selectedRows?.map((its) => {
if (rowkeylist.includes(its[rowKey])) {
return value.filter((it) => it[rowKey] == its[rowKey])[0];
} else {
return its;
}
});
onChange(newValue);
},
}}
editable={{
onValuesChange: (record, recordList) => {
const newValue = value?.map((its) => {
if (its[rowKey] == record[rowKey]) {
return record;
} else {
return its;
}
});
onChange(newValue);
},
}}
/>
);
const Done = () => (
<EditTable
value={value}
rowKey={rowKey}
columns={item.columns}
resizeable={false}
alwaysShowAlert={false}
tableAlertRender={false}
tableAlertOptionRender={false}
rowClassName={(record, index) => {
if (chooses.includes(record[rowKey])) {
return 'lightblue';
} else {
return '';
}
}}
rowSelection={{
...item.rowSelection,
columnWidth: 44,
preserveSelectedRowKeys: true,
selectedRowKeys: value && value?.map((it) => it[rowKey]),
onChange: (selectedKeys, selectedRows) => {
const rowkeylist = value ? value?.map((it) => it[rowKey]) : [];
const newValue = selectedRows?.map((its) => {
if (rowkeylist.includes(its[rowKey])) {
return value.filter((it) => it[rowKey] == its[rowKey])[0];
} else {
return its;
}
});
onChange(newValue);
},
}}
editable={{
onValuesChange: (record, recordList) => {
const newValue = value?.map((its) => {
if (its[rowKey] == record[rowKey]) {
return record;
} else {
return its;
}
});
onChange(newValue);
},
}}
/>
);
const propes = {
actionRef,
value,
item,
params,
rowKey,
chooses,
onChange,
};
return (
<div className="selecttable">
<Tabs
......@@ -1669,8 +1681,8 @@ function TableSelect({ item, value, onChange, params = {} }) {
{ label: `选择结果${value?.length ?? 0}`, key: 2 },
]}
/>
{activetab == 1 && <Todo />}
{activetab == 2 && <Done />}
{activetab == 1 && <Todo {...propes} />}
{activetab == 2 && <Done {...propes} />}
</div>
);
}
......
......@@ -22,8 +22,8 @@ export default (props) => {
},
{
title: '设备型号',
dataIndex: 'equipmentName',
key: 'equipmentName',
dataIndex: 'equipmentModelName',
key: 'equipmentModelName',
},
{
title: '公司名称',
......
......@@ -19,7 +19,76 @@ export default (props) => {
// 维修工单
const Wxgd = () => {
return (
// return (
// <>
// <DesItem
// dataSource={request?.data?.dataList[0]}
// title="报修信息"
// hidden={true}
// index="0"
// // navhidden={false}
// />
// {request?.data?.dataList?.splice(1).map((it, index) => {
// return (
// <>
// <DesItem
// type="wxgd"
// dataSource={it}
// index={index + 2}
// hidden={true}
// navhidden={false}
// />
// </>
// );
// })}
// </>
// );
return hidden ? (
<>
<DesItem
dataSource={request?.data?.dataList[0]}
title="基本信息"
hidden={true}
type="wxgd"
index="0"
// navhidden={false}
/>
<DesItem
type="wxgd"
dataSource={request?.data?.dataList[1]}
index={'2'}
hidden={true}
navhidden={false}
/>
<div className="fault-detail" style={{ paddingTop: 30, paddingBottom: 30 }}>
<Tooltip title="点击展开">
<Button
type="primary"
shape="circle"
icon={<MoreOutlined />}
onClick={() => {
sethidden(false);
}}
/>
</Tooltip>
</div>
<DesItem
type="wxgd"
dataSource={request?.data?.dataList[request?.data?.dataList?.length - 2]}
index={request?.data?.dataList?.length - 1}
hidden={true}
navhidden={false}
/>
<DesItem
type="wxgd"
dataSource={request?.data?.dataList[request?.data?.dataList?.length - 1]}
index={request?.data?.dataList?.length}
hidden={true}
navhidden={false}
/>
</>
) : (
<>
<DesItem
dataSource={request?.data?.dataList[0]}
......@@ -89,19 +158,6 @@ export default (props) => {
hidden={true}
navhidden={false}
/>
{/* {request?.data?.dataList?.splice(1).map((it, index) => {
return (
<>
<DesItem
type="zzgd"
dataSource={it}
index={index + 2}
hidden={true}
navhidden={false}
/>
</>
);
})} */}
</>
) : (
<>
......
......@@ -14,8 +14,8 @@ const getcolumns = {
},
{
title: '设备型号',
dataIndex: 'equipmentName',
key: 'equipmentName',
dataIndex: 'equipmentModelName',
key: 'equipmentModelName',
},
{
title: '保养类型',
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03
* @Last Modified by: Li Hanlin
* @Last Modified time: 2023-01-30 15:59:06
* @Last Modified time: 2023-02-07 13:31:07
*/
import * as React from 'react';
......@@ -149,9 +149,8 @@ function Failure(props) {
},
{
title: '关单时间',
dataIndex: 'faultDescription',
key: 'faultDescription',
valueType: 'textarea',
dataIndex: 'repairCloseTime',
key: 'repairCloseTime',
},
];
}
......
......@@ -3,7 +3,7 @@
* @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03
* @Last Modified by: Li Hanlin
* @Last Modified time: 2023-02-02 17:04:01
* @Last Modified time: 2023-02-07 15:25:45
*/
import * as React from 'react';
......@@ -146,8 +146,10 @@ function Failure(props) {
type: 'wcwx',
item: {
...row,
repairType: '101',
isShutdown: 1,
repairContent: res?.data?.data?.faultSolution,
repairAssistList: row?.repairAssistList.map((it) => it?.assistUserId),
},
val: 'only',
title: '完成维修',
......@@ -158,7 +160,12 @@ function Failure(props) {
...s,
open: true,
type: 'wcwx',
item: { ...row, isShutdown: 1 },
item: {
...row,
isShutdown: 1,
repairType: '101',
repairAssistList: row?.repairAssistList.map((it) => it?.assistUserId),
},
val: 'only',
title: '完成维修',
}));
......@@ -408,8 +415,10 @@ function Failure(props) {
type: 'wcwx',
item: {
...row,
repairType: '101',
isShutdown: 1,
repairContent: res?.data?.data?.faultSolution,
repairAssistList: row?.repairAssistList.map((it) => it?.assistUserId),
},
val: 'only',
title: '完成维修',
......@@ -420,7 +429,12 @@ function Failure(props) {
...s,
open: true,
type: 'wcwx',
item: { ...row, isShutdown: 1 },
item: {
...row,
repairType: '101',
isShutdown: 1,
repairAssistList: row?.repairAssistList.map((it) => it?.assistUserId),
},
val: 'only',
title: '完成维修',
}));
......
......@@ -320,6 +320,12 @@ function getcolumns(setdrawer, bus) {
path: '/auth/sysUser/selection',
},
},
{
title: '关单时间',
dataIndex: 'repairCloseTime',
key: 'repairCloseTime',
valueType: 'dateTimeRange',
},
{
title: '来源单号',
dataIndex: 'dataSourcesNo',
......
......@@ -3,7 +3,7 @@
* @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03
* @Last Modified by: Li Hanlin
* @Last Modified time: 2023-02-03 10:40:38
* @Last Modified time: 2023-02-07 16:50:52
*/
import * as React from 'react';
......@@ -179,7 +179,7 @@ function Failure(props) {
]}
onFinish={async (vals) => {
let params = {
otherUnitsAssistList: vals?.otherUnitsAssistList.map((it) => ({ assistUserId: it })),
otherUnitsAssistList: [{ assistUserId: vals?.otherUnitsAssistList }],
id: drawer?.item?.id,
};
let res = await doFetch({
......
import dayjs from 'dayjs';
function getcolumns(setdrawer, bus) {
let listOptions = bus?.map((it) => ({ label: it?.name, value: it?.code }));
console.log(listOptions);
return [
{
tab: '我的待办',
......@@ -325,6 +326,12 @@ function getcolumns(setdrawer, bus) {
path: '/auth/sysUser/selection',
},
},
{
title: '关单时间',
dataIndex: 'repairCloseTime',
key: 'repairCloseTime',
valueType: 'dateTimeRange',
},
{
title: '来源单号',
dataIndex: 'repairNo',
......
......@@ -3,7 +3,7 @@
* @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03
* @Last Modified by: Li Hanlin
* @Last Modified time: 2023-02-01 18:48:57
* @Last Modified time: 2023-02-07 16:08:46
*/
import * as React from 'react';
......@@ -54,7 +54,7 @@ function Failure(props) {
...s,
SpecName: res?.data?.dataList,
}));
}, []);
}, [activeTabKey]);
// 重新指派
const Reassig = () => {
......@@ -132,11 +132,11 @@ function Failure(props) {
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
options: [
{
value: '1',
value: 1,
label: '正常',
},
{
value: '2',
value: 2,
label: '异常',
},
],
......@@ -152,11 +152,11 @@ function Failure(props) {
key: 'isFinishTrack',
options: [
{
value: '1',
value: 1,
label: '是',
},
{
value: '2',
value: 2,
label: '否',
},
],
......@@ -165,6 +165,8 @@ function Failure(props) {
title: '追踪周期',
dataIndex: 'trackCycle',
key: 'trackCycle',
valueType: 'digit',
precision: 0,
fieldProps: {
disabled: true,
},
......@@ -424,8 +426,8 @@ function Failure(props) {
trackResult: '1',
isFinishTrack: '2',
},
// detailpath: '/repair/umTrackTraceinfo/queryByTrackOrderId',
// params: { trackOrderId: row?.id },
detailpath: '/repair/umTrackTraceinfo/queryByTrackOrderId',
params: { trackOrderId: row?.id },
val: 'only',
title: '追踪信息',
}));
......@@ -451,7 +453,7 @@ function Failure(props) {
open: true,
val: 'only',
title: '验证',
item: row,
item: { ...row, reviewerResult: 1 },
detailpath: '/repair/umTrackTraceinfo/queryByTrackOrderId',
params: { trackOrderId: row?.id },
type: 'check',
......@@ -555,7 +557,7 @@ function Failure(props) {
} else if (activeTabKey == '3') {
return defcolumn;
}
}, [activeTabKey]);
}, [activeTabKey, drawer?.SpecName]);
const pathconfig = useMemo(() => {
let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {};
......
......@@ -102,6 +102,9 @@ function getcolumns(setdrawer) {
title: '入库单号',
dataIndex: 'taskNo',
key: 'taskNo',
fieldProps: {
placeholder: '不填系统自动生成',
},
},
{
title: '入库类型',
......@@ -216,7 +219,7 @@ function getcolumns(setdrawer) {
dataIndex: 'createTime',
key: 'createTimeList',
hideInForm: true,
valueType: 'dateRange',
valueType: 'dateTimeRange',
render: (text, row) => {
return <span>{row?.createTime}</span>;
},
......@@ -228,7 +231,6 @@ function getcolumns(setdrawer) {
valueType: 'split',
},
{
title: '备件',
dataIndex: 'detailsList',
key: 'detailsList',
valueType: 'formList',
......@@ -387,7 +389,7 @@ function getcolumns(setdrawer) {
dataIndex: 'createTime',
key: 'createTimeList',
hideInForm: true,
valueType: 'dateRange',
valueType: 'dateTimeRange',
render: (text, row) => {
return <span>{row?.createTime}</span>;
},
......@@ -397,6 +399,7 @@ function getcolumns(setdrawer) {
dataIndex: 'completeTime',
key: 'completeTimeList',
hideInForm: true,
span: 3,
valueType: 'dateRange',
render: (text, row) => {
return <span>{row?.completeTime}</span>;
......@@ -409,7 +412,6 @@ function getcolumns(setdrawer) {
valueType: 'split',
},
{
title: '备件',
dataIndex: 'detailsList',
key: 'detailsList',
valueType: 'formList',
......@@ -445,6 +447,9 @@ function getcolumns(setdrawer) {
key: 'status',
hideInForm: true,
valueType: 'select',
fieldProps: {
dropdownMatchSelectWidth: 120,
},
width: 120,
options: [
{ label: '已入库', value: 2 },
......
......@@ -112,6 +112,14 @@ function getcolumns(setdrawer) {
dataIndex: 'isLifeName',
key: 'isLife',
valueType: 'select',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
options: [
{
label: '是',
......@@ -132,7 +140,7 @@ function getcolumns(setdrawer) {
valueType: 'split',
},
{
title: '供应商',
// title: '供应商',
dataIndex: 'relationSupplierList',
key: 'relationSupplierList',
valueType: 'formSelectList',
......
......@@ -77,9 +77,9 @@ request.interceptors.request.use(async (url, options) => {
// response拦截器, 处理response
request.interceptors.response.use(async (response, options) => {
if (response?.status == '401') {
window.location.href = '/';
}
// if (response?.status == '401') {
// window.location.href = '/';
// }
if (options.responseType == 'blob') {
const data = await response.clone().blob();
let blobUrl = window.URL.createObjectURL(data);
......
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