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

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