|
@@ -433,16 +433,18 @@ export default {
|
|
|
let SDate = moment(startDate);
|
|
|
let EDate = moment(endDate);
|
|
|
daysList.push({
|
|
|
- "priceDate": SDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
|
|
|
- });
|
|
|
+ "priceDate": SDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
|
|
|
+ });
|
|
|
while (SDate.add(1, "days").isBefore(EDate)) { // 注意这里add方法处理后SDate对象已经改变。
|
|
|
daysList.push({
|
|
|
"priceDate": SDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
|
|
|
});
|
|
|
}
|
|
|
- daysList.push({
|
|
|
+ if(this.timeValueObj.next != this.timeValueObj.prev){
|
|
|
+ daysList.push({
|
|
|
"priceDate": EDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
|
|
|
});
|
|
|
+ }
|
|
|
let res = await deleteCalendarPriceApi({
|
|
|
"id": this.form.id,
|
|
|
"goodsId": this.form.goodsId,
|
|
@@ -526,13 +528,15 @@ export default {
|
|
|
"costAmount": this.formPrice.costAmount
|
|
|
});
|
|
|
}
|
|
|
- daysList.push({
|
|
|
+ if(this.timeValueObj.next != this.timeValueObj.prev){
|
|
|
+ daysList.push({
|
|
|
"id": null,
|
|
|
"priceDate": EDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
|
|
|
"originalAmount": this.formPrice.originalAmount,
|
|
|
"saleAmount": this.formPrice.saleAmount,
|
|
|
"costAmount": this.formPrice.costAmount
|
|
|
});
|
|
|
+ }
|
|
|
console.log("daysList===",daysList)
|
|
|
daysList.forEach((item,index)=>{
|
|
|
this.perFormList.forEach((item1,index1)=>{
|