heyang 1 rok pred
rodič
commit
45d1debcb7

+ 1 - 0
src/api/chemicalManage/index.js

@@ -0,0 +1 @@
+import request from '@/utils/request'

+ 3 - 0
src/store/modules/permission.js

@@ -230,6 +230,9 @@ export const loadView = (view) => { // 路由懒加载
   }else if(pathName === 'emergencyManagement'){
     //应急预警
     return (resolve) => require([`@/views/emergencyManagement${pathUrl}`], resolve)
+  }else if(pathName === 'chemicalManage'){
+    //化学品管理
+    return (resolve) => require([`@/views/chemicalManage${pathUrl}`], resolve)
   }
 }
 

+ 318 - 0
src/views/chemicalManage/useLedger/index.vue

@@ -0,0 +1,318 @@
+<!--物联分类-->
+<template>
+  <div class="app-container useLedger">
+    <div class="page-container useLedger-page" v-if="pageType == 1">
+      <div class="page-form-title-box">
+        <el-form :model="queryParams" class="form-box" ref="queryForm"
+                 :inline="true" style="width:100%;">
+          <el-form-item label="关键词" prop="searchValue " label-width="90px">
+            <el-input
+              maxLength="30"
+              v-model="queryParams.searchValue "
+              placeholder="请输入关键词"
+              clearable
+              style="width: 200px"
+            />
+          </el-form-item>
+          <el-form-item label="关键词" prop="searchValue " label-width="90px">
+            <el-input
+              maxLength="30"
+              v-model="queryParams.searchValue "
+              placeholder="请输入关键词"
+              clearable
+              style="width: 200px"
+            />
+          </el-form-item>
+          <el-form-item label="关键词" prop="searchValue " label-width="90px">
+            <el-input
+              maxLength="30"
+              v-model="queryParams.searchValue "
+              placeholder="请输入关键词"
+              clearable
+              style="width: 200px"
+            />
+          </el-form-item>
+          <el-form-item label="状态" prop="state ">
+            <el-select v-model="queryParams.state " clearable placeholder="请选择" style="width: 200px">
+              <el-option
+                v-for="dict in options"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              />
+            </el-select>
+          </el-form-item>
+          <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
+          <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
+          <el-form-item label="" prop="title" style="float: right">
+            <el-dropdown @command="exportButton" style="float: left">
+              <div class="form-dropdown-box">
+                <img src="@/assets/ZDimages/basicsModules/icon_jzgxx_sc.png">
+                <p>导出</p>
+                <img src="@/assets/ZDimages/basicsModules/icon_jzggl_xljt.png">
+              </div>
+              <el-dropdown-menu slot="dropdown">
+                <el-dropdown-item style="border-bottom:1px solid #E0E0E0;margin:0 10px;color:#333;" :command="{command:1}">导出全部数据</el-dropdown-item>
+                <el-dropdown-item style="margin:0 10px;color:#666;" :command="{command:2}">导出选中数据</el-dropdown-item>
+              </el-dropdown-menu>
+            </el-dropdown>
+          </el-form-item>
+        </el-form>
+      </div>
+      <div class="page-content-box">
+        <el-table class="table-box" v-loading="loading" border :data="dataList" @selection-change="handleSelectionChange" ref="multipleTable">
+          <el-table-column type="selection" width="50" align="center"/>
+          <el-table-column label="化学品名称" align="left" prop="name" />
+          <el-table-column label="编码" align="left" prop="name" />
+          <el-table-column label="CAS" align="left" prop="name" />
+          <el-table-column label="类别" align="left" prop="name" />
+          <el-table-column label="级别" align="left" prop="name" />
+          <el-table-column label="实验室" align="left" prop="name" />
+          <el-table-column label="安全员" align="left" prop="name" />
+          <el-table-column label="位置" align="left" prop="name" />
+          <el-table-column label="领用人" align="left" prop="name" />
+          <el-table-column label="领用时间" align="left" prop="name" />
+          <el-table-column label="领用量" align="left" prop="name" />
+          <el-table-column label="归还时间" align="left" prop="name" />
+          <el-table-column label="操作人" align="left" prop="name" />
+          <el-table-column label="操作" align="left" class-name="small-padding fixed-width">
+            <template slot-scope="scope">
+              <div class="table-button-box">
+                <p class="table-button-null"></p>
+                <p class="table-button-p"
+                   @click="tableButton(2,scope.row)"
+                >详情</p>
+                <p class="table-button-null"></p>
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+        <pagination :page-sizes="[20, 30, 40, 50]"
+                    v-show="total>0"
+                    :total="total"
+                    :page.sync="queryParams.page"
+                    :limit.sync="queryParams.pageSize"
+                    @pagination="getList"
+        />
+      </div>
+    </div>
+    <infoPage v-if="pageType == 2" :propsData="propsData"></infoPage>
+  </div>
+</template>
+
+<script>
+  import { iotTypeList,iotTypeDetail,iotTypeAdd,iotTypeUpdate,iotTypeDelete } from "@/api/iotDevice/index";
+  import infoPage from "./infoPage.vue"
+  export default {
+    name: 'index',
+    components: {
+      infoPage
+    },
+    data(){
+      return{
+        loading:false,
+        pageType:1,
+        options:[{label:'启用',value:true},{label:'停用',value:false}],
+        queryParams:{
+          page:1,
+          pageSize:20,
+          searchValue :"",
+          jobGroup:null,
+          state :null,
+        },
+        dataList:[{}],
+        total:0,
+        dialogTitle:null,
+        dialogType:false,
+        dialogForm:{
+          typeName:"",
+          typeKey:"",
+          state:true,
+          remark:"",
+        },
+        dialogRules:{
+          typeName: [
+            { required: true, message: "请输入名称", trigger: "blur" },
+            { required: true, message: "请输入名称", validator: this.spaceJudgment, trigger: "blur" }
+          ],
+          typeKey: [
+            { required: true, message: "请输入标识", trigger: "blur" },
+            { required: true, message: "请输入标识", validator: this.spaceJudgment, trigger: "blur" }
+          ],
+          state: [
+            { required: true, message: "请选择状态", trigger: "blur" },
+          ],
+        },
+        //组件传参
+        propsData:{},
+      }
+    },
+    created(){
+
+    },
+    mounted(){
+      //this.getList();
+    },
+    methods:{
+      /** 搜索按钮操作 */
+      handleQuery() {
+        this.queryParams.pageNum = 1;
+        this.getList();
+      },
+      /** 重置按钮操作 */
+      resetQuery() {
+        this.queryParams.searchValue = "";
+        this.handleQuery();
+      },
+      /** 导出按钮操作 */
+      exportButton(item) {
+        let self = this;
+        let currentDate = this.getCurrentTime()
+        if(item.command == 1){
+          self.$confirm(`确认导出全部数据?`, "提示", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(async () => {
+            self.download('/airbottle/informationRecord/taskExport/', {...self.queryParamsData}, '申领记录导出-'+currentDate+'.xlsx')
+          }).catch(() => {})
+        }else if(item.command == 2){
+          if(self.ids.length>0) {
+            self.$confirm(`确认导出选中数据?`, "提示", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning"
+            }).then(async () => {
+              let ids = self.ids.join(',');
+              let obj = {
+                ids :ids
+              }
+              console.log("obj",obj)
+              self.download(`/airbottle/informationRecord/taskExport/`,obj, '申领记录导出-'+currentDate+'.xlsx')
+            }).catch(() => {})
+          }else {
+            this.msgError('请选择要导出的数据')
+          }
+        }
+      },
+      // 多选框选中数据
+      handleSelectionChange(selection) {
+        this.selectedNum = selection.length;
+        this.ids = selection.map(item => item.id);
+        this.single = selection.length != 1;
+        this.multiple = !selection.length;
+      },
+
+
+
+      //弹层关闭
+      dialogOff(){
+        this.$set(this,'dialogType',false);
+      },
+      //弹层开启
+      dialogOpen(){
+        this.dialogFormReset();
+        this.$set(this,'dialogTitle','新增');
+        this.$set(this,'dialogType',true);
+      },
+      //弹层确定
+      dialogSubmit(){
+        this.$refs["dialogForm"].validate(valid => {
+          if (valid) {
+            if(this.dialogForm.typeId){
+              let obj = {
+                typeId:this.dialogForm.typeId,
+                typeName:this.dialogForm.typeName,
+                typeKey:this.dialogForm.typeKey,
+                state:this.dialogForm.state,
+                remark:this.dialogForm.remark,
+              }
+              iotTypeUpdate(obj).then(response => {
+                this.msgSuccess(response.message);
+                this.getList();
+                this.$set(this,'dialogType',false);
+              });
+            }else{
+              iotTypeAdd(this.dialogForm).then(response => {
+                this.msgSuccess(response.message);
+                this.getList();
+                this.$set(this,'dialogType',false);
+              });
+            }
+          }
+        })
+      },
+      handleQuery(){
+        this.$set(this.queryParams,'page',1);
+        this.getList();
+      },
+      resetQuery(){
+        this.$set(this,'queryParams',{
+          page:1,
+          pageSize:20,
+          searchValue :"",
+          state :null,
+        });
+        this.getList();
+      },
+      dialogFormReset(){
+        this.$set(this,'dialogForm',{
+          typeName:"",
+          typeKey:"",
+          state:true,
+          remark:"",
+        });
+      },
+      //获取数据列表
+      getList(){
+        this.$set(this,'loading',true);
+        iotTypeList(this.queryParams).then(response => {
+          this.$set(this,'dataList',response.data.records);
+          this.$set(this,'total',response.data.total);
+          this.$set(this,'loading',false);
+        });
+      },
+      tableButton(type,row){
+        let self = this;
+        if(type == 2){
+          //详情
+          this.$set(this,'propsData',JSON.parse(JSON.stringify(row)));
+          this.$set(this,'pageType',2);
+        }
+      },
+    },
+  }
+</script>
+
+<style scoped lang="scss">
+/*导出按钮样式*/
+.form-dropdown-box{
+  display: flex;
+  margin:0;
+  padding:0 10px;
+  cursor: pointer;
+  height:40px;
+  img:nth-child(1){
+    width:16px;
+    height:16px;
+    margin-top:12px;
+  }
+  p{
+    width:47px;
+    text-align: center;
+    font-size:14px;
+    margin:0;
+    line-height:40px;
+  }
+  img:nth-child(3){
+    width:10px;
+    height:6px;
+    margin-top:17px;
+  }
+}
+.useLedger{
+  .useLedger-page{
+
+  }
+}
+</style>

+ 192 - 0
src/views/chemicalManage/useLedger/infoPage.vue

@@ -0,0 +1,192 @@
+<template>
+  <div class="chemicalInventory-info-page">
+    <div class="title-box">
+      <p>盘点详情</p>
+      <p class="reset-button-one" @click="outButton">返回</p>
+    </div>
+    <div class="info-text-box">
+      <div class="info-text-min-box">
+        <div>
+          <p>标题:</p>
+          <p>{{infoData.takeTitle}}</p>
+        </div>
+        <div>
+          <p>盘点人:</p>
+          <p>{{infoData.createBy}}</p>
+        </div>
+        <div>
+          <p>盘点时间:</p>
+          <p>{{infoData.createTimeStr}}</p>
+        </div>
+      </div>
+      <div class="info-text-min-box">
+        <div>
+          <p>所属部门:</p>
+          <p>{{infoData.takeDpetName}}</p>
+        </div>
+        <div>
+          <p>楼栋:</p>
+          <p>{{infoData.takeBuildName}}</p>
+        </div>
+        <div>
+          <p>实验室:</p>
+          <p>{{infoData.subName}}</p>
+        </div>
+      </div>
+      <div class="info-text-min-box">
+        <div>
+          <p>盘点类型:</p>
+          <p>{{infoData.takeType==1?'按照实验室盘点':'按照化学品柜盘点'}}</p>
+        </div>
+      </div>
+    </div>
+    <div class="table-data-list-box">
+      <el-table border :data="tableData" ref="multipleTable">
+        <el-table-column label="序号"  width="50" align="center"  type="index"/>
+        <el-table-column label="化学品" prop="chemicalName" show-overflow-tooltip/>
+        <el-table-column label="CAS号" prop="casNum" width="130" show-overflow-tooltip/>
+        <el-table-column label="学院" prop="chemicalDpetName" width="200" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <span :class="scope.row.dpetFlag == 0?'abnormalColor':''">{{scope.row.chemicalDpetName}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="楼栋" prop="chemicalBuildName" width="150" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <span :class="scope.row.buildFlag == 0?'abnormalColor':''">{{scope.row.chemicalBuildName}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="实验室" prop="chemicalSubName" width="200" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <span :class="scope.row.subFlag == 0?'abnormalColor':''">{{scope.row.chemicalSubName}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="盘点结果" prop="takeResult" width="230"
+                         show-overflow-tooltip v-if="infoData.takeType == 1"/>
+        <el-table-column label="化学品柜" prop="chemicalCabinetName" width="140"
+                         show-overflow-tooltip v-if="infoData.takeType == 2">
+          <template slot-scope="scope">
+            <span :class="scope.row.cabinetFlag == 0?'abnormalColor':''">{{scope.row.chemicalCabinetName}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="盘点结果" prop="takeResult" width="160" s
+                         how-overflow-tooltip v-if="infoData.takeType == 2"/>
+        <el-table-column label="备注" prop="remark" width="120" show-overflow-tooltip/>
+        <el-table-column label="结果" prop="chemicalType" width="80" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <span :class="scope.row.chemicalType == 0?'abnormalColor':''">{{scope.row.chemicalType == 1?'正常':'异常'}}</span>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination :page-sizes="[20, 30, 40, 50]" 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 {  } from '@/api/chemicalManage/index'
+  export default {
+    name: 'infoPage',
+    props:{
+      infoDataProps:{},
+    },
+    data(){
+      return{
+        infoData:{},
+        tableData:[],
+        total:10,
+        pageNum:1,
+        pageSize:20,
+        queryParams:{
+          pageNum:1,
+          pageSize:20,
+          takeStockId:'',
+        },
+      }
+    },
+    created(){
+
+    },
+    mounted(){
+      this.initialization();
+    },
+    methods:{
+      // 初始化
+      initialization(){
+        hxpTakeStockInfo(this.infoDataProps.id).then( response => {
+          this.$set(this,'infoData',response.data);
+        });
+        this.getList();
+      },
+      outButton(){
+        this.$parent.controlsButton(1)
+      },
+      getList(){
+        this.queryParams.takeStockId=this.infoDataProps.id
+        hxpTakeStockDetailList(this.queryParams).then( response => {
+          this.$set(this,'tableData',response.rows);
+          this.total = response.total;
+        });
+      },
+    }
+  }
+</script>
+
+<style scoped lang="scss">
+  .chemicalInventory-info-page{
+    flex:1;
+    display: flex!important;
+    flex-direction: column;
+    overflow: hidden;
+    .title-box{
+      display: flex;
+      p:nth-child(1){
+        flex:1;
+        line-height:80px;
+        padding-left:20px;
+        color:#0045AF;
+        font-size:16px;
+      }
+      p:nth-child(2){
+        margin:20px;
+        width:90px;
+      }
+      border-bottom:1px solid #E0E0E0;
+    }
+    .info-text-box{
+      padding:36px 80px 0;
+      .info-text-min-box{
+        display: flex;
+        div{
+          flex:1;
+          font-size:16px;
+          display: flex;
+          margin-bottom:36px;
+          p{
+            line-height:20px;
+          }
+          p:nth-child(1){
+            width:80px;
+            text-align: right;
+            margin-right:10px;
+          }
+          p:nth-child(2){
+            flex:1;
+          }
+        }
+      }
+    }
+    .table-data-list-box{
+      flex:1;
+      display: flex!important;
+      flex-direction: column;
+      overflow: hidden;
+      margin:0 80px;
+      .abnormalColor{
+        color:#FF7300
+      }
+    }
+  }
+</style>

+ 10 - 0
vue.config.js

@@ -429,6 +429,16 @@ module.exports = {
           enforce:true,
           reuseExistingChunk: true
         },
+        //化学品管理
+        chemicalManage: {
+          name: 'chunk-chemicalManage',
+          test: resolve('src/views/chemicalManage'),
+          priority: 0,
+          minSize: 0,
+          minChunks: 1,
+          enforce:true,
+          reuseExistingChunk: true
+        },
       }
     })
     config.optimization.runtimeChunk('single'),{