|
|
|
@ -1,9 +1,11 @@
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { deletePackage } from '@/api/home/main'
|
|
|
|
|
import NotPassed from '@/components/NotPassed.vue'
|
|
|
|
|
import { useWorkOrder } from '@/store/modules/workOrder'
|
|
|
|
|
import { isEmpty } from '@/utils'
|
|
|
|
|
import { useInfiniteScroll } from '@vueuse/core'
|
|
|
|
|
import { reactive, ref, unref, watch } from 'vue'
|
|
|
|
|
import { useMessage } from 'naive-ui'
|
|
|
|
|
import { reactive, ref, watch } from 'vue'
|
|
|
|
|
import ApprovalModal from '../modal/ApprovalModal.vue'
|
|
|
|
|
import ListItem from './ListItem.vue'
|
|
|
|
|
import type { PackageListItem } from '/#/workorder'
|
|
|
|
@ -33,11 +35,7 @@ const pagination = reactive({
|
|
|
|
|
|
|
|
|
|
const approvalModalRef = ref(null)
|
|
|
|
|
const notPassedRef: any = ref(null)
|
|
|
|
|
|
|
|
|
|
function showModal(modalRef: any, id) {
|
|
|
|
|
const modal = unref(modalRef)! as any
|
|
|
|
|
modal.showModal(id)
|
|
|
|
|
}
|
|
|
|
|
const overTask = ref<any>(null);
|
|
|
|
|
|
|
|
|
|
function selectHandler(id: string, index: number) {
|
|
|
|
|
workStore.setActive(index)
|
|
|
|
@ -125,7 +123,21 @@ async function search(word: string) {
|
|
|
|
|
{ distance: 10, canLoadMore: () => canloadMore.value },
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function overTaskHandelr(item: any) {
|
|
|
|
|
overTask.value = item
|
|
|
|
|
}
|
|
|
|
|
function leaveTaskHandler() {
|
|
|
|
|
overTask.value = null;
|
|
|
|
|
}
|
|
|
|
|
const message = useMessage()
|
|
|
|
|
function dismisClick(packageId:string) {
|
|
|
|
|
deletePackage({packageId: packageId}).then((res) => {
|
|
|
|
|
if(res.code==="OK"){
|
|
|
|
|
message.success("解散任务包成功")
|
|
|
|
|
loadMore()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
defineExpose({
|
|
|
|
|
search,
|
|
|
|
|
})
|
|
|
|
@ -143,7 +155,11 @@ defineExpose({
|
|
|
|
|
:list-item="item"
|
|
|
|
|
:show-field-list="showFieldList"
|
|
|
|
|
:dicts="dicts"
|
|
|
|
|
:mouse-over-task="overTask"
|
|
|
|
|
@click="selectHandler(item.id, index)"
|
|
|
|
|
@mouseover="overTaskHandelr(item)"
|
|
|
|
|
@mouseleave="leaveTaskHandler"
|
|
|
|
|
@dismisClick="dismisClick"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</n-spin>
|
|
|
|
|