Sfoglia il codice sorgente

商机模板/和直播

三七 2 settimane fa
parent
commit
5f34119c46

+ 70 - 0
src/api/crm/business.js

@@ -0,0 +1,70 @@
+import request from '@/utils/request'
+
+// 查询商机列表
+export function listBusiness(query) {
+  return request({
+    url: '/crm/business/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询商机详细
+export function getBusiness(businessId) {
+  return request({
+    url: '/crm/business/' + businessId,
+    method: 'get'
+  })
+}
+
+// 新增商机
+export function addBusiness(data) {
+  return request({
+    url: '/crm/business',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改商机
+export function updateBusiness(data) {
+  return request({
+    url: '/crm/business',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除商机
+export function delBusiness(businessId) {
+  return request({
+    url: '/crm/business/' + businessId,
+    method: 'delete'
+  })
+}
+
+// 导出商机
+export function exportBusiness(query) {
+  return request({
+    url: '/crm/business/export',
+    method: 'get',
+    params: query
+  })
+}
+
+//捞取商机
+export function gainBusiness(data) {
+  return request({
+    url: '/crm/business/gain',
+    method: 'post',
+    data: data
+  })
+}
+
+// // 删除商机
+// export function setBusinessPool(businessId) {
+//   return request({
+//     url: '/crm/business/' + businessId,
+//     method: 'get'
+//   })
+// }

+ 53 - 0
src/api/crm/extDetail.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询字段扩展详情列表
+export function listDetail(query) {
+  return request({
+    url: '/crm/detail/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询字段扩展详情详细
+export function getDetail(id) {
+  return request({
+    url: '/crm/detail/' + id,
+    method: 'get'
+  })
+}
+
+// 新增字段扩展详情
+export function addDetail(data) {
+  return request({
+    url: '/crm/detail',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改字段扩展详情
+export function updateDetail(data) {
+  return request({
+    url: '/crm/detail',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除字段扩展详情
+export function delDetail(id) {
+  return request({
+    url: '/crm/detail/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出字段扩展详情
+export function exportDetail(query) {
+  return request({
+    url: '/crm/detail/export',
+    method: 'get',
+    params: query
+  })
+}

+ 28 - 0
src/api/crm/extLog.js

@@ -0,0 +1,28 @@
+import request from '@/utils/request'
+
+// 查询修改字段扩展日志列表
+export function listLog(query) {
+  return request({
+    url: '/crm/log/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询修改字段扩展日志详细
+export function getLog(logId) {
+  return request({
+    url: '/crm/log/' + logId,
+    method: 'get'
+  })
+}
+
+
+// 导出修改字段扩展日志
+export function exportLog(query) {
+  return request({
+    url: '/crm/log/export',
+    method: 'get',
+    params: query
+  })
+}

+ 53 - 0
src/api/system/show.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询用户展示字段列表
+export function listShow(query) {
+  return request({
+    url: '/system/show/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询用户展示字段详细
+export function getShow(type) {
+  return request({
+    url: '/system/show/' + type,
+    method: 'get'
+  })
+}
+
+// 新增用户展示字段
+export function addShow(data) {
+  return request({
+    url: '/system/show',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改用户展示字段
+export function updateShow(data) {
+  return request({
+    url: '/system/show',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除用户展示字段
+export function delShow(id) {
+  return request({
+    url: '/system/show/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出用户展示字段
+export function exportShow(query) {
+  return request({
+    url: '/system/show/export',
+    method: 'get',
+    params: query
+  })
+}

+ 480 - 0
src/views/crm/components/addBusiness.vue

@@ -0,0 +1,480 @@
+<template>
+    <div>
+        <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+            <el-form-item label="线索来源" prop="source">
+                <el-select v-model="form.source" :disabled="form.source !== null" placeholder="请选择线索来源" clearable size="small">
+                <el-option
+                    v-for="item in clueSourceOptions"
+                    :key="item.dictValue"
+                    :label="item.dictLabel"
+                    :value="item.dictValue"
+                />
+                </el-select>
+            </el-form-item>
+            <el-form-item label="客户经理" prop="manager">
+                <el-input v-model="form.manager" placeholder="请输入客户经理" />
+            </el-form-item>
+            <el-form-item label="客户名称" prop="companyName">
+                <el-input v-model="form.companyName" :disabled="form.customerId !== null" placeholder="请输入公司名称(只填公司全称,个人用户就填名字)" />
+            </el-form-item>
+            <el-form-item label="联系电话" prop="mobile">
+                <el-input  v-model="form.mobile" :disabled="form.customerId !== null" placeholder="请输入电话号码"/>
+                <!-- <el-button type="text" @click="showAddContactDialog">添加其他联系电话</el-button> -->
+            </el-form-item>
+            <el-form-item label="其他联系方式">
+                <el-button type="text" @click="showAddContactDialog">添加其他联系电话</el-button>
+            </el-form-item>
+            <el-table border v-loading="loading" :data="mobileList" v-if="mobileList && mobileList.length > 0" >
+                <el-table-column label="姓名" align="center" prop="name" />
+                <el-table-column label="手机" align="center" prop="mobile" />
+                <el-table-column label="备注" align="center" prop="remark" />
+                <el-table-column label="操作" align="center" 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="['crm:customerContacts:edit']"
+                    >修改</el-button> -->
+                    <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-delete"
+                    @click="handleDelete(scope.row)"
+                    v-hasPermi="['crm:customerContacts:remove']"
+                    v-if="scope.row.contactsId == null"
+                    >删除</el-button>
+                </template>
+                </el-table-column>
+            </el-table>
+
+            <el-form-item label="接口人角色" prop="contactRole">
+                <el-select v-model="form.contactRole" placeholder="请选择" clearable size="small">
+                    <el-option
+                        v-for="item in contactRoleOptions"
+                        :key="item.dictValue"
+                        :label="item.dictLabel"
+                        :value="item.dictValue"
+                    />
+                </el-select>
+            </el-form-item>
+            <el-form-item label="业务场景" prop="businessScenario">
+                <!-- <el-input v-model="form.businessScenario" placeholder="例:网站,电商,游戏,小程序,APP,OA,ERP,CRM,物联网,AI人工智能,国产化,数字人,内部办公系统,等保,其他" /> -->
+                <el-select v-model="form.businessScenario"  placeholder="请选择线索业务场景" clearable size="small">
+                <el-option
+                    v-for="item in businessScenarioOptions"
+                    :key="item.dictValue"
+                    :label="item.dictLabel"
+                    :value="item.dictValue"
+                />
+                </el-select>
+            </el-form-item>
+            <el-form-item label="意向产品" prop="product">
+                <!-- <el-input v-model="form.product" placeholder="请输入方案涉及产品" /> -->
+                <el-button icon="el-icon-plus" size="mini" @click="addProduct">添加产品</el-button>
+            </el-form-item>
+            <el-form-item label="采购周期" prop="purchaseCycle">
+                <el-input v-model="form.purchaseCycle" placeholder="请输入采购周期(单位:天)" />
+            </el-form-item>
+            <el-form-item label="跟进状态" prop="businessStatus">
+                <el-radio-group v-model="form.businessStatus">
+                    <el-radio label="0">跟进中</el-radio>
+                    <el-radio label="1">已流失</el-radio>
+                    <el-radio label="2">已赢单</el-radio>
+                    <el-radio label="3">待验证</el-radio>
+                </el-radio-group>
+            </el-form-item>
+            <!-- <el-form-item label="沟通进展" prop="remark">
+                <el-input v-model="form.remark" placeholder="请输入沟通进展" />
+            </el-form-item> -->
+            <el-form-item label="项目阶段" prop="projectPhase">
+                <el-select v-model="form.projectPhase" placeholder="请选择" clearable size="small">
+                    <el-option
+                        v-for="item in projectPhaseOptions"
+                        :key="item.dictValue"
+                        :label="item.dictLabel"
+                        :value="item.dictValue"
+                    />
+                </el-select>
+            </el-form-item>
+            <el-form-item label="意向等级" prop="level">
+                <el-select v-model="form.level" placeholder="请选择" clearable size="small">
+                    <el-option
+                        v-for="item in levelOptions"
+                        :key="item.dictValue"
+                        :label="item.dictLabel"
+                        :value="item.dictValue"
+                    />
+                </el-select>
+            </el-form-item>
+            <el-form-item label="是否绑定BP账号">
+                <el-radio-group v-model="form.isBp">
+                    <el-radio label="0">未注册</el-radio>
+                    <el-radio label="1">已注册未绑定</el-radio>
+                    <el-radio label="2">不明确</el-radio>
+                    <el-radio label="3">已绑定</el-radio>
+                </el-radio-group>
+            </el-form-item>
+            <!-- <el-form-item label="BP账户" prop="bpAccount">
+                <el-input v-model="form.bpAccount" placeholder="请输入BP账户" />
+            </el-form-item> -->
+            <el-form-item label="预计成单时间" prop="preTime">
+                <el-date-picker clearable size="small" style="width: 200px"
+                    v-model="form.preTime"
+                    type="date"
+                    value-format="yyyy-MM-dd"
+                    placeholder="选择预计成单时间">
+                </el-date-picker>
+            </el-form-item>
+            <el-form-item label="预计成交金额" prop="preMoney">
+                <el-input v-model="form.preMoney" placeholder="请输入预计成交金额(元)" />
+            </el-form-item>
+            <el-form-item label="下次跟进时间" prop="nextTime">
+                <el-date-picker clearable size="small" style="width: 200px"
+                    v-model="form.nextTime"
+                    type="date"
+                    value-format="yyyy-MM-dd"
+                    placeholder="选择下次跟进时间">
+                </el-date-picker>
+            </el-form-item>
+            <!-- <el-form-item label="回收时间" prop="recoveryTime">
+                <el-date-picker clearable size="small" style="width: 200px"
+                    v-model="form.recoveryTime"
+                    type="date"
+                    value-format="yyyy-MM-dd"
+                    placeholder="选择回收时间">
+                </el-date-picker>
+            </el-form-item> -->
+            <!-- <el-form-item label="状态">
+                <el-radio-group v-model="form.status">
+                    <el-radio label="1">已分配</el-radio>
+                    <el-radio label="2">进行中</el-radio>
+                    <el-radio label="3">回收</el-radio>
+                </el-radio-group>
+            </el-form-item> -->
+        </el-form>
+        <div class="footer">
+            <el-button type="primary" @click="submitForm">确 定</el-button>
+        </div>
+
+
+        <el-dialog  :title=title :visible.sync="open" width="500px" append-to-body>
+            <el-form ref="contactForm" :model="contactForm" :rules="contactRules" label-width="120px">
+            <el-form-item label="联系人名称" prop="name">
+                <el-input v-model="contactForm.name" placeholder="请输入联系人名称" />
+            </el-form-item>
+            <el-form-item label="手机" prop="mobile">
+                <el-input v-model="contactForm.mobile" placeholder="请输入手机" />
+            </el-form-item>
+            <el-form-item label="备注" prop="remark">
+                <el-input v-model="contactForm.remark" type="textarea" placeholder="请输入内容" />
+            </el-form-item>
+            </el-form>
+            <div slot="footer" class="dialog-footer">
+                <el-button type="primary" @click="submitContactForm">确 定</el-button>
+                <el-button @click="cancelContact">取 消</el-button>
+            </div>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+    import { addBusiness } from "@/api/crm/business";
+    import { listCustomerContacts, getCustomerContacts, addCustomerContacts, exportCustomerContacts } from "@/api/crm/customerContacts";
+    export default {
+        name: "business",
+        data() {
+            return {
+                // 弹出层标题
+                title: "",
+                // 是否显示弹出层
+                open: false,
+                // 遮罩层
+                loading: true,
+                mobileList:[],
+                // dialogVisible:false,
+                //联系方式表格
+                contactForm:{
+                    contactsId:null,
+                    customerId:null,
+                    businessId:null,
+                    name:null,
+                    mobile:null,
+                    remark:null
+                },
+                businessScenarioOptions:[],
+                clueSourceOptions:[],
+                contactRoleOptions:[],
+                projectPhaseOptions:[],
+                levelOptions:[],
+                form: {
+                    businessId: null,
+                    customerId: null,
+                    source: null,
+                    manager: null,
+                    companyName: null,
+                    mobile: null,
+                    mobileList:[],
+                    contactRole: null,
+                    businessScenario: null,
+                    product: null,
+                    purchaseCycle: null,
+                    businessStatus: "0",
+                    remark: null,
+                    projectPhase: null,
+                    level: null,
+                    isBp: '0',
+                    bpAccount: null,
+                    preTime: null,
+                    preMoney: null,
+                    nextTime: null,
+                    createTime: null,
+                    updateTime: null,
+                    createBy: null,
+                    recoveryTime: null,
+                    status: '1'
+                },
+                // 表单校验
+                rules: {
+                    source:[
+                        { required: true, message: "客户来源不能为空", trigger: "change" }
+                    ],
+                    companyName: [
+                        { required: true, message: "客户名称不能为空", trigger: "blur" }
+                    ],
+                    mobile: [
+                        { required: true, message: "联系电话不能为空", trigger: "blur" },
+                    ],
+                    businessScenario: [
+                        { required: true, message: "业务场景不能为空", trigger: "change" }
+                    ],
+                    businessStatus:[
+                        { required: true, message: "请选择跟进状态", trigger: "change" }
+                    ],
+                    projectPhase:[
+                        { required: true, message: "请选择项目阶段", trigger: "change" }
+                    ],
+
+                },
+                //联系方式表单校验
+                contactRules:{
+                    name:[
+                        { required: true, message: "联系人不能为空", trigger: "blur" }
+                    ],
+                    mobile: [
+                        { required: true, message: "手机不能为空", trigger: "blur" },
+                        { min: 8, max: 11, message: '长度在 8 到 11 个字符', trigger: 'blur' }
+                    ]
+                }
+
+            };
+        },
+        created() {
+
+            this.getDicts("crm_customer_source").then((response) => {
+                this.clueSourceOptions = response.data;
+            });
+            this.getDicts("crm_contact_role").then((response) => {
+                this.contactRoleOptions = response.data;
+            });
+            this.getDicts("crm_project_phase").then((response) => {
+                this.projectPhaseOptions = response.data;
+            });
+            this.getDicts("crm_level").then((response) => {
+                this.levelOptions = response.data;
+            });
+            this.getDicts("business_scenario_type").then((response) => {
+                this.businessScenarioOptions = response.data;
+            });
+        },
+        methods: {
+            addProduct(){
+
+            },
+            delCustomerContacts(mobile){
+                const index = this.mobileList.findIndex(phone => phone.id === mobile);
+                if (index !== -1) {
+                    this.mobileList.splice(index, 1); // 删除找到的对象
+                }
+                this.open = false;
+                this.loading = false;
+                console.log("3333333333333",JSON.String(mobileList))
+            },
+            /** 删除按钮操作 */
+            handleDelete(row) {
+                this.loading = true;
+                const mobile = row.mobile
+                const index = this.mobileList.findIndex(phone => phone.mobile === mobile);
+                if (index !== -1) {
+                    this.mobileList.splice(index, 1); // 删除找到的对象
+                }
+                this.open = false;
+                this.loading = false;
+
+            },
+            /** 修改按钮操作 */
+            // handleUpdate(row) {
+            //     // this.resetContact();
+            //     if (row.contactsId == undefined){
+            //         console.log('============================')
+            //         this.contactForm = {name:this.form.companyName,mobile:this.form.mobile}
+            //     } else{
+            //         this.resetContact();
+            //         getCustomerContacts(row.contactsId).then(response => {
+            //             this.contactForm = response.data;
+            //         });
+            //     }
+            //     // const contactsId = row.contactsId
+            //     console.log("row",JSON.stringify(this.contactForm))
+            //     this.open = true;
+            //     this.title = "修改客户联系人";
+            // },
+            /** 提交按钮 */
+            submitContactForm() {
+                this.$refs["contactForm"].validate(valid => {
+                if (valid) {
+                    console.log("13579246810",JSON.stringify(this.contactForm))
+                        //新增
+                        const newMobile = {
+                            mobile: this.contactForm.mobile,
+                            name:this.contactForm.name,
+                            remark:this.contactForm.remark,
+                        };
+                        this.mobileList.push(newMobile);
+                        this.open = false;
+                        this.loading = false;
+                }});
+            },
+            updateMobileList(mobile, newMobileData) {
+                // 查找要修改的对象
+                const index = this.mobileList.findIndex(phone => phone.mobile === mobile);
+                if (index !== -1) {
+                // 更新找到的对象
+                this.$set(this.mobileList, index, { ...this.mobileList[index], ...newMobileData });
+                }
+            },
+            // 取消按钮
+            cancelContact() {
+                this.open = false;
+                this.resetContact();
+            },
+            resetContact(){
+                this.contactForm = {
+                    contactsId: null,
+                    customerId: null,
+                    name: null,
+                    mobile: null,
+                    email: null,
+                    weixin: null,
+                    address: null,
+                    remark: null,
+                    createUserId: null,
+                    createTime: null,
+                    updateTime: null,
+                    isDel: null,
+                    companyId: null
+                };
+            },
+            //添加联系方式
+            showAddContactDialog() {
+                this.open = true; // 显示弹窗
+                this.contactForm.mobile = ''; // 清空表单数据
+            },
+            addContact() {
+                // 添加联系方式逻辑
+                console.log('添加联系方式:', this.contactForm);
+                this.form.mobile = this.contactForm.mobile; // 将联系方式添加到form.mobile
+                this.open = false; // 关闭弹窗
+            },
+            updateReset(row){
+                this.form = row;
+                if(row.source != null){
+                    this.form.source = String(row.source);
+                }
+                if(row.contactRole != null){
+                    this.form.contactRole = String(row.contactRole);
+                }
+                this.mobileList = this.form.mobileList;
+                this.loading = false;
+                if(row.businessStatus != null){
+                    this.form.businessStatus = String(row.businessStatus);
+                }
+                if(row.level != null){
+                    this.form.level = String(row.level);
+                }
+                if(row.isBp != null){
+                    this.form.isBp = String(row.isBp);
+                }
+            },
+            reset(row) {
+                this.form = row;
+                this.form.source=String(row.source);
+                //电话
+                this.getContact(row.customerId,this.form.businessId);
+                //跟进状态
+                this.form.businessStatus = '0'
+                //客户名字
+                this.form.companyName = row.customerName
+            },
+            getContact(customerId,businessId){
+                this.loading = true;
+                listCustomerContacts({customerId:customerId,businessId:businessId}).then(response=>{
+                    if (response.code === 200) {
+                        if(response.rows.length>0)
+                            this.mobileList = response.rows;
+                            this.loading = false;
+                        } else{
+                            this.mobileList = []
+                        }
+                })
+                console.log("========",JSON.stringify(this.mobileList))
+            },
+            /** 提交按钮 */
+            submitForm() {
+                this.$refs["form"].validate(valid => {
+                if (valid) {
+                    this.form.mobileList = this.mobileList;
+                    addBusiness(this.form).then(response => {
+                        if (response.code === 200) {
+                            this.msgSuccess("提交成功");
+                            this.$emit('closeBusiness');
+                        }
+                    });
+                }
+                });
+            },
+        }
+    };
+</script>
+<style lang="scss" scoped>
+.contents{
+    height: 100%;
+    background-color: #fff;
+    padding: 20px;
+
+}
+.footer{
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+}
+</style>
+
+
+<style scoped>
+  .avatar-uploader .el-upload {
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+  }
+  .avatar-uploader .el-upload:hover {
+    border-color: #409EFF;
+  }
+</style>
+
+
+
+

+ 96 - 0
src/views/crm/components/setColumn.vue

@@ -0,0 +1,96 @@
+<template>
+    <div>
+        <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+            <el-form-item label="全部字段" prop="columns">
+                <p></p>
+                <el-checkbox-group v-model="form.columns">
+                    <!-- 循环遍历选项 -->
+                    <el-checkbox
+                        v-for="(item, index) in allColumns"
+                        :key="index"
+                        :label="item.prop"
+                        :disabled="item.prop == 'customerId' || item.prop == 'businessId'"
+                    >
+                        {{ item.label }}
+                    </el-checkbox>
+                </el-checkbox-group>
+            </el-form-item>
+            <div   class="footer">
+                <el-button type="primary" @click="submitForm">确定</el-button>
+                <el-button  @click="cancel">取消</el-button>
+            </div>
+        </el-form>
+    </div>
+</template>
+
+<script>
+    import {updateShow} from "@/api/system/show";
+
+    export default {
+        name: "business",
+        data() {
+            return {
+                form:{
+                    type:'',
+                    columns:[],
+                },
+                allColumns:[],
+                // 表单校验
+                rules: {
+                    type: [
+                        { required: true, message: "type不能为空", trigger: "blur" }
+                    ],
+                    columns: [
+                        { required: true, message: '请至少选择一个选项', trigger: 'change' },
+                        ],
+
+                },
+
+
+            }
+        },
+
+        created() {
+
+        },
+        methods: {
+            cancel(){
+                this.$emit('close');
+            },
+            reset(allColumns,selectedKeys,type,){
+                this.allColumns = allColumns;
+                this.form.columns = selectedKeys;
+                this.form.type = type;
+                console.log("==========",JSON.stringify(this.allColumns))
+                console.log("==========2",JSON.stringify(this.form.columns))
+            },
+            /** 提交按钮 */
+            submitForm() {
+                this.$refs["form"].validate(valid => {
+                if (valid) {
+                    console.log("==========2",JSON.stringify(this.form))
+                    updateShow(this.form).then(response => {
+                        if (response.code === 200) {
+                            this.msgSuccess("提交成功");
+                            this.$emit('close');
+                        }
+                    });
+                }
+                });
+            },
+        }
+    };
+</script>
+<style lang="scss" scoped>
+.contents{
+    height: 100%;
+    background-color: #fff;
+    padding: 20px;
+
+}
+.footer{
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+}
+</style>

+ 826 - 0
src/views/crm/customerBusiness/index.vue

@@ -0,0 +1,826 @@
+<template>
+  <div class="app-container"  customer-page-box>
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <!-- <el-form-item label="客户名称" prop="companyName">
+        <el-input
+          v-model="queryParams.companyName"
+          placeholder="请输入客户名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item> -->
+      <el-form-item label="线索来源" prop="source">
+        <el-select v-model="queryParams.source" placeholder="请选择线索来源" clearable size="small">
+          <el-option
+            v-for="item in clueSourceOptions"
+              :key="item.dictValue"
+              :label="item.dictLabel"
+              :value="item.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <!-- <el-form-item label="客户经理" prop="manager">
+        <el-input
+          v-model="queryParams.manager"
+          placeholder="请输入客户经理"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item> -->
+      <el-form-item label="公司名称" prop="companyName">
+        <el-input
+          v-model="queryParams.companyName"
+          placeholder="请输入公司名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="电话号码" prop="mobile">
+        <el-input
+          v-model="queryParams.mobile"
+          placeholder="请输入电话号码"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <!-- <el-form-item label="接口人角色" prop="contactRole">
+        <el-select v-model="queryParams.contactRole" placeholder="请选择" clearable size="small">
+          <el-option
+            v-for="item in contactRoleOptions"
+              :key="item.dictValue"
+              :label="item.dictLabel"
+              :value="item.dictValue"
+            />
+         </el-select>
+      </el-form-item> -->
+      <el-form-item label="业务场景" prop="businessScenario">
+        <el-input
+          v-model="queryParams.businessScenario"
+          placeholder="请输入业务场景"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <!-- <el-form-item label="方案涉及的产品" prop="product">
+        <el-input
+          v-model="queryParams.product"
+          placeholder="请输入方案涉及的产品"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item> -->
+      <!-- <el-form-item label="采购周期(单位:天)" prop="purchaseCycle">
+        <el-input
+          v-model="queryParams.purchaseCycle"
+          placeholder="请输入采购周期(单位:天)"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item> -->
+      <el-form-item label="跟进状态" prop="businessStatus">
+        <el-select v-model="queryParams.businessStatus" placeholder="请选择跟进状态" clearable size="small">
+          <el-option
+            v-for="item in businessStatusOptions"
+              :key="item.dictValue"
+              :label="item.dictLabel"
+              :value="item.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="项目阶段" prop="projectPhase">
+        <el-select v-model="queryParams.projectPhase" placeholder="请选择" clearable size="small">
+          <el-option
+              v-for="item in projectPhaseOptions"
+              :key="item.dictValue"
+              :label="item.dictLabel"
+              :value="item.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="意向等级" prop="level">
+        <el-select v-model="queryParams.level" placeholder="请选择" clearable size="small">
+          <el-option
+              v-for="item in levelOptions"
+              :key="item.dictValue"
+              :label="item.dictLabel"
+              :value="item.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <!-- <el-form-item label="是否绑定BP账号" prop="isBp">
+        <el-input
+          v-model="queryParams.isBp"
+          placeholder="请输入是否绑定BP账号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item> -->
+      <!-- <el-form-item label="BP账户" prop="bpAccount">
+        <el-input
+          v-model="queryParams.bpAccount"
+          placeholder="请输入BP账户"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item> -->
+      <!-- <el-form-item label="预计成单时间" prop="preTime">
+        <el-date-picker clearable size="small" style="width: 200px"
+          v-model="queryParams.preTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择预计成单时间">
+        </el-date-picker>
+      </el-form-item> -->
+      <!-- <el-form-item label="预计付费(元)" prop="preMoney">
+        <el-input
+          v-model="queryParams.preMoney"
+          placeholder="请输入预计付费(元)"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item> -->
+      <!-- <el-form-item label="挖掘时间" prop="createTime">
+        <el-date-picker clearable size="small" style="width: 200px"
+          v-model="queryParams.createTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择挖掘时间">
+        </el-date-picker>
+      </el-form-item> -->
+      <el-form-item label="挖掘时间" prop="createTimeRange">
+        <el-date-picker
+          style="width:205.4px"
+          clearable size="small"
+          v-model="createTimeRange"
+          type="daterange"
+          value-format="yyyy-MM-dd"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期">
+        </el-date-picker>
+      </el-form-item>
+      <!-- <el-form-item label="下次跟进时间" prop="nextTime">
+        <el-date-picker clearable size="small" style="width: 200px"
+          v-model="queryParams.nextTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择下次跟进时间">
+        </el-date-picker>
+      </el-form-item> -->
+      <el-form-item label="下次跟进时间" prop="nextTimeRange">
+        <el-date-picker
+          style="width:205.4px"
+          clearable size="small"
+          v-model="nextTimeRange"
+          type="daterange"
+          value-format="yyyy-MM-dd"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期">
+        </el-date-picker>
+      </el-form-item>
+      <!-- <el-form-item label="回收时间" prop="recoveryTime">
+        <el-date-picker clearable size="small" style="width: 200px"
+          v-model="queryParams.recoveryTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择回收时间">
+        </el-date-picker>
+      </el-form-item> -->
+      <el-form-item label="回收时间" prop="recoveryRange">
+        <el-date-picker
+          style="width:205.4px"
+          clearable size="small"
+          v-model="recoveryRange"
+          type="daterange"
+          value-format="yyyy-MM-dd"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期">
+        </el-date-picker>
+      </el-form-item>
+      <!-- <el-form-item label="状态" prop="status">
+        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
+          <el-option
+              v-for="item in statusOptions"
+              :key="item.dictValue"
+              :label="item.dictLabel"
+              :value="item.dictValue"
+          />
+        </el-select>
+      </el-form-item> -->
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <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-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['crm:business:export']"
+        >导出</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button size="mini" icon="el-icon-s-operation" @click="handleSetColumn()" >设置列表</el-button>
+      </el-col>
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <div>
+      <!-- <el-table v-loading="loading" :data="businessList" @selection-change="handleSelectionChange">
+        <el-table-column type="selection" width="55" align="center" />
+        <el-table-column label="商机ID" align="center" prop="businessId" />
+
+        <el-table-column label="线索来源" align="center" prop="source">
+          <template slot-scope="scope">
+              <span prop="source" v-for="(item, index) in clueSourceOptions"    v-if="scope.row.source==item.dictValue">{{item.dictLabel}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="客户经理" align="center" prop="manager" />
+        <el-table-column label="公司名称" align="center" prop="companyName" />
+        <el-table-column label="电话号码" align="center" width="100">
+          <template slot-scope="scope">
+            <div v-if="scope.row.mobileList">
+              <el-tag v-for="(phone, index) in scope.row.mobileList" :key="index">
+                {{ phone.mobile }}
+              </el-tag>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column label="接口人角色" align="center" prop="contactRole" width="120">
+          <template slot-scope="scope">
+              <span prop="contactRole" v-for="(item, index) in contactRoleOptions"    v-if="scope.row.contactRole==item.dictValue">{{item.dictLabel}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="业务场景" align="center" prop="businessScenario">
+          <template slot-scope="scope">
+              <span prop="businessScenario" v-for="(item, index) in businessScenarioOptions"    v-if="scope.row.businessScenario==item.dictValue">{{item.dictLabel}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="方案涉及产品" align="center" prop="product"  width="100"/>
+        <el-table-column label="采购周期" align="center" prop="purchaseCycle">
+          <template slot-scope="scope">
+              <span>{{scope.row.purchaseCycle}}天</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="跟进状态" align="center" prop="businessStatus">
+          <template slot-scope="scope">
+              <span prop="businessStatus" v-for="(item, index) in businessStatusOptions"    v-if="scope.row.businessStatus==item.dictValue">{{item.dictLabel}}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="项目阶段" align="center" prop="projectPhase" width="200">
+          <template slot-scope="scope">
+              <span prop="projectPhase" v-for="(item, index) in projectPhaseOptions" v-if="scope.row.projectPhase==item.dictValue">{{item.dictLabel}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="意向等级" align="center" prop="level" width="100">
+          <template slot-scope="scope">
+              <span prop="level" v-for="(item, index) in levelOptions" v-if="scope.row.level==item.dictValue">{{item.dictLabel}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="是否绑定BP账号" align="center" prop="isBp" width="120">
+          <template slot-scope="scope">
+              <span prop="isBp" v-for="(item, index) in isBpOptions" v-if="scope.row.isBp==item.dictValue">{{item.dictLabel}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="BP账户" align="center" prop="bpAccount" />
+        <el-table-column label="预计成单时间" align="center" prop="preTime" width="180">
+          <template slot-scope="scope">
+            <span>{{ parseTime(scope.row.preTime, '{y}-{m}-{d}') }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="预计付费" align="center" prop="preMoney">
+          <template slot-scope="scope">
+              <span>{{scope.row.preMoney}}元</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="挖掘时间" align="center" prop="createTime" width="180"/>
+        <el-table-column label="下次跟进时间" align="center" prop="nextTime" width="180">
+          <template slot-scope="scope">
+            <span>{{ parseTime(scope.row.nextTime, '{y}-{m}-{d}') }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center" 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="['crm:business:edit']"
+            >修改</el-button>
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              @click="handleDelete(scope.row)"
+              v-hasPermi="['crm:business:remove']"
+            >退回公海</el-button>
+          </template>
+        </el-table-column>
+      </el-table> -->
+
+      <!-- 动态表格 -->
+    <el-table height="500" border v-loading="loading" :data="businessList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <!-- 动态渲染列 -->
+      <el-table-column
+        v-for="col in visibleColumns"
+        :key="col.prop"
+        :label="col.label"
+        :width="col.width"
+        align="center"
+        :prop="col.prop">
+
+        <template slot-scope="scope">
+          <!-- 如果是线索来源字段 -->
+          <template v-if="col.prop === 'source'">
+            <el-tag v-for="item in clueSourceOptions" :key="item.dictValue" v-show="scope.row.source == item.dictValue">
+              {{ item.dictLabel }}
+            </el-tag>
+          </template>
+
+
+          <!-- 如果是电话号码字段 -->
+          <template v-else-if="col.prop === 'mobileList'">
+            <el-tag v-for="(phone, index) in scope.row.mobileList" :key="index" v-show="scope.row.mobileList">
+              {{ phone.mobile }}
+            </el-tag>
+          </template>
+
+          <!-- 如果是接口人角色字段 -->
+          <template v-else-if="col.prop === 'contactRole'">
+            <span v-for="item in contactRoleOptions" :key="item.dictValue" v-show="scope.row.contactRole == item.dictValue">
+              {{ item.dictLabel }}
+            </span>
+          </template>
+
+          <!-- 如果是业务场景字段 -->
+          <template v-else-if="col.prop === 'businessScenario'">
+            <span v-for="(item, index) in businessScenarioOptions" :key="item.dictValue" v-show="scope.row.businessScenario == item.dictValue">
+              {{ item.dictLabel }}
+            </span>
+          </template>
+
+          <!-- 如果是采购周期字段 -->
+          <template v-else-if="col.prop === 'purchaseCycle'">
+            <span>{{scope.row.purchaseCycle||'--'}}天</span>
+          </template>
+
+
+          <!-- 如果是跟进状态字段 -->
+          <template v-else-if="col.prop === 'businessStatus'">
+            <span v-for="item in businessStatusOptions" :key="item.dictValue" v-show="scope.row.businessStatus == item.dictValue">
+              {{ item.dictLabel }}
+            </span>
+          </template>
+
+          <!-- 如果是项目阶段字段 -->
+          <template v-else-if="col.prop === 'projectPhase'">
+            <span v-for="(item, index) in projectPhaseOptions" :key="item.dictValue" v-show="scope.row.projectPhase == item.dictValue">
+              {{ item.dictLabel }}
+            </span>
+          </template>
+
+          <!-- 如果是意向等级字段 -->
+          <template v-else-if="col.prop === 'level'">
+            <span v-for="(item, index) in levelOptions" :key="item.dictValue" v-show="scope.row.level == item.dictValue">
+              {{ item.dictLabel }}
+            </span>
+          </template>
+
+          <!-- 如果是预计成单时间字段 -->
+          <template v-else-if="col.prop === 'preTime'">
+            <span>{{ parseTime(scope.row.preTime, '{y}-{m}-{d}') }}</span>
+          </template>
+
+          <!-- 如果是是否绑定BP账号字段 -->
+          <template v-else-if="col.prop === 'isBp'">
+            <span v-for="(item, index) in isBpOptions" :key="item.dictValue" v-show="scope.row.isBp == item.dictValue">
+              {{ item.dictLabel }}
+            </span>
+          </template>
+
+          <!-- 如果是预计付费字段 -->
+          <template v-else-if="col.prop === 'preMoney'">
+            <span>{{scope.row.preMoney||'--'}}元</span>
+          </template>
+
+          <!-- 如果是下次跟进时间字段 -->
+          <template v-else-if="col.prop === 'nextTime'">
+            <span>{{ parseTime(scope.row.nextTime, '{y}-{m}-{d}') }}</span>
+          </template>
+
+          <!-- 其他普通字段 -->
+          <span v-else>{{ scope.row[col.prop] }}</span>
+        </template>
+
+
+      </el-table-column>
+
+      <!-- 操作列,始终显示 -->
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope" v-if="scope.row.customerId !== ''">
+          <el-button size="mini" type="text" icon="el-icon-s-custom" @click="handleShow(scope.row)" v-hasPermi="['crm:customer:query']" >查看相关客户</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+      <pagination
+        v-show="total>0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
+
+      <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
+        <add-business @closeBusiness="closeBusiness"   ref="addBusiness" />
+      </el-dialog>
+      <!-- 显示 allColumns 数据的对话框 -->
+      <el-dialog :visible.sync="columns.open" :title="columns.title">
+        <set-column ref="setColumn" @close="closeSetColumn"/>
+      </el-dialog>
+      <el-drawer
+      size="75%"
+        :title="show.title" :visible.sync="show.open">
+          <customer-details  ref="customerDetails" />
+      </el-drawer>
+
+    </div>
+  </div>
+</template>
+
+<script>
+import { listBusiness, getBusiness, exportBusiness,setBusinessPool } from "@/api/crm/business";
+import addBusiness from '../components/addBusiness.vue';
+import setColumn from '../components/setColumn.vue';
+import {getShow} from "@/api/system/show";
+import customerDetails from '../components/customerDetails.vue';
+export default {
+  name: "Business",
+  components: {addBusiness,setColumn,customerDetails},
+  data() {
+    return {
+      show:{
+        title:"客户详情",
+        open:false,
+      },
+      columns:{
+        title:"设置列表",
+        open:false,
+      },
+      columnType:'business',
+      visibleColumns: [],
+       // 可选字段
+       allColumns: [
+        { prop: "businessId", label: "商机ID" },
+        // { prop: "companyName", label: "客户名称" },
+        { prop: "customerId", label: "客户ID" },
+        { prop: "source", label: "线索来源" },
+        { prop: "manager", label: "客户经理" },
+        { prop: "companyName", label: "公司名称" },
+        { prop: "mobileList", label: "电话号码" },
+        { prop: "contactRole", label: "接口人角色" },
+        { prop: "businessScenario", label: "业务场景" },
+        { prop: "product", label: "方案涉及产品" },
+        { prop: "purchaseCycle", label: "采购周期" },
+        { prop: "businessStatus", label: "跟进状态" },
+        { prop: "projectPhase", label: "项目阶段" },
+        { prop: "level", label: "意向等级" },
+        { prop: "isBp", label: "是否绑定BP账号" },
+        { prop: "bpAccount", label: "BP账户" },
+        { prop: "preTime", label: "预计成单时间", width: 105 },
+        { prop: "preMoney", label: "预计付费" },
+        { prop: "createTime", label: "挖掘时间", width: 105 },
+        { prop: "nextTime", label: "下次跟进时间", width: 105 }
+
+      ],
+      // 选中的字段(默认显示所有字段)
+      selectedKeys: [
+        "businessId",
+        "customerId",
+        "source",
+        "manager",
+        "companyName",
+        "mobileList",
+        "contactRole",
+        "businessScenario",
+        "product",
+        "purchaseCycle",
+        "businessStatus",
+        "projectPhase",
+        "level",
+        "isBp",
+        "bpAccount",
+        "preTime",
+        "preMoney",
+        "createTime",
+        "nextTime"
+      ],
+      createTimeRange:[],
+      nextTimeRange:[],
+      recoveryRange:[],
+      statusOptions:[
+        {
+          dictValue:1,
+          dictLabel:"已分配"
+        },
+        {
+          dictValue:2,
+          dictLabel:"进行中"
+        },
+        {
+          dictValue:3,
+          dictLabel:"回收"
+        }
+      ],
+      clueSourceOptions:[],
+      contactRoleOptions:[],
+      projectPhaseOptions:[],
+      businessScenarioOptions:[],
+      levelOptions:[],
+      businessStatusOptions:[],
+      isBpOptions:[
+        {
+          dictValue:0,
+          dictLabel:"未注册"
+        },
+        {
+          dictValue:1,
+          dictLabel:"已注册未绑定"
+        },
+        {
+          dictValue:2,
+          dictLabel:"不明确"
+        },
+        {
+          dictValue:3,
+          dictLabel:"已绑定"
+        }
+      ],
+
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 商机表格数据
+      businessList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        // customerId: null,
+        source: null,
+        manager: null,
+        companyName: null,
+        mobile: null,
+        contactRole: null,
+        businessScenario: null,
+        product: null,
+        purchaseCycle: null,
+        businessStatus: null,
+        projectPhase: null,
+        level: null,
+        isBp: null,
+        bpAccount: null,
+        preTime: null,
+        preMoney: null,
+        nextTime: null,
+        recoveryTime: null,
+        status: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        customerId: [
+          { required: true, message: "客户id不能为空", trigger: "blur" }
+        ],
+      },
+
+    };
+  },
+  created() {
+    this.getDicts("business_scenario_type").then((response) => {
+      this.businessScenarioOptions = response.data;
+    });
+    this.getDicts("crm_customer_source").then((response) => {
+      this.clueSourceOptions = response.data;
+    });
+    this.getDicts("crm_contact_role").then((response) => {
+      this.contactRoleOptions = response.data;
+    });
+    this.getDicts("crm_project_phase").then((response) => {
+      this.projectPhaseOptions = response.data;
+    });
+    this.getDicts("crm_level").then((response) => {
+      this.levelOptions = response.data;
+    });
+    this.getDicts("crm_business_status").then((response) => {
+      this.businessStatusOptions = response.data;
+    });
+    this.getList();
+  },
+  methods: {
+    handleShow(row){
+      var that=this;
+      that.show.open=true;
+      setTimeout(() => {
+          that.$refs.customerDetails.getDetails(row.customerId);
+      }, 200);
+    },
+    handleSetColumn(){
+      this.columns.open=true;
+      var that=this;
+      setTimeout(() => {
+            that.$refs.setColumn.reset(that.allColumns,that.selectedKeys,that.columnType);
+      }, 200);
+    },
+    closeSetColumn(){
+      this.columns.open=false;
+      this.getList();
+    },
+    handleBusiness(row){
+        this.business.open=true;
+        setTimeout(() => {
+            this.$refs.addBusiness.reset(row);
+        }, 200);
+    },
+    closeBusiness(){
+        this.business.open=false;
+        this.getList();
+    },
+    //查询显示字段
+    async getColumn(){
+      const response = await getShow(this.columnType);
+      if (response.code === 200 && response.data) {
+        this.selectedKeys = response.data.columns.split(",");
+        this.$set(this, "visibleColumns", this.allColumns.filter(col => this.selectedKeys.includes(col.prop)));
+
+      } else{
+        this.$set(this, "visibleColumns", this.allColumns);
+      }
+    },
+    /** 查询客户列表 */
+    async getList() {
+      this.loading = true;
+      await this.getColumn(); // 确保 visibleColumns 先获取到
+
+      if(this.createTimeRange!=null&&this.createTimeRange.length==2){
+        this.queryParams.createTimeRange=this.createTimeRange[0]+"--"+this.createTimeRange[1]
+      }
+      else{
+        this.queryParams.createTimeRange=null;
+      }
+      if(this.nextTimeRange!=null&&this.nextTimeRange.length==2){
+        this.queryParams.nextTimeRange=this.nextTimeRange[0]+"--"+this.nextTimeRange[1]
+      }
+      else{
+        this.queryParams.nextTimeRange=null;
+      }
+      if(this.recoveryRange!=null&&this.recoveryRange.length==2){
+        this.queryParams.recoveryRange=this.recoveryRange[0]+"--"+this.recoveryRange[1]
+      }
+      else{
+        this.queryParams.recoveryRange=null;
+      }
+      const response = await listBusiness(this.addDateRange(this.queryParams, this.dateRange));
+
+      // this.customerList = response.rows;
+      // 处理 customerList 数据,确保不会有 undefined 或 null
+      this.businessList = response.rows.map(row => {
+        let newRow = {};
+        this.visibleColumns.forEach(col => {
+          newRow[col.prop] = row[col.prop] != null ? row[col.prop] : ""; // 如果是 null 或 undefined,就填 "-"
+        });
+        return newRow;
+      });
+      this.total = response.total;
+      this.loading = false;
+
+    },
+    // /** 查询商机列表 */
+    // getList() {
+    //   this.loading = true;
+    //   if(this.createTimeRange!=null&&this.createTimeRange.length==2){
+    //     this.queryParams.createTimeRange=this.createTimeRange[0]+"--"+this.createTimeRange[1]
+    //   }
+    //   else{
+    //     this.queryParams.createTimeRange=null;
+    //   }
+    //   if(this.nextTimeRange!=null&&this.nextTimeRange.length==2){
+    //     this.queryParams.nextTimeRange=this.nextTimeRange[0]+"--"+this.nextTimeRange[1]
+    //   }
+    //   else{
+    //     this.queryParams.nextTimeRange=null;
+    //   }
+    //   if(this.recoveryRange!=null&&this.recoveryRange.length==2){
+    //     this.queryParams.recoveryRange=this.recoveryRange[0]+"--"+this.recoveryRange[1]
+    //   }
+    //   else{
+    //     this.queryParams.recoveryRange=null;
+    //   }
+    //   listBusiness(this.queryParams).then(response => {
+    //     this.businessList = response.rows;
+    //     this.total = response.total;
+    //     this.loading = false;
+    //   });
+    // },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        businessId: null,
+        customerId: null,
+        source: null,
+        manager: null,
+        companyName: null,
+        mobile: null,
+        contactRole: null,
+        businessScenario: null,
+        product: null,
+        purchaseCycle: null,
+        businessStatus: 0,
+        remark: null,
+        projectPhase: null,
+        level: null,
+        isBp: null,
+        bpAccount: null,
+        preTime: null,
+        preMoney: null,
+        nextTime: null,
+        createTime: null,
+        updateTime: null,
+        createBy: null,
+        recoveryTime: null,
+        status: 0,
+        // createTimeRange:null,
+        // nextTimeRange:null,
+        // recoveryRange:null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.businessId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有商机数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportBusiness(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        }).catch(function() {});
+    }
+  }
+};
+</script>

+ 25 - 0
src/views/live/liveConfig/liveLotteryConf.vue

@@ -248,6 +248,7 @@
                   remote
                 reserve-keyword
                 placeholder="请输入关键字搜索"
+                :remote-method="fetchProducts"
                 :loading="loadingProducts"
                 size="small"
                 style="width: 180px"
@@ -521,6 +522,30 @@ export default {
     );
   },
   methods: {
+
+    async fetchProducts(query) {
+
+      if (!query) {
+        this.productOptions = [];
+        return;
+      }
+      const queryParam = {
+        liveId : this.liveId,
+        keywords: query
+      }
+      this.loadingProducts = true;
+      try {
+        listLiveGoods(queryParam).then(response => {
+          this.productOptions = response.rows;
+        })
+      } catch (err) {
+        console.error('查询商品失败:', err);
+        this.productOptions = [];
+      } finally {
+        this.loadingProducts = false;
+      }
+    },
+
     getProducts(){
       const queryParam = {
         liveId : this.liveId

+ 2 - 2
src/views/live/liveConfig/liveRedConf.vue

@@ -177,8 +177,8 @@
         <el-form-item label="直播间ID" prop="liveId">
           <el-input v-model="form.liveId" placeholder="请输入直播间ID" :disabled="canLiveId"/>
         </el-form-item>
-        <el-form-item label="芳华币数" prop="redNum">
-          <el-input v-model="form.redNum" placeholder="请输入芳华币数量" />
+        <el-form-item label="积分" prop="redNum">
+          <el-input v-model="form.redNum" placeholder="请输入积分数量" />
         </el-form-item>
         <el-form-item label="中奖份量" prop="totalLots">
           <el-input v-model="form.totalLots" placeholder="请输入可中奖份量" />

+ 6 - 6
src/views/live/liveCoupon/index.vue

@@ -57,7 +57,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['store:storeCoupon:add']"
+          v-hasPermi="['live:liveCoupon:add']"
         >新增</el-button>
       </el-col>
 
@@ -68,7 +68,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['store:storeCoupon:remove']"
+          v-hasPermi="['live:liveCoupon:remove']"
         >删除</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -77,7 +77,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleBatchPublish"
-          v-hasPermi="['store:storeCoupon:batchPublish']"
+          v-hasPermi="['live:liveCoupon:batchPublish']"
         >批量发布</el-button>
       </el-col>
 
@@ -116,21 +116,21 @@
             size="mini"
             type="text"
             @click="handlePublish(scope.row)"
-            v-hasPermi="['store:storeCoupon:publish']"
+            v-hasPermi="['live:liveCoupon:publish']"
           >发布</el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['store:storeCoupon:edit']"
+            v-hasPermi="['live:liveCoupon:edit']"
           >修改</el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['store:storeCoupon:remove']"
+            v-hasPermi="['live:liveCoupon:remove']"
           >删除</el-button>
         </template>
       </el-table-column>

+ 76 - 2
src/views/system/config/config.vue

@@ -2814,6 +2814,50 @@
         </div>
       </el-tab-pane>
 
+      <el-tab-pane label="提现配置" name="his.AppRedPacket">
+        <!-- 添加 ref 和 rules -->
+        <el-form ref="form36" :model="form36" label-width="160px">
+
+          <el-form-item label="红包接口类型" prop="isNew">
+            <el-radio-group v-model="form36.isNew" >
+              <el-radio label="0">商家转账到零钱(旧)</el-radio>
+              <el-radio label="1">商家转账到零钱(新)</el-radio>
+            </el-radio-group>
+          </el-form-item>
+          <el-form-item label="商户号" prop="mchId">
+            <el-input v-model="form36.mchId" placeholder="请输入商户号"></el-input>
+          </el-form-item>
+          <el-form-item label="商户密钥" prop="mchKey">
+            <el-input v-model="form36.mchKey" placeholder="请输入商户密钥" show-password></el-input>
+          </el-form-item>
+          <el-form-item label="p12证书路径" prop="keyPath">
+            <el-input v-model="form36.keyPath" placeholder="请输入p12证书路径"></el-input>
+          </el-form-item>
+          <el-form-item label="apiV3密钥" prop="apiV3Key">
+            <el-input v-model="form36.apiV3Key" placeholder="请输入apiV3密钥" show-password></el-input>
+          </el-form-item>
+          <el-form-item label="公钥ID" prop="publicKeyId">
+            <el-input v-model="form36.publicKeyId" placeholder="请输入公钥ID"></el-input>
+          </el-form-item>
+          <el-form-item label="公钥证书路径" prop="publicKeyPath">
+            <el-input v-model="form36.publicKeyPath" placeholder="请输入公钥证书路径"></el-input>
+          </el-form-item>
+          <el-form-item label="私钥路径" prop="privateKeyPath">
+            <el-input v-model="form36.privateKeyPath" placeholder="请输入私钥路径"></el-input>
+          </el-form-item>
+          <el-form-item label="证书路径" prop="privateCertPath">
+            <el-input v-model="form36.privateCertPath" placeholder="请输入证书路径"></el-input>
+          </el-form-item>
+          <el-form-item label="回调地址" prop="notifyUrl">
+            <el-input v-model="form36.notifyUrl" placeholder="请输入回调地址"></el-input>
+          </el-form-item>
+
+          <div class="footer">
+            <el-button type="primary" @click="submitForm36">提 交</el-button>
+          </div>
+        </el-form>
+      </el-tab-pane>
+
     </el-tabs>
 
 
@@ -3022,6 +3066,7 @@ export default {
       form33:{},
       form34:{},
       form35:{},
+      form36:{},
       form40: {
         enablePhoneConfig: false,
         enablePhoneLimitConfig:false,
@@ -3378,8 +3423,8 @@ export default {
     },
     handleClick(tab, event) {
     this.getConfigByKey(tab.name)
-     
-      
+
+
     },
     handleAddProduct() {
       setTimeout(() => {
@@ -3599,6 +3644,27 @@ export default {
         if(key=="courseAppConfig.config"){
           this.form35 =JSON.parse(response.data.configValue);
         }
+        if (key == 'his.AppRedPacket') {
+          if (response.data && response.data.configValue) {
+            this.form36 = JSON.parse(response.data.configValue);
+          } else {
+            // 如果没有配置,使用默认值
+            this.form36 = {
+              isNew: '1',
+              mchId: '',
+              notifyUrl: '',
+              mchKey: '',
+              keyPath: '',
+              apiV3Key: '',
+              serialNo: '',
+              privateCertPath: '',
+              privateKeyPath: '',
+              publicKeyPath: ''
+            };
+          }
+          this.configId = response.data?.configId || null;
+          this.configKey = response.data?.configKey || 'his.AppRedPacket';
+        }
         if(key == 'vc.config'){
           if(!!response.data){
             this.configId = response.data.configId
@@ -3938,6 +4004,14 @@ export default {
         }
       });
     },
+    submitForm36(){
+      var param={configId:this.configId,configName : "APP提现配置", configKey: this.configKey,configValue:JSON.stringify(this.form36)}
+      updateConfigByKey(param).then(response => {
+        if (response.code === 200) {
+          this.msgSuccess("修改成功");
+        }
+      });
+    },
     submitForm32(){
       const param = { configId: this.configId, configName : "直播源配置", configKey: this.configKey, configValue: JSON.stringify(this.form32) }
       console.log(param)

+ 10 - 0
src/views/system/config/integralConfig.vue

@@ -130,6 +130,15 @@
           </el-form-item>
         </el-col>
       </el-row>
+      <el-row>
+        <el-col :span="12">
+          <el-form-item  label="首次下载App获取积分" prop="downloadAppIntegral">
+            <el-tooltip class="item" effect="dark" content="首次下载App获取积分" placement="top-end">
+              <el-input-number  v-model="form11.downloadAppIntegral"   ></el-input-number>
+            </el-tooltip>
+          </el-form-item>
+        </el-col>
+      </el-row>
       <el-row>
         <el-col :span="12">
           <el-form-item  label="单日可获总积分" prop="integralByOneDay">
@@ -183,6 +192,7 @@ export default {
         integralFirstOrderPoint: null,
         integralTypeByOneDay: null,
         integralSubscriptCourse: null,
+        downloadAppIntegral: null,
       },
       saveLoading: false,
     }