唐耀东
2022-02-07 0efb10e3999d1bcb7cc65008b067836ddd71c82c
src/views/device/peripheralUnit/index.vue
@@ -227,7 +227,7 @@
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
        <el-button :loading="buttonLoading" type="primary" @click="submitForm" :disabled="disabled">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </Dialog>
@@ -236,7 +236,7 @@
    <Dialog :title="title" :visible.sync="uploadFlag" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="附件">
          <fileUpload v-model="form.filePath" limit="1"/>
          <fileUpload v-model="form.filePath" :limit="1"/>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
@@ -358,12 +358,12 @@
  },
  created() {
    this.getList();
    this.getManufacturerList();
  },
  methods: {
    getManufacturerList() {
      listManufacturer().then(res => {
        this.manufacturerList = res.data
        this.manufacturerList = res.data;
      })
    },
    /** 查询外设单元列表 */
@@ -373,6 +373,7 @@
        this.peripheralUnitList = response.rows;
        this.total = response.total;
        this.loading = false;
        this.getManufacturerList();
      });
    },
    // 取消按钮
@@ -440,7 +441,7 @@
        this.loading = false;
        this.form = response.data;
        this.open = true;
        this.title = "修改外设单元";
        this.title = "查看外设单元";
      });
    },
    /** 修改按钮操作 */
@@ -448,11 +449,12 @@
      this.loading = true;
      this.disabled = false
      this.reset();
      this.getManufacturerList();
      //this.getManufacturerList();
      const id = row.id || this.ids
      getPeripheralUnit(id).then(response => {
        this.loading = false;
        this.form = response.data;
        this.form.manufacturer = parseInt(this.form.manufacturer);
        this.open = true;
        this.title = "修改外设单元";
      });
@@ -461,6 +463,12 @@
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if(this.uploadFlag){
            if(!this.form.filePath){
              this.$modal.msgWarning("请选择上传附件");
              return;
            }
          }
          this.buttonLoading = true;
          if (this.form.id != null) {
            updatePeripheralUnit(this.form).then(response => {