|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<div id="list-frame">
|
|
<div id="list-frame">
|
|
- <el-row>
|
|
|
|
|
|
+ <el-row v-if="view==='list'">
|
|
<el-col :span="24" class="main">
|
|
<el-col :span="24" class="main">
|
|
<el-col :span="24" class="one">
|
|
<el-col :span="24" class="one">
|
|
<data-table
|
|
<data-table
|
|
@@ -16,16 +16,28 @@
|
|
<template v-if="item.prop === 'status'">
|
|
<template v-if="item.prop === 'status'">
|
|
<el-option
|
|
<el-option
|
|
v-for="(i, index) in statusList"
|
|
v-for="(i, index) in statusList"
|
|
|
|
+ :key="index"
|
|
:label="i.label"
|
|
:label="i.label"
|
|
:value="i.value"
|
|
:value="i.value"
|
|
- :key="index"
|
|
|
|
- ></el-option>
|
|
|
|
|
|
+ />
|
|
</template>
|
|
</template>
|
|
</template>
|
|
</template>
|
|
</data-table>
|
|
</data-table>
|
|
</el-col>
|
|
</el-col>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
+ <el-row v-else>
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <el-button type="primary" plain icon="el-icon-back" size="mini" @click="toBack">返回</el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <achieve-view :info="viewData" />
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
<el-dialog
|
|
<el-dialog
|
|
:title="dialog.title"
|
|
:title="dialog.title"
|
|
:visible.sync="dialog.show"
|
|
:visible.sync="dialog.show"
|
|
@@ -36,10 +48,10 @@
|
|
>
|
|
>
|
|
<div class="info">
|
|
<div class="info">
|
|
<el-col :span="24" class="info_1">
|
|
<el-col :span="24" class="info_1">
|
|
- <el-form :model="form" :rules="rules" ref="form" label-width="100px">
|
|
|
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item label="用户名称" prop="user_name">
|
|
<el-form-item label="用户名称" prop="user_name">
|
|
- <el-input v-model="form.user_name" disabled></el-input>
|
|
|
|
|
|
+ <el-input v-model="form.user_name" disabled />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
@@ -52,17 +64,11 @@
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
<el-form-item label="审核意见" prop="desc">
|
|
<el-form-item label="审核意见" prop="desc">
|
|
- <el-input
|
|
|
|
- v-model="form.desc"
|
|
|
|
- type="textarea"
|
|
|
|
- placeholder="请输入审核意见"
|
|
|
|
- ></el-input>
|
|
|
|
|
|
+ <el-input v-model="form.desc" type="textarea" placeholder="请输入审核意见" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24" class="btn">
|
|
<el-col :span="24" class="btn">
|
|
- <el-button type="primary" size="mini" @click="onSubmit('form')"
|
|
|
|
- >保存</el-button
|
|
|
|
- >
|
|
|
|
|
|
+ <el-button type="primary" size="mini" @click="onSubmit('form')">保存</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
</el-form>
|
|
</el-form>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -72,139 +78,149 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import dataTable from "@/components/free/filter-page-table.vue";
|
|
|
|
-import { mapState, mapGetters, createNamespacedHelpers } from "vuex";
|
|
|
|
-const { mapActions: merits_apply } = createNamespacedHelpers("merits_apply");
|
|
|
|
-const moment = require("moment");
|
|
|
|
|
|
+import achieveView from '@/components/free/achieve-view.vue'
|
|
|
|
+import dataTable from '@/components/free/filter-page-table.vue'
|
|
|
|
+import { mapState, mapGetters, createNamespacedHelpers } from 'vuex'
|
|
|
|
+const { mapActions: merits_apply } = createNamespacedHelpers('merits_apply')
|
|
|
|
+const moment = require('moment')
|
|
|
|
+const _ = require('lodash')
|
|
export default {
|
|
export default {
|
|
- name: "list-frame",
|
|
|
|
|
|
+ name: 'ListFrame',
|
|
|
|
+ components: { dataTable, achieveView },
|
|
props: {},
|
|
props: {},
|
|
- components: { dataTable },
|
|
|
|
- data: function () {
|
|
|
|
|
|
+ data: function() {
|
|
return {
|
|
return {
|
|
|
|
+ view: 'list',
|
|
list: [],
|
|
list: [],
|
|
total: 0,
|
|
total: 0,
|
|
fields: [
|
|
fields: [
|
|
- { label: "用户名称", prop: "user_name", filter: true },
|
|
|
|
- { label: "申请年度", prop: "apply_year" },
|
|
|
|
|
|
+ { label: '用户名称', prop: 'user_name', filter: true },
|
|
|
|
+ { label: '申请年度', prop: 'apply_year' },
|
|
{
|
|
{
|
|
- label: "申报状态",
|
|
|
|
- prop: "status",
|
|
|
|
|
|
+ label: '申报状态',
|
|
|
|
+ prop: 'status',
|
|
format: (i) =>
|
|
format: (i) =>
|
|
- i == "0"
|
|
|
|
- ? "草稿"
|
|
|
|
- : i == "1"
|
|
|
|
- ? "待审中"
|
|
|
|
- : i == "2"
|
|
|
|
- ? "审核通过"
|
|
|
|
- : i == "3"
|
|
|
|
- ? "审核拒绝"
|
|
|
|
- : "",
|
|
|
|
- filter: "select",
|
|
|
|
- },
|
|
|
|
|
|
+ i == '0'
|
|
|
|
+ ? '草稿'
|
|
|
|
+ : i == '1'
|
|
|
|
+ ? '待审中'
|
|
|
|
+ : i == '2'
|
|
|
|
+ ? '审核通过'
|
|
|
|
+ : i == '3'
|
|
|
|
+ ? '审核拒绝'
|
|
|
|
+ : '',
|
|
|
|
+ filter: 'select'
|
|
|
|
+ }
|
|
],
|
|
],
|
|
opera: [
|
|
opera: [
|
|
{
|
|
{
|
|
- label: "查看",
|
|
|
|
- method: "toView",
|
|
|
|
|
|
+ label: '查看',
|
|
|
|
+ method: 'toView'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- label: "绩效审核",
|
|
|
|
- method: "toCheck",
|
|
|
|
- display: (i) => i.status == "1",
|
|
|
|
- },
|
|
|
|
|
|
+ label: '绩效审核',
|
|
|
|
+ method: 'toCheck',
|
|
|
|
+ display: (i) => i.status == '1'
|
|
|
|
+ }
|
|
],
|
|
],
|
|
// 绩效审核
|
|
// 绩效审核
|
|
- dialog: { title: "绩效审核", show: false },
|
|
|
|
|
|
+ dialog: { title: '绩效审核', show: false },
|
|
form: {},
|
|
form: {},
|
|
info: {},
|
|
info: {},
|
|
rules: {
|
|
rules: {
|
|
- desc: [{ required: true, message: "请输入审核意见", trigger: "blur" }],
|
|
|
|
|
|
+ desc: [{ required: true, message: '请输入审核意见', trigger: 'blur' }],
|
|
status: [
|
|
status: [
|
|
- { required: true, message: "请选择审核状态", trigger: "change" },
|
|
|
|
- ],
|
|
|
|
|
|
+ { required: true, message: '请选择审核状态', trigger: 'change' }
|
|
|
|
+ ]
|
|
},
|
|
},
|
|
// 审核状态
|
|
// 审核状态
|
|
statusList: [
|
|
statusList: [
|
|
- { label: "待审中", value: "1" },
|
|
|
|
- { label: "审核通过", value: "2" },
|
|
|
|
- { label: "审核拒绝", value: "3" },
|
|
|
|
|
|
+ { label: '待审中', value: '1' },
|
|
|
|
+ { label: '审核通过', value: '2' },
|
|
|
|
+ { label: '审核拒绝', value: '3' }
|
|
],
|
|
],
|
|
- };
|
|
|
|
|
|
+ // 查看
|
|
|
|
+ viewData: {}
|
|
|
|
+ }
|
|
},
|
|
},
|
|
async created() {
|
|
async created() {
|
|
- await this.search();
|
|
|
|
|
|
+ await this.search()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- ...merits_apply(["query", "update"]),
|
|
|
|
|
|
+ ...merits_apply(['query', 'update']),
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
- info.superior_id = this.user_id;
|
|
|
|
- let res = await this.query({ skip, limit, ...info });
|
|
|
|
|
|
+ info.superior_id = this.user_id
|
|
|
|
+ const res = await this.query({ skip, limit, ...info })
|
|
if (this.$checkRes(res)) {
|
|
if (this.$checkRes(res)) {
|
|
- this.$set(this, `list`, res.data);
|
|
|
|
- this.$set(this, `total`, res.total);
|
|
|
|
|
|
+ this.$set(this, `list`, res.data)
|
|
|
|
+ this.$set(this, `total`, res.total)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
// 查看信息
|
|
// 查看信息
|
|
toView({ data }) {
|
|
toView({ data }) {
|
|
- console.log(data);
|
|
|
|
|
|
+ this.$set(this, `viewData`, _.cloneDeep(data))
|
|
|
|
+ this.view = 'detail'
|
|
},
|
|
},
|
|
// 绩效审核
|
|
// 绩效审核
|
|
toCheck({ data }) {
|
|
toCheck({ data }) {
|
|
- this.$set(this, `info`, data);
|
|
|
|
- this.$set(this, `form`, { user_name: data.user_name });
|
|
|
|
- this.dialog = { title: "绩效审核", show: true };
|
|
|
|
|
|
+ this.$set(this, `info`, data)
|
|
|
|
+ this.$set(this, `form`, { user_name: data.user_name })
|
|
|
|
+ this.dialog = { title: '绩效审核', show: true }
|
|
},
|
|
},
|
|
// 保存
|
|
// 保存
|
|
async onSubmit(formName) {
|
|
async onSubmit(formName) {
|
|
- this.$refs[formName].validate(async (valid) => {
|
|
|
|
|
|
+ this.$refs[formName].validate(async(valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- let arr = { id: this.info._id, status: this.form.status };
|
|
|
|
- let data = {
|
|
|
|
|
|
+ const arr = { id: this.info._id, status: this.form.status }
|
|
|
|
+ const data = {
|
|
examine_user: this.name,
|
|
examine_user: this.name,
|
|
- examine_date: moment().format("YYYY-MM-DD HH:mm:ss"),
|
|
|
|
|
|
+ examine_date: moment().format('YYYY-MM-DD HH:mm:ss'),
|
|
desc: this.form.desc,
|
|
desc: this.form.desc,
|
|
- status: this.form.status,
|
|
|
|
- };
|
|
|
|
- let record = [...this.info.record, data];
|
|
|
|
- arr.record = record;
|
|
|
|
- let res = await this.update(arr);
|
|
|
|
|
|
+ status: this.form.status
|
|
|
|
+ }
|
|
|
|
+ const record = [...this.info.record, data]
|
|
|
|
+ arr.record = record
|
|
|
|
+ const res = await this.update(arr)
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
- this.$message({ type: `success`, message: res.msg });
|
|
|
|
- this.toClose();
|
|
|
|
|
|
+ this.$message({ type: `success`, message: res.msg })
|
|
|
|
+ this.toClose()
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
type: `error`,
|
|
type: `error`,
|
|
- message: res.msg || res.errmsg + ":" + res.details,
|
|
|
|
- });
|
|
|
|
|
|
+ message: res.msg || res.errmsg + ':' + res.details
|
|
|
|
+ })
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- console.log("error submit!!");
|
|
|
|
- return false;
|
|
|
|
|
|
+ console.log('error submit!!')
|
|
|
|
+ return false
|
|
}
|
|
}
|
|
- });
|
|
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 关闭
|
|
// 关闭
|
|
toClose() {
|
|
toClose() {
|
|
- this.search();
|
|
|
|
- this.dialog = { title: "绩效审核", show: false };
|
|
|
|
|
|
+ this.search()
|
|
|
|
+ this.dialog = { title: '绩效审核', show: false }
|
|
},
|
|
},
|
|
|
|
+ toBack() {
|
|
|
|
+ this.view = 'list'
|
|
|
|
+ this.viewData = {}
|
|
|
|
+ }
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
- ...mapGetters(["user_id", "name"]),
|
|
|
|
|
|
+ ...mapGetters(['user_id', 'name'])
|
|
},
|
|
},
|
|
metaInfo() {
|
|
metaInfo() {
|
|
- return { title: this.$route.meta.title };
|
|
|
|
|
|
+ return { title: this.$route.meta.title }
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
test: {
|
|
test: {
|
|
deep: true,
|
|
deep: true,
|
|
immediate: true,
|
|
immediate: true,
|
|
- handler(val) {},
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
-};
|
|
|
|
|
|
+ handler(val) { }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|