فهرست منبع

新增签到管理

asd123a20 2 سال پیش
والد
کامیت
065ba71eee
3فایلهای تغییر یافته به همراه295 افزوده شده و 0 حذف شده
  1. 52 0
      src/api/community/clockin.js
  2. 239 0
      src/views/community/clockin/index.vue
  3. 4 0
      vue.config.js

+ 52 - 0
src/api/community/clockin.js

@@ -0,0 +1,52 @@
+import request from '@/utils/request'
+
+// 查询服务签到列表
+export function listClockin(query) {
+  return request({
+    url: '/community/clockin/list-clockin',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询服务签到详细
+export function getClockin(dangjianClockinId) {
+  return request({
+    url: '/community/clockin/' + dangjianClockinId,
+    method: 'get'
+  })
+}
+
+// 新增服务签到
+export function addClockin(data) {
+  return request({
+    url: '/community/clockin',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改服务签到
+export function updateClockin(data) {
+  return request({
+    url: '/community/clockin',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除服务签到
+export function delClockin(dangjianClockinId) {
+  return request({
+    url: '/community/clockin/' + dangjianClockinId,
+    method: 'delete'
+  })
+}
+
+// 社区查询 
+export function getaddr() {
+  return request({
+    url: '/community/addr/list-community',
+    method: 'get'
+  })
+}

+ 239 - 0
src/views/community/clockin/index.vue

@@ -0,0 +1,239 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="姓名" prop="description">
+        <el-input
+          v-model="queryParams.name"
+          placeholder="请输入姓名"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="联系方式" prop="description">
+        <el-input
+          v-model="queryParams.phone"
+          placeholder="请输入联系方式"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="签到社区" prop="deptId">
+        <el-select v-model="queryParams.deptId" placeholder="请选择社区">
+          <el-option
+            v-for="item in addrList"
+            :key="item.deptId"
+            :label="item.deptName"
+            :value="item.deptId">
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="签到时间" prop="clockinTime">
+        <el-date-picker clearable
+          v-model="queryParams.clockinTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="请选择签到时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['community:clockin:export']"
+        >导出</el-button>
+      </el-col>
+    </el-row>
+
+    <el-table v-loading="loading" :data="clockinList">
+      <el-table-column label="姓名" align="center" prop="name" />
+      <el-table-column label="性别" align="center" prop="sexName" />
+      <el-table-column label="联系方式" align="center" prop="phone" />
+      <el-table-column label="签到社区" align="center" prop="deptName" />
+      <el-table-column label="签到时间" align="center" prop="clockinTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.clockinTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['community:clockin:edit']"
+          >详情</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改服务签到对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" label-width="80px">
+        <el-form-item label="姓名" prop="name">
+          <el-input disabled v-model="form.name" placeholder="请输入用户Id" />
+        </el-form-item>
+        <el-form-item label="性别" prop="sex">
+          <el-input disabled v-model="form.sexName" placeholder="请输入用户Id" />
+        </el-form-item>
+        <el-form-item label="联系方式" prop="phone">
+          <el-input disabled v-model="form.phone" placeholder="请输入用户Id" />
+        </el-form-item>
+        <el-form-item label="签到社区" prop="deptId">
+          <el-input disabled v-model="form.deptName" placeholder="请输入签到社区" />
+        </el-form-item>
+        <el-form-item label="服务内容" prop="description">
+          <el-input disabled v-model="form.description" placeholder="请输入服务内容" />
+        </el-form-item>
+        <el-form-item label="图片路径" prop="photo">
+          <img :src="form.photo" style="display: block; width: 100px; height: 100px" @click="dialogVisible = true" />
+        </el-form-item>
+        <el-form-item label="签到时间" prop="clockinTime">
+          <el-date-picker
+            clearable
+            disabled
+            v-model="form.clockinTime"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="请选择签到时间">
+          </el-date-picker>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+    <el-dialog
+      :visible.sync="dialogVisible"
+      title="预览"
+      width="800"
+      append-to-body
+    >
+      <img :src="form.photo" style="display: block; max-width: 100%; margin: 0 auto" />
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listClockin, getaddr } from "@/api/community/clockin";
+
+export default {
+  name: "Clockin",
+  data() {
+    return {
+      // s社区列表
+      addrList: [],
+      // 预览弹窗
+      dialogVisible: false,
+      // 预览图片
+      dialogImageUrl: [],
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 服务签到表格数据
+      clockinList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        userId: null,
+        deptId: null,
+        description: null,
+        photo: null,
+        clockinTime: null
+      },
+      // 表单参数
+      form: {},
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询服务签到列表 */
+    async getList() {
+      this.loading = true;
+      const res = await getaddr();
+      this.addrList = res.rows;
+      listClockin(this.queryParams).then(response => {
+        this.clockinList = response.rows.map(e=> {
+          const name = res.rows.find(j => j.deptId == e.deptId);
+          if (name) e.deptName = name.deptName;
+          e.sexName = e.sex == 0 ? '女' : '男';
+          return e;
+        });
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        dangjianClockinId: null,
+        userId: null,
+        deptId: null,
+        description: null,
+        photo: null,
+        clockinTime: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      this.form = row;
+      this.open = true;
+      this.title = "服务签到详情";
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('community/clockin/export', {
+        ...this.queryParams
+      }, `签到导出_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>

+ 4 - 0
vue.config.js

@@ -49,6 +49,10 @@ module.exports = {
         target: `https://fuyu.cc-lotus.info/`,
         changeOrigin: true,
       },
+      '/profile/': {
+        target: `http://172.17.116.208:8080`,
+        changeOrigin: true,
+      },
     },
     disableHostCheck: true
   },