bug修改,统计查询限制

This commit is contained in:
zhaoxiao
2021-09-28 09:46:31 +08:00
parent 68ea19b3f8
commit 55880ac6ba
9 changed files with 482 additions and 36 deletions
@@ -167,6 +167,7 @@
<invoicing-stage-module
ref="invoicingStage"
:visible.sync="invoicingStageVisible"
:mail-contacts-id="companyDataById.packContactId"
:project-id="selectProjectId"
:project-type="selectProjectType"
:project-name="selectProjectName"
@@ -42,9 +42,17 @@
</a-col>
<a-col :xl="10" :lg="11" :md="12" :sm="24">
<a-form-item label="应收款项" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入应收款项" v-model="queryParam.allMoney" class="query-group-cust"></a-input>
<a-input
placeholder="请输入应收款项"
v-model="queryParam.allMoney"
class="query-group-cust"
@change="checkMoney('start')"></a-input>
<span class="query-group-split-cust"></span>
<a-input placeholder="请输入应收款项" v-model="queryParam.allMoneyTwo" class="query-group-cust"></a-input>
<a-input
placeholder="请输入应收款项"
v-model="queryParam.allMoneyTwo"
class="query-group-cust"
@change="checkMoney('end')"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -68,7 +76,8 @@
</a-col>
<a-col :xl="4" :lg="7" :md="8" :sm="24">
<span class="table-page-search-submitButtons">
<a-button type="primary" icon="search" @click="searchQuery" v-has="'wholeInstituteStatistics:search'">查询</a-button>
<a-button type="primary" icon="search" @click="searchQuery"
v-has="'wholeInstituteStatistics:search'">查询</a-button>
<a-button icon="reload" @click="searchReset" class="reset-button">重置</a-button>
</span>
</a-col>
@@ -79,7 +88,9 @@
<!-- 操作按钮区域-->
<div class="table-operator">
<a-button type="primary" icon="export" @click="handleExportXls('全所统计')" v-has="'wholeInstituteStatistics:export'">导出</a-button>
<a-button type="primary" icon="export" @click="handleExportXls('全所统计')"
v-has="'wholeInstituteStatistics:export'">导出
</a-button>
</div>
<!-- 操作按钮区域-end-->
@@ -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
}
}
}
}
</script>
@@ -31,9 +31,17 @@
</a-col>
<a-col :xl="10" :lg="11" :md="12" :sm="24">
<a-form-item label="应收款项" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入应收款项" v-model="queryParam.allMoney" class="query-group-cust"></a-input>
<a-input
placeholder="请输入应收款项"
v-model="queryParam.allMoney"
class="query-group-cust"
@change="checkMoney('start')"></a-input>
<span class="query-group-split-cust"></span>
<a-input placeholder="请输入应收款项" v-model="queryParam.allMoneyTwo" class="query-group-cust"></a-input>
<a-input
placeholder="请输入应收款项"
v-model="queryParam.allMoneyTwo"
class="query-group-cust"
@change="checkMoney('end')"></a-input>
</a-form-item>
</a-col>
<a-col :xl="4" :lg="7" :md="8" :sm="24">
@@ -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
}
}
}
}
</script>
@@ -19,9 +19,17 @@
</a-col>
<a-col :xl="10" :lg="11" :md="12" :sm="24">
<a-form-item label="应收款项" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入应收款项" v-model="queryParam.allMoney" class="query-group-cust"></a-input>
<a-input
placeholder="请输入应收款项"
v-model="queryParam.allMoney"
class="query-group-cust"
@change="checkMoney('start')"></a-input>
<span class="query-group-split-cust"></span>
<a-input placeholder="请输入应收款项" v-model="queryParam.allMoneyTwo" class="query-group-cust"></a-input>
<a-input
placeholder="请输入应收款项"
v-model="queryParam.allMoneyTwo"
class="query-group-cust"
@change="checkMoney('end')"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -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
}
}
}
}
@@ -29,9 +29,17 @@
</a-col>
<a-col :xl="10" :lg="11" :md="12" :sm="24">
<a-form-item label="应收款项" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入应收款项" v-model="queryParam.allMoney" class="query-group-cust"></a-input>
<a-input
placeholder="请输入应收款项"
v-model="queryParam.allMoney"
class="query-group-cust"
@change="checkMoney('start')"></a-input>
<span class="query-group-split-cust"></span>
<a-input placeholder="请输入应收款项" v-model="queryParam.allMoneyTwo" class="query-group-cust"></a-input>
<a-input
placeholder="请输入应收款项"
v-model="queryParam.allMoneyTwo"
class="query-group-cust"
@change="checkMoney('end')"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -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
}
}
}
}
@@ -31,9 +31,17 @@
</a-col>
<a-col :xl="10" :lg="11" :md="12" :sm="24">
<a-form-item label="应收款项" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入应收款项" v-model="queryParam.allMoney" class="query-group-cust"></a-input>
<a-input
placeholder="请输入应收款项"
v-model="queryParam.allMoney"
class="query-group-cust"
@change="checkMoney('start')"></a-input>
<span class="query-group-split-cust"></span>
<a-input placeholder="请输入应收款项" v-model="queryParam.allMoneyTwo" class="query-group-cust"></a-input>
<a-input
placeholder="请输入应收款项"
v-model="queryParam.allMoneyTwo"
class="query-group-cust"
@change="checkMoney('end')"></a-input>
</a-form-item>
</a-col>
<a-col :xl="4" :lg="7" :md="8" :sm="24">
@@ -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
}
}
}
}
@@ -9,7 +9,8 @@
<a-row>
<a-col :xxl="4" :xl="10" :lg="12" :md="12" :sm="24">
<a-form-item label="来款企业" :labelCol="labelCol" :wrapperCol="wrapperCol" style="margin-bottom: -1px">
<company-select :can-add="false" placeholder="请选择来款企业" v-model="queryParam.chargeCompany"></company-select>
<company-select :can-add="false" placeholder="请选择来款企业"
v-model="queryParam.chargeCompany"></company-select>
</a-form-item>
</a-col>
<a-col :xxl="4" :xl="10" :lg="12" :md="12" :sm="24">
@@ -19,14 +20,23 @@
</a-col>
<a-col :xl="10" :lg="11" :md="12" :sm="24">
<a-form-item label="应收款项" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入应收款项" v-model="queryParam.allMoney" class="query-group-cust"></a-input>
<a-input
placeholder="请输入应收款项"
v-model="queryParam.allMoney"
class="query-group-cust"
@change="checkMoney('start')"></a-input>
<span class="query-group-split-cust"></span>
<a-input placeholder="请输入应收款项" v-model="queryParam.allMoneyTwo" class="query-group-cust"></a-input>
<a-input
placeholder="请输入应收款项"
v-model="queryParam.allMoneyTwo"
class="query-group-cust"
@change="checkMoney('end')"></a-input>
</a-form-item>
</a-col>
<a-col :xl="4" :lg="7" :md="8" :sm="24">
<span class="table-page-search-submitButtons">
<a-button type="primary" icon="search" @click="searchQuery" v-has="'companyPaymentStatistics:search'">查询</a-button>
<a-button type="primary" icon="search" @click="searchQuery"
v-has="'companyPaymentStatistics:search'">查询</a-button>
<a-button icon="reload" @click="searchReset" class="reset-button">重置</a-button>
</span>
</a-col>
@@ -37,7 +47,9 @@
<!-- 操作按钮区域-->
<div class="table-operator">
<a-button type="primary" icon="export" @click="handleExportXls('企业来款统计')" v-has="'companyPaymentStatistics:export'">导出</a-button>
<a-button type="primary" icon="export" @click="handleExportXls('企业来款统计')"
v-has="'companyPaymentStatistics:export'">导出
</a-button>
</div>
<!-- 操作按钮区域-end-->
@@ -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
}
}
}
}
@@ -12,11 +12,11 @@
<a-input placeholder="请输入来款单位" v-model="queryParam.chargeCompanyTemporaryName"></a-input>
</a-form-item>
</a-col>
<!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">-->
<!-- <a-form-item label="来款项目" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <a-input placeholder="请输入来款项目" v-model="queryParam.projectName"></a-input>-->
<!-- </a-form-item>-->
</a-col>
<!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">-->
<!-- <a-form-item label="来款项目" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <a-input placeholder="请输入来款项目" v-model="queryParam.projectName"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="来款用途" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag v-model="queryParam.chargeUse" placeholder="请选择来款用途" dictCode="payment_charge_use"/>
@@ -36,9 +36,17 @@
</a-col>
<a-col :xl="10" :lg="11" :md="12" :sm="24">
<a-form-item label="应收款项" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入应收款项" v-model="queryParam.allMoney" class="query-group-cust"></a-input>
<a-input
placeholder="请输入应收款项"
v-model="queryParam.allMoney"
class="query-group-cust"
@change="checkMoney('start')"></a-input>
<span class="query-group-split-cust"></span>
<a-input placeholder="请输入应收款项" v-model="queryParam.allMoneyTwo" class="query-group-cust"></a-input>
<a-input
placeholder="请输入应收款项"
v-model="queryParam.allMoneyTwo"
class="query-group-cust"
@change="checkMoney('end')"></a-input>
</a-form-item>
</a-col>
<a-col :xxl="5" :xl="8" :lg="7" :md="8" :sm="24">
@@ -94,7 +102,7 @@
<a @click="goDetail(record.id)">详情</a>
</span>
<template slot="footer" slot-scope="currentPageData" v-if="dataSource.length > 0">
<template slot="footer" v-if="dataSource.length > 0">
<a-table
size="middle"
@@ -150,7 +158,7 @@ export default {
},
url: {
list: '/project/payWorkingGroupStatistics/listSub',
exportXlsUrl: '/project/payWorkingGroupStatistics/excelSub',
exportXlsUrl: '/project/payWorkingGroupStatistics/excelSub'
},
columns: [
{
@@ -257,7 +265,7 @@ export default {
},
lastQueryParam: {
year: new Date().getFullYear().toString()
},
}
}
},
methods: {
@@ -326,6 +334,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
}
}
}
}
</script>
@@ -19,9 +19,17 @@
</a-col>
<a-col :xl="10" :lg="11" :md="12" :sm="24">
<a-form-item label="应收款项" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入应收款项" v-model="queryParam.allMoney" class="query-group-cust"></a-input>
<a-input
placeholder="请输入应收款项"
v-model="queryParam.allMoney"
class="query-group-cust"
@change="checkMoney('start')"></a-input>
<span class="query-group-split-cust"></span>
<a-input placeholder="请输入应收款项" v-model="queryParam.allMoneyTwo" class="query-group-cust"></a-input>
<a-input
placeholder="请输入应收款项"
v-model="queryParam.allMoneyTwo"
class="query-group-cust"
@change="checkMoney('end')"></a-input>
</a-form-item>
</a-col>
<a-col :xl="4" :lg="7" :md="8" :sm="24">
@@ -299,6 +307,52 @@ export default {
},
true
)
},
/**
* 搜索金额校验
* @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
}
}
}
}