"git@gitlab.aishuhong.com:zhang_jianguo/onn.git" did not exist on "2589b9883ce0f84b58fd278c394122642ebc81a5"
Commit 344202ed authored by cx49085's avatar cx49085
Browse files

增加变量,控制条件,普通查询和同意拒绝之间的耦合;重置数据并且发起请求

parent 28c692ea
......@@ -114,7 +114,7 @@ export default {
this.$message.success("修改成功")
setTimeout(() => {
this.$router.push('/pettyMoneyRecord')
}, 1000);
}, 500);
} else {
this.$message.error(res.msg)
}
......@@ -126,7 +126,7 @@ export default {
this.$message.success("申请成功")
setTimeout(() => {
this.$router.push('/pettyMoneyRecord')
}, 1000);
}, 500);
} else {
this.$message.error(res.msg)
}
......
......@@ -23,7 +23,7 @@
<el-button size="medium" type="primary" icon="el-icon-search" @click="getexamineList(true)">
查询
</el-button>
<el-button size="medium" type="primary" icon="el-icon-refresh-right" @click="examineQuery = {}">重置
<el-button size="medium" type="primary" icon="el-icon-refresh-right" @click="examineQuery = {};getexamineList(false)">重置
</el-button>
<!-- <el-button size="medium" type="success" icon="el-icon-circle-plus-outline" @click="dialogTableVisible = true">添加合同</el-button> -->
</el-form-item>
......@@ -75,7 +75,7 @@
</el-table-column>
</el-table>
<div class="footer">
<el-pagination @current-change="getexamineList" :current-page.sync="examinePageQuery.pageNum"
<el-pagination @current-change="getexamineList()" :current-page.sync="examinePageQuery.pageNum"
:page-size="examinePageQuery.pageSize" layout="total, prev, pager, next"
:total="examinePageQuery.total">
</el-pagination>
......@@ -181,6 +181,7 @@ export default {
pageSize: 10,
total: 0
},
isConditionSelect: false,
approveResult,
pettyStates,
examineList: [],
......@@ -192,16 +193,24 @@ export default {
}
},
mounted() {
this.getexamineList()
this.getexamineList(false)
},
methods: {
getexamineList(isCondition) {
getexamineList(isConditionSelect) {
const params = {
...this.examinePageQuery,
companyId: this.companyId
}
//不能确定是不是条件查询,则根据上一个查询方式进行条件查询或者一般查询
if(isConditionSelect === undefined || isConditionSelect === ''){
this.isConditionSelect && Object.assign(params, this.examineQuery)
//确定是某种查询方式,则更新标记,作为下一次查询的标准
}else{
this.isConditionSelect = isConditionSelect
isConditionSelect && Object.assign(params, this.examineQuery)
}
//组件重用,利用tag来区分查询条件
this.tag === 'unapprove' && (params.pettyApproval = 0)
isCondition && Object.assign(params, this.examineQuery)
selectCompanyPettyRecord(params).then(res => {
if (res.success) {
const { list, total, repaymentCount, approvalPending } = res.data
......
......@@ -14,7 +14,7 @@
<el-button size="medium" type="primary" icon="el-icon-search" @click="getexamineRepayList(true)">
查询
</el-button>
<el-button size="medium" type="primary" icon="el-icon-refresh-right" @click="examineQuery = {}">重置
<el-button size="medium" type="primary" icon="el-icon-refresh-right" @click="examineQuery = {}; getexamineRepayList(false)">重置
</el-button>
<!-- <el-button size="medium" type="success" icon="el-icon-circle-plus-outline" @click="dialogTableVisible = true">添加合同</el-button> -->
</el-form-item>
......@@ -57,7 +57,7 @@
<template slot-scope="scope">
<el-button-group>
<el-button type="success" size="mini" @click="agree(scope.row)">同意</el-button>
<el-button type="warning" size="mini">驳回</el-button>
<el-button type="warning" size="mini" @click="disagree(scope.row)">驳回</el-button>
<!-- <el-button type="primary" size="mini">详情</el-button> -->
</el-button-group>
<!-- <el-button type="text"
......@@ -76,7 +76,7 @@
</el-table-column>
</el-table>
<div class="footer">
<el-pagination @current-change="getexamineRepayList" :current-page.sync="examinePageQuery.pageNum"
<el-pagination @current-change="getexamineRepayList()" :current-page.sync="examinePageQuery.pageNum"
:page-size="examinePageQuery.pageSize" layout="total, prev, pager, next"
:total="examinePageQuery.total">
</el-pagination>
......@@ -85,7 +85,7 @@
</template>
<script>
import { mapGetters } from 'vuex'
import { selectUnrepay, agreeRepay } from '@/api/pettyMoney'
import { selectUnrepay, agreeRepay, rejectRepay } from '@/api/pettyMoney'
import { approveResult, pettyStates } from '../pettyMoneyStaticData'
export default {
props:['pettyApproval'],
......@@ -101,6 +101,7 @@ export default {
pettyName: '',
pettyApproval: '',
},
isConditionSelect: false,
examinePageQuery: {
pageNum: 1,
pageSize: 10,
......@@ -113,15 +114,22 @@ export default {
}
},
mounted() {
this.getexamineRepayList()
this.getexamineRepayList(false)
},
methods: {
getexamineRepayList(isCondition) {
getexamineRepayList(isConditionSelect) {
const params = {
...this.examinePageQuery,
companyId: this.companyId
}
isCondition && Object.assign(params, this.examineQuery)
//不能确定是不是条件查询,则根据上一个查询方式进行条件查询或者一般查询
if(isConditionSelect === undefined || isConditionSelect === ''){
this.isConditionSelect && Object.assign(params, this.examineQuery)
//确定是某种查询方式,则更新标记,作为下一次查询的标准
}else{
this.isConditionSelect = isConditionSelect
isConditionSelect && Object.assign(params, this.examineQuery)
}
selectUnrepay(params).then(res => {
if (res.success) {
const {list, total} = res.data
......@@ -146,7 +154,7 @@ export default {
// return
// }
agree(data){
const {repaymentId, repaymentApproval, pettyId} = data
const {repaymentId, pettyId} = data
const params = {
operationId: this.urId,
repaymentId,
......@@ -161,6 +169,22 @@ export default {
}
})
},
disagree(data){
const {repaymentId, pettyId} = data
const params = {
operationId: this.urId,
repaymentId,
repaymentApproval: 2,
pettyId,
}
rejectRepay(params).then(res => {
if (res.success) {
this.getexamineRepayList()
} else {
this.$message.error("操作失败")
}
})
}
}
}
......
......@@ -20,7 +20,7 @@
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getPettyMoneyList(true)">查询</el-button>
<el-button type="primary" icon="el-icon-refresh-right" @click="pettyMoneyQuery = {}">重置</el-button>
<el-button type="primary" icon="el-icon-refresh-right" @click="pettyMoneyQuery = {}; getPettyMoneyList(false)">重置</el-button>
<!-- <el-button type="success" icon="el-icon-circle-plus-outline" @click="dialogTableVisible = true">添加合同</el-button> -->
</el-form-item>
</el-form>
......@@ -72,7 +72,7 @@
</el-table>
</div>
<div class="footer">
<el-pagination @current-change="getPettyMoneyList" :current-page.sync="pettyMoneyPageQuery.pageNum"
<el-pagination @current-change="getPettyMoneyList()" :current-page.sync="pettyMoneyPageQuery.pageNum"
:page-size="pettyMoneyPageQuery.pageSize" layout="total, prev, pager, next"
:total="pettyMoneyPageQuery.total">
</el-pagination>
......@@ -162,6 +162,7 @@ export default {
data() {
return {
pettyMoneyQuery: {},
isConditionSelect: false,
pettyMoneyPageQuery: {
pageSize: 10,
pageNum: 1,
......@@ -178,7 +179,7 @@ export default {
}
},
mounted() {
this.getPettyMoneyList()
this.getPettyMoneyList(false)
},
methods: {
checkRepayMoney(rule, value, callback) {
......@@ -191,13 +192,20 @@ export default {
callback();
}
},
getPettyMoneyList(isCondition = false) {
getPettyMoneyList(isConditionSelect) {
const params = {
...this.pettyMoneyPageQuery,
companyId: this.companyId,
userId: this.urId
}
isCondition && Object.assign(params, this.pettyMoneyQuery)
//不能确定是不是条件查询,则根据上一个查询方式进行条件查询或者一般查询
if(isConditionSelect === undefined || isConditionSelect === ''){
this.isConditionSelect && Object.assign(params, this.pettyMoneyQuery)
//确定是某种查询方式,则更新标记,作为下一次查询的标准
}else{
this.isConditionSelect = isConditionSelect
isConditionSelect && Object.assign(params, this.pettyMoneyQuery)
}
selectSelfPettyRecord(params).then(res => {
if (res.success) {
this.pettyMoneyPageQuery.total = res.data.total
......
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