|
@@ -100,6 +100,14 @@
|
|
|
@click="handleAllowedAllRegister"
|
|
|
>允许注册会员开关</el-button>
|
|
|
</el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ size="mini"
|
|
|
+ @click="handleBindCompanyUserCode"
|
|
|
+ >生成注册/绑定销售二维码</el-button>
|
|
|
+ </el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
@@ -406,25 +414,60 @@
|
|
|
</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" slot="tip">-->
|
|
|
-<!-- <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
|
|
|
-<!-- <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>-->
|
|
|
-<!-- </div>-->
|
|
|
-<!-- <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</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>-->
|
|
|
+ <el-dialog :title="title" :visible.sync="bindCompanyOpen" width="700px" append-to-body>
|
|
|
+ <el-form ref="formBindCompany" :model="formBindCompany" :rules="bindCompanyRules" label-width="80px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="企微主体" prop="corpId">
|
|
|
+ <el-select v-model="formBindCompany.corpId" placeholder="企微主体" size="small">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in myQwCompanyList"
|
|
|
+ :key="dict.dictValue"
|
|
|
+ :label="dict.dictLabel"
|
|
|
+ :value="dict.dictValue"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="归属部门" prop="deptId">
|
|
|
+ <treeselect v-model="formBindCompany.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="角色" prop="roleIds">
|
|
|
+ <el-select v-model="formBindCompany.roleIds" multiple placeholder="请选择">
|
|
|
+ <el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId "></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="销售区域" prop="addressId">
|
|
|
+ <el-select v-model="formBindCompany.addressId" filterable placeholder="请选择所属销售的区域" style="width: 200px;">
|
|
|
+ <el-option
|
|
|
+ v-for="item in citysAreaList"
|
|
|
+ :key="item.cityId"
|
|
|
+ :label="item.cityName"
|
|
|
+ :value="item.cityId"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitBingCompanyForm">确 定</el-button>
|
|
|
+ <el-button @click="cancelBind">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<el-dialog :title="user.title" :visible.sync="user.open" width="1000px" append-to-body>
|
|
|
<selectUser ref="selectUser" @bindQwUser="bindQwUser"></selectUser>
|
|
|
</el-dialog>
|
|
@@ -470,6 +513,17 @@
|
|
|
<el-button @click="allowedAllRegisterOpen = false">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-dialog :title="bindCompanyUrl.title" v-if="bindCompanyUrl.open" :visible.sync="bindCompanyUrl.open" width="450px" append-to-body>
|
|
|
+ <div style="padding-bottom:15px;" >
|
|
|
+ <img :src="bindCompanyUrl.url" width="400px">
|
|
|
+ </div>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="downloadImage(bindCompanyUrl.url, bindCompanyUrl.name+'.png')">下载二维码</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -500,6 +554,7 @@ import { getMyQwUserList,getMyQwCompanyList } from "@/api/qw/user";
|
|
|
import selectUser from "@/views/company/components/selectQwUser.vue";
|
|
|
import { getConfigByKey } from "@/api/company/companyConfig";
|
|
|
import axios from "axios";
|
|
|
+import {addCodeUrl} from "../../../api/company/companyUser";
|
|
|
export default {
|
|
|
name: "User",
|
|
|
components: { Treeselect ,selectUser},
|
|
@@ -538,6 +593,7 @@ export default {
|
|
|
deptOptions: undefined,
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
+ bindCompanyOpen: false,
|
|
|
qwOpen:false,
|
|
|
// 部门名称
|
|
|
deptName: undefined,
|
|
@@ -569,6 +625,15 @@ export default {
|
|
|
citysAreaList:[],
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
+ formBindCompany: {},
|
|
|
+
|
|
|
+ bindCompanyUrl:{
|
|
|
+ open:false,
|
|
|
+ title:"绑定/注册销售二维码",
|
|
|
+ name:null,
|
|
|
+ url:null,
|
|
|
+ },
|
|
|
+
|
|
|
form1: {},
|
|
|
defaultProps: {
|
|
|
children: "children",
|
|
@@ -646,6 +711,21 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
+ // 表单校验
|
|
|
+ bindCompanyRules: {
|
|
|
+ deptId: [
|
|
|
+ { required: true, message: "归属部门不能为空", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ addressId: [
|
|
|
+ { required: true, message: "销售所属区域不能为空", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ roleIds: [
|
|
|
+ { required: true, message: "角色不能为空", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ corpId: [
|
|
|
+ { required: true, message: "角色不能为空", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
// 是否允许注册会员开关
|
|
|
allowedAllRegisterOpen: false,
|
|
|
allowedAllRegisterForm: {
|
|
@@ -771,6 +851,10 @@ export default {
|
|
|
this.open = false;
|
|
|
this.reset();
|
|
|
},
|
|
|
+ cancelBind(){
|
|
|
+ this.bindCompanyOpen=false;
|
|
|
+ this.resetBindCompany();
|
|
|
+ },
|
|
|
|
|
|
submitFormArea(address){
|
|
|
const uIds = this.ids;
|
|
@@ -820,6 +904,15 @@ export default {
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
},
|
|
|
+
|
|
|
+ resetBindCompany() {
|
|
|
+ this.formBindCompany = {
|
|
|
+ deptId: null,
|
|
|
+ addressId: null,
|
|
|
+ roleIds: [],
|
|
|
+ };
|
|
|
+ this.resetForm("formBindCompany");
|
|
|
+ },
|
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
this.queryParams.page = 1;
|
|
@@ -850,6 +943,17 @@ export default {
|
|
|
console.log(" this.form1 ", this.form1)
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ handleBindCompanyUserCode(){
|
|
|
+ this.reset();
|
|
|
+ this.getTreeselect();
|
|
|
+ getUser().then((response) => {
|
|
|
+ this.postOptions = response.posts;
|
|
|
+ this.roleOptions = response.roles;
|
|
|
+ this.bindCompanyOpen = true;
|
|
|
+ this.title = "创建 新增/绑定销售 的二维码";
|
|
|
+ });
|
|
|
+ },
|
|
|
qwBind(row){
|
|
|
this.qwUser=[];
|
|
|
this.qwUserList=[];
|
|
@@ -960,6 +1064,39 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ downloadImage(imageSrc, fileName) {
|
|
|
+ const link = document.createElement('a');
|
|
|
+ link.href = imageSrc;
|
|
|
+ link.download = fileName || '绑定或新增销售.png';
|
|
|
+ document.body.appendChild(link);
|
|
|
+ link.click();
|
|
|
+ document.body.removeChild(link);
|
|
|
+ },
|
|
|
+
|
|
|
+ submitBingCompanyForm: function () {
|
|
|
+
|
|
|
+ this.$refs["formBindCompany"].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+
|
|
|
+ let loadingRock = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '生成二维码中~~请不要刷新页面!!',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ });
|
|
|
+
|
|
|
+ addCodeUrl(this.formBindCompany).then((response) => {
|
|
|
+ this.bindCompanyOpen=false;
|
|
|
+ this.bindCompanyUrl.url=response.data.url
|
|
|
+ this.bindCompanyUrl.open=true;
|
|
|
+ this.bindCompanyUrl.name="绑定或新增 销售二维码";
|
|
|
+ }).finally(res=>{
|
|
|
+ loadingRock.close();
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
/**
|
|
|
* 同步企业微信员工
|
|
|
*/
|