|
@@ -118,25 +118,29 @@
|
|
|
<el-table v-loading="loading" :data="deviceList" :cell-style="tableCellStyle"
|
|
|
@selection-change="handleSelectionChange" :height="clientHeight" border>
|
|
|
<el-table-column type="selection" width="55" align="center" fixed="left"/>
|
|
|
- <el-table-column label="审核状态" align="center" fixed="left" prop="approveStatus" :formatter="approveStatusFormat" :show-overflow-tooltip="true" width="80"/>
|
|
|
+ <el-table-column label="审核状态" align="center" fixed="left" prop="approveStatus"
|
|
|
+ :formatter="approveStatusFormat" :show-overflow-tooltip="true" width="80"/>
|
|
|
<el-table-column label="装置名称" align="center" prop="plantName" :show-overflow-tooltip="true" width="100"/>
|
|
|
<el-table-column label="装置编编码" align="center" prop="plantCode" :show-overflow-tooltip="true" width="100"/>
|
|
|
<el-table-column label="区域名称" align="center" prop="regionName" :show-overflow-tooltip="true" width="100"/>
|
|
|
<el-table-column label="区域编号" align="center" prop="regionCode" :show-overflow-tooltip="true" width="100"/>
|
|
|
<el-table-column label="设备/管线编号" align="center" prop="devCode" :show-overflow-tooltip="true" width="130"/>
|
|
|
- <el-table-column label="设备/管线描述" align="center" prop="devDescribe" :show-overflow-tooltip="true" width="230"/>
|
|
|
+ <el-table-column label="设备/管线描述" align="center" prop="devDescribe" :show-overflow-tooltip="true"
|
|
|
+ width="230"/>
|
|
|
<el-table-column label="主要物料/产品" align="center" prop="material" :show-overflow-tooltip="true" width="130"/>
|
|
|
<el-table-column label="物料状态" align="center" prop="materialStatus" :show-overflow-tooltip="true" width="100"/>
|
|
|
- <el-table-column label="合成相应因子" align="center" prop="responseFactor" :show-overflow-tooltip="true" width="100"/>
|
|
|
- <el-table-column label="相应因子来源" align="center" prop="responseFactorFrom" :show-overflow-tooltip="true" width="100"/>
|
|
|
+ <el-table-column label="合成相应因子" align="center" prop="responseFactor" :show-overflow-tooltip="true"
|
|
|
+ width="100"/>
|
|
|
+ <el-table-column label="相应因子来源" align="center" prop="responseFactorFrom" :show-overflow-tooltip="true"
|
|
|
+ width="100"/>
|
|
|
<el-table-column label="维护人" align="center" prop="updater" :show-overflow-tooltip="true" width="100"/>
|
|
|
<el-table-column label="维护时间" align="center" prop="updatedate" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" width="230"/>
|
|
|
- <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width" width="120">
|
|
|
+ <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" width="230"/>
|
|
|
+ <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width" width="120">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
size="mini"
|
|
@@ -242,12 +246,15 @@
|
|
|
<el-link type="info" style="font-size:12px" @click="importTemplate">{{ $t('下载模板') }}</el-link>
|
|
|
</div>
|
|
|
<form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
|
|
|
- <input name="type" :value="upload.type" hidden />
|
|
|
+ <input name="type" :value="upload.type" hidden/>
|
|
|
</form>
|
|
|
<div class="el-upload__tip" style="color:red" slot="tip">{{ $t('提示:仅允许导入“xls”或“xlsx”格式文件!') }}</div>
|
|
|
</el-upload>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="submitFileForm" v-loading.fullscreen.lock="fullscreenLoading">{{ $t('确 定') }}</el-button>
|
|
|
+ <el-button type="primary" @click="submitFileForm" v-loading.fullscreen.lock="fullscreenLoading">{{
|
|
|
+ $t('确 定')
|
|
|
+ }}
|
|
|
+ </el-button>
|
|
|
<el-button @click="upload.open = false">{{ $t('取 消') }}</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
@@ -255,7 +262,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {listDevice, getDevice, delDevice, addDevice, updateDevice} from "@/api/base/device";
|
|
|
+import {addDevice, delDevice, getDevice, handleApprove, listDevice, updateDevice} from "@/api/base/device";
|
|
|
import {getAllPlantName} from "@/api/base/plant";
|
|
|
import {getAllRegion} from "@/api/base/region";
|
|
|
import {MessageBox} from 'element-ui'
|
|
@@ -271,7 +278,7 @@ export default {
|
|
|
clientHeight: 300,
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
- // 选中数组
|
|
|
+ // 选中数组l
|
|
|
ids: [],
|
|
|
status: [],
|
|
|
// 非单个禁用
|
|
@@ -303,7 +310,7 @@ export default {
|
|
|
// 是否更新已经存在的用户数据
|
|
|
updateSupport: 0,
|
|
|
// 设置上传的请求头部
|
|
|
- headers: { Authorization: "Bearer " + getToken() },
|
|
|
+ headers: {Authorization: "Bearer " + getToken()},
|
|
|
// 上传的地址
|
|
|
url: process.env.VUE_APP_BASE_API + "/base/device/importData"
|
|
|
},
|
|
@@ -385,12 +392,12 @@ export default {
|
|
|
this.$refs.upload.clearFiles();
|
|
|
this.fullscreenLoading = false;
|
|
|
console.log(response)
|
|
|
- if (response.data ===0) {
|
|
|
- this.$alert(this.$t('导入失败!')+ response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
|
|
|
- }else if (response.data[0] != null) {
|
|
|
- this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据') + "," + this.$t('第') + response.data + this.$t('行数据出现错误导入失败')+"。", this.$t('导入结果'), { dangerouslyUseHTMLString: true });
|
|
|
- }else {
|
|
|
- this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据'), this.$t('导入结果'), { dangerouslyUseHTMLString: true });
|
|
|
+ if (response.data === 0) {
|
|
|
+ this.$alert(this.$t('导入失败!') + response.msg, this.$t('导入结果'), {dangerouslyUseHTMLString: true});
|
|
|
+ } else if (response.data[0] != null) {
|
|
|
+ this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据') + "," + this.$t('第') + response.data + this.$t('行数据出现错误导入失败') + "。", this.$t('导入结果'), {dangerouslyUseHTMLString: true});
|
|
|
+ } else {
|
|
|
+ this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据'), this.$t('导入结果'), {dangerouslyUseHTMLString: true});
|
|
|
}
|
|
|
this.getList();
|
|
|
},
|
|
@@ -399,7 +406,7 @@ export default {
|
|
|
},
|
|
|
tableCellStyle({row, column, rowIndex, columnIndex}) {
|
|
|
if (columnIndex === 1 && row.approveStatus == 2) {
|
|
|
- return "color:#00ff00;";
|
|
|
+ return "color:#13C2C2;";
|
|
|
}
|
|
|
if (columnIndex === 1 && row.approveStatus == 1) {
|
|
|
return "color:#0000FF;";
|
|
@@ -525,7 +532,7 @@ export default {
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
const ids = row.devId || this.ids;
|
|
|
- if(row.approveStatus===undefined){
|
|
|
+ if (row.approveStatus === undefined) {
|
|
|
for (let i = 0; i < this.status.length; i++) {
|
|
|
if (this.status[i] != 0) {
|
|
|
MessageBox.alert('已送审/已审核的数据不可删除!', '注意!', {
|
|
@@ -534,7 +541,7 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
- }else if (row.approveStatus!=0){
|
|
|
+ } else if (row.approveStatus != 0) {
|
|
|
MessageBox.alert('已送审/已审核的数据不可删除!', '注意!', {
|
|
|
confirmButtonText: '确定',
|
|
|
})
|
|
@@ -555,10 +562,20 @@ export default {
|
|
|
}, `device_${new Date().getTime()}.xlsx`)
|
|
|
},
|
|
|
handleToApprove() {
|
|
|
- alert("功能开发中......")
|
|
|
+ let data = {};
|
|
|
+ data.devIds = this.ids;
|
|
|
+ data.approveStatus = 1;
|
|
|
+ handleApprove(data).then(() => {
|
|
|
+ this.getList();
|
|
|
+ })
|
|
|
},
|
|
|
handleApprove() {
|
|
|
- alert("功能开发中......")
|
|
|
+ let data = {};
|
|
|
+ data.devIds = this.ids;
|
|
|
+ data.approveStatus = 2;
|
|
|
+ handleApprove(data).then(() => {
|
|
|
+ this.getList();
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
};
|