commit
This commit is contained in:
+73
-34
@@ -13,8 +13,18 @@ layout("/layouts/platform.html"){
|
||||
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix=":"
|
||||
class="flow-task-form">
|
||||
<el-descriptions :column="2" border>
|
||||
|
||||
<el-descriptions-item label="经费类型">
|
||||
<el-descriptions-item label="报销身份" :span="2">
|
||||
<el-form-item label="报销身份" prop="reimbursementIdentity"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-radio-group v-model="formData.reimbursementIdentity"
|
||||
@change="reimbursementIdentityChange" :disabled="taskId">
|
||||
<el-radio border :label="i.code" :key="i.code" v-for="i in reimbursementIdentityOption">
|
||||
{{i.name}}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="经费类型" :span="2">
|
||||
<el-form-item label="经费类型" prop="outlayManageSource"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-radio-group v-model="formData.outlayManageSource" @change="outlayManageSourceChange">
|
||||
@@ -37,7 +47,8 @@ layout("/layouts/platform.html"){
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="所属协会"
|
||||
v-if="['ACTIVITY_BUDGET_TYPE_THREE'].includes(formData.outlayManageSource)">
|
||||
v-if="['ACTIVITY_BUDGET_TYPE_THREE'].includes(formData.outlayManageSource)
|
||||
||formData.reimbursementIdentity==='club'">
|
||||
<el-form-item label="所属协会" prop="clubId"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-select
|
||||
@@ -94,7 +105,7 @@ layout("/layouts/platform.html"){
|
||||
<el-descriptions-item label="扣款预算">
|
||||
<el-form-item prop="deductionBudgetId" label="扣款预算"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-select v-model="formData.deductionBudgetId" style="width: 100%;"
|
||||
<el-select v-model="formData.deductionBudgetId" style="width: 100%;"
|
||||
filterable placeholder="选择扣款预算">
|
||||
<el-option
|
||||
v-for="item in filteredBudgetOption"
|
||||
@@ -105,11 +116,11 @@ layout("/layouts/platform.html"){
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
v-if="formData.activityReimbursementMode!=='activity'
|
||||
&&
|
||||
['ACTIVITY_BUDGET_TYPE_THREE'].includes(formData.outlayManageSource)"></el-descriptions-item>
|
||||
|
||||
<el-descriptions-item v-if="formData.activityReimbursementMode!=='activity'
|
||||
&&
|
||||
!['ACTIVITY_BUDGET_TYPE_THREE'].includes(formData.outlayManageSource)
|
||||
&&formData.reimbursementIdentity!=='club'"></el-descriptions-item>
|
||||
|
||||
<template v-if="formData.activityReimbursementMode==='activity'">
|
||||
<el-descriptions-item label="实际活动时间">
|
||||
@@ -143,10 +154,6 @@ layout("/layouts/platform.html"){
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
v-if="formData.activityReimbursementMode==='activity'
|
||||
&&
|
||||
['ACTIVITY_BUDGET_TYPE_THREE'].includes(formData.outlayManageSource)"></el-descriptions-item>
|
||||
</template>
|
||||
|
||||
<el-descriptions-item label="费用" :span="2">
|
||||
@@ -327,6 +334,7 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
|
||||
activityOptions: [],
|
||||
reimbursementIdentityOption: [],
|
||||
|
||||
declareDialogVisible: false,
|
||||
|
||||
@@ -347,20 +355,21 @@ layout("/layouts/platform.html"){
|
||||
filteredBudgetOption() {
|
||||
if (this.hasSchoolLevelRole()) {
|
||||
return this.budgetOption;
|
||||
} else if (this.formData.outlayManageSource === "ACTIVITY_BUDGET_TYPE_ONE" &&
|
||||
(this.hasUnionRole() || this.hasClubRole())) {
|
||||
return this.budgetOption.filter(item => {
|
||||
if (this.hasUnionRole() && this.hasClubRole()) {
|
||||
return item.isUnionUse === true || item.isClubUse === true;
|
||||
}
|
||||
else if (this.hasUnionRole()) {
|
||||
return item.isUnionUse === true;
|
||||
}
|
||||
else if (this.hasClubRole()) {
|
||||
return item.isClubUse === true;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
} else if (this.formData.outlayManageSource === "ACTIVITY_BUDGET_TYPE_ONE") {
|
||||
if (this.hasUnionRole() || this.hasClubRole()) {
|
||||
return this.budgetOption.filter(item => {
|
||||
if (this.hasUnionRole() && this.hasClubRole()) {
|
||||
return item.isUnionUse === true || item.isClubUse === true;
|
||||
} else if (this.hasUnionRole()) {
|
||||
return item.isUnionUse === true;
|
||||
} else if (this.hasClubRole()) {
|
||||
return item.isClubUse === true;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}else{
|
||||
return this.budgetOption;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
@@ -385,6 +394,14 @@ layout("/layouts/platform.html"){
|
||||
this.getBudgetByYear()
|
||||
this.getActivityReimbursementByUser()
|
||||
},
|
||||
reimbursementIdentityChange(val) {
|
||||
this.$set(this.formData, "unionId", this.$store.state.user.union.id)
|
||||
if (val === "school") {
|
||||
this.$set(this.formData, "declareUnitName", "校工会")
|
||||
} else if (val === "union") {
|
||||
this.$set(this.formData, "declareUnitName", this.$store.state.user.union.name)
|
||||
}
|
||||
},
|
||||
outlayManageSourceChange(val) {
|
||||
this.$set(this.formData, 'clubId', null)
|
||||
this.$set(this.formData, 'deductionBudgetId', null)
|
||||
@@ -395,13 +412,6 @@ layout("/layouts/platform.html"){
|
||||
if (val === "ACTIVITY_BUDGET_TYPE_ONE" && !this.hasSchoolLevelRole()) {
|
||||
this.$set(this.formData, 'activityReimbursementMode', 'daily')
|
||||
}
|
||||
|
||||
if (val === "ACTIVITY_BUDGET_TYPE_ONE") {
|
||||
this.$set(this.formData, "declareUnitName", "校工会")
|
||||
} else if (val === "ACTIVITY_BUDGET_TYPE_TWO") {
|
||||
this.$set(this.formData, "unionId", this.$store.state.user.union.id)
|
||||
this.$set(this.formData, "declareUnitName", this.$store.state.user.union.name)
|
||||
}
|
||||
this.getBudgetByYear()
|
||||
this.getActivityReimbursementByUser()
|
||||
},
|
||||
@@ -429,6 +439,14 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
// 保存
|
||||
onSave() {
|
||||
if (this.formData.reimbursementIdentity === 'union' && this.formData.outlayManageSource === "ACTIVITY_BUDGET_TYPE_THREE") {
|
||||
this.$message.error("报销身份如果是分工会,不能报销协会经费!")
|
||||
return
|
||||
}
|
||||
if (this.formData.reimbursementIdentity === 'club' && this.formData.outlayManageSource === "ACTIVITY_BUDGET_TYPE_TWO") {
|
||||
this.$message.error("报销身份如果是协会,不能报销分工会经费!")
|
||||
return
|
||||
}
|
||||
this.$confirm("您确定保存吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
@@ -455,6 +473,15 @@ layout("/layouts/platform.html"){
|
||||
this.$message.error("请填写费用!")
|
||||
return
|
||||
}
|
||||
if (this.formData.reimbursementIdentity === 'union' && this.formData.outlayManageSource === "ACTIVITY_BUDGET_TYPE_THREE") {
|
||||
this.$message.error("报销身份如果是分工会,不能报销协会经费!")
|
||||
return
|
||||
}
|
||||
if (this.formData.reimbursementIdentity === 'club' && this.formData.outlayManageSource === "ACTIVITY_BUDGET_TYPE_TWO") {
|
||||
this.$message.error("报销身份如果是协会,不能报销分工会经费!")
|
||||
return
|
||||
}
|
||||
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
@@ -578,7 +605,7 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
|
||||
if (this.$auth.hasPermission('activityReimbursement.apply.schoolHas')) {
|
||||
const allCodes = [ "ACTIVITY_BUDGET_TYPE_TWO", "ACTIVITY_BUDGET_TYPE_THREE"]
|
||||
const allCodes = ["ACTIVITY_BUDGET_TYPE_TWO", "ACTIVITY_BUDGET_TYPE_THREE"]
|
||||
allCodes.forEach(code => {
|
||||
const option = resp.find(v => v.code === code)
|
||||
if (option && !budgetTypeCloseOption.some(existing => existing.code === code)) {
|
||||
@@ -603,10 +630,22 @@ layout("/layouts/platform.html"){
|
||||
this.budgetTypeOption = budgetTypeCloseOption
|
||||
})
|
||||
},
|
||||
initReimbursementIdentity() {
|
||||
if (this.$auth.hasPermission('activityReimbursement.apply.schoolHas')) {
|
||||
this.reimbursementIdentityOption.push({name: "校工会", code: "school"})
|
||||
}
|
||||
if (this.$auth.hasPermission('activityReimbursement.apply.unionHas')) {
|
||||
this.reimbursementIdentityOption.push({name: "分工会", code: "union"})
|
||||
}
|
||||
if (this.$auth.hasPermission('activityReimbursement.apply.clubHas')) {
|
||||
this.reimbursementIdentityOption.push({name: "协会", code: "club"})
|
||||
}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.clubOption = await this.$businessTool.listCLubByRole()
|
||||
this.initBudgetType()
|
||||
this.initReimbursementIdentity()
|
||||
if (this.bizId) {
|
||||
this.findOne()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user