调整预结算、正式结算
This commit is contained in:
@@ -5158,6 +5158,7 @@ const standaloneBusinessFormPaths = [
|
||||
...Object.keys(standaloneBusinessFormRoutes),
|
||||
...Object.values(standaloneBusinessFormRoutes),
|
||||
];
|
||||
const loadingCreateWaybillsStorageKey = 'loading-manage-create-waybills';
|
||||
|
||||
const attachmentViewerPlugins = [
|
||||
imagePlugin(),
|
||||
@@ -12779,28 +12780,41 @@ export default {
|
||||
this.$message.warning('请选择至少一条数据');
|
||||
return;
|
||||
}
|
||||
const nonRoadWaybills = this.selectionList.filter(row => {
|
||||
const transportType = String(row.transportType || '').trim();
|
||||
return transportType !== '公路运输' && transportType.toLowerCase() !== 'road';
|
||||
});
|
||||
const nonRoadWaybills = this.selectionList.filter(row => !this.waybillIsRoadTransport(row));
|
||||
if (nonRoadWaybills.length) {
|
||||
this.$message.warning('公路配置仅支持运输方式为“公路运输”的运单');
|
||||
this.$message.warning('公路配载仅支持运输方式为“公路运输”的运单');
|
||||
return;
|
||||
}
|
||||
if (typeof this.api.roadLoading !== 'function') {
|
||||
this.$message.warning('公路配载功能暂未配置');
|
||||
const unavailableWaybills = this.selectionList.filter(
|
||||
row =>
|
||||
this.statusValue(row) !== 'pending' ||
|
||||
row.loadingId ||
|
||||
row.loadingManageId ||
|
||||
row.loadingNo
|
||||
);
|
||||
if (unavailableWaybills.length) {
|
||||
this.$message.warning('公路配载仅支持进行中且未配载的运单');
|
||||
return;
|
||||
}
|
||||
this.$confirm('确定对选中的运单进行公路配载?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => this.api.roadLoading(this.ids))
|
||||
.then(() => {
|
||||
this.$message.success('公路配载成功');
|
||||
this.onLoad(this.page, this.query);
|
||||
});
|
||||
try {
|
||||
sessionStorage.setItem(
|
||||
loadingCreateWaybillsStorageKey,
|
||||
JSON.stringify({
|
||||
source: 'waybill-manage',
|
||||
rows: this.selectionList,
|
||||
})
|
||||
);
|
||||
} catch (error) {
|
||||
this.$message.error('暂存待配载运单失败,请重试');
|
||||
return;
|
||||
}
|
||||
this.$router.push({
|
||||
path: '/business/loading-manage/form',
|
||||
query: {
|
||||
mode: 'add',
|
||||
name: '新增配载管理',
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -635,8 +635,11 @@ export default {
|
||||
editPending(item) {
|
||||
const route = this.routes.find(routeItem => routeItem.segmentNo === item.segmentNo);
|
||||
if (!route) return;
|
||||
const sourceIndex = (this.master.goods || []).findIndex(goods => goods.cargoName === item.cargoName && goods.cargoType === item.cargoType);
|
||||
let goods = route.goods.find(goodsItem => goodsItem.cargoName === item.cargoName && goodsItem.cargoType === item.cargoType);
|
||||
const itemSourceIndex = Number(item.sourceIndex);
|
||||
const sourceIndex = Number.isInteger(itemSourceIndex) && itemSourceIndex >= 0
|
||||
? itemSourceIndex
|
||||
: (this.master.goods || []).findIndex(goods => goods.cargoName === item.cargoName && goods.cargoType === item.cargoType);
|
||||
let goods = route.goods.find(goodsItem => String(goodsItem.sourceIndex) === String(sourceIndex));
|
||||
if (!goods && sourceIndex >= 0) {
|
||||
goods = this.createGoodsRow(this.master.goods[sourceIndex], sourceIndex);
|
||||
route.goods.push(goods);
|
||||
@@ -646,8 +649,9 @@ export default {
|
||||
this.syncFreightItems(route);
|
||||
const freightItem = this.freightItemsForGoods(route, goods);
|
||||
if (freightItem) { freightItem.unitPrice = item.unitPrice || ''; freightItem.priceUnit = item.priceUnit || freightItem.priceUnit; }
|
||||
this.editingId = item.id;
|
||||
this.removePending(item.id);
|
||||
this.editingId = item.id;
|
||||
route.selected = true;
|
||||
this.$nextTick(() => document.querySelector(`[data-segment="${item.segmentNo}"]`)?.scrollIntoView({ behavior: 'smooth', block: 'start' }));
|
||||
},
|
||||
freightItemsForGoods(route, goods) {
|
||||
|
||||
@@ -907,7 +907,8 @@ export default {
|
||||
async loadContracts(projectId, selectFirst = true) {
|
||||
const response = await api.getProjectContracts(projectId);
|
||||
this.contracts = this.responseRecords(response).filter(
|
||||
item => String(item.projectId) === String(projectId)
|
||||
item =>
|
||||
String(item.projectId) === String(projectId) && item.contractCategory === '客户合同'
|
||||
);
|
||||
if (selectFirst) {
|
||||
const first = this.contracts[0];
|
||||
|
||||
Reference in New Issue
Block a user