Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
work-order-web
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
张圳龙
work-order-web
Commits
559f459e
Unverified
Commit
559f459e
authored
Sep 01, 2020
by
lyl_task
Committed by
GitHub
Sep 01, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14 from lanyulei/dev
添加主动处理功能。
parents
473f8d9a
7b05117e
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
117 additions
and
24 deletions
+117
-24
work-order.js
src/api/process/work-order.js
+9
-0
HandleNodeDetail.vue
...omponents/wfd/components/DetailPanel/HandleNodeDetail.vue
+28
-5
UserTaskDetail.vue
src/components/wfd/components/DetailPanel/UserTaskDetail.vue
+31
-8
zh-CN.js
src/components/wfd/locales/zh-CN.js
+2
-1
getters.js
src/store/getters.js
+1
-0
user.js
src/store/modules/user.js
+5
-1
handle.vue
src/views/process/list/handle.vue
+41
-9
No files found.
src/api/process/work-order.js
View file @
559f459e
...
...
@@ -62,3 +62,12 @@ export function urgeWorkOrder(params) {
params
})
}
// 主动接单
export
function
activeOrder
(
data
,
workOrderId
)
{
return
request
({
url
:
`/api/v1/work-order/active-order/
${
workOrderId
}
`
,
method
:
'put'
,
data
})
}
src/components/wfd/components/DetailPanel/HandleNodeDetail.vue
View file @
559f459e
...
...
@@ -41,7 +41,7 @@
:value=
"model.assignValue"
:multiple=
"true"
:filterable=
"true"
@
change=
"(e) =>
onChange('assignValue', e)
"
@
change=
"(e) =>
{ onChange('assignValue', e); getPersons(e) }
"
>
<el-option
v-for=
"user in users"
:key=
"user.userId"
:label=
"user.nickName===''?user.username:user.nickName"
:value=
"user.userId"
/>
</el-select>
...
...
@@ -55,7 +55,7 @@
:disabled=
"readOnly"
:multiple=
"true"
:filterable=
"true"
@
change=
"(e) =>
onChange('assignValue', e)
"
@
change=
"(e) =>
{ onChange('assignValue', e); getPersons(e) }
"
>
<el-option
v-for=
"group in groups"
:key=
"group.id"
:label=
"group.nickname===''?group.name:group.nickname"
:value=
"group.id"
/>
</el-select>
...
...
@@ -69,7 +69,7 @@
:disabled=
"readOnly"
:multiple=
"true"
:filterable=
"true"
@
change=
"(e) =>
onChange('assignValue', e)
"
@
change=
"(e) =>
{ onChange('assignValue', e); getPersons(e) }
"
>
<el-option
v-for=
"department in departments"
...
...
@@ -88,17 +88,32 @@
:disabled=
"readOnly"
:multiple=
"true"
:filterable=
"true"
@
change=
"(e) =>
onChange('assignValue', e)
"
@
change=
"(e) =>
{ onChange('assignValue', e); getPersons(e) }
"
>
<el-option
v-for=
"(item, index) in variableOptions"
:key=
"index"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</div>
<div
class=
"panelRow"
>
<el-checkbox
:disabled=
"readOnly"
:disabled=
"
model.assignValue===undefined||
model.assignValue===null||
model.assignValue.length
<
=
1
||
model
.
activeOrder
||
readOnly
"
:value=
"!!model.isCounterSign"
@
change=
"(value) => onChange('isCounterSign', value)"
>
{{
i18n
[
'handleNode.counterSign'
]
}}
</el-checkbox>
<el-checkbox
:disabled=
"
model.assignValue===undefined||
model.assignValue===null||
model.assignValue.length
<
=
1
||
model
.
isCounterSign
||
readOnly
"
:value=
"!!model.activeOrder"
@
change=
"(value) => onChange('activeOrder', value)"
>
{{
i18n
[
'handleNode.activeOrder'
]
}}
</el-checkbox>
<!--
<el-checkbox
@
change=
"(value) => onChange('isEndorsement', value)"
:disabled=
"readOnly"
:value=
"!!model.isEndorsement"
>
{{
i18n
[
'handleNode.endorsement'
]
}}
</el-checkbox>
...
...
@@ -174,6 +189,14 @@ export default {
label
:
'创建者负责人'
}]
}
},
methods
:
{
getPersons
(
e
)
{
if
(
e
===
undefined
||
e
===
null
||
e
.
length
<=
1
)
{
this
.
onChange
(
'activeOrder'
,
false
)
this
.
onChange
(
'isCounterSign'
,
false
)
}
}
}
}
</
script
>
src/components/wfd/components/DetailPanel/UserTaskDetail.vue
View file @
559f459e
...
...
@@ -41,7 +41,7 @@
:value=
"model.assignValue"
:multiple=
"true"
:filterable=
"true"
@
change=
"(e) =>
onChange('assignValue', e)
"
@
change=
"(e) =>
{ onChange('assignValue', e); getPersons(e) }
"
>
<el-option
v-for=
"user in users"
:key=
"user.userId"
:label=
"user.nickName===''?user.username:user.nickName"
:value=
"user.userId"
/>
</el-select>
...
...
@@ -55,12 +55,12 @@
:disabled=
"readOnly"
:multiple=
"true"
:filterable=
"true"
@
change=
"(e) =>
onChange('assignValue', e)
"
@
change=
"(e) =>
{ onChange('assignValue', e); getPersons(e) }
"
>
<el-option
v-for=
"group in groups"
:key=
"group.id"
:label=
"group.nickname===''?group.name:group.nickname"
:value=
"group.id"
/>
</el-select>
</div>
-->
<div
v-else-if=
"model.assignType === 'department'"
class=
"panelRow"
>
<
!--
<
div
v-else-if=
"model.assignType === 'department'"
class=
"panelRow"
>
<div><span
style=
"color: red"
>
*
</span>
{{
i18n
[
'userTask.assignType.department.title'
]
}}
:
</div>
<el-select
style=
"width:90%; font-size:12px"
...
...
@@ -69,11 +69,11 @@
:disabled=
"readOnly"
:multiple=
"true"
:filterable=
"true"
@
change=
"(e) =>
onChange('assignValue', e)
"
@
change=
"(e) =>
{ onChange('assignValue', e); getPersons(e) }
"
>
<el-option
v-for=
"department in departments"
:key=
"department.id"
:label=
"department.name===''?department.nickname:department.name"
:value=
"department.id"
/>
</el-select>
</div>
</div>
-->
<div
v-else-if=
"model.assignType === 'variable'"
class=
"panelRow"
>
<div><span
style=
"color: red"
>
*
</span>
{{
i18n
[
'userTask.assignType.variable.title'
]
}}
:
</div>
<el-select
...
...
@@ -82,17 +82,32 @@
:placeholder=
"i18n['userTask.assignType.variable.placeholder']"
:disabled=
"readOnly"
:multiple=
"true"
@
change=
"(e) =>
onChange('assignValue', e)
"
@
change=
"(e) =>
{ onChange('assignValue', e); getPersons(e) }
"
>
<el-option
v-for=
"(item, index) in variableOptions"
:key=
"index"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</div>
<div
class=
"panelRow"
>
<el-checkbox
:disabled=
"readOnly"
:value=
"!!model.isCounterSign"
:disabled=
"
model.assignValue===undefined||
model.assignValue===null||
model.assignValue.length
<
=
1
||
model
.
activeOrder
||
readOnly
"
:value=
"model.isCounterSign"
@
change=
"(value) => onChange('isCounterSign', value)"
>
{{
i18n
[
'userTask.counterSign'
]
}}
</el-checkbox>
<el-checkbox
:disabled=
"
model.assignValue===undefined||
model.assignValue===null||
model.assignValue.length
<
=
1
||
model
.
isCounterSign
||
readOnly
"
:value=
"model.activeOrder"
@
change=
"(value) => onChange('activeOrder', value)"
>
{{
i18n
[
'userTask.activeOrder'
]
}}
</el-checkbox>
<!--
<el-checkbox
@
change=
"(value) => onChange('isEndorsement', value)"
:disabled=
"readOnly"
:value=
"!!model.isEndorsement"
>
{{
i18n
[
'userTask.endorsement'
]
}}
</el-checkbox>
-->
...
...
@@ -165,6 +180,14 @@ export default {
label
:
'创建者负责人'
}]
}
},
methods
:
{
getPersons
(
e
)
{
if
(
e
===
undefined
||
e
===
null
||
e
.
length
<=
1
)
{
this
.
onChange
(
'activeOrder'
,
false
)
this
.
onChange
(
'isCounterSign'
,
false
)
}
}
}
}
</
script
>
src/components/wfd/locales/zh-CN.js
View file @
559f459e
...
...
@@ -21,6 +21,7 @@ export default {
'userTask.dueDate'
:
'到期时间'
,
'userTask.dueDate.placeholder'
:
'请选择日期'
,
'userTask.counterSign'
:
'会签'
,
'userTask.activeOrder'
:
'主动接单'
,
'userTask.endorsement'
:
'加签'
,
'conventional'
:
'常规节点'
,
'handleNode'
:
'处理节点'
,
...
...
@@ -44,7 +45,7 @@ export default {
'handleNode.dueDate.placeholder'
:
'请选择日期'
,
'handleNode.counterSign'
:
'会签'
,
'handleNode.endorsement'
:
'加签'
,
'handleNode.
task
Order'
:
'主动接单'
,
'handleNode.
active
Order'
:
'主动接单'
,
'scriptTask'
:
'任务节点'
,
'scriptTask.script'
:
'脚本'
,
'javaTask'
:
'自定义类节点'
,
...
...
src/store/getters.js
View file @
559f459e
...
...
@@ -7,6 +7,7 @@ const getters = {
token
:
state
=>
state
.
user
.
token
,
avatar
:
state
=>
state
.
user
.
avatar
,
name
:
state
=>
state
.
user
.
name
,
userId
:
state
=>
state
.
user
.
userId
,
introduction
:
state
=>
state
.
user
.
introduction
,
roles
:
state
=>
state
.
user
.
roles
,
permisaction
:
state
=>
state
.
user
.
permisaction
,
...
...
src/store/modules/user.js
View file @
559f459e
...
...
@@ -22,6 +22,9 @@ const mutations = {
SET_NAME
:
(
state
,
name
)
=>
{
state
.
name
=
name
},
SET_USERID
:
(
state
,
userId
)
=>
{
state
.
userId
=
userId
},
SET_AVATAR
:
(
state
,
avatar
)
=>
{
if
(
avatar
.
indexOf
(
'http'
)
!==
-
1
)
{
state
.
avatar
=
avatar
...
...
@@ -62,7 +65,7 @@ const actions = {
resolve
()
}
const
{
roles
,
name
,
avatar
,
introduction
,
permissions
}
=
response
.
data
const
{
userId
,
roles
,
name
,
avatar
,
introduction
,
permissions
}
=
response
.
data
// roles must be a non-empty array
if
(
!
roles
||
roles
.
length
<=
0
)
{
...
...
@@ -71,6 +74,7 @@ const actions = {
commit
(
'SET_PERMISSIONS'
,
permissions
)
commit
(
'SET_ROLES'
,
roles
)
commit
(
'SET_NAME'
,
name
)
commit
(
'SET_USERID'
,
userId
)
commit
(
'SET_AVATAR'
,
avatar
)
commit
(
'SET_INTRODUCTION'
,
introduction
)
resolve
(
response
)
...
...
src/views/process/list/handle.vue
View file @
559f459e
...
...
@@ -89,6 +89,19 @@
/>
</div>
<div
class=
"text item"
style=
"text-align: center;margin-top:18px"
>
<div
v-if=
"nodeStepList[activeIndex].activeOrder &&
processStructureValue.workOrder.state.length > 1"
>
<el-button
v-permisaction=
"['process:list:handle:active']"
type=
"primary"
@
click=
"activeOrderActive"
>
主动接单
</el-button>
</div>
<div
v-else
>
<
template
v-for=
"(item, index) in processStructureValue.edges"
>
<el-button
v-if=
"item.source===nodeStepList[activeIndex].id && processStructureValue.workOrder.is_end===0"
...
...
@@ -101,6 +114,7 @@
</
template
>
</div>
</div>
</div>
</el-card>
<el-card
class=
"box-card"
style=
"margin-top: 15px"
>
...
...
@@ -149,10 +163,13 @@ Vue.component(GenerateForm.name, GenerateForm)
import
{
processStructure
,
handleWorkOrder
handleWorkOrder
,
activeOrder
}
from
'@/api/process/work-order'
import
{
listUser
}
from
'@/api/system/sysuser'
import
{
mapGetters
}
from
'vuex'
export
default
{
data
()
{
return
{
...
...
@@ -190,6 +207,11 @@ export default {
}
}
},
computed
:
{
...
mapGetters
([
'userId'
])
},
created
()
{
this
.
getProcessNodeList
()
},
...
...
@@ -201,7 +223,6 @@ export default {
}).
then
(
response
=>
{
this
.
processStructureValue
=
response
.
data
this
.
circulationHistoryList
=
this
.
processStructureValue
.
circulationHistory
// 获取当前展示节点列表
this
.
nodeStepList
=
[]
for
(
var
i
=
0
;
i
<
this
.
processStructureValue
.
nodes
.
length
;
i
++
)
{
...
...
@@ -209,6 +230,7 @@ export default {
// 当前节点
this
.
nodeStepList
.
push
(
this
.
processStructureValue
.
nodes
[
i
])
this
.
activeIndex
=
this
.
nodeStepList
.
length
-
1
console
.
log
(
this
.
processStructureValue
.
workOrder
.
state
.
length
,
this
.
processStructureValue
.
workOrder
.
state
.
length
<=
1
)
if
(
i
+
1
===
this
.
processStructureValue
.
nodes
.
length
)
{
this
.
activeIndex
=
this
.
nodeStepList
.
length
}
...
...
@@ -234,7 +256,6 @@ export default {
for
(
var
tplDataIndex
in
this
.
tpls
)
{
this
.
tpls
[
tplDataIndex
].
tplValue
=
values
[
tplDataIndex
]
}
console
.
log
(
this
.
tpls
)
handleWorkOrder
({
tasks
:
this
.
processStructureValue
.
process
.
task
,
source_state
:
this
.
processStructureValue
.
workOrder
.
current_state
,
...
...
@@ -258,6 +279,17 @@ export default {
if
(
this
.
processStructureValue
.
workOrder
.
is_end
===
1
)
{
this
.
alertMessage
=
'当前工单已结束。'
}
},
activeOrderActive
()
{
var
jsonData
=
[{
id
:
this
.
nodeStepList
[
this
.
activeIndex
].
id
,
label
:
this
.
nodeStepList
[
this
.
activeIndex
].
label
,
process_method
:
'person'
,
processor
:
[
this
.
userId
]
}]
activeOrder
(
jsonData
,
this
.
$route
.
query
.
workOrderId
).
then
(
response
=>
{
this
.
getProcessNodeList
()
})
}
}
}
...
...
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