黄何裕
2024-07-30 1995e710dcf70e635c4edaa8173f8b66cd67d499
src/views/system/unit/index.vue
@@ -31,8 +31,8 @@
        ></el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        <el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
@@ -44,7 +44,7 @@
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:unit:add']"
          v-hasPermi="['unit:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
@@ -55,7 +55,7 @@
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:unit:edit']"
          v-hasPermi="['unit:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
@@ -66,7 +66,7 @@
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:unit:remove']"
          v-hasPermi="['unit:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
@@ -76,7 +76,7 @@
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:unit:export']"
          v-hasPermi="['unit:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@@ -89,7 +89,7 @@
      <el-table-column label="单位联系人" align="center" prop="unitContact" />
      <el-table-column label="单位联系人电话" align="center" prop="unitContactPhone" />
      <el-table-column label="单位管理员账号" align="center" prop="unitAdminAccount" />
      <el-table-column label="备注" align="center" prop="remark" />
      <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip/>
      <el-table-column label="添加时间" align="center" prop="createTime" />
      <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
        <template slot-scope="scope">
@@ -98,14 +98,14 @@
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:unit:edit']"
            v-hasPermi="['unit:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:unit:remove']"
            v-hasPermi="['unit:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
@@ -129,7 +129,7 @@
          <el-input v-model="form.unitName" placeholder="请输入单位名称" />
        </el-form-item>
        <el-form-item label="单位账号" prop="unitAdminAccount">
          <el-input v-model="form.unitAdminAccount" placeholder="请输入单位管理员账号" />
          <el-input v-model="form.unitAdminAccount" placeholder="请输入单位管理员账号" :disabled="account" />
        </el-form-item>
        <el-form-item label="单位联系人" prop="unitContact">
          <el-input v-model="form.unitContact" placeholder="请输入单位联系人" />
@@ -138,12 +138,12 @@
          <el-input v-model="form.unitContactPhone" placeholder="请输入单位联系人电话" />
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" maxlength="100" show-word-limit autosize type="textarea" placeholder="备注信息" />
          <el-input v-model="form.remark" maxlength="100" show-word-limit rows="3" type="textarea" placeholder="备注信息" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
        <el-button type="primary" @click="submitForm">确 定</el-button>
      </div>
    </el-dialog>
  </div>
@@ -156,6 +156,8 @@
  name: "Unit",
  data() {
    return {
      // 账号不可修改
      account: true,
      // 遮罩层
      loading: true,
      // 选中数组
@@ -267,6 +269,8 @@
    /** 重置按钮操作 */
    resetQuery() {
      this.daterangeCreateTime = [];
      this.queryParams.start = null;
      this.queryParams.end = null;
      this.resetForm("queryForm");
      this.handleQuery();
    },
@@ -278,12 +282,14 @@
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.account = false;
      this.reset();
      this.open = true;
      this.title = "添加运维单位";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.account = true;
      this.reset();
      const id = row.id || this.ids
      getUnit(id).then(response => {
@@ -324,7 +330,7 @@
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/unit/export', {
      this.download('yw-unit/export', {
        ...this.queryParams
      }, `unit_${new Date().getTime()}.xlsx`)
    }