Explorar o código

Merge remote-tracking branch 'origin/master'

xdd hai 1 mes
pai
achega
15a998bff8

+ 11 - 1
src/api/company/companyConfig.js

@@ -1,6 +1,6 @@
 import request from '@/utils/request'
 
- 
+
 
 // 根据参数键名查询参数值
 export function getConfigKey(configKey) {
@@ -20,3 +20,13 @@ export function updateConfig(data) {
   })
 }
 
+//配置公司默认是否开启小黑屋
+export function configUserCheck(data) {
+  return request({
+    url: '/company/company/configUserCheck',
+    method: 'post',
+    params: data
+  })
+}
+
+

+ 8 - 0
src/api/user/fsUser.js

@@ -67,3 +67,11 @@ export function listSalesStaff() {
     method: 'get'
   })
 }
+// 移除小黑屋
+export function auditUser(data) {
+  return request({
+    url: '/user/fsUser/auditUser',
+    method: 'post',
+    data: data
+  })
+}

+ 33 - 1
src/views/company/companyConfig/index.vue

@@ -129,6 +129,18 @@
             </div>
           </el-form>
         </el-tab-pane>
+        <el-tab-pane label="配置销售会员审核" name="companyUserConfig">
+          <el-form ref="companyUserConfig" label-width="140px">
+            <el-form-item label="会员是否默认黑名单">
+              <el-row>
+                <el-switch v-model="userIsDefaultBlack"></el-switch>
+              </el-row>
+            </el-form-item>
+            <div style="float:right;margin-right:20px">
+              <el-button type="primary" @click="onSubmit5">提交</el-button>
+            </div>
+          </el-form>
+        </el-tab-pane>
       </el-tabs>
 
       <el-dialog :title="customerExt.title" :visible.sync="customerExt.open" width="500px" append-to-body>
@@ -156,7 +168,7 @@
 
 <script>
 import { getCompanyInfo } from "@/api/company/company";
-import { getConfigKey,updateConfig } from "@/api/company/companyConfig";
+import { getConfigKey,updateConfig, configUserCheck } from "@/api/company/companyConfig";
 import { listCustomerExt, getCustomerExt, delCustomerExt, addCustomerExt, updateCustomerExt } from "@/api/crm/customerExt";
 
 export default {
@@ -204,6 +216,8 @@ export default {
 
       qwConfigForm:{},
       qwkfConfigForm:{},
+      companyUserConfig: {},
+      userIsDefaultBlack: false,
     };
   },
   created() {
@@ -212,6 +226,7 @@ export default {
     this.getConfigKey("qw:config");
     this.getConfigKey("customer:config");
     this.getConfigKey("redPacket:config");
+    this.getConfigKey("companyUser:config");
     this.getDicts("sys_company_status").then((response) => {
       this.statusOptions = response.data;
     });
@@ -315,6 +330,12 @@ export default {
               if(response.data.configValue!=null){
                 this.redPacketConfig=JSON.parse(response.data.configValue);
               }
+            }else if (key=="companyUser:config"){
+              console.log(response.data)
+              this.companyUserConfig=response.data;
+              if(response.data.configValue != null){
+                this.userIsDefaultBlack = JSON.parse(response.data.configValue);
+              }
             }
 
         });
@@ -355,6 +376,17 @@ export default {
         }
       });
     },
+    onSubmit5() {
+      this.companyUserConfig.configValue=JSON.stringify(this.userIsDefaultBlack);
+      console.log(this.companyUserConfig)
+      console.log(this.userIsDefaultBlack)
+      configUserCheck({userIsDefaultBlack: this.userIsDefaultBlack}).then(response => {
+        if (response.code === 200) {
+          this.msgSuccess("修改成功");
+          this.getConfigKey("companyUser:config");
+        }
+      });
+    },
   }
 };
 </script>

+ 28 - 19
src/views/member/list.vue

@@ -172,24 +172,17 @@
       <el-table-column label="注册时间" align="center" prop="createTime" width="160" />
       <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
       <el-table-column label="所属员工" align="center" prop="companyUserNickName" />
-<!--      <el-table-column label="操作" align="center" width="180" 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="['user:fsUser:edit']"-->
-<!--          >编辑</el-button>-->
-<!--          <el-button-->
-<!--            size="mini"-->
-<!--            type="text"-->
-<!--            icon="el-icon-delete"-->
-<!--            @click="handleDelete(scope.row)"-->
-<!--            v-hasPermi="['user:fsUser:remove']"-->
-<!--          >删除</el-button>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
+      <el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-check"
+            @click="handleAudit(scope.row)"
+            v-if="scope.row.isCurrentCompanyUser === 1 && scope.row.status === 0"
+          >审核会员</el-button>
+        </template>
+      </el-table-column>
     </el-table>
 
     <pagination
@@ -267,7 +260,7 @@
 </template>
 
 <script>
-import { listUser, getUser, addUser, updateUser, delUser, exportUser } from "@/api/user/fsUser";
+import { listUser, getUser, addUser, updateUser, delUser, exportUser, auditUser } from "@/api/user/fsUser";
 
 export default {
   name: "FsUser",
@@ -523,6 +516,22 @@ export default {
       }).then(response => {
         this.download(response.msg);
       }).catch(() => {});
+    },
+
+    /** 审核会员操作 */
+    handleAudit(row) {
+      this.$confirm('是否确认将其移除小黑屋?', "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        auditUser([row.userId]).then(response => {
+          if (response.code === 200) {
+            this.msgSuccess("审核成功");
+            this.getList();
+          }
+        });
+      }).catch(() => {});
     }
   }
 };