|
@@ -0,0 +1,387 @@
|
|
|
+<!-- 待入库 -->
|
|
|
+<template>
|
|
|
+ <div class="app-container savePending">
|
|
|
+ <div class="page-container savePendingPage" 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="queryParamsData2">
|
|
|
+ <el-select v-model="queryParams.queryParamsData2"
|
|
|
+ placeholder="请选择学院"
|
|
|
+ style="width: 140px">
|
|
|
+ <el-option
|
|
|
+ v-for="item in deptOptions"
|
|
|
+ :key="item.deptId"
|
|
|
+ :label="item.deptName"
|
|
|
+ :value="item.deptId"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="" prop="queryParamsData3">
|
|
|
+ <el-cascader
|
|
|
+ style="width: 150px"
|
|
|
+ placeholder="请选择楼栋楼层"
|
|
|
+ :props="{value: 'id', label: 'name',children:'buildFloorVoList'}"
|
|
|
+ v-model="queryParams.queryParamsData3"
|
|
|
+ :options="buildFloorOptions">
|
|
|
+ </el-cascader>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="" prop="queryParamsData4">
|
|
|
+ <el-select v-model="queryParams.queryParamsData4"
|
|
|
+ placeholder="请选择级别"
|
|
|
+ style="width: 120px">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in optionList"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="" prop="queryParamsData2">
|
|
|
+ <el-select v-model="queryParams.queryParamsData2"
|
|
|
+ placeholder="请选择类别"
|
|
|
+ style="width: 120px">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in optionList"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="" prop="state">
|
|
|
+ <el-date-picker
|
|
|
+ :clearable="false"
|
|
|
+ v-model="dateRange"
|
|
|
+ size="small"
|
|
|
+ style="width: 220px"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="-"
|
|
|
+ start-placeholder="开始时间"
|
|
|
+ end-placeholder="结束时间"
|
|
|
+ ></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="" prop="queryParamsData1">
|
|
|
+ <el-input
|
|
|
+ maxLength="30"
|
|
|
+ v-model="queryParams.queryParamsData1"
|
|
|
+ placeholder="化学品名/CAS/编码/实验室/房间号..."
|
|
|
+ style="width: 260px"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
|
|
|
+ <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
|
|
|
+ <p class="page-add-common-style-button"
|
|
|
+ style="float: right;"
|
|
|
+ @click="tableButton(1)"
|
|
|
+ v-hasPermiRouter="['demo:demo:add']"
|
|
|
+ >添加</p>
|
|
|
+ <el-form-item style="float: right;">
|
|
|
+ <export-component :exportConfig="exportConfig" v-hasPermiRouter="['demo:demo:demo']"></export-component>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item style="float: right;">
|
|
|
+ <import-component :importConfig="importConfig" v-hasPermiRouter="['demo:demo:demo']"></import-component>
|
|
|
+ </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" :row-key="getRowKeys">
|
|
|
+ <el-table-column type="selection" width="50" align="center" fixed :reserve-selection="true"/>
|
|
|
+ <el-table-column label="名称" prop="name" width="150" fixed show-overflow-tooltip/>
|
|
|
+ <el-table-column label="编码" prop="content" width="120" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="CAS" prop="content" width="120" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="类别" prop="content" width="120" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="级别" prop="content" width="120" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="规格" prop="content" width="120" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="数量" prop="content" width="120" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="过期时间" prop="createTime" width="200" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-date-picker
|
|
|
+ class="table-date-picker"
|
|
|
+ v-model="scope.row.time"
|
|
|
+ type="date"
|
|
|
+ placeholder="选择日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="归属人" prop="content" width="150" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="学院" prop="content" width="150" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="楼栋楼层" prop="content" width="180" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="实验室" prop="content" width="230" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="实验室负责人" prop="content" width="150" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="安全员" prop="content" width="150" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="入库期限" prop="createTime" width="200" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ parseTime(scope.row.createTime) }}</span><span>逾期</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="200" show-overflow-tooltip v-if="tableButtonType">
|
|
|
+ <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)"
|
|
|
+ v-hasPermiRouter="['demo:demo:detail']"
|
|
|
+ >详情</p>
|
|
|
+ <p class="table-button-p"
|
|
|
+ @click="tableButton(3,scope.row)"
|
|
|
+ v-hasPermiRouter="['demo:demo:edit']"
|
|
|
+ >编辑</p>
|
|
|
+ <p class="table-button-p"
|
|
|
+ @click="tableButton(4,scope.row)"
|
|
|
+ v-hasPermiRouter="['demo:demo:del']"
|
|
|
+ >删除</p>
|
|
|
+ <p class="table-button-null"></p>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="selected-num-box" v-show="total>0">
|
|
|
+ <p class="selected-num-p">
|
|
|
+ <i class="el-icon-warning"></i>
|
|
|
+ 已选择 {{selectedNum}} 项
|
|
|
+ </p>
|
|
|
+ <pagination :page-sizes="[20, 30, 40, 50]"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.page"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--<add-page :propsData="propsData" v-if="pageType === 2"></add-page>-->
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+ //import { getDicts } from "@/api/commonality/noPermission";
|
|
|
+ //import { systemUserSelect } from "@/api/commonality/permission";
|
|
|
+ //import { getInfo } from "@/api/basicsModules/index";
|
|
|
+ //import addPage from "./addPage.vue";
|
|
|
+ import importComponent from "@/components/importComponent/importComponent.vue";
|
|
|
+ import exportComponent from "@/components/exportComponent/exportComponent.vue";
|
|
|
+ import { getDeptDropList,systemBuildingGetTreeList,} from "@/api/commonality/permission";
|
|
|
+ export default {
|
|
|
+ name: 'index',
|
|
|
+ components: {
|
|
|
+ importComponent,
|
|
|
+ exportComponent,
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ //导出配置
|
|
|
+ exportConfig:{
|
|
|
+ api:'system/user/student/export', //导出接口地址
|
|
|
+ ids:'', //勾选导出,勾选的IDS
|
|
|
+ fileName:'化学品信息', //导出文件的命名
|
|
|
+ },
|
|
|
+ importConfig:{
|
|
|
+ upLoadApi:'/system/user/student/importData', //上传接口地址
|
|
|
+ downloadApi:'/system/user/student/importTemplate', //下载模板接口地址
|
|
|
+ loseApi:'/system/user/student/importErrorData', //失败报表接口地址
|
|
|
+ fileName:'导入模板-', //下载模板命名
|
|
|
+ },
|
|
|
+ tableButtonType:this.hasPermiDom(['demo:demo:detail','demo:demo:edit','demo:demo:del',]),
|
|
|
+ //页面状态
|
|
|
+ pageType:1,
|
|
|
+ //页面遮罩
|
|
|
+ loading:false,
|
|
|
+ //学院
|
|
|
+ deptOptions:[],
|
|
|
+ //楼栋楼层
|
|
|
+ buildFloorOptions:[],
|
|
|
+ //下拉列表数据
|
|
|
+ optionList:[{value:true,label:'启用'},{value:false,label:'停用'}],
|
|
|
+ //查询条件
|
|
|
+ queryParams:{
|
|
|
+ page:1,
|
|
|
+ pageSize:20,
|
|
|
+ queryParamsData1:"",
|
|
|
+ queryParamsData2 :null,
|
|
|
+ },
|
|
|
+ //时间数据
|
|
|
+ dateRange:[],
|
|
|
+ //列表数据
|
|
|
+ dataList:[{}],
|
|
|
+ //数据数量
|
|
|
+ total:10,
|
|
|
+ // 选中数组
|
|
|
+ selectedNum:0,
|
|
|
+ ids:[],
|
|
|
+ multiple:true,
|
|
|
+ //组件传参
|
|
|
+ propsData:{},
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ this.getDeptDropList();
|
|
|
+ this.systemBuildingGetTreeList();
|
|
|
+ //this.getList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ //查询按钮
|
|
|
+ handleQuery(){
|
|
|
+ this.$set(this.queryParams,'page',1);
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ //重置按钮
|
|
|
+ resetQuery(){
|
|
|
+ this.$set(this,'dateRange',[])
|
|
|
+ this.$set(this,'queryParams',{
|
|
|
+ page:1,
|
|
|
+ pageSize:20,
|
|
|
+ queryParamsData1:"",
|
|
|
+ queryParamsData2 :null,
|
|
|
+ });
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ //获取数据列表
|
|
|
+ getList(){
|
|
|
+ this.$set(this,'loading',true);
|
|
|
+ let obj = JSON.parse(JSON.stringify(this.queryParams))
|
|
|
+ if(this.dateRange[0]){
|
|
|
+ obj.startTime = this.dateRange[0]+'T00:00:00'
|
|
|
+ obj.endTime = this.dateRange[1]+'T23:59:59'
|
|
|
+ }else{
|
|
|
+ obj.startTime = "";
|
|
|
+ obj.endTime = "";
|
|
|
+ }
|
|
|
+ getListFunction(obj).then(response => {
|
|
|
+ this.$set(this,'loading',false);
|
|
|
+ this.$set(this,'dataList',response.data.records);
|
|
|
+ this.$set(this,'total',response.data.total);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //操作按钮
|
|
|
+ tableButton(type,row){
|
|
|
+ let self = this;
|
|
|
+ if(type == 1){
|
|
|
+ //新增
|
|
|
+ this.$set(this,'pageType',2);
|
|
|
+ this.$set(this,'propsData',{});
|
|
|
+ }else if(type == 2){
|
|
|
+ //详情
|
|
|
+ this.$set(this,'pageType',2);
|
|
|
+ let obj = JSON.parse(JSON.stringify(row))
|
|
|
+ obj.showType = true;
|
|
|
+ this.$set(this,'propsData',obj);
|
|
|
+ }else if(type == 3){
|
|
|
+ //编辑
|
|
|
+ this.$set(this,'pageType',2);
|
|
|
+ let obj = JSON.parse(JSON.stringify(row))
|
|
|
+ obj.showType = false;
|
|
|
+ this.$set(this,'propsData',obj);
|
|
|
+ }else if(type == 4){
|
|
|
+ //删除
|
|
|
+ this.$confirm('是否确认删除?', "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(function() {
|
|
|
+ }).then(() => {
|
|
|
+ deleteFunction({id:row.id}).then(response => {
|
|
|
+ self.msgSuccess(response.message)
|
|
|
+ self.getList();
|
|
|
+ });
|
|
|
+ }).catch(() => {});
|
|
|
+ }else if(type == 5){
|
|
|
+ //启用&停用
|
|
|
+ let text = row.state ? "停用" : "启用";
|
|
|
+ this.$confirm('是否确认' + text + '?', "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(function() {
|
|
|
+ }).then(() => {
|
|
|
+ stateFunction({id:row.id,state:!row.state,}).then(response => {
|
|
|
+ self.msgSuccess(response.message)
|
|
|
+ self.getList();
|
|
|
+ });
|
|
|
+ }).catch(() => {});
|
|
|
+ }else if(type == 6){
|
|
|
+ //返回并刷新
|
|
|
+ this.$set(this,'pageType',1);
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //查询学院列表
|
|
|
+ getDeptDropList(){
|
|
|
+ getDeptDropList({deptName:"",level:2,deptType:1}).then(response => {
|
|
|
+ this.$set(this, 'deptOptions', response.data)
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //查询楼栋楼层
|
|
|
+ systemBuildingGetTreeList(){
|
|
|
+ systemBuildingGetTreeList({}).then(response => {
|
|
|
+ if (response.data[0]) {
|
|
|
+ let list = this.forBuildFloor(response.data);
|
|
|
+ let newList = [];
|
|
|
+ for(let i=0;i<list.length;i++){
|
|
|
+ if(list[i].buildFloorVoList){
|
|
|
+ for(let o=0;o<list[i].buildFloorVoList.length;o++){
|
|
|
+ if(list[i].buildFloorVoList[o].buildFloorVoList){
|
|
|
+ newList.push(list[i].buildFloorVoList[o])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log('newList========>',newList);
|
|
|
+ this.$set(this, 'buildFloorOptions', newList)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //处理楼栋楼层数据
|
|
|
+ forBuildFloor(list){
|
|
|
+ let self = this;
|
|
|
+ for(let i=0;i<list.length;i++){
|
|
|
+ if(list[i].buildFloorVoList){
|
|
|
+ if(list[i].buildFloorVoList[0]){
|
|
|
+ list[i].buildFloorVoList = self.forBuildFloor(list[i].buildFloorVoList);
|
|
|
+ }else{
|
|
|
+ delete list[i].buildFloorVoList;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ delete list[i].buildFloorVoList;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return list
|
|
|
+ },
|
|
|
+ /*===记录勾选数据===
|
|
|
+ 需要再el-table 添加 :row-key="getRowKeys"
|
|
|
+ 需要在selection 添加 :reserve-selection="true"
|
|
|
+ */
|
|
|
+ getRowKeys(row) {
|
|
|
+ return row.id
|
|
|
+ },
|
|
|
+ //多选框选中数据
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ this.selectedNum = selection.length;
|
|
|
+ this.ids = selection.map(item => item.id)
|
|
|
+ this.multiple = !selection.length
|
|
|
+ },
|
|
|
+ },
|
|
|
+ }
|
|
|
+</script>
|
|
|
+<style scoped lang="scss">
|
|
|
+ .savePending{
|
|
|
+ .savePendingPage{
|
|
|
+ .table-date-picker{
|
|
|
+ width:176px;
|
|
|
+ height:26px;
|
|
|
+ ::v-deep input{
|
|
|
+ height:26px!important;
|
|
|
+ padding:0 45px;
|
|
|
+ }
|
|
|
+ ::v-deep .el-input__icon{
|
|
|
+ line-height:26px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|