Browse Source

[fix]销售管理:

客户报价
修改 业务经理,业务主管,总经理总助缺少TaskId问题
修改总经理总助审批时缺少客户报价详情问题
修改业务主管审核不同意的条件
去掉根据 业务经理这个角色筛选数据条件
去掉审批时多instanceTypeName字段
dev
liuxiaoxu 5 months ago
parent
commit
208e7c7c64
  1. 29
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java
  2. 2
      ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html
  3. 177
      ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwjlVerify.html
  4. 1
      ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html

29
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java

@ -102,20 +102,20 @@ public class SysCustomerQuoteController extends BaseController
String loginName = ShiroUtils.getLoginName(); String loginName = ShiroUtils.getLoginName();
List<SysUser> sysUserlist = sysUserService.selectRoleToUserList("ywyRole"); List<SysUser> sysUserlist = sysUserService.selectRoleToUserList("ywyRole");
sysUserlist.add(curUser); sysUserlist.add(curUser);
if (roleKeys.contains("ywjlRole")) { // if (roleKeys.contains("ywjlRole")) {
List<SysUser> findUser = sysUserlist.stream().filter(item -> (item.getDeptId().equals(curUser.getDeptId()))).collect(Collectors.toList()); // List<SysUser> findUser = sysUserlist.stream().filter(item -> (item.getDeptId().equals(curUser.getDeptId()))).collect(Collectors.toList());
Set<String> user = findUser.stream().map(SysUser::getLoginName).collect(Collectors.toSet()); // Set<String> user = findUser.stream().map(SysUser::getLoginName).collect(Collectors.toSet());
startPage(); // startPage();
List<SysCustomerQuoteVo> list2 = list.stream().filter(item -> user.contains(item.getApplyUser())).collect(Collectors.toList()); // List<SysCustomerQuoteVo> list2 = list.stream().filter(item -> user.contains(item.getApplyUser())).collect(Collectors.toList());
return getDataTable(list2); // return getDataTable(list2);
} // }
// 业务员角色只能看到自己创建的数据 // // 业务员角色只能看到自己创建的数据
if (roleKeys.contains("ywyRole")) { // if (roleKeys.contains("ywyRole")) {
sysCustomerQuoteVo.setApplyUser(curUser.getLoginName()); // sysCustomerQuoteVo.setApplyUser(curUser.getLoginName());
startPage(); // startPage();
List<SysCustomerQuoteVo> list2 = sysCustomerQuoteService.selectSysCustomerQuoteList(sysCustomerQuoteVo); // List<SysCustomerQuoteVo> list2 = sysCustomerQuoteService.selectSysCustomerQuoteList(sysCustomerQuoteVo);
return getDataTable(list2); // return getDataTable(list2);
} // }
return getDataTable(list); return getDataTable(list);
}catch(NullPointerException e){ }catch(NullPointerException e){
throw new NullPointerException("当前用户没有申请客户报价信息"); throw new NullPointerException("当前用户没有申请客户报价信息");
@ -240,7 +240,6 @@ public class SysCustomerQuoteController extends BaseController
String processInstanceId = task.getProcessInstanceId(); String processInstanceId = task.getProcessInstanceId();
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
SysCustomerQuoteVo sysCustomerQuoteVo = sysCustomerQuoteService.selectSysCustomerQuoteById(new Long(processInstance.getBusinessKey())); SysCustomerQuoteVo sysCustomerQuoteVo = sysCustomerQuoteService.selectSysCustomerQuoteById(new Long(processInstance.getBusinessKey()));
sysCustomerQuoteVo.setTaskId(taskId);
mmap.put("formData", sysCustomerQuoteVo); mmap.put("formData", sysCustomerQuoteVo);
mmap.put("taskId", taskId); mmap.put("taskId", taskId);
String verifyName = task.getTaskDefinitionKey().substring(0, 1).toUpperCase() + task.getTaskDefinitionKey().substring(1); String verifyName = task.getTaskDefinitionKey().substring(0, 1).toUpperCase() + task.getTaskDefinitionKey().substring(1);

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

@ -191,7 +191,7 @@
var todoUserIdList = row.todoUserId.split(","); var todoUserIdList = row.todoUserId.split(",");
if(todoUserIdList.includes(loginName)){ if(todoUserIdList.includes(loginName)){
var nodeName = row.taskName=='驳回调整'?' 调整申请':' 审批'; var nodeName = row.taskName=='驳回调整'?' 调整申请':' 审批';
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="showVerifyDialog(\'' + prefix + '\',\'' + row.taskId + '\', \'' + row.taskName+"-"+row.instanceTypeName+"申请" + '\')"><i class="fa fa-edit"></i> '+nodeName+'</a> '); actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="showVerifyDialog(\'' + prefix + '\',\'' + row.taskId + '\', \'' + row.taskName+"-"+"申请" + '\')"><i class="fa fa-edit"></i> '+nodeName+'</a> ');
} }
} }
// 审批历史 // 审批历史

177
ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwjlVerify.html

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org"> <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head> <head>
<th:block th:include="include :: header('业务经理审核')" /> <th:block th:include="include :: header('业务经理审核')" />
<th:block th:include="include :: select2-css" /> <th:block th:include="include :: select2-css" />
@ -16,7 +16,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">申请人:</label> <label class="col-sm-3 control-label">申请人:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="applyUser" th:field="*{applyUser}" class="form-control" type="text" readonly> <input name="applyUserName" th:field="*{applyUserName}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -49,7 +49,7 @@
<div class="col-xs-12"> <div class="col-xs-12">
<label class="col-sm-4 control-label">业务员:</label> <label class="col-sm-4 control-label">业务员:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select class="form-control" name="businessMembers" th:field="*{businessMembers}" id="businessMembers" required> <select class="form-control" name="businessMembers" disabled required th:field="*{businessMembers}">
<option value="">请选择</option> <option value="">请选择</option>
</select> </select>
</div> </div>
@ -69,8 +69,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">报价币种:</label> <label class="col-sm-4 control-label">报价币种:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select class="form-control" id="commonCurrency_edit" name="commonCurrency" <select class="form-control" id="commonCurrency_edit" name="commonCurrency" th:with="dictList=${@dict.getType('sys_common_currency')}" th:field="*{commonCurrency}" required>
th:with="dictList=${@dict.getType('sys_common_currency')}" th:field="*{commonCurrency}" required>
<option value="">请选择</option> <option value="">请选择</option>
<option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}" ></option> <option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}" ></option>
</select> </select>
@ -86,8 +85,8 @@
<label class="col-sm-6 control-label is-required">是否含税:</label> <label class="col-sm-6 control-label is-required">是否含税:</label>
<div class="col-sm-6"> <div class="col-sm-6">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_confirm_tax')}"> <div class="radio-box" th:each="dict : ${@dict.getType('sys_confirm_tax')}">
<input type="radio" th:id="${'confirmFax_' + dict.dictCode}" <input required type="radio" th:id="${'confirmFax_' + dict.dictCode}"
name="confirmFax" th:value="${dict.dictValue}" th:field="*{confirmFax}" th:checked="${dict.isDefault == 'Y' ? true : false}" required> name="confirmFax" th:value="${dict.dictValue}" th:field="*{confirmFax}" th:checked="${dict.isDefault == 'Y' ? true : false}">
<label th:for="${'confirmFax_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> <label th:for="${'confirmFax_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div> </div>
</div> </div>
@ -117,25 +116,24 @@
<div class="container"> <div class="container">
<h4 class="form-header h4">计算</h4> <h4 class="form-header h4">计算</h4>
<div class="col-xs-12 form-row"> <div class="col-xs-12 form-row">
<label class=" col-sm-2">物料合计:</label><input class="col-sm-4" name="enterprise" id="enterprise_edit" th:field="*{enterprise}" type="text" disabled/> <label class=" col-sm-2">物料合计:</label><input class="col-sm-4" name="enterprise" id="enterprise_edit" type="text" readonly/>
<label class=" col-sm-2">数量合计:</label><input class="col-sm-4" name="enterpriseSum" id="enterpriseSum_edit" th:field="*{enterpriseSum}" type="number" disabled/> <label class=" col-sm-2">数量合计:</label><input class="col-sm-4" name="enterpriseSum" id="enterpriseSum_edit" type="number" readonly/>
</div> </div>
<div class="col-xs-12 form-row"> <div class="col-xs-12 form-row">
<label class="col-sm-2"> 不含税单价:</label><input placeholder="RMB" class="col-sm-4" name="noRmb" id="noRmb_edit" th:field="*{noRmb}" type="number" disabled /> <label class="col-sm-2"> 不含税单价:</label><input placeholder="RMB" class="col-sm-4" name="noRmb" id="noRmb_edit" type="number" readonly/>
<label class="col-sm-2"> 不含税总价:</label><input placeholder="RMB" class="col-sm-4" name="noRmbSum" id="noRmbSum_edit" th:field="*{noRmbSum}" type="number" disabled/> <label class="col-sm-2"> 不含税总价:</label><input placeholder="RMB" class="col-sm-4" name="noRmbSum" id="noRmbSum_edit" type="number" readonly/>
</div> </div>
<div class="col-xs-12 form-row"> <div class="col-xs-12 form-row">
<label class="col-sm-2"> 含税单价:</label><input placeholder="RMB" class="col-sm-4" name="rmb" id="rmb_edit" type="number" th:field="*{rmb}" disabled/> <label class="col-sm-2"> 含税单价:</label><input placeholder="RMB" class="col-sm-4" name="rmb" id="rmb_edit" type="number" readonly/>
<label class="col-sm-2"> 含税总价:</label><input placeholder="RMB" class="col-sm-4" name="rmbSum" id="rmbSum_edit" th:field="*{rmbSum}" type="number" disabled/> <label class="col-sm-2"> 含税总价:</label><input placeholder="RMB" class="col-sm-4" name="rmbSum" id="rmbSum_edit" type="number" readonly/>
</div> </div>
<div class="col-xs-12 form-row"> <div class="col-xs-12">
<label class="col-sm-2">不含税单价:</label><input placeholder="USD" class="col-sm-4" name="noUsd" id="noUsd_edit" th:field="*{noUsd}" type="number" disabled/> <label class="col-sm-2">不含税单价:</label><input placeholder="美元" class="col-sm-4" name="noUsd" id="noUsd_edit" type="number" readonly/>
<label class="col-sm-2">不含税总价:</label><input placeholder="USD" class="col-sm-4" name="noUsdSum" id="noUsdSum_edit" th:field="*{noUsdSum}" type="number" disabled/> <label class="col-sm-2">不含税总价:</label><input placeholder="美元" class="col-sm-4" name="noUsdSum" id="noUsdSum_edit" type="number" readonly/>
</div> </div>
<div class="col-xs-12 form-row"> <div class="col-xs-12">
<label class="col-sm-2">含税单价:</label><input placeholder="USD" class="col-sm-4" name="usd" id="usd_edit" th:field="*{usd}" type="number" disabled/> <label class="col-sm-2">含税单价:</label><input placeholder="美元" class="col-sm-4" name="usd" id="usd_edit" type="number" readonly/>
<label class="col-sm-2">含税总价:</label><input placeholder="USD" class="col-sm-4" name="usdSum" id="usdSum_edit" th:field="*{usdSum}" type="number" disabled/> <label class="col-sm-2">含税总价:</label><input placeholder="美元" class="col-sm-4" name="usdSum" id="usdSum_edit" type="number" readonly/>
</div> </div>
</div> </div>
@ -162,7 +160,7 @@
<div class="form-row"> <div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group"> <div class="btn-group-sm" id="toolbar" role="group">
<span>选择报价信息</span> <span>选择报价信息</span>
<a class="btn btn-success" disabled> <a class="btn btn-success" onclick="insertRow()">
<i class="fa fa-plus"></i> 添加物料 <i class="fa fa-plus"></i> 添加物料
</a> </a>
</div> </div>
@ -176,8 +174,12 @@
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" /> <th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-js" /> <script th:src="@{/js/activiti.js}"></script>
<script th:src="@{/ajax/libs/vue/vue.js}"></script>
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script>
<script th:inline="javascript"> <script th:inline="javascript">
var prefix = ctx + "erp/bom";
$("#form-customerQuote-ywjl").validate({focusCleanup: true});
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]]; var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]]; var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]]; var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
@ -186,8 +188,11 @@
var sysCustomerQuote = [[${formData}]]; var sysCustomerQuote = [[${formData}]];
var prefix = ctx + "system/customerQuote" var prefix = ctx + "system/customerQuote"
var commonCurrency = $("#commonCurrency_edit option:selected").val(); var commonCurrency = $("#commonCurrency_edit option:selected").val();
$("#form-customerQuote-ywjl").validate({focusCleanup: true}); $("#form-customerQuote-ywjl").validate({
focusCleanup: true,
});
$(function() { $(function() {
/*业务员列表*/
$.ajax({ $.ajax({
url: ctx + 'system/salesOrder/getBinessMembers', url: ctx + 'system/salesOrder/getBinessMembers',
type: 'get', type: 'get',
@ -196,10 +201,9 @@
if (res.rows.length > 0) { if (res.rows.length > 0) {
var usertData = res.rows; var usertData = res.rows;
for (let i in usertData) { for (let i in usertData) {
$("#form-customerQuote-ywjl select[name='businessMembers']").append("<option value='" + $("#form-customerQuote-ywjl select[name='businessMembers']").append("<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
usertData[i].userName + "'>" + usertData[i].userName + "</option>");
} }
$("#form-customerQuote-ywjl select[name='businessMembers']").val(sysCustomerQuote.businessMembers).trigger("change");; $("#form-customerQuote-ywjl select[name='businessMembers']").val(sysCustomerQuote.businessMembers).trigger("change")
} else { } else {
$.modal.msgError(res.msg); $.modal.msgError(res.msg);
} }
@ -267,12 +271,94 @@
return $.table.selectDictLabel(processMethodDatas, value); return $.table.selectDictLabel(processMethodDatas, value);
} }
}, },
{title: '国内税率',field: 'countTax',align: 'center',editable: true}, { title: '对外售价',field: 'materialSole',
{title: '美元汇率',field: 'usdTax', align: 'center',editable: true}, editable: {
{title: '对外售价',field: 'materialSole',editable: true}, type: 'number',
{title: '物料的数量',field: 'materialNum',align: 'center',editable: true}, mode: 'inline',
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',editable: commonCurrency==1?true:false}, title: '对外售价',
{title: '物料的不含税单价(美元)',field: 'materialNoUsd',align: 'center',editable: commonCurrency==2?true:false}, validate: function (value) {
if (!value) {
return '对外售价不能为空';
}
if (isNaN(value)) {
return '对外售价必须为数字';
}
}
}
},
{title: '国内税率',field: 'countTax',align: 'center',},
{ title: '美元汇率',field: 'usdTax', align: 'center',},
{title: '物料的数量',field: 'materialNum',align: 'center',
editable:{
type : 'text',
mode: 'inline',
title : '物料的数量',
validate : function(value) {
if (!value) {
return '用量不能为空';
}
if (isNaN(value)) {
return '用量必须为数字';
}
}
},
},
{ title: '物料的不含税单价(RMB)',
field: 'materialNoRmb',
align: 'center',
editable:{
type: 'text', // 使用'text'类型,因为我们需自定义验证小数
mode: 'inline',
enabled: function() {
return ($("#commonCurrency_add").val() === '1'); // 当货币类型为2时启用
},
title: '物料的不含税单价(RMB)',
validate: function(value) {
// 验证是否为空
if (!value) {
return '金额不能为空';
}
// 尝试转换为浮点数并检查是否成功
var num = parseFloat(value);
if (isNaN(num)) {
return '请输入有效的数字';
}
// 检查小数点后是否有超过两位的数字
var decimalPart = num.toString().split('.')[1]; // 获取小数部分
if (decimalPart && decimalPart.length > 2) {
return '请输入精确到小数点后两位的数字';
}
}
}
},
{title: '物料的不含税单价(美元)',
field: 'materialNoUsd',
align: 'center',
editable: {
type: 'text', // 使用'text'类型,因为我们需自定义验证小数
mode: 'inline',
enabled: function() {
return ($("#commonCurrency_add").val() === '2'); // 当货币类型为2时启用
},
title: '物料的不含税单价(美元)',
validate: function(value) {
// 验证是否为空
if (!value) {
return '金额不能为空';
}
// 尝试转换为浮点数并检查是否成功
var num = parseFloat(value);
if (isNaN(num)) {
return '请输入有效的数字';
}
// 检查小数点后是否有超过两位的数字
var decimalPart = num.toString().split('.')[1]; // 获取小数部分
if (decimalPart && decimalPart.length > 2) {
return '请输入精确到小数点后两位的数字';
}
}
}
},
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center'}, {title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center'},
{title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center'}, {title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center'},
{title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center'}, {title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center'},
@ -342,9 +428,11 @@
var iframeWin = window[layero.find('iframe')[0]['name']]; var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0]; var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0];
console.log("rowData: "+rowData); console.log("rowData: "+rowData);
let enterpriseSum = $("#enterpriseSum").val();
var timestamp = new Date().getTime(); var timestamp = new Date().getTime();
var totalNum = $("#bootstrap-table-Quote-child4").bootstrapTable('getData').length;
$("#bootstrap-table-Quote-child4").bootstrapTable('insertRow', { $("#bootstrap-table-Quote-child4").bootstrapTable('insertRow', {
index: 1, index: totalNum,
row: { row: {
id:'', id:'',
quoteId:$("#supplierCode").val(), quoteId:$("#supplierCode").val(),
@ -386,8 +474,8 @@
/* 删除指定表格行 */ /* 删除指定表格行 */
function removeRow(rowData){ function removeRow(rowData){
$.table.bootstrapTable('remove', { $.table.bootstrapTable('remove', {
field: 'index', field: 'id',
values: rowData.index values: rowData.id
}) })
} }
$("input[name='pricingDate']").datetimepicker({ $("input[name='pricingDate']").datetimepicker({
@ -405,15 +493,15 @@
let noUsdSum = 0;let usdSum = 0; let noUsdSum = 0;let usdSum = 0;
for(var i=0;i<getData.length;i++){ for(var i=0;i<getData.length;i++){
enterprise += getData[i].materialName + ": 数量 :" + getData[i].materialNum +"; "; enterprise += getData[i].materialName + ": 数量 :" + getData[i].materialNum +"; ";
enterpriseSum += parseFloat(getData[i].materialNum); enterpriseSum += Number(getData[i].materialNum);
noRmb += parseFloat(getData[i].materialNoRmb); noRmb += Number(getData[i].materialNoRmb);
rmb += parseFloat(getData[i].materialRmb) ; rmb += Number(getData[i].materialRmb) ;
noRmbSum += parseFloat(getData[i].materialNoRmbSum); noRmbSum += Number(getData[i].materialNoRmbSum);
rmbSum += parseFloat(getData[i].materialRmbSum); rmbSum += Number(getData[i].materialRmbSum);
noUsd += parseFloat(getData[i].materialNoUsd) ; noUsd += Number(getData[i].materialNoUsd) ;
usd += parseFloat(getData[i].materialUsd) ; usd += Number(getData[i].materialUsd) ;
noUsdSum += parseFloat(getData[i].materialNoUsdSum); noUsdSum += Number(getData[i].materialNoUsdSum);
usdSum += parseFloat(getData[i].materialUsdSum); usdSum += Number(getData[i].materialUsdSum);
} }
$("#enterprise_edit").val(enterprise); $("#enterprise_edit").val(enterprise);
$("#enterpriseSum_edit").val(enterpriseSum); $("#enterpriseSum_edit").val(enterpriseSum);
@ -439,6 +527,7 @@
$.operate.save(prefix + "/complete/" + taskId, $('#form-customerQuote-ywjl').serialize()); $.operate.save(prefix + "/complete/" + taskId, $('#form-customerQuote-ywjl').serialize());
} }
} }
</script> </script>
</body> </body>
</html> </html>

1
ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html

@ -454,6 +454,7 @@
} }
var taskId = [[${taskId}]]; var taskId = [[${taskId}]];
var tableData = $("#bootstrap-table-Quote-child5").bootstrapTable('getData'); var tableData = $("#bootstrap-table-Quote-child5").bootstrapTable('getData');
$("input[name='customerQuoteChildList']").val(JSON.stringify(tableData));
$.operate.save(prefix + "/complete/" + taskId, $('#form-customerQuote-zozj').serialize()); $.operate.save(prefix + "/complete/" + taskId, $('#form-customerQuote-zozj').serialize());
} }
} }

Loading…
Cancel
Save