Sfoglia il codice sorgente

成本添加第一天排序

yuanrf 11 mesi fa
parent
commit
fbe5602390
1 ha cambiato i file con 12 aggiunte e 2 eliminazioni
  1. 12 2
      src/components/Finance/Cost.vue

+ 12 - 2
src/components/Finance/Cost.vue

@@ -303,7 +303,7 @@
                                         v-model="scope.row[item.prop]"
                                         @change="dateChange(scope.row[item.prop], scope.$index)">
                                     </el-input> -->
-                                    <el-date-picker :clearable="false" size="mini" v-model="scope.row[item.prop]"
+                                    <el-date-picker @change="TimeUpdateAnewOrderby(scope.$index)" :clearable="false" size="mini" v-model="scope.row[item.prop]"
                                         type="date" value-format="yyyy-MM-dd" placeholder="选择日期">
                                     </el-date-picker>
                                 </span>
@@ -5222,7 +5222,6 @@ export default {
                 this.$message.error('日期格式不正确!应该为YYYY-MM-DD格式!');
                 this.tableData[index].date = "";
             }
-
         },
         GetDJLableBJ(lableList) {
             var that = this;
@@ -5600,6 +5599,17 @@ export default {
                 console.log("保存失败,仅停止自动保存!");
                 clearInterval(this.autoSave);
             })
+        },
+        TimeUpdateAnewOrderby(index){
+                if(index == 0 && this.tableData.length > 0){
+                    var start = this.tableData[0].date;
+                    for (var i = 0; i < this.tableData.length; i++) {
+                        if(this.tableData[i].date){
+                            this.tableData[i].date = start;
+                            start = this.addOneDay(start,1)
+                        }
+                    }
+                }
         }
     },
     updated() {