修改采购合同媒体信息和付款信息不能被编辑异常

This commit is contained in:
wangchengming 2026-01-07 20:32:21 +08:00
parent 2cc2bc4c86
commit 404cd04a7e

View File

@ -44,76 +44,88 @@
<!-- 媒体信息开始 -->
<template #purchaseMediaBoList>
<div class="table-container">
<el-table
:data="visibleMediaData"
:key="'media-table-' + tableKey"
style="width: 100%"
height="400"
show-summary
:summary-method="mediaTypeSummary"
>
<el-table-column
v-for="column in mediaListColumns"
:key="column.dataIndex"
:prop="column.dataIndex"
:label="column.title"
:width="column.width"
>
<el-table :data="visibleMediaData" :key="'media-table-' + tableKey" style="width: 100%" height="400"
show-summary :summary-method="mediaTypeSummary">
<el-table-column v-for="column in mediaListColumns" :key="column.dataIndex" :prop="column.dataIndex"
:label="column.title" :width="column.width">
<template #default="scope">
<template v-if="column.slot">
<!-- 城市选择 -->
<template v-if="column.dataIndex === 'cityId'">
<el-custom-cascader
v-model="scope.row.cityIds"
:dataSource="cityList"
<el-custom-cascader v-model="scope.row.cityIds" :dataSource="cityList"
:cascaderStyle="{ width: '100%' }"
@change="(v, t) => { scope.row.cityId = v; scope.row.cityName = t; }"
/>
@change="(v, t) => { scope.row.cityId = v; scope.row.cityName = t; }" />
</template>
<!-- 媒体类型 -->
<template v-else-if="column.dataIndex === 'mediaId'">
<el-custom-select
v-model="scope.row.mediaId"
:dataSource="mediaTypeList"
:remoteAdd="handleAddMediaTypeParty"
@change="(v, t) => (scope.row.mediaName = t)"
/>
<el-custom-select v-model="scope.row.mediaId" :dataSource="mediaTypeList"
:remoteAdd="handleAddMediaTypeParty" @change="(v, t) => (scope.row.mediaName = t)" />
</template>
<!-- 媒体位置 -->
<template v-else-if="column.dataIndex === 'mediaPosition'">
<el-input v-model="scope.row.mediaPosition"></el-input>
</template>
<!-- 采购数量 -->
<template v-else-if="column.dataIndex === 'accountNumber'">
<el-input type="number" v-model="scope.row.accountNumber"></el-input>
</template>
<!-- 发布频次 -->
<template v-else-if="column.dataIndex === 'releaseFrequency'">
<el-input v-model="scope.row.releaseFrequency"></el-input>
</template>
<!-- 上刊时间 -->
<template v-else-if="column.dataIndex === 'upTime'">
<el-date-picker
v-model="scope.row.upTime"
value-format="yyyy-MM-dd"
style="width: 100%"
/>
<el-date-picker v-model="scope.row.upTime" value-format="yyyy-MM-dd" style="width: 100%" />
</template>
<!-- 下刊时间 -->
<template v-else-if="column.dataIndex === 'downTime'">
<el-date-picker
v-model="scope.row.downTime"
value-format="yyyy-MM-dd"
style="width: 100%"
/>
<el-date-picker v-model="scope.row.downTime" value-format="yyyy-MM-dd" style="width: 100%" />
</template>
<!-- 周期 -->
<template v-else-if="column.dataIndex === 'period'">
{{ delayPeriodDate(scope.row) }}
</template>
<!-- 刊例价 -->
<template v-else-if="column.dataIndex === 'printPrice'">
<el-input type="number" v-model="scope.row.printPrice"></el-input>
</template>
<!-- 刊例价单位 -->
<template v-else-if="column.dataIndex === 'printPriceUnit'">
<el-input v-model="scope.row.printPriceUnit"></el-input>
</template>
<!-- 折扣 -->
<template v-else-if="column.dataIndex === 'discount'">
<div class="flexRowCenter">
<el-input
v-model="scope.row.discount"
@change="handleNumberChange(scope.row.discount, $event)"
></el-input>
<el-input v-model="scope.row.discount"
@change="handleNumberChange(scope.row.discount, $event)"></el-input>
</div>
</template>
<!-- 媒体费 -->
<template v-else-if="column.dataIndex === 'mediaFee'">
<el-input type="number" v-model="scope.row.mediaFee"></el-input>
</template>
<!-- 制作费 -->
<template v-else-if="column.dataIndex === 'productFee'">
<el-input type="number" v-model="scope.row.productFee"></el-input>
</template>
<!-- 备注 -->
<template v-else-if="column.dataIndex === 'remark'">
<el-input type="textarea" v-model="scope.row.remark"></el-input>
</template>
<!-- 默认显示 -->
<template v-else>
{{ scope.row[column.dataIndex] }}
@ -124,7 +136,7 @@
</template>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template #default="scope">
<el-button link type="danger" @click="removeMediaRow(scope.$index)">
@ -133,18 +145,12 @@
</template>
</el-table-column>
</el-table>
<div class="table-actions">
<el-button type="primary" @click="addMediaRow">新增媒体</el-button>
<el-pagination
v-if="mediaTableData.length > pageSize"
small
layout="prev, pager, next"
:total="mediaTableData.length"
:page-size="pageSize"
:current-page="mediaCurrentPage"
@current-change="handleMediaPageChange"
/>
<el-pagination v-if="mediaTableData.length > pageSize" small layout="prev, pager, next"
:total="mediaTableData.length" :page-size="pageSize" :current-page="mediaCurrentPage"
@current-change="handleMediaPageChange" />
</div>
</div>
</template>
@ -153,21 +159,10 @@
<!-- 付款管理开始 -->
<template #purchasePaymentBoList>
<div class="table-container">
<el-table
:data="visiblePaymentData"
:key="'payment-table-' + tableKey"
style="width: 100%"
height="400"
show-summary
:summary-method="paymentSummary"
>
<el-table-column
v-for="column in contranctPayListColumns"
:key="column.dataIndex"
:prop="column.dataIndex"
:label="column.title"
:width="column.width"
>
<el-table :data="visiblePaymentData" :key="'payment-table-' + tableKey" style="width: 100%" height="400"
show-summary :summary-method="paymentSummary">
<el-table-column v-for="column in contranctPayListColumns" :key="column.dataIndex" :prop="column.dataIndex"
:label="column.title" :width="column.width">
<template #default="scope">
<template v-if="column.slot">
<!-- 笔数 -->
@ -180,25 +175,26 @@
<el-option value="第5笔" label="第5笔"></el-option>
</el-select>
</template>
<!-- 定付款时间 -->
<template v-else-if="column.dataIndex === 'payTime'">
<el-date-picker
v-model="scope.row.payTime"
value-format="yyyy-MM-dd"
style="width: 100%"
/>
<el-date-picker v-model="scope.row.payTime" value-format="yyyy-MM-dd" style="width: 100%" />
</template>
<!-- 约定付款金额 -->
<template v-else-if="column.dataIndex === 'conventionArrivalMoney'">
<el-input type="number" v-model="scope.row.conventionArrivalMoney"></el-input>
</template>
<!-- 实际付款时间 -->
<template v-else-if="column.dataIndex === 'arrivalTime'">
<el-date-picker
v-model="scope.row.arrivalTime"
value-format="yyyy-MM-dd"
style="width: 100%"
/>
<el-date-picker v-model="scope.row.arrivalTime" value-format="yyyy-MM-dd" style="width: 100%" />
</template>
<!-- 实际付款金额 -->
<template v-else-if="column.dataIndex === 'actualArrivalMoney'">
<el-input type="number" v-model="scope.row.actualArrivalMoney"></el-input>
</template>
<!-- 是否逾期 -->
<template v-else-if="column.dataIndex === 'isOverdue'">
<el-select v-model="scope.row.isOverdue">
@ -206,21 +202,18 @@
<el-option :value="1" label="是"></el-option>
</el-select>
</template>
<!-- 逾期时间 -->
<template v-else-if="column.dataIndex === 'overdueDay'">
{{ delayDate(scope.row) }}
</template>
<!-- 附件 -->
<template v-else-if="column.dataIndex === 'annex'">
<el-file-upload
:key="`annex_${scope.row.id || scope.row.tempId}_${tableKey}`"
listType="list"
:uploadStyle="{ width: '336px' }"
/>
<el-file-upload :key="`annex_${scope.row.id || scope.row.tempId}_${tableKey}`" listType="list"
:uploadStyle="{ width: '336px' }" />
</template>
<!-- 默认显示 -->
<template v-else>
{{ scope.row[column.dataIndex] }}
@ -231,7 +224,7 @@
</template>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template #default="scope">
<el-button link type="danger" @click="removePaymentRow(scope.$index)">
@ -240,18 +233,12 @@
</template>
</el-table-column>
</el-table>
<div class="table-actions">
<el-button type="primary" @click="addPaymentRow">新增付款</el-button>
<el-pagination
v-if="paymentTableData.length > pageSize"
small
layout="prev, pager, next"
:total="paymentTableData.length"
:page-size="pageSize"
:current-page="paymentCurrentPage"
@current-change="handlePaymentPageChange"
/>
<el-pagination v-if="paymentTableData.length > pageSize" small layout="prev, pager, next"
:total="paymentTableData.length" :page-size="pageSize" :current-page="paymentCurrentPage"
@current-change="handlePaymentPageChange" />
</div>
</div>
</template>
@ -366,14 +353,14 @@ export default {
}
return total;
},
//
visibleMediaData() {
const start = (this.mediaCurrentPage - 1) * this.pageSize;
const end = start + this.pageSize;
return this.mediaTableData.slice(start, end);
},
//
visiblePaymentData() {
const start = (this.paymentCurrentPage - 1) * this.pageSize;
@ -403,19 +390,19 @@ export default {
processColumns(columns) {
return columns.map(column => ({
...column,
slot: !!column.scopedSlots || ['cityId', 'mediaId', 'upTime', 'downTime', 'period', 'discount',
'transactionsNumber', 'payTime', 'arrivalTime', 'isOverdue', 'overdueDay', 'annex'].includes(column.dataIndex)
slot: !!column.scopedSlots || ['cityId', 'mediaId', 'upTime', 'downTime', 'period', 'discount', 'mediaPosition', 'accountNumber', 'releaseFrequency', 'printPrice', 'printPriceUnit', 'mediaFee', 'productFee', 'remark',
'transactionsNumber', 'payTime', 'arrivalTime', 'isOverdue', 'overdueDay', 'annex', 'conventionArrivalMoney', 'actualArrivalMoney'].includes(column.dataIndex)
}));
},
async getDetailData(id) {
if (this._loading) return;
this._loading = true;
try {
//
this.resetFormData();
const res = await getAction(`/system/purchase/${id}`);
if (!res.data) {
console.error('获取到的数据为空');
@ -429,7 +416,7 @@ export default {
// -
let mediaData = [];
let paymentData = [];
if (formModel.purchaseMediaVoList && Array.isArray(formModel.purchaseMediaVoList)) {
// 200
const rawData = formModel.purchaseMediaVoList.slice(0, 200);
@ -448,7 +435,7 @@ export default {
//
this.AEform.formModel = formModel;
//
this.mediaTableData = mediaData;
this.paymentTableData = paymentData;
@ -476,7 +463,7 @@ export default {
this._loading = false;
}
},
setFileUploadData(fileData) {
try {
const setFileList = (ref, list) => {
@ -503,7 +490,7 @@ export default {
this.mediaCurrentPage = 1;
this.paymentCurrentPage = 1;
this.tableKey = Date.now();
this.$nextTick(() => {
const resetFileUpload = (ref) => {
if (ref && typeof ref.setFileList === 'function') {
@ -514,7 +501,7 @@ export default {
}
}
};
resetFileUpload(this.$refs.contractAccess);
resetFileUpload(this.$refs.detectPicAttr);
resetFileUpload(this.$refs.upPrint);
@ -830,7 +817,7 @@ export default {
.table-container {
margin-bottom: 20px;
.table-actions {
display: flex;
justify-content: space-between;