-
+
+ @pageSizeChange="callback($event,'pageSize')" :footerActions="[]" :actions="[]">
-
+
{{scope.$index+1}}
-
- {{scope.row.operateCompleted}}
-
-
- {{scope.row.operateCompleted}}
-
-
- {{scope.row.operateCompleted}}
-
-
- {{scope.row.operateCompleted}}
-
-
- {{scope.row.operateCompleted}}
-
+
+
+
+
+
+
+
+
查看
- 编辑
+ 编辑
-
-
-
-
-
- {{scope.$index+1}}
-
-
-
- {{scope.row.operateCompleted}}
-
-
- {{scope.row.operateCompleted}}
-
-
- {{scope.row.operateCompleted}}
-
-
- {{scope.row.operateCompleted}}
-
-
- {{scope.row.operateCompleted}}
-
-
- {{scope.row.operateCompleted}}
-
-
-
- 查看
- 编辑
-
-
-
-
-
-
-
-
- {{scope.$index+1}}
-
-
-
- {{scope.row.operateCompleted}}
-
-
- {{scope.row.operateCompleted}}
-
-
- {{scope.row.operateCompleted}}
-
-
- {{scope.row.operateCompleted}}
-
-
- {{scope.row.operateCompleted}}
-
-
- {{scope.row.operateCompleted}}
-
-
-
- 查看
- 编辑
-
-
-
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/src/views/riskAssessment/safetyNotice/safetyNotice.component.vue b/src/views/riskAssessment/safetyNotice/safetyNotice.component.vue
index 785605d..9ce3a6e 100644
--- a/src/views/riskAssessment/safetyNotice/safetyNotice.component.vue
+++ b/src/views/riskAssessment/safetyNotice/safetyNotice.component.vue
@@ -4,13 +4,14 @@ import template from "./safetyNotice.component.html"
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue"
import FormComponent from "hbt-common/components/common/form.component.vue"
import TableComponent from "hbt-common/components/common/table.component.vue"
-import MaintenanceInfoService from "@/service/maintenanceInfo.service"
+import SafetyNoticeService from "@/service/safetyNotice.service"
import FormOption from "hbt-common/models/formOptions"
import BtnOption from "hbt-common/models/btnOptions"
import DrawComponent from '@/components/draw.component.vue';
import ButtonListComponent from "hbt-common/components/common/buttonList.component.vue";
import UnitTreeComponent from '@/components/tree.component.vue';
import NoticeComponent from '@/components/notice.component.vue'
+import moment from 'moment';
@Component({
template,
@@ -24,10 +25,10 @@ import NoticeComponent from '@/components/notice.component.vue'
},
})
export default class SafetyNotice extends BaseRecordComponent
{
- public tableService = new MaintenanceInfoService();
+ public tableService = new SafetyNoticeService();
public params = {
- type: 1
+ type: 1,
} as any;
public isReadonly = false;
@@ -38,10 +39,18 @@ export default class SafetyNotice extends BaseRecordComponent {
public subTableColumn = [] as any;
- public subUpdateParams = {
- risk: [{ index: 0, key: 0, }]
- } as any;
- public subShowUpdate = false;
+ public tableState = { 1: '待承诺', 2: '已承诺', 3: '未承诺' };
+
+ public tableStateColor = ['', '#E6A23C', "#68C23A", "#F56C6C"];
+
+ public subTitle = '班组安全承诺';
+
+ public defaultPromise = [
+ '',
+ '今天我班组已根据岗位风险辨识管控相关内容以及安全风险评估表进行安全风险研判,各项安全风险防控措施已落实到位,我承诺本岗位处于安全运行状态,涉及罐区、仓库等重大危险源安全风险的到有效管控。',
+ '今天我车间已根据风险辨识管控相关内容以及安全风险评估表进行安全风险研判,各项安全风险防控措施已落实到位,我承诺本车间处于安全运行状态,涉及罐区、仓库等重大危险源安全风险的到有效管控。',
+ '今天我企业已根据风险辨识管控相关内容以及安全风险评估表进行安全风险研判,各项安全风险防控措施已落实到位,我承诺本企业处于安全运行状态,涉及罐区、仓库等重大危险源安全风险的到有效管控。'
+ ] as any;
public tabs = [{
name: "班组风险研判",
@@ -55,7 +64,7 @@ export default class SafetyNotice extends BaseRecordComponent {
},]
- public showUpdate = true;
+ public showUpdate = false;
public formActions = [{
@@ -112,39 +121,89 @@ export default class SafetyNotice extends BaseRecordComponent {
public updateParams = {} as any;
public selectData = [];
- public updateActions = [] as any;
+ public updateActions = [{
+ name: "取消",
+ value: "cancel"
+ }, {
+ name: "保存",
+ value: "save",
+ type: "primary"
+ }] as any;
public updateOptions: FormOption[] = [] as any;
public buildUpdateForm() {
this.updateOptions = [{
name: "班组名称",
+ key: "name",
+ type: "text",
+ require: true,
+ width: "calc(50% - 20px)",
+ disable: true,
+ hide: this.params.type !== 1,
+ showError: false,
+ },
+ {
+ name: "班组负责人",
+ key: "chargeUserName",
+ type: "text",
+ require: true,
+ width: "calc(50% - 20px)",
+ hide: this.params.type !== 1,
+ showError: false,
+ disable: true
+ },
+ {
+ name: "车间名称",
+ key: "name",
+ type: "text",
+ require: true,
+ width: "calc(50% - 20px)",
+ disable: true,
+ hide: this.params.type !== 2,
+ showError: false,
+ },
+ {
+ name: "车间负责人",
+ key: "chargeUserName",
+ type: "text",
+ require: true,
+ width: "calc(50% - 20px)",
+ hide: this.params.type !== 2,
+ showError: false,
+ },
+ {
+ name: "企业名称",
key: "controlName",
type: "select",
require: true,
width: "calc(50% - 20px)",
disable: true,
+ hide: this.params.type !== 3,
+ showError: false,
},
{
- name: "班组负责人",
+ name: "企业负责人",
key: "analName",
type: "text",
require: true,
width: "calc(50% - 20px)",
+ hide: this.params.type !== 3,
+ showError: false,
},
{
name: "研判时间",
- key: "seriousResult",
- format: "seriousResultName",
- type: "select",
+ key: "researchTime",
+ type: "date",
+ subType: "datetime",
require: true,
- multiple: true,
width: "calc(50% - 20px)",
- datas: this.$store.state.userList,
+ showError: false,
+ format: "yyyy-MM-dd HH:mm:ss"
},
{
name: "负责人签名",
- key: "file1",
+ key: "file",
ref: "file",
type: "upload",
width: "calc(50% - 20px)",
@@ -153,6 +212,7 @@ export default class SafetyNotice extends BaseRecordComponent {
onMove: this.onRemove,
onPreview: this.onPreview,
autoUpload: true,
+ require: true,
accept: "image/png, image/jpeg,.doc,.docx,.xls,.xlsx,.pdf",
listType: "text",
tip: this.isReadonly ? "" : "请上传.pdf,.png,.jpg,.doc.docx,.xls,.xlsx格式文件",
@@ -164,36 +224,7 @@ export default class SafetyNotice extends BaseRecordComponent {
size: "small",
type: "primary"
}]
- }, {
- name: "是否已落实管控措施",
- key: "seriousResult",
- format: "seriousResultName",
- type: "radio",
- require: true,
- labelWidth: "140px",
- width: "calc(50% - 20px)",
- datas: [{
- name: "是",
- value: 1,
- }, {
- name: "否",
- value: 0,
- }],
},];
-
- this.updateActions = [{
- name: "取消",
- value: "cancel"
- }, {
- name: "保存并继续添加",
- value: "saveAndContinue",
- type: "primary",
- hide: this.updateParams.id
- }, {
- name: "保存",
- value: "save",
- type: "primary"
- }];
}
created() {
@@ -201,12 +232,62 @@ export default class SafetyNotice extends BaseRecordComponent {
}
public buildTable() {
- this.tableColumn.push({ name: '状态', key: "controlName", });
- this.tableColumn.push({ name: '班组名称', key: "analName", });
- this.tableColumn.push({ name: '班组负责人', key: "riskSource", });
- this.tableColumn.push({ name: '公告时间', key: "seriousResult", });
- this.tableColumn.push({ name: '风险点个数', key: "riskLevel", });
-
+ if (this.params.type === 1) {
+ this.tableColumn = []
+ this.tableColumn.push({
+ name: '状态', key: "status", render: (data) => {
+ return `${this.tableState[data.status]}`
+ }
+ });
+ this.tableColumn.push({ name: '班组名称', key: "name", });
+ this.tableColumn.push({ name: '班组负责人', key: "chargeUserName", });
+ this.tableColumn.push({
+ name: '公告时间', key: "publishTime", render: (data) => {
+ return data.publishTime ? data.publishTime : '--'
+ }
+ });
+ this.tableColumn.push({ name: '风险点个数', key: "riskNumber", });
+ } else if (this.params.type === 2) {
+ this.tableColumn = [];
+ this.tableColumn.push({
+ name: '状态', key: "status", render: (data) => {
+ return `${this.tableState[data.status]}`
+ }
+ });
+ this.tableColumn.push({ name: '车间名称', key: "name", });
+ this.tableColumn.push({ name: '车间负责人', key: "chargeUserName", });
+ this.tableColumn.push({
+ name: '班组公告情况', key: "situation", render: (data) => {
+ return "" + ((data.promised ? data.promised : 0) + '/' + (data.total ? data.total : 0)) + ""
+ }
+ });
+ this.tableColumn.push({
+ name: '公告时间', key: "publishTime", render: (data) => {
+ return data.publishTime ? data.publishTime : '--'
+ }
+ });
+ this.tableColumn.push({ name: '风险点个数', key: "riskNumber", });
+ } else if (this.params.type === 3) {
+ this.tableColumn = [];
+ this.tableColumn.push({
+ name: '状态', key: "status", render: (data) => {
+ return `${this.tableState[data.status]}`
+ }
+ });
+ this.tableColumn.push({ name: '车间名称', key: "name", });
+ this.tableColumn.push({ name: '车间负责人', key: "chargeUserName", });
+ this.tableColumn.push({
+ name: '车间公告情况', key: "situation", render: (data) => {
+ return "" + ((data.promised ? data.promised : 0) + '/' + (data.total ? data.total : 0)) + ""
+ }
+ });
+ this.tableColumn.push({
+ name: '公告时间', key: "publishTime", render: (data) => {
+ return data.publishTime ? data.publishTime : '--'
+ }
+ });
+ this.tableColumn.push({ name: '风险点个数', key: "riskNumber", });
+ }
}
public changes(data, item) {
@@ -297,38 +378,41 @@ export default class SafetyNotice extends BaseRecordComponent {
// }
}
- public onSuccess(res, file, fileList) {
+ public onSuccess(res: any) {
if (res.code === 200) {
+ this.fileList = []
this.fileList.push({
name: res.data.originalName,
url: res.data.url,
type: res.data.type,
id: res.data.id
})
+ this.updateParams.file = this.fileList.length || null;
+ this.buildUpdateForm()
} else {
this.$message.error(res.msg);
}
}
- public onRemove(file, fileList) {
- this.fileList.splice(this.fileList.findIndex(item => item.id === file.response.data.id), 1)
+ public onRemove(file: any) {
+ this.fileList.splice(this.fileList.findIndex((item: any) => item.id === file.uid), 1)
+ this.updateParams.file = this.fileList.length || null;
}
//标签页切换
public tabTableChange(type) {
this.params.pageNum = 1;
- console.log('type',type);
-
if (type === 1) {
- // this.buildFormOptions()
+ this.subTitle = '班组安全承诺';
// this.getTableData()
} else if (type === 2) {
- // this.buildFormOptions()
- // this.getReportTableData()
+ this.subTitle = '车间安全承诺';
} else if (type === 3) {
- //
+ this.subTitle = '企业安全承诺';
}
+ this.buildTable()
+ this.getTableData()
}
public triCallback() {
@@ -336,11 +420,77 @@ export default class SafetyNotice extends BaseRecordComponent {
}
- public showUpdateModel(row,isReadonly){
+ public showUpdateModel(row: any, isReadonly: any) {
+ console.log('row', row);
+ this.updateParams = {} as any;
+ this.fileList = []
// this.
+ if (isReadonly) {
+ this.isReadonly = true
+ } else {
+ this.isReadonly = false
+ }
+ this.tableService.selectByDetail({ id: row.id, type: this.params.type }).then((res: any) => {
+ console.log('res', res);
+ this.updateParams = Object.assign(res.data, row);
+ if (!this.updateParams.promise) {
+ this.updateParams.promise = this.defaultPromise[this.params.type]
+ }
+ if (!isReadonly) {
+ this.updateParams.researchTime = moment().format('YYYY-MM-DD HH:mm:ss');
+ } else {
+ this.updateParams.researchTime = this.updateParams.updateTime
+ }
+ // 获取url
+ if (res.data.resourceId) {
+ this.tableService.getFileUrls({ ids: res.data.resourceId }).then((file: any) => {
+ this.fileList = file.data.map(item => {
+ return {
+ name: item.originalName,
+ url: item.url,
+ type: item.type,
+ id: item.id
+ }
+ })
+ if (!isReadonly) {
+ this.updateParams.file = this.fileList.length || null;
+ }
+ this.buildUpdateForm();
+ })
+ }
+ this.buildUpdateForm();
+ this.showUpdate = true;
+ })
+ this.buildUpdateForm();
+ this.showUpdate = true;
}
+ public promiseCallback(data: any) {
+ console.log('updateParams', this.updateParams);
+ console.log('data', data);
+ if (data === 'save') {
+ this.doSave()
+ } else {
+ this.showUpdate = false;
+ this.updateParams = {} as any;
+ }
+ }
+
+
+ public doSave() {
+ if ((this.$refs.basicForm as any).vaildParams()) {
+ this.updateParams.resourceId = this.fileList.map((item: any) => item.id).join(",");
+ this.updateParams.resourceName = this.fileList.map((item: any) => item.name).join(",");
+ this.updateParams.status = 2
+ this.tableService.addOrUpdate(this.updateParams, false).then((res: any) => {
+ this.$message.success("研判成功!");
+ this.updateParams = {} as any
+ this.showUpdate = false;
+ this.getTableData();
+ })
+ }
+ }
}