heyang 2 年之前
父節點
當前提交
70327a4f12

+ 66 - 0
src/api/laboratory/safetyInfo.js

@@ -0,0 +1,66 @@
+import request from '@/utils/request'
+
+// 安全信息类目-新增
+export function infoCategoryAdd(data) {
+  return request({
+    url: '/laboratory/XxpClassify/',
+    method: 'post',
+    data: data
+  })
+}
+// 安全信息类目-编辑
+export function infoCategoryPut(data) {
+  return request({
+    url: '/laboratory/XxpClassify/',
+    method: 'put',
+    data: data
+  })
+}
+// 安全信息类目-删除
+export function infoCategoryDelete(id) {
+  return request({
+    url: '/laboratory/XxpClassify/'+id,
+    method: 'Delete',
+  })
+}
+//安全信息类目-列表
+export function infoCategoryList(data) {
+  return request({
+    url: '/laboratory/XxpClassify/list',
+    method: 'get',
+    params: data
+  })
+}
+// 安全信息配置------------------------------------------------------------------------------------
+// 安全信息配置-新增
+export function infoConfigAdd(data) {
+  return request({
+    url: '/laboratory/XxpClassifyDet/',
+    method: 'post',
+    data: data
+  })
+}
+// 安全信息配置-编辑
+export function infoConfigPut(data) {
+  return request({
+    url: '/laboratory/XxpClassifyDet/',
+    method: 'put',
+    data: data
+  })
+}
+//安全信息配置-列表
+export function infoConfigList(data) {
+  return request({
+    url: '/laboratory/XxpClassifyDet/list',
+    method: 'get',
+    params: data
+  })
+}
+// 安全信息配置-删除
+export function infoConfigDelete(id) {
+  return request({
+    url: '/laboratory/XxpClassifyDet/'+id,
+    method: 'Delete',
+  })
+}
+

+ 66 - 0
src/api/laboratory/subject.js

@@ -59,6 +59,14 @@ export function updateSubject(data) {
     data: data
   })
 }
+// 查询实验室-安全信息牌
+export function getClassifyBySubId(data) {
+  return request({
+    url: '/laboratory/XxpClassify/getClassifyBySubId/',
+    method: 'get',
+    data: data
+  })
+}
 
 // 修改实验室(包含新危险源)
 export function updateSubjectEditJoinHazard(data) {
@@ -291,6 +299,32 @@ export function delSubjectRelation(id) {
     method: 'Delete',
   })
 }
+// 新增电子信息牌
+export function subjectSignAdd(data) {
+  return request({
+    url: '/laboratory/XxpCardInfo/addInfo',
+    method: 'post',
+    data: data
+  })
+}
+// 编辑电子信息牌
+export function subjectSignEdit(data) {
+  return request({
+    url: '/laboratory/XxpCardInfo/edit',
+    method: 'post',
+    data: data
+  })
+}
+// 删除电子信息牌
+export function subjectSignDelete(id) {
+  return request({
+    url: '/laboratory/XxpCardInfo/del/'+id,
+    method: 'post',
+  })
+}
+
+
+
 
 //门禁授权列表
 export function openDoorApplyList(query) {
@@ -479,3 +513,35 @@ export function queryHardByTypeList(query) {
     params: query
   })
 }
+//电子信息牌------------------------------------------------------------------------------
+//查询门禁授权类型
+export function getSignTypeList(query) {
+  return request({
+    url: '/laboratory/XxpUserAuth/authTypelist',
+    method: 'get',
+    params: query
+  })
+}
+//新增电子信息牌用户授权
+export function getSignAuthAdd(data) {
+  return request({
+    url: '/laboratory/XxpUserAuth/addAuth',
+    method: 'post',
+    data: data
+  })
+}
+//查询门禁授权列表
+export function getSignAuthList(query) {
+  return request({
+    url: '/laboratory/XxpUserAuth/list',
+    method: 'get',
+    params: query
+  })
+}
+//门禁授权删除
+export function getSignAuthDelete(id) {
+  return request({
+    url: '/laboratory/XxpUserAuth/' + id,
+    method: 'delete'
+  })
+}

+ 220 - 0
src/views/safetyInfo/safetyInfoCategory/infoConfig.vue

@@ -0,0 +1,220 @@
+<!--信用分明细-->
+<template>
+  <div class="creditScoreList">
+    <div class="title-box">
+      <p>信息牌配置</p>
+      <p class="reset-button-one" @click="handleClick('','','back')"><i class="el-icon-arrow-left"></i>返回</p>
+    </div>
+    <div class="rewardPointsListPage">
+      <el-table v-loading="loading" border :data="tableData" style="margin-top:20px;">
+        <el-table-column label="类目名称" align="left" prop="classifyName"/>
+        <el-table-column label="内容类型" align="left" prop="classifyType">
+          <template slot-scope="scope">
+            <span v-if="scope.row.classifyType==1">文字</span>
+            <span v-if="scope.row.classifyType==2">图片</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="颜色" align="left" prop="showColour">
+          <template slot-scope="scope">
+            <p :style="'width:40px;height:23px;margin:0;background:'+scope.row.showColour"></p>
+          </template>
+        </el-table-column>
+        <el-table-column label="创建人" align="left" prop="createBy"/>
+        <el-table-column label="创建时间" align="left" prop="createTime"/>
+        <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="120">
+          <template slot-scope="scope">
+            <div class="category-show">
+              <el-switch
+                @click.native="categoryShow(scope.row)"
+                class="category-switch captcha-img"
+                :active-value="1"
+                :inactive-value="2"
+                active-color="#FF9900"
+                inactive-color="#999"
+                v-model="scope.row.isShow"
+                active-text="启用"
+                inactive-text="停用"
+                disabled
+              ></el-switch>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column label="" align="left" class-name="small-padding fixed-width" width="120">
+          <template slot-scope="scope">
+            <el-input
+              :disabled="scope.row.isSpecial==2"
+              class="serial"
+              v-model="scope.row.sort"
+              @change="categorySort(scope.row)"
+              placeholder="序号">
+            </el-input>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+        style="margin-top:20px;"
+        v-show="total>0"
+        :total="total"
+        layout="total, prev, pager, next, sizes, jumper"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
+    </div>
+  </div>
+</template>
+
+<script>
+import { creditScoreList } from "@/api/exam/record";
+import { infoCategoryAdd, infoCategoryDelete, infoCategoryList, infoCategoryPut } from '@/api/laboratory/safetyInfo'
+export default {
+  name: "creditScoreList",
+  props: {
+    propsData:{},
+  },
+  data() {
+    return {
+      //加载状态
+      loading:false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize:20,
+      },
+      //列表数据
+      tableData:[{status:3}],
+      total:0,
+
+    }
+  },
+  created(){
+    this.getList()
+  },
+  methods:{
+    //返回上级页面
+    backPage(){
+      this.$parent.goPage(1);
+    },
+    handleClick(index,row,doType){
+      let _this=this;
+      if(doType=='add'){//添加
+        this.open = true;
+      }else if(doType=='back'){//返回
+        this.$parent.handleClick('','','back');
+      }
+    },
+    categoryShow(row){
+      let obj={
+        id:row.id,
+        isShow:row.isShow==1?2:1,
+        sort:row.sort,
+      }
+      infoCategoryPut(obj).then( response => {
+        this.msgSuccess("修改成功");
+        this.open = false;
+        this.getList();
+      });
+    },
+    categorySort(row){
+      let obj={
+        id:row.id,
+        sort:row.sort,
+      }
+      infoCategoryPut(obj).then( response => {
+        this.msgSuccess("修改成功");
+        this.open = false;
+        this.getList();
+      });
+    },
+    /** 查询数据 */
+    getList() {
+      this.loading = true;
+      infoCategoryList(this.queryParams).then( response => {
+        this.tableData =  response.rows;
+        this.total =  response.total;
+        this.loading = false;
+      });
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryParams");
+      this.handleQuery();
+    },
+  },
+}
+</script>
+
+<style lang="scss">
+.serial{
+  width: 60px;
+}
+.category-show{
+  width: 80px;
+  .category-switch .el-switch__label {
+    position: absolute;
+    display: none;
+    color: #fff !important;
+  }
+
+
+  .category-switch .el-switch__label--right span {
+    margin-left: 10px;
+  }
+
+  .category-switch .el-switch__label--left {
+    z-index: 1;
+  }
+
+  .category-switch .el-switch__label--left span {
+    margin-left: 24px;
+  }
+
+  .category-switch .el-switch__label.is-active {
+    display: block;
+  }
+
+  .category-switch.el-switch .el-switch__core,
+  .el-switch .el-switch__label {
+    width: 72px !important;
+    margin: 0;
+  }
+}
+</style>
+
+<style scoped lang="scss">
+.creditScoreList {
+  flex:1;
+  display: flex!important;
+  flex-direction: column;
+  overflow: hidden;
+  *{
+    margin:0;
+  }
+  .title-box{
+    display: flex;
+    border-bottom: 1px solid #E0E0E0;
+    p:nth-child(1){
+      flex:1;
+      line-height:80px;
+      color:#0045AF;
+      font-size:18px;
+      margin-left:20px;
+    }
+    p:nth-child(2){
+      margin:20px;
+    }
+  }
+  .rewardPointsListPage{
+    flex:1;
+    display: flex!important;
+    flex-direction: column;
+    overflow: hidden;
+    padding:20px;
+  }
+}
+</style>

+ 396 - 0
src/views/safetyInfo/safetyInfoConfig/safetyInfoConfig.vue

@@ -0,0 +1,396 @@
+<!--安全信息类目-->
+<template>
+  <div class="app-container approval_handle">
+    <div class="tab-title">
+      <div class="tab-title-l">
+        <template>
+          <el-tabs v-model="activeName" @tab-click="handleTabClick">
+            <el-tab-pane :label="item.classifyName" :name="item.id+''" v-for="item in tabsList"></el-tab-pane>
+          </el-tabs>
+        </template>
+      </div>
+      <el-button
+        type="primary"
+        plain
+        icon="el-icon-plus"
+        size="mini"
+        @click="handleClick('','','add')"
+      >新增</el-button>
+    </div>
+    <div class="approval_handle-page" v-if="pageType == 1">
+      <el-table border v-loading="loading" :data="tableData">
+        <el-table-column label="序号"  width="100" align="left"  type="index"/>
+        <el-table-column label="信息名称" align="left" prop="infoName"/>
+        <el-table-column label="公共信息" align="left">
+          <template slot-scope="scope">
+            <el-switch
+              @click.native="categoryShow(scope.row)"
+              class="category-switch captcha-img"
+              :active-value="2"
+              :inactive-value="1"
+              active-color="#FF9900"
+              inactive-color="#999"
+              v-model="scope.row.isCollective"
+              active-text="是"
+              inactive-text="否"
+              disabled
+            ></el-switch>
+          </template>
+        </el-table-column>
+        <el-table-column label="添加人" align="left" prop="createBy"/>
+        <el-table-column label="添加时间" align="left" prop="createTime"/>
+        <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="120">
+          <template slot-scope="scope">
+            <div class="button-box">
+              <p class="table-min-button"
+                 @click="handleClick('',scope.row,'edit')"
+              >编辑</p>
+              <p class="table-min-button"
+                 @click="handleClick('',scope.row,'delete')"
+              >删除</p>
+            </div>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination :page-sizes="[20, 30, 40, 50]"
+        :total="total"
+        layout="total, prev, pager, next, sizes, jumper"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
+    </div>
+    <safety-Info-Config v-if="pageType == 2"></safety-Info-Config>
+    <!-- 添加或修改安全分级对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="信息名称" prop="infoName">
+          <el-input v-model="form.infoName" maxlength="10" placeholder="请输入名称" style="width:320px;"/>
+        </el-form-item>
+        <el-form-item label="信息类目"  prop="infoClassifyId" class="form-item">
+          <el-select placeholder="请选择类目" v-model="form.infoClassifyId" style="width:320px;" @change="categoryClick()">
+            <el-option
+              v-for="dict in categoryList"
+              :key="dict.id"
+              :label="dict.classifyName"
+              :value="dict.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="信息类型">
+          <el-input v-model="form.infoTypeName"   placeholder="" disabled style="width:320px;"/>
+        </el-form-item>
+        <el-form-item label="信息内容" prop="infoContent" v-if="form.infoType==1">
+          <el-input type="textarea" v-model="form.infoContent"   placeholder="请输入内容" style="width:320px;"/>
+        </el-form-item>
+        <el-form-item label="信息内容" prop="infoContent" v-if="form.infoType==2">
+          <el-upload
+            class="certificate-avatar-uploader"
+            :action="uploadImgUrl"
+            :show-file-list="false"
+            :on-success="handleAvatarSuccess"
+            :headers="headers"
+            :before-upload="beforeAvatarUpload">
+            <div style="display: flex;">
+              <img v-if="form.infoContent" :src="form.infoContent" style="width: 80px;height: 80px;margin-right: 10px">
+              <i v-if="!form.infoContent" class="el-icon-plus avatar-uploader-icon"></i>
+            </div>
+          </el-upload>
+        </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>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { getToken } from "@/utils/auth";
+import {
+  infoCategoryList,
+  infoConfigAdd, infoConfigList, infoConfigPut,infoConfigDelete
+} from '@/api/laboratory/safetyInfo'
+import safetyInfoConfig from "./safetyInfoConfig.vue"
+import { listHazard } from '@/api/permissionRequired'
+export default {
+  name: "Approval",
+  components: {
+    safetyInfoConfig
+  },
+  data() {
+    return {
+      uploadImgUrl: this.uploadUrl(), // 上传的图片服务器地址
+      activeName: '',
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      //页面状态
+      pageType:1,
+      loading:false,
+      headers: {
+        Authorization: "Bearer " + getToken()
+      },
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize:20,
+        infoClassifyId:'',
+      },
+      total:0,
+      tableData:[{}],
+      dateRange:[],
+      pageData2:{},
+      tabsList:[],
+      categoryList:[],
+      // 表单参数
+      form: {
+        infoName:'',
+        infoClassifyId:'',
+        infoType:'',
+        infoTypeName:'',
+        infoContent:'',
+        isCollective:'',
+
+      },
+      // 表单校验
+      rules: {
+        infoName: [
+          { required: true, message: "请输入名称", trigger: "blur" },
+        ],
+        infoClassifyId: [
+          { required: true, message: "请选择类目", trigger: "blur" },
+        ],
+        infoContent: [
+          { required: true, message: "请添加信息内容", trigger: "blur" },
+        ],
+      }
+    };
+
+
+  },
+  methods: {
+      handleTabClick(tab){
+        console.log(tab.name)
+        this.queryParams.infoClassifyId=tab.name;
+        this.getList()
+      },
+      handleClick(index,row,doType){
+        let self=this;
+        if(doType=='add'){//添加
+          delete this.form.id
+          this.form.infoName='';
+          this.form.infoClassifyId='';
+          this.form.infoType='';
+          this.form.infoTypeName='';
+          this.form.infoContent='';
+          this.open = true;
+        }else if(doType=='edit'){//编辑
+          this.form.id=row.id
+          this.form.infoName=row.infoName
+          this.form.infoClassifyId=row.infoClassifyId
+          this.form.infoContent=row.infoContent
+          this.form.infoType=row.infoType
+          this.form.infoTypeName=row.infoType==1?'文字':'图片';
+          this.open = true;
+
+        }else if(doType=='deploy'){//信息牌配置
+          self.pageType=2;
+        }else if(doType=='delete'){//删除
+          this.$confirm('确认要删除吗?', "警告", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(() => {
+            //  确定
+            infoConfigDelete(row.id).then(response => {
+              self.msgSuccess(response.msg);
+              self.getList();
+            });
+          }).catch(function() {});
+        }else if(doType=='back'){//返回
+          self.pageType=1;
+        }
+      },
+      categoryShow(row){
+        let obj={
+          id:row.id,
+          isCollective:row.isCollective==1?2:1,
+        }
+        infoConfigPut(obj).then( response => {
+          this.msgSuccess("修改成功");
+          this.open = false;
+          this.getList();
+        });
+      },
+      categoryClick(){
+        let _this=this;
+        this.form.infoContent='';
+        this.categoryList.forEach(function(item) {
+          if(item.id==_this.form.infoClassifyId){
+              console.log(item)
+            _this.form.infoTypeName=item.classifyType==1?'文字':'图片';
+            _this.form.infoType=item.classifyType;
+          }
+        })
+
+      },
+      /** 搜索按钮操作 */
+      handleQuery() {
+        this.queryParams.pageNum = 1;
+        this.getList();
+      },
+      /** 重置按钮操作 */
+      resetQuery() {
+        this.handleQuery();
+      },
+      /** 取消按钮 */
+      cancel() {
+        this.open = false;
+      },
+      /** 提交按钮 */
+      submitForm() {
+        this.$refs["form"].validate(valid => {
+          if (valid) {
+            if (this.form.id != null) {
+              infoConfigPut(this.form).then( response => {
+                this.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              });
+            } else {
+              infoConfigAdd(this.form).then( response => {
+                this.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              });
+            }
+          }
+        });
+      },
+      //上传
+      handleAvatarSuccess(res, file) {
+        console.log(res.data.url);
+        this.form.infoContent = res.data.url;
+        this.$forceUpdate()
+      },
+      beforeAvatarUpload(file) {
+        let type = false;
+        if (file.type == 'image/png' || file.type == 'image/jpeg' || file.type == 'image/gif') {
+          type = true;
+        }else{
+          this.$message.error('只能上传png/jpeg/gif格式图片');
+          type = false;
+        }
+        return type;
+      },
+      //获取危险源列表
+      getCategory(){
+        listHazard({}).then(response=>{
+          this.$set(this,'categoryList',response.data);
+        })
+      },
+      //查询信息类目列表
+      getCategoryList(){
+        let _this=this;
+        let obj={
+          pageNum: 1,
+          pageSize:100,
+        }
+        infoCategoryList(obj).then( response => {
+          let res=response.rows;
+          if(response.code==200){
+            if(res){
+              _this.tabsList=res;
+              _this.categoryList=res;
+              _this.activeName=response.rows[0].id+''
+              _this.queryParams.infoClassifyId=response.rows[0].id;
+              this.getList()
+            }
+          }
+
+        });
+      },
+      getList(){
+        let _this=this;
+        infoConfigList(_this.queryParams).then( response => {
+          let res=response.rows;
+          _this.tableData=res;
+          _this.total=response.total;
+        });
+      },
+  },
+  mounted() {
+    this.getCategoryList()
+
+  }
+};
+</script>
+
+<style scoped lang="scss">
+  .approval_handle {
+    display: flex!important;
+    flex-direction: column;
+    flex-direction: column;
+    box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
+    border-radius:10px;
+    padding-top: 20px !important;
+    .approval_handle-page{
+      padding:20px 20px 20px!important;
+      flex:1;
+      display: flex!important;
+      flex-direction: column;
+      .button-box{
+        width:200px;
+        display: flex;
+      }
+    }
+
+  }
+
+</style>
+<style  lang="scss">
+
+.tab-title{
+  display: flex;
+  justify-content: space-between;
+  padding-bottom: 20px;
+  box-sizing: border-box;
+  border-bottom: 1px solid #E0E0E0;
+  padding: 0 20px;
+  .tab-title-l{
+    flex: 1;
+    .el-tabs__nav-wrap::after{
+      background-color: #fff !important;
+    }
+  }
+}
+.category-switch .el-switch__label {
+  position: absolute;
+  display: none;
+  color: #fff !important;
+}
+.category-switch .el-switch__label--right span {
+  margin-left: 10px;
+}
+
+.category-switch .el-switch__label--left {
+  z-index: 1;
+}
+
+.category-switch .el-switch__label--left span {
+  margin-left: 24px;
+}
+
+.category-switch .el-switch__label.is-active {
+  display: block;
+}
+
+.category-switch.el-switch .el-switch__core,
+.el-switch .el-switch__label {
+  width: 60px !important;
+  margin: 0;
+}
+</style>