Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
华润手术跟台
admin
Commits
1134229d
提交
1134229d
authored
10月 28, 2022
作者:
leon
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
收货人管理 ,经销商id fix
上级
598901dd
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
242 行增加
和
54 行删除
+242
-54
receiver.ts
src/api/model/receiver.ts
+11
-0
receiverApi.ts
src/api/system/receiverApi.ts
+13
-15
user.ts
src/store/modules/user.ts
+2
-2
schema.ts
src/views/system/doctor/schema.ts
+10
-2
index.vue
src/views/system/receiver/index.vue
+82
-6
schema.ts
src/views/system/receiver/schema.ts
+124
-29
没有找到文件。
src/api/model/receiver.ts
浏览文件 @
1134229d
...
...
@@ -141,3 +141,14 @@ export type ReceiverPageResult = PageResult<Receiver>;
export
type
ReceiverPageResponse
=
ApiResponse
<
ReceiverPageResult
>
;
export
type
ReceiverResponse
=
ApiResponse
<
Receiver
>
;
export
interface
BatchVerifyParams
{
/**
* id数组
*/
idList
:
Array
<
number
|
string
>
;
/**
* 状态
*/
status
:
string
;
}
src/api/system/receiverApi.ts
浏览文件 @
1134229d
...
...
@@ -13,26 +13,24 @@ import {
ReceiverPageResponse
,
ReceiverResponse
,
}
from
'../model/receiver'
;
import
{
BatchVerifyParams
}
from
'/@/api/model/receiver'
;
const
baseApi
=
'/v1/system/receiver'
;
/**
* 新增
*/
export
const
add
=
(
entity
:
Receiver
)
=>
defHttp
.
post
<
Receiver
>
({
url
:
`
${
baseApi
}
/`
,
data
:
entity
});
export
const
add
=
(
entity
:
Receiver
)
=>
defHttp
.
post
<
Receiver
>
({
url
:
`
${
baseApi
}
/`
,
data
:
entity
});
/**
* 更新
*/
export
const
update
=
(
entity
:
Receiver
)
=>
defHttp
.
put
<
Receiver
>
({
url
:
`
${
baseApi
}
/`
,
data
:
entity
});
export
const
update
=
(
entity
:
Receiver
)
=>
defHttp
.
put
<
Receiver
>
({
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
}
`
});
/**
* 分页查询
...
...
@@ -43,20 +41,17 @@ export const search = (params?: ReceiverParams) =>
/**
* 列表查询
*/
export
const
all
=
(
params
?:
ReceiverParams
)
=>
defHttp
.
get
<
ReceiverPageResult
>
({
url
:
`
${
baseApi
}
/all`
,
params
});
export
const
all
=
(
params
?:
ReceiverParams
)
=>
defHttp
.
get
<
ReceiverPageResult
>
({
url
:
`
${
baseApi
}
/all`
,
params
});
/**
* 通过主键查询
*/
export
const
getById
=
(
id
:
any
)
=>
defHttp
.
get
<
Receiver
>
({
url
:
`
${
baseApi
}
/
${
id
}
`
});
export
const
getById
=
(
id
:
any
)
=>
defHttp
.
get
<
Receiver
>
({
url
:
`
${
baseApi
}
/
${
id
}
`
});
/**
* 单个查询
*/
export
const
getOne
=
(
params
?:
ReceiverParams
)
=>
defHttp
.
get
<
Receiver
>
({
url
:
`
${
baseApi
}
/one`
,
params
});
export
const
getOne
=
(
params
?:
ReceiverParams
)
=>
defHttp
.
get
<
Receiver
>
({
url
:
`
${
baseApi
}
/one`
,
params
});
/**
* 批量删除
...
...
@@ -79,7 +74,10 @@ export const batchUpdate = (entityList: Array<Receiver>) =>
/**
* 查询数量
*/
export
const
count
=
(
params
?:
ReceiverParams
)
=>
defHttp
.
get
<
Number
>
({
url
:
`
${
baseApi
}
/count`
,
params
});
export
const
count
=
(
params
?:
ReceiverParams
)
=>
defHttp
.
get
<
Number
>
({
url
:
`
${
baseApi
}
/count`
,
params
});
/**
* @description 批量审核,
*/
export
const
batchVerify
=
(
params
:
BatchVerifyParams
)
=>
defHttp
.
post
<
boolean
>
({
url
:
`
${
baseApi
}
/batch/verify`
,
data
:
params
});
src/store/modules/user.ts
浏览文件 @
1134229d
...
...
@@ -64,8 +64,8 @@ export const useUserStore = defineStore({
/**
* @description 经销商id 华润是0 其他不是
*/
getDistributorId
():
number
|
null
{
return
this
.
userInfo
?.
distributorId
||
getAuthCache
<
User
>
(
USER_INFO_KEY
)?.
distributorId
||
null
;
getDistributorId
():
number
{
return
this
.
userInfo
?.
distributorId
as
number
;
},
},
actions
:
{
...
...
src/views/system/doctor/schema.ts
浏览文件 @
1134229d
...
...
@@ -11,6 +11,8 @@ import { FormSchema } from '/@/components/Table';
import
{
getDistributorId
,
getHospitalId
}
from
'/@/commonSchemaProperty'
;
import
{
usePermission
}
from
'/@/hooks/web/usePermission'
;
import
{
BatchVerifyParams
}
from
'/@/api/model/doctor'
;
import
{
useUserStore
}
from
'/@/store/modules/user'
;
const
userStore
=
useUserStore
();
const
{
hasPermission
}
=
usePermission
();
export
enum
SexEnum
{
MALE
=
'男'
,
...
...
@@ -149,7 +151,7 @@ export const schema = {
},
colProps
,
component
:
'Input'
,
rules
:
[{
required
:
false
,
message
:
'请输入手机号!
'
}],
rules
:
[{
pattern
:
/^1
[
3456789
]\d{9}
$/
,
message
:
'请输入正确的手机号码!'
,
trigger
:
'blur
'
}],
},
table
:
{},
},
...
...
@@ -335,7 +337,13 @@ const descriptionFields = [
];
export
const
searchFormSchema
:
FormSchema
[]
=
schema
.
properties
.
filter
((
item
)
=>
queryFields
.
includes
(
item
.
field
))
.
filter
((
item
)
=>
{
if
(
item
.
field
===
'distributorId'
)
{
return
queryFields
.
includes
(
item
.
field
)
&&
userStore
.
getDistributorId
===
0
;
}
else
{
return
queryFields
.
includes
(
item
.
field
);
}
})
.
map
(
({
field
,
label
,
form
:
{
rules
=
[],
...
formProps
}
})
=>
({
...
...
src/views/system/receiver/index.vue
浏览文件 @
1134229d
...
...
@@ -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>
...
...
@@ -36,11 +45,47 @@
<
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_RECEIVER:EDIT'),
ifShow: isShowHandleEdit(record.status),
},
{
tooltip: '详情',
icon: 'ant-design:eye-outlined',
onClick: handleView.bind(null, record),
},
{
tooltip: '删除',
...
...
@@ -50,7 +95,7 @@
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
},
ifShow:
hasPermission('AUTH_SYSTEM_RECEIVER:DELETE'
),
ifShow:
isShowHandleDelete(
),
},
]"
/>
...
...
@@ -72,11 +117,20 @@
import
componentSetting
from
'/@/settings/componentSetting'
;
import
ReceiverDrawer
from
'./drawer.vue'
;
import
{
columns
,
searchFormSchema
}
from
'./schema'
;
const
{
hasPermission
}
=
usePermission
();
import
{
isShowHandleEdit
,
isShowHandlePassed
,
isShowHandleForbidden
,
isShowHandleReject
,
isShowHandleDelete
,
getVerifyParams
,
StatusValEnum
,
}
from
'./schema'
;
import
{
BatchVerifyParams
}
from
'/@/api/model/doctor'
;
import
{
useUserStore
}
from
'/@/store/modules/user'
;
const
go
=
useGo
();
const
{
formConfig
,
showTableSetting
,
bordered
,
showIndexColumn
}
=
componentSetting
.
table
;
const
userStore
=
useUserStore
();
const
checkedKeys
=
ref
<
Array
<
string
|
number
>>
([]);
const
onSelectChange
=
(
selectedRowKeys
:
(
string
|
number
)[])
=>
{
checkedKeys
.
value
=
selectedRowKeys
;
...
...
@@ -104,7 +158,7 @@
canResize
:
false
,
rowKey
:
(
record
:
any
)
=>
record
.
id
,
actionColumn
:
{
width
:
8
0
,
width
:
21
0
,
title
:
'操作'
,
dataIndex
:
'action'
,
...
...
@@ -133,9 +187,31 @@
}
}
});
// 如果是经销商,只能看到自己的数据
if
(
userStore
.
getDistributorId
!==
0
)
{
handledParams
.
distributorId
=
userStore
.
getDistributorId
;
}
else
if
(
userStore
.
getDistributorId
==
null
)
{
handledParams
.
distributorId
=
-
1
;
}
return
handledParams
;
};
const
handleVerify
=
(
record
:
Recordable
,
status
:
string
)
=>
{
ReceiverApi
.
batchVerify
(
getVerifyParams
(
record
,
status
)).
then
((
_
)
=>
{
reload
();
});
};
const
handleBatchPassed
=
()
=>
{
const
params
:
BatchVerifyParams
=
{
idList
:
checkedKeys
.
value
,
status
:
StatusValEnum
.
PASSED
,
};
ReceiverApi
.
batchVerify
(
params
).
then
((
_
)
=>
{
reload
();
});
};
const
handleCreate
=
()
=>
{
openDrawer
(
true
,
{
isUpdate
:
false
,
...
...
src/views/system/receiver/schema.ts
浏览文件 @
1134229d
...
...
@@ -8,7 +8,13 @@
import
{
BasicColumn
}
from
'/@/components/Table'
;
import
{
FormSchema
}
from
'/@/components/Table'
;
import
{
SexEnum
,
StatusEnumOptions
}
from
'/@/views/system/doctor/schema'
;
import
{
getDistributorId
}
from
'/@/commonSchemaProperty'
;
import
{
usePermission
}
from
'/@/hooks/web/usePermission'
;
import
{
BatchVerifyParams
}
from
'/@/api/model/receiver'
;
import
{
useUserStore
}
from
'/@/store/modules/user'
;
const
{
hasPermission
}
=
usePermission
();
const
userStore
=
useUserStore
();
export
enum
YesNoEnum
{
YES
=
'是'
,
NO
=
'否'
,
...
...
@@ -21,6 +27,61 @@ for (const key in YesNoEnum) {
});
}
export
enum
StatusEnum
{
PENDING_REVIEW
=
'待审核'
,
PASSED
=
'已通过'
,
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
StatusOptions
:
any
[]
=
[];
for
(
const
key
in
StatusEnum
)
{
StatusOptions
.
push
({
value
:
key
,
label
:
SexEnum
[
key
],
});
}
export
const
isShowHandlePassed
=
(
status
:
string
):
boolean
=>
{
return
hasPermission
(
'AUTH_SYSTEM_RECEIVER:PASSED'
)
&&
status
===
'PENDING_REVIEW'
;
};
export
const
isShowHandleReject
=
(
status
:
string
):
boolean
=>
{
return
hasPermission
(
'AUTH_SYSTEM_RECEIVER:REJECT'
)
&&
status
===
'PENDING_REVIEW'
;
};
export
const
isShowHandleForbidden
=
(
status
:
string
):
boolean
=>
{
return
hasPermission
(
'AUTH_SYSTEM_RECEIVER:FORBIDDEN'
)
&&
status
===
'PASSED'
;
};
export
const
isShowHandleEdit
=
(
status
:
string
):
boolean
=>
{
return
hasPermission
(
'AUTH_SYSTEM_RECEIVER:EDIT'
)
&&
status
!==
'FORBIDDEN'
;
};
export
const
isShowHandleDelete
=
():
boolean
=>
{
return
hasPermission
(
'AUTH_SYSTEM_RECEIVER:DELETE'
);
};
/**
* @description: 返回审核所需参数
* @param record
* @param status
*/
export
const
getVerifyParams
=
(
record
:
Recordable
,
status
:
string
):
BatchVerifyParams
=>
{
const
params
:
BatchVerifyParams
=
{
idList
:
[
record
.
id
],
status
,
};
return
params
;
};
const
colProps
=
{
xs
:
{
span
:
24
},
sm
:
{
span
:
24
},
lg
:
{
span
:
8
}
};
const
colPropsInDrawer
=
{
span
:
24
};
...
...
@@ -43,21 +104,7 @@ export const schema = {
},
table
:
{},
},
{
field
:
'distributorId'
,
label
:
'经销商id'
,
defaultValue
:
undefined
,
form
:
{
componentProps
:
{
allowClear
:
false
,
placeholder
:
'经销商id'
,
},
colProps
,
component
:
'InputNumber'
,
rules
:
[{
required
:
true
,
message
:
'请输入经销商id!'
}],
},
table
:
{},
},
getDistributorId
({
colProps
}),
{
field
:
'logisticsMode'
,
label
:
'物流方式'
,
...
...
@@ -74,13 +121,14 @@ export const schema = {
},
{
field
:
'receiveName'
,
label
:
'
接收人
姓名'
,
label
:
'姓名'
,
defaultValue
:
undefined
,
form
:
{
componentProps
:
{
allowClear
:
true
,
placeholder
:
'
接收人
姓名'
,
placeholder
:
'姓名'
,
},
rules
:
[{
required
:
true
,
message
:
'请输入姓名!'
}],
colProps
,
component
:
'Input'
,
},
...
...
@@ -88,15 +136,19 @@ export const schema = {
},
{
field
:
'receivePhone'
,
label
:
'
接收人
电话'
,
label
:
'电话'
,
defaultValue
:
undefined
,
form
:
{
componentProps
:
{
allowClear
:
true
,
placeholder
:
'
接收人
电话'
,
placeholder
:
'电话'
,
},
colProps
,
component
:
'Input'
,
rules
:
[
{
required
:
true
,
message
:
'请输入电话!'
},
{
pattern
:
/^1
[
3456789
]\d{9}
$/
,
message
:
'请输入正确的手机号码!'
,
trigger
:
'blur'
},
],
},
table
:
{},
},
...
...
@@ -111,11 +163,12 @@ export const schema = {
},
component
:
'InputTextArea'
,
colProps
:
{
span
:
24
},
required
:
true
,
},
table
:
{},
},
{
field
:
'
status
'
,
field
:
'
isDefault
'
,
label
:
'是否默认'
,
defaultValue
:
'NO'
,
form
:
{
...
...
@@ -134,6 +187,45 @@ export const schema = {
},
},
},
{
field
:
'status'
,
label
:
'状态'
,
defaultValue
:
'PENDING_REVIEW'
,
form
:
{
componentProps
:
{
allowClear
:
false
,
placeholder
:
'状态'
,
options
:
StatusEnumOptions
,
},
colProps
,
component
:
'Select'
,
rules
:
[{
required
:
true
,
message
:
'请输入状态!'
}],
},
table
:
{
fixed
:
'right'
,
customRender
:
({
text
})
=>
{
const
option
=
StatusEnumOptions
.
find
((
item
)
=>
item
.
value
===
text
);
return
option
?
option
.
label
:
text
;
},
},
},
{
field
:
'attachment'
,
label
:
'照片'
,
defaultValue
:
undefined
,
form
:
{
componentProps
:
{
allowClear
:
true
,
placeholder
:
'照片'
,
maxNumber
:
1
,
multiple
:
false
,
},
colProps
,
component
:
'Upload'
,
rules
:
[{
required
:
true
,
message
:
'请上传'
}],
},
table
:
{},
},
{
field
:
'remark'
,
label
:
'备注'
,
...
...
@@ -216,29 +308,27 @@ export const schema = {
};
const
queryFields
=
[
'id'
,
//
'id',
'distributorId'
,
'logisticsMode'
,
'receiveName'
,
'receivePhone'
,
'status'
,
'remark'
,
'editorId'
,
//
'editorId',
'editorName'
,
'createTime'
,
'updateTime'
,
];
const
editFields
=
[
'
distributorId'
,
'logisticsMode'
,
'receiveName'
,
'receivePhone'
,
'address'
,
'statu
s'
,
'remark'
];
const
editFields
=
[
'
receiveName'
,
'receivePhone'
,
'addres
s'
,
'remark'
];
const
tableFields
=
[
'id'
,
'distributorId'
,
'logisticsMode'
,
'receiveName'
,
'receivePhone'
,
'address'
,
'status'
,
'remark'
,
'editorId'
,
//
'editorId',
'editorName'
,
'createTime'
,
'updateTime'
,
...
...
@@ -246,7 +336,6 @@ const tableFields = [
const
descriptionFields
=
[
'id'
,
'distributorId'
,
'logisticsMode'
,
'receiveName'
,
'receivePhone'
,
'address'
,
...
...
@@ -259,7 +348,13 @@ const descriptionFields = [
];
export
const
searchFormSchema
:
FormSchema
[]
=
schema
.
properties
.
filter
((
item
)
=>
queryFields
.
includes
(
item
.
field
))
.
filter
((
item
)
=>
{
if
(
item
.
field
===
'distributorId'
)
{
return
queryFields
.
includes
(
item
.
field
)
&&
userStore
.
getDistributorId
===
0
;
}
else
{
return
queryFields
.
includes
(
item
.
field
);
}
})
.
map
(
({
field
,
label
,
form
:
{
rules
=
[],
...
formProps
}
})
=>
({
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论