|
@@ -19,6 +19,28 @@
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="所属公司" prop="companyIds" >
|
|
|
+ <el-select
|
|
|
+ v-model="companyIds"
|
|
|
+ filterable
|
|
|
+ multiple
|
|
|
+ remote
|
|
|
+ reserve-keyword
|
|
|
+ placeholder="请输入关键字搜索"
|
|
|
+ :remote-method="fetchCompanies"
|
|
|
+ :loading="loadingCompanies"
|
|
|
+ size="small"
|
|
|
+ @change="formatCompanies"
|
|
|
+ style="width: 180px"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="company in companyOptions"
|
|
|
+ :key="company.companyId"
|
|
|
+ :label="company.companyName"
|
|
|
+ :value="company.companyId"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
@@ -141,7 +163,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
-
|
|
|
+
|
|
|
<pagination
|
|
|
v-show="total>0"
|
|
|
:total="total"
|
|
@@ -151,15 +173,15 @@
|
|
|
/>
|
|
|
|
|
|
<!-- 添加或修改达人对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body @close="handleClose">>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
- <el-row>
|
|
|
- <el-col :span="8">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
<el-form-item label="昵称" prop="nickName">
|
|
|
<el-input v-model="form.nickName" placeholder="请输入昵称" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
+ <el-col :span="12">
|
|
|
<el-form-item label="性别" prop="sex">
|
|
|
<el-select v-model="form.sex" placeholder="性别" clearable size="small">
|
|
|
<el-option
|
|
@@ -171,7 +193,9 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
<el-form-item label="关联用户" prop="userId" >
|
|
|
<el-select v-model="form.userId" remote filterable reserve-keyword placeholder="输入手机号搜索" @change="selectUser" :remote-method="userMethod" >
|
|
|
<el-option
|
|
@@ -186,6 +210,25 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="关联公司" prop="companyId" >
|
|
|
+ <el-select v-model="form.companyId"
|
|
|
+ remote
|
|
|
+ filterable
|
|
|
+ reserve-keyword
|
|
|
+ placeholder="输入公司名称搜索"
|
|
|
+ :remote-method="fetchCompanies" >
|
|
|
+ <el-option
|
|
|
+ v-for="item in companyOptions"
|
|
|
+ :key="item.companyId"
|
|
|
+ :label="item.companyId"
|
|
|
+ :value="item.companyId">
|
|
|
+ <span style="float: left">{{ item.companyId }}</span>
|
|
|
+ <span style="margin-left: 30px ;">{{item.companyName}}</span>
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
|
|
|
<el-form-item label="头像" prop="avatar">
|
|
@@ -194,8 +237,8 @@
|
|
|
<el-form-item label="标题" prop="title">
|
|
|
<el-input v-model="form.title" type="textarea" placeholder="请输入内容" />
|
|
|
</el-form-item>
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="获赞数" prop="likes">
|
|
@@ -262,7 +305,16 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listUserTalent, getUserTalent, delUserTalent, addUserTalent, updateUserTalent, exportUserTalent,auditUserTalent } from "@/api/course/userTalent";
|
|
|
+import {
|
|
|
+ listUserTalent,
|
|
|
+ getUserTalent,
|
|
|
+ delUserTalent,
|
|
|
+ addUserTalent,
|
|
|
+ updateUserTalent,
|
|
|
+ exportUserTalent,
|
|
|
+ auditUserTalent,
|
|
|
+ getCompanies
|
|
|
+} from '@/api/course/userTalent'
|
|
|
import { listBySearch} from "@/api/his/user";
|
|
|
import ImageUpload from '@/components/ImageUpload/index';
|
|
|
import VideoUpload from '@/components/VideoUpload/index';
|
|
@@ -302,6 +354,8 @@ export default {
|
|
|
},
|
|
|
userList:[],
|
|
|
tagsOptions:[],
|
|
|
+ companyOptions:[],
|
|
|
+ loadingCompanies: false, // 加载状态
|
|
|
tags:[],
|
|
|
sexOptions:[],
|
|
|
// 遮罩层
|
|
@@ -339,8 +393,11 @@ export default {
|
|
|
fans: null,
|
|
|
likes: null,
|
|
|
isDel: null,
|
|
|
- isAudit:0
|
|
|
+ isAudit:0,
|
|
|
+ //销售公司
|
|
|
+ companyIdStr: null
|
|
|
},
|
|
|
+ companyIds: [],
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
// 表单校验
|
|
@@ -359,6 +416,9 @@ export default {
|
|
|
],
|
|
|
title: [
|
|
|
{ required: true, message: "标题不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ companyId: [
|
|
|
+ { required: true, message: "关联公司不能为空", trigger: "change" }
|
|
|
]
|
|
|
}
|
|
|
};
|
|
@@ -379,6 +439,27 @@ export default {
|
|
|
handleVideoDuration(duration) {
|
|
|
this.form.videoDuration = duration;
|
|
|
},
|
|
|
+ async fetchCompanies(query) {
|
|
|
+ if (!query) {
|
|
|
+ this.companyOptions = [];
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.loadingCompanies = true;
|
|
|
+ try {
|
|
|
+ getCompanies(query).then(response => {
|
|
|
+ this.companyOptions = response.data;
|
|
|
+ })
|
|
|
+ } catch (err) {
|
|
|
+ console.error('查询销售公司失败:', err);
|
|
|
+ this.companyOptions = [];
|
|
|
+ } finally {
|
|
|
+ this.loadingCompanies = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ formatCompanies(){
|
|
|
+ if(this.companyIds)
|
|
|
+ this.queryParams.companyIdStr = this.companyIds.join(',');
|
|
|
+ },
|
|
|
submitAuditForm(){
|
|
|
this.$refs["auditForm"].validate(valid => {
|
|
|
if(valid){
|
|
@@ -465,6 +546,12 @@ export default {
|
|
|
resetQuery() {
|
|
|
this.resetForm("queryForm");
|
|
|
this.handleQuery();
|
|
|
+ this.resetCompany();
|
|
|
+ },
|
|
|
+ resetCompany() {
|
|
|
+ this.companyOptions = [];
|
|
|
+ this.companyIds = [];
|
|
|
+ this.queryParams.companyIdStr=null;
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
@@ -494,6 +581,10 @@ export default {
|
|
|
this.title = "修改达人";
|
|
|
});
|
|
|
},
|
|
|
+ /**修改页面关闭方法*/
|
|
|
+ handleClose(){
|
|
|
+ this.resetCompany();
|
|
|
+ },
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
this.$refs["form"].validate(valid => {
|