Commit 503ecf16 authored by 徐俊's avatar 徐俊

xujun

parent c075e24f
...@@ -245,7 +245,7 @@ export const routes = [ ...@@ -245,7 +245,7 @@ export const routes = [
hidden: false, hidden: false,
children: [ children: [
{ path: '/timeSet/task', name: '合同书时间设置', component: () => import('@/views/timeSet/taskTimeSet/Index.vue'), meta: { title: '合同书时间设置', icon: '', noCache: true } }, { path: '/timeSet/task', name: '合同书时间设置', component: () => import('@/views/timeSet/taskTimeSet/Index.vue'), meta: { title: '合同书时间设置', icon: '', noCache: true } },
{ path: '/setting/batch', name: '申报批次设置', component: () => import('@/views/timeSet/batch/Index.vue'), meta: { title: '申报批次设置', icon: '', noCache: true } }, { path: '/setting/batch', name: '项目申报批次设置', component: () => import('@/views/timeSet/batch/Index.vue'), meta: { title: '项目申报批次设置', icon: '', noCache: true } },
{ path: '/system/evaluationStandard', name: '年度评审标准设置', component: () => import('@/views/system/evaluationStandard/index.vue'), meta: { title: '年度评审标准设置', icon: '', noCache: true } }, { path: '/system/evaluationStandard', name: '年度评审标准设置', component: () => import('@/views/system/evaluationStandard/index.vue'), meta: { title: '年度评审标准设置', icon: '', noCache: true } },
//后台 //后台
{ path: '/system/role', name: '角色管理', component: () => import('@/views/system/role/index.vue'), meta: { title: '角色管理', icon: '', noCache: true } }, { path: '/system/role', name: '角色管理', component: () => import('@/views/system/role/index.vue'), meta: { title: '角色管理', icon: '', noCache: true } },
...@@ -253,6 +253,7 @@ export const routes = [ ...@@ -253,6 +253,7 @@ export const routes = [
{ path: '/system/role/menu', name: '角色菜单管理', component: () => import('@/views/system/role/roleRight.vue'), meta: { title: '角色权限管理', icon: '', noCache: true } }, { path: '/system/role/menu', name: '角色菜单管理', component: () => import('@/views/system/role/roleRight.vue'), meta: { title: '角色权限管理', icon: '', noCache: true } },
{ path: '/system/evaluation', name: '评审表设置', component: () => import('@/views/system/evaluation/index.vue'), meta: { title: '评审表设置', icon: '', noCache: true } }, { path: '/system/evaluation', name: '评审表设置', component: () => import('@/views/system/evaluation/index.vue'), meta: { title: '评审表设置', icon: '', noCache: true } },
{ path: '/system/set', name: '系统设置', component: () => import('@/views/system/set/index.vue'), meta: { title: '系统配置', icon: '', noCache: true } }, { path: '/system/set', name: '系统设置', component: () => import('@/views/system/set/index.vue'), meta: { title: '系统配置', icon: '', noCache: true } },
{ path: '/setting/talentBatch', name: '人才申报批次设置', component: () => import('@/views/timeSet/batch/talentBatch.vue'), meta: { title: '人才申报批次设置', icon: '', noCache: true } },
] ]
}, },
{ {
......
<template>
<div class="app-content" style="height:330px;overflow:auto;">
<a-spin :spinning="loading" style="width: 100%;height: 100%;">
<a-form-model ref="formRef" :model="formData" :rules="formRules" class="from-table">
<a-row>
<a-col :span="6" class="bg-gray">
<div class="required">申报年度</div>
</a-col>
<a-col :span="6">
<a-form-model-item ref="year" prop="year">
<base-select v-model="formData.year" :type="8" :width="160" />
</a-form-model-item>
</a-col>
<a-col :span="4" class="bg-gray">
<div class="required">申报批次</div>
</a-col>
<a-col :span="8">
<a-form-model-item ref="batch" prop="batch">
<base-select v-model="formData.batch" :type="10" :width="160" />
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="6" class="bg-gray">
<div class="required">项目申报时间</div>
</a-col>
<a-col :span="18">
<a-form-model-item ref="reportRange" prop="reportRange">
<a-range-picker v-model="formData.reportRange" show-time format="YYYY-MM-DD HH:mm:ss" valueFormat="YYYY-MM-DD HH:mm:ss" @change="reportDateChange" :placeholder="['开始时间', '结束时间']" />
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="6" class="bg-gray">
<div class="required">审核时间</div>
</a-col>
<a-col :span="18">
<a-form-model-item ref="unitRange" prop="unitRange">
<a-range-picker v-model="formData.auditRange" show-time format="YYYY-MM-DD HH:mm:ss" valueFormat="YYYY-MM-DD HH:mm:ss" @change="auditDateChange" :placeholder="['开始时间', '结束时间']" />
</a-form-model-item>
</a-col>
</a-row>
<!-- <a-row>
<a-col :span="6" class="bg-gray">
<div class="required">专家审核时间</div>
</a-col>
<a-col :span="18">
<a-form-model-item ref="expertRange" prop="expertRange">
<a-range-picker v-model="formData.expertRange" show-time format="YYYY-MM-DD HH:mm:ss" valueFormat="YYYY-MM-DD HH:mm:ss" @change="expertDateChange" :placeholder="['开始时间', '结束时间']" />
</a-form-model-item>
</a-col>
</a-row> -->
<a-row>
<a-col :span="6" class="bg-gray">
<div>备注</div>
</a-col>
<a-col :span="18">
<a-form-model-item ref="remark" prop="remark">
<a-input v-model="formData.remark" style="width:450px" />
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col style="text-align: center;width:100%;">
<a-button type="primary" style="width:68px;" @click="submit">提交</a-button>
</a-col>
</a-row>
</a-form-model>
</a-spin>
</div>
</template>
<script>
import { getType } from '@/views/utils/auth'
import { isEmptyParams, checkDateRange } from '@/views/utils/common'
import moment from 'moment'
import baseSelect from '@/views/components/common/baseSelect'
export default {
name: "batchEdit",
components: {
baseSelect
},
data () {
return {
formData: {
id: null,
year: moment().format('YYYY'),
batch: '1',
timeType: 4,
reportStart: '',
reportEnd: '',
auditStart: '',
auditEnd: '',
expertStart: '',
expertEnd: '',
remark: '',
reportRange: [],
auditRange: [],
expertRange: [],
projType: null,
},
formRules: {
id: [{ required: false }],
year: { required: true, message: '请输入申报年度' },
batch: { required: true, message: '请输入申报批次' },
reportRange: [{ required: true, validator: checkDateRange, trigger: 'blur' }],
auditRange: [{ required: true, validator: checkDateRange, trigger: 'blur' }],
// prefectureRange: [{ required: true, validator: checkDateRange, trigger: 'blur' }],
// provinceRange: [{ required: true, validator: checkDateRange, trigger: 'blur' }],
expertRange: [{ required: true, validator: checkDateRange, trigger: 'blur' }],
remark: [{ required: false }]
},
loading: false,
}
},
props: {
value: {
type: String,
default: () => {
return null
}
},
},
created () {
if (this.value) {
this.loading = true
this.getBatchById()
}
},
methods: {
moment,
getBatchById () {
this.$api.batch.getBatchById({ id: this.value }).then(({ data = {} }) => {
if (data) {
this.formData.id = data.id
this.formData.year = data.year + ''
this.formData.timeType = data.timeType
this.formData.projType = null
this.formData.reportStart = data.reportStart
this.formData.reportEnd = data.reportEnd
this.formData.auditStart = data.auditStart
this.formData.auditEnd = data.auditEnd
//this.formData.expertStart = data.expertStart
//this.formData.expertEnd = data.expertEnd
this.formData.remark = data.remark
this.formData.reportRange = [data.reportStart, data.reportEnd]
this.formData.auditRange = [data.auditStart, data.auditEnd]
//this.formData.expertRange = [data.expertStart, data.expertEnd]
}
this.loading = false
}).catch(() => { this.loading = false })
},
submit () {
this.$refs.formRef.validate(valid => {
if (valid) {
this.loading = true
let pars = isEmptyParams(this.formData)
if (this.value) {
this.$api.batch.updateBatch({ ...pars }).then(({ data }) => {
if (data) {
this.$message.success('修改成功!')
this.$emit('close', 'edit')
}
}).catch(() => { this.loading = false })
} else {
this.$api.batch.addBatch({ ...pars }).then(({ data }) => {
if (data) {
this.$message.success('添加成功!')
this.$emit('close', 'edit')
}
}).catch(() => { this.loading = false })
}
}
})
},
//起止日期选择处理
reportDateChange (dates, dateStrings) {
if (dateStrings[0] != '' && dateStrings[1] != '') {
this.formData.reportStart = dateStrings[0]
this.formData.reportEnd = dateStrings[1]
}
},
auditDateChange (dates, dateStrings) {
if (dateStrings[0] != '' && dateStrings[1] != '') {
this.formData.auditStart = dateStrings[0]
this.formData.auditEnd = dateStrings[1]
}
},
expertDateChange (dates, dateStrings) {
if (dateStrings[0] != '' && dateStrings[1] != '') {
this.formData.expertStart = dateStrings[0]
this.formData.expertEnd = dateStrings[1]
}
},
}
}
</script>
\ No newline at end of file
<template>
<div class="app-content">
<a-form :form="form" :model="searchForm" layout="inline" class="search_form">
<a-form-item>
<a-button type="primary" class="search_input" style="margin-right: 10px;" @click="createBatch">添加</a-button>
<a-button type="primary" @click="search">刷新</a-button>
</a-form-item>
</a-form>
<a-table :dataSource="tableData" :columns="columns" rowKey="id" :pagination="false" :loading="loading" bordered>
<template slot="option" slot-scope="record">
<a-button type="link" size="small" @click="recordClick(record,'edit')">修改</a-button>&nbsp;
<a-button type="link" size="small" @click="recordClick(record,'delete')">删除</a-button>
</template>
</a-table>
<a-pagination v-if="pagination.total > 0" :total="pagination.total" show-size-changer show-quick-jumper v-model="pagination.pageIndex" :page-size="pagination.pageSize" :page-size-options="pagination.pageSizeOptions" @showSizeChange="showSizeChange" @change="change" :showTotal="() => `共 ${pagination.total} 条`" />
<a-modal :visible="visibleEdit" v-model="visibleEdit" :title="'添加/修改'" :footer="null" :maskClosable="false" :dialog-style="{ top: '15%' }" :width="800" destroyOnClose>
<talent-batch-edit v-model="id" @close="closeWindow" ref="childEdit" />
</a-modal>
</div>
</template>
<script>
import talentBatchEdit from '@/views/timeSet/batch/components/talentBatchEdit'
import moment from 'moment'
import { isEmptyParams} from "@/views/utils/common"
export default {
name: 'talentBatch',
components: { talentBatchEdit },
data () {
return {
searchForm: { timeType: 4, },
form: this.$form.createForm(this, { name: 'advanced_search' }),
tableData: [],
columns: [
{ key: '1', title: '申报年度', dataIndex: 'year', align: 'center' },
{ key: '2', title: '批次', dataIndex: 'batch', align: 'center' },
{ key: '3', title: '项目申报时间', dataIndex: 'reportStart', colSpan: 2, ellipsis: true },
{ key: '4', title: '项目申报时间', dataIndex: 'reportEnd', colSpan: 0, ellipsis: true },
{ key: '5', title: '审核时间', dataIndex: 'auditStart', colSpan: 2, ellipsis: true },
{ key: '6', title: '审核时间', dataIndex: 'auditEnd', colSpan: 0, ellipsis: true },
// { key: '11', title: '专家评审时间', dataIndex: 'expertStart', colSpan: 2, ellipsis: true },
// { key: '12', title: '专家评审时间', dataIndex: 'expertEnd', colSpan: 0, ellipsis: true },
{ key: '13', title: '备注', dataIndex: 'remark', align: 'center', ellipsis: true },
{ key: '14', title: '操作', scopedSlots: { customRender: 'option' }, align: 'center', fixed: 'right', width: 120, },
],
pagination: { pageIndex: 1, pageSize: this.$defaultPageSize, total: 0, pageSizeOptions: this.$defaultPageSizeOptions, },
// 弹窗标志
visibleEdit: false,
id: null,
loading: false,
}
},
created () {
this.getListByPage()
},
computed: {
},
methods: {
moment,
getListByPage () {
this.loading = true
let pars = isEmptyParams(this.searchForm)
let par = { ...pars, pageIndex: this.pagination.pageIndex, pageSize: this.pagination.pageSize }
this.$api.batch.getListByPage(par).then(({ data = {} }) => {
if (data) {
const { dataList = [], total = 0 } = data
this.tableData = dataList
this.pagination.total = total
this.loading = false
}
}).catch(() => { this.loading = false })
},
search () {
this.pagination.pageIndex = 1
this.getListByPage()
},
reset () {
this.pagination.pageIndex = 1
this.getListByPage()
},
change () {
this.getListByPage()
},
showSizeChange (current, pageSize) {
this.pagination.pageIndex = current
this.pagination.pageSize = pageSize
this.getListByPage()
},
createBatch () {
this.id = null
this.visibleEdit = true
},
recordClick (record, type) {
if (type === 'edit') {
this.id = record.id
this.visibleEdit = true
} else if (type === 'delete') {
let self = this
this.$confirm({
title: '',
content: '确定要删除该批次?',
okText: '确定',
okType: 'danger',
cancelText: '取消',
onOk () {
let pars = { id: record.id }
self.$api.batch.deleteBatch(pars).then(({ data = {} }) => {
if (data) {
self.getListByPage()
}
})
},
onCancel () {
},
})
}
},
closeWindow () {
this.visibleEdit = false
this.getListByPage()
}
},
watch: {
$route () {
}
}
}
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment