Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
华润手术跟台
admin
Commits
deb06025
提交
deb06025
authored
11月 08, 2022
作者:
袁伟伟
浏览文件
操作
浏览文件
下载
差异文件
fix:合并
上级
e25e247f
e9bb2511
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
232 行增加
和
145 行删除
+232
-145
operationOrderApi.ts
src/api/order/operationOrderApi.ts
+11
-26
index.ts
src/commonSchemaProperty/index.ts
+65
-5
BasicForm.vue
src/components/Form/src/BasicForm.vue
+0
-3
ApiSelect.vue
src/components/Form/src/components/ApiSelect.vue
+10
-5
detail.vue
src/views/order/operation-order/detail.vue
+25
-19
drawer.vue
src/views/order/operation-order/drawer.vue
+55
-18
index.vue
src/views/order/operation-order/index.vue
+34
-15
schema.ts
src/views/order/operation-order/schema.ts
+19
-39
index.vue
src/views/system/doctor/index.vue
+1
-1
drawer.vue
src/views/system/user/drawer.vue
+12
-14
没有找到文件。
src/api/order/operationOrderApi.ts
浏览文件 @
deb06025
...
...
@@ -5,81 +5,66 @@
*/
import
{
defHttp
}
from
'/@/utils/http/axios'
;
import
{
ApiResponse
}
from
'../model/baseModel'
;
import
{
OperationOrder
,
OperationOrderParams
,
OperationOrderPageResult
,
OperationOrderPageResponse
,
OperationOrderResponse
,
}
from
'../model/operationOrder'
;
const
baseApi
=
'/v1/order/operation-order'
;
/**
* 新增
*/
export
const
add
=
(
entity
:
OperationOrder
)
=>
defHttp
.
post
<
OperationOrder
>
({
url
:
`
${
baseApi
}
/`
,
data
:
entity
});
export
const
add
=
(
entity
:
OperationOrder
)
=>
defHttp
.
post
<
OperationOrder
>
({
url
:
`
${
baseApi
}
/`
,
data
:
entity
});
/**
* 更新
*/
export
const
update
=
(
entity
:
OperationOrder
)
=>
defHttp
.
put
<
OperationOrder
>
({
url
:
`
${
baseApi
}
/`
,
data
:
entity
});
export
const
update
=
(
entity
:
OperationOrder
)
=>
defHttp
.
put
<
OperationOrder
>
({
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
?:
OperationOrderParams
)
=>
defHttp
.
get
<
OperationOrderPageResult
>
({
url
:
`
${
baseApi
}
/search`
,
params
});
export
const
search
=
(
params
?:
OperationOrderParams
)
=>
defHttp
.
get
<
OperationOrderPageResult
>
({
url
:
`
${
baseApi
}
/search`
,
params
});
/**
* 列表查询
*/
export
const
all
=
(
params
?:
OperationOrderParams
)
=>
defHttp
.
get
<
OperationOrderPageResult
>
({
url
:
`
${
baseApi
}
/all`
,
params
});
export
const
all
=
(
params
?:
OperationOrderParams
)
=>
defHttp
.
get
<
OperationOrderPageResult
>
({
url
:
`
${
baseApi
}
/all`
,
params
});
/**
* 通过主键查询
*/
export
const
getById
=
(
id
:
any
)
=>
defHttp
.
get
<
OperationOrder
>
({
url
:
`
${
baseApi
}
/
${
id
}
`
});
export
const
getById
=
(
id
:
any
)
=>
defHttp
.
get
<
OperationOrder
>
({
url
:
`
${
baseApi
}
/
${
id
}
`
});
/**
* 单个查询
*/
export
const
getOne
=
(
params
?:
OperationOrderParams
)
=>
defHttp
.
get
<
OperationOrder
>
({
url
:
`
${
baseApi
}
/one`
,
params
});
export
const
getOne
=
(
params
?:
OperationOrderParams
)
=>
defHttp
.
get
<
OperationOrder
>
({
url
:
`
${
baseApi
}
/one`
,
params
});
/**
* 批量删除
*/
export
const
batchRemove
=
(
idList
:
Array
<
any
>
)
=>
defHttp
.
post
<
boolean
>
({
url
:
`
${
baseApi
}
/batch-delete`
,
data
:
idList
});
export
const
batchRemove
=
(
idList
:
Array
<
any
>
)
=>
defHttp
.
post
<
boolean
>
({
url
:
`
${
baseApi
}
/batch-delete`
,
data
:
idList
});
/**
* 批量新增
*/
export
const
batchAdd
=
(
entityList
:
Array
<
OperationOrder
>
)
=>
defHttp
.
post
<
boolean
>
({
url
:
`
${
baseApi
}
/batch-save`
,
data
:
entityList
});
export
const
batchAdd
=
(
entityList
:
Array
<
OperationOrder
>
)
=>
defHttp
.
post
<
boolean
>
({
url
:
`
${
baseApi
}
/batch-save`
,
data
:
entityList
});
/**
* 批量更新
*/
export
const
batchUpdate
=
(
entityList
:
Array
<
OperationOrder
>
)
=>
defHttp
.
post
<
boolean
>
({
url
:
`
${
baseApi
}
/batch-update`
,
data
:
entityList
});
export
const
batchUpdate
=
(
entityList
:
Array
<
OperationOrder
>
)
=>
defHttp
.
post
<
boolean
>
({
url
:
`
${
baseApi
}
/batch-update`
,
data
:
entityList
});
/**
* 查询数量
*/
export
const
count
=
(
params
?:
OperationOrderParams
)
=>
defHttp
.
get
<
Number
>
({
url
:
`
${
baseApi
}
/count`
,
params
});
export
const
count
=
(
params
?:
OperationOrderParams
)
=>
defHttp
.
get
<
Number
>
({
url
:
`
${
baseApi
}
/count`
,
params
});
src/commonSchemaProperty/index.ts
浏览文件 @
deb06025
...
...
@@ -4,6 +4,12 @@
import
*
as
DistributorApi
from
'/@/api/system/distributorApi'
;
import
get
from
'lodash.get'
;
import
*
as
HospitalApi
from
'/@/api/system/hospitalApi'
;
import
*
as
DoctorApi
from
'/@/api/system/doctorApi'
;
interface
gerPropType
{
colProps
?:
any
;
onChange
?:
any
;
}
export
const
getDistributorText
=
(
text
)
=>
{
if
(
text
===
0
)
{
...
...
@@ -45,30 +51,67 @@ const getDistributorId = ({ colProps }) => {
};
};
const
getHospitalId
=
({
colProps
}
)
=>
{
const
getHospitalId
=
({
colProps
,
onChange
}:
gerPropType
)
=>
{
return
{
field
:
'hospitalId'
,
label
:
'医院'
,
defaultValue
:
undefined
,
form
:
{
itemProps
:
{
validateTrigger
:
'blur'
,
},
componentProps
:
({
formActionType
,
formModel
})
=>
{
return
{
labelInValue
:
true
,
api
:
HospitalApi
.
all
,
params
:
{},
resultField
:
'records'
,
labelField
:
'name'
,
valueField
:
'id'
,
allowClear
:
false
,
placeholder
:
'医院'
,
optionFilterProp
:
'label'
,
showSearch
:
true
,
onChange
:
(
e
:
any
)
=>
{
onChange
&&
onChange
({
formActionType
,
formModel
,
e
});
},
};
},
colProps
,
component
:
'ApiSelect'
,
rules
:
[{
required
:
true
,
type
:
'object'
,
message
:
'请选择医院!'
}],
},
table
:
{
customRender
:
({
record
})
=>
get
(
record
,
'hospital.name'
)
||
'(已删除/不存在)'
,
},
};
};
const
getDoctorId
=
({
colProps
})
=>
{
return
{
field
:
'doctorId'
,
label
:
'医生'
,
defaultValue
:
undefined
,
form
:
{
itemProps
:
{
validateTrigger
:
'blur'
,
},
componentProps
:
{
labelInValue
:
true
,
api
:
Hospital
Api
.
all
,
api
:
Doctor
Api
.
all
,
params
:
{},
resultField
:
'records'
,
labelField
:
'name'
,
valueField
:
'id'
,
allowClear
:
false
,
placeholder
:
'医
院
'
,
placeholder
:
'医
生
'
,
optionFilterProp
:
'label'
,
showSearch
:
true
,
disabled
:
true
,
},
colProps
,
component
:
'ApiSelect'
,
rules
:
[{
required
:
true
,
type
:
'object'
,
message
:
'请选择医
院
!'
}],
rules
:
[{
required
:
true
,
type
:
'object'
,
message
:
'请选择医
生
!'
}],
},
table
:
{
customRender
:
({
record
})
=>
get
(
record
,
'hospital.name'
)
||
'(已删除/不存在)'
,
...
...
@@ -76,4 +119,21 @@ const getHospitalId = ({ colProps }) => {
};
};
export
{
getDistributorId
,
getHospitalId
};
const
getHospitalIdAndDoctorId
=
({
colProps
})
=>
{
return
[
getHospitalId
({
colProps
,
onChange
:
({
formActionType
,
formModel
,
e
})
=>
{
console
.
log
(
'onChange'
,
e
);
const
{
updateSchema
}
=
formActionType
;
updateSchema
([
{
field
:
'doctorId'
,
componentProps
:
{
params
:
{
hospitalId
:
e
.
value
}
}
},
{
field
:
'doctorId'
,
componentProps
:
{
disabled
:
false
}
},
]);
formModel
.
doctorId
=
undefined
;
// 清空医生
},
}),
getDoctorId
({
colProps
}),
];
};
export
{
getDistributorId
,
getHospitalId
,
getDoctorId
,
getHospitalIdAndDoctorId
};
src/components/Form/src/BasicForm.vue
浏览文件 @
deb06025
...
...
@@ -203,9 +203,6 @@
(
schemas
)
=>
{
resetSchema
(
schemas
??
[]);
},
{
deep
:
true
,
},
);
watch
(
...
...
src/components/Form/src/components/ApiSelect.vue
浏览文件 @
deb06025
...
...
@@ -21,15 +21,16 @@
</Select>
</template>
<
script
lang=
"ts"
>
import
{
defineComponent
,
PropType
,
ref
,
watchEffect
,
computed
,
unref
,
watch
}
from
'vue'
;
import
{
defineComponent
,
PropType
,
ref
,
watchEffect
,
computed
,
unref
,
watch
,
reactive
}
from
'vue'
;
import
{
Select
}
from
'ant-design-vue'
;
import
{
isFunction
}
from
'/@/utils/is'
;
import
{
useRuleFormItem
}
from
'/@/hooks/component/useFormItem'
;
import
{
useAttrs
}
from
'/@/hooks/core/useAttrs'
;
import
{
get
,
omit
}
from
'lodash-es'
;
import
{
cloneDeep
,
get
,
omit
}
from
'lodash-es'
;
import
{
LoadingOutlined
}
from
'@ant-design/icons-vue'
;
import
{
useI18n
}
from
'/@/hooks/web/useI18n'
;
import
{
propTypes
}
from
'/@/utils/propTypes'
;
import
{
deepMerge
}
from
'/@/utils'
;
type
OptionsItem
=
{
label
:
string
;
value
:
string
;
disabled
?:
boolean
};
...
...
@@ -67,7 +68,7 @@
const
emitData
=
ref
<
any
[]
>
([]);
const
attrs
=
useAttrs
();
const
{
t
}
=
useI18n
();
let
oldParams
=
reactive
({});
// Embedded in the form, just use the hook binding to perform form verification
const
[
state
]
=
useRuleFormItem
(
props
,
'value'
,
'change'
,
emitData
);
...
...
@@ -88,13 +89,16 @@
});
watchEffect
(()
=>
{
props
.
immediate
&&
!
props
.
alwaysLoad
&&
fetch
();
props
.
immediate
&&
!
props
.
alwaysLoad
&&
isFirstLoad
.
value
&&
fetch
();
isFirstLoad
.
value
=
false
;
});
watch
(
()
=>
props
.
params
,
()
=>
{
!
unref
(
isFirstLoad
)
&&
fetch
();
if
(
JSON
.
stringify
(
oldParams
)
!==
JSON
.
stringify
(
props
.
params
))
{
!
unref
(
isFirstLoad
)
&&
fetch
();
}
},
{
deep
:
true
},
);
...
...
@@ -105,6 +109,7 @@
options
.
value
=
[];
try
{
loading
.
value
=
true
;
oldParams
=
cloneDeep
(
props
.
params
);
const
res
=
await
api
(
props
.
params
);
if
(
Array
.
isArray
(
res
))
{
options
.
value
=
res
;
...
...
src/views/order/operation-order/detail.vue
浏览文件 @
deb06025
<
template
>
<Card
:bordered=
"false"
>
<Card
:bordered=
"false"
:loading=
"isLoading"
>
<Descriptions
bordered
:column=
"3"
>
<Descriptions
.
Item
v-for=
"p in displayProps"
...
...
@@ -8,7 +8,7 @@
:span=
"['avatar'].includes(p.name) ? 3 : 1"
>
<span
v-if=
"p.key === 'avatar'"
>
<
img
:src=
"p.value"
style=
"width: 120px; height
: 120px"
/>
<
ImagePreview
:imageList=
"[p.value]"
style=
"width
: 120px"
/>
</span>
<template
v-else
>
{{
p
.
value
}}
...
...
@@ -18,39 +18,45 @@
</Card>
</template>
<
script
lang=
"ts"
setup
name=
"DeviceDetail"
>
import
{
onMounted
,
computed
,
ref
,
reactive
}
from
'vue'
;
import
{
onMounted
,
computed
,
ref
}
from
'vue'
;
import
{
useRoute
}
from
'vue-router'
;
import
{
useAsyncState
}
from
'@vueuse/core'
;
import
{
ImagePreview
}
from
'/@/components/Preview/index'
;
import
{
ComputedRef
}
from
'@vue/reactivity'
;
import
{
Descriptions
,
Card
}
from
'ant-design-vue'
;
import
{
descriptionColumns
}
from
'./schema'
;
import
*
as
OperationOrderApi
from
'/@/api/order/operationOrderApi'
;
import
{
Device
}
from
'/@/api/model/device
'
;
import
{
OperationOrder
}
from
'/@/api/model/operationOrder
'
;
const
route
=
useRoute
();
const
id
=
ref
(
route
.
params
?.
id
);
let
data
=
reactive
({
detail
:
{},
isOver
:
false
,
});
const
getDetail
=
()
=>
{
OperationOrderApi
.
getById
(
id
.
value
).
then
((
res
:
Device
)
=>
{
data
.
isOver
=
true
;
data
.
detail
=
res
;
});
};
// id 查询
const
{
state
:
detail
,
isReady
:
isDetailReady
,
isLoading
,
execute
,
}
=
useAsyncState
(
()
=>
{
return
OperationOrderApi
.
getById
(
id
.
value
).
then
((
res
:
OperationOrder
)
=>
res
);
},
null
,
{
immediate
:
false
,
},
);
onMounted
(()
=>
{
getDetail
();
execute
();
});
const
displayProps
:
ComputedRef
<
Array
<
any
>>
=
computed
(()
=>
{
if
(
!
data
.
isOver
)
return
{};
if
(
!
isDetailReady
.
value
)
return
{};
const
display
:
any
=
descriptionColumns
.
map
(({
title
,
dataIndex
=
''
,
customRender
})
=>
({
key
:
dataIndex
,
title
,
value
:
customRender
?
customRender
({
text
:
data
.
detail
[
dataIndex
],
record
:
data
.
detail
})
:
data
.
detail
[
dataIndex
],
value
:
customRender
?
customRender
({
text
:
detail
.
value
[
dataIndex
],
record
:
detail
.
value
})
:
detail
.
value
[
dataIndex
],
}));
return
display
;
});
...
...
src/views/order/operation-order/drawer.vue
浏览文件 @
deb06025
<
template
>
<BasicDrawer
v-bind=
"$attrs"
@
register=
"registerDrawer"
showFooter
:title=
"getTitle"
width=
"600px"
@
ok=
"handleSubmit"
>
<BasicForm
@
register=
"registerForm"
/>
<BasicDrawer
v-bind=
"$attrs"
@
register=
"registerDrawer"
showFooter
:confirmDisabled=
"getConfirmDisabled"
:title=
"getTitle"
width=
"1000px"
@
ok=
"handleSubmit"
>
<a-spin
:spinning=
"isLoading"
>
<BasicForm
@
register=
"registerForm"
/>
</a-spin>
</BasicDrawer>
</
template
>
<
script
lang=
"ts"
setup
name=
"OperationOrderDrawer"
>
...
...
@@ -8,7 +18,9 @@
import
{
BasicForm
,
useForm
}
from
'/@/components/Form/index'
;
import
{
formSchema
}
from
'./schema'
;
import
{
BasicDrawer
,
useDrawerInner
}
from
'/@/components/Drawer'
;
import
{
useAsyncState
}
from
'@vueuse/core'
;
import
*
as
OperationOrderApi
from
'/@/api/order/operationOrderApi'
;
import
{
OperationOrder
}
from
'/@/api/model/operationOrder'
;
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
isUpdate
=
ref
(
true
);
...
...
@@ -20,6 +32,22 @@
showActionButtonGroup
:
false
,
});
// id 查询
const
{
state
:
detail
,
isReady
:
isDetailReady
,
isLoading
,
execute
,
}
=
useAsyncState
(
()
=>
{
return
OperationOrderApi
.
getById
(
entityId
.
value
).
then
((
res
:
OperationOrder
)
=>
res
);
},
null
,
{
immediate
:
false
,
},
);
const
[
registerDrawer
,
{
setDrawerProps
,
closeDrawer
}]
=
useDrawerInner
(
async
(
data
)
=>
{
await
resetFields
();
setDrawerProps
({
confirmLoading
:
false
});
...
...
@@ -27,23 +55,31 @@
entityId
.
value
=
data
?.
record
?.
id
;
if
(
unref
(
isUpdate
))
{
await
setFieldsValue
({
...
data
.
record
,
hospitalId
:
{
label
:
data
.
record
.
hospitalName
,
value
:
data
.
record
.
hospitalId
},
});
await
execute
();
if
(
detail
.
value
)
{
const
formData
:
any
=
{
...
detail
.
value
,
hospitalId
:
{
label
:
detail
.
value
.
hospital
?.
name
||
'(已删除/不存在)'
,
value
:
detail
.
value
.
hospitalId
},
};
await
setFieldsValue
(
formData
);
}
}
});
const
getConfirmDisabled
=
computed
(()
=>
{
if
(
unref
(
isUpdate
))
{
return
!
unref
(
isDetailReady
);
}
else
{
return
false
;
}
});
const
getTitle
=
computed
(()
=>
(
!
unref
(
isUpdate
)
?
'新增'
:
'编辑'
));
async
function
handleSubmit
()
{
try
{
const
values
=
await
validate
();
setDrawerProps
({
confirmLoading
:
true
});
const
{
hospitalId
,
...
rest
}
=
values
;
const
{
hospitalId
,
...
rest
}
=
values
;
const
action
=
!
unref
(
isUpdate
)
?
OperationOrderApi
.
add
:
OperationOrderApi
.
update
;
const
data
=
!
unref
(
isUpdate
)
?
{
...
...
@@ -51,14 +87,15 @@
hospitalId
:
hospitalId
.
value
,
hospitalName
:
hospitalId
.
label
,
}
:
Object
.
assign
({},
{
...
rest
,
id
:
unref
(
entityId
),
hospitalId
:
hospitalId
.
value
,
hospitalName
:
hospitalId
.
label
,
},
);
:
Object
.
assign
(
{},
{
...
rest
,
id
:
unref
(
entityId
),
hospitalId
:
hospitalId
.
value
,
hospitalName
:
hospitalId
.
label
,
},
);
await
action
(
data
);
closeDrawer
();
emit
(
'success'
);
...
...
src/views/order/operation-order/index.vue
浏览文件 @
deb06025
...
...
@@ -8,6 +8,7 @@
<span>
已选中
{{
checkedKeys
.
length
}}
条记录
</span>
<a-button
type=
"link"
@
click=
"checkedKeys = []"
size=
"small"
>
清空
</a-button>
<a-popconfirm
v-auth=
"'AUTH_ORDER_OPERATION_ORDER'"
class=
"ml-4"
title=
"确定要全部删除吗?"
ok-text=
"是"
...
...
@@ -27,9 +28,6 @@
<a-button
v-auth=
"'AUTH_ORDER_OPERATION_ORDER:ADD'"
type=
"primary"
@
click=
"handleCreate"
>
新增
</a-button>
</
template
>
<
template
#
bodyCell=
"{ column, record, text }"
>
<template
v-if=
"column.dataIndex === 'id'"
>
<a
@
click=
"handleView(record)"
>
{{
record
.
id
}}
</a>
</
template
>
<template
v-if=
"[].includes(column.dataIndex)"
>
<img
:src=
"text"
class=
"photo"
alt=
"图片"
v-if=
"!!text"
/>
</
template
>
...
...
@@ -42,6 +40,12 @@
onClick: handleEdit.bind(null, record),
ifShow: hasPermission('AUTH_ORDER_OPERATION_ORDER:EDIT'),
},
{
tooltip: '详情',
icon: 'ant-design:eye-outlined',
onClick: handleView.bind(null, record),
ifShow: hasPermission('AUTH_ORDER_OPERATION_ORDER:QUERY'),
},
{
tooltip: '删除',
icon: 'ant-design:delete-outlined',
...
...
@@ -60,7 +64,7 @@
<OperationOrderDrawer
@
register=
"registerDrawer"
@
success=
"handleSuccess"
/>
</div>
</template>
<
script
lang=
"ts"
setup
name=
"
DeviceIndex
"
>
<
script
lang=
"ts"
setup
name=
"
AUTH_ORDER_OPERATION_ORDER
"
>
import
{
ref
}
from
'vue'
;
import
{
useGo
}
from
'/@/hooks/web/usePage'
;
import
{
usePermission
}
from
'/@/hooks/web/usePermission'
;
...
...
@@ -72,7 +76,8 @@
import
componentSetting
from
'/@/settings/componentSetting'
;
import
OperationOrderDrawer
from
'./drawer.vue'
;
import
{
columns
,
searchFormSchema
}
from
'./schema'
;
import
{
useUserStore
}
from
'/@/store/modules/user'
;
const
userStore
=
useUserStore
();
const
{
hasPermission
}
=
usePermission
();
const
go
=
useGo
();
const
{
formConfig
,
showTableSetting
,
bordered
,
showIndexColumn
}
=
componentSetting
.
table
;
...
...
@@ -83,7 +88,7 @@
};
const
[
registerDrawer
,
{
openDrawer
}]
=
useDrawer
();
const
[
registerTable
,
{
reload
}]
=
useTable
({
const
[
registerTable
,
{
reload
,
setLoading
}]
=
useTable
({
title
:
'手术订单管理'
,
api
:
(
params
)
=>
OperationOrderApi
.
search
(
handleParams
(
params
)),
columns
,
...
...
@@ -94,6 +99,7 @@
},
rowSelection
:
{
type
:
'checkbox'
,
// @ts-ignore
selectedRowKeys
:
checkedKeys
,
onChange
:
onSelectChange
,
},
...
...
@@ -104,10 +110,9 @@
canResize
:
false
,
rowKey
:
(
record
:
any
)
=>
record
.
id
,
actionColumn
:
{
width
:
8
0
,
width
:
12
0
,
title
:
'操作'
,
dataIndex
:
'action'
,
fixed
:
'right'
,
},
});
...
...
@@ -133,6 +138,10 @@
}
}
});
// 如果是经销商,只能看到自己的数据
if
(
userStore
.
getIsDistributor
)
{
handledParams
.
distributorId
=
userStore
.
getDistributorId
;
}
return
handledParams
;
};
...
...
@@ -150,15 +159,25 @@
};
const
handleDelete
=
(
record
:
Recordable
)
=>
{
OperationOrderApi
.
remove
(
record
.
id
).
then
((
_
)
=>
{
reload
();
});
setLoading
(
true
);
OperationOrderApi
.
remove
(
record
.
id
)
.
then
((
_
)
=>
{
reload
();
})
.
catch
(()
=>
{
setLoading
(
false
);
});
};
const
handleBatchDelete
=
()
=>
{
OperationOrderApi
.
batchRemove
(
checkedKeys
.
value
).
then
((
_
)
=>
{
reload
();
});
setLoading
(
true
);
OperationOrderApi
.
batchRemove
(
checkedKeys
.
value
)
.
then
((
_
)
=>
{
reload
();
})
.
catch
(()
=>
{
setLoading
(
false
);
});
};
const
handleSuccess
=
()
=>
{
...
...
@@ -166,6 +185,6 @@
};
const
handleView
=
(
record
)
=>
{
go
(
'/order/operation-order/'
+
record
.
id
);
go
(
'/
main/
order/operation-order/'
+
record
.
id
);
};
</
script
>
src/views/order/operation-order/schema.ts
浏览文件 @
deb06025
...
...
@@ -8,7 +8,8 @@
import
{
BasicColumn
}
from
'/@/components/Table'
;
import
{
FormSchema
}
from
'/@/components/Table'
;
import
{
getHospitalId
}
from
'/@/commonSchemaProperty'
;
import
{
useUserStore
}
from
'/@/store/modules/user'
;
import
{
getDistributorId
,
getDoctorId
,
getHospitalId
,
getHospitalIdAndDoctorId
}
from
'/@/commonSchemaProperty'
;
export
enum
YesNoEnum
{
YES
=
'是'
,
...
...
@@ -36,7 +37,7 @@ for (const key in StatusEnum) {
}
const
colProps
=
{
xs
:
{
span
:
24
},
sm
:
{
span
:
24
},
lg
:
{
span
:
8
}
};
const
colPropsInDrawer
=
{
span
:
24
};
const
colPropsInDrawer
=
{
span
:
12
};
export
const
schema
=
{
model
:
'OperationOrder'
,
...
...
@@ -44,34 +45,20 @@ export const schema = {
properties
:
[
{
field
:
'id'
,
label
:
'ID
系统自动生成
'
,
label
:
'ID'
,
defaultValue
:
undefined
,
form
:
{
componentProps
:
{
allowClear
:
false
,
placeholder
:
'ID
系统自动生成
'
,
placeholder
:
'ID'
,
},
colProps
,
component
:
'InputNumber'
,
rules
:
[{
required
:
true
,
message
:
'请输入ID系统自动生成!'
}],
},
table
:
{},
},
{
field
:
'distributorId'
,
label
:
'经销商id'
,
defaultValue
:
undefined
,
form
:
{
componentProps
:
{
allowClear
:
false
,
placeholder
:
'经销商id'
,
},
colProps
,
component
:
'InputNumber'
,
rules
:
[{
required
:
true
,
message
:
'请输入经销商id!'
}],
rules
:
[{
required
:
true
,
message
:
'请输入ID!'
}],
},
table
:
{},
},
getDistributorId
({
colProps
}),
{
field
:
'orderSn'
,
label
:
'订单编号'
,
...
...
@@ -101,7 +88,7 @@ export const schema = {
},
table
:
{},
},
getHospital
Id
({
colProps
}),
...
getHospitalIdAndDoctor
Id
({
colProps
}),
{
field
:
'saleUserId'
,
label
:
'业务员id'
,
...
...
@@ -130,20 +117,6 @@ export const schema = {
},
table
:
{},
},
{
field
:
'doctorId'
,
label
:
'医生id'
,
defaultValue
:
undefined
,
form
:
{
componentProps
:
{
allowClear
:
true
,
placeholder
:
'医生id'
,
},
colProps
,
component
:
'InputNumber'
,
},
table
:
{},
},
{
field
:
'doctorName'
,
label
:
'医生名称'
,
...
...
@@ -388,7 +361,7 @@ export const schema = {
},
{
field
:
'createTime'
,
label
:
'
创建时间
'
,
label
:
'
CreateTime
'
,
defaultValue
:
undefined
,
form
:
{
colProps
,
...
...
@@ -405,7 +378,7 @@ export const schema = {
},
{
field
:
'updateTime'
,
label
:
'
更新时间
'
,
label
:
'
UpdateTime
'
,
defaultValue
:
undefined
,
form
:
{
colProps
,
...
...
@@ -424,7 +397,7 @@ export const schema = {
};
const
queryFields
=
[
'id'
,
//
'id',
'distributorId'
,
'orderSn'
,
'productLineName'
,
...
...
@@ -525,9 +498,16 @@ const descriptionFields = [
'createTime'
,
'updateTime'
,
];
const
userStore
=
useUserStore
();
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/doctor/index.vue
浏览文件 @
deb06025
...
...
@@ -142,7 +142,7 @@
const
userStore
=
useUserStore
();
const
[
registerDrawer
,
{
openDrawer
}]
=
useDrawer
();
const
[
registerTable
,
{
reload
,
setLoading
,
getLoading
}]
=
useTable
({
const
[
registerTable
,
{
reload
,
setLoading
}]
=
useTable
({
title
:
'医生管理'
,
api
:
(
params
)
=>
DoctorApi
.
search
(
handleParams
(
params
)),
columns
,
...
...
src/views/system/user/drawer.vue
浏览文件 @
deb06025
...
...
@@ -33,18 +33,7 @@
showActionButtonGroup
:
false
,
});
const
[
registerForm
,
{
resetFields
,
setFieldsValue
,
validate
}]
=
useForm
(
useFormProps
.
value
);
/**
* @description: 编辑时候影藏密码表单项 , 创建时候显示
*/
const
handlePwdFiled
=
()
=>
{
useFormProps
.
value
.
schemas
?.
forEach
((
item
:
any
)
=>
{
if
(
item
.
field
===
PASSWORD
)
{
item
.
show
=
!
unref
(
isUpdate
);
}
});
};
const
[
registerForm
,
{
resetFields
,
setFieldsValue
,
validate
,
updateSchema
}]
=
useForm
(
useFormProps
.
value
);
// id 查询
const
{
...
...
@@ -68,9 +57,12 @@
isUpdate
.
value
=
!!
data
?.
isUpdate
;
entityId
.
value
=
data
?.
record
?.
id
;
handlePwdFiled
();
if
(
unref
(
isUpdate
))
{
// 更新时,不显示密码
await
updateSchema
({
field
:
PASSWORD
,
show
:
false
,
});
await
execute
();
if
(
detail
.
value
)
{
const
formData
:
any
=
{
...
detail
.
value
};
...
...
@@ -90,6 +82,12 @@
formData
.
roleList
=
roleObj
;
await
setFieldsValue
(
formData
);
}
}
else
{
// 新增时,显示密码
await
updateSchema
({
field
:
PASSWORD
,
show
:
true
,
});
}
});
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论