commit
This commit is contained in:
+324
@@ -0,0 +1,324 @@
|
||||
<div id="activity_declare_apply">
|
||||
<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-form-item prop="activityName">
|
||||
<el-input placeholder="请输入内容" style="width: 100%" v-model="formData.activityName">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="活动类型">
|
||||
<el-form-item prop="activityType">
|
||||
<el-select @change="activityTypeChange" placeholder="请选择活动类型"
|
||||
style="width: 100%" v-model="formData.activityType">
|
||||
<el-option
|
||||
:key="item.name"
|
||||
:label="item.typeName"
|
||||
:value="item.name"
|
||||
v-for="item in activityDeclareReimbursementList">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="申请人姓名">
|
||||
<el-form-item prop="userName">
|
||||
<el-input disabled type="text" v-model="formData.userName"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<template v-if="formData.activityType == 'CLUB'">
|
||||
<el-descriptions-item label="申请协会">
|
||||
<el-form-item prop="clubId" label="申请协会">
|
||||
<el-select v-model="formData.clubId" placeholder="请选择协会"
|
||||
@change="setDeclareUnitName" style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in clubList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-descriptions-item label="申请单位">
|
||||
<el-form-item prop="declareUnitName">
|
||||
<el-input readonly v-model="formData.declareUnitName" type="text" placeholder="请选择项目类型,自动填充"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
</template>
|
||||
|
||||
<el-descriptions-item label="联系方式">
|
||||
<el-form-item prop="mobile">
|
||||
<el-input type="text" v-model="formData.mobile" placeholder="请输入联系方式" maxlength="11"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="申请时间">
|
||||
<el-form-item prop="applyTime">
|
||||
<el-input disabled type="text" v-model="formData.applyTime"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
|
||||
<el-descriptions-item label="活动计划时间">
|
||||
<el-form-item prop="planDate">
|
||||
<el-date-picker
|
||||
start-placeholder="开始日期"
|
||||
range-separator="-"
|
||||
end-placeholder="结束日期"
|
||||
style="width: 100%"
|
||||
type="daterange"
|
||||
v-model="formData.planDate"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="活动人数">
|
||||
<el-form-item prop="activityNumber">
|
||||
<el-input-number v-model="formData.activityNumber" placeholder="请输入活动人数"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="活动地址" :span="2">
|
||||
<el-form-item prop="activityAddress">
|
||||
<el-input maxlength="150" placeholder="请填写活动地址" type="text"
|
||||
v-model="formData.activityAddress"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="活动预算费用" :span="2">
|
||||
<el-form-item prop="budgets">
|
||||
<el-table :data="formData.budgets" border max-height="500" size="mini" style="width: 100%">
|
||||
<el-table-column label="序号" sortable type="index" width="100"></el-table-column>
|
||||
<el-table-column label="费用项目名称" prop="name">
|
||||
<template scope="{row,$index}">
|
||||
<el-form-item label-width="0"
|
||||
:prop="'budgets.'+$index+'.name'"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-input v-model="row.name" maxlength="50"
|
||||
placeholder="请输入费用项目名称"></el-input>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="预算费用" prop="budgetPrice">
|
||||
<template scope="{row,$index}">
|
||||
<el-form-item label-width="0"
|
||||
:prop="'budgets.'+$index+'.budgetPrice'"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-input-number placeholder="预算费用" v-model="row.budgetPrice" :precision="2"
|
||||
style="width: 100%" :min="1"></el-input-number>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作" width="150px">
|
||||
<template slot="header" slot-scope="scope">
|
||||
<el-button @click="formData.budgets.push({})" icon="el-icon-plus" type="primary"
|
||||
size="mini">添加
|
||||
</el-button>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-button :disabled="formData.budgets.length==1"
|
||||
@click="formData.budgets.splice(scope.$index,1)"
|
||||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
type="danger"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="活动方案及简介" :span="2">
|
||||
<el-form-item prop="activityContent">
|
||||
<text-editor v-model="formData.activityContent"></text-editor>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="附件" :span="2">
|
||||
<el-form-item prop="files">
|
||||
<file-upload :value.sync="formData.files"
|
||||
upload_mode="drag"
|
||||
:upload_number="10" upload_result_category="array"
|
||||
complete_result></file-upload>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="签字" :span="2">
|
||||
<el-form-item prop="sign">
|
||||
<pc-signature v-model="formData.sign"></pc-signature>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-form>
|
||||
|
||||
<snaker-flow-task-form-action @task-action="handleTaskAction" @save-draft="handleSaveDraft"></snaker-flow-task-form-action>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#activity_declare_apply',
|
||||
store,
|
||||
data() {
|
||||
return {
|
||||
businessId: GetQueryString("businessId"),
|
||||
instanceId: GetQueryString("instanceId"),
|
||||
formData: {
|
||||
id: GetQueryString("businessId"),
|
||||
},
|
||||
|
||||
formRules: {
|
||||
activityName: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
activityType: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
fundsUnitName: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
declareUnitName: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
budgets: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
clubId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
mobile: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
sign: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
},
|
||||
|
||||
activityDeclareReimbursementList: [],
|
||||
clubList: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 提交
|
||||
handleTaskAction(val) {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
if (!this.instanceId) {
|
||||
this.handleApply(val)
|
||||
} else {
|
||||
this.handleReApply(val)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 提交申请
|
||||
handleApply(val) {
|
||||
this.$confirm("您确定要提交吗?", "提示", { type: "warning" })
|
||||
.then(() => {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$axios
|
||||
.post("/flow/common/startInstanceAndExecute", {
|
||||
...val,
|
||||
bizData: JSON.stringify(this.formData)
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("操作成功")
|
||||
// 发送完成消息
|
||||
window.GlobalBroadcastChannel.postMessage({
|
||||
type: "task-complete"
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 重新提交申请
|
||||
handleReApply(val) {
|
||||
this.$confirm("您确定要提交吗?", "提示", { type: "warning" })
|
||||
.then(() => {
|
||||
this.$axios
|
||||
.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify({
|
||||
processTaskId: val.taskId,
|
||||
processInstanceId: val.instanceId,
|
||||
submitType: val.submitType,
|
||||
f_data: JSON.stringify(this.formData)
|
||||
})
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
window.GlobalBroadcastChannel.postMessage({
|
||||
type: "task-complete"
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 保存
|
||||
handleSaveDraft(val) {
|
||||
this.$confirm("您确定要保存吗?", "提示", { type: "warning" })
|
||||
.then(() => {
|
||||
this.$axios
|
||||
.post("/flow/common/startInstance", {
|
||||
...val,
|
||||
bizData: JSON.stringify(this.formData)
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("操作成功")
|
||||
// 发送完成消息
|
||||
window.parent.postMessage(
|
||||
{
|
||||
type: "task-complete"
|
||||
},
|
||||
"*"
|
||||
)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 取消
|
||||
handleCancel() {
|
||||
|
||||
},
|
||||
// 设置申报主体名称
|
||||
setDeclareUnitName(val){
|
||||
const club = this.clubList.find(v => v.id === val)
|
||||
this.$set(this.formData, "declareUnitName", club ? club.clubName : null)
|
||||
},
|
||||
// 申请类型选中
|
||||
activityTypeChange(val) {
|
||||
if (val === "SCHOOL_UNION") {
|
||||
this.$set(this.formData, "declareUnitName", "校工会")
|
||||
} else if (val === "BRANCH_UNION") {
|
||||
this.$set(this.formData, "declareUnitName", this.$store.state.user.union.name)
|
||||
}
|
||||
},
|
||||
findOne(id) {
|
||||
this.$axios.post("/activity/declare/apply/findOne", { id })
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.formData = res.data
|
||||
if (res.data.clubId) {
|
||||
this.setDeclareUnitName(res.data.clubId)
|
||||
}
|
||||
if (this.formData.budgets) {
|
||||
this.formData.budgets = JSON.parse(res.data.budgets)
|
||||
}
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.activityDeclareReimbursementList = await this.$businessTool.getEnumOptions("ActivityDeclareReimbursement")
|
||||
if (this.businessId) {
|
||||
this.findOne(this.businessId)
|
||||
} else {
|
||||
const user = this.$store.state.user
|
||||
this.$set(this.formData, "userName", user.username)
|
||||
this.$set(this.formData, "loginName", user.loginname)
|
||||
this.$set(this.formData, "mobile", user.mobile)
|
||||
this.$set(this.formData, "applyTime", this.$moment().format("YYYY-MM-DD"))
|
||||
this.$set(this.formData, "budgets", [])
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.el-descriptions-item__label {
|
||||
width: 15% !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
+200
@@ -0,0 +1,200 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
placeholder="年度"
|
||||
type="year"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.year"
|
||||
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
|
||||
filterable
|
||||
placeholder="所属工会"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.unionId">
|
||||
<el-option :label="item.name" :value="item.id"
|
||||
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">
|
||||
<el-option :label="item.name" :value="item.id"
|
||||
v-for="item in units"></el-option>
|
||||
</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="所属协会"
|
||||
style="width: 100%;" v-model="pageForm.clubId">
|
||||
<el-option :label="item.clubName" :value="item.id"
|
||||
v-for="item in clubs"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</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"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
header-align="center"
|
||||
min-width="100px"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
<template scope="{row}" v-if="column.prop=='loginName'">
|
||||
<span>{{row.userName + '(' + row.loginName + ')' }}</span>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='instanceState'">
|
||||
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
|
||||
size="small"></enum-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="220" fixed="right">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button v-if="row.taskKey === 'startTask'" @click="onEdit(row)" size="mini" type="primary">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-if="row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">
|
||||
撤回
|
||||
</el-button>
|
||||
<el-button @click="onDelete(row.id)" size="mini" type="danger">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
store,
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
year: this.$moment().format("YYYY")
|
||||
},
|
||||
tableColumns: [
|
||||
{ prop: "loginName", label: "申报人", sortable: true },
|
||||
{ prop: "mobile", label: "联系方式"},
|
||||
{ prop: "activityName", label: "活动名称"},
|
||||
{ prop: "activityType", label: "活动类型"},
|
||||
{ prop: "declareUnitName", label: "申报单位/协会", sortable: true },
|
||||
{ prop: "activityNumber", label: "活动人数", sortable: true },
|
||||
{ prop: "applyTime", label: "申报时间", sortable: true },
|
||||
{ prop: "taskName", label: "当前节点"},
|
||||
{ prop: "instanceState", label: "流程状态"}
|
||||
],
|
||||
|
||||
unions: [],
|
||||
units: [],
|
||||
clubs: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onApply() {
|
||||
window.open("/flow/common/approval/form?defineKey=HDSB")
|
||||
},
|
||||
openView(row) {
|
||||
window.open("/flow/common/approval/form?instanceId=" + (row.instanceId || "") + "&businessId=" + row.id + "&defineKey=HDSB")
|
||||
},
|
||||
onEdit(row) {
|
||||
window.open(
|
||||
"/flow/common/approval/form?taskId=" +
|
||||
(row.taskId || "") +
|
||||
"&instanceId=" +
|
||||
(row.instanceId || "") +
|
||||
"&businessId=" +
|
||||
row.id +
|
||||
"&defineKey=HYRH"
|
||||
)
|
||||
},
|
||||
onRevoke(row) {
|
||||
this.$confirm("您确定要撤回吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/flow/common/revokeTask", { taskId: row.startTaskId }).then((resp) => {
|
||||
this.$message.success(resp.msg)
|
||||
this.pageData()
|
||||
})
|
||||
})
|
||||
},
|
||||
onDelete(id) {
|
||||
this.$confirm("您确定要删除吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/activityDeclare/apply/onDelete", { id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.doSearch()
|
||||
this.$message.success(res.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
async flushUnits(){
|
||||
this.$set(this.pageForm, "unitId", null)
|
||||
if (this.$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN')) {
|
||||
this.units = await this.$businessTool.listUnit(this.pageForm.unionId)
|
||||
} else {
|
||||
this.units = await this.$businessTool.listUnit(this.$store.state.user.union.id)
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
if (this.$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN')) {
|
||||
this.unions = await this.$businessTool.listUnion()
|
||||
this.clubs = await this.$businessTool.listClub()
|
||||
} else {
|
||||
if (this.$auth.hasRoleOr('CLUB_MANAGER, CLUB_PRESIDENT')) {
|
||||
this.clubs = await this.$businessTool.listClub()
|
||||
}
|
||||
this.unions = await this.$businessTool.listUnion(this.$store.state.user.union.id)
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -211,7 +211,7 @@
|
||||
|
||||
|
||||
<el-descriptions-item label="签字" :span="3">
|
||||
<el-form-item prop="signature">
|
||||
<el-form-item prop="sign">
|
||||
<pc-signature v-model="formData.sign"></pc-signature>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
@@ -40,7 +40,7 @@ layout("/layouts/platform.html"){
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool :app="this" label="申请记录">
|
||||
<table-tool label="申请记录">
|
||||
<el-button size="small" type="primary" @click="onApply">帮扶申请</el-button>
|
||||
</table-tool>
|
||||
|
||||
@@ -102,8 +102,8 @@ layout("/layouts/platform.html"){
|
||||
{ prop: "unitName", label: "所属单位", sortable: true },
|
||||
{ prop: "subsidyStandards", label: "困难类型", sortable: true },
|
||||
{ prop: "applyTime", label: "申请时间", sortable: true },
|
||||
{ prop: "taskName", label: "当前节点"},
|
||||
{ prop: "instanceState", label: "流程状态"}
|
||||
{ prop: "taskName", label: "当前节点" },
|
||||
{ prop: "instanceState", label: "流程状态" }
|
||||
],
|
||||
unions: [],
|
||||
units: []
|
||||
|
||||
Reference in New Issue
Block a user