浏览代码

会所列表

zhengjinyi 5 年之前
父节点
当前提交
a277dfb16a

+ 92 - 12
src/api/club.js

@@ -1,33 +1,113 @@
 import request from '@/utils/request'
 
-export function getList(query) {
+/**
+ *会所列表
+ */
+export function addNewClub(query) {
   return request({
-    url: '/goods/list',
+    url: '/user/cmUserOrganize/toCmOrganizeClubList',
     method: 'get',
     params: query
   })
 }
-
-export function getCategory(query) {
+/**
+ *会所列表
+ */
+export function getClubList(query) {
+  return request({
+    url: '/user/cmUserOrganize/toCmOrganizeClubList',
+    method: 'get',
+    params: query
+  })
+}
+/**
+ *保存并生成运营
+ */
+export function createOperator(query) {
+  return request({
+    url: '/user/cmUserOrganize/toCmOrganizeClubList',
+    method: 'get',
+    params: query
+  })
+}
+/**
+ *保存运营
+ */
+export function preservOperator(query) {
+  return request({
+    url: '/user/cmUserOrganize/toCmOrganizeClubList',
+    method: 'get',
+    params: query
+  })
+}
+/**
+ *上线下线
+ */
+export function updateStatus(query) {
+  return request({
+    url: '/user/cmUserOrganize/toCmOrganizeClubList',
+    method: 'get',
+    params: query
+  })
+}
+/**
+ *会所条件搜索
+ */
+export function queryClubList(query) {
   return request({
     url: '/goods/category/list',
     method: 'get',
     params: query
   })
 }
-
-export function updateCategory(query) {
+// 查看运营人员接口
+/**
+ *运营人员列表
+ */
+export function getOperatorList(query) {
   return request({
-    url: '/goods/category/update',
-    method: 'post',
+    url: '/goods/category/list',
+    method: 'get',
     params: query
   })
 }
-
-export function createCategory(query) {
+/**
+ *生成邀请码
+ */
+export function createOperatorCode(query) {
+  return request({
+    url: '/goods/category/list',
+    method: 'get',
+    params: query
+  })
+}
+/**
+ *更新邀请码
+ */
+export function updateOperatorCode(query) {
+  return request({
+    url: '/goods/category/list',
+    method: 'get',
+    params: query
+  })
+}
+/**
+ *解绑
+ */
+export function unbindOperator(query) {
   return request({
-    url: '/goods/category/create',
-    method: 'post',
+    url: '/goods/category/list',
+    method: 'get',
+    params: query
+  })
+}
+/**
+ *运营人员条件搜索
+ */
+export function queryOperatorList(query) {
+  return request({
+    url: '/goods/category/list',
+    method: 'get',
     params: query
   })
 }

+ 1 - 1
src/components/Ctiy/index.vue

@@ -50,7 +50,7 @@ export default {
   name: 'Ctiy',
   data() {
     return {
-      mapJson: 'http://localhost:9528/map.json',
+      mapJson: 'http://localhost:9527/map.json',
       province: '',
       sheng: '',
       shi: '',

+ 12 - 5
src/components/Dropzone/index.vue

@@ -27,7 +27,7 @@ export default {
     },
     defaultMsg: {
       type: String,
-      default: '上传图片'
+      default: ''
     },
     acceptedFiles: {
       type: String,
@@ -100,9 +100,9 @@ export default {
       addRemoveLinks: this.showRemoveLink,
       acceptedFiles: this.acceptedFiles,
       autoProcessQueue: this.autoProcessQueue,
-      dictDefaultMessage: '<i style="margin-top: 3em;display: inline-block" class="material-icons">' + this.defaultMsg + '</i><br>Drop files here to upload',
+      dictDefaultMessage: ' <i class="el-icon-plus avatar-uploader-icon material-icons" style="display: inline-block"></i>',
       dictMaxFilesExceeded: '只能一个图',
-      previewTemplate: '<div class="dz-preview dz-file-preview">  <div class="dz-image" style="width:' + this.thumbnailWidth + 'px;height:' + this.thumbnailHeight + 'px" ><img style="width:' + this.thumbnailWidth + 'px;height:' + this.thumbnailHeight + 'px" data-dz-thumbnail /></div>  <div class="dz-details"><div class="dz-size"><span data-dz-size></span></div> <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>  <div class="dz-error-message"><span data-dz-errormessage></span></div>  <div class="dz-success-mark"> <i class="material-icons">done</i> </div>  <div class="dz-error-mark"><i class="material-icons">error</i></div></div>',
+      previewTemplate: '<div class="dz-preview dz-file-preview"><div class="dz-image" style="width:' + this.thumbnailWidth + 'px;height:' + this.thumbnailHeight + 'px" ><img style="width:' + this.thumbnailWidth + 'px;height:' + this.thumbnailHeight + 'px" data-dz-thumbnail /></div>  <div class="dz-details"><div class="dz-size"><span data-dz-size></span></div> <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>  <div class="dz-error-message"><span data-dz-errormessage></span></div> <div class="dz-success-mark"> <i class="material-icons">done</i> </div>  <div class="dz-error-mark"><i class="material-icons">error</i></div></div>',
       init() {
         const val = vm.defaultImg
         if (!val) return
@@ -207,13 +207,20 @@ export default {
 
 <style scoped>
     .dropzone {
-        border: 2px solid #E5E5E5;
+        width: 180px;
+        height: 180px;
+        border: 1px dashed #E5E5E5;
         font-family: 'Roboto', sans-serif;
         color: #777;
         transition: background-color .2s linear;
         padding: 5px;
+        border-radius: 8px;
+    }
+    .dropzone .dz-message{
+      width: 100% !important;
+      height: 100% !important;
+      margin: 0 !important;
     }
-
     .dropzone:hover {
         background-color: #F6F6F6;
     }

+ 2 - 2
src/main.js

@@ -19,7 +19,7 @@ import './utils/error-log' // error log
 
 import * as filters from './filters' // global filters
 
-const userOrganizeID = 1 // 组织ID
+const organizeID = 1 // 组织ID
 /**
  * If you don't want to use mock-server
  * you want to use MockJs for mock api
@@ -42,7 +42,7 @@ Object.keys(filters).forEach(key => {
   Vue.filter(key, filters[key])
 })
 
-Vue.prototype.userOrganizeID = userOrganizeID
+Vue.prototype.organizeID = organizeID
 Vue.config.productionTip = false
 
 new Vue({

+ 31 - 3
src/views/club/form.vue

@@ -27,10 +27,13 @@
         <div class="form-el-upload">
           <el-upload
             class="avatar-uploader"
-            action="https://jsonplaceholder.typicode.com/posts/"
+            accept="image/jpeg,image/gif,image/png"
+            action="https://www-b.caimei365.com/register/imageUpload.action"
             :show-file-list="false"
             :on-success="handleAvatarSuccess"
             :before-upload="beforeAvatarUpload"
+            :multiple="false"
+            :limit= '1'
           >
             <img v-if="form.imageUrl" :src="form.imageUrl" class="avatar">
             <i v-else class="el-icon-plus avatar-uploader-icon" />
@@ -42,6 +45,7 @@
         <div class="form-el-upload">
           <el-upload
             class="avatar-uploader"
+            accept="image/jpeg,image/gif,image/png,image/jpg"
             action="https://jsonplaceholder.typicode.com/posts/"
             :show-file-list="false"
             :on-success="handleDoorwaySuccess"
@@ -72,6 +76,7 @@
 <script>
 // 引入省市区组件,公共组件所在的路径
 import City from '@/components/Ctiy'
+import { addNewClub } from '@/api/club'
 export default {
   components: { City },
   data() {
@@ -121,7 +126,9 @@ export default {
       this.addList.area = data.area
     },
     handleAvatarSuccess(res, file) {
-      console.log(res)
+      this.getBase64(file.raw).then(res => {
+        console.log(res)
+      });
       const fileName = file.name
       const regex = /(.jpg|.jpeg|.gif|.png|.bmp)$/
       if (regex.test(fileName.toLowerCase())) {
@@ -138,7 +145,9 @@ export default {
       return isLt5M
     },
     handleDoorwaySuccess(res, file) {
-      console.log(res)
+      this.getBase64(file.raw).then(res => {
+        console.log(res)
+      });
       const fileName = file.name
       const regex = /(.jpg|.jpeg|.gif|.png|.bmp)$/
       if (regex.test(fileName.toLowerCase())) {
@@ -148,11 +157,30 @@ export default {
       }
     },
     beforeDoorwayUpload(file) {
+      this.getBase64(file.raw).then(res => {
+        console.log(res)
+      });
       const isLt5M = file.size / 1024 / 1024 < 5
       if (!isLt5M) {
         this.$message.error('上传头像图片大小不能超过 5MB!')
       }
       return isLt5M
+    },
+    getBase64(file) {
+      return new Promise(function(resolve, reject) {
+        let reader = new FileReader();
+        let imgResult = "";
+        reader.readAsDataURL(file);
+        reader.onload = function() {
+          imgResult = reader.result;
+        };
+        reader.onerror = function(error) {
+          reject(error);
+        };
+        reader.onloadend = function() {
+          resolve(imgResult);
+        };
+      });
     }
   }
 }

+ 39 - 22
src/views/club/list.vue

@@ -91,8 +91,8 @@
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button @click="dialogFormVisible = false">取消</el-button>
-        <el-button type="primary" @click="createData()">保存</el-button>
-        <el-button type="primary" @click="updateData()">保存生成邀请码</el-button>
+        <el-button type="primary" @click="createOperator()">保存</el-button>
+        <el-button type="primary" @click="preservOperator()">保存生成邀请码</el-button>
       </div>
     </el-dialog>
 
@@ -107,7 +107,13 @@
 </template>
 
 <script>
-import { getCategory, updateCategory, createCategory } from '@/api/club'
+import { 
+  getClubList,
+  createOperator, 
+  preservOperator,
+  updateStatus, 
+  queryClubList
+} from '@/api/club'
 import Pagination from '@/components/Pagination'
 
 export default {
@@ -173,7 +179,10 @@ export default {
   methods: {
     fetchData() {
       this.listLoading = true
-      getCategory().then(response => {
+      let params = {
+        userOrganizeID:this.userOrganizeID
+      }
+      getClubList(params).then(response => {
         this.list = response.data.items
         this.listLoading = false
       }).catch(() => {
@@ -213,30 +222,34 @@ export default {
         this.$refs['dataForm'].clearValidate()
       })
     },
-    createData() {
+    createOperator() {
       this.$refs['dataForm'].validate((valid) => {
         if (valid) {
           const addPeopleData = Object.assign({}, this.addPeople)
           console.log(addPeopleData)
-          updateCategory(addPeopleData).then(() => {
+          createOperator(addPeopleData).then(() => {
             this.dialogFormVisible = false
-            this.$notify({
-              title: 'Success',
+            this.$message({
               message: '保存成功',
               type: 'success',
-              duration: 2000
-            })
+              center: true
+            });
           })
         }
       })
     },
-    updateData() {
+    preservOperator() {
       this.$refs['dataForm'].validate((valid) => {
         if (valid) {
           const addPeopleData = Object.assign({}, this.addPeople)
           console.log(addPeopleData)
-          updateCategory(addPeopleData).then(() => {
+          preservOperator(addPeopleData).then(() => {
             this.dialogFormVisible = false
+            this.$message({
+              message: '生成邀请码成功',
+              type: 'success',
+              center: true
+            });
           })
         }
       })
@@ -259,21 +272,25 @@ export default {
       if (this.updateTatusType === 'online') {
         console.log(this.updateTatusId)
         this.list[0].status = 2
-        this.$notify({
-          title: 'Success',
-          message: '上线成功',
+        // preservOperator(addPeopleData).then(() => {
+        //     this.dialogFormVisible = false
+        // })
+        this.$message({
+          message: '上线会所成功',
           type: 'success',
-          duration: 2000
-        })
+          center: true
+        });
       } else {
+        // preservOperator(addPeopleData).then(() => {
+        //     this.dialogFormVisible = false
+        // })
         console.log(this.updateTatusId)
         this.list[1].status = 2
-        this.$notify({
-          title: 'Success',
-          message: '下线成功',
+        this.$message({
+          message: '下线会所成功',
           type: 'success',
-          duration: 2000
-        })
+          center: true
+        });
       }
       this.dialogVisible = false
     },

+ 23 - 17
src/views/club/operateList.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <div class="app-title">当前会所: <span>商城测试演示会所</span> </div>
+    <div class="app-title">当前会所: <span class="span"></span>商城测试演示会所</span> </div>
     <el-table
       v-loading="listLoading"
       :data="list"
@@ -71,7 +71,15 @@
 </template>
 
 <script>
-import { getCategory, updateCategory, createCategory } from '@/api/goods'
+import { 
+  getOperatorList,     //初始化
+  createOperatorCode,  //生成邀请码
+  updateOperatorCode,  //更新邀请码
+  unbindOperator,      //解绑运营
+  preservOperator,     //保存
+  createOperator,      //保存并生成
+  queryOperatorList    //条件查询
+} from '@/api/goods'
 import Pagination from '@/components/Pagination'
 
 export default {
@@ -128,7 +136,7 @@ export default {
   methods: {
     fetchData() {
       this.listLoading = true
-      getCategory().then(response => {
+      getOperatorList().then(response => {
         this.list = response.data.items
         this.listLoading = false
       }).catch(() => {
@@ -227,21 +235,19 @@ export default {
     },
     untyingRequst() {
       this.dialogVisible = false
-      this.$notify({
-        title: 'Success',
+      this.$message({
         message: '解绑成功',
         type: 'success',
-        duration: 2000
-      })
+        center: true
+      });
     },
     generateRequst() {
       this.dialogVisible = false
-      this.$notify({
-        title: 'Success',
+      this.$message({
         message: '邀请码生成成功',
         type: 'success',
-        duration: 2000
-      })
+        center: true
+      });
     },
     rexpStautsText(status) {
       let text = ''
@@ -278,12 +284,11 @@ export default {
         if (valid) {
           const tempData = Object.assign({}, this.temp)
           this.dialogFormVisible = false
-          this.$notify({
-            title: 'Success',
+          this.$message({
             message: '保存成功',
             type: 'success',
-            duration: 2000
-          })
+            center: true
+          });
           updateCategory(tempData).then(() => {
 
           })
@@ -300,8 +305,9 @@ export default {
     font-weight: bold;
     color: #999999;
     margin-bottom: 10px;
-    span{
+    
+  }
+  .app-title .span{
       color: #417DE6;
-    }
   }
 </style>

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

@@ -77,7 +77,7 @@ export default {
       loginForm: {
         account: 'admin',
         password: '123456',
-        organizeID: this.userOrganizeID
+        organizeID: this.organizeID
       },
       loginRules: {
         account: [{ required: true, trigger: 'blur', validator: validateUsername }],

+ 2 - 2
src/views/other/about.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="app-container">
     <tinymce v-model="content" :height="300" />
-    <div slot="footer" class="dialog-footer" style="width:1px;margin:0 auto;padding:40px 0 80px 0;">
-      <el-button type="primary" icon="el-icon-check" style="width:150px;" @click="onSubmite()">提交</el-button>
+    <div slot="footer" class="dialog-footer" style="float: right;padding:40px 0 80px 0;">
+      <el-button type="primary" style="width:100px;" @click="onSubmite()">提交</el-button>
     </div>
     <div v-if="isContent" class="editor-content" v-html="content" />
   </div>

+ 2 - 2
src/views/other/after.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="app-container">
     <Tinymce />
-    <div slot="footer" class="dialog-footer" style="width:1px;margin:0 auto;padding:40px 0 80px 0;">
-      <el-button type="primary" icon="el-icon-check" style="width:150px;" @click="onSubmite('dataForm')">提交</el-button>
+    <div slot="footer" class="dialog-footer" style="float: right;padding:40px 0 80px 0;">
+      <el-button type="primary"  style="width:100px;" @click="onSubmite('dataForm')">提交</el-button>
     </div>
   </div>
 </template>

+ 2 - 2
src/views/other/notes.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="app-container">
     <Tinymce v-model="content" />
-    <div slot="footer" class="dialog-footer" style="width:1px;margin:0 auto;padding:40px 0 80px 0;">
-      <el-button type="primary" icon="el-icon-check" style="width:150px;" @click="onSubmite('dataForm')">提交</el-button>
+    <div slot="footer" class="dialog-footer" style="float: right;padding:40px 0 80px 0;">
+      <el-button type="primary" style="width:100px;" @click="onSubmite('dataForm')">提交</el-button>
     </div>
   </div>
 </template>

+ 1 - 1
src/views/other/password.vue

@@ -12,7 +12,7 @@
       </el-form-item>
     </el-form>
     <div slot="footer" class="dialog-footer" style="width:1px;margin:0 auto;padding:40px 0 80px 0;">
-      <el-button type="primary" icon="el-icon-check" @click="onSubmite('dataForm')">保存</el-button>
+      <el-button type="primary" style="width: 100px;" @click="onSubmite('dataForm')">保存</el-button>
     </div>
   </div>
 </template>