|
@@ -0,0 +1,230 @@
|
|
|
|
+<template>
|
|
|
|
+ <div id="list-frame">
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="24" class="main">
|
|
|
|
+ <el-col :span="24" class="one">
|
|
|
|
+ <data-table
|
|
|
|
+ :fields="fields"
|
|
|
|
+ :opera="opera"
|
|
|
|
+ :total="total"
|
|
|
|
+ :data="list"
|
|
|
|
+ @query="search"
|
|
|
|
+ @toView="toView"
|
|
|
|
+ @toCheck="toCheck"
|
|
|
|
+ >
|
|
|
|
+ <template #custom="{ item, row }">
|
|
|
|
+ <template v-if="item.prop === 'status'">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="(i, index) in statusList"
|
|
|
|
+ :key="index"
|
|
|
|
+ :label="i.label"
|
|
|
|
+ :value="i.value"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </template>
|
|
|
|
+ </template>
|
|
|
|
+ </data-table>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-dialog
|
|
|
|
+ :title="dialog.title"
|
|
|
|
+ :visible.sync="dialog.show"
|
|
|
|
+ width="40%"
|
|
|
|
+ :before-close="toClose"
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ custom-class="dialog"
|
|
|
|
+ >
|
|
|
|
+ <div class="info">
|
|
|
|
+ <el-col :span="24" class="info_1">
|
|
|
|
+ <el-form :model="form" :rules="rules" ref="form" label-width="100px">
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="用户名称" prop="user_name">
|
|
|
|
+ <el-input v-model="form.user_name" disabled></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="审核状态" prop="status">
|
|
|
|
+ <el-radio-group v-model="form.status">
|
|
|
|
+ <el-radio label="2">审核通过</el-radio>
|
|
|
|
+ <el-radio label="3">审核拒绝</el-radio>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <el-form-item label="审核意见" prop="desc">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="form.desc"
|
|
|
|
+ type="textarea"
|
|
|
|
+ placeholder="请输入审核意见"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24" class="btn">
|
|
|
|
+ <el-button type="primary" size="mini" @click="onSubmit('form')"
|
|
|
|
+ >保存</el-button
|
|
|
|
+ >
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-form>
|
|
|
|
+ </el-col>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<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");
|
|
|
|
+export default {
|
|
|
|
+ name: "list-frame",
|
|
|
|
+ props: {},
|
|
|
|
+ components: { dataTable },
|
|
|
|
+ data: function () {
|
|
|
|
+ return {
|
|
|
|
+ list: [],
|
|
|
|
+ total: 0,
|
|
|
|
+ fields: [
|
|
|
|
+ { label: "用户名称", prop: "user_name", filter: true },
|
|
|
|
+ { label: "申请年度", prop: "apply_year" },
|
|
|
|
+ {
|
|
|
|
+ label: "申报状态",
|
|
|
|
+ prop: "status",
|
|
|
|
+ format: (i) =>
|
|
|
|
+ i == "0"
|
|
|
|
+ ? "草稿"
|
|
|
|
+ : i == "1"
|
|
|
|
+ ? "待审中"
|
|
|
|
+ : i == "2"
|
|
|
|
+ ? "审核通过"
|
|
|
|
+ : i == "3"
|
|
|
|
+ ? "审核拒绝"
|
|
|
|
+ : "",
|
|
|
|
+ filter: "select",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ opera: [
|
|
|
|
+ {
|
|
|
|
+ label: "查看",
|
|
|
|
+ method: "toView",
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: "绩效审核",
|
|
|
|
+ method: "toCheck",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ // 绩效审核
|
|
|
|
+ dialog: { title: "绩效审核", show: false },
|
|
|
|
+ form: {},
|
|
|
|
+ info: {},
|
|
|
|
+ rules: {
|
|
|
|
+ desc: [{ required: true, message: "请输入审核意见", trigger: "blur" }],
|
|
|
|
+ status: [
|
|
|
|
+ { required: true, message: "请选择审核状态", trigger: "change" },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ // 审核状态
|
|
|
|
+ statusList: [
|
|
|
|
+ {
|
|
|
|
+ label: "0",
|
|
|
|
+ value: "as",
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ async created() {
|
|
|
|
+ await this.search();
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ ...merits_apply(["query", "update"]),
|
|
|
|
+ async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
|
+ info.superior_id = this.user_id;
|
|
|
|
+ let res = await this.query({ skip, limit, ...info });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 查看信息
|
|
|
|
+ toView({ data }) {
|
|
|
|
+ console.log(data);
|
|
|
|
+ },
|
|
|
|
+ // 绩效审核
|
|
|
|
+ toCheck({ data }) {
|
|
|
|
+ this.$set(this, `info`, data);
|
|
|
|
+ this.$set(this, `form`, { user_name: data.user_name });
|
|
|
|
+ this.dialog = { title: "绩效审核", show: true };
|
|
|
|
+ },
|
|
|
|
+ // 保存
|
|
|
|
+ async onSubmit(formName) {
|
|
|
|
+ this.$refs[formName].validate(async (valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ let arr = { id: this.info._id, status: this.form.status };
|
|
|
|
+ let data = {
|
|
|
|
+ examine_user: this.name,
|
|
|
|
+ examine_date: moment().format("YYYY-MM-DD HH:mm:ss"),
|
|
|
|
+ desc: this.form.desc,
|
|
|
|
+ status: this.form.status,
|
|
|
|
+ };
|
|
|
|
+ let record = [...this.info.record, data];
|
|
|
|
+ arr.record = record;
|
|
|
|
+ let res = await this.update(arr);
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.$message({ type: `success`, message: res.msg });
|
|
|
|
+ this.toClose();
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: `error`,
|
|
|
|
+ message: res.msg || res.errmsg + ":" + res.details,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ console.log("error submit!!");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ // 关闭
|
|
|
|
+ toClose() {
|
|
|
|
+ this.search();
|
|
|
|
+ this.dialog = { title: "绩效审核", show: false };
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapGetters(["user_id", "name"]),
|
|
|
|
+ },
|
|
|
|
+ metaInfo() {
|
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
|
+ },
|
|
|
|
+ watch: {
|
|
|
|
+ test: {
|
|
|
|
+ deep: true,
|
|
|
|
+ immediate: true,
|
|
|
|
+ handler(val) {},
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="less" scoped>
|
|
|
|
+.main {
|
|
|
|
+ padding: 25px 30px 30px;
|
|
|
|
+}
|
|
|
|
+.dialog {
|
|
|
|
+ .info {
|
|
|
|
+ min-height: 150px;
|
|
|
|
+ max-height: 430px;
|
|
|
|
+ overflow-y: auto;
|
|
|
|
+ .info_1 {
|
|
|
|
+ .btn {
|
|
|
|
+ text-align: center;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+/deep/.el-dialog__body {
|
|
|
|
+ padding: 10px;
|
|
|
|
+}
|
|
|
|
+</style>
|