fix : 修复需求征集编辑时所属公司回显,项目阶段改成研发阶段,人员选择器主子账号颜色区分

This commit is contained in:
2024-06-18 23:11:27 +08:00
parent 5410b6d248
commit 820349877c
8 changed files with 32 additions and 24 deletions

View File

@@ -161,8 +161,6 @@ const show = () => {
getList()
};
const handleChange = (data, checked) => {
// 左侧有选择框
// if (props.showCheckbox) {
// 左侧有选择框 + 多选
if (props.multiple) {
//不添加重复的数据到右边
@@ -197,7 +195,6 @@ const handleChange = (data, checked) => {
tree.value.setCheckedKeys([]);
}
}
// }
};
const handle = (node, check) => {
if (check.isLeaf !== false) {

View File

@@ -47,11 +47,11 @@ const searchConfig = reactive([
}
},
{
label: '项目阶段',
label: '研发阶段',
prop: 'researchStage',
component: shallowRef(fvSelect),
props: {
placeholder: '请选择项目阶段查询',
placeholder: '请选择研发阶段查询',
clearable: true,
filterable: true,
checkStrictly: true,
@@ -115,7 +115,7 @@ const tableConfig = reactive({
},
{
prop: 'researchStage',
label: '项目阶段',
label: '研发阶段',
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => {

View File

@@ -102,7 +102,7 @@ const tableConfig = reactive({
},
{
prop: 'researchStage',
label: '项目阶段',
label: '研发阶段',
align: 'center',
currentRender: ({row, index}) => {
if (row.researchStage&&row.researchStage !== null&&row.researchStage!==undefined) {

View File

@@ -34,8 +34,9 @@
</el-col>
<el-col :span="24">
<el-form-item label="所属公司" prop="companyIds" class="tree-select">
<div>{{ getName(companyList) }}</div>
<el-button color="#DED0B2" @click="showCompany">{{ companyList.length === 0 ? '请选择所属公司' : '更改' }}
<div v-if="route.query.id">{{selectedCompanyList}}</div>
<div v-else>{{ getName(selectedCompanyList) }}</div>
<el-button color="#DED0B2" @click="showCompany">{{ selectedCompanyList.length === 0 ? '请选择所属公司' : '更改' }}
</el-button>
<!-- <el-tree-select v-model="formData.companyIds" :data="companyOption"-->
<!-- filterable clearable :check-strictly="true" multiple/>-->
@@ -96,7 +97,7 @@
<el-button color="#DED0B2" v-else @click="handleResubmit">重新提交</el-button>
<el-button @click="handleBack">返回</el-button>
</div>
<company-picker :multiple="true" ref="companyRef" title="请选择所属公司" v-model:value="companyList" @ok="selected"/>
<company-picker :multiple="true" ref="companyRef" title="请选择所属公司" @ok="selected"/>
</div>
</template>
@@ -119,11 +120,13 @@ import {getSubCompOpt} from '@/api/user/user.js'
import {useTagsView} from '@/stores/tagsview.js'
import {getFundOption} from "@/api/special-fund";
import CompanyPicker from "@/components/DetailComponent/CompanyPicker.vue";
import {matterTree} from "@/utils/matterTree";
import {useCacheStore} from '@/stores/cache.js'
const cacheStore = useCacheStore()
const companyRef = ref()
const companyList = ref([])
const selectedCompanyList = ref([])
// const companyList = ref([])
const changeDiagram = ref(false)
const tagsViewStore = useTagsView()
const authStore = useAuthStore()
@@ -152,6 +155,7 @@ const showTable = ref(true)
const processStore = useProcessStore()
const processInstanceData = ref()
const formPermMap = ref(new Map());
const companyNameArray = ref([])
const rules = reactive({
requirementName: [{required: true, message: '请输入征集名称', trigger: 'blur'}],
companyIds: [{required: true, message: '请选择所属公司', trigger: 'blur'}],
@@ -203,6 +207,15 @@ const tableConfig = reactive({
}
]
})
const getCompanyOptionItem = (val) => {
if (val !== undefined) {
val.forEach(item => {
matterTree(companyNameArray.value, companyOption.value, item)
})
}
return companyNameArray.value.join('');
}
const getName = (list) => {
return list.map(item => item.label).join('')
}
@@ -210,12 +223,10 @@ const showCompany = () => {
companyRef.value.show()
}
const selected = (select) => {
let companyInfoList = []
for (let val of select) {
companyInfoList.push(val)
formData.value.companyIds.push(val.value)
}
companyList.value = companyInfoList
selectedCompanyList.value = select
}
const checkFormPrem = (formKey) => {
if (formPermMap.value.hasOwnProperty(formKey)) {
@@ -306,7 +317,6 @@ const init = async () => {
})
}
const submitParam = (item) => {
console.log('item..', item.companyIds)
if (item.companyIds.length === 0) {
ElNotification({
title: '提示',
@@ -373,6 +383,7 @@ const handleResubmit = () => {
const getDetailInfo = async () => {
getFormInfo(route.query.id).then(res => {
if (res.code === 1000) {
selectedCompanyList.value = getCompanyOptionItem(res.data.companyIds)
formData.value = res.data
showTinymce.value = false
showTable.value = false

View File

@@ -60,11 +60,11 @@ const searchConfig = reactive([
}
},
{
label: '项目阶段',
label: '研发阶段',
prop: 'researchStage',
component: shallowRef(fvSelect),
props: {
placeholder: '请选择项目阶段查询',
placeholder: '请选择研发阶段查询',
clearable: true,
filterable: true,
checkStrictly: true,
@@ -123,7 +123,7 @@ const tableConfig = reactive({
},
{
prop: 'researchStage',
label: '项目阶段',
label: '研发阶段',
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => {

View File

@@ -183,7 +183,7 @@ const tableConfig = reactive({
},
{
prop: 'researchStage',
label: '项目阶段',
label: '研发阶段',
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => {

View File

@@ -31,10 +31,10 @@
</el-form-item>
</template>
</el-table-column>
<el-table-column prop="researchStage" label="项目阶段">
<el-table-column prop="researchStage" label="研发阶段">
<template #default="scope">
<el-form-item prop="researchStage" :rules="scope.row.researchStage?'1':rules.researchStage">
<el-select v-model="scope.row.researchStage" placeholder="请选择项目阶段" clearable filterable>
<el-select v-model="scope.row.researchStage" placeholder="请选择研发阶段" clearable filterable>
<el-option
v-for="item in cacheStore.getDict('fee_stage')"
:key="item.value"
@@ -115,7 +115,7 @@ const baseForm = ref()
const rules = reactive({
time: [{required: true, message: '请选择时间', trigger: 'blur'}],
projectCost: [{required: true, message: '请输入项目费用', trigger: 'blur'}],
researchStage: [{required: true, message: '请输入项目阶段', trigger: 'blur'}],
researchStage: [{required: true, message: '请输入研发阶段', trigger: 'blur'}],
digest: [{required: true, message: '请输入摘要', trigger: 'blur'}],
afterTax: [{required: true, message: '请输入税后余额', trigger: 'blur'}]
})

View File

@@ -5,7 +5,7 @@
<div class="picker">
<div class="candidate" v-loading="loading">
<el-input v-model="filterText" @change="getList(1)"
clearable placeholder="输入部门/昵称进行搜索">
clearable placeholder="输入昵称进行搜索">
<template #append>
<el-button @click="getList(1)">搜索</el-button>
</template>
@@ -20,7 +20,7 @@
<template #default="{ node, data }">
<div class="tree-node">
<div v-if="data.type === 0" style="display: flex;align-items: center;padding: 3px 0">
<el-icon>
<el-icon :color="data.accountType==='1'?'#95d475':'#409eff'">
<UserFilled/>
</el-icon>
{{ node.label }}-{{ data.companyName }}