|
|
@@ -1,7 +1,7 @@
|
|
|
<script setup lang="ts">
|
|
|
import type { SystemItemModel, SystemIteQuery } from '@/model/care.model';
|
|
|
import ServiceDetail from './ServiceDetail.vue';
|
|
|
-import AddItems from './addItems.vue';
|
|
|
+import AddItems from './AddItems.vue';
|
|
|
import seeHealthEvaluation from './seeHealthEvaluation.vue';
|
|
|
import HealthEvaluation from './HealthEvaluation.vue';
|
|
|
// 接口数据
|
|
|
@@ -17,7 +17,7 @@ const searchFormProps = reactive<VxeFormProps<SystemIteQuery>>({
|
|
|
titleWidth: 100,
|
|
|
titleAlign: 'right',
|
|
|
titleColon: true,
|
|
|
- data: {},
|
|
|
+ data: { types: ['1'] as any, status: '0' as any },
|
|
|
items: [
|
|
|
{
|
|
|
field: 'institutionName',
|
|
|
@@ -47,7 +47,7 @@ const searchFormProps = reactive<VxeFormProps<SystemIteQuery>>({
|
|
|
{ name: 'add', content: '新增', status: 'primary' },
|
|
|
],
|
|
|
events: {
|
|
|
- click(slotParams, { name }) {
|
|
|
+ click(slotParams: any, { name }: any) {
|
|
|
if (name === 'add') {
|
|
|
// 新增
|
|
|
editConfirmed();
|
|
|
@@ -56,18 +56,59 @@ const searchFormProps = reactive<VxeFormProps<SystemIteQuery>>({
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
+ { field: 'types', title: '项目应用', span: 8, itemRender: {
|
|
|
+ name: 'VxeCheckboxGroup',
|
|
|
+ options: [
|
|
|
+ { label: '服务包项目', value: '1' },
|
|
|
+ { label: '调理方案项目', value: '2' },
|
|
|
+ ],
|
|
|
+ events: {
|
|
|
+ change(value: { data: SystemIteQuery }) { onSearch(value.data) },
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'status',
|
|
|
+ title: '启用状态',
|
|
|
+ span: 6,
|
|
|
+ itemRender: {
|
|
|
+ name: 'VxeRadioGroup',
|
|
|
+ options: [
|
|
|
+ { label: '启用', value: '0' },
|
|
|
+ { label: '停用', value: '1' },
|
|
|
+ ],
|
|
|
+ props: {
|
|
|
+ strict: false,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
],
|
|
|
});
|
|
|
const searchFormEmits: VxeFormListeners<SystemIteQuery> = {
|
|
|
// 查询随访计划
|
|
|
submit({ data }) {
|
|
|
- model.value = { ...data };
|
|
|
+ onSearch(data);
|
|
|
},
|
|
|
+
|
|
|
// 重置
|
|
|
reset({ data }) {
|
|
|
- model.value = { ...data };
|
|
|
+ onSearch(data);
|
|
|
},
|
|
|
};
|
|
|
+function onSearch(data: SystemIteQuery) {
|
|
|
+ const types: string[] = (data as any).types?.length ? (data as any).types : ['1'];
|
|
|
+ const status: string = (data as any).status ?? '0';
|
|
|
+ const isForWrap: SystemIteQuery['isForWrap'] = types.includes('1') ? 'Y' : null;
|
|
|
+ const isForInfer: SystemIteQuery['isForInfer'] = types.includes('2') ? 'Y' : null;
|
|
|
+
|
|
|
+ model.value = { ...data, types: [...types] as any, status: status as any, isForWrap, isForInfer };
|
|
|
+ nextTick(() => {
|
|
|
+ (searchFormProps.data as any)!.types = [...types];
|
|
|
+ (searchFormProps.data as any)!.status = status;
|
|
|
+ (searchFormProps.data as any)!.isForInfer = isForInfer;
|
|
|
+ (searchFormProps.data as any)!.isForWrap = isForWrap;
|
|
|
+ })
|
|
|
+}
|
|
|
const gridRef = ref<VxeGridInstance<SystemItemModel>>();
|
|
|
const gridOptions = reactive<VxeGridProps<SystemItemModel>>({
|
|
|
id: 'tag-list',
|
|
|
@@ -116,7 +157,7 @@ const gridOptions = reactive<VxeGridProps<SystemItemModel>>({
|
|
|
{ content: '删除', status: 'primary', name: 'deleteConfirmed' },
|
|
|
],
|
|
|
events: {
|
|
|
- click({ row, rowIndex }, { name }) {
|
|
|
+ click({ row, rowIndex }: any, { name }: any) {
|
|
|
let method;
|
|
|
if (name === 'seeDetail') {
|
|
|
method = seeDetail;
|
|
|
@@ -152,11 +193,11 @@ const {
|
|
|
watchingStates: [model],
|
|
|
immediate: true,
|
|
|
});
|
|
|
-onSuccess(({ data: { data } }) => {
|
|
|
- gridRef.value?.loadData(data);
|
|
|
+onSuccess((res: any) => {
|
|
|
+ gridRef.value?.loadData(res?.data?.data ?? []);
|
|
|
});
|
|
|
onMounted(() => {
|
|
|
- model.value = toRaw(searchFormProps.data);
|
|
|
+ onSearch(toRaw(searchFormProps.data) as any);
|
|
|
});
|
|
|
|
|
|
function deleteConfirmed(model: SystemItemModel, index: number) {
|
|
|
@@ -248,6 +289,7 @@ function seeDetail(model?: SystemItemModel, index?: number) {
|
|
|
},
|
|
|
});
|
|
|
} else {
|
|
|
+ const addType = 'itemsList';
|
|
|
VxeUI.modal.open({
|
|
|
title: '查看',
|
|
|
height: 800,
|
|
|
@@ -260,7 +302,10 @@ function seeDetail(model?: SystemItemModel, index?: number) {
|
|
|
slots: {
|
|
|
default() {
|
|
|
return h(ServiceDetail, <any>{
|
|
|
- data: model,
|
|
|
+ data: {
|
|
|
+ ...model,
|
|
|
+ addType,
|
|
|
+ },
|
|
|
onSubmit(data: SystemItemModel) {
|
|
|
refresh(page.value);
|
|
|
VxeUI.modal.close(`service-detail-modal`);
|