Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
ferry_web
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
jianan
ferry_web
Commits
0ab0fc2e
Commit
0ab0fc2e
authored
Jul 17, 2020
by
YuleiLan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加工单列表
parent
b4e5f57c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
238 additions
and
27 deletions
+238
-27
src/views/process/list/all.vue
+194
-4
src/views/process/list/apply-process-list.vue
+2
-2
src/views/process/list/create.vue
+42
-21
No files found.
src/views/process/list/all.vue
View file @
0ab0fc2e
<
template
>
<
template
>
<div>
<div
class=
"app-container"
>
this is all.
<el-card
class=
"box-card"
>
<el-form
ref=
"listQuery"
:model=
"listQuery"
:inline=
"true"
>
<el-form-item
label=
"工单标题"
>
<el-input
v-model=
"listQuery.title"
placeholder=
"请输入工单标题"
clearable
size=
"small"
style=
"width: 240px"
@
keyup
.
enter
.
native=
"getList"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"small"
@
click=
"getList"
>
搜索
</el-button>
</el-form-item>
</el-form>
<el-table
v-loading=
"loading"
border
:data=
"ticketList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"ID"
prop=
"id"
width=
"120"
/>
<el-table-column
label=
"标题"
prop=
"title"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"当前状态"
:show-overflow-tooltip=
"true"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
state
[
0
].
label
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"当前处理人"
prop=
"principals"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"是否结束"
:show-overflow-tooltip=
"true"
width=
"80"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-tag
v-if=
"scope.row.is_end===0"
size=
"mini"
type=
"success"
>
否
</el-tag>
<el-tag
v-else
size=
"mini"
type=
"danger"
>
是
</el-tag>
</
template
>
</el-table-column>
<el-table-column
label=
"创建时间"
align=
"center"
prop=
"create_time"
width=
"180"
>
<
template
slot-scope=
"scope"
>
<span>
{{
parseTime
(
scope
.
row
.
create_time
)
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
width=
"180"
>
<
template
slot-scope=
"scope"
>
<el-button
v-permisaction=
"['process:admin:classify:edit']"
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleView(scope.row)"
>
查看
</el-button>
<el-button
v-permisaction=
"['process:admin:classify:edit']"
size=
"mini"
type=
"text"
icon=
"el-icon-position"
@
click=
"handleInversion(scope.row)"
>
转交
</el-button>
<el-button
v-permisaction=
"['process:admin:classify:edit']"
size=
"mini"
type=
"text"
icon=
"el-icon-switch-button"
@
click=
"handleUnity(scope.row)"
>
结单
</el-button>
</
template
>
</el-table-column>
</el-table>
<el-dialog
title=
"转交工单"
:visible
.
sync=
"dialogVisible"
width=
"30%"
>
<el-form
ref=
"ruleForm"
:model=
"ruleForm"
:rules=
"rules"
label-width=
"60px"
class=
"demo-ruleForm"
>
<el-form-item
label=
"节点"
prop=
"node_id"
>
<el-select
v-model=
"ruleForm.node_id"
placeholder=
"选择节点"
size=
"small"
style=
"width: 100%"
>
<el-option
v-for=
"(item, index) in nodeList"
:key=
"index"
:label=
"item.label"
:value=
"item.id"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"用户"
prop=
"user_id"
>
<el-select
v-model=
"ruleForm.user_id"
placeholder=
"选择用户"
size=
"small"
style=
"width: 100%"
>
<el-option
v-for=
"(item, index) in users"
:key=
"index"
:label=
"item.nickname"
:value=
"item.id"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"备注"
>
<el-input
v-model=
"ruleForm.remarks"
type=
"textarea"
size=
"small"
/>
</el-form-item>
<el-form-item
style=
"text-align: right"
>
<el-button
type=
"primary"
@
click=
"submitForm('ruleForm')"
>
提交
</el-button>
<el-button
@
click=
"dialogVisible = false"
>
关闭
</el-button>
</el-form-item>
</el-form>
</el-dialog>
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"queryParams.pageIndex"
:limit
.
sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
</el-card>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
workOrderList
,
unityWorkOrder
,
inversionWorkOrder
}
from
'@/api/process/work-order'
import
{
listUser
}
from
'@/api/system/sysuser'
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
users
:
[],
nodeList
:
[],
dialogVisible
:
false
,
queryParams
:
{},
total
:
0
,
loading
:
false
,
ticketList
:
[],
listQuery
:
{
page
:
1
,
per_page
:
10
},
ruleForm
:
{
work_order_id
:
''
,
node_id
:
''
,
user_id
:
''
,
remarks
:
''
},
rules
:
{
node_id
:
[
{
required
:
true
,
message
:
'请选择节点'
,
trigger
:
'change'
}
],
user_id
:
[
{
required
:
true
,
message
:
'请选择用户'
,
trigger
:
'change'
}
]
}
}
}
},
},
created
()
{
this
.
getList
()
},
methods
:
{
methods
:
{
getList
()
{
this
.
loading
=
true
this
.
listQuery
.
page
=
this
.
queryParams
.
pageIndex
this
.
listQuery
.
per_page
=
this
.
queryParams
.
pageSize
this
.
listQuery
.
classify
=
4
workOrderList
(
this
.
listQuery
).
then
(
response
=>
{
console
.
log
(
response
)
this
.
ticketList
=
response
.
data
.
data
this
.
queryParams
.
pageIndex
=
response
.
data
.
page
this
.
queryParams
.
pageSize
=
response
.
data
.
per_page
this
.
total
=
response
.
data
.
total_count
this
.
loading
=
false
})
},
handleView
(
row
)
{
this
.
$router
.
push
({
name
:
'ProcessListHandle'
,
query
:
{
workOrderId
:
row
.
id
,
processId
:
row
.
process
}})
},
handleUnity
(
row
)
{
console
.
log
(
row
)
this
.
$confirm
(
'此操作将会结束该工单, 是否继续?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
unityWorkOrder
({
work_oroder_id
:
row
.
id
}).
then
(
response
=>
{
if
(
response
.
code
===
100000
)
{
this
.
getList
()
}
})
}).
catch
(()
=>
{
this
.
$message
({
type
:
'info'
,
message
:
'已取消'
})
})
},
handleInversion
(
row
)
{
this
.
dialogVisible
=
true
this
.
ruleForm
.
work_order_id
=
row
.
id
this
.
nodeList
=
row
.
state
if
(
this
.
nodeList
.
length
===
1
)
{
this
.
ruleForm
.
node_id
=
this
.
nodeList
[
0
].
id
}
listUser
({
pageSize
:
999999
}).
then
(
response
=>
{
this
.
users
=
response
.
data
.
list
})
},
handleSelectionChange
()
{},
submitForm
(
formName
)
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
inversionWorkOrder
(
this
.
ruleForm
).
then
(
response
=>
{
if
(
response
.
code
===
100000
)
{
this
.
getList
()
this
.
dialogVisible
=
false
}
})
}
})
}
}
}
}
}
</
script
>
</
script
>
...
...
src/views/process/list/apply-process-list.vue
View file @
0ab0fc2e
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
<div
class=
"app-container"
>
<div
class=
"app-container"
>
<el-card
class=
"box-card"
>
<el-card
class=
"box-card"
>
<el-form
ref=
"listQuery"
:model=
"listQuery"
:inline=
"true"
>
<el-form
ref=
"listQuery"
:model=
"listQuery"
:inline=
"true"
>
<el-form-item
label=
"
分类
名称"
>
<el-form-item
label=
"
流程
名称"
>
<el-input
<el-input
v-model=
"listQuery.name"
v-model=
"listQuery.name"
placeholder=
"请输入
分类
名称"
placeholder=
"请输入
流程
名称"
clearable
clearable
size=
"small"
size=
"small"
style=
"width: 240px"
style=
"width: 240px"
...
...
src/views/process/list/create.vue
View file @
0ab0fc2e
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<el-card
class=
"box-card"
>
<el-card
class=
"box-card"
>
<div
class=
"text item"
>
<div
class=
"text item"
>
<el-steps
:active=
"active"
finish-status=
"success"
>
<el-steps
:active=
"active"
finish-status=
"success"
>
<template
v-for=
"(item, index) in processStructure.nodes"
>
<template
v-for=
"(item, index) in processStructure
Value
.nodes"
>
<el-step
<el-step
v-if=
"item.isHideNode === false ||
v-if=
"item.isHideNode === false ||
item.isHideNode === undefined ||
item.isHideNode === undefined ||
...
@@ -34,18 +34,19 @@
...
@@ -34,18 +34,19 @@
<span>
表单信息
</span>
<span>
表单信息
</span>
</div>
</div>
<div
class=
"text item"
>
<div
class=
"text item"
>
<
k-form-build
<
fm-generate-form
v-for=
"(tplItem, tplIndex) in processStructure.tpls"
v-for=
"(tplItem, tplIndex) in processStructure
Value
.tpls"
:key=
"tplIndex"
:key=
"tplIndex"
:ref=
"'kfd-' + tplItem.id"
:ref=
"'generateForm-'+tplItem.id"
:value=
"JSON.parse(tplItem.form_structure)"
:remote=
"remoteFunc"
:data=
"tplItem.form_structure"
/>
/>
</div>
</div>
<hr
style=
"background-color: #d9d9d9; border:0; height:1px;"
>
<hr
style=
"background-color: #d9d9d9; border:0; height:1px;"
>
<div
class=
"text item"
style=
"text-align: center;margin-top:18px"
>
<div
class=
"text item"
style=
"text-align: center;margin-top:18px"
>
<el-button
<el-button
v-for=
"(item, index) in processStructure.edges"
v-for=
"(item, index) in processStructure
Value
.edges"
v-show=
"item.source===processStructure.nodes[active].id"
v-show=
"item.source===processStructure
Value
.nodes[active].id"
:key=
"index"
:key=
"index"
type=
"primary"
type=
"primary"
@
click=
"submitAction(item.target)"
@
click=
"submitAction(item.target)"
...
@@ -58,18 +59,27 @@
...
@@ -58,18 +59,27 @@
</template>
</template>
<
script
>
<
script
>
import
Vue
from
'vue'
import
{
GenerateForm
}
from
'@/components/VueFormMaking'
import
'form-making/dist/FormMaking.css'
Vue
.
component
(
GenerateForm
.
name
,
GenerateForm
)
import
{
import
{
processStructure
,
processStructure
,
createWorkOrder
createWorkOrder
}
from
'@/api/process/work-order'
}
from
'@/api/process/work-order'
import
{
listUser
}
from
'@/api/system/sysuser'
export
default
{
export
default
{
name
:
'Create'
,
name
:
'Create'
,
data
()
{
data
()
{
return
{
return
{
active
:
0
,
active
:
0
,
processStructure
:
{},
processStructure
Value
:
{},
ruleForm
:
{
ruleForm
:
{
title
:
''
,
title
:
'
123
'
,
process
:
''
,
process
:
''
,
classify
:
''
,
classify
:
''
,
state
:
[],
state
:
[],
...
@@ -86,6 +96,17 @@ export default {
...
@@ -86,6 +96,17 @@ export default {
title
:
[
title
:
[
{
required
:
true
,
message
:
'请输入工单标题'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'请输入工单标题'
,
trigger
:
'blur'
}
]
]
},
remoteFunc
:
{
// 获取用户列表
getUserListFunc
(
resolve
)
{
listUser
({
pageSize
:
999999
}).
then
(
response
=>
{
const
options
=
response
.
data
.
list
resolve
(
options
)
})
}
}
}
}
}
},
},
...
@@ -97,7 +118,7 @@ export default {
...
@@ -97,7 +118,7 @@ export default {
processStructure
({
processStructure
({
processId
:
this
.
$route
.
query
.
processId
processId
:
this
.
$route
.
query
.
processId
}).
then
(
response
=>
{
}).
then
(
response
=>
{
this
.
processStructure
=
response
.
data
this
.
processStructure
Value
=
response
.
data
})
})
},
},
submitAction
(
target
)
{
submitAction
(
target
)
{
...
@@ -105,10 +126,10 @@ export default {
...
@@ -105,10 +126,10 @@ export default {
if
(
valid
)
{
if
(
valid
)
{
var
stateMap
=
{}
var
stateMap
=
{}
this
.
ruleForm
.
process
=
parseInt
(
this
.
$route
.
query
.
processId
)
this
.
ruleForm
.
process
=
parseInt
(
this
.
$route
.
query
.
processId
)
this
.
ruleForm
.
classify
=
this
.
processStructure
.
process
.
classify
this
.
ruleForm
.
classify
=
this
.
processStructure
Value
.
process
.
classify
stateMap
[
'id'
]
=
target
stateMap
[
'id'
]
=
target
this
.
ruleForm
.
source_state
=
this
.
processStructure
.
nodes
[
this
.
active
].
label
this
.
ruleForm
.
source_state
=
this
.
processStructure
Value
.
nodes
[
this
.
active
].
label
for
(
var
v
of
this
.
processStructure
.
nodes
)
{
for
(
var
v
of
this
.
processStructure
Value
.
nodes
)
{
if
(
v
.
id
===
target
)
{
if
(
v
.
id
===
target
)
{
if
(
v
.
assignType
!==
undefined
)
{
if
(
v
.
assignType
!==
undefined
)
{
stateMap
[
'process_method'
]
=
v
.
assignType
stateMap
[
'process_method'
]
=
v
.
assignType
...
@@ -127,10 +148,10 @@ export default {
...
@@ -127,10 +148,10 @@ export default {
'form_data'
:
[]
'form_data'
:
[]
}
}
// 绑定流程任务
// 绑定流程任务
this
.
ruleForm
.
tasks
=
this
.
processStructure
.
process
.
tasks
===
undefined
?
[]
:
this
.
processStructur
e
.
process
.
tasks
this
.
ruleForm
.
tasks
=
this
.
processStructure
Value
.
process
.
tasks
===
undefined
?
[]
:
this
.
processStructureValu
e
.
process
.
tasks
// 追加节点任务
// 追加节点任务
if
(
this
.
processStructure
.
nodes
[
this
.
active
].
task
!==
undefined
&&
this
.
processStructur
e
.
nodes
[
this
.
active
].
task
.
length
>
0
)
{
if
(
this
.
processStructure
Value
.
nodes
[
this
.
active
].
task
!==
undefined
&&
this
.
processStructureValu
e
.
nodes
[
this
.
active
].
task
.
length
>
0
)
{
for
(
var
task
of
this
.
processStructure
.
nodes
[
this
.
active
].
task
)
{
for
(
var
task
of
this
.
processStructure
Value
.
nodes
[
this
.
active
].
task
)
{
if
(
this
.
ruleForm
.
tasks
.
indexOf
(
task
)
===
-
1
)
{
if
(
this
.
ruleForm
.
tasks
.
indexOf
(
task
)
===
-
1
)
{
this
.
ruleForm
.
tasks
.
push
(
task
)
this
.
ruleForm
.
tasks
.
push
(
task
)
}
}
...
@@ -138,16 +159,16 @@ export default {
...
@@ -138,16 +159,16 @@ export default {
}
}
var
promiseList
=
[]
var
promiseList
=
[]
for
(
var
tpl
of
this
.
processStructure
.
tpls
)
{
for
(
var
tpl
of
this
.
processStructure
Value
.
tpls
)
{
this
.
ruleForm
.
tpls
.
form_structure
.
push
(
tpl
.
form_structure
)
this
.
ruleForm
.
tpls
.
form_structure
.
push
(
tpl
.
form_structure
)
promiseList
.
push
(
this
.
$refs
[
'
kfd
-'
+
tpl
.
id
][
0
].
getData
())
promiseList
.
push
(
this
.
$refs
[
'
generateForm
-'
+
tpl
.
id
][
0
].
getData
())
}
}
Promise
.
all
(
promiseList
).
then
(
values
=>
{
Promise
.
all
(
promiseList
).
then
(
values
=>
{
this
.
ruleForm
.
source
=
this
.
processStructure
.
nodes
[
this
.
active
].
id
this
.
ruleForm
.
source
=
this
.
processStructure
Value
.
nodes
[
this
.
active
].
id
this
.
ruleForm
.
tpls
.
form_data
=
values
this
.
ruleForm
.
tpls
.
form_data
=
values
createWorkOrder
(
this
.
ruleForm
).
then
(
response
=>
{
createWorkOrder
(
this
.
ruleForm
).
then
(
response
=>
{
if
(
response
.
code
===
1000
00
)
{
if
(
response
.
code
===
2
00
)
{
this
.
$router
.
push
({
name
:
'my-order
'
})
this
.
$router
.
push
({
path
:
'/process/upcoming
'
})
}
}
})
})
})
})
...
...
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