Jelajahi Sumber

小黑屋配置

ct 2 hari lalu
induk
melakukan
0ceefddbde
2 mengubah file dengan 50 tambahan dan 1 penghapusan
  1. 10 0
      src/api/company/companyConfig.js
  2. 40 1
      src/views/company/companyConfig/index.vue

+ 10 - 0
src/api/company/companyConfig.js

@@ -20,3 +20,13 @@ export function updateConfig(data) {
   })
 }
 
+//配置公司默认是否开启小黑屋
+export function configUserCheck(data) {
+  return request({
+    url: '/company/company/configUserCheck',
+    method: 'post',
+    params: data
+  })
+}
+
+

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

@@ -135,6 +135,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="onSubmit6">提交</el-button>
+            </div>
+          </el-form>
+        </el-tab-pane>
       </el-tabs>
 
       <el-dialog :title="customerExt.title" :visible.sync="customerExt.open" width="500px" append-to-body>
@@ -162,7 +174,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 {
@@ -225,6 +237,8 @@ export default {
       },
       qwConfigForm:{},
       qwkfConfigForm:{},
+      companyUserConfig: {},
+      userIsDefaultBlack: null,
     };
   },
   created() {
@@ -247,6 +261,14 @@ export default {
     getCompanyInfo(){
       getCompanyInfo().then(response => {
         this.company = response.data;
+        if(response.data.fsUserIsDefaultBlack != null){
+          const userIsDefaultBlack = response.data.fsUserIsDefaultBlack
+          if(userIsDefaultBlack == 1){
+            this.userIsDefaultBlack = true
+          } else{
+            this.userIsDefaultBlack = false
+          }
+        }
       });
     },
     /** 新增按钮操作 */
@@ -356,6 +378,12 @@ export default {
               if(response.data.configValue!=null){
                 this.AiKfConfig=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);
+              }
             }
 
         });
@@ -405,6 +433,17 @@ export default {
         }
       });
     },
+    onSubmit6() {
+      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>