Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -195,6 +195,17 @@
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #contactPhone-form>
|
||||
<el-input
|
||||
v-model="form.contactPhone"
|
||||
:disabled="dialogReadonly"
|
||||
inputmode="numeric"
|
||||
maxlength="20"
|
||||
placeholder="请输入"
|
||||
@input="handleContactPhoneInput"
|
||||
/>
|
||||
</template>
|
||||
</avue-crud>
|
||||
|
||||
<el-dialog
|
||||
@@ -326,7 +337,7 @@ export default {
|
||||
initDeptTree() {
|
||||
getDeptTree(this.userInfo.tenantId).then(res => {
|
||||
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;
|
||||
});
|
||||
},
|
||||
@@ -736,6 +747,9 @@ export default {
|
||||
const numberValue = Number(value);
|
||||
return Number.isFinite(numberValue) ? numberValue.toFixed(6) : '';
|
||||
},
|
||||
handleContactPhoneInput(value) {
|
||||
this.form.contactPhone = String(value || '').replace(/\D/g, '');
|
||||
},
|
||||
normalizeRow(row) {
|
||||
const trimValue = value => String(value || '').trim();
|
||||
const submitRow = {
|
||||
@@ -820,6 +834,10 @@ export default {
|
||||
this.$message.warning('联系方式不能超过20个字');
|
||||
return false;
|
||||
}
|
||||
if (row.contactPhone && !/^\d+$/.test(row.contactPhone)) {
|
||||
this.$message.warning('联系方式只能输入数字');
|
||||
return false;
|
||||
}
|
||||
if (row.remark && row.remark.length > 200) {
|
||||
this.$message.warning('备注不能超过200个字');
|
||||
return false;
|
||||
|
||||
@@ -108,14 +108,18 @@
|
||||
|
||||
<template #cargoCode-form>
|
||||
<el-input
|
||||
v-model="form.cargoCode"
|
||||
:model-value="getCargoCodeSuffix()"
|
||||
clearable
|
||||
maxlength="20"
|
||||
:maxlength="getCargoCodeMaxLength()"
|
||||
show-word-limit
|
||||
placeholder="请输入"
|
||||
:disabled="dialogReadonly || dialogType === 'edit'"
|
||||
@input="handleCargoCodeInput"
|
||||
/>
|
||||
>
|
||||
<template v-if="getCargoCodePrefix()" #prepend>
|
||||
{{ getCargoCodePrefix() }}
|
||||
</template>
|
||||
</el-input>
|
||||
</template>
|
||||
|
||||
<template #cargoValue-form>
|
||||
@@ -143,10 +147,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #packageBrand="{ row }">
|
||||
{{ [row.packageType, row.brand].filter(Boolean).join(' / ') || '-' }}
|
||||
</template>
|
||||
|
||||
<template #menu="{ row, index }">
|
||||
<el-link
|
||||
type="primary"
|
||||
@@ -357,6 +357,14 @@ export default {
|
||||
? 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() {
|
||||
const prefix = this.getCargoCodePrefix();
|
||||
const current = String(this.form.cargoCode || '').replace(/\D/g, '');
|
||||
@@ -369,13 +377,10 @@ export default {
|
||||
},
|
||||
handleCargoCodeInput(value) {
|
||||
const prefix = this.getCargoCodePrefix();
|
||||
const input = String(value || '').replace(/\D/g, '');
|
||||
if (!prefix) {
|
||||
this.form.cargoCode = input.slice(0, 20);
|
||||
return;
|
||||
}
|
||||
const suffix = input.startsWith(prefix) ? input.slice(prefix.length) : input;
|
||||
this.form.cargoCode = `${prefix}${suffix}`.slice(0, 20);
|
||||
const suffix = String(value || '')
|
||||
.replace(/\D/g, '')
|
||||
.slice(0, this.getCargoCodeMaxLength());
|
||||
this.form.cargoCode = `${prefix}${suffix}`;
|
||||
},
|
||||
handleCargoValueInput(value) {
|
||||
const raw = String(value || '').replace(/[^\d.]/g, '');
|
||||
|
||||
@@ -394,6 +394,7 @@ export default {
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.applyDefaultDeptSearch();
|
||||
this.initDeptTree();
|
||||
},
|
||||
methods: {
|
||||
@@ -434,6 +435,18 @@ 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;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetAddressQuery() {
|
||||
this.addressQuery = {
|
||||
addressName: '',
|
||||
@@ -883,8 +896,9 @@ export default {
|
||||
},
|
||||
searchReset() {
|
||||
this.query = {};
|
||||
this.applyDefaultDeptSearch();
|
||||
this.page.currentPage = 1;
|
||||
this.onLoad(this.page);
|
||||
this.onLoad(this.page, this.query);
|
||||
},
|
||||
searchChange(params, done) {
|
||||
this.query = params;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -527,6 +527,7 @@ export default {
|
||||
created() {
|
||||
this.resetNodeRows();
|
||||
this.loadProjectOptions('');
|
||||
this.applyDefaultDeptSearch();
|
||||
this.initDeptOptions();
|
||||
},
|
||||
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) {
|
||||
return tree.flatMap(item => [
|
||||
{
|
||||
@@ -953,8 +969,9 @@ export default {
|
||||
},
|
||||
searchReset() {
|
||||
this.query = {};
|
||||
this.applyDefaultDeptSearch();
|
||||
this.page.currentPage = 1;
|
||||
this.onLoad(this.page);
|
||||
this.onLoad(this.page, this.query);
|
||||
},
|
||||
searchChange(params, done) {
|
||||
this.query = params;
|
||||
|
||||
@@ -1015,7 +1015,7 @@
|
||||
v-for="item in scoreQuantificationOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
:value="String(item.id)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -1961,14 +1961,14 @@ export default {
|
||||
},
|
||||
initScoreQuantificationOptions() {
|
||||
this.scoreQuantificationLoading = true;
|
||||
getCreditScoreQuantificationList(1, 9999, { status: 1 })
|
||||
return getCreditScoreQuantificationList(1, 9999, { status: 1 })
|
||||
.then(res => {
|
||||
const data = res.data.data || {};
|
||||
const records = Array.isArray(data) ? data : data.records || [];
|
||||
this.scoreQuantificationOptions = records
|
||||
.filter(item => Number(item.status) === 1)
|
||||
.map(item => ({
|
||||
id: item.id,
|
||||
id: String(item.id),
|
||||
name: item.name || item.configName || item.title || item.id,
|
||||
}));
|
||||
})
|
||||
@@ -1976,6 +1976,21 @@ export default {
|
||||
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) {
|
||||
getDictionary({ code }).then(res => {
|
||||
const options = (res.data.data || []).map(item => ({
|
||||
@@ -2022,6 +2037,7 @@ export default {
|
||||
const deptNames = deptIds
|
||||
.map(id => this.deptOptions.find(item => String(item.value) === String(id))?.rawLabel)
|
||||
.filter(Boolean);
|
||||
this.archiveForm.deptId = deptIds;
|
||||
this.archiveForm.deptIds = deptIds.join(',');
|
||||
this.archiveForm.deptName = deptNames.join(',');
|
||||
this.$refs.archiveForm?.validateField('deptName');
|
||||
@@ -2692,6 +2708,7 @@ export default {
|
||||
attachments: [],
|
||||
details: [],
|
||||
...score,
|
||||
quantificationId: score.quantificationId ? String(score.quantificationId) : '',
|
||||
tempApplyCreditLimit: this.normalizeOptionalAmount(score.tempApplyCreditLimit),
|
||||
attachments: score.attachments || this.parseAttachments(score.proofAttachments),
|
||||
details: score.details || [],
|
||||
@@ -2808,7 +2825,7 @@ export default {
|
||||
.map(id => this.deptOptions.find(item => String(item.value) === String(id))?.rawLabel)
|
||||
.filter(Boolean);
|
||||
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.registeredAddress = this.formatArchiveAddress(archive);
|
||||
delete archive.registeredRegionPath;
|
||||
@@ -2885,9 +2902,10 @@ export default {
|
||||
this.scoreAttachmentFiles = JSON.parse(JSON.stringify(this.currentScore.attachments || []));
|
||||
this.expandedScoreCategoryKeys = [];
|
||||
this.scoreBox = true;
|
||||
if (!this.scoreQuantificationOptions.length) {
|
||||
this.initScoreQuantificationOptions();
|
||||
}
|
||||
const loadOptions = this.scoreQuantificationOptions.length
|
||||
? Promise.resolve()
|
||||
: this.initScoreQuantificationOptions();
|
||||
loadOptions.then(() => this.ensureScoreQuantificationOption(this.currentScore.quantificationId));
|
||||
},
|
||||
resetScoreDialog() {
|
||||
this.scoreRecordIndex = -1;
|
||||
|
||||
Reference in New Issue
Block a user