Skip to content

Commit 8128d27

Browse files
authored
Feature 合并前端代码 (#312)
* [add] 合并前端页面代码 * [fix] pep-8
1 parent 8f43d75 commit 8128d27

File tree

363 files changed

+5922456
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

363 files changed

+5922456
-0
lines changed

Core/templates/Core/index.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!doctype html><html lang=en><head><title>太重滨海煤化工分公司生产管理系统</title><meta charset=utf-8><script>/* eslint-disable */
2+
var env = 'production'
3+
if (env !== 'production') {
4+
window.erpConfig = JSON.parse('')
5+
window.erpConfig.deptMap = JSON.stringify(window.erpConfig.deptMap)
6+
window.erpConfig.menus = JSON.stringify(window.erpConfig.menus)
7+
} else {
8+
window.erpConfig = {
9+
employeeId: '{{employee_id}}',
10+
employeeName: '{{employee_name}}',
11+
employeeMail: '{{email}}',
12+
deptMap: '{{ deptMap|safe }}',
13+
menus: '{{ menu|safe }}'
14+
}
15+
}</script><link href=/static/css/app.20ad268c14cc30547a6d967ca6d0baf8.css rel=stylesheet></head><body><div id=root style="height: 100%"></div><script type=text/javascript src=/static/js/vendor.d76e8cbaf64069d7f043.js></script><script type=text/javascript src=/static/js/app.c7b61b2f6f8c71fc38d6.js></script></body></html>

Core/views/index.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import json
2+
3+
from Core.views.base import TemplateView
4+
from Core.models.auth import Department
5+
6+
7+
class IndexView(TemplateView):
8+
template_name = 'Core/index.html'
9+
10+
def get_context_data(self, **kwargs):
11+
context = super().get_context_data(**kwargs)
12+
context['employee_id'] = '1345'
13+
context['employee_name'] = '王蕾'
14+
context['email'] = '806935949@qq.com'
15+
with open('Core/views/tmp_menu.txt', 'r') as f:
16+
context['menu'] = f.read().strip()
17+
context['deptMap'] = json.dumps(Department.get_departments_dict())
18+
return context

Core/views/tmp_menu.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"code":"menu.distribution","name":"经销管理","children":[{"code":"menu.distribution.production","name":"产品","children":[]},{"code":"menu.distribution.production_send","name":"生产科下发","children":[]},{"code":"menu.distribution.process_send","name":"工艺科下发","children":[]},{"code":"menu.distribution.procurement_send","name":"采购科下发","children":[]},{"code":"menu.distribution.bid_document","name":"招标文件审核","children":[]}]},{"code":"menu.process","name":"工艺管理","children":[{"code":"menu.process.process_import","name":"工艺库导入","children":[]},{"code":"menu.process.process","name":"工艺库","children":[]},{"code":"menu.process.welding_seam","name":"焊缝明细","children":[]},{"code":"menu.process.brought_in_items","name":"外购件明细","children":[]},{"code":"menu.process.first_feeding_items","name":"先投件明细","children":[]},{"code":"menu.process.cooperant_items","name":"工序性协作件明细","children":[]},{"code":"menu.process.principal_quota","name":"主材定额","children":[]},{"code":"menu.process.auxiliary_quota","name":"辅材定额","children":[]},{"code":"menu.process.welding_quota","name":"焊材定额","children":[]}]},{"code":"menu.purchase","name":"采购管理","children":[{"code":"menu.purchase.pending_order","name":"待处理工作令","children":[]},{"code":"menu.purchase.material_summarize","name":"物料汇总","children":[]},{"code":"menu.purchase.purchase_order_management","name":"订购单管理","children":[]},{"code":"menu.purchase.purchase_track","name":"采购跟踪","children":[]},{"code":"menu.purchase.entry_confirm","name":"入库确认","children":[]},{"code":"menu.purchase.material_sub_apply","name":"材料代用","children":[]},{"code":"menu.purchase.status_back_track","name":"状态回溯","children":[]},{"code":"menu.purchase.material_execution","name":"材料执行","children":[]},{"code":"menu.purchase.supplier","name":"供应商管理","children":[]},{"code":"menu.purchase.contract","name":"合同财务管理","children":[]}]},{"code":"menu.inventory","name":"库存管理","children":[{"code":"menu.inventory.weld","name":"焊材库存管理","children":[]},{"code":"menu.inventory.steel","name":"钢材库存管理","children":[]},{"code":"menu.inventory.brought_in","name":"外购件库存管理","children":[]},{"code":"menu.inventory.auxiliary","name":"辅助工具库存管理","children":[]},{"code":"menu.inventory.basic_data","name":"库存基础数据管理","children":[]}]},{"code":"menu.production","name":"生产管理","children":[{"code":"menu.production.production_plan","name":"生产计划","children":[]},{"code":"menu.production.ledgers","name":"台账查询","children":[]},{"code":"menu.production.departments","name":"综合工部","children":[]},{"code":"menu.production.query_work_hours","name":"工时信息查询","children":[]},{"code":"menu.production.task_plan_date","name":"任务计划时间","children":[]},{"code":"menu.production.task_allocation","name":"任务分配","children":[]},{"code":"menu.production.task_confirm","name":"任务完成确认","children":[]},{"code":"menu.production.production_users","name":"生产用户管理","children":[]},{"code":"menu.production.material_apply_card","name":"材料领用卡","children":[]},{"code":"menu.production.material_refund_card","name":"材料退库卡","children":[]}]}]

ERP/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
STATIC_URL = '/static/'
102102
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
103103
STATICFILES_DIRS = [
104+
os.path.join(BASE_DIR, 'dev_static'),
104105
]
105106

106107
MEDIA_URL = '/media/'

ERP/urls.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
from django.conf import settings
1717
from django.conf.urls import url, include
1818

19+
from Core.views.index import IndexView
20+
1921

2022
urlpatterns = [
2123
url(r'^', include('Core.urls')),
@@ -24,6 +26,7 @@
2426
url(r'^', include('Procurement.urls')),
2527
url(r'^', include('Inventory.urls')),
2628
url(r'^', include('Production.urls')),
29+
url(r'^', IndexView.as_view()),
2730
]
2831

2932
if settings.DEBUG:

dev_static/css/app.20ad268c14cc30547a6d967ca6d0baf8.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev_static/favicon.ico

3.78 KB
Binary file not shown.

0 commit comments

Comments
 (0)