Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jilinzhongdianrenqun-web
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
吴超
jilinzhongdianrenqun-web
Commits
c02ff50e
Commit
c02ff50e
authored
Dec 30, 2025
by
yubin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://code.palacesun.com/wuchao/jilinzhongdianrenqun-web
parents
9aad480f
c573b8ff
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
285 行增加
和
115 行删除
+285
-115
src/api/key-dm-inventory.js
+1
-1
src/api/key-dm.js
+4
-4
src/view/key-person/key_dm_conf/index.vue
+1
-1
src/view/key-person/key_dm_conf/materialSelector.vue
+14
-17
src/view/key-person/key_dm_inventory/inbound.vue
+17
-4
src/view/key-person/key_dm_inventory/index.vue
+246
-87
src/view/key-person/key_dm_user/index.vue
+2
-1
没有找到文件。
src/api/key-dm-inventory.js
View file @
c02ff50e
...
...
@@ -21,7 +21,7 @@ export const getPendingBorrowList = (param) => {
// 获取历史列表
export
const
getHistoryBorrowList
=
(
param
)
=>
{
return
axios
.
request
({
url
:
'/api/keyDmBorrow/selectHistoryList'
,
url
:
'/api/
ac/jilinsscgsdp/
keyDmBorrow/selectHistoryList'
,
method
:
'post'
,
data
:
param
})
...
...
src/api/key-dm.js
View file @
c02ff50e
...
...
@@ -137,7 +137,7 @@ export const materialTemplateDownload = (param) => {
// 使用统计
export
const
getUsageStats
=
(
param
)
=>
{
return
axios
.
request
({
url
:
'/api/ac/jilinsscgsdp/keyDm
Stats
/selectUsageStats'
,
url
:
'/api/ac/jilinsscgsdp/keyDm
UserCategory
/selectUsageStats'
,
method
:
'post'
,
data
:
param
})
...
...
@@ -145,7 +145,7 @@ export const getUsageStats = (param) => {
export
const
getUsageDetails
=
(
param
)
=>
{
return
axios
.
request
({
url
:
'/api/ac/jilinsscgsdp/keyDm
Stats
/selectUsageDetails'
,
url
:
'/api/ac/jilinsscgsdp/keyDm
UserCategory
/selectUsageDetails'
,
method
:
'post'
,
data
:
param
})
...
...
@@ -154,7 +154,7 @@ export const getUsageDetails = (param) => {
// 工作量统计
export
const
getWorkloadStats
=
(
param
)
=>
{
return
axios
.
request
({
url
:
'/api/ac/jilinsscgsdp/keyDm
Stats
/selectWorkloadStats'
,
url
:
'/api/ac/jilinsscgsdp/keyDm
UserCategory
/selectWorkloadStats'
,
method
:
'post'
,
data
:
param
})
...
...
@@ -162,7 +162,7 @@ export const getWorkloadStats = (param) => {
export
const
getWorkloadDetails
=
(
param
)
=>
{
return
axios
.
request
({
url
:
'/api/ac/jilinsscgsdp/keyDm
Stats
/selectWorkloadDetails'
,
url
:
'/api/ac/jilinsscgsdp/keyDm
UserCategory
/selectWorkloadDetails'
,
method
:
'post'
,
data
:
param
})
...
...
src/view/key-person/key_dm_conf/index.vue
View file @
c02ff50e
...
...
@@ -1041,7 +1041,7 @@ export default {
}
else
{
this
.
$Notice
.
error
({
title
:
'保存失败'
,
desc
:
ret
.
data
&&
ret
.
data
.
errmsg
})
}
}).
finally
(()
=>
{
})
}).
finally
(()
=>
{})
}
}
}
...
...
src/view/key-person/key_dm_conf/materialSelector.vue
View file @
c02ff50e
...
...
@@ -2,23 +2,19 @@
<Modal
v-model=
"visible"
title=
"选择物料"
width=
"900"
:mask-closable=
"false"
>
<div
class=
"search-div"
>
<Row
type=
"flex"
:gutter=
"16"
align=
"middle"
>
<Col
:span=
"
6
"
>
<Col
:span=
"
18
"
>
<span>
分类:
</span>
<Select
v-model=
"filters.category_id"
clearable
style=
"width: 1
00%
"
>
<Option
v-for=
"c in categoryOptions"
:key=
"c.id"
:value=
"c.id"
>
{{
c
.
category_
N
ame
}}
</Option>
<Select
v-model=
"filters.category_id"
clearable
style=
"width: 1
30px"
class=
"mr10
"
>
<Option
v-for=
"c in categoryOptions"
:key=
"c.id"
:value=
"c.id"
>
{{
c
.
category_
n
ame
}}
</Option>
</Select>
</Col>
<Col
:span=
"6"
>
<span>
物料编码:
</span>
<Input
v-model=
"filters.material_code"
placeholder=
"物料编码"
/>
</Col>
<Col
:span=
"8"
>
<Input
v-model=
"filters.material_code"
placeholder=
"物料编码"
style=
"width: 150px"
class=
"mr10"
/>
<span>
物料名称:
</span>
<Input
v-model=
"filters.material_name"
placeholder=
"物料名称"
/>
<Input
v-model=
"filters.material_name"
placeholder=
"物料名称"
style=
"width: 150px"
/>
</Col>
<Col
:span=
"
4
"
class=
"text-right"
>
<Col
:span=
"
6
"
class=
"text-right"
>
<Button
type=
"primary"
class=
"mr10"
@
click=
"handleSearch"
>
搜索
</Button>
<Button
@
click=
"handleReset"
>
重置
</Button>
<Button
type=
"primary"
@
click=
"handleReset"
>
重置
</Button>
</Col>
</Row>
</div>
...
...
@@ -58,11 +54,11 @@ export default {
categoryOptions
:
[],
columns
:
[
{
type
:
'selection'
,
width
:
60
},
{
title
:
'
物料编码'
,
key
:
'material_code'
,
align
:
'center'
},
{
title
:
'物料
名称'
,
key
:
'material_name'
,
align
:
'center'
},
{
title
:
'
单位'
,
key
:
'unit'
,
align
:
'center'
,
width
:
8
0
},
{
title
:
'
可用库存'
,
key
:
'available_quantity'
,
align
:
'center'
,
width
:
12
0
},
{
title
:
'
分类'
,
key
:
'category_Name'
,
align
:
'center'
}
{
title
:
'
分类'
,
key
:
'category_name'
,
align
:
'center'
,
minWidth
:
80
},
{
title
:
'物料
编码'
,
key
:
'material_code'
,
align
:
'center'
,
minWidth
:
100
},
{
title
:
'
物料名称'
,
key
:
'material_name'
,
align
:
'center'
,
minWidth
:
10
0
},
{
title
:
'
单位'
,
key
:
'unit'
,
align
:
'center'
,
minWidth
:
8
0
},
{
title
:
'
可用库存'
,
key
:
'available_quantity'
,
align
:
'center'
,
minWidth
:
120
}
]
}
},
...
...
@@ -95,7 +91,7 @@ export default {
},
fetchList
()
{
this
.
loading
=
true
const
payload
=
{
pageNo
:
this
.
pager
.
pageNo
,
pageSize
:
this
.
pager
.
pageSize
,
params
:
this
.
filters
}
const
payload
=
Object
.
assign
({
pageNo
:
this
.
pager
.
pageNo
,
pageSize
:
this
.
pager
.
pageSize
},
this
.
filters
)
getMaterialList
(
payload
).
then
(
ret
=>
{
if
(
ret
.
data
&&
ret
.
data
.
errcode
===
0
)
{
const
data
=
ret
.
data
.
data
||
{}
...
...
@@ -146,4 +142,5 @@ export default {
.search-div
{
border
:
1px
solid
#dce1e7
;
padding
:
12px
;
margin-bottom
:
12px
;
background-color
:
#f8fbff
;
}
.mr10
{
margin-right
:
10px
;
}
.page_style
{
margin-top
:
12px
;
text-align
:
right
;
}
.text-right
{
text-align
:
right
;
}
</
style
>
src/view/key-person/key_dm_inventory/inbound.vue
View file @
c02ff50e
...
...
@@ -67,12 +67,12 @@
</div>
<Table
:data=
"tables.inbound"
:loading=
"loading.inbound"
:columns=
"inboundColumns"
border
>
<template
slot=
"action"
slot-scope=
"
{ row }">
<Poptip
confirm
title=
"确认执行入库?"
transfer
@
on-ok=
"doInbound(row)"
v-if=
"
row.inbound_status === 0
"
>
<Poptip
confirm
title=
"确认执行入库?"
transfer
@
on-ok=
"doInbound(row)"
v-if=
"
canEdit(row)
"
>
<Button
size=
"small"
type=
"success"
>
入库
</Button>
</Poptip>
<Button
size=
"small"
@
click=
"openDetail(row)"
>
详细
</Button>
<Button
size=
"small"
type=
"primary"
@
click=
"openEdit(row)"
v-if=
"canEdit(row)"
>
修改
</Button>
<Poptip
confirm
title=
"确认删除?"
transfer
@
on-ok=
"deleteInbound(row)"
>
<Poptip
confirm
title=
"确认删除?"
transfer
@
on-ok=
"deleteInbound(row)"
v-if=
"canEdit(row)"
>
<Button
size=
"small"
type=
"error"
>
删除
</Button>
</Poptip>
</
template
>
...
...
@@ -609,8 +609,21 @@ export default {
this
.
inboundModal
.
saving
=
false
})
},
canEdit
(
row
)
{
return
row
.
inbound_status
===
0
},
deleteInbound
(
row
)
{
deleteInbound
({
id
:
row
.
id
}).
then
(
ret
=>
{
if
(
ret
.
data
&&
ret
.
data
.
errcode
===
0
)
{
this
.
$Message
.
success
(
'删除成功'
);
this
.
fetchList
(
'inbound'
)
}
else
this
.
$Notice
.
error
({
title
:
'删除失败'
,
desc
:
ret
.
data
&&
ret
.
data
.
errmsg
})
})
},
canEdit
(
row
)
{
const
userId
=
this
.
$store
.
state
.
user
.
userId
return
row
.
inbound_status
===
0
&&
row
.
create_by
===
userId
},
deleteInbound
(
row
)
{
deleteInbound
({
id
:
row
.
id
}).
then
(
ret
=>
{
if
(
ret
.
data
&&
ret
.
data
.
errcode
===
0
)
{
this
.
$Message
.
success
(
'删除成功'
);
this
.
fetchList
(
'inbound'
)
}
else
{
this
.
$Notice
.
error
({
title
:
'删除失败'
,
desc
:
ret
.
data
&&
ret
.
data
.
errmsg
})
}
})
},
doInbound
(
row
)
{
doInbound
({
id
:
row
.
id
}).
then
(
ret
=>
{
if
(
ret
.
data
&&
ret
.
data
.
errcode
===
0
)
{
...
...
src/view/key-person/key_dm_inventory/index.vue
View file @
c02ff50e
...
...
@@ -4,55 +4,70 @@
<TabPane
label=
"办公用品申领"
name=
"apply"
>
<div
class=
"search-div"
>
<Row
type=
"flex"
:gutter=
"16"
>
<Col
span=
"20"
>
<div
class=
"search-form"
>
<Form
:inline=
"true"
:model=
"filters.apply"
class=
"form-inline"
>
<FormItem
label=
"申请单号:"
class=
"form-item"
>
<Col
span=
"18"
>
<span>
部门:
</span>
<Input
v-model=
"filters.apply.application_no"
placeholder=
"请输入申请单号"
class=
"form-input"
v-model=
"filters.apply.department_name"
placeholder=
"请输入部门"
class=
"mr10"
style=
"width: 200px"
/>
</FormItem>
<FormItem
label=
"申请人:"
class=
"form-item"
>
<span>
申请人:
</span>
<Input
v-model=
"filters.apply.applicant_name"
placeholder=
"请输入申请人"
class=
"form-input"
class=
"mr10"
style=
"width: 200px"
/>
</FormItem>
<FormItem
label=
"审批状态:"
class=
"form-item"
>
<span>
开始时间:
</span>
<DatePicker
v-model=
"filters.apply.startDate"
type=
"date"
format=
"yyyy-MM-dd"
value-format=
"yyyy-MM-dd"
placeholder=
"请选择开始时间"
class=
"mr10"
style=
"width: 200px"
/>
<span>
结束时间:
</span>
<DatePicker
v-model=
"filters.apply.endDate"
type=
"date"
format=
"yyyy-MM-dd"
value-format=
"yyyy-MM-dd"
placeholder=
"请选择结束时间"
class=
"mr10"
style=
"width: 200px"
/>
<br>
<span>
审批状态:
</span>
<Select
v-model=
"filters.apply.approval_status"
placeholder=
"请选择审批状态"
class=
"form-input"
class=
"mr10"
style=
"width: 200px"
>
<Option
:value=
'0'
>
待提交
</Option>
<Option
:value=
'1'
>
审核中
</Option>
<Option
:value=
'9'
>
审核通过
</Option>
<Option
:value=
'-1'
>
驳回
</Option>
</Select>
</FormItem>
<FormItem
class=
"form-item-actions"
>
<Button
type=
"primary"
@
click=
"handleSearch('apply')"
>
搜索
</Button>
<Button
@
click=
"handleReset('apply')"
style=
"margin-left: 8px;"
>
重置
</Button>
</FormItem>
</Form>
</div>
</Col>
<!-- 右侧操作按钮区:固定居右 -->
<Col
span=
"4"
class=
"action-col"
>
<Button
type=
"success"
@
click=
"openApplyModal"
>
申请
</Button>
<Col
span=
"6"
class=
"action-col"
>
<Button
type=
"primary"
class=
"mr10"
@
click=
"handleSearch('apply')"
>
搜索
</Button>
<Button
type=
"primary"
class=
"mr10"
@
click=
"handleReset('apply')"
>
重置
</Button>
<Button
type=
"primary"
class=
"mr10"
@
click=
"openApplyModal"
>
申请
</Button>
</Col>
</Row>
</div>
<Table
:data=
"tables.apply"
:loading=
"loading.apply"
:columns=
"applyColumns"
border
>
<template
slot=
"action"
slot-scope=
"
{ row }">
<Button
size=
"small"
@
click=
"openDetail(row)"
>
详细
</Button>
<Button
size=
"small"
type=
"primary"
@
click=
"openEdit(row)"
v-if=
"canEdit(row)"
>
修改
</Button>
<Button
size=
"small"
type=
"success"
@
click=
"submit(row)"
v-if=
"canSubmit(row)"
>
提交
</Button>
<Poptip
confirm
title=
"确认撤回?"
transfer
@
on-ok=
"revoke(row)"
v-if=
"canRevoke(row)"
>
<Button
size=
"small"
@
click=
"openDetail(row)"
class=
"mr5"
>
详细
</Button>
<Button
size=
"small"
type=
"primary"
class=
"mr5"
@
click=
"openEdit(row)"
v-if=
"canEdit(row)"
>
修改
</Button>
<Button
size=
"small"
type=
"success"
class=
"mr5"
@
click=
"submit(row)"
v-if=
"canSubmit(row)"
>
提交
</Button>
<Poptip
confirm
title=
"确认撤回?"
transfer
@
on-ok=
"revoke(row)"
v-if=
"canRevoke(row)"
class=
"mr5"
>
<Button
size=
"small"
type=
"warning"
>
撤回
</Button>
</Poptip>
</
template
>
...
...
@@ -74,41 +89,58 @@
<TabPane
label=
"办公用品审核历史查询"
name=
"history"
>
<div
class=
"search-div"
>
<Row
type=
"flex"
:gutter=
"16"
>
<Col
span=
"24"
>
<div
class=
"search-form"
>
<Form
:inline=
"true"
:model=
"filters.history"
class=
"form-inline"
>
<FormItem
label=
"申请单号:"
class=
"form-item"
>
<Col
span=
"18"
>
<span>
部门:
</span>
<Input
v-model=
"filters.history.application_no"
placeholder=
"请输入申请单号"
class=
"form-input"
v-model=
"filters.history.department_name"
placeholder=
"请输入部门"
class=
"mr10"
style=
"width: 200px"
/>
</FormItem>
<FormItem
label=
"申请人:"
class=
"form-item"
>
<span>
申请人:
</span>
<Input
v-model=
"filters.history.applicant_name"
placeholder=
"请输入申请人"
class=
"form-input"
class=
"mr10"
style=
"width: 200px"
/>
</FormItem>
<FormItem
label=
"审批状态:"
class=
"form-item"
>
<span>
提交开始时间:
</span>
<DatePicker
v-model=
"filters.history.startDate"
type=
"date"
format=
"yyyy-MM-dd"
value-format=
"yyyy-MM-dd"
placeholder=
"请选择开始时间"
class=
"mr10"
style=
"width: 200px"
/>
<span>
提交结束时间:
</span>
<DatePicker
v-model=
"filters.history.endDate"
type=
"date"
format=
"yyyy-MM-dd"
value-format=
"yyyy-MM-dd"
placeholder=
"请选择结束时间"
class=
"mr10"
style=
"width: 200px"
/>
<br>
<span>
审批状态:
</span>
<Select
v-model=
"filters.history.approval_status"
placeholder=
"请选择审批状态"
class=
"form-input"
class=
"mr10"
style=
"width: 200px"
>
<Option
:value=
"0"
>
待提交
</Option>
<Option
:value=
"1"
>
审核中
</Option>
<Option
:value=
"9"
>
审核通过
</Option>
<Option
:value=
"-1"
>
驳回
</Option>
</Select>
</FormItem>
<FormItem
class=
"form-item-actions"
>
<Button
type=
"primary"
@
click=
"handleSearch('history')"
>
搜索
</Button>
<Button
@
click=
"handleReset('history')"
style=
"margin-left: 8px;"
>
重置
</Button>
</FormItem>
</Form>
</div>
</Col>
<Col
span=
"6"
class=
"text-right"
>
<Button
type=
"primary"
class=
"mr10"
@
click=
"handleSearch('history')"
>
搜索
</Button>
<Button
type=
"primary"
class=
"mr10"
@
click=
"handleReset('history')"
>
重置
</Button>
</Col>
</Row>
</div>
...
...
@@ -194,6 +226,37 @@
</div>
<div
slot=
"footer"
><Button
type=
"primary"
@
click=
"detailModal.visible=false"
>
关闭
</Button></div>
</Modal>
<Modal
v-model=
"approverModal.visible"
title=
"选择审批人"
width=
"500"
>
<Form
:model=
"approverModal.form"
:label-width=
"80"
>
<FormItem
label=
"审批人:"
required
>
<Select
v-model=
"approverModal.form.approver_id"
placeholder=
"请选择审批人"
class=
"form-input"
filterable
>
<Option
v-for=
"item in approverModal.approverList"
:key=
"item.id"
:value=
"item.id"
>
{{ item.name }} {{ item.leader === 1 ? '-leader' : '' }}
</Option>
</Select>
</FormItem>
</Form>
<div
slot=
"footer"
>
<Button
@
click=
"approverModal.visible=false"
>
取消
</Button>
<Button
type=
"primary"
:loading=
"approverModal.submitting"
@
click=
"confirmSubmitWithApprover"
:disabled=
"!approverModal.form.approver_id"
>
确认提交
</Button>
</div>
</Modal>
</div>
</template>
...
...
@@ -204,17 +267,27 @@ import {
submitBorrow
,
revokeBorrow
,
getPendingBorrowList
,
getHistoryBorrowList
,
approveBorrow
,
rejectBorrow
,
getBorrowById
}
from
'@/api/key-dm-inventory'
import
MaterialSelector
from
'@/view/key-person/key_dm_conf/materialSelector.vue'
import
{
getSupplyApproval
}
from
'@/api/key-dm-user-permission'
import
{
normalizeVisitTimeValue
}
from
'@/view/key-person/key_dm_conf/dates.js'
export
default
{
name
:
'key-dm-inventory-index'
,
components
:
{
MaterialSelector
},
data
()
{
return
{
approverModal
:
{
visible
:
false
,
submitting
:
false
,
form
:
{
approver_id
:
''
},
// 选中的审批人ID
approverList
:
[],
// 审批人列表
currentBorrowId
:
''
// 暂存当前提交的申请ID
},
// 申请弹窗中的可编辑行状态
editingRowIndex
:
-
1
,
editingCellField
:
''
,
...
...
@@ -223,44 +296,53 @@ export default {
opTypeMap
:
{
'1'
:
'入库'
,
'2'
:
'出库'
},
activeTab
:
'apply'
,
filters
:
{
apply
:
{
application_no
:
''
,
applicant_name
:
''
,
approval_status
:
null
},
history
:
{
application_no
:
''
,
applicant_name
:
''
,
approval_status
:
null
}
apply
:
{
application_no
:
''
,
applicant_name
:
''
,
approval_status
:
null
,
startDate
:
null
,
endDate
:
null
},
history
:
{
application_no
:
''
,
applicant_name
:
''
,
approval_status
:
null
,
startDate
:
null
,
endDate
:
null
}
},
tables
:
{
apply
:
[],
pending
:
[],
history
:
[]
},
pagers
:
{
apply
:
{
pageNo
:
1
,
pageSize
:
10
,
totalRecord
:
0
},
pending
:
{
pageNo
:
1
,
pageSize
:
10
,
totalRecord
:
0
},
history
:
{
pageNo
:
1
,
pageSize
:
10
,
totalRecord
:
0
}
},
loading
:
{
apply
:
false
,
pending
:
false
,
history
:
false
},
applyColumns
:
[
{
type
:
'index'
,
title
:
'序号'
,
width
:
60
,
align
:
'center'
},
{
title
:
'申请单号'
,
key
:
'application_no'
,
align
:
'center'
},
{
title
:
'申请人'
,
key
:
'applicant_name'
,
align
:
'center'
},
// { title: '申请单号', key: 'application_no', align: 'center' },
{
title
:
'部门'
,
key
:
'department_name'
,
align
:
'center'
},
{
title
:
'审评用途'
,
key
:
'borrow_purpose'
,
align
:
'center'
},
{
title
:
'申请人'
,
key
:
'applicant_name'
,
align
:
'center'
},
{
title
:
'申领用途'
,
key
:
'borrow_purpose'
,
align
:
'center'
},
{
title
:
'
起止
时间'
,
key
:
's
tar
t_time'
,
title
:
'
提交申请
时间'
,
key
:
's
ubmi
t_time'
,
align
:
'center'
,
width
:
'300px'
,
render
:
(
h
,
{
row
})
=>
{
return
h
(
'span'
,
(
this
.
formatDateTime
(
row
.
create_time
)
||
row
.
create_time
||
'-'
)
+
'--'
+
(
this
.
formatDateTime
(
row
.
approval_time
)
||
row
.
approval_time
||
'-'
))
}
},
{
title
:
'时长'
,
key
:
'duration'
,
align
:
'center'
,
render
:
(
h
,
{
row
})
=>
{
const
createTime
=
Number
(
row
.
create_time
)
||
0
const
approvalTime
=
Number
(
row
.
approval_time
)
||
0
let
duration
=
null
if
(
createTime
!==
0
&&
approvalTime
!==
0
)
{
const
diffMs
=
Math
.
abs
(
approvalTime
-
createTime
)
duration
=
this
.
formatDuration
(
diffMs
)
}
else
{
duration
=
this
.
formatDuration
(
''
)
}
return
h
(
'span'
,
duration
)
}
},
return
h
(
'span'
,
this
.
formatDateTime
(
row
.
submit_time
)
||
'-'
)
}
},
// {
// title: '起止时间',
// key: 'start_time',
// align: 'center',
// width: '300px',
// render: (h, { row }) => {
// return h('span', (this.formatDateTime(row.create_time) || row.create_time || '-') + '--' + (this.formatDateTime(row.approval_time) || row.approval_time || '-'))
// }
// },
// {
// title: '时长',
// key: 'duration',
// align: 'center',
// render: (h, { row }) => {
// const createTime = Number(row.create_time) || 0
// const approvalTime = Number(row.approval_time) || 0
// let duration = null
// if (createTime !== 0 && approvalTime !== 0) {
// const diffMs = Math.abs(approvalTime - createTime)
// duration = this.formatDuration(diffMs)
// } else {
// duration = this.formatDuration('')
// }
// return h('span', duration)
// }
// },
{
title
:
'状态'
,
key
:
'approval_status'
,
...
...
@@ -273,11 +355,12 @@ export default {
],
pendingColumns
:
[
{
type
:
'index'
,
title
:
'序号'
,
width
:
60
,
align
:
'center'
},
{
title
:
'申请单号'
,
key
:
'application_no'
,
align
:
'center'
},
{
title
:
'申请人'
,
key
:
'applicant_name'
,
align
:
'center'
},
// { title: '申请单号', key: 'application_no', align: 'center' },
{
title
:
'部门'
,
key
:
'department_name'
,
align
:
'center'
},
{
title
:
'申请人'
,
key
:
'applicant_name'
,
align
:
'center'
},
{
title
:
'申请用途'
,
key
:
'borrow_purpose'
,
align
:
'center'
},
{
title
:
'提交时间'
,
title
:
'提交
申请
时间'
,
key
:
'submit_time'
,
align
:
'center'
,
render
:
(
h
,
{
row
})
=>
{
...
...
@@ -288,8 +371,10 @@ export default {
],
historyColumns
:
[
{
type
:
'index'
,
title
:
'序号'
,
width
:
60
,
align
:
'center'
},
{
title
:
'申请单号'
,
key
:
'application_no'
,
align
:
'center'
},
{
title
:
'部门'
,
key
:
'department_name'
,
align
:
'center'
},
// { title: '申请单号', key: 'application_no', align: 'center' },
{
title
:
'申请人'
,
key
:
'applicant_name'
,
align
:
'center'
},
{
title
:
'申请用途'
,
key
:
'borrow_purpose'
,
align
:
'center'
},
{
title
:
'状态'
,
key
:
'approval_status'
,
...
...
@@ -299,6 +384,14 @@ export default {
}
},
{
title
:
'提交审批时间'
,
key
:
'submit_time'
,
align
:
'center'
,
render
:
(
h
,
{
row
})
=>
{
return
h
(
'span'
,
this
.
formatDateTime
(
row
.
submit_time
)
||
'-'
)
}
},
{
title
:
'审批完成时间'
,
key
:
'approval_time'
,
align
:
'center'
,
...
...
@@ -428,8 +521,29 @@ export default {
detailModal
:
{
visible
:
false
,
loading
:
false
,
data
:
{},
details
:
[],
logs
:
[]
}
}
},
created
()
{
this
.
fetchList
(
'apply'
)
},
created
()
{
this
.
fetchList
(
'apply'
)
this
.
fetchApproverList
()
},
methods
:
{
// 新增:获取审批人列表
async
fetchApproverList
()
{
await
getSupplyApproval
().
then
(
ret
=>
{
if
(
ret
.
data
&&
ret
.
data
.
errcode
===
0
)
{
this
.
approverModal
.
approverList
=
ret
.
data
.
data
||
[]
const
leaderItem
=
this
.
approverModal
.
approverList
.
find
(
(
item
)
=>
item
.
leader
===
1
)
if
(
leaderItem
)
{
this
.
approverModal
.
form
.
approver_id
=
leaderItem
.
id
}
else
{
this
.
approverModal
.
form
.
approver_id
=
this
.
approverModal
.
approverList
[
0
].
id
}
}
else
{
this
.
$Notice
.
error
({
title
:
'获取审批人失败'
,
desc
:
ret
.
data
&&
ret
.
data
.
errmsg
})
}
})
},
// 获取当天日期,格式为 yyyy-MM-dd
getTodayDate
()
{
const
today
=
new
Date
()
...
...
@@ -509,11 +623,15 @@ export default {
if
(
name
===
'history'
)
this
.
fetchList
(
'history'
)
},
fetchList
(
tab
)
{
const
apiMap
=
{
apply
:
getBorrowList
,
pending
:
getPendingBorrowList
,
history
:
getBorrowList
}
const
apiMap
=
{
apply
:
getBorrowList
,
pending
:
getPendingBorrowList
,
history
:
get
History
BorrowList
}
const
api
=
apiMap
[
tab
];
if
(
!
api
)
return
this
.
loading
[
tab
]
=
true
// 清理空值,防止参数传递问题
const
cleanParams
=
(
obj
)
=>
{
console
.
log
(
obj
)
obj
.
startDate
=
normalizeVisitTimeValue
(
obj
.
startDate
)
obj
.
endDate
=
normalizeVisitTimeValue
(
obj
.
endDate
)
console
.
log
(
obj
)
const
cleaned
=
{}
for
(
let
key
in
obj
)
{
const
value
=
obj
[
key
]
...
...
@@ -612,15 +730,53 @@ export default {
if
(
ret
.
data
&&
ret
.
data
.
errcode
===
0
)
{
this
.
$Message
.
success
(
'保存成功'
);
this
.
applyModal
.
visible
=
false
;
this
.
fetchList
(
'apply'
)
}
else
this
.
$Notice
.
error
({
title
:
'保存失败'
,
desc
:
ret
.
data
&&
ret
.
data
.
errmsg
})
}).
finally
(()
=>
{
this
.
applyModal
.
saving
=
false
})
},
canEdit
(
row
)
{
return
row
.
approval_status
===
0
||
row
.
approval_status
===
-
1
},
canSubmit
(
row
)
{
return
row
.
approval_status
===
0
||
row
.
approval_status
===
-
1
},
canRevoke
(
row
)
{
return
row
.
approval_status
===
1
},
canEdit
(
row
)
{
const
userId
=
this
.
$store
.
state
.
user
.
userId
return
(
row
.
approval_status
===
0
&&
row
.
applicant_id
===
userId
)
||
(
row
.
approval_status
===
-
1
&&
row
.
applicant_id
===
userId
)
},
canSubmit
(
row
)
{
const
userId
=
this
.
$store
.
state
.
user
.
userId
return
(
row
.
approval_status
===
0
&&
row
.
applicant_id
===
userId
)
||
(
row
.
approval_status
===
-
1
&&
row
.
applicant_id
===
userId
)
},
canRevoke
(
row
)
{
const
userId
=
this
.
$store
.
state
.
user
.
userId
return
(
row
.
approval_status
===
1
&&
row
.
applicant_id
===
userId
)
},
submit
(
row
)
{
this
.
$Modal
.
confirm
({
title
:
'确认提交'
,
content
:
'提交后进入审批流程,是否继续?'
,
onOk
:
()
=>
{
submitBorrow
({
id
:
row
.
id
}).
then
(
ret
=>
{
if
(
ret
.
data
&&
ret
.
data
.
errcode
===
0
)
{
this
.
$Message
.
success
(
'提交成功'
);
this
.
fetchList
(
'apply'
)
}
else
this
.
$Notice
.
error
({
title
:
'提交失败'
,
desc
:
ret
.
data
&&
ret
.
data
.
errmsg
})
})
}
})
// 暂存当前申请ID
this
.
approverModal
.
currentBorrowId
=
row
.
id
// 清空上次选择的审批人
this
.
approverModal
.
form
.
approver_id
=
''
// 获取审批人列表
this
.
fetchApproverList
()
// 打开审批人选择弹窗
this
.
approverModal
.
visible
=
true
},
// 新增:确认选择审批人后提交
confirmSubmitWithApprover
()
{
const
approverId
=
this
.
approverModal
.
form
.
approver_id
if
(
!
approverId
)
{
this
.
$Message
.
warning
(
'请选择审批人'
)
return
}
this
.
approverModal
.
submitting
=
true
// 调用提交接口,携带审批人ID(需后端接口支持)
submitBorrow
({
id
:
this
.
approverModal
.
currentBorrowId
,
approver_id
:
approverId
,
// 新增审批人参数
approver_name
:
this
.
approverModal
.
form
.
approver_name
}).
then
(
ret
=>
{
if
(
ret
.
data
&&
ret
.
data
.
errcode
===
0
)
{
this
.
$Message
.
success
(
'提交成功'
)
this
.
approverModal
.
visible
=
false
this
.
fetchList
(
'apply'
)
}
else
{
this
.
$Notice
.
error
({
title
:
'提交失败'
,
desc
:
ret
.
data
&&
ret
.
data
.
errmsg
})
}
}).
finally
(()
=>
{
this
.
approverModal
.
submitting
=
false
})
},
revoke
(
row
)
{
revokeBorrow
({
id
:
row
.
id
}).
then
(
ret
=>
{
if
(
ret
.
data
&&
ret
.
data
.
errcode
===
0
)
{
this
.
$Message
.
success
(
'撤回成功'
);
this
.
fetchList
(
'apply'
)
}
else
this
.
$Notice
.
error
({
title
:
'撤回失败'
,
desc
:
ret
.
data
&&
ret
.
data
.
errmsg
})
})
},
...
...
@@ -746,4 +902,7 @@ export default {
.ivu-table-row
:hover
.edit-icon
{
opacity
:
1
;
}
.mr5
{
margin-right
:
5px
;
}
</
style
>
src/view/key-person/key_dm_user/index.vue
View file @
c02ff50e
...
...
@@ -90,6 +90,7 @@
<
script
>
import
{
getDmUserList
,
syncDmUsersByOffice
,
saveDmUser
}
from
'@/api/key-dm-user'
import
UserSelector
from
'./userSelector.vue'
import
{
normalizeVisitTimeValue
}
from
'@/view/key-person/key_dm_conf/dates.js'
export
default
{
name
:
'key-dm-user-index'
,
...
...
@@ -226,7 +227,7 @@ export default {
const
params
=
{
office_code
:
this
.
officeCode
}
this
.
$Modal
.
confirm
({
title
:
'确认同步'
,
content
:
'将同步本机构及下属机构的用户,已存在的记录会被更新
(不覆盖 null 值)
,是否继续?'
,
content
:
'将同步本机构及下属机构的用户,已存在的记录会被更新,是否继续?'
,
onOk
:
()
=>
{
this
.
loading
=
true
syncDmUsersByOffice
(
params
).
then
(
ret
=>
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论