fix bug
This commit is contained in:
@@ -32,6 +32,23 @@ const parseJsonArray = value => {
|
||||
}
|
||||
};
|
||||
|
||||
const hasProcessConfig = value => {
|
||||
if (isEmpty(value)) return false;
|
||||
if (typeof value !== 'string') {
|
||||
return Array.isArray(value) ? value.length > 0 : typeof value === 'object';
|
||||
}
|
||||
const text = value.trim();
|
||||
if (!text) return false;
|
||||
try {
|
||||
const result = JSON.parse(text);
|
||||
return Array.isArray(result)
|
||||
? result.length > 0
|
||||
: Boolean(result && Object.keys(result).length);
|
||||
} catch (error) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
const getFirstValue = (row, props) => {
|
||||
const prop = props.find(item => !isEmpty(row[item]));
|
||||
return prop ? row[prop] : '';
|
||||
@@ -96,6 +113,11 @@ export const config = {
|
||||
exportUrl: '/blade-transport/waybill-manage/export-waybill-manage',
|
||||
exportName: '运单管理',
|
||||
importUrl: '/blade-transport/waybill-manage/import-waybill-manage',
|
||||
defaultForm: {
|
||||
carrierType: '承运商',
|
||||
quantityUnit: '吨',
|
||||
priceUnit: '元/吨',
|
||||
},
|
||||
enableAllDept: false,
|
||||
enableProjectSelect: true,
|
||||
templateCreateTarget: 'waybill-manage',
|
||||
@@ -103,6 +125,13 @@ export const config = {
|
||||
enableShippingPlanSelect: true,
|
||||
enableShippingInfoForm: true,
|
||||
enableTaskInfoForm: true,
|
||||
enableWaybillFooterFreightSummary: true,
|
||||
enableDraftSave: true,
|
||||
saveAsDraft: true,
|
||||
skipDraftValidation: true,
|
||||
draftStatusProp: 'businessStatus',
|
||||
draftStatus: 'draft',
|
||||
draftSaveText: '暂存',
|
||||
batchDelete: false,
|
||||
actionButtonLikeSearch: true,
|
||||
createText: '新建运单',
|
||||
@@ -118,6 +147,16 @@ export const config = {
|
||||
actions: ['copy', 'cancel', 'reassign', 'complete', 'batchComplete'],
|
||||
statusProp: 'businessStatus',
|
||||
statusTextProp: 'businessStatusName',
|
||||
formatStatus(row, prop, defaultText) {
|
||||
if (
|
||||
prop === 'businessStatus' &&
|
||||
row.businessStatus === 'pending' &&
|
||||
!hasProcessConfig(row.processJson)
|
||||
) {
|
||||
return '进行中';
|
||||
}
|
||||
return defaultText;
|
||||
},
|
||||
deleteStatus: ['draft'],
|
||||
editStatus: ['draft', 'pending'],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user