Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
ypt_mgw_local
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
苏星豪
ypt_mgw_local
Commits
ec82ddb7
提交
ec82ddb7
authored
11月 22, 2022
作者:
张颂恩
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
http://124.225.116.118:35236/tj_django/datacenter
into dev
上级
26be7680
cf0b9e2f
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
228 行增加
和
15 行删除
+228
-15
.gitignore
.gitignore
+1
-0
.gitlab-ci.yml
.gitlab-ci.yml
+14
-0
README.md
README.md
+5
-2
forms.py
company/forms.py
+6
-1
urls.py
datacenter/urls.py
+7
-1
views.py
inventory/views.py
+0
-0
news.html
templates/company/news.html
+13
-8
label_replace_online.html
templates/inventory/label_replace_online.html
+175
-0
left.html
templates/left.html
+7
-3
没有找到文件。
.gitignore
浏览文件 @
ec82ddb7
...
...
@@ -8,6 +8,7 @@
!/manage.py
!/README.md
!/.gitignore
!/.gitlab-ci.yml
### NotepadPP template
# Notepad++ backups #
...
...
.gitlab-ci.yml
0 → 100644
浏览文件 @
ec82ddb7
stages
:
-
deploy
deploy_job
:
stage
:
deploy
script
:
-
cd "E:\datacenter"
-
git checkout test
-
git pull
only
:
# 只有test分支才执行
-
test
tags
:
-
"
36"
\ No newline at end of file
README.md
浏览文件 @
ec82ddb7
...
...
@@ -4,4 +4,7 @@
项目根目录下static和media两个文件夹不会上传到代码仓库,
**如果有修改需要通知其他成员同步。**
**_TODO: 服务器环境需要建立一个conda._**
\ No newline at end of file
**_TODO: 服务器环境需要建立一个conda._**
# requirements:
django 3.1.4
\ No newline at end of file
company/forms.py
浏览文件 @
ec82ddb7
...
...
@@ -416,7 +416,12 @@ class News_Form(ModelForm):
model
=
News
fields
=
[
'news_from'
,
'subtitle'
,
'desc'
,
'poster'
,
'content'
,
'is_active'
,
'remark'
,
'pub_date'
]
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
News_Form
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
self
.
fields
[
'subtitle'
]
.
widget
.
attrs
[
'placeholder'
]
=
'必填'
self
.
fields
[
'content'
]
.
widget
.
attrs
[
'placeholder'
]
=
'必填'
self
.
fields
[
'desc'
]
.
widget
.
attrs
[
'placeholder'
]
=
'必填'
self
.
fields
[
'news_from'
]
.
widget
.
attrs
[
'placeholder'
]
=
'必填'
#2021-02-24
...
...
datacenter/urls.py
浏览文件 @
ec82ddb7
...
...
@@ -227,7 +227,13 @@ urlpatterns = [
url
(
r'^inventory/upload/label_replace/$'
,
inventory_views
.
upload_label_replace
),
url
(
r'^inventory/upload/label_replace/$'
,
inventory_views
.
upload_label_replace
),
#2022-09-19 酒鬼酒在线绑定标签替换
# url(r'^test/wx/test/$', inventory_views.upload_label_replace_sh),
# url(r'^test/wx/test/yemian/$', inventory_views.yemian),
url
(
r'^inventory/upload/label_replace_sh/$'
,
inventory_views
.
upload_label_replace_sh
),
url
(
r'^inventory/upload/yemian/$'
,
inventory_views
.
yemian
),
url
(
r'^inventory/app/stock/(?P<company_id>\d+)/$'
,
inventory_views
.
app_stock
),
url
(
r'^inventory/app/(?P<company_id>\d+)/children/$'
,
inventory_views
.
app_childcompany
),
...
...
inventory/views.py
浏览文件 @
ec82ddb7
差异被折叠。
点击展开。
templates/company/news.html
浏览文件 @
ec82ddb7
...
...
@@ -18,16 +18,21 @@
$
(
'#image-clear_id,#id_image'
).
removeClass
(
'form-control'
);
$
(
'.btn-save'
).
click
(
function
()
{
{
#
$
(
'.btn-save'
).
click
(
function
()
{
#
}
{
#
let
editorData
=
editor
.
txt
.
html
();
#
}
{
#
$
(
"#id_content"
).
val
(
editorData
);
#
}
{
#
$
.
SubmitForm
(
'#obj_form form'
,
'{{request.path}}'
,
function
(){
#
}
{
#
$
(
'.alert'
).
fadeIn
();
#
}
{
#
setTimeout
(
function
(){
#
}
{
#
$
(
'.alert'
).
fadeOut
();
#
}
{
#
},
3000
)
#
}
{
#
});
#
}
{
#
});
#
}
$
(
'.btn-save'
).
click
(
function
(){
let
editorData
=
editor
.
txt
.
html
();
$
(
"#id_content"
).
val
(
editorData
);
$
.
SubmitForm
(
'#obj_form form'
,
'{{request.path}}'
,
function
(){
$
(
'.alert'
).
fadeIn
();
setTimeout
(
function
(){
$
(
'.alert'
).
fadeOut
();
},
3000
)
$
.
SubmitForm
(
'#obj_form form'
,
'{{request.path}}'
);
});
});
$
(
'#obj_form .product_photo a'
).
click
(
function
(
event
)
{
event
.
preventDefault
();
...
...
@@ -61,7 +66,7 @@
z-index
:
1000002
;
}
</style>
{{ block.super }}
<div
class=
"form-group "
>
<label
class=
"col-sm-2 control-label "
>
标题
</label>
<div
class=
"col-sm-8"
>
{{ form.subtitle }}
</div>
...
...
templates/inventory/label_replace_online.html
0 → 100644
浏览文件 @
ec82ddb7
{% load i18n %}
<div
class=
"subtitle"
>
<ol
class=
"breadcrumb"
>
<li>
{% trans "物流工具" %}
</li>
<li>
{% trans "在线采集标签替换" %}
</li>
</ol>
</div>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
$
(
'input[name="info"]'
).
change
(
function
()
{
info
=
$
(
'input[name="info"]:checked'
).
attr
(
'value'
);
if
(
info
==
'custom'
)
{
$
(
'#fahuo_info'
).
show
(
400
);
}
else
{
$
(
'#fahuo_info'
).
hide
(
400
);
}
});
var
uploadType
=
''
;
$
(
'#upload'
).
on
(
'click'
,
function
()
{
var
Sel
=
document
.
getElementById
(
"select"
);
var
index
=
Sel
.
selectedIndex
;
uploadType
=
Sel
.
options
[
index
].
value
;
// console.log(val);
if
(
uploadType
==
''
)
{
alert
(
"请选择替换类型"
);
}
else
{
document
.
getElementById
(
'xFile'
).
click
();
}
})
$
(
'#xFile'
).
change
(
function
()
{
var
formData
=
new
FormData
();
formData
.
append
(
"type"
,
uploadType
);
$
(
'#info table'
).
html
(
''
);
$
(
'#info .info'
).
html
(
''
);
$
(
'#errinfo_null_rec'
).
html
(
''
);
$
(
'#errinfo_delivered_rec'
).
html
(
''
);
$
(
'#errinfo_different_rec'
).
html
(
''
);
console
var
xhr
=
new
XMLHttpRequest
();
var
file
=
document
.
getElementById
(
'xFile'
).
files
;
var
formDat
;
var
cnt
=
0
;
for
(
i
=
0
;
i
<
file
.
length
;
i
++
)
{
var
fn
=
file
[
i
].
name
.
substr
(
0
,
2
).
toUpperCase
();
formData
.
append
(
"files"
,
file
[
i
]);
cnt
=
cnt
+
1
;
}
if
(
cnt
==
0
)
{
//bootbox.alert("{% trans '没有可上传的文件!' %}", function() {});
toastr
.
error
(
"没有可上传的文件!"
,
"操作错误:"
,
{
timeOut
:
800
,
positionClass
:
"toast-center-center"
}
);
return
;
}
$
(
'#msg'
).
remove
();
$
(
'.btn-upload'
).
addClass
(
'disabled'
);
$
(
'#ajax_loading2'
).
show
();
var
si
=
''
;
xhr
.
open
(
'POST'
,
'/inventory/upload/label_replace_sh/'
);
xhr
.
setRequestHeader
(
"X-CSRFToken"
,
'{{ csrf_token }}'
);
xhr
.
send
(
formData
);
xhr
.
onreadystatechange
=
(
function
(
_xhr
)
{
return
function
()
{
if
(
_xhr
.
readyState
==
4
)
{
if
(
_xhr
.
status
==
200
)
{
console
.
log
(
'200'
);
var
d
=
eval
(
'('
+
_xhr
.
responseText
+
')'
);
if
(
d
.
e
!=
''
)
{
$
(
'.btn-upload'
).
removeClass
(
'disabled'
);
toastr
.
error
(
d
.
e
,
"上传失败:"
,
{
timeOut
:
800
,
positionClass
:
"toast-center-center"
}
);
//bootbox.alert(d.e, function() {});
return
;
};
$
(
'#info table'
).
prepend
(
'<tr>'
+
'<th style="width:30px">{% trans '
上传的
TXT
文件名
' %}</th>'
+
'<th style="width:15px">{% trans '
总行数
' %}</th>'
+
'<th style="width:15px">{% trans '
写入替换记录数
' %}</th>'
+
'<th style="width:15px">{% trans '
错误标签
' %}</th>'
+
'</tr>'
);
for
(
var
n
in
d
.
files
)
{
$
(
'#info table'
).
append
(
'<tr>'
+
'<td>'
+
d
.
files
[
n
].
txt_name
+
'</td>'
+
'<td>'
+
d
.
files
[
n
].
total
+
'</td>'
+
'<td>'
+
d
.
files
[
n
].
ok
+
'</td>'
+
'<td>'
+
d
.
files
[
n
].
err
+
'</td>'
+
'</tr>'
);
};
var
html
=
''
;
$
(
'#info .info'
).
html
(
html
);
$
(
'.btn-upload'
).
removeClass
(
'disabled'
);
$
(
'#ajax_loading2'
).
hide
();
}
else
{
$
(
'.btn-upload'
).
removeClass
(
'disabled'
);
$
(
'#ajax_loading2'
).
hide
();
//bootbox.alert("{% trans '通讯错误!' %}", function() {});
toastr
.
error
(
"通讯错误"
,
"上传失败:"
,
{
timeOut
:
800
,
positionClass
:
"toast-center-center"
}
);
return
;
}
}
}
})(
xhr
);
xhr
.
timeout
=
300000
;
xhr
.
ontimeout
=
function
(
event
)
{
$
(
'#ajax_loading2'
).
hide
();
//bootbox.alert("{% trans '请求超时!' %}", function() {});
toastr
.
error
(
"请求超时!"
,
"操作失败:"
,
{
timeOut
:
800
,
positionClass
:
"toast-center-center"
}
);
}
});
});
</script>
<div>
{% trans "点击右边按钮,选择标签替换TXT文件上传服务器:" %}
<select
id=
"select"
style=
"width : 150px;"
>
<option
value=
""
>
请选择替换类型
</option>
<option
value=
"pg"
>
瓶盖替换
</option>
<option
value=
"qh"
>
标签替换(全换)
</option>
</select>
<label
class=
"btn btn-primary btn-upload btn-sm"
id=
"upload"
>
{% trans "上传文件" %}
</label>
<div
style=
'font-style:italic;'
>
TXT文件格式:每行两列,先是旧标签号码后是新标签号码,中间用英文逗号分隔
</div>
<form>
<input
type=
"file"
id=
"xFile"
accept=
"text/plain"
multiple=
"multiple"
style=
"position:absolute;clip:rect(0 0 0 0);"
>
</form>
<div
id=
'info'
>
<div
id=
'tb_div'
class=
'table-responsive'
>
<table
class=
'table table-bordered table-striped table-condensed table-hover'
></table>
</div>
<div
class=
'info'
></div>
</div>
<div
id=
'errinfo_null_rec'
></div>
<div
id=
'errinfo_delivered_rec'
></div>
<div
id=
'errinfo_different_rec'
></div>
<div
id=
'msg'
></div>
</div>
\ No newline at end of file
templates/left.html
浏览文件 @
ec82ddb7
...
...
@@ -551,15 +551,19 @@
{% ifequal user.company.id 16716 %}
<li><a
class=
"l-a"
href=
"/inventory/ticketinfo/"
>
{% trans '入库启票' %}
</a></li>
{% endifequal %}
{% ifequal user.company.id 16687 %}
<li><a
class=
"l-a"
href=
"/inventory/upload/yemian/"
>
{% trans '在线绑定标签替换TXT' %}
</a></li>
{% endifequal %}
{% if perms.company.sys_admin %}
{% if request.user.company.is_manufacturing %}
<li><a
class=
"l-a"
href=
"/inventory/html/label_replace/"
>
{% trans '上传标签替换TXT' %}
</a></li>
{% endif %}
{% endif %}
{% if perms.company.sys_admin %}
<li><a
class=
"l-a"
href=
"/inventory/upload/inv/"
>
{% trans '上传发货TXT文件' %}
</a></li>
{% endif %}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论