Skip to content

Commit d93a155

Browse files
committed
MES: Ek Notlar - Resim/Döküman Görüntüleme
1 parent c45c69b commit d93a155

File tree

8 files changed

+82
-15
lines changed

8 files changed

+82
-15
lines changed

app/mes/classes/include.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
<script src="<?=$_partRoot?>/mqHatYonetimi.js?<?=$appVersion?>"></script> <link rel="stylesheet" href="<?=$_partRoot?>/mqHatYonetimi.css?<?=$appVersion?>"/>
66
<script src="<?=$_partRoot?>/mqXIsler.js?<?=$appVersion?>"></script> <link rel="stylesheet" href="<?=$_partRoot?>/mqXIsler.css?<?=$appVersion?>"/>
77
<script src="<?=$_partRoot?>/mqDiger.js?<?=$appVersion?>"></script> <link rel="stylesheet" href="<?=$_partRoot?>/mqDiger.css?<?=$appVersion?>"/>
8+
<script src="<?=$_partRoot?>/parts.js?<?=$appVersion?>"></script> <link rel="stylesheet" href="<?=$_partRoot?>/parts.css?<?=$appVersion?>"/>

app/mes/classes/mqDiger.js

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ class MQEkNotlar extends MQSayacliOrtak {
232232
static get table() { return 'meseknotlar' } static get tableAlias() { return 'eknot' } static get sayacSaha() { return 'kaysayac' }
233233
static get tanimUISinif() { return ModelTanimPart } static get secimSinif() { return MQCogul.secimSinif }
234234
static get tanimlanabilirmi() { return true } static get silinebilirmi() { return true } static get urlCount() { return 3 }
235+
static get urlCount() { return 3 }
235236
static pTanimDuzenle(e) {
236237
super.pTanimDuzenle(e); const {pTanim} = e; $.extend(pTanim, {
237238
kayitTarih: new PInstDateNow('kayittarih'), kayitZaman: new PInstStr({ rowAttr: 'kayitzaman', init: e => timeToString(now()) }),
@@ -240,6 +241,10 @@ class MQEkNotlar extends MQSayacliOrtak {
240241
});
241242
for (let i = 1; i <= this.urlCount; i++) { pTanim[`url${i}`] = new PInstStr(`url${i}`) }
242243
}
244+
static rootFormBuilderDuzenle_listeEkrani(e) {
245+
super.rootFormBuilderDuzenle_listeEkrani(e); const rfb = e.rootBuilder;
246+
this.fbd_listeEkrani_addButton(rfb, { id: 'dokumanGoster', text: 'Döküman Göster', handler: e => this.dokumanGosterIstendi(e) })
247+
}
243248
static rootFormBuilderDuzenle(e) {
244249
super.rootFormBuilderDuzenle(e); const rfb = e.rootBuilder, tanimForm = e.tanimFormBuilder;
245250
let form = tanimForm.addFormWithParent().yanYana(3);
@@ -251,7 +256,7 @@ class MQEkNotlar extends MQSayacliOrtak {
251256
form.addModelKullan('hatKod', 'Hat').setMFSinif(MQHat).comboBox().setVisibleKosulu(e => { let value = e.builder.altInst.tip; value = value?.char ?? value; return value == 'HT' ? true : 'jqx-hidden' });
252257
form.addModelKullan('tezgahKod', 'Tezgah').setMFSinif(MQTezgah).comboBox().setVisibleKosulu(e => { let value = e.builder.altInst.tip; value = value?.char ?? value; return value == 'TZ' ? true : 'jqx-hidden' });;
253258
form = tanimForm.addFormWithParent().yanYana().addStyle(e => `$elementCSS { margin-top: 10px }`);
254-
form.addTextInput('url1', 'Doküman URL 1'); form.addTextInput('url2', 'Doküman URL 2'); form.addTextInput('url3', 'Doküman URL 3');
259+
for (let i = 1; i <= this.urlCount; i++) { form.addTextInput(`url${i}`, `Doküman URL ${i}`) }
255260
form = tanimForm.addFormWithParent().yanYana().addStyle(e => `$elementCSS { margin-top: 10px }`);
256261
form.addTextArea('notlar', 'Notlar').setRows(20)
257262
}
@@ -275,27 +280,53 @@ class MQEkNotlar extends MQSayacliOrtak {
275280
wh.ozellik(sec.tezgahAdi, 'tez.aciklama')
276281
})
277282
}
283+
static orjBaslikListesi_argsDuzenle(e) { super.orjBaslikListesi_argsDuzenle(e); const {args} = e; $.extend(args, { rowsHeight: 180 }) }
278284
static ekCSSDuzenle(e) {
279285
super.ekCSSDuzenle(e); const {rec, result} = e, belirtec = e.belirtec ?? e.dataField ?? e.datafield, {tip} = rec;
280286
if (belirtec == 'tipText') { result.push('bold'); switch (tip) { case 'HT': result.push('bg-lightgreen'); break; case 'TZ': result.push('bg-lightred'); break } }
281287
}
288+
static standartGorunumListesiDuzenle(e) {
289+
super.standartGorunumListesiDuzenle(e); let {liste} = e, _liste = liste.filter(colDef => !colDef?.startsWith('url'));
290+
liste = e.liste = _liste
291+
}
282292
static orjBaslikListesiDuzenle(e) {
283-
super.orjBaslikListesiDuzenle(e); const {liste} = e, alias = e.alias ?? this.tableAlias; liste.push(...[
293+
super.orjBaslikListesiDuzenle(e); const {liste} = e, alias = e.alias ?? this.tableAlias, {urlCount} = this;
294+
liste.push(...[
284295
new GridKolon({ belirtec: 'tipText', text: 'Tip', genislikCh: 8, sql: HatTezgah.getClause(`${alias}.tip`) }),
285296
new GridKolon({ belirtec: 'hatkod', text: 'Hat', genislikCh: 8 }),
286297
new GridKolon({ belirtec: 'hatadi', text: 'Hat Adı', genislikCh: 15, sql: 'hat.aciklama' }),
287298
new GridKolon({ belirtec: 'tezgahkod', text: 'Tezgah', genislikCh: 16 }),
288-
new GridKolon({ belirtec: 'tezgahadi', text: 'Tezgah Adı', genislikCh: 30, sql: 'tez.aciklama' }),
289-
new GridKolon({ belirtec: 'url1', text: 'Dokuman URL 1' }),
290-
new GridKolon({ belirtec: 'url2', text: 'Dokuman URL 2' }),
291-
new GridKolon({ belirtec: 'url3', text: 'Dokuman URL 3' }),
292-
new GridKolon({ belirtec: 'notlar', text: 'Ek Notlar' })
293-
])
299+
new GridKolon({ belirtec: 'tezgahadi', text: 'Tezgah Adı', genislikCh: 30, sql: 'tez.aciklama' })
300+
]);
301+
for (let i = 1; i <= urlCount; i++) { liste.push(new GridKolon({ belirtec: `url${i}`, text: `Dokuman URL ${i}` })) }
302+
for (let i = 1; i <= urlCount; i++) {
303+
liste.push(new GridKolon({
304+
belirtec: `resim${i}`, text: `Dokuman Resim ${i}`, genislikCh: 20, cellsRenderer: (colDef, rowIndex, belirtec, _value, html, jqxCol, rec) => {
305+
let i = asInteger(belirtec.slice('resim'.length)), value = rec[`url${i}`];
306+
if (value) { html = `<div class="full-wh" style="background-repeat: no-repeat; background-size: contain; background-image: url(${value})"*>` }
307+
return html
308+
}
309+
}).noSql())
310+
}
311+
liste.push(new GridKolon({ belirtec: 'notlar', text: 'Ek Notlar', genislikCh: 150 }))
294312
}
295313
static loadServerData_queryDuzenle(e) {
296314
super.loadServerData_queryDuzenle(e); const {sent} = e, alias = e.alias ?? this.tableAlias;
297315
sent.fromIliski('ismerkezi hat', `${alias}.hatkod = hat.kod`);
298316
sent.fromIliski('tekilmakina tez', `${alias}.tezgahkod = tez.kod`);
299-
sent.sahalar.add(`${alias}.tip`)
317+
sent.sahalar.add(`${alias}.tip`); for (let i = 1; i <= this.urlCount; i++) { sent.sahalar.add(`${alias}.url${i}`) }
318+
}
319+
static orjBaslikListesi_satirTiklandi(e) {
320+
e = e || {}; const gridPart = e.gridPart ?? e.sender, gridWidget = e?.event?.args?.owner ?? gridPart.gridWidget, belirtec = e.belirtec ?? gridWidget?._clickedcolumn;
321+
if (belirtec?.startsWith('resim')) { this.dokumanGosterIstendi(e) }
322+
}
323+
static dokumanGosterIstendi(e) {
324+
e = e || {}; const islemAdi = 'Döküman Göster'; try {
325+
const {builder} = e, gridPart = e.gridPart ?? builder?.rootPart ?? e.sender ?? app.activeWndPart, recs = gridPart.selectedRecs, {urlCount} = this;
326+
const urlListe = []; for (const rec of recs) { for (let i = 1; i <= urlCount; i++) { let value = rec[`url${i}`]; if (value?.includes('://')) { urlListe.push(value.trim()) } } }
327+
if (!urlListe.length) { hConfirm('Gösterilecek Döküman bulunamadı', islemAdi); return }
328+
new MESDokumanWindowPart({ urlListe }).run()
329+
}
330+
catch (ex) { hConfirm(getErrorText(ex), islemAdi); throw ex }
300331
}
301332
}

app/mes/classes/mqHatYonetimi.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class MQHatYonetimi extends MQMasterOrtak {
5050
{ id: 'tezgahMenu', text: 'TEZ', handler: e => this.tezgahMenuIstendi(e) },
5151
{ id: 'isEmirleri', text: 'EMR', handler: e => this.bekleyenIsEmirleriIstendi(e) },
5252
{ id: 'topluX', text: 'TPL', handler: e => this.topluXMenuIstendi(e) },
53+
{ id: 'tumEkNotlar', text: 'NOT', handler: e => this.ekNotlarIstendi({ ...e, hepsi: true }) },
5354
{ id: 'ozet', text: 'ÖZET', handler: e => this.ozetBilgiGoster(e) }
5455
];
5556
liste.splice(liste.findIndex(item => item.id == 'vazgec'), 0, ...items);

app/mes/classes/parts.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.mesDokuman.part .dokumanForm,
2+
.mesDokuman.part .skyResim.part #resim > .widget,
3+
.mesDokuman.part .skyResim.part #resim > .widget .item > .content { background-color: #111 !important; margin: 0 !important; padding: 0 !important }
4+
.mesDokuman.part .skyResim.part { height: calc(var(--full) - 50px) !important }
5+
/*.mesDokuman.part { --islemTuslari-height: 0px }
6+
.mesDokuman.part .content { height: calc(var(--full) - var(--islemTuslari-height)) !important }*/

app/mes/classes/parts.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
class MESDokumanPart extends Part {
2+
static { window[this.name] = this; this._key2Class[this.name] = this }
3+
static get isWindowPart() { return false } static get partName() { return 'mesDokuman' } static get sinifAdi() { return 'Dökümanlar' }
4+
constructor(e) { e = e || {}; super(e); $.extend(this, { title: e.title ?? 'Dökümanlar', urlListe: e.urlListe ?? e.images ?? [] }) }
5+
run(e) {
6+
e = e || {}; super.run(e); const {layout} = this;
7+
const header = this.header = layout.children('.header'), islemTuslari = this.islemTuslari = header.children('.islemTuslari');
8+
const subContent = this.subContent = layout.children('.content'), dokumanForm = this.dokumanForm = subContent.find('.dokumanForm');
9+
const builder = this.builder = this.getRootFormBuilder(e); if (builder) { $.extend(builder, { part: this }); builder.autoInitLayout().run(e) }
10+
}
11+
destroyPart(e) { super.destroyPart(e) }
12+
tazele(e) { e = e || {}; const {part} = this, images = this.urlListe; $.extend(part, { images }); part.run(); return this }
13+
getRootFormBuilder(e) {
14+
const rfb = new RootFormBuilder(), {islemTuslari, dokumanForm} = this;
15+
rfb.addIslemTuslari('islemTuslari').setLayout(islemTuslari).widgetArgsDuzenleIslemi(e => $.extend(e.args, { ekButonlarIlk: [{ id: 'vazgec', handler: e => e.builder.rootBuilder.part.close(e) }] }));
16+
let layout = app.getLayout({ selector: '#skyResim.part' }); layout.appendTo(dokumanForm); layout.addClass('full-wh');
17+
let part = this.part = new SkyResimPart({ layout }); let form = rfb.addForm('dokumanForm').setLayout(dokumanForm).setPart(part).onAfterRun(e => this.tazele(e)); return rfb
18+
}
19+
getLayoutInternal(e) {
20+
return $(`
21+
<div class="full-wh">
22+
<div class="header full-width jqx-hidden"><div class="islemTuslari"/></div></div><div class="content full-width dock-bottom"><div class="dokumanForm full-wh"/></div>
23+
</div>`
24+
)
25+
}
26+
}
27+
class MESDokumanWindowPart extends MESDokumanPart {
28+
static { window[this.name] = this; this._key2Class[this.name] = this }
29+
static get isWindowPart() { return true }
30+
}

app/mes/prereq.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22
require_once("$webRoot_ticari/include/ortak-01.php"); require_once("$webRoot_ticari/include/ortak-02.php"); require_once("$webRoot_ticari/classes/mq-param/include.php");
3-
require_once("$webRoot_ticari/include/ortak-03.php"); require_once("$webRoot_ticari/include/ortak-06.php"); require_once("./classes/include.php")
3+
require_once("$webRoot_ticari/include/ortak-03.php"); require_once("$webRoot_ticari/include/ortak-06.php"); require_once("$webRoot/../ext/etc/skyResim/layouts.php"); @include_once("$webRoot/../ext/etc/skyResim/include.php");
4+
require_once("./classes/include.php")
45
?>
56
<div id="prefetch" class="jqx-hidden"></div>

app/uretimVeriToplama/classes/mq-master/mqGercekleme.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ class MQGercekleme extends MQSayacli {
4848
if (oemSayacListe) { wh.inDizi(oemSayacListe, `${aliasVeNokta}fissayac`) }
4949
})
5050
}
51-
static orjBaslikListesi_argsDuzenle(e) {
52-
super.orjBaslikListesi_argsDuzenle(e); const {args} = e;
53-
$.extend(args, { showFilterRow: true, rowsHeight: 65 })
54-
}
51+
static orjBaslikListesi_argsDuzenle(e) { super.orjBaslikListesi_argsDuzenle(e); const {args} = e; $.extend(args, { showFilterRow: true, rowsHeight: 65 }) }
5552
static standartGorunumListesiDuzenle(e) {
5653
super.standartGorunumListesiDuzenle(e); const {liste} = e;
5754
if (config.dev) liste.push(this.sayacSaha, 'oemsayac')

config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
global $globalAppName, $appName, $appVersion, $appClass, $shortAppName, $webRoot, $webRoot_ticari;
3-
$globalAppName = 'SkyERP'; $appVersion = '1.21.8';
3+
$globalAppName = 'SkyERP'; $appVersion = '1.21.9';
44
$shortAppName = empty($appClass) ? $globalAppName : $appClass;
55
$webRoot = isset($webRoot) ? $webRoot : '../..'; $webRoot_ticari = "$webRoot/app/ticari";
66
?>

0 commit comments

Comments
 (0)