Explorar o código

新安全责任书

luojun hai 1 ano
pai
achega
fcc3af5550

+ 38 - 0
src/api/safetyBookNew/index.js

@@ -0,0 +1,38 @@
+import request from '@/utils/request'
+
+// 查询列表安全责任书
+export function listSafetyBook(data) {
+  return request({
+    url: '/core/safetyBooknew/list',
+    method: 'post',
+    data: data
+  })
+}
+
+
+// 查询详细安全责任书
+export function getSafetyBook(id) {
+  return request({
+    url: '/core/safetyBooknew/' + id,
+    method: 'get'
+  })
+}
+
+// 新增/编辑安全责任书
+export function editOrAdd(data) {
+  return request({
+    url: '/core/safetyBooknew/editOrAdd',
+    method: 'post',
+    data: data
+  })
+}
+
+
+
+// 删除安全责任书
+export function delSafetyBook(ids) {
+  return request({
+    url: '/core/safetyBooknew/' + ids,
+    method: 'delete'
+  })
+}

+ 273 - 0
src/views/safetyBook/newBook/dialog.des.vue

@@ -0,0 +1,273 @@
+<template>
+  <div class="rule-type">
+    <DialogCom
+      :title="id ? '安全责任书存档记录详情' : '新增安全责任书存档记录'"
+      :visible.sync="isShow"
+      @close="onHide"
+      width="1200px"
+    >
+      <div class="page-body">
+        <el-form
+          :model="formData"
+          :rules="formDataRules"
+          size="small"
+          ref="form"
+          label-position="right"
+          label-width="180px"
+          label-prefix=":"
+        >
+          <el-descriptions
+            class="margin-top"
+            :column="1"
+            size="medium"
+            border
+            :label-style="labelStyle"
+            :contentStyle="content_style"
+          >
+          <el-descriptions-item
+              labelClassName="gx_info_label"
+              label="签署层级"
+            >
+              {{ getLabel(dict.type.sign_level, formData.signLevel) }}
+            </el-descriptions-item>
+            <el-descriptions-item
+              labelClassName="gx_info_label"
+              label="签署责任书类型"
+            >
+              {{ getLabel(dict.type.safety_book_type, formData.type) }}
+            </el-descriptions-item>
+            <el-descriptions-item
+              labelClassName="gx_info_label"
+              label="所属年度"
+            >
+              {{ formData.year }}
+            </el-descriptions-item>
+            <!-- <el-form-item prop="orgName" label="签署人所在机构:" >
+                  <el-input
+                :readonly="true"
+                v-model="formData.orgName"
+                :disabled="true"
+              ></el-input>
+               
+              </el-form-item> -->
+            <el-descriptions-item labelClassName="gx_info_label" label="甲方">
+              {{ formData.partyA }}
+            </el-descriptions-item>
+            <el-descriptions-item
+              labelClassName="gx_info_label"
+              label="甲方机构"
+            >
+              {{ formData.partyAOrg }}
+            </el-descriptions-item>
+            <el-descriptions-item labelClassName="gx_info_label" label="乙方">
+              {{ formData.partyB }}
+            </el-descriptions-item>
+            <el-descriptions-item
+              labelClassName="gx_info_label"
+              label="乙方机构"
+            >
+              {{ formData.partyBOrgName }}
+            </el-descriptions-item>
+            <el-descriptions-item
+              labelClassName="gx_info_label"
+              label="签署时间"
+            >
+              {{
+                formData.time
+                  ? dayjs(formData.time).format("YYYY年MM月DD日")
+                  : ""
+              }}
+            </el-descriptions-item>
+            <el-descriptions-item
+              labelClassName="gx_info_label"
+              label="签署文件"
+            >
+            <div
+              v-for="(file, index) in formData.files"
+              :key="index"
+              class="container"
+            >
+              <el-image
+                class="item"
+                v-if="isPic(file.url)"
+                :src="file.url"
+                :preview-src-list="[file.url]"
+                fit="contain"
+              ></el-image>
+              <div v-else="isPic(file.url)">
+                <el-link :href="file.url" :underline="false" target="_blank">
+                  <span class="el-icon-document"> {{ file.name }} </span>
+                </el-link>
+              </div>
+            </div>
+            </el-descriptions-item>
+          </el-descriptions>
+        </el-form>
+      </div>
+
+      <div slot="footer" class="dialog-footer" style="margin-top: 10px">
+        <el-button @click="isShow = false">确定</el-button>
+        <!-- <el-button type="primary" @click="onSubmit">确定</el-button> -->
+      </div>
+    </DialogCom>
+    <!-- <DialogSelect ref="DialogSelect" @success="getSign"></DialogSelect> -->
+  </div>
+</template>
+
+<script>
+import { mapState, mapMutations } from "vuex";
+import { getLabel } from "@/views/commonOption.js";
+import {
+  listSafetyBook,
+  getSafetyBook,
+  editOrAdd,
+  delSafetyBook,
+} from "@/api/safetyBookNew/index";
+import { deptTreeSelect } from "@/api/system/public";
+//   import DialogSelect from "./dialog.sign";
+import dayjs from "dayjs";
+export default {
+  dicts: ["safety_book_type","sign_level"],
+  data() {
+    return {
+      labelStyle: {
+        color: "#000",
+        "text-align": "center",
+        height: "40px",
+        "min-width": "150px",
+        "word-break": "keep-all",
+      },
+      content_style: {
+        "text-align": "left",
+        "min-width": "150px",
+        "word-break": "break-all",
+      },
+      id: null,
+      isShow: false,
+      timeClearable: true,
+      formData: this.reset(),
+      tableData: [],
+      //修改新增中的机构树
+      deptOptions: [],
+      formDataRules: {
+        orgId: [{ required: true, message: "请选择签署责任人所在机构" }],
+        type: [{ required: true, message: "请选择签署责任书类型" }],
+        year: [{ required: true, message: "请选择所属年度" }],
+      },
+    };
+  },
+
+  watch: {},
+  computed: {
+    ...mapState([]),
+  },
+  methods: {
+    isPic(url) {
+      if (url.endsWith("jpg") || url.endsWith("png")) {
+        return true;
+      }
+      return false;
+    },
+    getLabel,
+    ...mapMutations([]),
+    dayjs,
+    //添加签署后回调
+    //   getSign(data) {
+    //     this.tableData.push(data);
+    //     // console.log(data, "ddd");
+    //   },
+    //新增签署
+    openSelect() {
+      // this.$refs.DialogSelect.show();
+    },
+    /** 查询机构树数据 */
+    getDeptTree() {
+      deptTreeSelect().then((response) => {
+        this.deptOptions = response.data;
+      });
+    },
+    /** treeSelect组件自定义数据*/
+    tenantIdnormalizer(node, instanceId) {
+      if (node.children && !node.children.length) {
+        delete node.children;
+      }
+      return {
+        id: node.id,
+        label: node.shortName,
+        children: node.children,
+      };
+    },
+    removeRow(row) {
+      this.tableData = this.tableData.filter((item) => item !== row);
+    },
+    reset() {
+      return {
+        id: null,
+        type: null,
+        year: null,
+      };
+    },
+    async refresh(id) {
+      if (id != null && id != undefined) {
+        await getSafetyBook(id).then((res) => {
+          // console.log(res.data,"res")
+          this.formData = res.data;
+          this.tableData = res.data.bookUsers;
+        });
+      }
+    },
+    async show(id) {
+      // console.log(id, "id");
+      this.getDeptTree();
+      this.formData = this.reset();
+      this.tableData = [];
+      this.id = id;
+      await this.refresh(id);
+      this.isShow = true;
+    },
+
+    // 事件
+    onHide() {
+      this.formData = this.reset();
+      this.$refs.form.resetFields();
+    },
+    onSubmit() {
+      console.log(this.formData, "this.formData");
+      this.$refs.form.validate(async (isValidate) => {
+        if (!isValidate) return;
+        this.formData.bookUsers = this.tableData;
+        await editOrAdd(this.formData);
+        this.$emit("success");
+        this.isShow = false;
+      });
+    },
+
+    // 事件
+    //apimark//
+  },
+  mounted() {},
+  components: {},
+};
+</script>
+
+<style lang="scss" scoped>
+.brand_info {
+  .el-form {
+    width: 600px;
+    padding-top: 40px;
+  }
+}
+.container {
+  width: 50px;
+  height: 50px;
+  float: left;
+  .item {
+    width: 100%;
+    height: 100%;
+  }
+  .item img {
+    width: 100% !important;
+    object-fit: cover !important;
+  }
+}
+</style>

+ 305 - 0
src/views/safetyBook/newBook/dialog.edit.vue

@@ -0,0 +1,305 @@
+<template>
+  <div class="rule-type">
+    <DialogCom
+      :title="id ? '编辑安全责任书存档记录' : '新增安全责任书存档记录'"
+      :visible.sync="isShow"
+      @close="onHide"
+      width="700px"
+    >
+      <div class="page-body">
+        <el-form
+          :model="formData"
+          :rules="formDataRules"
+          size="small"
+          ref="form"
+          label-position="right"
+          label-width="180px"
+          label-prefix=":"
+        >
+        <el-form-item prop="signLevel" label="签署层级:">
+            <el-select
+              v-model="formData.signLevel"
+              style="width: 100%"
+              placeholder="请选择签署层级"
+            >
+              <el-option
+                v-for="dict in dict.type.sign_level"
+                :key="dict.value"
+                :label="dict.label"
+                :value="`${dict.value}`"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        <el-form-item prop="type" label="签署责任书类型:">
+            <el-select
+              v-model="formData.type"
+              style="width: 100%"
+              placeholder="请选择签署责任书类型"
+            >
+              <el-option
+                v-for="dict in dict.type.safety_book_type"
+                :key="dict.value"
+                :label="dict.label"
+                :value="`${dict.value}`"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="所属年度:" prop="year">
+            <el-date-picker
+              v-model="formData.year"
+              :clearable="timeClearable"
+              type="year"
+              placeholder="请选择责任书所属年度"
+              value-format="yyyy"
+            >
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item prop="partyA" label="甲方:">
+            <div>
+              <el-input
+                v-model="formData.partyA"
+                placeholder="请输入甲方:"
+              ></el-input>
+            </div>
+          </el-form-item>
+          <el-form-item prop="partyAOrg" label="甲方机构:">
+            <div>
+              <el-input
+                v-model="formData.partyAOrg"
+                placeholder="请输入甲方机构:"
+              ></el-input>
+            </div>
+          </el-form-item>
+          <el-form-item prop="partyB" label="乙方:">
+            <div>
+              <el-input
+                v-model="formData.partyB"
+                placeholder="请输入乙方:"
+              ></el-input>
+            </div>
+          </el-form-item>
+          <el-form-item prop="partyBOrg" label="乙方机构:">
+            <tree-select
+              v-model="formData.partyBOrg"
+              :options="deptOptions"
+              :show-count="true"
+              :normalizer="tenantIdnormalizer"
+              :props="{ checkStrictly: true, label: 'shortName' }"
+              placeholder="请选择乙方所属机构"
+            />
+          </el-form-item>
+          <!-- <el-form-item prop="userIds" label="签署人:">
+            <div>
+              <el-input
+                :readonly="true"
+                v-model="joinedStringArray"
+                placeholder="点击选择"
+              ></el-input>
+              <el-button @click="selectUser">选择</el-button>
+            </div>
+          </el-form-item> -->
+          <el-form-item prop="time" label="签署时间:">
+            <el-date-picker
+              v-model="formData.time"
+              :clearable="true"
+              type="date"
+              placeholder="选择时间"
+              value-format="yyyy-MM-dd hh:mm:ss"
+            >
+            </el-date-picker>
+          </el-form-item>
+
+         
+         
+          <el-col :xs="24" :sm="24" :md="24" :lg="24">
+            <el-form-item label="上传文件" prop="files">
+              <W-file-upload
+                ref="upload"
+                :defaultValue="formFileListDefualtValue"
+                v-model="formData.files"
+              />
+            </el-form-item>
+          </el-col>
+        </el-form>
+      </div>
+
+      <div slot="footer" class="dialog-footer" style="margin-top: 10px">
+        <el-button @click="isShow = false">取消</el-button>
+        <el-button type="primary" @click="onSubmit">确定</el-button>
+      </div>
+    </DialogCom>
+  </div>
+</template>
+
+<script>
+import { mapState, mapMutations } from "vuex";
+import { mapGetters } from "vuex";
+import WFileUpload from "@/components/W-FileUpload/index.vue";
+import {
+  listSafetyBook,
+  getSafetyBook,
+  editOrAdd,
+  delSafetyBook,
+} from "@/api/safetyBookNew/index";
+import { deptTreeSelect } from "@/api/system/public";
+import dayjs from "dayjs";
+export default {
+  dicts: ["safety_book_type","sign_level"],
+  data() {
+    return {
+      id: null,
+      isShow: false,
+      timeClearable: true,
+      formData: this.reset(),
+      tableData: [],
+      formFileListDefualtValue: [],
+      //修改新增中的机构树
+      deptOptions: [],
+      formDataRules: {
+    
+        type: [{ required: true, message: "请选择签署责任书类型" }],
+        year: [{ required: true, message: "请选择所属年度" }],
+        partyA: [{ required: true, message: "请输入甲方" }],
+        partyAOrg: [{ required: true, message: "请输入甲方机构" }],
+        partyB: [{ required: true, message: "请输入乙方" }],
+        partyBOrg: [{ required: true, message: "请输入乙方机构" }],
+        time: [{ required: true, message: "请选择时间" }],
+        files: [{ required: true, message: "请上传责任书" }],
+      },
+    };
+  },
+
+  watch: {},
+  computed: {
+    ...mapState([]),
+    ...mapGetters(["orgId", "orgName"]),
+  },
+  methods: {
+    ...mapMutations([]),
+    isPic(url) {
+      if (url.endsWith("jpg") || url.endsWith("png")) {
+        return true;
+      }
+      return false;
+    },
+   
+    dayjs,
+   
+    editII(row) {
+     
+    },
+    //新增签署
+    openSelect() {
+     
+    },
+    /** 查询机构树数据 */
+    getDeptTree() {
+      deptTreeSelect().then((response) => {
+        this.deptOptions = response.data;
+      });
+    },
+    /** treeSelect组件自定义数据*/
+    tenantIdnormalizer(node, instanceId) {
+      if (node.children && !node.children.length) {
+        delete node.children;
+      }
+      return {
+        id: node.id,
+        label: node.shortName,
+        children: node.children,
+      };
+    },
+    removeRow(row) {
+      this.$modal
+        .confirm("是否确认删除?")
+        .then(function () {})
+        .then(() => {
+          this.tableData = this.tableData.filter((item) => item !== row);
+          this.$modal.msgSuccess("删除成功");
+        });
+    },
+    reset() {
+      return {
+        id: null,
+        type: null,
+        year: null,
+        time: null,
+        files: [],
+        partyA: null,
+        partyAOrg: null,
+        partyB: null,
+        partyBOrg: null,
+        signLevel:null,
+      };
+    },
+    async refresh(id) {
+      if (id != null && id != undefined) {
+        await getSafetyBook(id).then((res) => {
+          // console.log(res.data,"res")
+          this.formData = res.data;
+          this.tableData = res.data.bookUsers;
+          this.formFileListDefualtValue = res.data.files;
+        });
+      }
+    },
+    async show(id) {
+      // console.log(id, "id");
+      this.formFileListDefualtValue = [];
+      this.getDeptTree();
+      this.formData = this.reset();
+      this.tableData = [];
+      this.id = id;
+      await this.refresh(id);
+      if (id) {
+      } else {
+        // console.log(this.orgId,"this.orgId")
+        this.formData.orgId = this.orgId;
+      }
+      this.isShow = true;
+    },
+
+    // 事件
+    onHide() {
+      this.formData = this.reset();
+      this.$refs.form.resetFields();
+    },
+    onSubmit() {
+      // console.log(this.formData,"this.formData")
+      this.$refs.form.validate(async (isValidate) => {
+        if (!isValidate) return;
+        this.formData.bookUsers = this.tableData;
+        await editOrAdd(this.formData);
+        this.$emit("success");
+        this.isShow = false;
+      });
+    },
+
+    // 事件
+    //apimark//
+  },
+  mounted() {},
+  components: { WFileUpload },
+};
+</script>
+
+<style lang="scss" scoped>
+.brand_info {
+  .el-form {
+    width: 600px;
+    padding-top: 40px;
+  }
+}
+.container {
+  width: 50px;
+  height: 50px;
+  float: left;
+  .item {
+    width: 100%;
+    height: 100%;
+  }
+  .item img {
+    width: 100% !important;
+    object-fit: cover !important;
+  }
+}
+</style>

+ 417 - 0
src/views/safetyBook/newBook/index.vue

@@ -0,0 +1,417 @@
+<template>
+  <div class="app-container">
+    <!--机构数据-->
+    <!-- <el-col :span="4" :xs="24" v-if="false">
+          <org-tree
+            v-model="queryParams.orgId"
+            @defaultKey="getDefaultKey"
+            @checkChange="checkChange"
+            @click="clickTreeNode"
+            wholeTree
+          ></org-tree>
+        </el-col> -->
+    <!--用户数据-->
+    <div class="main-right-box">
+      <!--    搜索条件    -->
+      <div class="main-search-box">
+        <el-form
+          :model="queryParams"
+          ref="queryForm"
+          size="small"
+          :inline="true"
+          v-show="showSearch"
+        >
+          <el-form-item prop="type" label="签署类型">
+            <el-select
+              prop="type"
+              label="签署类型"
+              v-model="queryParams.type"
+              placeholder="请选择签署类型"
+              clearable
+            >
+              <el-option
+                v-for="dict in dict.type.safety_book_type"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="所属年度" prop="year">
+            <el-date-picker
+              v-model="queryParams.year"
+              :clearable="timeClearable"
+              type="year"
+              placeholder="选择时间"
+              value-format="yyyy"
+            >
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item label="签署机构" prop="partyBOrg"   class="formTreeItem">
+            <tree-select
+              v-model="queryParams.partyBOrg"
+              :options="deptOptions"
+              :show-count="true"
+              :normalizer="tenantIdnormalizer"
+              :props="{ checkStrictly: true, label: 'name' }"
+              placeholder="请选择签署机构"
+              clearValueText="清除"
+              :noChildrenText="''"
+              noOptionsText="没有数据"
+              noResultsText="没有搜索结果"
+            />
+          </el-form-item>
+        </el-form>
+
+        <el-row :gutter="10">
+          <el-col :span="1.5">
+            <el-button
+              type="primary"
+              icon="el-icon-search"
+              size="mini"
+              @click="getList"
+              >搜索</el-button
+            >
+          </el-col>
+          <el-col :span="1.5">
+            <el-button
+              type="primary"
+              icon="el-icon-refresh"
+              size="mini"
+              @click="resetQuery"
+              >重置</el-button
+            >
+          </el-col>
+          <el-col :span="1.5">
+            <el-button
+              type="primary"
+              icon="el-icon-plus"
+              size="mini"
+              @click="handleAdd(null)"
+              v-hasPermi="['core:safetyBooknew:add']"
+              >新增
+            </el-button>
+          </el-col>
+
+          <right-toolbar
+            :showSearch.sync="showSearch"
+            @queryTable="getList"
+          ></right-toolbar>
+        </el-row>
+      </div>
+      <!-- 表格数据 -->
+      <el-table
+        border
+        height="644"
+        size="small"
+        v-loading="loading"
+        :data="dataList"
+      >
+        <el-table-column label="序号" type="index" align="center" width="60" />
+        <el-table-column label="签署类型" align="center" prop="type">
+          <template slot-scope="r"
+            >{{ getLabel(dict.type.safety_book_type, `${r.row.type}`) }}
+          </template>
+        </el-table-column>
+        <el-table-column label="所属年份" align="center" prop="year" />
+        <el-table-column label="甲方" align="left" prop="partyA" />
+        <el-table-column label="甲方机构" align="left" prop="partyAOrg" />
+        <el-table-column label="乙方" align="left" prop="partyB" />
+
+        <el-table-column label="乙方机构" align="left" prop="partyBOrgName" />
+
+        <el-table-column
+          label="签署时间"
+          align="center"
+          prop="time"
+          width="150"
+          v-if="false"
+        >
+          <template slot-scope="r">
+            {{ r.row.time ? dayjs(r.row.time).format("YYYY年MM月DD日") : "" }}
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="files" width="400px" label="签署文件">
+          <template slot-scope="r">
+            <div
+              v-for="(file, index) in r.row.files"
+              :key="index"
+              class="container"
+            >
+              <el-image
+                class="item"
+                v-if="isPic(file.url)"
+                :src="file.url"
+                :preview-src-list="[file.url]"
+                fit="contain"
+              ></el-image>
+              <div v-else="isPic(file.url)">
+                <el-link :href="file.url" :underline="false" target="_blank">
+                  <span class="el-icon-document"> {{ file.name }} </span>
+                </el-link>
+              </div>
+            </div>
+          </template>
+        </el-table-column>
+
+        <el-table-column
+          label="操作"
+          width="250"
+          align="center"
+          class-name="small-padding fixed-width"
+        >
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-info"
+              @click="handleInfo(scope.row.id)"
+              v-hasPermi="['core:safetyBooknew:query']"
+              >详情
+            </el-button>
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-edit-outline"
+              @click="handleAdd(scope.row.id)"
+              v-hasPermi="['core:safetyBooknew:add']"
+              >编辑
+            </el-button>
+
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              @click="handleDelete(scope.row)"
+              v-hasPermi="['core:safetyBooknew:remove']"
+              >删除
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <pagination
+        v-show="total > 0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
+    </div>
+    <dialog-edit ref="editDialog" @success="getList()"></dialog-edit>
+    <DialogDes ref="DialogDes"></DialogDes>
+  </div>
+</template>
+
+<script>
+import {
+  listSafetyBook,
+  getSafetyBook,
+  editOrAdd,
+  delSafetyBook,
+} from "@/api/safetyBookNew/index";
+import { getLabel } from "@/views/commonOption";
+import DialogEdit from "./dialog.edit";
+import DialogDes from "./dialog.des";
+import { deptTreeSelect } from "@/api/system/public";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import OrgTree from "@/components/orgTree/index.vue";
+import kOrgTree from "@/components/k-orgTree/index.vue";
+import KFileUpload from "@/components/K-FileUpload/index.vue";
+import tableList from "@/mixins/tableList";
+import orgTree from "@/components/orgTree";
+import dayjs from "dayjs";
+export default {
+  dicts: ["safety_book_type"],
+  name: "safetyBook",
+  components: {
+    OrgTree,
+    kOrgTree,
+    KFileUpload,
+    DialogEdit,
+    orgTree,
+    DialogDes,
+  },
+  mixins: [tableList],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个停用
+      single: true,
+      // 非多个停用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 安全责任书表格数据
+      dataList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 机构树选项
+      deptOptions: [],
+      // 机构名称
+      deptName: undefined,
+      //是否关联下级
+      checked: false,
+      timeClearable: true,
+      defaultProps: {
+        children: "children",
+        label: "name",
+      },
+      formFileListDefualtValue: [],
+      // 查询参数
+      queryParams: {
+        checkSub: true,
+        pageNum: 1,
+        pageSize: 10,
+        partyBOrg: null,
+        year: null,
+        searchOrgId: null,
+        type: null,
+      },
+      // 表单参数
+      form: {},
+
+      //默认选中节点
+      defaultKeys: [],
+    };
+  },
+  watch: {
+    // 根据名称筛选机构树
+    deptName(val) {
+      this.$refs.tree.filter(val);
+    },
+  },
+  created() {
+    this.getDeptTree();
+    this.getConfigKey("sys.user.initPassword").then((response) => {
+      this.initPassword = response.msg;
+    });
+    this.getList();
+  },
+  methods: {
+    isPic(url) {
+      if (url.endsWith("jpg") || url.endsWith("png")) {
+        return true;
+      }
+      return false;
+    },
+    dayjs,
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.getList();
+    },
+    getLabel(options, value) {
+      return getLabel(options, value);
+    },
+    //新增
+    handleAdd(id) {
+      this.$refs.editDialog.show(id);
+    },
+    /** 查询安全责任书列表 */
+    getList() {
+      this.loading = true;
+      listSafetyBook(this.queryParams)
+        .then((response) => {
+          this.dataList = response.rows;
+          this.total = response.total;
+          this.loading = false;
+        })
+        .catch(() => {
+          this.loading = false;
+        });
+    },
+    getDeptTree() {
+      deptTreeSelect().then((response) => {
+        this.deptOptions = response.data;
+      });
+    },
+
+    // 节点单击事件
+    clickTreeNode(data) {
+      this.queryParams.orgId = data.id;
+      this.handleQuery();
+    },
+    /** 下穿状态改变*/
+    changeCheckBox() {
+      this.getList();
+    },
+
+    getDefaultKey(key) {
+      this.queryParams.orgId = key;
+      this.getList();
+    },
+    //单选框状态改变
+    checkChange(state) {
+      this.queryParams.checkSub = state;
+      this.handleQuery();
+    },
+
+    // 筛选节点
+    filterNode(value, data) {
+      if (!value) return true;
+      return data.name.indexOf(value) !== -1;
+    },
+    // 节点单击事件
+    handleNodeClick(data) {
+      this.queryParams.orgId = data.id;
+      this.handleQuery();
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal
+        .confirm("是否确认删除?")
+        .then(function () {
+          return delSafetyBook(ids);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
+    },
+
+    /** 详情按钮操作 */
+    handleInfo(id) {
+      this.$refs.DialogDes.show(id);
+    },
+    /** treeSelect组件自定义数据*/
+    tenantIdnormalizer(node, instanceId) {
+      if (node.children && !node.children.length) {
+        delete node.children;
+      }
+      return {
+        id: node.id,
+        label: node.shortName,
+        children: node.children,
+      };
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.ellipsis {
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+::v-deep.formTreeItem {
+  .el-form-item__content {
+    width: 264px;
+  }
+}
+</style>