Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -33,8 +33,6 @@ export const createOption = () => ({
|
|||||||
{
|
{
|
||||||
label: '地址名称',
|
label: '地址名称',
|
||||||
prop: 'addressName',
|
prop: 'addressName',
|
||||||
search: true,
|
|
||||||
searchOrder: 8,
|
|
||||||
span: 24,
|
span: 24,
|
||||||
minWidth: 150,
|
minWidth: 150,
|
||||||
showOverflowTooltip: true,
|
showOverflowTooltip: true,
|
||||||
@@ -58,8 +56,6 @@ export const createOption = () => ({
|
|||||||
prop: 'addressType',
|
prop: 'addressType',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
formslot: true,
|
formslot: true,
|
||||||
search: true,
|
|
||||||
searchOrder: 7,
|
|
||||||
span: 24,
|
span: 24,
|
||||||
minWidth: 140,
|
minWidth: 140,
|
||||||
dicData: addressTypeOptions,
|
dicData: addressTypeOptions,
|
||||||
@@ -76,8 +72,6 @@ export const createOption = () => ({
|
|||||||
{
|
{
|
||||||
label: '详细地址',
|
label: '详细地址',
|
||||||
prop: 'detailAddress',
|
prop: 'detailAddress',
|
||||||
search: true,
|
|
||||||
searchOrder: 5,
|
|
||||||
formslot: true,
|
formslot: true,
|
||||||
type: 'textarea',
|
type: 'textarea',
|
||||||
minRows: 3,
|
minRows: 3,
|
||||||
@@ -108,8 +102,6 @@ export const createOption = () => ({
|
|||||||
{
|
{
|
||||||
label: '行政区划',
|
label: '行政区划',
|
||||||
prop: 'regionName',
|
prop: 'regionName',
|
||||||
search: true,
|
|
||||||
searchOrder: 4,
|
|
||||||
display: false,
|
display: false,
|
||||||
minWidth: 150,
|
minWidth: 150,
|
||||||
rules: [{ required: true, message: '请选择行政区划', trigger: 'change' }],
|
rules: [{ required: true, message: '请选择行政区划', trigger: 'change' }],
|
||||||
@@ -117,8 +109,6 @@ export const createOption = () => ({
|
|||||||
{
|
{
|
||||||
label: '联系人',
|
label: '联系人',
|
||||||
prop: 'contactName',
|
prop: 'contactName',
|
||||||
search: true,
|
|
||||||
searchOrder: 2,
|
|
||||||
minWidth: 110,
|
minWidth: 110,
|
||||||
placeholder: '请输入',
|
placeholder: '请输入',
|
||||||
maxlength: 50,
|
maxlength: 50,
|
||||||
@@ -127,12 +117,14 @@ export const createOption = () => ({
|
|||||||
{
|
{
|
||||||
label: '联系方式',
|
label: '联系方式',
|
||||||
prop: 'contactPhone',
|
prop: 'contactPhone',
|
||||||
search: true,
|
|
||||||
searchOrder: 1,
|
|
||||||
minWidth: 130,
|
minWidth: 130,
|
||||||
placeholder: '请输入',
|
placeholder: '请输入',
|
||||||
maxlength: 20,
|
maxlength: 20,
|
||||||
rules: [{ max: 20, message: '联系方式不能超过20个字', trigger: 'blur' }],
|
formslot: true,
|
||||||
|
rules: [
|
||||||
|
{ max: 20, message: '联系方式不能超过20个字', trigger: 'blur' },
|
||||||
|
{ pattern: /^\d*$/, message: '联系方式只能输入数字', trigger: 'blur' },
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '组织',
|
label: '组织',
|
||||||
@@ -216,8 +208,6 @@ export const createOption = () => ({
|
|||||||
{
|
{
|
||||||
label: '站点编码',
|
label: '站点编码',
|
||||||
prop: 'siteCode',
|
prop: 'siteCode',
|
||||||
search: true,
|
|
||||||
searchOrder: 6,
|
|
||||||
hide: true,
|
hide: true,
|
||||||
addDisplay: false,
|
addDisplay: false,
|
||||||
editDisplay: false,
|
editDisplay: false,
|
||||||
@@ -226,11 +216,121 @@ export const createOption = () => ({
|
|||||||
label: '组织',
|
label: '组织',
|
||||||
prop: 'deptId',
|
prop: 'deptId',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
search: true,
|
|
||||||
searchOrder: 3,
|
|
||||||
hide: true,
|
hide: true,
|
||||||
display: false,
|
display: false,
|
||||||
dicData: [],
|
dicData: [],
|
||||||
},
|
},
|
||||||
|
// 搜索字段与表格、表单字段独立,避免筛选配置影响数据展示和编辑布局。
|
||||||
|
{
|
||||||
|
label: '地址名称',
|
||||||
|
prop: 'searchAddressName',
|
||||||
|
searchProp: 'addressName',
|
||||||
|
search: true,
|
||||||
|
searchOrder: 8,
|
||||||
|
searchPlaceholder: '请输入',
|
||||||
|
hide: true,
|
||||||
|
display: false,
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
|
viewDisplay: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '类型',
|
||||||
|
prop: 'searchAddressType',
|
||||||
|
searchProp: 'addressType',
|
||||||
|
type: 'select',
|
||||||
|
searchType: 'select',
|
||||||
|
search: true,
|
||||||
|
searchOrder: 7,
|
||||||
|
searchPlaceholder: '请选择',
|
||||||
|
dicData: addressTypeOptions,
|
||||||
|
hide: true,
|
||||||
|
display: false,
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
|
viewDisplay: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '详细地址',
|
||||||
|
prop: 'searchDetailAddress',
|
||||||
|
searchProp: 'detailAddress',
|
||||||
|
search: true,
|
||||||
|
searchOrder: 6,
|
||||||
|
searchPlaceholder: '请输入',
|
||||||
|
hide: true,
|
||||||
|
display: false,
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
|
viewDisplay: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '行政区划',
|
||||||
|
prop: 'searchRegionName',
|
||||||
|
searchProp: 'regionName',
|
||||||
|
search: true,
|
||||||
|
searchOrder: 5,
|
||||||
|
searchPlaceholder: '请输入',
|
||||||
|
hide: true,
|
||||||
|
display: false,
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
|
viewDisplay: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '站点编码',
|
||||||
|
prop: 'searchSiteCode',
|
||||||
|
searchProp: 'siteCode',
|
||||||
|
search: true,
|
||||||
|
searchOrder: 4,
|
||||||
|
searchPlaceholder: '请输入',
|
||||||
|
hide: true,
|
||||||
|
display: false,
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
|
viewDisplay: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '组织',
|
||||||
|
prop: 'searchDeptId',
|
||||||
|
searchProp: 'deptId',
|
||||||
|
type: 'select',
|
||||||
|
searchType: 'select',
|
||||||
|
search: true,
|
||||||
|
searchOrder: 3,
|
||||||
|
searchPlaceholder: '请选择',
|
||||||
|
dicData: [],
|
||||||
|
filterable: true,
|
||||||
|
hide: true,
|
||||||
|
display: false,
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
|
viewDisplay: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '联系人',
|
||||||
|
prop: 'searchContactName',
|
||||||
|
searchProp: 'contactName',
|
||||||
|
search: true,
|
||||||
|
searchOrder: 2,
|
||||||
|
searchPlaceholder: '请输入',
|
||||||
|
hide: true,
|
||||||
|
display: false,
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
|
viewDisplay: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '联系方式',
|
||||||
|
prop: 'searchContactPhone',
|
||||||
|
searchProp: 'contactPhone',
|
||||||
|
search: true,
|
||||||
|
searchOrder: 1,
|
||||||
|
searchPlaceholder: '请输入',
|
||||||
|
hide: true,
|
||||||
|
display: false,
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
|
viewDisplay: false,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ export const option = createCrudOption([
|
|||||||
display: false,
|
display: false,
|
||||||
addDisplay: false,
|
addDisplay: false,
|
||||||
editDisabled: true,
|
editDisabled: true,
|
||||||
|
minWidth: 180,
|
||||||
},
|
},
|
||||||
// 搜索字段与表格、表单字段独立,避免筛选配置影响数据展示和编辑布局。
|
// 搜索字段与表格、表单字段独立,避免筛选配置影响数据展示和编辑布局。
|
||||||
{
|
{
|
||||||
@@ -169,31 +170,20 @@ export const option = createCrudOption([
|
|||||||
viewDisplay: false,
|
viewDisplay: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '包装品牌',
|
label: '包装',
|
||||||
prop: 'packageBrand',
|
prop: 'packageType',
|
||||||
slot: true,
|
type: 'select',
|
||||||
minWidth: 150,
|
dicData: packageOptions,
|
||||||
addDisplay: false,
|
minWidth: 100,
|
||||||
editDisplay: false,
|
|
||||||
viewDisplay: false,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '品牌',
|
label: '品牌',
|
||||||
prop: 'brand',
|
prop: 'brand',
|
||||||
search: false,
|
search: false,
|
||||||
hide: true,
|
|
||||||
minWidth: 120,
|
minWidth: 120,
|
||||||
placeholder: '请输入',
|
placeholder: '请输入',
|
||||||
rules: textRule('品牌', 50),
|
rules: textRule('品牌', 50),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: '包装',
|
|
||||||
prop: 'packageType',
|
|
||||||
type: 'select',
|
|
||||||
dicData: packageOptions,
|
|
||||||
hide: true,
|
|
||||||
minWidth: 100,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: '规格',
|
label: '规格',
|
||||||
prop: 'specification',
|
prop: 'specification',
|
||||||
|
|||||||
@@ -12,8 +12,12 @@ export const config = {
|
|||||||
exportName: '发货模板',
|
exportName: '发货模板',
|
||||||
enableAllDept: false,
|
enableAllDept: false,
|
||||||
enableProjectSelect: true,
|
enableProjectSelect: true,
|
||||||
|
excludeVoidedProjects: true,
|
||||||
enableAttachmentTable: true,
|
enableAttachmentTable: true,
|
||||||
enableTransportPlanForm: true,
|
enableTransportPlanForm: true,
|
||||||
|
enableShippingTemplateFreight: true,
|
||||||
|
editableRoadAddress: true,
|
||||||
|
fixedTransportAddressType: true,
|
||||||
enableTemplateCodePreview: true,
|
enableTemplateCodePreview: true,
|
||||||
attachmentTitle: '附件',
|
attachmentTitle: '附件',
|
||||||
defaultForm: {
|
defaultForm: {
|
||||||
@@ -178,6 +182,7 @@ export const option = {
|
|||||||
labelWidth: '0px',
|
labelWidth: '0px',
|
||||||
className: 'business-crud-page__full-form-item',
|
className: 'business-crud-page__full-form-item',
|
||||||
},
|
},
|
||||||
|
{ label: '运费信息', prop: 'freightJson', hide: true, display: false },
|
||||||
{
|
{
|
||||||
label: '',
|
label: '',
|
||||||
prop: 'attachmentTitle',
|
prop: 'attachmentTitle',
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ const formatGoodsInfo = row => {
|
|||||||
const text = Object.entries(groups)
|
const text = Object.entries(groups)
|
||||||
.map(([unit, group]) => {
|
.map(([unit, group]) => {
|
||||||
const quantity = `${formatGoodsQuantity(group.quantity)}${unit}`;
|
const quantity = `${formatGoodsQuantity(group.quantity)}${unit}`;
|
||||||
return `${group.typeName}等${group.count}中货物 | ${quantity}`;
|
return `${group.typeName}等${group.count}种货物 | ${quantity}`;
|
||||||
})
|
})
|
||||||
.join('; ');
|
.join('; ');
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,23 @@ const parseJsonArray = value => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const hasProcessConfig = value => {
|
||||||
|
if (isEmpty(value)) return false;
|
||||||
|
if (typeof value !== 'string') {
|
||||||
|
return Array.isArray(value) ? value.length > 0 : typeof value === 'object';
|
||||||
|
}
|
||||||
|
const text = value.trim();
|
||||||
|
if (!text) return false;
|
||||||
|
try {
|
||||||
|
const result = JSON.parse(text);
|
||||||
|
return Array.isArray(result)
|
||||||
|
? result.length > 0
|
||||||
|
: Boolean(result && Object.keys(result).length);
|
||||||
|
} catch (error) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const getFirstValue = (row, props) => {
|
const getFirstValue = (row, props) => {
|
||||||
const prop = props.find(item => !isEmpty(row[item]));
|
const prop = props.find(item => !isEmpty(row[item]));
|
||||||
return prop ? row[prop] : '';
|
return prop ? row[prop] : '';
|
||||||
@@ -96,6 +113,11 @@ export const config = {
|
|||||||
exportUrl: '/blade-transport/waybill-manage/export-waybill-manage',
|
exportUrl: '/blade-transport/waybill-manage/export-waybill-manage',
|
||||||
exportName: '运单管理',
|
exportName: '运单管理',
|
||||||
importUrl: '/blade-transport/waybill-manage/import-waybill-manage',
|
importUrl: '/blade-transport/waybill-manage/import-waybill-manage',
|
||||||
|
defaultForm: {
|
||||||
|
carrierType: '承运商',
|
||||||
|
quantityUnit: '吨',
|
||||||
|
priceUnit: '元/吨',
|
||||||
|
},
|
||||||
enableAllDept: false,
|
enableAllDept: false,
|
||||||
enableProjectSelect: true,
|
enableProjectSelect: true,
|
||||||
templateCreateTarget: 'waybill-manage',
|
templateCreateTarget: 'waybill-manage',
|
||||||
@@ -103,6 +125,13 @@ export const config = {
|
|||||||
enableShippingPlanSelect: true,
|
enableShippingPlanSelect: true,
|
||||||
enableShippingInfoForm: true,
|
enableShippingInfoForm: true,
|
||||||
enableTaskInfoForm: true,
|
enableTaskInfoForm: true,
|
||||||
|
enableWaybillFooterFreightSummary: true,
|
||||||
|
enableDraftSave: true,
|
||||||
|
saveAsDraft: true,
|
||||||
|
skipDraftValidation: true,
|
||||||
|
draftStatusProp: 'businessStatus',
|
||||||
|
draftStatus: 'draft',
|
||||||
|
draftSaveText: '暂存',
|
||||||
batchDelete: false,
|
batchDelete: false,
|
||||||
actionButtonLikeSearch: true,
|
actionButtonLikeSearch: true,
|
||||||
createText: '新建运单',
|
createText: '新建运单',
|
||||||
@@ -118,6 +147,16 @@ export const config = {
|
|||||||
actions: ['copy', 'cancel', 'reassign', 'complete', 'batchComplete'],
|
actions: ['copy', 'cancel', 'reassign', 'complete', 'batchComplete'],
|
||||||
statusProp: 'businessStatus',
|
statusProp: 'businessStatus',
|
||||||
statusTextProp: 'businessStatusName',
|
statusTextProp: 'businessStatusName',
|
||||||
|
formatStatus(row, prop, defaultText) {
|
||||||
|
if (
|
||||||
|
prop === 'businessStatus' &&
|
||||||
|
row.businessStatus === 'pending' &&
|
||||||
|
!hasProcessConfig(row.processJson)
|
||||||
|
) {
|
||||||
|
return '进行中';
|
||||||
|
}
|
||||||
|
return defaultText;
|
||||||
|
},
|
||||||
deleteStatus: ['draft'],
|
deleteStatus: ['draft'],
|
||||||
editStatus: ['draft', 'pending'],
|
editStatus: ['draft', 'pending'],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -195,6 +195,17 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template #contactPhone-form>
|
||||||
|
<el-input
|
||||||
|
v-model="form.contactPhone"
|
||||||
|
:disabled="dialogReadonly"
|
||||||
|
inputmode="numeric"
|
||||||
|
maxlength="20"
|
||||||
|
placeholder="请输入"
|
||||||
|
@input="handleContactPhoneInput"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
</avue-crud>
|
</avue-crud>
|
||||||
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
@@ -326,7 +337,7 @@ export default {
|
|||||||
initDeptTree() {
|
initDeptTree() {
|
||||||
getDeptTree(this.userInfo.tenantId).then(res => {
|
getDeptTree(this.userInfo.tenantId).then(res => {
|
||||||
this.deptOptions = this.flattenDept(res.data.data || []);
|
this.deptOptions = this.flattenDept(res.data.data || []);
|
||||||
const deptColumn = this.findColumn(this.option.column, 'deptId');
|
const deptColumn = this.findColumn(this.option.column, 'searchDeptId');
|
||||||
deptColumn.dicData = this.deptOptions;
|
deptColumn.dicData = this.deptOptions;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -736,6 +747,9 @@ export default {
|
|||||||
const numberValue = Number(value);
|
const numberValue = Number(value);
|
||||||
return Number.isFinite(numberValue) ? numberValue.toFixed(6) : '';
|
return Number.isFinite(numberValue) ? numberValue.toFixed(6) : '';
|
||||||
},
|
},
|
||||||
|
handleContactPhoneInput(value) {
|
||||||
|
this.form.contactPhone = String(value || '').replace(/\D/g, '');
|
||||||
|
},
|
||||||
normalizeRow(row) {
|
normalizeRow(row) {
|
||||||
const trimValue = value => String(value || '').trim();
|
const trimValue = value => String(value || '').trim();
|
||||||
const submitRow = {
|
const submitRow = {
|
||||||
@@ -820,6 +834,10 @@ export default {
|
|||||||
this.$message.warning('联系方式不能超过20个字');
|
this.$message.warning('联系方式不能超过20个字');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (row.contactPhone && !/^\d+$/.test(row.contactPhone)) {
|
||||||
|
this.$message.warning('联系方式只能输入数字');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (row.remark && row.remark.length > 200) {
|
if (row.remark && row.remark.length > 200) {
|
||||||
this.$message.warning('备注不能超过200个字');
|
this.$message.warning('备注不能超过200个字');
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -108,14 +108,18 @@
|
|||||||
|
|
||||||
<template #cargoCode-form>
|
<template #cargoCode-form>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="form.cargoCode"
|
:model-value="getCargoCodeSuffix()"
|
||||||
clearable
|
clearable
|
||||||
maxlength="20"
|
:maxlength="getCargoCodeMaxLength()"
|
||||||
show-word-limit
|
show-word-limit
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
:disabled="dialogReadonly || dialogType === 'edit'"
|
:disabled="dialogReadonly || dialogType === 'edit'"
|
||||||
@input="handleCargoCodeInput"
|
@input="handleCargoCodeInput"
|
||||||
/>
|
>
|
||||||
|
<template v-if="getCargoCodePrefix()" #prepend>
|
||||||
|
{{ getCargoCodePrefix() }}
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #cargoValue-form>
|
<template #cargoValue-form>
|
||||||
@@ -143,10 +147,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #packageBrand="{ row }">
|
|
||||||
{{ [row.packageType, row.brand].filter(Boolean).join(' / ') || '-' }}
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #menu="{ row, index }">
|
<template #menu="{ row, index }">
|
||||||
<el-link
|
<el-link
|
||||||
type="primary"
|
type="primary"
|
||||||
@@ -357,6 +357,14 @@ export default {
|
|||||||
? String(this.form.secondCargoTypeCode).slice(0, 4)
|
? String(this.form.secondCargoTypeCode).slice(0, 4)
|
||||||
: '';
|
: '';
|
||||||
},
|
},
|
||||||
|
getCargoCodeSuffix() {
|
||||||
|
const prefix = this.getCargoCodePrefix();
|
||||||
|
const cargoCode = String(this.form.cargoCode || '');
|
||||||
|
return prefix && cargoCode.startsWith(prefix) ? cargoCode.slice(prefix.length) : cargoCode;
|
||||||
|
},
|
||||||
|
getCargoCodeMaxLength() {
|
||||||
|
return 20 - this.getCargoCodePrefix().length;
|
||||||
|
},
|
||||||
syncCargoCodePrefix() {
|
syncCargoCodePrefix() {
|
||||||
const prefix = this.getCargoCodePrefix();
|
const prefix = this.getCargoCodePrefix();
|
||||||
const current = String(this.form.cargoCode || '').replace(/\D/g, '');
|
const current = String(this.form.cargoCode || '').replace(/\D/g, '');
|
||||||
@@ -369,13 +377,10 @@ export default {
|
|||||||
},
|
},
|
||||||
handleCargoCodeInput(value) {
|
handleCargoCodeInput(value) {
|
||||||
const prefix = this.getCargoCodePrefix();
|
const prefix = this.getCargoCodePrefix();
|
||||||
const input = String(value || '').replace(/\D/g, '');
|
const suffix = String(value || '')
|
||||||
if (!prefix) {
|
.replace(/\D/g, '')
|
||||||
this.form.cargoCode = input.slice(0, 20);
|
.slice(0, this.getCargoCodeMaxLength());
|
||||||
return;
|
this.form.cargoCode = `${prefix}${suffix}`;
|
||||||
}
|
|
||||||
const suffix = input.startsWith(prefix) ? input.slice(prefix.length) : input;
|
|
||||||
this.form.cargoCode = `${prefix}${suffix}`.slice(0, 20);
|
|
||||||
},
|
},
|
||||||
handleCargoValueInput(value) {
|
handleCargoValueInput(value) {
|
||||||
const raw = String(value || '').replace(/[^\d.]/g, '');
|
const raw = String(value || '').replace(/[^\d.]/g, '');
|
||||||
|
|||||||
@@ -394,6 +394,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.applyDefaultDeptSearch();
|
||||||
this.initDeptTree();
|
this.initDeptTree();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -434,6 +435,18 @@ export default {
|
|||||||
defaultDeptId() {
|
defaultDeptId() {
|
||||||
return (this.userInfo && (this.userInfo.deptId || this.userInfo.dept_id)) || '';
|
return (this.userInfo && (this.userInfo.deptId || this.userInfo.dept_id)) || '';
|
||||||
},
|
},
|
||||||
|
applyDefaultDeptSearch() {
|
||||||
|
const deptId = this.defaultDeptId();
|
||||||
|
const deptColumn = this.findColumn(this.option.column, 'searchDeptId');
|
||||||
|
if (!deptId || !deptColumn) return;
|
||||||
|
deptColumn.searchValue = deptId;
|
||||||
|
this.query = { ...this.query, deptId };
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.$refs.crud?.searchForm) {
|
||||||
|
this.$refs.crud.searchForm.searchDeptId = deptId;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
resetAddressQuery() {
|
resetAddressQuery() {
|
||||||
this.addressQuery = {
|
this.addressQuery = {
|
||||||
addressName: '',
|
addressName: '',
|
||||||
@@ -883,8 +896,9 @@ export default {
|
|||||||
},
|
},
|
||||||
searchReset() {
|
searchReset() {
|
||||||
this.query = {};
|
this.query = {};
|
||||||
|
this.applyDefaultDeptSearch();
|
||||||
this.page.currentPage = 1;
|
this.page.currentPage = 1;
|
||||||
this.onLoad(this.page);
|
this.onLoad(this.page, this.query);
|
||||||
},
|
},
|
||||||
searchChange(params, done) {
|
searchChange(params, done) {
|
||||||
this.query = params;
|
this.query = params;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -527,6 +527,7 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
this.resetNodeRows();
|
this.resetNodeRows();
|
||||||
this.loadProjectOptions('');
|
this.loadProjectOptions('');
|
||||||
|
this.applyDefaultDeptSearch();
|
||||||
this.initDeptOptions();
|
this.initDeptOptions();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -545,6 +546,21 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
defaultDeptId() {
|
||||||
|
return (this.userInfo && (this.userInfo.deptId || this.userInfo.dept_id)) || '';
|
||||||
|
},
|
||||||
|
applyDefaultDeptSearch() {
|
||||||
|
const deptId = this.defaultDeptId();
|
||||||
|
const deptColumn = this.findColumn(this.option.column, 'searchDeptId');
|
||||||
|
if (!deptId || !deptColumn) return;
|
||||||
|
deptColumn.searchValue = deptId;
|
||||||
|
this.query = { ...this.query, deptId };
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.$refs.crud?.searchForm) {
|
||||||
|
this.$refs.crud.searchForm.searchDeptId = deptId;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
flattenDept(tree, level = 0) {
|
flattenDept(tree, level = 0) {
|
||||||
return tree.flatMap(item => [
|
return tree.flatMap(item => [
|
||||||
{
|
{
|
||||||
@@ -953,8 +969,9 @@ export default {
|
|||||||
},
|
},
|
||||||
searchReset() {
|
searchReset() {
|
||||||
this.query = {};
|
this.query = {};
|
||||||
|
this.applyDefaultDeptSearch();
|
||||||
this.page.currentPage = 1;
|
this.page.currentPage = 1;
|
||||||
this.onLoad(this.page);
|
this.onLoad(this.page, this.query);
|
||||||
},
|
},
|
||||||
searchChange(params, done) {
|
searchChange(params, done) {
|
||||||
this.query = params;
|
this.query = params;
|
||||||
|
|||||||
@@ -1015,7 +1015,7 @@
|
|||||||
v-for="item in scoreQuantificationOptions"
|
v-for="item in scoreQuantificationOptions"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id"
|
:value="String(item.id)"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -1961,14 +1961,14 @@ export default {
|
|||||||
},
|
},
|
||||||
initScoreQuantificationOptions() {
|
initScoreQuantificationOptions() {
|
||||||
this.scoreQuantificationLoading = true;
|
this.scoreQuantificationLoading = true;
|
||||||
getCreditScoreQuantificationList(1, 9999, { status: 1 })
|
return getCreditScoreQuantificationList(1, 9999, { status: 1 })
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const data = res.data.data || {};
|
const data = res.data.data || {};
|
||||||
const records = Array.isArray(data) ? data : data.records || [];
|
const records = Array.isArray(data) ? data : data.records || [];
|
||||||
this.scoreQuantificationOptions = records
|
this.scoreQuantificationOptions = records
|
||||||
.filter(item => Number(item.status) === 1)
|
.filter(item => Number(item.status) === 1)
|
||||||
.map(item => ({
|
.map(item => ({
|
||||||
id: item.id,
|
id: String(item.id),
|
||||||
name: item.name || item.configName || item.title || item.id,
|
name: item.name || item.configName || item.title || item.id,
|
||||||
}));
|
}));
|
||||||
})
|
})
|
||||||
@@ -1976,6 +1976,21 @@ export default {
|
|||||||
this.scoreQuantificationLoading = false;
|
this.scoreQuantificationLoading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
ensureScoreQuantificationOption(quantificationId) {
|
||||||
|
if (!quantificationId) return Promise.resolve();
|
||||||
|
const id = String(quantificationId);
|
||||||
|
if (this.scoreQuantificationOptions.some(item => String(item.id) === id)) {
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
return getCreditScoreQuantificationDetail(quantificationId).then(res => {
|
||||||
|
const item = res.data.data || {};
|
||||||
|
if (!item.id) return;
|
||||||
|
this.scoreQuantificationOptions.push({
|
||||||
|
id: String(item.id),
|
||||||
|
name: item.name || item.configName || item.title || String(item.id),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
loadDictOptions(code, target, fallback = [], callback) {
|
loadDictOptions(code, target, fallback = [], callback) {
|
||||||
getDictionary({ code }).then(res => {
|
getDictionary({ code }).then(res => {
|
||||||
const options = (res.data.data || []).map(item => ({
|
const options = (res.data.data || []).map(item => ({
|
||||||
@@ -2022,6 +2037,7 @@ export default {
|
|||||||
const deptNames = deptIds
|
const deptNames = deptIds
|
||||||
.map(id => this.deptOptions.find(item => String(item.value) === String(id))?.rawLabel)
|
.map(id => this.deptOptions.find(item => String(item.value) === String(id))?.rawLabel)
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
|
this.archiveForm.deptId = deptIds;
|
||||||
this.archiveForm.deptIds = deptIds.join(',');
|
this.archiveForm.deptIds = deptIds.join(',');
|
||||||
this.archiveForm.deptName = deptNames.join(',');
|
this.archiveForm.deptName = deptNames.join(',');
|
||||||
this.$refs.archiveForm?.validateField('deptName');
|
this.$refs.archiveForm?.validateField('deptName');
|
||||||
@@ -2692,6 +2708,7 @@ export default {
|
|||||||
attachments: [],
|
attachments: [],
|
||||||
details: [],
|
details: [],
|
||||||
...score,
|
...score,
|
||||||
|
quantificationId: score.quantificationId ? String(score.quantificationId) : '',
|
||||||
tempApplyCreditLimit: this.normalizeOptionalAmount(score.tempApplyCreditLimit),
|
tempApplyCreditLimit: this.normalizeOptionalAmount(score.tempApplyCreditLimit),
|
||||||
attachments: score.attachments || this.parseAttachments(score.proofAttachments),
|
attachments: score.attachments || this.parseAttachments(score.proofAttachments),
|
||||||
details: score.details || [],
|
details: score.details || [],
|
||||||
@@ -2808,7 +2825,7 @@ export default {
|
|||||||
.map(id => this.deptOptions.find(item => String(item.value) === String(id))?.rawLabel)
|
.map(id => this.deptOptions.find(item => String(item.value) === String(id))?.rawLabel)
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
archive.deptIds = deptIds.join(',');
|
archive.deptIds = deptIds.join(',');
|
||||||
archive.deptId = deptIds.length ? deptIds[0] : '';
|
archive.deptId = deptIds.length ? Number(deptIds[0]) : null;
|
||||||
archive.deptName = deptNames.length ? deptNames.join(',') : archive.deptName;
|
archive.deptName = deptNames.length ? deptNames.join(',') : archive.deptName;
|
||||||
archive.registeredAddress = this.formatArchiveAddress(archive);
|
archive.registeredAddress = this.formatArchiveAddress(archive);
|
||||||
delete archive.registeredRegionPath;
|
delete archive.registeredRegionPath;
|
||||||
@@ -2885,9 +2902,10 @@ export default {
|
|||||||
this.scoreAttachmentFiles = JSON.parse(JSON.stringify(this.currentScore.attachments || []));
|
this.scoreAttachmentFiles = JSON.parse(JSON.stringify(this.currentScore.attachments || []));
|
||||||
this.expandedScoreCategoryKeys = [];
|
this.expandedScoreCategoryKeys = [];
|
||||||
this.scoreBox = true;
|
this.scoreBox = true;
|
||||||
if (!this.scoreQuantificationOptions.length) {
|
const loadOptions = this.scoreQuantificationOptions.length
|
||||||
this.initScoreQuantificationOptions();
|
? Promise.resolve()
|
||||||
}
|
: this.initScoreQuantificationOptions();
|
||||||
|
loadOptions.then(() => this.ensureScoreQuantificationOption(this.currentScore.quantificationId));
|
||||||
},
|
},
|
||||||
resetScoreDialog() {
|
resetScoreDialog() {
|
||||||
this.scoreRecordIndex = -1;
|
this.scoreRecordIndex = -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user