feat: 任务审批模块左侧筛选条件联动

pull/104/head
刘释隆 1 year ago
parent 868b24c023
commit 53d3062faa

@ -26,8 +26,7 @@ export async function getPictureTypeList(): Promise<any> {
url: `/static/admin/web/distionary/bytypecode/izpicturetype`, url: `/static/admin/web/distionary/bytypecode/izpicturetype`,
method: 'get', method: 'get',
}) })
const list = res.data&&res.data.length?res.data[0].distionaryList:[]
const list = res.data[0].distionaryList
return list return list
} }
@ -73,7 +72,7 @@ export async function getTFList() {
method: 'get', method: 'get',
}) })
const list = res.data[0].distionaryList const list = res.data&&res.data.length?res.data[0].distionaryList:[]
return list return list
} }
@ -145,7 +144,7 @@ export async function getIztaskrromList(enabled: string) {
params: { enabled }, params: { enabled },
}) })
const list = res.data[0].distionaryList const list = res.data&&res.data.length?res.data[0].distionaryList:[]
return list return list
} }
@ -161,7 +160,7 @@ export async function getIztaskstatusList(enabled: string) {
params: { enabled }, params: { enabled },
}) })
const list = res.data[0].distionaryList const list = res.data&&res.data.length?res.data[0].distionaryList:[]
return list return list
} }
@ -191,7 +190,7 @@ export async function getIzfirmList(enabled: string) {
params: { enabled }, params: { enabled },
}) })
const list = res.data[0].distionaryList const list = res.data&&res.data.length?res.data[0].distionaryList:[]
return list return list
} }
@ -207,7 +206,7 @@ export async function getIzproductnameList(enabled: string) {
params: { enabled }, params: { enabled },
}) })
const list = res.data[0].distionaryList const list = res.data&&res.data.length?res.data[0].distionaryList:[]
return list return list
} }
@ -223,7 +222,7 @@ export async function getizcustomnameList(enabled: string) {
params: { enabled }, params: { enabled },
}) })
const list = res.data[0].distionaryList const list = res.data&&res.data.length?res.data[0].distionaryList:[]
return list return list
} }
@ -237,7 +236,7 @@ export async function getIzCustomtypeList(): Promise<any> {
method: 'get', method: 'get',
}) })
const list = res.data[0].distionaryList const list = res.data&&res.data.length?res.data[0].distionaryList:[]
return list return list
} }
@ -253,7 +252,7 @@ export async function getIzcustomlevel(enabled: string) {
params: { enabled }, params: { enabled },
}) })
const list = res.data[0].distionaryList const list = res.data&&res.data.length?res.data[0].distionaryList:[]
return list return list
} }
@ -269,7 +268,7 @@ export async function getIzprojecttypeList(enabled: string) {
params: { enabled }, params: { enabled },
}) })
const list = res.data[0].distionaryList const list = res.data&&res.data.length?res.data[0].distionaryList:[]
return list return list
} }
@ -298,8 +297,7 @@ export async function getRejectList() {
method: 'get', method: 'get',
}) })
const list = res.data[0].distionaryList return res.data&&res.data.length?res.data[0].distionaryList:[]
return list
} }
/** /**
@ -312,7 +310,7 @@ export async function getBackList() {
method: 'get', method: 'get',
}) })
return res.data[0].distionaryList return res.data&&res.data.length?res.data[0].distionaryList:[]
} }
/** /**
@ -365,7 +363,7 @@ export async function getRelationTypeList() {
method: 'get', method: 'get',
}) })
return res.data[0].distionaryList return res.data&&res.data.length?res.data[0].distionaryList:[]
} }
/** /**
@ -377,7 +375,7 @@ export async function getizstatusList() {
url: `/static/admin/web/distionary/bytypecode/izstatus`, url: `/static/admin/web/distionary/bytypecode/izstatus`,
method: 'get', method: 'get',
}) })
return res.data[0].distionaryList return res.data&&res.data.length?res.data[0].distionaryList:[]
} }
/** /**
@ -389,5 +387,5 @@ export async function getizApprovalStatusList() {
url: `/static/admin/web/distionary/bytypecode/izApprovalStatus`, url: `/static/admin/web/distionary/bytypecode/izApprovalStatus`,
method: 'get', method: 'get',
}) })
return res.data[0].distionaryList return res.data&&res.data.length?res.data[0].distionaryList:[]
} }

@ -15,6 +15,7 @@ export async function getApprovalList(page: any) {
pageSize: page.pageSize, pageSize: page.pageSize,
currPage: page.pageNo, currPage: page.pageNo,
keyword: page.keyword, keyword: page.keyword,
userSearchId:page.userSearchId
}, },
}) })

@ -40,6 +40,7 @@ Object.keys(asideMap).forEach((key) => {
const filterModalRef = ref(null); const filterModalRef = ref(null);
const newFilterModalRef = ref(null); const newFilterModalRef = ref(null);
const customModalRef = ref(null); const customModalRef = ref(null);
const AdvanceFilterRef: any = ref(null);
function showModal(modalRef: any) { function showModal(modalRef: any) {
const modal = unref(modalRef)! as any; const modal = unref(modalRef)! as any;
@ -166,6 +167,16 @@ watch(asideValue, (newVal) => {
const inputChange = (keyword) => { const inputChange = (keyword) => {
emit("inputChange", keyword); emit("inputChange", keyword);
}; };
const handleOk = (item: any) => {
console.log("handleOk", item);
if (item) {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced(item.searchname);
filterHandler(item.id);
} else {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced("高级筛选");
filterHandler("");
}
};
</script> </script>
<template> <template>
@ -197,6 +208,7 @@ const inputChange = (keyword) => {
@update:search="setShowSearch(true)" @update:search="setShowSearch(true)"
@show-custom="showModal(customModalRef)" @show-custom="showModal(customModalRef)"
@show-filter="showModal(filterModalRef)" @show-filter="showModal(filterModalRef)"
ref="AdvanceFilterRef"
/> />
</div> </div>
@ -216,6 +228,7 @@ const inputChange = (keyword) => {
ref="filterModalRef" ref="filterModalRef"
@edit-filter="editFilter" @edit-filter="editFilter"
@show-new-filter="showModal(newFilterModalRef)" @show-new-filter="showModal(newFilterModalRef)"
@handleOk="handleOk"
/> />
<!-- 新增过滤 --> <!-- 新增过滤 -->
<NewFilterModal ref="newFilterModalRef" /> <NewFilterModal ref="newFilterModalRef" />

@ -19,10 +19,10 @@ const inputChange = (keyword)=>{
<Aside @inputChange="inputChange" /> <Aside @inputChange="inputChange" />
<!-- 内容 --> <!-- 内容 -->
<Content @changeShow="showList=true" ref="contentRef" /> <Content @changeShow="showList=true" ref="contentRef" v-show="!showList" />
<!-- 任务管理 --> <!-- 任务管理 -->
<!-- TODO:本地演示即可 上传注释注释 --> <!-- TODO:本地演示即可 上传注释注释 -->
<!-- <ListContent /> --> <ListContent v-show="showList" @changeShow="showList=false" />
</div> </div>
</template> </template>

@ -186,12 +186,13 @@ watch(
const listData = ref<any[]>([]); const listData = ref<any[]>([]);
async function featchList() { async function featchList(userSearchId?:string) {
loading.value = true; loading.value = true;
try { try {
const contentParams = { const contentParams = {
search_month: timeRange.value, search_month: timeRange.value,
search_history: 0, search_history: 0,
userSearchId
}; };
pagination.pageNo += 1; pagination.pageNo += 1;
@ -404,6 +405,11 @@ async function commitHandler(settingParam) {
onMounted(() => { onMounted(() => {
emitter.on("filter", refreshHandler); emitter.on("filter", refreshHandler);
// emitter.on("filter", (searchId)=>{
// console.log("emitter on filter" + searchId)
// reset();
// featchList(searchId);
// });
// //
getLastCheckNo().then((res) => { getLastCheckNo().then((res) => {
if (res.code === "OK") { if (res.code === "OK") {

@ -26,6 +26,7 @@ const CustomFieldModalRef = ref(null)
const collapse = ref(false) const collapse = ref(false)
const taskStore = useTaskStore() const taskStore = useTaskStore()
const taskListRef: any = ref(null) const taskListRef: any = ref(null)
const AdvanceFilterRef: any = ref(null);
// //
const showFieldList = ref<any[]>([]) const showFieldList = ref<any[]>([])
const search = ref('') const search = ref('')
@ -171,6 +172,16 @@ function setAsideItemName(text) {
defineExpose({ defineExpose({
setAsideItemName, setAsideItemName,
}) })
const handleOk = (item: any) => {
if (item) {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced(item.searchname);
filterHandler(item.id);
} else {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced("高级筛选");
filterHandler("");
}
};
</script> </script>
<template> <template>
@ -215,6 +226,7 @@ defineExpose({
@update:search="setShowSearch(true)" @update:search="setShowSearch(true)"
@show-custom="showModal(CustomFieldModalRef)" @show-custom="showModal(CustomFieldModalRef)"
@show-filter="showModal(filterModalRef)" @show-filter="showModal(filterModalRef)"
ref="AdvanceFilterRef"
/> />
<div v-show="showSearch" class="warpper"> <div v-show="showSearch" class="warpper">
@ -253,6 +265,7 @@ defineExpose({
:type="2" :type="2"
@edit-filter="editFilter" @edit-filter="editFilter"
@show-new-filter="showModal(newFilterModalRef)" @show-new-filter="showModal(newFilterModalRef)"
@handleOk="handleOk"
/> />
<!-- 新增过滤 --> <!-- 新增过滤 -->
<NewFilterModalVue ref="newFilterModalRef" @on-ok="newFilterOk" /> <NewFilterModalVue ref="newFilterModalRef" @on-ok="newFilterOk" />

@ -4,6 +4,7 @@ import { defineProps, onMounted, onUnmounted, reactive, ref, watch } from 'vue'
import ListItem from './ListItem.vue' import ListItem from './ListItem.vue'
import emitter from '@/utils/mitt' import emitter from '@/utils/mitt'
import { useTaskStore } from '@/store/modules/task' import { useTaskStore } from '@/store/modules/task'
import { filter } from 'lodash'
defineProps({ defineProps({
showFieldList: { showFieldList: {
@ -18,6 +19,7 @@ const el = ref<HTMLDivElement | null>(null)
const keyword = ref('') const keyword = ref('')
const canloadMore = ref(true) const canloadMore = ref(true)
const isLoading = ref(false) const isLoading = ref(false)
const searchId = ref('')
const pagination = reactive({ const pagination = reactive({
pageNo: 0, pageNo: 0,
@ -37,7 +39,6 @@ useInfiniteScroll(
) )
async function loadMore() { async function loadMore() {
console.log(77888)
if (isLoading.value || el.value == null) if (isLoading.value || el.value == null)
return return
isLoading.value = true isLoading.value = true
@ -57,6 +58,7 @@ async function fetchList() {
const result = await taskStore.fetchApprovalList({ const result = await taskStore.fetchApprovalList({
...pagination, ...pagination,
keyword: keyword.value, keyword: keyword.value,
userSearchId:searchId.value
}) })
const { data, pageCount } = result const { data, pageCount } = result
canloadMore.value = pageCount >= pagination.pageNo canloadMore.value = pageCount >= pagination.pageNo
@ -80,7 +82,6 @@ function reset() {
pagination.pageSize = 30 pagination.pageSize = 30
canloadMore.value = true canloadMore.value = true
data.value.length = 0 data.value.length = 0
taskStore.reset() taskStore.reset()
} }
@ -98,6 +99,11 @@ async function search(word: string) {
onMounted(() => { onMounted(() => {
emitter.on('refresh', refreshHandler) emitter.on('refresh', refreshHandler)
emitter.on('filter',async(id)=>{
await reset();
searchId.value = id;
data.value = await fetchList();
})
}) })
onUnmounted(() => { onUnmounted(() => {

Loading…
Cancel
Save