bug修改
This commit is contained in:
+13
-13
@@ -14,11 +14,11 @@ layout("/layouts/platform.html"){
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
|
||||
|
||||
<search-item label="申请人">
|
||||
<el-input placeholder="请输入申请人工号或姓名" clearable v-model="pageForm.searchKeyword"></el-input>
|
||||
</search-item>
|
||||
|
||||
|
||||
<template v-if="$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN, BRANCH_UNION_ADMIN')">
|
||||
<search-item label="所属工会">
|
||||
<el-select @change="flushUnits" @clear="flushUnits" clearable
|
||||
@@ -30,7 +30,7 @@ layout("/layouts/platform.html"){
|
||||
v-for="item in unions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
|
||||
<search-item label="所属单位">
|
||||
<el-select clearable filterable placeholder="所属单位"
|
||||
style="width: 100%;" v-model="pageForm.unitId">
|
||||
@@ -39,7 +39,7 @@ layout("/layouts/platform.html"){
|
||||
</el-select>
|
||||
</search-item>
|
||||
</template>
|
||||
|
||||
|
||||
<template v-if="$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN, CLUB_MANAGER, CLUB_PRESIDENT')">
|
||||
<search-item label="所属协会">
|
||||
<el-select clearable filterable placeholder="所属协会"
|
||||
@@ -51,17 +51,17 @@ layout("/layouts/platform.html"){
|
||||
</template>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="申报记录">
|
||||
<el-button size="small" type="primary" @click="onApply">活动申报</el-button>
|
||||
</table-tool>
|
||||
|
||||
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
|
||||
ref="table" row-key="id" style="width: 100%">
|
||||
<el-table-column :index="indexMethod" header-align="center" label="序号"
|
||||
type="index" width="60px"></el-table-column>
|
||||
|
||||
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
@@ -92,25 +92,25 @@ layout("/layouts/platform.html"){
|
||||
<el-button v-if="row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">撤回
|
||||
</el-button>
|
||||
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onDelete(row.id)" size="mini" type="danger">删除</el-button>
|
||||
|
||||
|
||||
<el-button v-if="row.instanceState === 20" @click="doExport(row)" size="mini" type="primary">导出</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
|
||||
<template #view>
|
||||
<info ref="infoRef"></info>
|
||||
</template>
|
||||
|
||||
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("../common/info.js"){}#-->
|
||||
|
||||
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
@@ -131,11 +131,11 @@ layout("/layouts/platform.html"){
|
||||
{ prop: "taskName", label: "当前节点"},
|
||||
{ prop: "instanceState", label: "流程状态"}
|
||||
],
|
||||
|
||||
|
||||
unions: [],
|
||||
units: [],
|
||||
clubs: [],
|
||||
|
||||
|
||||
activityDeclareReimbursementList: []
|
||||
}
|
||||
},
|
||||
|
||||
+19
-14
@@ -14,11 +14,11 @@ layout("/layouts/platform.html"){
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
|
||||
|
||||
<search-item label="申请人">
|
||||
<el-input placeholder="请输入申请人工号或姓名" clearable v-model="pageForm.searchKeyword"></el-input>
|
||||
</search-item>
|
||||
|
||||
|
||||
<template v-if="$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN, BRANCH_UNION_ADMIN')">
|
||||
<search-item label="所属工会">
|
||||
<el-select @change="flushUnits" @clear="flushUnits" clearable
|
||||
@@ -30,7 +30,7 @@ layout("/layouts/platform.html"){
|
||||
v-for="item in unions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
|
||||
<search-item label="所属单位">
|
||||
<el-select clearable filterable placeholder="所属单位"
|
||||
style="width: 100%;" v-model="pageForm.unitId">
|
||||
@@ -39,7 +39,7 @@ layout("/layouts/platform.html"){
|
||||
</el-select>
|
||||
</search-item>
|
||||
</template>
|
||||
|
||||
|
||||
<template v-if="$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN, CLUB_MANAGER, CLUB_PRESIDENT')">
|
||||
<search-item label="所属协会">
|
||||
<el-select clearable filterable placeholder="所属协会"
|
||||
@@ -51,17 +51,17 @@ layout("/layouts/platform.html"){
|
||||
</template>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="申报记录">
|
||||
<el-button size="small" type="primary" @click="onApply">活动申报</el-button>
|
||||
</table-tool>
|
||||
|
||||
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
|
||||
ref="table" row-key="id" style="width: 100%">
|
||||
<el-table-column :index="indexMethod" header-align="center" label="序号"
|
||||
type="index" width="60px"></el-table-column>
|
||||
|
||||
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
@@ -92,14 +92,15 @@ layout("/layouts/platform.html"){
|
||||
<el-button v-if="row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">撤回
|
||||
</el-button>
|
||||
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onDelete(row.id)" size="mini" type="danger">删除</el-button>
|
||||
|
||||
<el-button @click="doExport(row)">导出</el-button>
|
||||
|
||||
<el-button @click="doExport(row)" size="mini">申请</el-button>
|
||||
<el-button @click="doExportReimbursement(row)" size="mini">报销</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
|
||||
<template #view>
|
||||
<info ref="infoRef"></info>
|
||||
</template>
|
||||
@@ -109,7 +110,7 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<script>
|
||||
<!--#include("../common/info.js"){}#-->
|
||||
|
||||
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
@@ -130,11 +131,11 @@ layout("/layouts/platform.html"){
|
||||
{ prop: "taskName", label: "当前节点"},
|
||||
{ prop: "instanceState", label: "流程状态"}
|
||||
],
|
||||
|
||||
|
||||
unions: [],
|
||||
units: [],
|
||||
clubs: [],
|
||||
|
||||
|
||||
activityDeclareReimbursementList: []
|
||||
}
|
||||
},
|
||||
@@ -144,7 +145,11 @@ layout("/layouts/platform.html"){
|
||||
methods: {
|
||||
// 导出示例
|
||||
doExport(row){
|
||||
this.$downLoad('/platform/activityDeclare/mine?id=' + row.declareId)
|
||||
this.$downLoad('/platform/activityDeclare/mine/doExport?id=' + row.declareId)
|
||||
},
|
||||
// 导出报销凭证
|
||||
doExportReimbursement(row){
|
||||
this.$downLoad('/platform/activityReimbursement/mine/doExportReimbursement?id=' + row.id)
|
||||
},
|
||||
onApply() {
|
||||
window.location.href = '/platform/activityReimbursement/apply'
|
||||
|
||||
@@ -56,6 +56,7 @@ const ARTICLE_INFO = {
|
||||
|
||||
</div>
|
||||
`,
|
||||
store,
|
||||
dicts: ["PROCESS_TASK_SUBMIT_TYPE"],
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -11,7 +11,7 @@ layout("/layouts/platform.html"){
|
||||
style="width: 100%"></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="标题">
|
||||
<el-input v-model="pageForm.title" placeholder="标题" clearable></el-input>
|
||||
<el-input v-model="pageForm.title" placeholder="请输入标题" clearable></el-input>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
@@ -35,7 +35,7 @@ layout("/layouts/platform.html"){
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="300px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="onOpen(row.id)" size="mini" type="primary">查看</el-button>
|
||||
<el-button @click="onOpen(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onEdit(row)"
|
||||
size="mini" type="primary">编辑
|
||||
</el-button>
|
||||
|
||||
+68
-8
@@ -39,9 +39,24 @@ const basicForm = {
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="unionId" label="工会"
|
||||
:rules="[{required:true,message:'请选择工会',trigger:['change','blur']}]">
|
||||
<el-select clearable filterable multiple style="width: 100%"
|
||||
v-model="formData.unionId"
|
||||
placeholder="请选择活动线路"
|
||||
@change="onUnionChange">
|
||||
<el-option :value="item.id"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
v-for="item in unionOptions"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="unionQuotaAllocationList" label="工会名额分配">
|
||||
<el-table :data="formData.unionQuotaAllocationList" size="medium" height="70vh">
|
||||
<el-table :data="filteredUnionQuotaAllocationList" size="medium" height="70vh">
|
||||
<el-table-column type="index" label="序号"></el-table-column>
|
||||
<el-table-column label="工会名称" prop="unionName"></el-table-column>
|
||||
<el-table-column label="会员人数" prop="memberNum"></el-table-column>
|
||||
@@ -87,13 +102,27 @@ const basicForm = {
|
||||
</el-row>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
|
||||
`,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
lineList: [],
|
||||
unionOptions: [],
|
||||
allUnionQuotaAllocationList: [], // 保存所有工会名额分配数据
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 计算属性:根据选择的工会过滤显示的名额分配列表
|
||||
filteredUnionQuotaAllocationList() {
|
||||
// 如果没有选择任何工会,显示所有工会
|
||||
if (!this.formData.unionId || this.formData.unionId.length === 0) {
|
||||
return this.allUnionQuotaAllocationList;
|
||||
}
|
||||
|
||||
// 如果选择了工会,只显示选中的工会
|
||||
return this.allUnionQuotaAllocationList.filter(item =>
|
||||
this.formData.unionId.includes(item.unionId)
|
||||
);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -107,32 +136,58 @@ const basicForm = {
|
||||
listUnion() {
|
||||
this.$axios.post("/platform/excellentRecuperation/activityList/listUnion").then(res => {
|
||||
if (res.code === 0) {
|
||||
this.formData.unionQuotaAllocationList = res.data
|
||||
this.allUnionQuotaAllocationList = res.data; // 保存所有数据
|
||||
// 如果formData.unionQuotaAllocationList存在,则更新对应数据
|
||||
if (this.formData.unionQuotaAllocationList) {
|
||||
this.updateUnionQuotaAllocationList();
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 更新名额分配列表数据
|
||||
updateUnionQuotaAllocationList() {
|
||||
this.allUnionQuotaAllocationList.forEach(item => {
|
||||
const existingItem = this.formData.unionQuotaAllocationList.find(
|
||||
formDataItem => formDataItem.unionId === item.unionId
|
||||
);
|
||||
if (existingItem) {
|
||||
item.allocationNum = existingItem.allocationNum || 0;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 工会选择变化时的处理
|
||||
onUnionChange(selectedUnions) {
|
||||
// 数据会自动根据计算属性更新显示
|
||||
console.log("Selected unions:", selectedUnions);
|
||||
},
|
||||
clearUnionQuotaAllocation() {
|
||||
this.$confirm("您确定要清空分配名额吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
this.listUnion()
|
||||
// 清空所有名额分配
|
||||
this.allUnionQuotaAllocationList.forEach(item => {
|
||||
this.$set(item, 'allocationNum', 0);
|
||||
});
|
||||
})
|
||||
},
|
||||
onOpen(id) {
|
||||
this.formData = {}
|
||||
this.$refs.formRef.clearValidate()
|
||||
this.getLineList()
|
||||
this.listUnion(); // 始终加载所有工会数据
|
||||
if (id) {
|
||||
this.$axios.post("/platform/excellentRecuperation/activityList/findOne", {id}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.formData = res.data
|
||||
this.$set(this.formData, "signUpTime", [res.data.signUpStartTime, res.data.signUpEndTIme])
|
||||
// 更新名额分配数据
|
||||
if (this.allUnionQuotaAllocationList.length > 0) {
|
||||
this.updateUnionQuotaAllocationList();
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.listUnion()
|
||||
}
|
||||
},
|
||||
onSubmit() {
|
||||
@@ -146,6 +201,8 @@ const basicForm = {
|
||||
const formData = clone(this.formData)
|
||||
formData.signUpStartTime = formData.signUpTime[0]
|
||||
formData.signUpEndTIme = formData.signUpTime[1]
|
||||
// 传递过滤后的名额分配列表
|
||||
formData.unionQuotaAllocationList = this.filteredUnionQuotaAllocationList;
|
||||
const resp = await this.$axios.post("/platform/excellentRecuperation/activityList/onSubmit", {
|
||||
data: JSON.stringify(formData)
|
||||
})
|
||||
@@ -157,6 +214,9 @@ const basicForm = {
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
//工会查询
|
||||
this.$businessTool.listUnion().then((res) => (this.unionOptions = res))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user