@dssp/supervision 1.0.0-alpha.25 → 1.0.0-alpha.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist-client/graphql/building-inspection.js +17 -0
  2. package/dist-client/graphql/building-inspection.js.map +1 -1
  3. package/dist-client/pages/action-plan/action-plan-importer.d.ts +1 -1
  4. package/dist-client/pages/action-plan/action-plan-list-page.d.ts +1 -1
  5. package/dist-client/pages/building-inspection/building-inspection-detail-camera.d.ts +1 -1
  6. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.d.ts +6 -1
  7. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +86 -9
  8. package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js.map +1 -1
  9. package/dist-client/pages/building-inspection/building-inspection-detail-drawing.d.ts +1 -1
  10. package/dist-client/pages/building-inspection/building-inspection-list.d.ts +7 -0
  11. package/dist-client/pages/building-inspection/building-inspection-list.js +90 -15
  12. package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -1
  13. package/dist-client/pages/building-inspection/component/daily-worklog-popup.d.ts +17 -0
  14. package/dist-client/pages/building-inspection/component/daily-worklog-popup.js +354 -0
  15. package/dist-client/pages/building-inspection/component/daily-worklog-popup.js.map +1 -0
  16. package/dist-client/pages/building-inspection/component/image-preview-popup.d.ts +1 -1
  17. package/dist-client/pages/building-inspection/component/inspection-document/inspection-request-document.d.ts +3 -4
  18. package/dist-client/pages/building-inspection/component/inspection-document/inspection-request-document.js +135 -176
  19. package/dist-client/pages/building-inspection/component/inspection-document/inspection-request-document.js.map +1 -1
  20. package/dist-client/pages/building-inspection/component/inspection-document/inspection-result-notification.d.ts +30 -0
  21. package/dist-client/pages/building-inspection/component/inspection-document/inspection-result-notification.js +479 -0
  22. package/dist-client/pages/building-inspection/component/inspection-document/inspection-result-notification.js.map +1 -0
  23. package/dist-client/pages/building-inspection/component/inspection-document/photo-album-popup.d.ts +1 -1
  24. package/dist-client/pages/building-inspection/inspection-create-popup.js +17 -5
  25. package/dist-client/pages/building-inspection/inspection-create-popup.js.map +1 -1
  26. package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.d.ts +3 -2
  27. package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.js +46 -3
  28. package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.js.map +1 -1
  29. package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.js +2 -1
  30. package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.js.map +1 -1
  31. package/dist-client/pages/building-inspection-grid/component/plan-preview-popup.d.ts +1 -1
  32. package/dist-client/pages/checklist/attachment-list-popup.js +1 -7
  33. package/dist-client/pages/checklist/attachment-list-popup.js.map +1 -1
  34. package/dist-client/pages/checklist/checklist-view.js +52 -18
  35. package/dist-client/pages/checklist/checklist-view.js.map +1 -1
  36. package/dist-client/pages/checklist/inspection-info-popup.d.ts +1 -1
  37. package/dist-client/pages/checklist/inspection-tab-popup.d.ts +1 -1
  38. package/dist-client/pages/checklist-template/checklist-template-list.d.ts +1 -1
  39. package/dist-client/pages/checklist-template/checklist-template-list.js +1 -1
  40. package/dist-client/pages/checklist-template/checklist-template-list.js.map +1 -1
  41. package/dist-client/pages/checklist-template/checklist-type-management.d.ts +1 -1
  42. package/dist-client/pages/issue/issue-importer.d.ts +1 -1
  43. package/dist-client/pages/issue/issue-list-page.d.ts +1 -1
  44. package/dist-client/pages/project-report/project-report-importer.d.ts +1 -1
  45. package/dist-client/pages/project-report/project-report-list-page.d.ts +1 -1
  46. package/dist-client/pages/supervisor/supervisor-importer.d.ts +1 -1
  47. package/dist-client/pages/supervisor/supervisor-list-page.d.ts +1 -1
  48. package/dist-client/tsconfig.tsbuildinfo +1 -1
  49. package/dist-server/service/building-inspection/building-inspection-mutation.js +45 -19
  50. package/dist-server/service/building-inspection/building-inspection-mutation.js.map +1 -1
  51. package/dist-server/service/building-inspection/building-inspection-query.js +7 -1
  52. package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -1
  53. package/dist-server/service/building-inspection/building-inspection-type.d.ts +7 -0
  54. package/dist-server/service/building-inspection/building-inspection-type.js +25 -0
  55. package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -1
  56. package/dist-server/service/building-inspection/index.d.ts +1 -1
  57. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-mutation.d.ts +8 -0
  58. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-mutation.js +98 -0
  59. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-mutation.js.map +1 -0
  60. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-query.d.ts +12 -0
  61. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-query.js +85 -0
  62. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-query.js.map +1 -0
  63. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-type.d.ts +12 -0
  64. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-type.js +47 -0
  65. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-type.js.map +1 -0
  66. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog.d.ts +25 -0
  67. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog.js +98 -0
  68. package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog.js.map +1 -0
  69. package/dist-server/service/building-inspection-daily-worklog/index.d.ts +5 -0
  70. package/dist-server/service/building-inspection-daily-worklog/index.js +9 -0
  71. package/dist-server/service/building-inspection-daily-worklog/index.js.map +1 -0
  72. package/dist-server/service/checklist/checklist-query.d.ts +2 -0
  73. package/dist-server/service/checklist/checklist-query.js +11 -0
  74. package/dist-server/service/checklist/checklist-query.js.map +1 -1
  75. package/dist-server/service/checklist/checklist.d.ts +23 -0
  76. package/dist-server/service/checklist/checklist.js +73 -1
  77. package/dist-server/service/checklist/checklist.js.map +1 -1
  78. package/dist-server/service/index.d.ts +2 -1
  79. package/dist-server/service/index.js +6 -2
  80. package/dist-server/service/index.js.map +1 -1
  81. package/dist-server/tsconfig.tsbuildinfo +1 -1
  82. package/package.json +4 -3
@@ -10,6 +10,7 @@ export async function getBuildingInspectionForChecklist(buildingInspectionId = '
10
10
  id
11
11
  status
12
12
  requestDate
13
+ memo
13
14
  checklist {
14
15
  id
15
16
  name
@@ -18,12 +19,25 @@ export async function getBuildingInspectionForChecklist(buildingInspectionId = '
18
19
  location
19
20
  inspectionParts
20
21
  documentNo
22
+ inspectionRequestDocumentNo
23
+ inspectionRequestMemo
24
+ inspectionRequestUpdatedAt
25
+ inspectionResultDocumentNo
26
+ inspectionResultStatus
27
+ inspectionResultType
28
+ inspectionResultMemo
29
+ inspectionResultUpdatedAt
21
30
  constructionInspectionDate
22
31
  supervisorInspectionDate
23
32
  overallConstructorSignature
24
33
  taskConstructorSignature
25
34
  overallSupervisorySignature
26
35
  taskSupervisorySignature
36
+ nameListAttachment {
37
+ id
38
+ name
39
+ fullpath
40
+ }
27
41
  taskConstructor {
28
42
  id
29
43
  name
@@ -57,6 +71,8 @@ export async function getBuildingInspectionForChecklist(buildingInspectionId = '
57
71
 
58
72
  buildingLevel {
59
73
  id
74
+ floor
75
+
60
76
  building {
61
77
  id
62
78
  buildingComplex {
@@ -66,6 +82,7 @@ export async function getBuildingInspectionForChecklist(buildingInspectionId = '
66
82
  overallSupervisoryEmails
67
83
  taskSupervisoryEmails
68
84
  supervisoryCompany
85
+ constructionCompany
69
86
  }
70
87
  }
71
88
  }
@@ -1 +1 @@
1
- {"version":3,"file":"building-inspection.js","sourceRoot":"","sources":["../../client/graphql/building-inspection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AAEpC,MAAM,CAAC,KAAK,UAAU,iCAAiC,CAAC,uBAA+B,EAAE;IACvF,IAAI,CAAC,oBAAoB;QAAE,OAAO,IAAI,CAAA;IAEtC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmET;QACD,SAAS,EAAE;YACT,oBAAoB;SACrB;KACF,CAAC,CAAA;IAEF,IAAI,QAAQ,CAAC,MAAM;QAAE,OAAO,IAAI,CAAA;IAEhC,OAAO,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAA;AACzC,CAAC","sourcesContent":["import { client } from '@operato/graphql'\nimport { gql } from '@apollo/client'\n\nexport async function getBuildingInspectionForChecklist(buildingInspectionId: string = '') {\n if (!buildingInspectionId) return null\n\n const response = await client.query({\n query: gql`\n query BuildingInspection($buildingInspectionId: String!) {\n buildingInspection(id: $buildingInspectionId) {\n id\n status\n requestDate\n checklist {\n id\n name\n constructionType\n constructionDetailType\n location\n inspectionParts\n documentNo\n constructionInspectionDate\n supervisorInspectionDate\n overallConstructorSignature\n taskConstructorSignature\n overallSupervisorySignature\n taskSupervisorySignature\n taskConstructor {\n id\n name\n }\n overallConstructor {\n id\n name\n }\n taskSupervisory {\n id\n name\n }\n overallSupervisory {\n id\n name\n }\n\n checklistItems {\n id\n name\n sequence\n mainType\n detailType\n inspctionCriteria\n constructionConfirmStatus\n supervisoryConfirmStatus\n checklistItemCommentCount\n checklistItemAttachmentCount\n }\n }\n\n buildingLevel {\n id\n building {\n id\n buildingComplex {\n id\n overallConstructorEmails\n taskConstructorEmails\n overallSupervisoryEmails\n taskSupervisoryEmails\n supervisoryCompany\n }\n }\n }\n }\n }\n `,\n variables: {\n buildingInspectionId\n }\n })\n\n if (response.errors) return null\n\n return response.data.buildingInspection\n}\n"]}
1
+ {"version":3,"file":"building-inspection.js","sourceRoot":"","sources":["../../client/graphql/building-inspection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AAEpC,MAAM,CAAC,KAAK,UAAU,iCAAiC,CAAC,uBAA+B,EAAE;IACvF,IAAI,CAAC,oBAAoB;QAAE,OAAO,IAAI,CAAA;IAEtC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;QAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAoFT;QACD,SAAS,EAAE;YACT,oBAAoB;SACrB;KACF,CAAC,CAAA;IAEF,IAAI,QAAQ,CAAC,MAAM;QAAE,OAAO,IAAI,CAAA;IAEhC,OAAO,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAA;AACzC,CAAC","sourcesContent":["import { client } from '@operato/graphql'\nimport { gql } from '@apollo/client'\n\nexport async function getBuildingInspectionForChecklist(buildingInspectionId: string = '') {\n if (!buildingInspectionId) return null\n\n const response = await client.query({\n query: gql`\n query BuildingInspection($buildingInspectionId: String!) {\n buildingInspection(id: $buildingInspectionId) {\n id\n status\n requestDate\n memo\n checklist {\n id\n name\n constructionType\n constructionDetailType\n location\n inspectionParts\n documentNo\n inspectionRequestDocumentNo\n inspectionRequestMemo\n inspectionRequestUpdatedAt\n inspectionResultDocumentNo\n inspectionResultStatus\n inspectionResultType\n inspectionResultMemo\n inspectionResultUpdatedAt\n constructionInspectionDate\n supervisorInspectionDate\n overallConstructorSignature\n taskConstructorSignature\n overallSupervisorySignature\n taskSupervisorySignature\n nameListAttachment {\n id\n name\n fullpath\n }\n taskConstructor {\n id\n name\n }\n overallConstructor {\n id\n name\n }\n taskSupervisory {\n id\n name\n }\n overallSupervisory {\n id\n name\n }\n\n checklistItems {\n id\n name\n sequence\n mainType\n detailType\n inspctionCriteria\n constructionConfirmStatus\n supervisoryConfirmStatus\n checklistItemCommentCount\n checklistItemAttachmentCount\n }\n }\n\n buildingLevel {\n id\n floor\n\n building {\n id\n buildingComplex {\n id\n overallConstructorEmails\n taskConstructorEmails\n overallSupervisoryEmails\n taskSupervisoryEmails\n supervisoryCompany\n constructionCompany\n }\n }\n }\n }\n }\n `,\n variables: {\n buildingInspectionId\n }\n })\n\n if (response.errors) return null\n\n return response.data.buildingInspection\n}\n"]}
@@ -5,6 +5,6 @@ export declare class ActionPlanImporter extends LitElement {
5
5
  static styles: import("lit").CSSResult[];
6
6
  private actionPlans;
7
7
  private columns;
8
- render(): import("lit-html").TemplateResult<1>;
8
+ render(): import("lit").TemplateResult<1>;
9
9
  private save;
10
10
  }
@@ -48,7 +48,7 @@ export declare class ActionPlanListPage extends ActionPlanListPage_base {
48
48
  handler: (records: any) => Promise<void>;
49
49
  };
50
50
  };
51
- render(): import("lit-html").TemplateResult<1>;
51
+ render(): import("lit").TemplateResult<1>;
52
52
  pageInitialized(lifecycle: any): Promise<void>;
53
53
  pageUpdated(changes: any, lifecycle: any): Promise<void>;
54
54
  fetchHandler({ page, limit, sortings, filters }: FetchOption): Promise<{
@@ -15,7 +15,7 @@ export declare class BuildingInspectionCamera extends PageView {
15
15
  get context(): {
16
16
  title: string;
17
17
  };
18
- render(): import("lit-html").TemplateResult<1>;
18
+ render(): import("lit").TemplateResult<1>;
19
19
  protected updated(changes: PropertyValues): Promise<void>;
20
20
  pageUpdated(changes: any, lifecycle: PageLifecycle): Promise<void>;
21
21
  initBuildingInspection(buildingInspectionId?: string): Promise<void>;
@@ -4,6 +4,7 @@ import { PageView } from '@operato/shell';
4
4
  import { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view';
5
5
  import './component/building-inspection-detail-header';
6
6
  import './component/inspection-document/inspection-request-document';
7
+ import './component/inspection-document/inspection-result-notification';
7
8
  import '../checklist/checklist-view';
8
9
  export declare class BuildingInspectionDetailChecklist extends PageView {
9
10
  static styles: import("lit").CSSResult[];
@@ -12,7 +13,7 @@ export declare class BuildingInspectionDetailChecklist extends PageView {
12
13
  get context(): {
13
14
  title: string;
14
15
  };
15
- render(): import("lit-html").TemplateResult<1>;
16
+ render(): import("lit").TemplateResult<1>;
16
17
  pageUpdated(changes: any, lifecycle: PageLifecycle): Promise<void>;
17
18
  initBuildingInspection(buildingInspectionId?: string): Promise<void>;
18
19
  private _getProjectByBuildingComplexId;
@@ -21,4 +22,8 @@ export declare class BuildingInspectionDetailChecklist extends PageView {
21
22
  private _showInspectionRequestDocument;
22
23
  private _showInspectionResultNotification;
23
24
  private _onInspectionMemoChange;
25
+ private _onInspectionResultChange;
26
+ private _onInspectionTypeChange;
27
+ private _onInstructionsChange;
28
+ private _uploadNameListFile;
24
29
  }
@@ -13,7 +13,7 @@ import gql from 'graphql-tag';
13
13
  import { verifyBiometric } from '@things-factory/auth-base/dist-client';
14
14
  import './component/building-inspection-detail-header';
15
15
  import './component/inspection-document/inspection-request-document';
16
- // import './component/inspection-document/inspection-result-notification'
16
+ import './component/inspection-document/inspection-result-notification';
17
17
  import '../checklist/checklist-view';
18
18
  import { BuildingInspectionStatus } from './building-inspection-list';
19
19
  import { getBuildingInspectionForChecklist } from '../../graphql/building-inspection';
@@ -47,6 +47,7 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
47
47
  status=${this.buildingInspection.status}
48
48
  .checklist=${this.buildingInspection.checklist || {}}
49
49
  .buildingComplex=${((_l = (_k = (_j = this.buildingInspection) === null || _j === void 0 ? void 0 : _j.buildingLevel) === null || _k === void 0 ? void 0 : _k.building) === null || _l === void 0 ? void 0 : _l.buildingComplex) || {}}
50
+ .projectType=${this.project.projectType}
50
51
  ></checklist-view>
51
52
  `)}
52
53
 
@@ -65,7 +66,6 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
65
66
  if (this.active) {
66
67
  const buildingInspectionId = lifecycle.resourceId || '';
67
68
  await this.initBuildingInspection(buildingInspectionId);
68
- this._showInspectionRequestDocument(this.buildingInspection.checklist);
69
69
  }
70
70
  }
71
71
  async initBuildingInspection(buildingInspectionId = '') {
@@ -80,6 +80,7 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
80
80
  project: projectByBuildingComplexId(buildingComplexId: $buildingComplexId) {
81
81
  id
82
82
  name
83
+ projectType
83
84
  }
84
85
  }
85
86
  `,
@@ -121,6 +122,10 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
121
122
  notify({ message: 'Error during biometric verification:' + error });
122
123
  return;
123
124
  }
125
+ // 실명부 파일 업로드 처리 (새로 업로드된 경우만)
126
+ if (checklist.isNameListAttachmentUploaded) {
127
+ await this._uploadNameListFile(checklist);
128
+ }
124
129
  const response = await client.mutate({
125
130
  mutation: gql `
126
131
  mutation UpdateBuildingInspectionChecklist($buildingInspection: UpdateBuildingInspectionSubmitType!) {
@@ -130,13 +135,16 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
130
135
  variables: {
131
136
  buildingInspection: {
132
137
  id: this.buildingInspection.id,
133
- memo: this.buildingInspection.memo,
134
138
  checklist: {
135
139
  id: checklist.id,
136
140
  overallConstructorSignature: checklist.overallConstructorSignature,
137
141
  taskConstructorSignature: checklist.taskConstructorSignature,
138
142
  overallSupervisorySignature: checklist.overallSupervisorySignature,
139
- taskSupervisorySignature: checklist.taskSupervisorySignature
143
+ taskSupervisorySignature: checklist.taskSupervisorySignature,
144
+ inspectionRequestMemo: checklist.inspectionRequestMemo,
145
+ inspectionResultMemo: checklist.inspectionResultMemo,
146
+ inspectionResultStatus: checklist.inspectionResultStatus,
147
+ inspectionResultType: checklist.inspectionResultType
140
148
  },
141
149
  checklistItem: checklist.checklistItems.map(item => ({
142
150
  id: item.id,
@@ -161,11 +169,16 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
161
169
  <inspection-request-document
162
170
  .checklist=${checklist}
163
171
  .buildingInspection=${this.buildingInspection}
164
- .mode=${InspectionMode.EDIT}
172
+ .mode=${this.buildingInspection.status == BuildingInspectionStatus.PASS ? InspectionMode.VIEW : InspectionMode.EDIT}
165
173
  @inspection-memo-change=${this._onInspectionMemoChange.bind(this)}
174
+ @name-list-file-selected=${(e) => {
175
+ // checklist에 선택된 파일 저장
176
+ checklist.nameListAttachment = e.detail.file;
177
+ checklist.isNameListAttachmentUploaded = true;
178
+ }}
166
179
  @popup-close=${() => resolve()}
167
180
  ></inspection-request-document>
168
- `, { backdrop: true, size: 'large', title: '검측요청서' });
181
+ `, { backdrop: true, size: 'large', title: '검측요청결과 통보내용' });
169
182
  });
170
183
  }
171
184
  async _showInspectionResultNotification(checklist) {
@@ -175,14 +188,78 @@ let BuildingInspectionDetailChecklist = class BuildingInspectionDetailChecklist
175
188
  .checklist=${checklist}
176
189
  .buildingInspection=${this.buildingInspection}
177
190
  .project=${this.project}
191
+ .mode=${this.buildingInspection.status == BuildingInspectionStatus.PASS ? InspectionMode.VIEW : InspectionMode.EDIT}
192
+ @inspection-result-change=${this._onInspectionResultChange.bind(this)}
193
+ @inspection-type-change=${this._onInspectionTypeChange.bind(this)}
194
+ @instructions-change=${this._onInstructionsChange.bind(this)}
178
195
  @popup-close=${() => resolve()}
179
196
  ></inspection-result-notification>
180
- `, { backdrop: true, size: 'large', title: '검측결과 통보' });
197
+ `, { backdrop: true, size: 'large', title: '검측 결과 통보' });
181
198
  });
182
199
  }
183
200
  _onInspectionMemoChange(e) {
184
- const { memo } = e.detail;
185
- this.buildingInspection = Object.assign(Object.assign({}, this.buildingInspection), { memo });
201
+ var _a;
202
+ const { inspectionRequestMemo } = e.detail;
203
+ if ((_a = this.buildingInspection) === null || _a === void 0 ? void 0 : _a.checklist) {
204
+ this.buildingInspection.checklist.inspectionRequestMemo = inspectionRequestMemo;
205
+ }
206
+ this.requestUpdate();
207
+ }
208
+ _onInspectionResultChange(e) {
209
+ var _a;
210
+ const { inspectionResultStatus } = e.detail;
211
+ // checklist 업데이트 (레퍼런스 유지하여 호출부 인자에도 반영)
212
+ if ((_a = this.buildingInspection) === null || _a === void 0 ? void 0 : _a.checklist) {
213
+ this.buildingInspection.checklist.inspectionResultStatus = inspectionResultStatus;
214
+ }
215
+ this.requestUpdate();
216
+ }
217
+ _onInspectionTypeChange(e) {
218
+ var _a;
219
+ const { inspectionResultType } = e.detail;
220
+ // checklist 업데이트 (레퍼런스 유지)
221
+ if ((_a = this.buildingInspection) === null || _a === void 0 ? void 0 : _a.checklist) {
222
+ this.buildingInspection.checklist.inspectionResultType = inspectionResultType;
223
+ }
224
+ this.requestUpdate();
225
+ }
226
+ _onInstructionsChange(e) {
227
+ var _a;
228
+ const { inspectionResultMemo } = e.detail;
229
+ // checklist 업데이트 (레퍼런스 유지)
230
+ if ((_a = this.buildingInspection) === null || _a === void 0 ? void 0 : _a.checklist) {
231
+ this.buildingInspection.checklist.inspectionResultMemo = inspectionResultMemo;
232
+ }
233
+ this.requestUpdate();
234
+ }
235
+ // 실명부 파일 업로드
236
+ async _uploadNameListFile(checklist) {
237
+ var _a;
238
+ if (!checklist.isNameListAttachmentUploaded || !checklist.nameListAttachment) {
239
+ return;
240
+ }
241
+ const response = await client.mutate({
242
+ mutation: gql `
243
+ mutation CreateAttachments($attachments: [NewAttachment!]!) {
244
+ createAttachments(attachments: $attachments) {
245
+ id
246
+ }
247
+ }
248
+ `,
249
+ variables: {
250
+ attachments: [
251
+ {
252
+ file: checklist.nameListAttachment,
253
+ refBy: checklist.id,
254
+ refType: 'Checklist_NameList'
255
+ }
256
+ ]
257
+ },
258
+ context: { hasUpload: true }
259
+ });
260
+ if (response.errors) {
261
+ throw new Error(((_a = response.errors[0]) === null || _a === void 0 ? void 0 : _a.message) || '실명부 파일 업로드에 실패했습니다.');
262
+ }
186
263
  }
187
264
  };
188
265
  BuildingInspectionDetailChecklist.styles = [
@@ -1 +1 @@
1
- {"version":3,"file":"building-inspection-detail-checklist.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-detail-checklist.ts"],"names":[],"mappings":";AAA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AC,MAAM,CAAA;QACzB,IAAI,CAAC,kBAAkB,mCAClB,IAAI,CAAC,kBAAkB,KAC1B,IAAI,GACL,CAAA;IACH,CAAC;;AAhOM,wCAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiCF;CACF,AArCY,CAqCZ;AAEQ;IAAR,KAAK,EAAE;;kEAAkB;AACjB;IAAR,KAAK,EAAE;;6EAA6B;AAzC1B,iCAAiC;IAD7C,aAAa,CAAC,sCAAsC,CAAC;GACzC,iCAAiC,CAkO7C","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist'\n\nimport { CommonGristStyles, CommonButtonStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, state } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\nimport { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'\nimport { client } from '@operato/graphql'\nimport { notify, openPopup } from '@operato/layout'\nimport { store } from '@operato/shell'\nimport gql from 'graphql-tag'\n\nimport { verifyBiometric } from '@things-factory/auth-base/dist-client'\n\nimport './component/building-inspection-detail-header'\nimport './component/inspection-document/inspection-request-document'\n// import './component/inspection-document/inspection-result-notification'\nimport '../checklist/checklist-view'\nimport { ChecklistMode } from '../checklist/checklist-view'\nimport { BuildingInspectionStatus } from './building-inspection-list'\nimport { getBuildingInspectionForChecklist } from '../../graphql/building-inspection'\nimport { InspectionMode } from './component/inspection-document/inspection-request-document'\n\n@customElement('building-inspection-detail-checklist')\nexport class BuildingInspectionDetailChecklist extends PageView {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: 55px auto;\n color: #4e5055;\n\n width: 100%;\n background-color: var(--md-sys-color-background, #f6f6f6);\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n *[bold] {\n font-weight: bold;\n }\n\n div[body] {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n\n div[button-container] {\n display: flex;\n justify-content: flex-end;\n width: 100%;\n gap: 10px;\n margin-right: 50px;\n margin-bottom: 15px;\n }\n }\n `\n ]\n\n @state() project: any = {}\n @state() buildingInspection: any = {}\n\n get context() {\n return {\n title: '검측 관리 상세 - 검측 체크리스트'\n }\n }\n\n render() {\n return html`\n <building-inspection-detail-header\n .buildingInspectionId=${this.buildingInspection?.id}\n .buildingLevelId=${this.buildingInspection?.buildingLevel?.id}\n .projectName=${this.project.name}\n .buildingName=${this.buildingInspection?.buildingLevel?.building?.name}\n .buildingLevelFloor=${this.buildingInspection?.buildingLevel?.floor}\n ></building-inspection-detail-header>\n\n <div body>\n ${keyed(\n new Date(),\n html`\n <checklist-view\n .mode=${ChecklistMode.EDITOR}\n status=${this.buildingInspection.status}\n .checklist=${this.buildingInspection.checklist || {}}\n .buildingComplex=${this.buildingInspection?.buildingLevel?.building?.buildingComplex || {}}\n ></checklist-view>\n `\n )}\n\n <div button-container>\n <md-elevated-button\n ?disabled=${this.buildingInspection.status == BuildingInspectionStatus.PASS}\n @click=${this._onClickModifyChecklist}\n >\n <md-icon slot=\"icon\">assignment</md-icon>등록\n </md-elevated-button>\n </div>\n </div>\n `\n }\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n const buildingInspectionId = lifecycle.resourceId || ''\n await this.initBuildingInspection(buildingInspectionId)\n\n this._showInspectionRequestDocument(this.buildingInspection.checklist)\n }\n }\n\n async initBuildingInspection(buildingInspectionId: string = '') {\n this.buildingInspection = await getBuildingInspectionForChecklist(buildingInspectionId)\n\n await this._getProjectByBuildingComplexId(this.buildingInspection?.buildingLevel?.building?.buildingComplex?.id)\n }\n\n private async _getProjectByBuildingComplexId(buildingComplexId) {\n const response = await client.query({\n query: gql`\n query ProjectByBuildingComplexId($buildingComplexId: String!) {\n project: projectByBuildingComplexId(buildingComplexId: $buildingComplexId) {\n id\n name\n }\n }\n `,\n variables: {\n buildingComplexId\n }\n })\n\n if (response.errors) return\n\n this.project = response.data.project\n }\n\n private _onClickModifyChecklist() {\n this.validateChecklist(this.buildingInspection.checklist)\n }\n\n private async validateChecklist(checklist: any) {\n // 사용자 권한 체크\n const email = (store.getState() as any).auth?.user?.email\n const isOverallConstructor =\n this.buildingInspection?.buildingLevel?.building?.buildingComplex?.overallConstructorEmails?.includes(email) || false\n const isOverallSupervisory =\n this.buildingInspection?.buildingLevel?.building?.buildingComplex?.overallSupervisoryEmails?.includes(email) || false\n\n // 권한에 따라 적절한 문서 표시\n if (this.buildingInspection.status == BuildingInspectionStatus.OVERALL_WAIT && isOverallConstructor) {\n await this._showInspectionRequestDocument(checklist)\n } else if (this.buildingInspection.status == BuildingInspectionStatus.OVERALL_REQUEST && isOverallSupervisory) {\n await this._showInspectionResultNotification(checklist)\n }\n\n try {\n const result = await verifyBiometric()\n if (result.verified) {\n console.log('Verification successful. Proceeding with sensitive action.')\n } else {\n notify({ message: 'Verification failed:' + result.message })\n return\n }\n } catch (error) {\n notify({ message: 'Error during biometric verification:' + error })\n return\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation UpdateBuildingInspectionChecklist($buildingInspection: UpdateBuildingInspectionSubmitType!) {\n updateBuildingInspectionChecklist(buildingInspection: $buildingInspection)\n }\n `,\n variables: {\n buildingInspection: {\n id: this.buildingInspection.id,\n memo: this.buildingInspection.memo,\n checklist: {\n id: checklist.id,\n overallConstructorSignature: checklist.overallConstructorSignature,\n taskConstructorSignature: checklist.taskConstructorSignature,\n overallSupervisorySignature: checklist.overallSupervisorySignature,\n taskSupervisorySignature: checklist.taskSupervisorySignature\n },\n checklistItem: checklist.checklistItems.map(item => ({\n id: item.id,\n constructionConfirmStatus: item.constructionConfirmStatus,\n supervisoryConfirmStatus: item.supervisoryConfirmStatus\n }))\n }\n }\n })\n\n if (!response.errors) {\n notify({ message: '검측 요청서를 등록하였습니다.' })\n this.initBuildingInspection(this.buildingInspection.id)\n } else {\n notify({ message: response.errors?.[0]?.message || '검측 요청서 등록에 실패하였습니다.', level: 'error' })\n }\n }\n\n // resolve 호출 전까지 싱크를 위해 Promise 사용\n private async _showInspectionRequestDocument(checklist: any): Promise<void> {\n return new Promise(resolve => {\n openPopup(\n html`\n <inspection-request-document\n .checklist=${checklist}\n .buildingInspection=${this.buildingInspection}\n .mode=${InspectionMode.EDIT}\n @inspection-memo-change=${this._onInspectionMemoChange.bind(this)}\n @popup-close=${() => resolve()}\n ></inspection-request-document>\n `,\n { backdrop: true, size: 'large', title: '검측요청서' }\n )\n })\n }\n\n private async _showInspectionResultNotification(checklist: any): Promise<void> {\n return new Promise(resolve => {\n openPopup(\n html`\n <inspection-result-notification\n .checklist=${checklist}\n .buildingInspection=${this.buildingInspection}\n .project=${this.project}\n @popup-close=${() => resolve()}\n ></inspection-result-notification>\n `,\n { backdrop: true, size: 'large', title: '검측결과 통보' }\n )\n })\n }\n\n private _onInspectionMemoChange(e: CustomEvent) {\n const { memo } = e.detail\n this.buildingInspection = {\n ...this.buildingInspection,\n memo\n }\n }\n}\n"]}
1
+ {"version":3,"file":"building-inspection-detail-checklist.js","sourceRoot":"","sources":["../../../client/pages/building-inspection/building-inspection-detail-checklist.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,iBAAiB,EAAsB,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,MAAM,EA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C,CA6S7C","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist'\n\nimport { CommonGristStyles, CommonButtonStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, state } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\nimport { PageLifecycle } from '@operato/shell/dist/src/app/pages/page-view'\nimport { client } from '@operato/graphql'\nimport { notify, openPopup } from '@operato/layout'\nimport { store } from '@operato/shell'\nimport gql from 'graphql-tag'\n\nimport { verifyBiometric } from '@things-factory/auth-base/dist-client'\n\nimport './component/building-inspection-detail-header'\nimport './component/inspection-document/inspection-request-document'\nimport './component/inspection-document/inspection-result-notification'\nimport '../checklist/checklist-view'\nimport { ChecklistMode } from '../checklist/checklist-view'\nimport { BuildingInspectionStatus } from './building-inspection-list'\nimport { getBuildingInspectionForChecklist } from '../../graphql/building-inspection'\nimport { InspectionMode } from './component/inspection-document/inspection-request-document'\n\n@customElement('building-inspection-detail-checklist')\nexport class BuildingInspectionDetailChecklist extends PageView {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: grid;\n grid-template-rows: 55px auto;\n color: #4e5055;\n\n width: 100%;\n background-color: var(--md-sys-color-background, #f6f6f6);\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n *[bold] {\n font-weight: bold;\n }\n\n div[body] {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n\n div[button-container] {\n display: flex;\n justify-content: flex-end;\n width: 100%;\n gap: 10px;\n margin-right: 50px;\n margin-bottom: 15px;\n }\n }\n `\n ]\n\n @state() project: any = {}\n @state() buildingInspection: any = {}\n\n get context() {\n return {\n title: '검측 관리 상세 - 검측 체크리스트'\n }\n }\n\n render() {\n return html`\n <building-inspection-detail-header\n .buildingInspectionId=${this.buildingInspection?.id}\n .buildingLevelId=${this.buildingInspection?.buildingLevel?.id}\n .projectName=${this.project.name}\n .buildingName=${this.buildingInspection?.buildingLevel?.building?.name}\n .buildingLevelFloor=${this.buildingInspection?.buildingLevel?.floor}\n ></building-inspection-detail-header>\n\n <div body>\n ${keyed(\n new Date(),\n html`\n <checklist-view\n .mode=${ChecklistMode.EDITOR}\n status=${this.buildingInspection.status}\n .checklist=${this.buildingInspection.checklist || {}}\n .buildingComplex=${this.buildingInspection?.buildingLevel?.building?.buildingComplex || {}}\n .projectType=${this.project.projectType}\n ></checklist-view>\n `\n )}\n\n <div button-container>\n <md-elevated-button\n ?disabled=${this.buildingInspection.status == BuildingInspectionStatus.PASS}\n @click=${this._onClickModifyChecklist}\n >\n <md-icon slot=\"icon\">assignment</md-icon>등록\n </md-elevated-button>\n </div>\n </div>\n `\n }\n\n async pageUpdated(changes: any, lifecycle: PageLifecycle) {\n if (this.active) {\n const buildingInspectionId = lifecycle.resourceId || ''\n await this.initBuildingInspection(buildingInspectionId)\n }\n }\n\n async initBuildingInspection(buildingInspectionId: string = '') {\n this.buildingInspection = await getBuildingInspectionForChecklist(buildingInspectionId)\n\n await this._getProjectByBuildingComplexId(this.buildingInspection?.buildingLevel?.building?.buildingComplex?.id)\n }\n\n private async _getProjectByBuildingComplexId(buildingComplexId) {\n const response = await client.query({\n query: gql`\n query ProjectByBuildingComplexId($buildingComplexId: String!) {\n project: projectByBuildingComplexId(buildingComplexId: $buildingComplexId) {\n id\n name\n projectType\n }\n }\n `,\n variables: {\n buildingComplexId\n }\n })\n\n if (response.errors) return\n\n this.project = response.data.project\n }\n\n private _onClickModifyChecklist() {\n this.validateChecklist(this.buildingInspection.checklist)\n }\n\n private async validateChecklist(checklist: any) {\n // 사용자 권한 체크\n const email = (store.getState() as any).auth?.user?.email\n const isOverallConstructor =\n this.buildingInspection?.buildingLevel?.building?.buildingComplex?.overallConstructorEmails?.includes(email) || false\n const isOverallSupervisory =\n this.buildingInspection?.buildingLevel?.building?.buildingComplex?.overallSupervisoryEmails?.includes(email) || false\n\n // 권한에 따라 적절한 문서 표시\n if (this.buildingInspection.status == BuildingInspectionStatus.OVERALL_WAIT && isOverallConstructor) {\n await this._showInspectionRequestDocument(checklist)\n } else if (this.buildingInspection.status == BuildingInspectionStatus.OVERALL_REQUEST && isOverallSupervisory) {\n await this._showInspectionResultNotification(checklist)\n }\n\n try {\n const result = await verifyBiometric()\n if (result.verified) {\n console.log('Verification successful. Proceeding with sensitive action.')\n } else {\n notify({ message: 'Verification failed:' + result.message })\n return\n }\n } catch (error) {\n notify({ message: 'Error during biometric verification:' + error })\n return\n }\n\n // 실명부 파일 업로드 처리 (새로 업로드된 경우만)\n if (checklist.isNameListAttachmentUploaded) {\n await this._uploadNameListFile(checklist)\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation UpdateBuildingInspectionChecklist($buildingInspection: UpdateBuildingInspectionSubmitType!) {\n updateBuildingInspectionChecklist(buildingInspection: $buildingInspection)\n }\n `,\n variables: {\n buildingInspection: {\n id: this.buildingInspection.id,\n checklist: {\n id: checklist.id,\n overallConstructorSignature: checklist.overallConstructorSignature,\n taskConstructorSignature: checklist.taskConstructorSignature,\n overallSupervisorySignature: checklist.overallSupervisorySignature,\n taskSupervisorySignature: checklist.taskSupervisorySignature,\n inspectionRequestMemo: checklist.inspectionRequestMemo,\n inspectionResultMemo: checklist.inspectionResultMemo,\n inspectionResultStatus: checklist.inspectionResultStatus,\n inspectionResultType: checklist.inspectionResultType\n },\n checklistItem: checklist.checklistItems.map(item => ({\n id: item.id,\n constructionConfirmStatus: item.constructionConfirmStatus,\n supervisoryConfirmStatus: item.supervisoryConfirmStatus\n }))\n }\n }\n })\n\n if (!response.errors) {\n notify({ message: '검측 요청서를 등록하였습니다.' })\n this.initBuildingInspection(this.buildingInspection.id)\n } else {\n notify({ message: response.errors?.[0]?.message || '검측 요청서 등록에 실패하였습니다.', level: 'error' })\n }\n }\n\n // resolve 호출 전까지 싱크를 위해 Promise 사용\n private async _showInspectionRequestDocument(checklist: any): Promise<void> {\n return new Promise(resolve => {\n openPopup(\n html`\n <inspection-request-document\n .checklist=${checklist}\n .buildingInspection=${this.buildingInspection}\n .mode=${this.buildingInspection.status == BuildingInspectionStatus.PASS ? InspectionMode.VIEW : InspectionMode.EDIT}\n @inspection-memo-change=${this._onInspectionMemoChange.bind(this)}\n @name-list-file-selected=${(e: CustomEvent) => {\n // checklist에 선택된 파일 저장\n checklist.nameListAttachment = e.detail.file\n checklist.isNameListAttachmentUploaded = true\n }}\n @popup-close=${() => resolve()}\n ></inspection-request-document>\n `,\n { backdrop: true, size: 'large', title: '검측요청결과 통보내용' }\n )\n })\n }\n\n private async _showInspectionResultNotification(checklist: any): Promise<void> {\n return new Promise(resolve => {\n openPopup(\n html`\n <inspection-result-notification\n .checklist=${checklist}\n .buildingInspection=${this.buildingInspection}\n .project=${this.project}\n .mode=${this.buildingInspection.status == BuildingInspectionStatus.PASS ? InspectionMode.VIEW : InspectionMode.EDIT}\n @inspection-result-change=${this._onInspectionResultChange.bind(this)}\n @inspection-type-change=${this._onInspectionTypeChange.bind(this)}\n @instructions-change=${this._onInstructionsChange.bind(this)}\n @popup-close=${() => resolve()}\n ></inspection-result-notification>\n `,\n { backdrop: true, size: 'large', title: '검측 결과 통보' }\n )\n })\n }\n\n private _onInspectionMemoChange(e: CustomEvent) {\n const { inspectionRequestMemo } = e.detail\n if (this.buildingInspection?.checklist) {\n this.buildingInspection.checklist.inspectionRequestMemo = inspectionRequestMemo\n }\n this.requestUpdate()\n }\n\n private _onInspectionResultChange(e: CustomEvent) {\n const { inspectionResultStatus } = e.detail\n // checklist 업데이트 (레퍼런스 유지하여 호출부 인자에도 반영)\n if (this.buildingInspection?.checklist) {\n this.buildingInspection.checklist.inspectionResultStatus = inspectionResultStatus\n }\n this.requestUpdate()\n }\n\n private _onInspectionTypeChange(e: CustomEvent) {\n const { inspectionResultType } = e.detail\n // checklist 업데이트 (레퍼런스 유지)\n if (this.buildingInspection?.checklist) {\n this.buildingInspection.checklist.inspectionResultType = inspectionResultType\n }\n this.requestUpdate()\n }\n\n private _onInstructionsChange(e: CustomEvent) {\n const { inspectionResultMemo } = e.detail\n // checklist 업데이트 (레퍼런스 유지)\n if (this.buildingInspection?.checklist) {\n this.buildingInspection.checklist.inspectionResultMemo = inspectionResultMemo\n }\n this.requestUpdate()\n }\n\n // 실명부 파일 업로드\n private async _uploadNameListFile(checklist: any) {\n if (!checklist.isNameListAttachmentUploaded || !checklist.nameListAttachment) {\n return\n }\n\n const response = await client.mutate({\n mutation: gql`\n mutation CreateAttachments($attachments: [NewAttachment!]!) {\n createAttachments(attachments: $attachments) {\n id\n }\n }\n `,\n variables: {\n attachments: [\n {\n file: checklist.nameListAttachment,\n refBy: checklist.id,\n refType: 'Checklist_NameList'\n }\n ]\n },\n context: { hasUpload: true }\n })\n\n if (response.errors) {\n throw new Error(response.errors[0]?.message || '실명부 파일 업로드에 실패했습니다.')\n }\n }\n}\n"]}
@@ -25,7 +25,7 @@ export declare class BuildingInspectionDetailDrawing extends BuildingInspectionD
25
25
  title: string;
26
26
  };
27
27
  connectedCallback(): void;
28
- render(): import("lit-html").TemplateResult<1>;
28
+ render(): import("lit").TemplateResult<1>;
29
29
  protected updated(changes: PropertyValues): Promise<void>;
30
30
  pageUpdated(changes: any, lifecycle: PageLifecycle): Promise<void>;
31
31
  initBuildingInspection(buildingInspectionId?: string): Promise<void>;
@@ -7,6 +7,9 @@ import { FetchOption } from '@operato/data-grist';
7
7
  import './inspection-create-popup';
8
8
  import './component/inspection-document/photo-album-popup';
9
9
  import './component/inspection-document/inspection-request-document';
10
+ import './component/inspection-document/inspection-result-notification';
11
+ import './component/image-preview-popup';
12
+ import './component/daily-worklog-popup';
10
13
  import '@operato/event-view/ox-event-view.js';
11
14
  import { EventProvider } from '@operato/event-view';
12
15
  export declare enum ChecklistTypeMainType {
@@ -45,6 +48,8 @@ export declare class BuildingInspectionList extends BuildingInspectionList_base
45
48
  drawingImage: string;
46
49
  buildingInspectionSummary: any;
47
50
  calendarData?: EventProvider;
51
+ selectedYearMonth: string;
52
+ selectedDate?: string;
48
53
  private grist;
49
54
  private eventView;
50
55
  get context(): {
@@ -75,5 +80,7 @@ export declare class BuildingInspectionList extends BuildingInspectionList_base
75
80
  private _openChecklistPopup;
76
81
  _openPhotoAlbumPopup(checklistId: string): Promise<void>;
77
82
  _openInspectionRequestDocument(buildingInspectionId: string): Promise<void>;
83
+ private _showNameListPreview;
84
+ private _openDailyWorklogPopup;
78
85
  }
79
86
  export {};
@@ -14,10 +14,14 @@ import { openPopup } from '@operato/layout';
14
14
  import './inspection-create-popup';
15
15
  import './component/inspection-document/photo-album-popup';
16
16
  import './component/inspection-document/inspection-request-document';
17
+ import './component/inspection-document/inspection-result-notification';
18
+ import './component/image-preview-popup';
19
+ import './component/daily-worklog-popup';
17
20
  import '@operato/event-view/ox-event-view.js';
18
21
  import { InspectionEventProvider } from './component/inspection-event-provider';
19
22
  import { getBuildingInspectionForChecklist } from '../../graphql/building-inspection';
20
23
  import { InspectionMode } from './component/inspection-document/inspection-request-document';
24
+ import moment from 'moment-timezone';
21
25
  export var ChecklistTypeMainType;
22
26
  (function (ChecklistTypeMainType) {
23
27
  ChecklistTypeMainType["BASIC"] = "10";
@@ -59,6 +63,8 @@ let BuildingInspectionList = class BuildingInspectionList extends ScopedElements
59
63
  this.building = {};
60
64
  this.drawingImage = '';
61
65
  this.buildingInspectionSummary = {};
66
+ this.selectedYearMonth = moment().tz('Asia/Seoul').format('YYYY-MM');
67
+ this.selectedDate = moment().tz('Asia/Seoul').format('YYYY-MM-DD');
62
68
  }
63
69
  get context() {
64
70
  return {
@@ -122,8 +128,12 @@ let BuildingInspectionList = class BuildingInspectionList extends ScopedElements
122
128
  .mode=${'monthly'}
123
129
  .eventProvider=${this.calendarData}
124
130
  @select-date=${(e) => {
125
- // TODO 선택된 날짜의 검측데이터만 그리드에 보여야함
126
- console.log('select-date', e.detail);
131
+ this.selectedDate = moment(e.detail[0]).format('YYYY-MM-DD');
132
+ }}
133
+ @change-month=${(e) => {
134
+ const { year, month } = e.detail;
135
+ this.selectedYearMonth = moment({ year, month }).tz('Asia/Seoul').format('YYYY-MM');
136
+ this.grist.fetch();
127
137
  }}
128
138
  >
129
139
  </ox-event-view>
@@ -131,6 +141,11 @@ let BuildingInspectionList = class BuildingInspectionList extends ScopedElements
131
141
  </div>
132
142
 
133
143
  <div bottom>
144
+ <div daily-worklog-actions>
145
+ <md-filled-button @click=${this._openDailyWorklogPopup}>
146
+ <md-icon slot="icon">note_add</md-icon>일일 업무일지 작성
147
+ </md-filled-button>
148
+ </div>
134
149
  <ox-grist .mode=${'GRID'} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}> </ox-grist>
135
150
  </div>
136
151
  </div>
@@ -151,6 +166,7 @@ let BuildingInspectionList = class BuildingInspectionList extends ScopedElements
151
166
  projectByBuildingLevelId(buildingLevelId: $buildingLevelId) {
152
167
  id
153
168
  name
169
+ projectType
154
170
  mainPhoto {
155
171
  fullpath
156
172
  }
@@ -302,7 +318,7 @@ let BuildingInspectionList = class BuildingInspectionList extends ScopedElements
302
318
  width: 50,
303
319
  handlers: {
304
320
  click: (columns, data, column, record, rowIndex) => {
305
- console.log('record : ', record);
321
+ this._showNameListPreview(record);
306
322
  }
307
323
  }
308
324
  }
@@ -335,6 +351,11 @@ let BuildingInspectionList = class BuildingInspectionList extends ScopedElements
335
351
  constructionDetailType
336
352
  location
337
353
  inspectionParts
354
+ nameListAttachment {
355
+ id
356
+ name
357
+ fullpath
358
+ }
338
359
  }
339
360
  }
340
361
  total
@@ -360,7 +381,9 @@ let BuildingInspectionList = class BuildingInspectionList extends ScopedElements
360
381
  variables: {
361
382
  params: {
362
383
  buildingLevelId: this.buildingLevelId,
363
- limit: 0
384
+ limit: 0,
385
+ startDate: moment(this.selectedYearMonth).startOf('month').format('YYYY-MM-DD'),
386
+ endDate: moment(this.selectedYearMonth).endOf('month').format('YYYY-MM-DD')
364
387
  },
365
388
  buildingLevelId: this.buildingLevelId
366
389
  }
@@ -405,11 +428,7 @@ let BuildingInspectionList = class BuildingInspectionList extends ScopedElements
405
428
  .selectedBuildingLevelId=${this.buildingLevelId}
406
429
  @requestRefresh="${() => this.grist.fetch()}"
407
430
  ></inspection-create-popup>
408
- `, {
409
- backdrop: true,
410
- size: 'large',
411
- title: '검측 요청서 등록'
412
- });
431
+ `, { backdrop: true, size: 'large', title: '검측 등록' });
413
432
  }
414
433
  _formatDate(date) {
415
434
  return date
@@ -431,6 +450,7 @@ let BuildingInspectionList = class BuildingInspectionList extends ScopedElements
431
450
  .checklist=${buildingInspection === null || buildingInspection === void 0 ? void 0 : buildingInspection.checklist}
432
451
  .buildingComplex=${((_b = (_a = buildingInspection === null || buildingInspection === void 0 ? void 0 : buildingInspection.buildingLevel) === null || _a === void 0 ? void 0 : _a.building) === null || _b === void 0 ? void 0 : _b.buildingComplex) || {}}
433
452
  .status=${buildingInspection === null || buildingInspection === void 0 ? void 0 : buildingInspection.status}
453
+ .projectType=${this.project.projectType}
434
454
  ></checklist-view>
435
455
  </div>
436
456
  `, { backdrop: true, size: 'large', title: '체크 리스트 미리보기' });
@@ -444,13 +464,54 @@ let BuildingInspectionList = class BuildingInspectionList extends ScopedElements
444
464
  }
445
465
  async _openInspectionRequestDocument(buildingInspectionId) {
446
466
  const buildingInspection = await getBuildingInspectionForChecklist(buildingInspectionId);
467
+ if (!buildingInspection.checklist.inspectionRequestUpdatedAt) {
468
+ notify({ message: '검측 요청서가 없습니다.', level: 'info' });
469
+ return;
470
+ }
447
471
  openPopup(html `
448
- <inspection-request-document
449
- .checklist=${buildingInspection.checklist}
450
- .buildingInspection=${buildingInspection}
451
- .mode=${InspectionMode.VIEW}
452
- ></inspection-request-document>
453
- `, { backdrop: true, size: 'large', title: '검측요청서' });
472
+ <div style="overflow-y: auto;">
473
+ <inspection-request-document
474
+ .checklist=${buildingInspection.checklist}
475
+ .buildingInspection=${buildingInspection}
476
+ .mode=${InspectionMode.VIEW}
477
+ ></inspection-request-document>
478
+
479
+ ${buildingInspection.checklist.inspectionResultUpdatedAt
480
+ ? html `
481
+ <hr />
482
+
483
+ <inspection-result-notification
484
+ .checklist=${buildingInspection.checklist}
485
+ .buildingInspection=${buildingInspection}
486
+ .mode=${InspectionMode.VIEW}
487
+ ></inspection-result-notification>
488
+ `
489
+ : ''}
490
+ </div>
491
+ `, { backdrop: true, size: 'large', title: '검측요청결과 통보내용' });
492
+ }
493
+ // 실명부 미리보기
494
+ _showNameListPreview(record) {
495
+ const nameListAttachment = record.nameListAttachment;
496
+ if (!nameListAttachment) {
497
+ notify({ message: '실명부 파일이 없습니다.', level: 'info' });
498
+ return;
499
+ }
500
+ // 이미지 미리보기 팝업
501
+ openPopup(html `
502
+ <image-preview-popup
503
+ .images=${[{ fullpath: nameListAttachment.fullpath, name: nameListAttachment.name }]}
504
+ .currentIndex=${0}
505
+ ></image-preview-popup>
506
+ `, { backdrop: true, size: 'large', title: '실명부' });
507
+ }
508
+ _openDailyWorklogPopup() {
509
+ const date = this.selectedDate;
510
+ openPopup(html `<daily-worklog-popup .project=${this.project} .date=${date}></daily-worklog-popup>`, {
511
+ backdrop: true,
512
+ size: 'large',
513
+ title: '일일 업무일지 작성'
514
+ });
454
515
  }
455
516
  };
456
517
  BuildingInspectionList.styles = [
@@ -642,6 +703,12 @@ BuildingInspectionList.styles = [
642
703
  flex-direction: column;
643
704
  overflow: hidden;
644
705
  min-height: 300px;
706
+ gap: 0px !important;
707
+ }
708
+
709
+ div[daily-worklog-actions] {
710
+ display: flex;
711
+ justify-content: flex-end;
645
712
  }
646
713
 
647
714
  ox-grist {
@@ -682,6 +749,14 @@ __decorate([
682
749
  state(),
683
750
  __metadata("design:type", Object)
684
751
  ], BuildingInspectionList.prototype, "calendarData", void 0);
752
+ __decorate([
753
+ state(),
754
+ __metadata("design:type", String)
755
+ ], BuildingInspectionList.prototype, "selectedYearMonth", void 0);
756
+ __decorate([
757
+ state(),
758
+ __metadata("design:type", String)
759
+ ], BuildingInspectionList.prototype, "selectedDate", void 0);
685
760
  __decorate([
686
761
  query('ox-grist'),
687
762
  __metadata("design:type", DataGrist)