fix:财务模块-付款单页面添加附件补充功能

dev_1.0.2
UNISINSIGHT\rdpnr_jiangpeng 2026-03-10 14:32:45 +08:00
parent d1910e2497
commit 9f11895847
7 changed files with 91 additions and 6 deletions

View File

@ -197,3 +197,13 @@ export function manualWriteOff(data) {
data: data data: data
}) })
} }
// 新增付款单
export function updatePaymentBill(data) {
return request({
url: '/finance/payment/updatePaymentBill',
method: 'post',
data: data,
needLoading: true
})
}

View File

@ -48,7 +48,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="其它特别说明" prop="remark"> <el-form-item label="特别说明" prop="remark">
<el-input v-model="form.remark" type="textarea" <el-input v-model="form.remark" type="textarea"
:rows="2" :rows="2"
style="width: 100%"></el-input> style="width: 100%"></el-input>
@ -56,7 +56,7 @@
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="附件" prop="fileId"> <el-form-item label="附件" prop="fileId">
<file-upload :value="fileList" @file-list-changed="handleFileListChanged" :limit="1" <file-upload :value="fileList" @file-list-changed="handleFileListChanged" :limit="5"
:file-type="['png', 'jpg', 'jpeg', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'pdf']"/> :file-type="['png', 'jpg', 'jpeg', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'pdf']"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -518,6 +518,7 @@ export default {
vendorName: null, vendorName: null,
remark: null, remark: null,
totalPriceWithTax: 0, totalPriceWithTax: 0,
fileId: null,
}; };
this.payableList = []; this.payableList = [];
this.orderList = []; this.orderList = [];
@ -527,6 +528,7 @@ export default {
pageSize: 10 pageSize: 10
}; };
this.total = 0; this.total = 0;
this.fileList = [];
} }
} }
}; };

View File

@ -99,6 +99,16 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20" v-if="detail.fileList == null || detail.fileList.length < 5">
<el-col :span="24">
<div class="detail-item">
<span style="margin-right: 10px">附件补充:</span>
<file-upload :value="fileList" @file-list-changed="handleFileListChanged" :limit="detail.fileList == null ? 5 : 5 - detail.fileList.length"
:file-type="['png', 'jpg', 'jpeg', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'pdf']"/>
<el-button type="primary" size="small" style="margin-left: 10px" @click="handleSaveAttachment"></el-button>
</div>
</el-col>
</el-row>
</div> </div>
</div> </div>
@ -142,6 +152,27 @@ export default {
default: () => {}, default: () => {},
}, },
}, },
data() {
return {
fileList: [],
fileId: null,
};
},
watch: {
visible(newVal) {
if (newVal) {
this.fileList = [];
this.fileId = null;
}
},
detail: {
handler() {
this.fileList = [];
this.fileId = null;
},
deep: true
}
},
dicts:['payment_bill_type','approve_status','payment_status','payment_method'], dicts:['payment_bill_type','approve_status','payment_status','payment_method'],
methods: { methods: {
downloadFile(attachment){ downloadFile(attachment){
@ -158,6 +189,23 @@ export default {
handleClose() { handleClose() {
this.$emit("update:visible", false); this.$emit("update:visible", false);
}, },
handleFileListChanged(fileList) {
this.fileList = fileList;
this.fileId = this.fileList.map(f => f.id).filter(id => !!id).join(',')
},
handleSaveAttachment() {
if (this.fileList.length === 0) {
this.$modal.msgWarning('请先上传附件');
return;
}
const oldFileId = this.detail.fileId;
this.fileId = oldFileId === null || oldFileId === '' ? this.fileId : oldFileId + ',' + this.fileId;
const saveData = {
id: this.detail.id,
fileId: this.fileId,
};
this.$emit('submit', saveData);
},
}, },
}; };
</script> </script>

View File

@ -197,7 +197,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="审批节点" fixed="right" width="80" align="center" prop="approveNode"/> <el-table-column label="审批节点" fixed="right" width="80" align="center" prop="approveNode"/>
<el-table-column label="操作" fixed="right" width="200" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" fixed="right" width="100" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
@ -263,7 +263,7 @@
/> />
<!-- 详情抽屉 --> <!-- 详情抽屉 -->
<detail-drawer :visible.sync="detailOpen" :detail="detailData"></detail-drawer> <detail-drawer :visible.sync="detailOpen" :detail="detailData" @submit="handleUpdatePaymentBillSubmit"></detail-drawer>
<!-- 新增弹窗 --> <!-- 新增弹窗 -->
<add-form :visible.sync="addOpen" :dicts="dict.type" @submit="handleAddSubmit"></add-form> <add-form :visible.sync="addOpen" :dicts="dict.type" @submit="handleAddSubmit"></add-form>
<!-- 回执单弹窗 --> <!-- 回执单弹窗 -->
@ -316,7 +316,9 @@ import {
applyRefund, applyRefund,
addPayment, addPayment,
handleRevoke, handleRevoke,
exportPayment, deletePayment exportPayment,
deletePayment,
updatePaymentBill
} from "@/api/finance/payment"; } from "@/api/finance/payment";
import { addDateRange } from "@/utils/ruoyi"; import { addDateRange } from "@/utils/ruoyi";
import DetailDrawer from "./components/DetailDrawer.vue"; import DetailDrawer from "./components/DetailDrawer.vue";
@ -554,6 +556,16 @@ export default {
timeProcessing(value) { timeProcessing(value) {
if (value === null || value === undefined || value === '') return ''; if (value === null || value === undefined || value === '') return '';
return value.substring(0, 10); return value.substring(0, 10);
},
handleUpdatePaymentBillSubmit(form) {
console.log(form);
updatePaymentBill(form).then(response => {
this.$modal.msgSuccess("保存成功");
this.detailOpen = false;
}).catch(error => {
console.error("保存补充附件失败", error);
this.$modal.msgError("保存失败");
});
} }
} }
}; };

View File

@ -297,6 +297,10 @@ public class OmsPaymentBillController extends BaseController
} }
} }
@PostMapping("/updatePaymentBill")
@ResponseBody
public AjaxResult updatePaymentBill(@RequestBody OmsPaymentBill paymentBill) {
return toAjax(omsPaymentBillService.updatePaymentBill(paymentBill));
}
} }

View File

@ -117,4 +117,7 @@ public interface IOmsPaymentBillService
void deleteFile(Long id); void deleteFile(Long id);
PaymentBillDetailDTO queryByCode(String paymentBillCode); PaymentBillDetailDTO queryByCode(String paymentBillCode);
int updatePaymentBill(OmsPaymentBill omsPaymentBill);
} }

View File

@ -731,4 +731,10 @@ public class OmsPaymentBillServiceImpl implements IOmsPaymentBillService , TodoC
paymentBillDetailDTO.setPayableDetails(paymentBillPayableDetailDTOS); paymentBillDetailDTO.setPayableDetails(paymentBillPayableDetailDTOS);
return paymentBillDetailDTO; return paymentBillDetailDTO;
} }
@Override
public int updatePaymentBill(OmsPaymentBill omsPaymentBill) {
return omsPaymentBillMapper.updateOmsPaymentBill(omsPaymentBill);
}
} }