This commit is contained in:
xd 2024-03-27 14:08:55 +08:00
parent 57a2b89818
commit a7ee87edf5
4 changed files with 38 additions and 36 deletions

View File

@ -18,11 +18,11 @@ public class IdUtils {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
//生成两位大写字母
String keyArr = randomLetter(size);
String fourRandom = random.nextInt(9999) + "";
String fourRandom = random.nextInt(999) + "";
int randLength = fourRandom.length();
//四位随机数不足四位的补0
if(fourRandom.length()<4){//不足四位的随机数补充0
for(int i=1; i<=4-randLength; i++){
if(fourRandom.length()<3){//不足四位的随机数补充0
for(int i=1; i<=3-randLength; i++){
fourRandom = '0' + fourRandom;
}
}

View File

@ -1,6 +1,8 @@
package com.ruoyi.customer.service.impl;
import java.util.List;
import com.ruoyi.common.annotation.DataScope;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@ -42,6 +44,7 @@ public class CustomerServiceImpl implements ICustomerService
* @return 客户管理
*/
@Override
@DataScope(deptAlias = "d", userAlias = "u")
public List<Customer> selectCustomerList(Customer customer)
{
return customerMapper.selectCustomerList(customer);

View File

@ -45,14 +45,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="customerJoins">
LEFT JOIN sys_user s on s.user_name=a.create_by
LEFT JOIN sys_user u on u.user_name=a.create_by
</sql>
<sql id="selectCustomerVo">
select a.cus_id, a.cus_code, a.cus_name, a.cus_sap_code, a.cus_street, a.cus_payment_terms, a.cus_phone_number,
a.cus_industry_code, a.cus_group, a.cus_vat_no, a.cus_type, a.cus_country, a.cus_language, a.cus_label,
a.cus_classification, a.cus_receiving_email, a.cus_recipient, a.cus_recipient_phone, a.cus_remark,
a.cus_state, a.cus_approval_status,a.create_time,s.nick_name create_name
a.cus_state, a.cus_approval_status,a.create_time,u.nick_name create_name
from customer a
<include refid="customerJoins"/>
</sql>
@ -65,6 +65,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="cusSapCode != null and cusSapCode != ''"> and cus_sap_code like concat('%', #{cusSapCode}, '%')</if>
<if test="cusState != null and cusState != ''"> and cus_state = #{cusState}</if>
<if test="cusApprovalStatus != null and cusApprovalStatus != ''"> and cus_approval_status = #{cusApprovalStatus}</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
</select>

View File

@ -152,12 +152,12 @@
<el-input v-model="form.cusCode" placeholder="系统自动生成" :disabled="true"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="6">
<el-form-item label="SAP客户编码" prop="cusSapCode">
<el-input v-model="form.cusSapCode" placeholder="审批通过自动生成" :disabled="true"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="10">
<el-form-item label="客户名称" prop="cusName">
<el-input v-model="form.cusName" placeholder="企查查查询" :disabled="true">
<el-button slot="append" icon="el-icon-search" @click="openQcc" v-if="buttonShow"></el-button>
@ -166,12 +166,12 @@
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="16">
<el-col :span="12">
<el-form-item label="街道/门牌号" prop="cusStreet">
<el-input v-model="form.cusStreet" placeholder="请输入街道/门牌号" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="6">
<el-form-item label="付款条件" prop="cusPaymentTerms">
<el-select v-model="form.cusPaymentTerms" placeholder="请选择付款条件" style="width: 100%;">
<el-option
@ -183,19 +183,24 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="8">
<el-col :span="6">
<el-form-item label="电话号码" prop="cusPhoneNumber">
<el-input v-model="form.cusPhoneNumber" placeholder="请输入电话号码" />
</el-form-item>
</el-col>
<el-col :span="8">
</el-row>
<el-row :gutter="8">
<el-col :span="6">
<el-form-item label="增值税号" prop="cusVatNo">
<el-input v-model="form.cusVatNo" placeholder="企查查查询带出" :disabled="true"/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="行业代码" prop="cusIndustryCode">
<el-input v-model="form.cusIndustryCode" placeholder="请输入行业代码" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="6">
<el-form-item label="客户组类别" prop="cusGroup">
<el-select v-model="form.cusGroup" placeholder="请选择客户组类别" style="width: 100%;">
<el-option
@ -207,14 +212,7 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="8">
<el-form-item label="增值税号" prop="cusVatNo">
<el-input v-model="form.cusVatNo" placeholder="企查查查询带出" :disabled="true"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="6">
<el-form-item label="客户类型" prop="cusType">
<el-select v-model="form.cusType" placeholder="请选择客户类型" style="width: 100%;">
<el-option
@ -226,7 +224,9 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
</el-row>
<el-row :gutter="8">
<el-col :span="6">
<el-form-item label="国家" prop="cusCountry">
<el-select v-model="form.cusCountry" placeholder="请选择国家" style="width: 100%;">
<el-option
@ -238,9 +238,7 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="8">
<el-col :span="6">
<el-form-item label="语言" prop="cusLanguage">
<el-select v-model="form.cusLanguage" placeholder="请选择语言" style="width: 100%;">
<el-option
@ -252,29 +250,29 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="6">
<el-form-item label="客户标签" prop="cusLabel">
<el-input v-model="form.cusLabel" placeholder="请输入客户标签" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="6">
<el-form-item label="客户分类" prop="cusClassification">
<el-input v-model="form.cusClassification" placeholder="请输入客户分类" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="8">
<el-col :span="6">
<el-form-item label="电子发票邮箱" prop="cusReceivingEmail">
<el-input v-model="form.cusReceivingEmail" placeholder="请输入电子发票接收邮箱" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="6">
<el-form-item label="收件人" prop="cusRecipient">
<el-input v-model="form.cusRecipient" placeholder="请输入收件人" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="6">
<el-form-item label="收件人电话" prop="cusRecipientPhone">
<el-input v-model="form.cusRecipientPhone" placeholder="请输入收件人电话" />
</el-form-item>
@ -288,7 +286,7 @@
</el-col>
</el-row>
<el-divider content-position="center">银行信息</el-divider>
<el-row :gutter="8" class="mb8" v-if="buttonShow">
<el-row class="mb8" :gutter="8" v-if="buttonShow">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddBank">添加</el-button>
</el-col>
@ -359,10 +357,9 @@
color: #606266;
font-size: 14px;
word-break: break-all;
overflow-y: auto; /* 自动显示垂直滚动条 */
max-height: 580px; /* 设置最大高度,根据需要调整 */
}
/* .el-dialog__footer {
text-align: center;
}*/
</style>
<script>
import { listCustomer, getCustomer, delCustomer, addCustomer, updateCustomer, qccListCustomer } from "@/api/customer/customer";