feat(sip): 新增项目产品信息备份与恢复功能

- 添加 ProjectProductInfoBakService 接口定义备份和恢复方法
- 实现 ProjectProductInfoBakServiceImpl 类逻辑
- 提供 saveBakData 方法用于保存备份数据
- 提供 restoreData 方法用于恢复指定版本的数据
- 在恢复前校验备份数据是否存在
dev_1.0.0
chenhao 2025-11-25 09:00:26 +08:00
parent 2a9cf42a06
commit d74613d83f
3 changed files with 23 additions and 7 deletions

View File

@ -72,8 +72,8 @@ export default {
title: process.env.VUE_APP_TITLE,
codeUrl: "",
loginForm: {
username: "admin",
password: "admin@123",
username: "",
password: "",
rememberMe: false,
code: ""
},

View File

@ -33,7 +33,7 @@
</el-table-column>
<el-table-column label="目录单价(¥)" width="120" prop="cataloguePrice">
<template slot-scope="scope">
<el-input v-model="scope.row.cataloguePriceFormat" readonly size="small"></el-input>
<el-input v-model="scope.row.cataloguePriceFormat" :readonly="!isCataloguePriceEditable(scope.row)" size="small" @blur="handleCataloguePriceChange(scope.row)"></el-input>
</template>
</el-table-column>
<el-table-column label="指导折扣(%)" width="100" prop="guidanceDiscount">
@ -114,7 +114,7 @@
</el-table-column>
<el-table-column label="目录单价(¥)" width="120" prop="cataloguePrice">
<template slot-scope="scope">
<el-input v-model="scope.row.cataloguePriceFormat" readonly size="small"></el-input>
<el-input v-model="scope.row.cataloguePriceFormat" :readonly="!isCataloguePriceEditable(scope.row)" size="small" @blur="handleCataloguePriceChange(scope.row)"></el-input>
</template>
</el-table-column>
<el-table-column label="指导折扣(%)" width="100" prop="guidanceDiscount">
@ -195,7 +195,7 @@
</el-table-column>
<el-table-column label="目录单价(¥)" width="120" prop="cataloguePrice">
<template slot-scope="scope">
<el-input v-model="scope.row.cataloguePriceFormat" readonly size="small"></el-input>
<el-input v-model="scope.row.cataloguePriceFormat" :readonly="!isCataloguePriceEditable(scope.row)" size="small" @blur="handleCataloguePriceChange(scope.row)"></el-input>
</template>
</el-table-column>
<el-table-column label="指导折扣(%)" width="100" prop="guidanceDiscount">
@ -286,7 +286,8 @@ export default {
selectProductVisible: false,
currentProductType: '1', // 1: 2: 11,22,99:
currentEditType: '', // software, hardware, maintenance
currentEditIndex: -1
currentEditIndex: -1,
editableProductBomCodes: ['8813A3YA','8813A3YB','8813A7U4','8813A7U2']
};
},
computed: {
@ -527,6 +528,21 @@ export default {
hardwareProjectProductInfoList: this.hardwareList,
maintenanceProjectProductInfoList: this.maintenanceList
};
},
isCataloguePriceEditable(row) {
return !this.isActionDisabled && this.editableProductBomCodes.includes(row.productBomCode);
},
handleCataloguePriceChange(row) {
let cataloguePrice = parseFloat(String(row.cataloguePriceFormat).replace(/,/g, ''));
if (isNaN(cataloguePrice)) {
cataloguePrice = 0;
}
row.cataloguePrice = this.preciseCurrencyRound(cataloguePrice, 2);
row.cataloguePriceFormat = this.formatAmount(row.cataloguePrice);
// Recalculate based on new catalogue price
this.calculateRow(row);
this.emitChange();
}
}
};

View File

@ -377,8 +377,8 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
serviceInfo.setServiceLevel(productInfo.getProductBomCode());
serviceInfo.setServiceDescribe(productInfo.getProductDesc());
serviceInfo.setServiceStartTime(startTime);
serviceInfo.setServiceEndTime(DateUtils.addYears(startTime, year));
startTime = DateUtils.addYears(startTime, year);
serviceInfo.setServiceEndTime(DateUtils.addDays(startTime, -1));
serviceInfoList.add(serviceInfo);
return startTime;
}