Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
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
周远喜
mes-ui
Commits
abfe3498
Commit
abfe3498
authored
Oct 29, 2020
by
zhanglongtao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改工时页面
parent
1d9c2ce6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
356 additions
and
157 deletions
+356
-157
api.js
pages/produce/execute/api.js
+9
-0
add.vue
pages/produce/execute/taskTime/add.vue
+145
-84
index.vue
pages/produce/execute/taskTime/index.vue
+202
-73
No files found.
pages/produce/execute/api.js
View file @
abfe3498
...
...
@@ -50,6 +50,12 @@ export default {
getentryusers
(
params
)
{
return
Api
.
get
(
`
${
PlanUrl
}
/orderexecutenew/entryusers`
,
params
);
},
getusers
(
params
)
{
return
Api
.
get
(
`
${
PlanUrl
}
/orderexecutenew/getusers`
,
params
);
},
gethourinfo
(
params
)
{
return
Api
.
get
(
`
${
technologyUrl
}
workhours/gethourinfo`
,
params
);
},
//工时分配--工时列表
getentrylist
(
params
)
{
return
Api
.
post
(
`
${
technologyUrl
}
workhours/list`
,
params
);
...
...
@@ -62,6 +68,9 @@ export default {
subcreatehours
(
params
)
{
return
Api
.
post
(
`
${
technologyUrl
}
workhours/createmore`
,
params
);
},
subcreatemodelhours
(
params
)
{
return
Api
.
post
(
`
${
technologyUrl
}
workhours/createmoremodel`
,
params
);
},
//工时分配--删除一条
deletehours
(
params
)
{
return
Api
.
delete
(
`
${
technologyUrl
}
workhours/delete?id=`
+
params
);
...
...
pages/produce/execute/taskTime/add.vue
View file @
abfe3498
...
...
@@ -3,42 +3,63 @@
<div
class=
"add_user"
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"100"
>
<Row>
<!--
<Col
span=
"8"
>
<FormItem
label=
"所属车间"
>
<Select
v-model=
"entity.che"
style=
"width:200px"
>
<Option
v-for=
"item in cityList"
:value=
"item.value"
:key=
"item.value"
>
{{
item
.
label
}}
</Option>
</Select>
</FormItem>
</Col>
<Col
span=
"8"
>
<FormItem
label=
"所属班组"
>
<Select
v-model=
"entity.productName"
style=
"width:200px"
>
<Option
v-for=
"item in cityList"
:value=
"item.value"
:key=
"item.value"
>
{{
item
.
label
}}
</Option>
</Select>
</FormItem>
</Col>
<Col
span=
"8"
>
<FormItem
label=
""
>
<Input
search
enter-button
placeholder=
"请输入编号"
/>
</FormItem>
</Col>
-->
<Col
span=
"8"
>
<FormItem
label=
"所属车间"
>
<!--
<Select
v-model=
"entity.che"
style=
"width: 200px"
>
<Option
v-for=
"item in workShopList"
:value=
"item.value"
:key=
"item.value"
>
{{
item
.
label
}}
</Option>
</Select>
-->
<departmentSelect
:type=
"3"
@
on-change=
"departChange"
></departmentSelect>
</FormItem>
</Col>
<Col
span=
"8"
>
<FormItem
label=
"所属班组"
>
<!--
<Select
v-model=
"entity.productName"
style=
"width: 200px"
>
<Option
v-for=
"item in groupList"
:value=
"item.value"
:key=
"item.value"
>
{{
item
.
label
}}
</Option
>
</Select>
-->
<departmentSelect
:type=
"1"
></departmentSelect>
</FormItem>
</Col>
<Col
span=
"8"
>
<FormItem
label=
""
>
<Input
search
enter-button
v-model=
"searchStr"
placeholder=
"请输入编号/姓名"
@
click=
"searchUsers"
/>
</FormItem>
</Col>
<Col
span=
"24"
class=
"mb20"
>
<FormItem
label=
"
既定
人员"
>
<FormItem
label=
"
选择
人员"
>
<div
class=
"gd_userB"
>
<a
class=
"user_item"
v-model=
"entity.oldUserse"
@
click=
"checkItem(index)"
v-for=
"(item,index) in listMan"
v-for=
"(item,
index) in listMan"
:key=
"index"
>
<div
:class=
"
{
user_bg:item.checked
}">
<div
:class=
"
{
user_bg: item.checked
}">
<Icon
type=
"md-contact"
/>
<div
class=
"gd_user"
>
<p
class=
"user_name"
>
{{
item
.
userName
}}
</p>
<p
class=
"user_number"
>
{{
item
.
cardNo
}}
</p>
<p
class=
"user_name"
>
{{
item
.
userName
}}
</p>
<p
class=
"user_number"
>
{{
item
.
cardNo
}}
</p>
</div>
</div>
<!--
<RadioGroup
class=
"man_body"
>
v-model="item.checked"
...
...
@@ -58,22 +79,33 @@
</FormItem>
</Col>
<Col
span=
"24"
v-show=
"showSelect"
>
<FormItem
label=
"添加人员"
style=
"width:90%"
>
<UserSelect
ref=
"userSelected"
v-model=
"entity.userse"
@
on-change=
"changeUser"
/>
<FormItem
label=
"添加人员"
style=
"width: 90%"
>
<UserSelect
ref=
"userSelected"
v-model=
"entity.userse"
@
on-change=
"changeUser"
/>
<!-- :roleTitle="roleTitle" :datas="userlist" :multiple="true" -->
</FormItem>
</Col>
<Col
span=
"24"
>
<FormItem
label=
"分配工时"
prop=
"setTime"
>
<!--
<InputNumber
:max=
"30"
:min=
"0"
:step=
"1"
v-model=
"value1"
></InputNumber>
天
-->
<InputNumber
:max=
"maxHour"
:min=
"1"
:editable=
"false"
v-model=
"entity.workHour"
@
on-change=
"testChange"
></InputNumber>
工时
<InputNumber
:max=
"maxHour"
:min=
"1"
:editable=
"false"
v-model=
"entity.workHour"
@
on-change=
"testChange"
></InputNumber
>
工时
<!--
<InputNumber
:max=
"59"
:min=
"1"
v-model=
"value1"
></InputNumber>
分钟
-->
</FormItem>
</Col>
</Row>
</Form>
<Row>
<Col
span=
"24"
style=
"text-align:
right;height:60px;line-height:
60px"
>
<Col
span=
"24"
style=
"text-align:
right; height: 60px; line-height:
60px"
>
<Button
@
click=
"handleClose"
class=
"mr20"
>
取消
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
v-noClick
>
保存
</Button>
</Col>
...
...
@@ -81,49 +113,78 @@
</div>
</
template
>
<
script
>
import
Api
from
"../api"
;
export
default
{
data
()
{
return
{
entity
:
{
oldUserse
:
""
,
userse
:
null
,
workHour
:
1
workHour
:
1
,
},
// userlist:[],
userflag
:
false
,
// userlist:[],
userflag
:
false
,
showSelect
:
true
,
rules
:
{
outSideTime
:
[
{
required
:
true
,
message
:
"必填"
,
type
:
"number"
,
trigger
:
"change"
}
]
{
required
:
true
,
message
:
"必填"
,
type
:
"number"
,
trigger
:
"change"
,
},
],
},
maxHour
:
10
,
listMan
:
[
{
checked
:
false
,
userName
:
"张珊珊1"
,
cardNo
:
"08965481"
,
id
:
1
},{
checked
:
false
,
userName
:
"张珊珊2"
,
cardNo
:
"08965482"
,
id
:
2
},
]
// {
// checked: false,
// userName: "张珊珊1",
// cardNo: "08965481",
// id: 1
// },{
// checked: false,
// userName: "张珊珊2",
// cardNo: "08965482",
// id: 2
// },
],
workShopList
:
[],
groupList
:
[],
searchStr
:
""
,
};
},
created
(){},
created
()
{},
methods
:
{
departChange
(
v
,
item
)
{
let
parm
=
{
partmentId
:
v
,
search
:
""
,
};
Api
.
getusers
(
parm
).
then
((
res
)
=>
{
let
result
=
res
.
result
;
this
.
listMan
=
result
;
});
},
searchUsers
()
{
let
parm
=
{
partmentId
:
0
,
search
:
this
.
searchStr
,
};
Api
.
getusers
(
parm
).
then
((
res
)
=>
{
let
result
=
res
.
result
;
this
.
listMan
=
result
;
});
},
handleSubmit
()
{
this
.
listMan
.
map
(
item
=>
{
if
(
item
.
checked
)
{
this
.
entity
.
cardNo
=
item
.
cardNo
this
.
listMan
.
map
(
(
item
)
=>
{
if
(
item
.
checked
)
{
this
.
entity
.
cardNo
=
item
.
cardNo
;
}
})
})
;
// console.log(this.entity);
this
.
$emit
(
"on-ok"
,
this
.
entity
);
this
.
showSelect
=
true
this
.
showSelect
=
true
;
},
//单选框
radioChange
(
val
)
{
...
...
@@ -131,53 +192,53 @@ export default {
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
this
.
entity
=
{
this
.
entity
=
{
cardNo
:
""
,
oldUserse
:
null
,
userse
:
null
,
workHour
:
1
,
}
}
;
},
checkItem
(
i
)
{
if
(
this
.
userflag
)
{
this
.
$Message
.
error
(
"只能选择一人"
);
return
}
let
oldlist
=
this
.
listMan
if
(
this
.
userflag
)
{
this
.
$Message
.
error
(
"只能选择一人"
);
return
;
}
let
oldlist
=
this
.
listMan
;
oldlist
[
i
].
checked
=
!
oldlist
[
i
].
checked
;
let
oolist
=
[];
oldlist
.
map
(
u
=>
{
oldlist
.
map
(
(
u
)
=>
{
if
(
u
.
checked
)
{
oolist
.
push
(
u
);
this
.
showSelect
=
false
if
(
1
<
oolist
.
length
)
{
this
.
$Message
.
error
(
"只能选择一人"
);
this
.
listMan
[
i
].
checked
=
false
;
}
oolist
.
push
(
u
);
this
.
showSelect
=
false
;
if
(
1
<
oolist
.
length
)
{
this
.
$Message
.
error
(
"只能选择一人"
);
this
.
listMan
[
i
].
checked
=
false
;
}
}
});
oolist
.
map
(
u
=>
{
oolist
.
map
(
(
u
)
=>
{
if
(
u
.
checked
)
{
this
.
entity
.
userName
=
u
.
userName
;
this
.
entity
.
userId
=
u
.
id
this
.
showSelect
=
false
}
else
{
this
.
entity
.
userName
=
''
;
this
.
entity
.
userId
=
''
this
.
entity
.
userId
=
u
.
id
;
this
.
showSelect
=
false
;
}
else
{
this
.
entity
.
userName
=
""
;
this
.
entity
.
userId
=
""
;
}
});
if
(
oolist
.
length
==
0
)
{
this
.
showSelect
=
true
if
(
oolist
.
length
==
0
)
{
this
.
showSelect
=
true
;
}
},
// 选择新增人员
changeUser
(
data
)
{
this
.
$nextTick
(()
=>
{
let
alloterInfo
=
this
.
$refs
.
userSelected
.
getSelectItems
();
this
.
entity
.
cardNo
=
alloterInfo
[
0
].
cardNo
this
.
entity
.
userName
=
alloterInfo
[
0
].
userName
this
.
entity
.
userId
=
alloterInfo
[
0
].
id
})
changeUser
(
data
)
{
this
.
$nextTick
(()
=>
{
let
alloterInfo
=
this
.
$refs
.
userSelected
.
getSelectItems
();
this
.
entity
.
cardNo
=
alloterInfo
[
0
].
cardNo
;
this
.
entity
.
userName
=
alloterInfo
[
0
].
userName
;
this
.
entity
.
userId
=
alloterInfo
[
0
].
id
;
});
},
testChange
()
{
// 该方法在input内容改变是就会触发进行检测
...
...
@@ -196,7 +257,7 @@ export default {
}
}
return
newNumber
;
}
}
}
,
}
,
};
</
script
>
\ No newline at end of file
pages/produce/execute/taskTime/index.vue
View file @
abfe3498
<
template
>
<div
class=
"gs_set"
>
<div
style=
"text-align: center; background: wihte; height: 50px"
>
产品名称:
<span
class=
""
>
{{
topInfoShow
.
productName
}}
</span
>
工序号:
<span
class=
""
>
{{
topInfoShow
.
taskSeq
}}
</span
>
工序名称:
<span
class=
""
>
{{
topInfoShow
.
name
}}
</span
>
派工数量:
<span
class=
""
>
{{
topInfoShow
.
count
}}
</span
>
绩效单件:
<span
class=
""
>
{{
topInfoShow
.
performanceHours
}}
</span
>
绩效准结:
<span
class=
""
>
{{
topInfoShow
.
performanceWorkingHours
}}
</span>
</div>
<div
class=
"gs_top"
>
<div
class=
"gs_top_box total_time"
>
<img
src=
"@/assets/imgicon/execute/time01.png"
alt
/>
<!--
<Icon
type=
"ios-time"
/>
-->
<div
class=
"gs_bo01"
>
<span
class=
"shi"
>
总工时
</span>
<span
class=
"number"
>
{{
allHours
}}
</span>
<span
class=
"number"
>
{{
allHours
}}
</span>
</div>
</div>
<Divider
type=
"vertical"
class=
"line_slit"
/>
...
...
@@ -16,20 +30,21 @@
<img
src=
"@/assets/imgicon/execute/time02.png"
alt
/>
<div
class=
"gs_bo01"
>
<span
class=
"shi"
>
待分配
</span>
<span
class=
"number"
>
{{
waitHours
}}
</span>
<span
class=
"number"
>
{{
waitHours
}}
</span>
</div>
</div>
</div>
<div
class=
"gs_card_box"
>
<Card
class=
"gs_card"
v-for=
"(item,index) in cardMan"
:key=
"index"
>
<Card
class=
"gs_card"
v-for=
"(item,
index) in cardMan"
:key=
"index"
>
<p
slot=
"title"
class=
"gs_title"
>
{{
item
.
userTitle
}}
<
!--
<span
class=
"fr"
>
{{
item
.
cardNo
}}
</span>
--
>
{{
item
.
userTitle
}}
<
span
class=
"fr"
>
{{
item
.
userCardNo
}}
</span
>
</p>
<!--
<p
class=
"gs_p"
>
所属车间:车间A
{{
i
}}
</p>
<p
class=
"gs_p"
>
所属班组:班组B
{{
i
}}
</p>
-->
<p>
所属车间:
{{
item
.
workShopTitle
}}
</p>
<p>
所属班组:
{{
item
.
groupTitle
}}
</p>
<p
class=
"gs_time"
>
<span
class=
"b_size"
>
{{
item
.
workHour
}}
</span>
工时
<span
class=
"b_size"
>
{{
item
.
workHour
}}
</span>
工时
</p>
<!--
<p
class=
"gs_p"
>
<span
class=
"b_size"
>
100
</span>
分
...
...
@@ -38,20 +53,33 @@
<span
class=
"b_size"
>
100
</span>
秒
</p>
-->
<p
class=
"gs_footer"
>
<!--
<a
class=
"gs_edit"
@
click=
"editItem"
>
<Icon
type=
"md-create"
/>
编辑
</a>
-->
<a
class=
"gs_edit"
@
click=
"editItem"
>
<Icon
type=
"md-create"
/>
编辑
</a
>
<a
class=
"gs_del"
@
click=
"delItem(item.id)"
>
<Icon
type=
"ios-trash-outline"
/>
删除
</a>
</p>
</Card>
<a
class=
"gs_card gs_add"
@
click=
"addItem"
v-show=
"this.waitHours
!=
0"
>
<a
class=
"gs_card gs_add"
@
click=
"addItem"
v-show=
"this.waitHours
!=
0"
>
<Icon
type=
"ios-add"
/>
</a>
</div>
<!--
<div>
<Button
class=
"mr20"
>
取消
</Button>
<Button
type=
"primary"
v-noClick
>
提交
</Button>
</Col>
</Row>
</div>
-->
<!-- 新增弹框 -->
<Modal
v-model=
"addmodal"
width=
"1100"
:mask-closable=
"false"
title=
"添加人员"
footer-hide
>
<Modal
v-model=
"addmodal"
width=
"1100"
:mask-closable=
"false"
title=
"添加人员"
footer-hide
>
<addview
ref=
"addview"
@
on-close=
"cancel"
@
on-ok=
"addInfo"
></addview>
</Modal>
</div>
...
...
@@ -68,20 +96,29 @@ export default {
msg
:
"确认要删除吗?"
,
title
:
"删除确认"
,
addmodal
:
false
,
allHours
:
24
0
,
waitHours
:
20
0
,
allHours
:
0
,
waitHours
:
0
,
cardMan
:
[
// {
// userName:"张三",
// cardNo:123123,
// workHour:50,
// }
]
// userName: "张三",
// cardNo: 123123,
// workHour: 0,
// },
],
topInfoShow
:
{
productName
:
this
.
$route
.
query
.
productName
,
taskSeq
:
""
,
//工序号
taskName
:
""
,
//工序名
dispatchingNumber
:
""
,
//派工数量
qualifiedData
:
""
,
//合格数据
performanceQuasiKnot
:
""
,
//绩效单件
performanceSingleton
:
""
,
//绩效准结
},
};
},
created
()
{
// this.treeHeight = window.innerHeight - 120;
this
.
laodHorse
();
this
.
Initload
();
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
...
...
@@ -95,31 +132,112 @@ export default {
};
},
methods
:
{
// 初始化加载
Initload
()
{
let
parme
=
{
dispatchId
:
this
.
$route
.
query
.
id
,
routingDetailId
:
this
.
$route
.
query
.
routid
,
count
:
this
.
$route
.
query
.
quantity
,
};
// 最上边的信息
Api
.
gethourinfo
(
parme
).
then
((
res
)
=>
{
let
result
=
res
.
result
;
result
.
productName
=
this
.
$route
.
query
.
productName
;
this
.
topInfoShow
=
result
;
});
// 工时信息
Api
.
getallhours
(
parme
).
then
((
res
)
=>
{
if
(
res
.
result
)
{
this
.
allHours
=
res
.
result
.
allHours
;
// 总工时
this
.
waitHours
=
res
.
result
.
waitHours
;
// 待分配工时
this
.
$refs
.
addview
.
maxHour
=
this
.
waitHours
;
// 如果工时还未分配,则默认人员平均分配
if
(
this
.
allHours
==
this
.
waitHours
)
{
let
id
=
this
.
$route
.
query
.
id
;
// 获取既定users
Api
.
getentryusers
({
Id
:
id
}).
then
((
res
)
=>
{
let
result
=
res
.
result
;
// 默认工时分配
this
.
defaultWorkTime
(
result
);
this
.
waitHours
=
0
;
});
}
// 工时分配列表
this
.
getWorkTimelist
();
}
else
{
console
.
log
(
"获取失败。"
);
}
});
},
// 刷新加载
laodHorse
()
{
let
parme
=
{
dispatchId
:
this
.
$route
.
query
.
id
,
routingDetailId
:
this
.
$route
.
query
.
routid
,
count
:
this
.
$route
.
query
.
quantity
count
:
this
.
$route
.
query
.
quantity
,
};
Api
.
getallhours
(
parme
).
then
(
res
=>
{
Api
.
getallhours
(
parme
).
then
(
(
res
)
=>
{
if
(
res
.
result
)
{
this
.
allHours
=
res
.
result
.
allHours
;
this
.
waitHours
=
res
.
result
.
waitHours
;
this
.
allHours
=
res
.
result
.
allHours
;
// 总工时
this
.
waitHours
=
res
.
result
.
waitHours
;
// 待分配工时
this
.
$refs
.
addview
.
maxHour
=
this
.
waitHours
;
// 工时分配列表
this
.
getWorkTimelist
();
}
else
{
console
.
log
(
"获取失败。"
);
}
});
},
// 默认工时分配
defaultWorkTime
(
result
)
{
var
length
=
result
.
length
;
//平均工时
var
averageHour
=
this
.
allHours
/
length
;
//最后一个人的工时
var
lastHour
=
this
.
allHours
-
averageHour
*
(
length
-
1
);
let
parme
=
[];
for
(
var
i
=
0
;
i
<
length
;
i
++
)
{
var
model
=
{
userId
:
result
[
i
].
userId
,
userTitle
:
result
[
i
].
userTitle
,
userCardNo
:
result
[
i
].
userCardNo
,
groupId
:
result
[
i
].
groupId
,
groupTitle
:
result
[
i
].
groupTitle
,
workShopId
:
result
[
i
].
workShopId
,
workShopTitle
:
result
[
i
].
workShopTitle
,
workHour
:
i
==
length
-
1
?
lastHour
:
averageHour
,
dispatchId
:
this
.
$route
.
query
.
id
,
routingDetailId
:
this
.
$route
.
query
.
routid
,
count
:
this
.
$route
.
query
.
quantity
,
};
parme
.
push
(
model
);
}
this
.
cardMan
=
parme
;
// 默认工时创建
Api
.
subcreatemodelhours
(
parme
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
// 工时分配列表
this
.
getWorkTimelist
();
}
else
{
console
.
log
(
"默认工时创建失败。"
);
}
});
},
// 工时分配列表
getWorkTimelist
()
{
let
parm
=
{
conditions
:
[
{
fieldName
:
"dispatchId"
,
fieldValue
:
this
.
$route
.
query
.
id
,
conditionalType
:
"Equal"
}
]
conditionalType
:
"Equal"
,
}
,
]
,
};
Api
.
getentrylist
(
parm
).
then
(
rest
=>
{
Api
.
getentrylist
(
parm
).
then
(
(
rest
)
=>
{
if
(
rest
.
success
)
{
this
.
cardMan
=
rest
.
result
;
}
else
{
...
...
@@ -127,29 +245,7 @@ export default {
}
});
},
addItem
()
{
// let aa=this.$refs.addview.$refs.userSelected.getSelectItems()
// console.log("1",aa)
// if(this.allHours==0){
// this.$Message.info("无工时分配...")
// return
// }
this
.
addmodal
=
true
;
let
id
=
this
.
$route
.
query
.
id
;
Api
.
getentryusers
({
Id
:
id
}).
then
(
res
=>
{
let
result
=
res
.
result
;
result
.
map
(
u
=>
{
u
.
checked
=
false
;
});
this
.
$refs
.
addview
.
listMan
=
result
;
});
this
.
$refs
.
addview
.
entity
=
{
cardNo
:
""
,
oldUserse
:
null
,
userse
:
null
,
workHour
:
1
,
}
},
editItem
()
{
this
.
$Message
.
success
(
"编辑工时..."
);
},
...
...
@@ -158,7 +254,7 @@ export default {
title
:
this
.
title
,
content
:
"<p>"
+
this
.
msg
+
"</p>"
,
onOk
:
()
=>
{
Api
.
deletehours
(
itmid
).
then
(
res
=>
{
Api
.
deletehours
(
itmid
).
then
(
(
res
)
=>
{
if
(
res
.
success
)
{
this
.
laodHorse
();
this
.
$Message
.
success
(
"工时已删除"
);
...
...
@@ -166,34 +262,67 @@ export default {
this
.
$Message
.
error
(
"删除失败..."
);
}
});
}
}
,
});
},
cancel
()
{
this
.
addmodal
=
false
;
},
addInfo
(
formdata
)
{
let
parme
=
{
users
:
[
{
userTitle
:
formdata
.
userName
,
userId
:
formdata
.
userId
}
],
workHour
:
formdata
.
workHour
,
dispatchId
:
this
.
$route
.
query
.
id
,
routingDetailId
:
this
.
$route
.
query
.
routid
,
count
:
this
.
$route
.
query
.
quantity
// 打开添加分配人员页面
addItem
()
{
// let aa=this.$refs.addview.$refs.userSelected.getSelectItems()
// console.log("1",aa)
// if(this.allHours==0){
// this.$Message.info("无工时分配...")
// return
// }
this
.
addmodal
=
true
;
let
id
=
this
.
$route
.
query
.
id
;
// 既定users
// Api.getentryusers({ Id: id }).then((res) => {
// let result = res.result;
// result.map((u) => {
// u.checked = false;
// });
// this.$refs.addview.listMan = result;
// });
let
parm
=
{
partmentId
:
0
,
search
:
""
};
Api
.
getusers
(
parm
).
then
((
res
)
=>
{
let
result
=
res
.
result
;
this
.
$refs
.
addview
.
listMan
=
result
;
});
this
.
$refs
.
addview
.
entity
=
{
userCardNo
:
""
,
oldUserse
:
null
,
userse
:
null
,
workHour
:
1
,
};
Api
.
subcreatehours
(
parme
).
then
(
res
=>
{
},
// 保存 添加分配人员
addInfo
(
formdata
)
{
let
parme
=
[
{
userTitle
:
formdata
.
userName
,
userId
:
formdata
.
userId
,
userCardNo
:
formdata
.
cardNo
,
workHour
:
formdata
.
workHour
,
dispatchId
:
this
.
$route
.
query
.
id
,
routingDetailId
:
this
.
$route
.
query
.
routid
,
count
:
this
.
$route
.
query
.
quantity
,
},
];
Api
.
subcreatemodelhours
(
parme
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
laodHorse
();
this
.
addmodal
=
false
;
}
else
{
this
.
addmodal
=
true
;
this
.
laodHorse
();
this
.
addmodal
=
false
;
}
else
{
this
.
addmodal
=
true
;
}
});
}
}
}
,
}
,
};
</
script
>
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