Эх сурвалжийг харах

Merge branch 'V0.0.2' of http://10.87.10.227:4000/jzyd_yyds/soc_web into V0.0.2

coys 2 жил өмнө
parent
commit
1bbcd53d65

+ 43 - 0
src/api/safetyBook/aqbwbndjh.js

@@ -0,0 +1,43 @@
+import request from "@/utils/request";
+
+// 查询列表安全责任书
+export function listaqbwbndjh(data) {
+  return request({
+    url: "/core/safetyBook/aqbwbndjh/list",
+    method: "post",
+    data: data,
+  });
+}
+
+// 查询详细安全责任书
+export function getaqbwbndjh(id) {
+  return request({
+    url: "/core/safetyBook/aqbwbndjh/" + id,
+    method: "get",
+  });
+}
+
+// 新增/编辑安全责任书
+export function Add(data) {
+  return request({
+    url: "/core/safetyBook/aqbwbndjh/add",
+    method: "post",
+    data: data,
+  });
+}
+// 编辑安全责任书
+export function edit(data) {
+  return request({
+    url: "/core/safetyBook/aqbwbndjh/edit",
+    method: "post",
+    data: data,
+  });
+}
+
+// 删除安全责任书
+export function delaqbwbndjh(ids) {
+  return request({
+    url: "/core/safetyBook/aqbwbndjh/" + ids,
+    method: "delete",
+  });
+}

+ 43 - 0
src/api/safetyBook/hsggbsdj.js

@@ -0,0 +1,43 @@
+import request from "@/utils/request";
+
+// 查询列表安全责任书
+export function listhsggbsdj(data) {
+  return request({
+    url: "/core/safetyBook/hsggbsdj/list",
+    method: "post",
+    data: data,
+  });
+}
+
+// 查询详细安全责任书
+export function gethsggbsdj(id) {
+  return request({
+    url: "/core/safetyBook/hsggbsdj/" + id,
+    method: "get",
+  });
+}
+
+// 新增/编辑安全责任书
+export function Add(data) {
+  return request({
+    url: "/core/safetyBook/hsggbsdj/add",
+    method: "post",
+    data: data,
+  });
+}
+// 编辑安全责任书
+export function edit(data) {
+  return request({
+    url: "/core/safetyBook/hsggbsdj/edit",
+    method: "post",
+    data: data,
+  });
+}
+
+// 删除安全责任书
+export function delhsggbsdj(ids) {
+  return request({
+    url: "/core/safetyBook/hsggbsdj/" + ids,
+    method: "delete",
+  });
+}

BIN
src/assets/fonts/SourceHanSansCN-ExtraLight.otf


BIN
src/assets/fonts/SourceHanSansCN-Light.otf


BIN
src/assets/fonts/SourceHanSansCN-Normal.otf


+ 31 - 2
src/assets/styles/index.scss

@@ -5,13 +5,42 @@
 @import "./sidebar.scss";
 @import "./btn.scss";
 
+@font-face {
+  font-family: ExtraLight;
+  font-style: normal;
+  font-weight: bold;
+  src: local("ExtraLight"), url("@/assets/fonts/SourceHanSansCN-ExtraLight.otf");
+}
+
+@font-face {
+  font-family: SYLight;
+  font-style: normal;
+  src: local("SYLight"), url("@/assets/fonts/SourceHanSansCN-Light.otf");
+}
+
+@font-face {
+  font-family: SYNormal;
+  font-style: normal;
+  src: local("SYNormal"), url("@/assets/fonts/SourceHanSansCN-Normal.otf");
+}
+
 body {
   height: 100%;
   -moz-osx-font-smoothing: grayscale;
   -webkit-font-smoothing: antialiased;
   text-rendering: optimizeLegibility;
-  font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB,
-    Microsoft YaHei, Arial, sans-serif;
+  font-family: ExtraLight,Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
+  /*框架自带字体*/
+  //font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB,
+  //  Microsoft YaHei, Arial, sans-serif;
+}
+
+.el-button{
+  font-family: SYLight,Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
+}
+
+.el-table__header-wrapper{
+  font-family: SYNormal,Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
 }
 
 label {

+ 1 - 1
src/views/core/accessPlan/index.vue

@@ -96,7 +96,7 @@
           <el-table-column label="备注" align="center" prop="description"/>
           <el-table-column label="操作" fixed="right" width="120" align="center" class-name="small-padding fixed-width">
             <template slot-scope="scope">
-              <el-button size="mini" type="text" icon="el-icon-edit-outline" @click="handleUpdate(scope.row)" v-if="scope.row.parentId==null&&(scope.row.parentOrgId==isEdit||scope.row.orgId==isEdit)&&check==true"
+              <el-button size="mini" type="text" icon="el-icon-edit-outline" @click="handleUpdate(scope.row)" v-if="scope.row.orgId==isEdit&&check==true"
                          v-hasPermi="['core:accessPlan:edit','core:accessPlan:query']">编辑
               </el-button>
               <el-button size="mini" type="text" v-if="scope.row.parentId==null&& scope.row.orgId==isEdit&&scope.row.isDistribute == 0 && (scope.row.planStatus==0||scope.row.planStatus==2)" icon="el-icon-arrow-down"

+ 193 - 0
src/views/safetyBook/aqbwbndjh/dialog.edit.vue

@@ -0,0 +1,193 @@
+<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="130px"
+          label-prefix=":"
+        >
+          <el-form-item prop="orgId" label="签署责任人所在机构:">
+            <tree-select
+              v-model="formData.orgId"
+              :options="deptOptions"
+              :show-count="true"
+              :normalizer="tenantIdnormalizer"
+              :props="{ checkStrictly: true, label: 'name' }"
+              placeholder="请选择签署责任人所在机构"
+            />
+          </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>
+        <el-button @click="openSelect">新增签署</el-button>
+
+        <el-table :data="tableData" style="width: 100%" height="400px">
+          <el-table-column prop="names" label="姓名">
+            <template slot-scope="scope">
+              <template v-for="item in scope.row.names">
+                {{ item }}
+                <br />
+              </template>
+            </template>
+          </el-table-column>
+          <el-table-column prop="time" label="签署时间"> </el-table-column>
+          <el-table-column prop="files" label="签署文件"> </el-table-column>
+
+          <el-table-column prop="names" label="操作">
+            <template v-slot="{ row }">
+              <el-button type="text" @click="removeRow(row)">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <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 {
+  listSafetyBook,
+  getSafetyBook,
+  editOrAdd,
+  delSafetyBook,
+} from "@/api/safetyBook/index";
+import { deptTreeSelect } from "@/api/system/public";
+import DialogSelect from "./dialog.sign";
+export default {
+  dicts: ["safety_book_type"],
+  data() {
+    return {
+      id: null,
+      isShow: false,
+      formData: this.reset(),
+      tableData: [],
+      //修改新增中的机构树
+      deptOptions: [],
+      formDataRules: {
+        orgId: [{ required: true, message: "请选择签署责任人所在机构" }],
+        type: [{ required: true, message: "请选择签署责任书类型" }],
+      },
+    };
+  },
+
+  watch: {},
+  computed: {
+    ...mapState([]),
+  },
+  methods: {
+    ...mapMutations([]),
+    //添加签署后回调
+    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,
+      };
+    },
+    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: { DialogSelect },
+};
+</script>
+
+<style lang="scss" scoped>
+.brand_info {
+  .el-form {
+    width: 600px;
+    padding-top: 40px;
+  }
+}
+</style>

+ 150 - 0
src/views/safetyBook/aqbwbndjh/dialog.sign.vue

@@ -0,0 +1,150 @@
+<template>
+  <div class="rule-type">
+    <DialogCom
+      :title="id ? '编辑' : '新增'"
+      :visible.sync="isShow"
+      @close="onHide"
+      width="500px"
+    >
+      <div class="page-body">
+        <el-form
+          :model="formData"
+          :rules="formDataRules"
+          size="small"
+          ref="form"
+          label-position="right"
+          label-width="130px"
+          label-prefix=":"
+        >
+          <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">
+              <imgs-upload
+                :limit="5"
+                v-model="formData.files"
+                :fileSize="2"
+              ></imgs-upload>
+            </el-form-item>
+          </el-col>
+        </el-form>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="isShow = false">取消</el-button>
+        <el-button type="primary" @click="onSubmit">确定</el-button>
+      </div>
+    </DialogCom>
+    <UserSelector ref="UserSelector" @select="onUserSelect"></UserSelector>
+  </div>
+</template>
+
+<script>
+import { mapState, mapMutations } from "vuex";
+import ImgsUpload from "@/components/ImgsUpload";
+import UserSelector from "@/components/userSelector/index.vue";
+export default {
+  data() {
+    return {
+      id: null,
+      isShow: false,
+      formData: this.reset(),
+      formDataRules: {
+        userIds: [{ required: true, message: "请选择用户" }],
+        time: [{ required: true, message: "请选择时间" }],
+        files: [{ required: true, message: "请上传责任书" }],
+      },
+    };
+  },
+
+  watch: {},
+  computed: {
+    joinedStringArray: {
+      get() {
+        return this.formData.names.join(", ");
+      },
+      set(value) {
+        this.formData.names = value.split(", ");
+      },
+    },
+    ...mapState([]),
+  },
+  methods: {
+    ...mapMutations([]),
+
+    //选择用户回调
+    onUserSelect(data) {
+      var ids = data.map((obj) => obj.id);
+      var names = data.map((obj) => obj.name);
+      this.formData.userIds = ids;
+      this.formData.names = names;
+      //   console.log(this.formData.userIds, "this.formData.userIds");
+    },
+    //用户选择
+    selectUser(event) {
+    //   event.preventDefault();
+      this.$refs.UserSelector.show();
+    },
+
+    reset() {
+      return {
+        id: null,
+        userIds: [],
+        time: null,
+        files: null,
+        names: [],
+      };
+    },
+    async show(id) {
+      this.formData= this.reset(),
+      this.id = id;
+      this.isShow = true;
+    },
+
+    // 事件
+    onHide() {
+      //   this.formData = this.reset();
+      //   this.$refs.form.resetFields();
+    },
+    onSubmit() {
+      this.$refs.form.validate(async (isValidate) => {
+        if (!isValidate) return;
+        this.$emit("success", this.formData);
+        this.isShow = false;
+      });
+    },
+
+    // 事件
+    //apimark//
+  },
+  mounted() {},
+  components: { ImgsUpload, UserSelector },
+};
+</script>
+
+<style lang="scss" scoped>
+.brand_info {
+  .el-form {
+    width: 600px;
+    padding-top: 40px;
+  }
+}
+</style>

+ 320 - 0
src/views/safetyBook/aqbwbndjh/index.vue

@@ -0,0 +1,320 @@
+<template>
+  <div class="app-container">
+    <el-row :gutter="20">
+      <!--机构数据-->
+      <el-col :span="4" :xs="24">
+        <org-tree
+          v-model="queryParams.orgId"
+          @defaultKey="getDefaultKey"
+          @checkChange="checkChange"
+          @click="clickTreeNode"
+          wholeTree
+        ></org-tree>
+      </el-col>
+      <!--用户数据-->
+      <el-col :span="20" :xs="24">
+        <el-form
+          :model="queryParams"
+          ref="queryForm"
+          size="small"
+          :inline="true"
+          v-show="showSearch"
+          label-width="68px"
+        >
+          <el-form-item label="所属年份" prop="year">
+            <el-date-picker
+              v-model="queryParams.year"
+              :clearable="timeClearable"
+              type="year"
+              placeholder="选择时间"
+              value-format="yyyy"
+              @change="handleQuery"
+            >
+            </el-date-picker>
+          </el-form-item>
+        </el-form>
+        <el-row :gutter="10" class="mb8">
+          <el-col :span="1.5">
+            <el-button
+              type="primary"
+              icon="el-icon-plus"
+              size="mini"
+              @click="handleAdd(null)"
+              v-hasPermi="['core:aqbwbndjh:add']"
+              >新增
+            </el-button>
+          </el-col>
+
+          <right-toolbar
+            :showSearch.sync="showSearch"
+            @queryTable="getList"
+          ></right-toolbar>
+        </el-row>
+        <!-- 表格数据 -->
+        <el-table
+          border
+          height="600"
+          size="small"
+          v-loading="loading"
+          :data="dataList"
+        >
+          <el-table-column
+            label="序号"
+            type="index"
+            align="center"
+            width="60"
+          />
+          <el-table-column
+            label="工作主题"
+            align="left"
+            width="200"
+            prop="orgName"
+          />
+          <el-table-column
+            label="参与人员"
+            align="left"
+            width="160"
+            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"
+            width="120"
+            prop="year"
+          />
+         
+
+          <el-table-column
+            label="操作"
+            width="180"
+            fixed="right"
+            align="center"
+            class-name="small-padding fixed-width"
+          >
+            <template slot-scope="scope">
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-edit-outline"
+                @click="handleAdd(scope.row.id)"
+                v-hasPermi="['core:aqbwbndjh:edit']"
+                >编辑
+              </el-button>
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-info"
+                @click="handleInfo(scope.row)"
+                v-hasPermi="['core:aqbwbndjh:query']"
+                >详情
+              </el-button>
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-delete"
+                @click="handleDelete(scope.row)"
+                v-hasPermi="['core:aqbwbndjh: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"
+        />
+      </el-col>
+    </el-row>
+    <dialog-edit ref="editDialog" @success="getList()"></dialog-edit>
+  </div>
+</template>
+
+<script>
+import {
+  listSafetyBook,
+  getSafetyBook,
+  editOrAdd,
+  delSafetyBook,
+} from "@/api/safetyBook/index";
+import {  getLabel } from "@/views/commonOption";
+import DialogEdit from "./dialog.edit";
+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";
+
+export default {
+  dicts: [
+    "safety_book_type"
+  ],
+  name: "aqbwbndjh",
+  components: { OrgTree, kOrgTree, KFileUpload, DialogEdit },
+  mixins: [tableList],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 安全责任书表格数据
+      dataList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 机构树选项
+      deptOptions: undefined,
+      // 机构名称
+      deptName: undefined,
+      //是否关联下级
+      checked: false,
+      timeClearable: true,
+      defaultProps: {
+        children: "children",
+        label: "name",
+      },
+      formFileListDefualtValue: [],
+      // 查询参数
+      queryParams: {
+        checkSub: true,
+        pageNum: 1,
+        pageSize: 10,
+        orgId: null,
+        year: null,
+        searchOrgId: 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: {
+    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;
+      });
+    },
+    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(row) {
+      this.reset();
+      const id = row.id || this.ids;
+      getSafetyBook(id).then((response) => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "安全责任书详情";
+      });
+    },
+  },
+};
+</script>
+<style>
+.ellipsis {
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+</style>

+ 208 - 0
src/views/safetyBook/hsggbsdj/dialog.edit.vue

@@ -0,0 +1,208 @@
+<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="130px"
+          label-prefix=":"
+        >
+          <el-form-item prop="title" label="工作主题:">
+            <el-input></el-input>
+          </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="title" label="开会日期:">
+            <el-date-picker
+              v-model="formData.startDate"
+              style="width: 240px"
+              value-format="yyyy-MM-dd hh:mm:ss"
+              placeholder="请选择开会日期"
+              type="datetime"
+              :clearable="false"
+            ></el-date-picker>
+          </el-form-item>
+
+          <el-form-item label="照片">
+            <imgs-upload
+              :limit="5"
+              v-model="formData.images"
+              :fileSize="2"
+            ></imgs-upload>
+          </el-form-item>
+        </el-form>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="isShow = false">取消</el-button>
+        <el-button type="primary" @click="onSubmit">确定</el-button>
+      </div>
+    </DialogCom>
+    <DialogSelect ref="DialogSelect" @success="getSign"></DialogSelect>
+    <UserSelector ref="UserSelector" @select="onUserSelect"></UserSelector>
+  </div>
+</template>
+
+<script>
+import { mapState, mapMutations } from "vuex";
+import {
+  getSafetyBook,
+  editOrAdd,
+  delSafetyBook,
+} from "@/api/safetyBook/index";
+import { deptTreeSelect } from "@/api/system/public";
+import DialogSelect from "./dialog.sign";
+import UserSelector from "@/components/userSelector/index.vue";
+import ImgsUpload from "@/components/ImgsUpload";
+
+export default {
+  dicts: ["safety_book_type"],
+  data() {
+    return {
+      id: null,
+      isShow: false,
+      formData: this.reset(),
+      tableData: [],
+      //修改新增中的机构树
+      deptOptions: [],
+      formDataRules: {
+        orgId: [{ required: true, message: "请选择签署责任人所在机构" }],
+        type: [{ required: true, message: "请选择签署责任书类型" }],
+      },
+    };
+  },
+
+  watch: {},
+  computed: {
+    ...mapState([]),
+    joinedStringArray: {
+      get() {
+        return this.formData.names.join(", ");
+      },
+      set(value) {
+        this.formData.names = value.split(", ");
+      },
+    },
+  },
+  methods: {
+    ...mapMutations([]),
+    //添加签署后回调
+    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,
+        names: [],
+        userIds: [],
+        startDate: null,
+        images: [],
+      };
+    },
+    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;
+      });
+    },
+    //选择用户回调
+    onUserSelect(data) {
+      var ids = data.map((obj) => obj.id);
+      var names = data.map((obj) => obj.name);
+      this.formData.userIds = ids;
+      this.formData.names = names;
+      //   console.log(this.formData.userIds, "this.formData.userIds");
+    },
+    //用户选择
+    selectUser(event) {
+      //   event.preventDefault();
+      this.$refs.UserSelector.show();
+    },
+
+    // 事件
+    //apimark//
+  },
+  mounted() {},
+  components: { DialogSelect, UserSelector,ImgsUpload },
+};
+</script>
+
+<style lang="scss" scoped>
+.brand_info {
+  .el-form {
+    width: 600px;
+    padding-top: 40px;
+  }
+}
+</style>

+ 150 - 0
src/views/safetyBook/hsggbsdj/dialog.sign.vue

@@ -0,0 +1,150 @@
+<template>
+  <div class="rule-type">
+    <DialogCom
+      :title="id ? '编辑' : '新增'"
+      :visible.sync="isShow"
+      @close="onHide"
+      width="500px"
+    >
+      <div class="page-body">
+        <el-form
+          :model="formData"
+          :rules="formDataRules"
+          size="small"
+          ref="form"
+          label-position="right"
+          label-width="130px"
+          label-prefix=":"
+        >
+          <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">
+              <imgs-upload
+                :limit="5"
+                v-model="formData.files"
+                :fileSize="2"
+              ></imgs-upload>
+            </el-form-item>
+          </el-col>
+        </el-form>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="isShow = false">取消</el-button>
+        <el-button type="primary" @click="onSubmit">确定</el-button>
+      </div>
+    </DialogCom>
+    <UserSelector ref="UserSelector" @select="onUserSelect"></UserSelector>
+  </div>
+</template>
+
+<script>
+import { mapState, mapMutations } from "vuex";
+import ImgsUpload from "@/components/ImgsUpload";
+import UserSelector from "@/components/userSelector/index.vue";
+export default {
+  data() {
+    return {
+      id: null,
+      isShow: false,
+      formData: this.reset(),
+      formDataRules: {
+        userIds: [{ required: true, message: "请选择用户" }],
+        time: [{ required: true, message: "请选择时间" }],
+        files: [{ required: true, message: "请上传责任书" }],
+      },
+    };
+  },
+
+  watch: {},
+  computed: {
+    joinedStringArray: {
+      get() {
+        return this.formData.names.join(", ");
+      },
+      set(value) {
+        this.formData.names = value.split(", ");
+      },
+    },
+    ...mapState([]),
+  },
+  methods: {
+    ...mapMutations([]),
+
+    //选择用户回调
+    onUserSelect(data) {
+      var ids = data.map((obj) => obj.id);
+      var names = data.map((obj) => obj.name);
+      this.formData.userIds = ids;
+      this.formData.names = names;
+      //   console.log(this.formData.userIds, "this.formData.userIds");
+    },
+    //用户选择
+    selectUser(event) {
+    //   event.preventDefault();
+      this.$refs.UserSelector.show();
+    },
+
+    reset() {
+      return {
+        id: null,
+        userIds: [],
+        time: null,
+        files: null,
+        names: [],
+      };
+    },
+    async show(id) {
+      this.formData= this.reset(),
+      this.id = id;
+      this.isShow = true;
+    },
+
+    // 事件
+    onHide() {
+      //   this.formData = this.reset();
+      //   this.$refs.form.resetFields();
+    },
+    onSubmit() {
+      this.$refs.form.validate(async (isValidate) => {
+        if (!isValidate) return;
+        this.$emit("success", this.formData);
+        this.isShow = false;
+      });
+    },
+
+    // 事件
+    //apimark//
+  },
+  mounted() {},
+  components: { ImgsUpload, UserSelector },
+};
+</script>
+
+<style lang="scss" scoped>
+.brand_info {
+  .el-form {
+    width: 600px;
+    padding-top: 40px;
+  }
+}
+</style>

+ 319 - 0
src/views/safetyBook/hsggbsdj/index.vue

@@ -0,0 +1,319 @@
+<template>
+  <div class="app-container">
+    <el-row :gutter="20">
+      <!--机构数据-->
+      <el-col :span="4" :xs="24">
+        <org-tree
+          v-model="queryParams.orgId"
+          @defaultKey="getDefaultKey"
+          @checkChange="checkChange"
+          @click="clickTreeNode"
+          wholeTree
+        ></org-tree>
+      </el-col>
+      <!--用户数据-->
+      <el-col :span="20" :xs="24">
+        <el-form
+          :model="queryParams"
+          ref="queryForm"
+          size="small"
+          :inline="true"
+          v-show="showSearch"
+          label-width="68px"
+        >
+          <el-form-item label="所属年份" prop="year">
+            <el-date-picker
+              v-model="queryParams.year"
+              :clearable="timeClearable"
+              type="year"
+              placeholder="选择时间"
+              value-format="yyyy"
+              @change="handleQuery"
+            >
+            </el-date-picker>
+          </el-form-item>
+        </el-form>
+        <el-row :gutter="10" class="mb8">
+          <el-col :span="1.5">
+            <el-button
+              type="primary"
+              icon="el-icon-plus"
+              size="mini"
+              @click="handleAdd(null)"
+              v-hasPermi="['core:hsggbsdj:add']"
+              >新增
+            </el-button>
+          </el-col>
+
+          <right-toolbar
+            :showSearch.sync="showSearch"
+            @queryTable="getList"
+          ></right-toolbar>
+        </el-row>
+        <!-- 表格数据 -->
+        <el-table
+          border
+          height="600"
+          size="small"
+          v-loading="loading"
+          :data="dataList"
+        >
+          <el-table-column
+            label="序号"
+            type="index"
+            align="center"
+            width="60"
+          />
+          <el-table-column
+            label="工作主题"
+            align="left"
+            width="200"
+            prop="title"
+          />
+          <el-table-column label="参与人" align="center" prop="userNames">
+          </el-table-column>
+          <el-table-column
+            label="开会日期"
+            align="left"
+            width="160"
+            prop="date"
+          >
+
+          <!-- <template slot-scope="r"
+              >{{
+                getLabel(dict.type.safety_book_type, `${r.row.type}`)
+              }}
+            </template> -->
+        </el-table-column>
+         
+    
+          
+
+          <el-table-column
+            label="操作"
+            width="180"
+            fixed="right"
+            align="center"
+            class-name="small-padding fixed-width"
+          >
+            <template slot-scope="scope">
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-edit-outline"
+                @click="handleAdd(scope.row.id)"
+                v-hasPermi="['core:hsggbsdj:edit']"
+                >编辑
+              </el-button>
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-info"
+                @click="handleInfo(scope.row)"
+                v-hasPermi="['core:hsggbsdj:query']"
+                >详情
+              </el-button>
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-delete"
+                @click="handleDelete(scope.row)"
+                v-hasPermi="['core:hsggbsdj: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"
+        />
+      </el-col>
+    </el-row>
+    <dialog-edit ref="editDialog" @success="getList()"></dialog-edit>
+  </div>
+</template>
+
+<script>
+import {
+  listhsggbsdj,
+  gethsggbsdj,
+  Add,
+  edit,
+  delhsggbsdj,
+} from "@/api/safetyBook/hsggbsdj";
+import {  getLabel } from "@/views/commonOption";
+import DialogEdit from "./dialog.edit";
+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";
+
+export default {
+  dicts: [
+    "safety_book_type"
+  ],
+  name: "hsggbsdj",
+  components: { OrgTree, kOrgTree, KFileUpload, DialogEdit },
+  mixins: [tableList],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 行社高管部署登记表格数据
+      dataList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 机构树选项
+      deptOptions: undefined,
+      // 机构名称
+      deptName: undefined,
+      //是否关联下级
+      checked: false,
+      timeClearable: true,
+      defaultProps: {
+        children: "children",
+        label: "name",
+      },
+      formFileListDefualtValue: [],
+      // 查询参数
+      queryParams: {
+        checkSub: true,
+        pageNum: 1,
+        pageSize: 10,
+        orgId: null,
+        year: null,
+        searchOrgId: 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: {
+    getLabel(options, value) {
+      return getLabel(options, value);
+    },
+    //新增
+    handleAdd(id) {
+      this.$refs.editDialog.show(id);
+    },
+    /** 查询行社高管部署登记列表 */
+    getList() {
+      this.loading = true;
+      listhsggbsdj(this.queryParams).then((response) => {
+        this.dataList = response.rows;
+        this.total = response.total;
+        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 delhsggbsdj(ids);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
+    },
+
+    /** 详情按钮操作 */
+    handleInfo(row) {
+      this.reset();
+      const id = row.id || this.ids;
+      gethsggbsdj(id).then((response) => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "行社高管部署登记详情";
+      });
+    },
+  },
+};
+</script>
+<style>
+.ellipsis {
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+</style>

+ 5 - 5
src/views/safetyBook/index.vue

@@ -23,7 +23,7 @@
         >
           <el-form-item label="所属年份" prop="year">
             <el-date-picker
-              v-model="queryParams.planStartTime"
+              v-model="queryParams.year"
               :clearable="timeClearable"
               type="year"
               placeholder="选择时间"
@@ -40,7 +40,7 @@
               icon="el-icon-plus"
               size="mini"
               @click="handleAdd(null)"
-              v-hasPermi="['core:materials:add']"
+              v-hasPermi="['core:book:add']"
               >新增
             </el-button>
           </el-col>
@@ -106,7 +106,7 @@
                 type="text"
                 icon="el-icon-edit-outline"
                 @click="handleAdd(scope.row.id)"
-                v-hasPermi="['core:materials:edit']"
+                v-hasPermi="['core:book:add']"
                 >编辑
               </el-button>
               <el-button
@@ -114,7 +114,7 @@
                 type="text"
                 icon="el-icon-info"
                 @click="handleInfo(scope.row)"
-                v-hasPermi="['core:materials:edit']"
+                v-hasPermi="['core:book:query']"
                 >详情
               </el-button>
               <el-button
@@ -122,7 +122,7 @@
                 type="text"
                 icon="el-icon-delete"
                 @click="handleDelete(scope.row)"
-                v-hasPermi="['core:materials:remove']"
+                v-hasPermi="['core:book:remove']"
                 >删除
               </el-button>
             </template>

+ 1 - 1
src/views/system/user/extend.vue

@@ -144,7 +144,7 @@
         </el-row>
         <el-row>
           <el-col :xs="24" :sm="24" :md="24" :lg="24">
-            <el-form-item v-if="formData.certificateWork == 0" label="上传相关证书">
+            <el-form-item v-if="formData.certificateWork != 0" label="上传相关证书">
               <imgs-upload :limit="5" v-model="formData.qualificationCertificateUrl" :fileSize="2"></imgs-upload>
             </el-form-item>
           </el-col>