Browse Source

[fix] 前端通用模块

按照万材样式要求:
修改ry-ui.js的dropdownToggle通用方法,样式修改为和表头的样式保持一致,修改下拉菜单的选项的背景颜色加深颜色,确定最终样式
修改客户报价作为示例样式模板,并修改客户报价的列表字段的排列顺序
dev
liuxiaoxu 1 month ago
parent
commit
67013190d1
  1. 6
      ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js
  2. 154
      ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html

6
ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js

@ -330,12 +330,12 @@ var table = {
dropdownToggle: function (value) {
var actions = [];
actions.push('<div class="btn-group" style="width:100px;display: flex; justify-content: center; align-items: center;">');
actions.push('<button type="button" class="btn btn-xs dropdown-toggle" data-toggle="dropdown" aria-expanded="false">');
actions.push('<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-expanded="false">');
actions.push('更多操作&nbsp;');
actions.push('<span class="fa fa-lg fa-chevron-down"></span>'); // 如果需要,可以保留这个图标
actions.push('</button>');
actions.push('<ul class="dropdown-menu">');
actions.push(value.replace(/<a/g,"<li><a").replace(/<\/a>/g,"</a></li>"));
actions.push('<ul class="dropdown-menu" style="background-color: lightblue; color: white;">'); // 使用淡蓝色作为背景色
actions.push(value.replace(/<a/g,"<li style='color:black;background:lightblue;'><a style='color:black;'").replace(/<\/a>/g,"</a></li>")); // 为每个<li>元素添加样式
actions.push('</ul>');
actions.push('</div>');
return actions.join('');

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

@ -64,27 +64,27 @@
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:customerQuote:add">
<a class="btn btn-success btn-xs" onclick="$.operate.add()" shiro:hasPermission="system:customerQuote:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-warning" onclick="exportExcel()" shiro:hasPermission="system:customerQuote:export">
<a class="btn btn-success btn-xs" onclick="exportExcel()" shiro:hasPermission="system:customerQuote:export">
<i class="fa fa-download"></i> 导出
</a>
<a class="btn btn-warning" onclick="exportCustomerQuoteOne()" shiro:hasPermission="system:customerQuote:exportCustomerQuoteOne">
<a class="btn btn-success btn-xs" onclick="exportCustomerQuoteOne()" shiro:hasPermission="system:customerQuote:exportCustomerQuoteOne">
<i class="fa fa-download"></i> 导出Vantritek-RMB
</a>
<a class="btn btn-warning" onclick="exportCustomerQuoteTwo()" shiro:hasPermission="system:customerQuote:exportCustomerQuoteTwo">
<a class="btn btn-success btn-xs" onclick="exportCustomerQuoteTwo()" shiro:hasPermission="system:customerQuote:exportCustomerQuoteTwo">
<i class="fa fa-download"></i> 导出Vantritek-美元
</a>
<a class="btn btn-warning" onclick="exportCustomerQuoteThree()" shiro:hasPermission="system:customerQuote:exportCustomerQuoteThree">
<a class="btn btn-success btn-xs" onclick="exportCustomerQuoteThree()" shiro:hasPermission="system:customerQuote:exportCustomerQuoteThree">
<i class="fa fa-download"></i> 导出Infinity-RMB
</a>
<a class="btn btn-warning" onclick="exportCustomerQuoteFour()" shiro:hasPermission="system:customerQuote:exportCustomerQuoteFour">
<a class="btn btn-success btn-xs" onclick="exportCustomerQuoteFour()" shiro:hasPermission="system:customerQuote:exportCustomerQuoteFour">
<i class="fa fa-download"></i> 导出Infinity-美元
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" style="white-space:nowrap"></table>
<table id="bootstrap-table"></table>
</div>
</div>
</div>
@ -133,6 +133,8 @@
fixedColumns:true,
showFooter: true,
fixedRightNumber:1,
sortable: true, // 是否启用排序
sortStable: true, // 设置为 true 将获得稳定的排序
columns: [
{checkbox: true},
{field: 'id',title: '主键ID',visible: false},
@ -143,6 +145,15 @@
{field: 'instanceTypeName',title: '流程实例类型',visible: false},
{field: 'applyUser',title: '申请人ID', visible: false},
{field: 'taskId', title: '当前任务ID',visible: false},
{field: 'todoUserId',title: '待办用户ID',visible: false},
{field: 'taskName',title: '当前任务名称',align: 'center', visible: false,
formatter: function(value, row, index) { return '<span class="badge badge-primary">' + value + '</span>'; }
},
{ title: '审核状态',field: 'auditStatus', visible: false,
formatter: function (value, row, index) { return $.table.selectDictLabel(auditStatusDatas, value);}
},
{title: '当前状态',field: 'taskStatus',align: 'center',
formatter: function(value, row, index) {
if(row.auditStatus!="1"&&value != "未启动"){
@ -154,26 +165,10 @@
return '<span class="badge badge-primary">' + value + '</span>';}
},
{field: 'applyUserName', title: '<span style="color: red;">申请人</span>',
formatter: function(value, row, index) {return '<span style="color: red;">' + (value ? value : "-") + '</span>'; }
},
{field: 'applyTime',title: '申请时间'},
{field: 'taskId', title: '当前任务ID',visible: false},
{field: 'todoUserId',title: '待办用户ID',visible: false},
{field: 'taskName',title: '当前任务名称',align: 'center', visible: false,
formatter: function(value, row, index) { return '<span class="badge badge-primary">' + value + '</span>'; }
},
{ title: '审核状态',field: 'auditStatus', visible: false,
formatter: function (value, row, index) { return $.table.selectDictLabel(auditStatusDatas, value);}
},
{title: '使用状态',field: 'useStatus',
formatter: function (value, row, index) {return $.table.selectDictLabel(useStatusDatas, value);},
},
{title:'业务员',field:'businessMembers'},
{title: '客户报价编号',field: 'supplierCode'},
{title: '客户编号',field: 'customerCode'},
{title: '客户名称',field: 'customerName'},
{title: '物料合计',field: 'enterprise',
{title: '客户报价编号',field: 'supplierCode',align: 'center'},
{title: '客户编号',field: 'customerCode',align: 'center'},
{title: '客户名称',field: 'customerName',align: 'center'},
{title: '物料合计',field: 'enterprise' ,align: 'center',
footerFormatter: function (value) {
var sum = 0;
for (var i in value) {
@ -182,7 +177,7 @@
return "总物料合计: " + sum;
}
},
{title: '数量合计',field: 'enterpriseSum',
{title: '数量合计',field: 'enterpriseSum',align: 'center',
footerFormatter: function (value) {
var sum = 0;
for (var i in value) {
@ -191,89 +186,110 @@
return "总数量合计: " + sum;
}
},
{title: '报价币种',field: 'commonCurrency',
{title: '报价币种',field: 'commonCurrency',align: 'center',
formatter: function (value, row, index) {return $.table.selectDictLabel(currencyDatas, value);}
},
{title: '国内汇率',field: 'rmbTax'},
{title: '美元汇率',field: 'usdTax'},
{title: '不含税总价(RMB)',field: 'noRmbSum',
{title: '国内汇率',field: 'rmbTax',align: 'center'},
{title: '美元汇率',field: 'usdTax',align: 'center'},
{title: '不含税单价(RMB)',field: 'noRmb',align: 'center',
footerFormatter: function (value) {
var sum = 0;
for (var i in value) {
sum += parseFloat(value[i].noRmbSum) || 0;
sum += parseFloat(value[i].noRmb) || 0;
}
return "总不含税总价: " + sum.toFixed(2);
return "总不含税单价(RMB): " + sum.toFixed(2);
}
},
{title: '含税总价(RMB)',field: 'rmbSum',
{title: '含税单价(RMB)',field: 'rmb',align: 'center',
footerFormatter: function (value) {
var sum = 0;
for (var i in value) {
sum += parseFloat(value[i].rmbSum) || 0;
sum += parseFloat(value[i].rmb) || 0;
}
return "总含税总价: " + sum.toFixed(2);
return "总含税单价(RMB): " + sum.toFixed(2);
}
},
{title: '不含税总价(美元)',field: 'noUsdSum',
{title: '不含税单价($)',field: 'noUsd',align: 'center',
footerFormatter: function (value) {
var sum = 0;
for (var i in value) {
sum += parseFloat(value[i].noUsdSum) || 0;
sum += parseFloat(value[i].noUsd) || 0;
}
return "总不含税总价: " + sum.toFixed(2);
return "总不含税单价($): " + sum.toFixed(2);
}
},
{title: '含税总价(美元)',field: 'usdSum',
{title: '含税单价($)',field: 'usd',align: 'center',
footerFormatter: function (value) {
var sum = 0;
for (var i in value) {
sum += parseFloat(value[i].usdSum) || 0;
sum += parseFloat(value[i].usd) || 0;
}
return "总含税总价: " + sum.toFixed(2);
return "总含税单价($): " + sum.toFixed(2);
}
},
{title: '不含税单价(RMB)',field: 'noRmb',
{title: '不含税总价(RMB)',field: 'noRmbSum',align: 'center',
footerFormatter: function (value) {
var sum = 0;
for (var i in value) {
sum += parseFloat(value[i].noRmb) || 0;
sum += parseFloat(value[i].noRmbSum) || 0;
}
return "总不含税单价: " + sum.toFixed(2);
return "总不含税总价(RMB): " + sum.toFixed(2);
}
},
{title: '含税单价(RMB)',field: 'rmb',
{title: '含税总价(RMB)',field: 'rmbSum',align: 'center',
footerFormatter: function (value) {
var sum = 0;
for (var i in value) {
sum += parseFloat(value[i].rmb) || 0;
sum += parseFloat(value[i].rmbSum) || 0;
}
return "总含税单价: " + sum.toFixed(2);
return "总含税总价(RMB): " + sum.toFixed(2);
}
},
{title: '不含税单价(美元)',field: 'noUsd',
{title: '不含税总价($)',field: 'noUsdSum',align: 'center',
footerFormatter: function (value) {
var sum = 0;
for (var i in value) {
sum += parseFloat(value[i].noUsd) || 0;
sum += parseFloat(value[i].noUsdSum) || 0;
}
return "总不含税单价: " + sum.toFixed(2);
return "总不含税总价($): " + sum.toFixed(2);
}
},
{title: '含税单价(美元)',field: 'usd',
{title: '含税总价($)',field: 'usdSum',align: 'center',
footerFormatter: function (value) {
var sum = 0;
for (var i in value) {
sum += parseFloat(value[i].usd) || 0;
sum += parseFloat(value[i].usdSum) || 0;
}
return "总含税单价: " + sum.toFixed(2);
return "总含税总价($): " + sum.toFixed(2);
}
},
{title: '使用状态',field: 'useStatus',align: 'center',
formatter: function (value, row, index) {return $.table.selectDictLabel(useStatusDatas, value);},
},
{field: 'applyUserName', title: '申请人',align: 'center'},
{field: 'applyTime',title: '申请时间',align: 'center',
formatter: function(value, row, index) {
return $.table.tooltip(value, 10, "open");
}
},
{title:'业务员',field:'businessMembers',align: 'center'},
{title: '定价时间',field: 'pricingDate',align: 'center'},
{title: '录入人',field: 'createBy',align: 'center'},
{title: '录入时间',field: 'createTime',sortable: true,align: 'center',
formatter: function(value, row, index) {
return $.table.tooltip(value, 10, "open");
}
},
{title: '更新人',field: 'updateBy',align: 'center'},
{ title: '上次修改时间',field: 'updateTime',align: 'center',
formatter: function(value, row, index) {
return $.table.tooltip(value, 10, "open");
}
},
{title: '定价时间',field: 'pricingDate'},
{title: '录入人',field: 'createBy'},
{title: '录入时间',field: 'createTime'},
{title: '更新人',field: 'updateBy'},
{ title: '上次修改时间',field: 'updateTime'},
{title: '备注',field: 'remark'},
{
title: '操作',
@ -283,11 +299,11 @@
var actions = [];
if(row.auditStatus=="1" && row.useStatus=="1" && !row.cancelInstanceId){
// 作废
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0) ' + cancelFlag + ' " onclick="cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i> 作废</a>');
actions.push('<a href="javascript:void(0) ' + cancelFlag + ' " onclick="cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i> 作废</a>');
// 编辑
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
actions.push('<a href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
}else{
actions.push('<a class="btn btn-default btn-xs" disabled href="javascript:void(0)"><i class="fa fa-edit"></i> 编辑</a> ');
actions.push('<a disabled href="javascript:void(0)"><i class="fa fa-edit"></i> 编辑</a> ');
}
// 已作废
if(row.useStatus=="2" && !row.restoreInstanceId){
@ -305,12 +321,12 @@
}
}
// 审批历史
actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="showHistoryDialog(\'' + row.instanceId + '\')"><i class="fa fa-list"></i> 审批历史</a> ');
actions.push('<a href="javascript:void(0)" onclick="showHistoryDialog(\'' + row.instanceId + '\')"><i class="fa fa-list"></i> 审批历史</a> ');
// 进度查看
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="showProcessImgDialog(\'' + row.instanceId + '\')"><i class="fa fa-image"></i> 进度查看</a> ');
actions.push('<a href="javascript:void(0)" onclick="showProcessImgDialog(\'' + row.instanceId + '\')"><i class="fa fa-image"></i> 进度查看</a> ');
}
// 详情
actions.push('<a class="btn btn-primary btn-xs" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-eye"></i> 详情</a> ');
actions.push('<a href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-eye"></i> 详情</a> ');
var actionLinks = actions.join('');
return $.table.dropdownToggle(actionLinks);
}
@ -342,6 +358,12 @@
}
}
// //双击某格触发事件
// function onDblClickCell(field, value, row, $element){
// alert("双击格name:" + field + " value:" + value);
// }
// 作废
function cancel(id) {

Loading…
Cancel
Save