Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dwsproject
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dws
dwsproject
Commits
b06b9625
Commit
b06b9625
authored
Nov 29, 2024
by
夏超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] 修改报工台,工单报工问题
parent
0275ab2e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
19 deletions
+87
-19
jzjx_project/controllers/inherit_production.py
+21
-0
jzjx_project/static/src/html/view/zdy_gdbg.html
+66
-19
No files found.
jzjx_project/controllers/inherit_production.py
View file @
b06b9625
import
datetime
import
json
import
os
from
jinja2
import
FileSystemLoader
,
Environment
...
...
@@ -116,6 +118,25 @@ class JzjxRokeRefixAutoWorkOrder(http.Controller):
data_list
.
append
(
url
)
return
{
"code"
:
0
,
"message"
:
"获取成功!"
,
"data"
:
data_list
}
@http.route
(
'/roke/mes/work_time/get'
,
type
=
'json'
,
auth
=
"user"
,
csrf
=
False
,
cors
=
'*'
)
def
get_work_time
(
self
):
"""
获取工时树
:return:
"""
uid
=
http
.
request
.
uid
or
http
.
request
.
session
.
uid
if
not
uid
:
return
{
"code"
:
1
,
"message"
:
"当前位置尚未登录,请先登录"
,
"work_hours"
:
0
}
start_record
=
http
.
request
.
env
(
user
=
SUPERUSER_ID
)[
'roke.work.start.record'
]
.
search
([
(
"user_id"
,
"="
,
uid
),
(
"state"
,
"="
,
"工作中"
)
],
limit
=
1
)
if
not
start_record
:
return
{
"code"
:
1
,
"message"
:
"未开工,请先开工。"
,
"work_hours"
:
0
}
delta
=
datetime
.
datetime
.
now
()
-
start_record
.
start_time
work_hours
=
round
(
delta
.
total_seconds
()
/
3600
,
2
)
return
{
"code"
:
0
,
"message"
:
"获取成功!"
,
"work_hours"
:
work_hours
}
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
__file__
))
templateloader
=
FileSystemLoader
(
searchpath
=
BASE_DIR
+
"/static/src/html/view"
)
...
...
jzjx_project/static/src/html/view/zdy_gdbg.html
View file @
b06b9625
...
...
@@ -731,11 +731,11 @@
placeholder=
"为空时默认当前时间"
value-format=
'yyyy-MM-dd HH:mm:ss'
></el-date-picker>
</div>
<div
style=
"display:flex;"
>
<p>
工
   
时
   
数:
</p
>
<el-input-number
v-model=
"bg_gss"
:min=
"0"
label=
"工时数"
:precision=
"2"
>
</el-input-number
>
</div
>
<!-- <div style="display:flex;">--
>
<!-- <p>工   时   数:</p>--
>
<!-- <el-input-number v-model="bg_gss" :min="0" label="工时数" :precision="2">--
>
<!-- </el-input-number>--
>
<!-- </div>--
>
<div
style=
"display:flex;"
>
<p>
合
   
格
   
数:
</p>
<el-input-number
v-model=
"bg_hgs"
:min=
"0"
label=
"合格数"
@
change=
"set_move_qty"
...
...
@@ -1232,12 +1232,14 @@
},
gdId
:
null
,
// 当前工单id
work_center_show
:
false
,
// 判断工作中心是否必传标识
document_list
:
[]
document_list
:
[],
default_process_id
:
null
}
},
created
()
{
this
.
isLoginApi
()
this
.
getPageAllDataApi
()
this
.
gongxu_filter
(
'初始化'
)
},
mounted
()
{
},
...
...
@@ -1256,7 +1258,7 @@
that
.
getmorenList
();
that
.
chanpin_filter
();
that
.
kehu_filter
();
that
.
gongxu_filter
();
//
that.gongxu_filter();
that
.
get_category
();
let
screenHeight
=
window
.
innerHeight
;
that
.
inHeight
=
screenHeight
-
84
;
...
...
@@ -1276,7 +1278,7 @@
});
},
// 获取页面全部数据
getPageAllDataApi
()
{
getPageAllDataApi
(
default_process_id
)
{
let
that
=
this
;
axios
.
request
({
url
:
"/roke/get_staging_order_list"
,
...
...
@@ -1287,7 +1289,7 @@
data
:
{
'model_index'
:
'roke.work.order'
,
'work_desk_index'
:
'gongdanbaogong'
,
'domain_dict'
:
{
'state'
:
'未完工'
},
'domain_dict'
:
{
'state'
:
'未完工'
,
'process_id'
:
default_process_id
},
'code'
:
''
,
'search_type'
:
''
,
'page_no'
:
1
,
...
...
@@ -1484,6 +1486,11 @@
let
list
=
{};
that
.
record_filter_data
.
map
(
item
=>
{
list
[
item
.
field_index
]
=
item
.
value
;
if
(
item
.
field_index
==
'process_id'
){
if
(
!
item
.
value
){
list
[
item
.
field_index
]
=
that
.
default_process_id
}
}
});
that
.
filter_list
=
list
;
axios
.
request
({
...
...
@@ -2633,7 +2640,18 @@
}
});
}
if
(
that
.
reportData_value
.
length
===
1
&&
allow_key
)
{
// this.bg_gss
axios
.
request
({
url
:
"/roke/mes/work_time/get"
,
method
:
"post"
,
headers
:
{
'Content-Type'
:
'application/json'
},
data
:
{}
}).
then
((
res
)
=>
{
if
(
res
.
data
.
result
.
code
==
0
){
that
.
bg_gss
=
res
.
data
.
result
.
work_hours
if
(
that
.
reportData_value
.
length
===
1
&&
allow_key
)
{
// 单人报工
var
ryList
=
[];
for
(
let
i
=
0
;
i
<
that
.
reportData_value
.
length
;
i
++
)
{
...
...
@@ -2692,6 +2710,7 @@
item
.
value
=
'未完工'
}
});
that
.
stop
()
that
.
getList
();
}
});
...
...
@@ -2754,10 +2773,18 @@
item
.
value
=
'未完工'
}
});
that
.
stop
()
that
.
getList
();
}
});
}
}
else
{
that
.
$message
({
type
:
'error'
,
message
:
'获取工时失败,报工失败'
});
}
});
},
search_gongxu_filter
(
val
)
{
// console.log(val);
...
...
@@ -2824,21 +2851,31 @@
}
},
gongxu_filter
(
val
)
{
//获取工序
let
that
=
this
console
.
log
(
11111
);
let
sta
=
{}
if
(
val
==
'初始化'
){
sta
=
{
'process'
:
''
,
'page_size'
:
that
.
gongxupageSize
,
"product_id"
:
that
.
no_order_cp
}
}
else
{
sta
=
{
'process'
:
''
,
"page_no"
:
val
,
'page_size'
:
that
.
gongxupageSize
,
"product_id"
:
that
.
no_order_cp
}
}
//获取工序
axios
.
request
({
url
:
"/roke/get_process_list"
,
method
:
"post"
,
headers
:
{
'Content-Type'
:
'application/json'
},
data
:
{
'process'
:
''
,
"page_no"
:
val
,
'page_size'
:
that
.
gongxupageSize
,
"product_id"
:
that
.
no_order_cp
}
data
:
sta
}).
then
(
function
(
res
)
{
// console.log(res);
if
(
res
.
data
.
result
.
state
===
'error'
)
{
...
...
@@ -2855,6 +2892,16 @@
if
((
that
.
no_order_gxList
.
length
===
res
.
data
.
result
.
total_number
))
{
that
.
datations_Gongxu
=
'到底啦'
}
if
(
val
==
'初始化'
){
that
.
gongxuList
.
forEach
((
item
)
=>
{
if
(
item
.
name
.
includes
(
'切割'
))
{
that
.
default_process_id
=
item
.
id
that
.
gongxuList
.
length
=
0
return
}
});
that
.
getPageAllDataApi
(
that
.
default_process_id
)
}
}
});
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment