|
@@ -0,0 +1,91 @@
|
|
|
|
+<template>
|
|
|
|
+ <div id="detail">
|
|
|
|
+ <list-frame :title="pageTitle" returns="./index" :needFilter="false" :needAdd="false">
|
|
|
|
+ <data-table :fields="fields" :data="list" :opera="opera" @namelist="toNamelist"></data-table>
|
|
|
|
+ </list-frame>
|
|
|
|
+ <el-dialog :visible.sync="dialog" title="上传名单" width="30%">
|
|
|
|
+ <el-form size="mini">
|
|
|
|
+ <el-form-item label="期数">{{ form.termnum }}</el-form-item>
|
|
|
|
+ <el-form-item label="人数">{{ form.number }}</el-form-item>
|
|
|
|
+ <el-form-item label="上传名单">
|
|
|
|
+ <el-upload class="upload-demo" action="/files/train/upload" :on-success="handleSuccess">
|
|
|
|
+ <el-button size="small" type="primary">点击上传</el-button>
|
|
|
|
+ <div slot="tip" class="el-upload__tip">不超过500kb</div>
|
|
|
|
+ </el-upload>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import listFrame from '@frame/layout/admin/list-frame';
|
|
|
|
+import dataTable from '@frame/components/data-table';
|
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
|
+const { mapActions: schPlan } = createNamespacedHelpers('schPlan');
|
|
|
|
+const { mapActions: util } = createNamespacedHelpers('util');
|
|
|
|
+const { mapActions: imports } = createNamespacedHelpers('schimport');
|
|
|
|
+export default {
|
|
|
|
+ name: 'detail',
|
|
|
|
+ props: {},
|
|
|
|
+ components: { listFrame, dataTable },
|
|
|
|
+ data: function() {
|
|
|
|
+ return {
|
|
|
|
+ dialog: false,
|
|
|
|
+ info: {},
|
|
|
|
+ form: {},
|
|
|
|
+ list: [],
|
|
|
|
+ fields: [
|
|
|
|
+ { label: '期数', prop: 'termnum' },
|
|
|
|
+ { label: '人数', prop: 'number' },
|
|
|
|
+ { label: '需求车辆', prop: 'carnum' },
|
|
|
|
+ ],
|
|
|
|
+ opera: [
|
|
|
|
+ {
|
|
|
|
+ label: '上报名单',
|
|
|
|
+ icon: 'el-icon-document',
|
|
|
|
+ method: 'namelist',
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ this.search();
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ ...imports(['create']),
|
|
|
|
+ ...schPlan(['update']),
|
|
|
|
+ ...util(['fetch']),
|
|
|
|
+ async search() {
|
|
|
|
+ let res = await this.fetch({ model: 'schtime', planid: this.id, schid: this.user.code });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ let { term } = res.data;
|
|
|
|
+ this.$set(this, `info`, res.data);
|
|
|
|
+ this.$set(this, `list`, term);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ toNamelist({ data }) {
|
|
|
|
+ this.$set(this, `form`, JSON.parse(JSON.stringify(data)));
|
|
|
|
+ this.dialog = true;
|
|
|
|
+ },
|
|
|
|
+ async handleSuccess(file, fileList) {
|
|
|
|
+ let res = await this.create({ filepath: file.uri, termid: this.form.termid, schid: this.user.code });
|
|
|
|
+ if (this.$checkRes(res, '上传成功', res.errmsg || '上传失败')) this.dialog = false;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapState(['user']),
|
|
|
|
+ pageTitle() {
|
|
|
|
+ return `${this.$route.meta.title}`;
|
|
|
|
+ },
|
|
|
|
+ id() {
|
|
|
|
+ return this.$route.query.id;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ metaInfo() {
|
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="less" scoped></style>
|