1、调整业务模块
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import {
|
||||
auditColumns,
|
||||
createCrudOption,
|
||||
dataSourceOptions,
|
||||
phoneRule,
|
||||
planStatusOptions,
|
||||
selectRule,
|
||||
@@ -9,6 +8,12 @@ import {
|
||||
withSearchPlaceholders,
|
||||
} from './common';
|
||||
|
||||
const transportPlanDataSourceOptions = [
|
||||
{ label: '批量导入', value: '批量导入' },
|
||||
{ label: '手工创建', value: '手工创建' },
|
||||
{ label: '外部系统', value: '外部系统' },
|
||||
];
|
||||
|
||||
const listDicFormatter = res => {
|
||||
const data = res?.data || res;
|
||||
if (Array.isArray(data)) return data;
|
||||
@@ -61,7 +66,17 @@ const getSecondCargoTypeName = item =>
|
||||
'货物';
|
||||
|
||||
const formatGoodsInfo = row => {
|
||||
const rows = parseGoodsRows(row.goodsJson);
|
||||
const rows = [
|
||||
row.goodsJson,
|
||||
row.goodsList,
|
||||
row.goodsRows,
|
||||
row.cargoList,
|
||||
row.cargoRows,
|
||||
row.goods,
|
||||
]
|
||||
.map(source => parseGoodsRows(source))
|
||||
.filter(source => source.length)
|
||||
.sort((left, right) => right.length - left.length)[0] || [];
|
||||
if (!rows.length) return row.goodsInfo || '';
|
||||
|
||||
const groups = rows.reduce((result, item = {}) => {
|
||||
@@ -78,11 +93,22 @@ const formatGoodsInfo = row => {
|
||||
item.goodsQuantity,
|
||||
item.quantityUnit,
|
||||
item.goodsQuantityUnit,
|
||||
item.cargoUnit,
|
||||
item.unit,
|
||||
].some(Boolean);
|
||||
if (!hasGoodsInfo) return result;
|
||||
|
||||
const unit = item.quantityUnit || item.goodsQuantityUnit || item.unit || '';
|
||||
const unit = String(
|
||||
item.quantityUnit ||
|
||||
item.goodsQuantityUnit ||
|
||||
item.cargoUnit ||
|
||||
item.unit ||
|
||||
row.quantityUnit ||
|
||||
row.goodsQuantityUnit ||
|
||||
row.cargoUnit ||
|
||||
row.unit ||
|
||||
''
|
||||
).trim();
|
||||
if (!result[unit]) {
|
||||
result[unit] = {
|
||||
typeName: getSecondCargoTypeName(item),
|
||||
@@ -388,7 +414,7 @@ export const option = {
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 1,
|
||||
dicData: dataSourceOptions,
|
||||
dicData: transportPlanDataSourceOptions,
|
||||
minWidth: 120,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
|
||||
Reference in New Issue
Block a user