1、调整导入运单
2、调整对账
This commit is contained in:
@@ -655,23 +655,10 @@ const extractRecords = res => {
|
||||
if (Array.isArray(data?.data?.records)) return data.data.records;
|
||||
return [];
|
||||
};
|
||||
// 批次号规则:PC + 导入日期 + 当日批次流水号(4 位),如 PC202606010001。
|
||||
const batchNoPrefix = 'PC';
|
||||
const batchNoSequenceLength = 4;
|
||||
// 批次号由后端按 PC + 导入日期 + 当日流水生成,已删除数据也计入流水,避免唯一索引冲突。
|
||||
const generateBatchNo = async () => {
|
||||
const prefix = `${batchNoPrefix}${dayjs().format('YYYYMMDD')}`;
|
||||
let maxSequence = 0;
|
||||
try {
|
||||
const res = await api.getImportBatches({ current: 1, size: 9999 });
|
||||
extractRecords(res).forEach(item => {
|
||||
const no = String(item.batchNo || '').trim();
|
||||
if (!no.startsWith(prefix)) return;
|
||||
maxSequence = Math.max(maxSequence, Number(no.slice(prefix.length)) || 0);
|
||||
});
|
||||
} catch (error) {
|
||||
maxSequence = 0;
|
||||
}
|
||||
return `${prefix}${String(maxSequence + 1).padStart(batchNoSequenceLength, '0')}`;
|
||||
const res = await api.getImportBatchNextCode();
|
||||
return res?.data?.data || '';
|
||||
};
|
||||
// 承运商合同的承运商固定取合同乙方,与运单管理(waybill-manage-page)保持一致。
|
||||
const getCarrierContractPartyName = (contract = {}) =>
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
|
||||
<section class="change-section attachment-section">
|
||||
<div class="section-head"><div class="dialog-section-title">其它附件</div><el-button type="primary" plain>批量下载</el-button></div>
|
||||
<el-table :data="attachments" border class="change-table"><el-table-column type="index" label="序号" width="70" /><el-table-column label="文件名" min-width="240"><template #default="{ row }"><el-link type="primary" @click="previewAttachment(row, attachments)">{{ row.originalName || row.name }}</el-link></template></el-table-column><el-table-column prop="description" label="附件描述" min-width="240" /><el-table-column prop="size" label="文件大小" width="120" /><el-table-column prop="userName" label="上传人" width="140" /><el-table-column prop="uploadTime" label="上传时间" width="180" /><el-table-column label="操作" width="100"><template #default="{ $index }"><el-link type="danger" @click="attachments.splice($index, 1)">删除</el-link></template></el-table-column></el-table>
|
||||
<el-table :data="attachments" border class="change-table"><el-table-column type="index" label="序号" width="70" /><el-table-column label="文件名" min-width="240"><template #default="{ row }"><el-link type="primary" @click="previewAttachment(row, attachments)">{{ row.originalName || row.name }}</el-link></template></el-table-column><el-table-column prop="description" label="附件描述" min-width="240" /><el-table-column prop="size" label="文件大小" width="120" /><el-table-column prop="uploadUserName" label="上传人" width="140" /><el-table-column prop="uploadTime" label="上传时间" width="180" /><el-table-column label="操作" width="100"><template #default="{ $index }"><el-link type="danger" @click="attachments.splice($index, 1)">删除</el-link></template></el-table-column></el-table>
|
||||
<el-upload action="#" :auto-upload="false" multiple :show-file-list="false" @change="handleAttachment"><el-button type="primary" plain icon="el-icon-upload">上传附件</el-button></el-upload>
|
||||
</section>
|
||||
|
||||
@@ -171,8 +171,33 @@ export default {
|
||||
savePlan(value, index) { if (index < 0) this.plans.push(value); else this.plans.splice(index, 1, value); if (value.defaultPlan) this.plans.forEach((item, current) => { if (current !== (index < 0 ? this.plans.length - 1 : index)) item.defaultPlan = false; }); },
|
||||
handleSettlementTypeChange(value) { if (value !== '月结') { this.settlementRule.billCycleType = ''; this.settlementRule.billCutoffDay = ''; } else if (!this.settlementRule.billCycleType) this.settlementRule.billCycleType = '固定截单日'; if (value !== '固定天数周期结算') this.settlementRule.cycleDays = ''; },
|
||||
handleCycleTypeChange(value) { if (value === '固定截单日' && !this.settlementRule.billCutoffDay) this.settlementRule.billCutoffDay = 25; if (value !== '固定截单日') this.settlementRule.billCutoffDay = ''; },
|
||||
handleAttachment(event) { const raw = event.raw; if (!raw) return; if (raw.size > 50 * 1024 * 1024) { this.$message.warning('单个文件大小不能超过50M'); return; } this.attachments.push({ name: raw.name, size: `${Math.ceil(raw.size / 1024)}KB`, uploadTime: this.$dayjs().format('YYYY-MM-DD HH:mm:ss') }); },
|
||||
handleContractFileChange(list) { this.contractFileRows = (list || []).map(item => ({ ...item, uploadTime: item.uploadTime || this.$dayjs().format('YYYY-MM-DD HH:mm:ss') })); },
|
||||
currentUploadUserName() {
|
||||
const userInfo = this.$store.getters.userInfo || {};
|
||||
return userInfo.realName || userInfo.userName || '';
|
||||
},
|
||||
handleAttachment(event) {
|
||||
const raw = event.raw;
|
||||
if (!raw) return;
|
||||
if (raw.size > 50 * 1024 * 1024) {
|
||||
this.$message.warning('单个文件大小不能超过50M');
|
||||
return;
|
||||
}
|
||||
this.attachments.push({
|
||||
name: raw.name,
|
||||
size: `${Math.ceil(raw.size / 1024)}KB`,
|
||||
uploadUserName: this.currentUploadUserName(),
|
||||
uploadTime: this.$dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||||
});
|
||||
},
|
||||
handleContractFileChange(list) {
|
||||
const uploadUserName = this.currentUploadUserName();
|
||||
const uploadTime = this.$dayjs().format('YYYY-MM-DD HH:mm:ss');
|
||||
this.contractFileRows = (list || []).map(item => ({
|
||||
...item,
|
||||
uploadUserName: item.uploadUserName || uploadUserName,
|
||||
uploadTime: item.uploadTime || uploadTime,
|
||||
}));
|
||||
},
|
||||
attachmentUrl(row = {}) { return row.url || row.link || row.fileUrl || row.downloadUrl || row.domain || ''; },
|
||||
attachmentName(row = {}) { return row.originalName || row.name || row.fileName || '附件'; },
|
||||
attachmentExtension(row = {}) { const source = String(this.attachmentName(row) || this.attachmentUrl(row)).split('?')[0]; const index = source.lastIndexOf('.'); return index > -1 ? source.slice(index + 1).toLowerCase() : ''; },
|
||||
|
||||
@@ -384,6 +384,16 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务模式" prop="businessMode">
|
||||
<el-select v-model="form.businessMode" placeholder="请选择业务模式">
|
||||
<el-option
|
||||
v-for="item in businessModeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目规模" prop="projectScale">
|
||||
<el-input
|
||||
v-model="form.projectScale"
|
||||
@@ -410,6 +420,14 @@
|
||||
<template #suffix>万元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="利润率" prop="profitRate">
|
||||
<el-input
|
||||
v-model="form.profitRate"
|
||||
@input="value => handleNumberInput('profitRate', value)"
|
||||
>
|
||||
<template #suffix>%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="履约保证金" prop="fundDemand">
|
||||
<el-input
|
||||
v-model="form.fundDemand"
|
||||
@@ -670,17 +688,6 @@
|
||||
</el-table>
|
||||
|
||||
<template v-if="isChangeDialog">
|
||||
<div class="dialog-section-title">变更内容</div>
|
||||
<el-form-item prop="changeContent" class="project-apply-form__change-textarea">
|
||||
<el-input
|
||||
v-model="form.changeContent"
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="2000字以内"
|
||||
maxlength="2000"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<div class="dialog-section-title">变更原因</div>
|
||||
<el-form-item prop="changeReason" class="project-apply-form__change-textarea">
|
||||
<el-input
|
||||
@@ -852,6 +859,7 @@ import { mapGetters } from 'vuex';
|
||||
import NProgress from 'nprogress';
|
||||
import 'nprogress/nprogress.css';
|
||||
import {
|
||||
businessModeOptions,
|
||||
businessTypeOptions,
|
||||
projectSourceOptions,
|
||||
projectTypeOptions,
|
||||
@@ -886,9 +894,11 @@ const emptyForm = () => ({
|
||||
transportRoute: '',
|
||||
transportType: '',
|
||||
businessType: '',
|
||||
businessMode: '国内运输',
|
||||
projectScale: '',
|
||||
settlementMode: '',
|
||||
estimatedProfit: '',
|
||||
profitRate: '',
|
||||
fundDemand: '',
|
||||
handlerUserId: '',
|
||||
handlerUserName: '',
|
||||
@@ -909,6 +919,7 @@ const emptyForm = () => ({
|
||||
const optionalSentinelFields = [
|
||||
'projectScale',
|
||||
'estimatedProfit',
|
||||
'profitRate',
|
||||
'fundDemand',
|
||||
'receivableDays',
|
||||
'paymentDays',
|
||||
@@ -1001,6 +1012,7 @@ export default {
|
||||
projectSourceOptions,
|
||||
transportTypeOptions: [],
|
||||
businessTypeOptions,
|
||||
businessModeOptions,
|
||||
settlementModeOptions: [],
|
||||
changeTypeOptions,
|
||||
tableForm: {},
|
||||
@@ -1035,11 +1047,11 @@ export default {
|
||||
{ max: 50, message: '项目名称不能超过50个字符', trigger: 'blur' },
|
||||
],
|
||||
projectShortName: [
|
||||
{ required: true, message: '请输入项目简称', trigger: 'blur' },
|
||||
{ max: 20, message: '项目简称不能超过20个字符', trigger: 'blur' },
|
||||
],
|
||||
businessDeptId: [{ required: true, message: '请选择业务部门', trigger: 'change' }],
|
||||
undertakeDeptId: [{ required: true, message: '请选择承办部门', trigger: 'change' }],
|
||||
businessMode: [{ required: true, message: '请选择业务模式', trigger: 'change' }],
|
||||
customerNames: [{ required: true, message: '请选择客户名称', trigger: 'change' }],
|
||||
carrierNames: [{ required: true, message: '请选择下游承运商', trigger: 'change' }],
|
||||
fundLimit: [
|
||||
@@ -1066,6 +1078,7 @@ export default {
|
||||
],
|
||||
projectScale: [{ label: '项目规模', validator: validateAmount, trigger: 'blur' }],
|
||||
estimatedProfit: [{ label: '预估利润', validator: validateAmount, trigger: 'blur' }],
|
||||
profitRate: [{ label: '利润率', validator: validateAmount, trigger: 'blur' }],
|
||||
fundDemand: [{ label: '履约保证金', validator: validateAmount, trigger: 'blur' }],
|
||||
handlerUserId: [
|
||||
{
|
||||
@@ -1087,9 +1100,6 @@ export default {
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
changeContent: [
|
||||
{ max: 2000, message: '变更内容不能超过2000个字符', trigger: 'blur' },
|
||||
],
|
||||
changeReason: [
|
||||
{ max: 2000, message: '变更原因不能超过2000个字符', trigger: 'blur' },
|
||||
],
|
||||
@@ -1570,6 +1580,7 @@ export default {
|
||||
receivableLimit: this.formatAmount(row.receivableLimit),
|
||||
projectScale: this.normalizeOptionalSentinel(row.projectScale),
|
||||
estimatedProfit: this.normalizeOptionalSentinel(row.estimatedProfit),
|
||||
profitRate: this.normalizeOptionalSentinel(row.profitRate),
|
||||
fundDemand: this.normalizeOptionalSentinel(row.fundDemand),
|
||||
receivableDays: this.normalizeOptionalSentinel(row.receivableDays),
|
||||
paymentDays: this.normalizeOptionalSentinel(row.paymentDays),
|
||||
@@ -1760,8 +1771,9 @@ export default {
|
||||
if (!options.includeChangeType) {
|
||||
delete submitRow.changeType;
|
||||
}
|
||||
// 变更内容字段已下线,提交时始终清空,避免沿用历史值
|
||||
submitRow.changeContent = '';
|
||||
if (this.isNewProjectDialog && !options.includeChangeType) {
|
||||
delete submitRow.changeContent;
|
||||
delete submitRow.changeReason;
|
||||
}
|
||||
['projectIntro', 'profitRemark', 'riskPoint', 'emergencyPlan'].forEach(
|
||||
|
||||
@@ -279,7 +279,7 @@
|
||||
class="voucher-manage-page__upload-progress"
|
||||
/></el-form-item>
|
||||
<el-form-item label="关联运输批次" prop="waybillImportBatchIds"
|
||||
><el-button type="primary" @click="openBatchDialog">选择</el-button></el-form-item
|
||||
><el-button type="primary" @click="openBatchDialog()">选择</el-button></el-form-item
|
||||
>
|
||||
</el-form>
|
||||
</section-card>
|
||||
@@ -886,13 +886,15 @@ watch(uploadVisible, visible => {
|
||||
if (!visible && !closingUploadDialog.value) void stopCurrentUpload(editing.fileTaskId);
|
||||
});
|
||||
const openBatchDialog = async row => {
|
||||
batchDialogMode.value = row ? 'change' : 'upload';
|
||||
batchTarget.value = row;
|
||||
// 按钮 @click 会传入 MouseEvent,不能把事件对象当成凭证行。
|
||||
const voucher = row instanceof Event ? undefined : row;
|
||||
batchDialogMode.value = voucher?.id ? 'change' : 'upload';
|
||||
batchTarget.value = voucher?.id ? voucher : undefined;
|
||||
batchSelection.value = [];
|
||||
batchVisible.value = true;
|
||||
await loadBatches();
|
||||
if (row?.waybillBatchNo) {
|
||||
const currentBatch = batchRows.value.find(item => item.batchNo === row.waybillBatchNo);
|
||||
if (voucher?.waybillBatchNo) {
|
||||
const currentBatch = batchRows.value.find(item => item.batchNo === voucher.waybillBatchNo);
|
||||
if (currentBatch) batchSelection.value = [currentBatch];
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user