Administrator
2021-11-03 0ba5628cb5282ebbb1eac30c886f1af0d7d431f8
src/views/accreditationRecords/accreditationRecords.vue
@@ -23,6 +23,7 @@
    >
      <template slot="menuLeft">
        <el-button
          style="display:none"
          type="danger"
          size="small"
          icon="el-icon-delete"
@@ -37,11 +38,12 @@
        <el-tag>{{ row.categoryName }}</el-tag>
      </template>
      <template slot-scope="{ type, size, row }" slot="menu">
        <el-button
        :size="size"
        :type="type"
        v-if="permission.notice_upload"
        @click="handleUploadPage(row)"
        <el-button
          style="display:none"
          :size="size"
          :type="type"
          v-if="permission.notice_upload"
          @click="handleUploadPage(row)"
          >附件上传
        </el-button>
        <!-- <el-button
@@ -52,15 +54,26 @@
          >附件查看
        </el-button> -->
      </template>
      <template slot-scope="{ row }" slot="deptName">
            <el-tag>{{ row.deptName }}</el-tag>
      </template>
      <template slot-scope="{ row }" slot="sex">
            <el-tag>{{ row.sex=="1"?"男":row.sex=="2"?"女":""}}</el-tag>
      </template>
    </avue-crud>
  </basic-container>
</template>
<script>
import { getListPage, remove, update, add, getNotice } from "@/api/desk/notice";
import {
  getList,
  remove,
  update,
  add,
} from "@/api/accreditationRecords/accreditationRecords";
import { getDept } from "@/api/system/dept";
import { mapGetters } from "vuex";
import { mapState } from 'vuex';
import { mapState } from "vuex";
export default {
  data() {
@@ -97,116 +110,105 @@
        addBtnText: "发布",
        addTitle: "发布",
        saveBtnText: "发布",
        menuWidth: 320,
        menuWidth: 150,
        dialogClickModal: false,
        column: [
          {
            label: "通知标题",
            prop: "title",
            span: 24,
            searchSpan: 4,
            row: true,
            label: "姓名",
            prop: "realName",
            search: true,
            rules: [
              {
                required: true,
                message: "请输入通知标题",
                trigger: "blur",
              },
            ],
            searchSpan: 3,
            width:100,
            searchLabelWidth: 50,
            display: false,
          },
          // {
          //   label: "所属保安公司",
          //   searchLabelWidth: "110",
          //   // prop: "deptName",
          //   prop: "deptId",
          //   type: "tree",
          //   dicUrl:
          //     "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
          //   props: {
          //     label: "title",
          //     value: "id",
          //   },
          //   // hide: true,
          //   slot: true,
          //   searchSpan: 5,
          //   display: false,
          //   search: true,
          //   minWidth: 260,
          // },
          {
              label: "所属保安公司",
              searchLabelWidth: "110",
              prop: "deptName",
              // type: "tree",
              // dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
              // props: {
              //     label: "title",
              //     value: "id",
              // },
              slot: true,
              searchSpan: 5,
              display: false,
              search: true,
              minWidth: 200
          },
          {
            label: "通知类型",
            label: "性别",
            prop: "sex",
            width: 80,
            type: "select",
            dicUrl: "/api/blade-system/dict/dictionary?code=notice",
            props: {
              label: "dictValue",
              value: "dictKey",
            },
            dataType: "number",
            slot: true,
            addDisplay: false,
            editDisplay: false,
            defaultValue: "1",
            prop: "category",
            display: false,
          },
          {
            label: "身份证号码",
            prop: "idCardNo",
            search: true,
            searchLabelWidth: 90,
            searchSpan: 5,
            display: false,
          },
          {
            label: "年龄",
            prop: "age",
            display: false,
          },
          {
            label: "保安证编号",
            prop: "securityNumber",
            search: true,
            searchLabelWidth: 90,
            minWidth: 105,
            searchSpan: 4,
            rules: [
              {
                required: true,
                message: "请输入通知类型",
                trigger: "blur",
              },
            ],
          },
          {
            label: "发布单位",
            prop: "deptId",
            type: "tree",
            dicUrl: "/api/blade-system/dept/lazy-tree",
            props: {
              label: "title",
              value: "id",
            },
            addDisplay: false,
            editDisplay: false,
            rules: [
              {
                required: true,
                message: "所属组织机构",
                trigger: "click",
              },
            ],
            // hide: true,
          },
          // {
          //   label: "申请人",
          //   prop: "createUser",
          //   search: true,
          //   searchLabelWidth: 90,
          //   minWidth: 105,
          //   searchSpan: 4,
          //   addDisplay: false,
          //   editDisplay: false,
          //   // hide: true,
          // },
          {
            label: "通知时间",
            prop: "releaseTimeRange",
            type: "datetime",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            searchRange: true,
            hide: true,
            label: "申请时间",
            prop: "createTime",
            // search: true,
            searchLabelWidth: 90,
            minWidth: 105,
            // searchSpan: 4,
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
            search: true,
            searchSpan:6,
            rules: [
              {
                required: true,
                message: "请输入通知时间",
                trigger: "blur",
              },
            ],
          },
          {
            label: "通知日期",
            prop: "releaseTime",
            type: "date",
            format: "yyyy-MM-dd hh:mm:ss",
            valueFormat: "yyyy-MM-dd hh:mm:ss",
            rules: [
              {
                required: true,
                message: "请输入通知日期",
                trigger: "click",
              },
            ],
          },
          {
            label: "通知内容",
            prop: "content",
            component: "AvueUeditor",
            options: {
              action: "/api/blade-resource/oss/endpoint/put-file",
              props: {
                res: "data",
                url: "link",
              },
            },
            hide: true,
            minRows: 6,
            span: 24,
            // hide: true,
          },
        ],
      },
@@ -217,10 +219,10 @@
    ...mapGetters(["userInfo", "permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.notice_add, false),
        addBtn: this.vaildData(null, false),
        viewBtn: this.vaildData(this.permission.notice_view, false),
        delBtn: this.vaildData(this.permission.notice_delete, false),
        editBtn: this.vaildData(this.permission.notice_edit, false),
        delBtn: this.vaildData(null, false),
        editBtn: this.vaildData(null, false),
      };
    },
    ids() {
@@ -231,8 +233,8 @@
      return ids.join(",");
    },
    ...mapState({
        userInfo: state => state.user.userInfo
    })
      userInfo: (state) => state.user.userInfo,
    }),
  },
  mounted() {
    this.getDeptInfo(this.userInfo.dept_id);
@@ -246,7 +248,6 @@
        deptCategory == 1
          ? (that.deptCategory = true)
          : (that.deptCategory = false);
      });
    },
    //跳转到附件列表页面
@@ -262,10 +263,10 @@
    rowSave(row, done, loading) {
      if (this.deptCategory) {
        row.category = 1;
      }else{
      } else {
        row.category = 2;
      }
      row['type'] = 1;
      row["type"] = 1;
      row.deptId = this.deptId;
      add(row).then(
        () => {
@@ -390,23 +391,23 @@
          ? (that.deptCategory = true)
          : (that.deptCategory = false);
        const { releaseTimeRange } = this.query;
        // const { releaseTimeRange } = this.query;
        params["jurisdiction"] = this.jurisdiction;
        params["type"] = 1;
        let values = {
          ...params,
        };
        if (releaseTimeRange) {
          values = {
            ...params,
            startTime: releaseTimeRange[0],
            endTime: releaseTimeRange[1],
            ...this.query,
          };
          values.releaseTimeRange = null;
        }
        // if (releaseTimeRange) {
        //   values = {
        //     ...params,
        //     startTime: releaseTimeRange[0],
        //     endTime: releaseTimeRange[1],
        //     ...this.query,
        //   };
        //   values.releaseTimeRange = null;
        // }
        this.loading = true;
        getListPage(page.currentPage, page.pageSize, values).then((res) => {
        getList(page.currentPage, page.pageSize, values).then((res) => {
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;