|
@@ -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>
|