Compare commits
5 Commits
1862115e1d
...
1e4de76978
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e4de76978 | |||
| e6d4edf362 | |||
| 5e92124710 | |||
| badfed7ff1 | |||
| c339852e04 |
@@ -170,12 +170,14 @@ Avue 表格/表单配置独立存放于 `src/option/` 目录,与 `views` 和 `
|
||||
- 表格操作列同时展示“查看、编辑、删除”等三个按钮时,操作列宽度统一不小于 `220px`;操作列最大按钮数量超过 3 个时,操作列宽度统一加宽到不小于 `320px`;最大按钮数量超过 4 个时,仍按 `320px` 保持列宽,并从第 5 个按钮开始换行展示,禁止出现按钮裁切或显示不全。
|
||||
- 表格操作列按钮统一仅展示文字,禁止配置 `icon` / `:icon` 或在操作按钮、操作下拉项中嵌入图标;顶部工具栏按钮不受此条限制。
|
||||
- 纯文字操作入口统一使用 `<el-link>`,禁止使用带 `text` 属性的 `<el-button>`;提交、确认、上传等具有明确命令语义或需要加载状态的按钮可继续使用 `<el-button>`。
|
||||
- 所有表格操作列中的文字链接统一保持 `8px` 间距;操作按钮超过操作列可用宽度时必须自动换行,禁止链接连续粘连或被裁切。Avue 自定义 `#menu` 插槽和手写 `el-table-column` 操作列均适用。
|
||||
- `.avue-crud__header` 顶部间距统一为 `12px`。
|
||||
- 分页组件整体靠右展示,必须展示接口返回的数据总条数,`X条/页` 的页容量选择器必须放在总条数右侧。
|
||||
- `.basic-container__card` 的直接子级 `.el-card__body` 内边距统一去除,保持 `padding: 0`
|
||||
- 所有 CRUD 页面搜索栏需与下方表格拆分为独立区域,两者垂直间距统一为 `8px`。
|
||||
- 所有 CRUD 页面搜索栏操作按钮(搜索、清空等)需在搜索表单下方独占一行并放置在最右侧;搜索条件超过一行时必须显示“展开/折叠”,默认折叠且仅展示一行搜索条件;一行布局默认展示 4 个筛选项,Avue 配置统一使用 `searchIndex: 4`。
|
||||
- 所有 CRUD 页面中新增、批量导入等顶部按钮组行不需要背景色,应保持透明背景。
|
||||
- 所有 CRUD 页面顶部工具栏的“新增/新建”主操作按钮统一使用蓝底白字的实心主按钮(`type="primary"` 且不使用 `plain`),视觉标准与“新建运单”一致;批量导入、导出等辅助工具按钮仍使用描边样式。
|
||||
- 所有 `.basic-container__card` 内的 Avue 内层 `el-card` 需去卡片化,仅保留外层容器卡片样式,禁止出现二级卡片边框、阴影或额外内边距。
|
||||
|
||||
### 4.5 全局注册组件
|
||||
|
||||
@@ -45,6 +45,13 @@ export const reject = id =>
|
||||
params: { id },
|
||||
});
|
||||
|
||||
export const updateAttachments = row =>
|
||||
request({
|
||||
url: `${baseUrl}/update-attachments`,
|
||||
method: 'post',
|
||||
data: row,
|
||||
});
|
||||
|
||||
export const withdraw = id =>
|
||||
request({
|
||||
url: `${baseUrl}/withdraw`,
|
||||
|
||||
@@ -40,6 +40,16 @@ export const submitApproval = id => {
|
||||
});
|
||||
};
|
||||
|
||||
export const withdrawApproval = id => {
|
||||
return request({
|
||||
url: '/blade-transport/customer-archive/withdraw-approval',
|
||||
method: 'post',
|
||||
params: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
export const approve = id => {
|
||||
return request({
|
||||
url: '/blade-transport/customer-archive/approve',
|
||||
|
||||
@@ -85,6 +85,9 @@ const MIME_MAP = {
|
||||
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
ppt: 'application/vnd.ms-powerpoint',
|
||||
pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||
eml: 'message/rfc822',
|
||||
msg: 'application/vnd.ms-outlook',
|
||||
zip: 'application/zip',
|
||||
txt: 'text/plain',
|
||||
};
|
||||
|
||||
|
||||
@@ -56,10 +56,10 @@ export const getCargoTypeOption = ctx => ({
|
||||
type: 'radio',
|
||||
dataType: 'number',
|
||||
dicData: typeLevelDic,
|
||||
search: true,
|
||||
searchSpan: 6,
|
||||
search: false,
|
||||
value: 2,
|
||||
span: 24,
|
||||
order: 100,
|
||||
hide: true,
|
||||
minWidth: 120,
|
||||
editDisabled: true,
|
||||
@@ -70,20 +70,34 @@ export const getCargoTypeOption = ctx => ({
|
||||
label: '货物类型',
|
||||
prop: 'cargoName',
|
||||
minWidth: 150,
|
||||
search: true,
|
||||
searchPlaceholder: '请输入',
|
||||
searchSpan: 6,
|
||||
searchOrder: 2,
|
||||
order: 70,
|
||||
placeholder: '请输入',
|
||||
maxlength: 50,
|
||||
showWordLimit: true,
|
||||
showOverflowTooltip: true,
|
||||
rules: [{ validator: validateCargoName, trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '请输入货物类型名称', trigger: 'blur' },
|
||||
{ validator: validateCargoName, trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '货物类型编码',
|
||||
prop: 'cargoCode',
|
||||
minWidth: 140,
|
||||
search: true,
|
||||
searchPlaceholder: '请输入',
|
||||
searchSpan: 6,
|
||||
searchOrder: 1,
|
||||
maxlength: 4,
|
||||
order: 60,
|
||||
placeholder: '请输入',
|
||||
editDisabled: true,
|
||||
rules: [
|
||||
{ required: true, message: '请输入货物类型编码', trigger: 'blur' },
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
const form = ctx.form || {};
|
||||
@@ -115,6 +129,8 @@ export const getCargoTypeOption = ctx => ({
|
||||
hide: true,
|
||||
display: false,
|
||||
span: 12,
|
||||
order: 90,
|
||||
placeholder: '请输入',
|
||||
rules: [{ required: true, message: '请选择上级货物类型', trigger: 'change' }],
|
||||
},
|
||||
{
|
||||
@@ -128,16 +144,19 @@ export const getCargoTypeOption = ctx => ({
|
||||
minWidth: 160,
|
||||
},
|
||||
{
|
||||
label: '上级货物编码',
|
||||
label: '上级货物类型编码',
|
||||
prop: 'parentCargoCode',
|
||||
slot: true,
|
||||
readonly: true,
|
||||
editDisabled: true,
|
||||
addDisabled: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
display: false,
|
||||
span: 12,
|
||||
order: 80,
|
||||
minWidth: 160,
|
||||
placeholder: '请输入',
|
||||
rules: [{ required: true, message: '请选择上级货物类型', trigger: 'change' }],
|
||||
},
|
||||
{
|
||||
@@ -156,6 +175,7 @@ export const getCargoTypeOption = ctx => ({
|
||||
minRows: 4,
|
||||
span: 24,
|
||||
minWidth: 180,
|
||||
placeholder: '请输入',
|
||||
maxlength: 200,
|
||||
showWordLimit: true,
|
||||
overHidden: true,
|
||||
|
||||
@@ -27,18 +27,154 @@ export const createOption = () => ({
|
||||
delBtn: false,
|
||||
addBtn: false,
|
||||
dialogClickModal: false,
|
||||
menuWidth: 160,
|
||||
menuFixed: 'right',
|
||||
menuWidth: 220,
|
||||
column: [
|
||||
{
|
||||
label: '地址名称',
|
||||
prop: 'addressName',
|
||||
search: true,
|
||||
searchOrder: 8,
|
||||
span: 24,
|
||||
minWidth: 150,
|
||||
showOverflowTooltip: true,
|
||||
placeholder: '请输入',
|
||||
maxlength: 100,
|
||||
showWordLimit: true,
|
||||
rules: [
|
||||
{ required: true, message: '请输入地址名称', trigger: 'blur' },
|
||||
{ max: 100, message: '地址名称不能超过100个字', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '地址编号',
|
||||
prop: 'addressCode',
|
||||
minWidth: 120,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '类型',
|
||||
prop: 'addressType',
|
||||
type: 'select',
|
||||
formslot: true,
|
||||
search: true,
|
||||
searchOrder: 7,
|
||||
span: 24,
|
||||
minWidth: 140,
|
||||
dicData: addressTypeOptions,
|
||||
rules: [{ required: true, message: '请选择类型', trigger: 'change' }],
|
||||
},
|
||||
{
|
||||
label: '站点编码',
|
||||
prop: 'siteCodeDisplay',
|
||||
search: false,
|
||||
minWidth: 120,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '详细地址',
|
||||
prop: 'detailAddress',
|
||||
search: true,
|
||||
searchOrder: 5,
|
||||
formslot: true,
|
||||
type: 'textarea',
|
||||
minRows: 3,
|
||||
span: 24,
|
||||
minWidth: 220,
|
||||
showOverflowTooltip: true,
|
||||
rules: [
|
||||
{ required: true, message: '请输入详细地址', trigger: 'blur' },
|
||||
{ max: 255, message: '详细地址不能超过255个字', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '经度',
|
||||
prop: 'longitude',
|
||||
minWidth: 120,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '纬度',
|
||||
prop: 'latitude',
|
||||
minWidth: 120,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '行政区划',
|
||||
prop: 'regionName',
|
||||
search: true,
|
||||
searchOrder: 4,
|
||||
display: false,
|
||||
minWidth: 150,
|
||||
rules: [{ required: true, message: '请选择行政区划', trigger: 'change' }],
|
||||
},
|
||||
{
|
||||
label: '联系人',
|
||||
prop: 'contactName',
|
||||
search: true,
|
||||
searchOrder: 2,
|
||||
minWidth: 110,
|
||||
placeholder: '请输入',
|
||||
maxlength: 50,
|
||||
rules: [{ max: 50, message: '联系人不能超过50个字', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '联系方式',
|
||||
prop: 'contactPhone',
|
||||
search: true,
|
||||
searchOrder: 1,
|
||||
minWidth: 130,
|
||||
placeholder: '请输入',
|
||||
maxlength: 20,
|
||||
rules: [{ max: 20, message: '联系方式不能超过20个字', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '组织',
|
||||
prop: 'deptName',
|
||||
minWidth: 150,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
type: 'textarea',
|
||||
minRows: 4,
|
||||
span: 24,
|
||||
minWidth: 160,
|
||||
overHidden: true,
|
||||
showOverflowTooltip: true,
|
||||
placeholder: '请输入',
|
||||
maxlength: 200,
|
||||
showWordLimit: true,
|
||||
rules: [{ max: 200, message: '备注不能超过200个字', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '更新时间',
|
||||
prop: 'updateTime',
|
||||
type: 'datetime',
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
width: 180,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '创建时间',
|
||||
prop: 'createTime',
|
||||
type: 'datetime',
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
width: 180,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '港口',
|
||||
prop: 'portId',
|
||||
@@ -75,133 +211,24 @@ export const createOption = () => ({
|
||||
span: 24,
|
||||
rules: [{ required: true, message: '请选择机场标准名称', trigger: 'change' }],
|
||||
},
|
||||
{
|
||||
label: '地址名称',
|
||||
prop: 'addressName',
|
||||
search: true,
|
||||
span: 24,
|
||||
minWidth: 150,
|
||||
maxlength: 100,
|
||||
showWordLimit: true,
|
||||
rules: [
|
||||
{ required: true, message: '请输入地址名称', trigger: 'blur' },
|
||||
{ max: 100, message: '地址名称不能超过100个字', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '地址编号',
|
||||
prop: 'addressCode',
|
||||
minWidth: 120,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '站点编码',
|
||||
prop: 'siteCodeDisplay',
|
||||
search: false,
|
||||
minWidth: 120,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '站点编码',
|
||||
prop: 'siteCode',
|
||||
search: true,
|
||||
searchOrder: 6,
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '行政区划',
|
||||
prop: 'regionName',
|
||||
search: true,
|
||||
display: false,
|
||||
minWidth: 150,
|
||||
rules: [{ required: true, message: '请选择行政区划', trigger: 'change' }],
|
||||
},
|
||||
{
|
||||
label: '详细地址',
|
||||
prop: 'detailAddress',
|
||||
search: true,
|
||||
formslot: true,
|
||||
type: 'textarea',
|
||||
minRows: 3,
|
||||
span: 24,
|
||||
minWidth: 220,
|
||||
rules: [
|
||||
{ required: true, message: '请输入详细地址', trigger: 'blur' },
|
||||
{ max: 255, message: '详细地址不能超过255个字', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '组织',
|
||||
prop: 'deptId',
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 3,
|
||||
hide: true,
|
||||
display: false,
|
||||
dicData: [],
|
||||
},
|
||||
{
|
||||
label: '组织',
|
||||
prop: 'deptName',
|
||||
minWidth: 150,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '联系人',
|
||||
prop: 'contactName',
|
||||
search: true,
|
||||
minWidth: 110,
|
||||
maxlength: 50,
|
||||
rules: [{ max: 50, message: '联系人不能超过50个字', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '联系方式',
|
||||
prop: 'contactPhone',
|
||||
search: true,
|
||||
minWidth: 130,
|
||||
maxlength: 20,
|
||||
rules: [{ max: 20, message: '联系方式不能超过20个字', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
type: 'textarea',
|
||||
minRows: 4,
|
||||
span: 24,
|
||||
hide: true,
|
||||
maxlength: 200,
|
||||
showWordLimit: true,
|
||||
rules: [{ max: 200, message: '备注不能超过200个字', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '更新人',
|
||||
prop: 'updateUserName',
|
||||
minWidth: 120,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '更新时间',
|
||||
prop: 'updateTime',
|
||||
type: 'datetime',
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
minWidth: 160,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '创建时间',
|
||||
prop: 'createTime',
|
||||
type: 'datetime',
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
minWidth: 160,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
@@ -6,6 +6,15 @@ import {
|
||||
textRule,
|
||||
} from './common';
|
||||
|
||||
const listDicFormatter = res => {
|
||||
const data = res?.data || res;
|
||||
if (Array.isArray(data)) return data;
|
||||
if (Array.isArray(data?.records)) return data.records;
|
||||
if (Array.isArray(data?.data)) return data.data;
|
||||
if (Array.isArray(data?.data?.records)) return data.data.records;
|
||||
return [];
|
||||
};
|
||||
|
||||
export const config = {
|
||||
title: '常用货物',
|
||||
permission: 'common_cargo',
|
||||
@@ -17,12 +26,29 @@ export const config = {
|
||||
};
|
||||
|
||||
export const option = createCrudOption([
|
||||
{
|
||||
label: '货物名称',
|
||||
prop: 'cargoName',
|
||||
minWidth: 150,
|
||||
placeholder: '请输入',
|
||||
rules: textRule('货物名称', 100, true),
|
||||
},
|
||||
{
|
||||
label: '货物编号',
|
||||
prop: 'cargoCode',
|
||||
formslot: true,
|
||||
minWidth: 120,
|
||||
maxlength: 20,
|
||||
showWordLimit: true,
|
||||
rules: [
|
||||
{ required: true, message: '请输入货物编号', trigger: 'blur' },
|
||||
{ max: 20, message: '货物编号不能超过20个字符', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '一级货物类型',
|
||||
prop: 'firstCargoTypeName',
|
||||
formslot: true,
|
||||
search: true,
|
||||
searchOrder: 3,
|
||||
minWidth: 150,
|
||||
editDisabled: true,
|
||||
rules: [{ required: true, message: '请选择一级货物类型', trigger: 'change' }],
|
||||
@@ -39,8 +65,6 @@ export const option = createCrudOption([
|
||||
label: '二级货物类型',
|
||||
prop: 'secondCargoTypeName',
|
||||
formslot: true,
|
||||
search: true,
|
||||
searchOrder: 4,
|
||||
minWidth: 150,
|
||||
editDisabled: true,
|
||||
rules: [{ required: true, message: '请选择二级货物类型', trigger: 'change' }],
|
||||
@@ -48,47 +72,118 @@ export const option = createCrudOption([
|
||||
{
|
||||
label: '二级货物类型编码',
|
||||
prop: 'secondCargoTypeCode',
|
||||
hide: true,
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisabled: true,
|
||||
},
|
||||
// 搜索字段与表格、表单字段独立,避免筛选配置影响数据展示和编辑布局。
|
||||
{
|
||||
label: '货物名称',
|
||||
prop: 'cargoName',
|
||||
prop: 'searchCargoName',
|
||||
searchProp: 'cargoName',
|
||||
search: true,
|
||||
searchOrder: 1,
|
||||
minWidth: 150,
|
||||
rules: textRule('货物名称', 100, true),
|
||||
searchOrder: 5,
|
||||
searchPlaceholder: '请输入',
|
||||
hide: true,
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '货物编号',
|
||||
prop: 'cargoCode',
|
||||
formslot: true,
|
||||
prop: 'searchCargoCode',
|
||||
searchProp: 'cargoCode',
|
||||
search: true,
|
||||
searchOrder: 4,
|
||||
searchPlaceholder: '请输入',
|
||||
hide: true,
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '一级货物类型',
|
||||
prop: 'searchFirstCargoTypeName',
|
||||
searchProp: 'firstCargoTypeName',
|
||||
type: 'select',
|
||||
searchType: 'select',
|
||||
search: true,
|
||||
searchOrder: 3,
|
||||
searchPlaceholder: '请选择',
|
||||
dicUrl: '/blade-system/cargo-type/list?current=1&size=9999&typeLevel=1',
|
||||
dicFormatter: listDicFormatter,
|
||||
props: {
|
||||
label: 'cargoName',
|
||||
value: 'cargoName',
|
||||
},
|
||||
filterable: true,
|
||||
hide: true,
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '二级货物类型',
|
||||
prop: 'searchSecondCargoTypeName',
|
||||
searchProp: 'secondCargoTypeName',
|
||||
type: 'select',
|
||||
searchType: 'select',
|
||||
search: true,
|
||||
searchOrder: 2,
|
||||
minWidth: 120,
|
||||
maxlength: 20,
|
||||
showWordLimit: true,
|
||||
rules: [
|
||||
{ required: true, message: '请输入货物编号', trigger: 'blur' },
|
||||
{ max: 20, message: '货物编号不能超过20个字符', trigger: 'blur' },
|
||||
],
|
||||
searchPlaceholder: '请选择',
|
||||
dicUrl: '/blade-system/cargo-type/list?current=1&size=9999&typeLevel=2',
|
||||
dicFormatter: listDicFormatter,
|
||||
props: {
|
||||
label: 'cargoName',
|
||||
value: 'cargoName',
|
||||
},
|
||||
filterable: true,
|
||||
hide: true,
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '组织',
|
||||
prop: 'deptName',
|
||||
prop: 'searchDeptId',
|
||||
searchProp: 'deptId',
|
||||
type: 'select',
|
||||
searchType: 'select',
|
||||
search: true,
|
||||
searchOrder: 5,
|
||||
searchOrder: 1,
|
||||
searchPlaceholder: '请选择',
|
||||
dicData: [],
|
||||
props: {
|
||||
label: 'label',
|
||||
value: 'value',
|
||||
},
|
||||
filterable: true,
|
||||
hide: true,
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '包装品牌',
|
||||
prop: 'packageBrand',
|
||||
slot: true,
|
||||
minWidth: 150,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '品牌',
|
||||
prop: 'brand',
|
||||
search: false,
|
||||
hide: true,
|
||||
minWidth: 120,
|
||||
placeholder: '请输入',
|
||||
rules: textRule('品牌', 50),
|
||||
},
|
||||
{
|
||||
@@ -96,10 +191,25 @@ export const option = createCrudOption([
|
||||
prop: 'packageType',
|
||||
type: 'select',
|
||||
dicData: packageOptions,
|
||||
hide: true,
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
label: '货值',
|
||||
label: '规格',
|
||||
prop: 'specification',
|
||||
minWidth: 120,
|
||||
placeholder: '请输入',
|
||||
rules: textRule('规格', 50),
|
||||
},
|
||||
{
|
||||
label: '型号',
|
||||
prop: 'model',
|
||||
minWidth: 120,
|
||||
placeholder: '请输入',
|
||||
rules: textRule('型号', 50),
|
||||
},
|
||||
{
|
||||
label: '单价',
|
||||
prop: 'cargoValue',
|
||||
formslot: true,
|
||||
minWidth: 120,
|
||||
@@ -129,29 +239,26 @@ export const option = createCrudOption([
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
label: '规格',
|
||||
prop: 'specification',
|
||||
minWidth: 120,
|
||||
rules: textRule('规格', 50),
|
||||
},
|
||||
{
|
||||
label: '型号',
|
||||
prop: 'model',
|
||||
minWidth: 120,
|
||||
rules: textRule('型号', 50),
|
||||
},
|
||||
{
|
||||
label: '说明',
|
||||
prop: 'descriptionOne',
|
||||
minWidth: 160,
|
||||
rules: textRule('说明', 100),
|
||||
},
|
||||
{
|
||||
label: '数据来源',
|
||||
prop: 'dataSource',
|
||||
label: '尺寸',
|
||||
prop: 'sizeText',
|
||||
minWidth: 120,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
rules: textRule('尺寸', 100),
|
||||
},
|
||||
{
|
||||
label: '其他说明1',
|
||||
prop: 'descriptionOne',
|
||||
minWidth: 160,
|
||||
placeholder: '请输入',
|
||||
rules: textRule('其他说明1', 100),
|
||||
},
|
||||
{
|
||||
label: '其他说明2',
|
||||
prop: 'descriptionTwo',
|
||||
minWidth: 160,
|
||||
placeholder: '请输入',
|
||||
rules: textRule('其他说明2', 100),
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
@@ -159,12 +266,25 @@ export const option = createCrudOption([
|
||||
type: 'textarea',
|
||||
minRows: 4,
|
||||
span: 24,
|
||||
hide: true,
|
||||
maxlength: 200,
|
||||
showWordLimit: true,
|
||||
placeholder: '请输入',
|
||||
rules: textRule('备注', 200),
|
||||
},
|
||||
...auditColumns,
|
||||
{
|
||||
label: '组织',
|
||||
prop: 'deptName',
|
||||
minWidth: 150,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
...auditColumns
|
||||
.filter(column => ['updateTime', 'createTime'].includes(column.prop))
|
||||
.sort(
|
||||
(first, second) =>
|
||||
['updateTime', 'createTime'].indexOf(first.prop) -
|
||||
['updateTime', 'createTime'].indexOf(second.prop)
|
||||
),
|
||||
]);
|
||||
|
||||
export const excelOption = {
|
||||
|
||||
@@ -5,6 +5,8 @@ export const config = {
|
||||
permission: 'common_route',
|
||||
exportUrl: '/blade-transport/common-route/export-common-route',
|
||||
exportName: '常用线路',
|
||||
importUrl: '/blade-transport/common-route/import-common-route',
|
||||
templateUrl: '/blade-transport/common-route/export-template',
|
||||
enableAllDept: false,
|
||||
};
|
||||
|
||||
@@ -12,17 +14,14 @@ export const option = createCrudOption([
|
||||
{
|
||||
label: '线路名称',
|
||||
prop: 'routeName',
|
||||
search: true,
|
||||
searchOrder: 1,
|
||||
span: 24,
|
||||
span: 12,
|
||||
minWidth: 150,
|
||||
overHidden: true,
|
||||
rules: textRule('线路名称', 100, true),
|
||||
},
|
||||
{
|
||||
label: '线路编号',
|
||||
prop: 'routeCode',
|
||||
search: true,
|
||||
searchOrder: 2,
|
||||
minWidth: 120,
|
||||
addDisplay: false,
|
||||
editDisabled: true,
|
||||
@@ -30,8 +29,6 @@ export const option = createCrudOption([
|
||||
{
|
||||
label: '发货地',
|
||||
prop: 'departureName',
|
||||
search: true,
|
||||
searchOrder: 3,
|
||||
minWidth: 140,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
@@ -40,10 +37,9 @@ export const option = createCrudOption([
|
||||
label: '发货地址',
|
||||
prop: 'departureAddress',
|
||||
formslot: true,
|
||||
search: true,
|
||||
searchOrder: 4,
|
||||
span: 24,
|
||||
minWidth: 220,
|
||||
overHidden: true,
|
||||
rules: textRule('发货地址', 255, true),
|
||||
},
|
||||
{
|
||||
@@ -53,6 +49,8 @@ export const option = createCrudOption([
|
||||
precision: 6,
|
||||
minWidth: 120,
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '发货纬度',
|
||||
@@ -61,6 +59,8 @@ export const option = createCrudOption([
|
||||
precision: 6,
|
||||
minWidth: 120,
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '发货联系人',
|
||||
@@ -77,8 +77,6 @@ export const option = createCrudOption([
|
||||
{
|
||||
label: '收货地',
|
||||
prop: 'arrivalName',
|
||||
search: true,
|
||||
searchOrder: 5,
|
||||
minWidth: 140,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
@@ -87,10 +85,9 @@ export const option = createCrudOption([
|
||||
label: '收货地址',
|
||||
prop: 'arrivalAddress',
|
||||
formslot: true,
|
||||
search: true,
|
||||
searchOrder: 6,
|
||||
span: 24,
|
||||
minWidth: 220,
|
||||
overHidden: true,
|
||||
rules: textRule('收货地址', 255, true),
|
||||
},
|
||||
{
|
||||
@@ -100,6 +97,8 @@ export const option = createCrudOption([
|
||||
precision: 6,
|
||||
minWidth: 120,
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '收货纬度',
|
||||
@@ -108,6 +107,8 @@ export const option = createCrudOption([
|
||||
precision: 6,
|
||||
minWidth: 120,
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '收货联系人',
|
||||
@@ -121,25 +122,160 @@ export const option = createCrudOption([
|
||||
minWidth: 140,
|
||||
rules: [phoneRule('收货联系方式'), ...textRule('收货联系方式', 50)],
|
||||
},
|
||||
{
|
||||
label: '组织',
|
||||
prop: 'deptName',
|
||||
search: true,
|
||||
searchOrder: 7,
|
||||
minWidth: 150,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
type: 'textarea',
|
||||
minRows: 4,
|
||||
span: 24,
|
||||
hide: true,
|
||||
minWidth: 180,
|
||||
maxlength: 500,
|
||||
showWordLimit: true,
|
||||
rules: textRule('备注', 500),
|
||||
},
|
||||
...auditColumns,
|
||||
{
|
||||
label: '组织',
|
||||
prop: 'deptName',
|
||||
minWidth: 150,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
// 搜索字段独立于表格和表单字段,避免筛选配置影响数据展示和编辑布局。
|
||||
{
|
||||
label: '线路名称',
|
||||
prop: 'searchRouteName',
|
||||
searchProp: 'routeName',
|
||||
search: true,
|
||||
searchOrder: 7,
|
||||
searchPlaceholder: '请输入',
|
||||
hide: true,
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '线路编号',
|
||||
prop: 'searchRouteCode',
|
||||
searchProp: 'routeCode',
|
||||
search: true,
|
||||
searchOrder: 6,
|
||||
searchPlaceholder: '请输入',
|
||||
hide: true,
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '发货地',
|
||||
prop: 'searchDepartureName',
|
||||
searchProp: 'departureName',
|
||||
search: true,
|
||||
searchOrder: 5,
|
||||
searchPlaceholder: '请输入',
|
||||
hide: true,
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '发货地址',
|
||||
prop: 'searchDepartureAddress',
|
||||
searchProp: 'departureAddress',
|
||||
search: true,
|
||||
searchOrder: 4,
|
||||
searchPlaceholder: '请输入',
|
||||
hide: true,
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '收货地',
|
||||
prop: 'searchArrivalName',
|
||||
searchProp: 'arrivalName',
|
||||
search: true,
|
||||
searchOrder: 3,
|
||||
searchPlaceholder: '请输入',
|
||||
hide: true,
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '收货地址',
|
||||
prop: 'searchArrivalAddress',
|
||||
searchProp: 'arrivalAddress',
|
||||
search: true,
|
||||
searchOrder: 2,
|
||||
searchPlaceholder: '请输入',
|
||||
hide: true,
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '组织',
|
||||
prop: 'searchDeptId',
|
||||
searchProp: 'deptId',
|
||||
search: true,
|
||||
searchOrder: 1,
|
||||
searchType: 'cascader',
|
||||
searchPlaceholder: '请选择',
|
||||
hide: true,
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
dicData: [],
|
||||
props: {
|
||||
label: 'label',
|
||||
value: 'value',
|
||||
children: 'children',
|
||||
},
|
||||
checkStrictly: true,
|
||||
emitPath: false,
|
||||
showAllLevels: false,
|
||||
filterable: true,
|
||||
},
|
||||
...auditColumns
|
||||
.filter(column => column.prop !== 'createUserName')
|
||||
.map(column =>
|
||||
['createTime', 'updateTime'].includes(column.prop) ? { ...column, minWidth: 190 } : column
|
||||
)
|
||||
.sort(
|
||||
(first, second) =>
|
||||
['updateUserName', 'updateTime', 'createTime'].indexOf(first.prop) -
|
||||
['updateUserName', 'updateTime', 'createTime'].indexOf(second.prop)
|
||||
),
|
||||
]);
|
||||
|
||||
export const excelOption = {
|
||||
submitBtn: false,
|
||||
emptyBtn: false,
|
||||
column: [
|
||||
{
|
||||
label: '导入模板',
|
||||
prop: 'excelTemplate',
|
||||
formslot: true,
|
||||
span: 24,
|
||||
},
|
||||
{
|
||||
label: 'Excel文件',
|
||||
prop: 'excelFile',
|
||||
type: 'upload',
|
||||
drag: true,
|
||||
loadText: '模板上传中,请稍等',
|
||||
span: 24,
|
||||
propsHttp: {
|
||||
res: 'data',
|
||||
},
|
||||
tip: '请上传 .xls,.xlsx 标准格式文件',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -87,8 +87,10 @@ export const approvalStatusOptions = [
|
||||
];
|
||||
|
||||
export const effectiveTypeOptions = [
|
||||
{ label: '临时', value: 'temporary' },
|
||||
{ label: '正式', value: 'formal' },
|
||||
{ label: '未生效', value: 'not_effective' },
|
||||
{ label: '临时生效', value: 'temporary_effective' },
|
||||
{ label: '正式生效', value: 'formal_effective' },
|
||||
{ label: '已过期', value: 'expired' },
|
||||
];
|
||||
|
||||
export const businessTypeOptions = [
|
||||
|
||||
@@ -6,11 +6,18 @@ import {
|
||||
createCrudOption,
|
||||
effectiveTypeOptions,
|
||||
selectRule,
|
||||
settlementModeOptions,
|
||||
signTypeOptions,
|
||||
textRule,
|
||||
} from './common';
|
||||
|
||||
const contractSettlementModeOptions = [
|
||||
{ label: '现结', value: '现结' },
|
||||
{ label: '日结', value: '日结' },
|
||||
{ label: '周结', value: '周结' },
|
||||
{ label: '月结', value: '月结' },
|
||||
{ label: '按固定天数周期', value: '按固定天数周期' },
|
||||
];
|
||||
|
||||
const listDicFormatter = res => {
|
||||
const data = res?.data || res;
|
||||
if (Array.isArray(data)) return data;
|
||||
@@ -25,7 +32,13 @@ export const config = {
|
||||
permission: 'contract_manage',
|
||||
exportUrl: '/blade-transport/contract-manage/export-contract-manage',
|
||||
exportName: '合同管理',
|
||||
enableAllDept: false,
|
||||
defaultForm: {
|
||||
contractCategory: '客户合同',
|
||||
},
|
||||
projectPlaceholder: '请选择',
|
||||
organizationPlaceholder: '请选择',
|
||||
enableAllDept: true,
|
||||
allDeptReadonly: false,
|
||||
batchDelete: false,
|
||||
enableContractForm: true,
|
||||
enableProjectSelect: true,
|
||||
@@ -39,6 +52,7 @@ export const config = {
|
||||
enableChangeRecord: true,
|
||||
enableOrganizationSelect: true,
|
||||
enableContractCreateActions: true,
|
||||
enableContractExpiryTags: true,
|
||||
actions: ['copy'],
|
||||
statusProp: 'approvalStatus',
|
||||
statusTextProp: 'approvalStatusName',
|
||||
@@ -63,9 +77,25 @@ export const config = {
|
||||
label: '撤回',
|
||||
statusProp: 'approvalStatus',
|
||||
status: ['reviewing'],
|
||||
stage: ['temporary'],
|
||||
stage: ['temporary', 'formal'],
|
||||
permission: 'contract_manage_withdraw',
|
||||
},
|
||||
{
|
||||
action: 'approve',
|
||||
label: '通过',
|
||||
statusProp: 'approvalStatus',
|
||||
status: ['reviewing'],
|
||||
stage: ['temporary', 'formal'],
|
||||
permission: 'contract_manage_approve',
|
||||
},
|
||||
{
|
||||
action: 'reject',
|
||||
label: '驳回',
|
||||
statusProp: 'approvalStatus',
|
||||
status: ['reviewing'],
|
||||
stage: ['temporary', 'formal'],
|
||||
permission: 'contract_manage_reject',
|
||||
},
|
||||
{
|
||||
action: 'submitFormal',
|
||||
label: '重新提交转正',
|
||||
@@ -143,16 +173,18 @@ export const option = createCrudOption([
|
||||
prop: 'contractNo',
|
||||
search: true,
|
||||
searchOrder: 6,
|
||||
searchPlaceholder: '请输入',
|
||||
order: 185,
|
||||
disabled: true,
|
||||
placeholder: '不填写,则系统自动生成',
|
||||
minWidth: 160,
|
||||
minWidth: 200,
|
||||
},
|
||||
{
|
||||
label: '合同名称',
|
||||
prop: 'contractName',
|
||||
search: true,
|
||||
searchOrder: 7,
|
||||
searchPlaceholder: '请输入',
|
||||
order: 180,
|
||||
minWidth: 180,
|
||||
rules: textRule('合同名称', 100, true),
|
||||
@@ -163,6 +195,7 @@ export const option = createCrudOption([
|
||||
search: true,
|
||||
searchOrder: 8,
|
||||
searchType: 'select',
|
||||
searchPlaceholder: '请选择',
|
||||
formslot: true,
|
||||
order: 140,
|
||||
dicUrl: '/blade-transport/project-apply/list?current=1&size=9999',
|
||||
@@ -187,6 +220,7 @@ export const option = createCrudOption([
|
||||
search: true,
|
||||
searchOrder: 3,
|
||||
searchType: 'cascader',
|
||||
searchPlaceholder: '全部',
|
||||
formslot: true,
|
||||
order: 120,
|
||||
dicData: [],
|
||||
@@ -208,6 +242,7 @@ export const option = createCrudOption([
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 9,
|
||||
searchPlaceholder: '请选择',
|
||||
order: 170,
|
||||
dicData: contractCategoryOptions,
|
||||
minWidth: 130,
|
||||
@@ -217,10 +252,8 @@ export const option = createCrudOption([
|
||||
label: '签约类型',
|
||||
prop: 'signType',
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 1,
|
||||
search: false,
|
||||
span: 6,
|
||||
row: true,
|
||||
order: 190,
|
||||
dicData: signTypeOptions,
|
||||
minWidth: 120,
|
||||
@@ -232,6 +265,7 @@ export const option = createCrudOption([
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 5,
|
||||
searchPlaceholder: '请选择',
|
||||
dicData: effectiveTypeOptions,
|
||||
hide: true,
|
||||
display: false,
|
||||
@@ -241,7 +275,8 @@ export const option = createCrudOption([
|
||||
prop: 'partyA',
|
||||
type: 'select',
|
||||
order: 160,
|
||||
dicUrl: '/blade-transport/customer-archive/list?current=1&size=9999&approvalStatus=approved',
|
||||
dicUrl:
|
||||
'/blade-transport/customer-archive/list?current=1&size=9999&customerType=客户&approvalStatus=approved&status=1',
|
||||
dicFormatter: listDicFormatter,
|
||||
props: {
|
||||
label: 'fullName',
|
||||
@@ -256,7 +291,8 @@ export const option = createCrudOption([
|
||||
prop: 'partyB',
|
||||
type: 'select',
|
||||
order: 150,
|
||||
dicUrl: '/blade-transport/customer-archive/list?current=1&size=9999&approvalStatus=approved',
|
||||
dicUrl:
|
||||
'/blade-transport/customer-archive/list?current=1&size=9999&customerType=承运商&approvalStatus=approved&status=1',
|
||||
dicFormatter: listDicFormatter,
|
||||
props: {
|
||||
label: 'fullName',
|
||||
@@ -334,14 +370,14 @@ export const option = createCrudOption([
|
||||
rules: [{ required: true, message: '请选择签订日期', trigger: 'change' }],
|
||||
},
|
||||
{
|
||||
label: '结算方式',
|
||||
label: '结算类型',
|
||||
prop: 'settlementMode',
|
||||
type: 'select',
|
||||
dicData: settlementModeOptions,
|
||||
dicData: contractSettlementModeOptions,
|
||||
hide: true,
|
||||
order: 90,
|
||||
minWidth: 120,
|
||||
rules: selectRule('结算方式'),
|
||||
rules: selectRule('结算类型'),
|
||||
},
|
||||
{
|
||||
label: '合同格式',
|
||||
@@ -392,7 +428,7 @@ export const option = createCrudOption([
|
||||
type: 'datetime',
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
minWidth: 160,
|
||||
minWidth: 190,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
@@ -402,6 +438,7 @@ export const option = createCrudOption([
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 2,
|
||||
searchPlaceholder: '请选择',
|
||||
slot: true,
|
||||
dicData: contractStageOptions,
|
||||
minWidth: 120,
|
||||
@@ -414,6 +451,7 @@ export const option = createCrudOption([
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 4,
|
||||
searchPlaceholder: '请选择',
|
||||
slot: true,
|
||||
dicData: contractApprovalStatusOptions,
|
||||
minWidth: 130,
|
||||
@@ -572,3 +610,6 @@ export const option = createCrudOption([
|
||||
|
||||
option.span = 8;
|
||||
option.dialogWidth = 1480;
|
||||
option.dialogTop = '10px';
|
||||
option.dialogCloseBtn = true;
|
||||
option.menuWidth = 320;
|
||||
|
||||
@@ -13,7 +13,7 @@ export const config = {
|
||||
permission: 'process_config',
|
||||
exportUrl: '/blade-transport/process-config/export-process-config',
|
||||
exportName: '过程配置',
|
||||
enableAllDept: false,
|
||||
enableAllDept: true,
|
||||
actions: ['copy', 'enable', 'disable'],
|
||||
statusProp: 'status',
|
||||
statusTextProp: 'statusName',
|
||||
@@ -29,21 +29,13 @@ export const option = applyTableMenuWidth({
|
||||
span: 24,
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: '配置编号',
|
||||
prop: 'configCode',
|
||||
search: true,
|
||||
searchOrder: 4,
|
||||
minWidth: 130,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
editDisabled: true,
|
||||
},
|
||||
{
|
||||
label: '配置名称',
|
||||
prop: 'configName',
|
||||
search: true,
|
||||
searchOrder: 6,
|
||||
searchSpan: 6,
|
||||
searchPlaceholder: '请输入',
|
||||
span: 12,
|
||||
minWidth: 150,
|
||||
addDisplay: false,
|
||||
@@ -51,13 +43,16 @@ export const option = applyTableMenuWidth({
|
||||
rules: textRule('配置名称', 100, true),
|
||||
},
|
||||
{
|
||||
label: '项目ID集合',
|
||||
prop: 'projectIds',
|
||||
hide: true,
|
||||
display: false,
|
||||
label: '配置编号',
|
||||
prop: 'configCode',
|
||||
search: true,
|
||||
searchOrder: 4,
|
||||
searchSpan: 6,
|
||||
searchPlaceholder: '请输入',
|
||||
minWidth: 130,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
rules: textRule('项目ID集合', 1000, true),
|
||||
editDisabled: true,
|
||||
},
|
||||
{
|
||||
label: '项目',
|
||||
@@ -65,7 +60,9 @@ export const option = applyTableMenuWidth({
|
||||
formslot: true,
|
||||
search: true,
|
||||
searchOrder: 5,
|
||||
searchType: 'select',
|
||||
searchType: 'input',
|
||||
searchSpan: 6,
|
||||
searchPlaceholder: '请输入',
|
||||
type: 'textarea',
|
||||
minRows: 2,
|
||||
span: 12,
|
||||
@@ -77,53 +74,98 @@ export const option = applyTableMenuWidth({
|
||||
rules: textRule('项目', 1000, true),
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
searchLabel: '包含过程节点',
|
||||
label: '过程节点',
|
||||
prop: 'includedNodes',
|
||||
search: true,
|
||||
searchOrder: 3,
|
||||
type: 'select',
|
||||
multiple: true,
|
||||
dicData: nodeOptions,
|
||||
minWidth: 180,
|
||||
formslot: true,
|
||||
span: 24,
|
||||
minWidth: 260,
|
||||
overHidden: false,
|
||||
slot: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
rules: selectRule('包含过程节点'),
|
||||
rules: selectRule('过程节点'),
|
||||
},
|
||||
{
|
||||
label: '默认完成运输天数',
|
||||
label: '默认运输完成天数',
|
||||
prop: 'defaultFinishDays',
|
||||
formslot: true,
|
||||
type: 'number',
|
||||
min: 1,
|
||||
min: 0,
|
||||
max: 999,
|
||||
span: 12,
|
||||
minWidth: 170,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
type: 'textarea',
|
||||
minRows: 4,
|
||||
span: 24,
|
||||
minWidth: 180,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
maxlength: 500,
|
||||
showWordLimit: true,
|
||||
rules: textRule('备注', 500),
|
||||
},
|
||||
{
|
||||
label: '组织',
|
||||
prop: 'deptName',
|
||||
minWidth: 150,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
...auditColumns
|
||||
.filter(column => ['updateTime', 'createTime'].includes(column.prop))
|
||||
.map(column => ({ ...column, minWidth: 190 }))
|
||||
.sort(
|
||||
(first, second) =>
|
||||
['updateTime', 'createTime'].indexOf(first.prop) -
|
||||
['updateTime', 'createTime'].indexOf(second.prop)
|
||||
),
|
||||
{
|
||||
label: '项目ID集合',
|
||||
prop: 'projectIds',
|
||||
hide: true,
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
rules: textRule('项目ID集合', 1000, true),
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'status',
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 1,
|
||||
searchSpan: 6,
|
||||
searchPlaceholder: '请选择',
|
||||
dicData: processStatusOptions,
|
||||
slot: true,
|
||||
minWidth: 100,
|
||||
hide: true,
|
||||
fixed: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '组织',
|
||||
prop: 'deptName',
|
||||
prop: 'searchDeptId',
|
||||
searchProp: 'deptId',
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 2,
|
||||
minWidth: 150,
|
||||
searchSpan: 6,
|
||||
searchPlaceholder: '请选择',
|
||||
hide: true,
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
dicData: [],
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
@@ -132,23 +174,9 @@ export const option = applyTableMenuWidth({
|
||||
span: 24,
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
type: 'textarea',
|
||||
minRows: 4,
|
||||
span: 24,
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
maxlength: 500,
|
||||
showWordLimit: true,
|
||||
rules: textRule('备注', 500),
|
||||
},
|
||||
...auditColumns,
|
||||
]),
|
||||
saveBtnText: '保存',
|
||||
updateBtnText: '保存',
|
||||
dialogTop: '10px',
|
||||
dialogWidth: '96%',
|
||||
dialogCustomClass: 'process-config-dialog',
|
||||
searchSpan: 8,
|
||||
}, 5);
|
||||
|
||||
@@ -29,6 +29,14 @@ const userDicFormatter = res => {
|
||||
}));
|
||||
};
|
||||
|
||||
const formatUserRealName = (row, role) =>
|
||||
row[`${role}RealName`] ||
|
||||
row[`${role}UserRealName`] ||
|
||||
row[`${role}User`]?.realName ||
|
||||
row[role]?.realName ||
|
||||
row[`${role}UserName`] ||
|
||||
'';
|
||||
|
||||
export const config = {
|
||||
title: '项目管理',
|
||||
permission: 'project_apply',
|
||||
@@ -94,8 +102,9 @@ export const option = createCrudOption([
|
||||
label: '立项申请单号',
|
||||
prop: 'applyNo',
|
||||
search: true,
|
||||
searchPlaceholder: '请输入',
|
||||
searchOrder: 7,
|
||||
minWidth: 160,
|
||||
minWidth: 220,
|
||||
addDisplay: false,
|
||||
editDisabled: true,
|
||||
},
|
||||
@@ -110,6 +119,7 @@ export const option = createCrudOption([
|
||||
label: '项目名称',
|
||||
prop: 'projectName',
|
||||
search: true,
|
||||
searchPlaceholder: '请输入',
|
||||
searchOrder: 6,
|
||||
minWidth: 180,
|
||||
maxlength: 50,
|
||||
@@ -128,6 +138,7 @@ export const option = createCrudOption([
|
||||
prop: 'projectType',
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchPlaceholder: '请选择',
|
||||
searchOrder: 3,
|
||||
dicData: projectTypeOptions,
|
||||
minWidth: 120,
|
||||
@@ -156,7 +167,7 @@ export const option = createCrudOption([
|
||||
label: '承办部门',
|
||||
prop: 'undertakeDeptName',
|
||||
search: true,
|
||||
searchLabel: '承办单位',
|
||||
searchPlaceholder: '请输入',
|
||||
searchOrder: 5,
|
||||
minWidth: 150,
|
||||
rules: textRule('承办部门', 50, true),
|
||||
@@ -170,6 +181,7 @@ export const option = createCrudOption([
|
||||
label: '项目负责人',
|
||||
prop: 'principalUserName',
|
||||
minWidth: 130,
|
||||
formatter: row => formatUserRealName(row, 'principal'),
|
||||
rules: textRule('项目负责人', 50, true),
|
||||
},
|
||||
{
|
||||
@@ -177,6 +189,7 @@ export const option = createCrudOption([
|
||||
prop: 'principalUserId',
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchPlaceholder: '请选择',
|
||||
searchOrder: 4,
|
||||
filterable: true,
|
||||
dicUrl: '/blade-system/user/user-list',
|
||||
@@ -193,6 +206,7 @@ export const option = createCrudOption([
|
||||
prop: 'handlerUserName',
|
||||
hide: true,
|
||||
minWidth: 130,
|
||||
formatter: row => formatUserRealName(row, 'handler'),
|
||||
rules: textRule('项目经办人', 50, true),
|
||||
},
|
||||
{
|
||||
@@ -336,6 +350,7 @@ export const option = createCrudOption([
|
||||
prop: 'approvalStatus',
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchPlaceholder: '请选择',
|
||||
searchOrder: 2,
|
||||
slot: true,
|
||||
dicData: projectApprovalStatusOptions,
|
||||
@@ -362,6 +377,7 @@ export const option = createCrudOption([
|
||||
prop: 'effectiveType',
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchPlaceholder: '请选择',
|
||||
searchOrder: 1,
|
||||
dicData: effectiveTypeOptions,
|
||||
value: 'temporary',
|
||||
|
||||
@@ -28,6 +28,9 @@ export const config = {
|
||||
exportName: '临时额度申请',
|
||||
enableAllDept: false,
|
||||
enableProjectSelect: true,
|
||||
projectQueryParams: {
|
||||
temporaryCreditLimitSelectable: true,
|
||||
},
|
||||
enableAttachmentTable: true,
|
||||
enableDraftSave: true,
|
||||
saveAsDraft: true,
|
||||
@@ -108,6 +111,7 @@ export const option = {
|
||||
value: 'projectName',
|
||||
},
|
||||
filterable: true,
|
||||
span: 12,
|
||||
minWidth: 180,
|
||||
rules: textRule('项目名称', 100, true),
|
||||
},
|
||||
@@ -122,14 +126,16 @@ export const option = {
|
||||
prop: 'projectCode',
|
||||
hide: true,
|
||||
disabled: true,
|
||||
span: 12,
|
||||
minWidth: 150,
|
||||
rules: textRule('项目编号', 50, true),
|
||||
rules: textRule('项目编号', 50),
|
||||
},
|
||||
{
|
||||
label: '承办部门',
|
||||
prop: 'undertakeDeptName',
|
||||
hide: true,
|
||||
disabled: true,
|
||||
span: 12,
|
||||
minWidth: 150,
|
||||
rules: textRule('承办部门', 50, true),
|
||||
},
|
||||
@@ -138,6 +144,7 @@ export const option = {
|
||||
prop: 'projectFundLimit',
|
||||
hide: true,
|
||||
disabled: true,
|
||||
span: 12,
|
||||
minWidth: 200,
|
||||
rules: [nonNegativeRule('项目资金使用额度')],
|
||||
},
|
||||
@@ -146,6 +153,7 @@ export const option = {
|
||||
prop: 'usedFundLimit',
|
||||
hide: true,
|
||||
disabled: true,
|
||||
span: 12,
|
||||
minWidth: 220,
|
||||
value: 0,
|
||||
rules: [nonNegativeRule('已使用项目资金额度')],
|
||||
@@ -155,6 +163,7 @@ export const option = {
|
||||
prop: 'remainingFundLimit',
|
||||
hide: true,
|
||||
disabled: true,
|
||||
span: 12,
|
||||
minWidth: 230,
|
||||
value: 0,
|
||||
rules: [nonNegativeRule('剩余项目资金使用额度')],
|
||||
@@ -163,6 +172,7 @@ export const option = {
|
||||
label: '申请临时额度(万元)',
|
||||
prop: 'applyLimit',
|
||||
formslot: true,
|
||||
span: 12,
|
||||
minWidth: 180,
|
||||
rules: [
|
||||
{ required: true, message: '请输入申请临时额度', trigger: 'blur' },
|
||||
@@ -175,6 +185,7 @@ export const option = {
|
||||
type: 'date',
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
span: 12,
|
||||
minWidth: 140,
|
||||
rules: [{ required: true, message: '请选择申请有效期至', trigger: 'change' }],
|
||||
},
|
||||
@@ -260,6 +271,6 @@ export const option = {
|
||||
},
|
||||
...auditColumns.map(column => ({ ...column, hide: true })),
|
||||
]),
|
||||
dialogWidth: 1480,
|
||||
dialogWidth: 1010,
|
||||
index: false,
|
||||
};
|
||||
|
||||
@@ -14,23 +14,30 @@ export const option = {
|
||||
editBtn: false,
|
||||
delBtn: false,
|
||||
viewBtn: false,
|
||||
menuWidth: 160,
|
||||
menuWidth: 220,
|
||||
dialogClickModal: false,
|
||||
column: [
|
||||
{ label: '船舶名', prop: 'shipName', search: true, searchOrder: 5, slot: true, width: 130 },
|
||||
{
|
||||
label: '船舶名',
|
||||
prop: 'shipName',
|
||||
search: true,
|
||||
searchOrder: 5,
|
||||
slot: true,
|
||||
minWidth: 130,
|
||||
},
|
||||
{
|
||||
label: '船舶识别号',
|
||||
prop: 'shipIdentifierNo',
|
||||
search: true,
|
||||
searchOrder: 4,
|
||||
width: 140,
|
||||
minWidth: 140,
|
||||
},
|
||||
{
|
||||
label: '船检登记号',
|
||||
prop: 'shipInspectionNo',
|
||||
search: true,
|
||||
searchOrder: 3,
|
||||
width: 130,
|
||||
minWidth: 130,
|
||||
},
|
||||
{
|
||||
label: '船舶类型',
|
||||
@@ -44,7 +51,7 @@ export const option = {
|
||||
{ label: '杂货船', value: '杂货船' },
|
||||
{ label: '油船', value: '油船' },
|
||||
],
|
||||
width: 110,
|
||||
minWidth: 110,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
@@ -55,7 +62,7 @@ export const option = {
|
||||
type: 'select',
|
||||
filterable: true,
|
||||
dicData: [],
|
||||
width: 160,
|
||||
minWidth: 160,
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
@@ -66,30 +73,36 @@ export const option = {
|
||||
{ label: '启用', value: 1 },
|
||||
{ label: '停用', value: 2 },
|
||||
],
|
||||
width: 90,
|
||||
minWidth: 90,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
label: '国籍证有效期至',
|
||||
prop: 'nationalityCertEndDate',
|
||||
slot: true,
|
||||
width: 150,
|
||||
minWidth: 150,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
label: '最低安全配员证书有效期至',
|
||||
prop: 'safeManningCertEndDate',
|
||||
slot: true,
|
||||
width: 210,
|
||||
minWidth: 210,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
label: '营业运输证有效期至',
|
||||
prop: 'businessTransportCertEndDate',
|
||||
slot: true,
|
||||
width: 170,
|
||||
minWidth: 170,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
label: '承租有效期至',
|
||||
prop: 'leaseEndDate',
|
||||
slot: true,
|
||||
minWidth: 140,
|
||||
align: 'center',
|
||||
},
|
||||
{ label: '承租有效期至', prop: 'leaseEndDate', slot: true, width: 140, align: 'center' },
|
||||
],
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@ export const option = {
|
||||
editBtn: false,
|
||||
delBtn: false,
|
||||
viewBtn: false,
|
||||
menuWidth: 160,
|
||||
menuWidth: 220,
|
||||
dialogClickModal: false,
|
||||
column: [
|
||||
{
|
||||
@@ -23,7 +23,7 @@ export const option = {
|
||||
search: true,
|
||||
searchOrder: 5,
|
||||
slot: true,
|
||||
width: 120,
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
label: '所属组织',
|
||||
@@ -33,7 +33,7 @@ export const option = {
|
||||
type: 'select',
|
||||
filterable: true,
|
||||
dicData: [],
|
||||
width: 150,
|
||||
minWidth: 150,
|
||||
},
|
||||
{
|
||||
label: '业务关系',
|
||||
@@ -47,7 +47,7 @@ export const option = {
|
||||
{ label: '管理挂靠', value: '管理挂靠' },
|
||||
{ label: '业务合作', value: '业务合作' },
|
||||
],
|
||||
width: 120,
|
||||
minWidth: 120,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
@@ -65,13 +65,13 @@ export const option = {
|
||||
{ label: '拖挂车', value: '拖挂' },
|
||||
{ label: '半挂车', value: '半挂' },
|
||||
],
|
||||
width: 110,
|
||||
minWidth: 110,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
label: '核定载质量(KG)',
|
||||
prop: 'approvedLoadKg',
|
||||
width: 140,
|
||||
minWidth: 140,
|
||||
align: 'right',
|
||||
},
|
||||
{
|
||||
@@ -85,28 +85,28 @@ export const option = {
|
||||
{ label: '启用', value: 1 },
|
||||
{ label: '停用', value: 2 },
|
||||
],
|
||||
width: 90,
|
||||
minWidth: 90,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
label: '行驶证有效期',
|
||||
prop: 'drivingLicenseEndDate',
|
||||
slot: true,
|
||||
width: 140,
|
||||
minWidth: 140,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
label: '道路运输证有效期',
|
||||
prop: 'roadTransportCertEndDate',
|
||||
slot: true,
|
||||
width: 160,
|
||||
minWidth: 160,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
label: '年审有效期',
|
||||
prop: 'annualReviewEndDate',
|
||||
slot: true,
|
||||
width: 130,
|
||||
minWidth: 130,
|
||||
align: 'center',
|
||||
},
|
||||
],
|
||||
|
||||
@@ -364,6 +364,19 @@
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
// 统一 CRUD 顶部新增按钮为蓝底白字,保留其他工具按钮的描边样式
|
||||
.avue-crud__header .el-button--primary.is-plain:has(.el-icon-plus) {
|
||||
--el-button-bg-color: #409eff;
|
||||
--el-button-border-color: #409eff;
|
||||
--el-button-hover-bg-color: #66b1ff;
|
||||
--el-button-hover-border-color: #66b1ff;
|
||||
--el-button-active-bg-color: #337ecc;
|
||||
--el-button-active-border-color: #337ecc;
|
||||
--el-button-text-color: #fff;
|
||||
--el-button-hover-text-color: #fff;
|
||||
--el-button-active-text-color: #fff;
|
||||
}
|
||||
|
||||
// 统一分页为按钮样式并靠右展示
|
||||
.avue-crud__pagination,
|
||||
.empty-pagination {
|
||||
@@ -536,16 +549,24 @@
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
// 全站统一:操作列最多一行展示 4 个按钮,第 5 个开始自动换行
|
||||
.avue-crud .el-table td .cell.avue-crud__menu {
|
||||
display: inline-grid;
|
||||
grid-template-columns: repeat(4, max-content);
|
||||
gap: 4px;
|
||||
// 全站统一:Avue 操作列文字链接保持间距并支持自动换行
|
||||
.avue-crud .avue-crud__menu {
|
||||
display: inline-flex !important;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
justify-content: start;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
// 全站统一:手写表格操作列中的文字链接保持间距并支持自动换行
|
||||
.el-table .el-table__body .cell:not(.avue-crud__menu):has(> .el-link) {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.avue-crud__menu > .el-button,
|
||||
.avue-crud__menu > .el-dropdown {
|
||||
margin: 0;
|
||||
|
||||
@@ -47,7 +47,12 @@ const decorateFailExcel = async (blob, businessName, failDetailDecorator) => {
|
||||
*/
|
||||
export const openImportDialog = (vm, businessName, onSuccess, options = {}) => {
|
||||
const { failDetailDecorator } = options;
|
||||
const column = vm.findColumn(vm.excelOption.column, 'excelFile');
|
||||
const excelOption = vm.excelOption || vm.excelOptionConfig;
|
||||
const column = vm.findColumn(excelOption?.column || [], 'excelFile');
|
||||
if (!column) {
|
||||
vm.$message.error('导入配置异常,请稍后重试');
|
||||
return;
|
||||
}
|
||||
column.httpRequest = (option, uploadColumn) =>
|
||||
handleImportExcel(vm, option, uploadColumn, businessName, onSuccess, { failDetailDecorator });
|
||||
vm.excelBox = true;
|
||||
|
||||
@@ -250,7 +250,7 @@ export default {
|
||||
viewBtn: true,
|
||||
labelWidth: 'auto',
|
||||
searchLabelWidth: 160,
|
||||
menuWidth: 160,
|
||||
menuWidth: 320,
|
||||
dialogWidth: 600,
|
||||
dialogClickModal: false,
|
||||
column: [
|
||||
@@ -466,7 +466,7 @@ export default {
|
||||
});
|
||||
},
|
||||
rowSave(row, done, loading) {
|
||||
add(row).then(
|
||||
add(this.withTenantId(row)).then(
|
||||
() => {
|
||||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
@@ -482,7 +482,7 @@ export default {
|
||||
);
|
||||
},
|
||||
rowUpdate(row, index, done, loading) {
|
||||
update(row).then(
|
||||
update(this.withTenantId(row)).then(
|
||||
() => {
|
||||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
@@ -497,6 +497,12 @@ export default {
|
||||
}
|
||||
);
|
||||
},
|
||||
withTenantId(row) {
|
||||
return {
|
||||
...row,
|
||||
tenantId: row.tenantId || this.userInfo.tenantId || website.tenantId,
|
||||
};
|
||||
},
|
||||
rowDel(row) {
|
||||
this.$confirm('确定将选择数据删除?', {
|
||||
confirmButtonText: '确定',
|
||||
|
||||
@@ -366,15 +366,6 @@ export default {
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '行政区划编号',
|
||||
prop: 'regionCode',
|
||||
minWidth: 160,
|
||||
overHidden: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
rules: [{ max: 32, message: '行政区划编码不能超过32字', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '详细地址',
|
||||
prop: 'detailAddress',
|
||||
@@ -409,6 +400,15 @@ export default {
|
||||
{ validator: validateLatitude, trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '行政区划编号',
|
||||
prop: 'regionCode',
|
||||
minWidth: 160,
|
||||
overHidden: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
rules: [{ max: 32, message: '行政区划编码不能超过32字', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '数据来源',
|
||||
prop: 'dataSource',
|
||||
@@ -425,23 +425,6 @@ export default {
|
||||
{ label: '手动录入', value: '手动录入' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '启停状态',
|
||||
prop: 'status',
|
||||
type: 'select',
|
||||
search: true,
|
||||
slot: true,
|
||||
dataType: 'number',
|
||||
minWidth: 110,
|
||||
overHidden: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
dicData: [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '启用', value: 1 },
|
||||
{ label: '停用', value: 2 },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
@@ -483,6 +466,23 @@ export default {
|
||||
display: false,
|
||||
minWidth: 160,
|
||||
},
|
||||
{
|
||||
label: '启停状态',
|
||||
prop: 'status',
|
||||
type: 'select',
|
||||
search: true,
|
||||
slot: true,
|
||||
dataType: 'number',
|
||||
minWidth: 110,
|
||||
overHidden: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
dicData: [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '启用', value: 1 },
|
||||
{ label: '停用', value: 2 },
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
excelOption: {
|
||||
@@ -869,17 +869,12 @@ export default {
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
NProgress.start();
|
||||
exportBlob(
|
||||
'/blade-system/airport-master/export-airport-master',
|
||||
this.buildExportParams(),
|
||||
{ feedback: true }
|
||||
)
|
||||
exportBlob('/blade-system/airport-master/export-airport-master', this.buildExportParams(), {
|
||||
feedback: true,
|
||||
})
|
||||
.then(async res => {
|
||||
const blob = await addExcelRequiredHeaderMarks(res.data);
|
||||
downloadXls(
|
||||
blob,
|
||||
`空港机场主数据${this.$dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`
|
||||
);
|
||||
downloadXls(blob, `空港机场主数据${this.$dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`);
|
||||
})
|
||||
.finally(() => {
|
||||
NProgress.done();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -229,7 +229,15 @@ import 'nprogress/nprogress.css';
|
||||
|
||||
const DEFAULT_COUNTRY_CODE = '+86';
|
||||
const EXCLUDED_EXCEL_HEADERS = ['数据来源', '启停状态'];
|
||||
const REQUIRED_EXPORT_HEADERS = ['港口码头名称', '港口/码头名称', '类型', '国家', '城市', '经度', '纬度'];
|
||||
const REQUIRED_EXPORT_HEADERS = [
|
||||
'港口码头名称',
|
||||
'港口/码头名称',
|
||||
'类型',
|
||||
'国家',
|
||||
'城市',
|
||||
'经度',
|
||||
'纬度',
|
||||
];
|
||||
|
||||
const getExcelCellText = value => {
|
||||
if (value === undefined || value === null) return '';
|
||||
@@ -256,9 +264,7 @@ const removeWorkbookColumnsByHeaders = workbook => {
|
||||
}
|
||||
});
|
||||
if (indexes.length) {
|
||||
indexes
|
||||
.sort((a, b) => b - a)
|
||||
.forEach(colNumber => worksheet.spliceColumns(colNumber, 1));
|
||||
indexes.sort((a, b) => b - a).forEach(colNumber => worksheet.spliceColumns(colNumber, 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -383,13 +389,42 @@ export default {
|
||||
dialogClickModal: false,
|
||||
menuWidth: 160,
|
||||
column: [
|
||||
{
|
||||
label: '编码',
|
||||
prop: 'code',
|
||||
search: true,
|
||||
formslot: true,
|
||||
width: 140,
|
||||
span: 12,
|
||||
order: 70,
|
||||
placeholder: '请输入编码',
|
||||
rules: [
|
||||
{ required: true, message: '请输入编码', trigger: 'blur' },
|
||||
{ validator: validateCode, trigger: 'blur' },
|
||||
],
|
||||
change: ({ value }) => this.handleCodeChange(value),
|
||||
blur: ({ value }) => this.handleCodeChange(value),
|
||||
},
|
||||
{
|
||||
label: '港口/码头名称',
|
||||
prop: 'name',
|
||||
minWidth: 140,
|
||||
search: true,
|
||||
searchOrder: 7,
|
||||
span: 12,
|
||||
order: 80,
|
||||
placeholder: '请输入',
|
||||
rules: [{ required: true, message: '请输入港口/码头名称', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '类型',
|
||||
prop: 'category',
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 6,
|
||||
formslot: true,
|
||||
span: 24,
|
||||
order: 100,
|
||||
dicData: [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '港口', value: '港口' },
|
||||
@@ -409,6 +444,7 @@ export default {
|
||||
dicData: [],
|
||||
hide: true,
|
||||
span: 12,
|
||||
order: 90,
|
||||
placeholder: '请选择',
|
||||
rules: [{ required: false, message: '请选择上级港口', trigger: 'change' }],
|
||||
change: ({ value }) => this.handleParentChange(value),
|
||||
@@ -416,7 +452,7 @@ export default {
|
||||
{
|
||||
label: '上级港口',
|
||||
prop: 'parentName',
|
||||
minWidth: 120,
|
||||
minWidth: 140,
|
||||
slot: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
@@ -432,39 +468,17 @@ export default {
|
||||
placeholder: '自动带出',
|
||||
rules: [{ required: false, message: '请选择上级港口', trigger: 'change' }],
|
||||
},
|
||||
{
|
||||
label: '港口/码头名称',
|
||||
prop: 'name',
|
||||
minWidth: 140,
|
||||
search: true,
|
||||
span: 12,
|
||||
placeholder: '请输入',
|
||||
rules: [{ required: true, message: '请输入港口/码头名称', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '编码',
|
||||
prop: 'code',
|
||||
search: true,
|
||||
formslot: true,
|
||||
width: 140,
|
||||
span: 12,
|
||||
placeholder: '请输入编码',
|
||||
rules: [
|
||||
{ required: true, message: '请输入编码', trigger: 'blur' },
|
||||
{ validator: validateCode, trigger: 'blur' },
|
||||
],
|
||||
change: ({ value }) => this.handleCodeChange(value),
|
||||
blur: ({ value }) => this.handleCodeChange(value),
|
||||
},
|
||||
{
|
||||
label: '国家',
|
||||
prop: 'country',
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 5,
|
||||
formslot: true,
|
||||
filterable: true,
|
||||
dicData: [],
|
||||
span: 12,
|
||||
order: 60,
|
||||
minWidth: 140,
|
||||
overHidden: false,
|
||||
placeholder: '自动带出',
|
||||
@@ -478,6 +492,7 @@ export default {
|
||||
formslot: true,
|
||||
hide: true,
|
||||
span: 12,
|
||||
order: 50,
|
||||
placeholder: '自动带出',
|
||||
rules: [{ required: true, message: '请选择所属城市', trigger: 'change' }],
|
||||
},
|
||||
@@ -486,6 +501,7 @@ export default {
|
||||
prop: 'city',
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 4,
|
||||
filterable: true,
|
||||
dicData: [],
|
||||
addDisplay: false,
|
||||
@@ -513,14 +529,44 @@ export default {
|
||||
prop: 'districtName',
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 3,
|
||||
filterable: true,
|
||||
dicData: [],
|
||||
minWidth: 100,
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '行政区划编号',
|
||||
label: '经度',
|
||||
prop: 'longitude',
|
||||
formslot: true,
|
||||
minWidth: 130,
|
||||
span: 12,
|
||||
order: 20,
|
||||
placeholder: '请输入',
|
||||
overHidden: false,
|
||||
rules: [
|
||||
{ required: true, message: '请输入经度', trigger: 'blur' },
|
||||
{ validator: validateLongitude, trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '纬度',
|
||||
prop: 'latitude',
|
||||
formslot: true,
|
||||
minWidth: 130,
|
||||
span: 12,
|
||||
order: 10,
|
||||
placeholder: '请输入',
|
||||
overHidden: false,
|
||||
rules: [
|
||||
{ required: true, message: '请输入纬度', trigger: 'blur' },
|
||||
{ validator: validateLatitude, trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '行政区划编码',
|
||||
prop: 'regionCode',
|
||||
minWidth: 140,
|
||||
span: 12,
|
||||
@@ -538,42 +584,18 @@ export default {
|
||||
span: 24,
|
||||
minWidth: 220,
|
||||
overHidden: false,
|
||||
order: 30,
|
||||
placeholder: '请输入',
|
||||
maxlength: 255,
|
||||
showWordLimit: true,
|
||||
rules: [{ max: 255, message: '详细地址不能超过255字', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '经度',
|
||||
prop: 'longitude',
|
||||
formslot: true,
|
||||
minWidth: 130,
|
||||
span: 12,
|
||||
placeholder: '请输入',
|
||||
overHidden: false,
|
||||
rules: [
|
||||
{ required: true, message: '请输入经度', trigger: 'blur' },
|
||||
{ validator: validateLongitude, trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '纬度',
|
||||
prop: 'latitude',
|
||||
formslot: true,
|
||||
minWidth: 130,
|
||||
span: 12,
|
||||
placeholder: '请输入',
|
||||
overHidden: false,
|
||||
rules: [
|
||||
{ required: true, message: '请输入纬度', trigger: 'blur' },
|
||||
{ validator: validateLatitude, trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '数据来源',
|
||||
prop: 'dataSource',
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 2,
|
||||
minWidth: 120,
|
||||
overHidden: false,
|
||||
addDisplay: false,
|
||||
@@ -585,23 +607,6 @@ export default {
|
||||
{ label: '手工导入', value: '手工导入' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '启停状态',
|
||||
prop: 'status',
|
||||
type: 'select',
|
||||
search: true,
|
||||
slot: true,
|
||||
dataType: 'number',
|
||||
minWidth: 110,
|
||||
overHidden: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
dicData: [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '启用', value: 1 },
|
||||
{ label: '停用', value: 2 },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
@@ -639,9 +644,26 @@ export default {
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
display: false,
|
||||
minWidth: 160,
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'status',
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 1,
|
||||
slot: true,
|
||||
dataType: 'number',
|
||||
minWidth: 110,
|
||||
overHidden: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
dicData: [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '启用', value: 1 },
|
||||
{ label: '停用', value: 2 },
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
excelOption: {
|
||||
@@ -1270,19 +1292,14 @@ export default {
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
NProgress.start();
|
||||
exportBlob(
|
||||
'/blade-system/port-terminal/export-port-terminal',
|
||||
this.buildExportParams(),
|
||||
{ feedback: true }
|
||||
)
|
||||
exportBlob('/blade-system/port-terminal/export-port-terminal', this.buildExportParams(), {
|
||||
feedback: true,
|
||||
})
|
||||
.then(async res => {
|
||||
const blob = await removeExcelColumnsByHeaders(res.data, {
|
||||
markRequiredHeaders: true,
|
||||
});
|
||||
downloadXls(
|
||||
blob,
|
||||
`港口码头主数据${this.$dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`
|
||||
);
|
||||
downloadXls(blob, `港口码头主数据${this.$dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`);
|
||||
})
|
||||
.finally(() => {
|
||||
NProgress.done();
|
||||
|
||||
@@ -335,15 +335,6 @@ export default {
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '行政区划编号',
|
||||
prop: 'regionCode',
|
||||
minWidth: 160,
|
||||
overHidden: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
rules: [{ max: 32, message: '行政区划编码不能超过32字', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '详细地址',
|
||||
prop: 'detailAddress',
|
||||
@@ -373,20 +364,13 @@ export default {
|
||||
rules: [{ validator: validateLatitude, trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '数据来源',
|
||||
prop: 'dataSource',
|
||||
type: 'select',
|
||||
search: true,
|
||||
minWidth: 120,
|
||||
label: '行政区划编号',
|
||||
prop: 'regionCode',
|
||||
minWidth: 160,
|
||||
overHidden: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
dicData: [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '初始化导入', value: '初始化导入' },
|
||||
{ label: '批量', value: '批量' },
|
||||
{ label: '手动', value: '手动' },
|
||||
],
|
||||
rules: [{ max: 32, message: '行政区划编码不能超过32字', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '启停状态',
|
||||
@@ -446,6 +430,22 @@ export default {
|
||||
display: false,
|
||||
minWidth: 160,
|
||||
},
|
||||
{
|
||||
label: '数据来源',
|
||||
prop: 'dataSource',
|
||||
type: 'select',
|
||||
search: true,
|
||||
minWidth: 120,
|
||||
overHidden: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
dicData: [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '初始化导入', value: '初始化导入' },
|
||||
{ label: '批量', value: '批量' },
|
||||
{ label: '手动', value: '手动' },
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
excelOption: {
|
||||
|
||||
@@ -11,6 +11,37 @@
|
||||
</el-col>
|
||||
<el-col class="region-page__form-panel" :span="18">
|
||||
<basic-container>
|
||||
<el-form class="region-page__search" :model="searchForm" inline>
|
||||
<el-form-item label="区域编码">
|
||||
<el-input v-model="searchForm.code" clearable placeholder="请输入区域编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="区域名称">
|
||||
<el-input v-model="searchForm.name" clearable placeholder="请输入区域名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="区域层级">
|
||||
<el-select v-model="searchForm.regionLevel" clearable placeholder="请选择区域层级">
|
||||
<el-option label="省份" :value="1" />
|
||||
<el-option label="省市" :value="2" />
|
||||
<el-option label="区县" :value="3" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据来源">
|
||||
<el-select v-model="searchForm.dataSource" clearable placeholder="请选择数据来源">
|
||||
<el-option label="手动录入" value="手动录入" />
|
||||
<el-option label="初始化导入" value="初始化导入" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="启停状态">
|
||||
<el-select v-model="searchForm.status" clearable placeholder="请选择启停状态">
|
||||
<el-option label="启用" :value="1" />
|
||||
<el-option label="停用" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item class="region-page__search-actions">
|
||||
<el-button type="primary" @click="handleSearch">搜索</el-button>
|
||||
<el-button @click="handleSearchReset">清空</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-button-group>
|
||||
<el-button
|
||||
v-if="permission.region_add"
|
||||
@@ -136,14 +167,21 @@ export default {
|
||||
treeCode: '',
|
||||
treeParentCode: '',
|
||||
treeData: [],
|
||||
searchForm: {
|
||||
code: '',
|
||||
name: '',
|
||||
regionLevel: undefined,
|
||||
dataSource: '',
|
||||
status: undefined,
|
||||
},
|
||||
parentOptions: [],
|
||||
syncLoading: false,
|
||||
treeOption: {
|
||||
nodeKey: 'id',
|
||||
lazy: true,
|
||||
treeLoad: function (node, resolve) {
|
||||
treeLoad: (node, resolve) => {
|
||||
const parentCode = node.level === 0 ? ROOT_PARENT_CODE : node.data.id;
|
||||
getLazyTree(parentCode).then(res => {
|
||||
getLazyTree(parentCode, this.searchForm).then(res => {
|
||||
resolve(
|
||||
res.data.data.map(item => {
|
||||
return {
|
||||
@@ -402,7 +440,7 @@ export default {
|
||||
methods: {
|
||||
initTree() {
|
||||
this.treeData = [];
|
||||
getLazyTree(this.topCode).then(res => {
|
||||
getLazyTree(this.topCode, this.searchForm).then(res => {
|
||||
this.treeData = res.data.data.map(item => {
|
||||
return {
|
||||
...item,
|
||||
@@ -411,6 +449,20 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
handleSearch() {
|
||||
this.initTree();
|
||||
this.regionForm = {};
|
||||
},
|
||||
handleSearchReset() {
|
||||
this.searchForm = {
|
||||
code: '',
|
||||
name: '',
|
||||
regionLevel: undefined,
|
||||
dataSource: '',
|
||||
status: undefined,
|
||||
};
|
||||
this.handleSearch();
|
||||
},
|
||||
nodeClick(data) {
|
||||
this.setRegionColumnDisplay('code', true);
|
||||
this.treeCode = data.id;
|
||||
@@ -624,20 +676,18 @@ export default {
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
NProgress.start();
|
||||
exportBlob(
|
||||
`/blade-system/region/export-region?${this.website.tokenHeader}=${getToken()}`,
|
||||
{ feedback: true }
|
||||
).then(res => {
|
||||
exportBlob(`/blade-system/region/export-region?${this.website.tokenHeader}=${getToken()}`, {
|
||||
feedback: true,
|
||||
}).then(res => {
|
||||
downloadXls(res.data, `行政区划数据${this.$dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`);
|
||||
NProgress.done();
|
||||
});
|
||||
});
|
||||
},
|
||||
handleTemplate() {
|
||||
exportBlob(
|
||||
`/blade-system/region/export-template?${this.website.tokenHeader}=${getToken()}`,
|
||||
{ feedback: true }
|
||||
).then(res => {
|
||||
exportBlob(`/blade-system/region/export-template?${this.website.tokenHeader}=${getToken()}`, {
|
||||
feedback: true,
|
||||
}).then(res => {
|
||||
downloadXls(res.data, '行政区划模板.xlsx');
|
||||
});
|
||||
},
|
||||
|
||||
@@ -24,10 +24,9 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
plain
|
||||
v-if="hasPermission('common_cargo_add')"
|
||||
@click="$refs.crud.rowAdd()"
|
||||
>新增
|
||||
>新建常用货物
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@@ -113,7 +112,7 @@
|
||||
clearable
|
||||
maxlength="20"
|
||||
show-word-limit
|
||||
placeholder="请输入货物编号"
|
||||
placeholder="请输入"
|
||||
:disabled="dialogReadonly || dialogType === 'edit'"
|
||||
@input="handleCargoCodeInput"
|
||||
/>
|
||||
@@ -144,6 +143,10 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #packageBrand="{ row }">
|
||||
{{ [row.packageType, row.brand].filter(Boolean).join(' / ') || '-' }}
|
||||
</template>
|
||||
|
||||
<template #menu="{ row, index }">
|
||||
<el-link
|
||||
type="primary"
|
||||
@@ -192,6 +195,7 @@
|
||||
import * as api from '@/api/business/common-cargo';
|
||||
import { getList as getCargoTypeList } from '@/api/base/cargo-type';
|
||||
import { exportBlob } from '@/api/common';
|
||||
import { getDeptTree } from '@/api/system/dept';
|
||||
import { config, excelOption, option } from '@/option/business/common-cargo';
|
||||
import { priceUnitOptions } from '@/option/business/common';
|
||||
import { getToken } from '@/utils/auth';
|
||||
@@ -221,6 +225,7 @@ export default {
|
||||
secondCargoTypeLoading: false,
|
||||
firstCargoTypeOptions: [],
|
||||
secondCargoTypeOptions: [],
|
||||
deptOptions: [],
|
||||
page: {
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
@@ -247,6 +252,9 @@ export default {
|
||||
return this.selectionList.map(item => item.id).join(',');
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.initDeptTree();
|
||||
},
|
||||
methods: {
|
||||
hasPermission(code) {
|
||||
return this.isAdmin || this.validData(this.permission && this.permission[code], false);
|
||||
@@ -256,6 +264,28 @@ export default {
|
||||
if (Array.isArray(data)) return data;
|
||||
return (data && data.records) || [];
|
||||
},
|
||||
initDeptTree() {
|
||||
getDeptTree(this.userInfo.tenantId).then(res => {
|
||||
this.deptOptions = this.flattenDept(res.data.data || []);
|
||||
const deptColumn = this.findColumn(this.option.column, 'searchDeptId');
|
||||
if (deptColumn) {
|
||||
deptColumn.dicData = this.deptOptions;
|
||||
}
|
||||
});
|
||||
},
|
||||
flattenDept(tree, level = 0) {
|
||||
const result = [];
|
||||
tree.forEach(item => {
|
||||
result.push({
|
||||
label: `${' '.repeat(level)}${item.title || item.deptName || item.name}`,
|
||||
value: item.id,
|
||||
});
|
||||
if (item.children && item.children.length) {
|
||||
result.push(...this.flattenDept(item.children, level + 1));
|
||||
}
|
||||
});
|
||||
return result;
|
||||
},
|
||||
normalizeCargoTypeOptions(list = []) {
|
||||
return list
|
||||
.map(item => ({
|
||||
@@ -319,11 +349,12 @@ export default {
|
||||
const second = this.secondCargoTypeOptions.find(item => item.cargoCode === value);
|
||||
this.form.secondCargoTypeName = second ? second.cargoName : '';
|
||||
this.form.secondCargoTypeCode = second ? second.cargoCode : '';
|
||||
this.form.cargoCode = second ? String(second.cargoCode).slice(0, 4) : '';
|
||||
this.syncCargoCodePrefix();
|
||||
},
|
||||
getCargoCodePrefix() {
|
||||
return this.form.secondCargoTypeCode && this.form.firstCargoTypeCode
|
||||
? this.form.firstCargoTypeCode
|
||||
return this.form.secondCargoTypeCode
|
||||
? String(this.form.secondCargoTypeCode).slice(0, 4)
|
||||
: '';
|
||||
},
|
||||
syncCargoCodePrefix() {
|
||||
@@ -383,13 +414,13 @@ export default {
|
||||
return false;
|
||||
}
|
||||
const cargoCode = String(row.cargoCode || '');
|
||||
const prefix = row.firstCargoTypeCode;
|
||||
const prefix = String(row.secondCargoTypeCode || '').slice(0, 4);
|
||||
if (!cargoCode || cargoCode === prefix) {
|
||||
this.$message.warning('请输入货物编号');
|
||||
return false;
|
||||
}
|
||||
if (!cargoCode.startsWith(prefix)) {
|
||||
this.$message.warning('货物编号需拼接一级货物类型编号在前面');
|
||||
this.$message.warning('货物编号需拼接二级货物类型编号在前面');
|
||||
return false;
|
||||
}
|
||||
if (cargoCode.length > 20) {
|
||||
|
||||
@@ -24,10 +24,25 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
plain
|
||||
v-if="hasPermission('common_route_add')"
|
||||
@click="$refs.crud.rowAdd()"
|
||||
>新增
|
||||
>新建路线
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-upload"
|
||||
plain
|
||||
v-if="config.importUrl && hasPermission('common_route_import')"
|
||||
@click="handleImport"
|
||||
>批量导入
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-download"
|
||||
plain
|
||||
v-if="config.templateUrl && hasPermission('common_route_template')"
|
||||
@click="handleTemplate"
|
||||
>下载模板
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@@ -57,10 +72,10 @@
|
||||
/>
|
||||
<el-input
|
||||
v-model="form.departureAddress"
|
||||
readonly
|
||||
placeholder="请输入并选择地址"
|
||||
suffix-icon="el-icon-location"
|
||||
:disabled="dialogReadonly"
|
||||
@click="openRouteMapDialog('departure')"
|
||||
/>
|
||||
<el-tooltip content="选择常用地址" placement="top">
|
||||
<el-button
|
||||
@@ -84,10 +99,10 @@
|
||||
/>
|
||||
<el-input
|
||||
v-model="form.arrivalAddress"
|
||||
readonly
|
||||
placeholder="请输入并选择地址"
|
||||
suffix-icon="el-icon-location"
|
||||
:disabled="dialogReadonly"
|
||||
@click="openRouteMapDialog('arrival')"
|
||||
/>
|
||||
<el-tooltip content="选择常用地址" placement="top">
|
||||
<el-button
|
||||
@@ -133,6 +148,16 @@
|
||||
@load="onLoad(page, query)"
|
||||
/>
|
||||
|
||||
<el-dialog :title="`${config.title}导入`" append-to-body v-model="excelBox" width="555px">
|
||||
<avue-form :option="excelOptionConfig" v-model="excelForm">
|
||||
<template #excelTemplate>
|
||||
<el-button type="primary" @click="handleTemplate">
|
||||
点击下载<i class="el-icon-download el-icon--right"></i>
|
||||
</el-button>
|
||||
</template>
|
||||
</avue-form>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
title="选择常用地址"
|
||||
append-to-body
|
||||
@@ -242,6 +267,48 @@
|
||||
<el-button @click="addressDialogVisible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
title="地图选择地址"
|
||||
append-to-body
|
||||
v-model="routeMapVisible"
|
||||
width="920px"
|
||||
@opened="initRouteAmap"
|
||||
>
|
||||
<div class="common-route-page__map-toolbar">
|
||||
<el-input
|
||||
v-model="routeMapKeyword"
|
||||
clearable
|
||||
placeholder="输入地址关键词"
|
||||
@keyup.enter="searchRouteMapKeyword"
|
||||
/>
|
||||
<el-button
|
||||
type="primary"
|
||||
:icon="Search"
|
||||
:loading="routeMapLoading"
|
||||
@click="searchRouteMapKeyword"
|
||||
>
|
||||
搜索
|
||||
</el-button>
|
||||
</div>
|
||||
<div ref="routeAmap" class="common-route-page__map"></div>
|
||||
<div class="common-route-page__map-info">
|
||||
<span>{{ routeMapStatus }}</span>
|
||||
<span v-if="routeMapSelected.regionName"
|
||||
>发货/收货地:{{ routeMapSelected.regionName }}</span
|
||||
>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="routeMapVisible = false">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="!routeMapSelected.longitude"
|
||||
@click="confirmRouteMapPick"
|
||||
>
|
||||
确定
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</basic-container>
|
||||
</template>
|
||||
|
||||
@@ -251,18 +318,24 @@ import { getList as getCommonAddressList } from '@/api/base/common-address';
|
||||
import { exportBlob } from '@/api/common';
|
||||
import { getDeptTree } from '@/api/system/dept';
|
||||
import { addressTypeOptions } from '@/option/base/common-address';
|
||||
import { config, option } from '@/option/business/common-route';
|
||||
import { config, excelOption, option } from '@/option/business/common-route';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { openImportDialog } from '@/utils/import-excel';
|
||||
import { downloadXls } from '@/utils/util';
|
||||
import { List } from '@element-plus/icons-vue';
|
||||
import { List, Search } from '@element-plus/icons-vue';
|
||||
import { mapGetters } from 'vuex';
|
||||
import NProgress from 'nprogress';
|
||||
import 'nprogress/nprogress.css';
|
||||
|
||||
const AMAP_KEY = '653b7cf105ad7fb8ec9b2f5198ade315';
|
||||
const AMAP_SECURITY_CODE = '5aab65c632e48ebae0d0e28f5b28e21a';
|
||||
let amapLoader;
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
List,
|
||||
Search,
|
||||
config,
|
||||
option,
|
||||
form: {},
|
||||
@@ -270,12 +343,24 @@ export default {
|
||||
loading: true,
|
||||
data: [],
|
||||
dialogReadonly: false,
|
||||
excelBox: false,
|
||||
excelForm: {},
|
||||
excelOptionConfig: excelOption,
|
||||
addressTypeOptions,
|
||||
addressDialogVisible: false,
|
||||
addressTarget: '',
|
||||
addressQuery: {},
|
||||
addressData: [],
|
||||
addressLoading: false,
|
||||
routeMapVisible: false,
|
||||
routeMapTarget: '',
|
||||
routeMapLoading: false,
|
||||
routeMapKeyword: '',
|
||||
routeMapStatus: '可搜索地址或点击地图选点',
|
||||
routeMapSelected: {},
|
||||
routeAmap: null,
|
||||
routeAmapMarker: null,
|
||||
routeAmapGeocoder: null,
|
||||
deptOptions: [],
|
||||
page: {
|
||||
pageSize: 10,
|
||||
@@ -317,9 +402,22 @@ export default {
|
||||
},
|
||||
initDeptTree() {
|
||||
getDeptTree(this.userInfo.tenantId).then(res => {
|
||||
this.deptOptions = this.flattenDept(res.data.data || []);
|
||||
const deptTree = res.data.data || [];
|
||||
this.deptOptions = this.flattenDept(deptTree);
|
||||
const deptColumn = this.findColumn(this.option.column, 'searchDeptId');
|
||||
if (deptColumn) {
|
||||
deptColumn.dicData = this.buildDeptTree(deptTree);
|
||||
}
|
||||
});
|
||||
},
|
||||
buildDeptTree(tree) {
|
||||
return tree.map(item => ({
|
||||
label: item.title || item.deptName || item.name,
|
||||
value: item.id,
|
||||
children:
|
||||
item.children && item.children.length ? this.buildDeptTree(item.children) : undefined,
|
||||
}));
|
||||
},
|
||||
flattenDept(tree, level = 0) {
|
||||
const result = [];
|
||||
tree.forEach(item => {
|
||||
@@ -404,6 +502,246 @@ export default {
|
||||
this.form[`${prefix}Contact`] = address.contactName || this.form[`${prefix}Contact`] || '';
|
||||
this.form[`${prefix}Phone`] = address.contactPhone || this.form[`${prefix}Phone`] || '';
|
||||
},
|
||||
openRouteMapDialog(target) {
|
||||
if (this.dialogReadonly) return;
|
||||
const prefix = target === 'departure' ? 'departure' : 'arrival';
|
||||
this.routeMapTarget = prefix;
|
||||
this.routeMapKeyword = this.form[`${prefix}Address`] || this.form[`${prefix}Name`] || '';
|
||||
this.routeMapSelected = this.buildRouteMapSelection({
|
||||
lng: this.form[`${prefix}Longitude`],
|
||||
lat: this.form[`${prefix}Latitude`],
|
||||
address: this.form[`${prefix}Address`],
|
||||
regionName: this.form[`${prefix}Name`],
|
||||
});
|
||||
this.routeMapStatus = this.routeMapSelected.longitude
|
||||
? '已加载当前选点,可重新选点'
|
||||
: '可搜索地址或点击地图选点';
|
||||
this.routeMapVisible = true;
|
||||
},
|
||||
loadAmap() {
|
||||
if (window.AMap && window.AMap.Map) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
if (!amapLoader) {
|
||||
amapLoader = new Promise((resolve, reject) => {
|
||||
window._AMapSecurityConfig = {
|
||||
securityJsCode: AMAP_SECURITY_CODE,
|
||||
};
|
||||
const script = document.createElement('script');
|
||||
script.src = `https://webapi.amap.com/maps?v=2.0&key=${AMAP_KEY}`;
|
||||
script.async = true;
|
||||
script.onload = resolve;
|
||||
script.onerror = () => reject(new Error('高德地图组件加载失败'));
|
||||
document.body.appendChild(script);
|
||||
});
|
||||
}
|
||||
return amapLoader;
|
||||
},
|
||||
initRouteAmap() {
|
||||
this.loadAmap()
|
||||
.then(() => {
|
||||
this.$nextTick(() => {
|
||||
if (!this.routeAmap) {
|
||||
const center = this.toLngLat(
|
||||
this.routeMapSelected.longitude || 116.40769,
|
||||
this.routeMapSelected.latitude || 39.89945
|
||||
);
|
||||
this.routeAmap = new window.AMap.Map(this.$refs.routeAmap, {
|
||||
center,
|
||||
zoom: this.routeMapSelected.longitude ? 14 : 11,
|
||||
});
|
||||
window.AMap.plugin(['AMap.ToolBar', 'AMap.Geocoder'], () => {
|
||||
this.routeAmap.addControl(new window.AMap.ToolBar());
|
||||
if (!this.routeAmapGeocoder) {
|
||||
this.routeAmapGeocoder = new window.AMap.Geocoder();
|
||||
}
|
||||
});
|
||||
this.routeAmap.on('click', event => this.pickRouteMapPoint(event.lnglat));
|
||||
} else if (typeof this.routeAmap.resize === 'function') {
|
||||
this.routeAmap.resize();
|
||||
}
|
||||
if (this.routeMapSelected.longitude) {
|
||||
this.renderRouteMapMarker(
|
||||
this.toLngLat(this.routeMapSelected.longitude, this.routeMapSelected.latitude)
|
||||
);
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message.error('高德地图组件加载失败,请稍后重试或重新打开弹窗');
|
||||
this.routeMapVisible = false;
|
||||
});
|
||||
},
|
||||
searchRouteMapKeyword() {
|
||||
const keyword = String(this.routeMapKeyword || '').trim();
|
||||
if (!keyword) {
|
||||
this.$message.warning('请输入地址关键词');
|
||||
return;
|
||||
}
|
||||
this.loadAmap()
|
||||
.then(() => {
|
||||
this.routeMapLoading = true;
|
||||
return this.ensureRouteAmapGeocoder();
|
||||
})
|
||||
.then(() => this.runAmapGeocode('location', keyword))
|
||||
.then(result => {
|
||||
const point = this.resolveMapPoint(result);
|
||||
if (!point) {
|
||||
this.routeMapStatus = '未找到匹配地址';
|
||||
this.$message.warning('地图搜索无匹配地址');
|
||||
return;
|
||||
}
|
||||
this.pickRouteMapPoint(point, keyword);
|
||||
})
|
||||
.catch(() => {
|
||||
this.routeMapStatus = '地图搜索失败';
|
||||
this.$message.error('地图搜索失败,请稍后重试');
|
||||
})
|
||||
.finally(() => {
|
||||
this.routeMapLoading = false;
|
||||
});
|
||||
},
|
||||
pickRouteMapPoint(lnglat, keyword) {
|
||||
const longitude = this.getPointLng(lnglat);
|
||||
const latitude = this.getPointLat(lnglat);
|
||||
if (longitude === undefined || latitude === undefined) {
|
||||
this.$message.warning('选点坐标无效');
|
||||
return;
|
||||
}
|
||||
const point = this.toLngLat(longitude, latitude);
|
||||
this.renderRouteMapMarker(point);
|
||||
this.routeMapSelected = this.buildRouteMapSelection({
|
||||
lng: longitude,
|
||||
lat: latitude,
|
||||
address: keyword,
|
||||
});
|
||||
this.routeMapStatus = '正在反查地址...';
|
||||
this.ensureRouteAmapGeocoder()
|
||||
.then(() => this.runAmapGeocode('address', point))
|
||||
.then(result => {
|
||||
const address = this.resolveMapAddress(result);
|
||||
this.routeMapSelected = {
|
||||
...this.routeMapSelected,
|
||||
detailAddress: address.detailAddress || this.routeMapSelected.detailAddress,
|
||||
regionName: address.regionName || this.routeMapSelected.regionName,
|
||||
};
|
||||
this.routeMapKeyword = this.routeMapSelected.detailAddress || this.routeMapKeyword;
|
||||
this.routeMapStatus = this.routeMapSelected.detailAddress || '已选点,可确认回填';
|
||||
})
|
||||
.catch(() => {
|
||||
this.routeMapStatus = '反查地址失败';
|
||||
this.$message.error('反查地址失败,请重新选点');
|
||||
});
|
||||
},
|
||||
renderRouteMapMarker(point) {
|
||||
if (!this.routeAmap || !window.AMap) return;
|
||||
if (this.routeAmapMarker) {
|
||||
this.routeAmapMarker.setMap(null);
|
||||
}
|
||||
this.routeAmapMarker = new window.AMap.Marker({ position: point });
|
||||
this.routeAmapMarker.setMap(this.routeAmap);
|
||||
this.routeAmap.setCenter(point);
|
||||
},
|
||||
confirmRouteMapPick() {
|
||||
if (!this.routeMapSelected.longitude) {
|
||||
this.$message.warning('请先搜索或点击地图完成选点');
|
||||
return;
|
||||
}
|
||||
const prefix = this.routeMapTarget;
|
||||
this.form[`${prefix}Address`] =
|
||||
this.routeMapSelected.detailAddress || this.form[`${prefix}Address`];
|
||||
this.form[`${prefix}Name`] = this.routeMapSelected.regionName || this.form[`${prefix}Name`];
|
||||
this.form[`${prefix}Longitude`] = this.routeMapSelected.longitude;
|
||||
this.form[`${prefix}Latitude`] = this.routeMapSelected.latitude;
|
||||
this.routeMapVisible = false;
|
||||
this.$refs.crud?.validateField?.(`${prefix}Address`);
|
||||
},
|
||||
buildRouteMapSelection({ lng, lat, address, regionName }) {
|
||||
return {
|
||||
longitude: this.formatCoordinate(lng),
|
||||
latitude: this.formatCoordinate(lat),
|
||||
detailAddress: address || '',
|
||||
regionName: regionName || '',
|
||||
};
|
||||
},
|
||||
formatCoordinate(value) {
|
||||
if (value === undefined || value === null || value === '') return '';
|
||||
const numberValue = Number(value);
|
||||
return Number.isFinite(numberValue) ? numberValue.toFixed(6) : '';
|
||||
},
|
||||
toLngLat(lng, lat) {
|
||||
return new window.AMap.LngLat(Number(lng), Number(lat));
|
||||
},
|
||||
getPointLng(point) {
|
||||
if (!point) return undefined;
|
||||
if (typeof point.getLng === 'function') return point.getLng();
|
||||
return point.lng ?? point.lon;
|
||||
},
|
||||
getPointLat(point) {
|
||||
if (!point) return undefined;
|
||||
if (typeof point.getLat === 'function') return point.getLat();
|
||||
return point.lat;
|
||||
},
|
||||
ensureRouteAmapGeocoder() {
|
||||
if (this.routeAmapGeocoder) return Promise.resolve(this.routeAmapGeocoder);
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!window.AMap || !window.AMap.plugin) {
|
||||
reject(new Error('高德地图组件未就绪'));
|
||||
return;
|
||||
}
|
||||
window.AMap.plugin(['AMap.Geocoder'], () => {
|
||||
try {
|
||||
this.routeAmapGeocoder = new window.AMap.Geocoder();
|
||||
resolve(this.routeAmapGeocoder);
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
runAmapGeocode(action, input) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const timer = window.setTimeout(() => {
|
||||
reject(new Error('高德地图请求超时'));
|
||||
}, 10000);
|
||||
const done = (status, result) => {
|
||||
window.clearTimeout(timer);
|
||||
if (status === 'complete' && result) {
|
||||
resolve(result);
|
||||
return;
|
||||
}
|
||||
reject(new Error('高德地图请求失败'));
|
||||
};
|
||||
try {
|
||||
if (action === 'location') {
|
||||
this.routeAmapGeocoder.getLocation(input, done);
|
||||
} else {
|
||||
this.routeAmapGeocoder.getAddress(input, done);
|
||||
}
|
||||
} catch (error) {
|
||||
window.clearTimeout(timer);
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
},
|
||||
resolveMapPoint(result) {
|
||||
if (!result) return null;
|
||||
const geocode = Array.isArray(result.geocodes) ? result.geocodes[0] : null;
|
||||
if (geocode && geocode.location) return geocode.location;
|
||||
if (result.location) return result.location;
|
||||
if (result.lnglat) return result.lnglat;
|
||||
if (result.getLng || result.lng || result.lon) return result;
|
||||
return null;
|
||||
},
|
||||
resolveMapAddress(result = {}) {
|
||||
const regeocode = result.regeocode || {};
|
||||
const component = regeocode.addressComponent || {};
|
||||
const city = Array.isArray(component.city) ? '' : component.city;
|
||||
return {
|
||||
detailAddress: regeocode.formattedAddress || '',
|
||||
regionName: [component.province, city, component.district].filter(Boolean).join(''),
|
||||
};
|
||||
},
|
||||
normalizeRow(row) {
|
||||
const submitRow = { ...row };
|
||||
Object.keys(submitRow).forEach(key => {
|
||||
@@ -613,6 +951,27 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
handleTemplate() {
|
||||
NProgress.start();
|
||||
exportBlob(
|
||||
config.templateUrl,
|
||||
{
|
||||
[this.website.tokenHeader]: getToken(),
|
||||
},
|
||||
{ feedback: true }
|
||||
)
|
||||
.then(res => {
|
||||
downloadXls(res.data, `${config.title}模板.xlsx`);
|
||||
})
|
||||
.finally(() => {
|
||||
NProgress.done();
|
||||
});
|
||||
},
|
||||
handleImport() {
|
||||
const column = this.excelOptionConfig.column.find(item => item.prop === 'excelFile');
|
||||
column.action = config.importUrl;
|
||||
openImportDialog(this, config.title, () => this.onLoad(this.page, this.query));
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -654,5 +1013,31 @@ export default {
|
||||
justify-content: flex-end;
|
||||
margin-top: 14px;
|
||||
}
|
||||
|
||||
&__map-toolbar {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
margin-bottom: 12px;
|
||||
|
||||
.el-input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&__map {
|
||||
width: 100%;
|
||||
height: 420px;
|
||||
border: 1px solid #eff1f7;
|
||||
}
|
||||
|
||||
&__map-info {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
margin-top: 10px;
|
||||
color: #606266;
|
||||
line-height: 1.6;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
@current-change="currentChange"
|
||||
@size-change="sizeChange"
|
||||
@refresh-change="refreshChange"
|
||||
@search-icon-change="handleSearchIconChange"
|
||||
@on-load="onLoad"
|
||||
>
|
||||
<template #menu-left>
|
||||
<el-button
|
||||
type="primary"
|
||||
:icon="actionButtonLikeSearch ? undefined : 'el-icon-plus'"
|
||||
:plain="!actionButtonLikeSearch"
|
||||
v-if="canCreate"
|
||||
@click="$refs.crud.rowAdd()"
|
||||
>{{ config.createText || '新增' }}
|
||||
@@ -114,11 +114,35 @@
|
||||
|
||||
<template #contractCategory-label>合同类型</template>
|
||||
|
||||
<template v-if="config.enableContractExpiryTags" #search-menu>
|
||||
<div v-show="searchExpanded" class="business-crud-page__contract-expiry-search">
|
||||
<span class="business-crud-page__contract-expiry-label">签约类型:</span>
|
||||
<el-select v-model="contractSignType" clearable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in contractSignTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<div class="business-crud-page__contract-expiry-tags">
|
||||
<el-check-tag
|
||||
v-for="item in contractExpiryTagOptions"
|
||||
:key="item.value"
|
||||
:checked="contractExpiryScope === item.value"
|
||||
@change="handleContractExpiryScopeChange(item.value)"
|
||||
>
|
||||
{{ item.label }}({{ contractExpiryStats[item.statKey] || 0 }})
|
||||
</el-check-tag>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #projectName-form>
|
||||
<el-select
|
||||
v-model="selectedProjectId"
|
||||
class="business-crud-page__field"
|
||||
placeholder="请选择项目名称"
|
||||
:placeholder="config.projectPlaceholder || '请选择项目名称'"
|
||||
filterable
|
||||
clearable
|
||||
:loading="projectLoading"
|
||||
@@ -1221,7 +1245,7 @@
|
||||
<el-cascader
|
||||
v-model="selectedOrganizationId"
|
||||
class="business-crud-page__field"
|
||||
placeholder="请选择所属组织"
|
||||
:placeholder="config.organizationPlaceholder || '请选择所属组织'"
|
||||
:options="organizationOptions"
|
||||
:props="organizationCascaderProps"
|
||||
clearable
|
||||
@@ -1402,12 +1426,17 @@
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<el-form
|
||||
v-if="settlementRuleEnabled"
|
||||
:model="settlementRuleForm"
|
||||
label-position="right"
|
||||
label-width="auto"
|
||||
class="business-crud-page__module-form business-crud-page__module-form--three"
|
||||
>
|
||||
<el-form-item label="账单起始日期" required>
|
||||
<el-form-item
|
||||
label="账单起始日期"
|
||||
required
|
||||
:error="settlementRuleErrors.billStartDate"
|
||||
>
|
||||
<el-date-picker
|
||||
v-model="settlementRuleForm.billStartDate"
|
||||
type="date"
|
||||
@@ -1415,9 +1444,10 @@
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
:disabled="dialogReadonly"
|
||||
@change="clearSettlementRuleError('billStartDate')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="结算类型" required>
|
||||
<el-form-item label="结算类型" required :error="settlementRuleErrors.settlementType">
|
||||
<el-select
|
||||
v-model="settlementRuleForm.settlementType"
|
||||
placeholder="请选择结算类型"
|
||||
@@ -1432,7 +1462,12 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="showSettlementBillCycleType" label="账单周期类型" required>
|
||||
<el-form-item
|
||||
v-if="showSettlementBillCycleType"
|
||||
label="账单周期类型"
|
||||
required
|
||||
:error="settlementRuleErrors.billCycleType"
|
||||
>
|
||||
<el-select
|
||||
v-model="settlementRuleForm.billCycleType"
|
||||
placeholder="请选择账单周期类型"
|
||||
@@ -1447,11 +1482,17 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="showSettlementBillCutoffDay" label="账单截单日">
|
||||
<el-form-item
|
||||
v-if="showSettlementBillCutoffDay"
|
||||
label="账单截单日"
|
||||
required
|
||||
:error="settlementRuleErrors.billCutoffDay"
|
||||
>
|
||||
<el-select
|
||||
v-model="settlementRuleForm.billCutoffDay"
|
||||
placeholder="请选择账单截单日"
|
||||
:disabled="dialogReadonly"
|
||||
@change="clearSettlementRuleError('billCutoffDay')"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in billCutoffDayOptions"
|
||||
@@ -1461,11 +1502,17 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="showSettlementCycleDays" label="周期天数" required>
|
||||
<el-form-item
|
||||
v-if="showSettlementCycleDays"
|
||||
label="周期天数"
|
||||
required
|
||||
:error="settlementRuleErrors.cycleDays"
|
||||
>
|
||||
<el-select
|
||||
v-model="settlementRuleForm.cycleDays"
|
||||
placeholder="请选择周期天数"
|
||||
:disabled="dialogReadonly"
|
||||
@change="clearSettlementRuleError('cycleDays')"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in cycleDayOptions"
|
||||
@@ -2800,7 +2847,7 @@
|
||||
:title="billingPlanMode === 'edit' ? '编辑计费方案' : '添加计费方案'"
|
||||
append-to-body
|
||||
v-model="billingPlanBox"
|
||||
width="96%"
|
||||
width="90%"
|
||||
class="business-crud-page__billing-dialog"
|
||||
>
|
||||
<el-form
|
||||
@@ -2827,6 +2874,7 @@
|
||||
<el-form-item label="备注">
|
||||
<el-input
|
||||
v-model="billingPlanForm.remark"
|
||||
class="business-crud-page__billing-plan-remark"
|
||||
maxlength="100"
|
||||
show-word-limit
|
||||
:disabled="dialogReadonly"
|
||||
@@ -3958,6 +4006,7 @@ export default {
|
||||
cargoImportLoading: false,
|
||||
billingPlanRows: [],
|
||||
settlementRuleForm: defaultSettlementRule(),
|
||||
settlementRuleErrors: {},
|
||||
reconciliationForm: defaultReconciliation(),
|
||||
changeRecordRows: [],
|
||||
billingPlanBox: false,
|
||||
@@ -4035,9 +4084,23 @@ export default {
|
||||
total: 0,
|
||||
},
|
||||
selectionList: [],
|
||||
contractExpiryScope: '',
|
||||
contractSignType: '',
|
||||
searchExpanded: false,
|
||||
attachmentUploadMode: false,
|
||||
contractExpiryStats: {
|
||||
all: 0,
|
||||
within30: 0,
|
||||
within90: 0,
|
||||
over90: 0,
|
||||
expired: 0,
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
if (this.config.enableAllDept && this.isAdmin) {
|
||||
this.allDept = 1;
|
||||
}
|
||||
if (this.config.enableProjectSelect) {
|
||||
this.loadProjectOptions();
|
||||
}
|
||||
@@ -4076,6 +4139,18 @@ export default {
|
||||
actionButtonLikeSearch() {
|
||||
return this.config.actionButtonLikeSearch === true;
|
||||
},
|
||||
contractSignTypeOptions() {
|
||||
return this.option.column?.find(column => column.prop === 'signType')?.dicData || [];
|
||||
},
|
||||
contractExpiryTagOptions() {
|
||||
return [
|
||||
{ label: '全部', value: '', statKey: 'all' },
|
||||
{ label: '30天内到期', value: 'within30', statKey: 'within30' },
|
||||
{ label: '90天内到期', value: 'within90', statKey: 'within90' },
|
||||
{ label: '90天以上', value: 'over90', statKey: 'over90' },
|
||||
{ label: '已到期', value: 'expired', statKey: 'expired' },
|
||||
];
|
||||
},
|
||||
contractSelectEnabled() {
|
||||
return this.config.enableContractSelect || this.config.enableTransportPlanForm;
|
||||
},
|
||||
@@ -4242,7 +4317,9 @@ export default {
|
||||
return this.isAdmin;
|
||||
},
|
||||
readonlyScope() {
|
||||
return this.config.enableAllDept && this.allDept === 1;
|
||||
return (
|
||||
this.config.enableAllDept && this.config.allDeptReadonly !== false && this.allDept === 1
|
||||
);
|
||||
},
|
||||
canCreate() {
|
||||
return this.hasPermission(`${this.config.permission}_add`) && !this.readonlyScope;
|
||||
@@ -4301,6 +4378,9 @@ export default {
|
||||
emitPath: true,
|
||||
};
|
||||
},
|
||||
settlementRuleEnabled() {
|
||||
return Number(this.settlementRuleForm.autoGenerate) === 1;
|
||||
},
|
||||
showSettlementBillCycleType() {
|
||||
return this.settlementRuleForm.settlementType === '月结';
|
||||
},
|
||||
@@ -4537,6 +4617,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
if (action.action === 'edit' || action.action === 'attachmentUpload') {
|
||||
this.attachmentUploadMode = action.action === 'attachmentUpload';
|
||||
this.$refs.crud.rowEdit(row, index);
|
||||
return;
|
||||
}
|
||||
@@ -4714,6 +4795,7 @@ export default {
|
||||
return rule.settlementType === '固定天数周期结算';
|
||||
},
|
||||
handleSettlementTypeChange(value) {
|
||||
this.clearSettlementRuleError('settlementType');
|
||||
if (value === '月结') {
|
||||
if (!this.settlementRuleForm.billCycleType) {
|
||||
this.settlementRuleForm.billCycleType = '固定截单日';
|
||||
@@ -4731,6 +4813,7 @@ export default {
|
||||
}
|
||||
},
|
||||
handleSettlementBillCycleTypeChange(value) {
|
||||
this.clearSettlementRuleError('billCycleType');
|
||||
if (value === '固定截单日') {
|
||||
this.settlementRuleForm.billCutoffDay = this.settlementRuleForm.billCutoffDay || 25;
|
||||
return;
|
||||
@@ -4753,23 +4836,40 @@ export default {
|
||||
}
|
||||
return nextRule;
|
||||
},
|
||||
clearSettlementRuleError(field) {
|
||||
if (!this.settlementRuleErrors[field]) return;
|
||||
this.settlementRuleErrors = {
|
||||
...this.settlementRuleErrors,
|
||||
[field]: '',
|
||||
};
|
||||
},
|
||||
validateSettlementRule() {
|
||||
const rule = this.normalizeSettlementRule(this.settlementRuleForm);
|
||||
this.settlementRuleErrors = {};
|
||||
if (this.isBillingFieldEmpty(rule.billStartDate)) {
|
||||
this.settlementRuleErrors = { billStartDate: '请选择账单起始日期' };
|
||||
this.$message.warning('请选择账单起始日期');
|
||||
return false;
|
||||
}
|
||||
if (this.isBillingFieldEmpty(rule.settlementType)) {
|
||||
this.settlementRuleErrors = { settlementType: '请选择结算类型' };
|
||||
this.$message.warning('请选择结算类型');
|
||||
return false;
|
||||
}
|
||||
if (this.isMonthlySettlement(rule) && this.isBillingFieldEmpty(rule.billCycleType)) {
|
||||
this.settlementRuleErrors = { billCycleType: '请选择账单周期类型' };
|
||||
this.$message.warning('请选择账单周期类型');
|
||||
return false;
|
||||
}
|
||||
if (this.isFixedBillCutoffSettlement(rule)) {
|
||||
if (this.isBillingFieldEmpty(rule.billCutoffDay)) {
|
||||
this.settlementRuleErrors = { billCutoffDay: '请选择账单截单日' };
|
||||
this.$message.warning('请选择账单截单日');
|
||||
return false;
|
||||
}
|
||||
const billCutoffDay = Number(rule.billCutoffDay);
|
||||
if (!Number.isInteger(billCutoffDay) || billCutoffDay < 1 || billCutoffDay > 31) {
|
||||
this.settlementRuleErrors = { billCutoffDay: '账单截单日必须为1~31的整数' };
|
||||
this.$message.warning('账单截单日必须为1~31的整数');
|
||||
return false;
|
||||
}
|
||||
@@ -4777,13 +4877,14 @@ export default {
|
||||
if (this.isFixedCycleSettlement(rule)) {
|
||||
const cycleDays = Number(rule.cycleDays);
|
||||
if (!Number.isInteger(cycleDays) || cycleDays < 1 || cycleDays > 365) {
|
||||
this.settlementRuleErrors = { cycleDays: '周期天数必须为1~365的整数' };
|
||||
this.$message.warning('周期天数必须为1~365的整数');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
normalizeRow(row) {
|
||||
normalizeRow(row, saveAsDraft = false) {
|
||||
const submitRow = { ...row };
|
||||
if (this.config.enableTransportPlanForm) {
|
||||
if (!this.validateTransportPlanForm(submitRow)) return false;
|
||||
@@ -4803,7 +4904,7 @@ export default {
|
||||
submitRow.billingPlanJson = JSON.stringify(this.billingPlanRows);
|
||||
}
|
||||
if (this.config.enableSettlementRule) {
|
||||
if (!this.validateSettlementRule()) return false;
|
||||
if (this.settlementRuleEnabled && !this.validateSettlementRule()) return false;
|
||||
submitRow.settlementRuleJson = JSON.stringify(this.normalizeSettlementRule());
|
||||
}
|
||||
if (this.config.enableReconciliation) {
|
||||
@@ -4812,7 +4913,7 @@ export default {
|
||||
if (this.config.enableChangeRecord) {
|
||||
submitRow.changeRecordJson = JSON.stringify(this.changeRecordRows);
|
||||
}
|
||||
if (this.config.saveAsDraft) {
|
||||
if (this.config.saveAsDraft && saveAsDraft) {
|
||||
submitRow.approvalStatus = 'draft';
|
||||
}
|
||||
delete submitRow.basicInfoTitle;
|
||||
@@ -4896,22 +4997,25 @@ export default {
|
||||
this.stopSubmitLoading(loading);
|
||||
return;
|
||||
}
|
||||
this.getSaveRequest()(submitRow).then(
|
||||
const request =
|
||||
this.attachmentUploadMode && typeof this.api.updateAttachments === 'function'
|
||||
? this.api.updateAttachments
|
||||
: this.getSaveRequest();
|
||||
request(submitRow).then(
|
||||
() => {
|
||||
this.attachmentUploadMode = false;
|
||||
this.onLoad(this.page);
|
||||
this.$message({ type: 'success', message: '操作成功!' });
|
||||
done();
|
||||
},
|
||||
error => {
|
||||
this.attachmentUploadMode = false;
|
||||
window.console.log(error);
|
||||
this.stopSubmitLoading(loading);
|
||||
}
|
||||
);
|
||||
},
|
||||
getSaveRequest() {
|
||||
if (this.config.saveAsDraft && typeof this.api.saveDraft === 'function') {
|
||||
return this.api.saveDraft;
|
||||
}
|
||||
return this.api.submit;
|
||||
},
|
||||
buildContractCreateSubmitRow(action) {
|
||||
@@ -5033,7 +5137,7 @@ export default {
|
||||
handleDraftSave() {
|
||||
const request =
|
||||
typeof this.api.saveDraft === 'function' ? this.api.saveDraft : this.api.submit;
|
||||
const submitRow = this.normalizeRow(this.form);
|
||||
const submitRow = this.normalizeRow(this.form, true);
|
||||
if (!submitRow) return;
|
||||
this.draftSaveLoading = true;
|
||||
request(submitRow)
|
||||
@@ -5096,6 +5200,7 @@ export default {
|
||||
},
|
||||
beforeOpen(done, type) {
|
||||
this.crudDialogType = type;
|
||||
this.settlementRuleErrors = {};
|
||||
this.syncCustomCreateDialogButtons(type);
|
||||
this.dialogReadonly = type === 'view';
|
||||
this.syncContractNoDisabled(type);
|
||||
@@ -5177,8 +5282,7 @@ export default {
|
||||
this.syncCurrentOrganizationOption();
|
||||
}
|
||||
if (this.config.enableProjectSelect) {
|
||||
this.form.usedFundLimit = 0;
|
||||
this.form.remainingFundLimit = 0;
|
||||
this.form.remainingFundLimit = this.calculateRemainingFundLimit();
|
||||
this.syncCurrentProjectOption();
|
||||
}
|
||||
if (this.contractSelectEnabled) {
|
||||
@@ -5225,7 +5329,7 @@ export default {
|
||||
loadProjectOptions() {
|
||||
if (!this.config.enableProjectSelect || this.projectLoading) return;
|
||||
this.projectLoading = true;
|
||||
getProjectList(1, 9999, {})
|
||||
getProjectList(1, 9999, this.config.projectQueryParams || {})
|
||||
.then(res => {
|
||||
this.projectOptions = extractRecords(res);
|
||||
this.syncCurrentProjectOption();
|
||||
@@ -5249,6 +5353,12 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
calculateRemainingFundLimit() {
|
||||
const projectFundLimit = Number(this.form.projectFundLimit);
|
||||
const usedFundLimit = Number(this.form.usedFundLimit);
|
||||
if (!Number.isFinite(projectFundLimit) || !Number.isFinite(usedFundLimit)) return '';
|
||||
return Math.round((projectFundLimit - usedFundLimit + Number.EPSILON) * 100) / 100;
|
||||
},
|
||||
handleProjectChange(projectId) {
|
||||
const project = this.projectOptions.find(item => String(item.id) === String(projectId));
|
||||
if (!project) {
|
||||
@@ -5276,7 +5386,7 @@ export default {
|
||||
this.form.undertakeDeptName = project.undertakeDeptName || '';
|
||||
this.form.projectFundLimit = project.fundLimit || project.projectFundLimit || 0;
|
||||
this.form.usedFundLimit = 0;
|
||||
this.form.remainingFundLimit = 0;
|
||||
this.form.remainingFundLimit = this.calculateRemainingFundLimit();
|
||||
if (this.contractSelectEnabled || this.config.enableTransportPlanForm) {
|
||||
this.form.customerName =
|
||||
project.customerName ||
|
||||
@@ -7618,11 +7728,16 @@ export default {
|
||||
},
|
||||
searchReset() {
|
||||
this.query = {};
|
||||
this.contractExpiryScope = '';
|
||||
this.contractSignType = '';
|
||||
this.page.currentPage = 1;
|
||||
this.onLoad(this.page);
|
||||
},
|
||||
searchChange(params, done) {
|
||||
this.query = params;
|
||||
this.query = {
|
||||
...params,
|
||||
...(this.contractSignType ? { signType: this.contractSignType } : {}),
|
||||
};
|
||||
this.page.currentPage = 1;
|
||||
this.onLoad(this.page, params);
|
||||
done();
|
||||
@@ -7645,6 +7760,25 @@ export default {
|
||||
refreshChange() {
|
||||
this.onLoad(this.page, this.query);
|
||||
},
|
||||
handleSearchIconChange(expanded) {
|
||||
this.searchExpanded = expanded;
|
||||
},
|
||||
handleContractExpiryScopeChange(expireScope) {
|
||||
this.contractExpiryScope = expireScope;
|
||||
this.page.currentPage = 1;
|
||||
this.onLoad(this.page, this.query);
|
||||
},
|
||||
refreshContractExpiryStats(query) {
|
||||
if (!this.config.enableContractExpiryTags || typeof this.api.expireStats !== 'function') return;
|
||||
const statsQuery = { ...query };
|
||||
delete statsQuery.expireScope;
|
||||
this.api.expireStats(statsQuery).then(res => {
|
||||
this.contractExpiryStats = {
|
||||
...this.contractExpiryStats,
|
||||
...(res.data.data || {}),
|
||||
};
|
||||
});
|
||||
},
|
||||
handleScopeChange() {
|
||||
if (!this.canViewAllDept) {
|
||||
this.allDept = 0;
|
||||
@@ -7701,7 +7835,13 @@ export default {
|
||||
},
|
||||
onLoad(page, params = {}) {
|
||||
this.loading = true;
|
||||
const query = this.normalizeQueryParams({ ...params, ...this.query, allDept: this.allDept });
|
||||
const query = this.normalizeQueryParams({
|
||||
...params,
|
||||
...this.query,
|
||||
allDept: this.allDept,
|
||||
...(this.contractSignType ? { signType: this.contractSignType } : {}),
|
||||
...(this.contractExpiryScope ? { expireScope: this.contractExpiryScope } : {}),
|
||||
});
|
||||
this.api
|
||||
.getList(page.currentPage, page.pageSize, query)
|
||||
.then(res => {
|
||||
@@ -7709,6 +7849,7 @@ export default {
|
||||
this.page.total = result.total;
|
||||
this.data = result.records;
|
||||
this.selectionClear();
|
||||
this.refreshContractExpiryStats(query);
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
@@ -8612,6 +8753,38 @@ export default {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&__contract-expiry-search {
|
||||
display: flex;
|
||||
order: -1;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-right: auto;
|
||||
min-width: 0;
|
||||
|
||||
:deep(.el-select) {
|
||||
width: 160px;
|
||||
}
|
||||
}
|
||||
|
||||
&__contract-expiry-label {
|
||||
flex: 0 0 auto;
|
||||
min-width: 140px;
|
||||
color: #606266;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&__contract-expiry-tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
|
||||
:deep(.el-check-tag) {
|
||||
margin: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.dialog-section-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -9422,6 +9595,10 @@ export default {
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
&__billing-plan-remark {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
&__billing-rule-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -20,7 +20,6 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
plain
|
||||
v-if="canMajorProjectSupplement"
|
||||
@click="openProjectDialog('majorSupplement')"
|
||||
>
|
||||
@@ -29,7 +28,6 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
plain
|
||||
v-if="canCreate"
|
||||
@click="openProjectDialog('add')"
|
||||
>
|
||||
@@ -176,21 +174,16 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="承办部门" prop="undertakeDeptId">
|
||||
<el-select
|
||||
<el-cascader
|
||||
v-model="form.undertakeDeptId"
|
||||
placeholder="请选择承办部门"
|
||||
filterable
|
||||
clearable
|
||||
filterable
|
||||
:options="deptTreeOptions"
|
||||
:props="deptCascaderProps"
|
||||
:disabled="isBasicInfoReadonly"
|
||||
@change="handleUndertakeDeptChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deptOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目由来" prop="projectSource">
|
||||
<el-select
|
||||
@@ -217,9 +210,11 @@
|
||||
<el-form-item label="客户名称" prop="customerNames">
|
||||
<el-select
|
||||
v-model="selectedCustomerId"
|
||||
placeholder="搜索选择"
|
||||
placeholder="支持多选,选择后下方列表展示"
|
||||
multiple
|
||||
filterable
|
||||
clearable
|
||||
collapse-tags
|
||||
:loading="customerLoading"
|
||||
@visible-change="visible => visible && loadCustomerOptions('客户')"
|
||||
@change="handleCustomerChange"
|
||||
@@ -257,6 +252,7 @@
|
||||
v-model="form.fundLimit"
|
||||
placeholder="实际业务回款周期内付款额度"
|
||||
@input="value => handleNumberInput('fundLimit', value)"
|
||||
@blur="formatAmountField('fundLimit')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目应收账款额度(万元)" prop="receivableLimit">
|
||||
@@ -264,6 +260,7 @@
|
||||
v-model="form.receivableLimit"
|
||||
placeholder="回款期内最大应收账款额度"
|
||||
@input="value => handleNumberInput('receivableLimit', value)"
|
||||
@blur="formatAmountField('receivableLimit')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="应收账款回款期限" prop="receivableDays">
|
||||
@@ -466,13 +463,25 @@
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<div class="project-apply-form__material-card">
|
||||
<div class="project-apply-form__material-head">
|
||||
<div class="dialog-section-title project-apply-form__material-title">项目材料</div>
|
||||
<el-button type="primary" :disabled="!attachmentRows.length" @click="handleBatchDownload"
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="!attachmentRows.length"
|
||||
@click="handleBatchDownload"
|
||||
>批量下载</el-button
|
||||
>
|
||||
</div>
|
||||
<el-table :data="attachmentRows" border class="project-apply-form__table">
|
||||
<el-alert
|
||||
v-if="dialogReadonly && missingRequiredAttachmentTypes.length"
|
||||
class="project-apply-form__material-warning"
|
||||
type="warning"
|
||||
:closable="false"
|
||||
show-icon
|
||||
:title="`缺少必需材料:${missingRequiredAttachmentTypes.join('、')}`"
|
||||
/>
|
||||
<el-table :data="attachmentRows" border class="project-apply-form__material-table">
|
||||
<el-table-column type="index" label="序号" width="80" align="center" />
|
||||
<el-table-column label="附件类型" min-width="160" align="center">
|
||||
<template #default="{ row }">
|
||||
@@ -506,10 +515,7 @@
|
||||
<el-table-column label="操作" width="110" align="center">
|
||||
<template #default="{ row, $index }">
|
||||
<el-link type="primary" @click="downloadAttachment(row)">下载</el-link>
|
||||
<el-link
|
||||
v-if="!dialogReadonly"
|
||||
type="primary"
|
||||
@click="removeAttachment($index)"
|
||||
<el-link v-if="!dialogReadonly" type="primary" @click="removeAttachment($index)"
|
||||
>删除</el-link
|
||||
>
|
||||
</template>
|
||||
@@ -520,11 +526,12 @@
|
||||
class="project-apply-form__upload"
|
||||
:readonly="dialogReadonly"
|
||||
:file-types="attachmentFileTypes"
|
||||
:max-size="500"
|
||||
:max-size="50"
|
||||
button-text="上传附件"
|
||||
tip="支持pdf、bmp、jpeg、png、jpg、doc、docx、ppt、pptx、xlsx、xls、eml、msg、zip的文件格式,单个文件大小限制500M"
|
||||
tip="支持pdf、bmp、jpeg、png、jpg、doc、docx、ppt、pptx、xlsx、xls、eml、msg、zip的文件格式,单个文件大小限制50M"
|
||||
@change="handleAttachmentChange"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div v-if="!isChangeDialog" class="dialog-section-title project-apply-form__table-title">
|
||||
变更记录
|
||||
@@ -595,16 +602,24 @@
|
||||
:class="{ 'project-apply-dialog__footer--change': isChangeDialog }"
|
||||
>
|
||||
<template v-if="isChangeDialog">
|
||||
<el-button type="primary" :loading="submitLoading" @click="submitChangeProject">
|
||||
提交
|
||||
</el-button>
|
||||
<el-button type="primary" :loading="submitLoading" @click="saveChangeProject">
|
||||
保存
|
||||
</el-button>
|
||||
<el-button @click="projectBox = false">关闭</el-button>
|
||||
<el-button type="primary" :loading="submitLoading" @click="submitChangeProject">
|
||||
提交
|
||||
</el-button>
|
||||
<el-button @click="handleCancelProject">取消</el-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-button @click="projectBox = false">取消</el-button>
|
||||
<el-button @click="handleCancelProject">取消</el-button>
|
||||
<el-button
|
||||
v-if="!dialogReadonly"
|
||||
type="primary"
|
||||
:loading="submitLoading"
|
||||
@click="saveProject"
|
||||
>
|
||||
保存
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="!dialogReadonly"
|
||||
type="primary"
|
||||
@@ -745,6 +760,7 @@ const changeTypeOptions = [
|
||||
];
|
||||
|
||||
const normalProjectAttachmentTypeOptions = [
|
||||
'项目立项报告',
|
||||
'利润测算表',
|
||||
'单一来源供应商申请表/三方比价表',
|
||||
'合同模板',
|
||||
@@ -754,6 +770,7 @@ const normalProjectAttachmentTypeOptions = [
|
||||
].map(item => ({ label: item, value: item }));
|
||||
|
||||
const majorProjectAttachmentTypeOptions = [
|
||||
'项目立项报告',
|
||||
'会议纪要',
|
||||
'评审表决票',
|
||||
'利润测算表',
|
||||
@@ -875,6 +892,8 @@ export default {
|
||||
fundDemand: [{ label: '资金需求', validator: validateAmount, trigger: 'blur' }],
|
||||
handlerUserId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择项目经办人',
|
||||
label: '项目经办人',
|
||||
nameProp: 'handlerUserName',
|
||||
validator: validateUser,
|
||||
@@ -883,6 +902,8 @@ export default {
|
||||
],
|
||||
principalUserId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择项目负责人',
|
||||
label: '项目负责人',
|
||||
nameProp: 'principalUserName',
|
||||
validator: validateUser,
|
||||
@@ -899,8 +920,16 @@ export default {
|
||||
],
|
||||
},
|
||||
deptOptions: [],
|
||||
deptTreeOptions: [],
|
||||
deptCascaderProps: {
|
||||
label: 'label',
|
||||
value: 'value',
|
||||
children: 'children',
|
||||
emitPath: false,
|
||||
checkStrictly: true,
|
||||
},
|
||||
cargoTypeOptions: [],
|
||||
selectedCustomerId: '',
|
||||
selectedCustomerId: [],
|
||||
selectedCarrierIds: [],
|
||||
customerOptions: [],
|
||||
carrierOptions: [],
|
||||
@@ -993,6 +1022,12 @@ export default {
|
||||
? majorProjectAttachmentTypeOptions
|
||||
: normalProjectAttachmentTypeOptions;
|
||||
},
|
||||
missingRequiredAttachmentTypes() {
|
||||
const uploadedTypes = new Set(this.attachmentRows.map(item => item.fileType).filter(Boolean));
|
||||
return this.projectAttachmentTypeOptions
|
||||
.map(item => item.value)
|
||||
.filter(fileType => !uploadedTypes.has(fileType));
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.loadDeptOptions();
|
||||
@@ -1233,7 +1268,7 @@ export default {
|
||||
if (type === 'add' || type === 'majorSupplement') {
|
||||
this.applyProjectDetail({
|
||||
...emptyForm(),
|
||||
projectType: type === 'majorSupplement' ? '重大项目' : '',
|
||||
projectType: type === 'majorSupplement' ? '重大项目' : '普通项目',
|
||||
});
|
||||
this.fillDefaultUsers();
|
||||
return;
|
||||
@@ -1253,21 +1288,35 @@ export default {
|
||||
this.carrierRows = [];
|
||||
this.attachmentRows = [];
|
||||
this.changeRows = [];
|
||||
this.selectedCustomerId = '';
|
||||
this.selectedCustomerId = [];
|
||||
this.selectedCarrierIds = [];
|
||||
},
|
||||
applyProjectDetail(row) {
|
||||
const displayRow = {
|
||||
...row,
|
||||
fundLimit: this.formatAmount(row.fundLimit),
|
||||
receivableLimit: this.formatAmount(row.receivableLimit),
|
||||
...(this.dialogReadonly
|
||||
? {
|
||||
projectScale: this.normalizeReadonlyAmount(row.projectScale),
|
||||
estimatedProfit: this.normalizeReadonlyAmount(row.estimatedProfit),
|
||||
fundDemand: this.normalizeReadonlyAmount(row.fundDemand),
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
const form = {
|
||||
...emptyForm(),
|
||||
...row,
|
||||
...displayRow,
|
||||
handlerUserName: this.resolveUserRealName(displayRow, 'handler'),
|
||||
principalUserName: this.resolveUserRealName(displayRow, 'principal'),
|
||||
businessDateRange:
|
||||
row.businessStartDate && row.businessEndDate
|
||||
? [row.businessStartDate, row.businessEndDate]
|
||||
displayRow.businessStartDate && displayRow.businessEndDate
|
||||
? [displayRow.businessStartDate, displayRow.businessEndDate]
|
||||
: [],
|
||||
};
|
||||
const situation = this.parseSituation(row.situationRemark);
|
||||
const customerRows = this.parseJsonArray(row.customerJson);
|
||||
const carrierRows = this.parseJsonArray(row.carrierJson);
|
||||
const situation = this.parseSituation(displayRow.situationRemark);
|
||||
const customerRows = this.parseJsonArray(displayRow.customerJson);
|
||||
const carrierRows = this.parseJsonArray(displayRow.carrierJson);
|
||||
this.form = {
|
||||
...form,
|
||||
...situation,
|
||||
@@ -1276,9 +1325,11 @@ export default {
|
||||
};
|
||||
this.customerRows = customerRows;
|
||||
this.carrierRows = carrierRows;
|
||||
this.attachmentRows = this.parseJsonArray(row.attachmentsJson);
|
||||
this.changeRows = this.buildChangeRows(row);
|
||||
this.selectedCustomerId = this.getCustomerRowId(this.customerRows[0]);
|
||||
this.attachmentRows = this.parseJsonArray(displayRow.attachmentsJson);
|
||||
this.changeRows = this.buildChangeRows(displayRow);
|
||||
this.selectedCustomerId = this.customerRows
|
||||
.map(item => this.getCustomerRowId(item))
|
||||
.filter(Boolean);
|
||||
this.selectedCarrierIds = this.carrierRows
|
||||
.map(item => this.getCustomerRowId(item))
|
||||
.filter(Boolean);
|
||||
@@ -1287,7 +1338,13 @@ export default {
|
||||
fillDefaultUsers() {
|
||||
const userId = this.userInfo?.userId || this.userInfo?.id || '';
|
||||
const userName =
|
||||
this.userInfo?.realName || this.userInfo?.userName || this.userInfo?.account || '';
|
||||
this.userInfo?.realName ||
|
||||
this.userInfo?.real_name ||
|
||||
this.userInfo?.name ||
|
||||
this.userInfo?.userName ||
|
||||
this.userInfo?.user_name ||
|
||||
this.userInfo?.account ||
|
||||
'';
|
||||
if (userId && userName) {
|
||||
this.form.handlerUserId = userId;
|
||||
this.form.handlerUserName = userName;
|
||||
@@ -1295,6 +1352,16 @@ export default {
|
||||
this.form.principalUserName = userName;
|
||||
}
|
||||
},
|
||||
resolveUserRealName(row = {}, role) {
|
||||
return (
|
||||
row[`${role}RealName`] ||
|
||||
row[`${role}UserRealName`] ||
|
||||
row[`${role}User`]?.realName ||
|
||||
row[role]?.realName ||
|
||||
row[`${role}UserName`] ||
|
||||
''
|
||||
);
|
||||
},
|
||||
resolveChangeType(row = {}) {
|
||||
if (row.changeType) return row.changeType;
|
||||
const node = row.currentNode || '';
|
||||
@@ -1330,6 +1397,36 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
saveProject() {
|
||||
this.submitLoading = true;
|
||||
this.api
|
||||
.saveDraft(this.normalizeSubmitForm())
|
||||
.then(res => {
|
||||
if (res.data?.success === false || res.data?.data === false) {
|
||||
this.$message.error(res.data?.msg || '保存失败,请联系管理员');
|
||||
return;
|
||||
}
|
||||
this.$message.success('保存成功!');
|
||||
this.projectBox = false;
|
||||
this.onLoad(this.page, this.query);
|
||||
})
|
||||
.finally(() => {
|
||||
this.submitLoading = false;
|
||||
});
|
||||
},
|
||||
handleCancelProject() {
|
||||
if (!['add', 'majorSupplement', 'change'].includes(this.dialogType)) {
|
||||
this.projectBox = false;
|
||||
return;
|
||||
}
|
||||
this.$confirm('确认后直接关闭弹窗,列表无数据变更,是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
this.projectBox = false;
|
||||
});
|
||||
},
|
||||
saveChangeProject() {
|
||||
this.submitChangeForm(false);
|
||||
},
|
||||
@@ -1366,6 +1463,8 @@ export default {
|
||||
const [businessStartDate, businessEndDate] = this.form.businessDateRange || [];
|
||||
const submitRow = {
|
||||
...this.form,
|
||||
fundLimit: this.formatAmount(this.form.fundLimit),
|
||||
receivableLimit: this.formatAmount(this.form.receivableLimit),
|
||||
businessStartDate,
|
||||
businessEndDate,
|
||||
customerJson: JSON.stringify(this.customerRows),
|
||||
@@ -1479,6 +1578,11 @@ export default {
|
||||
})
|
||||
.filter(Boolean);
|
||||
},
|
||||
normalizeReadonlyAmount(value) {
|
||||
return value === null || value === undefined || value === '' || Number(value) === -1
|
||||
? ''
|
||||
: value;
|
||||
},
|
||||
mergeCustomerOptions(options = [], selectedOptions = []) {
|
||||
const result = [...selectedOptions];
|
||||
options.forEach(option => {
|
||||
@@ -1507,7 +1611,7 @@ export default {
|
||||
changeType:
|
||||
row.changeType ||
|
||||
(String(row.currentNode || '').includes('备案') ? '项目备案调整' : '项目变更'),
|
||||
handler: row.handlerUserName || '',
|
||||
handler: this.resolveUserRealName(row, 'handler'),
|
||||
content: row.changeContent || '',
|
||||
reason: row.changeReason || '',
|
||||
status: row.approvalStatusName || row.approvalStatus || '',
|
||||
@@ -1531,9 +1635,18 @@ export default {
|
||||
},
|
||||
loadDeptOptions() {
|
||||
getDeptTree().then(res => {
|
||||
this.deptOptions = this.flattenDept(res.data.data || []);
|
||||
const deptTree = res.data.data || [];
|
||||
this.deptOptions = this.flattenDept(deptTree);
|
||||
this.deptTreeOptions = this.toDeptCascaderOptions(deptTree);
|
||||
});
|
||||
},
|
||||
toDeptCascaderOptions(list = []) {
|
||||
return list.map(item => ({
|
||||
label: item.title || item.deptName || item.name,
|
||||
value: item.id,
|
||||
children: item.children?.length ? this.toDeptCascaderOptions(item.children) : undefined,
|
||||
}));
|
||||
},
|
||||
flattenDept(list = [], level = 0) {
|
||||
return list.reduce((result, item) => {
|
||||
const label = item.title || item.deptName || item.name;
|
||||
@@ -1568,7 +1681,11 @@ export default {
|
||||
const loadingKey = type === '客户' ? 'customerLoading' : 'carrierLoading';
|
||||
const optionsKey = type === '客户' ? 'customerOptions' : 'carrierOptions';
|
||||
this[loadingKey] = true;
|
||||
getCustomerArchiveList(1, 100, { customerType: type, status: 1 })
|
||||
getCustomerArchiveList(1, 100, {
|
||||
customerType: type,
|
||||
status: 1,
|
||||
...(type === '客户' ? { approvalStatus: 'approved' } : {}),
|
||||
})
|
||||
.then(res => {
|
||||
const records = (res.data.data && res.data.data.records) || [];
|
||||
const selectedOptions = this.buildCustomerOptionsFromRows(
|
||||
@@ -1592,16 +1709,16 @@ export default {
|
||||
raw: item,
|
||||
};
|
||||
},
|
||||
handleCustomerChange(id) {
|
||||
if (!id) {
|
||||
handleCustomerChange(ids) {
|
||||
if (!ids || !ids.length) {
|
||||
this.customerRows = [];
|
||||
this.form.customerNames = '';
|
||||
this.form.customerJson = '';
|
||||
return;
|
||||
}
|
||||
this.loadCustomerDetailRow(id, 'customer').then(row => {
|
||||
this.customerRows = [row];
|
||||
this.form.customerNames = row.customer;
|
||||
Promise.all(ids.map(id => this.loadCustomerDetailRow(id, 'customer'))).then(rows => {
|
||||
this.customerRows = rows;
|
||||
this.form.customerNames = rows.map(item => item.customer).join('、');
|
||||
this.form.customerJson = JSON.stringify(this.customerRows);
|
||||
this.syncSelectedCustomerOptions();
|
||||
this.$refs.projectForm?.validateField('customerNames');
|
||||
@@ -1654,6 +1771,14 @@ export default {
|
||||
this.form[prop] =
|
||||
parts.length > 1 ? `${parts[0]}.${parts.slice(1).join('').slice(0, 2)}` : parts[0];
|
||||
},
|
||||
formatAmount(value) {
|
||||
if (value === null || value === undefined || value === '' || Number(value) === -1) return '';
|
||||
const amount = Number(value);
|
||||
return Number.isFinite(amount) ? amount.toFixed(2) : value;
|
||||
},
|
||||
formatAmountField(prop) {
|
||||
this.form[prop] = this.formatAmount(this.form[prop]);
|
||||
},
|
||||
handleIntegerInput(prop, value) {
|
||||
this.form[prop] = String(value || '').replace(/[^\d]/g, '');
|
||||
},
|
||||
@@ -1834,13 +1959,36 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
&__material-card {
|
||||
margin-bottom: 16px;
|
||||
background: #fff;
|
||||
border-radius: 6px;
|
||||
padding: 12px 16px;
|
||||
padding: 14px 16px;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
&__material-table {
|
||||
width: 100%;
|
||||
margin-bottom: 12px;
|
||||
|
||||
:deep(.el-table__header th) {
|
||||
background: #f5f7fa;
|
||||
color: #303133;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
:deep(.el-table__cell) {
|
||||
border-color: #eff1f7;
|
||||
}
|
||||
}
|
||||
|
||||
&__material-warning {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
&__material-title {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
plain
|
||||
v-if="hasPermission('driver_add')"
|
||||
@click="openDriver()"
|
||||
>新增
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
plain
|
||||
v-if="hasPermission('transport_ship_add')"
|
||||
@click="openShip()"
|
||||
>
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
plain
|
||||
v-if="hasPermission('transport_vehicle_add')"
|
||||
@click="openVehicle()"
|
||||
>新增
|
||||
|
||||
@@ -20,35 +20,10 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
plain
|
||||
v-if="hasPermission('credit_score_quantification_add')"
|
||||
@click="openConfig()"
|
||||
>新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-upload"
|
||||
plain
|
||||
v-if="hasPermission('credit_score_quantification_import')"
|
||||
@click="handleImport"
|
||||
>批量导入
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-download"
|
||||
plain
|
||||
v-if="hasPermission('credit_score_quantification_template')"
|
||||
@click="handleTemplate"
|
||||
>下载模板
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-download"
|
||||
plain
|
||||
v-if="hasPermission('credit_score_quantification_export')"
|
||||
@click="handleExport"
|
||||
>批量导出
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@@ -71,28 +46,28 @@
|
||||
<template #menu="{ row }">
|
||||
<el-link
|
||||
type="primary"
|
||||
v-if="hasPermission('credit_score_quantification_edit')"
|
||||
@click="openConfig(row)"
|
||||
v-if="hasPermission('credit_score_quantification_status') && row.status === 1"
|
||||
@click="handleStatus(row)"
|
||||
>
|
||||
编辑
|
||||
停用
|
||||
</el-link>
|
||||
<el-link
|
||||
type="primary"
|
||||
v-if="hasPermission('credit_score_quantification_publish') && row.status === 3"
|
||||
v-if="hasPermission('credit_score_quantification_publish') && row.status !== 1"
|
||||
@click="handlePublish(row)"
|
||||
>
|
||||
发布
|
||||
</el-link>
|
||||
<el-link
|
||||
type="primary"
|
||||
v-if="hasPermission('credit_score_quantification_status') && row.status !== 3"
|
||||
@click="handleStatus(row)"
|
||||
v-if="hasPermission('credit_score_quantification_edit') && row.status !== 1"
|
||||
@click="openConfig(row)"
|
||||
>
|
||||
{{ row.status === 1 ? '停用' : '启用' }}
|
||||
编辑
|
||||
</el-link>
|
||||
<el-link
|
||||
type="danger"
|
||||
v-if="hasPermission('credit_score_quantification_delete') && row.status === 3"
|
||||
v-if="hasPermission('credit_score_quantification_delete')"
|
||||
@click="rowDel(row)"
|
||||
>
|
||||
删除
|
||||
@@ -100,16 +75,6 @@
|
||||
</template>
|
||||
</avue-crud>
|
||||
|
||||
<el-dialog title="评分量化表数据导入" append-to-body v-model="excelBox" width="555px">
|
||||
<avue-form :option="excelOption" v-model="excelForm">
|
||||
<template #excelTemplate>
|
||||
<el-button type="primary" @click="handleTemplate">
|
||||
点击下载<i class="el-icon-download el-icon--right"></i>
|
||||
</el-button>
|
||||
</template>
|
||||
</avue-form>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
:title="readonly ? '查看评分量化表' : configForm.id ? '编辑评分量化表' : '新增评分量化表'"
|
||||
append-to-body
|
||||
@@ -128,10 +93,21 @@
|
||||
:disabled="readonly"
|
||||
>
|
||||
<el-form-item label="评定表名称" required>
|
||||
<el-input v-model="configForm.name" maxlength="30" show-word-limit />
|
||||
<el-input
|
||||
v-model="configForm.name"
|
||||
class="score-config__name-input"
|
||||
maxlength="30"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="configForm.remark" type="textarea" maxlength="500" show-word-limit />
|
||||
<el-input
|
||||
v-model="configForm.remark"
|
||||
type="textarea"
|
||||
:rows="1"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
@@ -160,16 +136,6 @@
|
||||
<el-table :data="configForm.standards" border class="config-table">
|
||||
<el-table-column label="序号" type="index" width="90" align="center" />
|
||||
<el-table-column label="信用等级" prop="creditLevel" width="120" align="center" />
|
||||
<el-table-column label="得分率" width="160" align="center">
|
||||
<template #default="{ row }"
|
||||
>{{ row.scoreRateLower }}% - {{ row.scoreRateUpper }}%</template
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="最大资金使用额度(万元)" width="210" align="center">
|
||||
<template #default="{ row }">
|
||||
{{ row.creditLimitLower }} - {{ row.creditLimitUpper }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="标准说明" prop="standardDescription" min-width="320" />
|
||||
<el-table-column label="操作" width="160" align="center">
|
||||
<template #default="{ row, $index }">
|
||||
@@ -192,7 +158,7 @@
|
||||
append-to-body
|
||||
v-model="categoryBox"
|
||||
width="82%"
|
||||
class="score-dialog"
|
||||
class="score-dialog category-dialog"
|
||||
:close-on-press-escape="false"
|
||||
>
|
||||
<div class="category-detail">
|
||||
@@ -317,43 +283,62 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="得分率(%)" required>
|
||||
<div class="range-input">
|
||||
<el-input-number
|
||||
<div class="range-input standard-range-input">
|
||||
<el-input
|
||||
v-model="standardForm.scoreRateLower"
|
||||
:min="0"
|
||||
:max="100"
|
||||
:precision="0"
|
||||
inputmode="numeric"
|
||||
@input="value => handleStandardNumberInput('scoreRateLower', value, 0, 100)"
|
||||
/>
|
||||
<span>至</span>
|
||||
<el-input-number
|
||||
<el-input
|
||||
v-model="standardForm.scoreRateUpper"
|
||||
:min="0"
|
||||
:max="100"
|
||||
:precision="0"
|
||||
inputmode="numeric"
|
||||
@input="value => handleStandardNumberInput('scoreRateUpper', value, 0, 100)"
|
||||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="得分率每增加" required>
|
||||
<el-input-number v-model="standardForm.scoreRateIncrease" :min="0" :precision="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="最大资金使用额度(万元)" required>
|
||||
<div class="range-input">
|
||||
<el-input-number v-model="standardForm.creditLimitLower" :min="0" :precision="2" />
|
||||
<span>至</span>
|
||||
<el-input-number v-model="standardForm.creditLimitUpper" :min="0" :precision="2" />
|
||||
</div>
|
||||
<el-form-item label="得分率每增加" required>
|
||||
<el-input
|
||||
v-model="standardForm.scoreRateIncrease"
|
||||
inputmode="numeric"
|
||||
@input="value => handleStandardNumberInput('scoreRateIncrease', value)"
|
||||
>
|
||||
<template #suffix>%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="额度增加" required>
|
||||
<el-input-number v-model="standardForm.creditLimitIncrease" :min="0" :precision="2" />
|
||||
<span class="score-unit">万元</span>
|
||||
<el-input
|
||||
v-model="standardForm.creditLimitIncrease"
|
||||
inputmode="decimal"
|
||||
@input="value => handleStandardNumberInput('creditLimitIncrease', value, 2)"
|
||||
>
|
||||
<template #suffix>万元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="最大资金使用额度(万元)" required>
|
||||
<div class="range-input standard-range-input">
|
||||
<el-input
|
||||
v-model="standardForm.creditLimitLower"
|
||||
inputmode="decimal"
|
||||
@input="value => handleStandardNumberInput('creditLimitLower', value, 2)"
|
||||
/>
|
||||
<span>至</span>
|
||||
<el-input
|
||||
v-model="standardForm.creditLimitUpper"
|
||||
inputmode="decimal"
|
||||
@input="value => handleStandardNumberInput('creditLimitUpper', value, 2)"
|
||||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -383,14 +368,8 @@ import {
|
||||
publish,
|
||||
changeStatus,
|
||||
} from '@/api/vehicle/credit-score-quantification';
|
||||
import { exportBlob } from '@/api/common';
|
||||
import { downloadXls } from '@/utils/util';
|
||||
import { openImportDialog } from '@/utils/import-excel';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { normalizeSearchRangeParams } from '@/utils/search-range';
|
||||
import { mapGetters } from 'vuex';
|
||||
import NProgress from 'nprogress';
|
||||
import 'nprogress/nprogress.css';
|
||||
|
||||
const createTimeRangeMap = {
|
||||
createTimeRange: ['createTimeStart', 'createTimeEnd'],
|
||||
@@ -413,9 +392,7 @@ export default {
|
||||
categoryBox: false,
|
||||
itemBox: false,
|
||||
standardBox: false,
|
||||
excelBox: false,
|
||||
readonly: false,
|
||||
excelForm: {},
|
||||
configForm: this.emptyConfig(),
|
||||
currentCategory: { items: [] },
|
||||
currentItemIndex: -1,
|
||||
@@ -455,7 +432,7 @@ export default {
|
||||
menuWidth: 160,
|
||||
column: [
|
||||
{
|
||||
label: '评定表名称',
|
||||
label: '评分表名称',
|
||||
prop: 'name',
|
||||
slot: true,
|
||||
minWidth: 180,
|
||||
@@ -464,23 +441,10 @@ export default {
|
||||
rules: [{ required: true, message: '请输入评定表名称', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
minWidth: 260,
|
||||
overHidden: true,
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'status',
|
||||
type: 'select',
|
||||
search: true,
|
||||
slot: true,
|
||||
dataType: 'number',
|
||||
dicData: [
|
||||
{ label: '正常', value: 1 },
|
||||
{ label: '停用', value: 2 },
|
||||
{ label: '草稿', value: 3 },
|
||||
],
|
||||
label: '创建人',
|
||||
prop: 'createUserName',
|
||||
minWidth: 120,
|
||||
display: false,
|
||||
},
|
||||
{
|
||||
label: '创建时间',
|
||||
@@ -489,6 +453,22 @@ export default {
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
minWidth: 160,
|
||||
display: false,
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'status',
|
||||
type: 'select',
|
||||
search: true,
|
||||
slot: true,
|
||||
dataType: 'number',
|
||||
searchValue: '',
|
||||
dicData: [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '正常', value: 1 },
|
||||
{ label: '停用', value: 2 },
|
||||
],
|
||||
clearable: true,
|
||||
},
|
||||
{
|
||||
label: '创建时间',
|
||||
@@ -502,33 +482,6 @@ export default {
|
||||
},
|
||||
],
|
||||
},
|
||||
excelOption: {
|
||||
labelPosition: 'right',
|
||||
submitBtn: false,
|
||||
emptyBtn: false,
|
||||
column: [
|
||||
{
|
||||
label: '模板上传',
|
||||
prop: 'excelFile',
|
||||
type: 'upload',
|
||||
drag: true,
|
||||
loadText: '模板上传中,请稍等',
|
||||
span: 24,
|
||||
propsHttp: {
|
||||
res: 'data',
|
||||
},
|
||||
tip: '请上传 .xls,.xlsx 标准格式文件',
|
||||
action:
|
||||
'/blade-transport/credit-score-quantification/import-credit-score-quantification',
|
||||
},
|
||||
{
|
||||
label: '模板下载',
|
||||
prop: 'excelTemplate',
|
||||
formslot: true,
|
||||
span: 24,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -723,6 +676,18 @@ export default {
|
||||
this.standardForm.creditLevel = '';
|
||||
}
|
||||
},
|
||||
handleStandardNumberInput(field, value, precision = 0, max) {
|
||||
let normalized = String(value || '').replace(precision > 0 ? /[^\d.]/g : /\D/g, '');
|
||||
if (precision > 0) {
|
||||
const [integer = '', ...decimalParts] = normalized.split('.');
|
||||
const decimal = decimalParts.join('').slice(0, precision);
|
||||
normalized = decimalParts.length ? `${integer}.${decimal}` : integer;
|
||||
}
|
||||
if (max !== undefined && normalized !== '' && Number(normalized) > max) {
|
||||
normalized = String(max);
|
||||
}
|
||||
this.standardForm[field] = normalized;
|
||||
},
|
||||
isValidCreditLevel(creditLevel) {
|
||||
return this.creditLevelOptions.some(item => item.value === String(creditLevel || '').trim());
|
||||
},
|
||||
@@ -764,6 +729,16 @@ export default {
|
||||
}
|
||||
const standard = JSON.parse(JSON.stringify(this.standardForm));
|
||||
standard.creditLevel = String(standard.creditLevel || '').trim();
|
||||
[
|
||||
'scoreRateLower',
|
||||
'scoreRateUpper',
|
||||
'scoreRateIncrease',
|
||||
'creditLimitLower',
|
||||
'creditLimitUpper',
|
||||
'creditLimitIncrease',
|
||||
].forEach(field => {
|
||||
standard[field] = Number(standard[field]);
|
||||
});
|
||||
const nextStandards = JSON.parse(JSON.stringify(this.configForm.standards));
|
||||
if (this.currentStandardIndex >= 0) {
|
||||
nextStandards.splice(this.currentStandardIndex, 1, standard);
|
||||
@@ -786,7 +761,13 @@ export default {
|
||||
this.standardBox = false;
|
||||
},
|
||||
removeStandard(index) {
|
||||
this.$confirm('确定删除该评估标准?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
this.configForm.standards.splice(index, 1);
|
||||
});
|
||||
},
|
||||
isBlankValue(value) {
|
||||
return value === undefined || value === null || value === '';
|
||||
@@ -947,7 +928,7 @@ export default {
|
||||
this.$message.warning('请选择至少一条数据');
|
||||
return;
|
||||
}
|
||||
this.$confirm('仅草稿状态量表可删除,确定删除所选数据?', {
|
||||
this.$confirm('确定删除所选评分量化表?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
@@ -1024,49 +1005,9 @@ export default {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleImport() {
|
||||
openImportDialog(this, '评分量化表');
|
||||
},
|
||||
handleExport() {
|
||||
this.$confirm('是否导出评分量化表数据?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
NProgress.start();
|
||||
exportBlob(
|
||||
'/blade-transport/credit-score-quantification/export-credit-score-quantification',
|
||||
this.buildExportParams(),
|
||||
{ feedback: true }
|
||||
)
|
||||
.then(res => {
|
||||
downloadXls(res.data, `评分量化表${this.$dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`);
|
||||
})
|
||||
.finally(() => {
|
||||
NProgress.done();
|
||||
});
|
||||
});
|
||||
},
|
||||
buildExportParams() {
|
||||
return {
|
||||
...this.buildQuery(),
|
||||
ids: this.ids,
|
||||
[this.website.tokenHeader]: getToken(),
|
||||
};
|
||||
},
|
||||
buildQuery(params = {}) {
|
||||
return normalizeSearchRangeParams({ ...params, ...this.query }, createTimeRangeMap);
|
||||
},
|
||||
handleTemplate() {
|
||||
exportBlob(
|
||||
`/blade-transport/credit-score-quantification/export-template?${
|
||||
this.website.tokenHeader
|
||||
}=${getToken()}`,
|
||||
{ feedback: true }
|
||||
).then(res => {
|
||||
downloadXls(res.data, '评分量化表模板.xlsx');
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -1074,6 +1015,10 @@ export default {
|
||||
<style lang="scss" scoped>
|
||||
.score-config {
|
||||
padding: 4px 12px 12px;
|
||||
|
||||
&__name-input {
|
||||
width: min(420px, 100%);
|
||||
}
|
||||
}
|
||||
|
||||
.base-form {
|
||||
@@ -1111,10 +1056,14 @@ export default {
|
||||
.category-line {
|
||||
margin: 0 0 24px;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
font-weight: 400;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
:deep(.category-dialog .el-dialog__title) {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.score-item-form {
|
||||
width: 100%;
|
||||
max-width: 1400px;
|
||||
@@ -1220,6 +1169,17 @@ export default {
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.standard-range-input {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
|
||||
:deep(.el-input) {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
min-width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.score-unit {
|
||||
margin-left: 8px;
|
||||
color: #606266;
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
plain
|
||||
v-if="hasPermission('customer_archive_add')"
|
||||
@click="openArchive()"
|
||||
>新增
|
||||
@@ -87,6 +86,16 @@
|
||||
>
|
||||
提交
|
||||
</el-link>
|
||||
<el-link
|
||||
type="warning"
|
||||
v-if="
|
||||
hasPermission('customer_archive_submit') &&
|
||||
['draft', 'reviewing'].includes(row.approvalStatus)
|
||||
"
|
||||
@click="handleWithdrawApproval(row)"
|
||||
>
|
||||
撤回
|
||||
</el-link>
|
||||
<el-link
|
||||
type="success"
|
||||
v-if="hasPermission('customer_archive_approve') && row.approvalStatus === 'reviewing'"
|
||||
@@ -142,16 +151,23 @@
|
||||
:disabled="readonly"
|
||||
class="archive-form"
|
||||
>
|
||||
<section-card title="工商信息">
|
||||
<div class="section-title dialog-section-title">基本信息</div>
|
||||
<div class="archive-form__group">
|
||||
<div class="dialog-section-title archive-form__group-title">工商信息</div>
|
||||
<el-row :gutter="18">
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="客商编号" prop="customerCode">
|
||||
<el-input v-model="archiveForm.customerCode" disabled placeholder="保存后自动生成" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="客商性质" prop="customerNature">
|
||||
<el-select v-model="archiveForm.customerNature" filterable clearable>
|
||||
<el-select
|
||||
v-model="archiveForm.customerNature"
|
||||
placeholder="请输入"
|
||||
filterable
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in customerNatureOptions"
|
||||
:key="item.value"
|
||||
@@ -161,10 +177,11 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="统一社会信用代码" prop="unifiedCreditCode">
|
||||
<el-input
|
||||
v-model="archiveForm.unifiedCreditCode"
|
||||
placeholder="请输入"
|
||||
maxlength="18"
|
||||
show-word-limit
|
||||
@input="
|
||||
@@ -175,14 +192,25 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="客商名称" prop="fullName">
|
||||
<el-input v-model="archiveForm.fullName" maxlength="100" show-word-limit />
|
||||
<el-input
|
||||
v-model="archiveForm.fullName"
|
||||
placeholder="请输入"
|
||||
maxlength="100"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="客商类型" prop="customerType">
|
||||
<el-select v-model="archiveForm.customerType" filterable clearable>
|
||||
<el-select
|
||||
v-model="archiveForm.customerType"
|
||||
multiple
|
||||
placeholder="请选择"
|
||||
filterable
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in customerTypeOptions"
|
||||
:key="item.value"
|
||||
@@ -192,13 +220,13 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="企业法人" prop="legalPerson">
|
||||
<el-input v-model="archiveForm.legalPerson" maxlength="10" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="经营范围" prop="businessScope">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="经营范围" prop="businessScope" required>
|
||||
<el-select v-model="archiveForm.businessScope" multiple filterable clearable>
|
||||
<el-option
|
||||
v-for="item in businessScopeOptions"
|
||||
@@ -209,8 +237,12 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="营业期限" prop="businessEndDate" required>
|
||||
<el-col :span="6">
|
||||
<el-form-item
|
||||
label="营业期限"
|
||||
prop="businessEndDate"
|
||||
:required="archiveForm.businessTermType === '固定期限'"
|
||||
>
|
||||
<div class="business-term-field">
|
||||
<el-date-picker
|
||||
v-model="archiveForm.businessEndDate"
|
||||
@@ -228,18 +260,23 @@
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="助记码" prop="mnemonicCode">
|
||||
<el-input v-model="archiveForm.mnemonicCode" maxlength="15" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="客户简称" prop="shortName">
|
||||
<el-input v-model="archiveForm.shortName" maxlength="20" show-word-limit />
|
||||
<el-input
|
||||
v-model="archiveForm.shortName"
|
||||
placeholder="请输入"
|
||||
maxlength="20"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="地址" prop="registeredDetailAddress">
|
||||
<el-form-item label="地址" prop="registeredDetailAddress" required>
|
||||
<div class="archive-form__address">
|
||||
<el-cascader
|
||||
ref="registeredRegionCascader"
|
||||
@@ -260,9 +297,10 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</section-card>
|
||||
</div>
|
||||
|
||||
<section-card title="联系信息">
|
||||
<div class="archive-form__group">
|
||||
<div class="dialog-section-title archive-form__group-title">联系信息</div>
|
||||
<el-row :gutter="18">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="客商负责人" prop="principal">
|
||||
@@ -291,11 +329,12 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</section-card>
|
||||
</div>
|
||||
|
||||
<section-card title="财务/信用信息">
|
||||
<div class="archive-form__group">
|
||||
<div class="dialog-section-title archive-form__group-title">财务/信用信息</div>
|
||||
<el-row :gutter="18">
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="注册资金(万元)" prop="registeredCapital">
|
||||
<el-input
|
||||
v-model="archiveForm.registeredCapital"
|
||||
@@ -304,7 +343,7 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="开票税点" prop="invoiceTaxRate">
|
||||
<el-input
|
||||
v-model="archiveForm.invoiceTaxRate"
|
||||
@@ -313,12 +352,12 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="客户等级" prop="customerLevel">
|
||||
<el-input v-model="archiveForm.customerLevel" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="最大资金使用额度(万元)" prop="maxCreditLimit">
|
||||
<el-input
|
||||
v-model="archiveForm.maxCreditLimit"
|
||||
@@ -328,19 +367,20 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="申请总资金使用额度(万元)" prop="applyCreditLimit">
|
||||
<el-input
|
||||
v-model="archiveForm.applyCreditLimit"
|
||||
maxlength="18"
|
||||
@input="value => handleDecimalInput('applyCreditLimit', value)"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</section-card>
|
||||
</div>
|
||||
|
||||
<section-card title="其他信息">
|
||||
<div class="archive-form__group">
|
||||
<div class="dialog-section-title archive-form__group-title">其他信息</div>
|
||||
<el-row :gutter="18">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
@@ -353,7 +393,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</section-card>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<el-tabs v-model="activeTab" class="archive-tabs">
|
||||
@@ -538,8 +578,9 @@
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<section-card title="客商材料">
|
||||
<template #extra>
|
||||
<div class="customer-material-section">
|
||||
<div class="section-head">
|
||||
<div class="section-title dialog-section-title">客商材料</div>
|
||||
<div v-if="!readonly" class="section-actions">
|
||||
<el-button icon="el-icon-download" @click="downloadAttachments">批量下载</el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addAttachment"
|
||||
@@ -549,11 +590,11 @@
|
||||
OCR上传识别
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<el-alert
|
||||
type="info"
|
||||
:closable="false"
|
||||
title="支持 JPG、PNG、PDF、Word、Excel、PPT,单文件大小不超过 10MB。"
|
||||
title="支持pdf、bmp、jpeg、png、jpg、doc、docx、ppt、pptx、xlsx、xls、eml、msg、zip的文件格式,单个文件大小限制500M"
|
||||
class="archive-rule-alert"
|
||||
/>
|
||||
<el-alert
|
||||
@@ -580,8 +621,8 @@
|
||||
v-model="row.files"
|
||||
:readonly="readonly"
|
||||
:multiple="false"
|
||||
accept=".jpg,.jpeg,.png,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx"
|
||||
:max-size="10"
|
||||
accept=".pdf,.bmp,.jpeg,.png,.jpg,.doc,.docx,.ppt,.pptx,.xlsx,.xls,.eml,.msg,.zip"
|
||||
:max-size="500"
|
||||
button-text="上传文件"
|
||||
:show-tip="false"
|
||||
@success="file => handleQualificationUploadSuccess(file, row)"
|
||||
@@ -616,16 +657,17 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</section-card>
|
||||
</div>
|
||||
|
||||
<section-card title="变更记录">
|
||||
<div class="change-record-section">
|
||||
<div class="section-title dialog-section-title">变更记录</div>
|
||||
<el-table :data="archiveForm.changeRecords" border>
|
||||
<el-table-column label="序号" type="index" width="90" align="center" />
|
||||
<el-table-column label="变更日期" prop="changeTime" min-width="170" />
|
||||
<el-table-column label="变更内容" prop="changeContent" min-width="260" />
|
||||
<el-table-column label="变更账号" prop="changeUserName" min-width="160" />
|
||||
</el-table>
|
||||
</section-card>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="archiveBox = false">{{ readonly ? '关闭' : '取消' }}</el-button>
|
||||
@@ -651,13 +693,13 @@
|
||||
label-width="110px"
|
||||
class="contact-form"
|
||||
>
|
||||
<el-form-item label="联系人姓名" prop="contactName">
|
||||
<el-form-item label="联系人姓名" prop="contactName" class="contact-form__compact-field">
|
||||
<el-input v-model="contactForm.contactName" maxlength="30" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="contactPhone">
|
||||
<el-form-item label="手机号" prop="contactPhone" class="contact-form__compact-field">
|
||||
<el-input v-model="contactForm.contactPhone" maxlength="11" />
|
||||
</el-form-item>
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-form-item label="邮箱" prop="email" class="contact-form__compact-field">
|
||||
<el-input v-model="contactForm.email" maxlength="100" />
|
||||
</el-form-item>
|
||||
<el-form-item label="地址" prop="detailAddress">
|
||||
@@ -678,13 +720,15 @@
|
||||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-form-item label="备注" prop="remark" class="contact-form__compact-field">
|
||||
<el-input v-model="contactForm.remark" maxlength="200" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="contact-dialog__footer-actions">
|
||||
<el-button type="primary" @click="saveContact">保存</el-button>
|
||||
<el-button @click="contactBox = false">返回</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
@@ -771,8 +815,10 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="receipt-dialog__footer-actions">
|
||||
<el-button type="primary" @click="saveReceipt">保存</el-button>
|
||||
<el-button @click="receiptBox = false">返回</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
@@ -802,7 +848,6 @@
|
||||
<el-input v-model="invoiceForm.registeredPhone" maxlength="20" />
|
||||
</el-form-item>
|
||||
<el-form-item label="注册地址" prop="registeredRegionName">
|
||||
<div class="invoice-form__address">
|
||||
<el-input
|
||||
v-model="invoiceForm.registeredRegionName"
|
||||
readonly
|
||||
@@ -811,6 +856,8 @@
|
||||
suffix-icon="el-icon-location"
|
||||
@click="handleInvoiceRegisteredMapPick"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="详细地址" prop="registeredDetailAddress">
|
||||
<el-input
|
||||
v-model="invoiceForm.registeredDetailAddress"
|
||||
readonly
|
||||
@@ -819,7 +866,6 @@
|
||||
suffix-icon="el-icon-location"
|
||||
@click="handleInvoiceRegisteredMapPick"
|
||||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -873,8 +919,10 @@
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="invoice-dialog__footer-actions">
|
||||
<el-button type="primary" @click="saveInvoice">保存</el-button>
|
||||
<el-button @click="invoiceBox = false">返回</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
@@ -1090,7 +1138,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120" align="center" v-if="!readonly">
|
||||
<template #default="{ $index }">
|
||||
<el-link type="primary" @click="scoreAttachmentFiles.splice($index, 1)">
|
||||
<el-link type="primary" @click="deleteScoreAttachment($index)">
|
||||
删除
|
||||
</el-link>
|
||||
</template>
|
||||
@@ -1113,6 +1161,7 @@ import {
|
||||
getDetail,
|
||||
submit,
|
||||
submitApproval,
|
||||
withdrawApproval,
|
||||
approve,
|
||||
reject,
|
||||
changeStatus,
|
||||
@@ -1180,11 +1229,11 @@ export default {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
const validateInvoiceRegisteredAddress = (rule, value, callback) => {
|
||||
const regionName = (this.invoiceForm.registeredRegionName || '').trim();
|
||||
const detailAddress = (this.invoiceForm.registeredDetailAddress || '').trim();
|
||||
const validateRegisteredAddress = (rule, value, callback) => {
|
||||
const regionName = (this.archiveForm.registeredRegionName || '').trim();
|
||||
const detailAddress = String(value || '').trim();
|
||||
if (!regionName) {
|
||||
callback(new Error('请选择注册地址'));
|
||||
callback(new Error('请选择省市区'));
|
||||
} else if (!detailAddress) {
|
||||
callback(new Error('请输入详细地址'));
|
||||
} else if (detailAddress.length > 255) {
|
||||
@@ -1196,6 +1245,7 @@ export default {
|
||||
return {
|
||||
form: {},
|
||||
query: {},
|
||||
deptSearchInitialized: false,
|
||||
loading: true,
|
||||
data: [],
|
||||
page: {
|
||||
@@ -1305,8 +1355,18 @@ export default {
|
||||
maxCreditLimit: [{ validator: validateNonNegative, trigger: 'blur' }],
|
||||
applyCreditLimit: [{ validator: validateNonNegative, trigger: 'blur' }],
|
||||
businessEndDate: [{ validator: validateBusinessEndDate, trigger: 'change' }],
|
||||
registeredDetailAddress: [{ max: 255, message: '详细地址最多255个字符', trigger: 'blur' }],
|
||||
businessScope: [{ type: 'array', message: '请选择经营范围', trigger: 'change' }],
|
||||
registeredDetailAddress: [
|
||||
{ validator: validateRegisteredAddress, trigger: ['change', 'blur'] },
|
||||
],
|
||||
businessScope: [
|
||||
{
|
||||
required: true,
|
||||
type: 'array',
|
||||
min: 1,
|
||||
message: '请选择经营范围',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
remark: [{ max: 500, message: '备注最多500个字符', trigger: 'blur' }],
|
||||
},
|
||||
contactRules: {
|
||||
@@ -1332,7 +1392,11 @@ export default {
|
||||
registeredPhone: [{ required: true, message: '请输入注册电话', trigger: 'blur' }],
|
||||
bankName: [{ required: true, message: '请输入开户行名称', trigger: 'blur' }],
|
||||
registeredRegionName: [
|
||||
{ required: true, validator: validateInvoiceRegisteredAddress, trigger: 'blur' },
|
||||
{ required: true, message: '请选择注册地址', trigger: 'blur' },
|
||||
],
|
||||
registeredDetailAddress: [
|
||||
{ required: true, message: '请输入详细地址', trigger: 'blur' },
|
||||
{ max: 255, message: '详细地址最多255个字符', trigger: 'blur' },
|
||||
],
|
||||
bankAccount: [{ required: true, message: '请输入银行账号', trigger: 'blur' }],
|
||||
receiverDetailAddress: [
|
||||
@@ -1369,6 +1433,7 @@ export default {
|
||||
slot: true,
|
||||
search: true,
|
||||
searchOrder: 10,
|
||||
searchPlaceholder: '请输入',
|
||||
minWidth: 140,
|
||||
},
|
||||
{
|
||||
@@ -1376,6 +1441,7 @@ export default {
|
||||
prop: 'shortName',
|
||||
search: true,
|
||||
searchOrder: 2,
|
||||
searchPlaceholder: '请输入',
|
||||
minWidth: 150,
|
||||
},
|
||||
{
|
||||
@@ -1383,6 +1449,7 @@ export default {
|
||||
prop: 'fullName',
|
||||
search: true,
|
||||
searchOrder: 9,
|
||||
searchPlaceholder: '请输入',
|
||||
minWidth: 220,
|
||||
overHidden: true,
|
||||
},
|
||||
@@ -1392,8 +1459,10 @@ export default {
|
||||
search: true,
|
||||
searchType: 'select',
|
||||
searchOrder: 7,
|
||||
searchValue: '',
|
||||
searchPlaceholder: '请输入',
|
||||
minWidth: 140,
|
||||
dicData: this.customerTypeOptions,
|
||||
dicData: [{ label: '全部', value: '' }],
|
||||
},
|
||||
{
|
||||
label: '客户性质',
|
||||
@@ -1401,8 +1470,11 @@ export default {
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 5,
|
||||
searchValue: '',
|
||||
searchPlaceholder: '请输入',
|
||||
minWidth: 120,
|
||||
dicData: [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '有限公司', value: '有限公司' },
|
||||
{ label: '个体工商户', value: '个体工商户' },
|
||||
],
|
||||
@@ -1412,6 +1484,7 @@ export default {
|
||||
prop: 'unifiedCreditCode',
|
||||
search: true,
|
||||
searchOrder: 3,
|
||||
searchPlaceholder: '请输入',
|
||||
minWidth: 190,
|
||||
},
|
||||
{
|
||||
@@ -1420,8 +1493,9 @@ export default {
|
||||
search: true,
|
||||
searchType: 'select',
|
||||
searchOrder: 1,
|
||||
searchValue: '',
|
||||
minWidth: 180,
|
||||
dicData: [],
|
||||
dicData: [{ label: '全部', value: '' }],
|
||||
},
|
||||
{
|
||||
label: '准入标准',
|
||||
@@ -1432,8 +1506,8 @@ export default {
|
||||
searchOrder: 8,
|
||||
minWidth: 120,
|
||||
dicData: [
|
||||
{ label: '临时客商', value: 'temporary' },
|
||||
{ label: '正式客商', value: 'formal' },
|
||||
{ label: '临时', value: 'temporary' },
|
||||
{ label: '正式', value: 'formal' },
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -1443,8 +1517,10 @@ export default {
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 4,
|
||||
searchValue: '',
|
||||
minWidth: 130,
|
||||
dicData: [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '草稿', value: 'draft' },
|
||||
{ label: '审核中', value: 'reviewing' },
|
||||
{ label: '审核通过', value: 'approved' },
|
||||
@@ -1468,9 +1544,11 @@ export default {
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 6,
|
||||
searchValue: '',
|
||||
dataType: 'number',
|
||||
minWidth: 100,
|
||||
dicData: [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '启用', value: 1 },
|
||||
{ label: '停用', value: 2 },
|
||||
],
|
||||
@@ -1618,7 +1696,7 @@ export default {
|
||||
deptId: [],
|
||||
deptIds: '',
|
||||
deptName: '',
|
||||
customerType: '',
|
||||
customerType: [],
|
||||
businessScope: [],
|
||||
businessTermType: '固定期限',
|
||||
registeredRegionPath: [],
|
||||
@@ -1736,16 +1814,39 @@ export default {
|
||||
};
|
||||
},
|
||||
initDeptTree() {
|
||||
getDeptTree(this.userInfo.tenantId).then(res => {
|
||||
getDeptTree(this.userInfo.tenantId)
|
||||
.then(res => {
|
||||
this.deptTree = this.normalizeDeptTree(res.data.data || []);
|
||||
this.deptOptions = this.flattenDept(this.deptTree);
|
||||
const deptColumn = this.findColumn(this.option.column, 'deptName');
|
||||
deptColumn.dicData = this.deptOptions.map(item => ({
|
||||
deptColumn.dicData = [
|
||||
{ label: '全部', value: '' },
|
||||
...this.deptOptions.map(item => ({
|
||||
label: item.label,
|
||||
value: item.rawLabel,
|
||||
}));
|
||||
})),
|
||||
];
|
||||
this.applyDefaultDeptSearch(deptColumn);
|
||||
})
|
||||
.finally(() => {
|
||||
this.deptSearchInitialized = true;
|
||||
this.$nextTick(() => this.onLoad(this.page, this.query));
|
||||
});
|
||||
},
|
||||
applyDefaultDeptSearch(deptColumn) {
|
||||
if (this.isAdmin) return;
|
||||
const currentDeptId = this.userInfo.deptId || this.userInfo.dept_id;
|
||||
const currentDept = this.deptOptions.find(
|
||||
item => String(item.value) === String(currentDeptId)
|
||||
);
|
||||
const deptName = currentDept?.rawLabel || this.userInfo.deptName || this.userInfo.dept_name;
|
||||
if (!deptName) return;
|
||||
deptColumn.searchValue = deptName;
|
||||
this.query = { ...this.query, deptName };
|
||||
if (this.$refs.crud?.searchForm) {
|
||||
this.$refs.crud.searchForm.deptName = deptName;
|
||||
}
|
||||
},
|
||||
initRegionOptions() {
|
||||
getLazyTree().then(res => {
|
||||
const regions = this.buildRegionTree(res.data.data || []);
|
||||
@@ -1827,10 +1928,12 @@ export default {
|
||||
handleRegisteredRegionChange(value) {
|
||||
if (!value || !value.length) {
|
||||
this.archiveForm.registeredRegionName = '';
|
||||
this.$refs.archiveForm?.validateField('registeredDetailAddress');
|
||||
return;
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.archiveForm.registeredRegionName = this.getRegisteredRegionLabels(value).join('');
|
||||
this.$refs.archiveForm?.validateField('registeredDetailAddress');
|
||||
});
|
||||
},
|
||||
initBusinessDictionaries() {
|
||||
@@ -1840,12 +1943,12 @@ export default {
|
||||
['有限公司', '个体工商户'],
|
||||
options => {
|
||||
const customerNatureColumn = this.findColumn(this.option.column, 'customerNature');
|
||||
customerNatureColumn.dicData = options;
|
||||
customerNatureColumn.dicData = [{ label: '全部', value: '' }, ...options];
|
||||
}
|
||||
);
|
||||
this.loadDictOptions('customer_type', 'customerTypeOptions', ['客户', '承运商'], options => {
|
||||
const customerTypeColumn = this.findColumn(this.option.column, 'customerType');
|
||||
customerTypeColumn.dicData = options;
|
||||
customerTypeColumn.dicData = [{ label: '全部', value: '' }, ...options];
|
||||
});
|
||||
this.loadDictOptions('scope_of_business', 'businessScopeOptions');
|
||||
this.loadDictOptions('bank_list', 'bankListOptions');
|
||||
@@ -1922,7 +2025,12 @@ export default {
|
||||
if (checked) {
|
||||
this.archiveForm.businessEndDate = '';
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs.archiveForm?.clearValidate('businessEndDate');
|
||||
if (!checked) {
|
||||
this.$refs.archiveForm?.validateField('businessEndDate');
|
||||
}
|
||||
});
|
||||
},
|
||||
handleBusinessEndDateChange(value) {
|
||||
if (value) {
|
||||
@@ -2033,8 +2141,16 @@ export default {
|
||||
});
|
||||
},
|
||||
deleteContact(index) {
|
||||
this.$confirm('确定删除该联系人?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
this.archiveForm.contacts.splice(index, 1);
|
||||
this.handleDetailCurrentChange('contact', this.contactPage.currentPage);
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
handleContactMapPick() {
|
||||
this.contactMapTarget = 'contact';
|
||||
@@ -2361,8 +2477,16 @@ export default {
|
||||
});
|
||||
},
|
||||
deleteReceipt(index) {
|
||||
this.$confirm('确定删除该收款信息?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
this.archiveForm.receiptAccounts.splice(index, 1);
|
||||
this.handleDetailCurrentChange('receipt', this.receiptPage.currentPage);
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
normalizeInvoice(invoice = {}) {
|
||||
const registeredDetailAddress =
|
||||
@@ -2416,8 +2540,27 @@ export default {
|
||||
});
|
||||
},
|
||||
deleteInvoice(index) {
|
||||
this.$confirm('确定删除该发票信息?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
this.archiveForm.invoices.splice(index, 1);
|
||||
this.handleDetailCurrentChange('invoice', this.invoicePage.currentPage);
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
deleteScoreAttachment(index) {
|
||||
this.$confirm('确定删除该评分证明材料?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
this.scoreAttachmentFiles.splice(index, 1);
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
parseAttachments(value) {
|
||||
if (!value) return [];
|
||||
@@ -2502,7 +2645,9 @@ export default {
|
||||
...this.emptyArchive(),
|
||||
...detail,
|
||||
deptId: this.normalizeDeptIds(detail),
|
||||
customerType: detail.customerType || '',
|
||||
customerType: this.splitValue(detail.customerType),
|
||||
invoiceTaxRate: this.normalizeOptionalAmount(detail.invoiceTaxRate),
|
||||
registeredCapital: this.normalizeOptionalAmount(detail.registeredCapital),
|
||||
businessScope,
|
||||
businessTermType: detail.businessTermType || '固定期限',
|
||||
registeredRegionPath: Array.isArray(detail.registeredRegionPath)
|
||||
@@ -2541,10 +2686,15 @@ export default {
|
||||
attachments: [],
|
||||
details: [],
|
||||
...score,
|
||||
tempApplyCreditLimit: this.normalizeOptionalAmount(score.tempApplyCreditLimit),
|
||||
attachments: score.attachments || this.parseAttachments(score.proofAttachments),
|
||||
details: score.details || [],
|
||||
};
|
||||
},
|
||||
normalizeOptionalAmount(value) {
|
||||
const amount = Number(value);
|
||||
return Number.isFinite(amount) && amount < 0 ? '' : value ?? '';
|
||||
},
|
||||
getScoreTimeValue(value) {
|
||||
if (!value) return 0;
|
||||
const time = this.$dayjs(value).valueOf();
|
||||
@@ -2571,6 +2721,7 @@ export default {
|
||||
const latestScore = this.getLatestCreditScore(archive.scores || []);
|
||||
archive.customerLevel = latestScore?.creditLevel || archive.customerLevel || '';
|
||||
archive.maxCreditLimit = latestScore?.maxCreditLimit || archive.maxCreditLimit || '';
|
||||
archive.applyCreditLimit = archive.maxCreditLimit;
|
||||
return archive;
|
||||
},
|
||||
syncArchiveCreditFromScores() {
|
||||
@@ -2629,6 +2780,13 @@ export default {
|
||||
},
|
||||
normalizeArchive() {
|
||||
const archive = JSON.parse(JSON.stringify(this.archiveForm));
|
||||
if (archive.businessTermType === '长期') {
|
||||
archive.businessEndDate = null;
|
||||
}
|
||||
const invoiceTaxRate = this.normalizeOptionalAmount(archive.invoiceTaxRate);
|
||||
const registeredCapital = this.normalizeOptionalAmount(archive.registeredCapital);
|
||||
archive.invoiceTaxRate = invoiceTaxRate === '' ? null : invoiceTaxRate;
|
||||
archive.registeredCapital = registeredCapital === '' ? null : registeredCapital;
|
||||
archive.customerType = Array.isArray(archive.customerType)
|
||||
? archive.customerType.join(',')
|
||||
: archive.customerType;
|
||||
@@ -3165,6 +3323,18 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
handleWithdrawApproval(row) {
|
||||
this.$confirm('是否确认撤回该客商审批?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => withdrawApproval(row.id))
|
||||
.then(() => {
|
||||
this.onLoad(this.page);
|
||||
this.$message({ type: 'success', message: '已撤回至草稿状态!' });
|
||||
});
|
||||
},
|
||||
handleApprove(row) {
|
||||
this.$confirm('是否确认审核通过?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
@@ -3204,7 +3374,7 @@ export default {
|
||||
});
|
||||
},
|
||||
searchReset() {
|
||||
this.query = {};
|
||||
this.query = this.isAdmin ? {} : { deptName: this.getCurrentDeptName() };
|
||||
this.onLoad(this.page);
|
||||
},
|
||||
searchChange(params, done) {
|
||||
@@ -3230,6 +3400,7 @@ export default {
|
||||
this.onLoad(this.page, this.query);
|
||||
},
|
||||
onLoad(page, params = {}) {
|
||||
if (!this.deptSearchInitialized) return;
|
||||
this.loading = true;
|
||||
getList(page.currentPage, page.pageSize, this.buildQuery(params))
|
||||
.then(res => {
|
||||
@@ -3272,6 +3443,13 @@ export default {
|
||||
buildQuery(params = {}) {
|
||||
return normalizeSearchRangeParams({ ...params, ...this.query }, createTimeRangeMap);
|
||||
},
|
||||
getCurrentDeptName() {
|
||||
const currentDeptId = this.userInfo.deptId || this.userInfo.dept_id;
|
||||
const currentDept = this.deptOptions.find(
|
||||
item => String(item.value) === String(currentDeptId)
|
||||
);
|
||||
return currentDept?.rawLabel || this.userInfo.deptName || this.userInfo.dept_name || '';
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -3293,6 +3471,28 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.archive-form__group {
|
||||
padding: 16px 20px;
|
||||
margin-bottom: 16px;
|
||||
background-color: #f0f2f5;
|
||||
border-radius: 8px;
|
||||
|
||||
.dialog-section-title {
|
||||
margin: 0 0 12px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
// 内层白色卡片:字段区域白底,浮于灰色分组块之上
|
||||
> .el-row {
|
||||
margin: 0;
|
||||
padding: 18px 16px 4px;
|
||||
background-color: #fff;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
}
|
||||
|
||||
.business-term-field,
|
||||
.archive-form__address {
|
||||
@@ -3326,11 +3526,22 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.section-title {
|
||||
margin: 16px 0 12px;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.section-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin: 18px 0 12px;
|
||||
|
||||
.section-title {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.section-actions {
|
||||
@@ -3470,6 +3681,13 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.customer-material-section {
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
.change-record-section {
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
.score-list-table,
|
||||
.contact-table,
|
||||
@@ -3532,6 +3750,37 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.contact-form__compact-field {
|
||||
:deep(.el-input) {
|
||||
width: 60%;
|
||||
}
|
||||
}
|
||||
|
||||
.contact-dialog__footer-actions {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.receipt-form {
|
||||
:deep(.el-input),
|
||||
:deep(.el-select) {
|
||||
width: 60%;
|
||||
}
|
||||
}
|
||||
|
||||
.receipt-dialog__footer-actions {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.invoice-dialog__footer-actions {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.contact-form__map-toolbar {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
|
||||
Reference in New Issue
Block a user