唐耀东
2022-05-18 7ca1a8ec18fccca9102cd1179e05fdc877bdc511
src/views/construction/constructionBatch/index.vue
@@ -24,7 +24,6 @@
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['oa:constructionBatch:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
@@ -35,7 +34,6 @@
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['oa:constructionBatch:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
@@ -46,7 +44,6 @@
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['oa:constructionBatch:remove']"
        >删除</el-button>
      </el-col>
    </el-row>
@@ -74,7 +71,6 @@
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['oa:constructionBatch:edit']"
          >修改</el-button>
          <el-button
            size="mini"
@@ -82,7 +78,6 @@
            class="del-btn"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['oa:constructionBatch:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
@@ -106,6 +101,7 @@
          <el-date-picker
              v-model="form.date"
              type="daterange"
              value-format="yyyy-MM-dd"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="截至日期">
@@ -142,6 +138,12 @@
export default {
  name: "ConstructionBatch",
  props: {
    schoolId: {
      type: Number,
      default: undefined
    }
  },
  data() {
    return {
      // 按钮loading
@@ -193,6 +195,11 @@
      userList: []
    };
  },
  watch: {
    'schoolId': function () {
      this.getList()
    }
  },
  created() {
    this.getList();
  },
@@ -200,7 +207,7 @@
    /** 查询施工批次列表 */
    getList() {
      this.loading = true;
      listConstructionBatch(this.queryParams).then(response => {
      listConstructionBatch(Object.assign({}, this.queryParams, {schoolId: this.schoolId})).then(response => {
        this.constructionBatchList = response.rows;
        this.total = response.total;
        this.loading = false;
@@ -264,8 +271,9 @@
      const id = row.id || this.ids
      getConstructionBatch(id).then(response => {
        this.loading = false;
        this.form = response.data;
        this.form.date = [this.form.startDate, this.form.endDate]
        // this.form = response.data;
        const localDate = [response.data.startDate, response.data.endDate];
        this.form = Object.assign({}, response.data, {date: localDate})
        this.open = true;
        this.title = "修改施工批次";
      });
@@ -273,11 +281,11 @@
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        console.log(this.form.date)
        this.form.startDate = this.form.date[0];
        this.form.endDate = this.form.date[1];
        if (valid) {
          this.buttonLoading = true;
          this.form.schoolId = this.schoolId;
          if (this.form.id != null) {
            updateConstructionBatch(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");