|
@@ -5,8 +5,8 @@
|
|
|
<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" clearable placeholder="请选择类别" style="width: 200px">
|
|
|
+ <el-form-item label="" prop="chemicalCategory">
|
|
|
+ <el-select v-model="queryParams.chemicalCategory" clearable placeholder="请选择类别" style="width: 200px">
|
|
|
<el-option
|
|
|
v-for="dict in optionListA"
|
|
|
:key="dict.value"
|
|
@@ -15,8 +15,8 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="" prop="queryParamsData3">
|
|
|
- <el-select v-model="queryParams.queryParamsData3" clearable placeholder="请选择级别" style="width: 200px">
|
|
|
+ <el-form-item label="" prop="chemicalLevel">
|
|
|
+ <el-select v-model="queryParams.chemicalLevel" clearable placeholder="请选择级别" style="width: 200px">
|
|
|
<el-option
|
|
|
v-for="dict in optionListB"
|
|
|
:key="dict.value"
|
|
@@ -25,10 +25,10 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="" prop="queryParamsData1" label-width="50px">
|
|
|
+ <el-form-item label="" prop="searchValue" label-width="50px">
|
|
|
<el-input
|
|
|
maxLength="30"
|
|
|
- v-model="queryParams.queryParamsData1"
|
|
|
+ v-model="queryParams.searchValue"
|
|
|
placeholder="化学品/别名/CAS号"
|
|
|
clearable
|
|
|
style="width: 200px"
|
|
@@ -50,16 +50,17 @@
|
|
|
</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 class="table-box" v-loading="loading" border :data="dataList"
|
|
|
+ ref="table-box" @selection-change="handleSelectionChange" :row-key="getRowKeys">
|
|
|
<el-table-column type="selection" width="50" :reserve-selection="true" align="center"/>
|
|
|
- <el-table-column label="名称" prop="name" show-overflow-tooltip/>
|
|
|
- <el-table-column label="CAS号" prop="content" width="200" show-overflow-tooltip/>
|
|
|
- <el-table-column label="类别" prop="content" width="200" show-overflow-tooltip/>
|
|
|
- <el-table-column label="级别" prop="content" width="200" show-overflow-tooltip/>
|
|
|
- <el-table-column label="纯度" prop="content" width="200" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="名称" prop="chemicalName" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="CAS号" prop="casNum" width="200" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="类别" prop="chemicalCategoryName" width="200" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="级别" prop="chemicalLevelName" width="200" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="纯度" prop="chemicalPurity" width="200" 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>{{ parseTime(scope.row.createTime,"{y}-{m}-{d} {h}:{i}") }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" width="230" show-overflow-tooltip v-if="tableButtonType">
|
|
@@ -99,14 +100,15 @@
|
|
|
</div>
|
|
|
<!--<add-page :propsData="propsData" v-if="pageType === 2"></add-page>-->
|
|
|
<add-chemicals ref="addChemicals"></add-chemicals>
|
|
|
- <msds-page v-if="pageType == 2"></msds-page>
|
|
|
+ <msds-page v-if="pageType == 2" :propsData="propsData"></msds-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 { getDicts } from "@/api/commonality/noPermission";
|
|
|
+ import { chemicalChemicalList,chemicalChemicalDelete } from "@/api/chemicalManage/index";
|
|
|
import addChemicals from "@/views/chemicalManage/components/addChemicals.vue";
|
|
|
import importComponent from "@/components/importComponent/importComponent.vue";
|
|
|
import exportComponent from "@/components/exportComponent/exportComponent.vue";
|
|
@@ -123,16 +125,16 @@
|
|
|
return {
|
|
|
//导出配置
|
|
|
exportConfig:{
|
|
|
- api:'system/user/student/export', //导出接口地址
|
|
|
+ api:'/chemical/chemical/export', //导出接口地址
|
|
|
ids:'', //勾选导出,勾选的IDS
|
|
|
fileName:'化学品信息', //导出文件的命名
|
|
|
},
|
|
|
//导入配置
|
|
|
importConfig:{
|
|
|
- upLoadApi:'/system/user/student/importData', //上传接口地址
|
|
|
- downloadApi:'/system/user/student/importTemplate', //下载模板接口地址
|
|
|
- loseApi:'/system/user/student/importErrorData', //失败报表接口地址
|
|
|
- fileName:'导入模板-', //下载模板命名
|
|
|
+ upLoadApi:'/chemical/chemical/importData', //上传接口地址
|
|
|
+ downloadApi:'/chemical/chemical/importTemplate', //下载模板接口地址
|
|
|
+ loseApi:'/chemical/chemical/importErrorData', //失败报表接口地址
|
|
|
+ fileName:'化学品导入模板-', //下载模板命名
|
|
|
},
|
|
|
//表格扩展选择器---需要在@selection-change绑定的方法内监控selection数组长度
|
|
|
tableButtonType:this.hasPermiDom(['demo:demo:detail','demo:demo:edit','demo:demo:del',]),
|
|
@@ -142,14 +144,14 @@
|
|
|
loading:false,
|
|
|
//下拉列表数据
|
|
|
optionListA:[{value:true,label:'启用'},{value:false,label:'停用'}],
|
|
|
- optionListB:[{value:true,label:'启用'},{value:false,label:'停用'}],
|
|
|
+ optionListB:[{value:1,label:'管控'},{value:2,label:'非管控'}],
|
|
|
//查询条件
|
|
|
queryParams:{
|
|
|
page:1,
|
|
|
pageSize:20,
|
|
|
- queryParamsData1:"",
|
|
|
- queryParamsData2 :null,
|
|
|
- queryParamsData3 :null,
|
|
|
+ searchValue:"",
|
|
|
+ chemicalCategory :null,
|
|
|
+ chemicalLevel :null,
|
|
|
},
|
|
|
selectedNum:0,
|
|
|
//列表数据
|
|
@@ -163,12 +165,23 @@
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
-
|
|
|
+ this.getDicts();
|
|
|
+ this.getList();
|
|
|
},
|
|
|
mounted () {
|
|
|
- //this.getList();
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
+ //获取化学品类别
|
|
|
+ getDicts(){
|
|
|
+ getDicts('chemicals_category').then(response => {
|
|
|
+ this.$set(this,'optionListA',response.data);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //化学品添加成功
|
|
|
+ submitSuccessful(){
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
//查询按钮
|
|
|
handleQuery(){
|
|
|
this.$set(this.queryParams,'page',1);
|
|
@@ -177,25 +190,26 @@
|
|
|
},
|
|
|
//重置按钮
|
|
|
resetQuery(){
|
|
|
+ this.$refs['table-box'].clearSelection();
|
|
|
this.$set(this,'selectedNum',0);
|
|
|
this.$set(this,'queryParams',{
|
|
|
page:1,
|
|
|
pageSize:20,
|
|
|
- queryParamsData1:"",
|
|
|
- queryParamsData2 :null,
|
|
|
- queryParamsData3 :null,
|
|
|
+ searchValue:"",
|
|
|
+ chemicalCategory :null,
|
|
|
+ chemicalLevel :null,
|
|
|
});
|
|
|
this.$set(this.exportConfig,'ids','');
|
|
|
this.getList();
|
|
|
},
|
|
|
//获取数据列表
|
|
|
getList(){
|
|
|
- // this.$set(this,'loading',true);
|
|
|
- // getListFunction(this.queryParams).then(response => {
|
|
|
- // this.$set(this,'loading',false);
|
|
|
- // this.$set(this,'dataList',response.data.records);
|
|
|
- // this.$set(this,'total',response.data.total);
|
|
|
- // });
|
|
|
+ this.$set(this,'loading',true);
|
|
|
+ chemicalChemicalList(this.queryParams).then(response => {
|
|
|
+ this.$set(this,'loading',false);
|
|
|
+ this.$set(this,'dataList',response.data.records);
|
|
|
+ this.$set(this,'total',response.data.total);
|
|
|
+ });
|
|
|
},
|
|
|
//操作按钮
|
|
|
tableButton(type,row){
|
|
@@ -205,10 +219,9 @@
|
|
|
this.$refs.addChemicals.addChemicalsOpen('1');
|
|
|
}else if(type == 2){
|
|
|
//MSDS
|
|
|
- this.$set(this,'pageType',2);
|
|
|
let obj = JSON.parse(JSON.stringify(row))
|
|
|
- obj.showType = true;
|
|
|
this.$set(this,'propsData',obj);
|
|
|
+ this.$set(this,'pageType',2);
|
|
|
}else if(type == 3){
|
|
|
//编辑
|
|
|
this.$refs.addChemicals.addChemicalsOpen('2',row);
|
|
@@ -220,7 +233,7 @@
|
|
|
type: "warning"
|
|
|
}).then(function() {
|
|
|
}).then(() => {
|
|
|
- deleteFunction({id:row.id}).then(response => {
|
|
|
+ chemicalChemicalDelete({chemicalId:row.chemicalId}).then(response => {
|
|
|
self.msgSuccess(response.message)
|
|
|
self.getList();
|
|
|
});
|
|
@@ -234,14 +247,14 @@
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
this.$set(this.queryParams,'selectedNum',selection.length);
|
|
|
- this.$set(this.exportConfig,'ids',selection.map(item => item.id));
|
|
|
+ this.$set(this.exportConfig,'ids',selection.map(item => item.chemicalId));
|
|
|
},
|
|
|
/*===记录勾选数据===
|
|
|
需要再el-table 添加 :row-key="getRowKeys"
|
|
|
需要在selection 添加 :reserve-selection="true"
|
|
|
*/
|
|
|
getRowKeys(row) {
|
|
|
- return row.id
|
|
|
+ return row.chemicalId
|
|
|
},
|
|
|
},
|
|
|
}
|