diff --git a/src/views/packManagement/PackProjectMaintenance.vue b/src/views/packManagement/PackProjectMaintenance.vue index 45ffaf7..d680c65 100644 --- a/src/views/packManagement/PackProjectMaintenance.vue +++ b/src/views/packManagement/PackProjectMaintenance.vue @@ -167,6 +167,7 @@ - + - + @@ -68,7 +76,8 @@ - 查询 + 查询 重置 @@ -79,7 +88,9 @@
- 导出 + 导出 +
@@ -226,7 +237,7 @@ export default { key: 'rowIndex', width: 120, align: 'center' - }, { + }, { title: '项目名称', align: 'center', // width: 200, @@ -274,7 +285,8 @@ export default { url: { list: '/statistics/allProjectStatistics/list', exportXlsUrl: '/statistics/allProjectStatistics/statistics/excel' - } + }, + validateMoney: true } }, created() { @@ -292,7 +304,6 @@ export default { return } let dom = this.$refs.footTable.$el.querySelectorAll('.ant-table-body')[0] - console.log(this.$refs.footTable.$el.querySelectorAll('.ant-table-body')) dom.addEventListener( 'scroll', () => { @@ -331,6 +342,12 @@ export default { this.ipagination.current = 1 } let params = this.getQueryParams()//查询条件 + if (params.hasOwnProperty.call(params, 'allMoney') && params.hasOwnProperty.call(params, 'allMoneyTwo')) { + if (Number(params.allMoney) > Number(params.allMoneyTwo)) { + this.$message.warn('应收款项范围不正确,请修改') + return + } + } this.loading = true getAction(this.url.list, params).then((res) => { if (res.success) { @@ -373,6 +390,52 @@ export default { } this.loadData(1) }, + /** + * 搜索金额校验 + * @param type 起始范围--start,终止范围--end + */ + checkMoney(type) { + if (type === 'start') { + this.queryParam.allMoney = this.queryParam.allMoney.replace(/[^0-9.]/g, '') + let pointIndex = this.queryParam.allMoney.indexOf('.') + // 包含小数点,保留小数点后两位 + if (pointIndex > -1) { + this.queryParam.allMoney = this.queryParam.allMoney.substr(0, pointIndex + 3) + // 截取整数部分 + let str = this.queryParam.allMoney.slice(0, pointIndex) + // 整数部分大于十位则去掉十位之后的整数部门,并将小数部分拼接 + if (str.length > 10) { + str = str.substr(0, 10) + this.queryParam.allMoney = str + this.queryParam.allMoney.substr(pointIndex, 3) + } + } + // 不包含小数点且输入数字超过十位保留前十位数据 + if (pointIndex === -1 && this.queryParam.allMoney.length > 10) { + this.queryParam.allMoney = this.queryParam.allMoney.substr(0, 10) + } + return + } + if (type === 'end') { + this.queryParam.allMoneyTwo = this.queryParam.allMoneyTwo.replace(/[^0-9.]/g, '') + let pointIndex = this.queryParam.allMoneyTwo.indexOf('.') + // 包含小数点,保留小数点后两位 + if (pointIndex > -1) { + this.queryParam.allMoneyTwo = this.queryParam.allMoneyTwo.substr(0, pointIndex + 3) + // 截取整数部分 + let str = this.queryParam.allMoneyTwo.slice(0, pointIndex) + // 整数部分大于十位则去掉十位之后的整数部门,并将小数部分拼接 + if (str.length > 10) { + str = str.substr(0, 10) + this.queryParam.allMoneyTwo = str + this.queryParam.allMoneyTwo.substr(pointIndex, 3) + } + } + // 不包含小数点且输入数字超过十位保留前十位数据 + if (pointIndex === -1 && this.queryParam.allMoneyTwo.length > 10) { + this.queryParam.allMoneyTwo = this.queryParam.allMoneyTwo.substr(0, 10) + } + return + } + } } } diff --git a/src/views/statisticalReport/departmentStatistics/IndividualPaymentStatisticsDetail.vue b/src/views/statisticalReport/departmentStatistics/IndividualPaymentStatisticsDetail.vue index 1b4db95..6a5acbf 100644 --- a/src/views/statisticalReport/departmentStatistics/IndividualPaymentStatisticsDetail.vue +++ b/src/views/statisticalReport/departmentStatistics/IndividualPaymentStatisticsDetail.vue @@ -31,9 +31,17 @@ - + - + @@ -141,7 +149,7 @@ export default { }, // 给定当年作为来款年份默认查询条件 queryParam: { - year: new Date().getFullYear().toString(), + year: new Date().getFullYear().toString() }, lastQueryParam: { year: new Date().getFullYear().toString() @@ -295,6 +303,52 @@ export default { } this.loadData(1) }, + /** + * 搜索金额校验 + * @param type 起始范围--start,终止范围--end + */ + checkMoney(type) { + if (type === 'start') { + this.queryParam.allMoney = this.queryParam.allMoney.replace(/[^0-9.]/g, '') + let pointIndex = this.queryParam.allMoney.indexOf('.') + // 包含小数点,保留小数点后两位 + if (pointIndex > -1) { + this.queryParam.allMoney = this.queryParam.allMoney.substr(0, pointIndex + 3) + // 截取整数部分 + let str = this.queryParam.allMoney.slice(0, pointIndex) + // 整数部分大于十位则去掉十位之后的整数部门,并将小数部分拼接 + if (str.length > 10) { + str = str.substr(0, 10) + this.queryParam.allMoney = str + this.queryParam.allMoney.substr(pointIndex, 3) + } + } + // 不包含小数点且输入数字超过十位保留前十位数据 + if (pointIndex === -1 && this.queryParam.allMoney.length > 10) { + this.queryParam.allMoney = this.queryParam.allMoney.substr(0, 10) + } + return + } + if (type === 'end') { + this.queryParam.allMoneyTwo = this.queryParam.allMoneyTwo.replace(/[^0-9.]/g, '') + let pointIndex = this.queryParam.allMoneyTwo.indexOf('.') + // 包含小数点,保留小数点后两位 + if (pointIndex > -1) { + this.queryParam.allMoneyTwo = this.queryParam.allMoneyTwo.substr(0, pointIndex + 3) + // 截取整数部分 + let str = this.queryParam.allMoneyTwo.slice(0, pointIndex) + // 整数部分大于十位则去掉十位之后的整数部门,并将小数部分拼接 + if (str.length > 10) { + str = str.substr(0, 10) + this.queryParam.allMoneyTwo = str + this.queryParam.allMoneyTwo.substr(pointIndex, 3) + } + } + // 不包含小数点且输入数字超过十位保留前十位数据 + if (pointIndex === -1 && this.queryParam.allMoneyTwo.length > 10) { + this.queryParam.allMoneyTwo = this.queryParam.allMoneyTwo.substr(0, 10) + } + return + } + } } } diff --git a/src/views/statisticalReport/departmentStatistics/IndividualPaymentStatisticsList.vue b/src/views/statisticalReport/departmentStatistics/IndividualPaymentStatisticsList.vue index 0614128..3b331a7 100644 --- a/src/views/statisticalReport/departmentStatistics/IndividualPaymentStatisticsList.vue +++ b/src/views/statisticalReport/departmentStatistics/IndividualPaymentStatisticsList.vue @@ -19,9 +19,17 @@ - + - + @@ -313,6 +321,52 @@ export default { year: new Date().getFullYear().toString() } this.loadData(1) + }, + /** + * 搜索金额校验 + * @param type 起始范围--start,终止范围--end + */ + checkMoney(type) { + if (type === 'start') { + this.queryParam.allMoney = this.queryParam.allMoney.replace(/[^0-9.]/g, '') + let pointIndex = this.queryParam.allMoney.indexOf('.') + // 包含小数点,保留小数点后两位 + if (pointIndex > -1) { + this.queryParam.allMoney = this.queryParam.allMoney.substr(0, pointIndex + 3) + // 截取整数部分 + let str = this.queryParam.allMoney.slice(0, pointIndex) + // 整数部分大于十位则去掉十位之后的整数部门,并将小数部分拼接 + if (str.length > 10) { + str = str.substr(0, 10) + this.queryParam.allMoney = str + this.queryParam.allMoney.substr(pointIndex, 3) + } + } + // 不包含小数点且输入数字超过十位保留前十位数据 + if (pointIndex === -1 && this.queryParam.allMoney.length > 10) { + this.queryParam.allMoney = this.queryParam.allMoney.substr(0, 10) + } + return + } + if (type === 'end') { + this.queryParam.allMoneyTwo = this.queryParam.allMoneyTwo.replace(/[^0-9.]/g, '') + let pointIndex = this.queryParam.allMoneyTwo.indexOf('.') + // 包含小数点,保留小数点后两位 + if (pointIndex > -1) { + this.queryParam.allMoneyTwo = this.queryParam.allMoneyTwo.substr(0, pointIndex + 3) + // 截取整数部分 + let str = this.queryParam.allMoneyTwo.slice(0, pointIndex) + // 整数部分大于十位则去掉十位之后的整数部门,并将小数部分拼接 + if (str.length > 10) { + str = str.substr(0, 10) + this.queryParam.allMoneyTwo = str + this.queryParam.allMoneyTwo.substr(pointIndex, 3) + } + } + // 不包含小数点且输入数字超过十位保留前十位数据 + if (pointIndex === -1 && this.queryParam.allMoneyTwo.length > 10) { + this.queryParam.allMoneyTwo = this.queryParam.allMoneyTwo.substr(0, 10) + } + return + } } } } diff --git a/src/views/statisticalReport/departmentStatistics/ProjectPaymentStatisticsList.vue b/src/views/statisticalReport/departmentStatistics/ProjectPaymentStatisticsList.vue index 46ba664..87902f1 100644 --- a/src/views/statisticalReport/departmentStatistics/ProjectPaymentStatisticsList.vue +++ b/src/views/statisticalReport/departmentStatistics/ProjectPaymentStatisticsList.vue @@ -29,9 +29,17 @@ - + - + @@ -262,7 +270,7 @@ export default { treeDepartData: [], // 部门数据 replaceFields: { value: 'orgCode' - }, + } } }, created() { @@ -358,6 +366,52 @@ export default { year: new Date().getFullYear().toString() } this.loadData(1) + }, + /** + * 搜索金额校验 + * @param type 起始范围--start,终止范围--end + */ + checkMoney(type) { + if (type === 'start') { + this.queryParam.allMoney = this.queryParam.allMoney.replace(/[^0-9.]/g, '') + let pointIndex = this.queryParam.allMoney.indexOf('.') + // 包含小数点,保留小数点后两位 + if (pointIndex > -1) { + this.queryParam.allMoney = this.queryParam.allMoney.substr(0, pointIndex + 3) + // 截取整数部分 + let str = this.queryParam.allMoney.slice(0, pointIndex) + // 整数部分大于十位则去掉十位之后的整数部门,并将小数部分拼接 + if (str.length > 10) { + str = str.substr(0, 10) + this.queryParam.allMoney = str + this.queryParam.allMoney.substr(pointIndex, 3) + } + } + // 不包含小数点且输入数字超过十位保留前十位数据 + if (pointIndex === -1 && this.queryParam.allMoney.length > 10) { + this.queryParam.allMoney = this.queryParam.allMoney.substr(0, 10) + } + return + } + if (type === 'end') { + this.queryParam.allMoneyTwo = this.queryParam.allMoneyTwo.replace(/[^0-9.]/g, '') + let pointIndex = this.queryParam.allMoneyTwo.indexOf('.') + // 包含小数点,保留小数点后两位 + if (pointIndex > -1) { + this.queryParam.allMoneyTwo = this.queryParam.allMoneyTwo.substr(0, pointIndex + 3) + // 截取整数部分 + let str = this.queryParam.allMoneyTwo.slice(0, pointIndex) + // 整数部分大于十位则去掉十位之后的整数部门,并将小数部分拼接 + if (str.length > 10) { + str = str.substr(0, 10) + this.queryParam.allMoneyTwo = str + this.queryParam.allMoneyTwo.substr(pointIndex, 3) + } + } + // 不包含小数点且输入数字超过十位保留前十位数据 + if (pointIndex === -1 && this.queryParam.allMoneyTwo.length > 10) { + this.queryParam.allMoneyTwo = this.queryParam.allMoneyTwo.substr(0, 10) + } + return + } } } } diff --git a/src/views/statisticalReport/enterprisePaymentStatistics/EnterprisePaymentStatisticsDetail.vue b/src/views/statisticalReport/enterprisePaymentStatistics/EnterprisePaymentStatisticsDetail.vue index dcde8ff..929677a 100644 --- a/src/views/statisticalReport/enterprisePaymentStatistics/EnterprisePaymentStatisticsDetail.vue +++ b/src/views/statisticalReport/enterprisePaymentStatistics/EnterprisePaymentStatisticsDetail.vue @@ -31,9 +31,17 @@ - + - + @@ -150,7 +158,7 @@ export default { customRender: function (t, r, index) { return parseInt(index) + 1 } - },{ + }, { title: '来款项目', align: 'center', dataIndex: 'projectName', @@ -295,6 +303,52 @@ export default { year: new Date().getFullYear().toString() } this.loadData(1) + }, + /** + * 搜索金额校验 + * @param type 起始范围--start,终止范围--end + */ + checkMoney(type) { + if (type === 'start') { + this.queryParam.allMoney = this.queryParam.allMoney.replace(/[^0-9.]/g, '') + let pointIndex = this.queryParam.allMoney.indexOf('.') + // 包含小数点,保留小数点后两位 + if (pointIndex > -1) { + this.queryParam.allMoney = this.queryParam.allMoney.substr(0, pointIndex + 3) + // 截取整数部分 + let str = this.queryParam.allMoney.slice(0, pointIndex) + // 整数部分大于十位则去掉十位之后的整数部门,并将小数部分拼接 + if (str.length > 10) { + str = str.substr(0, 10) + this.queryParam.allMoney = str + this.queryParam.allMoney.substr(pointIndex, 3) + } + } + // 不包含小数点且输入数字超过十位保留前十位数据 + if (pointIndex === -1 && this.queryParam.allMoney.length > 10) { + this.queryParam.allMoney = this.queryParam.allMoney.substr(0, 10) + } + return + } + if (type === 'end') { + this.queryParam.allMoneyTwo = this.queryParam.allMoneyTwo.replace(/[^0-9.]/g, '') + let pointIndex = this.queryParam.allMoneyTwo.indexOf('.') + // 包含小数点,保留小数点后两位 + if (pointIndex > -1) { + this.queryParam.allMoneyTwo = this.queryParam.allMoneyTwo.substr(0, pointIndex + 3) + // 截取整数部分 + let str = this.queryParam.allMoneyTwo.slice(0, pointIndex) + // 整数部分大于十位则去掉十位之后的整数部门,并将小数部分拼接 + if (str.length > 10) { + str = str.substr(0, 10) + this.queryParam.allMoneyTwo = str + this.queryParam.allMoneyTwo.substr(pointIndex, 3) + } + } + // 不包含小数点且输入数字超过十位保留前十位数据 + if (pointIndex === -1 && this.queryParam.allMoneyTwo.length > 10) { + this.queryParam.allMoneyTwo = this.queryParam.allMoneyTwo.substr(0, 10) + } + return + } } } } diff --git a/src/views/statisticalReport/enterprisePaymentStatistics/EnterprisePaymentStatisticsList.vue b/src/views/statisticalReport/enterprisePaymentStatistics/EnterprisePaymentStatisticsList.vue index dd8c58f..395aa20 100644 --- a/src/views/statisticalReport/enterprisePaymentStatistics/EnterprisePaymentStatisticsList.vue +++ b/src/views/statisticalReport/enterprisePaymentStatistics/EnterprisePaymentStatisticsList.vue @@ -9,7 +9,8 @@ - + @@ -19,14 +20,23 @@ - + - + - 查询 + 查询 重置 @@ -37,7 +47,9 @@
- 导出 + 导出 +
@@ -207,7 +219,7 @@ export default { }, lastQueryParam: { year: new Date().getFullYear().toString() - }, + } } }, mounted() { @@ -314,6 +326,52 @@ export default { year: new Date().getFullYear().toString() } this.loadData(1) + }, + /** + * 搜索金额校验 + * @param type 起始范围--start,终止范围--end + */ + checkMoney(type) { + if (type === 'start') { + this.queryParam.allMoney = this.queryParam.allMoney.replace(/[^0-9.]/g, '') + let pointIndex = this.queryParam.allMoney.indexOf('.') + // 包含小数点,保留小数点后两位 + if (pointIndex > -1) { + this.queryParam.allMoney = this.queryParam.allMoney.substr(0, pointIndex + 3) + // 截取整数部分 + let str = this.queryParam.allMoney.slice(0, pointIndex) + // 整数部分大于十位则去掉十位之后的整数部门,并将小数部分拼接 + if (str.length > 10) { + str = str.substr(0, 10) + this.queryParam.allMoney = str + this.queryParam.allMoney.substr(pointIndex, 3) + } + } + // 不包含小数点且输入数字超过十位保留前十位数据 + if (pointIndex === -1 && this.queryParam.allMoney.length > 10) { + this.queryParam.allMoney = this.queryParam.allMoney.substr(0, 10) + } + return + } + if (type === 'end') { + this.queryParam.allMoneyTwo = this.queryParam.allMoneyTwo.replace(/[^0-9.]/g, '') + let pointIndex = this.queryParam.allMoneyTwo.indexOf('.') + // 包含小数点,保留小数点后两位 + if (pointIndex > -1) { + this.queryParam.allMoneyTwo = this.queryParam.allMoneyTwo.substr(0, pointIndex + 3) + // 截取整数部分 + let str = this.queryParam.allMoneyTwo.slice(0, pointIndex) + // 整数部分大于十位则去掉十位之后的整数部门,并将小数部分拼接 + if (str.length > 10) { + str = str.substr(0, 10) + this.queryParam.allMoneyTwo = str + this.queryParam.allMoneyTwo.substr(pointIndex, 3) + } + } + // 不包含小数点且输入数字超过十位保留前十位数据 + if (pointIndex === -1 && this.queryParam.allMoneyTwo.length > 10) { + this.queryParam.allMoneyTwo = this.queryParam.allMoneyTwo.substr(0, 10) + } + return + } } } } diff --git a/src/views/statisticalReport/workingGroupPaymentStatistics/WorkingGroupPaymentStatisticsDetail.vue b/src/views/statisticalReport/workingGroupPaymentStatistics/WorkingGroupPaymentStatisticsDetail.vue index 8e145f9..8e32309 100644 --- a/src/views/statisticalReport/workingGroupPaymentStatistics/WorkingGroupPaymentStatisticsDetail.vue +++ b/src/views/statisticalReport/workingGroupPaymentStatistics/WorkingGroupPaymentStatisticsDetail.vue @@ -12,11 +12,11 @@
- - - - - + + + + + @@ -36,9 +36,17 @@ - + - + @@ -94,7 +102,7 @@ 详情 -