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

463 lines
18 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('项目管理列表')"/>
</head>
<style>
.sortBox {
display: flex;
float: right;
flex-direction: column;
gap: 0;
height: 20px;
justify-content: center;
margin-right: 30px;
}
.bootstrap-table table {
table-layout: fixed;
}
.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;
}
.disableBtnfalse {
color: #ccc;
}
.select-list li p, .select-list li label:not(.radio-box){
width: 80px;
}
</style>
<body class="gray-bg">
<div class="container-div">
<!-- <div th:replace="layout/product-list::configInfoTable('','','')"></div>-->
<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>
<label>最终客户:</label>
<input type="text" name="customerName"/>
</li>
<li>
<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>
</li>
<li>
<label>行业:</label>
<div id="industryTypeBox" style="float: right">
<select name="industryType" class="form-control" required>
<option value="">请先选择BG</option>
</select>
</div>
</li>
<li>
<label>代表处:</label>
<input type="text" name="agentName"/>
</li>
<li>
<label>项目把握度:</label>
<select name="projectGraspDegree" onchange="changeTimeType()" value="0">
<option value="">请选择</option>
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
</select>
</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>
</li>
<li>
<label>汇智负责人:</label>
<input type="text" name="hzSupportUserName"/>
</li>
<li>
<label>POC</label>
<select type="text" name="poc">
<option value="">请选择POC</option>
<option value="1"></option>
<option value="0"></option>
</select>
</li>
<li class="timeSearch" style="width: 80%">
<div>
<label>时间选择:</label>
<select name="timeType" onchange="changeTimeType()" value="0">
<option value="0">预计下单时间</option>
<option value="2">更新时间</option>
</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>
</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">
<i class="fa fa-plus"></i> 添加
</a>
<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">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: bootstrap-table-fixed-columns-js" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('sip:project:edit')}]];
var removeFlag = [[${@permission.hasPermi('sip:project:remove')}]];
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,
columns: [{
checkbox: true
},
{
field: 'id',
title: '',
visible: false,
},
{
field: 'projectCode',
title: '项目编号',
width: 100,
escape: true,
formatter: (value, row, index) => {
if (row.highlight) {
return `<span class="highlight">${value}</span>`
} else {
return `<span>${value}</span>`
}
}
},
{
field: 'projectName',
title: '项目名称',
width: 300
},
{
field: 'customerName',
title: '最终客户',
width: 200
},
{
field: 'bgProperty',
title: 'BG',
width: 100,
formatter: function (value, row, index) {
return $.table.selectDictLabel([[${@dict.getType('bg_type')}]], value);
}
},
{
field: 'industryType',
title: '行业',
width: 100,
formatter: function (value, row, index) {
if (row.bgProperty === 'YYS') {
return $.table.selectDictLabel([[${@dict.getType('bg_yys')}]], value);
} else {
return $.table.selectDictLabel([[${@dict.getType('bg_hysy')}]], value);
}
}
},
{
field: 'agentName',
title: '代表处',
width: 100
},
{
field: 'projectGraspDegree',
title: '项目把握度',
width: 100,
formatter: function (value, row, index) {
return value?'<div style="text-align: center">'+value+'</div>':'-'
}
},
{
field: 'projectStage',
title: '项目阶段',
width: 100,
formatter: function (value, row, index) {
return $.table.selectDictLabel([[${@dict.getType('project_stage')}]], value);
}
},
{
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',
title: '预计下单时间',
class: 'time1',
width: 140
},
{
field: 'updateTime',
title: '更新时间',
class: 'time3',
width: 160,
formatter: function (value, row, index) {
return value;
}
},
{
title: '操作',
align: 'center',
width: 300,
titleTooltip:true,
formatter: function (value, row, index) {
var actions = [];
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> ');
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> ');
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('');
}
}],
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>`)
$('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>`)
$('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>`)
$('thead .time3 .th-inner').append(sort3)
}
function changeSort(ele, index) {
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')
}
}
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>
`)
}
}
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,
btn: ['确定', '关闭'],
yes: function (index, layero) {
let body = parent.layer.getChildFrame('body', index)
if ($(body.find('#form-order-add').get(0)).validate().form()) {
layero.find('iframe')[0].contentWindow.saveSelect()
}else{
$.modal.alertWarning("请完善表单");
}
},
};
window.localStorage.setItem('projcetDataId', id)
$.modal.openOptions(options)
}
</script>
</body>
</html>