订单列表和计费列表调整使用客户下拉全查接口
This commit is contained in:
+16
@@ -22,6 +22,7 @@ import com.bms.common.core.controller.BaseController;
|
||||
import com.bms.common.core.domain.AjaxResult;
|
||||
import com.bms.common.enums.BusinessType;
|
||||
import com.bms.customer.customerinfo.domain.BmsCustomer;
|
||||
import com.bms.customer.customerinfo.domain.BmsCustomerOption;
|
||||
import com.bms.customer.customerinfo.service.IBmsCustomerService;
|
||||
import com.bms.common.utils.poi.ExcelUtil;
|
||||
import com.bms.common.core.page.TableDataInfo;
|
||||
@@ -51,6 +52,21 @@ public class BmsCustomerController extends BaseController
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户下拉选项。
|
||||
* 只返回客户ID、客户编码、客户名称,供各页面下拉框使用。
|
||||
* 查询参数 keywords 按客户名称、客户编码、对外代码模糊匹配,多行之间为或者关系。
|
||||
* 分页参数与原下拉一致,避免一次查出全部客户。
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('customersupplier:customerinfo:list')")
|
||||
@GetMapping("/optionselect")
|
||||
public TableDataInfo optionselect(BmsCustomer query)
|
||||
{
|
||||
startPage();
|
||||
List<BmsCustomerOption> list = bmsCustomerService.selectCustomerOptions(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出客户信息列表
|
||||
*/
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.bms.customer.customerinfo.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 客户下拉选项。
|
||||
* 只携带下拉展示和回填需要的字段,不返回额度、账期等客户档案内容。
|
||||
*
|
||||
* @author bms
|
||||
*/
|
||||
@Data
|
||||
public class BmsCustomerOption
|
||||
{
|
||||
/** 客户ID。收款、账单等已有下拉按主键选中,需一并返回 */
|
||||
private Long customerId;
|
||||
|
||||
/** 客户编码 */
|
||||
private String customerCode;
|
||||
|
||||
/** 客户名称 */
|
||||
private String customerName;
|
||||
}
|
||||
+10
@@ -2,6 +2,7 @@ package com.bms.customer.customerinfo.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.bms.customer.customerinfo.domain.BmsCustomer;
|
||||
import com.bms.customer.customerinfo.domain.BmsCustomerOption;
|
||||
import com.bms.customer.customerinfo.domain.BmsCustomerAttachment;
|
||||
import com.bms.customer.customerinfo.domain.BmsCustomerCompany;
|
||||
import com.bms.customer.customerinfo.domain.BmsCustomerContact;
|
||||
@@ -34,6 +35,15 @@ public interface BmsCustomerMapper
|
||||
*/
|
||||
public List<BmsCustomer> selectBmsCustomerList(BmsCustomer bmsCustomer);
|
||||
|
||||
/**
|
||||
* 查询客户下拉选项。
|
||||
* 按客户名称、客户编码、对外代码模糊匹配,只返回下拉所需字段。
|
||||
*
|
||||
* @param query 下拉查询条件
|
||||
* @return 客户下拉选项
|
||||
*/
|
||||
public List<BmsCustomerOption> selectCustomerOptions(BmsCustomer query);
|
||||
|
||||
/** 校验业务员用户ID仍对应未删除的系统用户。 */
|
||||
public int countValidSalesUserId(@org.apache.ibatis.annotations.Param("salesUserId") String salesUserId);
|
||||
|
||||
|
||||
+10
@@ -2,6 +2,7 @@ package com.bms.customer.customerinfo.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.bms.customer.customerinfo.domain.BmsCustomer;
|
||||
import com.bms.customer.customerinfo.domain.BmsCustomerOption;
|
||||
import com.bms.customer.customerinfo.domain.BmsCustomerAttachment;
|
||||
import com.bms.customer.customerinfo.domain.BmsCustomerCompany;
|
||||
import com.bms.customer.customerinfo.domain.BmsCustomerContact;
|
||||
@@ -39,6 +40,15 @@ public interface IBmsCustomerService
|
||||
*/
|
||||
public List<BmsCustomer> selectBmsCustomerList(BmsCustomer bmsCustomer);
|
||||
|
||||
/**
|
||||
* 查询客户下拉选项。
|
||||
* 只返回客户ID、客户编码、客户名称;keywords 按客户名称、客户编码、对外代码模糊查询。
|
||||
*
|
||||
* @param query 下拉查询条件
|
||||
* @return 客户下拉选项
|
||||
*/
|
||||
public List<BmsCustomerOption> selectCustomerOptions(BmsCustomer query);
|
||||
|
||||
/**
|
||||
* 查询客户附件列表
|
||||
*
|
||||
|
||||
+11
@@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.bms.customer.customerinfo.mapper.BmsCustomerMapper;
|
||||
import com.bms.customer.customerinfo.domain.BmsCustomer;
|
||||
import com.bms.customer.customerinfo.domain.BmsCustomerOption;
|
||||
import com.bms.customer.customerinfo.domain.BmsCustomerLog;
|
||||
import com.bms.customer.customerinfo.service.IBmsCustomerLogService;
|
||||
import com.bms.customer.customerinfo.service.IBmsCustomerService;
|
||||
@@ -89,6 +90,16 @@ public class BmsCustomerServiceImpl implements IBmsCustomerService
|
||||
return bmsCustomerMapper.selectBmsCustomerList(bmsCustomer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户下拉选项。数据权限与客户列表一致,只查下拉需要的字段。
|
||||
*/
|
||||
@Override
|
||||
@DataScope(deptAlias = "su", deptField = "dept_id", userAlias = "su", userField = "user_id")
|
||||
public List<BmsCustomerOption> selectCustomerOptions(BmsCustomer query)
|
||||
{
|
||||
return bmsCustomerMapper.selectCustomerOptions(query);
|
||||
}
|
||||
|
||||
//查询附件子表数据
|
||||
@Override
|
||||
public List<BmsCustomerAttachment> selectBmsCustomerAttachmentList(BmsCustomerAttachment bmsCustomerAttachment) {
|
||||
|
||||
@@ -112,6 +112,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
order by c.customer_id desc
|
||||
</select>
|
||||
|
||||
<resultMap type="BmsCustomerOption" id="BmsCustomerOptionResult">
|
||||
<result property="customerId" column="customer_id" />
|
||||
<result property="customerCode" column="customer_code" />
|
||||
<result property="customerName" column="customer_name" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 客户下拉:不关联账户、套餐,只取名称和编码;对外代码仅参与模糊条件 -->
|
||||
<select id="selectCustomerOptions" parameterType="BmsCustomer" resultMap="BmsCustomerOptionResult">
|
||||
select c.customer_id, c.customer_code, c.customer_name
|
||||
from ctr_customer c
|
||||
left join sys_user su
|
||||
on su.del_flag = '0'
|
||||
and cast(su.user_id as char) = c.sales_user_id
|
||||
<where>
|
||||
c.del_flag = '0'
|
||||
<if test="keywordList != null and keywordList.size() > 0">
|
||||
and (
|
||||
<foreach collection="keywordList" item="kw" separator=" or ">
|
||||
(c.customer_name like concat('%', #{kw}, '%')
|
||||
or c.customer_code like concat('%', #{kw}, '%')
|
||||
or c.customer_code_dw like concat('%', #{kw}, '%'))
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
${params.dataScope}
|
||||
</where>
|
||||
order by c.customer_id desc
|
||||
</select>
|
||||
|
||||
<select id="countValidSalesUserId" resultType="int">
|
||||
select count(1)
|
||||
from sys_user
|
||||
|
||||
@@ -9,6 +9,16 @@ export function listCustomer(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 客户下拉选项:只返回客户ID、客户编码、客户名称
|
||||
// keywords 按客户名称、客户编码、对外代码模糊查询
|
||||
export function listCustomerOption(query) {
|
||||
return request({
|
||||
url: '/customersupplier/customerinfo/optionselect',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询客户主详细
|
||||
export function getCustomer(customerId) {
|
||||
return request({
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="CustomerSelect">
|
||||
import { listCustomer } from '@/api/customersuppliermanagement/customerinfo/customer.js'
|
||||
import { listCustomer, listCustomerOption } from '@/api/customersuppliermanagement/customerinfo/customer.js'
|
||||
import { listSupplier } from '@/api/customersuppliermanagement/supplierinfo/supplier.js'
|
||||
|
||||
const props = defineProps({
|
||||
@@ -95,6 +95,11 @@ const props = defineProps({
|
||||
remoteSearch: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 为 true 时客户下拉走专用选项接口,默认仍走客户列表接口
|
||||
optionSelect: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
})
|
||||
|
||||
@@ -138,7 +143,9 @@ const displayOptions = computed(() => {
|
||||
function fetchList(keyword = '') {
|
||||
if (!props.remoteSearch && loaded.value) return Promise.resolve(options.value)
|
||||
loading.value = true
|
||||
const api = isCustomer.value ? listCustomer : listSupplier
|
||||
const api = !isCustomer.value
|
||||
? listSupplier
|
||||
: (props.optionSelect ? listCustomerOption : listCustomer)
|
||||
const currentRequest = ++requestSerial
|
||||
const query = String(keyword || '').trim()
|
||||
return api({
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
placeholder="客户名称/客户代码/对外代码"
|
||||
multiple
|
||||
remote-search
|
||||
option-select
|
||||
/>
|
||||
</template>
|
||||
<template #search-productCodes="{ model }">
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
placeholder="客户名称/客户代码/对外代码"
|
||||
multiple
|
||||
remote-search
|
||||
option-select
|
||||
/>
|
||||
</template>
|
||||
<template #search-orderStatuses="{ model }">
|
||||
|
||||
Reference in New Issue
Block a user