xg
“linengliang”
2024-03-14 1a5ab0d78c55273b173397ebd8ed06b0ba8978cd
src/views/eam/EquipmentMaintenancePlanList.vue
@@ -23,6 +23,23 @@
              ></j-input>
            </a-form-item>
          </a-col>
           <!-- 按创建时间范围检索 -->
          <a-col
            :xl="6"
            :lg="7"
            :md="8"
            :sm="24">
            <a-form-item label="创建时间">
              <a-range-picker
                v-model="ranges"
                style="width:100%"
                format="YYYY-MM-DD HH:mm:ss"
                showTime
                placeholder="请选择创建时间"
                @change="changeDate"
              />
            </a-form-item>
          </a-col>
          <a-col
            :xl="6"
            :lg="7"
@@ -37,6 +54,8 @@
              />
            </a-form-item>
          </a-col>
          <a-col
            :xl="6"
            :lg="7"
@@ -267,6 +286,7 @@
  data() {
    return {
      description: '保养计划管理页面',
      ranges:[],
      // 表头
      columns: [
        {
@@ -383,6 +403,11 @@
      this.equipmentMaintenancePlanDetailMainId = selectionRows[0]['id']
      this.mainStatus = selectionRows[0]['status']
    },
    searchReset() {
      this.queryParam = {}
      this.ranges = []
      this.loadData()
    },
    loadData(arg) {
      if (!this.url.list) {
        this.$message.error("请设置url.list属性!")
@@ -466,7 +491,19 @@
      }).finally(res => {
        this.loadData();
      })
    }
    },
    // 将ranges转化为开始时间和结束时间
    changeDate() {
      if (this.ranges.length === 0) {
        this.queryParam.beginTime = ''
        this.queryParam.endTime = ''
      } else {
        //后端报这个错rejected value ["2024-03-14T06:26:38.692Z"]
        this.queryParam.beginTime = this.ranges[0].format('YYYY-MM-DD')
        this.queryParam.endTime = this.ranges[1].format('YYYY-MM-DD')
      }
    },
  }
}
</script>