wip: receiving dashboard, customer records, archive old 2-level paths, various fixes
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
<div style="padding:20px;">
|
||||
<h2>Route Planner</h2>
|
||||
<p>Optimize pickup routes for scheduled pickups.</p>
|
||||
</div>
|
||||
@@ -0,0 +1,38 @@
|
||||
frappe.pages["route-planner"].on_page_load = function(wrapper) {
|
||||
var page = frappe.ui.make_app_page({
|
||||
parent: wrapper,
|
||||
title: "Route Planner",
|
||||
single_column: true
|
||||
});
|
||||
|
||||
frappe.call({
|
||||
method: "westech_r2.api.optimize_routes.get_scheduled_pickups",
|
||||
callback: function(r) {
|
||||
if (r.message) {
|
||||
renderRoutePlanner(page, r.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function renderRoutePlanner(page, data) {
|
||||
var h = "<div style='padding:20px;'>";
|
||||
h += "<h2>Route Planner</h2>";
|
||||
h += "<p>Schedule and optimize pickup routes.</p>";
|
||||
h += "<div id='route-map' style='width:100%;height:400px;background:#f0f0f0;margin:20px 0;'></div>";
|
||||
h += "<button class='btn btn-primary' id='optimize-btn'>Optimize Routes</button>";
|
||||
h += "<div id='routes-container' style='margin-top:20px;'></div>";
|
||||
h += "</div>";
|
||||
$(page.body).html(h);
|
||||
|
||||
$("#optimize-btn").on("click", function() {
|
||||
frappe.call({
|
||||
method: "westech_r2.api.optimize_routes.optimize_routes",
|
||||
callback: function(r) {
|
||||
if (r.message) {
|
||||
frappe.show_alert({message: "Routes optimized", indicator: "green"});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"doctype": "Page",
|
||||
"name": "route-planner",
|
||||
"page_name": "route-planner",
|
||||
"title": "Route Planner",
|
||||
"module": "Westech R2",
|
||||
"standard": "Yes",
|
||||
"roles": [
|
||||
{
|
||||
"role": "All"
|
||||
}
|
||||
],
|
||||
"script": "frappe.pages[\"route-planner\"].on_page_load = function(wrapper) {\n var page = frappe.ui.make_app_page({\n parent: wrapper,\n title: \"Route Planner\",\n single_column: true\n });\n \n frappe.call({\n method: \"westech_r2.api.optimize_routes.get_scheduled_pickups\",\n callback: function(r) {\n if (r.message) {\n renderRoutePlanner(page, r.message);\n }\n }\n });\n \n function renderRoutePlanner(page, data) {\n var h = \"<div style='padding:20px;'>\";\n h += \"<h2>Route Planner</h2>\";\n h += \"<p>Schedule and optimize pickup routes.</p>\";\n h += \"<div id='route-map' style='width:100%;height:400px;background:#f0f0f0;margin:20px 0;'></div>\";\n h += \"<button class='btn btn-primary' id='optimize-btn'>Optimize Routes</button>\";\n h += \"<div id='routes-container' style='margin-top:20px;'></div>\";\n h += \"</div>\";\n $(page.body).html(h);\n \n $(\"#optimize-btn\").on(\"click\", function() {\n frappe.call({\n method: \"westech_r2.api.optimize_routes.optimize_routes\",\n callback: function(r) {\n if (r.message) {\n frappe.show_alert({message: \"Routes optimized\", indicator: \"green\"});\n }\n }\n });\n });\n }\n};\n"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import frappe
|
||||
|
||||
no_cache = 1
|
||||
@@ -0,0 +1,4 @@
|
||||
<div style="padding:20px;">
|
||||
<h2>Route Planner</h2>
|
||||
<p>Optimize pickup routes for scheduled pickups.</p>
|
||||
</div>
|
||||
@@ -0,0 +1,38 @@
|
||||
frappe.pages["route-planner"].on_page_load = function(wrapper) {
|
||||
var page = frappe.ui.make_app_page({
|
||||
parent: wrapper,
|
||||
title: "Route Planner",
|
||||
single_column: true
|
||||
});
|
||||
|
||||
frappe.call({
|
||||
method: "westech_r2.api.optimize_routes.get_scheduled_pickups",
|
||||
callback: function(r) {
|
||||
if (r.message) {
|
||||
renderRoutePlanner(page, r.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function renderRoutePlanner(page, data) {
|
||||
var h = "<div style='padding:20px;'>";
|
||||
h += "<h2>Route Planner</h2>";
|
||||
h += "<p>Schedule and optimize pickup routes.</p>";
|
||||
h += "<div id='route-map' style='width:100%;height:400px;background:#f0f0f0;margin:20px 0;'></div>";
|
||||
h += "<button class='btn btn-primary' id='optimize-btn'>Optimize Routes</button>";
|
||||
h += "<div id='routes-container' style='margin-top:20px;'></div>";
|
||||
h += "</div>";
|
||||
$(page.body).html(h);
|
||||
|
||||
$("#optimize-btn").on("click", function() {
|
||||
frappe.call({
|
||||
method: "westech_r2.api.optimize_routes.optimize_routes",
|
||||
callback: function(r) {
|
||||
if (r.message) {
|
||||
frappe.show_alert({message: "Routes optimized", indicator: "green"});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"doctype": "Page",
|
||||
"name": "route-planner",
|
||||
"page_name": "route-planner",
|
||||
"title": "Route Planner",
|
||||
"module": "Westech R2",
|
||||
"standard": "Yes",
|
||||
"roles": [{"role": "All"}]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import frappe
|
||||
|
||||
no_cache = 1
|
||||
Reference in New Issue
Block a user