|
@@ -174,8 +174,15 @@
|
|
|
:placeholder="$t('请选择') + $t('第九次延期')">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
- <el-form-item :label="$t('卡具状态')" prop="status">
|
|
|
- <el-input v-model="queryParams.status" :placeholder="$t('卡具状态') + $t('介质类型')" />
|
|
|
+ <el-form-item :label="$t('卡具状态')" prop="area">
|
|
|
+ <el-select v-model="queryParams.status" :placeholder="$t('请选择') + $t('卡具状态')">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in mocStatusOptions"
|
|
|
+ :key="dict.dictValue"
|
|
|
+ :label="dict.dictLabel"
|
|
|
+ :value="dict.dictValue"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item :label="$t('到期时间')" prop="extention9">
|
|
|
<el-date-picker clearable size="small" style="width: 200px"
|
|
@@ -427,46 +434,55 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column :label="$t('第一次延期')" align="center" prop="extention1" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.extention1 == null && scope.row.status == 0">N.A.</span>
|
|
|
<span>{{ parseTime(scope.row.extention1, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column :label="$t('第二次延期')" align="center" prop="extention2" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.extention2 == null && scope.row.status == 0">N.A.</span>
|
|
|
<span>{{ parseTime(scope.row.extention2, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column :label="$t('第三次延期')" align="center" prop="extention3" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.extention3 == null && scope.row.status == 0">N.A.</span>
|
|
|
<span>{{ parseTime(scope.row.extention3, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column :label="$t('第四次延期')" align="center" prop="extention4" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.extention4 == null && scope.row.status == 0">N.A.</span>
|
|
|
<span>{{ parseTime(scope.row.extention4, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column :label="$t('第五次延期')" align="center" prop="extention5" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.extention5 == null && scope.row.status == 0">N.A.</span>
|
|
|
<span>{{ parseTime(scope.row.extention5, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column :label="$t('第六次延期')" align="center" prop="extention6" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.extention6 == null && scope.row.status == 0">N.A.</span>
|
|
|
<span>{{ parseTime(scope.row.extention6, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column :label="$t('第七次延期')" align="center" prop="extention7" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.extention7 == null && scope.row.status == 0">N.A.</span>
|
|
|
<span>{{ parseTime(scope.row.extention7, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column :label="$t('第八次延期')" align="center" prop="extention8" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.extention8 == null && scope.row.status == 0">N.A.</span>
|
|
|
<span>{{ parseTime(scope.row.extention8, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column :label="$t('第九次延期')" align="center" prop="extention9" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.extention9 == null && scope.row.status == 0">N.A.</span>
|
|
|
<span>{{ parseTime(scope.row.extention9, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -475,7 +491,7 @@
|
|
|
<span>{{ parseTime(scope.row.expTime, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column :label="$t('卡具状态')" align="center" width="100" prop="status" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column :label="$t('卡具状态')" align="center" width="100" prop="status" :show-overflow-tooltip="true" :formatter="mocStatusFormat"/>
|
|
|
<!--<el-table-column prop="mocType" label="":show-overflow-tooltip="true" :formatter="mocTypeFormat" width="120">-->
|
|
|
<!--<template slot="header">-->
|
|
|
<!--MOC类型-->
|
|
@@ -548,8 +564,24 @@
|
|
|
<el-table-column :label="$t('EHS审查数据库')" align="center" prop="ehsDb" :show-overflow-tooltip="true"/>
|
|
|
<el-table-column :label="$t('PSSR数据库')" align="center" prop="pssrDb" :show-overflow-tooltip="true"/>
|
|
|
<el-table-column :label="$t('CAPEX计划')" align="center" prop="capex" :show-overflow-tooltip="true"/>-->
|
|
|
- <el-table-column :label="$t('操作')" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
|
|
|
+ <el-table-column :label="$t('操作')" align="center" fixed="right" width="240" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="handleDelay(scope.row)"
|
|
|
+ v-hasPermi="['process:moc:edit']"
|
|
|
+ v-if="scope.row.extention9 == null && scope.row.status == 1"
|
|
|
+ >{{ $t('延期') }}</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-circle-close"
|
|
|
+ @click="handleRemove(scope.row)"
|
|
|
+ v-hasPermi="['process:moc:edit']"
|
|
|
+ v-if="scope.row.status == 1"
|
|
|
+ >{{ $t('移除') }}</el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
@@ -576,6 +608,24 @@
|
|
|
@pagination="getList"
|
|
|
/>
|
|
|
|
|
|
+ <!-- 延期对话框 -->
|
|
|
+ <el-dialog v-dialogDrag :title="delayDialog.title" :visible.sync="delayDialog.open" width="500px" append-to-body>
|
|
|
+ <el-form ref="form" :model="delayForm" :rules="delayRules" label-width="80px">
|
|
|
+ <el-form-item :label="$t('延期时间')" prop="extention">
|
|
|
+ <el-date-picker clearable size="small" style="width: 200px"
|
|
|
+ v-model="delayForm.extention"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ :placeholder="$t('请选择') + $t('延期时间')">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitDelayForm">{{ $t('确 定') }}</el-button>
|
|
|
+ <el-button @click="cancelDelay">{{ $t('取 消') }}</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<!-- 添加或修改MOC管理对话框 -->
|
|
|
<el-dialog v-dialogDrag :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
@@ -720,8 +770,15 @@
|
|
|
:placeholder="$t('请选择') + $t('第九次延期')">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
- <el-form-item :label="$t('卡具状态')" prop="status">
|
|
|
- <el-input v-model="form.status" :placeholder="$t('卡具状态') + $t('介质类型')" />
|
|
|
+ <el-form-item :label="$t('卡具状态')" prop="area">
|
|
|
+ <el-select v-model="form.status" :placeholder="$t('请选择') + $t('卡具状态')">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in mocStatusOptions"
|
|
|
+ :key="dict.dictValue"
|
|
|
+ :label="dict.dictLabel"
|
|
|
+ :value="dict.dictValue"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item :label="$t('到期时间')" prop="extention9">
|
|
|
<el-date-picker clearable size="small" style="width: 200px"
|
|
@@ -1147,7 +1204,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { listPermanent, listTemporary, listAquifier, listFacility, listInterlock, getMoc, delMoc, addMoc, updateMoc, exportMoc } from "@/api/process/moc";
|
|
|
+ import { delay, listPermanent, listTemporary, listAquifier, listFacility, listInterlock, getMoc, delMoc, addMoc, updateMoc, exportMoc } from "@/api/process/moc";
|
|
|
import { treeselect } from "@/api/system/dept";
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
@@ -1176,6 +1233,14 @@
|
|
|
}
|
|
|
};
|
|
|
return {
|
|
|
+ delayForm: {
|
|
|
+ id: null,
|
|
|
+ extention: null,
|
|
|
+ },
|
|
|
+ delayDialog: {
|
|
|
+ open: false,
|
|
|
+ title: null,
|
|
|
+ },
|
|
|
mocTypeInfo: {
|
|
|
open: false,
|
|
|
title: 'MOC类型说明'
|
|
@@ -1203,6 +1268,8 @@
|
|
|
clientHeight:300,
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
+ // 卡具状态字典
|
|
|
+ mocStatusOptions: [],
|
|
|
// 装置字典
|
|
|
plantCodeOptions: [],
|
|
|
// 类别字典
|
|
@@ -1358,6 +1425,11 @@
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
+ delayRules: {
|
|
|
+ extention: [
|
|
|
+ {required: true, message: this.$t('延期日期') + this.$t('不能为空'), trigger: "change"}
|
|
|
+ ],
|
|
|
+ },
|
|
|
rules: {
|
|
|
mocNo: [
|
|
|
{ required: true, message: this.$t('MOC编号') + this.$t('不能为空'), trigger: "change" }
|
|
@@ -1502,6 +1574,9 @@
|
|
|
})
|
|
|
this.getList();
|
|
|
this.getTreeselect();
|
|
|
+ this.getDicts("MOC_STATUS").then(response => {
|
|
|
+ this.mocStatusOptions = response.data;
|
|
|
+ });
|
|
|
this.getDicts("MC_DETAIL").then(response => {
|
|
|
this.mcDetailOptions = response.data;
|
|
|
});
|
|
@@ -1536,6 +1611,19 @@
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ /** 移除按钮操作 */
|
|
|
+ handleRemove(row) {
|
|
|
+ this.$confirm(this.$t('是否确认移除?'), this.$t('警告'), {
|
|
|
+ confirmButtonText: this.$t('确定'),
|
|
|
+ cancelButtonText: this.$t('取消'),
|
|
|
+ type: "warning"
|
|
|
+ }).then(function() {
|
|
|
+ updateMoc({id: row.id, status: 0});
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.msgSuccess(this.$t('移除成功'));
|
|
|
+ })
|
|
|
+ },
|
|
|
/** 查询MOC管理列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
@@ -1556,7 +1644,7 @@
|
|
|
let today = new Date(); // 当前时间
|
|
|
let expTime = new Date(row.expTime);
|
|
|
let difference = expTime.getTime() - today.getTime(); // 时间差
|
|
|
- if (row.tempState == 0) { // 移除的数据
|
|
|
+ if (row.tempState == 0 || row.status == 0) { // 移除的数据
|
|
|
return "background-color: rgba(0, 255, 0, 0.2);";
|
|
|
} else if (row.expTime != null && row.expTime != '') {
|
|
|
if (difference <= 7 * 24 * 60 * 60 * 1000) { // 到期时间 - 当前时间 <= 7
|
|
@@ -1583,6 +1671,10 @@
|
|
|
this.deptOptions = response.data;
|
|
|
});
|
|
|
},
|
|
|
+ // 卡具状态字典翻译
|
|
|
+ mocStatusFormat(row, column) {
|
|
|
+ return this.selectDictLabel(this.mocStatusOptions, row.status);
|
|
|
+ },
|
|
|
// 装置字典翻译
|
|
|
plantCodeFormat(row, column) {
|
|
|
return this.selectDictLabel(this.plantCodeOptions, row.plantCode);
|
|
@@ -1632,6 +1724,9 @@
|
|
|
return this.selectDictLabel(this.docUpdateOptions, row.docUpdate);
|
|
|
},
|
|
|
// 取消按钮
|
|
|
+ cancelDelay() {
|
|
|
+ this.delayDialog.open = false;
|
|
|
+ },
|
|
|
cancel() {
|
|
|
this.open = false;
|
|
|
this.reset();
|
|
@@ -1759,6 +1854,12 @@
|
|
|
return 'cellMoc'
|
|
|
}
|
|
|
},
|
|
|
+ /** 延期按钮操作 */
|
|
|
+ handleDelay(row) {
|
|
|
+ this.delayForm.id = row.id;
|
|
|
+ this.delayDialog.open = true;
|
|
|
+ this.delayDialog.title = row.mocNo.toString() + '延期操作';
|
|
|
+ },
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
this.reset();
|
|
@@ -1771,6 +1872,13 @@
|
|
|
});
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
+ submitDelayForm() {
|
|
|
+ delay(this.delayForm).then(response => {
|
|
|
+ this.msgSuccess(this.$t('延期成功'));
|
|
|
+ this.delayDialog.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ },
|
|
|
submitForm() {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|