|
@@ -102,7 +102,19 @@
|
|
|
<el-table-column :label="$t('是否需要跟进')" align="center" prop="follow" :formatter="followFormat"/>
|
|
|
<el-table-column :label="$t('使用/储存/废物最大量')" align="center" prop="allowance" :show-overflow-tooltip="true"/>
|
|
|
<el-table-column :label="$t('排放/监控要求')" align="center" prop="requirements" :show-overflow-tooltip="true"/>
|
|
|
- <el-table-column :label="$t('主要内容')" align="center" width="250" prop="content" />
|
|
|
+ <el-table-column :label="$t('主要内容')" align="center" width="250" prop="content">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.conPic === 'false'">{{ scope.row.content }}</span>
|
|
|
+ <span v-if="scope.row.conPic === 'true'">
|
|
|
+ <el-image
|
|
|
+ style="width: 100px; height: 100px"
|
|
|
+ :src=getUrl(scope.row.conUrl)
|
|
|
+ :preview-src-list="scope.row.conWaterList"
|
|
|
+ >
|
|
|
+ </el-image>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column :label="$t('负责人')" align="center" prop="owner" :show-overflow-tooltip="true"/>
|
|
|
<el-table-column :label="$t('回顾人')" align="center" prop="reviewerName" :show-overflow-tooltip="true"/>
|
|
|
<el-table-column :label="$t('本次回顾日期')" align="center" prop="reviewdate" width="100">
|
|
@@ -113,7 +125,7 @@
|
|
|
<el-table-column :label="$t('回顾结果')" align="center" prop="reviewResult" :show-overflow-tooltip="true"/>
|
|
|
<el-table-column :label="$t('下次回顾日期')" align="center" prop="nextreviewdate" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
- <span style="vertical-align:middle">{{ parseTime(scope.row.nextreviewdate, '{y}-{m}-{d}') }}</span>
|
|
|
+ <span style="vertical-align:middle;margin-right: 3px">{{ parseTime(scope.row.nextreviewdate, '{y}-{m}-{d}') }}</span>
|
|
|
<svg-icon :icon-class="changeColorPiont(scope.row.nextreviewdate)" style="font-size: 8px"></svg-icon>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -276,10 +288,30 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item :label="$t('主要内容为图表')" prop="conPic">
|
|
|
+ <el-checkbox v-model="form.conPic"></el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item :label="$t('主要内容')" prop="content">
|
|
|
- <el-input v-model="form.content" type="textarea" :placeholder="$t('请输入') + $t('主要内容')" />
|
|
|
+ <el-input v-if="form.conPic == false" v-model="form.content" type="textarea" :placeholder="$t('请输入') + $t('主要内容')" />
|
|
|
+ <span v-if="form.conPic == true">
|
|
|
+ <el-upload
|
|
|
+ ref="picture"
|
|
|
+ :headers="picture.headers"
|
|
|
+ :action="picture.url + '?pType=safetyapproval&pId=' + picture.pId"
|
|
|
+ :show-file-list="false"
|
|
|
+ :on-success="handleConSuccess"
|
|
|
+ list-type="picture-card"
|
|
|
+ style="display: inline-block">
|
|
|
+ <img v-if="conWaterUrl" :src="conWaterUrl" class="avatar">
|
|
|
+ <i v-else class="el-icon-plus "></i>
|
|
|
+ </el-upload>
|
|
|
+ </span>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
@@ -593,6 +625,18 @@ export default {
|
|
|
},
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
+ picture: {
|
|
|
+ file: "",
|
|
|
+ // 报告附件上传位置编号
|
|
|
+ ids: 0,
|
|
|
+ // 设置上传的请求头部
|
|
|
+ headers: { Authorization: "Bearer " + getToken() },
|
|
|
+ // 上传的地址
|
|
|
+ url: process.env.VUE_APP_BASE_API + "/ehs/safetyapproval/uploadPic",
|
|
|
+ pType: 'safetyapproval',
|
|
|
+ pId: null
|
|
|
+ },
|
|
|
+ conWaterUrl: "",
|
|
|
//证书是否永久
|
|
|
canChange: false,
|
|
|
// 表单校验
|
|
@@ -645,9 +689,6 @@ export default {
|
|
|
reviewResult: [
|
|
|
{ required: true, message: this.$t('回顾结果') + this.$t('不能为空'), trigger: "blur" }
|
|
|
],
|
|
|
- content: [
|
|
|
- { required: true, message: this.$t('主要内容') + this.$t('不能为空'), trigger: "blur" }
|
|
|
- ],
|
|
|
deptId: [
|
|
|
{ required: true, message: this.$t('归属部门') + this.$t('不能为空'), trigger: "blur" }
|
|
|
]
|
|
@@ -679,12 +720,24 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ getUrl(value){
|
|
|
+ return process.env.VUE_APP_BASE_API + value
|
|
|
+ },
|
|
|
/** 查询安全批文清单列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
listSafetyapproval(this.queryParams).then(response => {
|
|
|
this.safetyapprovalList = response.rows;
|
|
|
this.total = response.total;
|
|
|
+ this.safetyapprovalList.forEach(function (item) {
|
|
|
+ if (item.conPic === 'true') {
|
|
|
+ if (item.conUrl) {
|
|
|
+ var conWaterList = [];
|
|
|
+ conWaterList.push(process.env.VUE_APP_BASE_API + item.conUrl);
|
|
|
+ item.conWaterList = conWaterList;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
@@ -695,6 +748,7 @@ export default {
|
|
|
}else if (timeInterval <= 30 * 24 * 3600 * 1000) {
|
|
|
return 'roundYellow'
|
|
|
}
|
|
|
+ return ''
|
|
|
},
|
|
|
/** 查询部门下拉树结构 */
|
|
|
getTreeselect() {
|
|
@@ -737,6 +791,7 @@ export default {
|
|
|
},
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
+ this.conWaterUrl = '';
|
|
|
this.form = {
|
|
|
id: null,
|
|
|
plantCode: null,
|
|
@@ -756,7 +811,9 @@ export default {
|
|
|
updaterCode: null,
|
|
|
updatedate: null,
|
|
|
deptId: null,
|
|
|
- remarks: null
|
|
|
+ remarks: null,
|
|
|
+ conPic: null,
|
|
|
+ conUrl: null,
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
},
|
|
@@ -790,6 +847,7 @@ export default {
|
|
|
this.reset();
|
|
|
this.open = true;
|
|
|
this.chooseDate = [];
|
|
|
+ this.form.conPic = false;
|
|
|
this.title = this.$t('新增') + " " + this.$t('安全批文清单');
|
|
|
this.getReviewer()
|
|
|
},
|
|
@@ -802,12 +860,21 @@ export default {
|
|
|
}else if (row.isPermanent == 0){
|
|
|
this.canChange = false
|
|
|
}
|
|
|
+
|
|
|
const id = row.id || this.ids
|
|
|
getSafetyapproval(id).then(response => {
|
|
|
this.form = response.data;
|
|
|
this.chooseDate = this.$set(this.form,'chooseDate',[""+response.data.validityBefore+"",""+response.data.validityAfter+""]);
|
|
|
this.open = true;
|
|
|
this.title = this.$t('修改') + this.$t('安全批文清单');
|
|
|
+ if (this.form.conPic === 'true') {
|
|
|
+ this.form.conPic = true
|
|
|
+ }else {
|
|
|
+ this.form.conPic = false
|
|
|
+ }
|
|
|
+ if(response.data.conUrl) {
|
|
|
+ this.conWaterUrl = process.env.VUE_APP_BASE_API + response.data.conUrl;
|
|
|
+ }
|
|
|
//根据回顾日期筛选
|
|
|
this.getReviewer( response.data.reviewdate.substring(0,4))
|
|
|
});
|
|
@@ -822,6 +889,12 @@ export default {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
if (this.form.isPermanent === 0) {
|
|
|
+ if (!this.chooseDate) {
|
|
|
+ this.$confirm('请填写证书有效期', this.$t('警告'), {
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
this.form.validityBefore = this.chooseDate[0];
|
|
|
this.form.validityAfter = this.chooseDate[1];
|
|
|
}
|
|
@@ -950,6 +1023,11 @@ export default {
|
|
|
a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
|
|
|
a.click()
|
|
|
},
|
|
|
+ handleConSuccess (res, file, fileList) {
|
|
|
+ this.conWaterUrl = URL.createObjectURL(file.raw);
|
|
|
+ this.form.conUrl = res.msg
|
|
|
+ this.$alert(res.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
|
|
|
+ },
|
|
|
//pdf预览
|
|
|
openPdf(){
|
|
|
window.open(this.pdf.pdfUrl);//path是文件的全路径地址
|
|
@@ -968,4 +1046,8 @@ export default {
|
|
|
.el-table .cell {
|
|
|
white-space: pre-line;
|
|
|
}
|
|
|
+ .avatar {
|
|
|
+ width: 120px;
|
|
|
+ height: 140px;
|
|
|
+ }
|
|
|
</style>
|