1、基础数据修复bug
2、客商模块修复bug
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
:table-loading="loading"
|
||||
:data="data"
|
||||
v-model:page="page"
|
||||
v-model:form="form"
|
||||
v-model="form"
|
||||
ref="crud"
|
||||
:permission="permissionList"
|
||||
:before-open="beforeOpen"
|
||||
@@ -22,7 +22,7 @@
|
||||
>
|
||||
<template #menu-left>
|
||||
<el-button type="primary" v-if="permission.cargo_type_add" @click="$refs.crud.rowAdd()">
|
||||
<el-icon class="el-icon--left"><Plus /></el-icon>新增
|
||||
<el-icon class="el-icon--left"><Plus /></el-icon>新建货物类型
|
||||
</el-button>
|
||||
<el-button type="primary" plain v-if="permission.cargo_type_import" @click="handleImport"
|
||||
><el-icon class="el-icon--left"><Upload /></el-icon>批量导入</el-button
|
||||
@@ -67,7 +67,7 @@
|
||||
:remote-method="loadParentOptions"
|
||||
:loading="parentLoading"
|
||||
:disabled="dialogType === 'view' || form.typeLevel !== 2"
|
||||
placeholder="请输入名称或编码搜索"
|
||||
placeholder="请输入"
|
||||
style="width: 100%"
|
||||
@change="handleParentChange"
|
||||
>
|
||||
@@ -348,6 +348,11 @@ export default {
|
||||
const parent = this.parentOptions.find(item => String(item.id) === String(value));
|
||||
this.form.parentCargoName = parent ? parent.cargoName : '';
|
||||
this.form.parentCargoCode = parent ? parent.cargoCode || parent.code || '' : '';
|
||||
if (parent) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.crud?.clearValidate?.(['parentId', 'parentCargoCode']);
|
||||
});
|
||||
}
|
||||
if (!parent) {
|
||||
this.form.cargoCode = '';
|
||||
return;
|
||||
@@ -540,7 +545,10 @@ export default {
|
||||
});
|
||||
},
|
||||
buildExportParams() {
|
||||
return { ...this.query };
|
||||
return {
|
||||
...this.query,
|
||||
...(this.ids ? { ids: this.ids } : {}),
|
||||
};
|
||||
},
|
||||
handleExport() {
|
||||
this.$confirm('是否导出货物类型数据?', '提示', {
|
||||
@@ -564,16 +572,9 @@ export default {
|
||||
},
|
||||
handleTemplate() {
|
||||
NProgress.start();
|
||||
// 直接下载工程内置的标准导入模板(public 目录静态资源),表头与可正常导入的模板一致,
|
||||
// 含一级(19 类)及全部二级示例,便于用户参照填写层级关系与编码规则
|
||||
const templateUrl = `${import.meta.env.BASE_URL}cargo-type-import-template.xlsx`;
|
||||
fetch(templateUrl)
|
||||
exportBlob('/blade-system/cargo-type/export-template', {}, { feedback: true })
|
||||
.then(res => {
|
||||
if (!res.ok) throw new Error('模板文件不存在');
|
||||
return res.blob();
|
||||
})
|
||||
.then(blob => {
|
||||
downloadXls(blob, '货物类型导入模板.xlsx');
|
||||
downloadXls(res.data, '货物类型导入模板.xlsx');
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message.error('模板下载失败,请稍后重试');
|
||||
|
||||
@@ -24,10 +24,9 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
plain
|
||||
v-if="hasPermission('common_address_add')"
|
||||
@click="$refs.crud.rowAdd()"
|
||||
>新增
|
||||
>新建常用地址
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@@ -188,7 +187,6 @@
|
||||
/>
|
||||
<el-input
|
||||
v-model="form.detailAddress"
|
||||
readonly
|
||||
maxlength="255"
|
||||
placeholder="点击后弹出地图组件"
|
||||
suffix-icon="el-icon-location"
|
||||
@@ -389,10 +387,96 @@ export default {
|
||||
column.rules = rules;
|
||||
}
|
||||
},
|
||||
setColumnSpan(prop, span) {
|
||||
const column = this.findColumn(this.option.column, prop);
|
||||
if (column) {
|
||||
column.span = span;
|
||||
}
|
||||
},
|
||||
setColumnRow(prop, row) {
|
||||
const column = this.findColumn(this.option.column, prop);
|
||||
if (column) {
|
||||
column.row = row;
|
||||
}
|
||||
},
|
||||
setColumnOrder(prop, order) {
|
||||
const column = this.findColumn(this.option.column, prop);
|
||||
if (column) {
|
||||
column.order = order;
|
||||
}
|
||||
},
|
||||
syncSourceFormLayout(addressType) {
|
||||
const isPortTerminal = addressType === '港口/码头';
|
||||
const isRailwayStation = addressType === '铁路车站';
|
||||
const isAirport = addressType === '空港机场';
|
||||
const isRegularAddress = addressType === '常规地址';
|
||||
this.setColumnSpan(
|
||||
'addressName',
|
||||
isRegularAddress || isPortTerminal || isRailwayStation || isAirport ? 12 : 24
|
||||
);
|
||||
this.setColumnRow('addressName', true);
|
||||
this.setColumnSpan('stationId', isRailwayStation ? 12 : 24);
|
||||
this.setColumnSpan('airportId', isAirport ? 12 : 24);
|
||||
this.setColumnRow('stationId', isRailwayStation);
|
||||
this.setColumnRow('airportId', isAirport);
|
||||
const formOrders = {
|
||||
addressType: 100,
|
||||
addressName: 70,
|
||||
contactName: 60,
|
||||
contactPhone: 50,
|
||||
detailAddress: 40,
|
||||
remark: 30,
|
||||
};
|
||||
if (isPortTerminal) {
|
||||
Object.assign(formOrders, {
|
||||
addressType: 80,
|
||||
portId: 70,
|
||||
terminalId: 60,
|
||||
addressName: 50,
|
||||
contactName: 40,
|
||||
contactPhone: 30,
|
||||
detailAddress: 20,
|
||||
remark: 10,
|
||||
});
|
||||
} else if (isRailwayStation) {
|
||||
Object.assign(formOrders, {
|
||||
addressType: 80,
|
||||
stationId: 70,
|
||||
addressName: 60,
|
||||
contactName: 50,
|
||||
contactPhone: 40,
|
||||
detailAddress: 30,
|
||||
remark: 20,
|
||||
});
|
||||
} else if (isAirport) {
|
||||
Object.assign(formOrders, {
|
||||
addressType: 80,
|
||||
airportId: 70,
|
||||
addressName: 60,
|
||||
contactName: 50,
|
||||
contactPhone: 40,
|
||||
detailAddress: 30,
|
||||
remark: 20,
|
||||
});
|
||||
}
|
||||
[
|
||||
'addressType',
|
||||
'portId',
|
||||
'terminalId',
|
||||
'stationId',
|
||||
'airportId',
|
||||
'addressName',
|
||||
'contactName',
|
||||
'contactPhone',
|
||||
'detailAddress',
|
||||
'remark',
|
||||
].forEach(prop => this.setColumnOrder(prop, formOrders[prop]));
|
||||
},
|
||||
syncSourceColumnDisplay(addressType) {
|
||||
const isPortTerminal = addressType === '港口/码头';
|
||||
const isRailwayStation = addressType === '铁路车站';
|
||||
const isAirport = addressType === '空港机场';
|
||||
this.syncSourceFormLayout(addressType);
|
||||
this.setColumnDisplay('portId', isPortTerminal);
|
||||
this.setColumnDisplay('terminalId', isPortTerminal);
|
||||
this.setColumnDisplay('stationId', isRailwayStation);
|
||||
@@ -1183,6 +1267,17 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.common-address-page :deep(.avue-crud__dialog .avue-form__row),
|
||||
.common-address-page :deep(.avue-crud__dialog .el-row) {
|
||||
margin-right: -16px;
|
||||
margin-left: -16px;
|
||||
}
|
||||
|
||||
.common-address-page :deep(.avue-crud__dialog .el-col) {
|
||||
padding-right: 16px;
|
||||
padding-left: 16px;
|
||||
}
|
||||
|
||||
.common-address-page {
|
||||
&__map-address {
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user