Merge remote-tracking branch 'origin/feature1.2' into dev

dev
kongyeqing 2023-09-07 09:28:12 +08:00
commit c6a2560f84
38 changed files with 522 additions and 373 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -109,6 +109,7 @@ import { L_COLUMN, L_VALUE, S_COLUMN, S_VALUE } from '@/mock/lsRisk';
import { L_LECCOLUMN, L_LECVALUE, E_COLUMN, E_VALUE, C_COLUMN, C_VALUE } from '@/mock/lecRisk'; import { L_LECCOLUMN, L_LECVALUE, E_COLUMN, E_VALUE, C_COLUMN, C_VALUE } from '@/mock/lecRisk';
import MeasureComponent from '@/components/measure.component.vue' import MeasureComponent from '@/components/measure.component.vue'
import moment from 'moment'; import moment from 'moment';
import { Message } from 'element-ui';
@Component({ @Component({
components: { components: {
@ -1110,6 +1111,8 @@ export default class AnalEvaluationComponent extends Vue {
if (data.value === "cancel") { if (data.value === "cancel") {
this.visible = false; this.visible = false;
} else if (data.value === "store") { } else if (data.value === "store") {
let vaildParams = true let vaildParams = true
if ((this.$refs.basicForm as any).vaildParams() === false) { if ((this.$refs.basicForm as any).vaildParams() === false) {
// //
@ -1124,6 +1127,12 @@ export default class AnalEvaluationComponent extends Vue {
vaildParams = false vaildParams = false
} }
if (vaildParams === true) { if (vaildParams === true) {
console.log('this.analysisUpdateParams', this.analysisUpdateParams);
if (this.analysisUpdateParams.measures.length === 0) {
this.$message.warning('请添加管控措施!')
return
}
const tmpUpdateParams = JSON.parse(JSON.stringify(this.updateParams)) const tmpUpdateParams = JSON.parse(JSON.stringify(this.updateParams))
// this.analysisUpdateParams.measures = this.currentMeasureData.datas // this.analysisUpdateParams.measures = this.currentMeasureData.datas
// //
@ -1153,7 +1162,7 @@ export default class AnalEvaluationComponent extends Vue {
} }
} }
//
public collationAnalysisDataMethod() { public collationAnalysisDataMethod() {
this.analysisUpdateParams.measuresNum = this.analysisUpdateParams.measures.length; this.analysisUpdateParams.measuresNum = this.analysisUpdateParams.measures.length;
this.analysisUpdateParams.seriousResult = this.analysisUpdateParams.seriousResult.join(","); this.analysisUpdateParams.seriousResult = this.analysisUpdateParams.seriousResult.join(",");

View File

@ -11,7 +11,7 @@
<div class="update-box"> <div class="update-box">
<div class="form-box"> <div class="form-box">
<FormComponent v-if="viewModel!=='list'" labelWidth="56px" :isReadonly="isReadonly" :fullBtn="true" :btnPosition="'center'" @change="change" :data.sync="updateParams" @actionCallback="callback" :options="options" :actions="actions"></FormComponent> <FormComponent v-if="viewModel!=='list'" labelWidth="56px" :isReadonly="isReadonly" :fullBtn="true" :btnPosition="'center'" @change="change" :data.sync="updateParams" @actionCallback="callback" :options="options" :actions="actions"></FormComponent>
<FormComponent v-else labelWidth="56px" @change="change" :data.sync="listParams" :options="listForm" ></FormComponent> <FormComponent v-else labelWidth="56px" @input="change" :data.sync="listParams" :options="listForm" ></FormComponent>
</div> </div>
<div class="tree-box" v-if="viewModel==='list'"> <div class="tree-box" v-if="viewModel==='list'">
<el-tree :data="treeData" :props="{children:'children',label:'name'}" :expand-on-click-node="false" default-expand-all highlight-current <el-tree :data="treeData" :props="{children:'children',label:'name'}" :expand-on-click-node="false" default-expand-all highlight-current

View File

@ -18,7 +18,7 @@ export default class MapComponent extends Vue {
@PropSync("position",{ @PropSync("position",{
required:false, required:false,
default:()=>{ default:()=>{
return [118.751353,31.969568] return [119.592977,34.523847]
} }
}) })
center:number[] center:number[]

View File

@ -34,8 +34,8 @@
<el-dialog :close-on-click-modal="false" :title="taskIsReadonly ? '详情' : taskUpdataParams.index ? '编辑' : '新增'" <el-dialog :close-on-click-modal="false" :title="taskIsReadonly ? '详情' : taskUpdataParams.index ? '编辑' : '新增'"
:visible.sync="showSubUpdate" width="952px" :before-close="handleCloseTask"> :visible.sync="showSubUpdate" width="952px" :before-close="handleCloseTask">
<FormComponent :options="taskUpdateOptions" :isReadonly="taskIsReadonly" labelWidth="110px" labelAlign="right" <FormComponent :options="taskUpdateOptions" :isReadonly="taskIsReadonly" labelWidth="110px" labelAlign="right"
:data.sync="taskUpdataParams" :actions="subActions" :full-btn="true" btnPosition="center" :data.sync="taskUpdataParams" :actions="taskIsReadonly ? [] : taskActions" :full-btn="true"
@actionCallback="taskCallback" @change="taskSelectChange"> btnPosition="center" @actionCallback="taskCallback" @change="taskSelectChange">
</FormComponent> </FormComponent>
</el-dialog> </el-dialog>
</div> </div>
@ -231,6 +231,7 @@ export default class MeasureComponent extends Vue {
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
require: true, require: true,
showError: false, showError: false,
min: 1,
// labelWidth:"130px" // labelWidth:"130px"
}, { }, {
key: "reviewCycleUnit", key: "reviewCycleUnit",
@ -274,19 +275,26 @@ export default class MeasureComponent extends Vue {
showError: false, showError: false,
},] },]
} }
public subActions = [] as any;
//
public taskActions = [] as any;
public buildTaskAction(){
this.taskActions= [{
name: "取消",
value: "cancel"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary",
hide: this.taskUpdataParams.index
}, {
name: "保存",
value: "save",
type: "primary"
}];
}
public subActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary"
}, {
name: "保存",
value: "save",
type: "primary"
}];
public tableActions = [{ public tableActions = [{
name: "添加", name: "添加",
value: "fourSubAdd", value: "fourSubAdd",
@ -328,6 +336,7 @@ export default class MeasureComponent extends Vue {
// } // }
this.measuresUpdateForm() this.measuresUpdateForm()
this.taskUpdateForm() this.taskUpdateForm()
this.buildActions()
} }
@PropSync("tabledata", { @PropSync("tabledata", {
@ -335,9 +344,26 @@ export default class MeasureComponent extends Vue {
}) })
public measureData!: any; public measureData!: any;
public buildActions() {
this.subActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary",
hide: this.updataParams.index
}, {
name: "保存",
value: "save",
type: "primary"
}];
}
created() { created() {
this.buildTable(); this.buildTable();
console.log('measureData',this.measureData); console.log('measureData', this.measureData);
} }
@ -442,6 +468,7 @@ export default class MeasureComponent extends Vue {
} }
this.showSubUpdate = true this.showSubUpdate = true
this.taskUpdateForm() this.taskUpdateForm()
this.buildTaskAction()
} }
// --- // ---
@ -501,6 +528,7 @@ export default class MeasureComponent extends Vue {
} }
this.taskUpdateForm(); this.taskUpdateForm();
this.showSubUpdate = true; this.showSubUpdate = true;
this.buildTaskAction()
} }
public deleteTask(row) { public deleteTask(row) {

1
src/global.d.ts vendored
View File

@ -2,4 +2,5 @@
declare module 'common/notFound'; declare module 'common/notFound';
declare module 'common/index'; declare module 'common/index';
declare module 'common/layout'; declare module 'common/layout';
declare module 'common/login';
declare module 'file-saver' declare module 'file-saver'

View File

@ -2,6 +2,7 @@ import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router' import VueRouter, { RouteConfig } from 'vue-router'
import pageNoFoundComponent from 'common/notFound' import pageNoFoundComponent from 'common/notFound'
import indexComponent from 'common/index' import indexComponent from 'common/index'
import LoginComponent from 'common/login'
import LayoutComponent from "common/layout" import LayoutComponent from "common/layout"
import HomeComponent from '@/views/home/home.component.vue' import HomeComponent from '@/views/home/home.component.vue'
import BlankComponent from "@/views/blank.component.vue" import BlankComponent from "@/views/blank.component.vue"
@ -316,6 +317,11 @@ const routes: Array<RouteConfig> = [
name: 'index', name: 'index',
component:indexComponent component:indexComponent
}, },
{
path: '/login',
name: 'login',
component:LoginComponent
},
{ {
path: '*', path: '*',
name: '404', name: '404',

View File

@ -8,7 +8,7 @@ export default class EmergencyCardService extends BaseService<any>{
// 查询列表 // 查询列表
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{ public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/card/handle/getList'; const url = this.prefix.prevention+'/card/handle/getList';
return this.post(url,params) return this.get(url,params,true)
} }
// 批量删除 // 批量删除
public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{ public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{

View File

@ -43,4 +43,10 @@ export default class ProgrammeService extends BaseService<any>{
const url = this.prefix.file+'/getSysFiles'; const url = this.prefix.file+'/getSysFiles';
return this.get(url,params,false) return this.get(url,params,false)
} }
//获取适用年度
public getSuitListData(params:any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/process/plan/suitList';
return this.get(url,params)
}
} }

View File

@ -8,7 +8,7 @@ export default class RewardsRecordService extends BaseService<any>{
// 查询列表 // 查询列表
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{ public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/incentive/record/getList'; const url = this.prefix.prevention+'/incentive/record/getList';
return this.post(url,params) return this.get(url,params,true)
} }
// 批量删除 // 批量删除
public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{ public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{

View File

@ -8,7 +8,7 @@ export default class RiskCardService extends BaseService<any>{
// 查询列表 // 查询列表
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{ public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/card/notify/getList'; const url = this.prefix.prevention+'/card/notify/getList';
return this.post(url,params) return this.get(url,params,true)
} }
// 批量删除 // 批量删除
public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{ public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{

View File

@ -8,7 +8,7 @@ export default class SafeCardService extends BaseService<any>{
// 查询列表 // 查询列表
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{ public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/card/promise/getList'; const url = this.prefix.prevention+'/card/promise/getList';
return this.post(url,params) return this.get(url,params,true)
} }
// 批量删除 // 批量删除
public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{ public deleteByIds(params,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{

View File

@ -36,6 +36,12 @@ export default class UnitService extends BaseService<any>{
return this.post(url,params,{},showLoading) return this.post(url,params,{},showLoading)
} }
//获取单元详情
public getUnitDetail(params):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/risk/unit/repairList';
return this.get(url,params)
}
// 新增或更新 // 新增或更新
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{ public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{

View File

@ -7,7 +7,7 @@ export default class WorkService extends BaseService<any>{
} }
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{ public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/job/inventory/getList'; const url = this.prefix.prevention+'/job/inventory/getList';
return this.post(url,params,{},true) return this.get(url,params,true)
} }
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{ public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/job/inventory'; const url = this.prefix.prevention+'/job/inventory';

View File

@ -195,7 +195,7 @@
color: #F56C6C; color: #F56C6C;
margin-left: -43px; margin-left: -43px;
margin-bottom: 20px; margin-bottom: 20px;
margin-top: -20px; margin-top: -10px;
font-size: 20px; font-size: 20px;
scale:0.5; scale:0.5;
} }

View File

@ -697,7 +697,7 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
} }
} }
}); });
this.tableColumn.push({ name: '当前执行人', width: "100", key: "executor", render: (data) => data.executor || "--" }); this.tableColumn.push({ name: '当前执行人', width: "100", key: "executor", render: (data) => data.taskInfo.executor || "--" });
this.tableColumn.push({ name: '最新提交时间', width: "180", key: "updateTime", sortable: 'custom' }); this.tableColumn.push({ name: '最新提交时间', width: "180", key: "updateTime", sortable: 'custom' });
this.tableColumn.push({ name: '隐患来源', width: "150", render: (data) => this.$store.getters.prevention_danger_resource_map[data.source] }); this.tableColumn.push({ name: '隐患来源', width: "150", render: (data) => this.$store.getters.prevention_danger_resource_map[data.source] });
this.tableColumn.push({ name: '上报人', width: "100", key: "reportUserName", render: (data) => data.reportUserName || "--" }); this.tableColumn.push({ name: '上报人', width: "100", key: "reportUserName", render: (data) => data.reportUserName || "--" });
@ -883,6 +883,7 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
pageSize: 20, pageSize: 20,
bpmSchemeCode: "prevention-yhzl" bpmSchemeCode: "prevention-yhzl"
} as any; } as any;
this.getTableData()
} }

View File

@ -1,12 +1,12 @@
<div class="common-box dis-flex " > <div class="common-box dis-flex ">
<div class="common-content-box dis-flex flex-col flex-1"> <div class="common-content-box dis-flex flex-col flex-1">
<div class="search-box"> <div class="search-box">
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions" <FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
:full-btn="false" @change="change" btn-position="end"></FormComponent> :full-btn="false" @change="callback" btn-position="end"></FormComponent>
</div> </div>
<div class="table-box flex-1"> <div class="table-box flex-1">
<TableComponent :tableData="tableData" :tableColumn="tableColumn" <TableComponent :tableData="tableData" :tableColumn="tableColumn" @actionCallback="callback($event)"
@actionCallback="callback($event)" @pageNumberChange="callback($event,'pageNum')" @pageSizeChange="callback($event,'pageSize')" @pageNumberChange="callback($event,'pageNum')" @pageSizeChange="callback($event,'pageSize')"
:footerActions="footerActions" :actions="tableActions"> :footerActions="footerActions" :actions="tableActions">
<el-table ref="multipleTable" :data="tableData.datas" tooltip-effect="dark" height="100%" border <el-table ref="multipleTable" :data="tableData.datas" tooltip-effect="dark" height="100%" border
@ -19,18 +19,20 @@
</template> </template>
</el-table-column> </el-table-column>
<template v-for="item in tableColumn"> <template v-for="item in tableColumn">
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :filters="item.filters" <el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip"
:filter-method="item.filterMethod" :label="item.name" :width="item.width" :key="item.key"> :filters="item.filters" :filter-method="item.filterMethod" :label="item.name"
:width="item.width" :key="item.key">
<div slot-scope="scope" v-html="item.render(scope.row)"></div> <div slot-scope="scope" v-html="item.render(scope.row)"></div>
</el-table-column> </el-table-column>
<el-table-column v-else :prop="item.key" :filters="item.filters" <el-table-column v-else :prop="item.key" :filters="item.filters"
:filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip" :label="item.name" :width="item.width" :key="item.key"> :filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip" :label="item.name"
:width="item.width" :key="item.key">
</el-table-column> </el-table-column>
</template> </template>
<el-table-column label="操作" fixed="right" width="200"> <el-table-column label="操作" fixed="right" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="showUpdateModel(scope.row,true)">查看</el-button> <el-button type="text" @click="showUpdateModel(scope.row,true)">查看</el-button>
<el-button type="text" @click="showUpdateModel(scope.row)">修改</el-button> <el-button type="text" @click="showUpdateModel(scope.row)">修改</el-button>
<el-button type="text" @click="deleteData([scope.row.id])">删除</el-button> <el-button type="text" @click="deleteData([scope.row.id])">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -40,75 +42,76 @@
</div> </div>
</div> </div>
<el-dialog :close-on-click-modal="false" :title="currentId===-1?'新增':isReadonly?'详情':'编辑'" :visible.sync="showUpdate" width="952px" <el-dialog :close-on-click-modal="false" :title="currentId===-1?'新增':isReadonly?'详情':'编辑'"
:before-close="handleClose" destroy-on-close> :visible.sync="showUpdate" width="952px" :before-close="handleClose" destroy-on-close>
<FormComponent :options="updateOptions" :isReadonly="isReadonly" labelWidth="110px" labelAlign="right" :data.sync="updateParams" <FormComponent :options="updateOptions" :isReadonly="isReadonly" labelWidth="110px" labelAlign="right"
@actionCallback="callback" :actions="updateActions" :full-btn="true" @change="change" :data.sync="updateParams" @actionCallback="callback" :actions="updateActions" :full-btn="true"
btn-position="center"> @change="change" btn-position="center" ref="checkForm">
<div class="sub-title" v-if="isManager">检查项目</div> <div class="sub-title" v-if="isManager">检查项目</div>
<TableComponent v-if="isManager" :tableData="updateTableData" :tableColumn="updateTableColumn"
<TableComponent v-if="isManager" :tableData="updateTableData" :tableColumn="updateTableColumn" @actionCallback="subCallback($event)" actionPosition="flex-start"
@actionCallback="subCallback($event)" actionPosition="flex-start" :actions="!isReadonly?updateTableActions:[]" :actions="!isReadonly?updateTableActions:[]" :showFooter="false" style="margin-bottom: 20px;">
:showFooter="false" style="margin-bottom: 20px;">
<el-table ref="multipleTable" :data="updateParams.tableItems" tooltip-effect="dark" height="100%" border <el-table ref="multipleTable" :data="updateParams.tableItems" tooltip-effect="dark" height="100%" border
@selection-change="handleSelectionChange" style="width: 100%;min-height: 200px;"> @selection-change="handleSelectionChange" style="width: 100%;min-height: 200px;">
<el-table-column type="selection" fixed label="全选" width="40" v-if="!isReadonly"> <el-table-column type="selection" fixed label="全选" width="40" v-if="!isReadonly">
</el-table-column> </el-table-column>
<template v-for="item in updateTableColumn"> <template v-for="item in updateTableColumn">
<el-table-column v-if="item.render" :filters="item.filters" <el-table-column v-if="item.render" :filters="item.filters" :filter-method="item.filterMethod"
:filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip" :label="item.name" :width="item.width" :key="item.key"> :show-overflow-tooltip="item.showTip" :label="item.name" :width="item.width"
:key="item.key">
<div slot-scope="scope" v-html="item.render(scope.row)"></div> <div slot-scope="scope" v-html="item.render(scope.row)"></div>
</el-table-column> </el-table-column>
<el-table-column v-else :prop="item.key" :filters="item.filters" <el-table-column v-else :prop="item.key" :filters="item.filters"
:filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip" :label="item.name" :width="item.width" :key="item.key"> :filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip" :label="item.name"
:width="item.width" :key="item.key">
</el-table-column> </el-table-column>
</template> </template>
<el-table-column label="操作" fixed="right" width="200" v-if="!isReadonly"> <el-table-column label="操作" fixed="right" width="200" v-if="!isReadonly">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="showSubUpdateModel(scope.row,true)">查看</el-button> <el-button type="text" @click="showSubUpdateModel(scope.row,true)">查看</el-button>
<el-button type="text" @click="showSubUpdateModel(scope.row)">修改</el-button> <el-button type="text" @click="showSubUpdateModel(scope.row)">修改</el-button>
<el-button type="text" @click="doSubDelete([scope.$index])">删除</el-button> <el-button type="text" @click="doSubDelete([scope.$index])">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</TableComponent> </TableComponent>
</FormComponent> </FormComponent>
</el-dialog> </el-dialog>
<el-dialog v-if="isManager" :close-on-click-modal="false" :title="!subUpdateParams.id?'新增':subIsReadonly?'详情':'编辑'" :visible.sync="showSubUpdate" <el-dialog v-if="isManager" :close-on-click-modal="false" :title="!subUpdateParams.id?'新增':subIsReadonly?'详情':'编辑'"
:before-close="handleClose"> :visible.sync="showSubUpdate" :before-close="handleClose">
<FormComponent :options="subUpdateOptions" :isReadonly="subIsReadonly" labelWidth="110px" labelAlign="right" :data.sync="subUpdateParams" <FormComponent :options="subUpdateOptions" :isReadonly="subIsReadonly" labelWidth="110px" labelAlign="right"
@actionCallback="subCallback" :actions="updateActions" :full-btn="true" @change="subChange" :data.sync="subUpdateParams" @actionCallback="subCallback" :actions="updateActions" :full-btn="true"
btn-position="center"> @change="subChange" btn-position="center">
</FormComponent> </FormComponent>
</el-dialog> </el-dialog>
<el-dialog v-if="isManager" :close-on-click-modal="false" :title="'批量添加'" :visible.sync="showSubMutilUpdate" <el-dialog v-if="isManager" :close-on-click-modal="false" :title="'批量添加'" :visible.sync="showSubMutilUpdate"
:before-close="handleClose" destroy-on-close> :before-close="handleClose" destroy-on-close>
<FormComponent :options="mutilAddOptions" @change="loadRuleTable" :data.sync="ruleParams"></FormComponent> <FormComponent :options="mutilAddOptions" @change="loadRuleTable" :data.sync="ruleParams"></FormComponent>
<TableComponent :tableData="updateTableData" :tableColumn="updateTableColumn" @pageNumberChange="loadRuleTable($event,'pageNum')" @pageSizeChange="loadRuleTable($event,'pageSize')" <TableComponent :tableData="updateTableData" :tableColumn="updateTableColumn"
:showFooter="true"> @pageNumberChange="loadRuleTable($event,'pageNum')" @pageSizeChange="loadRuleTable($event,'pageSize')"
:showFooter="true">
<el-table ref="multipleTable" :data="updateTableData.datas" tooltip-effect="dark" height="100%" border <el-table ref="multipleTable" :data="updateTableData.datas" tooltip-effect="dark" height="100%" border
@selection-change="handleSelectionChange" style="width: 100%;min-height: 200px;"> @selection-change="handleSelectionChange" style="width: 100%;min-height: 200px;">
<el-table-column type="selection" fixed label="全选" width="40px" > <el-table-column type="selection" fixed label="全选" width="40px">
</el-table-column>
<template v-for="item in updateTableColumn">
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name"
:width="item.width" :key="item.key">
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
</el-table-column> </el-table-column>
<template v-for="item in updateTableColumn"> <el-table-column v-else :prop="item.key" :show-overflow-tooltip="item.showTip" :label="item.name"
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name" :width="item.width" :key="item.key"> :width="item.width" :key="item.key">
<div slot-scope="scope" v-html="item.render(scope.row)"></div> </el-table-column>
</el-table-column> </template>
<el-table-column v-else :prop="item.key" :show-overflow-tooltip="item.showTip" :label="item.name" :width="item.width" :key="item.key"> </el-table>
</el-table-column> </TableComponent>
</template> <div class="dis-flex" style="justify-content: center; margin-top: 20px;">
</el-table> <el-button @click="cancelMutilAdd"> 取消</el-button>
</TableComponent> <el-button type="primary" @click="doMutilAdd"> 确定</el-button>
<div class="dis-flex" style="justify-content: center; margin-top: 20px;"> </div>
<el-button @click="cancelMutilAdd"> 取消</el-button>
<el-button type="primary" @click="doMutilAdd"> 确定</el-button>
</div>
</el-dialog> </el-dialog>
</div> </div>

View File

@ -12,7 +12,7 @@ import RuleService from '@/service/rule.service';
import { number } from 'echarts'; import { number } from 'echarts';
@Component({ @Component({
template, template,
components:{ components: {
FormComponent, FormComponent,
TableComponent, TableComponent,
DrawComponent, DrawComponent,
@ -28,45 +28,45 @@ export default class RulesComponent extends BaseRecordComponent<any> {
public isManager = false; public isManager = false;
public formActions = [{ public formActions = [{
name:"查询", name: "查询",
value:"search", value: "search",
icon:"el-icon-search", icon: "el-icon-search",
type:"primary" type: "primary"
},{ }, {
name:"清空", name: "清空",
icon:"el-icon-tickets", icon: "el-icon-tickets",
value:"reset" value: "reset"
}]; }];
public tableActions = [{ public tableActions = [{
name:"添加", name: "添加",
value:"add", value: "add",
icon:"el-icon-plus", icon: "el-icon-plus",
type:"primary" type: "primary"
},{ }, {
name:"批量删除", name: "批量删除",
value:"delete", value: "delete",
plain:true, plain: true,
icon:"el-icon-delete", icon: "el-icon-delete",
type:"danger" type: "danger"
}]; }];
public footerActions = [{ public footerActions = [{
name:"选择全部", name: "选择全部",
value:"selectAll", value: "selectAll",
type:"primary" type: "primary"
},{ }, {
name:"反向选择", name: "反向选择",
value:"reverse" value: "reverse"
}]; }];
public formOptions:FormOption<BtnOption>[] = [{ public formOptions: FormOption<BtnOption>[] = [{
name:"检查项目", name: "检查项目",
key:"name", key: "name",
type:"text", type: "text",
}]; }];
public showUpdate = false; public showUpdate = false;
public currentId = -1; public currentId = -1;
public updateParams = {} as any; public updateParams = {} as any;
public updateOptions:FormOption<BtnOption>[] = []; public updateOptions: FormOption<BtnOption>[] = [];
public showDraw = false; public showDraw = false;
@ -74,159 +74,176 @@ export default class RulesComponent extends BaseRecordComponent<any> {
public drawModel = "list"; public drawModel = "list";
public updateActions = [{ public updateActions = [] as any;
name:"取消",
value:"cancel"
},{
name:"保存并继续添加",
value:"saveAndContinue",
type:"primary"
},{
name:"保存",
value:"save",
type:"primary"
}];
public selectData = []; public selectData = [];
created(){ created() {
} }
public getTableCallback(){ public getTableCallback() {
this.updateOptions = [{ this.updateOptions = [{
name:"检查标准编号", name: "检查标准编号",
key:"number", key: "number",
type:"text", type: "text",
width:"calc(50% - 20px)", width: "calc(50% - 20px)",
require:true, require: true,
showError:false, showError: false,
disable:true, disable: true,
},{ }, {
name:"检查项目", name: "检查项目",
key:"name", key: "name",
type:"text", type: "text",
width:"calc(50% - 20px)", width: "calc(50% - 20px)",
require:true, require: true,
showError:false, showError: false,
},{ }, {
name:"检查内容", name: "检查内容",
key:"content", key: "content",
type:"textarea", type: "textarea",
width:"100%", width: "100%",
require:true, require: true,
showError:false, showError: false,
},{ }, {
name:"检查依据", name: "检查依据",
key:"reason", key: "reason",
type:"textarea", type: "textarea",
width:"100%", width: "100%",
require:true, require: true,
showError:false, showError: false,
},{ }, {
name:"类型", name: "类型",
key:"type", key: "type",
format:"typeName", format: "typeName",
type:"select", type: "select",
width:"100%", width: "100%",
require:true, require: true,
datas:this.$store.state.prevention_dangrous_type multiple: true,
showError: false,
datas: this.$store.state.prevention_dangrous_type
}]
this.updateActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary",
hide: this.updateParams.id
}, {
name: "保存",
value: "save",
type: "primary"
}] }]
} }
public buildTable(){ public buildTable() {
this.tableColumn.push({name:'检查项目',key:"name"}); this.tableColumn.push({ name: '检查项目', key: "name" });
this.tableColumn.push({name:'检查内容',key:"content",showTip:true}); this.tableColumn.push({ name: '检查内容', key: "content", showTip: true });
this.tableColumn.push({name:'检查依据',key:"reason",showTip:true}); this.tableColumn.push({ name: '检查依据', key: "reason", showTip: true });
this.tableColumn.push({name:'分类',key:"type",render:(data)=>{ this.tableColumn.push({
return this.$store.getters.prevention_dangrous_type_map[data.type] name: '分类', key: "type", render: (data) => {
}}); return data.type.split(',').map(item => {
return this.$store.getters.prevention_dangrous_type_map[item]
}).join(",")
}
});
} }
public change(data,item){ public change(data, item) {
// //
} }
public callback(data,type?){ public callback(data, type?) {
if(type){ if (type) {
this.params[type] = data; this.params[type] = data;
this.getTableData(); this.getTableData();
return return
} }
// //
if(data && data.value==="search"){ if (data && data.value === "search") {
this.getTableData() this.getTableData()
// //
}else if(data && data.value === "reset"){ } else if (data && data.value === "reset") {
this.reset() this.reset()
// //
}else if(data && data.value === "reverse"){ } else if (data && data.value === "reverse") {
this.toggleAll() this.toggleAll()
// //
}else if(data && data.value === "selectAll"){ } else if (data && data.value === "selectAll") {
this.selectAll() this.selectAll()
}else if(data && data.value === "add"){ } else if (data && data.value === "add") {
this.showUpdateModel() this.showUpdateModel()
}else if(data && data.value === "delete"){ } else if (data && data.value === "delete") {
this.deleteData(this.selectData.map((item:any)=>item.id)); this.deleteData(this.selectData.map((item: any) => item.id));
this.clearSelect() this.clearSelect()
}else if(data && data.value.indexOf("save")>=0){ } else if (data && data.value.indexOf("save") >= 0) {
this.doSave(data.value!=="save") this.doSave(data.value !== "save")
}else{ } else {
this.handleClose(); this.handleClose();
} }
} }
// //
public reset(){ public reset() {
this.params = { this.params = {
name:"", name: "",
pageNum:1, pageNum: 1,
pageSize:20, pageSize: 20,
} as any; } as any;
} }
/**
public doSave(goOn?){ * 数据保存
this.tableService.addOrUpdate(this.updateParams,this.currentId===-1).then((res=>{ * @param goOn
this.$message.success(this.currentId===-1?"新增成功!":"编辑成功"); */
public doSave(goOn?) {
this.updateParams.type = this.updateParams.type.join(',')
this.tableService.addOrUpdate(this.updateParams, this.currentId === -1).then((res => {
this.$message.success(this.currentId === -1 ? "新增成功!" : "编辑成功");
this.showUpdate = !!goOn; this.showUpdate = !!goOn;
this.updateParams = {number:null} as any; this.updateParams = { number: null } as any;
if(goOn){ if (goOn) {
this.tableService.getNumber().then(res=>{ this.tableService.getNumber().then(res => {
this.updateParams.number = res.data this.updateParams.number = res.data
}) })
} }
this.getTableData(); this.getTableData();
})) }))
} }
public showUpdateModel(row?,isRead?){ public showUpdateModel(row?, isRead?) {
this.updateParams = Object.assign({ number: null })
this.updateParams = Object.assign({number:null})
this.isReadonly = !!isRead; this.isReadonly = !!isRead;
if(!row){ if (!row) {
this.currentId = -1; this.currentId = -1;
this.tableService.getNumber().then(res=>{ this.tableService.getNumber().then(res => {
this.updateParams.number = res.data this.updateParams.number = res.data
}) })
}else{ } else {
this.updateParams = Object.assign({number:null,typeName:this.$store.getters.prevention_dangrous_type_map[row.type]},row) this.updateParams = Object.assign({
number: null,
typeName: row.type.split(',').map(item => {
return this.$store.getters.prevention_dangrous_type_map[item]
}).join(",")
}, row)
this.updateParams.type = row.type.split(',').map((item: any) => parseInt(item))
this.currentId = row.id; this.currentId = row.id;
} }
this.clearSelect(); this.clearSelect();
this.showUpdate = true this.getTableCallback()
this.showUpdate = true;
} }
public clearSelect(){ public clearSelect() {
(this.$refs.multipleTable as any).clearSelection(); (this.$refs.multipleTable as any).clearSelection();
this.selectData = []; this.selectData = [];
} }
public handleClose(){ public handleClose() {
this.showUpdate = false; this.showUpdate = false;
this.clearSelect(); this.clearSelect();
} }
@ -234,24 +251,24 @@ export default class RulesComponent extends BaseRecordComponent<any> {
public toggleAll() { public toggleAll() {
this.tableData.datas.forEach((item,index)=>{ this.tableData.datas.forEach((item, index) => {
(this.$refs.multipleTable as any).toggleRowSelection(item); (this.$refs.multipleTable as any).toggleRowSelection(item);
}) })
} }
public selectAll(){ public selectAll() {
if(!this.selectData.length){ if (!this.selectData.length) {
this.toggleAll() this.toggleAll()
}else{ } else {
this.tableData.datas.forEach((item,index)=>{ this.tableData.datas.forEach((item, index) => {
const find = this.selectData.find((data:any)=>data.id === item.id); const find = this.selectData.find((data: any) => data.id === item.id);
if(!find){ if (!find) {
(this.$refs.multipleTable as any).toggleRowSelection(item); (this.$refs.multipleTable as any).toggleRowSelection(item);
} }
}) })
} }
} }
public handleSelectionChange(data){ public handleSelectionChange(data) {
this.selectData = data; this.selectData = data;
} }
} }

View File

@ -42,6 +42,10 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
value:"search", value:"search",
icon:"el-icon-search", icon:"el-icon-search",
type:"primary" type:"primary"
}, {
name: "清空",
icon: "el-icon-tickets",
value: "reset"
}]; }];
public tableActions = [{ public tableActions = [{
@ -293,6 +297,10 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
} }
}),filterMethod:(data,row)=>{ }),filterMethod:(data,row)=>{
return row.types.indexOf(data)>=0; return row.types.indexOf(data)>=0;
}, render: (data) => {
return data.types.split(',').map(item => {
return this.$store.getters.prevention_dangrous_type_map[item]
}).join(",")
}}); }});
this.tableColumn.push({name:'编制人',key:"createName"}); this.tableColumn.push({name:'编制人',key:"createName"});
this.tableColumn.push({name:'编制时间',key:"createTime"}); this.tableColumn.push({name:'编制时间',key:"createTime"});
@ -499,7 +507,10 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
this.$message.success(this.currentId===-1?"新增成功!":"编辑成功"); this.$message.success(this.currentId===-1?"新增成功!":"编辑成功");
this.getTableData(); this.getTableData();
this.showUpdate = !!goOn; this.showUpdate = !!goOn;
this.updateParams = {areas:[],depts:[],units:[],types:[],targets:[],number:null} as any; this.updateParams = {areas:[],depts:[],units:[],types:[],targets:[],number:null,tableItems:[]} as any;
if(!!goOn){
this.getNumber();
}
}).catch(()=>{ }).catch(()=>{
this.updateParams.depts = this.updateParams.depts.map(item=>item.id) this.updateParams.depts = this.updateParams.depts.map(item=>item.id)

View File

@ -544,6 +544,7 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
} as any; } as any;
this.getTableData()
} }
public getMap(map) { public getMap(map) {

View File

@ -2,7 +2,7 @@
<div class="common-content-box dis-flex flex-col flex-1"> <div class="common-content-box dis-flex flex-col flex-1">
<div class="search-box"> <div class="search-box">
<FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions" <FormComponent :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions"
:full-btn="false" @change="callback($event)" btn-position="end"></FormComponent> :full-btn="false" @change="callback" btn-position="end"></FormComponent>
</div> </div>
<div class="table-box flex-1"> <div class="table-box flex-1">
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)" <TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"

View File

@ -101,8 +101,14 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
datas: this.$store.state.userList datas: this.$store.state.userList
}, { }, {
name: "岗位", name: "岗位",
type: "select",
key: "postName", key: "postName",
datas: this.$store.state.postList,
width: "270px",
}, {
name: "职务",
type: "text", type: "text",
key: "dutyName",
}]; }];
public subActions = [{ public subActions = [{
@ -344,6 +350,9 @@ export default class RewardsRecord extends BaseRecordComponent<any> {
} }
// //
public getTableData() { public getTableData() {
if(this.params.postName){
this.params.postName = this.$store.state.postList.find((item: any) => item.value === this.params.postName)?.name??""
}
this.tableService.selectByPage(this.params).then(res => { this.tableService.selectByPage(this.params).then(res => {
this.tableData = res.data as any; this.tableData = res.data as any;
}) })

View File

@ -111,7 +111,7 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
created() { created() {
//
} }
public buildFormOptions() { public buildFormOptions() {
@ -388,10 +388,9 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
} as any; } as any;
this.getTableData()
} }
public showUpdateModel(data?, isRead?) { public showUpdateModel(data?, isRead?) {
if (!data) { if (!data) {
this.currentId = -1; this.currentId = -1;
@ -399,7 +398,6 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
} else { } else {
this.currentId = data.id; this.currentId = data.id;
this.updateParams = Object.assign({ bottomHeight: 0, topHeight: 0, geoJson: "[]", majorHazardFlagName: this.$store.getters.common_yes_no_map[data.majorHazardFlag], majorHazardLevelName: this.levelName(data.majorHazardLevel) }, data); this.updateParams = Object.assign({ bottomHeight: 0, topHeight: 0, geoJson: "[]", majorHazardFlagName: this.$store.getters.common_yes_no_map[data.majorHazardFlag], majorHazardLevelName: this.levelName(data.majorHazardLevel) }, data);
this.isReadonly = !!isRead; this.isReadonly = !!isRead;
this.buildFormOptions(); this.buildFormOptions();
this.showUpdate = true this.showUpdate = true

View File

@ -1,13 +1,13 @@
<div class="common-box dis-flex "> <div class="common-box dis-flex ">
<div class="common-content-box dis-flex flex-col flex-1"> <div class="common-content-box dis-flex flex-col flex-1">
<div class="search-box"> <div class="search-box">
<FormComponent :inline="true" :options="formOptions" :data.sync="params" @actionCallback="callback" :actions="formActions" <FormComponent :inline="true" :options="formOptions" :data.sync="params" @actionCallback="callback"
:full-btn="false" @change="change" btn-position="end"></FormComponent> :actions="formActions" :full-btn="false" @change="callback" btn-position="end"></FormComponent>
</div> </div>
<div class="table-box flex-1"> <div class="table-box flex-1">
<TableComponent :tableData="tableData" :tableColumn="tableColumn" <TableComponent :tableData="tableData" :tableColumn="tableColumn" @actionCallback="callback($event)"
@actionCallback="callback($event)" @pageNumberChange="callback($event,'pageNum')" @pageNumberChange="callback($event,'pageNum')" @pageSizeChange="callback($event,'pageSize')"
@pageSizeChange="callback($event,'pageSize')" :footerActions="footerActions" :actions="tableActions"> :footerActions="footerActions" :actions="tableActions">
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border <el-table ref="multipleTable" :data="tableData.datas" height="100%" border
@selection-change="handleSelectionChange" style="width: 100%"> @selection-change="handleSelectionChange" style="width: 100%">
@ -54,12 +54,9 @@
:data.sync="updateParams" @actionCallback="callback" :actions="updateActions" :full-btn="true" :data.sync="updateParams" @actionCallback="callback" :actions="updateActions" :full-btn="true"
@change="change" btn-position="center"> @change="change" btn-position="center">
<span class="tips" v-if="isArea">*注:安全风险分析对象编码即危险化学品登记综合服务系统中的危险源编码</span> <span class="tips" v-if="isArea">*注:安全风险分析对象编码即危险化学品登记综合服务系统中的危险源编码</span>
<div class="sub-title" v-if="!isArea && isReadonly">停用/检修记录</div> <div class="sub-title" v-if="!isArea && isReadonly">停用/检修记录</div>
<TableComponent v-if="!isArea && isReadonly" :tableData="repairTableData" :tableColumn="repairTableColumn" <TableComponent v-if="!isArea && isReadonly" :tableData="repairTableData" :tableColumn="repairTableColumn"
:showFooter="false" style="margin-bottom: 20px;"> :showFooter="false" style="margin-bottom: 20px;height: 200px;">
</TableComponent> </TableComponent>
</FormComponent> </FormComponent>

View File

@ -38,7 +38,7 @@
</div> </div>
<el-dialog :close-on-click-modal="false" :visible.sync="showUpdate" destroy-on-close> <el-dialog :close-on-click-modal="false" :visible.sync="showUpdate" destroy-on-close>
<img style="width:100%" src="../../../../assets/images/4.jpg" alt=""> <img style="width:100%" src="../../../../assets/images/4.png" alt="">
</el-dialog> </el-dialog>
<!-- 选取LS值 --> <!-- 选取LS值 -->
@ -91,11 +91,7 @@
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===4}"> <div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===4}">
<el-radio v-model="scope.row.value" :label="4"">{{scope.row.type4}}</el-radio></div> <el-radio v-model="scope.row.value" :label="4"">{{scope.row.type4}}</el-radio></div>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column prop=" value" :label="popTitle==='L'?'Ln':'Sn'"> <el-table-column prop=" value" :label="popTitle==='L'?'Ln':'Sn'">
<div slot-scope="scope"> <div slot-scope="scope">
@ -108,44 +104,4 @@
<ButtonListComponent :actions="popBtns" @callback="popCallback" btn-position="center" :full-btn="true"> <ButtonListComponent :actions="popBtns" @callback="popCallback" btn-position="center" :full-btn="true">
</ButtonListComponent> </ButtonListComponent>
</el-dialog> </el-dialog>
<!-- 选取LS值 -->
<!-- <el-dialog :close-on-click-modal="false" :title="popTitle" :visible.sync="showPop" width="1000px" destroy-on-close>
<el-table :data="riskDatas" border style="width: 100%; margin-bottom: 20px;" :span-method="colSpan">
<el-table-column prop="index" label="序号"></el-table-column>
<el-table-column prop="name" label="项目"></el-table-column>
<el-table-column label="取值标准">
<el-table-column prop="noInvolved" label="是否涉及">
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===0}"
@click="selectRow(scope.row,0)">
<span>不涉及</span>
</div>
</el-table-column>
<el-table-column prop="type1" label="1">
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===1}"
@click="selectRow(scope.row,1)"><span>{{scope.row.type1}}</span></div>
</el-table-column>
<el-table-column prop="type2" label="2">
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===2}"
@click="selectRow(scope.row,2)"><span>{{scope.row.type2}}</span></div>
</el-table-column>
<el-table-column prop="type3" label="3">
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===3}"
@click="selectRow(scope.row,3)"><span>{{scope.row.type3}}</span></div>
</el-table-column>
<el-table-column prop="type4" label="4">
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===4}"
@click="selectRow(scope.row,4)"><span>{{scope.row.type4}}</span></div>
</el-table-column>
</el-table-column>
<el-table-column prop="value" :label="popTitle==='L值取值'?'Ln':'Sn'">
<div slot-scope="scope">
<span v-if="scope.row.value">{{scope.row.value}}</span>
<span v-else></span>
</div>
</el-table-column>
<el-table-column prop="result" :label="popTitle==='L值取值'?'L':'S'"></el-table-column>
</el-table>
<ButtonListComponent :actions="popBtns" @callback="popCallback" btn-position="center" :full-btn="true">
</ButtonListComponent>
</el-dialog> -->
</div> </div>

View File

@ -95,7 +95,7 @@ export default class AreaAnalComponent extends BaseRecordComponent<any> {
}); });
this.tableColumn.push({ this.tableColumn.push({
name: '区域固有风险', render: (data) => { name: '区域固有风险', render: (data) => {
return "<span class='color_level_" + data.analRiskLevel + "'>" + (data.analRiskLevel ? (this.$store.getters.prevention_risk_level_map[data.analRiskLevel] + this.numberForMat[data.analRiskLevel]) : '') + "</span>" return "<span class='color_level_" + data.analRiskLevel + "'>" + (data.analRiskLevel ? (this.$store.getters.prevention_risk_level_map[data.analRiskLevel] + this.numberForMat[data.analRiskLevel]) : '待评估') + "</span>"
} }
}); });
this.tableColumn.push({ this.tableColumn.push({
@ -144,11 +144,18 @@ export default class AreaAnalComponent extends BaseRecordComponent<any> {
this.showUpdate = true this.showUpdate = true
} }
// L/S /**
public addVal(el, row) { * 新增 添加L/S值
* @param el
* @param row 当前行数据
*/
public addVal(el: any, row: any) {
this.riskLDatas = [];
this.riskSDatas = [];
this.currentRow = row; this.currentRow = row;
this.cacheCurrentRow = JSON.parse(JSON.stringify(row)); this.cacheCurrentRow = JSON.parse(JSON.stringify(row));
this.riskLDatas = riskLData; this.riskLDatas = JSON.parse(JSON.stringify(riskLData));
this.riskSDatas = JSON.parse(JSON.stringify(riskSData));
this.popTitle = 'L'; this.popTitle = 'L';
const lData = JSON.parse(row.analLikelihoodContent || "[]"); const lData = JSON.parse(row.analLikelihoodContent || "[]");
const sData = JSON.parse(row.analSeverityContent || "[]"); const sData = JSON.parse(row.analSeverityContent || "[]");
@ -222,7 +229,30 @@ export default class AreaAnalComponent extends BaseRecordComponent<any> {
} }
if (row[column.property] !== '/') { if (row[column.property] !== '/') {
row.value = column.index - 1 row.value = column.index - 1
this.countEstimateValue()
} }
}
public countEstimateValue() {
let value: number = 0;
let len: number = 0;
let tmpRiskDatas = []
if (this.popTitle === 'L') {
tmpRiskDatas = this.riskLDatas
}
if (this.popTitle === 'S') {
tmpRiskDatas = this.riskSDatas
}
tmpRiskDatas.forEach((item: any) => {
if (item.value && typeof (item.value) === 'number') {
len = len + 1
value = value + item.value
}
})
tmpRiskDatas.forEach((item: any) => {
item.result = Math.round(value / len).toString()
})
} }
public startEdit(row) { public startEdit(row) {
@ -274,7 +304,9 @@ export default class AreaAnalComponent extends BaseRecordComponent<any> {
this.popTitle = 'S'; this.popTitle = 'S';
this.stepsActive = 2; this.stepsActive = 2;
this.riskLDatas[0].value = value; this.riskLDatas[0].value = value;
this.riskSDatas = JSON.parse(JSON.stringify(riskSData)); if (this.riskSDatas.length === 0) {
this.riskSDatas = JSON.parse(JSON.stringify(riskSData));
}
this.updateBtn(); this.updateBtn();
} else { } else {
this.currentRow.analSeverityContent = content; this.currentRow.analSeverityContent = content;
@ -304,7 +336,7 @@ export default class AreaAnalComponent extends BaseRecordComponent<any> {
// //
public selectRadioData(data) { public selectRadioData(data) {
console.log('data', data); // console.log('data', data);
} }
//L //L

View File

@ -159,7 +159,7 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
public buildUpdateForm() { public buildUpdateForm() {
this.updateOptions = [{ this.updateOptions = [{
name: "区域名称", name: "选择区域",
key: "areaId", key: "areaId",
format: "areaName", format: "areaName",
type: "select", type: "select",
@ -169,7 +169,7 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
datas: this.areaList, datas: this.areaList,
disable: !this.updateParams.status || this.updateParams.status === 1 ? false : true disable: !this.updateParams.status || this.updateParams.status === 1 ? false : true
}, { }, {
name: "单元名称", name: "选择单元",
key: "unitId", key: "unitId",
format: "unitName", format: "unitName",
type: "select", type: "select",
@ -236,7 +236,8 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
require: true, require: true,
showError: false, showError: false,
format: "yyyy-MM-dd" format: "yyyy-MM-dd",
disable: true,
}, { }, {
name: "区域固有风险等级", name: "区域固有风险等级",
key: "analRiskLevel", key: "analRiskLevel",

View File

@ -120,7 +120,7 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
name: "保存并继续添加", name: "保存并继续添加",
value: "saveAndContinue", value: "saveAndContinue",
type: "primary", type: "primary",
hide:this.updateParams.id hide: this.updateParams.id
}, { }, {
name: "保存", name: "保存",
value: "save", value: "save",
@ -137,7 +137,7 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
name: "保存并继续添加", name: "保存并继续添加",
value: "saveAndContinue", value: "saveAndContinue",
type: "primary", type: "primary",
hide:this.stepUpdateParams.index hide: this.stepUpdateParams.index
}, { }, {
name: "保存", name: "保存",
value: "save", value: "save",
@ -470,6 +470,7 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
} }
this.showSubUpdate = true; this.showSubUpdate = true;
this.subUpdateActionsForm(); this.subUpdateActionsForm();
this.buildUpdateForm();
} }
public doSubDelete(indexs) { public doSubDelete(indexs) {
@ -486,6 +487,10 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
public doSave(goOn?) { public doSave(goOn?) {
if (this.updateParams.steps.length === 0) {
this.$message.warning("请您至少添加一条作业步骤!");
return
}
// //
if (this.showSubUpdate) { if (this.showSubUpdate) {
// //
@ -598,7 +603,7 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
this.toggleAll() this.toggleAll()
} else { } else {
this.tableData.datas.forEach((item, index) => { this.tableData.datas.forEach((item, index) => {
const find = this.selectData.find((data: any) => data.userId === item.userId); const find = this.selectData.find((data: any) => data.id === item.id);
if (!find) { if (!find) {
(this.$refs.multipleTable as any).toggleRowSelection(item); (this.$refs.multipleTable as any).toggleRowSelection(item);
} }

View File

@ -131,7 +131,11 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
name: "单元名称", name: "单元名称",
key: "unitName", key: "unitName",
type: "text", type: "text",
},]; }, {
name: "作业活动",
key: "jobInventoryName",
type: "text",
}];
public showUpdate = false; public showUpdate = false;
@ -165,7 +169,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
console.log(this.updateParams.id && this.updateParams.status !== 1,); console.log(this.updateParams.id && this.updateParams.status !== 1,);
this.updateOptions = [{ this.updateOptions = [{
name: "区域名称", name: "选择区域",
key: "areaId", key: "areaId",
format: "areaName", format: "areaName",
type: "select", type: "select",
@ -175,7 +179,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
datas: this.areaList, datas: this.areaList,
disable: !this.updateParams.status || this.updateParams.status === 1 ? false : true disable: !this.updateParams.status || this.updateParams.status === 1 ? false : true
}, { }, {
name: "单元名称", name: "选择单元",
key: "unitId", key: "unitId",
format: "unitName", format: "unitName",
type: "select", type: "select",
@ -240,7 +244,8 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
require: true, require: true,
showError: false, showError: false,
format: "yyyy-MM-dd" format: "yyyy-MM-dd",
disable:true,
}, { }, {
name: "区域固有风险等级", name: "区域固有风险等级",
key: "analRiskLevel", key: "analRiskLevel",
@ -502,7 +507,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
this.subTableColumn.push({ name: '步骤名称', key: "name" }); this.subTableColumn.push({ name: '步骤名称', key: "name" });
this.subTableColumn.push({ name: '作业步骤描述', key: "description", showTip: true, width: "200px" }); this.subTableColumn.push({ name: '作业步骤描述', key: "description", showTip: true, width: "200px" });
this.subTableColumn.push({ name: '作业地点', key: "location" }); this.subTableColumn.push({ name: '风险源', key: "riskSource" }); this.subTableColumn.push({ name: '作业地点', key: "location" }); this.subTableColumn.push({ name: '风险源', key: "riskSource" });
this.subTableColumn.push({ name: '危害分析', key: "hazardAnalysis", width: "200px" }); this.subTableColumn.push({ name: '危害分析', key: "hazardAnalysis", width: "200px", showTip: true, });
this.subTableColumn.push({ this.subTableColumn.push({
name: '最严重后果', key: "seriousResult", width: "100px", render: (data) => { name: '最严重后果', key: "seriousResult", width: "100px", render: (data) => {
if (data.seriousResult) { if (data.seriousResult) {
@ -647,6 +652,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
} as any; } as any;
this.getTableData()
} }
// //

View File

@ -379,9 +379,10 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
this.repairTableColumn.push({ name: "登记时间", key: "registerTime" }); this.repairTableColumn.push({ name: "登记时间", key: "registerTime" });
} }
public getAreaList() {
this.areaService.selectByPage({ pageSize: 10 }).then((res: any) => { public getAreaList(){
this.areaList = res.data.datas.map(item => { this.areaService.selectByPage({pageSize:1000}).then((res:any)=>{
this.areaList = res.data.datas.map(item=>{
this.areaNoMap[item.id] = item.number; this.areaNoMap[item.id] = item.number;
return { return {
name: item.name, name: item.name,

View File

@ -63,7 +63,7 @@ export default class RiskCard extends BaseRecordComponent<any> {
public showFileList = [] as any; public showFileList = [] as any;
public labelWidth='130px' public labelWidth = '130px'
public formActions = [{ public formActions = [{
name: "查询", name: "查询",
@ -138,7 +138,7 @@ export default class RiskCard extends BaseRecordComponent<any> {
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
showError: false, showError: false,
disable: true, disable: true,
labelWidth:"130px" labelWidth: "130px"
}, },
{ {
name: "区域名称", name: "区域名称",
@ -185,7 +185,7 @@ export default class RiskCard extends BaseRecordComponent<any> {
require: true, require: true,
width: "100%", width: "100%",
showError: false, showError: false,
labelWidth:'130px' labelWidth: '130px'
}, },
{ {
name: "风险等级", name: "风险等级",
@ -327,7 +327,7 @@ export default class RiskCard extends BaseRecordComponent<any> {
this.tableColumn.push({ name: '岗位名称', key: "postName", }); this.tableColumn.push({ name: '岗位名称', key: "postName", });
this.tableColumn.push({ name: '主要危险有害因素', key: "harmfulFactors", }); this.tableColumn.push({ name: '主要危险有害因素', key: "harmfulFactors", });
this.tableColumn.push({ this.tableColumn.push({
name: '风险等级', key: "riskLevel",width:"150px", render: (data) => { name: '风险等级', key: "riskLevel", width: "150px", render: (data) => {
if (data.riskLevel) { if (data.riskLevel) {
return "<span class='color_level_" + data.riskLevel + "'>" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '') + "</span>" return "<span class='color_level_" + data.riskLevel + "'>" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '') + "</span>"
} }
@ -398,6 +398,7 @@ export default class RiskCard extends BaseRecordComponent<any> {
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
} as any; } as any;
this.getTableData()
} }
public showUpdateModel(id) { public showUpdateModel(id) {
@ -498,13 +499,8 @@ export default class RiskCard extends BaseRecordComponent<any> {
}) })
} }
public showModal(row, isReadonly) { public showModal(row, isReadonly = false) {
if (isReadonly) { this.subIsReadonly = isReadonly
this.subIsReadonly = true
} else {
this.subIsReadonly = false
}
this.tableService.getListDetail({ id: row.id }).then((res: any) => { this.tableService.getListDetail({ id: row.id }).then((res: any) => {
if (res.code === 200) { if (res.code === 200) {
@ -512,6 +508,7 @@ export default class RiskCard extends BaseRecordComponent<any> {
riskLevelName: this.$store.getters.prevention_risk_level_map[res.data.riskLevel], riskLevelName: this.$store.getters.prevention_risk_level_map[res.data.riskLevel],
safetySignName: res.data.safetySign.split(",").map(item => this.$store.getters.prevention_security_identifier_map[item]).join(",") safetySignName: res.data.safetySign.split(",").map(item => this.$store.getters.prevention_security_identifier_map[item]).join(",")
}, res.data) }, res.data)
this.subUpdateParams.postCode = +res.data.postCode
if (res.data.resourceId) { if (res.data.resourceId) {
this.tableService.getFileUrls({ ids: res.data.resourceId.split(",") }).then((files: any) => { this.tableService.getFileUrls({ ids: res.data.resourceId.split(",") }).then((files: any) => {
this.fileList = files.data.map(item => { this.fileList = files.data.map(item => {

View File

@ -99,9 +99,8 @@ export default class SafeCard extends BaseRecordComponent<any> {
public formOptions: FormOption<BtnOption>[] = [{ public formOptions: FormOption<BtnOption>[] = [{
name: "区域名称", name: "区域名称",
key: "areaId", key: "areaName",
type: "select", type: "text",
datas: this.areaList
}, { }, {
name: "承诺人", name: "承诺人",
key: "promiserId", key: "promiserId",

View File

@ -83,7 +83,7 @@
:title="subIsReadonly?'详情':subUpdateParams.index||subUpdateParams.id ?'编辑': '新增'" :visible.sync="subShowUpdate" :title="subIsReadonly?'详情':subUpdateParams.index||subUpdateParams.id ?'编辑': '新增'" :visible.sync="subShowUpdate"
width="952px"> width="952px">
<FormComponent :options="subUpdateOptions" :isReadonly="subIsReadonly" labelWidth="110px" labelAlign="right" <FormComponent :options="subUpdateOptions" :isReadonly="subIsReadonly" labelWidth="110px" labelAlign="right"
:data.sync="subUpdateParams" @actionCallback="triCallback" @change="changes" :actions="updateActions" :data.sync="subUpdateParams" @actionCallback="triCallback" @change="changes" :actions="subUpdateActions"
:full-btn="true" btnPosition="center"> :full-btn="true" btnPosition="center">
</FormComponent> </FormComponent>
</el-dialog> </el-dialog>

View File

@ -103,12 +103,14 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
type: "text", type: "text",
}, { }, {
name: "负责人", name: "负责人",
key: "chargeUserName", key: "chargeUserId",
type: "text", type: "select",
datas: this.$store.state.userList,
}, { }, {
name: "成立时间", name: "成立时间",
key: "establishTime", key: "establishTime",
type: "date", type: "date",
format: "yyyy-MM-dd"
}]; }];
public subActions = [{ public subActions = [{
@ -304,8 +306,8 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
this.subTableColumn.push({ name: '序号', key: "index", }); this.subTableColumn.push({ name: '序号', key: "index", });
this.subTableColumn.push({ name: '姓名', key: "userName",}); this.subTableColumn.push({ name: '姓名', key: "userName", });
this.subTableColumn.push({ name: '单位', key: "deptName",}); this.subTableColumn.push({ name: '单位', key: "deptName", });
this.subTableColumn.push({ name: '职务', key: "duty", }); this.subTableColumn.push({ name: '职务', key: "duty", });
this.subTableColumn.push({ name: '联系方式', key: "phone" }); this.subTableColumn.push({ name: '联系方式', key: "phone" });
this.subTableColumn.push({ name: '职责描述', key: "description", width: "250px", showTip: true, }); this.subTableColumn.push({ name: '职责描述', key: "description", width: "250px", showTip: true, });
@ -366,6 +368,7 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
} as any; } as any;
this.getTableData()
} }
public doSave(goOn?) { public doSave(goOn?) {
@ -394,7 +397,7 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
} as any } as any
this.showUpdate = !!goOn; this.showUpdate = !!goOn;
this.getTableData(); this.getTableData();
this.fileList = [];
if (goOn === true) { if (goOn === true) {
this.getFormNumber() this.getFormNumber()
} }
@ -461,7 +464,7 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
} }
public onRemove(file, fileList) { public onRemove(file, fileList) {
this.fileList.splice(this.fileList.findIndex(item => item.id === file.response.data.id), 1) this.fileList.splice(this.fileList.findIndex(item => item.id === file.id), 1)
} }
public showModal(row, isReadonly) { public showModal(row, isReadonly) {
@ -587,10 +590,10 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
public showSubModal(row, isReadonly) { public showSubModal(row, isReadonly) {
if (isReadonly) { if (isReadonly) {
this.subIsReadonly = true this.subIsReadonly = true
this.subUpdateParams = row this.subUpdateParams = JSON.parse(JSON.stringify(row))
} else { } else {
this.subIsReadonly = false this.subIsReadonly = false
this.subUpdateParams = row this.subUpdateParams = JSON.parse(JSON.stringify(row))
} }
this.subShowUpdate = true this.subShowUpdate = true
this.buildSubForm() this.buildSubForm()
@ -598,22 +601,27 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
// //
public deleteSubData(indexs) { public deleteSubData(indexs) {
this.$confirm('确认删除所选数据', '确认数据', { if (indexs.length === 0) {
confirmButtonText: '确定', this.$message.warning("请选择要删除的数据!")
cancelButtonText: '取消', } else {
type: 'warning' this.$confirm('确认删除所选数据', '确认数据', {
}).then(() => { confirmButtonText: '确定',
for (let i = this.updateParams.members.length - 1; i >= 0; i--) { cancelButtonText: '取消',
if (indexs.includes(i)) { type: 'warning'
this.updateParams.members.splice(i, 1) }).then(() => {
for (let i = this.updateParams.members.length - 1; i >= 0; i--) {
if (indexs.includes(i)) {
this.updateParams.members.splice(i, 1)
}
} }
} this.updateParams.members.forEach((item, index) => {
this.updateParams.members.forEach((item, index) => { item.index = index + 1;
item.index = index + 1; });
this.$message.success("删除成功")
}).catch(() => {
//
}); });
}).catch(() => { }
//
});
} }
public changes(data, item) { public changes(data, item) {
@ -622,11 +630,11 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
// //
public previewFile(url,file) { public previewFile(url, file) {
if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) { if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) {
this.currentUrl = file.url; this.currentUrl = file.url;
this.showFile = true; this.showFile = true;
} else{ } else {
window.open('http://119.45.186.133:8012/onlinePreview?url=' + encodeURIComponent(Base64.encode(url)), "_blank") window.open('http://119.45.186.133:8012/onlinePreview?url=' + encodeURIComponent(Base64.encode(url)), "_blank")
} }
} }

View File

@ -105,7 +105,7 @@ export default class ManagementSystem extends BaseRecordComponent<any> {
expandLevel: Infinity, expandLevel: Infinity,
width:"280px" width:"280px"
}, { }, {
name: "实施日期", name: "发布时间",
key: "publishTime", key: "publishTime",
type: "date", type: "date",
format: "yyyy-MM-dd" format: "yyyy-MM-dd"
@ -273,12 +273,10 @@ export default class ManagementSystem extends BaseRecordComponent<any> {
}); });
this.tableColumn.push({ this.tableColumn.push({
name: '状态', key: "status",width:"80px", render: (data) => { name: '状态', key: "status",width:"80px", render: (data) => {
if (data.status) { if (data.status === 1) {
if (data.status === 1) { return `<span class="color_1">${'在用'}</span>`
return `<span class="color_1">${'在用'}</span>` } else if (data.status === 0) {
} else if (data.status === 2) { return `<span class="color_0">${'废弃'}</span>`
return `<span class="color_0">${'废弃'}</span>`
}
} }
} }
}); });

View File

@ -57,7 +57,10 @@ export default class Programme extends BaseRecordComponent<any> {
public fileList = [] as any; public fileList = [] as any;
public suitList = [] as any;
public showFile = false; public showFile = false;
public currentUrl = null; public currentUrl = null;
public subShowUpdate = false; public subShowUpdate = false;
@ -96,7 +99,7 @@ export default class Programme extends BaseRecordComponent<any> {
}]; }];
public formOptions: FormOption<BtnOption>[] = [{ public formOptions: FormOption<BtnOption>[] = [{
name: "制度名称", name: "方案名称",
key: "name", key: "name",
type: "text", type: "text",
}, { }, {
@ -107,10 +110,10 @@ export default class Programme extends BaseRecordComponent<any> {
expandLevel: Infinity, expandLevel: Infinity,
width: "280px" width: "280px"
}, { }, {
name: "实施日期", name: "适用年度",
key: "publishTime", key: "suitYear",
type: "date", type: "select",
format: "yyyy-MM-dd" datas: this.suitList,
}]; }];
public subActions = [{ public subActions = [{
@ -259,9 +262,20 @@ export default class Programme extends BaseRecordComponent<any> {
created() { created() {
// this.getSuitListData();
} }
//
public getSuitListData() {
this.tableService.getSuitListData({}).then((res: any) => {
res.data.forEach((item) => {
let itemList = {} as any;
itemList.name = item;
itemList.value = item === '永久'?'1': item;
this.suitList.push(itemList)
})
})
}
public buildTable() { public buildTable() {
this.tableColumn.push({ name: '方案名称', key: "name", width: "200px" }); this.tableColumn.push({ name: '方案名称', key: "name", width: "200px" });

View File

@ -114,8 +114,9 @@ export default class TrainRecords extends BaseRecordComponent<any> {
datas: this.typeList datas: this.typeList
}, { }, {
name: "培训时间", name: "培训时间",
key: "analName", key: "startTime",
type: "date", type: "date",
format: "yyyy-MM-dd",
}]; }];
public subActions = [{ public subActions = [{
@ -123,21 +124,9 @@ export default class TrainRecords extends BaseRecordComponent<any> {
value: "cancel" value: "cancel"
}]; }];
public updateActions = [] as any;
public subUpdateActions = [] as any;
public updateActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary"
}, {
name: "保存",
value: "save",
type: "primary"
}];
public updateOptions: FormOption<BtnOption>[] = [] as any; public updateOptions: FormOption<BtnOption>[] = [] as any;
public buildUpdateForm() { public buildUpdateForm() {
@ -216,7 +205,19 @@ export default class TrainRecords extends BaseRecordComponent<any> {
showError: false, showError: false,
}, },
] ]
this.updateActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary",
hide: this.updateParams.id
}, {
name: "保存",
value: "save",
type: "primary"
}];
} }
public subUpdateOptions: FormOption<BtnOption>[] = [] public subUpdateOptions: FormOption<BtnOption>[] = []
@ -271,13 +272,29 @@ export default class TrainRecords extends BaseRecordComponent<any> {
}] }]
}, { }, {
name: "得分", name: "得分",
type: "text", type: "number",
key: "score", key: "score",
require: true, require: true,
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
controls: false,
showError: false, showError: false,
max: 100,
min: 0,
hide: !(this.subUpdateParams.examStatus === 1) hide: !(this.subUpdateParams.examStatus === 1)
},] },]
this.subUpdateActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary",
hide: this.subUpdateParams.index
}, {
name: "保存",
value: "save",
type: "primary"
}];
} }
@ -287,7 +304,7 @@ export default class TrainRecords extends BaseRecordComponent<any> {
public buildTable() { public buildTable() {
this.tableColumn.push({ name: '培训名称', key: "name"}); this.tableColumn.push({ name: '培训名称', key: "name" });
this.tableColumn.push({ this.tableColumn.push({
name: '培训类型', key: "type", render: (data) => { name: '培训类型', key: "type", render: (data) => {
if (data.type === 1) { if (data.type === 1) {
@ -310,7 +327,7 @@ export default class TrainRecords extends BaseRecordComponent<any> {
} }
}); });
this.tableColumn.push({ this.tableColumn.push({
name: '培训层级', key: "level", render: (data) => { name: '培训层级', key: "level", render: (data) => {
if (data.level) { if (data.level) {
return this.$store.getters.prevention_training_level_map[data.level] return this.$store.getters.prevention_training_level_map[data.level]
} }
@ -354,6 +371,28 @@ export default class TrainRecords extends BaseRecordComponent<any> {
} }
this.buildSubForm() this.buildSubForm()
} }
//
this.durationChange(data, item);
//
this.scoreFormat(data, item);
}
/**
* 培训时长格式化保留一位小数
* @param data
* @param item
*/
public durationChange(data: any, item: any) {
if (item && item.key === 'duration') {
this.updateParams.duration = null;
this.$set(this.updateParams, item.key, +data.toFixed(1))
}
}
public scoreFormat(data: any, item: any) {
if (item && item.key === 'score') {
this.updateParams.score = null;
this.$set(this.subUpdateParams, item.key, +data.toFixed(2))
}
} }
public callback(data, type) { public callback(data, type) {
@ -397,6 +436,7 @@ export default class TrainRecords extends BaseRecordComponent<any> {
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
} as any; } as any;
this.getTableData()
} }
public showUpdateModel(id) { public showUpdateModel(id) {
@ -422,7 +462,7 @@ export default class TrainRecords extends BaseRecordComponent<any> {
this.toggleAll() this.toggleAll()
} else { } else {
this.tableData.datas.forEach((item, index) => { this.tableData.datas.forEach((item, index) => {
const find = this.selectData.find((data: any) => data.userId === item.userId); const find = this.selectData.find((data: any) => data.id === item.id);
if (!find) { if (!find) {
(this.$refs.multipleTable as any).toggleRowSelection(item); (this.$refs.multipleTable as any).toggleRowSelection(item);
} }
@ -471,9 +511,9 @@ export default class TrainRecords extends BaseRecordComponent<any> {
public subCallback(data) { public subCallback(data) {
if (data.value === "add") { if (data.value === "add") {
this.subIsReadonly = false this.subIsReadonly = false
this.buildSubForm()
this.subUpdateParams = {} as any; this.subUpdateParams = {} as any;
this.subShowUpdate = true this.subShowUpdate = true
this.buildSubForm()
} else if (data.value === "cancel") { } else if (data.value === "cancel") {
this.showUpdate = false this.showUpdate = false
} else if (data && data.value.indexOf("save") >= 0) { } else if (data && data.value.indexOf("save") >= 0) {
@ -530,11 +570,11 @@ export default class TrainRecords extends BaseRecordComponent<any> {
public showSubModal(row, isReadonly) { public showSubModal(row, isReadonly) {
if (isReadonly) { if (isReadonly) {
this.subIsReadonly = true this.subIsReadonly = true
this.subUpdateParams = row this.subUpdateParams = JSON.parse(JSON.stringify(row))
this.subUpdateParams.examStatusName = row.examStatus === 1 ? '已参加' : '未参加' this.subUpdateParams.examStatusName = row.examStatus === 1 ? '已参加' : '未参加'
} else { } else {
this.subIsReadonly = false this.subIsReadonly = false
this.subUpdateParams = row this.subUpdateParams = JSON.parse(JSON.stringify(row))
} }
this.subShowUpdate = true this.subShowUpdate = true
this.buildSubForm() this.buildSubForm()
@ -542,7 +582,6 @@ export default class TrainRecords extends BaseRecordComponent<any> {
// //
public deleteSubData(indexs) { public deleteSubData(indexs) {
this.$confirm('确认删除所选数据', '确认数据', { this.$confirm('确认删除所选数据', '确认数据', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',