feat(project-demand): 实现主子项目名称模糊查询功能
- 在项目需求汇总、成本明细、支出明细和共享明细页面添加主子项目名称模糊查询功能 - 新增相关 API 接口和方法以支持模糊查询 - 优化 fvSelect 组件以适配远程搜索功能
This commit is contained in:
@@ -107,10 +107,72 @@ export const approvePlan= (data) => {
|
||||
};
|
||||
|
||||
|
||||
export const getProjectOption = () => {
|
||||
export const getProjectOption = (projectName) => {
|
||||
return request({
|
||||
url: '/workflow/mosr/requirement/master',
|
||||
method: "get"
|
||||
method: "get",
|
||||
params:{
|
||||
projectName:projectName
|
||||
}
|
||||
});
|
||||
};
|
||||
export const getMasterProjectNameOption = (masterProjectName) => {
|
||||
return request({
|
||||
url: '/workflow/mosr/payment/master/option',
|
||||
method: "get",
|
||||
params:{
|
||||
masterProjectName:masterProjectName
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const getSubprojectNameOption = (subProjectName) => {
|
||||
return request({
|
||||
url: '/workflow/mosr/payment/sub/option',
|
||||
method: "get",
|
||||
params:{
|
||||
subProjectName:subProjectName
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const getExpenseMasterProjectNameOption = (masterProjectName) => {
|
||||
return request({
|
||||
url: '/workflow/mosr/rd/expense/master/option',
|
||||
method: "get",
|
||||
params:{
|
||||
masterProjectName:masterProjectName
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const getExpenseSubprojectNameOption = (subProjectName) => {
|
||||
return request({
|
||||
url: '/workflow/mosr/rd/expense/sub/option',
|
||||
method: "get",
|
||||
params:{
|
||||
subProjectName:subProjectName
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const getCostMasterProjectNameOption = (masterProjectName) => {
|
||||
return request({
|
||||
url: '/workflow/mosr/cost/share/master/option',
|
||||
method: "get",
|
||||
params:{
|
||||
masterProjectName:masterProjectName
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const getCostSubprojectNameOption = (subProjectName) => {
|
||||
return request({
|
||||
url: '/workflow/mosr/cost/share/sub/option',
|
||||
method: "get",
|
||||
params:{
|
||||
subProjectName:subProjectName
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -15,6 +15,12 @@ import {reactive, ref} from "vue";
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import {costTemplateDownload, exportExcel, ledgerTemplateDownload} from "../../../api/project-manage";
|
||||
import ImportCostExcel from "@/components/ImportCostExcel.vue";
|
||||
import fvSelect from "@/fvcomponents/fvSelect/index.vue";
|
||||
import {
|
||||
getExpenseMasterProjectNameOption, getExpenseSubprojectNameOption,
|
||||
getMasterProjectNameOption,
|
||||
getSubprojectNameOption
|
||||
} from "@/api/project-demand/summary/index.js";
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const searchConfig = ref([
|
||||
@@ -22,24 +28,65 @@ const searchConfig = ref([
|
||||
{
|
||||
label: '主项目',
|
||||
prop: 'masterProjectName',
|
||||
component: 'el-input',
|
||||
component: shallowRef(fvSelect),
|
||||
props: {
|
||||
placeholder: '请输入主项目查询',
|
||||
placeholder: '请输入主项目',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
checkStrictly: true
|
||||
}
|
||||
options: [],
|
||||
remote: true,
|
||||
remoteMethod:async (val)=>{
|
||||
console.log('val',val)
|
||||
if(val){
|
||||
const res=await getExpenseMasterProjectNameOption(val)
|
||||
if(res.code==1000){
|
||||
let optionObj={}
|
||||
let optionsMap = new Map();
|
||||
res.data.forEach(item=>{
|
||||
optionObj={
|
||||
value:item.label,
|
||||
label:item.label
|
||||
}
|
||||
optionsMap.set(optionObj.value, optionObj);
|
||||
})
|
||||
// 将 Map 转换为数组
|
||||
searchConfig.value.find(item => item.prop == 'masterProjectName').props.options = Array.from(optionsMap.values())
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '子项目',
|
||||
prop: 'subProjectName',
|
||||
component: 'el-input',
|
||||
component: shallowRef(fvSelect),
|
||||
props: {
|
||||
placeholder: '请输入子项目查询',
|
||||
placeholder: '请输入子项目',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
checkStrictly: true
|
||||
}
|
||||
options: [],
|
||||
remote: true,
|
||||
remoteMethod:async (val)=>{
|
||||
if(val){
|
||||
const res=await getExpenseSubprojectNameOption(val)
|
||||
if(res.code==1000){
|
||||
let optionObj={}
|
||||
let optionsMap = new Map();
|
||||
res.data.forEach(item=>{
|
||||
if (item.value !== null && item.value !== "") { // 过滤 value 为 null 和 "" 的数据
|
||||
optionObj={
|
||||
value:item.label,
|
||||
label:item.label
|
||||
}
|
||||
optionsMap.set(optionObj.value, optionObj);
|
||||
}
|
||||
})
|
||||
// 将 Map 转换为数组
|
||||
searchConfig.value.find(item => item.prop == 'subProjectName').props.options = Array.from(optionsMap.values())
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '会计凭证记载金额(元)',
|
||||
|
||||
@@ -11,6 +11,11 @@
|
||||
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
||||
import {toThousands} from '@/utils/changePrice.js'
|
||||
import { getSubCompOpt } from '@/api/user/user.js';
|
||||
import {
|
||||
getMasterProjectNameOption,
|
||||
getRequirementName,
|
||||
getSubprojectNameOption
|
||||
} from "@/api/project-demand/summary/index.js";
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const searchConfig = ref(
|
||||
@@ -19,24 +24,65 @@ const searchConfig = ref(
|
||||
{
|
||||
label: '主项目',
|
||||
prop: 'masterProjectName',
|
||||
component: 'el-input',
|
||||
component: shallowRef(fvSelect),
|
||||
props: {
|
||||
placeholder: '请输入主项目查询',
|
||||
placeholder: '请输入主项目',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
checkStrictly: true
|
||||
}
|
||||
options: [],
|
||||
remote: true,
|
||||
remoteMethod:async (val)=>{
|
||||
console.log('val',val)
|
||||
if(val){
|
||||
const res=await getMasterProjectNameOption(val)
|
||||
if(res.code==1000){
|
||||
let optionObj={}
|
||||
let optionsMap = new Map();
|
||||
res.data.forEach(item=>{
|
||||
optionObj={
|
||||
value:item.label,
|
||||
label:item.label
|
||||
}
|
||||
optionsMap.set(optionObj.value, optionObj);
|
||||
})
|
||||
// 将 Map 转换为数组
|
||||
searchConfig.value.find(item => item.prop == 'masterProjectName').props.options = Array.from(optionsMap.values())
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '子项目',
|
||||
prop: 'subProjectName',
|
||||
component: 'el-input',
|
||||
component: shallowRef(fvSelect),
|
||||
props: {
|
||||
placeholder: '请输入子项目查询',
|
||||
placeholder: '请输入子项目',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
checkStrictly: true
|
||||
}
|
||||
options: [],
|
||||
remote: true,
|
||||
remoteMethod:async (val)=>{
|
||||
if(val){
|
||||
const res=await getSubprojectNameOption(val)
|
||||
if(res.code==1000){
|
||||
let optionObj={}
|
||||
let optionsMap = new Map();
|
||||
res.data.forEach(item=>{
|
||||
if (item.value !== null && item.value !== "") { // 过滤 value 为 null 和 "" 的数据
|
||||
optionObj={
|
||||
value:item.label,
|
||||
label:item.label
|
||||
}
|
||||
optionsMap.set(optionObj.value, optionObj);
|
||||
}
|
||||
})
|
||||
// 将 Map 转换为数组
|
||||
searchConfig.value.find(item => item.prop == 'subProjectName').props.options = Array.from(optionsMap.values())
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '项目类型',
|
||||
|
||||
@@ -16,19 +16,77 @@ import { getSubCompOpt } from '@/api/user/user.js';
|
||||
import {reactive, ref} from "vue";
|
||||
import {shareDetailExport, shareExportExcel} from "@/api/expense-manage";
|
||||
import {ElMessage} from "element-plus";
|
||||
import {
|
||||
getCostMasterProjectNameOption, getCostSubprojectNameOption,
|
||||
getMasterProjectNameOption,
|
||||
getSubprojectNameOption
|
||||
} from "@/api/project-demand/summary/index.js";
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const searchConfig = reactive([
|
||||
const searchConfig = ref([
|
||||
|
||||
{
|
||||
label: '主项目',
|
||||
prop: 'masterProjectName',
|
||||
component: shallowRef(fvSelect),
|
||||
props: {
|
||||
placeholder: '请输入主项目',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
options: [],
|
||||
remote: true,
|
||||
remoteMethod:async (val)=>{
|
||||
console.log('val',val)
|
||||
if(val){
|
||||
const res=await getCostMasterProjectNameOption(val)
|
||||
if(res.code==1000){
|
||||
let optionObj={}
|
||||
let optionsMap = new Map();
|
||||
res.data.forEach(item=>{
|
||||
optionObj={
|
||||
value:item.label,
|
||||
label:item.label
|
||||
}
|
||||
optionsMap.set(optionObj.value, optionObj);
|
||||
})
|
||||
// 将 Map 转换为数组
|
||||
searchConfig.value.find(item => item.prop == 'masterProjectName').props.options = Array.from(optionsMap.values())
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '子项目',
|
||||
prop: 'subProjectName',
|
||||
component: 'el-input',
|
||||
component: shallowRef(fvSelect),
|
||||
props: {
|
||||
placeholder: '请输入子项目查询',
|
||||
placeholder: '请输入子项目',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
checkStrictly: true
|
||||
}
|
||||
options: [],
|
||||
remote: true,
|
||||
remoteMethod:async (val)=>{
|
||||
if(val){
|
||||
const res=await getCostSubprojectNameOption(val)
|
||||
if(res.code==1000){
|
||||
let optionObj={}
|
||||
let optionsMap = new Map();
|
||||
res.data.forEach(item=>{
|
||||
if (item.value !== null && item.value !== "") { // 过滤 value 为 null 和 "" 的数据
|
||||
optionObj={
|
||||
value:item.label,
|
||||
label:item.label
|
||||
}
|
||||
optionsMap.set(optionObj.value, optionObj);
|
||||
}
|
||||
})
|
||||
// 将 Map 转换为数组
|
||||
searchConfig.value.find(item => item.prop == 'subProjectName').props.options = Array.from(optionsMap.values())
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
// {
|
||||
// label: '支付月份',
|
||||
|
||||
@@ -221,7 +221,7 @@
|
||||
:style="{marginLeft:!formData.isSpecialFund?route.query.id?'-10px':'-10px':route.query.id?'0':'-40px'}">
|
||||
<el-form-item label="主项目" prop="masterProjectId">
|
||||
<el-select v-model="formData.masterProjectId" clearable placeholder="请选择主项目"
|
||||
@change="changeCollectData">
|
||||
@change="changeCollectData" remote filterable :remote-method="filterMasterProject">
|
||||
<el-option
|
||||
v-for="item in masterProjectList"
|
||||
:key="item.value"
|
||||
@@ -567,6 +567,13 @@ const changeCollectData = () => {
|
||||
localStorage.setItem('collectData', JSON.stringify(params))
|
||||
}
|
||||
}
|
||||
|
||||
const filterMasterProject= (val)=>{
|
||||
if(val){
|
||||
getProjectList(val)
|
||||
}
|
||||
}
|
||||
|
||||
const handleShowOptionalChargeLeadershipPicker = () => {
|
||||
optionalChargeLeadershipPickerRef.value.showUserPicker()
|
||||
}
|
||||
@@ -584,8 +591,8 @@ const disabledDate = (time) => {
|
||||
return time.getTime() < new Date(formData.value.startTime).getTime();
|
||||
}
|
||||
|
||||
const getProjectList = () => {
|
||||
getProjectOption().then(res => {
|
||||
const getProjectList = (val) => {
|
||||
getProjectOption(val).then(res => {
|
||||
if (res.code === 1000) {
|
||||
if(name.value === 'Summary/edit'){
|
||||
masterProjectList.value = res.data.filter(item => item.value!=route.query.projectId)
|
||||
|
||||
Reference in New Issue
Block a user