This commit is contained in:
xd 2024-05-06 15:45:11 +08:00
parent 518bf039ef
commit 7a8b425741
10 changed files with 642 additions and 102 deletions

View File

@ -1,5 +1,5 @@
#for tests only !
#Tue Apr 30 16:42:04 CST 2024
#Mon May 06 14:44:29 CST 2024
jco.destination.pool_capacity=10
jco.client.lang=ZH
jco.client.ashost=172.19.0.125
@ -7,5 +7,5 @@ jco.client.saprouter=
jco.client.user=RFC
jco.client.sysnr=00
jco.destination.peak_limit=10
jco.client.passwd=uD8ely7MSR~%EjN[YVSQi{Uk(g)lY*X:C|ocMpezcUAU:e-g
jco.client.passwd=654321
jco.client.client=800

View File

@ -1,21 +1,34 @@
package com.ruoyi.web.controller.common;
import com.alibaba.fastjson2.JSON;
import com.github.pagehelper.PageInfo;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.core.redis.RedisLock;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.common.utils.file.MinioUtil;
import com.ruoyi.customer.domain.Bank;
import com.ruoyi.customer.domain.BankCode;
import com.ruoyi.customer.domain.Customer;
import com.ruoyi.customer.domain.qcc.FuzzySearch;
import com.ruoyi.customer.domain.qcc.QccFuzzySearchJsonResult;
import com.ruoyi.framework.config.ServerConfig;
import com.ruoyi.materialType.domain.CMaterialType;
import com.ruoyi.web.utils.SapFunction.RfcResult;
import com.ruoyi.web.utils.SapFunction.SapRfcUtils;
import com.ruoyi.web.utils.qcc.HttpHelper;
import com.ruoyi.web.utils.qcc.QiChaChaUtil;
import org.apache.commons.collections.CollectionUtils;
import org.apache.http.client.methods.HttpHead;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -58,10 +71,10 @@ public class SapRfcController
{
AjaxResult ajax = AjaxResult.success();
List<RfcResult> resCache = redisCache.getCacheObject(getSapCacheKey("country"));
List<RfcResult> resCache = redisCache.getCacheObject(getSapCacheKey("countrys"));
if(CollectionUtils.isEmpty(resCache)){
resCache = SapRfcUtils.getCountrys(null);
redisCache.setCacheObject(getSapCacheKey("country"),resCache);
redisCache.setCacheObject(getSapCacheKey("countrys"),resCache);
}
log.info("获取国家数据条数 - {}", resCache.size());
ajax.put("countrysDicts", resCache);
@ -215,6 +228,48 @@ public class SapRfcController
return ajax;
}
/**
* 获取客户税分类数据
* @param customer
* @return
*/
@PreAuthorize("@ss.hasPermi('customer:customer:list')")
@GetMapping("/getTax")
public AjaxResult getTax(Customer customer)
{
AjaxResult ajax = AjaxResult.success();
List<RfcResult> resCache = redisCache.getCacheObject(getSapCacheKey("tax"));
if(CollectionUtils.isEmpty(resCache)){
resCache = SapRfcUtils.getTax(null);
redisCache.setCacheObject(getSapCacheKey("tax"),resCache);
}
log.info("获取客户税分类数据条数 - {}", resCache.size());
ajax.put("taxDicts", resCache);
return ajax;
}
/**
* 获取统驭科目数据
* @param customer
* @return
*/
@PreAuthorize("@ss.hasPermi('customer:customer:list')")
@GetMapping("/getReconciliationAccount")
public AjaxResult getReconciliationAccount(Customer customer)
{
AjaxResult ajax = AjaxResult.success();
List<RfcResult> resCache = redisCache.getCacheObject(getSapCacheKey("reconciliationAccount"));
if(CollectionUtils.isEmpty(resCache)){
resCache = SapRfcUtils.getReconciliationAccount(null);
redisCache.setCacheObject(getSapCacheKey("reconciliationAccount"),resCache);
}
log.info("获取统驭科目数据条数 - {}", resCache.size());
ajax.put("reconciliationAccountDicts", resCache);
return ajax;
}
/**
* 获取redis SAP公共数据
* @param type
@ -224,4 +279,30 @@ public class SapRfcController
{
return CacheConstants.SAP_COMMON + type;
}
/*=======================================查询SAP银行代码信息=================================================*/
/**
* 查询银行代码列表
*/
@PreAuthorize("@ss.hasPermi('customer:customer:bankCodeList')")
@Log(title = "银行代码信息查询", businessType = BusinessType.OTHER)
@GetMapping("/bankCodeList")
public TableDataInfo bankCodeList(BankCode bank)
{
String bankName = bank.getBankName();
List<BankCode> resCache = new ArrayList<BankCode>();
try {
resCache = SapRfcUtils.getBankCodeList(bankName);
} catch (Exception e1) {
e1.printStackTrace();
}
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(HttpStatus.SUCCESS);
rspData.setMsg("查询成功");
rspData.setRows(resCache);
rspData.setTotal(new PageInfo(resCache).getTotal());
return rspData;
}
}

View File

@ -1,6 +1,7 @@
package com.ruoyi.web.utils.SapFunction;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.customer.domain.BankCode;
import com.sap.conn.jco.JCoDestination;
import com.sap.conn.jco.JCoFunction;
import com.sap.conn.jco.JCoParameterList;
@ -10,6 +11,7 @@ import java.util.ArrayList;
import java.util.List;
public class SapRfcUtils {
/**
* 获取SAP国家数据
* @param param 不传查询全部
@ -265,4 +267,103 @@ public class SapRfcUtils {
}
return countrys;
}
/**
* 获取客户税分类数据
* @param param 不传查询全部
* @return
*/
public static List<RfcResult> getTax(String param){
JCoFunction function = null;
RfcResult rfcResult = null;
List<RfcResult> countrys = new ArrayList<>();
JCoDestination destination = ConnectToSAP.connect();
try {
function = destination.getRepository().getFunctionTemplate("ZRFC_BASIC_DATA").getFunction();
if (function == null)
throw new RuntimeException("RFC_SYSTEM_INFO not found in SAP.");
JCoParameterList input = function.getImportParameterList();
input.setValue("FLAG40", StringUtils.isNotNull(param)?param:"X");//输入参数
function.execute(destination);
JCoTable table = function.getTableParameterList().getTable("T_TSKDT");
for(int i = 0; i<table.getNumRows(); i++){
table.setRow(i);
rfcResult = new RfcResult();
rfcResult.setValue(table.getString("TAXKD"));
rfcResult.setLabel(table.getString("VTEXT"));
countrys.add(rfcResult);
}
}catch (Exception e) {
e.printStackTrace();
}
return countrys;
}
/**
* 获取统驭科目数据
* @param param 不传查询全部
* @return
*/
public static List<RfcResult> getReconciliationAccount(String param){
JCoFunction function = null;
RfcResult rfcResult = null;
List<RfcResult> countrys = new ArrayList<>();
JCoDestination destination = ConnectToSAP.connect();
try {
function = destination.getRepository().getFunctionTemplate("ZRFC_BASIC_DATA").getFunction();
if (function == null)
throw new RuntimeException("RFC_SYSTEM_INFO not found in SAP.");
JCoParameterList input = function.getImportParameterList();
input.setValue("FLAG28", StringUtils.isNotNull(param)?param:"X");//输入参数
function.execute(destination);
JCoTable table = function.getTableParameterList().getTable("T_HKONT");
for(int i = 0; i<table.getNumRows(); i++){
table.setRow(i);
rfcResult = new RfcResult();
rfcResult.setValue(table.getString("SAKNR"));
rfcResult.setLabel(table.getString("TXT20"));
countrys.add(rfcResult);
}
}catch (Exception e) {
e.printStackTrace();
}
return countrys;
}
/*=======================================查询SAP银行代码信息=================================================*/
/**
* 获取银行代码数据
* @param param 不传查询全部
* @return
*/
public static List<BankCode> getBankCodeList(String param){
JCoFunction function = null;
BankCode rfcResult = null;
List<BankCode> countrys = new ArrayList<>();
JCoDestination destination = ConnectToSAP.connect();
try {
function = destination.getRepository().getFunctionTemplate("ZSRM_GET_BANKKEY").getFunction();
if (function == null)
throw new RuntimeException("RFC_SYSTEM_INFO not found in SAP.");
JCoParameterList input = function.getImportParameterList();
input.setValue("DESCRIPTION", StringUtils.isNotNull(param)?param:"X");//输入参数
function.execute(destination);
JCoTable table = function.getTableParameterList().getTable("T_DATA");
for(int i = 0; i<table.getNumRows(); i++){
table.setRow(i);
rfcResult = new BankCode();
rfcResult.setBankCode(table.getString("BANKL"));
rfcResult.setBankName(table.getString("BANKA"));
rfcResult.setBankCountry(table.getString("BANKS"));
countrys.add(rfcResult);
}
}catch (Exception e) {
e.printStackTrace();
}
return countrys;
}
}

View File

@ -24,6 +24,12 @@ public class Bank extends BaseEntity
/** 银行账户 */
private String bankAccount;
/** 银行代码 */
private String bankCode;
/** 国家 */
private String bankCountry;
/** 客户ID */
private String cusId;
@ -63,14 +69,10 @@ public class Bank extends BaseEntity
{
return cusId;
}
public String getBankCode() { return bankCode; }
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("bankId", getBankId())
.append("bankName", getBankName())
.append("bankAccount", getBankAccount())
.append("cusId", getCusId())
.toString();
}
public void setBankCode(String bankCode) { this.bankCode = bankCode; }
public String getBankCountry() { return bankCountry; }
public void setBankCountry(String bankCountry) { this.bankCountry = bankCountry; }
}

View File

@ -0,0 +1,49 @@
package com.ruoyi.customer.domain;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 银行代码对象 bankCode
*
* @author ruoyi
* @date 2024-03-25
*/
public class BankCode
{
private static final long serialVersionUID = 1L;
/** 银行ID */
private String bankCode;
/** 银行名称 */
private String bankName;
/** 国家 */
private String bankCountry;
public String getBankCode() {
return bankCode;
}
public void setBankCode(String bankCode) {
this.bankCode = bankCode;
}
public String getBankName() {
return bankName;
}
public void setBankName(String bankName) {
this.bankName = bankName;
}
public String getBankCountry() {
return bankCountry;
}
public void setBankCountry(String bankCountry) {
this.bankCountry = bankCountry;
}
}

View File

@ -319,6 +319,9 @@ public class Customer extends BaseEntity
private String cusDistributionChannel;
private String cusSalesTerritory;
private String cusSaleOffice;
private String cusCurrency;
private String cusTax;
private String cusReconciliationAccount;
public String getCusSalesOrganization() { return cusSalesOrganization; }
@ -335,4 +338,16 @@ public class Customer extends BaseEntity
public String getCusSaleOffice() { return cusSaleOffice; }
public void setCusSaleOffice(String cusSaleOffice) { this.cusSaleOffice = cusSaleOffice; }
public String getCusCurrency() { return cusCurrency; }
public void setCusCurrency(String cusCurrency) { this.cusCurrency = cusCurrency; }
public String getCusTax() { return cusTax; }
public void setCusTax(String cusTax) { this.cusTax = cusTax; }
public String getCusReconciliationAccount() { return cusReconciliationAccount; }
public void setCusReconciliationAccount(String cusReconciliationAccount) { this.cusReconciliationAccount = cusReconciliationAccount; }
}

View File

@ -36,6 +36,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="cusDistributionChannel" column="cus_distribution_channel" />
<result property="cusSalesTerritory" column="cus_sales_territory" />
<result property="cusSaleOffice" column="cus_sale_office" />
<result property="cusCurrency" column="cus_currency" />
<result property="cusTax" column="cus_tax" />
<result property="cusReconciliationAccount" column="cus_reconciliation_account" />
</resultMap>
<resultMap id="CustomerBankResult" type="Customer" extends="CustomerResult">
@ -46,6 +49,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="bankId" column="sub_bank_id" />
<result property="bankName" column="sub_bank_name" />
<result property="bankAccount" column="sub_bank_account" />
<result property="bankCode" column="sub_bank_code" />
<result property="bankCountry" column="sub_bank_country" />
<result property="cusId" column="sub_cus_id" />
</resultMap>
@ -59,7 +64,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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,u.nick_name create_name,
a.cus_sales_organization,a.cus_distribution_channel,a.cus_sales_territory,a.cus_sale_office
a.cus_sales_organization,a.cus_distribution_channel,a.cus_sales_territory,a.cus_sale_office,
a.cus_currency,a.cus_tax,a.cus_reconciliation_account
from customer a
<include refid="customerJoins"/>
</sql>
@ -82,8 +88,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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.cus_sales_organization,a.cus_distribution_channel,a.cus_sales_territory,a.cus_sale_office,
b.bank_id as sub_bank_id, b.bank_name as sub_bank_name, b.bank_account as sub_bank_account, b.cus_id as sub_cus_id
a.cus_currency,a.cus_tax,a.cus_reconciliation_account,
b.bank_id as sub_bank_id, b.bank_name as sub_bank_name, b.bank_account as sub_bank_account, b.cus_id as sub_cus_id,
b.bank_code as sub_bank_code,b.bank_country as sub_bank_country
from customer a
left join bank b on b.cus_id = a.cus_id
where a.cus_id = #{cusId}
@ -119,6 +126,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="cusDistributionChannel != null and cusDistributionChannel != ''">cus_distribution_channel,</if>
<if test="cusSalesTerritory != null and cusSalesTerritory != ''">cus_sales_territory,</if>
<if test="cusSaleOffice != null and cusSaleOffice != ''">cus_sale_office,</if>
<if test="cusCurrency != null and cusCurrency != ''">cus_currency,</if>
<if test="cusTax != null and cusTax != ''">cus_tax,</if>
<if test="cusReconciliationAccount != null and cusReconciliationAccount != ''">cus_reconciliation_account,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="cusId != null">#{cusId},</if>
@ -148,6 +158,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="cusDistributionChannel != null and cusDistributionChannel != ''">#{cusDistributionChannel},</if>
<if test="cusSalesTerritory != null and cusSalesTerritory != ''">#{cusSalesTerritory},</if>
<if test="cusSaleOffice != null and cusSaleOffice != ''">#{cusSaleOffice},</if>
<if test="cusCurrency != null and cusCurrency != ''">#{cusCurrency},</if>
<if test="cusTax != null and cusTax != ''">#{cusTax},</if>
<if test="cusReconciliationAccount != null and cusReconciliationAccount != ''">#{cusReconciliationAccount},</if>
</trim>
</insert>
@ -180,6 +193,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="cusDistributionChannel != null and cusDistributionChannel != ''">cus_distribution_channel = #{cusDistributionChannel},</if>
<if test="cusSalesTerritory != null and cusSalesTerritory != ''">cus_sales_territory = #{cusSalesTerritory},</if>
<if test="cusSaleOffice != null and cusSaleOffice != ''">cus_sale_office = #{cusSaleOffice},</if>
<if test="cusCurrency != null and cusCurrency != ''">cus_currency = #{cusCurrency},</if>
<if test="cusTax != null and cusTax != ''">cus_tax = #{cusTax},</if>
<if test="cusReconciliationAccount != null and cusReconciliationAccount != ''">cus_reconciliation_account = #{cusReconciliationAccount},</if>
</trim>
where cus_id = #{cusId}
</update>
@ -207,9 +223,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<insert id="batchBank">
insert into bank(bank_id, bank_name, bank_account, cus_id) values
insert into bank(bank_id, bank_name, bank_account, cus_id,bank_code,bank_country) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.bankId}, #{item.bankName}, #{item.bankAccount}, #{item.cusId})
( #{item.bankId}, #{item.bankName}, #{item.bankAccount}, #{item.cusId}, #{item.bankCode}, #{item.bankCountry})
</foreach>
</insert>
</mapper>

View File

@ -64,5 +64,31 @@ export function getSaleOffice(query) {
params: query
})
}
// 查询客户税分类数据
export function getTax(query) {
return request({
url: '/rfc/rfc/getTax',
method: 'get',
params: query
})
}
// 查询统驭科目数据
export function getReconciliationAccount(query) {
return request({
url: '/rfc/rfc/getReconciliationAccount',
method: 'get',
params: query
})
}
// 查询银行代码数据
export function bankCodeList(query) {
return request({
url: '/rfc/rfc/bankCodeList',
method: 'get',
params: query
})
}

View File

@ -170,14 +170,14 @@
</el-col>
<el-col :span="12">
<el-form-item label="街道/门牌号" prop="cusStreet">
<el-input v-model="form.cusStreet" placeholder="请输入街道/门牌号" :disabled="isDis"/>
<el-input v-model="form.cusStreet" placeholder="请输入街道/门牌号" :disabled="isDisSalesman"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="12">
<el-form-item label="街道" prop="cusQccStreet">
<el-input v-model="form.cusQccStreet" placeholder="企查查带出" :disabled="isDis"/>
<el-input v-model="form.cusQccStreet" placeholder="企查查带出" :disabled="isDisSalesman"/>
</el-form-item>
</el-col>
<el-col :span="12">
@ -189,12 +189,12 @@
<el-row :gutter="8">
<el-col :span="8">
<el-form-item label="电话号码" prop="cusPhoneNumber">
<el-input v-model="form.cusPhoneNumber" placeholder="请输入电话号码" :disabled="isDis"/>
<el-input v-model="form.cusPhoneNumber" placeholder="请输入电话号码" :disabled="isDisSalesman"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户组类别" prop="cusGroup">
<el-select v-model="form.cusGroup" placeholder="请选择客户组类别" style="width: 100%;" :disabled="isDis">
<el-select v-model="form.cusGroup" placeholder="请选择客户组类别" style="width: 100%;" :disabled="isDisSalesman">
<el-option
v-for="dict in dict.type.cus_group"
:key="dict.value"
@ -206,7 +206,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="客户类型" prop="cusType">
<el-select v-model="form.cusType" placeholder="请选择客户类型" style="width: 100%;" :disabled="isDis">
<el-select v-model="form.cusType" placeholder="请选择客户类型" style="width: 100%;" :disabled="isDisSalesman">
<el-option
v-for="dict in dict.type.cus_type"
:key="dict.value"
@ -220,7 +220,7 @@
<el-row :gutter="8">
<el-col :span="8">
<el-form-item label="国家" prop="cusCountry">
<el-select v-model="form.cusCountry" placeholder="请选择国家" style="width: 100%;" :disabled="isDis">
<el-select v-model="form.cusCountry" placeholder="请选择国家" style="width: 100%;" :disabled="isDisSalesman">
<el-option
v-for="item in countrysDicts"
:key="item.value"
@ -232,7 +232,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="语言" prop="cusLanguage">
<el-select v-model="form.cusLanguage" placeholder="请选择语言" style="width: 100%;" :disabled="isDis">
<el-select v-model="form.cusLanguage" placeholder="请选择语言" style="width: 100%;" :disabled="isDisSalesman">
<el-option
v-for="item in languageDicts"
:key="item.value"
@ -248,36 +248,36 @@
</el-col>
<el-col :span="8">
<el-form-item label="客户标签" prop="cusLabel">
<el-input v-model="form.cusLabel" placeholder="请输入客户标签" :disabled="isDis"/>
<el-input v-model="form.cusLabel" placeholder="请输入客户标签" :disabled="isDisSalesman"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户分类" prop="cusClassification">
<el-input v-model="form.cusClassification" placeholder="请输入客户分类" :disabled="isDis"/>
<el-input v-model="form.cusClassification" placeholder="请输入客户分类" :disabled="isDisSalesman"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="8">
<el-form-item label="电子发票邮箱" prop="cusReceivingEmail">
<el-input v-model="form.cusReceivingEmail" placeholder="请输入电子发票接收邮箱" :disabled="isDis"/>
<el-input v-model="form.cusReceivingEmail" placeholder="请输入电子发票接收邮箱" :disabled="isDisSalesman"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收件人" prop="cusRecipient">
<el-input v-model="form.cusRecipient" placeholder="请输入收件人" :disabled="isDis"/>
<el-input v-model="form.cusRecipient" placeholder="请输入收件人" :disabled="isDisSalesman"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收件人电话" prop="cusRecipientPhone">
<el-input v-model="form.cusRecipientPhone" placeholder="请输入收件人电话" :disabled="isDis"/>
<el-input v-model="form.cusRecipientPhone" placeholder="请输入收件人电话" :disabled="isDisSalesman"/>
</el-form-item>
</el-col>
</el-row>-->
<el-row :gutter="8">
<el-col :span="24">
<el-form-item label="备注" prop="cusRemark">
<el-input type="textarea" autosize v-model="form.cusRemark" placeholder="请输入备注" :disabled="isDis"/>
<el-input type="textarea" autosize v-model="form.cusRemark" placeholder="请输入备注" :disabled="isDisSalesman"/>
</el-form-item>
</el-col>
</el-row>
@ -286,18 +286,30 @@
<el-row class="mb8" :gutter="8">
<el-col :span="1.5">
<div v-hasPermi="['customer:customer:bankAdd']">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddBank" v-if="buttonShow">添加</el-button>
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddBank" v-if="buttonShowSalesman">添加</el-button>
</div>
</el-col>
<el-col :span="1.5">
<div v-hasPermi="['customer:customer:bankDel']">
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteBank" v-if="buttonShow">删除</el-button>
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteBank" v-if="buttonShowSalesman">删除</el-button>
</div>
</el-col>
</el-row>
<el-table :data="bankList" :row-class-name="rowBankIndex" @selection-change="handleBankSelectionChange" ref="bank">
<el-table :data="bankList" @selection-change="handleBankSelectionChange" ref="bank">
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="序号" align="center" prop="index" width="50"/>
<el-table-column label="国家" prop="bankCountry">
<template slot-scope="scope">
<el-input v-model="scope.row.bankCountry" placeholder="选择银行代码自动带出" :disabled="true"/>
</template>
</el-table-column>
<el-table-column label="银行代码" prop="bankCode">
<template slot-scope="scope">
<el-input v-model="scope.row.bankCode" placeholder="请输入银行代码">
<i slot="suffix" class="el-input__icon el-icon-search" @click="handleSearchBankCode(scope)"></i>
</el-input>
</template>
</el-table-column>
<el-table-column label="银行名称" prop="bankName">
<template slot-scope="scope">
<el-input v-model="scope.row.bankName" placeholder="请输入银行名称" />
@ -310,35 +322,11 @@
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="维护信息" name="checkInfo">
<el-tab-pane label="销售数据" name="checkInfo" v-if="checkRole(['ITZX_SJZ'])">
<el-row :gutter="8">
<el-col :span="8">
<el-form-item label="国家" prop="cusCountry">
<el-select v-model="form.cusCountry" placeholder="请选择国家" style="width: 100%;" :disabled="isDis">
<el-option
v-for="item in countrysDicts"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="语言" prop="cusLanguage">
<el-select v-model="form.cusLanguage" placeholder="请选择语言" style="width: 100%;" :disabled="isDis">
<el-option
v-for="item in languageDicts"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="付款条件" prop="cusPaymentTerms">
<el-select v-model="form.cusPaymentTerms" placeholder="请选择付款条件" style="width: 100%;" :disabled="isDis">
<el-select v-model="form.cusPaymentTerms" placeholder="请选择付款条件" style="width: 100%;" :disabled="isDisSjz">
<el-option
v-for="item in paymentTermsDicts"
:key="item.value"
@ -347,11 +335,9 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="8">
<el-form-item label="行业代码" prop="cusIndustryCode">
<el-select v-model="form.cusIndustryCode" placeholder="请选择行业代码" style="width: 100%;" :disabled="isDis">
<el-select v-model="form.cusIndustryCode" placeholder="请选择行业代码" style="width: 100%;" :disabled="isDisSjz">
<el-option
v-for="item in industryCodeDicts"
:key="item.value"
@ -361,9 +347,23 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="销售地区" prop="cusSalesTerritory">
<el-select v-model="form.cusSalesTerritory" placeholder="请选择销售地区" style="width: 100%;" :disabled="isDisSjz">
<el-option
v-for="item in salesTerritoryDicts"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="8">
<el-form-item label="销售组织" prop="cusSalesOrganization">
<el-select v-model="form.cusSalesOrganization" placeholder="请选择销售组织" style="width: 100%;" :disabled="isDis">
<el-select v-model="form.cusSalesOrganization" placeholder="请选择销售组织" style="width: 100%;" :disabled="isDisSjz">
<el-option
v-for="item in salesOrganizationDicts"
:key="item.value"
@ -375,7 +375,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="分销渠道" prop="cusDistributionChannel">
<el-select v-model="form.cusDistributionChannel" placeholder="请选择分销渠道" style="width: 100%;" :disabled="isDis">
<el-select v-model="form.cusDistributionChannel" placeholder="请选择分销渠道" style="width: 100%;" :disabled="isDisSjz">
<el-option
v-for="item in distributionChannelDicts"
:key="item.value"
@ -385,13 +385,37 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="销售办公室" prop="cusSaleOffice">
<el-select v-model="form.cusSaleOffice" placeholder="请选择销售办公室" style="width: 100%;" :disabled="isDisSjz">
<el-option
v-for="item in saleOfficeDicts"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="8">
<el-form-item label="销售地区" prop="cusSalesTerritory">
<el-select v-model="form.cusSalesTerritory" placeholder="请选择销售地区" style="width: 100%;" :disabled="isDis">
<el-form-item label="币种" prop="cusCurrency">
<el-select v-model="form.cusCurrency" placeholder="请选择币种" style="width: 100%;" :disabled="isDisSjz">
<el-option
v-for="item in salesTerritoryDicts"
v-for="dict in dict.type.cus_currency"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户税分类" prop="cusTax">
<el-select v-model="form.cusTax" placeholder="请选择客户税" style="width: 100%;" :disabled="isDisSjz">
<el-option
v-for="item in taxDicts"
:key="item.value"
:label="item.label"
:value="item.value"
@ -400,10 +424,10 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="销售办公室" prop="cusSaleOffice">
<el-select v-model="form.cusSaleOffice" placeholder="请选择销售办公室" style="width: 100%;" :disabled="isDis">
<el-form-item label="统驭科目" prop="cusReconciliationAccount">
<el-select v-model="form.cusReconciliationAccount" placeholder="请选择统驭科目" style="width: 100%;" :disabled="isDisSjz">
<el-option
v-for="item in saleOfficeDicts"
v-for="item in reconciliationAccountDicts"
:key="item.value"
:label="item.label"
:value="item.value"
@ -417,10 +441,13 @@
</el-form>
<div slot="footer" class="dialog-footer">
<span v-hasPermi="['customer:customer:save']">
<el-button @click="saveForm" v-if="buttonShow"> </el-button>
<el-button @click="saveForm" v-if="buttonShowSalesman"> </el-button>
</span>
<span style="margin-left: 10px" v-hasPermi="['customer:customer:commit']">
<el-button type="primary" plain @click="commitForm" v-if="buttonShow"> </el-button>
<el-button type="primary" plain @click="commitForm" v-if="buttonShowSalesman"> </el-button>
</span>
<span style="margin-left: 10px" v-hasPermi="['customer:customer:commitSAP']">
<el-button type="primary" plain @click="commitSAPForm" v-if="buttonShowSjz"> 交OA</el-button>
</span>
</div>
</el-dialog>
@ -460,6 +487,40 @@
<el-button @click="qccCancel"> </el-button>
</div>
</el-dialog>
<!-- 银行代码 查询 对话框 -->
<el-dialog :title="bankCodeTitle" :visible.sync="bankCodeOpen" width="800px" :show-close="false" append-to-body>
<el-form :model="queryBankCodeParams" ref="queryBankCodeForm" size="small" :inline="true" label-width="100px">
<el-form-item label="银行名称" prop="Name">
<el-input
v-model="queryBankCodeParams.bankName"
placeholder="请输入银行名称"
clearable
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleBankCodeQuery">搜索</el-button>
</el-form-item>
</el-form>
<el-table v-loading="bankCodeLoading" ref="bankCodeTable" :data="bankCodePagedData" @selection-change="handleSelectionBankCodeChange" height="300">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="银行代码" align="center" prop="bankCode" width="120"/>
<el-table-column label="银行名称" align="center" prop="bankName" />
<el-table-column label="国家" align="center" prop="bankCountry" width="120"/>
</el-table>
<pagination
v-show="bankCodeTotal>0"
:total="bankCodeTotal"
:page.sync="bankCodeCurrentPage"
:limit.sync="bankCodePageSize"
@size-change="handleBankCodeSizeChange"
@current-change="handleBankCodeCurrentChange"
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="bankCodeConfirm" :disabled="bankCodeSingle"> </el-button>
<el-button @click="bankCodeCancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<style>
@ -475,11 +536,60 @@
<script>
import { listCustomer, getCustomer, delCustomer, addCustomer, updateCustomer, commitCustomer, qccListCustomer } from "@/api/customer/customer";
import { checkPermi, checkRole } from "@/utils/permission"; //
import { getCountrys,getIndustryCode,getLanguage,getPaymentTerms,getSalesOrganization,getDistributionChannel,getSalesTerritory,getSaleOffice } from "@/api/common/sapRfc";// sap-rfc
import { bankCodeList,getCountrys,getIndustryCode,getLanguage,getPaymentTerms,getSalesOrganization,getDistributionChannel,getSalesTerritory,getSaleOffice,getTax,getReconciliationAccount } from "@/api/common/sapRfc";// sap-rfc
// -
const validateCusPaymentTerms = (rule, value, callback) => {
if (!value) {
callback(new Error("付款条件不能为空"));
} else {
callback();
}
};
// -
const validateCusIndustryCode = (rule, value, callback) => {
if (!value) {
callback(new Error("行业代码不能为空"));
} else {
callback();
}
};
// -
const validateCusSalesTerritory = (rule, value, callback) => {
if (!value) {
callback(new Error("销售地区不能为空"));
} else {
callback();
}
};
// -
const validateCusSaleOffice = (rule, value, callback) => {
if (!value) {
callback(new Error("销售办公室不能为空"));
} else {
callback();
}
};
// -
const validateCusTax = (rule, value, callback) => {
if (!value) {
callback(new Error("客户税分类不能为空"));
} else {
callback();
}
};
// -
const validateCusReconciliationAccount = (rule, value, callback) => {
if (!value) {
callback(new Error("统驭科目不能为空"));
} else {
callback();
}
};
export default {
name: "Customer",
dicts: ['cus_group', 'cus_approval_status', 'cus_type', 'common_state'],
dicts: ['cus_currency','cus_group','cus_approval_status', 'cus_type', 'common_state'],
data() {
return {
//
@ -527,15 +637,9 @@ export default {
cusStreet: [
{ required: true, message: "街道/门牌号不能为空", trigger: "blur" }
],
cusPaymentTerms: [
{ required: true, message: "付款条件不能为空", trigger: "change" }
],
cusPhoneNumber: [
{ required: true, message: "电话号码不能为空", trigger: "blur" }
],
cusIndustryCode: [
{ required: true, message: "行业代码不能为空", trigger: "blur" }
],
cusGroup: [
{ required: true, message: "客户组类别不能为空", trigger: "change" }
],
@ -548,23 +652,47 @@ export default {
cusLanguage: [
{ required: true, message: "语言不能为空", trigger: "change" }
],
//
cusPaymentTerms: [
{ required: true,trigger: "change", validator: validateCusPaymentTerms}
],
cusIndustryCode: [
{ required: true, trigger: "blur", validator: validateCusIndustryCode }
],
cusSalesOrganization: [
{ required: true, message: "销售组织不能为空", trigger: "blur" }
{ required: true, message: "销售组织不能为空", trigger: "blur"}
],
cusDistributionChannel: [
{ required: true, message: "分销渠道不能为空", trigger: "blur" }
],
cusSalesTerritory: [
{ required: true, message: "销售地区不能为空", trigger: "blur" }
{ required: true, trigger: "blur", validator: validateCusSalesTerritory }
],
cusSaleOffice: [
{ required: true, message: "销售办公室不能为空", trigger: "blur" }
{ required: true, trigger: "blur", validator: validateCusSaleOffice }
],
cusCurrency: [
{ required: true, message: "币种不能为空", trigger: "blur" }
],
cusTax: [
{ required: true, trigger: "blur", validator: validateCusTax }
],
cusReconciliationAccount: [
{ required: true, trigger: "blur", validator: validateCusReconciliationAccount }
],
},
// \,
buttonShow: true,
//
isDis: false,
// \, -
buttonShowSalesman: true,
// OA -
buttonShowSjz: true,
// -
isDisSalesman: false,
// -
isDisSjz: false,
/*****************************企查查查询模块*************************************/
//
@ -588,6 +716,29 @@ export default {
Name: null
},
/*****************************企查查查询模块*************************************/
/*****************************银行代码查询模块*************************************/
//
bankCodeLoading: false,
//
bankCodeTitle: "",
//
bankCodeOpen: false,
//
bankSelectedIndex: "",
bankCodeTotal: 0,
bankCodeCurrentPage: 1,
bankCodePageSize: 10,
bankCodeList: [], //
//
bankCodeSingle: true,
//
bankCodeMultiple: true,
queryBankCodeParams:{
bankName: null
},
/*****************************银行代码查询模块*************************************/
/*****************************SAP-RFC查询模块*************************************/
countrysDicts: [], //
industryCodeDicts: [], //
@ -597,11 +748,17 @@ export default {
distributionChannelDicts: [], //
salesTerritoryDicts: [], //
saleOfficeDicts: [], //
taxDicts: [], //
reconciliationAccountDicts: [], //
/*****************************SAP-RFC查询模块*************************************/
};
},
created() {
const roles = this.$store.state.user.roles;
if(roles && roles.indexOf('ITZX_SJZ') !== -1 && roles.indexOf('admin') == -1 ){//
this.queryParams.cusApprovalStatus = '1';
}
this.getList();
},
methods: {
@ -682,8 +839,12 @@ export default {
this.setInitF();
this.form = response.data;
this.buttonShow = this.form.cusApprovalStatus == '0'?true:false;
this.isDis = this.form.cusApprovalStatus == '0'?false:true;
this.buttonShowSalesman = this.form.cusApprovalStatus == '0'?true:false;
this.isDisSalesman = this.form.cusApprovalStatus == '0'?false:true;
this.buttonShowSjz = this.form.cusApprovalStatus != '0'?true:false;
this.isDisSjz = this.form.cusApprovalStatus != '0'?true:false;
this.bankList = response.data.bankList;
this.open = true;
this.title = "修改客户信息";
@ -732,14 +893,12 @@ export default {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 银行序号 */
rowBankIndex({ row, rowIndex }) {
row.index = rowIndex + 1;
},
/** 银行添加按钮操作 */
handleAddBank() {
let obj = {};
obj.bankCountry = "";
obj.bankCode = "";
obj.bankName = "";
obj.bankAccount = "";
this.bankList.push(obj);
@ -756,6 +915,7 @@ export default {
});
}
},
/** 复选框选中数据 */
handleBankSelectionChange(selection) {
this.checkedBank = selection.map(item => item.index)
@ -826,6 +986,77 @@ export default {
this.resetForm("queryQccForm");
},
/*****************************企查查查询模块*************************************/
/*****************************银行代码查询模块*************************************/
/** 选择银行代码弹出框 */
handleSearchBankCode(scope) {
this.bankCodeOpen = true;
this.bankCodeTitle = "银行代码信息";
this.resetBankCodeQuery();
this.bankSelectedIndex = scope.$index;
},
/** 切换每页显示条数 */
handleBankCodeSizeChange(val) {
this.bankCodePageSize = val;
this.bankCodeCurrentPage = 1;
},
/** 页码选择 */
handleBankCodeCurrentChange(val) {
this.bankCodeCurrentPage = val;
},
/** 银行代码查询 */
handleBankCodeQuery(){
if(!this.queryBankCodeParams.bankName){
this.$message.warning("请输入银行名称!");
return;
}
this.bankCodeLoading = true;
bankCodeList(this.queryBankCodeParams).then(response => {
this.bankCodeList = response.rows;
this.bankCodeTotal = response.total;
this.bankCodeCurrentPage = 1;
this.bankCodeLoading = false;
});
},
//
handleSelectionBankCodeChange(selection) {
this.bankCodeSingle = selection.length!==1
this.bankCodeMultiple = !selection.length
},
//
bankCodeConfirm(){
const bankCodeTable = this.$refs.bankCodeTable;
const selectedData = bankCodeTable.selection;
const bankCode = selectedData[0].bankCode;
const bankName = selectedData[0].bankName;
const bankCountry = selectedData[0].bankCountry;
//
const bank = this.bankList[this.bankSelectedIndex];
bank.bankCode = bankCode;
bank.bankName = bankName;
bank.bankCountry = bankCountry;
this.bankCodeOpen = false;
},
//
bankCodeCancel() {
this.bankCodeOpen = false;
this.resetBankCodeQuery();
},
/** 重置按钮操作 */
resetBankCodeQuery() {
this.bankCodeList = [];
this.bankCodeTotal = 0;
this.queryBankCodeParams = {
bankName: ""
}
},
/*****************************银行代码查询模块*************************************/
/*****************************SAP-RFC查询模块*************************************/
//
setInitV(){
@ -834,9 +1065,10 @@ export default {
this.form.cusGroup = 'Z001';
this.form.cusType = '0';
this.form.cusCountry = 'CN';
this.form.cusLanguage = 'ZH';
this.form.cusLanguage = '1';
this.form.cusSalesOrganization = '1100';
this.form.cusDistributionChannel = '10';
this.form.cusCurrency = 'CNY';
},
// SAP
setInitF(){
@ -850,6 +1082,8 @@ export default {
this.getDistributionChannel();
this.getSalesTerritory();
this.getSaleOffice();
this.getTax();
this.getReconciliationAccount();
},
//SAP
getCountrys(){
@ -899,15 +1133,27 @@ export default {
this.saleOfficeDicts = response.saleOfficeDicts;
});
},
//
getTax(){
getTax(this.queryParams).then(response => {
this.taxDicts = response.taxDicts;
});
},
//
getReconciliationAccount(){
getReconciliationAccount(this.queryParams).then(response => {
this.reconciliationAccountDicts = response.reconciliationAccountDicts;
});
},
/*****************************SAP-RFC查询模块*************************************/
},
/* computed: {
//
qccPagedData() {
const startIndex = (this.qccCurrentPage - 1) * this.qccPageSize;
const endIndex = startIndex + this.qccPageSize;
return this.qccCustomerList.slice(startIndex, endIndex);
computed: {
//
bankCodePagedData() {
const startIndex = (this.bankCodeCurrentPage - 1) * this.bankCodePageSize;
const endIndex = startIndex + this.bankCodePageSize;
return this.bankCodeList.slice(startIndex, endIndex);
},
},
},*/
};
</script>

View File

@ -822,6 +822,10 @@ export default {
};
},
created() {
const roles = this.$store.state.user.roles;
if(roles && roles.indexOf('QUOT') !== -1 && roles.indexOf('admin') == -1 ){//
this.queryParams.quotApprovalStatus = '1';
}
this.getList();
},
methods: {