From bab113b5e3bc074c7486609d97275dd1b3d5a44f Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Mon, 3 Jul 2023 09:32:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=A1=A8=E5=8D=95=20?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sections/workOrder/containers/aboutMe.jsx | 31 ++++++++++++------- .../workOrder/containers/initiated.jsx | 29 +++++++++++------ .../sections/workOrder/containers/receipt.jsx | 29 +++++++++++------ .../workOrder/containers/stayDoWorkOrder.jsx | 31 ++++++++++++------- web/client/src/utils/parseProcessData.js | 5 ++- 5 files changed, 82 insertions(+), 43 deletions(-) diff --git a/web/client/src/sections/workOrder/containers/aboutMe.jsx b/web/client/src/sections/workOrder/containers/aboutMe.jsx index 5b19ca9..89b2914 100644 --- a/web/client/src/sections/workOrder/containers/aboutMe.jsx +++ b/web/client/src/sections/workOrder/containers/aboutMe.jsx @@ -74,19 +74,28 @@ const Rest = (props) => { render: (text, record, index) => { return record?.pomsNeedData?.title?.value || '' } - }, { - title: '关联项目', + }, + // { + // title: '关联项目', + // dataIndex: 'pomsProject', + // render: (text, record, index) => { + // const pomsProjectId = record?.pomsNeedData?.pomsProjectId?.value + // if (pomsProjectId) { + // const corProject = pomsProjectBasicAll.find(p => p.value == pomsProjectId) + // return corProject?.label || '' + // } else { + // return '' + // } + // } + // }, + { + title: '项目名称', dataIndex: 'pomsProject', render: (text, record, index) => { - const pomsProjectId = record?.pomsNeedData?.pomsProjectId?.value - if (pomsProjectId) { - const corProject = pomsProjectBasicAll.find(p => p.value == pomsProjectId) - return corProject?.label || '' - } else { - return '' - } + return record?.pomsNeedData?.projectName?.value || '' } - }, { + }, + { title: '申请人', dataIndex: 'applyerName', }, { @@ -132,7 +141,7 @@ const Rest = (props) => { layout="horizontal" style={{ position: "relative", width: "100%", flex: 1 }} onSubmit={(values) => { - if (values?.applyTimes?.length) { + if (values?.applyTimes?.length) { values.applyTimes = [moment(values?.applyTimes[0]).format('YYYY-MM-DD HH:mm:ss'), moment(values?.applyTimes[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss')] } backlogData({ ...values, limit: 10, page: 0 }) diff --git a/web/client/src/sections/workOrder/containers/initiated.jsx b/web/client/src/sections/workOrder/containers/initiated.jsx index e0cb349..252966a 100644 --- a/web/client/src/sections/workOrder/containers/initiated.jsx +++ b/web/client/src/sections/workOrder/containers/initiated.jsx @@ -66,19 +66,28 @@ const Rest = (props) => { render: (text, record, index) => { return record?.pomsNeedData?.title?.value || '' } - }, { - title: '关联项目', + }, + // { + // title: '关联项目', + // dataIndex: 'pomsProject', + // render: (text, record, index) => { + // const pomsProjectId = record?.pomsNeedData?.pomsProjectId?.value + // if (pomsProjectId) { + // const corProject = pomsProjectBasicAll.find(p => p.value == pomsProjectId) + // return corProject?.label || '' + // } else { + // return '' + // } + // } + // }, + { + title: '项目名称', dataIndex: 'pomsProject', render: (text, record, index) => { - const pomsProjectId = record?.pomsNeedData?.pomsProjectId?.value - if (pomsProjectId) { - const corProject = pomsProjectBasicAll.find(p => p.value == pomsProjectId) - return corProject?.label || '' - } else { - return '' - } + return record?.pomsNeedData?.projectName?.value || '' } - }, { + }, + { title: '申请人', dataIndex: 'applyerName', }, { diff --git a/web/client/src/sections/workOrder/containers/receipt.jsx b/web/client/src/sections/workOrder/containers/receipt.jsx index 3b9f7fd..ff59868 100644 --- a/web/client/src/sections/workOrder/containers/receipt.jsx +++ b/web/client/src/sections/workOrder/containers/receipt.jsx @@ -77,19 +77,28 @@ const Rest = (props) => { render: (text, record, index) => { return record?.pomsNeedData?.title?.value || '' } - }, { - title: '关联项目', + }, + // { + // title: '关联项目', + // dataIndex: 'pomsProject', + // render: (text, record, index) => { + // const pomsProjectId = record?.pomsNeedData?.pomsProjectId?.value + // if (pomsProjectId) { + // const corProject = pomsProjectBasicAll.find(p => p.value == pomsProjectId) + // return corProject?.label || '' + // } else { + // return '' + // } + // } + // }, + { + title: '项目名称', dataIndex: 'pomsProject', render: (text, record, index) => { - const pomsProjectId = record?.pomsNeedData?.pomsProjectId?.value - if (pomsProjectId) { - const corProject = pomsProjectBasicAll.find(p => p.value == pomsProjectId) - return corProject?.label || '' - } else { - return '' - } + return record?.pomsNeedData?.projectName?.value || '' } - }, { + }, + { title: '申请人', dataIndex: 'application', }, { diff --git a/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx b/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx index 48ed020..ca8d657 100644 --- a/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx +++ b/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx @@ -65,19 +65,28 @@ const Rest = (props) => { render: (text, record, index) => { return record?.pomsNeedData?.title?.value || '' } - }, { - title: '关联项目', + }, + // { + // title: '关联项目', + // dataIndex: 'pomsProject', + // render: (text, record, index) => { + // const pomsProjectId = record?.pomsNeedData?.pomsProjectId?.value + // if (pomsProjectId) { + // const corProject = pomsProjectBasicAll.find(p => p.value == pomsProjectId) + // return corProject?.label || '' + // } else { + // return '' + // } + // } + // }, + { + title: '项目名称', dataIndex: 'pomsProject', render: (text, record, index) => { - const pomsProjectId = record?.pomsNeedData?.pomsProjectId?.value - if (pomsProjectId) { - const corProject = pomsProjectBasicAll.find(p => p.value == pomsProjectId) - return corProject?.label || '' - } else { - return '' - } + return record?.pomsNeedData?.projectName?.value || '' } - }, { + }, + { title: '申请人', dataIndex: 'applyerName', }, { @@ -117,7 +126,7 @@ const Rest = (props) => { layout="horizontal" style={{ position: "relative", width: "100%", flex: 1 }} onSubmit={(values) => { - if (values?.applyTimes?.length) { + if (values?.applyTimes?.length) { values.applyTimes = [moment(values?.applyTimes[0]).format('YYYY-MM-DD HH:mm:ss'), moment(values?.applyTimes[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss')] } backlogData(values) diff --git a/web/client/src/utils/parseProcessData.js b/web/client/src/utils/parseProcessData.js index 76afa0d..c22d8cc 100644 --- a/web/client/src/utils/parseProcessData.js +++ b/web/client/src/utils/parseProcessData.js @@ -43,7 +43,7 @@ const dataRecursionObj = (dataObj, index, needData, lastKeyObj, nd) => { const keyObj = needData[nd].schemaPath[index] if (dataObj.hasOwnProperty(keyObj.prKey)) { if (lastKeyObj.prKey == keyObj.prKey) { - let gotValue = dataObj[keyObj.prKey] + let gotValue = dataObj[keyObj.prKey] if (keyObj.enum && !needData[nd].fromDataSource) { let vIndex = keyObj.enum.findIndex(ke => ke == gotValue) gotValue = keyObj.enumNames[vIndex] @@ -89,6 +89,9 @@ export const parseProcessData = (applyDetail, pomsNeedData = { keyWord: '关联项目', fromDataSource: true }, + projectName: { + keyWord: '项目名称', + }, expectTime: { keyWord: '期望完成时间' }