Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
ypt_mgw_local
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
苏星豪
ypt_mgw_local
Commits
f8db32d2
提交
f8db32d2
authored
8月 19, 2024
作者:
张颂恩
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
产品规格功能调整
上级
3981bcdf
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
88 行增加
和
6 行删除
+88
-6
views.py
inventory/views.py
+1
-2
models.py
product/models.py
+1
-1
label_infor.html
templates/inventory/label_infor.html
+0
-2
product.html
templates/obj/product.html
+86
-1
没有找到文件。
inventory/views.py
浏览文件 @
f8db32d2
...
@@ -3653,9 +3653,8 @@ def ajax_stkclosing_list(request):
...
@@ -3653,9 +3653,8 @@ def ajax_stkclosing_list(request):
#lisin 2024-8-15 库存盘点批次明细
#lisin 2024-8-15 库存盘点批次明细
def
stkclosingbatchdetails_list
(
request
):
def
stkclosingbatchdetails_list
(
request
):
data
=
{
'data'
:
[],
'clmns'
:
[],
'e'
:
[],
'subtt'
:
[
'进销存报表'
,
'库存盘点批次明细'
],
'murl'
:
''
,
'dt'
:
True
,
'add'
:
True
}
data
=
{
'data'
:
[],
'clmns'
:
[],
'e'
:
[],
'subtt'
:
[
'进销存报表'
,
'库存盘点批次明细'
],
'murl'
:
''
,
'dt'
:
True
,
'add'
:
True
}
company_id
=
str
(
request
.
user
.
company
.
id
)
company_id
=
str
(
request
.
user
.
company
.
id
)
ancestor_id
=
str
(
request
.
user
.
company
.
id
)
ancestor_id
=
str
(
request
.
user
.
company
.
id
)
data
[
'murl'
]
=
'/inventory/stkclosingbatchdetails'
dt
=
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d'
)
dt
=
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d'
)
dt_fr
=
request
.
GET
.
get
(
'date_from'
,
dt
)
dt_fr
=
request
.
GET
.
get
(
'date_from'
,
dt
)
dt_to
=
request
.
GET
.
get
(
'date_to'
,
(
datetime
.
datetime
.
now
()
+
datetime
.
timedelta
(
days
=
1
))
.
strftime
(
"
%
Y-
%
m-
%
d"
))
dt_to
=
request
.
GET
.
get
(
'date_to'
,
(
datetime
.
datetime
.
now
()
+
datetime
.
timedelta
(
days
=
1
))
.
strftime
(
"
%
Y-
%
m-
%
d"
))
...
...
product/models.py
浏览文件 @
f8db32d2
...
@@ -115,7 +115,7 @@ class Product(models.Model):
...
@@ -115,7 +115,7 @@ class Product(models.Model):
components
=
models
.
JSONField
(
_
(
'组合包装产品明细'
),
blank
=
True
,
null
=
True
,
default
=
dict
)
components
=
models
.
JSONField
(
_
(
'组合包装产品明细'
),
blank
=
True
,
null
=
True
,
default
=
dict
)
# 2023-10-31
# 2023-10-31
bottlecap
=
models
.
SmallIntegerField
(
_
(
'瓶盖码'
),
blank
=
True
,
null
=
True
,
default
=
0
)
bottlecap
=
models
.
SmallIntegerField
(
_
(
'瓶盖码'
),
blank
=
True
,
null
=
True
,
default
=
0
)
scpc
=
models
.
TextField
(
_
(
'产品规格JSON格式'
),
blank
=
True
,
null
=
True
)
class
Meta
:
class
Meta
:
verbose_name
=
_
(
'产品信息'
)
verbose_name
=
_
(
'产品信息'
)
...
...
templates/inventory/label_infor.html
浏览文件 @
f8db32d2
...
@@ -119,8 +119,6 @@
...
@@ -119,8 +119,6 @@
});
});
$
(
'#no_form'
).
submit
(
function
(){
$
(
'#no_form'
).
submit
(
function
(){
return
false
;
return
false
;
});
});
...
...
templates/obj/product.html
浏览文件 @
f8db32d2
...
@@ -81,7 +81,6 @@
...
@@ -81,7 +81,6 @@
var editorData = editor.txt.html();
var editorData = editor.txt.html();
$("#id_product_content").val(editorData);
$("#id_product_content").val(editorData);
}
}
$(this).hide();
//2022-06-12
//2022-06-12
if( !$.isEmpty($('#shelf_life_value').val()) ){
if( !$.isEmpty($('#shelf_life_value').val()) ){
...
@@ -90,6 +89,20 @@
...
@@ -90,6 +89,20 @@
$('#id_shelf_life').val('{"period":"'+period+'","value":'+value+'}');
$('#id_shelf_life').val('{"period":"'+period+'","value":'+value+'}');
}
}
var scpc = []
var trs = $("#tb_scpc tbody tr")
if(trs.length>0){
for(const t of trs){
scpc.push({
name: $(t).find('.scpc-name').val(),
value: $(t).find('.scpc-value').val()
})
}
$("#id_product_scpc").val(JSON.stringify(scpc))
}
console.log(scpc)
$(this).hide();
$.SubmitForm('#obj_form form','{{request.path}}');
$.SubmitForm('#obj_form form','{{request.path}}');
});
});
//2022-06-12
//2022-06-12
...
@@ -222,6 +235,47 @@
...
@@ -222,6 +235,47 @@
$('#tb-components tbody').append(sTr);
$('#tb-components tbody').append(sTr);
{% endif %}
{% endif %}
var initial_scpc = $("#id_product_scpc").val()
if(initial_scpc!=""){
try{
initial_scpc = JSON.parse(initial_scpc)
for(const s of initial_scpc){
appendScpcItem(s.name, s.value)
}
}
catch(e){
console.log(e)
}
}
$("#btn_scpc_add").click(function(){
var scpc_name = $("#input_scpc_name").val().trim()
var scpc_value = $("#input_scpc_value").val()
if(scpc_name.length === 0){
alert('请输入规格名称')
return
}
if(scpc_value.length === 0){
alert('请输入规格值')
return
}
appendScpcItem(scpc_name, scpc_value)
})
function appendScpcItem(name,value){
$("#tb_scpc tbody").append(`
<tr>
<td><input
type=
"text"
value=
"${name}"
class=
"scpc-name"
/></td>
<td><input
type=
"text"
value=
"${value}"
class=
"scpc-value"
/></td>
<td><input
type=
"button"
value=
"删除"
class=
"btn-delete"
></td>
</tr>
`)
}
$('#tb_scpc tbody').on('click', '.btn-delete', function(){
$(this).parent().parent().remove();
});
{% endblock %}
{% endblock %}
{% block subtitle-1 %}
{% block subtitle-1 %}
...
@@ -244,6 +298,14 @@
...
@@ -244,6 +298,14 @@
padding
:
0px
;
padding
:
0px
;
margin
:
0px
;
margin
:
0px
;
}
}
#tb_scpc
tbody
input
{
border
:
none
;
}
#tb_scpc
.btn-delete
{
background-color
:
#f00
;
color
:
#fff
;
border
:
none
;
}
</style>
</style>
...
@@ -428,6 +490,28 @@
...
@@ -428,6 +490,28 @@
</div>
</div>
{% endif %}
{% endif %}
<div
style=
"margin-bottom:30px"
>
<h5>
产品规格:
</h5>
<div
style=
"display: flex; align-items: center;"
>
<input
type=
"text"
id=
"input_scpc_name"
placeholder=
"输入规格名称"
style=
"width: 200px;"
>
<div
style=
"padding: 0 10px;"
>
:
</div>
<input
type=
"text"
id=
"input_scpc_value"
placeholder=
"输入规格值"
style=
"width: 200px;"
>
<div
style=
"margin-left: 20px;"
>
<input
type=
"button"
value=
"添加"
id=
"btn_scpc_add"
>
</div>
</div>
<table
id=
'tb_scpc'
class=
"table table-condensed table-responsive table-bordered table-hover"
style=
"margin-top: 10px;"
>
<thead>
<th>
规格名称
</th>
<th>
规格值
</th>
<th>
操作
</th>
</thead>
<tbody>
</tbody>
</table>
</div>
<div>
<div>
{% if form.instance.id %}
{% if form.instance.id %}
{% if is_show %}
{% if is_show %}
...
@@ -438,4 +522,5 @@
...
@@ -438,4 +522,5 @@
</div>
</div>
<input
type=
"hidden"
id=
"id_product_content"
name=
"contents"
value=
"{{ form.instance.contents }}"
>
<input
type=
"hidden"
id=
"id_product_content"
name=
"contents"
value=
"{{ form.instance.contents }}"
>
<input
type=
"hidden"
id=
"id_product_scpc"
name=
"scpc"
value=
"{{ form.instance.scpc }}"
>
{% endblock %}
{% endblock %}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论