{
	"name": "form/nc/nc-production/nc-production.json",
	"layout": {
		"component": "nc-form",
		"attribute": {
			"id": "nc-production"
		},
		"element": [
			{
				"component": "nc-row",
				"element": [
					{
						"component": "nc-tab",
						"attribute": {
							"model": "rec.view"
						}
					},
					{
						"component": "nc-row",
						"attribute": {
							"class": ["nc-center-v"]
						},
						"element": [
							{
								"component": "nc-col",
								"attribute": {
									"width": "10em"
								},
								"element": [
									{
										"component": "nc-header",
										"text": "Production",
										"attribute": {
											"size": "medium",
											"hdr": "hdr.production.header"
										}
									}
								]
							},
							{
								"component": "nc-col",
								"attribute": {
									"width": "auto"
								},
								"element": [
									{
										"component": "nc-col",
										"attribute": {
											"width": "auto",
											"class": ["nc-space-evenly"],
											"v-if": "rec.view === 'product-need'"
										},
										"element": [
											{
												"component": "nc-checkbox",
												"text": "Create schedule",
												"attribute": {
													"model": "rec.create_schedule",
													"hdr": "hdr.production.create_schedule",
													"v-on:click": "update('update', true)"
												}
											},
											{
												"component": "nc-checkbox",
												"text": "Virtual production order",
												"attribute": {
													"model": "rec.virtual_production_order",
													"hdr": "hdr.production.virtual_production_order",
													"v-on:click": "update('update')"
												}
											},
											{
												"component": "nc-checkbox",
												"text": "Estimate order",
												"attribute": {
													"model": "rec.estimate_order",
													"hdr": "hdr.production.estimate_order",
													"v-on:click": "update('update', true)"
												}
											},
											{
												"component": "nc-checkbox",
												"text": "Old work date",
												"attribute": {
													"model": "rec.old_work_date",
													"hdr": "hdr.old_work_date",
													"v-on:click": "update('update', true)"
												}
											},
											{
												"component": "nc-checkbox",
												"text": "Minimum stock",
												"attribute": {
													"model": "rec.minimum_stock",
													"hdr": "hdr.production.minimum_stock",
													"v-on:click": "update('update', true)"
												}
											},
											{
												"component": "nc-checkbox",
												"text": "Action limit",
												"attribute": {
													"model": "rec.action_limit",
													"hdr": "hdr.production.action_limit",
													"v-on:click": "update('update', true)"
												}
											},
											{
												"component": "nc-checkbox",
												"text": "Negative start balance",
												"attribute": {
													"model": "rec.negative_start_balance",
													"hdr": "hdr.production.negative_start_balance",
													"v-on:click": "update('update', true)"
												}
											},
											{
												"component": "nc-checkbox",
												"text": "Negative end balance",
												"attribute": {
													"model": "rec.negative_end_balance",
													"hdr": "hdr.production.negative_end_balance",
													"v-on:click": "update('update', true)"
												}
											},
											{
												"component": "nc-checkbox",
												"text": "Critical date",
												"attribute": {
													"model": "rec.critical_date",
													"hdr": "hdr.production.critical_date",
													"v-on:click": "update('update', true)"
												}
											},
											{
												"component": "nc-checkbox",
												"text": "Sales need",
												"attribute": {
													"v-if": "false",
													"model": "rec.only_sales_need",
													"hdr": "hdr.production.only_sales_need",
													"v-on:click": "update('update', true)"
												}
											},
											{
												"component": "nc-checkbox",
												"text": "Reload data",
												"attribute": {
													"model": "rec.reload_data",
													"hdr": "hdr.production.reload_data"
												}
											}
										]
									}
								]
							},
							{
								"component": "nc-col",
								"attribute": {
									"class": ["nc-end-h"],
									"width": "1/12"
								},
								"element": [
									{
										"component": "nc-button",
										"attribute": {
											"model": "hdr.productivity_report.update",
											"primary": "primary",
											"v-on:click": "update('update', true)"
										},
										"element": [
											{
												"component": "nc-icon",
												"attribute": {
													"icon": ["sync"]
												}
											},
											{
												"component": "nc-translate",
												"text": "Update",
												"attribute": {
													"model": "hdr.productivity_report.update"
												}
											}
										]
									}
								]
							}
						]
					},
					{
						"component": "nc-row",
						"attribute": {
							"v-if": "1===0"
						},
						"element": [
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-col",
										"attribute": {
											"width": "2/12"
										},
										"element": [
											{
												"component": "nc-label",
												"text": "Time period",
												"attribute": {
													"model": "hdr.production.time_period"
												}
											}
										]
									},
									{
										"component": "nc-col",
										"attribute": {
											"class": ["nc-padding-right"],
											"width": "2/12"
										},
										"element": [
											{
												"component": "nc-input",
												"attribute": {
													"id": "start_date",
													"end-calendar": "rec.end_date",
													"model": "rec.start_date",
													"no-live-update": "no-live-update",
													"v-on:click": "update('start_date')"
												}
											}
										]
									},
									{
										"component": "nc-col",
										"attribute": {
											"class": ["nc-padding-right"],
											"width": "2/12"
										},
										"element": [
											{
												"component": "nc-input",
												"attribute": {
													"id": "end_date",
													"model": "rec.end_date",
													"no-live-update": "no-live-update",
													"start-calendar": "rec.start_date",
													"v-on:click": "update('end_date')"
												}
											}
										]
									}
								]
							},
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-col",
										"attribute": {
											"width": "2/12"
										},
										"element": [
											{
												"component": "nc-label",
												"text": "Foreman",
												"attribute": {
													"model": "hdr.production.foreman"
												}
											}
										]
									},
									{
										"component": "nc-col",
										"attribute": {
											"width": "8/12"
										},
										"element": [
											{
												"component": "nc-dropdown",
												"attribute": {
													"model": "rec.foreman",
													"multi": "multi",
													"search": "search",
													"v-on:change": "update('foreman')"
												}
											}
										]
									}
								]
							},
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-col",
										"attribute": {
											"width": "2/12"
										},
										"element": [
											{
												"component": "nc-label",
												"text": "Resource",
												"attribute": {
													"model": "hdr.production.resource"
												}
											}
										]
									},
									{
										"component": "nc-col",
										"attribute": {
											"width": "8/12"
										},
										"element": [
											{
												"component": "nc-dropdown",
												"attribute": {
													"model": "rec.resource",
													"multi": "multi",
													"search": "search",
													"v-on:change": "update('resource')"
												}
											}
										]
									}
								]
							},
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-col",
										"attribute": {
											"width": "2/12"
										},
										"element": [
											{
												"component": "nc-label",
												"text": "Employee",
												"attribute": {
													"model": "hdr.production.person"
												}
											}
										]
									},
									{
										"component": "nc-col",
										"attribute": {
											"width": "8/12"
										},
										"element": [
											{
												"component": "nc-dropdown",
												"attribute": {
													"model": "rec.person",
													"multi": "multi",
													"search": "search",
													"v-on:change": "update('person')"
												}
											}
										]
									},
									{
										"component": "nc-col",
										"attribute": {
											"class": ["nc-end-h"],
											"width": "2/12"
										},
										"element": [
											{
												"component": "nc-button",
												"attribute": {
													"model": "hdr.productivity_report.update",
													"primary": "primary",
													"v-on:click": "update('update')"
												},
												"element": [
													{
														"component": "nc-icon",
														"attribute": {
															"icon": ["sync"]
														}
													},
													{
														"component": "nc-translate",
														"text": "Update",
														"attribute": {
															"model": "hdr.productivity_report.update"
														}
													}
												]
											}
										]
									}
								]
							},
							{
								"component": "nc-row",
								"attribute": {
									"class": ["nc-padding-top"]
								},
								"element": [
									{
										"component": "hr",
										"attribute": {
											"class": ["small"]
										}
									}
								]
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"attribute": {
					"v-if": "rec.view === 'product-need'"
				},
				"element": [
					{
						"component": "nc-row",
						"attribute": {
							"class": ["nc-margin-top"]
						},
						"element": [{ "component": "nc-line" }]
					},
					{
						"component": "nc-row",
						"element": [
							{
								"component": "nc-tab",
								"attribute": {
									"model": "rec.chart_type",
									"v-on:change": "updateChart"
								}
							}
						]
					},
					{
						"component": "nc-row",
						"element": [
							{
								"component": "nc-col",
								"attribute": {
									"width": "auto",
									"height": "13em",
									"class": ["nc-align-top"]
								},
								"element": [
									{
										"component": "nc-rect",
										"attribute": {
											"class": ["nc-margin-top"],
											"style": ["margin: 1px"]
										},
										"element": [
											{
												"component": "nc-chart",
												"attribute": {
													"v-if": "rec.chart_type !== 'work_phase'",
													":init-options": "chartInitOption",
													":options": "chartOption"
												}
											},
											{
												"component": "nc-gantt-chart",
												"attribute": {
													"v-else": "",
													"class": ["nc-chart"],
													":data": "ganttData"
												}
											}
										]
									}
								]
							},
							{
								"component": "nc-col",
								"attribute": {
									"width": "20%",
									"height": "13em",
									"class": ["nc-align-top", "nc-svg-map"]
								},
								"element": [
									{
										"component": "nc-rect",
										"attribute": {
											"class": ["nc-margin-top", "nc-svg-map"],
											"style": ["margin: 1px;"]
										},
										"element": [
											{
												"component": "nc-svg-map",
												"attribute": {
													"style": "height: 14em; margin-top: -2em;",
													":highlight": "mapSelected",
													"svg": "img/storage-map.svg",
													"v-model:hover": "mapHover",
													"v-on:click": "mapToggleSelected($event)",
													"v-on:dblclick": "mapDoubleClick($event)"
												}
											}
										]
									}
								]
							}
						]
					},
					{
						"component": "nc-row",
						"attribute": {
							"class": ["nc-center-v", "nc-margin-top"]
						},
						"element": [
							{
								"component": "nc-col",
								"attribute": {
									"class": ["nc-margin-right", "nc-margin-top"],
									"width": "2em"
								},
								"element": [
									{
										"component": "nc-button",
										"attribute": {
											"id": "clear_find",
											"size": "tiny",
											"v-on:click": "clickButton('clear_find')"
										},
										"element": [
											{
												"component": "nc-icon",
												"attribute": {
													"icon": "backspace"
												}
											}
										]
									}
								]
							},
							{
								"component": "nc-col",
								"attribute": {
									"class": ["nc-margin-right", "nc-margin-top"],
									"width": "auto"
								},
								"element": [
									{
										"component": "nc-label-input",
										"text": "Find",
										"attribute": {
											":horizontal": "true",
											"hdr": "hdr.production.find_text",
											"model": "rec.find_text",
											"v-on:change": "checkBoxClicked",
											":clean": "false"
										}
									}
								]
							},
							{
								"component": "nc-col",
								"attribute": {
									"class": ["nc-end-h", "nc-margin-top"]
								},
								"element": [
									{
										"component": "nc-button",
										"attribute": {
											":disabled": "!rec.allow_save",
											"v-on:click": "clickButton('add_order')"
										},
										"element": [
											{
												"component": "nc-icon",
												"attribute": {
													"icon": "plus"
												}
											},
											{
												"component": "nc-translate",
												"text": "Add order",
												"attribute": {
													"model": "hdr.production.add_order"
												}
											}
										]
									}
								]
							}
						]
					},
					{
						"component": "nc-row",
						"attribute": {
							"class-": ["nc-margin-top"]
						},
						"element": [
							{
								"component": "nc-col",
								"attribute": {
									"class": ["nc-margin-right"],
									"width-": "10.86em"
								},
								"element": [
									{
										"component": "nc-tab",
										"attribute": {
											"model": "rec.need_view",
											"v-on:change": "needViewChanged"
										}
									}
								]
							},
							{
								"component": "nc-col",
								"attribute": {
									"class": ["nc-center-v", "nc-space-evenly"],
									"width": "auto"
								},
								"element": [
									{
										"component": "nc-checkbox",
										"text": "Hide empty",
										"attribute": {
											"model": "rec.hide_empty",
											"hdr": "hdr.production.hide_empty",
											"v-on:click": "checkBoxClicked"
										}
									},
									{
										"component": "nc-checkbox",
										"attribute": {
											"model": "rec.only_need",
											"hdr": "hdr.production.only_need",
											"v-on:click": "checkBoxClicked"
										}
									},
									{
										"component": "nc-checkbox",
										"text": "Has error",
										"attribute": {
											"model": "rec.has_error",
											"hdr": "hdr.production.has_error",
											"v-on:click": "checkBoxClicked"
										}
									},

									{
										"component": "nc-col",
										"attribute": {
											"width": "4em"
										},
										"element": [
											{
												"component": "nc-input",
												"attribute": {
													"disabled": "disabled",
													"input-style": "text-align: center;",
													"model": "rec.error_count"
												}
											}
										]
									},
									{
										"component": "nc-checkbox",
										"text": "Chart current",
										"attribute": {
											"model": "rec.chart_current",
											"hdr": "hdr.production.chart_current",
											"v-on:click": "updateLower"
										}
									},
									{
										"component": "nc-checkbox",
										"text": "Select upper",
										"attribute": {
											"model": "rec.select_upper",
											"hdr": "hdr.production.select_upper",
											"v-on:click": "updateLower"
										}
									},
									{
										"component": "nc-checkbox",
										"text": "Select lower",
										"attribute": {
											"model": "rec.select_lower",
											"hdr": "hdr.production.select_lower",
											"v-on:click": "updateLower"
										}
									}
								]
							}
						]
					},
					{
						"component": "nc-row",
						"attribute": {
							"class": ["nc-margin-top"],
							"v-if": "rec.weekly_need"
						},
						"element": [
							{
								"component": "nc-grid",
								"attribute": {
									"id": "product_need_weekly",
									":doesExternalFilterPass": "doesExternalFilterPass",
									":isExternalFilterPresent": "() => true",
									"model": "grid.product_need_weekly",
									"style": ["width: 100%", "height: calc(100vh - 37em)"],
									"v-on:grid-row-clicked": "gridRowClicked",
									"v-on:grid-row-double-clicked": "gridRowDoubleClicked"
								}
							}
						]
					},
					{
						"component": "nc-row",
						"attribute": {
							"class": ["nc-margin-top"],
							"v-else": ""
						},
						"element": [
							{
								"component": "nc-grid",
								"attribute": {
									"id": "product_need",
									":doesExternalFilterPass": "doesExternalFilterPass",
									":isExternalFilterPresent": "() => true",
									"model": "grid.product_need",
									"style": ["width: 100%", "height: calc(100vh - 37em)"],
									"v-on:grid-row-clicked": "gridRowClicked",
									"v-on:grid-row-double-clicked": "gridRowDoubleClicked"
								}
							}
						]
					}
				]
			},
			{
				"component": "nc-row",
				"attribute": {
					"v-if": "rec.view !== 'product-need'"
				},
				"element": [
					{
						"component": "nc-col",
						"attribute": {
							"class": ["nc-end-h"],
							"v-if": "1===0"
						},
						"element": [
							{
								"component": "nc-button",
								"attribute": {
									"v-on:click": "save()"
								},
								"element": [
									{
										"component": "i",
										"attribute": {
											"class": ["far", "fa-check"]
										}
									},
									{
										"component": "nc-translate",
										"text": "Save",
										"attribute": {
											"model": "hdr.global.save"
										}
									}
								]
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"v-if": "rec.view === 'planned'",
							"width": "1/1"
						},
						"element": [
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-header",
										"attribute": {
											"size": "small"
										},
										"element": [
											{
												"component": "nc-translate",
												"text": "Planned capacity",
												"attribute": {
													"model": "hdr.production.planned_capacity"
												}
											}
										]
									}
								]
							},
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-grid",
										"attribute": {
											"id": "planned_capacity",
											"model": "grid.planned_capacity",
											"style": ["width: 100%", "height: calc(90vh - 12em)"]
										}
									}
								]
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"v-if": "rec.view === 'actual' || rec.view === 'checked'",
							"width": "1/1"
						},
						"element": [
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-header",
										"attribute": {
											"size": "small"
										},
										"element": [
											{
												"component": "nc-translate",
												"text": "Shift",
												"attribute": {
													"model": "hdr.production.shift"
												}
											}
										]
									}
								]
							},
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-grid",
										"attribute": {
											"id": "person_shift",
											"model": "grid.person_shift",
											"style": ["width: 100%", "height: 10em"]
										}
									}
								]
							},
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-header",
										"attribute": {
											"size": "small"
										},
										"element": [
											{
												"component": "nc-translate",
												"text": "Actual work phase",
												"attribute": {
													"model": "hdr.production.actual_work_phase"
												}
											}
										]
									}
								]
							},
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-grid",
										"attribute": {
											"id": "actual_work_phase",
											"model": "grid.actual_work_phase",
											"style": ["width: 100%", "height: calc(75vh - 25em)"]
										}
									}
								]
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"v-if": "rec.view === 'graph'",
							"width": "1/1"
						},
						"element": [
							{
								"component": "nc-row",
								"attribute": {
									"class": ["nc-padding-top"]
								},
								"element": [
									{
										"component": "nc-col",
										"attribute": {
											"width": "1/1"
										},
										"element": [
											{
												"component": "nc-header",
												"attribute": {
													"size": "small"
												},
												"element": [
													{
														"component": "nc-translate",
														"text": "Graph",
														"attribute": {
															"model": "hdr.production.graph"
														}
													}
												]
											}
										]
									}
								]
							},
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-col",
										"attribute": {
											"height": "calc(100vh - 12em)",
											"width": "1/1"
										},
										"element": [
											{
												"component": "nc-gantt-chart"
											}
										]
									}
								]
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"v-if": "rec.view === 'timecard'",
							"width": "1/1"
						},
						"element": [
							{
								"component": "nc-row",
								"attribute": {
									"class": ["nc-padding-top"]
								},
								"element": [
									{
										"component": "nc-col",
										"attribute": {
											"width": "8/12"
										},
										"element": [
											{
												"component": "nc-header",
												"attribute": {
													"size": "small"
												},
												"element": [
													{
														"component": "nc-translate",
														"text": "Timecard",
														"attribute": {
															"model": "hdr.production.timecard"
														}
													}
												]
											}
										]
									}
								]
							},
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-grid",
										"attribute": {
											"id": "timecard",
											"model": "grid.timecard",
											"style": ["width: 100%", "height: calc(90vh - 12em)"]
										}
									}
								]
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"v-if": "rec.view === 'resource_efficiency'",
							"width": "1/1"
						},
						"element": [
							{
								"component": "nc-row",
								"attribute": {
									"class": ["nc-padding-top"]
								},
								"element": [
									{
										"component": "nc-col",
										"attribute": {
											"width": "8/12"
										},
										"element": [
											{
												"component": "nc-header",
												"attribute": {
													"size": "small"
												},
												"element": [
													{
														"component": "nc-translate",
														"text": "Resource efficiency",
														"attribute": {
															"model": "hdr.production.resource_efficiency"
														}
													}
												]
											}
										]
									}
								]
							},
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-grid",
										"attribute": {
											"id": "resource_efficiency",
											"model": "grid.resource_efficiency",
											"style": ["width: 100%", "height: calc(90vh - 12em)"]
										}
									}
								]
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"v-if": "rec.view === 'capacity'",
							"width": "1/1"
						},
						"element": [
							{
								"component": "nc-row",
								"attribute": {
									"class": ["nc-padding-top"]
								},
								"element": [
									{
										"component": "nc-col",
										"attribute": {
											"width": "8/12"
										},
										"element": [
											{
												"component": "nc-header",
												"attribute": {
													"size": "small"
												},
												"element": [
													{
														"component": "nc-translate",
														"text": "Capacity",
														"attribute": {
															"model": "hdr.production.capacity"
														}
													}
												]
											}
										]
									}
								]
							},
							{
								"component": "nc-row",
								"element": [
									{
										"component": "nc-grid",
										"attribute": {
											"id": "capacity",
											"model": "grid.capacity",
											"style": ["width: 100%", "height: calc(90vh - 12em)"]
										}
									}
								]
							}
						]
					},
					{
						"component": "nc-col",
						"attribute": {
							"v-if": "rec.view === 'shift'",
							"width": "1/1"
						},
						"element": [
							{
								"component": "nc-row",
								"attribute": {
									"class": ["nc-padding-top"]
								},
								"element": [
									{
										"component": "nc-col",
										"attribute": {
											"width": "10/12"
										},
										"element": [
											{
												"component": "nc-header",
												"attribute": {
													"size": "small"
												},
												"element": [
													{
														"component": "nc-translate",
														"text": "Shifts",
														"attribute": {
															"model": "hdr.production.shifts"
														}
													}
												]
											}
										]
									}
								]
							},
							{
								"component": "nc-row",
								"attribute": {
									"class": ["nc-padding-top"]
								},
								"element": [
									{
										"component": "nc-col",
										"attribute": {
											"width": "1/2"
										},
										"element": [
											{
												"component": "nc-textarea",
												"attribute": {
													"type": "text",
													"model": "rec.capacity_json",
													"rows": "24",
													"v-on:change.native": "updateJson('from_text')"
												}
											}
										]
									},
									{
										"component": "nc-col",
										"attribute": {
											"class": ["nc-padding-left"],
											"width": "1/2"
										},
										"element": [
											{
												"component": "div",
												"attribute": {
													"component": "tree-view",
													":data": "rec.capacity",
													":options": "{maxDepth: 1, rootObjectKey: rec.capacity && rec.capacity.name, modifiable: true}",
													"style": ["width: 100%", "height: calc(75vh - 13em)"],
													"v-on:change-data": "updateJsonEditor"
												}
											}
										]
									}
								]
							}
						]
					}
				]
			}
		]
	}
}
