Browse Source

[fix]

销售管理 客户报价
修改编辑客户报价页面业务员字段下拉框为文本输入框,
修改绑定数据源为当前登录名自动填充;
修改客户报价后端编辑方法,添加审批流程相关,编辑后启动审批流程;
dev
王晓迪 4 months ago
parent
commit
1a36762e07
  1. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java
  2. 49
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java
  3. 46
      ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html

2
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java

@ -50,7 +50,7 @@ public interface ISysCustomerQuoteService
* @param sysCustomerQuote 客户报价信息
* @return 结果
*/
int updateSysCustomerQuote(SysCustomerQuoteVo sysCustomerQuote);
ProcessInstance updateSysCustomerQuote(SysCustomerQuoteVo sysCustomerQuote);
/**
* 删除客户报价信息

49
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java

@ -150,7 +150,7 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService {
}
@Transactional(rollbackFor = Exception.class)
@Override
public int updateSysCustomerQuote(SysCustomerQuoteVo sysCustomerQuote) {
public ProcessInstance updateSysCustomerQuote(SysCustomerQuoteVo sysCustomerQuote) {
String loginName = ShiroUtils.getLoginName();
sysCustomerQuote.setUpdateBy(loginName);
sysCustomerQuote.setUpdateTime(DateUtils.getNowDate());
@ -158,24 +158,41 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService {
int list = sysCustomerQuoteMapper.updateSysCustomerQuote(sysCustomerQuote);
List<SysCustomerQuoteChild> sysCustomerQuoteChild = sysCustomerQuote.getSysCustomerQuoteChildList();
int s = sysCustomerQuoteChild.size();
if (s == 0){
return 0;
}
for(SysCustomerQuoteChild sysCustomerQuoteChild1 : sysCustomerQuoteChild){
if (sysCustomerQuoteChild1.getId() == null || sysCustomerQuoteChild1.getId() == 0L){
sysCustomerQuoteChild1.setQuoteId(sysCustomerQuote.getSupplierCode());
sysCustomerQuoteChild1.setCreateBy(loginName);
sysCustomerQuoteChild1.setCreateTime(DateUtils.getNowDate());
sysCustomerQuoteChildMapper.insertSysCustomerQuoteChild(sysCustomerQuoteChild1);
}else {
sysCustomerQuoteChild1.setUpdateBy(loginName);
sysCustomerQuoteChild1.setUpdateTime(DateUtils.getNowDate());
sysCustomerQuoteChildMapper.updateSysCustomerQuoteChild(sysCustomerQuoteChild1);
if (s > 0){
for(SysCustomerQuoteChild sysCustomerQuoteChild1 : sysCustomerQuoteChild){
if (sysCustomerQuoteChild1.getId() == null || sysCustomerQuoteChild1.getId() == 0L){
sysCustomerQuoteChild1.setQuoteId(sysCustomerQuote.getSupplierCode());
sysCustomerQuoteChild1.setCreateBy(loginName);
sysCustomerQuoteChild1.setCreateTime(DateUtils.getNowDate());
sysCustomerQuoteChildMapper.insertSysCustomerQuoteChild(sysCustomerQuoteChild1);
}else {
sysCustomerQuoteChild1.setUpdateBy(loginName);
sysCustomerQuoteChild1.setUpdateTime(DateUtils.getNowDate());
sysCustomerQuoteChildMapper.updateSysCustomerQuoteChild(sysCustomerQuoteChild1);
}
}
}
// 启动流程
return list;
sysCustomerQuote.setApplyUser(user.getLoginName());
sysCustomerQuote.setApplyTime(DateUtils.getNowDate());
sysCustomerQuoteMapper.updateSysCustomerQuote(sysCustomerQuote);
// 启动流程
String applyTitle = user.getUserName()+"发起了客户报价信息提交审批-"+DateUtils.dateTimeNow();
String instanceType = "submit";
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,sysCustomerQuote, user);
String processInstanceId = processInstance.getProcessInstanceId();
// 提交实例id
sysCustomerQuote.setSubmitInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
// 审核状态-审核通过
sysCustomerQuote.setAuditStatus("1");
// 使用状态-是
sysCustomerQuote.setUseStatus("1");
}
sysCustomerQuoteMapper.updateSysCustomerQuote(sysCustomerQuote);
return processInstance;
}
@Override

46
ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html

@ -23,9 +23,11 @@
<div class="form-group" shiro:hasPermission="system:customerQuote:edit">
<label class="col-sm-4 control-label">业务员:</label>
<div class="col-sm-8">
<select class="form-control" name="businessMembers" th:field="*{businessMembers}" readonly required>
<option value="">请选择</option>
</select>
<!-- <select class="form-control" name="businessMembers" th:field="*{businessMembers}" readonly required>-->
<!-- <option value="">请选择</option>-->
<!-- </select>-->
<input name="businessMembers" th:field="*{businessMembers}" class="form-control" type="text" readonly required>
</div>
</div>
<div class="form-group">
@ -144,6 +146,7 @@
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var userName = [[${@permission.getPrincipalProperty('userName')}]];
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
var sysCustomerQuote = [[${sysCustomerQuote}]];
var prefix = ctx + "system/customerQuote"
var commonCurrency = $("#commonCurrency_edit option:selected").val();
@ -153,24 +156,24 @@
var customerCode1 = [[${sysCustomerQuote.customerCode}]];
$(function() {
/*业务员列表*/
$.ajax({
url: ctx + 'system/salesOrder/getBinessMembers',
type: 'get',
success: function (res) {
console.log(res)
if (res.rows.length > 0) {
var usertData = res.rows;
//alert(JSON.stringify(data));
for (let i in usertData) {
// console.log(finishProductData[i].finishProductCode)
$("#form-customerQuote-edit select[name='businessMembers']").append("<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
$("#form-customerQuote-edit select[name='businessMembers']").val(sysCustomerQuote.businessMembers).trigger("change")
} else {
$.modal.msgError(res.msg);
}
}
});
// $.ajax({
// url: ctx + 'system/salesOrder/getBinessMembers',
// type: 'get',
// success: function (res) {
// console.log(res)
// if (res.rows.length > 0) {
// var usertData = res.rows;
// //alert(JSON.stringify(data));
// for (let i in usertData) {
// // console.log(finishProductData[i].finishProductCode)
// $("#form-customerQuote-edit select[name='businessMembers']").append("<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
// }
// $("#form-customerQuote-edit select[name='businessMembers']").val(sysCustomerQuote.businessMembers).trigger("change")
// } else {
// $.modal.msgError(res.msg);
// }
// }
// });
$("input[name='customerFax']").val([sysCustomerQuote.customerFax]);
$("input[name='rmbTax']").val([sysCustomerQuote.taxRate]);
$("input[name='customerFax']").change(function () {
@ -183,6 +186,7 @@
$("#commonCurrency_edit").val(sysCustomerQuote.commonCurrency).trigger('change');
});
$(function() {
$("#form-customerQuote-edit input[name='businessMembers']").val(loginName);
var options = {
id: "bootstrap-table-Quote-child-edit1",
url: ctx + "system/quoteChild/list",

Loading…
Cancel
Save