Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
kwell-mes
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gavelinfo
kwell-mes
Commits
5fe56f5d
Commit
5fe56f5d
authored
Mar 28, 2022
by
李苏
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
排产计划维护
parent
a2a7b819
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
131 additions
and
40 deletions
+131
-40
edit.html
gavel/src/main/resources/templates/views/wo/pcjhk/edit.html
+131
-40
No files found.
gavel/src/main/resources/templates/views/wo/pcjhk/edit.html
View file @
5fe56f5d
...
...
@@ -9,38 +9,58 @@
<input
type=
"hidden"
name=
"djly"
value=
"M"
>
<input
type=
"hidden"
name=
"sysversion"
>
<div
class=
"gui-row"
>
<div
class=
"gui-col-sm
4
"
>
<div
class=
"gui-col-sm
3
"
>
<label
class=
"gui-form-label"
>
计划编码:
</label>
<div
class=
"gui-input-block"
>
<input
type=
"text"
name=
"djid"
data-toggle=
"gui-textbox"
data-options=
""
>
</div>
</div>
<div
class=
"gui-col-sm4"
>
<label
class=
"gui-form-label"
>
计划日期:
</label>
<div
class=
"gui-col-sm3"
>
<label
class=
"gui-form-label"
>
选择时间:
</label>
<div
class=
"gui-input-block"
>
<input
type=
"text"
name=
"xzny"
>
</div>
</div>
<div
class=
"gui-col-sm3"
>
<label
class=
"gui-form-label"
>
周次:
</label>
<div
class=
"gui-input-block"
>
<input
type=
"text"
name=
"xzzc"
data-options=
"disabled:true"
>
</div>
</div>
<div
class=
"gui-col-sm3"
>
<label
class=
"gui-form-label"
>
开始日期:
</label>
<div
class=
"gui-input-block"
>
<input
type=
"text"
name=
"
jhrq"
data-toggle=
"gui-datebox"
data-options=
"requir
ed:true"
>
<input
type=
"text"
name=
"
ksrq"
data-toggle=
"gui-datebox"
data-options=
"required:true,disabl
ed:true"
>
</div>
</div>
<div
class=
"gui-col-sm4"
>
<div
class=
"gui-col-sm3"
>
<label
class=
"gui-form-label"
>
结束日期:
</label>
<div
class=
"gui-input-block"
>
<input
type=
"text"
name=
"jsrq"
data-toggle=
"gui-datebox"
data-options=
"required:true,disabled:true"
>
</div>
</div>
<div
class=
"gui-col-sm3"
>
<label
class=
"gui-form-label"
>
计划部门:
</label>
<div
class=
"gui-input-block"
>
<input
type=
"text"
name=
"bmid"
data-toggle=
"gui-textbox"
data-options=
""
>
</div>
</div>
<div
class=
"gui-col-sm3"
>
<label
class=
"gui-form-label"
>
计划人:
</label>
<div
class=
"gui-input-block"
>
<input
type=
"text"
name=
"jhr"
data-toggle=
"gui-textbox"
data-options=
""
>
</div>
</div>
<div
class=
"gui-col-sm12"
>
<label
class=
"gui-form-label"
>
备注:
</label>
<div
class=
"gui-input-block"
>
<input
type=
"text"
name=
"bz"
data-toggle=
"gui-textbox"
data-options=
""
>
</div>
</div>
</div>
<div
class=
"gui-row"
>
<div
class=
"gui-col-sm4"
>
<label
class=
"gui-form-label"
>
计划人:
</label>
<div
class=
"gui-input-block"
>
<input
type=
"text"
name=
"jhr"
data-toggle=
"gui-textbox"
data-options=
""
>
</div>
</div>
<div
class=
"gui-col-sm8"
>
<label
class=
"gui-form-label"
>
备注:
</label>
<div
class=
"gui-input-block"
>
<input
type=
"text"
name=
"bz"
data-toggle=
"gui-textbox"
data-options=
""
>
</div>
</div>
</div>
</div>
<div
class=
"mx-dataTable"
style=
"margin-top: 150px;bottom: 40px"
>
...
...
@@ -75,7 +95,8 @@
$
(
function
()
{
var
$div
=
$
(
'#woPcjhkEdit'
);
var
$datagrid
=
$
(
'#bzEditPcjhmxk'
);
var
$datJhrq
=
$div
.
find
(
'input[name="jhrq"]'
);
var
$datksrq
=
$div
.
find
(
'input[name="ksrq"]'
);
var
$datjsrq
=
$div
.
find
(
'input[name="jsrq"]'
);
var
$cbxBmid
=
$div
.
find
(
'input[name="bmid"]'
);
var
$datWhsj
=
$div
.
find
(
'input[name="whsj"]'
);
var
$edtWhr
=
$div
.
find
(
'input[name="whr"]'
);
...
...
@@ -83,10 +104,11 @@
var
$edtId
=
$div
.
find
(
'input[name="id"]'
);
var
$cbxLydjid
=
$div
.
find
(
'input[name="woid"]'
);
var
$cbxDjly
=
$div
.
find
(
'input[name="djly"]'
);
var
$xzny
=
$div
.
find
(
'input[name="xzny"]'
);
var
$xzzc
=
$div
.
find
(
'input[name="xzzc"]'
);
var
$tag
=
$div
.
closest
(
'form'
).
attr
(
"tag"
);
gas
.
load
(
paramInit
,
pageInit
,
dataInit
,
run
);
function
paramInit
(
ops
){
}
...
...
@@ -95,10 +117,14 @@
var
columns
=
[
{
title
:
"序号"
,
field
:
"xh"
,
fieldType
:
"ftString"
,
width
:
70
},
{
title
:
"生产单号"
,
field
:
"woDjid"
,
fieldType
:
"ftString"
,
width
:
120
},
{
title
:
"计划日期"
,
field
:
"jhrq"
,
fieldType
:
"date"
,
editor
:
{
type
:
'datebox'
,
required
:
true
}
},
// {title: "计划日期", field: "ksrq", fieldType: "date", editor: {
// type: 'datebox', required: true
// }
// },
// {title: "结束日期", field: "jsrq", fieldType: "date", editor: {
// type: 'datebox', required: true
// }
// },
{
title
:
"物料ID"
,
field
:
"wlid"
,
hidden
:
true
},
{
title
:
"物料编码"
,
field
:
"wlxxCode"
,
width
:
120
},
{
title
:
"物料名称"
,
field
:
"wlxxName"
,
width
:
140
},
...
...
@@ -106,7 +132,7 @@
{
title
:
"完工数量"
,
field
:
"wgsl"
,
fieldType
:
"float"
},
{
title
:
"合格数量"
,
field
:
"hgsl"
,
fieldType
:
"float"
},
{
title
:
"不合格数量"
,
field
:
"bhgsl"
,
fieldType
:
"float"
},
{
title
:
"备注"
,
field
:
"bz"
,
fieldType
:
"ftString"
,
width
:
240
}
//
{title: "备注", field: "bz", fieldType: "ftString",width:240}
];
$datagrid
.
DataTableEditing
({
columns
:[
new
$
.
common
.
formatterCol
(
columns
)],
...
...
@@ -114,12 +140,25 @@
allowAdd
:
false
,
onClickCell
:
doCellClick
});
$xzny
.
iDatebox
({
onSelect
:
function
(
e
){
let
data
=
getfeWeek
(
e
)
let
weekday
=
data
.
weekday
let
nowWeek
=
data
.
nowWeek
let
weekStart
=
data
.
weekStart
let
weekEnd
=
data
.
weekEnd
$xzzc
.
combobox
(
'setValue'
,
nowWeek
);
$datksrq
.
datebox
(
'setValue'
,
new
Date
(
weekStart
))
$datjsrq
.
datebox
(
'setValue'
,
new
Date
(
weekEnd
))
console
.
log
(
weekEnd
)
}})
$xzzc
.
iCombobox
({
valueField
:
'zcv'
,
textField
:
'zc'
,
data
:[{
zcv
:
0
,
zc
:
""
},{
zcv
:
1
,
zc
:
"第一周"
},{
zcv
:
0
,
zc
:
"第二周"
},{
zcv
:
0
,
zc
:
"第三周"
},{
zcv
:
0
,
zc
:
"第四周"
},{
zcv
:
0
,
zc
:
"第五周"
},{
zcv
:
0
,
zc
:
"第六周"
}]
}
);
$cbxBmid
.
iCombobox
({
valueField
:
'id'
,
textField
:
'bmmc'
});
$datJhrq
.
datebox
(
"bindChange"
,
doJhrqChange
);
$datksrq
.
datebox
(
"bindChange"
,
doksrqChange
);
$div
.
find
(
".datagrid-header-row td[field='wlxxCode']"
).
css
(
"border"
,
"none"
);
$
(
"#bzEditPcjhmxk-toolbar"
).
find
(
".chooseWO"
).
iMenubutton
({
text
:
"选择生产订单"
,
iconCls
:
"fa fa-search"
,
...
...
@@ -130,7 +169,7 @@
tag
:
'add'
,
onSaveCallback
:
function
(
opt
,
data
)
{
$datagrid
.
datagrid
(
"loadData"
,[]);
var
jhrq
=
$datJh
rq
.
val
();
var
ksrq
=
$datks
rq
.
val
();
var
list
=
data
.
list
;
$cbxDjly
.
val
(
'WO'
);
var
xh
=
0
;
...
...
@@ -138,10 +177,10 @@
item
[
'woid'
]
=
item
[
'id'
];
item
[
'woDjid'
]
=
item
[
'djid'
];
item
[
'jhsl'
]
=
item
[
'xqsl'
];
if
(
!
jh
rq
){
item
[
"
jh
rq"
]
=
''
if
(
!
ks
rq
){
item
[
"
ks
rq"
]
=
''
}
else
{
item
[
'
jhrq'
]
=
jh
rq
;
item
[
'
ksrq'
]
=
ks
rq
;
}
item
[
'xh'
]
=
xh
+
1
;
delete
item
[
"id"
];
...
...
@@ -160,7 +199,7 @@
gas
.
post
(
"common/datetime"
,{},
function
(
result
)
{
if
(
result
[
'success'
]
&&
result
[
'data'
][
'data'
]){
var
date
=
new
Date
(
result
[
'data'
][
'data'
]);
$dat
Jh
rq
.
iDatebox
({
value
:
DateUtils
.
format
(
date
)});
$dat
ks
rq
.
iDatebox
({
value
:
DateUtils
.
format
(
date
)});
$datWhsj
.
iDatetimebox
({
value
:
DateUtils
.
formatTime
(
date
)});
}
},
ops
);
...
...
@@ -181,7 +220,7 @@
}
loadListDatagrid
(
$datagrid
,{
url
:
"kmes/pcjhk/query/detail"
,
params
:{
mid
:
$edtId
.
val
()}},
$div
.
closest
(
"form"
));
}
function
doCellClick
(
rowIndex
,
field
,
value
)
{
if
(
field
==
"choose"
){
$datagrid
.
datagrid
(
'acceptChanges'
);
...
...
@@ -224,10 +263,62 @@
})
}
}
function
doJhrqChange
(
value
)
{
/* 获取几天前的时间 */
function
getBeforeDate
(
n
,
e
)
{
const
sum
=
86400
let
datesjc
=
e
.
valueOf
()
+
""
datesjc
=
parseInt
(
datesjc
.
substring
(
0
,
10
))
return
datesjc
+
sum
*
n
}
function
timestampToTime
(
timestamp
){
let
date
=
new
Date
(
timestamp
);
var
YY
=
date
.
getFullYear
()
+
'-'
;
var
MM
=
(
date
.
getMonth
()
+
1
<
10
?
'0'
+
(
date
.
getMonth
()
+
1
)
:
date
.
getMonth
()
+
1
)
+
'-'
;
var
DD
=
(
date
.
getDate
()
<
10
?
'0'
+
(
date
.
getDate
())
:
date
.
getDate
());
var
hh
=
(
date
.
getHours
()
<
10
?
'0'
+
date
.
getHours
()
:
date
.
getHours
())
+
':'
;
var
mm
=
(
date
.
getMinutes
()
<
10
?
'0'
+
date
.
getMinutes
()
:
date
.
getMinutes
())
+
':'
;
var
ss
=
(
date
.
getSeconds
()
<
10
?
'0'
+
date
.
getSeconds
()
:
date
.
getSeconds
());
return
YY
+
MM
+
DD
;
}
function
get17
(
e
){
var
weekarry
=
[
1
,
2
,
3
,
4
,
5
,
6
,
7
]
return
weekarry
[
e
]
}
var
getMonthWeek
=
function
(
a
,
b
,
c
)
{
/**
* a = d = 当前日期
* b = 6 - w = 当前周的还有几天过完(不算今天)
* a + b 的和在除以7 就是当天是当前月份的第几周
*/
var
date
=
new
Date
(
a
,
parseInt
(
b
)
-
1
,
c
),
w
=
date
.
getDay
(),
d
=
date
.
getDate
();
if
(
w
==
0
){
w
=
7
;
}
var
config
=
{
getMonth
:
date
.
getMonth
()
+
1
,
getYear
:
date
.
getFullYear
(),
getWeek
:
Math
.
ceil
((
d
+
6
-
w
)
/
7
),
}
return
config
;
};
function
getfeWeek
(
date
){
let
year
=
date
.
getFullYear
()
let
month
=
date
.
getMonth
()
+
1
let
day
=
date
.
getDate
()
let
weekday
=
date
.
getUTCDay
()
console
.
log
(
weekday
)
weekday
=
get17
(
weekday
)
let
nowWeek
=
getMonthWeek
(
year
,
month
,
day
).
getWeek
let
weekStart
=
getBeforeDate
(
-
(
weekday
-
1
),
date
)
*
1000
let
weekEnd
=
getBeforeDate
((
7
-
weekday
),
date
)
*
1000
return
{
weekday
:
weekday
,
nowWeek
:
nowWeek
,
weekStart
:
weekStart
,
weekEnd
:
weekEnd
}
}
function
doksrqChange
(
value
)
{
let
zrz
=
getMonthWeek
(
value
.
getFullYear
(),
value
.
getMonth
()
+
1
,
value
.
getDate
())
console
.
log
(
zrz
)
var
rows
=
$datagrid
.
datagrid
(
"getRows"
);
if
(
rows
.
length
<=
0
){
return
true
;
...
...
@@ -239,7 +330,7 @@
$datagrid
.
datagrid
(
"updateRow"
,{
index
:
i
,
row
:{
jh
rq
:
value
.
Format
(
"yyyy-MM-dd"
)
ks
rq
:
value
.
Format
(
"yyyy-MM-dd"
)
}
})
})
...
...
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