GitHub(nextgroup2706/ken_nogi)は今後使わず自社Gitea運用に切替え。 NodeSrvは旧リポジトリの履歴を破棄しファイルのみ統合(Dokploy用サービスアカウントは 別途mygit-admin/NodeSrv.gitに履歴あり)。notepmエクスポート(12GB)とPleasanter インストーラzip(208MB)はサイズが大きいため.gitignoreで除外。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
125 lines
4.7 KiB
JavaScript
125 lines
4.7 KiB
JavaScript
loadcdn('script', 'https://cdn.geolonia.com/community-geocoder.js');
|
|
loadcdn('script', 'https://html2canvas.hertzen.com/dist/html2canvas.min.js');
|
|
loadcdn('script', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.qrcode/1.0/jquery.qrcode.min.js');
|
|
|
|
function createMapReport() {
|
|
console.log('createMapReport');
|
|
let div = document.createElement('div');
|
|
div.id = 'templateHTML';
|
|
div.style.display = 'none';
|
|
$('body').append(div);
|
|
|
|
const req = new XMLHttpRequest();
|
|
let url = '/pleasanter/myScripts/templateHTML3.html';
|
|
req.onreadystatechange = function () {
|
|
//console.log(req);
|
|
if (req.readyState == 4) {
|
|
if (req.status == 200) {
|
|
//console.log(req);
|
|
let templateHTML = req.response;
|
|
let data002 = JSON.parse($('#Results_Description002').val()); //施工会社
|
|
//console.log(data002);
|
|
//console.log(userList);
|
|
|
|
let koujimei1 = $('#Results_ClassQ').val();
|
|
let koujimei2 = $('#Results_ClassU').val();
|
|
let shubetsu = $('#Results_Class042').val();
|
|
|
|
let koujimei = koujimei1 + ' 様邸' + shubetsu + '工事';
|
|
if (koujimei2 != '') {
|
|
koujimei = koujimei2 + ' 様邸' + shubetsu + '工事';
|
|
}
|
|
let now = new Date();
|
|
let nowStr = now.getFullYear() + '年' + (now.getMonth() + 1) + '月' + now.getDate() + '日';
|
|
|
|
let sonota = $('#Results_Description050').val().replace(/\n/g, '<br>');
|
|
let kouji_tantou = '';
|
|
if ($('#Results_ClassJ').val()) {
|
|
kouji_tantou = userList[$('#Results_ClassJ').val()].name;
|
|
}
|
|
|
|
let template = Hogan.compile(templateHTML);
|
|
let outputHtml = template.render({
|
|
kokyaku_code: $('#Results_ClassB').val(),
|
|
keiyaku_code: $('#Results_ClassA').val(),
|
|
create_date: nowStr,
|
|
koujimei_kana: $('#Results_ClassR').val(),
|
|
kouji_mei: koujimei,
|
|
jusyo_yubin: '〒' + $('#Results_Class028').val(),
|
|
jyusho: $('#Results_Class029').val(),
|
|
sekou_kaisya: data002.ClassHash.ClassA,
|
|
tel: data002.ClassHash.ClassD,
|
|
fax: data002.ClassHash.ClassE,
|
|
kouji_tantou: kouji_tantou,
|
|
hannyu_road: $('#Results_Class050').val(),
|
|
chusyajou: $('#Results_Class051').val(),
|
|
sho_unpan: $('#Results_Class052').val(),
|
|
ResultId: $p.id(),
|
|
sonota: sonota,
|
|
});
|
|
|
|
let newWin = window.open('', '現場案内図', 'left=10,top=10,width=1100,height=900,menubar=no,toolbar=no,location=no,status=no,resizable=yes,scrollbars=no');
|
|
newWin.document.open();
|
|
newWin.document.write(outputHtml);
|
|
newWin.document.close();
|
|
|
|
openYahooMap(newWin);
|
|
}
|
|
}
|
|
};
|
|
|
|
req.open('GET', url);
|
|
req.setRequestHeader('Pragma', 'no-cache');
|
|
req.setRequestHeader('Cache-Control', 'no-cache');
|
|
req.setRequestHeader('If-Modified-Since', 'Thu, 01 Jun 1970 00:00:00 GMT');
|
|
req.send();
|
|
}
|
|
|
|
function openYahooMap(newWin) {
|
|
let jyusho = $('#Results_Class029').val();
|
|
if (jyusho) {
|
|
const req = new XMLHttpRequest();
|
|
let url = 'https://msearch.gsi.go.jp/address-search/AddressSearch?q=' + encodeURI(jyusho);
|
|
req.onreadystatechange = function () {
|
|
if (req.readyState == 4) {
|
|
if (req.status == 200) {
|
|
// 受信したデータの処理を記述する
|
|
let res = JSON.parse(req.response);
|
|
//緯度経度取得
|
|
let lng = res[0].geometry.coordinates[0];
|
|
let lat = res[0].geometry.coordinates[1];
|
|
//GoogleMAPURL作成
|
|
let googleMap = 'https://maps.google.co.jp/maps?ll=' + lat + ',' + lng + '&q=' + lat + ',' + lng + '&z=19';
|
|
//QRコード作成
|
|
$('#googleMapQrCode').qrcode({
|
|
width: 90,
|
|
height: 90,
|
|
text: googleMap
|
|
});
|
|
let canvas1 = document.getElementById('googleMapQrCode').firstChild;
|
|
let qrData = canvas1.toDataURL('image/png');
|
|
//console.log(qrData);
|
|
//QRコードを案内図に埋め込み
|
|
newWin.document.getElementById('mapQr').innerHTML = '<img src=' + qrData + ' />';
|
|
|
|
//Yahoo地図取得
|
|
let yahooMap1 = 'https://map.yahoo.co.jp/embedmap/V3/?' + 'lon=' + lng + '&lat=' + lat + '&zoom=17&cond=maptype:twoTones;' + '&width=640&height=400';
|
|
let html1 = '<body>' + '<script type="text/javascript" src="' + yahooMap1 + '">' + '</' + 'script>' + '</body>';
|
|
let iframeDocument1 = newWin.document.getElementById('mapFrame1').contentWindow.document;
|
|
iframeDocument1.open();
|
|
iframeDocument1.write(html1);
|
|
iframeDocument1.close();
|
|
|
|
let yahooMap2 = 'https://map.yahoo.co.jp/embedmap/V3/?' + 'lon=' + lng + '&lat=' + lat + '&zoom=16&cond=maptype:twoTones;' + '&width=640&height=400';
|
|
let html2 = '<body>' + '<script type="text/javascript" src="' + yahooMap2 + '">' + '</' + 'script>' + '</body>';
|
|
let iframeDocument2 = newWin.document.getElementById('mapFrame2').contentWindow.document;
|
|
iframeDocument2.open();
|
|
iframeDocument2.write(html2);
|
|
iframeDocument2.close();
|
|
}
|
|
}
|
|
};
|
|
req.open('GET', url);
|
|
req.send();
|
|
}
|
|
} |