<template>
|
<InfiniteLoading
|
scrollViewClassName="common-page-infinite-scroll-list"
|
v-bind="infiniteLoadingProps"
|
>
|
<template #renderItem="{ item }">
|
<ChooseSupplierCard
|
:avatar="item.avatar"
|
:name="item.enterpriseName"
|
:mainBusiness="item.mainBusiness"
|
:serverCount="item.serverCount"
|
:serviceCount="item.serviceCount"
|
>
|
<template #actions>
|
<nut-button type="primary" plain>查看详情</nut-button>
|
<nut-button type="primary" @click="goEnterpriseEmployee(item)">选择</nut-button>
|
</template>
|
</ChooseSupplierCard>
|
</template>
|
</InfiniteLoading>
|
</template>
|
|
<script setup lang="ts">
|
import Taro from '@tarojs/taro';
|
import * as standardServiceServices from '@12333/services/apiV2/standardService';
|
import { useInfiniteLoading } from '@12333/hooks';
|
import { EnumPagedListOrder } from '@12333/constants';
|
import { useEvent, useEventChannel } from 'senin-mini/hooks';
|
import { SelectEnterpriseEmployeeEvent } from '../utils';
|
|
defineOptions({
|
name: 'InnerPage',
|
});
|
|
const route = Taro.useRouter();
|
const id = route.params?.id ?? '';
|
|
const eventChannel = useEventChannel();
|
|
const { infiniteLoadingProps } = useInfiniteLoading(
|
({ pageParam }) => {
|
let params: API.GetStandardServiceSupplierEnterprisesQuery = {
|
pageModel: {
|
rows: 20,
|
page: pageParam,
|
// orderInput: [{ property: 'id', order: EnumPagedListOrder.Desc }],
|
},
|
serviceId: id,
|
};
|
|
return standardServiceServices.getStandardServiceSupplierEnterprises(params, {
|
showLoading: false,
|
});
|
},
|
{
|
queryKey: ['standardServiceServices/getStandardServiceSupplierEnterprises', id],
|
}
|
);
|
|
function goEnterpriseEmployee(item: API.GetStandardServiceSupplierEnterprisesQueryResultItem) {
|
Taro.navigateTo({
|
url: `${RouterPath.chooseEnterpriseEmployee}?id=${item.id}`,
|
events: {
|
onSelectEnterpriseEmployee: function (data: SelectEnterpriseEmployeeEvent) {
|
console.log('SelectEnterpriseEmployeeEvent2: ', data);
|
eventChannel.emit('onSelectEnterpriseEmployee', data);
|
},
|
},
|
});
|
}
|
</script>
|