diff --git a/src/assets/images/4.png b/src/assets/images/4.png
new file mode 100644
index 0000000..1bd32d9
Binary files /dev/null and b/src/assets/images/4.png differ
diff --git a/src/assets/images/4.jpg b/src/assets/images/LS.jpg
similarity index 100%
rename from src/assets/images/4.jpg
rename to src/assets/images/LS.jpg
diff --git a/src/components/analEvaluation.component.vue b/src/components/analEvaluation.component.vue
index 0ff10d6..79f0ca0 100644
--- a/src/components/analEvaluation.component.vue
+++ b/src/components/analEvaluation.component.vue
@@ -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 MeasureComponent from '@/components/measure.component.vue'
import moment from 'moment';
+import { Message } from 'element-ui';
@Component({
components: {
@@ -1110,6 +1111,8 @@ export default class AnalEvaluationComponent extends Vue {
if (data.value === "cancel") {
this.visible = false;
} else if (data.value === "store") {
+
+
let vaildParams = true
if ((this.$refs.basicForm as any).vaildParams() === false) {
//基本信息
@@ -1124,6 +1127,12 @@ export default class AnalEvaluationComponent extends Vue {
vaildParams = false
}
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))
// this.analysisUpdateParams.measures = this.currentMeasureData.datas
//整理数据
@@ -1153,7 +1162,7 @@ export default class AnalEvaluationComponent extends Vue {
}
}
- //整理数据
+
public collationAnalysisDataMethod() {
this.analysisUpdateParams.measuresNum = this.analysisUpdateParams.measures.length;
this.analysisUpdateParams.seriousResult = this.analysisUpdateParams.seriousResult.join(",");
diff --git a/src/components/draw.component.vue b/src/components/draw.component.vue
index ad3053e..bcdbecd 100644
--- a/src/components/draw.component.vue
+++ b/src/components/draw.component.vue
@@ -11,7 +11,7 @@
-
+
{
- return [118.751353,31.969568]
+ return [119.592977,34.523847]
}
})
center:number[]
diff --git a/src/components/measure.component.vue b/src/components/measure.component.vue
index 575a7f1..e7c8a8b 100644
--- a/src/components/measure.component.vue
+++ b/src/components/measure.component.vue
@@ -34,8 +34,8 @@
+ :data.sync="taskUpdataParams" :actions="taskIsReadonly ? [] : taskActions" :full-btn="true"
+ btnPosition="center" @actionCallback="taskCallback" @change="taskSelectChange">
@@ -231,6 +231,7 @@ export default class MeasureComponent extends Vue {
width: "calc(50% - 20px)",
require: true,
showError: false,
+ min: 1,
// labelWidth:"130px"
}, {
key: "reviewCycleUnit",
@@ -274,19 +275,26 @@ export default class MeasureComponent extends Vue {
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 = [{
name: "添加",
value: "fourSubAdd",
@@ -328,6 +336,7 @@ export default class MeasureComponent extends Vue {
// }
this.measuresUpdateForm()
this.taskUpdateForm()
+ this.buildActions()
}
@PropSync("tabledata", {
@@ -335,10 +344,27 @@ export default class MeasureComponent extends Vue {
})
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() {
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.taskUpdateForm()
+ this.buildTaskAction()
}
//排查任务 --- 包保对应项
@@ -501,6 +528,7 @@ export default class MeasureComponent extends Vue {
}
this.taskUpdateForm();
this.showSubUpdate = true;
+ this.buildTaskAction()
}
public deleteTask(row) {
diff --git a/src/global.d.ts b/src/global.d.ts
index 105d56e..3f000bf 100644
--- a/src/global.d.ts
+++ b/src/global.d.ts
@@ -2,4 +2,5 @@
declare module 'common/notFound';
declare module 'common/index';
declare module 'common/layout';
+declare module 'common/login';
declare module 'file-saver'
\ No newline at end of file
diff --git a/src/router/index.ts b/src/router/index.ts
index 5900e81..f2e508b 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -2,6 +2,7 @@ import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'
import pageNoFoundComponent from 'common/notFound'
import indexComponent from 'common/index'
+import LoginComponent from 'common/login'
import LayoutComponent from "common/layout"
import HomeComponent from '@/views/home/home.component.vue'
import BlankComponent from "@/views/blank.component.vue"
@@ -316,6 +317,11 @@ const routes: Array
= [
name: 'index',
component:indexComponent
},
+ {
+ path: '/login',
+ name: 'login',
+ component:LoginComponent
+ },
{
path: '*',
name: '404',
diff --git a/src/service/emergencyCard.service.ts b/src/service/emergencyCard.service.ts
index 724f516..bd132d9 100644
--- a/src/service/emergencyCard.service.ts
+++ b/src/service/emergencyCard.service.ts
@@ -8,7 +8,7 @@ export default class EmergencyCardService extends BaseService{
// 查询列表
public selectByPage(params: any):Promise>>{
const url = this.prefix.prevention+'/card/handle/getList';
- return this.post(url,params)
+ return this.get(url,params,true)
}
// 批量删除
public deleteByIds(params,showLoading?):Promise>>{
diff --git a/src/service/programme.service.ts b/src/service/programme.service.ts
index 35f932d..332adad 100644
--- a/src/service/programme.service.ts
+++ b/src/service/programme.service.ts
@@ -43,4 +43,10 @@ export default class ProgrammeService extends BaseService{
const url = this.prefix.file+'/getSysFiles';
return this.get(url,params,false)
}
+
+ //获取适用年度
+ public getSuitListData(params:any):Promise>>{
+ const url = this.prefix.prevention+'/process/plan/suitList';
+ return this.get(url,params)
+ }
}
\ No newline at end of file
diff --git a/src/service/rewardsRecord.service.ts b/src/service/rewardsRecord.service.ts
index 478b132..0a03f90 100644
--- a/src/service/rewardsRecord.service.ts
+++ b/src/service/rewardsRecord.service.ts
@@ -8,7 +8,7 @@ export default class RewardsRecordService extends BaseService{
// 查询列表
public selectByPage(params: any):Promise>>{
const url = this.prefix.prevention+'/incentive/record/getList';
- return this.post(url,params)
+ return this.get(url,params,true)
}
// 批量删除
public deleteByIds(params,showLoading?):Promise>>{
diff --git a/src/service/riskCard.service.ts b/src/service/riskCard.service.ts
index 674a293..d7177a4 100644
--- a/src/service/riskCard.service.ts
+++ b/src/service/riskCard.service.ts
@@ -8,7 +8,7 @@ export default class RiskCardService extends BaseService{
// 查询列表
public selectByPage(params: any):Promise>>{
const url = this.prefix.prevention+'/card/notify/getList';
- return this.post(url,params)
+ return this.get(url,params,true)
}
// 批量删除
public deleteByIds(params,showLoading?):Promise>>{
diff --git a/src/service/safeCard.service.ts b/src/service/safeCard.service.ts
index c1e51af..c9e3d1b 100644
--- a/src/service/safeCard.service.ts
+++ b/src/service/safeCard.service.ts
@@ -8,7 +8,7 @@ export default class SafeCardService extends BaseService{
// 查询列表
public selectByPage(params: any):Promise>>{
const url = this.prefix.prevention+'/card/promise/getList';
- return this.post(url,params)
+ return this.get(url,params,true)
}
// 批量删除
public deleteByIds(params,showLoading?):Promise>>{
diff --git a/src/service/unit.service.ts b/src/service/unit.service.ts
index 83884b6..c327016 100644
--- a/src/service/unit.service.ts
+++ b/src/service/unit.service.ts
@@ -36,6 +36,12 @@ export default class UnitService extends BaseService{
return this.post(url,params,{},showLoading)
}
+ //获取单元详情
+ public getUnitDetail(params):Promise>>{
+ const url = this.prefix.prevention+'/risk/unit/repairList';
+ return this.get(url,params)
+ }
+
// 新增或更新
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise>>{
diff --git a/src/service/work.service.ts b/src/service/work.service.ts
index ee206d6..561af32 100644
--- a/src/service/work.service.ts
+++ b/src/service/work.service.ts
@@ -7,7 +7,7 @@ export default class WorkService extends BaseService{
}
public selectByPage(params: any):Promise>>{
const url = this.prefix.prevention+'/job/inventory/getList';
- return this.post(url,params,{},true)
+ return this.get(url,params,true)
}
public deleteByIds(params):Promise>>{
const url = this.prefix.prevention+'/job/inventory';
diff --git a/src/views/common.component.scss b/src/views/common.component.scss
index 0d1e05d..a1d2ca5 100644
--- a/src/views/common.component.scss
+++ b/src/views/common.component.scss
@@ -195,7 +195,7 @@
color: #F56C6C;
margin-left: -43px;
margin-bottom: 20px;
- margin-top: -20px;
+ margin-top: -10px;
font-size: 20px;
scale:0.5;
}
\ No newline at end of file
diff --git a/src/views/hiddenDanger/manager.component.vue b/src/views/hiddenDanger/manager.component.vue
index 8e123d3..9f99c45 100644
--- a/src/views/hiddenDanger/manager.component.vue
+++ b/src/views/hiddenDanger/manager.component.vue
@@ -697,7 +697,7 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent 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: "150", render: (data) => this.$store.getters.prevention_danger_resource_map[data.source] });
this.tableColumn.push({ name: '上报人', width: "100", key: "reportUserName", render: (data) => data.reportUserName || "--" });
@@ -883,6 +883,7 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent
+
+ :full-btn="false" @change="callback" btn-position="end">
-
-
-
@@ -19,96 +19,99 @@
-
+
+ :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">
查看
- 修改
+ 修改
删除
-
-
-
-
+
+
-
+
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
- 取消
- 确定
-
+
+
+
+
+
+
+ 取消
+ 确定
+
\ No newline at end of file
diff --git a/src/views/hiddenDanger/rules/rules.component.vue b/src/views/hiddenDanger/rules/rules.component.vue
index 8a07cf3..51680dc 100644
--- a/src/views/hiddenDanger/rules/rules.component.vue
+++ b/src/views/hiddenDanger/rules/rules.component.vue
@@ -12,7 +12,7 @@ import RuleService from '@/service/rule.service';
import { number } from 'echarts';
@Component({
template,
- components:{
+ components: {
FormComponent,
TableComponent,
DrawComponent,
@@ -28,45 +28,45 @@ export default class RulesComponent extends BaseRecordComponent {
public isManager = false;
public formActions = [{
- name:"查询",
- value:"search",
- icon:"el-icon-search",
- type:"primary"
- },{
- name:"清空",
- icon:"el-icon-tickets",
- value:"reset"
+ name: "查询",
+ value: "search",
+ icon: "el-icon-search",
+ type: "primary"
+ }, {
+ name: "清空",
+ icon: "el-icon-tickets",
+ value: "reset"
}];
public tableActions = [{
- name:"添加",
- value:"add",
- icon:"el-icon-plus",
- type:"primary"
- },{
- name:"批量删除",
- value:"delete",
- plain:true,
- icon:"el-icon-delete",
- type:"danger"
+ name: "添加",
+ value: "add",
+ icon: "el-icon-plus",
+ type: "primary"
+ }, {
+ name: "批量删除",
+ value: "delete",
+ plain: true,
+ icon: "el-icon-delete",
+ type: "danger"
}];
public footerActions = [{
- name:"选择全部",
- value:"selectAll",
- type:"primary"
- },{
- name:"反向选择",
- value:"reverse"
+ name: "选择全部",
+ value: "selectAll",
+ type: "primary"
+ }, {
+ name: "反向选择",
+ value: "reverse"
}];
- public formOptions:FormOption[] = [{
- name:"检查项目",
- key:"name",
- type:"text",
+ public formOptions: FormOption[] = [{
+ name: "检查项目",
+ key: "name",
+ type: "text",
}];
public showUpdate = false;
public currentId = -1;
- public updateParams = {} as any;
- public updateOptions:FormOption[] = [];
+ public updateParams = {} as any;
+ public updateOptions: FormOption[] = [];
public showDraw = false;
@@ -74,184 +74,201 @@ export default class RulesComponent extends BaseRecordComponent {
public drawModel = "list";
- public updateActions = [{
- name:"取消",
- value:"cancel"
- },{
- name:"保存并继续添加",
- value:"saveAndContinue",
- type:"primary"
- },{
- name:"保存",
- value:"save",
- type:"primary"
- }];
+ public updateActions = [] as any;
public selectData = [];
-
- created(){
+
+ created() {
}
- public getTableCallback(){
+ public getTableCallback() {
this.updateOptions = [{
- name:"检查标准编号",
- key:"number",
- type:"text",
- width:"calc(50% - 20px)",
- require:true,
- showError:false,
- disable:true,
- },{
- name:"检查项目",
- key:"name",
- type:"text",
- width:"calc(50% - 20px)",
- require:true,
- showError:false,
- },{
- name:"检查内容",
- key:"content",
- type:"textarea",
- width:"100%",
- require:true,
- showError:false,
- },{
- name:"检查依据",
- key:"reason",
- type:"textarea",
- width:"100%",
- require:true,
- showError:false,
- },{
- name:"类型",
- key:"type",
- format:"typeName",
- type:"select",
- width:"100%",
- require:true,
- datas:this.$store.state.prevention_dangrous_type
+ name: "检查标准编号",
+ key: "number",
+ type: "text",
+ width: "calc(50% - 20px)",
+ require: true,
+ showError: false,
+ disable: true,
+ }, {
+ name: "检查项目",
+ key: "name",
+ type: "text",
+ width: "calc(50% - 20px)",
+ require: true,
+ showError: false,
+ }, {
+ name: "检查内容",
+ key: "content",
+ type: "textarea",
+ width: "100%",
+ require: true,
+ showError: false,
+ }, {
+ name: "检查依据",
+ key: "reason",
+ type: "textarea",
+ width: "100%",
+ require: true,
+ showError: false,
+ }, {
+ name: "类型",
+ key: "type",
+ format: "typeName",
+ type: "select",
+ width: "100%",
+ require: true,
+ 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(){
- this.tableColumn.push({name:'检查项目',key:"name"});
- this.tableColumn.push({name:'检查内容',key:"content",showTip:true});
- this.tableColumn.push({name:'检查依据',key:"reason",showTip:true});
- this.tableColumn.push({name:'分类',key:"type",render:(data)=>{
- return this.$store.getters.prevention_dangrous_type_map[data.type]
- }});
+ public buildTable() {
+ this.tableColumn.push({ name: '检查项目', key: "name" });
+ this.tableColumn.push({ name: '检查内容', key: "content", showTip: true });
+ this.tableColumn.push({ name: '检查依据', key: "reason", showTip: true });
+ this.tableColumn.push({
+ 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?){
- if(type){
+ public callback(data, type?) {
+ if (type) {
this.params[type] = data;
this.getTableData();
return
}
// 查询
- if(data && data.value==="search"){
+ if (data && data.value === "search") {
this.getTableData()
- // 重置
- }else if(data && data.value === "reset"){
+ // 重置
+ } else if (data && data.value === "reset") {
this.reset()
- // 反选
- }else if(data && data.value === "reverse"){
+ // 反选
+ } else if (data && data.value === "reverse") {
this.toggleAll()
- // 全选
- }else if(data && data.value === "selectAll"){
+ // 全选
+ } else if (data && data.value === "selectAll") {
this.selectAll()
- }else if(data && data.value === "add"){
+ } else if (data && data.value === "add") {
this.showUpdateModel()
- }else if(data && data.value === "delete"){
- this.deleteData(this.selectData.map((item:any)=>item.id));
+ } else if (data && data.value === "delete") {
+ this.deleteData(this.selectData.map((item: any) => item.id));
this.clearSelect()
- }else if(data && data.value.indexOf("save")>=0){
- this.doSave(data.value!=="save")
- }else{
+ } else if (data && data.value.indexOf("save") >= 0) {
+ this.doSave(data.value !== "save")
+ } else {
this.handleClose();
}
}
// 重置数据
- public reset(){
+ public reset() {
this.params = {
- name:"",
- pageNum:1,
- pageSize:20,
+ name: "",
+ pageNum: 1,
+ pageSize: 20,
} as any;
}
-
- public doSave(goOn?){
- this.tableService.addOrUpdate(this.updateParams,this.currentId===-1).then((res=>{
- this.$message.success(this.currentId===-1?"新增成功!":"编辑成功");
+ /**
+ * 数据保存
+ * @param goOn
+ */
+ 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.updateParams = {number:null} as any;
- if(goOn){
- this.tableService.getNumber().then(res=>{
+ this.updateParams = { number: null } as any;
+ if (goOn) {
+ this.tableService.getNumber().then(res => {
this.updateParams.number = res.data
})
}
this.getTableData();
-
}))
}
- public showUpdateModel(row?,isRead?){
-
- this.updateParams = Object.assign({number:null})
+ public showUpdateModel(row?, isRead?) {
+ this.updateParams = Object.assign({ number: null })
this.isReadonly = !!isRead;
- if(!row){
+ if (!row) {
this.currentId = -1;
- this.tableService.getNumber().then(res=>{
+ this.tableService.getNumber().then(res => {
this.updateParams.number = res.data
})
- }else{
- this.updateParams = Object.assign({number:null,typeName:this.$store.getters.prevention_dangrous_type_map[row.type]},row)
+ } else {
+ 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.clearSelect();
- this.showUpdate = true
+ this.getTableCallback()
+ this.showUpdate = true;
}
- public clearSelect(){
+ public clearSelect() {
(this.$refs.multipleTable as any).clearSelection();
this.selectData = [];
}
- public handleClose(){
+ public handleClose() {
this.showUpdate = false;
this.clearSelect();
}
public toggleAll() {
-
- this.tableData.datas.forEach((item,index)=>{
+
+ this.tableData.datas.forEach((item, index) => {
(this.$refs.multipleTable as any).toggleRowSelection(item);
})
}
- public selectAll(){
- if(!this.selectData.length){
+ public selectAll() {
+ if (!this.selectData.length) {
this.toggleAll()
- }else{
- this.tableData.datas.forEach((item,index)=>{
- const find = this.selectData.find((data:any)=>data.id === item.id);
- if(!find){
+ } else {
+ this.tableData.datas.forEach((item, index) => {
+ const find = this.selectData.find((data: any) => data.id === item.id);
+ if (!find) {
(this.$refs.multipleTable as any).toggleRowSelection(item);
}
})
}
}
- public handleSelectionChange(data){
+ public handleSelectionChange(data) {
this.selectData = data;
}
}
diff --git a/src/views/hiddenDanger/rules/rulesManager.component.vue b/src/views/hiddenDanger/rules/rulesManager.component.vue
index adf28e2..caa4e70 100644
--- a/src/views/hiddenDanger/rules/rulesManager.component.vue
+++ b/src/views/hiddenDanger/rules/rulesManager.component.vue
@@ -42,6 +42,10 @@ export default class RulesManagerComponent extends BaseRecordComponent {
value:"search",
icon:"el-icon-search",
type:"primary"
+ }, {
+ name: "清空",
+ icon: "el-icon-tickets",
+ value: "reset"
}];
public tableActions = [{
@@ -293,6 +297,10 @@ export default class RulesManagerComponent extends BaseRecordComponent {
}
}),filterMethod:(data,row)=>{
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:"createTime"});
@@ -499,7 +507,10 @@ export default class RulesManagerComponent extends BaseRecordComponent {
this.$message.success(this.currentId===-1?"新增成功!":"编辑成功");
this.getTableData();
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(()=>{
this.updateParams.depts = this.updateParams.depts.map(item=>item.id)
diff --git a/src/views/hiddenDanger/safe/action.component.vue b/src/views/hiddenDanger/safe/action.component.vue
index e2cd102..db1e02a 100644
--- a/src/views/hiddenDanger/safe/action.component.vue
+++ b/src/views/hiddenDanger/safe/action.component.vue
@@ -544,6 +544,7 @@ export default class RulesManagerComponent extends BaseRecordComponent {
pageNum: 1,
pageSize: 20,
} as any;
+ this.getTableData()
}
public getMap(map) {
diff --git a/src/views/reward/rewardsRecord/rewardsRecord.component.html b/src/views/reward/rewardsRecord/rewardsRecord.component.html
index f1e2c0f..c4e2496 100644
--- a/src/views/reward/rewardsRecord/rewardsRecord.component.html
+++ b/src/views/reward/rewardsRecord/rewardsRecord.component.html
@@ -2,7 +2,7 @@
+ :full-btn="false" @change="callback" btn-position="end">
{
datas: this.$store.state.userList
}, {
name: "岗位",
+ type: "select",
key: "postName",
+ datas: this.$store.state.postList,
+ width: "270px",
+ }, {
+ name: "职务",
type: "text",
+ key: "dutyName",
}];
public subActions = [{
@@ -344,6 +350,9 @@ export default class RewardsRecord extends BaseRecordComponent {
}
// 分页数据
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.tableData = res.data as any;
})
diff --git a/src/views/risk/area/area.component.vue b/src/views/risk/area/area.component.vue
index 9b87721..e6ba201 100644
--- a/src/views/risk/area/area.component.vue
+++ b/src/views/risk/area/area.component.vue
@@ -111,7 +111,7 @@ export default class AreaManagerComponent extends BaseRecordComponent {
created() {
-
+//
}
public buildFormOptions() {
@@ -388,10 +388,9 @@ export default class AreaManagerComponent extends BaseRecordComponent {
pageNum: 1,
pageSize: 20,
} as any;
+ this.getTableData()
}
-
-
public showUpdateModel(data?, isRead?) {
if (!data) {
this.currentId = -1;
@@ -399,7 +398,6 @@ export default class AreaManagerComponent extends BaseRecordComponent {
} else {
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.isReadonly = !!isRead;
this.buildFormOptions();
this.showUpdate = true
diff --git a/src/views/risk/areaUnit.component.html b/src/views/risk/areaUnit.component.html
index d5b3cb7..afab524 100644
--- a/src/views/risk/areaUnit.component.html
+++ b/src/views/risk/areaUnit.component.html
@@ -1,13 +1,13 @@
-
+
-
+
@@ -54,12 +54,9 @@
:data.sync="updateParams" @actionCallback="callback" :actions="updateActions" :full-btn="true"
@change="change" btn-position="center">
*注:安全风险分析对象编码即危险化学品登记综合服务系统中的危险源编码
-
-
停用/检修记录
-
+ :showFooter="false" style="margin-bottom: 20px;height: 200px;">
diff --git a/src/views/risk/assessment/areaAnal/areaAnal.component.html b/src/views/risk/assessment/areaAnal/areaAnal.component.html
index f91dc87..f1d1f9c 100644
--- a/src/views/risk/assessment/areaAnal/areaAnal.component.html
+++ b/src/views/risk/assessment/areaAnal/areaAnal.component.html
@@ -38,7 +38,7 @@
-
+
@@ -91,11 +91,7 @@
{{scope.row.type4}}
-
-
-
-
@@ -108,44 +104,4 @@
-
-
\ No newline at end of file
diff --git a/src/views/risk/assessment/areaAnal/areaAnal.component.vue b/src/views/risk/assessment/areaAnal/areaAnal.component.vue
index e7f78df..1dcb7eb 100644
--- a/src/views/risk/assessment/areaAnal/areaAnal.component.vue
+++ b/src/views/risk/assessment/areaAnal/areaAnal.component.vue
@@ -95,7 +95,7 @@ export default class AreaAnalComponent extends BaseRecordComponent {
});
this.tableColumn.push({
name: '区域固有风险', render: (data) => {
- return "" + (data.analRiskLevel ? (this.$store.getters.prevention_risk_level_map[data.analRiskLevel] + this.numberForMat[data.analRiskLevel]) : '') + ""
+ return "" + (data.analRiskLevel ? (this.$store.getters.prevention_risk_level_map[data.analRiskLevel] + this.numberForMat[data.analRiskLevel]) : '待评估') + ""
}
});
this.tableColumn.push({
@@ -144,11 +144,18 @@ export default class AreaAnalComponent extends BaseRecordComponent {
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.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';
const lData = JSON.parse(row.analLikelihoodContent || "[]");
const sData = JSON.parse(row.analSeverityContent || "[]");
@@ -222,7 +229,30 @@ export default class AreaAnalComponent extends BaseRecordComponent {
}
if (row[column.property] !== '/') {
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) {
@@ -274,7 +304,9 @@ export default class AreaAnalComponent extends BaseRecordComponent {
this.popTitle = 'S';
this.stepsActive = 2;
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();
} else {
this.currentRow.analSeverityContent = content;
@@ -304,7 +336,7 @@ export default class AreaAnalComponent extends BaseRecordComponent {
//单选
public selectRadioData(data) {
- console.log('data', data);
+ // console.log('data', data);
}
//点击L 步骤
diff --git a/src/views/risk/assessment/device/deviceAnal.component.vue b/src/views/risk/assessment/device/deviceAnal.component.vue
index 0425e31..face15a 100644
--- a/src/views/risk/assessment/device/deviceAnal.component.vue
+++ b/src/views/risk/assessment/device/deviceAnal.component.vue
@@ -159,7 +159,7 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent
public buildUpdateForm() {
this.updateOptions = [{
- name: "区域名称",
+ name: "选择区域",
key: "areaId",
format: "areaName",
type: "select",
@@ -169,7 +169,7 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent
datas: this.areaList,
disable: !this.updateParams.status || this.updateParams.status === 1 ? false : true
}, {
- name: "单元名称",
+ name: "选择单元",
key: "unitId",
format: "unitName",
type: "select",
@@ -236,7 +236,8 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent
width: "calc(50% - 20px)",
require: true,
showError: false,
- format: "yyyy-MM-dd"
+ format: "yyyy-MM-dd",
+ disable: true,
}, {
name: "区域固有风险等级",
key: "analRiskLevel",
diff --git a/src/views/risk/assessment/work/work.component.vue b/src/views/risk/assessment/work/work.component.vue
index 2d78b88..7cf91bf 100644
--- a/src/views/risk/assessment/work/work.component.vue
+++ b/src/views/risk/assessment/work/work.component.vue
@@ -120,7 +120,7 @@ export default class WorkManagerComponent extends BaseRecordComponent {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary",
- hide:this.updateParams.id
+ hide: this.updateParams.id
}, {
name: "保存",
value: "save",
@@ -137,7 +137,7 @@ export default class WorkManagerComponent extends BaseRecordComponent {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary",
- hide:this.stepUpdateParams.index
+ hide: this.stepUpdateParams.index
}, {
name: "保存",
value: "save",
@@ -470,6 +470,7 @@ export default class WorkManagerComponent extends BaseRecordComponent {
}
this.showSubUpdate = true;
this.subUpdateActionsForm();
+ this.buildUpdateForm();
}
public doSubDelete(indexs) {
@@ -486,6 +487,10 @@ export default class WorkManagerComponent extends BaseRecordComponent {
public doSave(goOn?) {
+ if (this.updateParams.steps.length === 0) {
+ this.$message.warning("请您至少添加一条作业步骤!");
+ return
+ }
// 如果是新增步骤
if (this.showSubUpdate) {
// 新增
@@ -598,7 +603,7 @@ export default class WorkManagerComponent extends BaseRecordComponent {
this.toggleAll()
} else {
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) {
(this.$refs.multipleTable as any).toggleRowSelection(item);
}
diff --git a/src/views/risk/assessment/work/workAnal.component.vue b/src/views/risk/assessment/work/workAnal.component.vue
index 44d8e5a..9695d3c 100644
--- a/src/views/risk/assessment/work/workAnal.component.vue
+++ b/src/views/risk/assessment/work/workAnal.component.vue
@@ -131,7 +131,11 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent {
name: "单元名称",
key: "unitName",
type: "text",
- },];
+ }, {
+ name: "作业活动",
+ key: "jobInventoryName",
+ type: "text",
+ }];
public showUpdate = false;
@@ -165,7 +169,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent {
console.log(this.updateParams.id && this.updateParams.status !== 1,);
this.updateOptions = [{
- name: "区域名称",
+ name: "选择区域",
key: "areaId",
format: "areaName",
type: "select",
@@ -175,7 +179,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent {
datas: this.areaList,
disable: !this.updateParams.status || this.updateParams.status === 1 ? false : true
}, {
- name: "单元名称",
+ name: "选择单元",
key: "unitId",
format: "unitName",
type: "select",
@@ -240,7 +244,8 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent {
width: "calc(50% - 20px)",
require: true,
showError: false,
- format: "yyyy-MM-dd"
+ format: "yyyy-MM-dd",
+ disable:true,
}, {
name: "区域固有风险等级",
key: "analRiskLevel",
@@ -502,7 +507,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent {
this.subTableColumn.push({ name: '步骤名称', key: "name" });
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: "hazardAnalysis", width: "200px" });
+ this.subTableColumn.push({ name: '危害分析', key: "hazardAnalysis", width: "200px", showTip: true, });
this.subTableColumn.push({
name: '最严重后果', key: "seriousResult", width: "100px", render: (data) => {
if (data.seriousResult) {
@@ -647,6 +652,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent {
pageNum: 1,
pageSize: 20,
} as any;
+ this.getTableData()
}
// 分页数据
diff --git a/src/views/risk/unit/unit.component.vue b/src/views/risk/unit/unit.component.vue
index ff40661..00d95f1 100644
--- a/src/views/risk/unit/unit.component.vue
+++ b/src/views/risk/unit/unit.component.vue
@@ -379,9 +379,10 @@ export default class UnitManagerComponent extends BaseRecordComponent {
this.repairTableColumn.push({ name: "登记时间", key: "registerTime" });
}
- public getAreaList() {
- this.areaService.selectByPage({ pageSize: 10 }).then((res: any) => {
- this.areaList = res.data.datas.map(item => {
+
+ public getAreaList(){
+ this.areaService.selectByPage({pageSize:1000}).then((res:any)=>{
+ this.areaList = res.data.datas.map(item=>{
this.areaNoMap[item.id] = item.number;
return {
name: item.name,
diff --git a/src/views/threecards/riskCard.component.vue b/src/views/threecards/riskCard.component.vue
index 0f97a9c..891be6b 100644
--- a/src/views/threecards/riskCard.component.vue
+++ b/src/views/threecards/riskCard.component.vue
@@ -58,12 +58,12 @@ export default class RiskCard extends BaseRecordComponent {
public showUpdate = false;
public setpsOptions = [] as any;
-
+
public showFileModal = false;
public showFileList = [] as any;
- public labelWidth='130px'
+ public labelWidth = '130px'
public formActions = [{
name: "查询",
@@ -138,7 +138,7 @@ export default class RiskCard extends BaseRecordComponent {
width: "calc(50% - 20px)",
showError: false,
disable: true,
- labelWidth:"130px"
+ labelWidth: "130px"
},
{
name: "区域名称",
@@ -185,7 +185,7 @@ export default class RiskCard extends BaseRecordComponent {
require: true,
width: "100%",
showError: false,
- labelWidth:'130px'
+ labelWidth: '130px'
},
{
name: "风险等级",
@@ -327,7 +327,7 @@ export default class RiskCard extends BaseRecordComponent {
this.tableColumn.push({ name: '岗位名称', key: "postName", });
this.tableColumn.push({ name: '主要危险有害因素', key: "harmfulFactors", });
this.tableColumn.push({
- name: '风险等级', key: "riskLevel",width:"150px", render: (data) => {
+ name: '风险等级', key: "riskLevel", width: "150px", render: (data) => {
if (data.riskLevel) {
return "" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '') + ""
}
@@ -398,6 +398,7 @@ export default class RiskCard extends BaseRecordComponent {
pageNum: 1,
pageSize: 20,
} as any;
+ this.getTableData()
}
public showUpdateModel(id) {
@@ -498,13 +499,8 @@ export default class RiskCard extends BaseRecordComponent {
})
}
- public showModal(row, isReadonly) {
- if (isReadonly) {
- this.subIsReadonly = true
-
- } else {
- this.subIsReadonly = false
- }
+ public showModal(row, isReadonly = false) {
+ this.subIsReadonly = isReadonly
this.tableService.getListDetail({ id: row.id }).then((res: any) => {
if (res.code === 200) {
@@ -512,6 +508,7 @@ export default class RiskCard extends BaseRecordComponent {
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(",")
}, res.data)
+ this.subUpdateParams.postCode = +res.data.postCode
if (res.data.resourceId) {
this.tableService.getFileUrls({ ids: res.data.resourceId.split(",") }).then((files: any) => {
this.fileList = files.data.map(item => {
diff --git a/src/views/threecards/safeCard.component.vue b/src/views/threecards/safeCard.component.vue
index cc89b46..1d65bf5 100644
--- a/src/views/threecards/safeCard.component.vue
+++ b/src/views/threecards/safeCard.component.vue
@@ -99,9 +99,8 @@ export default class SafeCard extends BaseRecordComponent {
public formOptions: FormOption[] = [{
name: "区域名称",
- key: "areaId",
- type: "select",
- datas: this.areaList
+ key: "areaName",
+ type: "text",
}, {
name: "承诺人",
key: "promiserId",
diff --git a/src/views/workprogress/common.component.html b/src/views/workprogress/common.component.html
index dbbcd46..3bd6f16 100644
--- a/src/views/workprogress/common.component.html
+++ b/src/views/workprogress/common.component.html
@@ -83,7 +83,7 @@
:title="subIsReadonly?'详情':subUpdateParams.index||subUpdateParams.id ?'编辑': '新增'" :visible.sync="subShowUpdate"
width="952px">
diff --git a/src/views/workprogress/leader.component.vue b/src/views/workprogress/leader.component.vue
index 1c3b522..4d486d6 100644
--- a/src/views/workprogress/leader.component.vue
+++ b/src/views/workprogress/leader.component.vue
@@ -103,12 +103,14 @@ export default class LeadershipStructure extends BaseRecordComponent {
type: "text",
}, {
name: "负责人",
- key: "chargeUserName",
- type: "text",
+ key: "chargeUserId",
+ type: "select",
+ datas: this.$store.state.userList,
}, {
name: "成立时间",
key: "establishTime",
type: "date",
+ format: "yyyy-MM-dd"
}];
public subActions = [{
@@ -304,8 +306,8 @@ export default class LeadershipStructure extends BaseRecordComponent {
this.subTableColumn.push({ name: '序号', key: "index", });
- this.subTableColumn.push({ name: '姓名', key: "userName",});
- this.subTableColumn.push({ name: '单位', key: "deptName",});
+ this.subTableColumn.push({ name: '姓名', key: "userName", });
+ this.subTableColumn.push({ name: '单位', key: "deptName", });
this.subTableColumn.push({ name: '职务', key: "duty", });
this.subTableColumn.push({ name: '联系方式', key: "phone" });
this.subTableColumn.push({ name: '职责描述', key: "description", width: "250px", showTip: true, });
@@ -366,6 +368,7 @@ export default class LeadershipStructure extends BaseRecordComponent {
pageNum: 1,
pageSize: 20,
} as any;
+ this.getTableData()
}
public doSave(goOn?) {
@@ -394,7 +397,7 @@ export default class LeadershipStructure extends BaseRecordComponent {
} as any
this.showUpdate = !!goOn;
this.getTableData();
-
+ this.fileList = [];
if (goOn === true) {
this.getFormNumber()
}
@@ -461,7 +464,7 @@ export default class LeadershipStructure extends BaseRecordComponent {
}
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) {
@@ -587,10 +590,10 @@ export default class LeadershipStructure extends BaseRecordComponent {
public showSubModal(row, isReadonly) {
if (isReadonly) {
this.subIsReadonly = true
- this.subUpdateParams = row
+ this.subUpdateParams = JSON.parse(JSON.stringify(row))
} else {
this.subIsReadonly = false
- this.subUpdateParams = row
+ this.subUpdateParams = JSON.parse(JSON.stringify(row))
}
this.subShowUpdate = true
this.buildSubForm()
@@ -598,22 +601,27 @@ export default class LeadershipStructure extends BaseRecordComponent {
//删除成员
public deleteSubData(indexs) {
- this.$confirm('确认删除所选数据', '确认数据', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- for (let i = this.updateParams.members.length - 1; i >= 0; i--) {
- if (indexs.includes(i)) {
- this.updateParams.members.splice(i, 1)
+ if (indexs.length === 0) {
+ this.$message.warning("请选择要删除的数据!")
+ } else {
+ this.$confirm('确认删除所选数据', '确认数据', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }).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) => {
- item.index = index + 1;
+ this.updateParams.members.forEach((item, index) => {
+ item.index = index + 1;
+ });
+ this.$message.success("删除成功")
+ }).catch(() => {
+ //
});
- }).catch(() => {
- //
- });
+ }
}
public changes(data, item) {
@@ -622,11 +630,11 @@ export default class LeadershipStructure extends BaseRecordComponent {
//预览附件
- public previewFile(url,file) {
+ public previewFile(url, file) {
if (file.type.indexOf("png") >= 0 || file.type.indexOf("jp") >= 0) {
this.currentUrl = file.url;
this.showFile = true;
- } else{
+ } else {
window.open('http://119.45.186.133:8012/onlinePreview?url=' + encodeURIComponent(Base64.encode(url)), "_blank")
}
}
diff --git a/src/views/workprogress/managementSystem.component.vue b/src/views/workprogress/managementSystem.component.vue
index 940ab7b..e86a9de 100644
--- a/src/views/workprogress/managementSystem.component.vue
+++ b/src/views/workprogress/managementSystem.component.vue
@@ -105,7 +105,7 @@ export default class ManagementSystem extends BaseRecordComponent {
expandLevel: Infinity,
width:"280px"
}, {
- name: "实施日期",
+ name: "发布时间",
key: "publishTime",
type: "date",
format: "yyyy-MM-dd"
@@ -273,12 +273,10 @@ export default class ManagementSystem extends BaseRecordComponent {
});
this.tableColumn.push({
name: '状态', key: "status",width:"80px", render: (data) => {
- if (data.status) {
- if (data.status === 1) {
- return `${'在用'}`
- } else if (data.status === 2) {
- return `${'废弃'}`
- }
+ if (data.status === 1) {
+ return `${'在用'}`
+ } else if (data.status === 0) {
+ return `${'废弃'}`
}
}
});
diff --git a/src/views/workprogress/programme.component.vue b/src/views/workprogress/programme.component.vue
index 567ef0d..ede6747 100644
--- a/src/views/workprogress/programme.component.vue
+++ b/src/views/workprogress/programme.component.vue
@@ -57,7 +57,10 @@ export default class Programme extends BaseRecordComponent {
public fileList = [] as any;
+ public suitList = [] as any;
+
public showFile = false;
+
public currentUrl = null;
public subShowUpdate = false;
@@ -96,7 +99,7 @@ export default class Programme extends BaseRecordComponent {
}];
public formOptions: FormOption[] = [{
- name: "制度名称",
+ name: "方案名称",
key: "name",
type: "text",
}, {
@@ -107,10 +110,10 @@ export default class Programme extends BaseRecordComponent {
expandLevel: Infinity,
width: "280px"
}, {
- name: "实施日期",
- key: "publishTime",
- type: "date",
- format: "yyyy-MM-dd"
+ name: "适用年度",
+ key: "suitYear",
+ type: "select",
+ datas: this.suitList,
}];
public subActions = [{
@@ -259,9 +262,20 @@ export default class Programme extends BaseRecordComponent {
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() {
this.tableColumn.push({ name: '方案名称', key: "name", width: "200px" });
diff --git a/src/views/workprogress/trainRecords.component.vue b/src/views/workprogress/trainRecords.component.vue
index a1de905..272362c 100644
--- a/src/views/workprogress/trainRecords.component.vue
+++ b/src/views/workprogress/trainRecords.component.vue
@@ -114,8 +114,9 @@ export default class TrainRecords extends BaseRecordComponent {
datas: this.typeList
}, {
name: "培训时间",
- key: "analName",
+ key: "startTime",
type: "date",
+ format: "yyyy-MM-dd",
}];
public subActions = [{
@@ -123,21 +124,9 @@ export default class TrainRecords extends BaseRecordComponent {
value: "cancel"
}];
+ public updateActions = [] as any;
-
-
- public updateActions = [{
- name: "取消",
- value: "cancel"
- }, {
- name: "保存并继续添加",
- value: "saveAndContinue",
- type: "primary"
- }, {
- name: "保存",
- value: "save",
- type: "primary"
- }];
+ public subUpdateActions = [] as any;
public updateOptions: FormOption[] = [] as any;
public buildUpdateForm() {
@@ -216,7 +205,19 @@ export default class TrainRecords extends BaseRecordComponent {
showError: false,
},
]
-
+ this.updateActions = [{
+ name: "取消",
+ value: "cancel"
+ }, {
+ name: "保存并继续添加",
+ value: "saveAndContinue",
+ type: "primary",
+ hide: this.updateParams.id
+ }, {
+ name: "保存",
+ value: "save",
+ type: "primary"
+ }];
}
public subUpdateOptions: FormOption[] = []
@@ -271,13 +272,29 @@ export default class TrainRecords extends BaseRecordComponent {
}]
}, {
name: "得分",
- type: "text",
+ type: "number",
key: "score",
require: true,
width: "calc(50% - 20px)",
+ controls: false,
showError: false,
+ max: 100,
+ min: 0,
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 {
public buildTable() {
- this.tableColumn.push({ name: '培训名称', key: "name"});
+ this.tableColumn.push({ name: '培训名称', key: "name" });
this.tableColumn.push({
name: '培训类型', key: "type", render: (data) => {
if (data.type === 1) {
@@ -310,7 +327,7 @@ export default class TrainRecords extends BaseRecordComponent {
}
});
this.tableColumn.push({
- name: '培训层级', key: "level", render: (data) => {
+ name: '培训层级', key: "level", render: (data) => {
if (data.level) {
return this.$store.getters.prevention_training_level_map[data.level]
}
@@ -354,6 +371,28 @@ export default class TrainRecords extends BaseRecordComponent {
}
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) {
@@ -397,6 +436,7 @@ export default class TrainRecords extends BaseRecordComponent {
pageNum: 1,
pageSize: 20,
} as any;
+ this.getTableData()
}
public showUpdateModel(id) {
@@ -422,7 +462,7 @@ export default class TrainRecords extends BaseRecordComponent {
this.toggleAll()
} else {
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) {
(this.$refs.multipleTable as any).toggleRowSelection(item);
}
@@ -471,9 +511,9 @@ export default class TrainRecords extends BaseRecordComponent {
public subCallback(data) {
if (data.value === "add") {
this.subIsReadonly = false
- this.buildSubForm()
this.subUpdateParams = {} as any;
this.subShowUpdate = true
+ this.buildSubForm()
} else if (data.value === "cancel") {
this.showUpdate = false
} else if (data && data.value.indexOf("save") >= 0) {
@@ -530,11 +570,11 @@ export default class TrainRecords extends BaseRecordComponent {
public showSubModal(row, isReadonly) {
if (isReadonly) {
this.subIsReadonly = true
- this.subUpdateParams = row
+ this.subUpdateParams = JSON.parse(JSON.stringify(row))
this.subUpdateParams.examStatusName = row.examStatus === 1 ? '已参加' : '未参加'
} else {
this.subIsReadonly = false
- this.subUpdateParams = row
+ this.subUpdateParams = JSON.parse(JSON.stringify(row))
}
this.subShowUpdate = true
this.buildSubForm()
@@ -542,7 +582,6 @@ export default class TrainRecords extends BaseRecordComponent {
//删除成员
public deleteSubData(indexs) {
-
this.$confirm('确认删除所选数据', '确认数据', {
confirmButtonText: '确定',
cancelButtonText: '取消',