This commit is contained in:
Chen Lily 2023-06-05 10:10:22 +08:00
parent 9da1c4cf30
commit 634e8b71ab
18 changed files with 367 additions and 143 deletions

View File

@ -81,8 +81,8 @@
}
.question {
min-height: 24px;
line-height: 24px;
/*min-height: 24px;*/
/*line-height: 24px;*/
padding-left: 70px;
padding-right: 10px;
font-size: 14px;
@ -92,8 +92,8 @@
}
.answer {
min-height: 24px;
line-height: 24px;
/*min-height: 24px;*/
/*line-height: 24px;*/
padding-left: 90px;
padding-right: 10px;
}
@ -186,12 +186,19 @@
}
}
.question_line {
border-collapse: collapse;
.question_line tr {
border-top: 1px solid #dbdbdb;
border-bottom: 1px solid #dbdbdb;
}
.question_line {
border-collapse: collapse;
}
.answer_line {
border-collapse: collapse;
}
.question_table_grid {
border-collapse: collapse;
}
@ -200,10 +207,20 @@
border: 1px solid #dbdbdb;
}
.question_div_grid {
.question_standard_table_line {
border-top: 1px solid #dbdbdb;
border-bottom: 1px solid #dbdbdb;
}
.question_standard_table_grid {
border: 1px solid #dbdbdb;
}
.answer_div_grid {
border-left: 1px solid #dbdbdb;
border-right: 1px solid #dbdbdb;
}
.mediacaption {
text-align: center;
clear: both;

View File

@ -60,7 +60,7 @@
.page {
/*background-color: #d3d3d3;*/
/*height: 52px;*/
line-height: 52px;
line-height: 25px;
margin-top: 8px;
padding-left: 10px;
padding-right: 10px;
@ -72,7 +72,7 @@
.section {
/*background-color: #eaeaea;*/
/*height: 40px;*/
line-height: 40px;
line-height: 20px;
padding-left: 30px;
padding-right: 10px;
font-size: 20px;
@ -81,8 +81,8 @@
}
.question {
min-height: 30px;
line-height: 30px;
min-height: 24px;
line-height: 24px;
padding-left: 70px;
padding-right: 10px;
font-size: 14px;
@ -92,12 +92,21 @@
}
.answer {
min-height: 30px;
line-height: 30px;
min-height: 24px;
line-height: 24px;
padding-left: 90px;
padding-right: 10px;
}
.table_content {
padding-left: 3px;
padding-right: 3px;
}
.pagedoublespace {
line-height: 50px;
}
.media {
width: 120px;
height: 120px;
@ -176,6 +185,50 @@
display: block;
}
}
.question_line tr {
border-top: 1px solid #dbdbdb;
border-bottom: 1px solid #dbdbdb;
}
.question_line {
border-collapse: collapse;
}
.answer_line {
border-collapse: collapse;
}
.question_table_grid {
border-collapse: collapse;
}
.question_table_grid td {
border: 1px solid #dbdbdb;
}
.question_standard_table_line {
border-top: 1px solid #dbdbdb;
border-bottom: 1px solid #dbdbdb;
}
.question_standard_table_grid {
border: 1px solid #dbdbdb;
}
.answer_div_grid {
border-left: 1px solid #dbdbdb;
border-right: 1px solid #dbdbdb;
}
.mediacaption {
text-align: center;
clear: both;
height: 25px;
width: 120px;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<script src="<%=GetFileUrlWithVersion("../js/controls.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("../js/vue.min.js")%>"></script>
@ -249,6 +302,19 @@
<span id="button-print" class="sbutton iconprint" style="margin-right: 20px;" onclick="OnPrint();" data-lgid="P_IPT_PRINT">Print</span>
</div>
<div id="divreport" style="width: 1100px; margin: 0 auto;">
<div v-if="report.ReportLayout!=null">
<table class="maintable" style="width: 100%;">
<tr class="assettr">
<td style="width: 33%; text-align: left;">
<img id="reportlayoutlogo" style="width: 100px; margin-top: 5px; display: none;" /></td>
<td style="width: 33%; text-align: center;">
<img id="reportlayoutcenterlogo" style="width: 100px; margin-top: 5px; display: none;" /></td>
<td style="width: 33%; text-align: right;">
<img id="reportlayoutrightlogo" style="width: 100px; margin-top: 5px; display: none;" />
</td>
</tr>
</table>
</div>
<h1 style="text-align: center;" v-show="report.Template.DisplayInspectionTitle">{{report.Template.Name}}</h1>
<div style="text-align: center; margin-bottom: 10px;"><span v-show="report.Template.DisplayCommitTime">{{report.CommitTimeLocalStr}}</span><span v-show="report.Template.DisplayCommitBy"> by {{report.CommitedByUserName}}</span></div>
<table class="maintable">
@ -361,7 +427,9 @@
</tr>
</table>
</div>
<div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div>
<div id="mask_bg" style="display: none;">
<div class="loading c-spin"></div>
</div>
<div id="right_popup" style="display: none; position: absolute; top: 0; right: 0; bottom: 0; background-color: white; overflow: auto;">
</div>
<iframe id="ifdiv" style="height: 1px; width: 1px; display: none;"></iframe>

View File

@ -5,7 +5,7 @@ require.config({
//spectrum: "../../js/spectrum"
},
waitSeconds: 0,
urlArgs: "v=455" //+ Math.random()
urlArgs: "v=464" //+ Math.random()
})
requirejs(['modules/pageloader'], function (loader) {

View File

@ -113,10 +113,10 @@
_this.loading && _this.loading.fadeOut(100);
return;
}
if (q.QuestionType === Question.types.AssetStatus) {
a.Result = a.Comment;
a.Comment = "";
}
//if (q.QuestionType === Question.types.AssetStatus) {
// a.Result = a.Comment;
// a.Comment = "";
//}
answers.push(a);
}

View File

@ -852,15 +852,15 @@
content.append('<div style="clear: both"></div>');
cnt = $('<div style="margin: 6px 0 0 0px"></div>');
var divComment = $('<div style="padding: 6px 0"></div>');
var comment = $('<textarea class="form-control" style="width: 100%; box-sizing: border-box; height: 70px" placeholder="Comment"></textarea>');
comment.attr('maxlength', 500);
var divResult = $('<div style="padding: 6px 0"></div>');
var rst = $('<textarea class="form-control" style="width: 100%; box-sizing: border-box; height: 70px"></textarea>');
rst.attr('maxlength', 500);
if (answer && answer.Result) {
comment.val(answer.Result);
rst.val(answer.Result);
}
this.ui.comment = comment;
divComment.append(comment);
cnt.append(divComment);
this.ui.assetstatusresult = rst;
divResult.append(rst);
cnt.append(divResult);
content.append(cnt);
return content;
@ -874,12 +874,8 @@
items.push(item);
}
answer.SelectedItems = items;
if (items.length > 0) {
answer.Result = items.map(function (i) { return i.Value || i.Text }).join('\n');
//answer.SeverityLevel = items[0].SeverityLevel;
} else {
answer.Result = '';
}
answer.Result = this.ui.assetstatusresult.val();
return answer;
};
assetStatusQuestion.prototype.focus = function () {

View File

@ -573,7 +573,7 @@
content.find('.layout-footers-middle .editor-content').val(info.PageFooterCenter);
content.find('.layout-footers-right .editor-content').val(info.PageFooterRight);
content.find('#layout-style').val(info.Style);
content.find('#layout-style').val(info.Style).change();
content.find('#layout-spacing').val(info.Spacing);
content.find('#layout-picturesdisplay').val(info.PicturesDisplay);
content.find('#layout-captionimages').prop('checked', info.CaptionImages);

View File

@ -158,7 +158,7 @@ function showIdentifiedQuestions(questions) {
var content = $('<div></div>');
content.append($('<div class="catelog">IDENTIFIED ISSUES</div>'));
if (questions && questions.length > 0) {
createQuestionContent1(content, questions);
createQuestionContent1(content, questions, true);
}
else
content.append($('<div class="question"></div>').text(GetTextByKey("P_IPT_NOQUESTIONS", 'No Questions')));
@ -210,8 +210,7 @@ function showSignature(report) {
else if (layoutDivider == 2)//Grid
div_pic.addClass('question_div_grid');
if (layoutSpacing == 1)//Double Space
div_pic.css('line-height', '30px');
div_pic.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
}
}
@ -247,8 +246,7 @@ function showMedias() {
else if (layoutDivider == 2)//Grid
div_question.addClass('question_table_grid');
if (layoutSpacing == 1)//Double Space
div_question.css('line-height', '30px');
div_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
}
else if (layoutStyle == 2) {//Split
var div_question = $('<table style="width:100%;" class="question_table"></table>');
@ -279,8 +277,7 @@ function showMedias() {
else if (layoutDivider == 2)//Grid
div_question.addClass('question_table_grid');
if (layoutSpacing == 1)//Double Space
div_question.css('line-height', '30px');
div_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
}
else {
var div_question = $('<table style="width:100%;" class="question_table"></table>');
@ -297,14 +294,13 @@ function showMedias() {
}
if (layoutDivider == 1)//Line
div_question.addClass('question_line');
div_question.addClass('question_standard_table_line');
else if (layoutDivider == 2)//Grid
div_question.addClass('question_table_grid');
div_question.addClass('question_standard_table_grid');
if (layoutSpacing == 1)//Double Space
div_question.css('line-height', '30px');
div_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
}
$('#divpages').append(content);
}
@ -355,8 +351,7 @@ function createPage(page) {
else if (layoutDivider == 2)//Grid
tabpage.addClass('question_table_grid');
if (layoutSpacing == 1)//Double Space
tabpage.css('line-height', '30px');
tabpage.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
}
else {
var divpage = $('<div class="page"></div>');
@ -404,8 +399,7 @@ function createSectionContent(page) {
else if (layoutDivider == 2)//Grid
tabsection.addClass('question_table_grid');
if (layoutSpacing == 1)//Double Space
tabsection.css('line-height', '30px');
tabsection.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
var qc = createQuestionContent(s);
content.append(qc);
@ -459,35 +453,36 @@ function createSectionContent(page) {
function createQuestionContent(section) {
var content = $('<div style="margin-bottom:30px;"></div>');
if (section.Questions && section.Questions.length > 0) {
createQuestionContent1(content, section.Questions);
createQuestionContent1(content, section.Questions, false);
}
else
content.append($('<div class="question"></div>').text(GetTextByKey("P_IPT_NOQUESTIONS", 'No Questions')));
return content;
}
function createQuestionContent1(content, questions) {
function createQuestionContent1(content, questions, isidentified) {
if (questions && questions.length > 0) {
if (layoutStyle == 1) {//Compressed
var div_question = $('<table style="width:100%;" class="question_table"></table>');
content.append(div_question);
for (var i = 0; i < questions.length; i++) {
var q = questions[i];
if (ignoreQuestion(q, isidentified)) continue;
var tr_question = $('<tr style="width:100%;"></tr>');
div_question.append(tr_question);
tr_question.append($('<td style="width:33%;"></td>').text(q.DisplayText));
var td_answer = $('<td style="width:33%;"></td>');
tr_question.append(td_answer);
createAnswerContent(td_answer, q);
createAnswerContent(td_answer, q, isidentified);
var td_comment = $('<td style="width:33%;"></td>');
tr_question.append(td_comment);
var comment = td_answer.data('comment');
if (comment && comment != "") {
td_comment.append($('<div class="answer"></div>').html(replaceHtmlText(comment)));
}
if (q.IsImportant && layoutHighlightColor)
tr_question.css('background-color', layoutHighlightColor);
tr_question.css('color', layoutHighlightColor);
}
if (layoutDivider == 1)//Line
@ -495,16 +490,18 @@ function createQuestionContent1(content, questions) {
else if (layoutDivider == 2)//Grid
div_question.addClass('question_table_grid');
if (layoutSpacing == 1)//Double Space
div_question.css('line-height', '30px');
div_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
}
else if (layoutStyle == 2) {//Split
var div_question = $('<table style="width:100%;" class="question_table"></table>');
content.append(div_question);
var tr_question = "";
var qindex = 0;
for (var i = 0; i < questions.length; i++) {
var q = questions[i];
if (i % 2 == 0) {
if (ignoreQuestion(q, isidentified)) continue;
if (qindex % 2 == 0) {
tr_question = $('<tr style="width:100%;"></tr>');
div_question.append(tr_question);
}
@ -512,13 +509,15 @@ function createQuestionContent1(content, questions) {
tr_question.append(td_question);
var td_answer = $('<td style="width:25%;"></td>');
tr_question.append(td_answer);
createAnswerContent(td_answer, q);
createAnswerContent(td_answer, q, isidentified);
if (q.IsImportant && layoutHighlightColor) {
td_question.css('background-color', layoutHighlightColor);
td_answer.css('background-color', layoutHighlightColor);
td_question.css('color', layoutHighlightColor);
td_answer.css('color', layoutHighlightColor);
}
qindex++;
}
if (questions.length % 2 != 0) {
if (qindex % 2 != 0) {
tr_question.append($('<td style="width:25%;"></td><td style="width:25%;"></td>'));
}
if (layoutDivider == 1)//Line
@ -526,16 +525,21 @@ function createQuestionContent1(content, questions) {
else if (layoutDivider == 2)//Grid
div_question.addClass('question_table_grid');
if (layoutSpacing == 1)//Double Space
div_question.css('line-height', '30px');
div_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
}
else {
for (var i = 0; i < questions.length; i++) {
var q = questions[i];
var div_question = $('<div class="question"></div>');
content.append(div_question);
if (ignoreQuestion(q, isidentified)) continue;
var tab_question = $('<table style="width:100%;" class="question_table"></table>');
content.append(tab_question);
var tr_question = $('<tr style="width:100%;"></tr>');
tab_question.append(tr_question);
var td_question = $('<td style="width:100%;"></td>');
tr_question.append(td_question);
var div_question = $('<div class="question"></div>');
td_question.append(div_question);
var div_title = $('<div style="width:320px;flex-grow:1;"></div>').text(q.DisplayText);
div_question.append(div_title);
if (q.StaticPictures && q.StaticPictures.length > 0) {
@ -544,18 +548,23 @@ function createQuestionContent1(content, questions) {
div_question.append(div_pic)
}
createAnswerContent(content, q);
tr_question = $('<tr style="width:100%;"></tr>');
tab_question.append(tr_question);
var td_answer = $('<td style="width:100%;"></td>');
tr_question.append(td_answer);
createAnswerContent(td_answer, q, isidentified);
if (layoutDivider == 1)//Line
div_question.addClass('question_line');
tab_question.addClass('question_standard_table_line');
else if (layoutDivider == 2)//Grid
div_question.addClass('question_div_grid');
tab_question.addClass('question_standard_table_grid');
if (layoutSpacing == 1)//Double Space
div_question.css('line-height', '30px');
tab_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
if (q.IsImportant && layoutHighlightColor)
div_question.css('background-color', layoutHighlightColor);
if (q.IsImportant && layoutHighlightColor) {
tab_question.css('color', layoutHighlightColor);
div_question.css('color', layoutHighlightColor);
}
}
}
@ -564,38 +573,12 @@ function createQuestionContent1(content, questions) {
if (layoutStyle == 1 || layoutStyle == 2) {
div_answer.addClass('table_content');
}
else {
var isimportant = div_answer.data('isimportant');
if (isimportant && layoutHighlightColor)
div_answer.css('background-color', layoutHighlightColor);
if (layoutDivider == 1)//Line
div_answer.addClass('question_line');
else if (layoutDivider == 2)//Grid
div_answer.addClass('question_div_grid');
if (layoutSpacing == 1)//Double Space
div_answer.css('line-height', '30px');
}
});
content.find('.div_media').each(function () {
var div_media = $(this);
if (layoutStyle == 1 || layoutStyle == 2) {
div_media.css('padding-left', '3px');
}
else {
var isimportant = div_media.data('isimportant');
if (isimportant && layoutHighlightColor)
div_media.css('background-color', layoutHighlightColor);
if (layoutDivider == 1)//Line
div_media.addClass('question_line');
else if (layoutDivider == 2)//Grid
div_media.addClass('question_div_grid');
if (layoutSpacing == 1)//Double Space
div_media.css('line-height', '30px');
}
});
}
return content;
@ -612,8 +595,39 @@ function createPictures(pictures, p) {
}
return p;
}
function ignoreQuestion(q, isidentified) {
var ignore = false;
if (q.QuestionType == 10 || (q.QuestionType == 15 && q.SubType == 15)) {//Picture
var hasPicture = false;
if (reportdata && reportdata.Answers) {
for (var i = 0; i < reportdata.Answers.length; i++) {
var a = reportdata.Answers[i];
if (a.QuestionId.toLowerCase() == q.Id.toLowerCase()) {
if (reportdata.Medias && reportdata.Medias.length > 0) {
for (var j = 0; j < reportdata.Medias.length; j++) {
var m = reportdata.Medias[j];
if (m.AnswerId.toLowerCase() == a.Id.toLowerCase()) {
if (layoutPicturesDisplay == 1)//Displayed At Bottom
{
if (isidentified == false)
mediasdata.push(m);
}
else
hasPicture = true;
}
}
}
}
}
}
ignore = !hasPicture;
}
else
ignore = false;
return ignore;
}
function createAnswerContent(p, q) {
function createAnswerContent(p, q, isidentified) {
var leveltext = showSeverityLevel(q.SeverityLevel);
var label_level = $('<label class="label_level"></label>').text(leveltext);
if (reportdata && reportdata.Answers) {
@ -638,16 +652,19 @@ function createAnswerContent(p, q) {
var div_answer = $('<div class="answer"></div>').data('isimportant', q.IsImportant);
if (q.QuestionType == 1
|| (q.QuestionType == 15 && q.SubType == 14))
p.append(div_answer.html(replaceHtmlText(result))).append("<div style='clear:both;'></div>");
p.append(div_answer.html(replaceHtmlText(result)));
else if (q.QuestionType == 17 && q.TextToCompare != null && result.toLowerCase() != q.TextToCompare.toLowerCase()) // BarCodeValidate
p.append(div_answer
.append($('<span style="color:red"></span>').text(result))
.append($('<span style="margin-left:6px"></span>').text('(' + q.TextToCompare + ')'))
).append("<div style='clear:both;'></div>");
);
else
p.append(div_answer.text(result)).append("<div style='clear:both;'></div>");
p.append(div_answer.text(result));
div_answer.append(label_level);
p.append(item);
if (layoutStyle == 0)
p.append("<div style='clear:both;'></div>");
}
else if (q.QuestionType == 5) {//YesOrNo
if (a.SelectedItems && a.SelectedItems.length > 0) {
@ -662,7 +679,10 @@ function createAnswerContent(p, q) {
if (a.SelectedItems[0].BackgroundColor && a.SelectedItems[0].BackgroundColor != "") {
div_bg.css('background-color', a.SelectedItems[0].BackgroundColor);
}
p.append(item).append("<div style='clear:both;'></div>");
p.append(item);
if (layoutStyle == 0)
p.append("<div style='clear:both;'></div>");
}
}
else if (q.QuestionType == 8 || q.QuestionType == 9//DropDown、List
@ -682,7 +702,10 @@ function createAnswerContent(p, q) {
if (a.SelectedItems[j].BackgroundColor && a.SelectedItems[j].BackgroundColor != "") {
div_bg.css('background-color', a.SelectedItems[j].BackgroundColor);
}
p.append(item).append("<div style='clear:both;'></div>");
p.append(item);
if (layoutStyle == 0)
p.append("<div style='clear:both;'></div>");
}
}
}
@ -699,7 +722,9 @@ function createAnswerContent(p, q) {
if (a.SelectedItems[0].BackgroundColor && a.SelectedItems[0].BackgroundColor != "") {
div_bg.css('background-color', a.SelectedItems[0].BackgroundColor);
}
p.append(item).append("<div style='clear:both;'></div>");
p.append(item);
if (layoutStyle == 0)
p.append("<div style='clear:both;'></div>");
}
}
}
@ -726,7 +751,10 @@ function createAnswerContent(p, q) {
var m = reportdata.Medias[j];
if (m.AnswerId.toLowerCase() == a.Id.toLowerCase()) {
if (layoutPicturesDisplay == 1)//Displayed At Bottom
mediasdata.push(m);
{
if (isidentified == false)
mediasdata.push(m);
}
else {//Displayed As Taken
var media = createMedias(m);
pics.append(media);
@ -745,8 +773,10 @@ function createAnswerContent(p, q) {
if (a.SelectedItems[0].BackgroundColor && a.SelectedItems[0].BackgroundColor != "") {
div_bg.css('background-color', a.SelectedItems[0].BackgroundColor);
}
p.append(divanswer).append("<div style='clear:both;'></div>");
p.append(divanswer);
if (layoutStyle == 0)
p.append("<div style='clear:both;'></div>");
}
divanswer.append(label_level);
if (layoutPicturesDisplay != 1) {//Displayed At Bottom
@ -758,7 +788,10 @@ function createAnswerContent(p, q) {
var m = reportdata.Medias[j];
if (m.AnswerId.toLowerCase() == a.Id.toLowerCase()) {
if (layoutPicturesDisplay == 1)//Displayed At Bottom
mediasdata.push(m);
{
if (isidentified == false)
mediasdata.push(m);
}
else {//Displayed As Taken
var media = createMedias(m);
pics.append(media);
@ -767,17 +800,21 @@ function createAnswerContent(p, q) {
}
}
if (a.Result && a.Result != "") {
p.append($('<div class="answer" style="color:#808080"></div>').data('isimportant', q.IsImportant).html(replaceHtmlText(a.Result)));
var divresult = $('<div class="answer"></div>').data('isimportant', q.IsImportant).html(replaceHtmlText(a.Result));
p.append(divresult);
if (q.IsImportant && layoutHighlightColor)
divresult.css('color', layoutHighlightColor);
}
}
if (layoutStyle != 1 && layoutStyle != 2 && a.Comment && a.Comment != "") {
p.append($('<div class="answer" style="color:#808080"></div>').data('isimportant', q.IsImportant).html(replaceHtmlText(a.Comment)));
var divcomment = $('<div class="answer" style="color:#808080"></div>').data('isimportant', q.IsImportant).html(replaceHtmlText(a.Comment));
p.append(divcomment);
if (q.IsImportant && layoutHighlightColor)
divcomment.css('color', layoutHighlightColor);
}
return;
}
}
}
p.append($('<div class="answer"></div>').text(""));
//public string Id { get; set; }
@ -811,7 +848,6 @@ function createAnswerContent(p, q) {
//如果AssetStatus类型result存的是notes
return result;
}
function convertUnits(u) {

View File

@ -5,7 +5,7 @@
//spectrum: "../../js/spectrum"
},
waitSeconds: 0,
urlArgs: "v=38" //+ Math.random()
urlArgs: "v=39" //+ Math.random()
})
requirejs(['modules/inspects/editinspection'], function (EditModule) {

View File

@ -1072,7 +1072,7 @@
<div style="line-height: 30px;">
<div style="margin-left: 10px;">
<input type="checkbox" id="chkSelectAll" style="height: 26px;" v-on:change="selectAll($event)" /><span data-lgid="P_MAIN_SELECTALL">Select All</span>
<input type="checkbox" style="height: 26px;" v-on:change="selectAll($event)" /><span data-lgid="P_MAIN_SELECTALL">Select All</span>
</div>
<div id="divmsgcontainer" style="overflow: auto; position: absolute; top: 60px; bottom: 0; width: 100%;">
<div v-bind:style="bodyContainerStyle" style="position: relative">

View File

@ -166,6 +166,39 @@
opacity: 1;
opacity: initial
}
html::-webkit-scrollbar {
width: 8px;
height: 8px;
}
html::-webkit-scrollbar-thumb {
background-color: rgba(168, 168, 168, 0.9);
border-radius: 4px;
}
#workorderspliter {
height: 6px;
background-color: gray;
cursor: ns-resize;
margin: 6px 0 4px;
}
#workorderdetail {
position: relative;
overflow: auto;
}
#workorderdetail::-webkit-scrollbar {
width: 8px;
height: 8px;
}
#workorderdetail::-webkit-scrollbar-thumb {
background-color: rgba(168, 168, 168, 0.9);
border-radius: 4px;
}
#workorderdetail>.ui-popup-mask {
position: absolute;
}
</style>
<link href="<%=GetFileUrlWithVersion("../css/panel.css")%>" rel="stylesheet" />
@ -1010,6 +1043,10 @@
var dialogWidgets;
var widgetHeight = Number(localStorage.getItem('spliter_height'));
if (isNaN(widgetHeight) || widgetHeight < 100 || widgetHeight > 1000) {
widgetHeight = 300;
}
$(function () {
setPageTitle(GetTextByKey("P_WORKORDER", "Work Order"), true);
$('.iconlayout').on('click', function (ev) {
@ -1062,8 +1099,17 @@
});
$(window).resize(function () {
$("#workorderlist").css("height", $(window).height() - $("#workorderlist").offset().top - 10);
var top = $("#workorderlist").offset().top;
var height = $(window).height() - top - 10;
var widget = wowidgetobj?.workorderwidgets?.length > 0;
if (widget) {
height -= widgetHeight + 10;
}
$("#workorderlist").css("height", height);
grid_dt && grid_dt.resize();
//if (widget) {
// $('#workorderdetail').css('height', top + height + 6);
//}
}).resize();
$('#dialog_alerts').prop('iframe', true).dialog(function () {
@ -1102,6 +1148,46 @@
$('#spExport').hide();
}
var list = document.querySelector('#workorderlist');
var detail = document.querySelector('#workorderdetail');
detail.style.height = widgetHeight + 'px';
document.querySelector('#workorderspliter').addEventListener('mousedown', function (e) {
if (e.buttons !== 1) {
return;
}
var oy = e.clientY;
var oheight = widgetHeight;
var parent = document.body;
var top = document.querySelector('#workorderlist').offsetTop;
var windowHeight = window.innerHeight;
var gridbody = list.querySelector('.data-grid-body');
var headerHeight = list.querySelector('.data-grid-table-header').offsetHeight;
var move = function (e2) {
if (e2.buttons !== 1) {
parent.dispatchEvent(new MouseEvent('mouseup'));
return;
}
var y = e2.clientY - oy;
var height = oheight - y;
if (height > 100) {
widgetHeight = height;
detail.style.height = widgetHeight + 'px';
height = windowHeight - top - 10 - height - 10;
list.style.height = height + 'px';
gridbody.style.height = (height - headerHeight) + 'px';
}
};
parent.addEventListener('mousemove', move, { passive: false });
var up = function () {
grid_dt?.resize();
parent.removeEventListener('mousemove', move, { passive: false });
parent.removeEventListener('mouseup', up);
localStorage.setItem('spliter_height', String(widgetHeight));
};
parent.addEventListener('mouseup', up);
});
openmsgwebsocket();
});
@ -1437,7 +1523,8 @@
</div>
<div class="clear"></div>
<div id="workorderlist"></div>
<div id="workorderdetail"></div>
<div id="workorderspliter" style="display: none"></div>
<div id="workorderdetail" style="display: none"></div>
</div>
<div id="mask_bg" style="display: none;">
<div class="loading c-spin"></div>

View File

@ -1292,9 +1292,12 @@ function InitGridData() {
grid_dt.selectedrowchanged = function (rowindex) {
var rowdata = grid_dt.source[rowindex];
if (rowdata && rowdata.Values.Id.Value > 0) {
if (!wowidgetobj)
if (!wowidgetobj) {
wowidgetobj = new WorkOrderWidget();
wowidgetobj.changeWorkOrder(rowdata.Values);
wowidgetobj.changeWorkOrder(rowdata.Values);
} else {
wowidgetobj.changeWorkOrder(rowdata.Values);
}
}
}

View File

@ -391,7 +391,7 @@ if (typeof ($woestimate) !== "function") {
tb_att.append(tr_att);
var td_att = $('<td></td>');
tr_att.append(td_att);
div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>');
div_att = $('<div style="max-height: 80px; overflow: auto;padding: 0 4px;"></div>');
td_att.append(div_att);
tb_att = $('<table id="tab_est_atts" style="table-layout: fixed;"></table>');
div_att.append(tb_att);
@ -528,7 +528,7 @@ if (typeof ($woestimate) !== "function") {
tb_att.append(tr_att);
var td_att = $('<td></td>');
tr_att.append(td_att);
div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>');
div_att = $('<div style="max-height: 80px; overflow: auto;padding: 0 4px;"></div>');
td_att.append(div_att);
tb_att = $('<table id="tab_woest_atts" style="table-layout: fixed;"></table>');
div_att.append(tb_att);
@ -944,7 +944,7 @@ if (typeof ($woestimate) !== "function") {
tb_att.append(tr_att);
var td_att = $('<td></td>');
tr_att.append(td_att);
div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>');
div_att = $('<div style="max-height: 80px; overflow: auto;padding: 0 4px;"></div>');
td_att.append(div_att);
tb_att = $('<table id="tab_est_atts' + estimateindex + '" style="table-layout: fixed;"></table>');
div_att.append(tb_att);
@ -1812,7 +1812,7 @@ if (typeof ($woinvoice) !== "function") {
tb_att.append(tr_att);
var td_att = $('<td></td>');
tr_att.append(td_att);
div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>');
div_att = $('<div style="max-height: 80px; overflow: auto;padding: 0 4px;"></div>');
td_att.append(div_att);
tb_att = $('<table id="tab_invoice_atts" style="table-layout: fixed;"></table>');
div_att.append(tb_att);
@ -1943,7 +1943,7 @@ if (typeof ($woinvoice) !== "function") {
tb_att.append(tr_att);
var td_att = $('<td></td>');
tr_att.append(td_att);
div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>');
div_att = $('<div style="max-height: 80px; overflow: auto;padding: 0 4px;"></div>');
td_att.append(div_att);
tb_att = $('<table id="tab_woinvoice_atts" style="table-layout: fixed;"></table>');
div_att.append(tb_att);
@ -2369,7 +2369,7 @@ if (typeof ($woinvoice) !== "function") {
tb_att.append(tr_att);
var td_att = $('<td></td>');
tr_att.append(td_att);
div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>');
div_att = $('<div style="max-height: 80px; overflow: auto;padding: 0 4px;"></div>');
td_att.append(div_att);
tb_att = $('<table id="tab_invoice_atts' + invoice_index + '" style="table-layout: fixed;"></table>');
div_att.append(tb_att);

View File

@ -195,9 +195,15 @@ var WorkOrderWidget = function () {
return;
}
_this.workorderwidgets = data;
var display = data?.length > 0 ? 'block' : 'none';
$('#workorderspliter').css('display', display);
$('#workorderdetail').css('display', display);
_this.showWorkOrderWidgets();
_this.getWorkOrderContacts(_this.workorderid);
setTimeout(function () {
$(window).resize();
document.querySelector('#workorderdetail').scrollTop = 0;
}, 0);
}, function () {
showAlert(GetTextByKey("P_XXXX", 'Failed to get the work order widget list.'), title);
});
@ -259,6 +265,9 @@ var WorkOrderWidget = function () {
this.workorderwidgets = null;
this.popups = [];
this.widgets = [];
$('#workorderspliter').css('display', 'none');
$('#workorderdetail').css('display', 'none');
$(window).resize();
}
}
}
@ -313,25 +322,33 @@ var WorkOrderWidget = function () {
this.createWidgetDialog = function (widget) {
const ui = window['lib-ui'];
let width = $(document.body).width();
let layout = widget.Layout;
if (!layout || layout === '') {
let x = this.defX;
let y = this.defY;
let width = $(document.body).width();
let height = $(document.body).height();
let left = 20 + 320 * x;
let left = 10 + 315 * x;
if (left + 300 > width) {
x = 0;
left = 20;
left = 10;
y++;
this.defY = y;
}
let top = height - (y == 0 ? 420 : 320 * (y + 1));
let top = 10 + 165 * y;
if (top >= widgetHeight) {
top = widgetHeight - 40;
}
x++;
this.defX = x;
layout = { left, top, width: 300, height: 400 };
} else {
layout = JSON.parse(widget.Layout);
if (layout.top >= widgetHeight) {
layout.top = widgetHeight - 40;
}
if (layout.left >= width) {
layout.left = width - 10;
}
}
let zIndex = this.currentZIndex--;
@ -361,7 +378,7 @@ var WorkOrderWidget = function () {
onMoveEnded: function () { _this.saveWorkOrderWidgets(widget, popup.rect) },
onResizeEnded: function () { _this.saveWorkOrderWidgets(widget, popup.rect) }
});
popup.show();
popup.show(document.querySelector('#workorderdetail'));
popup.rect = layout;
this.popups[widget.WidgetId] = popup;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long