Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
华润手术跟台
admin
Commits
97e83853
提交
97e83853
authored
10月 28, 2022
作者:
袁伟伟
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
http://git.xinwangdao.com/china-resources-surgical/admin
上级
9e0bd4e9
782cdc07
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
179 行增加
和
37 行删除
+179
-37
doctor.ts
src/api/model/doctor.ts
+11
-0
doctorApi.ts
src/api/system/doctorApi.ts
+14
-17
detail.vue
src/views/system/doctor/detail.vue
+31
-4
drawer.vue
src/views/system/doctor/drawer.vue
+5
-6
index.vue
src/views/system/doctor/index.vue
+72
-8
schema.ts
src/views/system/doctor/schema.ts
+46
-2
没有找到文件。
src/api/model/doctor.ts
浏览文件 @
97e83853
...
...
@@ -166,3 +166,14 @@ export type DoctorPageResult = PageResult<Doctor>;
export
type
DoctorPageResponse
=
ApiResponse
<
DoctorPageResult
>
;
export
type
DoctorResponse
=
ApiResponse
<
Doctor
>
;
export
interface
BatchVerifyParams
{
/**
* id数组
*/
idList
:
Array
<
number
|
string
>
;
/**
* 状态
*/
status
:
string
;
}
src/api/system/doctorApi.ts
浏览文件 @
97e83853
...
...
@@ -12,6 +12,7 @@ import {
DoctorPageResult
,
DoctorPageResponse
,
DoctorResponse
,
BatchVerifyParams
,
}
from
'../model/doctor'
;
const
baseApi
=
'/v1/system/doctor'
;
...
...
@@ -19,44 +20,37 @@ const baseApi = '/v1/system/doctor';
/**
* 新增
*/
export
const
add
=
(
entity
:
Doctor
)
=>
defHttp
.
post
<
Doctor
>
({
url
:
`
${
baseApi
}
/`
,
data
:
entity
});
export
const
add
=
(
entity
:
Doctor
)
=>
defHttp
.
post
<
Doctor
>
({
url
:
`
${
baseApi
}
/`
,
data
:
entity
});
/**
* 更新
*/
export
const
update
=
(
entity
:
Doctor
)
=>
defHttp
.
put
<
Doctor
>
({
url
:
`
${
baseApi
}
/`
,
data
:
entity
});
export
const
update
=
(
entity
:
Doctor
)
=>
defHttp
.
put
<
Doctor
>
({
url
:
`
${
baseApi
}
/`
,
data
:
entity
});
/**
* 删除
*/
export
const
remove
=
(
id
:
any
)
=>
defHttp
.
delete
<
Number
>
({
url
:
`
${
baseApi
}
/
${
id
}
`
});
export
const
remove
=
(
id
:
any
)
=>
defHttp
.
delete
<
Number
>
({
url
:
`
${
baseApi
}
/
${
id
}
`
});
/**
* 分页查询
*/
export
const
search
=
(
params
?:
DoctorParams
)
=>
defHttp
.
get
<
DoctorPageResult
>
({
url
:
`
${
baseApi
}
/search`
,
params
});
export
const
search
=
(
params
?:
DoctorParams
)
=>
defHttp
.
get
<
DoctorPageResult
>
({
url
:
`
${
baseApi
}
/search`
,
params
});
/**
* 列表查询
*/
export
const
all
=
(
params
?:
DoctorParams
)
=>
defHttp
.
get
<
DoctorPageResult
>
({
url
:
`
${
baseApi
}
/all`
,
params
});
export
const
all
=
(
params
?:
DoctorParams
)
=>
defHttp
.
get
<
DoctorPageResult
>
({
url
:
`
${
baseApi
}
/all`
,
params
});
/**
* 通过主键查询
*/
export
const
getById
=
(
id
:
any
)
=>
defHttp
.
get
<
Doctor
>
({
url
:
`
${
baseApi
}
/
${
id
}
`
});
export
const
getById
=
(
id
:
any
)
=>
defHttp
.
get
<
Doctor
>
({
url
:
`
${
baseApi
}
/
${
id
}
`
});
/**
* 单个查询
*/
export
const
getOne
=
(
params
?:
DoctorParams
)
=>
defHttp
.
get
<
Doctor
>
({
url
:
`
${
baseApi
}
/one`
,
params
});
export
const
getOne
=
(
params
?:
DoctorParams
)
=>
defHttp
.
get
<
Doctor
>
({
url
:
`
${
baseApi
}
/one`
,
params
});
/**
* 批量删除
...
...
@@ -79,7 +73,10 @@ export const batchUpdate = (entityList: Array<Doctor>) =>
/**
* 查询数量
*/
export
const
count
=
(
params
?:
DoctorParams
)
=>
defHttp
.
get
<
Number
>
({
url
:
`
${
baseApi
}
/count`
,
params
});
export
const
count
=
(
params
?:
DoctorParams
)
=>
defHttp
.
get
<
Number
>
({
url
:
`
${
baseApi
}
/count`
,
params
});
/**
* @description 批量审核,
*/
export
const
batchVerify
=
(
params
:
BatchVerifyParams
)
=>
defHttp
.
post
<
boolean
>
({
url
:
`
${
baseApi
}
/batch/verify`
,
data
:
params
});
src/views/system/doctor/detail.vue
浏览文件 @
97e83853
<
template
>
<Card
:bordered=
"false"
>
<Card
:bordered=
"false"
:loading=
"!data.isOver"
>
<template
#
extra
>
<a-space>
<a-button
type=
"primary"
v-if=
"isShowHandleEdit(data.detail.status)"
@
click=
"reload"
>
编辑
</a-button>
<a-button
type=
"primary"
v-if=
"isShowHandlePassed(data.detail.status)"
>
通过
</a-button>
<a-button
type=
"danger"
v-if=
"isShowHandleReject(data.detail.status)"
>
拒绝
</a-button>
<a-button
type=
"danger"
v-if=
"isShowHandleForbidden(data.detail.status)"
>
禁用
</a-button>
<a-button
type=
"danger"
v-if=
"isShowHandleDelete()"
>
删除
</a-button>
</a-space>
</
template
>
<Descriptions
bordered
:column=
"3"
>
<Descriptions
.
Item
v-for=
"p in displayProps"
...
...
@@ -18,7 +27,15 @@
</Card>
</template>
<
script
lang=
"ts"
setup
name=
"DeviceDetail"
>
import
{
onMounted
,
computed
,
ref
,
reactive
}
from
'vue'
;
import
{
isShowHandleEdit
,
isShowHandlePassed
,
isShowHandleForbidden
,
isShowHandleReject
,
isShowHandleDelete
,
getVerifyParams
,
}
from
'./schema'
;
import
{
onMounted
,
computed
,
ref
,
reactive
,
toRef
}
from
'vue'
;
import
{
useRoute
}
from
'vue-router'
;
import
{
ComputedRef
}
from
'@vue/reactivity'
;
import
{
Descriptions
,
Card
}
from
'ant-design-vue'
;
...
...
@@ -38,15 +55,25 @@
data
.
detail
=
res
;
});
};
const
reload
=
()
=>
{
data
.
isOver
=
false
;
data
.
detail
=
{};
DoctorApi
.
getById
(
id
.
value
).
then
((
res
:
Device
)
=>
{
data
.
isOver
=
true
;
data
.
detail
=
res
;
});
};
onMounted
(()
=>
{
getDetail
();
});
const
handleVerify
=
(
record
:
Recordable
,
status
:
string
)
=>
{
DoctorApi
.
batchVerify
(
getVerifyParams
(
record
,
status
)).
then
((
_
)
=>
{});
};
const
displayProps
:
ComputedRef
<
Array
<
any
>>
=
computed
(()
=>
{
if
(
!
data
.
isOver
)
return
{};
console
.
log
(
'descriptionColumns'
,
descriptionColumns
);
console
.
log
(
'data.detail11'
,
data
.
detail
);
const
display
:
any
=
descriptionColumns
.
map
(({
title
,
dataIndex
=
''
,
customRender
})
=>
({
key
:
dataIndex
,
title
,
...
...
src/views/system/doctor/drawer.vue
浏览文件 @
97e83853
...
...
@@ -6,7 +6,7 @@
<
script
lang=
"ts"
setup
name=
"DoctorDrawer"
>
import
{
defineEmits
,
ref
,
computed
,
unref
}
from
'vue'
;
import
{
BasicForm
,
useForm
}
from
'/@/components/Form/index'
;
import
{
formSchema
}
from
'./schema'
;
import
{
formSchema
,
StatusValEnum
}
from
'./schema'
;
import
{
BasicDrawer
,
useDrawerInner
}
from
'/@/components/Drawer'
;
import
*
as
DoctorApi
from
'/@/api/system/doctorApi'
;
...
...
@@ -40,10 +40,7 @@
try
{
const
values
=
await
validate
();
setDrawerProps
({
confirmLoading
:
true
});
const
{
hospitalId
,
...
rest
}
=
values
;
const
{
hospitalId
,
...
rest
}
=
values
;
const
action
=
!
unref
(
isUpdate
)
?
DoctorApi
.
add
:
DoctorApi
.
update
;
const
data
=
!
unref
(
isUpdate
)
?
{
...
...
@@ -51,12 +48,14 @@
hospitalId
:
hospitalId
.
value
,
hospitalName
:
hospitalId
.
label
,
}
:
Object
.
assign
({},
:
Object
.
assign
(
{},
{
...
rest
,
id
:
unref
(
entityId
),
hospitalId
:
hospitalId
.
value
,
hospitalName
:
hospitalId
.
label
,
status
:
StatusValEnum
.
PENDING_REVIEW
,
},
);
await
action
(
data
);
...
...
src/views/system/doctor/index.vue
浏览文件 @
97e83853
...
...
@@ -16,6 +16,15 @@
>
<a
href=
"#"
class=
"text-red-500"
>
删除
</a>
</a-popconfirm>
<a-popconfirm
class=
"ml-4"
title=
"确定要全部通过审核吗?"
ok-text=
"是"
cancel-text=
"否"
@
confirm=
"handleBatchPassed"
>
<a
href=
"#"
class=
"text-green-500"
>
审核通过
</a>
</a-popconfirm>
</
template
>
<
template
v-else
>
<span>
未选中任何项目
</span>
...
...
@@ -28,17 +37,48 @@
<a-button
v-auth=
"'AUTH_SYSTEM_DOCTOR:IMPORT'"
type=
"primary"
@
click=
"handleImport"
>
批量导入医生
</a-button>
</
template
>
<
template
#
bodyCell=
"{ column, record, text }"
>
<template
v-if=
"
[].includes(column.dataIndex)
"
>
<
img
:src=
"text"
class=
"photo"
alt=
"图片"
v-if=
"!!text"
/
>
<template
v-if=
"
column.dataIndex === 'status'
"
>
<
a-tag
:color=
"StatusColorEnum[text]"
>
{{
StatusEnum
[
text
]
}}
</a-tag
>
</
template
>
<
template
v-if=
"column.dataIndex === 'action'"
>
<TableAction
:actions=
"[
//待审核 才能 通过
{
label: '通过',
color: 'success',
popConfirm: {
title: '是否确认通过',
confirm: handleVerify.bind(null, record, StatusValEnum.PASSED),
},
ifShow: isShowHandlePassed(record.status),
},
//待审核 才能 拒绝
{
label: '拒绝',
color: 'error',
popConfirm: {
title: '是否确认拒绝',
confirm: handleVerify.bind(null, record, StatusValEnum.REJECT),
},
ifShow: isShowHandleReject(record.status),
},
//已通过才能禁用
{
label: '禁用',
color: 'error',
popConfirm: {
title: '是否确认禁用',
confirm: handleVerify.bind(null, record, StatusValEnum.FORBIDDEN),
},
ifShow: isShowHandleForbidden(record.status),
},
//禁用后不能再编辑
{
tooltip: '编辑',
icon: 'clarity:note-edit-line',
onClick: handleEdit.bind(null, record),
ifShow:
hasPermission('AUTH_SYSTEM_DOCTOR:EDIT'
),
ifShow:
isShowHandleEdit(record.status
),
},
{
tooltip: '详情',
...
...
@@ -53,7 +93,7 @@
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
},
ifShow:
hasPermission('AUTH_SYSTEM_DOCTOR:DELETE'
),
ifShow:
isShowHandleDelete(
),
},
]"
/>
...
...
@@ -64,9 +104,17 @@
</div>
</template>
<
script
lang=
"ts"
setup
name=
"DeviceIndex"
>
import
{
isShowHandleEdit
,
isShowHandlePassed
,
isShowHandleForbidden
,
isShowHandleReject
,
isShowHandleDelete
,
getVerifyParams
,
StatusValEnum
,
}
from
'./schema'
;
import
{
ref
}
from
'vue'
;
import
{
useGo
}
from
'/@/hooks/web/usePage'
;
import
{
usePermission
}
from
'/@/hooks/web/usePermission'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'/@/components/Table'
;
import
{
isObject
}
from
'/@/utils/is'
;
import
moment
from
'moment'
;
...
...
@@ -75,8 +123,8 @@
import
componentSetting
from
'/@/settings/componentSetting'
;
import
DoctorDrawer
from
'./drawer.vue'
;
import
{
columns
,
searchFormSchema
}
from
'./schema'
;
const
{
hasPermission
}
=
usePermission
()
;
import
{
StatusColorEnum
,
StatusEnum
}
from
'./schema'
;
import
{
BatchVerifyParams
}
from
'/@/api/model/doctor'
;
const
go
=
useGo
();
const
{
formConfig
,
showTableSetting
,
bordered
,
showIndexColumn
}
=
componentSetting
.
table
;
...
...
@@ -107,7 +155,7 @@
canResize
:
false
,
rowKey
:
(
record
:
any
)
=>
record
.
id
,
actionColumn
:
{
width
:
12
0
,
width
:
21
0
,
title
:
'操作'
,
dataIndex
:
'action'
,
...
...
@@ -148,6 +196,22 @@
});
};
const
handleVerify
=
(
record
:
Recordable
,
status
:
string
)
=>
{
DoctorApi
.
batchVerify
(
getVerifyParams
(
record
,
status
)).
then
((
_
)
=>
{
reload
();
});
};
const
handleBatchPassed
=
()
=>
{
const
params
:
BatchVerifyParams
=
{
idList
:
checkedKeys
.
value
,
status
:
StatusValEnum
.
PASSED
,
};
DoctorApi
.
batchVerify
(
params
).
then
((
_
)
=>
{
reload
();
});
};
const
handleEdit
=
(
record
:
Recordable
)
=>
{
openDrawer
(
true
,
{
record
,
...
...
src/views/system/doctor/schema.ts
浏览文件 @
97e83853
...
...
@@ -9,7 +9,9 @@
import
{
BasicColumn
}
from
'/@/components/Table'
;
import
{
FormSchema
}
from
'/@/components/Table'
;
import
{
getDistributorId
,
getHospitalId
}
from
'/@/commonSchemaProperty'
;
import
{
usePermission
}
from
'/@/hooks/web/usePermission'
;
import
{
BatchVerifyParams
}
from
'/@/api/model/doctor'
;
const
{
hasPermission
}
=
usePermission
();
export
enum
SexEnum
{
MALE
=
'男'
,
FEMALE
=
'女'
,
...
...
@@ -24,9 +26,50 @@ for (const key in SexEnum) {
export
enum
StatusEnum
{
PENDING_REVIEW
=
'待审核'
,
PASSED
=
'已通过'
,
REJECT
=
'拒绝'
,
REJECT
=
'
已
拒绝'
,
FORBIDDEN
=
'禁用'
,
}
export
enum
StatusColorEnum
{
PENDING_REVIEW
=
'processing'
,
PASSED
=
'success'
,
REJECT
=
'error'
,
FORBIDDEN
=
'default'
,
}
export
enum
StatusValEnum
{
PENDING_REVIEW
=
'PENDING_REVIEW'
,
PASSED
=
'PASSED'
,
REJECT
=
'REJECT'
,
FORBIDDEN
=
'FORBIDDEN'
,
}
export
const
isShowHandlePassed
=
(
status
:
string
):
boolean
=>
{
return
hasPermission
(
'AUTH_SYSTEM_DOCTOR:PASSED'
)
&&
status
===
'PENDING_REVIEW'
;
};
export
const
isShowHandleReject
=
(
status
:
string
):
boolean
=>
{
return
hasPermission
(
'AUTH_SYSTEM_DOCTOR:REJECT'
)
&&
status
===
'PENDING_REVIEW'
;
};
export
const
isShowHandleForbidden
=
(
status
:
string
):
boolean
=>
{
return
hasPermission
(
'AUTH_SYSTEM_DOCTOR:FORBIDDEN'
)
&&
status
===
'PASSED'
;
};
export
const
isShowHandleEdit
=
(
status
:
string
):
boolean
=>
{
return
hasPermission
(
'AUTH_SYSTEM_DOCTOR:EDIT'
)
&&
status
!==
'FORBIDDEN'
;
};
export
const
isShowHandleDelete
=
():
boolean
=>
{
return
hasPermission
(
'AUTH_SYSTEM_DOCTOR:DELETE'
);
};
/**
* @description: 返回审核所需参数
* @param record
* @param status
*/
export
const
getVerifyParams
=
(
record
:
Recordable
,
status
:
string
):
BatchVerifyParams
=>
{
const
params
:
BatchVerifyParams
=
{
idList
:
[
record
.
id
],
status
,
};
return
params
;
};
export
const
StatusEnumOptions
:
any
[]
=
[];
for
(
const
key
in
StatusEnum
)
{
StatusEnumOptions
.
push
({
...
...
@@ -167,6 +210,7 @@ export const schema = {
rules
:
[{
required
:
true
,
message
:
'请输入状态!'
}],
},
table
:
{
fixed
:
'right'
,
customRender
:
({
text
})
=>
{
const
option
=
StatusEnumOptions
.
find
((
item
)
=>
item
.
value
===
text
);
return
option
?
option
.
label
:
text
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论