unis_sip/ruoyi-admin/src/main/resources/templates/project/info/project.html

463 lines
18 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
2025-05-30 09:32:14 +00:00
<th:block th:include="include :: header('项目管理列表')"/>
</head>
2025-05-30 09:32:14 +00:00
<style>
.sortBox {
display: flex;
float: right;
flex-direction: column;
gap: 0;
height: 20px;
justify-content: center;
2025-06-05 07:52:23 +00:00
margin-right: 30px;
2025-05-30 09:32:14 +00:00
}
.bootstrap-table table {
table-layout: fixed;
}
2025-05-30 09:32:14 +00:00
.sortBox div {
font-size: 10px;
transform: scale(1.2, 1);
cursor: pointer;
color: #bbb;
}
.sortBox .timeAction {
color: #000;
}
.timeSearch {
display: flex;
gap: 20px;
align-items: center;
}
.highlightRow {
color: red;
}
2025-06-06 11:59:13 +00:00
.disableBtnfalse {
color: #ccc;
}
.select-list li p, .select-list li label:not(.radio-box){
width: 80px;
}
2025-05-30 09:32:14 +00:00
</style>
<body class="gray-bg">
2025-05-30 09:32:14 +00:00
<div class="container-div">
<!-- <div th:replace="layout/product-list::configInfoTable('','','')"></div>-->
2025-05-30 09:32:14 +00:00
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>项目编号:</label>
<input type="text" name="projectCode"/>
</li>
<li>
<label>项目名称:</label>
<input type="text" name="projectName"/>
</li>
<li>
2025-06-05 07:52:23 +00:00
<label>最终客户:</label>
2025-06-06 09:34:50 +00:00
<input type="text" name="customerName"/>
2025-05-30 09:32:14 +00:00
</li>
<li>
2025-06-05 07:52:23 +00:00
<label>BG</label>
<select name="bgProperty" class="form-control" th:with="type=${@dict.getType('bg_type')}"
onchange="changeBg()" required>
<option value="">请选择BG</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
2025-05-30 09:32:14 +00:00
</li>
2025-06-05 07:52:23 +00:00
<li>
<label>行业:</label>
2025-06-06 11:59:13 +00:00
<div id="industryTypeBox" style="float: right">
2025-06-05 07:52:23 +00:00
<select name="industryType" class="form-control" required>
<option value="">请先选择BG</option>
</select>
</div>
</li>
<li>
<label>代表处:</label>
<input type="text" name="agentName"/>
</li>
2025-05-30 09:32:14 +00:00
<li>
<label>项目把握度:</label>
2025-06-05 07:52:23 +00:00
<select name="projectGraspDegree" onchange="changeTimeType()" value="0">
<option value="">请选择</option>
2025-06-06 08:41:11 +00:00
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
</select>
2025-05-30 09:32:14 +00:00
</li>
<li>
<label>项目阶段:</label>
<select name="projectStage" class="form-control"
th:with="type=${@dict.getType('project_stage')}">
<option value="">请选择项目阶段</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
2025-06-05 07:52:23 +00:00
</li>
<li>
<label>汇智负责人:</label>
<input type="text" name="hzSupportUserName"/>
2025-05-30 09:32:14 +00:00
</li>
<li>
<label>POC</label>
<select type="text" name="poc">
<option value="">请选择POC</option>
<option value="1"></option>
<option value="0"></option>
</select>
</li>
2025-05-30 09:32:14 +00:00
<li class="timeSearch" style="width: 80%">
<div>
<label>时间选择:</label>
<select name="timeType" onchange="changeTimeType()" value="0">
<option value="0">预计下单时间</option>
<option value="2">更新时间</option>
2025-05-30 09:32:14 +00:00
</select>
</div>
<div class="timeSearch">
<input name="estimatedOrderTimeStart" type="text" class="input-sm form-control"
id="laydate-startTime"
placeholder="yyyy-MM-dd"/>
<span></span>
<input name="estimatedOrderTime" type="text" class="input-sm form-control"
id="laydate-endTime"
placeholder="yyyy-MM-dd"/>
</div>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
2025-06-05 07:52:23 +00:00
2025-05-30 09:32:14 +00:00
</ul>
<input type="hidden" name="orderByColumn"/>
<input type="hidden" name="isAsc"/>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.addFull()" shiro:hasPermission="sip:project:add">
2025-05-30 09:32:14 +00:00
<i class="fa fa-plus"></i> 添加
</a>
2025-05-30 09:32:14 +00:00
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
shiro:hasPermission="sip:product:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission=" sip:project:export">
2025-05-30 09:32:14 +00:00
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
2025-05-30 09:32:14 +00:00
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: bootstrap-table-fixed-columns-js" />
2025-05-30 09:32:14 +00:00
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('sip:project:edit')}]];
var removeFlag = [[${@permission.hasPermi('sip:project:remove')}]];
2025-05-30 09:32:14 +00:00
var prefix = ctx + "sip/project";
$(function () {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "项目管理",
fixedColumns: true,
fixedRightNumber:1,
2025-05-30 09:32:14 +00:00
columns: [{
checkbox: true
},
{
field: 'id',
title: '',
2025-05-30 09:32:14 +00:00
visible: false,
},
{
field: 'projectCode',
title: '项目编号',
width: 100,
2025-05-30 09:32:14 +00:00
escape: true,
formatter: (value, row, index) => {
if (row.highlight) {
return `<span class="highlight">${value}</span>`
2025-06-06 11:59:13 +00:00
} else {
2025-06-06 08:41:11 +00:00
return `<span>${value}</span>`
2025-05-30 09:32:14 +00:00
}
}
},
{
field: 'projectName',
title: '项目名称',
width: 300
},
{
field: 'customerName',
title: '最终客户',
width: 200
2025-06-05 07:52:23 +00:00
},
{
field: 'bgProperty',
title: 'BG',
width: 100,
2025-06-05 07:52:23 +00:00
formatter: function (value, row, index) {
return $.table.selectDictLabel([[${@dict.getType('bg_type')}]], value);
}
},
{
field: 'industryType',
2025-06-05 07:52:23 +00:00
title: '行业',
width: 100,
2025-06-05 07:52:23 +00:00
formatter: function (value, row, index) {
if (row.bgProperty === 'YYS') {
2025-06-05 07:52:23 +00:00
return $.table.selectDictLabel([[${@dict.getType('bg_yys')}]], value);
2025-06-06 11:59:13 +00:00
} else {
return $.table.selectDictLabel([[${@dict.getType('bg_hysy')}]], value);
2025-06-05 07:52:23 +00:00
}
}
},
{
2025-06-05 07:52:23 +00:00
field: 'agentName',
title: '代表处',
width: 100
},
{
field: 'projectGraspDegree',
2025-06-05 07:52:23 +00:00
title: '项目把握度',
width: 100,
formatter: function (value, row, index) {
return value?'<div style="text-align: center">'+value+'</div>':'-'
}
},
{
2025-05-30 09:32:14 +00:00
field: 'projectStage',
2025-06-05 07:52:23 +00:00
title: '项目阶段',
width: 100,
2025-06-05 07:52:23 +00:00
formatter: function (value, row, index) {
return $.table.selectDictLabel([[${@dict.getType('project_stage')}]], value);
}
},
{
2025-06-09 07:59:26 +00:00
field: 'hzSupportUserName',
title: '汇智负责人',
width: 100
},
{
field: 'poc',
title: 'POC',
width: 100,
formatter: function (value, row, index) {
return value==='1'?'是':'否';
}
},
{
field: 'estimatedAmount',
title: '预计金额(元)',
width: 140,
formatter: function (value, row, index) {
return value?formatAmountNumber(value):'';
}
},
{
field: 'estimatedOrderTime',
2025-05-30 09:32:14 +00:00
title: '预计下单时间',
2025-06-05 07:52:23 +00:00
class: 'time1',
width: 140
},
{
2025-06-05 07:52:23 +00:00
field: 'updateTime',
title: '更新时间',
2025-06-05 07:52:23 +00:00
class: 'time3',
width: 160,
formatter: function (value, row, index) {
return value;
}
},
{
title: '操作',
align: 'center',
width: 300,
titleTooltip:true,
2025-05-30 09:32:14 +00:00
formatter: function (value, row, index) {
var actions = [];
2025-06-06 09:34:50 +00:00
actions.push('<a class="btn btn-success btn-xs mb5' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editFull(\'' + row.id + '\')"><i class="fa fa-edit"></i>项目详情</a> ');
2025-06-06 11:59:13 +00:00
actions.push('<a class="btn btn-success btn-xs mb5' + editFlag + '" href="javascript:void(0)" onclick="openOrder(' + row.id + ',' + row.canGenerate + ')" name="disableBtn' + row.canGenerate + '"><i class="fa fa-refresh"></i>生成订单</a> ');
2025-06-05 07:52:23 +00:00
actions.push('<a class="btn btn-danger btn-xs mb5' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
2025-05-30 09:32:14 +00:00
}],
onPostBody: () => {
initHighlight()
}
};
$.table.init(options);
initSrot()
changeTimeType()
layui.use('laydate', function () {
var laydate = layui.laydate;
var startDate = laydate.render({
elem: '#laydate-startTime',
max: $('#laydate-endTime').val(),
theme: 'molv',
trigger: 'click',
done: function (value, date) {
// 结束时间大于开始时间
if (value !== '') {
endDate.config.min.year = date.year;
endDate.config.min.month = date.month - 1;
endDate.config.min.date = date.date;
} else {
endDate.config.min.year = '';
endDate.config.min.month = '';
endDate.config.min.date = '';
}
}
});
var endDate = laydate.render({
elem: '#laydate-endTime',
min: $('#laydate-startTime').val(),
theme: 'molv',
trigger: 'click',
done: function (value, date) {
// 开始时间小于结束时间
if (value !== '') {
startDate.config.max.year = date.year;
startDate.config.max.month = date.month - 1;
startDate.config.max.date = date.date;
} else {
startDate.config.max.year = '';
startDate.config.max.month = '';
startDate.config.max.date = '';
}
}
});
})
});
function initHighlight() {
$('span.highlight').parent().parent().addClass('highlightRow')
}
function initSrot() {
let sort1 = $(`<div class="sortBox"><div class="sortBtn timeAction" onclick="changeSort(this,0)" sort="asc"></div><div class="sortBtn" onclick="changeSort(this,0)" sort="desc"></div></div>`)
2025-05-30 09:32:14 +00:00
$('thead .time1 .th-inner').append(sort1)
let sort2 = $(`<div class="sortBox"><div class="sortBtn" onclick="changeSort(this,1)" sort="asc"></div><div onclick="changeSort(this,1)" class="sortBtn" sort="desc"></div></div>`)
2025-05-30 09:32:14 +00:00
$('thead .time2 .th-inner').append(sort2)
let sort3 = $(`<div class="sortBox"><div class="sortBtn" onclick="changeSort(this,2)" sort="asc"></div><div onclick="changeSort(this,2)" class="sortBtn" sort="desc"></div></div>`)
2025-05-30 09:32:14 +00:00
$('thead .time3 .th-inner').append(sort3)
}
2025-05-30 09:32:14 +00:00
function changeSort(ele, index) {
2025-05-30 09:32:14 +00:00
let arr = ['estimated_orderTime', 'estimated_deliverTime', 'update_time']
$('.sortBox').find('.timeAction').removeClass('timeAction')
$(ele).addClass('timeAction')
$('input[name="orderByColumn"]').val(arr[index])
$('input[name="isAsc"]').val($(ele).attr('sort'))
$.table.search()
}
function changeTimeType() {
let timeType = $("[name='timeType']").val()
if (timeType == 0) {
$('#laydate-startTime').attr('name', 'estimatedOrderTimeStart')
$('#laydate-endTime').attr('name', 'estimatedOrderTimeEnd')
} else if (timeType == 1) {
$('#laydate-startTime').attr('name', 'estimatedDeliverTimeStart')
$('#laydate-endTime').attr('name', 'estimatedDeliverTimeEnd')
} else if (timeType == 2) {
$('#laydate-startTime').attr('name', 'updateTimeStart')
$('#laydate-endTime').attr('name', 'updateTimeEnd')
}
}
2025-06-06 11:59:13 +00:00
2025-06-05 07:52:23 +00:00
function changeBg() {
if ($('[name="bgProperty"]').val() != 'YYS') {
let datas = [[${@dict.getType('bg_hysy')}]]
let str = ``
datas.forEach((ele) => {
str += `<option value="${ele.dictValue}">${ele.dictLabel}</option> `
})
$('#industryTypeBox').html(`
<select name="industryType" class="form-control" required>
<option value="">请选择行业</option>
${str}
</select>
`)
} else {
let datas = [[${@dict.getType('bg_yys')}]]
let str = ``
datas.forEach((ele) => {
str += `<option value="${ele.dictValue}">${ele.dictLabel}</option> `
})
$('#industryTypeBox').html(`
<select name="industryType" class="form-control" required>
<option value="">请选择行业</option>
${str}
</select>
`)
}
2025-05-30 09:32:14 +00:00
2025-06-05 07:52:23 +00:00
}
2025-05-30 09:32:14 +00:00
2025-06-06 11:59:13 +00:00
function openOrder(id, canAdd) {
if (!canAdd) {
$.modal.alertWarning("该项目已存在订单");
return
}
var options = {
title: "新建订单",
url: ctx + `project/order/add`,
maxmin: false,
full: true,
index: 1000,
width: 1050,
2025-06-09 07:59:26 +00:00
btn: ['确定', '关闭'],
2025-06-06 11:59:13 +00:00
yes: function (index, layero) {
let body = parent.layer.getChildFrame('body', index)
2025-06-08 07:14:25 +00:00
if ($(body.find('#form-order-add').get(0)).validate().form()) {
2025-06-09 06:17:32 +00:00
layero.find('iframe')[0].contentWindow.saveSelect()
2025-06-08 07:14:25 +00:00
}else{
$.modal.alertWarning("请完善表单");
2025-06-06 11:59:13 +00:00
}
},
};
window.localStorage.setItem('projcetDataId', id)
$.modal.openOptions(options)
}
2025-05-30 09:32:14 +00:00
</script>
</body>
</html>