Bladeren bron

会议管理

yanliming 4 jaren geleden
bovenliggende
commit
c101cf0aba

+ 46 - 0
src/api/base/address.js

@@ -0,0 +1,46 @@
+import request from '@/utils/request'
+import constant from '@/constant'
+
+function pageList(formData){
+  return request.post(constant.serverUrl + "/base/addressInfo/pageList", formData);
+}
+
+function create(){
+  return request.get(constant.serverUrl + "/base/addressInfo/create");
+}
+
+function edit(id){
+  return request.get(constant.serverUrl + "/base/addressInfo/edit/" + id);
+}
+
+function add(formModel){
+  return request.post(constant.serverUrl + "/base/addressInfo/add", formModel,{
+    headers: {
+      "Content-Type": "application/json"
+    }
+  });
+}
+
+function update(formModel){  
+  return request.post(constant.serverUrl + "/base/addressInfo/update", formModel,{
+    headers: {
+      "Content-Type": "application/json"
+    }
+  });
+}
+
+function remove(id){
+  return request.post(constant.serverUrl + "/base/addressInfo/delete/" + id);
+}
+
+function batchRemove(idList){
+  return request.post(constant.serverUrl + "/base/addressInfo/batchDelete",idList,{
+    headers: {
+      "Content-Type": "application/json"
+    }
+  });
+}
+
+export default {
+  pageList,create,edit,add,update,remove,batchRemove
+}

+ 12 - 0
src/routers/modules/base.js

@@ -749,6 +749,18 @@ var routers = [
                         title: '会议管理'
                 }
         },
+        {
+                path: '/base/addressInfo/list',
+                name: 'baseAddressInfoList',
+                // route level code-splitting
+                // this generates a separate chunk (about.[hash].js) for this route
+                // which is lazy-loaded when the route is visited.
+                component: () => import('@/views/base/addressInfo-list.vue'),
+                meta: {
+                        roles: ["admin"],
+                        title: '会议地址管理'
+                }
+        },
 
 ]
 

+ 139 - 0
src/views/base/addressInfo-detail.vue

@@ -0,0 +1,139 @@
+
+<style scoped>
+.user-panel {
+  margin: 10px auto;
+}
+</style>
+<template>
+  <el-dialog
+    :visible.sync="showDialog"
+    :title="title"
+    :modal-append-to-body="false"
+    style="text-align: left"
+    @close="closeDialog"
+    :close-on-click-modal="false"
+    width="600px"
+  >
+    <div class="user-panel" v-loading="loading">
+      <el-form
+        ref="form"
+        :model="formModel"
+        :rules="ruleValidate"
+        :label-width="'150px'"
+      >
+        <el-form-item label="会议地点名称" prop="name">
+          <el-input
+            v-model="formModel.name"
+            placeholder="请输入会议地点名称"
+            style="width: 300px"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="可容纳人数" prop="capacity">
+          <el-input
+            v-model="formModel.capacity"
+            placeholder="请输入可容纳人数"
+            style="width: 300px"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="详细地址" prop="detailedAddress">
+          <el-input
+            v-model="formModel.detailedAddress"
+            placeholder="请输入详细地址"
+            style="width: 300px"
+          ></el-input>
+        </el-form-item>
+      </el-form>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="closeDialog">取 消</el-button>
+      <el-button type="primary" @click="handleSubmit" :loading="submitting"
+        >确 定</el-button
+      >
+    </span>
+  </el-dialog>
+</template>
+<script>
+import Constant from "@/constant";
+import addressInfoApi from "@/api/base/address";
+import NProgress from "nprogress"; // progress bar
+import "nprogress/nprogress.css"; // progress bar style
+
+export default {
+  props: ["businessKey", "title"],
+  data() {
+    return {
+      formModel: {},
+      ruleValidate: {
+        name: [{ required: true, message: "会议地点名称不能为空", trigger: "blur" }],
+      },
+      showDialog: true,
+      loading: false,
+      submitting: false,
+    };
+  },
+  methods: {
+    closeDialog() {
+      this.$emit("close", false);
+    },
+    handleSubmit() {
+      var self = this;
+
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          (function () {
+            var id = self.formModel.id;
+
+            if (id == null || id.length == 0) {
+              return addressInfoApi.add(self.formModel);
+            } else {
+              return addressInfoApi.update(self.formModel);
+            }
+          })().then(function (response) {
+            var jsonData = response.data;
+
+            if (jsonData.result) {
+              self.$message({
+                message: "保存成功!",
+                type: "success",
+              });
+
+              self.$emit("close", true);
+            } else {
+              self.$message({
+                message: jsonData.message + "",
+                type: "warning",
+              });
+
+              self.$emit("close", false);
+            }
+          });
+        }
+      });
+    },
+  },
+  mounted: function () {
+    var self = this;
+
+    (function () {
+      if (self.businessKey.length == 0) {
+        return addressInfoApi.create();
+      } else {
+        return addressInfoApi.edit(self.businessKey);
+      }
+    })()
+      .then((response) => {
+        var jsonData = response.data;
+        self.loading = false;
+
+        if (jsonData.result) {
+          self.formModel = jsonData.data;
+        } else {
+          self.$message.error(jsonData.message + "");
+        }
+      })
+      .catch((error) => {
+        self.$message.error(error + "");
+      });
+  },
+};
+</script>

+ 292 - 0
src/views/base/addressInfo-list.vue

@@ -0,0 +1,292 @@
+<template>
+  <div>
+    <el-breadcrumb separator=">">
+      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
+      <el-breadcrumb-item>
+        <a href="#">基础信息管理</a>
+      </el-breadcrumb-item>
+      <el-breadcrumb-item>
+        <a href="/base/addressInfo">会议地址管理</a>
+      </el-breadcrumb-item>
+    </el-breadcrumb>
+    <el-divider></el-divider>
+    <!--
+      要resetFields起作用,必须配置:model和prop
+    -->
+    <el-form
+      ref="queryForm"
+      :model="queryModel"
+      inline
+      class="demo-form-inline"
+    >
+      <el-form-item label="会议地点名称" prop="title">
+        <el-input type="text" size="mini" v-model="queryModel.name"></el-input>
+      </el-form-item>
+      <el-form-item>
+        <el-button
+          type="primary"
+          size="mini"
+          icon="ios-search"
+          @click="changePage(1)"
+          :loading="loading"
+          >查询</el-button
+        >&nbsp;
+        <el-button
+          type="info"
+          size="mini"
+          style="margin-left: 8px"
+          @click="handleReset('queryForm')"
+          >重置</el-button
+        >&nbsp;
+      </el-form-item>
+    </el-form>
+    <el-divider></el-divider>
+    <el-row class="button-group">
+      <el-button
+        type="primary"
+        size="small"
+        plain
+        icon="el-icon-circle-plus"
+        @click="handleAdd"
+        >新增</el-button
+      >
+      <el-button
+        type="primary"
+        size="small"
+        plain
+        icon="el-icon-circle-plus"
+        :disabled="multipleSelection.length == 0"
+        @click="handleBatchDelete"
+        >删除选中项</el-button
+      >
+    </el-row>
+    <el-table
+      :data="tableData"
+      style="min-height: 400px"
+      v-loading="loading"
+      stripe
+      @sort-change="sortChange"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column type="selection" width="55"></el-table-column>
+      <el-table-column prop="name" label="会议地点名称" width="180"></el-table-column>
+      <el-table-column
+        prop="capacity"
+        label="可容纳分数"
+        width="180"
+      ></el-table-column>
+      <el-table-column
+        prop="detailedAddress"
+        label="详细地址"
+      ></el-table-column>
+      <el-table-column
+        prop="createTime"
+        label="创建时间"
+        width="180"
+      ></el-table-column>
+      <el-table-column
+        prop="createByN"
+        label="创建人"
+      ></el-table-column>
+      <el-table-column label="操作" fixed="right" width="200">
+        <template slot-scope="{row}">
+          <el-button size="mini" type="warning" @click="handleEdit(row)">编辑</el-button>
+          <el-button size="mini" type="danger" @click="handleDelete(row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      :current-page.sync="pageIndex"
+      :total="totalElements"
+      :page-sizes="pageSizeList"
+      @current-change="changePage"
+      @size-change="pageSizeChange"
+      layout="total, sizes, prev, pager, next, jumper"
+    ></el-pagination>
+    <addressInfo-detail
+      v-if="showModal"
+      :businessKey="businessKey"
+      :title="modalTitle"
+      @close="onDetailModalClose"
+    ></addressInfo-detail>
+  </div>
+</template>
+<script>
+import Constant from "@/constant";
+import addressInfoDetail from "./addressInfo-detail";
+import addressInfoApi from "@/api/base/address";
+import NProgress from "nprogress"; // progress bar
+import "nprogress/nprogress.css"; // progress bar style
+
+export default {
+    name:"baseAddressInfoList",
+    data() {
+    var self = this;
+
+    return {
+      queryModel: {
+        name: "",
+      },
+      loading: false,
+      tableData: [],
+      pageIndex: 1,
+      pageSize: 10,
+      totalPages: 0,
+      totalElements: 0,
+      field: "",
+      direction: "",
+      pageSizeList: [10, 20, 30],
+      multipleSelection: [],
+      showModal: false,
+      modalTitle: "",
+      businessKey: "",
+    };
+  },
+  methods: {
+    changePage(pageIndex) {
+      var self = this;
+
+      self.loading = true;
+
+      self.pageIndex = pageIndex;
+      var formData = new FormData();
+
+      formData.append("pageIndex", self.pageIndex);
+      formData.append("pageSize", self.pageSize);
+
+      formData.append("name", self.queryModel.name);
+
+      addressInfoApi
+        .pageList(formData)
+        .then(function (response) {
+          self.loading = false;
+
+          var jsonData = response.data.data;
+
+          self.tableData = jsonData.data;
+          self.totalPages = jsonData.totalPages;
+          self.totalElements = jsonData.recordsTotal;
+        })
+        .catch((error) => {
+          self.loading = false;
+          // self.$message.error(error + "");
+        });
+    },
+    pageSizeChange(pageSize) {
+      this.pageSize = pageSize;
+
+      this.$nextTick(() => {
+        this.changePage(this.pageIndex);
+      });
+    },
+    sortChange(data) {
+      this.field = data.column.field;
+      this.direction = data.order == "ascending" ? "asc" : "desc";
+
+      this.changePage(this.pageIndex);
+    },
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
+    handleReset(name) {
+      this.$refs[name].resetFields();
+    },
+    handleAdd() {
+      this.modalTitle = "新增";
+      this.businessKey = "";
+      this.showModal = true;
+    },
+    handleEdit(record) {
+      this.modalTitle = "编辑";
+      this.businessKey = record.id;
+      this.showModal = true;
+    },
+    handleDelete(record) {
+      var self = this;
+
+      self
+        .$confirm("是否确认删除?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        })
+        .then(() => {
+          addressInfoApi.remove(record.id).then(function (response) {
+            var jsonData = response.data;
+
+            if (jsonData.result) {
+              // var index = self.tableData.indexOf(record);
+              // self.tableData.splice(index, 1);
+              self.changePage(self.pageIndex);
+
+              self.$message({
+                type: "success",
+                message: "删除成功!",
+              });
+            }
+          });
+        });
+    },
+    handleBatchDelete() {
+      var self = this;
+
+      var idList = this.multipleSelection.map((record) => {
+        return record.id;
+      });
+
+      this.$confirm("是否确认删除选中项?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        addressInfoApi.batchRemove(idList).then(function (response) {
+          var jsonData = response.data;
+
+          if (jsonData.result) {
+            self.changePage(self.pageIndex);
+
+            self.$message({
+              type: "success",
+              message: "删除成功!",
+            });
+          }
+        });
+      });
+    },
+    onDetailModalClose(refreshed) {
+      //保存成功后回调
+      this.showModal = false;
+
+      if (refreshed) {
+        this.changePage(this.pageIndex);
+      }
+    },
+  },
+  mounted: function () {
+    this.changePage(1);
+  },
+  components: {
+    "addressInfo-detail": addressInfoDetail,
+  },
+};
+</script>
+<style lang="scss" scoped>
+.el-breadcrumb {
+  margin: 10px;
+  line-height: 20px;
+}
+
+.el-divider {
+  margin: 5px 0;
+}
+
+.demo-form-inline {
+  margin-left: 10px;
+  text-align: left;
+}
+
+.button-group {
+  margin-left: 10px;
+  text-align: left;
+}
+</style>

+ 213 - 0
src/views/base/meetingInfo-detail.vue

@@ -0,0 +1,213 @@
+
+<style scoped>
+.user-panel {
+  margin: 10px auto;
+}
+</style>
+<template>
+  <el-dialog
+    :visible.sync="showDialog"
+    :title="title"
+    :modal-append-to-body="false"
+    style="text-align: left"
+    @close="closeDialog"
+    :close-on-click-modal="false"
+    width="950px"
+  >
+    <div class="user-panel" v-loading="loading">
+      <el-form
+        ref="form"
+        :model="formModel"
+        :rules="ruleValidate"
+        :label-width="'100px'"
+        :inline="true" 
+        class="demo-form-inline"
+      >
+        <el-form-item label="会议编号" prop="number">
+          <el-input
+            v-model="formModel.number"
+            placeholder="请输入会议编号"
+            style="width: 300px"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="会议名称" prop="name">
+          <el-input
+            v-model="formModel.name"
+            placeholder="请输入会议名称"
+            style="width: 300px"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="会议地点" prop="addressId">
+          <el-input
+            v-model="formModel.addressId"
+            placeholder="请输入详细地址"
+            style="width: 300px"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="会议日期" prop="addressId">
+          <el-input
+            v-model="formModel.addressId"
+            placeholder="请输入详细地址"
+            style="width: 300px"
+          ></el-input>
+        </el-form-item>
+                <el-form-item label="会议内容" prop="addressId">
+          <el-input
+            v-model="formModel.addressId"
+            placeholder="请输入详细地址"
+            style="width: 300px"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="会议备注" prop="addressId">
+          <el-input
+            v-model="formModel.addressId"
+            placeholder="请输入详细地址"
+            style="width: 300px"
+          ></el-input>
+        </el-form-item>
+        <h4>会议配置</h4>
+        <el-table
+        ref="formTable"
+        :data="tableData"
+        v-loading="loading"
+        :element-loading-text="loadingText"
+        stripe
+        :height="tableHeight"
+        >
+        <el-table-column prop="number" label="序号" width="150"></el-table-column>
+        <el-table-column prop="name" label="会议日期" width="200"></el-table-column>
+        <el-table-column prop="name" label="会议时间" width="200"></el-table-column>
+        <el-table-column prop="name" label="会前签到时间" ></el-table-column>
+        <el-table-column prop="name" label="结束签到时间" ></el-table-column>
+        </el-table>
+        <el-divider></el-divider>
+        <h4>添加参会人员</h4>
+        <el-form-item label="部门" prop="number">
+          <el-input
+            v-model="formModel.number"
+            placeholder="请输入会议编号"
+            style="width: 200px"
+          ></el-input>
+        </el-form-item>
+
+        <template>
+            <el-transfer
+                filterable
+                :filter-method="filterMethod"
+                filter-placeholder="请输入城市拼音"
+                v-model="value"
+                :data="data">
+            </el-transfer>
+        </template>
+      </el-form>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="closeDialog">取 消</el-button>
+      <el-button type="primary" @click="handleSubmit" :loading="submitting"
+        >确 定</el-button
+      >
+    </span>
+  </el-dialog>
+</template>
+<script>
+import meetingInfoApi from "@/api/base/meetingInfo";
+import dataDictionaryApi from "@/api/sys/dataDictionary";
+import "nprogress/nprogress.css"; // progress bar style
+
+export default {
+  props: ["businessKey", "title"],
+  data() {
+    const generateData = _ => {
+        const data = [];
+        const cities = ['上海', '北京', '广州', '深圳', '南京', '西安', '成都'];
+        const pinyin = ['shanghai', 'beijing', 'guangzhou', 'shenzhen', 'nanjing', 'xian', 'chengdu'];
+        cities.forEach((city, index) => {
+          data.push({
+            label: city,
+            key: index,
+            pinyin: pinyin[index]
+          });
+        });
+        return data;
+    };
+
+    return {
+      data: generateData(),
+      formModel: {},
+      ruleValidate: {
+        name: [{ required: true, message: "会议地点名称不能为空", trigger: "blur" }],
+      },
+      showDialog: true,
+      loading: false,
+      submitting: false,
+    };
+  },
+  methods: {
+    closeDialog() {
+      this.$emit("close", false);
+    },
+    filterMethod(query, item) {
+        return item.pinyin.indexOf(query) > -1;
+    },
+    handleSubmit() {
+      var self = this;
+
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          (function () {
+            var id = self.formModel.id;
+
+            if (id == null || id.length == 0) {
+              return meetingInfoApi.add(self.formModel);
+            } else {
+              return meetingInfoApi.update(self.formModel);
+            }
+          })().then(function (response) {
+            var jsonData = response.data;
+
+            if (jsonData.result) {
+              self.$message({
+                message: "保存成功!",
+                type: "success",
+              });
+
+              self.$emit("close", true);
+            } else {
+              self.$message({
+                message: jsonData.message + "",
+                type: "warning",
+              });
+
+              self.$emit("close", false);
+            }
+          });
+        }
+      });
+    },
+  },
+  mounted: function () {
+    var self = this;
+
+    (function () {
+      if (self.businessKey.length == 0) {
+        return meetingInfoApi.create();
+      } else {
+        return meetingInfoApi.edit(self.businessKey);
+      }
+    })()
+      .then((response) => {
+        var jsonData = response.data;
+        self.loading = false;
+
+        if (jsonData.result) {
+          self.formModel = jsonData.data;
+        } else {
+          self.$message.error(jsonData.message + "");
+        }
+      })
+      .catch((error) => {
+        self.$message.error(error + "");
+      });
+  },
+};
+</script>

+ 14 - 1
src/views/base/meetingInfo-list.vue

@@ -55,7 +55,7 @@
     <el-divider></el-divider>
     <el-row class="button-group">
       <el-button type="primary" size="small" plain icon="el-icon-circle-plus" @click="handleAdd">新增</el-button>
-      <el-button type="success" size="small" plain icon="el-icon-location-information" @click="handleAdd">会议地点管理</el-button>
+      <el-button type="success" size="small" plain icon="el-icon-location-information" @click="handleToAddress">会议地点管理</el-button>
     </el-row>
     <el-table
       ref="formTable"
@@ -332,6 +332,19 @@ export default {
         this.changePage(this.pageIndex);
       }
     },
+    handleToAddress(){
+      var path = "/base/addressInfo/list";
+
+      this.$store.dispatch("tagsView/delView", {
+          name: "baseAddressInfoList",
+          path: path,
+          })
+          .then(({ visitedViews }) => {
+          this.$router.push({
+              path: path,
+          });
+      });
+    },
   },
   mounted: function() {
     var self = this;