Commit 0b3c170b authored by TZW's avatar TZW

Merge branch 'master' of http://47.100.234.193:9527/wuhao/ems3.3

parents f1f9f22e bc16f269
...@@ -74,6 +74,7 @@ const EditTable = (props) => { ...@@ -74,6 +74,7 @@ const EditTable = (props) => {
if (Array.isArray(it.options)) { if (Array.isArray(it.options)) {
options = { options = {
fieldProps: { fieldProps: {
...it?.fieldProps,
options: [...it.options], options: [...it.options],
}, },
}; };
...@@ -141,20 +142,20 @@ const EditTable = (props) => { ...@@ -141,20 +142,20 @@ const EditTable = (props) => {
scroll={ scroll={
x x
? { ? {
x: x, x: x,
} }
: {} : {}
} }
pagination={ pagination={
ifspagination ifspagination
? false ? false
: { : {
showTotal: (total, range) => <span>{total}</span>, showTotal: (total, range) => <span>{total}</span>,
showQuickJumper: true, showQuickJumper: true,
showSizeChanger: true, showSizeChanger: true,
pageSizeOptions: [5, 10, 15, 30, 50, 100, 200], pageSizeOptions: [5, 10, 15, 30, 50, 100, 200],
defaultPageSize: pageSize || 15, defaultPageSize: pageSize || 15,
} }
} }
editable={{ editable={{
type: 'multiple', type: 'multiple',
......
import { Popconfirm, Switch } from 'antd'; import dayjs from 'dayjs';
function getcolumns(setdrawer, run) { function getcolumns(setdrawer) {
const disabledDate = (current) => {
// Can not select days before today and today
return current && current < dayjs().endOf('day');
};
const columns = [
{
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
editable: false,
},
{
title: '设备名称',
dataIndex: 'equipmentName',
key: 'equipmentName',
editable: false,
},
{
title: '工厂名称',
dataIndex: 'factoryName',
key: 'factoryId',
hideInForm: true,
valueType: 'select',
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
options: {
path: '/auth/sysFactory/getAllFactorySelection',
params: {},
},
editable: false,
},
{
title: '车间名称',
dataIndex: 'shopName',
key: 'shopId',
hideInForm: true,
valueType: 'select',
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
options: {
path: '/auth/sysShop/getAllShopSelection',
params: {},
},
editable: false,
},
{
title: '下次点检日期',
dataIndex: 'checkPlanDate',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
fieldProps: {
disabledDate,
},
valueType: 'date',
hideInSearch: true,
},
];
return [ return [
{ {
tab: '未完成', tab: '未完成',
...@@ -48,6 +115,10 @@ function getcolumns(setdrawer, run) { ...@@ -48,6 +115,10 @@ function getcolumns(setdrawer, run) {
key: 'factoryId', key: 'factoryId',
hideInForm: true, hideInForm: true,
valueType: 'select', valueType: 'select',
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
options: { options: {
path: '/auth/sysFactory/getAllFactorySelection', path: '/auth/sysFactory/getAllFactorySelection',
params: {}, params: {},
...@@ -59,8 +130,12 @@ function getcolumns(setdrawer, run) { ...@@ -59,8 +130,12 @@ function getcolumns(setdrawer, run) {
key: 'shopId', key: 'shopId',
hideInForm: true, hideInForm: true,
valueType: 'select', valueType: 'select',
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
options: { options: {
path: '/auth/sysShop/getShopSelectionByFactory', path: '/auth/sysShop/getAllShopSelection',
linkParams: { linkParams: {
factoryId: '', factoryId: '',
}, },
...@@ -122,8 +197,9 @@ function getcolumns(setdrawer, run) { ...@@ -122,8 +197,9 @@ function getcolumns(setdrawer, run) {
hideInSearch: true, hideInSearch: true,
valueType: 'digit', valueType: 'digit',
hideInForm: { hideInForm: {
checkLoop: [1], checkLoop: [1, undefined],
}, },
precision: 0,
}, },
{ {
title: '下次点检日期', title: '下次点检日期',
...@@ -131,6 +207,9 @@ function getcolumns(setdrawer, run) { ...@@ -131,6 +207,9 @@ function getcolumns(setdrawer, run) {
key: 'planCheckDateList', key: 'planCheckDateList',
hideInForm: true, hideInForm: true,
valueType: 'dateRange', valueType: 'dateRange',
render: (text, row, _, action) => {
return <span>{row.planCheckDate}</span>;
},
}, },
{ {
title: '状态', title: '状态',
...@@ -153,32 +232,10 @@ function getcolumns(setdrawer, run) { ...@@ -153,32 +232,10 @@ function getcolumns(setdrawer, run) {
}, },
], ],
}, },
{
title: '启用/停用',
dataIndex: 'checkEnable',
key: 'checkEnable',
hideInForm: true,
hideInSearch: true,
valueType: 'switch',
render: (text, row, _, action) => {
return <Popconfirm
title="是否开启或停用?"
onConfirm={() => {
if (row.checkEnable == 1) {
run({ url: "/check/umEquipmentCheckPlan/enable", params: { id: row.id, checkEnable: 2 } })
}
}}
okText="确定"
cancelText="取消"
>
< Switch checked={row.checkEnable == 1 ? true : false} checkedChildren="开启" unCheckedChildren="停用" defaultChecked={false} />
</Popconfirm>
}
},
{ {
title: '选择设备', title: '选择设备',
dataIndex: 'equipmentId', dataIndex: 'paramList',
key: 'equipmentId', key: 'paramList',
formItemProps: { formItemProps: {
rules: [ rules: [
{ {
...@@ -193,6 +250,9 @@ function getcolumns(setdrawer, run) { ...@@ -193,6 +250,9 @@ function getcolumns(setdrawer, run) {
colProps: { colProps: {
span: 24, span: 24,
}, },
path: '/asset/equipment/list/user/shop',
columns,
hideInDescriptions: true,
}, },
], ],
pathconfig: { pathconfig: {
...@@ -215,6 +275,25 @@ function getcolumns(setdrawer, run) { ...@@ -215,6 +275,25 @@ function getcolumns(setdrawer, run) {
title: '点检计划单号', title: '点检计划单号',
dataIndex: 'checkNo', dataIndex: 'checkNo',
key: 'checkNo', key: 'checkNo',
render: (text, row, _, action) => {
return (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
title: '详情',
val: 'detail',
type: 'detail',
title: '详细信息',
item: row,
}));
}}
>
{row?.checkNo}
</a>
);
},
}, },
{ {
title: '设备编号', title: '设备编号',
...@@ -230,7 +309,12 @@ function getcolumns(setdrawer, run) { ...@@ -230,7 +309,12 @@ function getcolumns(setdrawer, run) {
title: '工厂名称', title: '工厂名称',
dataIndex: 'factoryName', dataIndex: 'factoryName',
key: 'factoryId', key: 'factoryId',
hideInForm: true,
valueType: 'select', valueType: 'select',
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
options: { options: {
path: '/auth/sysFactory/getAllFactorySelection', path: '/auth/sysFactory/getAllFactorySelection',
params: {}, params: {},
...@@ -240,10 +324,17 @@ function getcolumns(setdrawer, run) { ...@@ -240,10 +324,17 @@ function getcolumns(setdrawer, run) {
title: '车间名称', title: '车间名称',
dataIndex: 'shopName', dataIndex: 'shopName',
key: 'shopId', key: 'shopId',
hideInForm: true,
valueType: 'select', valueType: 'select',
fieldProps: {
placeholder: '请选择',
showSearch: true,
},
options: { options: {
path: '/auth/sysShop/getShopSelectionByFactory', path: '/auth/sysShop/getAllShopSelection',
params: {}, linkParams: {
factoryId: '',
},
}, },
}, },
{ {
...@@ -289,6 +380,9 @@ function getcolumns(setdrawer, run) { ...@@ -289,6 +380,9 @@ function getcolumns(setdrawer, run) {
dataIndex: 'endDate', dataIndex: 'endDate',
key: 'endDateList', key: 'endDateList',
valueType: 'dateRange', valueType: 'dateRange',
render: (text, row, _, action) => {
return <span>{row.endDate}</span>;
},
}, },
{ {
title: '状态', title: '状态',
......
This diff is collapsed.
...@@ -17,7 +17,7 @@ function Project({ equipmentCheckStandardId }) { ...@@ -17,7 +17,7 @@ function Project({ equipmentCheckStandardId }) {
let pathconf = procolumns(setdrawer)?.pathconfig ?? {}; let pathconf = procolumns(setdrawer)?.pathconfig ?? {};
return pathconf; return pathconf;
}, []); }, []);
const { run, loading } = useRequest(doFetch, { const { run, loading, runAsync } = useRequest(doFetch, {
manual: true, manual: true,
onSuccess: (res, params) => { onSuccess: (res, params) => {
if (res?.code == '0000') { if (res?.code == '0000') {
...@@ -82,8 +82,8 @@ function Project({ equipmentCheckStandardId }) { ...@@ -82,8 +82,8 @@ function Project({ equipmentCheckStandardId }) {
title: '是否删除?', title: '是否删除?',
okText: '确认', okText: '确认',
cancelText: '取消', cancelText: '取消',
onConfirm: () => { onConfirm: async () => {
run({ url: pathconfig?.delete || '/delete', params: { id: row?.id } }); await runAsync({ url: pathconfig?.delete || '/delete', params: { id: row?.id } });
}, },
}} }}
btn={{ btn={{
...@@ -120,6 +120,7 @@ function Project({ equipmentCheckStandardId }) { ...@@ -120,6 +120,7 @@ function Project({ equipmentCheckStandardId }) {
addconfig={{ addconfig={{
// access: 'sysDepartment_save', // access: 'sysDepartment_save',
btn: { btn: {
type: 'primary',
disabled: false, disabled: false,
onClick: () => { onClick: () => {
setdrawer((s) => ({ setdrawer((s) => ({
...@@ -152,11 +153,11 @@ function Project({ equipmentCheckStandardId }) { ...@@ -152,11 +153,11 @@ function Project({ equipmentCheckStandardId }) {
})); }));
}} }}
{...drawer} {...drawer}
onFinish={(vals) => { onFinish={async (vals) => {
if (drawer?.val == 'add') { if (drawer?.val == 'add') {
run({ url: pathconfig?.add || '/add', params: { ...vals, equipmentCheckStandardId } }); await runAsync({ url: pathconfig?.add || '/add', params: { ...vals, equipmentCheckStandardId } });
} else if (drawer?.val == 'edit') { } else if (drawer?.val == 'edit') {
run({ url: pathconfig?.edit || '/edit', params: { ...vals, id: drawer?.item?.id, equipmentCheckStandardId } }); await runAsync({ url: pathconfig?.edit || '/edit', params: { ...vals, id: drawer?.item?.id, equipmentCheckStandardId } });
} }
}} }}
/> />
......
...@@ -17,7 +17,7 @@ function Standard(props) { ...@@ -17,7 +17,7 @@ function Standard(props) {
let pathconf = getcolumns(setdrawer)?.pathconfig ?? {}; let pathconf = getcolumns(setdrawer)?.pathconfig ?? {};
return pathconf; return pathconf;
}, []); }, []);
const { run, loading } = useRequest(doFetch, { const { run, loading, runAsync } = useRequest(doFetch, {
manual: true, manual: true,
onSuccess: (res, params) => { onSuccess: (res, params) => {
if (res?.code == '0000') { if (res?.code == '0000') {
...@@ -103,8 +103,8 @@ function Standard(props) { ...@@ -103,8 +103,8 @@ function Standard(props) {
title: '是否删除?', title: '是否删除?',
okText: '确认', okText: '确认',
cancelText: '取消', cancelText: '取消',
onConfirm: () => { onConfirm: async () => {
run({ url: pathconfig?.delete || '/delete', params: { id: row?.id } }); await runAsync({ url: pathconfig?.delete || '/delete', params: { id: row?.id } });
}, },
}} }}
btn={{ btn={{
...@@ -144,6 +144,7 @@ function Standard(props) { ...@@ -144,6 +144,7 @@ function Standard(props) {
addconfig={{ addconfig={{
// access: 'sysDepartment_save', // access: 'sysDepartment_save',
btn: { btn: {
type: 'primary',
disabled: false, disabled: false,
onClick: () => { onClick: () => {
setdrawer((s) => ({ setdrawer((s) => ({
...@@ -175,11 +176,11 @@ function Standard(props) { ...@@ -175,11 +176,11 @@ function Standard(props) {
})); }));
}} }}
{...drawer} {...drawer}
onFinish={(vals) => { onFinish={async (vals) => {
if (drawer?.val == 'add') { if (drawer?.val == 'add') {
run({ url: pathconfig?.add || '/add', params: { ...vals } }); await runAsync({ url: pathconfig?.add || '/add', params: { ...vals } });
} else if (drawer?.val == 'edit') { } else if (drawer?.val == 'edit') {
run({ url: pathconfig?.edit || '/edit', params: { ...vals, id: drawer?.item?.id } }); await runAsync({ url: pathconfig?.edit || '/edit', params: { ...vals, id: drawer?.item?.id } });
} }
}} }}
> >
......
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