Merge remote-tracking branch 'refs/remotes/origin/master' into feature/bfi-api-rate
# Conflicts: # pnpm-lock.yaml # src/axios.js # src/views/settlement/formal-settlement.vue # src/views/vehicle/customer-archive.vue
This commit is contained in:
@@ -136,6 +136,7 @@ export default {
|
||||
syncLoading: { type: Boolean, default: false },
|
||||
page: { type: Object, required: true },
|
||||
hasPermission: { type: Function, required: true },
|
||||
mkEnabled: { type: Boolean, default: false },
|
||||
},
|
||||
emits: [
|
||||
'create',
|
||||
@@ -195,7 +196,10 @@ export default {
|
||||
actions.push({ type: 'delete', label: '删除', danger: true });
|
||||
if (this.hasPermission('formal_settlement_submit') && this.isEditable(row))
|
||||
actions.push({ type: 'submit', label: '提交' });
|
||||
if (this.hasPermission('formal_settlement_approve') && row.approvalStatus === 'reviewing') {
|
||||
if (this.mkEnabled && this.hasPermission('formal_settlement_approve') && row.approvalStatus === 'reviewing') {
|
||||
actions.push({ type: 'mkAudit', label: '流程' });
|
||||
}
|
||||
if (!this.mkEnabled && this.hasPermission('formal_settlement_approve') && row.approvalStatus === 'reviewing') {
|
||||
actions.push({ type: 'approve', label: '通过' });
|
||||
actions.push({ type: 'return', label: '驳回', danger: true });
|
||||
}
|
||||
|
||||
@@ -966,6 +966,7 @@ import {
|
||||
import { downloadFileByUrl } from '@/utils/util';
|
||||
import { submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
import * as XLSX from 'xlsx';
|
||||
import { isAdministrator } from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
name: 'PreSettlementEditor',
|
||||
@@ -1164,10 +1165,7 @@ export default {
|
||||
return !this.readonly && ['draft', 'returned'].includes(this.form.approvalStatus);
|
||||
},
|
||||
isAdmin() {
|
||||
const authority = this.userInfo?.authority;
|
||||
return Array.isArray(authority)
|
||||
? authority.includes('admin')
|
||||
: String(authority || '').includes('admin');
|
||||
return isAdministrator(this.userInfo);
|
||||
},
|
||||
canAdjustDetail() {
|
||||
return this.editable && this.hasPermission('pre_settlement_adjust');
|
||||
@@ -1611,12 +1609,13 @@ export default {
|
||||
await this.loadDetail();
|
||||
await this.persistPendingAdjustments();
|
||||
if (shouldSubmit) {
|
||||
const previousApprovalStatus = this.form.approvalStatus || '';
|
||||
await submit({ id: this.form.id });
|
||||
await submitMkApprovalFlow({
|
||||
bizType: 'pre-settlement',
|
||||
formInstanceId: this.form.id,
|
||||
bizId: this.form.id,
|
||||
subjectName: this.form.preSettlementNo || this.form.contractName || '',
|
||||
approvalStatus: this.form.approvalStatus || '',
|
||||
approvalStatus: previousApprovalStatus,
|
||||
});
|
||||
this.$message.success('审批流程已发起');
|
||||
this.visible = false;
|
||||
|
||||
@@ -127,6 +127,13 @@
|
||||
</div>
|
||||
<el-button @click="resetInternalQuery">重置</el-button>
|
||||
<el-button type="primary" @click="internalFilterTick++">查询</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
:disabled="!filteredInternalRows.length"
|
||||
@click="exportInternalDetails"
|
||||
>导出</el-button
|
||||
>
|
||||
</div>
|
||||
<el-table
|
||||
:data="filteredInternalRows"
|
||||
@@ -616,6 +623,7 @@
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import * as XLSX from 'xlsx';
|
||||
import * as api from '@/api/settlement/transportReconciliation';
|
||||
import * as formalSettlementApi from '@/api/settlement/formalSettlement';
|
||||
import { getDictionary } from '@/api/system/dictbiz';
|
||||
@@ -1807,6 +1815,63 @@ export default {
|
||||
formatNumber(value) {
|
||||
return Number(value || 0).toFixed(2);
|
||||
},
|
||||
formatExportMoney(value) {
|
||||
if (value === null || value === undefined || value === '' || Number(value) === -1) {
|
||||
return '';
|
||||
}
|
||||
return Number(value || 0).toFixed(2);
|
||||
},
|
||||
formatInternalExportCell(row, column) {
|
||||
if (column.prop === 'matchResult') return this.matchName(row.matchResult);
|
||||
if (column.prop === 'updateResult') return this.updateName(row.updateResult);
|
||||
if (column.prop === 'matchedExternalLineNo') {
|
||||
return this.hasMatchedExternal(row)
|
||||
? this.formatMatchedExternalLineNo(row.matchedExternalLineNo)
|
||||
: '';
|
||||
}
|
||||
if (column.prop === 'transportType') return this.transportTypeLabel(row.transportType);
|
||||
if (column.prop === 'transportQuantity') {
|
||||
return row.transportQuantity === null ||
|
||||
row.transportQuantity === undefined ||
|
||||
row.transportQuantity === ''
|
||||
? ''
|
||||
: Number(row.transportQuantity || 0).toFixed(2);
|
||||
}
|
||||
if (column.feeItemName) {
|
||||
return this.formatExportMoney(this.getFeeItemAmount(row, column.feeItemName));
|
||||
}
|
||||
if (column.prop === 'mileage') {
|
||||
return Number(row.mileage) === -1 ? '' : this.formatExportMoney(row.mileage);
|
||||
}
|
||||
if (column.prop === 'actualDepartureTime' || column.prop === 'actualCompletionTime') {
|
||||
const text = this.formatDate(row[column.prop]);
|
||||
return text === '-' ? '' : text;
|
||||
}
|
||||
if (column.money || column.number) return this.formatExportMoney(row[column.prop]);
|
||||
const value = row[column.prop];
|
||||
return value === null || value === undefined || value === '' ? '' : value;
|
||||
},
|
||||
exportInternalDetails() {
|
||||
if (!this.filteredInternalRows.length) {
|
||||
this.$message.warning('暂无可导出的内部账单明细');
|
||||
return;
|
||||
}
|
||||
const rows = this.filteredInternalRows.map((row, index) => {
|
||||
const result = { 序号: index + 1 };
|
||||
this.internalTableColumns.forEach(column => {
|
||||
result[column.label] = this.formatInternalExportCell(row, column);
|
||||
});
|
||||
return result;
|
||||
});
|
||||
const workbook = XLSX.utils.book_new();
|
||||
XLSX.utils.book_append_sheet(workbook, XLSX.utils.json_to_sheet(rows), '内部账单明细');
|
||||
XLSX.writeFile(
|
||||
workbook,
|
||||
`${this.form.reconciliationNo || '运输对账'}内部账单明细${this.$dayjs().format(
|
||||
'YYYY-MM-DD HH-mm-ss'
|
||||
)}.xlsx`
|
||||
);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user