From c2de45a493ba4a8d848dea0672c497abf9f2bc0c Mon Sep 17 00:00:00 2001 From: zhangminghua Date: Mon, 5 Dec 2022 10:55:21 +0800 Subject: [PATCH 01/10] =?UTF-8?q?(*)=E5=90=88=E5=90=8C=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E8=A1=A8=E5=AD=97=E6=AE=B5=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/report/achievement.js | 2 ++ api/app/lib/models/contract_detail.js | 35 ++++++++++++++++--- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/api/app/lib/controllers/report/achievement.js b/api/app/lib/controllers/report/achievement.js index 8cfedb1..ac5e40e 100644 --- a/api/app/lib/controllers/report/achievement.js +++ b/api/app/lib/controllers/report/achievement.js @@ -346,6 +346,7 @@ async function getContractDetail(ctx) { where[keywordTarget] = { $iLike: `%${keyword}%` }; } let contractDetail = await models.ContractDetail.findAndCountAll({ + attributes: { exclude: ['iscopy', 'hiredate', 'regularDate'] }, where: where, offset: Number(page) * Number(limit), limit: Number(limit), @@ -394,6 +395,7 @@ async function exportContractDetail(ctx) { try { const { models } = ctx.fs.dc; let exportData = await models.ContractDetail.findAll({ + attributes: { exclude: ['iscopy', 'hiredate', 'regularDate'] }, order: [['id', 'ASC']] }); const { utils: { simpleExcelDown, contractDetailsColumnKeys } } = ctx.app.fs; diff --git a/api/app/lib/models/contract_detail.js b/api/app/lib/models/contract_detail.js index 2959cb1..531e203 100644 --- a/api/app/lib/models/contract_detail.js +++ b/api/app/lib/models/contract_detail.js @@ -16,12 +16,12 @@ module.exports = dc => { autoIncrement: true }, year: { - type: DataTypes.STRING, + type: DataTypes.INTEGER, allowNull: false, defaultValue: null, comment: "年度", primaryKey: false, - field: "year ", + field: "year", autoIncrement: false }, serialNo: { @@ -402,13 +402,13 @@ module.exports = dc => { field: "cus_province", autoIncrement: false }, - cusArea: { + itemArea: { type: DataTypes.STRING, allowNull: true, defaultValue: null, comment: "项目所在地", primaryKey: false, - field: "cus_area", + field: "item_area", autoIncrement: false }, text: { @@ -419,6 +419,33 @@ module.exports = dc => { primaryKey: false, field: "text", autoIncrement: false + }, + iscopy: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "是否可复制的业务路径", + primaryKey: false, + field: "iscopy", + autoIncrement: false + }, + hiredate: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "入职时间", + primaryKey: false, + field: "hiredate", + autoIncrement: false + }, + regularDate: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: "转正时间", + primaryKey: false, + field: "regular_date", + autoIncrement: false } }, { tableName: "contract_detail", From 3fe2d863d957a31218400f3201f0091b506b4454 Mon Sep 17 00:00:00 2001 From: wenlele Date: Mon, 5 Dec 2022 14:04:03 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E5=90=AF=E5=8A=A8=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/config.js b/web/config.js index cc4aa5b..ed385c1 100644 --- a/web/config.js +++ b/web/config.js @@ -12,7 +12,7 @@ dev && console.log('\x1B[33m%s\x1b[0m', '请遵循并及时更新 readme.md, args.option(['p', 'port'], '启动端口'); args.option(['u', 'api-url'], 'webapi的URL'); args.option('apiHrUrl', 'webapi的URL 外网可访问'); -args.option(['d', 'domain'], 'web domain'); +args.option(['d', 'domain'], '项企的顶级域名 domain'); args.option('webPepUrl', '企业管理 web'); @@ -43,6 +43,8 @@ const ANXINCLOUD_PM_SERVICES = process.env.ANXINCLOUD_PM_SERVICES || flags.pmrs; if ( !API_URL || !API_DC_URL + || !WEB_PEP_URL + || !FS_REPORT_DOMAIN || !ANXINCLOUD_QINIU_AK || !ANXINCLOUD_QINIU_SK || !ANXINCLOUD_QINIU_BUCKET_RESOURCE || !ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURCE ) { console.log('缺少启动参数,异常退出'); From d30bb5a2c6038b968045d56f0d7feec4b63beca5 Mon Sep 17 00:00:00 2001 From: wenlele Date: Mon, 5 Dec 2022 14:11:43 +0800 Subject: [PATCH 03/10] FS_PEP_DOMAIN --- web/config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/config.js b/web/config.js index ed385c1..76d3bdf 100644 --- a/web/config.js +++ b/web/config.js @@ -28,7 +28,7 @@ const flags = args.parse(process.argv); const API_URL = process.env.API_URL || flags.apiUrl; const API_DC_URL = process.env.API_DC_URL || flags.apiHrUrl; -const FS_REPORT_DOMAIN = process.FS_REPORT_DOMAIN || flags.domain; +const FS_PEP_DOMAIN = process.FS_REPORT_DOMAIN || flags.domain; const WEB_PEP_URL = process.env.WEB_PEP_URL || flags.webPepUrl; // 七牛 @@ -44,7 +44,7 @@ if ( !API_URL || !API_DC_URL || !WEB_PEP_URL - || !FS_REPORT_DOMAIN + || !FS_PEP_DOMAIN || !ANXINCLOUD_QINIU_AK || !ANXINCLOUD_QINIU_SK || !ANXINCLOUD_QINIU_BUCKET_RESOURCE || !ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURCE ) { console.log('缺少启动参数,异常退出'); @@ -85,7 +85,7 @@ const product = { service: { url: ANXINCLOUD_PM_SERVICES }, - domain: FS_REPORT_DOMAIN, + domain: FS_PEP_DOMAIN, webPepUrl: WEB_PEP_URL } }, { From 7c6c6fe112e0718a954bfbe4cd258c7e08953f83 Mon Sep 17 00:00:00 2001 From: zhangminghua Date: Mon, 5 Dec 2022 14:59:02 +0800 Subject: [PATCH 04/10] =?UTF-8?q?(*)=E5=BC=80=E7=A5=A8=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/sections/business/constants/index.js | 2 +- .../performanceReport/contractDetails.jsx | 2 +- .../importInvoicingDetailsModal.js | 84 +++++++++++++++++-- .../performanceReport/invoicingDetails.jsx | 5 +- 4 files changed, 83 insertions(+), 10 deletions(-) diff --git a/web/client/src/sections/business/constants/index.js b/web/client/src/sections/business/constants/index.js index c0fd58b..43e8e2c 100644 --- a/web/client/src/sections/business/constants/index.js +++ b/web/client/src/sections/business/constants/index.js @@ -47,7 +47,7 @@ export const contractDetailsColumnKeys = { industry: '行业', source: '信息来源', cusProvince: '客户省份', - cusArea: '项目所在地', + itemArea: '项目所在地', text: '备注', } diff --git a/web/client/src/sections/business/containers/performanceReport/contractDetails.jsx b/web/client/src/sections/business/containers/performanceReport/contractDetails.jsx index 3556a56..bb47784 100644 --- a/web/client/src/sections/business/containers/performanceReport/contractDetails.jsx +++ b/web/client/src/sections/business/containers/performanceReport/contractDetails.jsx @@ -35,7 +35,7 @@ const ContractDetails = (props) => { columns.push({ title: columnKeys[key], dataIndex: key, key: key, render: (text, record) => text === 0 ? text : text ? text : '-', - width: 32 + columnKeys[key].length * 32 + width: 60 + columnKeys[key].length * 16 }); break; } diff --git a/web/client/src/sections/business/containers/performanceReport/importInvoicingDetailsModal.js b/web/client/src/sections/business/containers/performanceReport/importInvoicingDetailsModal.js index cba870b..a571284 100644 --- a/web/client/src/sections/business/containers/performanceReport/importInvoicingDetailsModal.js +++ b/web/client/src/sections/business/containers/performanceReport/importInvoicingDetailsModal.js @@ -4,22 +4,35 @@ import { connect } from 'react-redux'; import { Modal, Form, Button, Notification } from '@douyinfe/semi-ui'; import { IconUpload } from '@douyinfe/semi-icons'; import XLSX from 'xlsx'; +import moment from 'moment'; import { invoicingDetailsColumnKeys } from '../../constants/index'; +const ColumnDateKey = ['invoiceDate']; +const ColumnDateName = ['开票日期']; //下载模板和上传文件读取 const ImportInvoicingDetailsModal = props => { const { dispatch, actions, onCancel } = props; - const { humanAffairs } = actions; + const { businessManagement } = actions; const [msg, setMsg] = useState(''); const [loading, setLoading] = useState(''); const [postData, setPostData] = useState([]); + const [uploadAble, setUploadAble] = useState(false); + const [allNumbers, setAllNumbers] = useState([]); //初始化 useEffect(() => { + //查询明细表已存在编号数据接口通用 + dispatch(businessManagement.getReceivedNumbers({ tableModel: 'InvoiceDetail' })).then(r => { + if (r.success) { + setUploadAble(true); + setAllNumbers(r.payload.data); + } + }) }, []); const confirm = () => { if (postData.length) { setLoading(true) - dispatch(humanAffairs.addSalesMemberBulk(postData)).then(res => { + //导入明细接口通用 + dispatch(businessManagement.importBackDetails(postData, { tableModel: 'InvoiceDetail' })).then(res => { if (res.success) { onCancel() } @@ -94,9 +107,29 @@ const ImportInvoicingDetailsModal = props => { }) } + const judgeNullTime = (v) => { + //注意的点:xlsx将excel中的时间内容解析后,会小一天 + //如2020/8/1,xlsx会解析成 Fri Jul 31 2020 23:59:17 GMT+0800 小了43秒 + let a = new Date(v); + a.setTime(a.getTime() + 43 * 1000); + return v ? a : null; + } - const judgeNull = (value) => { - return value ? String(value).trim().replace(/\s*/g, "") : null; + const judgeTimeValid = (time) => { + let valid = true; + if (!time) { + return valid;//可以不填 + } + const ymd = /^((19|20)[0-9]{2})[\/\-]((0[1-9])|(1[0-2]))[\/\-]((0[1-9])|((1|2)[0-9])|(3[0-1]))$/;//年月日 + if (time instanceof Date) { + let timeStr = moment(time).format('YYYY/MM/DD'); + if (!ymd.test(timeStr)) { + valid = false; + } + } else { + valid = false; + } + return valid; } return ( @@ -137,12 +170,51 @@ const ImportInvoicingDetailsModal = props => { return } let postData = []; + let yearPattern = /^(19|20)\d{2}$/;//1900-2099年 + let zzsPattern = /^[+]{0,1}(\d+)$/;//正整数 for (let i = 0; i < res.length; i++) { let d = res[i]; let obj = {}; Object.keys(invoicingDetailsColumnKeys).map(key => { - obj[key] = d[invoicingDetailsColumnKeys[key]] || ''; + //日期验证“开票日期” + if (ColumnDateKey.indexOf(key) != -1) {//两个时间 + obj[key] = judgeNullTime(d[invoicingDetailsColumnKeys[key]]); + } else { + obj[key] = d[invoicingDetailsColumnKeys[key]] || null; + } }) + //年度 序号 编号必填 + if (!obj.year || !obj.serialNo || !obj.number) { + error(`第${i + 2}行【年度】、【序号】、【编号】存在空值,请填写`) + return + } + //年度 + if (obj.year && !yearPattern.test(obj.year)) { + error(`第${i + 2}行【年度】填写错误`) + return + } + //序号 正整数 + if (obj.serialNo && !zzsPattern.test(obj.serialNo)) { + error(`第${i + 2}行【序号】填写错误,需要为非负整数`) + return + } + let exist = allNumbers.find(m => m.number == obj.number);//数据库中 已有该编号 + if (exist) { + error(`第${i + 2}行的【编号】在系统中已存在`) + return + } + if (postData.some(p => p.number == obj.number)) {//编号 唯一 + error(`第${i + 2}行【编号】重复,请更改后重新上传`) + return + } + + for (let k = 0; k < ColumnDateKey.length; k++) { + let cValid = judgeTimeValid(obj[ColumnDateKey[k]]); + if (!cValid) { + error(`第${i + 2}行【${ColumnDateName[k]}】错误,请填写yyyy/mm/dd格式`) + return + } + } postData.push(obj); } setPostData(postData) @@ -151,7 +223,7 @@ const ImportInvoicingDetailsModal = props => { onSuccess({ message: msg }) }) }}> - diff --git a/web/client/src/sections/business/containers/performanceReport/invoicingDetails.jsx b/web/client/src/sections/business/containers/performanceReport/invoicingDetails.jsx index 9a76a9b..717b0e6 100644 --- a/web/client/src/sections/business/containers/performanceReport/invoicingDetails.jsx +++ b/web/client/src/sections/business/containers/performanceReport/invoicingDetails.jsx @@ -34,8 +34,8 @@ const InvoicingDetails = (props) => { default: columns.push({ title: columnKeys[key], dataIndex: key, key: key, - render: (text, record) => text === 0 ? text : text ? text : '—', - width: 32 + columnKeys[key].length * 16 + render: (text, record) => text === 0 ? text : text ? text : '-', + width: 60 + columnKeys[key].length * 16 }); break; } @@ -216,6 +216,7 @@ const InvoicingDetails = (props) => { importModalV ? { setImportModalV(false); + getInvoicingDetailData(); }} /> : '' } { From 350e7ce6dd8b198ebcf3aa461577b2badd0e105e Mon Sep 17 00:00:00 2001 From: wuqun Date: Mon, 5 Dec 2022 15:00:52 +0800 Subject: [PATCH 05/10] =?UTF-8?q?(*)=E4=B8=9A=E7=BB=A9=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E8=A1=A8=20=E8=A1=A8=E6=A8=A1=E5=9E=8B=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/models/performance_detail.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api/app/lib/models/performance_detail.js b/api/app/lib/models/performance_detail.js index 59aa6e1..39bc1d7 100644 --- a/api/app/lib/models/performance_detail.js +++ b/api/app/lib/models/performance_detail.js @@ -230,6 +230,15 @@ module.exports = dc => { primaryKey: false, field: "isreproduce", autoIncrement: false + }, + contractNo: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: "", + comment: "合同编号", + primaryKey: false, + field: "contract_no", + autoIncrement: false } }, { tableName: "performance_detail", From ea664a13bf3fa7be39e18a25eafebe51be11b863 Mon Sep 17 00:00:00 2001 From: wuqun Date: Mon, 5 Dec 2022 15:28:23 +0800 Subject: [PATCH 06/10] =?UTF-8?q?(*)=E9=94=80=E5=94=AE=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E5=88=86=E5=B8=83=E6=98=8E=E7=BB=86=20=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/report/index.js | 2 +- .../containers/salesReport/salesDistributionDetails.jsx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/api/app/lib/controllers/report/index.js b/api/app/lib/controllers/report/index.js index ac36f7c..460b1cf 100644 --- a/api/app/lib/controllers/report/index.js +++ b/api/app/lib/controllers/report/index.js @@ -58,7 +58,7 @@ async function getSalersReport(ctx) { const salersRes = await clickHouse.hr.query(` SELECT * from sales_distribution as sales ${innerSelectQuery} - order by id asc + order by id desc ${!toExport && limit ? `LIMIT ${limit}` : ''} ${!toExport && limit && page ? 'OFFSET ' + parseInt(limit) * parseInt(page) : ''} `).toPromise() diff --git a/web/client/src/sections/business/containers/salesReport/salesDistributionDetails.jsx b/web/client/src/sections/business/containers/salesReport/salesDistributionDetails.jsx index 101c3f5..853adf1 100644 --- a/web/client/src/sections/business/containers/salesReport/salesDistributionDetails.jsx +++ b/web/client/src/sections/business/containers/salesReport/salesDistributionDetails.jsx @@ -14,6 +14,7 @@ const SalesDistributionDetails = (props) => { const [limits, setLimits] = useState()//每页实际条数 const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息 const [tableData, setTableData] = useState([]); + const [loading, setLoading] = useState(false) const [exportUrl, setExportUrl] = useState('') const page = useRef(query.page); function seachValueChange(value) { @@ -29,11 +30,13 @@ const SalesDistributionDetails = (props) => { }, [query]) function getMemberSearchList() { + setLoading(true); let kt = keywordTarget == 'place' ? '' : keywordTarget; let k = keywordTarget == 'place' ? '' : keyword; let placeSearch = keywordTarget == 'place' ? keyword : ''; dispatch(businessManagement.getSalesList({ keywordTarget: kt, keyword: k, placeSearch, ...query })).then(r => { if (r.success) { + setLoading(false); setTableData(r.payload?.data?.rows); setLimits(r.payload?.data?.count) } @@ -233,7 +236,7 @@ const SalesDistributionDetails = (props) => {
From 610ecee267a56bcc5919fe753a310183fdb305be Mon Sep 17 00:00:00 2001 From: wuqun Date: Mon, 5 Dec 2022 15:59:43 +0800 Subject: [PATCH 07/10] =?UTF-8?q?(*)=E4=B8=9A=E7=BB=A9=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E8=A1=A8=20=E5=AD=97=E6=AE=B5=E7=B1=BB=E5=9E=8B=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/report/achievement.js | 4 ++-- api/app/lib/models/performance_detail.js | 4 ++-- .../containers/performanceReport/achievementDetails.jsx | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/api/app/lib/controllers/report/achievement.js b/api/app/lib/controllers/report/achievement.js index ac5e40e..b36ad3f 100644 --- a/api/app/lib/controllers/report/achievement.js +++ b/api/app/lib/controllers/report/achievement.js @@ -237,8 +237,8 @@ async function exportAchievementDetail(ctx, dataList) { const { utils: { simpleExcelDown } } = ctx.app.fs; let exportData = [] for (let { dataValues: item } of dataList) { - item.isApproval = JSON.stringify(item.isApproval) === 'null' ? '-' : item.isApproval ? '是' : '否'; - item.reproducible = JSON.stringify(item.reproducible) === 'null' ? '-' : item.reproducible ? '是' : '否'; + //item.isApproval = JSON.stringify(item.isApproval) === 'null' ? '-' : item.isApproval ? '是' : '否'; + //item.reproducible = JSON.stringify(item.reproducible) === 'null' ? '-' : item.reproducible ? '是' : '否'; exportData.push(item) } const fileName = `业绩明细表_${moment().format('YYYYMMDDHHmmss')}` + '.xlsx' diff --git a/api/app/lib/models/performance_detail.js b/api/app/lib/models/performance_detail.js index 39bc1d7..5382ab2 100644 --- a/api/app/lib/models/performance_detail.js +++ b/api/app/lib/models/performance_detail.js @@ -97,7 +97,7 @@ module.exports = dc => { autoIncrement: false }, isApproval: { - type: DataTypes.BOOLEAN, + type: DataTypes.STRING, allowNull: true, defaultValue: null, comment: "价格是否特批:根据折算比例-《合同明细表》推\n算(100%——“是”;其他为否)", @@ -196,7 +196,7 @@ module.exports = dc => { autoIncrement: false }, reproducible: { - type: DataTypes.BOOLEAN, + type: DataTypes.STRING, allowNull: true, defaultValue: null, comment: "是否可复制的业务路径:《合同评审》表单获取", diff --git a/web/client/src/sections/business/containers/performanceReport/achievementDetails.jsx b/web/client/src/sections/business/containers/performanceReport/achievementDetails.jsx index 3fa9b7a..0355cb8 100644 --- a/web/client/src/sections/business/containers/performanceReport/achievementDetails.jsx +++ b/web/client/src/sections/business/containers/performanceReport/achievementDetails.jsx @@ -47,8 +47,7 @@ const AchievementDetails = (props) => { default: columns.push({ title: columnKeys[key], dataIndex: key, key: key, width: 120, - render: (text, record) => ['isApproval', 'reproducible'].indexOf(key) != -1 ? JSON.stringify(text) === 'null' ? '-' : text ? '是' : '否' - : text === 0 ? text : text ? text : '-' + render: (text, record) => text === 0 ? text : text ? text : '-' }); break; } From b7c72b9589af53ffa1aa152f1ec7384fec2acd54 Mon Sep 17 00:00:00 2001 From: wuqun Date: Mon, 5 Dec 2022 16:19:57 +0800 Subject: [PATCH 08/10] =?UTF-8?q?(*)=E5=9B=9E=E6=AC=BE=E5=92=8C=E4=B8=9A?= =?UTF-8?q?=E7=BB=A9=20=E5=AF=BC=E5=85=A5=E6=97=B6=E9=97=B4=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../performanceReport/importAchieveModal.jsx | 30 +++++++++---------- .../performanceReport/importBackModal.jsx | 30 +++++++++---------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/web/client/src/sections/business/containers/performanceReport/importAchieveModal.jsx b/web/client/src/sections/business/containers/performanceReport/importAchieveModal.jsx index a3f754b..6c8ac66 100644 --- a/web/client/src/sections/business/containers/performanceReport/importAchieveModal.jsx +++ b/web/client/src/sections/business/containers/performanceReport/importAchieveModal.jsx @@ -96,17 +96,17 @@ const ImportAchieveModal = props => { } - const judgeNull = (value) => { - return value ? String(value).trim().replace(/\s*/g, "") : null; - } + // const judgeNull = (value) => { + // return value ? String(value).trim().replace(/\s*/g, "") : null; + // } - const judgeNullTime = (v) => { - //注意的点:xlsx将excel中的时间内容解析后,会小一天 - //如2020/8/1,xlsx会解析成 Fri Jul 31 2020 23:59:17 GMT+0800 小了43秒 - let a = new Date(v); - a.setTime(a.getTime() + 43 * 1000); - return v ? a : null; - } + // const judgeNullTime = (v) => { + // //注意的点:xlsx将excel中的时间内容解析后,会小一天 + // //如2020/8/1,xlsx会解析成 Fri Jul 31 2020 23:59:17 GMT+0800 小了43秒 + // let a = new Date(v); + // a.setTime(a.getTime() + 43 * 1000); + // return v ? a : null; + // } const judgeTimeValid = (time) => { let valid = true; @@ -168,11 +168,11 @@ const ImportAchieveModal = props => { let d = res[i]; let obj = {}; Object.keys(achievementColumnKeys).map(key => { - if (key === 'recConDate') {//收到合同日期 - obj[key] = judgeNullTime(d[achievementColumnKeys[key]]); - } else { - obj[key] = d[achievementColumnKeys[key]] || null; - } + // if (key === 'recConDate') {//收到合同日期 + // obj[key] = judgeNullTime(d[achievementColumnKeys[key]]); + // } else { + obj[key] = d[achievementColumnKeys[key]] || null; + //} }) let tValid = judgeTimeValid(obj.recConDate); if (!tValid) { diff --git a/web/client/src/sections/business/containers/performanceReport/importBackModal.jsx b/web/client/src/sections/business/containers/performanceReport/importBackModal.jsx index 9b3f34f..c241ab7 100644 --- a/web/client/src/sections/business/containers/performanceReport/importBackModal.jsx +++ b/web/client/src/sections/business/containers/performanceReport/importBackModal.jsx @@ -104,17 +104,17 @@ const ImportBackModal = props => { } - const judgeNull = (value) => { - return value ? String(value).trim().replace(/\s*/g, "") : null; - } + // const judgeNull = (value) => { + // return value ? String(value).trim().replace(/\s*/g, "") : null; + // } - const judgeNullTime = (v) => { - //注意的点:xlsx将excel中的时间内容解析后,会小一天 - //如2020/8/1,xlsx会解析成 Fri Jul 31 2020 23:59:17 GMT+0800 小了43秒 - let a = new Date(v); - a.setTime(a.getTime() + 43 * 1000); - return v ? a : null; - } + // const judgeNullTime = (v) => { + // //注意的点:xlsx将excel中的时间内容解析后,会小一天 + // //如2020/8/1,xlsx会解析成 Fri Jul 31 2020 23:59:17 GMT+0800 小了43秒 + // let a = new Date(v); + // a.setTime(a.getTime() + 43 * 1000); + // return v ? a : null; + // } const judgeTimeValid = (time) => { let valid = true; @@ -178,11 +178,11 @@ const ImportBackModal = props => { let d = res[i]; let obj = {}; Object.keys(backMoneyColumnKeys).map(key => { - if (['receivableDate', 'incomeConfirmdate'].indexOf(key) != -1) {//两个时间 - obj[key] = judgeNullTime(d[backMoneyColumnKeys[key]]); - } else { - obj[key] = d[backMoneyColumnKeys[key]] || null; - } + // if (['receivableDate', 'incomeConfirmdate'].indexOf(key) != -1) {//两个时间 + // obj[key] = judgeNullTime(d[backMoneyColumnKeys[key]]); + // } else { + obj[key] = d[backMoneyColumnKeys[key]] || null; + //} }) //年度 序号 编号必填 if (!obj.year || !obj.serialNo || !obj.number) { From 6d1c6e6d3d77602808c65ba76bdcb1d6c9c57ff6 Mon Sep 17 00:00:00 2001 From: zhangminghua Date: Mon, 5 Dec 2022 16:22:08 +0800 Subject: [PATCH 09/10] =?UTF-8?q?(*)=E5=90=88=E5=90=8C=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E3=80=81=E5=BC=80=E7=A5=A8=E6=98=8E=E7=BB=86=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../importContractDetailsModal.js | 17 ++--------------- .../importInvoicingDetailsModal.js | 15 +-------------- 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/web/client/src/sections/business/containers/performanceReport/importContractDetailsModal.js b/web/client/src/sections/business/containers/performanceReport/importContractDetailsModal.js index 0dab5c7..fb8f29e 100644 --- a/web/client/src/sections/business/containers/performanceReport/importContractDetailsModal.js +++ b/web/client/src/sections/business/containers/performanceReport/importContractDetailsModal.js @@ -107,14 +107,6 @@ const ImportContractDetailsModal = props => { }) } - const judgeNullTime = (v) => { - //注意的点:xlsx将excel中的时间内容解析后,会小一天 - //如2020/8/1,xlsx会解析成 Fri Jul 31 2020 23:59:17 GMT+0800 小了43秒 - let a = new Date(v); - a.setTime(a.getTime() + 43 * 1000); - return v ? a : null; - } - const judgeTimeValid = (time) => { let valid = true; if (!time) { @@ -176,12 +168,7 @@ const ImportContractDetailsModal = props => { let d = res[i]; let obj = {}; Object.keys(contractDetailsColumnKeys).map(key => { - //四个日期验证“申请日期”、“收到合同日期”、“验收日期”、“收入确认时间” - if (ColumnDateKey.indexOf(key) != -1) {//两个时间 - obj[key] = judgeNullTime(d[contractDetailsColumnKeys[key]]); - } else { - obj[key] = d[contractDetailsColumnKeys[key]] || null; - } + obj[key] = d[contractDetailsColumnKeys[key]] || null; }) //年度 序号 编号必填 if (!obj.year || !obj.serialNo || !obj.number) { @@ -207,7 +194,7 @@ const ImportContractDetailsModal = props => { error(`第${i + 2}行【编号】重复,请更改后重新上传`) return } - + //日期验证“申请日期”、“收到合同日期”、“验收日期”、“收入确认时间” for (let k = 0; k < ColumnDateKey.length; k++) { let cValid = judgeTimeValid(obj[ColumnDateKey[k]]); if (!cValid) { diff --git a/web/client/src/sections/business/containers/performanceReport/importInvoicingDetailsModal.js b/web/client/src/sections/business/containers/performanceReport/importInvoicingDetailsModal.js index a571284..cba46d0 100644 --- a/web/client/src/sections/business/containers/performanceReport/importInvoicingDetailsModal.js +++ b/web/client/src/sections/business/containers/performanceReport/importInvoicingDetailsModal.js @@ -107,14 +107,6 @@ const ImportInvoicingDetailsModal = props => { }) } - const judgeNullTime = (v) => { - //注意的点:xlsx将excel中的时间内容解析后,会小一天 - //如2020/8/1,xlsx会解析成 Fri Jul 31 2020 23:59:17 GMT+0800 小了43秒 - let a = new Date(v); - a.setTime(a.getTime() + 43 * 1000); - return v ? a : null; - } - const judgeTimeValid = (time) => { let valid = true; if (!time) { @@ -176,12 +168,7 @@ const ImportInvoicingDetailsModal = props => { let d = res[i]; let obj = {}; Object.keys(invoicingDetailsColumnKeys).map(key => { - //日期验证“开票日期” - if (ColumnDateKey.indexOf(key) != -1) {//两个时间 - obj[key] = judgeNullTime(d[invoicingDetailsColumnKeys[key]]); - } else { - obj[key] = d[invoicingDetailsColumnKeys[key]] || null; - } + obj[key] = d[invoicingDetailsColumnKeys[key]] || null; }) //年度 序号 编号必填 if (!obj.year || !obj.serialNo || !obj.number) { From 7d80601abca5a34ddeac489d783f2f418ffb90b9 Mon Sep 17 00:00:00 2001 From: wenlele Date: Tue, 6 Dec 2022 09:27:07 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=80=80=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/client/src/layout/components/header/index.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/client/src/layout/components/header/index.jsx b/web/client/src/layout/components/header/index.jsx index 919a679..afc0e67 100644 --- a/web/client/src/layout/components/header/index.jsx +++ b/web/client/src/layout/components/header/index.jsx @@ -84,7 +84,7 @@ const Header = (props) => { ) } })} -
+ {/*
@@ -97,7 +97,7 @@ const Header = (props) => { }}> 退出
-
+
*/} {/*