|
@@ -74,7 +74,19 @@
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
-
|
|
|
+ <!-- 操作按钮区域 -->
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ icon="el-icon-d-arrow-right"
|
|
|
+ size="mini"
|
|
|
+ :disabled="multiple"
|
|
|
+ @click="handleTransfer"
|
|
|
+ v-hasPermi="['company:user:transfer']"
|
|
|
+ >转移</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
<!-- Tab Selection -->
|
|
|
<!-- <el-tabs v-model="queryParams.tabValue" @tab-click="handleTabChange">-->
|
|
|
<!-- <el-tab-pane label="全部" name="0"></el-tab-pane>-->
|
|
@@ -256,16 +268,58 @@
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- 客户转移对话框 (可选,更复杂的转移逻辑可能需要) -->
|
|
|
+
|
|
|
+ <el-dialog title="客户转移" :visible.sync="openTransferDialog" width="500px" append-to-body>
|
|
|
+ <el-form ref="transferForm" :model="transferForm" label-width="100px" :rules="cusTransfer">
|
|
|
+ <el-alert
|
|
|
+ title="会经过总后台审核后才进行转移"
|
|
|
+ type="warning">
|
|
|
+ </el-alert>
|
|
|
+ <el-form-item label="转移至销售" prop="targetUserId">
|
|
|
+ <el-select v-model="transferForm.targetUserId" remote placeholder="请选择" filterable clearable>
|
|
|
+ <el-option
|
|
|
+ v-for="dict in companyUserList"
|
|
|
+ :key="`${dict.nickName} - ${dict.userName}`"
|
|
|
+ :label="`${dict.nickName} - ${dict.userName}`"
|
|
|
+ :value="dict.userId">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="转移原因" prop="content">
|
|
|
+ <el-input type="textarea" v-model="transferForm.content" placeholder="转移原因"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <p>确定要转移选中的 <strong>{{ ids.length }}</strong> 个客户吗?</p>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="danger" @click="submitTransfer">提交申请</el-button>
|
|
|
+ <el-button @click="cancelTransfer">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { listUser, getUser, addUser, updateUser, delUser, exportUser, auditUser } from "@/api/user/fsUser";
|
|
|
+import {transferUser} from "@/api/users/user";
|
|
|
+import {getUserList} from "@/api/company/companyUser";
|
|
|
|
|
|
export default {
|
|
|
name: "FsUser",
|
|
|
data() {
|
|
|
return {
|
|
|
+ cusTransfer: {
|
|
|
+ targetUserId: [{required: true, message: '请选择转移至销售', trigger: 'change'}],
|
|
|
+ content: [{required: true, message: '请选择转移至销售', trigger: 'change'}]
|
|
|
+ },
|
|
|
+ companyUserList: [],
|
|
|
+ openTransferDialog: false,
|
|
|
+ transferForm: {
|
|
|
+ targetUserId: null,
|
|
|
+ content: null
|
|
|
+ },
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
// 选中数组
|
|
@@ -326,6 +380,11 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
+ getUserList().then(res=>{
|
|
|
+ if(res.code === 200) {
|
|
|
+ this.companyUserList = res.data
|
|
|
+ }
|
|
|
+ });
|
|
|
this.getList();
|
|
|
this.getDicts("user_status").then(response => {
|
|
|
this.statusOptions = response.data;
|
|
@@ -334,6 +393,59 @@ export default {
|
|
|
this.getSalesOptions();
|
|
|
},
|
|
|
methods: {
|
|
|
+ /** 提交转移按钮 (如果使用对话框) */
|
|
|
+
|
|
|
+ submitTransfer() {
|
|
|
+ this.$refs["transferForm"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ transferUser({
|
|
|
+ userIds: this.ids,
|
|
|
+ targetCompanyUserId: this.transferForm.targetUserId,
|
|
|
+ content: this.transferForm.content
|
|
|
+ }).then(response => {
|
|
|
+ if (response.code === 200) {
|
|
|
+ this.msgSuccess(response.msg);
|
|
|
+ this.openTransferDialog = false;
|
|
|
+ this.getList();
|
|
|
+ } else {
|
|
|
+ this.msgError(response.msg || "转移失败");
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ this.msgError("转移请求失败");
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 重置表单
|
|
|
+ resetForm() {
|
|
|
+ this.linkForm={
|
|
|
+ days:null,
|
|
|
+ courseId:null,
|
|
|
+ videoId:null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /** 转移按钮操作 */
|
|
|
+ handleTransfer(row) {
|
|
|
+
|
|
|
+ const userIds = row.userId ? [row.userId] : this.ids;
|
|
|
+ if (userIds.length === 0) {
|
|
|
+ this.$message.warning("请至少选择一个客户进行转移");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.resetTransferForm();
|
|
|
+ this.openTransferDialog = true;
|
|
|
+ },
|
|
|
+ resetTransferForm() {
|
|
|
+ this.transferForm = {
|
|
|
+ targetUserId: null,
|
|
|
+ content: null
|
|
|
+ };
|
|
|
+ this.resetForm("transferForm"); // 假设 transferForm 是 el-form 的 ref
|
|
|
+ },
|
|
|
+ cancelTransfer() {
|
|
|
+ this.openTransferDialog = false;
|
|
|
+ this.resetTransferForm();
|
|
|
+ },
|
|
|
/** 查询用户列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|