调整 iam
This commit is contained in:
@@ -146,8 +146,9 @@
|
||||
/>
|
||||
<el-input
|
||||
v-model="form.departureAddress"
|
||||
placeholder="请输入发货地址"
|
||||
:readonly="transportStationMode || !config.editableRoadAddress"
|
||||
class="shipping-template-page__address-map-input"
|
||||
readonly
|
||||
placeholder="请选择发货地址"
|
||||
:disabled="transportAddressSelectDisabled"
|
||||
@click="handleTransportSecondaryAddressInputClick('departure')"
|
||||
>
|
||||
@@ -189,8 +190,9 @@
|
||||
/>
|
||||
<el-input
|
||||
v-model="form.arrivalAddress"
|
||||
placeholder="请输入收货地址"
|
||||
:readonly="transportStationMode || !config.editableRoadAddress"
|
||||
class="shipping-template-page__address-map-input"
|
||||
readonly
|
||||
placeholder="请选择收货地址"
|
||||
:disabled="transportAddressSelectDisabled"
|
||||
@click="handleTransportSecondaryAddressInputClick('arrival')"
|
||||
>
|
||||
@@ -1131,7 +1133,7 @@ const defaultCargo = () => ({
|
||||
cargoTypePath: [],
|
||||
packageType: '',
|
||||
quantity: '',
|
||||
quantityUnit: '',
|
||||
quantityUnit: '吨',
|
||||
brand: '',
|
||||
specification: '',
|
||||
model: '',
|
||||
@@ -1258,6 +1260,7 @@ export default {
|
||||
crudDialogType: '',
|
||||
standaloneFormKey: '',
|
||||
copyingRow: null,
|
||||
suppressTransportTypeClear: false,
|
||||
detailBox: false,
|
||||
detailLoading: false,
|
||||
detailRow: {},
|
||||
@@ -1511,10 +1514,10 @@ export default {
|
||||
},
|
||||
},
|
||||
'form.transportType'(value, oldValue) {
|
||||
if (value !== oldValue) {
|
||||
this.handleTransportTypeChange(value);
|
||||
this.syncFreightItems();
|
||||
}
|
||||
if (this.suppressTransportTypeClear) return;
|
||||
if (String(value ?? '') === String(oldValue ?? '')) return;
|
||||
this.handleTransportTypeChange(value);
|
||||
this.syncFreightItems();
|
||||
},
|
||||
},
|
||||
created() {
|
||||
@@ -1527,6 +1530,20 @@ export default {
|
||||
methods: {
|
||||
buildOption(option) {
|
||||
const next = { ...option, column: (option.column || []).map(column => ({ ...column })) };
|
||||
const tableOrder = this.config.tableColumnOrder || [];
|
||||
if (tableOrder.length) {
|
||||
const orderMap = new Map(tableOrder.map((prop, index) => [prop, index]));
|
||||
next.column.sort((left, right) => {
|
||||
const leftOrder = orderMap.has(left.prop) ? orderMap.get(left.prop) : tableOrder.length;
|
||||
const rightOrder = orderMap.has(right.prop)
|
||||
? orderMap.get(right.prop)
|
||||
: tableOrder.length;
|
||||
return leftOrder - rightOrder;
|
||||
});
|
||||
next.column.forEach(column => {
|
||||
if (column.prop) column.hide = !orderMap.has(column.prop);
|
||||
});
|
||||
}
|
||||
if (this.menuWidth != null) next.menuWidth = this.menuWidth;
|
||||
if (
|
||||
this.standaloneFormPage &&
|
||||
@@ -1790,6 +1807,7 @@ export default {
|
||||
console.log('进入复制模式分支');
|
||||
const copyData = { ...this.copyingRow };
|
||||
this.copyingRow = null;
|
||||
this.suppressTransportTypeClear = true;
|
||||
this.form = { ...(this.config.defaultForm || {}), ...copyData };
|
||||
console.log('合并后的 form:', this.form);
|
||||
// 删除模板编号,等待系统生成
|
||||
@@ -1842,7 +1860,11 @@ export default {
|
||||
done?.();
|
||||
},
|
||||
applyFormDetail(row) {
|
||||
this.suppressTransportTypeClear = true;
|
||||
this.form = { ...(row || {}) };
|
||||
this.$nextTick(() => {
|
||||
this.suppressTransportTypeClear = false;
|
||||
});
|
||||
this.selectedProjectId = this.form.projectId || '';
|
||||
this.transportCargoRows = this.parseJsonArray(this.form.goodsJson).map(item =>
|
||||
this.normalizeCargo(item)
|
||||
@@ -1924,14 +1946,6 @@ export default {
|
||||
this.$message.warning(`第${index + 1}行货物类型不能为空`);
|
||||
return false;
|
||||
}
|
||||
if (!String(row.cargoName || '').trim() || !row.quantity || !row.quantityUnit) {
|
||||
this.$message.warning(`第${index + 1}行货物信息不完整`);
|
||||
return false;
|
||||
}
|
||||
if (Number(row.quantity) <= 0) {
|
||||
this.$message.warning(`第${index + 1}行数量必须大于0`);
|
||||
return false;
|
||||
}
|
||||
if (String(row.remark || '').length > 200) {
|
||||
this.$message.warning(`第${index + 1}行备注不能超过200个字符`);
|
||||
return false;
|
||||
@@ -2013,6 +2027,8 @@ export default {
|
||||
delete detail.updateUser;
|
||||
delete detail.updateUserName;
|
||||
delete detail.status;
|
||||
// 模板名称追加「副本」
|
||||
detail.templateName = `${detail.templateName || ''}副本`;
|
||||
|
||||
console.log('处理后的数据:', detail);
|
||||
console.log('isStandaloneBusinessPage:', this.isStandaloneBusinessPage);
|
||||
@@ -2286,13 +2302,60 @@ export default {
|
||||
},
|
||||
handleTransportTypeChange(value) {
|
||||
this.form.transportTypeName = this.getTransportTypeLabel(value);
|
||||
this.clearTransportShippingInfo();
|
||||
},
|
||||
clearTransportShippingInfo() {
|
||||
[
|
||||
'departureName',
|
||||
'departureAddress',
|
||||
'departureAddressCode',
|
||||
'departureSiteCode',
|
||||
'departureLongitude',
|
||||
'departureLatitude',
|
||||
'departureContact',
|
||||
'departurePhone',
|
||||
'arrivalName',
|
||||
'arrivalAddress',
|
||||
'arrivalAddressCode',
|
||||
'arrivalSiteCode',
|
||||
'arrivalLongitude',
|
||||
'arrivalLatitude',
|
||||
'arrivalContact',
|
||||
'arrivalPhone',
|
||||
].forEach(prop => {
|
||||
this.form[prop] = '';
|
||||
});
|
||||
this.transportMapSelected = {};
|
||||
this.transportRouteBox = false;
|
||||
this.transportAddressBox = false;
|
||||
this.transportStationBox = false;
|
||||
this.transportMapBox = false;
|
||||
this.transportAddressTarget = '';
|
||||
this.transportStationTarget = '';
|
||||
this.transportMapTarget = '';
|
||||
this.transportMapKeyword = '';
|
||||
this.transportMapStatus = '可搜索地址或点击地图选点';
|
||||
if (this.transportAmapMarker) {
|
||||
this.transportAmapMarker.setMap(null);
|
||||
this.transportAmapMarker = null;
|
||||
}
|
||||
this.$refs.crud?.clearValidate?.([
|
||||
'departureAddress',
|
||||
'arrivalAddress',
|
||||
'departureName',
|
||||
'arrivalName',
|
||||
'departureContact',
|
||||
'departurePhone',
|
||||
'arrivalContact',
|
||||
'arrivalPhone',
|
||||
]);
|
||||
},
|
||||
openTransportPrimaryAddressPicker(target) {
|
||||
if (this.transportStationMode) this.openTransportStationDialog(target);
|
||||
},
|
||||
handleTransportSecondaryAddressInputClick(target) {
|
||||
if (this.transportStationMode || !this.config.editableRoadAddress)
|
||||
this.openTransportSecondaryAddressPicker(target);
|
||||
if (this.transportAddressSelectDisabled) return;
|
||||
this.openTransportSecondaryAddressPicker(target);
|
||||
},
|
||||
openTransportSecondaryAddressPicker(target) {
|
||||
this.transportStationMode
|
||||
@@ -3328,6 +3391,13 @@ export default {
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
}
|
||||
.shipping-template-page__address-map-input {
|
||||
cursor: pointer;
|
||||
:deep(.el-input__wrapper),
|
||||
:deep(.el-input__inner) {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.shipping-template-page__section-actions {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
|
||||
Reference in New Issue
Block a user