commit
This commit is contained in:
@@ -1,111 +0,0 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
:clearable="false"
|
||||
@change="listActivity"
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="问卷">
|
||||
<el-select filterable placeholder="所属问卷" style="width: 100%" @change="doSearch" v-model="pageForm.activityId">
|
||||
<el-option :label="item.title" :value="item.id" :key="item.id" v-for="item in activityOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="姓名/工号">
|
||||
<el-input v-model="pageForm.searchKeyword" placeholder="姓名/工号" clearable></el-input>
|
||||
</search-item>
|
||||
<search-item label="所属工会">
|
||||
<el-select placeholder="所属工会" v-model="pageForm.unionId" clearable filterable>
|
||||
<el-option v-for="item in unionOptions" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属单位">
|
||||
<el-select placeholder="所属单位" v-model="pageForm.unitId" clearable filterable>
|
||||
<el-option v-for="item in unitOptions" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="答题日期">
|
||||
<el-date-picker
|
||||
@change="doSearch"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.attemptDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择答题日期"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<el-button @click="exportXlsx" icon="el-icon-download" size="small" type="primary" class="mr5">导出xlsx</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" ref="tableRef" @sort-change="pageOrder">
|
||||
<el-table-column label="序号" width="50" type="index" :index="indexMethod"></el-table-column>
|
||||
<el-table-column label="姓名" prop="userName" sortable></el-table-column>
|
||||
<el-table-column label="工号" prop="loginName" sortable></el-table-column>
|
||||
<el-table-column label="性别" prop="sex" sortable></el-table-column>
|
||||
<el-table-column label="单位" prop="unitName" sortable></el-table-column>
|
||||
<el-table-column label="分工会" prop="unionName" sortable></el-table-column>
|
||||
<el-table-column label="联系方式" prop="mobile" sortable></el-table-column>
|
||||
<el-table-column label="答题日期" prop="attemptDate" sortable></el-table-column>
|
||||
<el-table-column label="得分" prop="totalScore" sortable></el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
activityOptions: [],
|
||||
unionOptions: [],
|
||||
unitOptions: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
listActivity() {
|
||||
this.$axios.post("/platform/qsv/quizRank/listQuiz", { year: this.pageForm.year }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.activityOptions = res.data
|
||||
if (this.activityOptions.length > 0) {
|
||||
this.pageForm.activityId = this.activityOptions[0].id
|
||||
this.pageData()
|
||||
} else {
|
||||
this.pageForm.activityId = null
|
||||
this.tableData = []
|
||||
this.pageForm.totalCount = 0
|
||||
this.pageForm.pageNumber = 1
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
exportXlsx() {
|
||||
this.$downLoad("/platform/qsv/quizRank/exportXlsx", this.pageForm)
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.unionOptions = await this.$businessTool.listUnion()
|
||||
this.unitOptions = await this.$businessTool.listUnit()
|
||||
this.listActivity()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -1,70 +0,0 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
:clearable="false"
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<!-- <el-button @click="exportXlsx" icon="el-icon-download" size="small" type="primary" class="mr5">导出xlsx</el-button>-->
|
||||
</table-tool>
|
||||
<el-table :data="tableData" ref="tableRef" @sort-change="pageOrder">
|
||||
<el-table-column label="序号" width="50" type="index" :index="indexMethod"></el-table-column>
|
||||
<el-table-column label="标题" prop="title" width="120" sortable></el-table-column>
|
||||
<el-table-column label="类型" prop="category" sortable>
|
||||
<template scope="{row}">
|
||||
<dict-tag :options="dict.type.ACTIVITY_QSV_CATEGORY" :value="row.category"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间" prop="startTime" sortable></el-table-column>
|
||||
<el-table-column label="结束时间" prop="endTime" sortable></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="200px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="$refs.reportRef.onOpen(row.id)">查看分析</el-button>
|
||||
<el-button size="mini" type="primary" @click="$refs.answerRef.onOpen(row.id)">查看答卷</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
<report ref="reportRef"></report>
|
||||
<answer ref="answerRef"></answer>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include('report.js'){}#-->
|
||||
<!--#include('answer.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
dicts: ["ACTIVITY_QSV_CATEGORY"],
|
||||
components: { report, answer },
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
methods: {
|
||||
exportXlsx() {
|
||||
this.$axios.post("/platform/qsv/survey/exportXlsx", this.pageForm)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,161 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="编号/名称">
|
||||
<el-input placeholder="请输入类型编号或名称" clearable
|
||||
v-model="pageForm.searchKeyword"></el-input>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="资产类型列表">
|
||||
<el-button @click="openAdd" size="small" type="primary">
|
||||
新增类型
|
||||
</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"
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"
|
||||
></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"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openEdit(row)" size="mini" type="primary">编辑
|
||||
</el-button>
|
||||
<el-button @click="doDelete(row.id)" size="mini" type="danger">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog
|
||||
title=""
|
||||
:visible.sync="dialogVisible"
|
||||
width="40%"
|
||||
:close-on-click-modal="false">
|
||||
|
||||
<el-form :model="formData" :rules="rules" ref="ruleForm" label-width="120px">
|
||||
<el-form-item label="编号" prop="categoryCode">
|
||||
<el-input v-model="formData.categoryCode" maxlength="30" placeholder="编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="名称" prop="categoryName">
|
||||
<el-input v-model="formData.categoryName" maxlength="30" placeholder="内容"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="折旧年限(年)" prop="depreciationYear">
|
||||
<el-input v-model="formData.depreciationYear" maxlength="30" placeholder="折旧年限(年)"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">关 闭</el-button>
|
||||
<el-button type="primary" @click="doSubmit">提 交</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
tableColumns: [
|
||||
{prop: 'categoryCode', label: '编号'},
|
||||
{prop: 'categoryName', label: '名称'},
|
||||
{prop: 'depreciationYear', label: '折旧年限(年)'},
|
||||
],
|
||||
dialogVisible: false,
|
||||
rules: {
|
||||
categoryCode: [{required: true, message: '请输入编号', trigger: ['change', 'blur']}],
|
||||
categoryName: [{required: true, message: '请输入名称', trigger: ['change', 'blur']}],
|
||||
depreciationYear: [{required: true, message: '请输入折旧年限', trigger: ['change', 'blur']}],
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openEdit(row) {
|
||||
this.formData = {}
|
||||
this.formData = clone(row)
|
||||
this.dialogVisible = true
|
||||
},
|
||||
openAdd() {
|
||||
this.formData = {}
|
||||
if (this.$refs['ruleForm']) {
|
||||
this.$refs['ruleForm'].resetFields()
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
async doDelete(id) {
|
||||
const confirm = await this.$confirm('确定删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
const resp = await this.$axios.post(loc() + '/doDelete', {id})
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
async doSubmit() {
|
||||
const valid = await this.$refs['ruleForm'].validate()
|
||||
if (valid) {
|
||||
const resp = await this.$axios.post(loc() + "/doSubmit", this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.doSearch()
|
||||
this.dialogVisible = false
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,349 @@
|
||||
let ASSSET_FORM = {
|
||||
/*language=HTML*/
|
||||
template: `
|
||||
<div>
|
||||
<el-form :model="formData" :rules="ruleForm" label-width="120px" ref="AddForm">
|
||||
|
||||
<el-descriptions :column="3" border class="table_fixed">
|
||||
|
||||
<el-descriptions-item label="资产编号">
|
||||
<el-form-item prop="assetNumber" label-width="0">
|
||||
<el-input placeholder="不填为系统自动生成或自己编写"
|
||||
v-model="formData.assetNumber" maxlength="100"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="资产名称">
|
||||
<el-form-item prop="assetName" label-width="0">
|
||||
<el-input placeholder="请填写资产名称"
|
||||
v-model="formData.assetName" maxlength="100"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="资产类别">
|
||||
<el-form-item prop="assetCategoryId" label-width="0">
|
||||
<el-select @change="assetCategoryIdChange" clearable placeholder="请选择资产类别"
|
||||
style="width: 100%" v-model="formData.assetCategoryId">
|
||||
<el-option :label="item.categoryName+'('+item.depreciationYear+'年)'"
|
||||
:value="item.id"
|
||||
v-for="item in assetCategoryOption"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="资产规格型号">
|
||||
<el-form-item prop="assetSpecs" label-width="0">
|
||||
<el-input placeholder="请填写资产规格型号"
|
||||
v-model="formData.assetSpecs" maxlength="100"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="供应商名称">
|
||||
<el-form-item prop="assetSupplierName" label-width="0">
|
||||
<el-input placeholder="请填写供应商名称"
|
||||
v-model="formData.assetSupplierName" maxlength="100"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="采购方式">
|
||||
<el-form-item prop="assetFundingSubjectName" label-width="0">
|
||||
<el-select clearable placeholder="请选择采购方式"
|
||||
style="width: 100%"
|
||||
v-model="formData.assetFundingSubjectName">
|
||||
<el-option label="网购" value="网购"></el-option>
|
||||
<el-option label="线下" value="线下"></el-option>
|
||||
<el-option label="采购" value="采购"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="用途">
|
||||
<el-form-item prop="assetPurposeName" label-width="0">
|
||||
<el-select clearable placeholder="请选择用途"
|
||||
style="width: 100%"
|
||||
v-model="formData.assetPurposeName">
|
||||
<el-option label="职工之家建设" value="职工之家建设"></el-option>
|
||||
<el-option label="日常办公" value="日常办公"></el-option>
|
||||
<el-option label="其他" value="其他"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="单价">
|
||||
<el-form-item prop="assetUnitPrice" label-width="0">
|
||||
<el-input-number :precision="2" placeholder="单价" style="width: 100%"
|
||||
v-model="formData.assetUnitPrice">
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="数量">
|
||||
<el-form-item prop="assetQuantity" label-width="0">
|
||||
<el-input-number :precision="0" placeholder="数量" style="width: 100%"
|
||||
v-model="formData.assetQuantity" :max="999999">
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="资产类型">
|
||||
<el-form-item prop="assetTypeCode" label-width="0">
|
||||
<el-radio-group @change="assetTypeCodeChange" v-model="formData.assetTypeCode">
|
||||
<el-radio :label="1" v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN'])">
|
||||
校工会资产
|
||||
</el-radio>
|
||||
<el-radio :label="2">分工会资产</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="开始使用日期">
|
||||
<el-form-item prop="assetUsedDate" label-width="0">
|
||||
<el-date-picker @change="assetUsedDateChange" placeholder="开始使用日期"
|
||||
style="width: 100%" v-model="formData.assetUsedDate"
|
||||
value-format="yyyy-MM-dd"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="预计报废时间">
|
||||
<el-form-item prop="assetRetiredAssetsDate" label-width="0">
|
||||
<el-date-picker placeholder="预计报废时间"
|
||||
disabled style="width: 100%" v-model="formData.assetRetiredAssetsDate"
|
||||
value-format="yyyy-MM-dd"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="责任人">
|
||||
<el-form-item prop="assetUseUserId" label-width="0">
|
||||
<el-select :remote-method="searchAssetUseUser"
|
||||
@change="assetUseUserIdChange"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="可输入姓名或者工号查询"
|
||||
remote
|
||||
style="width: 100%"
|
||||
v-model="formData.assetUseUserId">
|
||||
<el-option :label="item.username+'-'+item.loginname"
|
||||
:value="item.id"
|
||||
v-for="item in assetUseUserOption"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="使用/管理部门">
|
||||
<template v-if="formData.assetTypeCode===1">
|
||||
<el-form-item prop="assetUseUnionName" label-width="0">
|
||||
<el-input :value="formData.assetUseUnionName" disabled
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-form-item prop="assetUseUnionId" label-width="0">
|
||||
<el-select
|
||||
@change="assetUseUnionIdChange"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请选择使用/管理部门"
|
||||
style="width: 100%"
|
||||
v-model="formData.assetUseUnionId"
|
||||
>
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id"
|
||||
v-for="item in unionList"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="存放地点">
|
||||
<el-form-item prop="assetStorageLocation" label-width="0">
|
||||
<el-input placeholder="请输入存放地点" v-model="formData.assetStorageLocation"
|
||||
maxlength="30"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="使用状况">
|
||||
<el-form-item prop="assetUsageStateName" label-width="0">
|
||||
<dict-select v-model="formData.assetUsageStateName" placeholder="请选择使用状况"
|
||||
code="ASSET_USAGE_STATE"></dict-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item span="2">
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" span="3">
|
||||
<el-form-item prop="assetNotes" label-width="0">
|
||||
<el-input placeholder="请输入备注" v-model="formData.assetNotes"
|
||||
maxlength="150" type="textarea" :rows="3"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="发票/购买信息" span="3">
|
||||
<el-form-item prop="assetInvoiceFiles" label-width="0">
|
||||
<file-upload
|
||||
:value.sync="formData.assetInvoiceFiles"
|
||||
upload_mode="drag"
|
||||
accept=".jpg,.jpeg,.png,.pdf"
|
||||
:upload_number="20"
|
||||
upload_result_category="array"
|
||||
complete_result
|
||||
></file-upload>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="资产图片" span="3">
|
||||
<el-form-item prop="assetFiles" label-width="0">
|
||||
<file-upload
|
||||
:value.sync="formData.assetFiles"
|
||||
upload_mode="drag"
|
||||
accept=".jpg,.jpeg,.png,.pdf"
|
||||
:upload_number="20"
|
||||
upload_result_category="array"
|
||||
complete_result
|
||||
></file-upload>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
|
||||
</el-descriptions>
|
||||
</el-form>
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button @click="doSubmit" type="primary">提 交
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
ruleForm: {
|
||||
assetName: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
assetCategoryId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
assetSpecs: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
assetSupplierName: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
assetFundingSubjectName: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
assetPurposeName: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
assetUnitPrice: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
assetQuantity: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
assetTypeCode: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
assetUsedDate: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
assetRetiredAssetsDate: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
assetUseUserId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
assetUseUnionId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
assetStorageLocation: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
assetUsageStateName: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
assetInvoiceFiles: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
assetFiles: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
},
|
||||
unions: [],
|
||||
assetCategoryOption: [],
|
||||
assetUseUserOption: [],
|
||||
unionList: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
},
|
||||
async findOne(id) {
|
||||
const res = await this.$axios.post("/platform/asset/manage/findOne", {id})
|
||||
this.formData = res.data
|
||||
},
|
||||
async openEdit(id) {
|
||||
await this.findOne(id)
|
||||
this.searchAssetUseUser(this.formData.assetUseUserId)
|
||||
},
|
||||
assetUseUnionIdChange(val) {
|
||||
const union = this.unions.find(v => v.id === val)
|
||||
if (union) {
|
||||
this.$set(this.formData, "assetUseUnionName", union.name)
|
||||
} else {
|
||||
this.$set(this.formData, "assetUseUnionName", null)
|
||||
}
|
||||
},
|
||||
// 切换资产类型把使用/管理部门清空
|
||||
assetTypeCodeChange(val) {
|
||||
if (val === 1) {
|
||||
this.$set(this.formData, "assetUseUnionName", "校工会")
|
||||
} else {
|
||||
this.$set(this.formData, "assetUseUnionName", null)
|
||||
this.$set(this.formData, "assetUseUnionId", null)
|
||||
}
|
||||
},
|
||||
// 点击责任人
|
||||
assetUseUserIdChange(val) {
|
||||
const {
|
||||
unionname,
|
||||
unionid
|
||||
} = this.assetUseUserOption.find(v => v.id === val)
|
||||
this.formData.assetUseUnionId = unionid
|
||||
if (this.formData.assetTypeCode === 1) {
|
||||
this.formData.assetUseUnionName = "校工会"
|
||||
} else {
|
||||
|
||||
this.formData.assetUseUnionName = unionname
|
||||
}
|
||||
},
|
||||
// 点击开始使用日期🧄预计报废时间
|
||||
assetUsedDateChange(val) {
|
||||
if (!this.formData.assetCategoryId) {
|
||||
this.$message.warning('请选择资产所属类别');
|
||||
this.$set(this.formData, "assetUsedDate", null)
|
||||
return
|
||||
}
|
||||
const assetCategoryOption = clone(this.assetCategoryOption)
|
||||
const data = assetCategoryOption.find(v => v.id === this.formData.assetCategoryId)
|
||||
const depreciationDate = this.$moment(val).add(data.depreciationYear, 'y').format('YYYY-MM-DD')
|
||||
this.$set(this.formData, "assetRetiredAssetsDate", depreciationDate)
|
||||
},
|
||||
assetCategoryIdChange() {
|
||||
if (this.formData.assetUsedDate) {
|
||||
this.assetUsedDateChange(this.formData.assetUsedDate)
|
||||
} else {
|
||||
this.$set(this.formData, "assetUsedDate", null);
|
||||
}
|
||||
},
|
||||
// 查询责任人
|
||||
searchAssetUseUser(val) {
|
||||
$.get("/platform/asset/manage/searchAssetUseUser", {query: val}).then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.assetUseUserOption = resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询资产类别
|
||||
queryCategory() {
|
||||
this.$axios.post("/platform/asset/category/queryCategory").then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.assetCategoryOption = resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
doSubmit() {
|
||||
this.$refs["AddForm"].validate((valid) => {
|
||||
if (valid) {
|
||||
let formData = clone(this.formData)
|
||||
if (formData.assetInvoiceFiles) {
|
||||
formData.assetInvoiceFiles = JSON.stringify(formData.assetInvoiceFiles)
|
||||
}
|
||||
if (formData.assetFiles) {
|
||||
formData.assetFiles = JSON.stringify(formData.assetFiles)
|
||||
}
|
||||
|
||||
this.$axios.post("/platform/asset/manage/" + (formData.id ? "doEdit" : "doAdd"), formData).then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.formData = {}
|
||||
this.$refs.AddForm.resetFields()
|
||||
this.$emit("save_success")
|
||||
this.$message.success(resp.msg);
|
||||
} else {
|
||||
this.$message.warning(resp.msg);
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
async created() {
|
||||
this.queryCategory()
|
||||
this.$businessTool.listUnion().then((data) => {
|
||||
this.unionList = data
|
||||
})
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
.table_fixed .el-form-item {
|
||||
margin-bottom: 0px !important;
|
||||
}
|
||||
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
let ASSSET_INFO = {
|
||||
/*language=HTML*/
|
||||
template: `
|
||||
<div>
|
||||
<el-tabs tab-position="top" v-model="activeName">
|
||||
<el-tab-pane label="资产基本信息" name="1">
|
||||
<el-descriptions :column="3" border style="margin-top: 10px;">
|
||||
<el-descriptions-item label="资产编号">
|
||||
{{viewData.assetNumber}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="资产名称">
|
||||
{{viewData.assetName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="资产类别">
|
||||
{{viewData.assetCategoryName}}({{viewData.assetDepreciationYear}}年)
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="资产规格型号">
|
||||
{{viewData.assetSpecs}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="供应商名称">
|
||||
{{viewData.assetSupplierName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="采购方式">
|
||||
{{viewData.assetFundingSubjectName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="用途">
|
||||
{{viewData.assetPurposeName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="单价(元)">
|
||||
{{viewData.assetUnitPrice}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="数量(台/件)">
|
||||
{{viewData.assetQuantity}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="资产类型">
|
||||
{{viewData.assetTypeCode===1?'校工会资产':'分工会资产'}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="开始使用日期">
|
||||
{{$moment(viewData.assetUsedDate).format('YYYY-MM-DD')}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="预计报废时间">
|
||||
{{$moment(viewData.assetRetiredAssetsDate).format('YYYY-MM-DD')}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="责任人">
|
||||
{{viewData.assetUseUserName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="使用/管理部门">
|
||||
{{viewData.assetUseUnionName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="存放地点">
|
||||
{{viewData.assetStorageLocation}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="使用状况">
|
||||
{{viewData.assetUsageStateName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item span="2">
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" span="3">
|
||||
<div style="white-space: pre">{{viewData.assetNotes}}</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="发票/购买信息" span="3">
|
||||
<file-preview :files="viewData.assetInvoiceFiles" complete_result></file-preview>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="资产图片" span="3">
|
||||
<file-preview :files="viewData.assetFiles" complete_result></file-preview>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="盘点信息" name="2"
|
||||
v-if="viewData.assetStocktakingList
|
||||
&& viewData.assetStocktakingList.length>0">
|
||||
<el-table :data="viewData.assetStocktakingList"
|
||||
:size="tableSize"
|
||||
ref="table"
|
||||
row-key="id"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column
|
||||
label="旧责任人" prop="oldAssetUseUserName">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="旧使用/管理部门" prop="oldAssetUseUnionName">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="旧存放地点" prop="oldAssetStorageLocation">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="旧使用状况" prop="oldAssetUsageStateName">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="旧使用状况" prop="oldAssetUsageStateName">
|
||||
<template v-slot="{row}">
|
||||
{{$moment(row.createdAt).format('YYYY-MM-DD HH:mm:ss')}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template v-slot="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
|
||||
<el-dialog
|
||||
title="盘点信息查询"
|
||||
:visible.sync="dialogVisible"
|
||||
:append-to-body="true"
|
||||
width="50%">
|
||||
<el-descriptions :column="2" border style="margin-top: 10px;">
|
||||
<el-descriptions-item label="旧责任人">
|
||||
{{tableStocktakingData.oldAssetUseUserName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="旧使用/管理部门">
|
||||
{{tableStocktakingData.oldAssetUseUnionName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="旧存放地点">
|
||||
{{tableStocktakingData.oldAssetStorageLocation}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="旧使用状况">
|
||||
{{tableStocktakingData.oldAssetUsageStateName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="盘点时间">
|
||||
{{$moment(tableStocktakingData.createdAt).format('YYYY-MM-DD HH:mm:ss')}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item></el-descriptions-item>
|
||||
<el-descriptions-item label="旧备注" :span="2">
|
||||
{{tableStocktakingData.oldAssetNotes}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="旧资产图片" :span="2">
|
||||
<file-preview :files="tableStocktakingData.oldAssetFiles" complete_result></file-preview>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="dialogVisible = false">关 闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
`, store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
viewData: {},
|
||||
tableStocktakingData: {},
|
||||
activeName: "1",
|
||||
dialogVisible:false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openView(row){
|
||||
this.tableStocktakingData=row
|
||||
this.dialogVisible=true
|
||||
|
||||
},
|
||||
open(id) {
|
||||
this.$axios.post("/platform/asset/manage/fondOneAsset", {id}).then(res => {
|
||||
this.viewData = res.data
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
let ASSSET_STOCKTAKING_FORM = {
|
||||
/*language=HTML*/
|
||||
template: `
|
||||
<div>
|
||||
<el-form :model="formData" :rules="ruleForm" label-width="120px" ref="AddForm">
|
||||
<el-descriptions :column="3" border class="table_fixed">
|
||||
|
||||
<el-descriptions-item label="资产编号">
|
||||
<el-form-item prop="assetNumber" label-width="0">
|
||||
<el-input disabled v-model="formData.assetNumber"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="资产名称">
|
||||
<el-form-item prop="assetName" label-width="0">
|
||||
<el-input disabled v-model="formData.assetName"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="开始使用日期">
|
||||
<el-form-item prop="assetUsedDate" label-width="0">
|
||||
<el-date-picker disabled style="width: 100%"
|
||||
v-model="formData.assetUsedDate"
|
||||
value-format="yyyy-MM-dd"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="责任人">
|
||||
<el-form-item prop="assetUseUserId" label-width="0">
|
||||
<el-select :remote-method="searchAssetUseUser"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="可输入姓名或者工号查询"
|
||||
remote
|
||||
style="width: 100%"
|
||||
v-model="formData.assetUseUserId">
|
||||
<el-option :label="item.username+'-'+item.loginname"
|
||||
:value="item.id"
|
||||
:key="item.id"
|
||||
v-for="item in assetUseUserOption"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="存放地点">
|
||||
<el-form-item prop="assetStorageLocation" label-width="0">
|
||||
<el-input placeholder="请输入存放地点" v-model="formData.assetStorageLocation"
|
||||
maxlength="30"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="使用状况">
|
||||
<el-form-item prop="assetUsageStateName" label-width="0">
|
||||
<dict-select v-model="formData.assetUsageStateName" placeholder="请选择使用状况"
|
||||
code="ASSET_USAGE_STATE"></dict-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" span="3">
|
||||
<el-form-item prop="assetNotes" label-width="0">
|
||||
<el-input placeholder="请输入备注" v-model="formData.assetNotes"
|
||||
maxlength="150" type="textarea" :rows="3"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="资产图片" span="3">
|
||||
<el-form-item prop="assetFiles" label-width="0">
|
||||
<file-upload
|
||||
:value.sync="formData.assetFiles"
|
||||
upload_mode="drag"
|
||||
accept=".jpg,.jpeg,.png,.pdf"
|
||||
:upload_number="20"
|
||||
upload_result_category="array"
|
||||
complete_result
|
||||
></file-upload>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
|
||||
</el-descriptions>
|
||||
</el-form>
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button @click="doSubmit" type="primary">提 交
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
ruleForm: {
|
||||
assetUseUserId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
assetStorageLocation: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
assetUsageStateName: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
assetFiles: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
},
|
||||
assetUseUserOption: [],
|
||||
assetInfo: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open(row) {
|
||||
this.assetInfo = row
|
||||
this.$set(this.formData, "assetId", row.id)
|
||||
this.$set(this.formData, "assetStocktakingPlanId", row.assetStocktakingPlanId)
|
||||
this.$set(this.formData, "assetNumber", row.assetNumber)
|
||||
this.$set(this.formData, "assetName", row.assetName)
|
||||
this.$set(this.formData, "assetUsedDate", row.assetUsedDate)
|
||||
this.$set(this.formData, "assetStorageLocation", row.assetStorageLocation)
|
||||
},
|
||||
doSubmit(){
|
||||
this.$refs["AddForm"].validate((valid) => {
|
||||
if (valid) {
|
||||
let formData = clone(this.formData)
|
||||
if (formData.assetFiles) {
|
||||
formData.assetFiles = JSON.stringify(formData.assetFiles)
|
||||
}
|
||||
|
||||
this.$axios.post("/platform/asset/stocktaking/doSubmit", formData).then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.formData = {}
|
||||
this.$refs.AddForm.resetFields()
|
||||
this.$emit("save_success")
|
||||
this.$message.success(resp.msg);
|
||||
} else {
|
||||
this.$message.warning(resp.msg);
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询责任人
|
||||
searchAssetUseUser(val) {
|
||||
$.get("/platform/asset/manage/searchAssetUseUser", {query: val}).then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.assetUseUserOption = resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
.table_fixed .el-form-item {
|
||||
margin-bottom: 0px !important;
|
||||
}
|
||||
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="编号/名称">
|
||||
<el-input placeholder="请输入资产编号或名称" clearable
|
||||
v-model="pageForm.searchKeyword"></el-input>
|
||||
</search-item>
|
||||
<search-item label="资产类型">
|
||||
<el-select clearable filterable placeholder="请选择资产类型" style="width: 100%"
|
||||
v-model="pageForm.assetTypeCode" @change="doSearch">
|
||||
<el-option label="校工会资产" :value="1"></el-option>
|
||||
<el-option label="分工会资产" :value="2"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="资产类别">
|
||||
<el-select clearable filterable placeholder="请选择资产类别" style="width: 100%"
|
||||
v-model="pageForm.assetCategoryId" @change="doSearch">
|
||||
<el-option :key="item.id"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
v-for="item in assetCategoryOption"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="使用状况">
|
||||
<dict-select v-model="pageForm.assetUsageStateName" placeholder="请选择使用状况"
|
||||
@change="doSearch"
|
||||
code="ASSET_USAGE_STATE"></dict-select>
|
||||
</search-item>
|
||||
<search-item label="使用/管理部门" v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN'])">
|
||||
<el-select
|
||||
@change="doSearch"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请选择使用/管理部门"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.assetUseUnionId"
|
||||
>
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id"
|
||||
v-for="item in unionList"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="资产列表">
|
||||
<el-button @click="doDepreciation" size="small" type="primary">
|
||||
折旧
|
||||
</el-button>
|
||||
<el-button @click="doExport" size="small" type="primary">
|
||||
导出折旧信息
|
||||
</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"
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"
|
||||
></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 v-slot="{row}" v-if="column.prop=='assetTypeCode'">
|
||||
{{row.assetTypeCode===1?'校工会资产':'分工会资产'}}
|
||||
</template>
|
||||
<template v-slot="{row}" v-else-if="column.prop=='assetRetiredAssetsDate'">
|
||||
{{$moment(row.assetRetiredAssetsDate).format('YYYY-MM-DD')}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template v-slot="{row}">
|
||||
<el-button @click="openView(row.id)" size="mini" type="primary">查看
|
||||
</el-button>
|
||||
<!--<el-button @click="doDelete(row.id)" size="mini" type="danger">删除
|
||||
</el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
<template #view>
|
||||
<asset-info ref="assetInfo"></asset-info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("../common/assetInfo.js"){}#-->
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
tableColumns: [
|
||||
{prop: 'assetNumber', label: '资产编号'},
|
||||
{prop: 'assetName', label: '资产名称'},
|
||||
{prop: 'categoryName', label: '类别名称'},
|
||||
{prop: 'assetStorageLocation', label: '存放地点'},
|
||||
{prop: 'assetUseUserName', label: '责任人'},
|
||||
{prop: 'assetAllMoney', label: '原值(元)'},
|
||||
{prop: 'assetSurplusMoney', label: '净值'},
|
||||
{prop: 'assetDepreciationMoney', label: '累计折旧(元)'},
|
||||
{prop: 'assetUsageMonth', label: '预计使用月份'},
|
||||
{prop: 'assetRetiredAssetsDate', label: '折旧到期日期'},
|
||||
],
|
||||
assetCategoryOption: [],
|
||||
unionList: [],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"asset-info": ASSSET_INFO,
|
||||
},
|
||||
methods: {
|
||||
doExport(){
|
||||
this.$downLoad("/platform/asset/depreciation/doExport", this.pageForm)
|
||||
},
|
||||
doDepreciation(){
|
||||
this.$confirm("此操作将给所有资产折旧, 是否继续?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
const resp = await this.$axios.post("/platform/asset/depreciation/doDepreciation")
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: resp.msg
|
||||
})
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
openView(id) {
|
||||
this.$refs.guava.view(() => {
|
||||
this.$refs.assetInfo.open(id)
|
||||
})
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm("此操作将永久删除折旧信息, 是否继续?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
const resp = await this.$axios.post("/platform/asset/depreciation/doDelete", {id})
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: resp.msg
|
||||
})
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询资产类别
|
||||
queryCategory() {
|
||||
this.$axios.post("/platform/asset/category/queryCategory").then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.assetCategoryOption = resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.queryCategory()
|
||||
this.$businessTool.listUnion().then((data) => {
|
||||
this.unionList = data
|
||||
})
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
|
||||
@@ -0,0 +1,205 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="编号/名称">
|
||||
<el-input placeholder="请输入资产编号或名称" clearable
|
||||
v-model="pageForm.searchKeyword"></el-input>
|
||||
</search-item>
|
||||
<search-item label="资产类型">
|
||||
<el-select clearable filterable placeholder="请选择资产类型" style="width: 100%"
|
||||
v-model="pageForm.assetTypeCode" @change="doSearch">
|
||||
<el-option label="校工会资产" :value="1"></el-option>
|
||||
<el-option label="分工会资产" :value="2"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="资产类别">
|
||||
<el-select clearable filterable placeholder="请选择资产类别" style="width: 100%"
|
||||
v-model="pageForm.assetCategoryId" @change="doSearch">
|
||||
<el-option :key="item.id"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
v-for="item in assetCategoryOption"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="使用状况">
|
||||
<dict-select v-model="pageForm.assetUsageStateName" placeholder="请选择使用状况"
|
||||
@change="doSearch"
|
||||
code="ASSET_USAGE_STATE"></dict-select>
|
||||
</search-item>
|
||||
<search-item label="使用/管理部门" v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN'])">
|
||||
<el-select
|
||||
@change="doSearch"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请选择使用/管理部门"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.assetUseUnionId"
|
||||
>
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id"
|
||||
v-for="item in unionList"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="资产列表">
|
||||
<el-button @click="openAdd" size="small" type="primary">
|
||||
新增资产
|
||||
</el-button>
|
||||
<el-button @click="doExport" size="small" type="primary">
|
||||
导出资产
|
||||
</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"
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"
|
||||
></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 v-slot="{row}" v-if="column.prop=='assetTypeCode'">
|
||||
{{row.assetTypeCode===1?'校工会资产':'分工会资产'}}
|
||||
</template>
|
||||
<template v-slot="{row}" v-else-if="column.prop=='assetRetiredAssetsDate'">
|
||||
{{$moment(row.assetRetiredAssetsDate).format('YYYY-MM-DD')}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="300">
|
||||
<template v-slot="{row}">
|
||||
<el-button @click="openView(row.id)" size="mini" type="primary">查看
|
||||
</el-button>
|
||||
<el-button @click="openEdit(row.id)" size="mini" type="primary">编辑
|
||||
</el-button>
|
||||
<el-button @click="doDelete(row.id)" size="mini" type="danger">删除
|
||||
</el-button>
|
||||
<!-- <el-button @click="doExportInit(row.id)" size="mini" type="primary">导出信息表
|
||||
</el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
<template #view>
|
||||
<asset-info ref="assetInfo"></asset-info>
|
||||
</template>
|
||||
<template #edit>
|
||||
<asset-form ref="assetForm" @save_success="saveSuccess"></asset-form>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("../common/assetForm.js"){}#-->
|
||||
<!--#include("../common/assetInfo.js"){}#-->
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
tableColumns: [
|
||||
{prop: 'assetNumber', label: '资产编号'},
|
||||
{prop: 'assetName', label: '资产名称'},
|
||||
{prop: 'categoryName', label: '类别名称'},
|
||||
{prop: 'assetStorageLocation', label: '存放地点'},
|
||||
{prop: 'assetUseUserName', label: '责任人'},
|
||||
{prop: 'assetRetiredAssetsDate', label: '折旧到期日期'},
|
||||
{prop: 'assetUsageStateName', label: '使用状况'},
|
||||
],
|
||||
assetCategoryOption: [],
|
||||
unionList: []
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"asset-form": ASSSET_FORM,
|
||||
"asset-info": ASSSET_INFO,
|
||||
},
|
||||
methods: {
|
||||
doExport(){
|
||||
this.$downLoad("/platform/asset/manage/doExport", this.pageForm)
|
||||
},
|
||||
saveSuccess() {
|
||||
this.doSearch()
|
||||
this.$refs.guava.index()
|
||||
},
|
||||
openView(id) {
|
||||
this.$refs.guava.view(() => {
|
||||
this.$refs.assetInfo.open(id)
|
||||
})
|
||||
},
|
||||
openEdit(id) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.$refs.assetForm.openEdit(id)
|
||||
})
|
||||
},
|
||||
openAdd() {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.$refs.assetForm.open()
|
||||
})
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm("此操作将永久删除资产和折旧信息, 是否继续?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
const resp = await this.$axios.post("/platform/asset/manage/doDelete", {id})
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: resp.msg
|
||||
})
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询资产类别
|
||||
queryCategory() {
|
||||
this.$axios.post("/platform/asset/category/queryCategory").then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.assetCategoryOption = resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.queryCategory()
|
||||
this.$businessTool.listUnion().then((data) => {
|
||||
this.unionList = data
|
||||
})
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,232 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="编号/名称">
|
||||
<el-input placeholder="请输入资产编号或名称" clearable
|
||||
v-model="pageForm.searchKeyword"></el-input>
|
||||
</search-item>
|
||||
<search-item label="盘点时间段">
|
||||
<el-select clearable placeholder="请选择盘点时间段" style="width: 100%"
|
||||
v-model="pageForm.assetStocktakingPlanId" @change="doSearch">
|
||||
<el-option :label="p.name" :value="p.id" :key="p.id"
|
||||
v-for="p in stocktakingPlanOption"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="资产类型">
|
||||
<el-select clearable filterable placeholder="请选择资产类型" style="width: 100%"
|
||||
v-model="pageForm.assetTypeCode" @change="doSearch">
|
||||
<el-option label="校工会资产" :value="1"></el-option>
|
||||
<el-option label="分工会资产" :value="2"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="资产类别">
|
||||
<el-select clearable filterable placeholder="请选择资产类别" style="width: 100%"
|
||||
v-model="pageForm.assetCategoryId" @change="doSearch">
|
||||
<el-option :key="item.id"
|
||||
:label="item.categoryName"
|
||||
:value="item.id"
|
||||
v-for="item in assetCategoryOption"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="使用状况">
|
||||
<dict-select v-model="pageForm.assetUsageStateName" placeholder="请选择使用状况"
|
||||
@change="doSearch"
|
||||
code="ASSET_USAGE_STATE"></dict-select>
|
||||
</search-item>
|
||||
<search-item label="使用/管理部门" v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN'])">
|
||||
<el-select
|
||||
@change="doSearch"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请选择使用/管理部门"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.assetUseUnionId"
|
||||
>
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id"
|
||||
v-for="item in unionList"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="资产列表">
|
||||
<el-radio-group v-model="pageForm.isStocktaking" size="mini" @change="doSearch">
|
||||
<el-radio-button :label="null">全部</el-radio-button>
|
||||
<el-radio-button :label="true">已盘点</el-radio-button>
|
||||
<el-radio-button :label="false">未盘点</el-radio-button>
|
||||
</el-radio-group>
|
||||
</table-tool>
|
||||
<el-table :data="tableData"
|
||||
:size="tableSize"
|
||||
@sort-change="pageOrder"
|
||||
ref="table"
|
||||
row-key="id"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:key="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
header-align="center"
|
||||
min-width="100px"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
<template v-slot="{row}" v-if="column.prop=='assetTypeCode'">
|
||||
{{row.assetTypeCode===1?'校工会资产':'分工会资产'}}
|
||||
</template>
|
||||
<template v-slot="{row}" v-else-if="column.prop=='assetRetiredAssetsDate'">
|
||||
{{$moment(row.assetRetiredAssetsDate).format('YYYY-MM-DD')}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200">
|
||||
<template v-slot="{row}">
|
||||
<el-button @click="openView(row.id)" size="mini" type="primary">查看
|
||||
</el-button>
|
||||
<el-button @click="openStocktaking(row)" size="mini" type="primary"
|
||||
v-if="!row.isStocktaking"
|
||||
:disabled="stocktakingPlanOption.length==0
|
||||
||!pageForm.assetStocktakingPlanId
|
||||
||!stocktakingPlanOption.find(p=>p.id===pageForm.assetStocktakingPlanId).isShow">
|
||||
开始盘点
|
||||
</el-button>
|
||||
<el-button
|
||||
:disabled="stocktakingPlanOption.length==0
|
||||
||!pageForm.assetStocktakingPlanId
|
||||
||!stocktakingPlanOption.find(p=>p.id===pageForm.assetStocktakingPlanId).isShow"
|
||||
@click="doDelete(row.id)"
|
||||
size="mini"
|
||||
type="danger" v-if="row.isStocktaking">
|
||||
删除盘点
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
<template #view>
|
||||
<asset-info ref="assetInfo"></asset-info>
|
||||
</template>
|
||||
<template #edit>
|
||||
<asset-stocktaking-form ref="assetStocktakingForm" @save_success="saveSuccess"></asset-stocktaking-form>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
<script>
|
||||
<!--#include("../common/assetStocktakingForm.js"){}#-->
|
||||
<!--#include("../common/assetInfo.js"){}#-->
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
tableColumns: [
|
||||
{prop: 'assetNumber', label: '资产编号'},
|
||||
{prop: 'assetName', label: '资产名称'},
|
||||
{prop: 'categoryName', label: '类别名称'},
|
||||
{prop: 'assetStorageLocation', label: '存放地点'},
|
||||
{prop: 'assetUseUserName', label: '责任人'},
|
||||
{prop: 'assetRetiredAssetsDate', label: '折旧到期日期'},
|
||||
{prop: 'assetUsageStateName', label: '使用状况'},
|
||||
],
|
||||
assetCategoryOption: [],
|
||||
stocktakingPlanOption: [],
|
||||
unionList: [],
|
||||
pageForm: {
|
||||
isStocktaking: false
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"asset-stocktaking-form": ASSSET_STOCKTAKING_FORM,
|
||||
"asset-info": ASSSET_INFO,
|
||||
},
|
||||
methods: {
|
||||
saveSuccess() {
|
||||
this.doSearch()
|
||||
this.$refs.guava.index()
|
||||
},
|
||||
openView(id) {
|
||||
this.$refs.guava.view(() => {
|
||||
this.$refs.assetInfo.open(id)
|
||||
})
|
||||
},
|
||||
openStocktaking(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
row.assetStocktakingPlanId = this.pageForm.assetStocktakingPlanId
|
||||
this.$refs.assetStocktakingForm.open(row)
|
||||
})
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm("此操作将永久删除资产和折旧信息, 是否继续?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
const resp = await this.$axios.post("/platform/asset/stocktaking/doDelete", {
|
||||
id: id,
|
||||
assetStocktakingPlanId: this.pageForm.assetStocktakingPlanId
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: resp.msg
|
||||
})
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询资产类别
|
||||
queryCategory() {
|
||||
this.$axios.post("/platform/asset/category/queryCategory").then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.assetCategoryOption = resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
// 按年度查询资产盘点计划
|
||||
async queryStocktakingPlan() {
|
||||
const resp = await this.$axios.post("/platform/asset/stocktakingPlan/queryStocktakingPlan")
|
||||
if (resp.code === 0) {
|
||||
resp.data.forEach(v => {
|
||||
const startDate = this.$moment(v.startDate).format('YYYY-MM-DD')
|
||||
const endDate = this.$moment(v.endDate).format('YYYY-MM-DD')
|
||||
v.name = startDate + "至" + endDate + "(" + v.year + ")"
|
||||
v.isShow = (this.$moment().format('YYYY-MM-DD hh:mm:ss') > v.startDate && this.$moment().format('YYYY-MM-DD hh:mm:ss') < v.endDate)
|
||||
})
|
||||
this.stocktakingPlanOption = resp.data
|
||||
if (this.stocktakingPlanOption && this.stocktakingPlanOption.length > 0) {
|
||||
this.$set(this.pageForm, "assetStocktakingPlanId", this.stocktakingPlanOption[0].id)
|
||||
} else {
|
||||
this.$set(this.pageForm, "assetStocktakingPlanId", null)
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.queryCategory()
|
||||
await this.queryStocktakingPlan()
|
||||
this.$businessTool.listUnion().then((data) => {
|
||||
this.unionList = data
|
||||
})
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,212 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="编号/名称">
|
||||
<el-date-picker placeholder="按年度查询" type="year" v-model="pageForm.year"
|
||||
value-format="yyyy"></el-date-picker>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="资产列表">
|
||||
<el-button @click="openAdd" size="small" type="primary">
|
||||
新增计划
|
||||
</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"
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"
|
||||
></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"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="300">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看
|
||||
</el-button>
|
||||
<el-button @click="openEdit(row)" size="mini" type="primary">编辑
|
||||
</el-button>
|
||||
<el-button @click="doDelete(row.id)" size="mini" type="danger">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:title="title"
|
||||
:visible.sync="dialogVisible"
|
||||
width="40%">
|
||||
<el-form :model="formData" :rules="formRules" label-width="100px" ref="addForm">
|
||||
<el-form-item label="年度" prop="year">
|
||||
<el-date-picker
|
||||
:disabled="isView"
|
||||
placeholder="选择年度"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="formData.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划时间" prop="planDate">
|
||||
<el-date-picker
|
||||
:disabled="isView"
|
||||
end-placeholder="结束日期"
|
||||
start-placeholder="开始日期"
|
||||
style="width: 100%"
|
||||
type="datetimerange"
|
||||
v-model="formData.planDate"
|
||||
value-format="yyyy-MM-dd HH:mm:ss">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="说明" prop="note">
|
||||
<el-input
|
||||
:disabled="isView"
|
||||
:rows="3"
|
||||
placeholder="请输入说明"
|
||||
type="textarea"
|
||||
v-model="formData.note">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<span class="dialog-footer" slot="footer" v-if="!isView">
|
||||
<el-button @click="dialogVisible = false">关 闭</el-button>
|
||||
<el-button @click="doSubmit" type="primary">提 交</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
tableColumns: [
|
||||
{prop: 'year', label: '年度', width: '200'},
|
||||
{prop: 'startDate', label: '开始时间', width: '200'},
|
||||
{prop: 'endDate', label: '结束时间', width: '200'},
|
||||
{prop: 'note', label: '备注'},
|
||||
],
|
||||
isView: false,
|
||||
title: "",
|
||||
dialogVisible: false,
|
||||
formRules: {
|
||||
year: [{required: true, message: '必选', trigger: ['blur', 'change']}],
|
||||
planDate: [{
|
||||
required: true,
|
||||
message: '必选',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
},
|
||||
}
|
||||
},
|
||||
components: {},
|
||||
methods: {
|
||||
doSubmit() {
|
||||
this.$refs["addForm"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const formData = clone(this.formData)
|
||||
formData.startDate = formData.planDate[0]
|
||||
formData.endDate = formData.planDate[1]
|
||||
const resp = await this.$axios.post('/platform/asset/stocktakingPlan/doSubmit', formData)
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
this.notifySuccess(resp.msg)
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
this.dialogVisible = false
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
openAdd() {
|
||||
this.isView = false
|
||||
this.title = "新增计划"
|
||||
this.formData = {
|
||||
year: this.$moment().format('YYYY') + "",
|
||||
planDate: [],
|
||||
note: null
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
openView(row) {
|
||||
this.isView = true
|
||||
this.title = "查看计划"
|
||||
this.formData = {
|
||||
year: row.year,
|
||||
planDate: [row.startDate, row.endDate],
|
||||
note: row.note
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
openEdit(row) {
|
||||
this.isView = false
|
||||
this.title = "编辑计划"
|
||||
this.formData = {
|
||||
id: row.id,
|
||||
year: row.year,
|
||||
planDate: [row.startDate, row.endDate],
|
||||
note: row.note
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm("此操作将永久删除盘点计划, 是否继续?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
const resp = await this.$axios.post("/platform/asset/stocktakingPlan/doDelete", {id})
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: resp.msg
|
||||
})
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+19
-15
@@ -158,6 +158,7 @@ const basicForm = {
|
||||
</span>
|
||||
|
||||
<el-input-number v-model="formData.timeLimit" :min="0" :max="100"
|
||||
:precision="0"
|
||||
placeholder="无需限制请设置为0"></el-input-number>
|
||||
</el-form-item>
|
||||
|
||||
@@ -170,16 +171,17 @@ const basicForm = {
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="封面" prop="cover">
|
||||
<file-upload
|
||||
:upload_number="1"
|
||||
:value.sync="formData.cover"
|
||||
accept=".jpg,.jpeg,.png"
|
||||
complete_result
|
||||
upload_mode="image"
|
||||
upload_result_category="interval"
|
||||
></file-upload>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="封面" prop="cover">-->
|
||||
<!-- <file-upload-->
|
||||
<!-- :upload_number="1"-->
|
||||
<!-- :value.sync="formData.cover"-->
|
||||
<!-- accept=".jpg,.jpeg,.png"-->
|
||||
<!-- complete_result-->
|
||||
<!-- upload_mode="image"-->
|
||||
<!-- upload_result_category="interval"-->
|
||||
<!-- ></file-upload>-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
</template>
|
||||
</el-form>
|
||||
</div>
|
||||
@@ -196,12 +198,14 @@ const basicForm = {
|
||||
`,
|
||||
dicts: ["ACTIVITY_QSV_CATEGORY", "ACTIVITY_QSV_MODE", "ACTIVITY_QSV_REPEAT_MODE", "ACTIVITY_QSV_SCORE_MODE"],
|
||||
components: {
|
||||
"drawer-user-scope": httpVueLoader("/components/module/activity/DrawerUserScope.vue")
|
||||
"drawer-user-scope": httpVueLoader("/components/plugins/DrawerUserScope.vue")
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formData: {},
|
||||
formData: {
|
||||
category: ''
|
||||
},
|
||||
formRules: {
|
||||
category: [{ required: true, message: "请选择类型", trigger: "change" }],
|
||||
title: [{ required: true, message: "请输入标题", trigger: "change" }],
|
||||
@@ -218,7 +222,7 @@ const basicForm = {
|
||||
this.dialogVisible = true
|
||||
this.getActivityGroup()
|
||||
if (id) {
|
||||
this.$axios.post("/platform/qsv/activity/findOne", { id }).then((res) => {
|
||||
$.post("/platform/qsv/activity/findOne", { id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.formData = res.data
|
||||
}
|
||||
@@ -230,7 +234,7 @@ const basicForm = {
|
||||
onSubmit() {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$axios.post("/platform/qsv/activity/save", this.formData).then((res) => {
|
||||
$.post("/platform/qsv/activity/save", this.formData).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.dialogVisible = false
|
||||
@@ -241,7 +245,7 @@ const basicForm = {
|
||||
})
|
||||
},
|
||||
getActivityGroup() {
|
||||
this.$axios.post("/platform/activity/basic/scope/getActivityUserScopeGroup").then((res) => {
|
||||
$.post("/platform/activity/basic/scope/getActivityUserScopeGroup").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.activityGroupOptions = res.data
|
||||
}
|
||||
+6
-5
@@ -7,15 +7,17 @@ layout("/layouts/platform.html"){
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker placeholder="年度" type="year" v-model="pageForm.year" value-format="yyyy"></el-date-picker>
|
||||
<el-date-picker placeholder="年度" style="width: 100%" type="year" v-model="pageForm.year"
|
||||
value-format="yyyy"></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="标题">
|
||||
<el-input placeholder="标题" v-model="pageForm.title" clearable></el-input>
|
||||
</search-item>
|
||||
</search>
|
||||
|
||||
</el-card>
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="管理列表">
|
||||
<el-button @click="$refs.basicFormRef.onOpen()" size="small" type="primary" class="mr5">新增</el-button>
|
||||
</table-tool>
|
||||
|
||||
@@ -46,7 +48,6 @@ layout("/layouts/platform.html"){
|
||||
</guava>
|
||||
|
||||
<basic-form ref="basicFormRef" @refresh="pageData"></basic-form>
|
||||
<!-- <subject-form ref="subjectFormRef" @refresh="pageData"></subject-form>-->
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@@ -80,7 +81,7 @@ layout("/layouts/platform.html"){
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/qsv/activity/delete", { id }).then((res) => {
|
||||
$.post("/platform/qsv/activity/delete", {id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("删除成功")
|
||||
this.pageData()
|
||||
+2
-2
@@ -3,7 +3,7 @@ const optionImg = {
|
||||
<el-dialog :visible="visible" title="设置图片" append-to-body width="700px">
|
||||
<div style="background: #f7f8f9;text-align: center;border: solid 1px #d7d8d9;border-radius: 4px;">
|
||||
<el-upload
|
||||
action="/platform/sys/file/uploadDynamicReturnUrl"
|
||||
action="/file_server/uploadFile"
|
||||
:show-file-list="false"
|
||||
:on-success="handleSuccess"
|
||||
:before-upload="beforeUpload">
|
||||
@@ -38,7 +38,7 @@ const optionImg = {
|
||||
console.log(file)
|
||||
console.log(fileList)
|
||||
if (response.code === 0) {
|
||||
this.img = response.data
|
||||
this.img = FILE_STREAM_PREVIEW_ADDRESS + "?id=" + response.data.filepath
|
||||
// this.img = "/platform/sys/file/download?id=t38dmq4beuhrupqb54prl52t4u"
|
||||
this.$message.success("图片上传成功")
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
const setting = {
|
||||
template:/*language=HTML*/`
|
||||
<el-dialog :title="title" :visible.sync="visible" append-to-body width="50%">
|
||||
<el-form :model="formData" label-width="80px">
|
||||
<el-form-item label="链接" prop="link">
|
||||
<el-input maxlength="255" placeholder="" v-model="formData.link"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="详情" prop="description">
|
||||
<text-editor v-model="formData.description"></text-editor>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="onConfirm">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
`,
|
||||
data(){
|
||||
return{
|
||||
title: '设置',
|
||||
visible: false,
|
||||
formData:{},
|
||||
ext: null
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
onOpen(option,ext){
|
||||
console.log(option)
|
||||
this.formData = { ...option }
|
||||
this.ext = ext
|
||||
this.visible = true
|
||||
},
|
||||
onConfirm(){
|
||||
this.$emit('confirm', { option:this.formData,ext:this.ext })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+86
-23
@@ -1,4 +1,6 @@
|
||||
<!--#include('optionImg.js'){}#-->
|
||||
<!--#include('setting.js'){}#-->
|
||||
<!--#include('txtImport.js'){}#-->
|
||||
|
||||
const subjectForm = {
|
||||
template: /*language=HTML*/ `
|
||||
@@ -33,7 +35,8 @@ const subjectForm = {
|
||||
<el-option label="多选题" value="checkbox">
|
||||
<i class="el-icon-check subject-type-icon"></i>多选题
|
||||
</el-option>
|
||||
<el-option label="填空题" value="text" v-if="activity.category!=='QUIZ'">
|
||||
<el-option label="填空题" value="text"
|
||||
v-if="activity.category!=='QUIZ'">
|
||||
<i class="el-icon-edit subject-type-icon"></i>填空题
|
||||
</el-option>
|
||||
<!-- <el-option label="判断题" value="judge">-->
|
||||
@@ -41,8 +44,11 @@ const subjectForm = {
|
||||
<!-- </el-option>-->
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
|
||||
<div v-if="subject.type === 'checkbox'">
|
||||
最大选择数:
|
||||
<el-input-number v-model="subject.maxMulti"
|
||||
placeholder="最多可选数量"></el-input>
|
||||
</div>
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="subject.hint"-->
|
||||
<!-- placeholder="题目提示信息"-->
|
||||
@@ -115,6 +121,14 @@ const subjectForm = {
|
||||
v-model="option.isCorrect"
|
||||
active-text="正确答案">
|
||||
</el-switch>
|
||||
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-setting"
|
||||
size="mini"
|
||||
@click="openSetting(subjectIndex,optionIndex,option)">
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@@ -180,6 +194,9 @@ const subjectForm = {
|
||||
|
||||
<div style="border-top: 1px solid var(--border-color-lighter);padding: 12px;text-align: right;">
|
||||
<!-- <el-button @click="visible = false">取消</el-button>-->
|
||||
<el-button type="primary" icon="el-icon-upload" @click="openTxtImport">
|
||||
从文本导入
|
||||
</el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addSubject">
|
||||
添加题目
|
||||
</el-button>
|
||||
@@ -189,10 +206,14 @@ const subjectForm = {
|
||||
</div>
|
||||
|
||||
<option-img ref="optionImgRef" @confirm="onOptionImgConfirm"></option-img>
|
||||
<setting ref="settingRef" @confirm="onSettingConfirm"></setting>
|
||||
<txt-import ref="txtImportRef" @confirm="onTxtImportConfirm"></txt-import>
|
||||
</div>
|
||||
`,
|
||||
components: {
|
||||
'option-img': optionImg,
|
||||
'setting': setting,
|
||||
'txt-import': txtImport
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -210,12 +231,12 @@ const subjectForm = {
|
||||
this.visible = true
|
||||
if (id) {
|
||||
this.id = id
|
||||
this.$axios.post("/platform/qsv/activity/findOne", {id}).then((res) => {
|
||||
$.post("/platform/qsv/activity/findOne", {id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.activity = res.data
|
||||
}
|
||||
})
|
||||
this.$axios.post("/platform/qsv/activity/listSubjects", {activityId: id}).then((res) => {
|
||||
$.post("/platform/qsv/activity/listSubjects", {activityId: id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.subjects = res.data
|
||||
}
|
||||
@@ -257,8 +278,8 @@ const subjectForm = {
|
||||
},
|
||||
|
||||
//题目类型切换
|
||||
subjectTypeChange(subject, subjectIndex){
|
||||
if(subject.type==='text'){
|
||||
subjectTypeChange(subject, subjectIndex) {
|
||||
if (subject.type === 'text') {
|
||||
subject.options = []
|
||||
}
|
||||
},
|
||||
@@ -277,7 +298,7 @@ const subjectForm = {
|
||||
.catch(() => {
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
//添加选项
|
||||
addOption(subject) {
|
||||
subject.options.push({
|
||||
@@ -288,7 +309,7 @@ const subjectForm = {
|
||||
isCorrect: false
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
//删除选项
|
||||
removeOption(subject, optionIndex) {
|
||||
subject.options.splice(optionIndex, 1)
|
||||
@@ -301,21 +322,63 @@ const subjectForm = {
|
||||
optionIndex
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
//选项图片上传成功回调
|
||||
onOptionImgConfirm({img, ext}) {
|
||||
this.$set(this.subjects[ext.subjectIndex].options[ext.optionIndex], "imgUrl", img)
|
||||
},
|
||||
|
||||
|
||||
//删除选项图片
|
||||
removeOptionImg(subjectIndex, optionIndex){
|
||||
removeOptionImg(subjectIndex, optionIndex) {
|
||||
this.$set(this.subjects[subjectIndex].options[optionIndex], "imgUrl", null)
|
||||
console.log(this.subjects[subjectIndex])
|
||||
},
|
||||
|
||||
|
||||
//打开选项设置
|
||||
openSetting(subjectIndex, optionIndex, option) {
|
||||
this.$refs.settingRef.onOpen(option, {
|
||||
subjectIndex,
|
||||
optionIndex
|
||||
})
|
||||
},
|
||||
|
||||
//选项设置确认
|
||||
onSettingConfirm({option, ext}) {
|
||||
this.subjects[ext.subjectIndex].options[ext.optionIndex] = option
|
||||
console.log(this.subjects[ext.subjectIndex].options[ext.optionIndex])
|
||||
|
||||
// this.$set(this.subjects[ext.subjectIndex].options[ext.optionIndex], "isCorrect", option.isCorrect)
|
||||
// this.$set(this.subjects[ext.subjectIndex].options[ext.optionIndex], "hint", option.hint)
|
||||
},
|
||||
|
||||
//从文本导入
|
||||
openTxtImport() {
|
||||
this.$refs.txtImportRef.visible = true;
|
||||
},
|
||||
|
||||
//处理导入的题目
|
||||
onTxtImportConfirm(importedQuestions) {
|
||||
if (!importedQuestions || importedQuestions.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 计算新题目的起始序号
|
||||
const startSortNum = this.subjects.length + 1;
|
||||
|
||||
// 更新导入题目的序号
|
||||
importedQuestions.forEach((question, index) => {
|
||||
question.sortNum = startSortNum + index;
|
||||
});
|
||||
|
||||
// 将导入的题目添加到现有题目列表
|
||||
this.subjects.push(...importedQuestions);
|
||||
|
||||
this.$message.success('成功导入' + importedQuestions.length + '道题目');
|
||||
},
|
||||
|
||||
//保存
|
||||
saveQuestionnaire() {
|
||||
this.$axios
|
||||
$
|
||||
.post("/platform/qsv/activity/saveSubjects", {
|
||||
activityId: this.id,
|
||||
subjects: JSON.stringify(this.subjects)
|
||||
@@ -459,9 +522,9 @@ const subjectForm = {
|
||||
.subject-type-icon {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
|
||||
.option-img-box{
|
||||
|
||||
|
||||
.option-img-box {
|
||||
position: relative;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
@@ -472,13 +535,13 @@ const subjectForm = {
|
||||
.option-img-box:hover .el-icon-remove {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.option-img-box img{
|
||||
|
||||
.option-img-box img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.option-img-box .el-icon-remove{
|
||||
|
||||
.option-img-box .el-icon-remove {
|
||||
position: absolute;
|
||||
top: -7px;
|
||||
right: -7px;
|
||||
@@ -486,9 +549,9 @@ const subjectForm = {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.option-img-box .el-icon-remove:hover{
|
||||
.option-img-box .el-icon-remove:hover {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,526 @@
|
||||
const txtImport = {
|
||||
template: /*language=HTML*/ `
|
||||
<el-dialog :visible.sync="visible" title="导入题目" width="80%" append-to-body custom-class="txt-import-dialog" top="50px">
|
||||
<div class="txt-import-container">
|
||||
<div class="txt-import-left-panel">
|
||||
<div class="txt-import-panel-header">
|
||||
<div class="txt-import-title">题目输入区</div>
|
||||
<div class="txt-import-format-tip">
|
||||
<el-tooltip placement="top" effect="light" class="txt-import-format-tooltip">
|
||||
<div slot="content">
|
||||
<div style="max-width: 300px; line-height: 1.5;">
|
||||
<p><b>支持的格式:</b></p>
|
||||
<p>单选题:</p>
|
||||
<p>1.题目标题?(A)</p>
|
||||
<p>A.选项A</p>
|
||||
<p>B.选项B</p>
|
||||
<p>C.选项C</p>
|
||||
<p>D.选项D</p>
|
||||
<p style="margin-top: 10px;">多选题:</p>
|
||||
<p>2.题目标题?(ABC)</p>
|
||||
<p>A.选项A</p>
|
||||
<p>B.选项B</p>
|
||||
<p>C.选项C</p>
|
||||
<p>D.选项D</p>
|
||||
</div>
|
||||
</div>
|
||||
<el-button type="text" icon="el-icon-question" size="small">格式说明</el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
<div class="txt-import-input-area">
|
||||
<textarea
|
||||
class="txt-import-textarea"
|
||||
v-model="inputText"
|
||||
placeholder="请粘贴题目内容,支持格式如:
|
||||
|
||||
1.单选题标题?(A)
|
||||
A.选项A
|
||||
B.选项B
|
||||
C.选项C
|
||||
D.选项D
|
||||
|
||||
2.多选题标题?(ABC)
|
||||
A.选项A
|
||||
B.选项B
|
||||
C.选项C
|
||||
D.选项D"
|
||||
></textarea>
|
||||
</div>
|
||||
<div class="txt-import-action-buttons">
|
||||
<el-button type="primary" icon="el-icon-check" @click="parseQuestions" :loading="parsing" size="small">解析题目</el-button>
|
||||
<el-button icon="el-icon-delete" @click="clearInput" size="small">清空</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="txt-import-right-panel">
|
||||
<div class="txt-import-panel-header">
|
||||
<div class="txt-import-title">解析结果</div>
|
||||
<div class="txt-import-stats" v-if="parsedQuestions.length > 0">
|
||||
{{statsText}}
|
||||
<el-tag size="small" type="success" style="margin-left: 10px;">{{parsedQuestions.length}} 题</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
<div class="txt-import-result-display">
|
||||
<div v-if="parsedQuestions.length === 0" class="txt-import-no-questions">
|
||||
<el-empty description="暂无解析结果" :image-size="100">
|
||||
<template slot="description">
|
||||
<p>请先输入题目内容并点击"解析题目"按钮</p>
|
||||
</template>
|
||||
</el-empty>
|
||||
</div>
|
||||
<div v-for="(question, index) in parsedQuestions" :key="index" class="txt-import-question-item">
|
||||
<div class="txt-import-question-title">
|
||||
<span class="txt-import-question-number">{{index + 1}}</span>
|
||||
{{question.title}}
|
||||
<el-tag size="mini" type="info" style="margin-left: 5px;" v-if="question.type === 'checkbox'">多选题</el-tag>
|
||||
<el-tag size="mini" type="info" style="margin-left: 5px;" v-else>单选题</el-tag>
|
||||
</div>
|
||||
<div class="txt-import-options">
|
||||
<template v-if="question.options && question.options.length > 0">
|
||||
<div v-for="(option, optIndex) in question.options" :key="option.id || optIndex"
|
||||
:class="['txt-import-option-item', option.isCorrect ? 'txt-import-correct' : '']">
|
||||
<span class="txt-import-option-text">{{option.text}}</span>
|
||||
<span v-if="option.isCorrect" class="txt-import-correct-mark">✓</span>
|
||||
</div>
|
||||
</template>
|
||||
<div v-else class="txt-import-no-options">
|
||||
未发现选项数据
|
||||
</div>
|
||||
</div>
|
||||
<div class="txt-import-question-meta">
|
||||
<el-tag size="mini" type="success">正确答案: {{getCorrectAnswerText(question)}}</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div slot="footer" class="txt-import-dialog-footer">
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="confirmAdd" :disabled="parsedQuestions.length === 0">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
inputText: '',
|
||||
parsedQuestions: [],
|
||||
statsText: '',
|
||||
activityId: "cc7cb3b0b25c472794048229ad910fb1",
|
||||
parsing: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onOpen() {
|
||||
this.visible = true;
|
||||
this.inputText = '';
|
||||
this.parsedQuestions = [];
|
||||
this.statsText = '';
|
||||
},
|
||||
|
||||
clearInput() {
|
||||
this.$confirm('确定要清空当前输入内容吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.inputText = '';
|
||||
this.$message.success('已清空输入内容');
|
||||
}).catch(() => {});
|
||||
},
|
||||
|
||||
parseQuestions() {
|
||||
const input = this.inputText.trim();
|
||||
if (!input) {
|
||||
this.$message.error('请先输入题目内容');
|
||||
return;
|
||||
}
|
||||
|
||||
this.parsing = true;
|
||||
setTimeout(() => {
|
||||
try {
|
||||
const questionsGroups = this.splitIntoQuestions(input);
|
||||
|
||||
if (questionsGroups.length === 0) {
|
||||
throw new Error('未识别到有效题目,请检查格式');
|
||||
}
|
||||
|
||||
const parsedQuestions = [];
|
||||
questionsGroups.forEach((group, index) => {
|
||||
const result = this.parseOneQuestion(group, index + 1);
|
||||
if (result) {
|
||||
parsedQuestions.push(result);
|
||||
}
|
||||
});
|
||||
|
||||
this.parsedQuestions = parsedQuestions;
|
||||
this.updateStats();
|
||||
|
||||
if (parsedQuestions.length === 0) {
|
||||
this.$message.warning('没有成功解析任何题目,请检查格式');
|
||||
} else if (parsedQuestions.length < questionsGroups.length) {
|
||||
this.$message.warning('共' + questionsGroups.length + '道题目,成功解析' + parsedQuestions.length + '道');
|
||||
} else {
|
||||
this.$message.success('成功解析' + parsedQuestions.length + '道题目');
|
||||
}
|
||||
} catch (error) {
|
||||
this.$message.error('解析失败,请检查题目格式:' + error.message);
|
||||
} finally {
|
||||
this.parsing = false;
|
||||
}
|
||||
}, 300);
|
||||
},
|
||||
|
||||
splitIntoQuestions(text) {
|
||||
const lines = text.split('\n').map(line => line.trim()).filter(line => line);
|
||||
const questions = [];
|
||||
let currentQuestion = [];
|
||||
|
||||
lines.forEach(line => {
|
||||
if (/^\d+\./.test(line)) {
|
||||
if (currentQuestion.length > 0) {
|
||||
questions.push(currentQuestion.join('\n'));
|
||||
currentQuestion = [];
|
||||
}
|
||||
}
|
||||
currentQuestion.push(line);
|
||||
});
|
||||
|
||||
if (currentQuestion.length > 0) {
|
||||
questions.push(currentQuestion.join('\n'));
|
||||
}
|
||||
|
||||
return questions;
|
||||
},
|
||||
|
||||
parseOneQuestion(questionText, sortNum) {
|
||||
const lines = questionText.split('\n').map(line => line.trim()).filter(line => line);
|
||||
|
||||
const titleLine = lines[0];
|
||||
const titleMatch = titleLine.match(/^(\d+)\.(.+?)[((]([A-Z]+)[))]$/);
|
||||
|
||||
if (!titleMatch) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const questionNumber = titleMatch[1];
|
||||
const title = titleMatch[2].trim();
|
||||
const correctAnswerLetters = titleMatch[3].split('');
|
||||
|
||||
const options = [];
|
||||
for (let i = 1; i < lines.length; i++) {
|
||||
const line = lines[i];
|
||||
const optionMatch = line.match(/^([A-Z])[..、\s](.+)$/);
|
||||
|
||||
if (optionMatch) {
|
||||
const optionLetter = optionMatch[1];
|
||||
const optionText = optionMatch[2].trim();
|
||||
|
||||
options.push({
|
||||
letter: optionLetter,
|
||||
text: optionLetter + '. ' + optionText,
|
||||
isCorrect: correctAnswerLetters.includes(optionLetter)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (options.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return this.createQuestionObject({
|
||||
questionNumber,
|
||||
title,
|
||||
correctAnswerLetters,
|
||||
options,
|
||||
sortNum,
|
||||
isMultiple: correctAnswerLetters.length > 1
|
||||
});
|
||||
},
|
||||
|
||||
createQuestionObject(data) {
|
||||
const questionId = this.generateId();
|
||||
const formattedOptions = [];
|
||||
const correctOptionIds = [];
|
||||
|
||||
data.options.forEach((option, index) => {
|
||||
const optionId = this.generateId();
|
||||
if (option.isCorrect) {
|
||||
correctOptionIds.push(optionId);
|
||||
}
|
||||
|
||||
formattedOptions.push({
|
||||
id: optionId,
|
||||
subjectId: questionId,
|
||||
text: option.text,
|
||||
isCorrect: option.isCorrect,
|
||||
imgUrl: null,
|
||||
link: null,
|
||||
description: null,
|
||||
sortNum: index + 1
|
||||
});
|
||||
});
|
||||
|
||||
return {
|
||||
id: questionId,
|
||||
activityId: this.activityId,
|
||||
title: data.title,
|
||||
type: data.isMultiple ? "checkbox" : "radio",
|
||||
correctAnswer: correctOptionIds,
|
||||
score: 10,
|
||||
displayDate: null,
|
||||
maxMulti: data.isMultiple ? correctOptionIds.length : null,
|
||||
sortNum: data.sortNum,
|
||||
options: formattedOptions,
|
||||
userSelectOptionIds: null,
|
||||
userFillContent: null
|
||||
};
|
||||
},
|
||||
|
||||
generateId() {
|
||||
return 'xxxxxxxx'.replace(/[x]/g, () => {
|
||||
return (Math.random() * 16 | 0).toString(16);
|
||||
});
|
||||
},
|
||||
|
||||
getCorrectAnswerText(question) {
|
||||
if (!question || !question.options || !Array.isArray(question.options)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const correctOptions = question.options.filter(opt => opt.isCorrect);
|
||||
if (correctOptions.length === 0) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return correctOptions.map(opt => opt.text).join('、');
|
||||
},
|
||||
|
||||
updateStats() {
|
||||
this.statsText = '已解析 ' + this.parsedQuestions.length + ' 道题目 | ' +
|
||||
'总分值 ' + (this.parsedQuestions.length * 10) + ' 分 | ';
|
||||
},
|
||||
|
||||
confirmAdd() {
|
||||
if (this.parsedQuestions.length === 0) {
|
||||
this.$message.warning('请先解析题目');
|
||||
return;
|
||||
}
|
||||
console.log(this.parsedQuestions)
|
||||
this.$emit('confirm', this.parsedQuestions);
|
||||
this.visible = false;
|
||||
}
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
.txt-import-dialog .el-dialog__body {
|
||||
padding: 10px 20px;
|
||||
}
|
||||
|
||||
.txt-import-container {
|
||||
display: flex;
|
||||
height: 80vh;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.txt-import-panel-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 15px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
height: 32px; /* 统一高度 */
|
||||
}
|
||||
|
||||
.txt-import-left-panel {
|
||||
width: 50%;
|
||||
padding: 20px;
|
||||
border-right: 1px solid #ebeef5;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.txt-import-right-panel {
|
||||
width: 50%;
|
||||
padding: 20px;
|
||||
background-color: #fff; /* 改为白色背景 */
|
||||
overflow-y: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.txt-import-title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.txt-import-format-tip {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.txt-import-format-tooltip {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.txt-import-input-area {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
margin-bottom: 15px;
|
||||
background-color: #f9fafc;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #ebeef5;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.txt-import-textarea {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 15px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
resize: none;
|
||||
outline: none;
|
||||
font-family: "Consolas", "微软雅黑", monospace;
|
||||
transition: all 0.3s;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.txt-import-textarea:focus {
|
||||
box-shadow: 0 0 0 2px rgba(24,103,176,0.2);
|
||||
}
|
||||
|
||||
.txt-import-action-buttons {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 10px;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.txt-import-stats {
|
||||
color: #1867b0;
|
||||
font-size: 13px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.txt-import-result-display {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
background-color: #f9fafc; /* 只在结果显示区域使用浅灰色背景 */
|
||||
border-radius: 4px;
|
||||
padding: 15px;
|
||||
border: 1px solid #ebeef5;
|
||||
}
|
||||
|
||||
.txt-import-no-questions {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #909399;
|
||||
font-style: italic;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.txt-import-question-item {
|
||||
background-color: #fff;
|
||||
margin-bottom: 15px;
|
||||
padding: 15px;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0,0,0,0.05);
|
||||
transition: all 0.3s;
|
||||
border-left: 3px solid #67c23a;
|
||||
}
|
||||
|
||||
.txt-import-question-item:hover {
|
||||
box-shadow: 0 4px 12px 0 rgba(0,0,0,0.1);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.txt-import-question-title {
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 12px;
|
||||
color: #303133;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.txt-import-question-number {
|
||||
display: inline-block;
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
line-height: 25px;
|
||||
text-align: center;
|
||||
background-color: #1867b0;
|
||||
color: white;
|
||||
border-radius: 50%;
|
||||
margin-right: 8px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.txt-import-options {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.txt-import-option-item {
|
||||
margin-bottom: 8px;
|
||||
padding: 8px 12px;
|
||||
background-color: #f5f7fa;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.txt-import-option-item:hover {
|
||||
background-color: #ebeef5;
|
||||
}
|
||||
|
||||
.txt-import-option-item.txt-import-correct {
|
||||
background-color: #f0f9eb;
|
||||
color: #67c23a;
|
||||
border-left: 3px solid #67c23a;
|
||||
}
|
||||
|
||||
.txt-import-option-text {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.txt-import-correct-mark {
|
||||
color: #67c23a;
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.txt-import-question-meta {
|
||||
margin-top: 12px;
|
||||
padding-top: 12px;
|
||||
border-top: 1px dashed #ebeef5;
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.txt-import-dialog-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.txt-import-no-options {
|
||||
padding: 10px;
|
||||
color: #f56c6c;
|
||||
font-style: italic;
|
||||
background-color: #fef0f0;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
`
|
||||
};
|
||||
@@ -0,0 +1,129 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
:clearable="false"
|
||||
@change="listActivity"
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="问卷">
|
||||
<el-select filterable placeholder="所属问卷" style="width: 100%" @change="doSearch"
|
||||
v-model="pageForm.activityId">
|
||||
<el-option :label="item.title" :value="item.id" :key="item.id"
|
||||
v-for="item in activityOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="姓名/工号">
|
||||
<el-input v-model="pageForm.searchKeyword" placeholder="姓名/工号" clearable></el-input>
|
||||
</search-item>
|
||||
<search-item label="所属工会">
|
||||
<el-select clearable filterable placeholder="所属工会" style="width: 100%"
|
||||
v-model="pageForm.unionId" @change="flushUnits">
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id"
|
||||
v-for="item in unionOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属单位">
|
||||
<el-select placeholder="所属单位" style="width: 100%" v-model="pageForm.unitId" clearable
|
||||
filterable>
|
||||
<el-option v-for="item in unitOptions" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="答题日期">
|
||||
<el-date-picker
|
||||
@change="doSearch"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.attemptDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择答题日期"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="管理列表">
|
||||
<el-button @click="exportXlsx" icon="el-icon-download" size="small" type="primary" class="mr5">
|
||||
导出xlsx
|
||||
</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" ref="tableRef" @sort-change="pageOrder">
|
||||
<el-table-column label="序号" width="50" type="index" :index="indexMethod"></el-table-column>
|
||||
<el-table-column label="姓名" prop="userName" sortable></el-table-column>
|
||||
<el-table-column label="工号" prop="loginName" sortable></el-table-column>
|
||||
<el-table-column label="性别" prop="sex" sortable></el-table-column>
|
||||
<el-table-column label="单位" prop="unitName" sortable></el-table-column>
|
||||
<el-table-column label="分工会" prop="unionName" sortable></el-table-column>
|
||||
<el-table-column label="联系方式" prop="mobile" sortable></el-table-column>
|
||||
<el-table-column label="答题日期" prop="attemptDate" sortable></el-table-column>
|
||||
<el-table-column label="得分" prop="totalScore" sortable></el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
activityOptions: [],
|
||||
unionOptions: [],
|
||||
unitOptions: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
listActivity() {
|
||||
$.post("/platform/qsv/quizRank/listQuiz", {year: this.pageForm.year}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.activityOptions = res.data
|
||||
if (this.activityOptions.length > 0) {
|
||||
this.pageForm.activityId = this.activityOptions[0].id
|
||||
this.pageData()
|
||||
} else {
|
||||
this.pageForm.activityId = null
|
||||
this.tableData = []
|
||||
this.pageForm.totalCount = 0
|
||||
this.pageForm.pageNumber = 1
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
exportXlsx() {
|
||||
this.$downLoad("/platform/qsv/quizRank/exportXlsx", this.pageForm)
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", null)
|
||||
this.unitList = []
|
||||
if (this.pageForm.unionId) {
|
||||
this.$businessTool.listUnit(this.pageForm.unionId).then((data) => {
|
||||
this.unitOptions = data
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.unionOptions = await this.$businessTool.listUnion()
|
||||
this.unitOptions = await this.$businessTool.listUnit()
|
||||
this.listActivity()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+10
-6
@@ -1,7 +1,7 @@
|
||||
const answer = {
|
||||
/*language=HTML*/
|
||||
template: `
|
||||
<el-dialog title="查看答卷" :visible.sync="dialogVisible" width="50%">
|
||||
<el-dialog title="查看答卷" :visible.sync="dialogVisible" width="80%">
|
||||
<el-row type="flex" justify="end" class="mb10">
|
||||
<el-button type="primary" size="small" icon="el-icon-download" @click="exportUserAnswerXlsx">导出xlsx</el-button>
|
||||
</el-row>
|
||||
@@ -14,8 +14,10 @@ const answer = {
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-dialog>
|
||||
`,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
@@ -28,14 +30,16 @@ const answer = {
|
||||
onOpen(activityId) {
|
||||
this.activityId = activityId
|
||||
this.dialogVisible = true
|
||||
this.list()
|
||||
this.pageData()
|
||||
},
|
||||
|
||||
list() {
|
||||
this.$axios.post("/platform/qsv/survey/userAnswer", { activityId: this.activityId }).then((res) => {
|
||||
pageData() {
|
||||
this.pageForm.activityId = this.activityId
|
||||
$.post("/platform/qsv/survey/userAnswer", this.pageForm).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.tableColumns = res.data.tableColumns
|
||||
this.tableData = res.data.tableData
|
||||
this.tableData = res.data.tableData.list
|
||||
this.pageForm.totalCount = res.data.tableData.totalCount
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -46,7 +50,7 @@ const answer = {
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/qsv/survey/deleteUserAnswer", { id }).then((res) => {
|
||||
$.post("/platform/qsv/survey/deleteUserAnswer", { id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.list()
|
||||
@@ -0,0 +1,74 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
:clearable="false"
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="数据列表">
|
||||
<!-- <el-button @click="exportXlsx" icon="el-icon-download" size="small" type="primary" class="mr5">导出xlsx</el-button>-->
|
||||
</table-tool>
|
||||
<el-table :data="tableData" ref="tableRef" @sort-change="pageOrder">
|
||||
<el-table-column label="序号" width="50" type="index" :index="indexMethod"></el-table-column>
|
||||
<el-table-column label="标题" prop="title" width="320" sortable></el-table-column>
|
||||
<el-table-column label="类型" prop="category" sortable>
|
||||
<template scope="{row}">
|
||||
<dict-tag :options="dict.type.ACTIVITY_QSV_CATEGORY" :value="row.category"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间" prop="startTime" sortable></el-table-column>
|
||||
<el-table-column label="结束时间" prop="endTime" sortable></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="200px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="$refs.reportRef.onOpen(row.id)">查看分析
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" @click="$refs.answerRef.onOpen(row.id)">查看答卷
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
<report ref="reportRef"></report>
|
||||
<answer ref="answerRef"></answer>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include('report.js'){}#-->
|
||||
<!--#include('answer.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
dicts: ["ACTIVITY_QSV_CATEGORY"],
|
||||
components: {report, answer},
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
methods: {
|
||||
exportXlsx() {
|
||||
this.$downLoad("/platform/qsv/survey/exportXlsx", this.pageForm)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+8
-3
@@ -2,6 +2,9 @@ const report = {
|
||||
/*language=HTML*/
|
||||
template: `
|
||||
<el-dialog title="分析报告" :visible.sync="dialogVisible" width="50%">
|
||||
<el-row type="flex" justify="end" class="mb10">
|
||||
<el-button type="primary" size="small" icon="el-icon-download" @click="exportReportXlsx">导出xlsx</el-button>
|
||||
</el-row>
|
||||
<div v-for="(subject,subjectIndex) in subjects" class="subject">
|
||||
<div>
|
||||
<div class="title">
|
||||
@@ -63,7 +66,7 @@ const report = {
|
||||
onOpen(activityId) {
|
||||
this.dialogVisible = true
|
||||
this.activityId = activityId
|
||||
this.$axios.post("/platform/qsv/survey/report", { activityId }).then((res) => {
|
||||
$.post("/platform/qsv/survey/report", { activityId }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.subjects = res.data
|
||||
}
|
||||
@@ -72,8 +75,7 @@ const report = {
|
||||
openDetail(subjectId, optionId) {
|
||||
console.log(subjectId)
|
||||
console.log(optionId)
|
||||
this.$axios
|
||||
.post("/platform/qsv/survey/selectOptionUsers", {
|
||||
$.post("/platform/qsv/survey/selectOptionUsers", {
|
||||
activityId: this.activityId,
|
||||
subjectId,
|
||||
optionId
|
||||
@@ -84,6 +86,9 @@ const report = {
|
||||
this.optionUsers = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
exportReportXlsx(){
|
||||
this.$downLoad("/platform/qsv/survey/exportReportXlsx", { activityId: this.activityId })
|
||||
}
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
@@ -0,0 +1,165 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app" v-cloak>
|
||||
<guava>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="院区名称">
|
||||
<el-input style="width: 350px;" @keyup.enter.native="doSearch"
|
||||
clearable placeholder="请输入院区名称" v-model="pageForm.campusName"></el-input>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt20">
|
||||
<table-tool label="体检项目" :app="this">
|
||||
<el-button type="primary" size="small" @click="openAdd"> 新增院区</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData">
|
||||
<el-table-column align="center" header-align="center" label="序号" type="index" width="100">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="院区编码"
|
||||
prop="campusCode"></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="院区名称"
|
||||
prop="campusName"></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作" width="200">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openEdit(row)" size="mini" type="primary">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button @click="doDelete(row.id)" size="mini" type="danger">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row class="el-pagination-container">
|
||||
<el-pagination
|
||||
@current-change="pageNumberChange"
|
||||
:current-page="pageForm.pageNumber"
|
||||
layout="total, prev, pager, next, jumper"
|
||||
:total="pageForm.totalCount">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
</guava>
|
||||
|
||||
<el-dialog title="新增院区" :visible.sync="addDialogVisible" :close-on-click-modal="false" width="30%">
|
||||
<el-form :model="formData" ref="addForm" :rules="rules">
|
||||
<el-form-item prop="campusCode" label="院区编码">
|
||||
<el-input v-model="formData.campusCode" placeholder="请输入院区编码" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="campusName" label="院区名称">
|
||||
<el-input v-model="formData.campusName" placeholder="请输入院区名称" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="addDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doAdd">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="编辑院区" :visible.sync="editDialogVisible" :close-on-click-modal="false" width="30%">
|
||||
<el-form :model="formData" ref="editForm" :rules="rules">
|
||||
<el-form-item prop="campusCode" label="院区编码">
|
||||
<el-input v-model="formData.campusCode" placeholder="请输入院区编码" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="campusName" label="院区名称">
|
||||
<el-input v-model="formData.campusName" placeholder="请输入院区名称" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="editDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doEdit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
|
||||
addDialogVisible: false,
|
||||
editDialogVisible: false,
|
||||
formData: {},
|
||||
rules: {
|
||||
campusName: [{required: true, message: '请输入院区名称', trigger: ['change', 'blur']}],
|
||||
campusCode: [{required: true, message: '请输入院区编码', trigger: ['change', 'blur']}]
|
||||
},
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openAdd() {
|
||||
this.formData = {}
|
||||
this.addDialogVisible = true
|
||||
if (this.$refs["addForm"])
|
||||
this.$refs["addForm"].resetFields()
|
||||
},
|
||||
doAdd() {
|
||||
this.$refs['addForm'].validate(valid => {
|
||||
if (valid) {
|
||||
$.post('/platform/healthCheckup/campus/doAdd', this.formData).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.addDialogVisible = false
|
||||
this.pageData()
|
||||
this.$message.success(res.msg)
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
openEdit(obj) {
|
||||
this.formData = JSON.parse(JSON.stringify(obj))
|
||||
this.editDialogVisible = true
|
||||
},
|
||||
doEdit() {
|
||||
this.$refs['editForm'].validate(valid => {
|
||||
if (valid) {
|
||||
$.post('/platform/healthCheckup/campus/doEdit', this.formData).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.editDialogVisible = false
|
||||
this.pageData()
|
||||
this.$message.success(res.msg)
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm('此操作将删除院区,确认删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
$.post('/platform/healthCheckup/campus/doDelete', {id: id}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.doSearch()
|
||||
this.$message.success(res.msg)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,338 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<div id="app" class="platform" v-cloak>
|
||||
<guava ref="guava" padding="0 5%">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
:clearable="true"
|
||||
@change="yearChange"
|
||||
placeholder="选择年"
|
||||
type="year"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="体检项目">
|
||||
<el-select @change="doSearch();getHealthCheckupSubject();"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.projectId">
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id"
|
||||
v-for="item in projectOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="职工信息">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
||||
@keyup.enter.native="doSearch" style="width: 100%">
|
||||
<el-select v-model="pageForm.searchName" slot="prepend"
|
||||
style="width: 80px;">
|
||||
<el-option label="姓名" value="hcu.username"></el-option>
|
||||
<el-option label="工号" value="hcu.loginname"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</search-item>
|
||||
<search-item label="所属工会" v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN'])">
|
||||
<el-select placeholder="请选择所属工会" v-model="pageForm.unionId"
|
||||
style="width: 100%;"
|
||||
clearable
|
||||
@change="flushUnits" @clear="flushUnits"
|
||||
filterable>
|
||||
<el-option v-for="item in unions"
|
||||
:label="item.name"
|
||||
:key="item.id"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属单位">
|
||||
<el-select placeholder="所属单位" v-model="pageForm.unitId"
|
||||
style="width: 100%;"
|
||||
clearable
|
||||
filterable>
|
||||
<el-option v-for="item in units"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
:key="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="体检项目">
|
||||
<el-button type="primary" size="small" @click="openImport">导入名单
|
||||
</el-button>
|
||||
<el-button :disabled="!pageForm.projectId" type="primary" size="small"
|
||||
@click="doAudit(true)">确认名单
|
||||
</el-button>
|
||||
<!-- 取消确认 -->
|
||||
<el-button :disabled="!pageForm.projectId" type="danger" size="small"
|
||||
@click="doAudit(false)">取消确认
|
||||
</el-button>
|
||||
</table-tool>
|
||||
|
||||
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id"
|
||||
@sort-change="pageOrder" :size="tableSize"
|
||||
v-loading="tableLoading" ref="table" class="vi-table">
|
||||
|
||||
|
||||
<el-table-column align="center" header-align="center" type="index"
|
||||
:index="indexMethod" label="序号"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
show-overflow-tooltip
|
||||
:sortable="column.sortable"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:key="column.prop"
|
||||
:width="column.width" min-width="100px">
|
||||
|
||||
<template v-if="column.prop=='optionName'" v-slot="{row}">
|
||||
{{row.optionName?row.optionName:''}}
|
||||
</template>
|
||||
|
||||
<template v-else-if="column.prop=='isAudit'" v-slot="{row}">
|
||||
<el-tag type="success" v-if="row.isAudit">已确认</el-tag>
|
||||
<el-tag type="info" v-else>未确认</el-tag>
|
||||
</template>
|
||||
|
||||
<template v-else-if="column.prop=='userSign'" v-slot="{row}">
|
||||
<el-image v-if="row.userSign"
|
||||
:src="row.userSign"
|
||||
fit="cover" style="height: 60px"></el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="userOnline" align="center" header-align="center"
|
||||
label="操作"
|
||||
fixed="right">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openEditHealthCheckup(row)" size="mini"
|
||||
:disabled="row.isAudit" type="primary">
|
||||
编辑
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog title="修改套餐" :visible.sync="exportHealthCheckupDialog" width="50%"
|
||||
:close-on-click-modal="false">
|
||||
<el-form :model="editHealthCheckupData" label-width="120px" ref="editHealthCheckupForm">
|
||||
<el-form-item label="姓名">
|
||||
<el-input :value="editHealthCheckupData.userName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="工号">
|
||||
<el-input :value="editHealthCheckupData.loginName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="套餐"
|
||||
prop="subjectId"
|
||||
:rules="[{required:true,message:'请选择',trigger:['change','blur']}]">
|
||||
<el-select v-model="editHealthCheckupData.subjectId" style="width: 100%">
|
||||
<el-option v-for="item in projectSubjectOptions" :key="item.id" :value="item.id"
|
||||
:label="item.optionName"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="院区"
|
||||
prop="campus"
|
||||
:rules="[{required:true,message:'请选择',trigger:['change','blur']}]">
|
||||
<el-select v-model="editHealthCheckupData.campus" style="width: 100%">
|
||||
<el-option v-for="item in campusOptions" :key="item.id" :value="item.id"
|
||||
:label="item.campusName"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button @click="exportHealthCheckupDialog=false" type="primary" plain>取消</el-button>
|
||||
<el-button @click="doEditHealthCheckupData" type="primary" v-loading="loading">确定
|
||||
</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<excel-import
|
||||
ref="excelImportRef"
|
||||
url="/platform/healthCheckup/list/mange/healthImport"
|
||||
template_url="/platform/healthCheckup/list/mange/downloadTem"
|
||||
:visible.sync="importVisible"
|
||||
title="导入名单数据"
|
||||
width="700px"
|
||||
:extra_params="{healthProjectId:pageForm.projectId}"
|
||||
></excel-import>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
year: moment().format('YYYY'),
|
||||
searchName: "hcu.username",
|
||||
},
|
||||
unions: [],
|
||||
units: [],
|
||||
projectOptions: [],
|
||||
projectSubjectOptions: [],
|
||||
tableColumns: [
|
||||
{prop: 'loginName', label: '工号'},
|
||||
{prop: 'userName', label: '姓名'},
|
||||
{prop: 'sex', label: '性别', sortable: true},
|
||||
{prop: 'unionName', label: '所属工会', sortable: true},
|
||||
{prop: 'unitName', label: '所属单位', sortable: true},
|
||||
{prop: 'optionName', label: '所选套餐'},
|
||||
{prop: 'campusName', label: '所选院区'},
|
||||
{prop: 'selectTime', label: '选择时间', width: "160px"},
|
||||
{prop: 'isAudit', label: '是否确认'},
|
||||
{prop: 'auditTime', label: '确认时间'},
|
||||
],
|
||||
exportHealthCheckupDialog: false,
|
||||
editHealthCheckupData: {},
|
||||
loading: false,
|
||||
//导入名单
|
||||
importVisible: false,
|
||||
|
||||
campusOptions: [],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"file-import": httpVueLoader("/components/plugins/sysImport/index.vue?v=" + new Date().getTime())
|
||||
},
|
||||
methods: {
|
||||
async doAudit(flag) {
|
||||
// flag true,确认 false,取消
|
||||
if (this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"]) && !this.pageForm.unionId) {
|
||||
this.notifyWarning("请选择需要提交的分工会")
|
||||
return
|
||||
}
|
||||
if (this.pageForm.totalCount === 0) {
|
||||
this.notifyWarning("当前分工会没有名单,暂不需要提交")
|
||||
return
|
||||
}
|
||||
const confirm = await this.$confirm('您确定名单都已核实,准确无误?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
const resp = await $.post("/platform/healthCheckup/list/mange/doAuditUser", {
|
||||
projectId: this.pageForm.projectId,
|
||||
unionId: this.pageForm.unionId,
|
||||
flag: flag
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
doEditHealthCheckupData() {
|
||||
this.$refs['editHealthCheckupForm'].validate(async valid => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
const resp = await $.post(loc() + "/doEditHealthCheckupData", this.editHealthCheckupData)
|
||||
this.exportHealthCheckupDialog = false
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
async openEditHealthCheckup(row) {
|
||||
this.editHealthCheckupData = {
|
||||
userName: row.userName,
|
||||
loginName: row.loginName,
|
||||
subjectId: row.subjectId,
|
||||
campus: row.campus,
|
||||
projectId: this.pageForm.projectId,
|
||||
userId: row.id
|
||||
}
|
||||
this.exportHealthCheckupDialog = true
|
||||
|
||||
},
|
||||
async yearChange() {
|
||||
const resp = await $.get("/platform/healthCheckup/project/mange/getHealthCheckupProject", {year: this.pageForm.year})
|
||||
if (resp.code === 0) {
|
||||
this.projectOptions = resp.data
|
||||
if (resp.data && resp.data.length > 0) {
|
||||
this.$set(this.pageForm, "projectId", resp.data[0].id)
|
||||
} else {
|
||||
this.$set(this.pageForm, "projectId", null)
|
||||
}
|
||||
await this.getHealthCheckupSubject()
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
},
|
||||
async getHealthCheckupSubject() {
|
||||
const resp = await $.get("/platform/healthCheckup/project/mange/findOne", {id: this.pageForm.projectId})
|
||||
if (resp.code === 0) {
|
||||
this.projectSubjectOptions = resp.data.healthCheckupProjectSubjects
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
},
|
||||
async queryCampus() {
|
||||
const resp = await $.get("/platform/healthCheckup/campus/queryCampus")
|
||||
if (resp.code === 0) {
|
||||
this.campusOptions = resp.data
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
if (this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])) {
|
||||
this.units = await this.$businessTool.listUnit(this.pageForm.unionId)
|
||||
} else {
|
||||
this.units = await this.$businessTool.listUnit()
|
||||
}
|
||||
},
|
||||
openImport() {
|
||||
// importUser
|
||||
|
||||
this.importVisible = true;
|
||||
},
|
||||
successImport() {
|
||||
this.importLoading = false
|
||||
this.doSearch()
|
||||
},
|
||||
|
||||
},
|
||||
async created() {
|
||||
this.unions = await this.$businessTool.listUnion()
|
||||
this.flushUnits()
|
||||
await this.yearChange()
|
||||
this.pageData()
|
||||
await this.queryCampus()
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,572 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<div id="app" class="platform" v-cloak>
|
||||
<guava ref="guava" padding="0 5%">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年  度">
|
||||
<el-date-picker
|
||||
v-model="pageForm.year"
|
||||
type="year"
|
||||
style="width: 100%"
|
||||
value-format="yyyy"
|
||||
placeholder="请选择">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="项目名称">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.name"
|
||||
@keyup.enter.native="doSearch" style="width:100%"></el-input>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="体检项目" :app="this">
|
||||
<el-button type="primary" size="small"
|
||||
@click="openAdd">新建体检项目
|
||||
</el-button>
|
||||
</table-tool>
|
||||
|
||||
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id"
|
||||
@sort-change="pageOrder" :size="tableSize"
|
||||
v-loading="tableLoading" ref="table" class="vi-table">
|
||||
|
||||
|
||||
<el-table-column align="center" header-align="center" type="index"
|
||||
:index="indexMethod" label="序号"
|
||||
width="80px"></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
show-overflow-tooltip
|
||||
:sortable="column.sortable"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:key="column.prop"
|
||||
:width="column.width" min-width="100px">
|
||||
|
||||
<template v-if="column.prop=='choiceTime'" v-slot="{row}">
|
||||
{{row.choiceTimeStart}}-{{row.choiceTimeEnd}}
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="userOnline" align="center" header-align="center"
|
||||
label="操作" width="100px">
|
||||
<template slot-scope="{row}">
|
||||
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button plain size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'view',data:row}">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-if="( row.isWithinChoiceTime || row.canCreated ) && row.isHasUserList===0"
|
||||
:command="{type:'created',data:row}">
|
||||
生成名单
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-if="( row.isWithinChoiceTime || row.canCreated ) && row.isHasUserList>0"
|
||||
:command="{type:'renew',data:row}">
|
||||
更新名单
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-if="( row.isWithinChoiceTime || row.canCreated ) && row.isHasUserList>0"
|
||||
:command="{type:'reset',data:row}">
|
||||
重置名单
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'edit',data:row}">
|
||||
编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'delete',data:row}">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
<!-- <el-dropdown-item :command="{type:'code',data:row}">
|
||||
二维码
|
||||
</el-dropdown-item>-->
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<el-form :model="formData" ref="form" :rules="formRules" label-width="120px"
|
||||
v-loading="formLoading">
|
||||
<table-tool label="体检项目信息"></table-tool>
|
||||
|
||||
<el-form-item prop="name" label="项目名称">
|
||||
<el-input v-model="formData.name" placeholder="项目名称" maxlength="100"></el-input>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="choiceTime" label="选择时间">
|
||||
<el-date-picker
|
||||
style="width: 80%"
|
||||
v-model="formData.choiceTime"
|
||||
type="datetimerange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
range-separator="-"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="activityGroupId" label="可报名人员范围">
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
<div style="width: 99%">
|
||||
<el-select prop="activityGroupId" placeholder="参加人员范围"
|
||||
v-model="formData.activityGroupId"
|
||||
style="width: 99%;"
|
||||
clearable
|
||||
filterable>
|
||||
<el-option v-for="item in activityGroupList"
|
||||
:label="item.groupName"
|
||||
:value="item.groupId"
|
||||
:key="item.groupId"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div>
|
||||
<el-button
|
||||
@click="$refs.drawerUserScope.userScopeDialog = true"
|
||||
type="primary">设置
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="healthCheckupType" label="体检对象类型">
|
||||
<el-radio-group v-model="formData.healthCheckupType">
|
||||
<el-radio-button label="jzg">教职工</el-radio-button>
|
||||
<el-radio-button label="js">家属</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="体检套餐" prop="healthCheckupProjectSubjects">
|
||||
<el-card shadow="hover">
|
||||
<div class="s-options-list" style="margin-top: 10px;">
|
||||
<el-table :data="formData.healthCheckupProjectSubjects" border>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="套餐名称">
|
||||
<template slot-scope="{row}">
|
||||
<el-input v-model="row.optionName" autosize
|
||||
class="text-input"
|
||||
data-type="option"
|
||||
></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="排序">
|
||||
<template slot-scope="{row}">
|
||||
<el-input v-model="row.optionSort" autosize
|
||||
class="text-input"
|
||||
data-type="option"
|
||||
></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="图片" width="130px">
|
||||
<template slot-scope="{row,$index}">
|
||||
<file-upload :upload_number="1" :value.sync="row.imgUrl"
|
||||
accept=".jpg,.jpeg,.png"
|
||||
class="imgUrl"
|
||||
upload_result_type="url"
|
||||
complete_result upload_mode="file"></file-upload>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center"
|
||||
header-align="center"
|
||||
label="说明">
|
||||
<template slot-scope="{row,$index}">
|
||||
<el-link type="primary"
|
||||
@click="openDescRichText(row.description,$index)">
|
||||
编辑说明
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="操作"
|
||||
width="100px">
|
||||
<template slot-scope="{row,$index}">
|
||||
<div class="option-delete">
|
||||
<el-button circle
|
||||
icon="el-icon-delete"
|
||||
size="mini" type="danger"
|
||||
@click="deleteRow(row,$index)"></el-button>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="s-operation">
|
||||
<el-button size="small" type="primary"
|
||||
@click="formData.healthCheckupProjectSubjects.push({optionNameId:'',optionName:'套餐'+(formData.healthCheckupProjectSubjects.length+1),optionSort:formData.healthCheckupProjectSubjects.length+1,imgUrl:null})">
|
||||
添加项目
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="项目封面" prop="cover">
|
||||
<file-upload :upload_number="1" :value.sync="formData.cover"
|
||||
accept=".jpg,.jpeg,.png"
|
||||
class="imgUrl"
|
||||
upload_result_type="url"
|
||||
complete_result upload_mode="image"></file-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
<div style="display: flex;justify-content: flex-end">
|
||||
<el-button @click="doAdd" type="primary">
|
||||
提交
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<el-descriptions :column="3" border class="table_fixed">
|
||||
<el-descriptions-item :span="3" label="项目名称">
|
||||
{{viewData.name}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="3" label="选择时间">
|
||||
{{viewData.choiceTimeStart}}-{{viewData.choiceTimeEnd}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="3" label="可报名人员范围">
|
||||
{{viewData.activityGroupName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="3" label="体检对象类型">
|
||||
{{viewData.healthCheckupType==='jzg'?'教职工':'家属'}}
|
||||
</el-descriptions-item>
|
||||
<template v-for="i in viewData.healthCheckupProjectSubjects">
|
||||
<el-descriptions-item label="套餐名称">
|
||||
{{i.optionName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="套餐说明">
|
||||
<el-link type="primary"
|
||||
@click="openViewDescRichText(i.description)">
|
||||
点击查看说明
|
||||
</el-link>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="套餐图片">
|
||||
<file-preview :files="i.imgUrl" v-if="i.imgUrl"></file-preview>
|
||||
<div v-else>暂无</div>
|
||||
</el-descriptions-item>
|
||||
</template>
|
||||
|
||||
</el-descriptions>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
<drawer-user-scope
|
||||
@group_change="getActivityGroup"
|
||||
ref="drawerUserScope"
|
||||
:group_id.sync="formData.activityGroupId"
|
||||
></drawer-user-scope>
|
||||
|
||||
|
||||
<!-- <open-qr-code ref="openQRCode" :url="url"></open-qr-code>-->
|
||||
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="richTextDialog"
|
||||
:title="(subjectIndex!==null&&subjectIndex>=0)?'编辑说明':'查看说明'"
|
||||
:append-to-body="true"
|
||||
width="60%">
|
||||
<template>
|
||||
<text-editor v-model="description" v-if="subjectIndex!==null&&subjectIndex>=0"></text-editor>
|
||||
<div v-else v-html="description"></div>
|
||||
</template>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<template v-if="subjectIndex!==null&&subjectIndex>=0">
|
||||
<el-button @click="richTextDialog = false">关 闭</el-button>
|
||||
<el-button type="primary" @click="getRichText">确 定</el-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-button @click="richTextDialog = false" type="primary">关 闭</el-button>
|
||||
</template>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
showSubmit: true,
|
||||
conditions: {
|
||||
method: "",
|
||||
conditions: [{}],
|
||||
},
|
||||
viewData: {},
|
||||
subjectIndex: null,
|
||||
richTextDialog: false,
|
||||
activityGroupList: [],
|
||||
pageForm: {
|
||||
year: moment().format('YYYY')
|
||||
},
|
||||
formData: {
|
||||
healthCheckupProjectSubjects: []
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'year', label: '年度'},
|
||||
{prop: 'name', label: '项目名称'},
|
||||
{prop: 'choiceTime', label: '选择时间'},
|
||||
],
|
||||
formRules: {
|
||||
name: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
choiceTime: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
activityGroupId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
// cover: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
healthCheckupType: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
healthCheckupProjectSubjects: [{
|
||||
required: true,
|
||||
message: '必填',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
},
|
||||
deleteRowIds: [],
|
||||
description: ""
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"drawer-user-scope": httpVueLoader("/components/module/activity/DrawerUserScope.vue"),
|
||||
// 'open-qr-code': httpVueLoader('/components/plugins/OpenQRCode.vue'),
|
||||
},
|
||||
methods: {
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type === 'view') {
|
||||
this.openView(data)
|
||||
} else if (type === 'created') {
|
||||
this.createUserList(data)
|
||||
} else if (type === 'renew') {
|
||||
this.renewUserList(data)
|
||||
} else if (type === 'reset') {
|
||||
this.resetUserList(data)
|
||||
} else if (type === 'edit') {
|
||||
this.openEdit(data)
|
||||
} else if (type === 'delete') {
|
||||
this.doDelete(data.id)
|
||||
} else if (type === 'code') {
|
||||
this.openCode(data.id)
|
||||
}
|
||||
},
|
||||
async createUserList(row) {
|
||||
const msg = '您确定要生成【' + row.name + '】体检名单吗?(该名单生成是按照创建时选择的可报名人员范围来生成)'
|
||||
const confirm = await this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if ('confirm' !== confirm) return
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '数据更新中,请稍后...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
const resp = await $.post(loc() + '/createUserList', row)
|
||||
|
||||
if (resp.code === 0) {
|
||||
setTimeout(() => {
|
||||
loading.close()
|
||||
this.$message.success('操作成功')
|
||||
this.pageData()
|
||||
}, 1000)
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
},
|
||||
async renewUserList(row) {
|
||||
const msg = '您确定要更新【' + row.name + '】的体检名单吗?(如可报名人员范围发生变化会删除已选择的人员信息)'
|
||||
const confirm = await this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if ('confirm' !== confirm) return
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '数据更新中,请稍后...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
const resp = await $.post(loc() + '/renewUserList', row)
|
||||
loading.close()
|
||||
if (resp.code === 0) {
|
||||
this.$message.success('操作成功')
|
||||
this.pageData()
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
},
|
||||
async resetUserList(row) {
|
||||
const msg = '您确定要重置【' + row.name + '】的体检名单吗?(该操作会将所有已选择的人员清空后,在进行生成)'
|
||||
const confirm = await this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if ('confirm' !== confirm) return
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '数据更新中,请稍后...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
const resp = await $.post(loc() + '/resetUserList', row)
|
||||
loading.close()
|
||||
if (resp.code === 0) {
|
||||
this.$message.success('操作成功')
|
||||
this.pageData()
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
},
|
||||
openCode(id) {
|
||||
this.$refs.openQRCode.openCode("/mobile/healthCheckup/list")
|
||||
},
|
||||
|
||||
deleteRow(row, index) {
|
||||
this.formData.healthCheckupProjectSubjects.splice(index, 1)
|
||||
if (row.id) this.deleteRowIds.push(row.id)
|
||||
},
|
||||
async doDelete(id) {
|
||||
const confirm = await this.$confirm('确定要删除该项目吗?', '提示', {type: 'warning'})
|
||||
if (confirm) {
|
||||
const resp = await $.post(loc() + "/doDelete", {id})
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.notifySuccess(resp.msg)
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
async openEdit(row) {
|
||||
this.formData = await this.findOne(row.id)
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
async openView(row) {
|
||||
this.viewData = await this.findOne(row.id)
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
async findOne(id) {
|
||||
const resp = await $.post(loc() + "/findOne", {id: id})
|
||||
if (resp.code === 0) {
|
||||
resp.data.choiceTime = [resp.data.choiceTimeStart, resp.data.choiceTimeEnd]
|
||||
return resp.data
|
||||
} else {
|
||||
this.notifyError("查询失败")
|
||||
}
|
||||
},
|
||||
async doAdd() {
|
||||
const formValid = await this.$refs["form"].validate()
|
||||
if (formValid) {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '数据保存中请稍后',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
const formData = clone(this.formData)
|
||||
formData.choiceTimeStart = formData.choiceTime[0]
|
||||
formData.choiceTimeEnd = formData.choiceTime[1]
|
||||
formData.healthCheckupProjectSubjects = JSON.stringify(this.formData.healthCheckupProjectSubjects)
|
||||
formData.activityGroupName = this.activityGroupList.find(v => v.groupId === this.formData.activityGroupId).groupName
|
||||
formData.deleteRowIds = JSON.stringify(this.deleteRowIds)
|
||||
const resp = await $.post(loc() + "/doAdd", formData)
|
||||
loading.close()
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
this.deleteRowIds = []
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
openAdd() {
|
||||
|
||||
this.formData = {
|
||||
name: null,
|
||||
activityGroupId: null,
|
||||
choiceTime: null,
|
||||
healthCheckupProjectSubjects: [
|
||||
{
|
||||
optionName: '套餐1',
|
||||
optionNameId: '',
|
||||
optionSort: '1',
|
||||
imgUrl: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
if (this.$refs.form) this.$refs.form.resetFields();
|
||||
this.$refs.guava.edit()
|
||||
|
||||
},
|
||||
openDescRichText(richText, sIdx) {
|
||||
this.subjectIndex = sIdx
|
||||
this.description = richText
|
||||
this.richTextDialog = true
|
||||
},
|
||||
openViewDescRichText(richText) {
|
||||
this.subjectIndex = null
|
||||
this.description = richText
|
||||
this.richTextDialog = true
|
||||
},
|
||||
getRichText() {
|
||||
this.formData.healthCheckupProjectSubjects[this.subjectIndex].description = this.description
|
||||
this.richTextDialog = false
|
||||
},
|
||||
async getActivityGroup() {
|
||||
const {data} = await $.get('/platform/activity/basic/scope/getActivityUserScopeGroup')
|
||||
this.activityGroupList = data
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.getActivityGroup()
|
||||
this.pageData()
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,460 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<guava padding="0 5%" ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
clearable
|
||||
@change="yearChange"
|
||||
placeholder="选择年"
|
||||
style="width: 100%;"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="年度">
|
||||
<el-select @change="getHealthCheckupSubject();"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.projectId">
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id"
|
||||
v-for="item in projectOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属工会" v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN'])">
|
||||
<el-select placeholder="请选择所属工会" v-model="pageForm.unionId"
|
||||
style="width: 100%;"
|
||||
:clearable="clearable"
|
||||
@change="flushUnits" @clear="flushUnits"
|
||||
filterable>
|
||||
<el-option v-for="item in unions" :label="item.name"
|
||||
:value="item.id" :key="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属单位">
|
||||
<el-select placeholder="所属单位" v-model="pageForm.unitId"
|
||||
style="width: 100%;"
|
||||
clearable
|
||||
filterable>
|
||||
<el-option v-for="item in units" :label="item.name"
|
||||
:value="item.id" :key="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool label="工会列表">
|
||||
<template
|
||||
v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN', 'BRANCH_UNION_CHAIRMAN'])">
|
||||
<template v-if="projectInfo.healthCheckupType==='jzg'">
|
||||
<el-button :disabled="!pageForm.projectId"
|
||||
@click="exportReceiveDetail(true)"
|
||||
icon="el-icon-printer"
|
||||
|
||||
size="small"
|
||||
type="primary">导出教职工已选名单
|
||||
</el-button>
|
||||
<el-button :disabled="!pageForm.projectId"
|
||||
@click="exportReceiveDetail(false)"
|
||||
icon="el-icon-printer"
|
||||
size="small"
|
||||
type="primary"
|
||||
v-if="projectInfo.healthCheckupType==='jzg'">导出教职工未选名单
|
||||
</el-button>
|
||||
<el-button @click="selectOptionByAdmin"
|
||||
icon="el-icon-printer"
|
||||
size="small"
|
||||
type="primary"
|
||||
v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN'])">管理员代选择
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
<el-button :disabled="!pageForm.projectId"
|
||||
@click="exportUserCompanion()"
|
||||
icon="el-icon-printer"
|
||||
size="small"
|
||||
type="primary"
|
||||
v-if="projectInfo.healthCheckupType==='js'">导出家属名单
|
||||
</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="tableData" :size="tableSize" :summary-method="getSummaries"
|
||||
@sort-change="pageOrder" class="vi-table"
|
||||
ref="table" row-key="id" show-summary
|
||||
style="width: 100%" v-loading="tableLoading">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号" type="index"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:key="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
align="center"
|
||||
header-align="center"
|
||||
min-width="100px" show-overflow-tooltip
|
||||
v-for="column in tableColumns">
|
||||
|
||||
<template v-slot="{row}" v-if="column.prop==='unselectedTeacherSum'">
|
||||
<el-link @click="openUnclaimed(row.id)" type="primary">
|
||||
{{row.unselectedTeacherSum}}
|
||||
</el-link>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" header-align="center"
|
||||
label="操作" prop="userOnline"
|
||||
width="200px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openView(row.id)" size="mini"
|
||||
type="primary"
|
||||
v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN', 'BRANCH_UNION_CHAIRMAN'])">
|
||||
查看已选人员
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
|
||||
<template #view>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-option">
|
||||
<el-input clearable placeholder="请输入内容"
|
||||
v-model="pageFormUnion.searchKeyword">
|
||||
<el-select @keyup.enter.native="doUnionSearch" placeholder="查询类型"
|
||||
slot="prepend"
|
||||
style="width: 80px;"
|
||||
v-model="pageFormUnion.searchName">
|
||||
<el-option label="姓名" value="u.username"></el-option>
|
||||
<el-option label="工号" value="u.loginname"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button @click="doUnionSearch" icon="el-icon-search" type="primary">搜索
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="mt10" shadow="never">
|
||||
<div v-if="pageFormUnion.isSelected=='0'">
|
||||
<table-tool label="已选人员"></table-tool>
|
||||
</div>
|
||||
<div v-else>
|
||||
<table-tool label="未选人员"></table-tool>
|
||||
</div>
|
||||
<el-table :data="receive_tableData" :size="tableSize" class="vi-table"
|
||||
height="100%"
|
||||
row-key="id" style="width: 100%;height: 700px" v-loading="tableLoading">
|
||||
<el-table-column type="index" width="50"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in receive_tableColumns"
|
||||
:key="column.prop"
|
||||
>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<el-row class="el-pagination-container" style="margin-bottom: 0px">
|
||||
<el-pagination
|
||||
:current-page="pageFormUnion.pageNumber"
|
||||
:page-size="pageFormUnion.pageSize"
|
||||
:page-sizes="[5,10, 20, 30, 50]"
|
||||
:total="pageFormUnion.totalCount"
|
||||
@current-change="pageNumberChange"
|
||||
@size-change="pageSizeChange"
|
||||
layout="total, sizes, prev, pager, next">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
|
||||
|
||||
<el-dialog :visible.sync="selectByAdminDialogVisible" title="管理员代选体检项目"
|
||||
width="35%">
|
||||
<el-form label-position="right" label-width="120px">
|
||||
<el-form-item label="体检项目">
|
||||
<el-select style="width: 100%" v-model="noSelectOptionId">
|
||||
<el-option :key="item.id" :label="item.optionName" :value="item.id"
|
||||
v-for="item in projectSubjectOptions"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="院区"
|
||||
prop="campus">
|
||||
<el-select style="width: 100%" v-model="campus">
|
||||
<el-option :key="item.id" :label="item.campusName" :value="item.id"
|
||||
v-for="item in campusOptions"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row justify="end" type="flex">
|
||||
<el-button @click="selectByAdminDialogVisible=false">取消</el-button>
|
||||
<el-button @click="doSelectByAdmin" type="primary" :loading="loading">提交</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
year: moment().format('YYYY'),
|
||||
},
|
||||
pageFormUnion: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: null,
|
||||
searchName: 'u.username',
|
||||
//0:已选人员页面 1:未选人员页面
|
||||
isSelected: '',
|
||||
},
|
||||
units: [],
|
||||
unions: [],
|
||||
projectOptions: [],
|
||||
receive_tableColumns: [],
|
||||
receive_tableData: [],
|
||||
clearable: false,
|
||||
tableColumns: [
|
||||
{prop: 'unionName', label: '所属工会'},
|
||||
{prop: 'sumCount', label: '本次体检人数'},
|
||||
],
|
||||
projectInfo: {},
|
||||
selectByAdminDialogVisible: false,
|
||||
projectSubjectOptions: [],
|
||||
campusOptions: [],
|
||||
noSelectOptionId: null,
|
||||
campus: null,
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async doSelectByAdmin() {
|
||||
if (!this.noSelectOptionId || !this.campus) {
|
||||
this.notifyWarning('请选择套餐/院区')
|
||||
return
|
||||
}
|
||||
const {optionName} = this.projectSubjectOptions.find(v => v.id === this.noSelectOptionId)
|
||||
|
||||
const confirm = await this.$confirm('请确定是否把【' + optionName + '】福利赋给未选择的教职工?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
this.loading = true
|
||||
const resp = await $.get(loc() + '/doSelectByAdmin', {
|
||||
optionId: this.noSelectOptionId,
|
||||
campus: this.campus,
|
||||
projectId: this.pageForm.projectId
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
setTimeout(()=>{
|
||||
this.doSearch()
|
||||
this.loading = false
|
||||
this.selectByAdminDialogVisible = false
|
||||
this.notifySuccess(resp.msg)
|
||||
},2000)
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
selectOptionByAdmin() {
|
||||
this.noSelectOptionId = null
|
||||
this.selectByAdminDialogVisible = true
|
||||
},
|
||||
async yearChange() {
|
||||
const resp = await $.get("/platform/healthCheckup/project/mange/getHealthCheckupProject", {year: this.pageForm.year})
|
||||
if (resp.code === 0) {
|
||||
this.projectOptions = resp.data
|
||||
if (resp.data && resp.data.length > 0) {
|
||||
this.$set(this.pageForm, "projectId", resp.data[0].id)
|
||||
} else {
|
||||
this.$set(this.pageForm, "projectId", null)
|
||||
}
|
||||
await this.getHealthCheckupSubject()
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
},
|
||||
async getHealthCheckupSubject() {
|
||||
this.projectSubjectOptions = []
|
||||
const resp = await $.get("/platform/healthCheckup/project/mange/findOne", {id: this.pageForm.projectId})
|
||||
if (resp.code === 0) {
|
||||
if (resp.data) {
|
||||
this.projectInfo = resp.data
|
||||
this.projectSubjectOptions = resp.data.healthCheckupProjectSubjects
|
||||
}
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
this.doSearch()
|
||||
},
|
||||
async queryCampus() {
|
||||
const resp = await $.get("/platform/healthCheckup/campus/queryCampus")
|
||||
if (resp.code === 0) {
|
||||
this.campusOptions = resp.data
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
},
|
||||
|
||||
async pageData() {
|
||||
this.tableColumns = []
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '努力加载中。。。',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
|
||||
this.tableColumns.push(
|
||||
{prop: 'unionName', label: '所属工会'},
|
||||
{prop: 'sumCount', label: '本次体检人数'}
|
||||
)
|
||||
if (this.projectSubjectOptions && this.projectSubjectOptions.length > 0) {
|
||||
this.projectSubjectOptions.forEach(v => {
|
||||
this.tableColumns.push({prop: v.optionName, label: v.optionName})
|
||||
})
|
||||
}
|
||||
this.tableColumns.push(
|
||||
{prop: "totalCount", label: "选取人数"},
|
||||
{prop: "unselectedTeacherSum", label: "未选人数"}
|
||||
)
|
||||
if (!this.pageForm.projectId) {
|
||||
this.tableData = []
|
||||
}
|
||||
|
||||
const resp = await $.post(loc() + '/pageData', this.pageForm)
|
||||
if (resp.code === 0) {
|
||||
this.tableData = resp.data.tableList
|
||||
}
|
||||
loading.close()
|
||||
},
|
||||
pageNumberChange(val) {
|
||||
this.pageFormUnion.pageNumber = val;
|
||||
this.pageUnionData();
|
||||
},
|
||||
pageSizeChange(val) {
|
||||
this.pageFormUnion.pageSize = val;
|
||||
this.pageUnionData();
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
if (this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])) {
|
||||
this.units = await this.$businessTool.listUnit(this.pageForm.unionId)
|
||||
} else {
|
||||
this.units = await this.$businessTool.listUnit()
|
||||
}
|
||||
},
|
||||
async init() {
|
||||
if (this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])) {
|
||||
this.unions = await this.$businessTool.listUnion()
|
||||
this.clearable = true
|
||||
} else {
|
||||
this.unions = await this.$businessTool.listUnion(this.$store.state.user.union.id)
|
||||
this.$set(this.pageForm, "unionId", this.unions[0].id)
|
||||
}
|
||||
await this.yearChange()
|
||||
await this.queryCampus()
|
||||
},
|
||||
//查看未选择人数
|
||||
async openUnclaimed(unionId) {
|
||||
this.pageFormUnion.isSelected = '1'
|
||||
this.pageFormUnion.unionId = unionId
|
||||
this.pageFormUnion.projectId = this.pageForm.projectId
|
||||
await this.pageUnionData();
|
||||
},
|
||||
//查看已选人员
|
||||
async openView(unionId) {
|
||||
this.pageFormUnion.isSelected = '0'
|
||||
this.pageFormUnion.unionId = unionId
|
||||
this.pageFormUnion.projectId = this.pageForm.projectId
|
||||
await this.pageUnionData();
|
||||
},
|
||||
async pageUnionData() {
|
||||
const resp = await $.post(loc() + '/receivePageData', this.pageFormUnion)
|
||||
if (resp.code === 0) {
|
||||
this.$refs.guava.view()
|
||||
this.receive_tableColumns = resp.data.label
|
||||
this.receive_tableData = resp.data.list.list
|
||||
this.pageFormUnion.totalCount = resp.data.list.totalCount
|
||||
}
|
||||
},
|
||||
doUnionSearch() {
|
||||
this.pageFormUnion.pageNumber = 1
|
||||
this.pageUnionData();
|
||||
},
|
||||
|
||||
//按分工会导出已选名单
|
||||
exportReceiveDetail(flag) {
|
||||
const {year, projectId, unionId} = this.pageForm
|
||||
window.open(loc() + '/exportReceiveDetail?year=' + year + '&projectId=' + projectId + '&unionId=' + (unionId ? unionId : '') + '&flag=' + flag)
|
||||
},
|
||||
//导出家属信息
|
||||
exportUserCompanion() {
|
||||
const {year, projectId, unionId} = this.pageForm
|
||||
window.open(loc() + '/exportUserCompanion?year=' + year + '&projectId=' + projectId + '&unionId=' + (unionId ? unionId : ''))
|
||||
},
|
||||
getSummaries(param) {
|
||||
const {columns, data} = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '总计';
|
||||
return;
|
||||
}
|
||||
const values = data.map(item => Number(item[column.property]));
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return Math.floor((prev + curr) * 100) / 100;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
sums[index] += ' 人';
|
||||
} else {
|
||||
sums[index] = null;
|
||||
}
|
||||
});
|
||||
return sums;
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.init()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,337 @@
|
||||
<div id="outlay-act-budget-apply-form" v-cloak>
|
||||
<el-form :model="formData" :rules="formRules" ref="formRef" class="flow-task-form">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="申报人姓名">{{formData.userName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="申报时间">{{formData.applyDate}}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系方式">
|
||||
<el-form-item label="联系方式" prop="mobile">
|
||||
<el-input placeholder="请输入联系方式" v-model="formData.mobile"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="预算类型">
|
||||
<el-form-item label="预算类型" prop="outlayManageSource">
|
||||
<el-select @change="budgetTypeCodeChange"
|
||||
placeholder="请选择预算类型"
|
||||
style="width: 100%;"
|
||||
v-model="formData.outlayManageSource">
|
||||
<el-option
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
v-for="item in budgetTypeOption">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="申报(承办)单位">
|
||||
<el-form-item label="申报(承办)单位" prop="helpUnitName"
|
||||
v-if="['ACTIVITY_BUDGET_TYPE_ONE'].includes(formData.outlayManageSource)">
|
||||
<el-input placeholder="请输入申报(承办)单位" readonly
|
||||
type="text" v-model="formData.helpUnitName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="申报(承办)单位" prop="unionId"
|
||||
v-if="formData.outlayManageSource==='ACTIVITY_BUDGET_TYPE_TWO'">
|
||||
<el-select v-model="formData.unionId" filterable @change="unionChange"
|
||||
clearable
|
||||
:disabled="!['superadmin'].includes($store.state.user.loginname)"
|
||||
placeholder="请选择工会" style="width: 100%;">
|
||||
<el-option v-for="item in unionList" :label="item.name"
|
||||
:value="item.id"
|
||||
:key="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="申报(承办)单位" prop="clubId"
|
||||
v-if="['ACTIVITY_BUDGET_TYPE_THREE'].includes(formData.outlayManageSource)">
|
||||
<el-select @change="clubChange"
|
||||
placeholder="请选择申报(承办)单位"
|
||||
style="width: 100%;" v-model="formData.clubId">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.clubName"
|
||||
:value="item.id"
|
||||
v-for="item in clubOption">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="活动项目">
|
||||
<el-form-item
|
||||
prop="activityMatter" label="活动项目">
|
||||
<el-input maxlength="50" placeholder="请输入项目"
|
||||
v-model="formData.activityMatter"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="活动时间">
|
||||
<el-form-item
|
||||
prop="activityDate" label="活动时间">
|
||||
<el-input maxlength="50" placeholder="请输入活动时间"
|
||||
v-model="formData.activityDate"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="预算金额(元)">
|
||||
<el-form-item
|
||||
prop="declareTotalBudgetMoney" label="预算金额(元)"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-input-number :min="0" :precision="2"
|
||||
:disabled="formData.budgetDetails&&formData.budgetDetails.length>0"
|
||||
placeholder="请输入预算金额"
|
||||
style="width: 100%"
|
||||
v-model="formData.declareTotalBudgetMoney"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<!--<el-descriptions-item label="是否可以重复报销"
|
||||
v-if="['superadmin'].includes($store.state.user.loginname)">
|
||||
<el-form-item
|
||||
prop="isRepeatReimburse" label="是否可以重复报销"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-radio-group v-model="formData.isRepeatReimburse">
|
||||
<el-radio-button :label="true">可以</el-radio-button>
|
||||
<el-radio-button :label="false">不可以</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>-->
|
||||
<el-descriptions-item label="是否属于校工会预算"
|
||||
v-if="['ACTIVITY_BUDGET_TYPE_TWO','ACTIVITY_BUDGET_TYPE_THREE'].includes(formData.outlayManageSource)
|
||||
&&['superadmin'].includes($store.state.user.loginname)" :span="2">
|
||||
<el-form-item
|
||||
prop="isSchoolBudget" label="是否属于校工会预算"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-radio-group v-model="formData.isSchoolBudget">
|
||||
<el-radio-button :label="true">属于</el-radio-button>
|
||||
<el-radio-button :label="false">不属于</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item v-if="!['ACTIVITY_BUDGET_TYPE_TWO','ACTIVITY_BUDGET_TYPE_THREE'].includes(formData.outlayManageSource)
|
||||
&&!['superadmin'].includes($store.state.user.loginname)"></el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="校工会预算" v-if="formData.isSchoolBudget" :span="2">
|
||||
<el-form-item
|
||||
prop="schoolBudgetId" label="校工会预算"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]"
|
||||
>
|
||||
<el-select v-model="formData.schoolBudgetId" filterable
|
||||
default-first-option
|
||||
placeholder="请选择校工会预算" style="width: 100%">
|
||||
<el-option :label="item.activityMatter"
|
||||
:value="item.id"
|
||||
:key="item.id"
|
||||
v-for="item in activityList"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="活动内容(如训练、装备等)" :span="2">
|
||||
<el-form-item
|
||||
prop="activityContent" label="活动内容(如训练、装备等)">
|
||||
<text-editor v-model="formData.activityContent"></text-editor>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-form>
|
||||
<snaker-flow-task-form-action @task-action="handleTaskAction" @save-draft="handleSaveDraft"
|
||||
@cancel="handleCancel"></snaker-flow-task-form-action>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#outlay-act-budget-apply-form',
|
||||
store,
|
||||
data() {
|
||||
return {
|
||||
id: GetQueryString("businessId"),
|
||||
activityList: [],
|
||||
budgetTypeOption: [],
|
||||
unionList: [],
|
||||
clubOption: [],
|
||||
formRules: {
|
||||
outlayManageSource: [{
|
||||
required: true,
|
||||
message: '必填',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
activityMatter: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
fundsUnitName: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
clubId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
helpUnitName: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
unionId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
},
|
||||
formData: {
|
||||
budgetDetails: []
|
||||
},
|
||||
dialogVisible: false,
|
||||
editType: "apply"
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async findOne(id) {
|
||||
const resp = await $.get('/platform/activity/budget/applyList/findOne', {id})
|
||||
if (resp.code === 0) {
|
||||
if (resp.data.budgets) {
|
||||
resp.data.budgets = JSON.parse(resp.data.budgets)
|
||||
}
|
||||
return resp.data
|
||||
}
|
||||
},
|
||||
init() {
|
||||
if (this.id) {
|
||||
this.findOne(this.id).then(data => {
|
||||
this.formData = data
|
||||
})
|
||||
} else {
|
||||
this.formData = {
|
||||
isSchoolBudget: false,
|
||||
isRepeatReimburse: true,
|
||||
budgetDetails: [],
|
||||
applyDate: this.$moment().format('YYYY-MM-DD'),
|
||||
userName: this.$store.state.user.username,
|
||||
mobile: this.$store.state.user.mobile,
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
clubChange(val) {
|
||||
const club = this.clubOption.find(c => c.id === val)
|
||||
this.formData.helpUnitName = club.clubName
|
||||
},
|
||||
unionChange(id) {
|
||||
if (id) {
|
||||
const union = this.unionList.find(c => c.id === id)
|
||||
this.$set(this.formData, "helpUnitName", union.unionname)
|
||||
} else {
|
||||
this.$set(this.formData, "helpUnitName", '')
|
||||
}
|
||||
},
|
||||
budgetTypeCodeChange(val) {
|
||||
if (val === "ACTIVITY_BUDGET_TYPE_ONE") {
|
||||
this.$set(this.formData, "helpUnitName", "校工会")
|
||||
} else if (val === "ACTIVITY_BUDGET_TYPE_TWO") {
|
||||
this.$set(this.formData, "helpUnitName", this.$store.state.user.union.name)
|
||||
this.$set(this.formData, "unionId", this.$store.state.user.union.id)
|
||||
} else if (["ACTIVITY_BUDGET_TYPE_THREE"].includes(val)) {
|
||||
this.$set(this.formData, "helpUnitName", '')
|
||||
this.$set(this.formData, "clubId", '')
|
||||
} else {
|
||||
this.$set(this.formData, "helpUnitName", "校工会")
|
||||
}
|
||||
if (val) {
|
||||
const budgetType = this.budgetTypeOption.find(b => b.code === val)
|
||||
this.$set(this.formData, "budgetTypeId", budgetType.code)
|
||||
}
|
||||
},
|
||||
async getActivityBudgetType() {
|
||||
const data = await this.$businessTool.getDictOptions("ACTIVITY_BUDGET_TYPE")
|
||||
let budgetTypeOption = []
|
||||
if (this.$auth.hasRoleOr(['SYSADMIN'])) {
|
||||
this.budgetTypeOption = data
|
||||
} else {
|
||||
if (this.$auth.hasRoleOr(['SCHOOL_UNION_ADMIN'])) {
|
||||
data.map(v => {
|
||||
if (["ACTIVITY_BUDGET_TYPE_ONE"].includes(v.code)) {
|
||||
budgetTypeOption.push(v)
|
||||
}
|
||||
})
|
||||
}
|
||||
if (this.$auth.hasRoleOr(['BRANCH_UNION_ADMIN', 'BRANCH_UNION_CHAIRMAN'])) {
|
||||
data.map(v => {
|
||||
if (["ACTIVITY_BUDGET_TYPE_TWO"].includes(v.code)) {
|
||||
budgetTypeOption.push(v)
|
||||
}
|
||||
})
|
||||
}
|
||||
if (this.$auth.hasRoleOr(['CLUB_PRESIDENT'])) {
|
||||
data.map(v => {
|
||||
if (["ACTIVITY_BUDGET_TYPE_THREE"].includes(v.code)) {
|
||||
budgetTypeOption.push(v)
|
||||
}
|
||||
})
|
||||
}
|
||||
this.budgetTypeOption = budgetTypeOption
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
getSchoolBudget() {
|
||||
this.$axios.post("/platform/activity/budget/apply/getSchoolBudget").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.activityList = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
handleTaskAction(val) {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('确定要提交数据吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$axios
|
||||
.post("/flow/common/startInstanceAndExecute", {
|
||||
...val,
|
||||
bizData: JSON.stringify(this.formData)
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("操作成功")
|
||||
// 发送完成消息
|
||||
window.parent.postMessage(
|
||||
{
|
||||
type: "task-complete"
|
||||
},
|
||||
"*"
|
||||
)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
handleSaveDraft(val) {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
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() {
|
||||
this.$confirm('取消将关闭当前页面并不会保存, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
window.close()
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.init()
|
||||
await this.getActivityBudgetType()
|
||||
await this.getSchoolBudget()
|
||||
this.unionList = await this.$businessTool.listUnion(this.$store.state.user.union.id)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,253 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<div class="platform" id="app" v-cloak>
|
||||
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch()">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
@change="doSearch"
|
||||
placeholder="选择年度"
|
||||
style="width: 100%" type="year"
|
||||
v-model="pageForm.year"
|
||||
:clearable="false"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="活动项目">
|
||||
<el-input v-model="pageForm.activityMatter" placeholder="请输入活动项目"
|
||||
clearable></el-input>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="申报列表">
|
||||
<!-- <div style="margin-left: 10px;">
|
||||
<el-tag style="font-size: 15px;">
|
||||
申报预算金额:{{declareTotalBudgetMoney}}元,审核预算金额:{{totalBudgetMoney}}元
|
||||
</el-tag>
|
||||
</div>
|
||||
<el-button type="primary" @click="batchSubmit"
|
||||
size="small" :disabled="auditIds&&auditIds.length===0">
|
||||
批量提交
|
||||
</el-button>
|
||||
<el-button type="danger" @click="batchDelete"
|
||||
size="small" :disabled="auditIds&&auditIds.length===0">
|
||||
批量删除
|
||||
</el-button>-->
|
||||
<el-button @click="openAdd" size="small" class="ml10" type="primary">
|
||||
填写申报
|
||||
</el-button><!--
|
||||
<el-button @click="doExport" size="small" class="ml10"
|
||||
type="primary">导出
|
||||
</el-button>-->
|
||||
</table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder" row-key="id"
|
||||
style="width: 100%"
|
||||
ref="table"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="tableLoading">
|
||||
<!-- <el-table-column
|
||||
reserve-selection
|
||||
:selectable="(row)=>{return !row.taskState||row.taskState===10}"
|
||||
type="selection"
|
||||
fixed
|
||||
width="60">
|
||||
</el-table-column>-->
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号"
|
||||
fixed
|
||||
type="index"
|
||||
width="50"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:width="column.width"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns">
|
||||
<template v-slot="{row}" v-if="column.prop==='outlayManageSource'">
|
||||
<dict-tag :options="budgetTypeOption"
|
||||
:value="row.outlayManageSource"></dict-tag>
|
||||
</template>
|
||||
<template v-slot="{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 align="center" fixed="right" header-align="center" label="操作"
|
||||
width="300px">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button @click="openEdit(row)" size="mini" type="primary">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button @click="doDelete(row.id)" size="mini" type="danger"
|
||||
:disabled="![0,1].includes(row.auditState)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
declareTotalBudgetMoney: 0,
|
||||
totalBudgetMoney: 0,
|
||||
pageForm: {year: new Date().getFullYear() + ""},
|
||||
budgetTypeOption: [],
|
||||
tableColumns: [
|
||||
{prop: 'year', label: '年度', width: '80'},
|
||||
{prop: 'userName', label: '申报人姓名'},
|
||||
{prop: 'loginName', label: '申报人工号'},
|
||||
{prop: 'mobile', label: '联系方式', width: '120'},
|
||||
{prop: 'outlayManageSource', label: '申报类型'},
|
||||
{prop: 'activityMatter', label: '活动项目', width: '300'},
|
||||
{prop: 'declareTotalBudgetMoney', label: '申报预算金额'},
|
||||
{prop: 'totalBudgetMoney', label: '审核预算金额'},
|
||||
{prop: 'applyDate', label: '申报时间'},
|
||||
{prop: 'taskName', label: '当前节点'},
|
||||
{prop: 'instanceState', label: '流程状态'},
|
||||
],
|
||||
|
||||
auditIds: [],
|
||||
}
|
||||
},
|
||||
components: {},
|
||||
methods: {
|
||||
openAdd() {
|
||||
window.open('/flow/common/approval/form?defineKey=NDYSSB')
|
||||
},
|
||||
doExport() {
|
||||
},
|
||||
batchDelete() {
|
||||
if (this.auditIds.length === 0) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: '请选择要删除的数据!'
|
||||
});
|
||||
return
|
||||
}
|
||||
this.$confirm('确定要批量提交选择的数据吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/activity/budget/applyList/batchDelete", {
|
||||
ids: this.auditIds
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '提交成功!'
|
||||
});
|
||||
this.doSearch();
|
||||
this.getApplyMoney()
|
||||
this.$refs.table.clearSelection();
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
batchSubmit() {
|
||||
if (this.auditIds.length === 0) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: '请选择要提交的数据!'
|
||||
});
|
||||
return
|
||||
}
|
||||
this.$confirm('确定要批量提交选择的数据吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/activity/budget/applyList/batchSubmit", {
|
||||
ids: this.auditIds
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '提交成功!'
|
||||
});
|
||||
this.doSearch();
|
||||
this.getApplyMoney()
|
||||
this.$refs.table.clearSelection();
|
||||
} else {
|
||||
this.$alert(res.msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'warning'
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.auditIds = val.map(item => item.id)
|
||||
},
|
||||
openView(row) {
|
||||
window.open("/flow/common/approval/form?instanceId=" + row.instanceId + "&businessId=" + row.businessNo + "")
|
||||
},
|
||||
openEdit(row) {
|
||||
window.open("/flow/common/approval/form?businessId=" + row.id + "&defineKey=NDYSSB")
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm('确定删除该条数据?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/activity/budget/applyList/doDelete", {id}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
});
|
||||
this.doSearch();
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
getApplyMoney() {
|
||||
this.$axios.post("/platform/activity/budget/applyList/getApplyMoney", this.pageForm).then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.declareTotalBudgetMoney = resp.data.declareTotalBudgetMoney
|
||||
this.totalBudgetMoney = resp.data.totalBudgetMoney
|
||||
} else {
|
||||
this.$message.error(resp.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.getApplyMoney()
|
||||
this.pageData()
|
||||
this.budgetTypeOption = await this.$businessTool.getDictOptions("ACTIVITY_BUDGET_TYPE")
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+224
@@ -0,0 +1,224 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch();getApplyMoney()">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
@change="doSearch"
|
||||
placeholder="选择年度"
|
||||
style="width: 100%" type="year"
|
||||
v-model="pageForm.year"
|
||||
:clearable="false"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="活动项目">
|
||||
<el-input v-model="pageForm.activityMatter" placeholder="请输入活动项目"
|
||||
clearable></el-input>
|
||||
</search-item>
|
||||
<search-item label="协会"
|
||||
v-if="!pageForm.outlayManageSource||pageForm.outlayManageSource==='ACTIVITY_BUDGET_TYPE_THREE'">
|
||||
<el-select clearable
|
||||
placeholder="请选择协会"
|
||||
style="width: 100%;" v-model="pageForm.clubId">
|
||||
<el-option
|
||||
:key="item.stid"
|
||||
:label="item.name"
|
||||
:value="item.stid"
|
||||
v-for="item in clubOption">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="分工会"
|
||||
v-if="!pageForm.outlayManageSource||pageForm.outlayManageSource==='ACTIVITY_BUDGET_TYPE_TWO'">
|
||||
<el-select v-model="pageForm.unionId" filterable
|
||||
clearable
|
||||
placeholder="请选择工会" style="width: 100%;">
|
||||
<el-option v-for="item in unionList" :label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
</search>
|
||||
|
||||
</el-card>
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool label="综合查询">
|
||||
<el-tag style="font-size: 15px;">
|
||||
申报预算金额:{{declareTotalBudgetMoney}}元,审核预算金额:{{totalBudgetMoney}}元
|
||||
</el-tag>
|
||||
|
||||
|
||||
<el-radio-group @change="budgetTypeCodeChange" size="small"
|
||||
style="margin-left: 10px;"
|
||||
v-model="pageForm.outlayManageSource">
|
||||
<el-radio-button :label="item.code"
|
||||
:key="item.code" v-for="item in budgetTypeOption">
|
||||
{{item.name}}
|
||||
</el-radio-button>
|
||||
</el-radio-group>
|
||||
|
||||
<el-button @click="doExport" size="small" style="margin-left: 10px;"
|
||||
type="primary">导出
|
||||
</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder" row-key="id"
|
||||
style="width: 100%"
|
||||
ref="table"
|
||||
v-loading="tableLoading">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号"
|
||||
fixed
|
||||
type="index"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:key="column.prop"
|
||||
:width="column.width"
|
||||
:fixed="column.fixed"
|
||||
show-overflow-tooltip
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns">
|
||||
<template v-slot="{row}" v-if="column.prop==='outlayManageSource'">
|
||||
<dict-tag :options="budgetTypeOption"
|
||||
:value="row.outlayManageSource"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" header-align="center" label="操作"
|
||||
width="300">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button @click="openEdit(row)" size="mini" type="primary"
|
||||
:disabled="!['superadmin'].includes($store.state.user.loginname)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button @click="doDelete(row.id)" size="mini" type="danger"
|
||||
:disabled="!['superadmin'].includes($store.state.user.loginname)">
|
||||
删除
|
||||
</el-button>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("../common/apply.js"){}#-->
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
declareTotalBudgetMoney: 0,
|
||||
totalBudgetMoney: 0,
|
||||
budgetTypeOption: [],
|
||||
clubOption: [],
|
||||
unionList: [],
|
||||
pageForm: {
|
||||
year: new Date().getFullYear() + "",
|
||||
outlayManageSource: "",
|
||||
unionId: "",
|
||||
clubId: "",
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'year', label: '年度', width: '80'},
|
||||
{prop: 'userName', label: '申报人姓名', fixed: "left"},
|
||||
{prop: 'loginName', label: '申报人工号', fixed: "left"},
|
||||
{prop: 'mobile', label: '联系方式', width: '120'},
|
||||
{prop: 'outlayManageSource', label: '申报类型'},
|
||||
{prop: 'helpUnitName', label: '申报单位'},
|
||||
{prop: 'activityMatter', label: '活动项目', width: '300'},
|
||||
{prop: 'declareTotalBudgetMoney', label: '申报预算金额'},
|
||||
{prop: 'totalBudgetMoney', label: '审核预算金额'},
|
||||
{prop: 'applyDate', label: '申报时间'},
|
||||
],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
},
|
||||
methods: {
|
||||
|
||||
openEdit(row) {
|
||||
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm('确定删除该条数据?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
$.post(loc() + "/doDelete", {id}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
});
|
||||
this.doSearch();
|
||||
this.getApplyMoney()
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
doExport() {
|
||||
const {year, outlayManageSource, unionId, clubId} = this.pageForm
|
||||
window.open("/platform/activity/budget/applyStatistics/doExport?year=" + year
|
||||
+ "&outlayManageSource=" + outlayManageSource
|
||||
+ "&unionId=" + unionId
|
||||
+ "&clubId=" + clubId
|
||||
)
|
||||
},
|
||||
budgetTypeCodeChange() {
|
||||
this.$set(this.pageForm, "unionId", '')
|
||||
this.$set(this.pageForm, "clubId", '')
|
||||
this.doSearch()
|
||||
this.getApplyMoney()
|
||||
},
|
||||
|
||||
openView(row) {
|
||||
window.open("/flow/common/approval/form?instanceId=" + row.instanceId + "&businessId=" + row.businessNo+"")
|
||||
},
|
||||
getApplyMoney() {
|
||||
this.$axios.post("/platform/activity/budget/applyStatistics/getApplyMoney", this.pageForm).then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.declareTotalBudgetMoney = resp.data.declareTotalBudgetMoney
|
||||
this.totalBudgetMoney = resp.data.totalBudgetMoney
|
||||
} else {
|
||||
this.$message.error(resp.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.budgetTypeOption = await this.$businessTool.getDictOptions("ACTIVITY_BUDGET_TYPE")
|
||||
this.budgetTypeOption.unshift({name: "全部类型", code: ""})
|
||||
// this.clubOption = await getClubsByRole()
|
||||
this.unionList = await this.$businessTool.listUnion()
|
||||
this.getApplyMoney()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+172
@@ -0,0 +1,172 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
@change="doSearch"
|
||||
placeholder="选择年度"
|
||||
style="width: 100%" type="year"
|
||||
v-model="pageForm.year"
|
||||
:clearable="false"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool label="预算汇总">
|
||||
<el-radio-group @change="budgetTypeCodeChange" size="small"
|
||||
v-model="pageForm.outlayManageSource">
|
||||
<el-radio-button :label="item.code" v-for="item in budgetTypeOption">
|
||||
{{item.name}}
|
||||
</el-radio-button>
|
||||
</el-radio-group>
|
||||
|
||||
<el-button @click="doExport" size="small" style="margin-left: 10px;"
|
||||
type="primary">导出汇总表
|
||||
</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :summary-method="getSummaries" @sort-change="pageOrder"
|
||||
row-key="id"
|
||||
show-summary
|
||||
style="width: 100%"
|
||||
v-loading="tableLoading">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
v-for="column in tableColumns">
|
||||
<template scope="{row}" v-if="column.prop==='year'">
|
||||
{{$moment(row.applyDate).format("YYYY")}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</el-card>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
budgetTypeOption: [],
|
||||
clubOption: [],
|
||||
unionList: [],
|
||||
pageForm: {
|
||||
year: new Date().getFullYear() + "",
|
||||
outlayManageSource: "ACTIVITY_BUDGET_TYPE_ONE",
|
||||
unionId: "",
|
||||
clubId: "",
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'year', label: '年度'},
|
||||
{prop: 'activityMatter', label: '活动项目'},
|
||||
{prop: 'totalBudgetMoney', label: '预算金额'},
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doExport() {
|
||||
const {year, outlayManageSource, unionId, clubId} = this.pageForm
|
||||
window.open("/platform/activity/budget/queryStatistics/doExport?year=" + year
|
||||
+ "&outlayManageSource=" + outlayManageSource
|
||||
+ "&unionId=" + unionId
|
||||
+ "&clubId=" + clubId
|
||||
)
|
||||
},
|
||||
budgetTypeCodeChange(val) {
|
||||
this.$set(this.pageForm, "unionId", '')
|
||||
this.$set(this.pageForm, "clubId", '')
|
||||
this.tableData = []
|
||||
if (["ACTIVITY_BUDGET_TYPE_ONE"].includes(val)) {
|
||||
this.tableColumns = [
|
||||
{prop: 'year', label: '年度'},
|
||||
{prop: 'activityMatter', label: '活动项目'},
|
||||
{prop: 'totalBudgetMoney', label: '预算金额'},
|
||||
]
|
||||
} else if (val === "ACTIVITY_BUDGET_TYPE_TWO") {
|
||||
this.tableColumns = [
|
||||
{prop: 'year', label: '年度'},
|
||||
{prop: 'unionName', label: '分工会'},
|
||||
{prop: 'totalBudgetMoney', label: '预算金额'},
|
||||
]
|
||||
} else if (val === "ACTIVITY_BUDGET_TYPE_THREE") {
|
||||
this.tableColumns = [
|
||||
{prop: 'year', label: '年度'},
|
||||
{prop: 'clubName', label: '协会名称'},
|
||||
{prop: 'totalBudgetMoney', label: '预算金额'},
|
||||
]
|
||||
}
|
||||
this.doSearch()
|
||||
},
|
||||
getSummaries(param) {
|
||||
const {columns, data} = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计';
|
||||
return;
|
||||
}
|
||||
const values = data.map(item => Number(item[column.property]));
|
||||
if (index === 3) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0).toFixed(2);
|
||||
sums[index] += ' 元';
|
||||
} else {
|
||||
sums[index] = '';
|
||||
}
|
||||
});
|
||||
|
||||
return sums;
|
||||
},
|
||||
pageData() {
|
||||
this.tableLoading = true
|
||||
this.$axios.post("/platform/activity/budget/queryStatistics/pageData", this.pageForm).then(resp => {
|
||||
this.tableLoading = false
|
||||
if (resp.code === 0) {
|
||||
if (this.pageForm.outlayManageSource === 'ACTIVITY_BUDGET_TYPE_TWO') {
|
||||
resp.data.map(v => {
|
||||
if (!v.unionName) {
|
||||
v.unionName = v.unitName
|
||||
}
|
||||
})
|
||||
this.unionList = resp.data
|
||||
}
|
||||
this.tableData = resp.data;
|
||||
} else {
|
||||
this.$message.error(resp.msg);
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.budgetTypeOption = await this.$businessTool.getDictOptions("ACTIVITY_BUDGET_TYPE")
|
||||
// this.clubOption = await getClubsByRole()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,69 @@
|
||||
<div id="outlay-act-budget-apply-form" v-cloak>
|
||||
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix=":" class="flow-task-form">
|
||||
<el-form-item label="审核金额" prop="tf_totalBudgetMoney"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-input-number :min="0" :precision="2"
|
||||
placeholder="请输入审核金额"
|
||||
style="width: 100%"
|
||||
v-model="formData.tf_totalBudgetMoney"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="审批意见" prop="tf_opinion"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<snaker-flow-task-form-action @task-action="handleTaskAction" @cancel="handleCancel"></snaker-flow-task-form-action>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#outlay-act-budget-apply-form",
|
||||
store,
|
||||
data() {
|
||||
return {
|
||||
businessId: GetQueryString("businessId"),
|
||||
processInstanceId: GetQueryString("instanceId"),
|
||||
formData: {},
|
||||
formRules: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleTaskAction(val) {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "info"
|
||||
}).then((res) => {
|
||||
this.formData.processInstanceId = this.processInstanceId
|
||||
this.$axios
|
||||
.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify({
|
||||
...val,
|
||||
...this.formData
|
||||
})
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("操作成功")
|
||||
// 发送完成消息
|
||||
window.parent.postMessage(
|
||||
{
|
||||
type: "task-complete"
|
||||
},
|
||||
"*"
|
||||
)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel(val) {
|
||||
console.log(val)
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,121 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<guava ref="guava">
|
||||
<div id="app">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
@change="doSearch"
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="申报人">
|
||||
<el-input v-model="pageForm.searchKeyword" placeholder="请输入工号/姓名"
|
||||
clearable></el-input>
|
||||
</search-item>
|
||||
<search-item label="活动项目">
|
||||
<el-input v-model="pageForm.activityMatter" placeholder="请输入活动项目"
|
||||
clearable></el-input>
|
||||
</search-item>
|
||||
<search-item label="分工会">
|
||||
<el-select v-model="formData.unionId" filterable
|
||||
clearable
|
||||
placeholder="请选择工会" style="width: 100%;">
|
||||
<el-option v-for="item in unionList" :label="item.name"
|
||||
:value="item.id"
|
||||
:key="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool label="申报列表">
|
||||
<el-radio-group v-model="pageForm.approval" size="small" @change="doSearch">
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder" style="width: 100%">
|
||||
<el-table-column type="index" width="50px" label="序号" :index="indexMethod"></el-table-column>
|
||||
<el-table-column prop="year" label="年度"></el-table-column>
|
||||
<el-table-column prop="userName" label="申报人姓名"></el-table-column>
|
||||
<el-table-column prop="loginName" label="申报人工号"></el-table-column>
|
||||
<el-table-column prop="outlayManageSource" label="申报类型">
|
||||
<template slot-scope="{row}">
|
||||
<dict-tag :options="budgetTypeOption"
|
||||
:value="row.outlayManageSource"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="helpUnitName" label="申报单位"></el-table-column>
|
||||
<el-table-column prop="activityMatter" label="活动项目"></el-table-column>
|
||||
<el-table-column prop="declareTotalBudgetMoney" label="申报预算金额"></el-table-column>
|
||||
<el-table-column prop="applyDate" label="申报时间"></el-table-column>
|
||||
<el-table-column prop="taskName" label="当前节点"></el-table-column>
|
||||
<el-table-column prop="instanceState" label="流程状态">
|
||||
<template slot-scope="{row}">
|
||||
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
|
||||
size="small"></enum-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="300px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button v-if="row.taskState === 10" @click="openApproval(row)" size="mini" type="primary">审核</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</div>
|
||||
</guava>
|
||||
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
pageDataUrl: "/platform/activity/budget/schoolAudit/pageData",
|
||||
budgetTypeOption: [],
|
||||
clubOption: [],
|
||||
unionList: [],
|
||||
pageForm: {
|
||||
year: moment().format("YYYY"), auditState: 2,
|
||||
outlayManageSource: "",
|
||||
activityMatter: "",
|
||||
unionId: "",
|
||||
clubId: "",
|
||||
approval: false
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
window.open("/flow/common/approval/form?instanceId=" + row.instanceId + "&businessId=" + row.businessNo+"")
|
||||
},
|
||||
openApproval(row) {
|
||||
window.open("/flow/common/approval/form?taskId=" + row.taskId + "&instanceId=" + row.instanceId + "&businessId=" + row.businessNo)
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.budgetTypeOption = await this.$businessTool.getDictOptions("ACTIVITY_BUDGET_TYPE")
|
||||
this.unionList = await this.$businessTool.listUnion()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,110 @@
|
||||
<div id="suggestion-box-view">
|
||||
<el-descriptions :column="3" border>
|
||||
<el-descriptions-item label="申报人">{{viewData.userName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="工号">{{viewData.loginName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系方式">{{viewData.mobile}}</el-descriptions-item>
|
||||
<el-descriptions-item label="预算类型">
|
||||
<dict-tag :options="budgetTypeOption"
|
||||
:value="viewData.outlayManageSource"></dict-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="申报(承办)单位">{{viewData.helpUnitName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="活动项目">{{viewData.activityMatter}}</el-descriptions-item>
|
||||
<el-descriptions-item label="活动时间">{{viewData.activityDate}}</el-descriptions-item>
|
||||
<el-descriptions-item label="申报预算金额(元)">{{viewData.declareTotalBudgetMoney}}</el-descriptions-item>
|
||||
<el-descriptions-item label="最终预算金额(元)">{{viewData.totalBudgetMoney}}</el-descriptions-item>
|
||||
<el-descriptions-item label="申报时间">{{viewData.applyDate}}</el-descriptions-item>
|
||||
<el-descriptions-item :span="2"></el-descriptions-item>
|
||||
<el-descriptions-item label="活动内容(如训练、装备等)" :span="3">
|
||||
<div v-html="viewData.activityContent"></div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<template v-for="task in doneTasks">
|
||||
<div class="task-panel mt10">
|
||||
<div class="task-panel-header">{{ task.displayName }}</div>
|
||||
<el-descriptions border class="flow-task-form" :column="3" :key="task.id" v-if="task.ext.isFirstTaskNode">
|
||||
<el-descriptions-item label="申请用户">{{ task.ext.initiatorName }}({{task.ext.initiatorAccount}})
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="申请时间">{{ task.finishTime }}</el-descriptions-item>
|
||||
<el-descriptions-item label="办理结果">
|
||||
<dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE" :value="task.ext.submitType"></dict-tag>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<el-descriptions border class="flow-task-form" :column="3" :key="task.id" v-else>
|
||||
<el-descriptions-item label="办理用户">{{ task.taskFormData.userName
|
||||
}}({{task.taskFormData.loginName}})
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="办理时间">{{ task.finishTime }}</el-descriptions-item>
|
||||
<el-descriptions-item label="办理结果">
|
||||
<dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE" :value="task.ext.submitType"></dict-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核金额">
|
||||
{{task.ext.tf_totalBudgetMoney}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="2"></el-descriptions-item>
|
||||
<el-descriptions-item label="办理意见" v-if="!task.ext.isFirstTaskNode">{{ task.taskFormData.opinion
|
||||
}}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#suggestion-box-view",
|
||||
store,
|
||||
dicts: ["PROCESS_TASK_SUBMIT_TYPE"],
|
||||
data() {
|
||||
return {
|
||||
businessId: GetQueryString("businessId"),
|
||||
instanceId: GetQueryString("instanceId"),
|
||||
viewData: {},
|
||||
doneTasks: [],
|
||||
budgetTypeOption: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
info() {
|
||||
this.$axios.post("/platform/activity/budget/applyList/findOne", {id: this.businessId}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.viewData = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
getDoneTasks() {
|
||||
this.$axios.post("/flow/common/doneTasks", {instanceId: this.instanceId}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.doneTasks = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$businessTool.getDictOptions("ACTIVITY_BUDGET_TYPE").then(resp => {
|
||||
this.budgetTypeOption = resp
|
||||
})
|
||||
this.info()
|
||||
this.getDoneTasks()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.task-panel {
|
||||
background: white;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.task-panel-header {
|
||||
background: rgb(250, 250, 250);
|
||||
border: 1px solid rgb(228, 231, 237);
|
||||
border-bottom: none;
|
||||
padding: 12px 16px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,90 @@
|
||||
const OUTLAY_MANAGE_EDIT_DETAIL_DIALOG = {
|
||||
template: /*language=HTML*/ `
|
||||
|
||||
<div>
|
||||
<el-dialog
|
||||
title="提示"
|
||||
:visible.sync="dialogVisible"
|
||||
width="40%" :append-to-body="true">
|
||||
<el-form :model="formData" ref="form" label-width="120px">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="活动名称" prop="projectName">
|
||||
<el-input v-model="formData.projectName" maxlength="100"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="活动时间" prop="activityTime">
|
||||
<el-date-picker
|
||||
v-model="formData.activityTime"
|
||||
type="date"
|
||||
style="width: 100%"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="活动费用" prop="adjustMoney">
|
||||
<el-input-number :precision="2" v-model="formData.adjustMoney"
|
||||
style="width: 100%"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="活动人数" prop="activityNumber">
|
||||
<el-input-number :min="0" v-model="formData.activityNumber"
|
||||
style="width: 100%"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="事由" prop="adjustReason">
|
||||
<el-input maxlength="500" type="textarea" v-model.trim="formData.adjustReason"
|
||||
rows="4"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">关 闭</el-button>
|
||||
<el-button type="primary" @click="doSubmit">提 交</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
`, data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formData: {},
|
||||
url: ""
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doSubmit() {
|
||||
this.$confirm('确认提交吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.$refs.form.validate(async valid => {
|
||||
if (valid) {
|
||||
this.$axios.post(this.url, this.formData).then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
this.dialogVisible = false
|
||||
this.$emit("search")
|
||||
this.$message.success(resp.msg)
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
open(row, url) {
|
||||
this.formData = row
|
||||
this.url = url
|
||||
this.dialogVisible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
@change="doSearch"
|
||||
placeholder="选择年度"
|
||||
style="width: 100%" type="year"
|
||||
v-model="pageForm.year"
|
||||
:clearable="false"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="预算分配">
|
||||
<el-button @click="issuedOutlay" size="small" type="primary" v-if="!isAllocation">年度分配
|
||||
</el-button>
|
||||
<el-button type="danger" size="small" @click="resetOutlay" v-else>
|
||||
分配重置
|
||||
</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id"
|
||||
v-loading="tableLoading" :size="tableSize" class="vi-table">
|
||||
|
||||
<el-table-column align="center" header-align="center" type="index"
|
||||
:index="indexMethod" label="序号"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
show-overflow-tooltip
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
min-width="50"
|
||||
>
|
||||
<template v-if="column.prop=='unit'" v-slot="{row}">
|
||||
校工会
|
||||
</template>
|
||||
<template v-else-if="column.prop=='totalQuota'" v-slot="{row}">
|
||||
<el-input v-if="row.edit" maxlength="8" min="0" type="number"
|
||||
style="width: 70%"
|
||||
size="small"
|
||||
onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
|
||||
v-model="row.totalQuota2" placeholder="填写总额度">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
<div v-else>
|
||||
<span v-if="!row.totalQuota">暂未分配</span>
|
||||
<span v-else><i>{{row.totalQuota}}</i> 元</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作"
|
||||
fixed="right" width="200">
|
||||
<template slot-scope="{row}">
|
||||
<div v-if="row.edit">
|
||||
<el-button type="success" icon="el-icon-check" size="mini"
|
||||
@click="doSubmit(row)"
|
||||
circle></el-button>
|
||||
<el-button type="danger" icon="el-icon-close" size="mini"
|
||||
@click="$set(row,'edit',false)"
|
||||
circle></el-button>
|
||||
</div>
|
||||
<el-button v-else size="mini" type="primary"
|
||||
@click="$set(row,'edit',true);$set(row,'totalQuota2',row.totalQuota);">
|
||||
编辑
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
tableColumns: [
|
||||
{prop: 'year', label: '年度'},
|
||||
{prop: 'unit', label: '单位'},
|
||||
{prop: 'totalQuota', label: '预算费用'},
|
||||
],
|
||||
pageForm: {
|
||||
year: this.$moment().format("YYYY")
|
||||
},
|
||||
isAllocation: false
|
||||
}
|
||||
},
|
||||
components: {},
|
||||
methods: {
|
||||
doSubmit(row) {
|
||||
this.$confirm('您确定要提交此条记录吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/outlay/outlayManage/schoolManage/doSubmit", {
|
||||
id: row.id,
|
||||
totalQuota: row.totalQuota2
|
||||
}).then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
row.edit = false
|
||||
this.doSearch()
|
||||
this.$message.success("编辑成功");
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
resetOutlay() {
|
||||
this.$confirm('您确定要重置今年的记录吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/outlay/outlayManage/schoolManage/resetOutlay", {
|
||||
year: this.pageForm.year
|
||||
}).then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
this.getIsAllocation()
|
||||
this.$message.success("操作成功");
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
issuedOutlay() {
|
||||
this.$confirm('您确定要下发今年的记录吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/outlay/outlayManage/schoolManage/issuedOutlay", {
|
||||
year: this.pageForm.year
|
||||
}).then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
this.getIsAllocation()
|
||||
this.$message.success("操作成功");
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
getIsAllocation() {
|
||||
this.$axios.post("/platform/outlay/outlayManage/schoolManage/getIsAllocationOutlay", {
|
||||
year: this.pageForm.year
|
||||
}).then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
this.isAllocation = (resp.data > 0)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.getIsAllocation()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+155
@@ -0,0 +1,155 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="预算年度">
|
||||
<el-select placeholder="请选择预算年度" v-model="pageForm.outlayManageId"
|
||||
style="width: 100%;"
|
||||
filterable @change="">
|
||||
<el-option v-for="item in outlayManageList"
|
||||
:label="item.year"
|
||||
:key="item.id"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="活动名称">
|
||||
<el-input v-model="pageForm.projectName" maxlength="100"
|
||||
placeholder="请输入活动名称" clearable></el-input>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="预算使用情况">
|
||||
<div style="margin-left: 10px;" v-if="pageForm.outlayManageId">
|
||||
<el-tag style="font-size: 15px;">
|
||||
{{outlayManageList.find(item=>item.id==pageForm.outlayManageId).year}}年总经费
|
||||
{{thisYearMoney.totalQuota}} 元 ,已使用 {{thisYearMoney.usedQuota}}
|
||||
剩余:{{thisYearMoney.totalQuota-thisYearMoney.usedQuota}}元
|
||||
<template v-if="thisYearMoney.totalMoney>0">当前项目已使用:{{thisYearMoney.totalMoney}}
|
||||
</template>
|
||||
</el-tag>
|
||||
</div>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id"
|
||||
v-loading="tableLoading" :size="tableSize" class="vi-table">
|
||||
|
||||
<el-table-column align="center" header-align="center" type="index"
|
||||
:index="indexMethod" label="序号"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
show-overflow-tooltip
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
min-width="50"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作"
|
||||
fixed="right" width="200">
|
||||
<template slot-scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="openEdit(row)"
|
||||
:disabled="!['superadmin'].includes($store.state.user.loginname)"
|
||||
>编辑
|
||||
</el-button>
|
||||
<el-button size="mini" type="danger" @click="doDelete(row)"
|
||||
:disabled="!['superadmin'].includes($store.state.user.loginname)"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
<outlay-manage-edit-detail-dialog ref="editDetailDialog" @search="changeYear"></outlay-manage-edit-detail-dialog>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("../../common/editDetailDialog.js"){}#-->
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
tableColumns: [
|
||||
{prop: 'projectName', label: '活动名称'},
|
||||
{prop: 'activityTime', label: '活动时间'},
|
||||
{prop: 'activityNumber', label: '活动人数'},
|
||||
{prop: 'adjustMoney', label: '活动费用'},
|
||||
{prop: 'adjustReason', label: '事由'},
|
||||
],
|
||||
pageForm: {outlayManageId: ''},
|
||||
outlayManageList: [],
|
||||
thisYearMoney: {}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'outlay-manage-edit-detail-dialog': OUTLAY_MANAGE_EDIT_DETAIL_DIALOG
|
||||
},
|
||||
methods: {
|
||||
openEdit(row) {
|
||||
this.$refs.editDetailDialog.open(row,"/platform/outlay/outlayManage/schoolUseDetail/doEditDetail")
|
||||
},
|
||||
getOutlayManageList() {
|
||||
this.$axios.post("/platform/outlay/outlayManage/schoolUseDetail/getOutlayManageList").then(res => {
|
||||
if (res.code === 0) {
|
||||
this.outlayManageList = res.data
|
||||
if (res.data && res.data.length > 0) {
|
||||
this.pageForm.outlayManageId = res.data[0].id
|
||||
this.pageData()
|
||||
this.getApplyMoney()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
doDelete(row) {
|
||||
this.$confirm("确定要删除该详情吗?", "提示", {type: "warning"}).then(async () => {
|
||||
this.$set(row, "loading", true)
|
||||
const resp = await this.$axios.post("/platform/outlay/outlayManage/schoolUseDetail/doDeleteDetail", {id: row.id})
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
this.getApplyMoney()
|
||||
this.$message.success(resp.msg)
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
changeYear(){
|
||||
this.doSearch()
|
||||
this.getApplyMoney()
|
||||
},
|
||||
getApplyMoney() {
|
||||
this.$axios.post("/platform/outlay/outlayManage/schoolUseDetail/getApplyMoney", {outlayManageId: this.pageForm.outlayManageId}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.thisYearMoney = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.getOutlayManageList()
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,182 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
@change="doSearch"
|
||||
placeholder="选择年度"
|
||||
style="width: 100%" type="year"
|
||||
v-model="pageForm.year"
|
||||
:clearable="false"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="预算分配">
|
||||
<template v-if="pageForm.year===$moment().format('YYYY')">
|
||||
<el-button @click="issuedOutlay" size="small" type="primary" v-if="!isAllocation">年度分配
|
||||
</el-button>
|
||||
<el-button type="danger" size="small" @click="resetOutlay" v-else>
|
||||
分配重置
|
||||
</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id"
|
||||
v-loading="tableLoading" :size="tableSize" class="vi-table">
|
||||
|
||||
<el-table-column align="center" header-align="center" type="index"
|
||||
:index="indexMethod" label="序号"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
show-overflow-tooltip
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
min-width="50"
|
||||
>
|
||||
<template v-if="column.prop=='totalQuota'" v-slot="{row}">
|
||||
<el-input v-if="row.edit" maxlength="8" min="0" type="number"
|
||||
style="width: 70%"
|
||||
size="small"
|
||||
onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
|
||||
v-model="row.totalQuota2" placeholder="填写总额度">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
<div v-else>
|
||||
<span v-if="!row.totalQuota">暂未分配</span>
|
||||
<span v-else><i>{{row.totalQuota}}</i> 元</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作"
|
||||
fixed="right" width="200">
|
||||
<template slot-scope="{row}">
|
||||
<div v-if="row.edit">
|
||||
<el-button type="success" icon="el-icon-check" size="mini"
|
||||
@click="doSubmit(row)"
|
||||
circle></el-button>
|
||||
<el-button type="danger" icon="el-icon-close" size="mini"
|
||||
@click="$set(row,'edit',false)"
|
||||
circle></el-button>
|
||||
</div>
|
||||
<el-button v-else size="mini" type="primary"
|
||||
@click="$set(row,'edit',true);$set(row,'totalQuota2',row.totalQuota);">
|
||||
编辑
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
tableColumns: [
|
||||
{prop: 'year', label: '年度'},
|
||||
{prop: 'unionName', label: '工会名称'},
|
||||
{prop: 'totalQuota', label: '预算费用'},
|
||||
],
|
||||
pageForm: {
|
||||
year: this.$moment().format("YYYY")
|
||||
},
|
||||
isAllocation: false
|
||||
}
|
||||
},
|
||||
components: {},
|
||||
methods: {
|
||||
doSubmit(row) {
|
||||
this.$confirm('您确定要提交此条记录吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/outlay/outlayManage/unionManage/doSubmit", {
|
||||
id: row.id,
|
||||
totalQuota: row.totalQuota2
|
||||
}).then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
row.edit = false
|
||||
this.doSearch()
|
||||
this.$message.success("编辑成功");
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
resetOutlay() {
|
||||
this.$confirm('您确定要重置今年的记录吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/outlay/outlayManage/unionManage/resetOutlay", {
|
||||
year: this.pageForm.year
|
||||
}).then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
this.getIsAllocation()
|
||||
this.$message.success("操作成功");
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
issuedOutlay() {
|
||||
this.$confirm('您确定要下发今年的记录吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/outlay/outlayManage/unionManage/issuedOutlay", {
|
||||
year: this.pageForm.year
|
||||
}).then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
this.getIsAllocation()
|
||||
this.$message.success("操作成功");
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
getIsAllocation() {
|
||||
this.$axios.post("/platform/outlay/outlayManage/unionManage/getIsAllocationOutlay", {
|
||||
year: this.pageForm.year
|
||||
}).then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
this.isAllocation = (resp.data > 0)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.getIsAllocation()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
<!--#include("../../common/editDetailDialog.js"){}#-->
|
||||
let OUTLAY_MANAGE_UNION_USE_DETAIL_INFO = {
|
||||
/*language=HTML*/
|
||||
template: `
|
||||
<div>
|
||||
<template>
|
||||
<table-tool label="预算详情列表"></table-tool>
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id"
|
||||
v-loading="tableLoading" :size="tableSize" class="vi-table">
|
||||
<el-table-column align="center" header-align="center" type="index"
|
||||
:index="indexMethod" label="序号"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column label="活动名称" prop="projectName" header-align="center"
|
||||
align="center"></el-table-column>
|
||||
<el-table-column label="活动时间" prop="activityTime"
|
||||
header-align="center"
|
||||
align="center"></el-table-column>
|
||||
<el-table-column label="活动人数" prop="activityNumber"
|
||||
header-align="center"
|
||||
align="center"></el-table-column>
|
||||
<el-table-column label="活动费用" prop="adjustMoney"
|
||||
header-align="center"
|
||||
align="center"></el-table-column>
|
||||
|
||||
<el-table-column label="审核人" prop="adjustUserName" header-align="center"
|
||||
align="center"></el-table-column>
|
||||
<el-table-column label="事由" prop="adjustReason" header-align="center"
|
||||
show-overflow-tooltip
|
||||
align="center"></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作"
|
||||
fixed="right" width="200">
|
||||
<template slot-scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="openEdit(row)"
|
||||
:disabled="!['superadmin'].includes($store.state.user.loginname)"
|
||||
>编辑
|
||||
</el-button>
|
||||
<el-button size="mini" type="danger" @click="doDelete(row)"
|
||||
:disabled="!['superadmin'].includes($store.state.user.loginname)"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</template>
|
||||
<template>
|
||||
<outlay-manage-edit-detail-dialog ref="editDetailDialog" @search="search"></outlay-manage-edit-detail-dialog>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
`,
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
rowData: {},
|
||||
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'outlay-manage-edit-detail-dialog': OUTLAY_MANAGE_EDIT_DETAIL_DIALOG
|
||||
},
|
||||
methods: {
|
||||
search(){
|
||||
this.doSearch()
|
||||
this.$emit("search")
|
||||
},
|
||||
openEdit(row) {
|
||||
this.$refs.editDetailDialog.open(row,"/platform/outlay/outlayManage/unionUseDetail/doEditDetail")
|
||||
|
||||
},
|
||||
doDelete(row) {
|
||||
this.$confirm("确定要删除该详情吗?", "提示", {type: "warning"}).then(async () => {
|
||||
this.$set(row, "loading", true)
|
||||
const resp = await this.$axios.post("/platform/outlay/outlayManage/unionUseDetail/doDeleteDetail", {id: row.id})
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
this.$emit("search")
|
||||
this.$message.success(resp.msg)
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
pageData() {
|
||||
this.$axios.post("/platform/outlay/outlayManage/unionUseDetail/detailInfo", this.pageForm).then((resp) => {
|
||||
this.tableLoading = false
|
||||
if (resp.code === 0) {
|
||||
this.tableData = resp.data.list
|
||||
this.pageForm.totalCount = resp.data.totalCount
|
||||
}
|
||||
})
|
||||
},
|
||||
open(row) {
|
||||
this.tableLoading = true
|
||||
this.rowData = row
|
||||
this.pageForm.outlayManageId = row.id
|
||||
this.pageData()
|
||||
}
|
||||
}
|
||||
}
|
||||
+125
@@ -0,0 +1,125 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
@change="doSearch"
|
||||
placeholder="选择年度"
|
||||
style="width: 100%" type="year"
|
||||
v-model="pageForm.year"
|
||||
:clearable="false"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
|
||||
<search-item label="所属工会" v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN'])">
|
||||
<el-select placeholder="请选择所属工会" v-model="pageForm.unionId"
|
||||
style="width: 100%;"
|
||||
clearable
|
||||
@change="doSearch"
|
||||
filterable>
|
||||
<el-option v-for="item in unions"
|
||||
:label="item.name"
|
||||
:key="item.id"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="预算使用情况">
|
||||
|
||||
</table-tool>
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id"
|
||||
v-loading="tableLoading" :size="tableSize" class="vi-table">
|
||||
|
||||
<el-table-column align="center" header-align="center" type="index"
|
||||
:index="indexMethod" label="序号"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
show-overflow-tooltip
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
min-width="50"
|
||||
>
|
||||
<template v-slot="{row}" v-if="column.prop=='surplusQuota'">
|
||||
<span v-if="!row.totalQuota">{{row.totalQuota}}元</span>
|
||||
<span v-else>{{(row.totalQuota-row.usedQuota).toFixed(2)}}</span>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作"
|
||||
fixed="right" width="150">
|
||||
<template slot-scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="openView(row)">使用详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<outlay-manage-union-use-detail-info ref="detailInfo" @search="doSearch"></outlay-manage-union-use-detail-info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("detailInfo.js"){}#-->
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
tableColumns: [
|
||||
{prop: 'year', label: '年度'},
|
||||
{prop: 'unionName', label: '分工会名称'},
|
||||
{prop: 'unionCode', label: '分工会编码'},
|
||||
{prop: 'totalQuota', label: '分配总额度(元)'},
|
||||
{prop: 'usedQuota', label: '已使用额度(元)'},
|
||||
{prop: 'surplusQuota', label: '剩余额度(元)'},
|
||||
],
|
||||
pageForm: {
|
||||
year: this.$moment().format("YYYY")
|
||||
},
|
||||
unions: []
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"outlay-manage-union-use-detail-info": OUTLAY_MANAGE_UNION_USE_DETAIL_INFO
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.view(() => {
|
||||
this.$refs.detailInfo.open(row)
|
||||
})
|
||||
},
|
||||
|
||||
},
|
||||
async created() {
|
||||
this.unions = await this.$businessTool.listUnion()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,323 @@
|
||||
<div id="outlay-reimburse-apply-form" v-cloak>
|
||||
<el-form :model="formData" ref="formRef" class="flow-task-form">
|
||||
<el-descriptions :column="2" border>
|
||||
<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">
|
||||
<el-radio border :label="i.code" :key="i.code" v-for="i in budgetTypeOption">
|
||||
{{i.name}}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="申报人姓名">{{formData.userName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="申报人工号">{{formData.loginName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系方式">
|
||||
<el-form-item label="联系方式" prop="mobile"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-input v-model="formData.mobile" placeholder="请输入联系方式"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="所属协会"
|
||||
v-if="['ACTIVITY_BUDGET_TYPE_THREE'].includes(formData.outlayManageSource)">
|
||||
<el-form-item label="所属协会" prop="clubId"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-select v-model="formData.clubId" @change="getBudgetMoneyOrActivity"
|
||||
style="width: 100%"
|
||||
placeholder="请选择所属协会">
|
||||
<el-option
|
||||
v-for="item in clubList"
|
||||
:key="item.clubid"
|
||||
:label="item.clubName"
|
||||
:value="item.clubid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="经费余额">
|
||||
<el-form-item label="经费余额" prop="budgetMoney">
|
||||
<el-input v-model="budgetMoney" readonly></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="活动事项"
|
||||
v-if="['ACTIVITY_BUDGET_TYPE_THREE'].includes(formData.outlayManageSource)">
|
||||
<el-form-item label="活动事项" prop="activityMatter"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-input v-model="formData.activityMatter" placeholder="请输入活动事项"
|
||||
maxlength="100"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="活动事项"
|
||||
v-if="!['ACTIVITY_BUDGET_TYPE_THREE'].includes(formData.outlayManageSource)">
|
||||
<el-form-item label="活动事项" prop="budgetId"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-select v-model="formData.budgetId" filterable
|
||||
@change="budgetIdChange"
|
||||
default-first-option
|
||||
placeholder="请选择项目名称" style="width: 100%">
|
||||
<el-option :label="item.activityMatter"
|
||||
:value="item.id"
|
||||
v-for="item in activityList"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item v-if="!['ACTIVITY_BUDGET_TYPE_THREE'].includes(formData.outlayManageSource)"></el-descriptions-item>
|
||||
<el-descriptions-item label="金额":span="2">
|
||||
<el-form-item label="金额" prop="money"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-input v-model="formData.money" :placeholder="moneyPlaceholder"
|
||||
type="number"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="活动时间">
|
||||
<el-form-item label="活动时间" prop="activityTime"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-date-picker v-model="formData.activityTime"
|
||||
placeholder="活动时间"
|
||||
style="width: 100%" type="date"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
v-if="!['ACTIVITY_BUDGET_TYPE_THREE'].includes(formData.outlayManageSource)"></el-descriptions-item>
|
||||
<el-descriptions-item label="支付内容" :span="2">
|
||||
<el-form-item label="支付内容" prop="paymentContent"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-input v-model="formData.paymentContent" :autosize="{ minRows: 4, maxRows: 8}"
|
||||
maxlength="500"
|
||||
placeholder="请填写支付内容" type="textarea"></el-input>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="附件" :span="2">
|
||||
<el-form-item label="附件" prop="files"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<file-upload :upload_number="10" :value.sync="formData.files"
|
||||
upload_result_type="url"
|
||||
complete_result upload_mode="drag"
|
||||
upload_result_category="array"></file-upload>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="签字" :span="2">
|
||||
<el-form-item label="签字" prop="userSign"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<pc-signature v-model="formData.userSign"></pc-signature>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-form>
|
||||
<snaker-flow-task-form-action @task-action="handleTaskAction" @save-draft="handleSaveDraft"
|
||||
@cancel="handleCancel"></snaker-flow-task-form-action>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#outlay-reimburse-apply-form',
|
||||
store,
|
||||
data() {
|
||||
return {
|
||||
id: GetQueryString("businessId"),
|
||||
formData: {},
|
||||
budgetTypeOption: [],
|
||||
clubList: [],
|
||||
activityList: [],
|
||||
moneyPlaceholder: "请输入金额",
|
||||
budgetMoney: 0,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
outlayManageSourceChange(val) {
|
||||
if (!val) {
|
||||
this.budgetMoney = 0
|
||||
return
|
||||
}
|
||||
this.$set(this.formData, "budgetId", null)
|
||||
this.getBudgetMoneyOrActivity()
|
||||
if (val === "ACTIVITY_BUDGET_TYPE_TWO") {
|
||||
this.$set(this.formData, "unionId", this.$store.state.user.union.id)
|
||||
}
|
||||
},
|
||||
async budgetIdChange(val) {
|
||||
if (val) {
|
||||
if (["ACTIVITY_BUDGET_TYPE_TWO", "ACTIVITY_BUDGET_TYPE_ONE"].includes(this.formData.outlayManageSource)) {
|
||||
//如果是分工会和校工会
|
||||
const data = this.activityList.find(a => a.id === val)
|
||||
if (this.formData.outlayManageSource === "ACTIVITY_BUDGET_TYPE_TWO") {
|
||||
//如果是分工会
|
||||
if (data.isSchoolBudget) {
|
||||
//如果这一条分工会活动预算金额是属于校工会的
|
||||
this.moneyPlaceholder = "预算金额" + data.totalBudgetMoney + "元"
|
||||
} else {
|
||||
//如果这一条分工会活动活动,并且预算金额也是自己分工会的
|
||||
if (data.isRepeatReimburse) {
|
||||
//如果这一条活动预算可以重复报销
|
||||
const money = await this.getBxMoneyByBudgetId(val)
|
||||
this.moneyPlaceholder = "预算金额:" + data.totalBudgetMoney + "元,已报销金额:" + money + ",不能超过20%"
|
||||
} else {
|
||||
//如果如果不能重复报销暂无判断
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//如果是校工会
|
||||
if (data.twoLevelBudgetList.length > 0) {
|
||||
//如果大于0代表肯定有分工会使用校工会的预算,这里要减去分工会的预算
|
||||
this.moneyPlaceholder = "预算金额:" + data.totalBudgetMoney + "元,已报销金额:" + data.twoLevelTotalBudgetMoney
|
||||
} else {
|
||||
if (data.isRepeatReimburse) {
|
||||
const money = await this.getBxMoneyByBudgetId(val)
|
||||
this.moneyPlaceholder = "预算金额:" + data.totalBudgetMoney + "元,已报销金额:" + money + ",不能超过20%"
|
||||
} else {
|
||||
//如果如果不能重复报销暂无判断
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
this.totalBudgetMoney = data.totalBudgetMoney
|
||||
this.$set(this.formData, 'activityMatter', data.activityMatter)
|
||||
} else {
|
||||
this.moneyPlaceholder = "预算金额" + this.budgetMoney + "元"
|
||||
this.totalBudgetMoney = this.budgetMoney
|
||||
this.$set(this.formData, 'activityMatter', val)
|
||||
}
|
||||
} else {
|
||||
this.moneyPlaceholder = "请输入金额"
|
||||
this.totalBudgetMoney = 0
|
||||
this.$set(this.formData, 'activityMatter', null)
|
||||
}
|
||||
},
|
||||
async getBxMoneyByBudgetId(budgetId) {
|
||||
const resp = await this.$axios.post("/platform/outlay/reimburse/apply/getBxMoneyByBudgetId", {
|
||||
budgetId
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
return resp.data
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
getBudgetMoneyOrActivity() {
|
||||
this.$axios.post("/platform/outlay/reimburse/apply/getBudgetMoneyOrActivity", {
|
||||
outlayManageSource: this.formData.outlayManageSource,
|
||||
clubId: this.formData.clubId,
|
||||
unionId: this.formData.unionId,
|
||||
id: this.formData.id
|
||||
}).then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
this.budgetMoney = resp.data.budgetMoney
|
||||
this.activityList = resp.data.activityList
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
init() {
|
||||
if (this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])) {
|
||||
|
||||
} else {
|
||||
if (this.$auth.hasRoleOr(["SCHOOL_OUTLAY_ADMIN", "SCHOOL_UNION_ADMIN"])) {
|
||||
this.budgetTypeOption.map(v => {
|
||||
if (["ACTIVITY_BUDGET_TYPE_ONE"].includes(v.code)) {
|
||||
budgetTypeOption.push(v)
|
||||
}
|
||||
})
|
||||
}
|
||||
if (this.$auth.hasRoleOr(["BRANCH_UNION_CHAIRMAN", "BRANCH_UNION_ADMIN"])) {
|
||||
this.budgetTypeOption.map(v => {
|
||||
if (["ACTIVITY_BUDGET_TYPE_TWO"].includes(v.code)) {
|
||||
budgetTypeOption.push(v)
|
||||
}
|
||||
})
|
||||
}
|
||||
if (this.$auth.hasRoleOr(["CLUB_MANAGER", "CLUB_PRESIDENT"])) {
|
||||
this.budgetTypeOption.map(v => {
|
||||
if (["ACTIVITY_BUDGET_TYPE_THREE"].includes(v.code)) {
|
||||
budgetTypeOption.push(v)
|
||||
}
|
||||
})
|
||||
}
|
||||
this.budgetTypeOption = budgetTypeOption
|
||||
}
|
||||
if (this.id) {
|
||||
|
||||
} else {
|
||||
this.formData = {
|
||||
userName: this.$store.state.user.username,
|
||||
loginName: this.$store.state.user.loginname,
|
||||
mobile: this.$store.state.user.mobile,
|
||||
}
|
||||
}
|
||||
},
|
||||
handleTaskAction(val) {
|
||||
this.$refs.formRef.validate(valid => {
|
||||
if (valid) {
|
||||
this.$confirm('确定要提交数据吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/outlay/reimburse/apply/bxAddValidate",this.formData)
|
||||
// this.$axios
|
||||
// .post("/flow/common/startInstanceAndExecute", {
|
||||
// ...val,
|
||||
// bizData: JSON.stringify(this.formData)
|
||||
// })
|
||||
// .then((res) => {
|
||||
// if (res.code === 0) {
|
||||
// this.$message.success("操作成功")
|
||||
// // 发送完成消息
|
||||
// window.parent.postMessage(
|
||||
// {
|
||||
// type: "task-complete"
|
||||
// },
|
||||
// "*"
|
||||
// )
|
||||
// }
|
||||
// })
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleSaveDraft(val) {
|
||||
this.$confirm('确定要提交数据吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/outlay/reimburse/apply/bxAddValidate",this.formData)
|
||||
/* 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() {
|
||||
this.$confirm('取消将关闭当前页面并不会保存, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
window.close()
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.init()
|
||||
this.budgetTypeOption = await this.$businessTool.getDictOptions("ACTIVITY_BUDGET_TYPE")
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,61 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<div id="app">
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
</el-card>
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<el-button @click="openAdd" size="small" class="ml10" type="primary">
|
||||
报销申请
|
||||
</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder" style="width: 100%">
|
||||
<el-table-column type="index" width="50px" label="序号" :index="indexMethod"></el-table-column>
|
||||
<el-table-column prop="loginName" label="经办人工号"></el-table-column>
|
||||
<el-table-column prop="userName" label="姓名"></el-table-column>
|
||||
<el-table-column prop="outlayManageSource" label="活动类型"></el-table-column>
|
||||
<el-table-column prop="activityMatter" label="活动事项"></el-table-column>
|
||||
<el-table-column prop="helpUnitName" label="申报单位"></el-table-column>
|
||||
<el-table-column prop="money" label="金额"></el-table-column>
|
||||
<el-table-column prop="applyTime" label="申报时间"></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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
</div>
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
pageDataUrl: "/platform/outlay/reimburse/apply/pageData"
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openAdd() {
|
||||
window.open('/flow/common/approval/form?defineKey=FYBXSQ')
|
||||
},
|
||||
onOpen(id) {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,305 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="姓名/工号">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
||||
style="width: 100%">
|
||||
</el-input>
|
||||
</search-item>
|
||||
<search-item label="所属工会">
|
||||
<el-select v-model="pageForm.unionId" placeholder="请选择分工会" clearable style="width: 100%"
|
||||
@change="flushUnits">
|
||||
<el-option v-for="item in unionOptions" :key="item.id" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属单位">
|
||||
<el-select placeholder="所属单位" v-model="pageForm.unitId"
|
||||
style="width: 100%;"
|
||||
clearable
|
||||
filterable>
|
||||
<el-option v-for="item in unitOptions" :label="item.name"
|
||||
:value="item.id"
|
||||
:key="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="进校时长">
|
||||
<el-input placeholder="请输入进校时长" clearable v-model="pageForm.teachNum"
|
||||
style="width: 100%"
|
||||
@keyup.enter.native="doSearch">
|
||||
</el-input>
|
||||
</search-item>
|
||||
<search-item label="办证年月">
|
||||
<el-date-picker
|
||||
format="yyyy"
|
||||
value-format="yyyy"
|
||||
v-model="pageForm.thirtyCertificateProcessingTime"
|
||||
type="year"
|
||||
placeholder="请选择荣誉证办理年月"
|
||||
style="width: 100%">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="在职状态">
|
||||
<dict-select v-model="pageForm.userState" style="width: 100%"
|
||||
clearable
|
||||
placeholder="人员类型"
|
||||
code="USER_STATE"></dict-select>
|
||||
</search-item>
|
||||
<search-item label="人员类型">
|
||||
<dict-select v-model="pageForm.personType" style="width: 100%"
|
||||
clearable
|
||||
placeholder="人员类型"
|
||||
code="PERSON_TYPE"></dict-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="教职工管理">
|
||||
<el-button size="small" @click="batchDelete" type="primary">
|
||||
批量删除
|
||||
</el-button>
|
||||
|
||||
<el-button size="small" @click="setThirtyTeach" type="primary">
|
||||
一键设置
|
||||
</el-button>
|
||||
|
||||
<el-button size="small" @click="openImport" type="primary">
|
||||
导入
|
||||
</el-button>
|
||||
|
||||
<el-button size="small" @click="doExport" type="primary">
|
||||
导出
|
||||
</el-button>
|
||||
</table-tool>
|
||||
|
||||
<el-table ref="table" :data="tableData" style="width: 100%" row-key="id"
|
||||
@sort-change="pageOrder"
|
||||
v-loading="tableLoading" :size="tableSize" class="vi-table"
|
||||
@selection-change="tableHandleSelectionChange">
|
||||
<el-table-column type="selection" :reserve-selection="true"></el-table-column>
|
||||
<el-table-column align="center" header-align="center" type="index"
|
||||
:index="indexMethod" label="序号"
|
||||
width="80px"></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
show-overflow-tooltip
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:key="column.prop"
|
||||
:sortable="column.sortable"
|
||||
>
|
||||
<template v-if="column.prop==='member'" v-slot="{row}">
|
||||
<span v-if="row.member==1" class="text-success ">
|
||||
<i class="fa fa-circle ml5"></i> 是
|
||||
</span>
|
||||
<span v-else class="text-danger">
|
||||
<i class="fa fa-circle ml5"></i> 否
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="userOnline" align="center" header-align="center"
|
||||
label="操作"
|
||||
width="180px">
|
||||
<template slot-scope="{row}">
|
||||
<!-- <el-button size="mini" type="primary" @click="openView(row.id)">查看</el-button>-->
|
||||
<el-button size="mini" type="danger" @click="doDelete(row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<file-import ref="viewImport" temp_url="/platform/thirtyTeach/manage/downloadImportTemp"
|
||||
post_url="/platform/thirtyTeach/manage/doImport" is_show_radio @flush="$refs.guava.index();pageData()"
|
||||
></file-import>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-diaLog title="一键设置" :visible.sync="setThirtyTeachVisible" :close-on-click-modal="false" width="50%">
|
||||
|
||||
<el-form label-width="120px">
|
||||
<el-form-item label="设置年限">
|
||||
<el-input placeholder="请输入要设置的年限" v-model="setThirtyTeachData.setNum" type="number"
|
||||
style="width: 80%"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="更新模式">
|
||||
<el-radio-group v-model="setThirtyTeachData.isFlag">
|
||||
<el-radio-button label="true">清空更新</el-radio-button>
|
||||
<el-radio-button label="false">追加</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
<div style="text-align: right">
|
||||
<span>
|
||||
<el-button @click="setThirtyTeachVisible = false">关 闭</el-button>
|
||||
<el-button type="primary" @click="doSet">确定</el-button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</el-diaLog>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
unionOptions: [],
|
||||
unitOptions: [],
|
||||
tableColumns: [
|
||||
{prop: 'loginname', label: '工号', sortable: true},
|
||||
{prop: 'username', label: '姓名', sortable: true},
|
||||
{prop: 'sex', label: '性别'},
|
||||
{prop: 'teachNum', label: '进校时长(年)', sortable: true},
|
||||
{prop: 'personType', label: '人员类型', sortable: true},
|
||||
{prop: 'userState', label: '在职状态', sortable: true},
|
||||
{prop: 'unionName', label: '所属工会', sortable: true},
|
||||
{prop: 'unitName', label: '所属单位', sortable: true},
|
||||
{prop: 'member', label: '是否会员', sortable: true},
|
||||
{prop: 'mobile', label: '联系电话'},
|
||||
{prop: 'thirtyCertificateProcessingTime', label: '《30年教龄荣誉证》办理年月'},
|
||||
],
|
||||
|
||||
setThirtyTeachVisible: false,
|
||||
setThirtyTeachData: {
|
||||
setNum: 30,
|
||||
isFlag: false
|
||||
},
|
||||
checkUsers: [],
|
||||
pageForm: {
|
||||
searchKeyword: '',
|
||||
unionId: '',
|
||||
unitId: '',
|
||||
personType: '',
|
||||
userState: ''
|
||||
},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"file-import": httpVueLoader("/components/plugins/sysImport/index.vue?v=" + new Date().getTime())
|
||||
},
|
||||
methods: {
|
||||
openImport() {
|
||||
this.$refs.guava.edit(()=>{
|
||||
this.$refs.viewImport.resetImportData()
|
||||
})
|
||||
|
||||
},
|
||||
doExport() {
|
||||
const {searchKeyword, unionId, unitId, personType, userState} = this.pageForm
|
||||
window.open('/platform/thirtyTeach/manage/doExport?searchKeyword=' + searchKeyword + '&unionId=' + unionId + '&unitId=' + unitId +
|
||||
'&personType=' + personType + '&userState=' + userState)
|
||||
},
|
||||
doSet() {
|
||||
if (!this.setThirtyTeachData.setNum) {
|
||||
this.notifyWarning("请填写年限!!!")
|
||||
return
|
||||
}
|
||||
this.$axios.post('/platform/thirtyTeach/manage/setThirtyTeach', {
|
||||
setNum: this.setThirtyTeachData.setNum,
|
||||
isFlag: this.setThirtyTeachData.isFlag,
|
||||
}).then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.setThirtyTeachVisible = false
|
||||
this.notifySuccess(resp.msg)
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
tableHandleSelectionChange(val) {
|
||||
this.checkUsers = val;
|
||||
},
|
||||
async batchDelete() {
|
||||
if (!this.checkUsers.length) {
|
||||
this.notifyWarning("请先勾选需要删除的数据!!!")
|
||||
return
|
||||
}
|
||||
const confirm = await this.$confirm('您确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
const userIds = this.checkUsers.map(obj => obj.id);
|
||||
this.$axios.post('/platform/thirtyTeach/manage/doBatchDelete', {
|
||||
userIds: JSON.stringify(userIds)
|
||||
}).then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.notifySuccess(resp.msg)
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
setThirtyTeach() {
|
||||
this.setThirtyTeachData = {
|
||||
setNum: 30,
|
||||
isFlag: false
|
||||
}
|
||||
this.setThirtyTeachVisible = true
|
||||
},
|
||||
openView() {
|
||||
},
|
||||
async doDelete(userId) {
|
||||
const confirm = await this.$confirm('您确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
this.$axios.post('/platform/thirtyTeach/manage/doBatchDelete', {
|
||||
userIds: JSON.stringify([userId])
|
||||
}).then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.notifySuccess(resp.msg)
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", null)
|
||||
this.unitList = []
|
||||
if (this.pageForm.unionId) {
|
||||
this.$businessTool.listUnit(this.pageForm.unionId).then((data) => {
|
||||
this.unitOptions = data
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.$businessTool.listUnion().then((res) => (this.unionOptions = res))
|
||||
this.$businessTool.listUnit().then((res) => (this.unitOptions = res))
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,111 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="所属工会">
|
||||
<el-select v-model="pageForm.unionId" placeholder="请选择分工会"
|
||||
clearable style="width: 100%" @change="flushUnits">
|
||||
<el-option v-for="item in unionOptions" :key="item.id" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
|
||||
</search-item>
|
||||
<search-item label="所属单位">
|
||||
<el-select placeholder="所属单位" v-model="pageForm.unitId"
|
||||
style="width: 100%;"
|
||||
clearable
|
||||
filterable>
|
||||
<el-option v-for="item in unitOptions" :label="item.name"
|
||||
:value="item.id"
|
||||
:key="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="教职工汇总">
|
||||
<el-button size="small" @click="doExportSummary" type="primary">
|
||||
导出汇总表
|
||||
</el-button>
|
||||
</table-tool>
|
||||
<el-table ref="table" :data="tableData" style="width: 100%" row-key="id"
|
||||
@sort-change="pageOrder" show-summary
|
||||
v-loading="tableLoading" :size="tableSize" class="vi-table">
|
||||
<el-table-column align="center" header-align="center" type="index"
|
||||
:index="indexMethod" label="序号"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
show-overflow-tooltip
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</el-card>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
unionId: '',
|
||||
unitId: '',
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'name', label: '分工会名称', sortable: true},
|
||||
{prop: 'userNum', label: '在职人数', sortable: true},
|
||||
],
|
||||
unionOptions: [],
|
||||
unitOptions: [],
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doExportSummary(){
|
||||
const {unionId, unitId} = this.pageForm
|
||||
window.open(loc() + '/doExportSummary?unionId=' + unionId + '&unitId=' + unitId)
|
||||
},
|
||||
async pageData() {
|
||||
const resp = await this.$axios.post(loc() + '/pageData', this.pageForm)
|
||||
if (resp.code === 0) {
|
||||
this.tableData = resp.data
|
||||
}
|
||||
},
|
||||
flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", null)
|
||||
this.unitList = []
|
||||
if (this.pageForm.unionId) {
|
||||
this.$businessTool.listUnit(this.pageForm.unionId).then((data) => {
|
||||
this.unitOptions = data
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.$businessTool.listUnion().then((res) => (this.unionOptions = res))
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user