空状态不完全显示
This commit is contained in:
@ -216,7 +216,7 @@ import FinishedProductDrawer from './finished-product-drawer.vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { getMediaAccountList } from '@/api/all/propertyMarketing';
|
||||
// 导入任务详情API
|
||||
import { getWorkDetail,getTaskSchedulesDetail } from '@/api/all/assignment-management';
|
||||
import { getWorkDetail } from '@/api/all/assignment-management';
|
||||
// 平台图标
|
||||
import iconDy from '@/assets/img/platform/icon-dy.png';
|
||||
import iconXhs from '@/assets/img/platform/icon-xhs.png';
|
||||
@ -389,7 +389,7 @@ const handleMaterialCancel = () => {
|
||||
};
|
||||
|
||||
// 处理成品库选择确认
|
||||
const handleProductConfirm = (result) => {
|
||||
const handleProductConfirm = async (result) => {
|
||||
selectedProducts.value = {
|
||||
keys: result.selectedKeys,
|
||||
data: result.selectedData,
|
||||
@ -401,13 +401,29 @@ const handleProductConfirm = (result) => {
|
||||
hasChoseFinishedProducts.value = true;
|
||||
// 取第一个选中的项目
|
||||
const selectedProduct = result.selectedRows[0];
|
||||
selectedProducts.value = {
|
||||
keys: [selectedProduct.id],
|
||||
data: [selectedProduct],
|
||||
text: '1个稿件',
|
||||
images: [selectedProduct],
|
||||
};
|
||||
fillTaskData(selectedProduct.id);
|
||||
|
||||
// 获取成品详情
|
||||
try {
|
||||
const res = await getWorkDetail(selectedProduct.id);
|
||||
if (res && res.code === 200) {
|
||||
const workDetail = res.data;
|
||||
selectedProducts.value = {
|
||||
keys: [workDetail.id],
|
||||
data: [workDetail],
|
||||
text: workDetail.title || '1个稿件',
|
||||
images: workDetail.files ? workDetail.files.filter(f => f.type === 0) : [], // 图片文件
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取成品详情失败:', error);
|
||||
// 如果获取详情失败,使用原始数据
|
||||
selectedProducts.value = {
|
||||
keys: [selectedProduct.id],
|
||||
data: [selectedProduct],
|
||||
text: '1个稿件',
|
||||
images: [selectedProduct],
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -490,7 +506,7 @@ const showDrawer = (accountInfo = null, selectedDate = null) => {
|
||||
|
||||
// 新增:编辑任务时的数据回填方法
|
||||
const fillTaskData = async (taskData) => {
|
||||
// 如果传入的数据包含完整信息,则直接使用,否则获取完整详情
|
||||
// 如果传入的数据包含完整信息,则直接使用,否则获取详情
|
||||
let fullTaskData = taskData;
|
||||
|
||||
// 如果没有work或raw_materials等详细信息,则需要获取完整详情
|
||||
|
||||
Reference in New Issue
Block a user