Browse Source

20221026日提交

asd123a20 2 years ago
parent
commit
d893602d66

+ 8 - 0
src/api/community/activity.js

@@ -42,3 +42,11 @@ export function delActivity(activityId) {
     method: 'delete'
   })
 }
+
+// 删除活动管理
+export function finishActivity(activityId) {
+  return request({
+    url: '/community/activity/finish/' + activityId,
+    method: 'post'
+  })
+}

+ 18 - 0
src/api/community/activitylog.js

@@ -42,3 +42,21 @@ export function delActivitylog(activityLogId) {
     method: 'delete'
   })
 }
+
+// 审核
+export function reviewActivity(data) {
+  return request({
+    url: '/community/activitylog/review',
+    method: 'post',
+    data: data
+  })
+}
+
+// 活动记录导出
+export function activityExport(data) {
+  return request({
+    url: '/community/activitylog/export',
+    method: 'post',
+    data: data
+  })
+}

+ 2 - 2
src/api/community/points.js

@@ -3,7 +3,7 @@ import request from '@/utils/request'
 // 查询积分列表
 export function listPoints(query) {
   return request({
-    url: '/community/points/list',
+    url: '/community/points/list-by-user',
     method: 'get',
     params: query
   })
@@ -30,7 +30,7 @@ export function addPoints(data) {
 export function updatePoints(data) {
   return request({
     url: '/community/points',
-    method: 'put',
+    method: 'post',
     data: data
   })
 }

+ 1 - 1
src/api/community/pointslog.js

@@ -3,7 +3,7 @@ import request from '@/utils/request'
 // 查询积分表更记录列表
 export function listPointslog(query) {
   return request({
-    url: '/community/pointslog/list',
+    url: '/community/pointslog/list-by-user',
     method: 'get',
     params: query
   })

+ 10 - 1
src/layout/components/InnerLink/index.vue

@@ -3,7 +3,7 @@
     <iframe
       :id="iframeId"
       style="width: 100%; height: 100%"
-      :src="src"
+      :src="url"
       frameborder="no"
     ></iframe>
   </div>
@@ -20,6 +20,15 @@ export default {
       type: String
     }
   },
+  computed: {
+    url() {
+      if (this.src.includes('http://localhost')) {
+        const url = this.src.replace('http://localhost', '');
+        return url;
+      }
+      return this.src;
+    }
+  },
   data() {
     return {
       loading: false,

+ 3 - 0
src/layout/components/Sidebar/SidebarItem.vue

@@ -84,12 +84,15 @@ export default {
     },
     resolvePath(routePath, routeQuery) {
       if (isExternal(routePath)) {
+        console.log(routePath, 'routePath');
         return routePath
       }
       if (isExternal(this.basePath)) {
+        console.log(this.basePath, 'this.basePath');
         return this.basePath
       }
       if (routeQuery) {
+        console.log(routeQuery, 'routeQuery');
         let query = JSON.parse(routeQuery);
         return { path: path.resolve(this.basePath, routePath), query: query }
       }

+ 203 - 0
src/views/activity/activitylog.vue

@@ -0,0 +1,203 @@
+<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="活动名称">
+        <el-input
+          v-model="queryParams['activity.topic']"
+          placeholder="请输入活动名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="用户名称">
+        <el-input
+          v-model="queryParams['user.name']"
+          placeholder="请输入用户名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </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="primary"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+        >活动记录导出</el-button>
+      </el-col>
+    </el-row>
+
+    <el-table v-loading="loading" :data="activitylogList">
+      <el-table-column label="活动名称" align="center" prop="activity.topic" />
+      <el-table-column label="用户名称" align="center" prop="user.name" />
+      <el-table-column label="签到状态" align="center" prop="checkinStatus" />
+      <el-table-column label="积分发放状态" align="center" prop="pointStatus" />
+      <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:activitylog: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="800px" append-to-body>
+      <el-form ref="form" :model="form" label-width="120px">
+        <el-form-item label="活动名称">
+          <el-input :value="form.activity && form.activity.topic" disabled />
+        </el-form-item>
+        <el-form-item label="用户名称">
+          <el-input :value="form.user && form.user.name" disabled />
+        </el-form-item>
+        <el-form-item label="活动图片">
+          <el-image v-for="(item, index) in form.photos" :key="index" :src="item.photo" fit="fill"></el-image>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="success" @click="submitForm(1)">审 核</el-button>
+        <el-button type="primary" @click="submitForm(0)">驳 回</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listActivitylog, getActivitylog, reviewActivity, activityExport } from "@/api/community/activitylog";
+
+export default {
+  name: "Activitylog",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 活动记录表格数据
+      activitylogList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        activityId: null,
+        userId: null,
+        checkinStatus: null,
+        pointStatus: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        activityId: [
+          { required: true, message: "活动Id不能为空", trigger: "blur" }
+        ],
+        userId: [
+          { required: true, message: "用户Id不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询活动记录列表 */
+    getList() {
+      this.loading = true;
+      listActivitylog(this.queryParams).then(response => {
+        this.activitylogList = response.rows.map(e => {
+          e.pointStatus = e.pointStatus == 0 ? '未发放' : '已发放';
+          e.checkinStatus = e.checkinStatus == 0 ? '报名' : '签到';
+          return e;
+        });
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        activityLogId: null,
+        activityId: null,
+        userId: null,
+        checkinStatus: "0",
+        pointStatus: "0",
+        createTime: null,
+        updateTime: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const activityLogId = row.activityLogId || this.ids
+      getActivitylog(activityLogId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "活动记录详情";
+      });
+    },
+    submitForm(e) {
+      console.log(this.form);
+      const { activityLogId } = this.form;
+      reviewActivity({ activityLogId, result: e }).then(response => {
+        this.open = false;
+        this.reset();
+        this.$modal.msgSuccess((e == 1 ? '审核' : '驳回') + "成功");
+      });
+    },
+    handleExport() {
+      this.download('/community/activitylog/export', {
+        }, `活动记录${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>

+ 31 - 78
src/views/community/activity/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
       <el-form-item label="主题" prop="topic">
         <el-input
           v-model="queryParams.topic"
@@ -25,22 +25,6 @@
           placeholder="请选择活动结束时间">
         </el-date-picker>
       </el-form-item>
-      <el-form-item label="发起者" prop="sponsorName">
-        <el-input
-          v-model="queryParams.sponsorName"
-          placeholder="请输入发起者"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="联系电话" prop="sponsorPhone">
-        <el-input
-          v-model="queryParams.sponsorPhone"
-          placeholder="请输入联系电话"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </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>
@@ -58,46 +42,11 @@
           v-hasPermi="['community:activity:add']"
         >新增</el-button>
       </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['community:activity:edit']"
-        >修改</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['community:activity:remove']"
-        >删除</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          @click="handleExport"
-          v-hasPermi="['community:activity:export']"
-        >导出</el-button>
-      </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="activityList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="活动Id" align="center" prop="activityId" />
       <el-table-column label="主题" align="center" prop="topic" />
-      <el-table-column label="类型" align="center" prop="type" />
       <el-table-column label="活动开始时间" align="center" prop="startTime" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
@@ -110,10 +59,18 @@
       </el-table-column>
       <el-table-column label="发起者" align="center" prop="sponsorName" />
       <el-table-column label="联系电话" align="center" prop="sponsorPhone" />
-      <el-table-column label="活动状态" align="center" prop="status" />
+      <el-table-column label="活动状态" align="center" prop="statusText" />
       <el-table-column label="奖励积分" align="center" prop="point" />
       <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"
+            v-if="scope.row.status !== '3'"
+            @click="handleEnd(scope.row)"
+            v-hasPermi="['community:activity:edit']"
+          >结束</el-button>
           <el-button
             size="mini"
             type="text"
@@ -141,8 +98,8 @@
     />
 
     <!-- 添加或修改活动管理对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
         <el-form-item label="主题" prop="topic">
           <el-input v-model="form.topic" placeholder="请输入主题" />
         </el-form-item>
@@ -184,27 +141,16 @@
         <el-form-item label="报名人数限制" prop="regMaxCount">
           <el-input v-model="form.regMaxCount" placeholder="请输入报名人数限制" />
         </el-form-item>
-        <el-form-item label="社区发起人Id" prop="sponsorSysId">
-          <el-input v-model="form.sponsorSysId" placeholder="请输入社区发起人Id" />
-        </el-form-item>
-        <el-form-item label="用户发起人Id" prop="sponsorUserId">
-          <el-input v-model="form.sponsorUserId" placeholder="请输入用户发起人Id" />
-        </el-form-item>
-        <el-form-item label="发起者" prop="sponsorName">
-          <el-input v-model="form.sponsorName" placeholder="请输入发起者" />
-        </el-form-item>
-        <el-form-item label="联系电话" prop="sponsorPhone">
-          <el-input v-model="form.sponsorPhone" placeholder="请输入联系电话" />
-        </el-form-item>
-        <el-form-item label="活动简介" prop="description">
-          <el-input v-model="form.description" type="textarea" placeholder="请输入内容" />
-        </el-form-item>
         <el-form-item label="奖励积分" prop="point">
           <el-input v-model="form.point" placeholder="请输入奖励积分" />
         </el-form-item>
         <el-form-item label="备注" prop="remark">
           <el-input v-model="form.remark" placeholder="请输入备注" />
         </el-form-item>
+        <el-form-item label="活动简介" prop="description">
+          <!-- <el-input v-model="form.description" type="textarea" placeholder="请输入内容" /> -->
+          <cmsEditor v-model="form.description" @getFileId="getFileId" type="base64" :min-height="192" />
+        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -215,7 +161,7 @@
 </template>
 
 <script>
-import { listActivity, getActivity, delActivity, addActivity, updateActivity } from "@/api/community/activity";
+import { listActivity, getActivity, delActivity, addActivity, updateActivity, finishActivity } from "@/api/community/activity";
 
 export default {
   name: "Activity",
@@ -262,11 +208,17 @@ export default {
     this.getList();
   },
   methods: {
+    getFileId(data) {
+        this.fileIds.push(data);
+      },
     /** 查询活动管理列表 */
     getList() {
       this.loading = true;
       listActivity(this.queryParams).then(response => {
-        this.activityList = response.rows;
+        this.activityList = response.rows.map(e => {
+          e.statusText = e.status == 0 ? '未开始' : '已结束'
+          return e;
+        });
         this.total = response.total;
         this.loading = false;
       });
@@ -357,18 +309,19 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const activityIds = row.activityId || this.ids;
-      this.$modal.confirm('是否确认删除活动管理编号为"' + activityIds + '"的数据项?').then(function() {
+      this.$modal.confirm('是否确认删除活动管理名称为"' + row.topic + '"的数据项?').then(function() {
         return delActivity(activityIds);
       }).then(() => {
         this.getList();
         this.$modal.msgSuccess("删除成功");
       }).catch(() => {});
     },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download('community/activity/export', {
-        ...this.queryParams
-      }, `activity_${new Date().getTime()}.xlsx`)
+    handleEnd(row) {
+      const { activityId } = row;
+      finishActivity(activityId).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("结束成功");
+      }).catch(() => {});
     }
   }
 };

+ 0 - 273
src/views/community/activitylog/index.vue

@@ -1,273 +0,0 @@
-<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="活动Id" prop="activityId">
-        <el-input
-          v-model="queryParams.activityId"
-          placeholder="请输入活动Id"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="用户Id" prop="userId">
-        <el-input
-          v-model="queryParams.userId"
-          placeholder="请输入用户Id"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </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="primary"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['community:activitylog:add']"
-        >新增</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['community:activitylog:edit']"
-        >修改</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['community:activitylog:remove']"
-        >删除</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          @click="handleExport"
-          v-hasPermi="['community:activitylog:export']"
-        >导出</el-button>
-      </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
-
-    <el-table v-loading="loading" :data="activitylogList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="活动记录Id" align="center" prop="activityLogId" />
-      <el-table-column label="活动Id" align="center" prop="activityId" />
-      <el-table-column label="用户Id" align="center" prop="userId" />
-      <el-table-column label="签到状态" align="center" prop="checkinStatus" />
-      <el-table-column label="积分发放状态" align="center" prop="pointStatus" />
-      <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:activitylog:edit']"
-          >修改</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['community:activitylog:remove']"
-          >删除</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" :rules="rules" label-width="80px">
-        <el-form-item label="活动Id" prop="activityId">
-          <el-input v-model="form.activityId" placeholder="请输入活动Id" />
-        </el-form-item>
-        <el-form-item label="用户Id" prop="userId">
-          <el-input v-model="form.userId" placeholder="请输入用户Id" />
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
-        <el-button @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { listActivitylog, getActivitylog, delActivitylog, addActivitylog, updateActivitylog } from "@/api/community/activitylog";
-
-export default {
-  name: "Activitylog",
-  data() {
-    return {
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
-      // 总条数
-      total: 0,
-      // 活动记录表格数据
-      activitylogList: [],
-      // 弹出层标题
-      title: "",
-      // 是否显示弹出层
-      open: false,
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        activityId: null,
-        userId: null,
-        checkinStatus: null,
-        pointStatus: null,
-      },
-      // 表单参数
-      form: {},
-      // 表单校验
-      rules: {
-        activityId: [
-          { required: true, message: "活动Id不能为空", trigger: "blur" }
-        ],
-        userId: [
-          { required: true, message: "用户Id不能为空", trigger: "blur" }
-        ],
-      }
-    };
-  },
-  created() {
-    this.getList();
-  },
-  methods: {
-    /** 查询活动记录列表 */
-    getList() {
-      this.loading = true;
-      listActivitylog(this.queryParams).then(response => {
-        this.activitylogList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        activityLogId: null,
-        activityId: null,
-        userId: null,
-        checkinStatus: "0",
-        pointStatus: "0",
-        createTime: null,
-        updateTime: null
-      };
-      this.resetForm("form");
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.activityLogId)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加活动记录";
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const activityLogId = row.activityLogId || this.ids
-      getActivitylog(activityLogId).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改活动记录";
-      });
-    },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.activityLogId != null) {
-            updateActivitylog(this.form).then(response => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addActivitylog(this.form).then(response => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
-        }
-      });
-    },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const activityLogIds = row.activityLogId || this.ids;
-      this.$modal.confirm('是否确认删除活动记录编号为"' + activityLogIds + '"的数据项?').then(function() {
-        return delActivitylog(activityLogIds);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
-    },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download('community/activitylog/export', {
-        ...this.queryParams
-      }, `activitylog_${new Date().getTime()}.xlsx`)
-    }
-  }
-};
-</script>

+ 0 - 272
src/views/community/pointslog/index.vue

@@ -1,272 +0,0 @@
-<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="用户Id" prop="userId">
-        <el-input
-          v-model="queryParams.userId"
-          placeholder="请输入用户Id"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </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="primary"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['community:pointslog:add']"
-        >新增</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['community:pointslog:edit']"
-        >修改</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['community:pointslog:remove']"
-        >删除</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          @click="handleExport"
-          v-hasPermi="['community:pointslog:export']"
-        >导出</el-button>
-      </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
-
-    <el-table v-loading="loading" :data="pointslogList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="自增ID" align="center" prop="pointsLogId" />
-      <el-table-column label="用户Id" align="center" prop="userId" />
-      <el-table-column label="变更类型" align="center" prop="changeType" />
-      <el-table-column label="变更数值" align="center" prop="changePoints" />
-      <el-table-column label="变更原因" align="center" prop="changeReason" />
-      <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:pointslog:edit']"
-          >修改</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['community:pointslog:remove']"
-          >删除</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" :rules="rules" label-width="80px">
-        <el-form-item label="用户Id" prop="userId">
-          <el-input v-model="form.userId" placeholder="请输入用户Id" />
-        </el-form-item>
-        <el-form-item label="变更数值" prop="changePoints">
-          <el-input v-model="form.changePoints" placeholder="请输入变更数值" />
-        </el-form-item>
-        <el-form-item label="变更原因" prop="changeReason">
-          <el-input v-model="form.changeReason" placeholder="请输入变更原因" />
-        </el-form-item>
-        <el-form-item label="变更事件关联Id" prop="relationId">
-          <el-input v-model="form.relationId" placeholder="请输入变更事件关联Id" />
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
-        <el-button @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { listPointslog, getPointslog, delPointslog, addPointslog, updatePointslog } from "@/api/community/pointslog";
-
-export default {
-  name: "Pointslog",
-  data() {
-    return {
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
-      // 总条数
-      total: 0,
-      // 积分表更记录表格数据
-      pointslogList: [],
-      // 弹出层标题
-      title: "",
-      // 是否显示弹出层
-      open: false,
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        userId: null,
-        changeType: null,
-      },
-      // 表单参数
-      form: {},
-      // 表单校验
-      rules: {
-        userId: [
-          { required: true, message: "用户Id不能为空", trigger: "blur" }
-        ],
-        changeType: [
-          { required: true, message: "变更类型不能为空", trigger: "change" }
-        ],
-        relationId: [
-          { required: true, message: "变更事件关联Id不能为空", trigger: "blur" }
-        ]
-      }
-    };
-  },
-  created() {
-    this.getList();
-  },
-  methods: {
-    /** 查询积分表更记录列表 */
-    getList() {
-      this.loading = true;
-      listPointslog(this.queryParams).then(response => {
-        this.pointslogList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        pointsLogId: null,
-        userId: null,
-        changeType: null,
-        changePoints: null,
-        changeReason: null,
-        createTime: null,
-        relationId: null
-      };
-      this.resetForm("form");
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.pointsLogId)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加积分表更记录";
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const pointsLogId = row.pointsLogId || this.ids
-      getPointslog(pointsLogId).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改积分表更记录";
-      });
-    },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.pointsLogId != null) {
-            updatePointslog(this.form).then(response => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addPointslog(this.form).then(response => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
-        }
-      });
-    },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const pointsLogIds = row.pointsLogId || this.ids;
-      this.$modal.confirm('是否确认删除积分表更记录编号为"' + pointsLogIds + '"的数据项?').then(function() {
-        return delPointslog(pointsLogIds);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
-    },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download('community/pointslog/export', {
-        ...this.queryParams
-      }, `pointslog_${new Date().getTime()}.xlsx`)
-    }
-  }
-};
-</script>

+ 97 - 87
src/views/community/points/index.vue

@@ -1,10 +1,18 @@
 <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="用户Id" prop="userId">
+      <el-form-item label="用户名" prop="name">
         <el-input
-          v-model="queryParams.userId"
-          placeholder="请输入用户Id"
+          v-model="queryParams.name"
+          placeholder="请输入用户名"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="手机号" prop="phone">
+        <el-input
+          v-model="queryParams.phone"
+          placeholder="请输入用户手机号"
           clearable
           @keyup.enter.native="handleQuery"
         />
@@ -16,54 +24,22 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['community:points:add']"
-        >新增</el-button>
-      </el-col>
       <el-col :span="1.5">
         <el-button
           type="success"
           plain
-          icon="el-icon-edit"
+          icon="el-icon-upload2"
           size="mini"
-          :disabled="single"
-          @click="handleUpdate"
+          @click="handleImport"
           v-hasPermi="['community:points:edit']"
-        >修改</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['community:points:remove']"
-        >删除</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          @click="handleExport"
-          v-hasPermi="['community:points:export']"
-        >导出</el-button>
+        >批量发放</el-button>
       </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="pointsList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="用户Id" align="center" prop="userId" />
+      <el-table-column label="用户名" align="center" prop="name" />
+      <el-table-column label="手机号" align="center" prop="phone" />
       <el-table-column label="荣誉积分" align="center" prop="honorPoints" />
       <el-table-column label="消费积分" align="center" prop="spendPoints" />
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@@ -71,23 +47,23 @@
           <el-button
             size="mini"
             type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
+            icon="el-icon-close"
+            @click="handleUpdate({ ...scope.row, changeType: 0 })"
             v-hasPermi="['community:points:edit']"
-          >修改</el-button>
+          >核销</el-button>
           <el-button
             size="mini"
             type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
+            icon="el-icon-check"
+            @click="handleUpdate({ ...scope.row, changeType: 1 })"
             v-hasPermi="['community:points:remove']"
-          >删除</el-button>
+          >发放</el-button>
         </template>
       </el-table-column>
     </el-table>
     
     <pagination
-      v-show="total>0"
+      v-if="total > 0"
       :total="total"
       :page.sync="queryParams.pageNum"
       :limit.sync="queryParams.pageSize"
@@ -97,24 +73,49 @@
     <!-- 添加或修改积分对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="荣誉积分" prop="honorPoints">
-          <el-input v-model="form.honorPoints" placeholder="请输入荣誉积分" />
-        </el-form-item>
         <el-form-item label="消费积分" prop="spendPoints">
           <el-input v-model="form.spendPoints" placeholder="请输入消费积分" />
         </el-form-item>
+        <el-form-item label="变更原因" prop="spendPoints">
+          <el-input type="textarea" v-model="form.changeReason"></el-input>
+        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+    <!-- 用户导入对话框 -->
+    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+      <el-upload
+        ref="upload"
+        :limit="1"
+        accept=".xlsx, .xls"
+        :headers="upload.headers"
+        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :disabled="upload.isUploading"
+        :on-progress="handleFileUploadProgress"
+        :on-success="handleFileSuccess"
+        :auto-upload="false"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+        <div class="el-upload__tip text-center" slot="tip">
+          <span>仅允许导入xls、xlsx格式文件。</span>
+        </div>
+      </el-upload>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import { listPoints, getPoints, delPoints, addPoints, updatePoints } from "@/api/community/points";
-
+import { getToken } from "@/utils/auth";
 export default {
   name: "Points",
   data() {
@@ -146,8 +147,22 @@ export default {
       // 表单参数
       form: {},
       // 表单校验
-      rules: {
-      }
+      rules: {},
+      // 用户导入参数
+      upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/community/points/importData"
+      },
     };
   },
   created() {
@@ -193,7 +208,7 @@ export default {
       this.single = selection.length!==1
       this.multiple = !selection.length
     },
-    /** 新增按钮操作 */
+    /** 核销 / 发放 */
     handleAdd() {
       this.reset();
       this.open = true;
@@ -201,49 +216,44 @@ export default {
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
+      console.log(row, 'row');
       this.reset();
-      const userId = row.userId || this.ids
-      getPoints(userId).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改积分";
-      });
+      this.form = row;
+      this.open = true;
+      this.title =  row.changeType == 0 ? "核销积分" : '发放积分';
     },
     /** 提交按钮 */
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          if (this.form.userId != null) {
-            updatePoints(this.form).then(response => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addPoints(this.form).then(response => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
+          updatePoints({ ...this.form, changePoints: this.form.spendPoints }).then(response => {
+            this.$modal.msgSuccess("修改成功");
+            this.open = false;
+            this.getList();
+          });
         }
       });
     },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const userIds = row.userId || this.ids;
-      this.$modal.confirm('是否确认删除积分编号为"' + userIds + '"的数据项?').then(function() {
-        return delPoints(userIds);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.title = "批量发放";
+      this.upload.open = true;
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
+      this.getList();
     },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download('community/points/export', {
-        ...this.queryParams
-      }, `points_${new Date().getTime()}.xlsx`)
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
     }
   }
 };

+ 94 - 0
src/views/points/pointslog.vue

@@ -0,0 +1,94 @@
+<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="userId">
+        <el-input
+          v-model="queryParams.name"
+          placeholder="请输入用户名"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="手机号" prop="userId">
+        <el-input
+          v-model="queryParams.phone"
+          placeholder="请输入用户手机号"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </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-table v-loading="loading" :data="pointslogList">
+      <el-table-column label="用户名" align="center" prop="name" />
+      <el-table-column label="手机号" align="center" prop="phone" />
+      <el-table-column label="变更类型" align="center" prop="changeType" />
+      <el-table-column label="变更数值" align="center" prop="changePoints" />
+      <el-table-column label="变更原因" align="center" prop="changeReason" />
+    </el-table>
+    
+    <pagination
+      v-if="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import { listPointslog, getPointslog, delPointslog, addPointslog, updatePointslog } from "@/api/community/pointslog";
+
+export default {
+  name: "Pointslog",
+  data() {
+    return {
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 积分表更记录表格数据
+      pointslogList: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        userId: null,
+        changeType: null,
+      },
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询积分表更记录列表 */
+    getList() {
+      this.loading = true;
+      listPointslog(this.queryParams).then(response => {
+        this.pointslogList = response.rows.map(e => {
+          e.changeType = e.changeType == 1 ? '发放' : '核销';
+          return e;
+        });
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+  }
+};
+</script>

+ 1 - 1
src/views/survey/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="box">
-    <iframe class="iframe" src="http://localhost:8081/#/dw/survey/"></iframe>
+    <iframe class="iframe" src="/dw/#/dw/survey"></iframe>
   </div>
 </template>
 

+ 7 - 3
vue.config.js

@@ -38,12 +38,16 @@ module.exports = {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
         // target: `http://fuyu.scapp.cn/prod-api/`,
-        target: `http://192.168.0.70:8080/`,
+        target: `http://192.168.0.63/`,
         changeOrigin: true,
         pathRewrite: {
-          ['^' + process.env.VUE_APP_BASE_API]: ''
+          ['^' + process.env.VUE_APP_BASE_API]: '/prod-api'
         }
-      }
+      },
+      '/dw': {
+        target: `http://fuyu.scapp.cn/`,
+        changeOrigin: true,
+      },
     },
     disableHostCheck: true
   },