xuqiang 4 лет назад
Родитель
Сommit
21992327c1

+ 147 - 0
src/main/vue/src/components/ArrangeLog.vue

@@ -0,0 +1,147 @@
+<template>
+    <el-dialog
+        v-loading="saving"
+        @close="closeDialog"
+        title="备案管理信息"
+        center
+        :visible.sync="dialogVisible"
+        width="800px"
+    >
+        <div class="edit-view">
+            <el-form
+                :model="formData"
+                :rules="rules"
+                ref="form"
+                label-width="80px"
+                label-position="right"
+                size="small"
+                style="max-width: 500px;"
+            >
+                <el-form-item prop="securityOwner" label="编导姓名">
+                    <el-input
+                        v-model="formData.writerDirector"
+                        suffix-icon="el-icon-user-solid"
+                        class="input1"
+                        placeholder="编导姓名"
+                    ></el-input>
+                </el-form-item>
+                <el-form-item prop="securityOwnerPhone" label="联系电话">
+                    <el-input
+                        v-model="formData.phone"
+                        suffix-icon="el-icon-phone"
+                        class="input1"
+                        placeholder="联系电话"
+                    ></el-input>
+                </el-form-item>
+                <el-form-item>
+                    <el-button @click="onSave" :loading="saving" type="primary">保存</el-button>
+                    <el-button @click="onDelete" :loading="saving" type="danger" v-if="formData.id">删除 </el-button>
+                    <el-button @click="dialogVisible = false">取消</el-button>
+                </el-form-item>
+            </el-form>
+        </div>
+    </el-dialog>
+</template>
+<script>
+export default {
+    props: ['dialogVisible'],
+    data() {
+        return {
+            saving: false,
+            showMore: false,
+            formData: {},
+            rules: {},
+            timeRange: '',
+            optionProps: {
+                value: 'id',
+                label: 'name',
+                children: 'children',
+                multiple: true,
+                emitPath: false,
+                checkStrictly: true,
+                expandTrigger: 'hover'
+            },
+            artTypes: []
+        };
+    },
+    methods: {
+        onSave() {
+            this.$refs.form.validate(valid => {
+                if (valid) {
+                    this.submit();
+                } else {
+                    return false;
+                }
+            });
+        },
+        closeDialog() {
+            this.$emit('close');
+        },
+        init(id) {
+            if (id) {
+                this.$http
+                    .get('arrange/get/' + id)
+                    .then(res => {
+                        this.formData = res;
+                        this.timeRange = [res.startTime, res.endTime];
+                    })
+                    .catch(e => {
+                        console.log(e);
+                        this.$message.error(e.error);
+                    });
+            }
+            this.$http
+                .post('/artType/allList')
+                .then(res => {
+                    this.artTypes = this.delChild(res);
+                })
+                .catch(e => {
+                    console.log(e);
+                });
+        },
+        submit() {
+            let data = { ...this.formData };
+
+            this.saving = true;
+            this.$http
+                .post('/arrange/save', data, { body: 'json' })
+                .then(res => {
+                    this.saving = false;
+                    this.$message.success('成功');
+                    // this.$router.go(-1);
+                    this.dialogVisible = false;
+                })
+                .catch(e => {
+                    console.log(e);
+                    this.saving = false;
+                    this.$message.error(e.error);
+                });
+        },
+        onDelete() {
+            this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
+                .then(() => {
+                    return this.$http.post(`/arrange/del/${this.formData.id}`);
+                })
+                .then(() => {
+                    this.$message.success('删除成功');
+                    this.$router.go(-1);
+                })
+                .catch(e => {
+                    if (e !== 'cancel') {
+                        console.log(e);
+                        this.$message.error((e || {}).error || '删除失败');
+                    }
+                });
+        }
+    }
+};
+</script>
+<style lang="less" scoped>
+.width {
+    width: 350px;
+}
+/deep/.el-input.is-disabled .el-input__inner {
+    background-color: #ffffff;
+    color: #606266;
+}
+</style>

+ 6 - 6
src/main/vue/src/views/performance/ArrangeList.vue

@@ -288,22 +288,26 @@
                 <el-table-column prop="examPoint" label="考级点"> </el-table-column>
             </el-table>
         </el-dialog>
+        <arrange-log :dialogVisible="isShow" @close="isShow = false" ref="public"></arrange-log>
     </div>
 </template>
 <script>
 import { mapState } from 'vuex';
 import pageableTable from '@/mixins/pageableTable';
+import ArrangeLog from '../../components/ArrangeLog';
 import { time } from 'echarts';
 import delChild from '@/mixins/delChild';
 
 export default {
     name: 'ArrangeList',
     mixins: [pageableTable, delChild],
+    components: { ArrangeLog },
     data() {
         return {
             showMore: false,
             multipleMode: false,
             search: '',
+            isShow: false,
             url: '/arrange/all',
             downloading: false,
             form: {},
@@ -472,12 +476,8 @@ export default {
             });
         },
         editRow(row) {
-            this.$router.push({
-                path: '/arrangeEdit',
-                query: {
-                    id: row.id
-                }
-            });
+            this.isShow = true;
+            this.$refs.public.init(row.id);
         },
         programme(row) {
             this.$router.push({