diff --git a/src/views/costManagement/subjectFeeMaintenance.vue b/src/views/costManagement/subjectFeeMaintenance.vue
index 620a51f7..df39e5ef 100644
--- a/src/views/costManagement/subjectFeeMaintenance.vue
+++ b/src/views/costManagement/subjectFeeMaintenance.vue
@@ -22,10 +22,10 @@
新增
删除
- 成本计算
+
- 导入
+
@@ -68,10 +68,11 @@
format="YYYY年MM月"
value-format="YYYY-MM"
:disabled="title == '详情'"
+ :disabled-date="disabledDate"
>
-
+
按金额
按比例
@@ -81,7 +82,7 @@
v-model="maintainForm.totalCost"
controls-position="right"
:min="1"
- :disabled="title == '详情'"
+ :disabled="title == '详情' || maintainForm.distributeType == 1"
>
@@ -93,9 +94,10 @@
changeRatio(val,scope.row)"
+ :disabled="title == '详情' || maintainForm.distributeType == 1"
>
@@ -105,7 +107,8 @@
v-model="scope.row.money"
controls-position="right"
:min="1"
- :disabled="title == '详情'"
+ :disabled="title == '详情' || maintainForm.distributeType == 2"
+ @change="changePrice"
>
@@ -237,7 +240,7 @@ export default {
searchLabelPosition: 'left',
searchGutter: 24,
searchSpan: 6,
- menuAlign: 'left',
+ menuAlign: 'center',
gridBtn: false,
searchMenuPosition: 'right',
addBtnIcon: ' ',
@@ -328,6 +331,49 @@ export default {
},
mounted() {},
methods: {
+ disabledDate(time) {
+ // 获取当前时间的年月
+ const now = new Date();
+ const currentYear = now.getFullYear();
+ const currentMonth = now.getMonth(); // 0-11
+
+ // 获取传入日期的年月
+ const targetYear = time.getFullYear();
+ const targetMonth = time.getMonth(); // 0-11
+
+ // 如果年份小于当前年份,或者年份相同但月份小于当前月份,则禁用
+ return (targetYear < currentYear) || (targetYear === currentYear && targetMonth < currentMonth);
+ },
+ changeType(val){
+ console.log('val---------------------',val)
+ if(val == 1){
+ this.tableData.map(item =>{
+ item.ratio = 0
+ })
+ }
+ },
+ changePrice(val){
+ console.log('val---------------------',val)
+ if(this.maintainForm.distributeType == 1){
+ const totalMoney = this.tableData.reduce((sum, item) => {
+ // 确保 item.money 是数字类型,如果是 null 或 undefined 则视为 0
+ return sum + (Number(item.money) || 0);
+ }, 0);
+ this.maintainForm.totalCost = totalMoney;
+
+ }else{
+ return
+ }
+ },
+ changeRatio(val,row){
+ console.log('val=============',val)
+ console.log('row=============',row)
+ if(this.maintainForm.distributeType == '2'){
+ row.money = this.maintainForm.totalCost * (val / 100)
+ }else{
+ return
+ }
+ },
// 点击导入按钮
handleImport() {
this.isShowImport = true;
@@ -380,6 +426,11 @@ export default {
this.title = '维护';
this.maintainForm = { ...row, month: row.month || this.getCurrentMonth() };
this.tableData = row.tableData;
+ if(this.maintainForm.distributeType == 1){
+ this.tableData.map(item =>{
+ item.ratio = 0
+ })
+ }
this.showMaintain = true;
},
// 获取当前月份