fix : 修复征集公司回显,所属公司改为征集公司

This commit is contained in:
2024-07-03 19:39:53 +08:00
parent f26a29338a
commit 9edf5d484f
17 changed files with 56 additions and 31 deletions

View File

@@ -118,7 +118,7 @@ const schema = computed(() => {
}
},
{
label: '所属公司',
label: '征集公司',
prop: 'affiliatedCompany',
colProps: {
span: 12

View File

@@ -1,13 +1,13 @@
export const matterTree = (array,data, id) => {
if (id) {
for (let i = 0; i < data.length; i++) {
if (data[i].value == id) {
array.push(data[i].label);
data.forEach(item => {
if (item.value == id) {
array.push(item.label);
}
if (data[i].children && data[i].children.length > 0) {
matterTree(array,data[i].children,id)
if (item.children && item.children.length > 0) {
matterTree(array,item.children,id)
}
}
})
return array;
}
}

View File

@@ -243,6 +243,7 @@ const showCompany = () => {
}
const selected = (select) => {
formData.value.companyIds=[]
for (let val of select) {
formData.value.companyIds.push(val.value)
}
@@ -368,7 +369,6 @@ const submitParam = (item) => {
}
}
const handleSubmit = async (instance) => {
console.log('submitParam(formData.value)', submitParam(formData.value))
if (!instance) return
instance.validate(async (valid) => {
if (!valid) {
@@ -415,16 +415,14 @@ const getCompanyOptionItem = (val) => {
if (val !== undefined) {
val.forEach(item => {
matterTree(companyNameArray.value, companyOption.value, item)
companyNameArray.value.forEach(companyItem => {
newObj = {
label: companyItem,
value: item
}
newArray.push(newObj)
})
})
companyNameArray.value.forEach(companyItem => {
newObj = {
label: companyItem
}
newArray.push(newObj)
})
}
return newArray;
}
const getDetailInfo = async () => {
@@ -460,7 +458,7 @@ const handleDelete = (row) => {
})
if (res.code === 1000) {
formData.value.fileList.splice(formData.value.fileList.findIndex((item) => item.id === row.fileId), 1);
showTable.value = formData.value.fileList.length !== 0;
// showTable.value = formData.value.fileList.length !== 0;
}
});
}

View File

@@ -77,7 +77,7 @@ const tableConfig = reactive({
},
{
prop: 'companyName',
label: '所属公司',
label: '征集公司',
align: 'center',
currentRender: ({row, index}) => (
<div style={{width: '300px', textOverflow: 'ellipsis'}}>{row.companyName}</div>)

View File

@@ -48,7 +48,7 @@ const schema = computed(() => {
}
},
{
label: '所属公司',
label: '征集公司',
prop: 'affiliatedCompany',
colProps: {
span: 12

View File

@@ -144,7 +144,7 @@ const tableConfig = reactive({
},
{
prop: 'affiliatedCompany',
label: '所属公司',
label: '征集公司',
align: 'center'
},
{

View File

@@ -54,7 +54,7 @@ const schema = computed(() => {
}
},
{
label: '所属公司',
label: '征集公司',
prop: 'affiliatedCompany',
colProps: {
span: 12

View File

@@ -64,7 +64,7 @@ const schema = computed(() => {
}
},
{
label: '所属公司',
label: '征集公司',
prop: 'affiliatedCompany',
colProps: {
span: 12

View File

@@ -147,7 +147,7 @@ const tableConfig = reactive({
},
{
prop: 'affiliatedCompany',
label: '所属公司',
label: '征集公司',
align: 'center'
},
{

View File

@@ -83,7 +83,7 @@ const schema = computed(() => {
}
},
{
label: '所属公司',
label: '征集公司',
prop: 'affiliatedCompany',
colProps: {
span: 12

View File

@@ -47,7 +47,7 @@ const schema = computed(() => {
}
},
{
label: '所属公司',
label: '征集公司',
prop: 'affiliatedCompany',
colProps: {
span: 12

View File

@@ -38,7 +38,7 @@ const schema = computed(() => {
}
},
{
label: '所属公司',
label: '征集公司',
prop: 'affiliatedCompany',
colProps: {
span: 12

View File

@@ -38,6 +38,7 @@ import {useTagsView} from '@/stores/tagsview.js'
import {uploadFileList} from "@/api/project-manage/attachment";
import {computed, ref} from "vue";
import {getBaseInfoApi} from "@/components/steps/api";
import {downloadFile,deleteFile} from "@/api/project-demand";
const tagsViewStore = useTagsView()
const route = useRoute()
@@ -68,7 +69,7 @@ const schema = computed(() => {
}
},
{
label: '所属公司',
label: '征集公司',
prop: 'affiliatedCompany',
colProps: {
span: 12
@@ -110,10 +111,14 @@ const tableConfig = reactive({
prop: 'oper',
label: '操作',
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => {
return (
<div>
<el-button type="primary" link onClick={() => handleDownload(row)}>下载</el-button>
<popover-delete name={row.originalFileName} type={'文件'} btnType={'danger'}
perm={['mosr:requirement:del']}
onDelete={() => handleDelete(row)}/>
</div>
)
}
@@ -126,6 +131,28 @@ const name = ref(router.currentRoute.value.name)
const rules = reactive({
tagName: [{required: true, message: '请输入标签名称', trigger: ['blur', 'change']}],
})
const handleDelete = (row) => {
deleteFile(row.fileId).then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) {
fileList.value.splice(fileList.value.findIndex((item) => item.id === row.fileId), 1);
}
});
}
const handleDownload = (row) => {
downloadFile(row.fileId).then(res => {
const blob = new Blob([res])
let a = document.createElement('a')
a.href = URL.createObjectURL(blob)
a.download = row.originalFileName
a.click()
})
}
const getBaseInfo = async () => {
try {
const {code, data} = await getBaseInfoApi(route.query.id)

View File

@@ -117,7 +117,7 @@ const schema = computed(() => {
}
},
{
label: '所属公司',
label: '征集公司',
prop: 'affiliatedCompany',
colProps: {
span: 12

View File

@@ -141,7 +141,7 @@ const tableConfig = reactive({
},
{
prop: 'affiliatedCompany',
label: '所属公司',
label: '征集公司',
align: 'center'
},
{

View File

@@ -18,7 +18,7 @@
</el-form-item>
</el-col>
<el-col :span="24" v-if="type==='singleDetail'">
<el-form-item label="所属公司">
<el-form-item label="征集公司">
<span :class="showExpendClass(showMoreCompany,formData.companyIds)">{{
getCompanyName(formData.companyIds)
}}</span>

View File

@@ -119,7 +119,7 @@ const schema = computed(() => {
}
},
{
label: '所属公司',
label: '征集公司',
prop: 'affiliatedCompany',
colProps: {
span: 24