feat:修复隐患积分bug

dev
kongyeqing 2023-09-14 14:22:09 +08:00
parent 1b7a1eaf53
commit f573d9a3ae
30 changed files with 307 additions and 132 deletions

View File

@ -284,6 +284,7 @@ export default class AnalEvaluationComponent extends Vue {
datas: this.$store.state.prevention_serious_result, datas: this.$store.state.prevention_serious_result,
filterable: true, filterable: true,
showError: false, showError: false,
clearable:true,
}, },
{ {
name: "危害分析", name: "危害分析",
@ -304,6 +305,7 @@ export default class AnalEvaluationComponent extends Vue {
datas: this.$store.state.prevention_security_identifier, datas: this.$store.state.prevention_security_identifier,
filterable: true, filterable: true,
showError: false, showError: false,
clearable:true,
}, },
{ {
name: "设置复评时间", name: "设置复评时间",
@ -314,6 +316,11 @@ export default class AnalEvaluationComponent extends Vue {
require: true, require: true,
showError: false, showError: false,
format: "yyyy-MM-dd", format: "yyyy-MM-dd",
pickerOptions: {
disabledDate(time) {
return time.getTime() < moment(new Date()).add(1, 'month').subtract(1, 'day').toDate().getTime();
}
}
}, },
]; ];
} else { } else {
@ -382,6 +389,7 @@ export default class AnalEvaluationComponent extends Vue {
datas: this.$store.state.prevention_serious_result, datas: this.$store.state.prevention_serious_result,
filterable: true, filterable: true,
showError: false, showError: false,
clearable:true,
}, },
{ {
name: "危害分析", name: "危害分析",
@ -402,6 +410,7 @@ export default class AnalEvaluationComponent extends Vue {
datas: this.$store.state.prevention_security_identifier, datas: this.$store.state.prevention_security_identifier,
filterable: true, filterable: true,
showError: false, showError: false,
clearable:true,
}, },
{ {
name: "设置复评时间", name: "设置复评时间",

View File

@ -599,6 +599,17 @@ export default class MeasureComponent extends Vue {
}) })
this.taskUpdataParams.taskItemName = map[data] this.taskUpdataParams.taskItemName = map[data]
} }
//
if (item && item.key === 'reviewCycleUnit') {
const option = this.taskUpdateOptions.find(item => item.key === "startTime") as any;
option.hide = data === 7 ? false : true;
const optionEnd = this.taskUpdateOptions.find(item => item.key === "endTime") as any;
optionEnd.hide = data === 7 ? false : true
if (data !== 7) {
this.taskUpdataParams.startTime = '';
this.taskUpdataParams.endTime = ''
}
}
// //
if (item && item.key === 'executeStartTime') { if (item && item.key === 'executeStartTime') {
const now = moment().format("YYYY-MM-DD HH:mm:ss"); const now = moment().format("YYYY-MM-DD HH:mm:ss");

View File

@ -7,7 +7,7 @@ export default class AreaService extends BaseService<any>{
} }
// 查询列表 // 查询列表
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{ public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/risk/area/analList'; const url = this.prefix.prevention+'/risk/area/list';
return this.get(url,params,true) return this.get(url,params,true)
} }
// 批量删除 // 批量删除

View File

@ -0,0 +1,43 @@
import BaseService from "hbt-common/service/base.service"
import type { AxiosResponse } from 'axios'
import { ActionResult } from "hbt-common/models/actionResult";
export default class AreaAnalService extends BaseService<any>{
constructor(){
super()
}
// 查询列表
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/risk/area/analList';
return this.get(url,params,true)
}
// 批量删除
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/risk/area';
return this.deleteBatch(url,params,{},true)
}
public getAreaNumber():Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/risk/area/number';
return this.get(url,null)
}
public getQrCode(params){
const url = this.prefix.file+'/qrCode/createQrCode';
return this.post(url,params)
}
// 新增或更新
public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/risk/area';
if(add){
return this.post(url,params,{},showLoading)
}else{
return this.put(url,params,{},showLoading)
}
}
public getAnalControls():Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/risk/identifyinventory/getAnalControls';
return this.get(url,null,false)
}
}

View File

@ -84,6 +84,15 @@
height: 39px; height: 39px;
} }
.el-dialog__headerbtn .el-dialog__close {
color: rgb(0 0 0 / 60%);
font-size: 28px;
}
.el-dialog__headerbtn {
right: 34px;
}
.el-tree-node__content:hover, .el-tree-node__content:hover,
.el-upload-list__item:hover { .el-upload-list__item:hover {
background: #e4e8f1; background: #e4e8f1;

View File

@ -145,7 +145,18 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
public getTableCallback() { public getTableCallback() {
this.formOptions = [{ this.formOptions = [
{
name: "隐患分类",
key: "classify",
type: "select",
datas: this.$store.state.prevention_dangrous_type
}, {
name: "隐患来源",
key: "source",
type: "select",
datas: this.$store.state.prevention_danger_resource
}, {
name: "隐患等级", name: "隐患等级",
key: "level", key: "level",
type: "select", type: "select",
@ -156,23 +167,20 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
name: "重大隐患", name: "重大隐患",
value: 2 value: 2
}] }]
}, { },
name: "隐患分类", // {
key: "classify", // name: "",
type: "select", // key: "reformMode",
datas: this.$store.state.prevention_dangrous_type // type: "select",
}, { // datas: [{
name: "整改方式", // name: "",
key: "reformMode", // value: 1
type: "select", // }, {
datas: [{ // name: "",
name: "即查即改", // value: 2
value: 1 // }]
}, { // }
name: "限期整改", ]
value: 2
}]
}]
this.updateOptions = [{ this.updateOptions = [{
name: "隐患编号", name: "隐患编号",
@ -697,7 +705,7 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
reformModeName: this.reformModeMap[row.reformMode], reformModeName: this.reformModeMap[row.reformMode],
}, row); }, row);
this.updateParams.majorHazard = +this.updateParams.majorHazard this.updateParams.majorHazard = +this.updateParams.majorHazard
this.updateParams.majorHazardName = !this.updateParams.majorHazard? '不涉及' : this.$store.getters.prevention_risk_source_map[this.updateParams.majorHazard] this.updateParams.majorHazardName = !this.updateParams.majorHazard ? '不涉及' : this.$store.getters.prevention_risk_source_map[this.updateParams.majorHazard]
this.getTableCallback() this.getTableCallback()
// url // url
if (row.resourceId) { if (row.resourceId) {

View File

@ -266,7 +266,7 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
key: "description", key: "description",
require: true, require: true,
showError: false, showError: false,
type: "text" type: "textarea"
}, { }, {
name: "隐患级别", name: "隐患级别",
key: "level", key: "level",
@ -553,7 +553,7 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
key: "realConfirmTime", key: "realConfirmTime",
format: "yyyy-MM-dd HH:mm", format: "yyyy-MM-dd HH:mm",
showError: false, showError: false,
disable:true, disable: true,
pickerOptions: this.getPickerOptions(this.updateParams.createTime), pickerOptions: this.getPickerOptions(this.updateParams.createTime),
}] }]
this.updateOptions3 = [{ this.updateOptions3 = [{
@ -1066,7 +1066,7 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
this.updateParams.verifyResourceId = this.photoList2.map(item => item.id).join(",") this.updateParams.verifyResourceId = this.photoList2.map(item => item.id).join(",")
this.updateParams.verifyResourceName = this.photoList2.map(item => item.name).join(",") this.updateParams.verifyResourceName = this.photoList2.map(item => item.name).join(",")
this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id).then(res => { this.tableService.addOrUpdate(this.updateParams, !this.updateParams.id).then(res => {
this.$message.success(!this.updateParams.id ? "新增成功" : "提交成功"); this.$message.success(!this.updateParams.id ? (isSubmit ? "提交成功" : '保存草稿成功') : "提交成功");
if (!preStatus) { if (!preStatus) {
if (isSubmit) { if (isSubmit) {
this.startWorkFlow(this.updateParams.id || res.data, [this.updateParams.reformUserId]) this.startWorkFlow(this.updateParams.id || res.data, [this.updateParams.reformUserId])

View File

@ -182,7 +182,8 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
require: true, require: true,
showError: false, showError: false,
datas: this.areaList datas: this.areaList,
clearable:true,
}, { }, {
name: "适用单元", name: "适用单元",
key: "units", key: "units",
@ -191,7 +192,8 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
require: true, require: true,
showError: false, showError: false,
datas: this.unitList datas: this.unitList,
clearable:true,
}, { }, {
name: "适用对象", name: "适用对象",
key: "targets", key: "targets",
@ -201,6 +203,7 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
require: true, require: true,
showError: false, showError: false,
datas: this.$store.state.analControlList, datas: this.$store.state.analControlList,
clearable:true,
}, { }, {
name: "适用部门", name: "适用部门",
key: "depts", key: "depts",
@ -209,7 +212,8 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
require: true, require: true,
showError: false, showError: false,
datas: this.$store.state.deptList datas: this.$store.state.deptList,
clearable:true,
}, { }, {
name: "适用类型", name: "适用类型",
key: "types", key: "types",
@ -218,7 +222,8 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
require: true, require: true,
multiple: true, multiple: true,
showError: false, showError: false,
datas: this.$store.state.prevention_dangrous_type datas: this.$store.state.prevention_dangrous_type,
clearable:true,
}] }]
this.updateActions = [{ this.updateActions = [{
name: "取消", name: "取消",

View File

@ -192,7 +192,7 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
key: "planName", key: "planName",
type: "text", type: "text",
}, { }, {
name: "检查项目", name: "检查类型",
key: "inspectType", key: "inspectType",
type: "select", type: "select",
datas: this.$store.state.prevention_danger_check_type datas: this.$store.state.prevention_danger_check_type

View File

@ -120,7 +120,7 @@ export default class PlanComponent extends BaseRecordComponent<any> {
type: "primary" type: "primary"
}, { }, {
name: "保存并继续添加", name: "保存并继续添加",
hide:false, hide: false,
value: "saveAndContinue", value: "saveAndContinue",
type: "primary" type: "primary"
}]; }];
@ -239,7 +239,8 @@ export default class PlanComponent extends BaseRecordComponent<any> {
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
require: true, require: true,
showError: false, showError: false,
datas: this.areaList datas: this.areaList,
clearable: true,
}, { }, {
name: "检查单元", name: "检查单元",
key: "unitIds", key: "unitIds",
@ -249,7 +250,8 @@ export default class PlanComponent extends BaseRecordComponent<any> {
require: true, require: true,
multiple: true, multiple: true,
showError: false, showError: false,
datas: this.unitList datas: this.unitList,
clearable: true,
}, { }, {
name: "检查对象", name: "检查对象",
key: "analControlIds", key: "analControlIds",
@ -259,6 +261,7 @@ export default class PlanComponent extends BaseRecordComponent<any> {
require: true, require: true,
multiple: true, multiple: true,
showError: false, showError: false,
clearable: true,
datas: this.$store.state.analControlList, datas: this.$store.state.analControlList,
}, { }, {
name: "计划检查时间", name: "计划检查时间",
@ -270,6 +273,11 @@ export default class PlanComponent extends BaseRecordComponent<any> {
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
require: true, require: true,
showError: false, showError: false,
pickerOptions: {
disabledDate(time) {
return time.getTime() < moment(new Date()).subtract(1, 'day').toDate().getTime();
}
}
}, { }, {
name: "计划检查时间", name: "计划检查时间",
key: "time", key: "time",
@ -280,6 +288,11 @@ export default class PlanComponent extends BaseRecordComponent<any> {
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
require: true, require: true,
showError: false, showError: false,
pickerOptions: {
disabledDate(time) {
return time.getTime() < moment(new Date()).subtract(1, 'day').toDate().getTime();
}
}
}, { }, {
name: "检查负责人", name: "检查负责人",
key: "chargeUserId", key: "chargeUserId",
@ -321,6 +334,7 @@ export default class PlanComponent extends BaseRecordComponent<any> {
width: "600px", width: "600px",
multiple: true, multiple: true,
showError: false, showError: false,
clearable: true,
datas: res.data.datas.map(item => { datas: res.data.datas.map(item => {
return { return {
name: item.name, name: item.name,
@ -450,13 +464,29 @@ export default class PlanComponent extends BaseRecordComponent<any> {
this.updateParams.chargeUserName = this.$store.getters.user_map[data] this.updateParams.chargeUserName = this.$store.getters.user_map[data]
} }
if (item && item.key === "inspectCycleValue") { if (item && item.key === "inspectCycleValue") {
console.log(data)
this.updateParams.inspectCycleValue = data; this.updateParams.inspectCycleValue = data;
setTimeout(() => { setTimeout(() => {
this.updateParams.inspectCycleValue = Math.floor(data) this.updateParams.inspectCycleValue = Math.floor(data)
}) })
} }
if (item && item.key === "startTime") {
const now = moment().format("YYYY-MM-DD HH:mm:ss")
if (data < now) {
this.$message.error("计划检查时间不能早于当前时间,请先修改数据");
this.updateParams.startTime = null;
return
}
}
if (item && item.key === "time") { if (item && item.key === "time") {
const now = moment().format("YYYY-MM-DD HH:mm:ss")
if (data[0] < now || data[1] < now) {
this.$message.error("计划检查时间不能早于当前时间,请先修改数据");
this.updateParams.time = null
this.updateParams.startTime = null
this.updateParams.endTime = null
return
}
if (data && data.length) { if (data && data.length) {
this.updateParams.startTime = data[0] this.updateParams.startTime = data[0]
this.updateParams.endTime = data[1] this.updateParams.endTime = data[1]
@ -491,8 +521,8 @@ export default class PlanComponent extends BaseRecordComponent<any> {
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))
} 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 if (data && data.value === "cancel") { } else if (data && data.value === "cancel") {
this.handleClose() this.handleClose()
} }
@ -562,7 +592,7 @@ export default class PlanComponent extends BaseRecordComponent<any> {
this.updateParams.startTime = row.startTime this.updateParams.startTime = row.startTime
} }
} else { } else {
this.updateParams = { planType: 1 , time :[]} as any; this.updateParams = { planType: 1, time: [] } as any;
} }
this.buildUpdateForm(); this.buildUpdateForm();
this.showUpdate = true this.showUpdate = true
@ -570,7 +600,7 @@ export default class PlanComponent extends BaseRecordComponent<any> {
// //
public openSendModel(row) { public openSendModel(row) {
const now = moment().format("YYYY-MM-DD HH:mm") const now = moment().format("YYYY-MM-DD HH:mm:ss")
if (row.startTime < now) { if (row.startTime < now) {
this.$message.error("检查开始时间不能早于当前时间,请先修改数据"); this.$message.error("检查开始时间不能早于当前时间,请先修改数据");
return return
@ -662,7 +692,7 @@ export default class PlanComponent extends BaseRecordComponent<any> {
name: this.$store.getters.prevention_anal_control_map[itm] name: this.$store.getters.prevention_anal_control_map[itm]
} }
}) })
const now = moment().format("YYYY-MM-DD HH:mm") const now = moment().format("YYYY-MM-DD HH:mm:ss")
if (this.updateParams.startTime < now) { if (this.updateParams.startTime < now) {
this.$message.error("检查开始时间不能早于当前时间"); this.$message.error("检查开始时间不能早于当前时间");
return return
@ -679,6 +709,9 @@ export default class PlanComponent extends BaseRecordComponent<any> {
} }
public changeState(row) { public changeState(row) {
this.$confirm(`确认${row.state ? '停用' : '启用'}此安全检查计划`, "确认数据", {
type: 'warning'
}).then(() => {
this.tableService.addOrUpdate({ this.tableService.addOrUpdate({
id: row.id, id: row.id,
state: +!row.state, state: +!row.state,
@ -687,6 +720,11 @@ export default class PlanComponent extends BaseRecordComponent<any> {
this.$message.success(row.state ? "停用成功" : "启用成功!") this.$message.success(row.state ? "停用成功" : "启用成功!")
this.getTableData(); this.getTableData();
}) })
}).catch(() => {
//
})
} }

View File

@ -11,8 +11,8 @@
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked" <el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
@selection-change="handleSelectionChange" style="width: 100%" @sort-change="sortChange($event)"> @selection-change="handleSelectionChange" style="width: 100%" @sort-change="sortChange($event)">
<el-table-column v-if="isPlan" type="selection" <el-table-column v-if="isPlan" type="selection" :selectable="selectable" fixed label="全选"
:selectable="selectable" fixed label="全选" width="40"> width="40">
</el-table-column> </el-table-column>
<el-table-column label="序号" width="60"> <el-table-column label="序号" width="60">
<div slot-scope="scope">{{scope.$index+1}}</div> <div slot-scope="scope">{{scope.$index+1}}</div>
@ -31,22 +31,24 @@
</template> </template>
<el-table-column label="操作" fixed="right" :width="tableActionWidth"> <el-table-column label="操作" fixed="right" :width="tableActionWidth">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" v-if="isPlan" <el-button type="text" v-if="isPlan" @click="showUpdateModel(scope.row,true)">查看</el-button>
@click="showUpdateModel(scope.row,true)">查看</el-button>
<el-button type="text" v-if="isPlan" <el-button type="text" v-if="isPlan"
:disabled="(scope.row.planType === 1 && scope.row.status===1) || (scope.row.planType === 2 && scope.row.state===1)" :disabled="(scope.row.planType === 1 && scope.row.status===1) || (scope.row.planType === 2 && scope.row.state===1)"
@click="showUpdateModel(scope.row)">修改</el-button> @click="showUpdateModel(scope.row)">修改</el-button>
<el-button type="text" v-if="isPlan" <el-button type="text" v-if="isPlan"
:disabled="(scope.row.planType === 1 && scope.row.status===1) || (scope.row.planType === 2 && scope.row.state===1)" :disabled="(scope.row.planType === 1 && scope.row.status===1) || (scope.row.planType === 2 && scope.row.state===1)"
@click="deleteData([scope.row.id])">删除</el-button> @click="deleteData([scope.row.id])">删除</el-button>
<el-button type="text" v-if="isPlan && !scope.row.status" :disabled="scope.row.planType===2 && scope.row.state===0" <el-button type="text" v-if="isPlan && !scope.row.status"
:disabled="scope.row.planType===2 && scope.row.state===0"
@click="openSendModel(scope.row)">下发</el-button> @click="openSendModel(scope.row)">下发</el-button>
<el-button type="text" v-if="isPlan && scope.row.planType===2 && !scope.row.state" <el-button type="text" v-if="isPlan && scope.row.planType===2 && !scope.row.state"
@click="changeState(scope.row)">启用</el-button> @click="changeState(scope.row)">启用</el-button>
<el-button type="text" v-if="isPlan && scope.row.planType===2 && scope.row.state" <el-button type="text" v-if="isPlan && scope.row.planType===2 && scope.row.state"
@click="changeState(scope.row)">停用</el-button> @click="changeState(scope.row)">停用</el-button>
<el-button type="text" v-if="isPlan && scope.row.planType===1" @click="openRecordModel(scope.row)">检查情况</el-button> <el-button type="text" v-if="isPlan && scope.row.planType===1"
<el-button type="text" v-if="isPlan && scope.row.planType===2 " @click="openRecordModel(scope.row)">最新检查情况</el-button> @click="openRecordModel(scope.row)">检查情况</el-button>
<el-button type="text" v-if="isPlan && scope.row.planType===2 "
@click="openRecordModel(scope.row)">最新检查情况</el-button>
<el-button type="text" v-if="isAction && scope.row.status !==4&& (scope.row.status !==2 &&(nowDate > scope.row.taskStartTime ? true : <el-button type="text" v-if="isAction && scope.row.status !==4&& (scope.row.status !==2 &&(nowDate > scope.row.taskStartTime ? true :
false) ) && scope.row.tag===0 " @click="openRecordModel(scope.row)">检查</el-button> false) ) && scope.row.tag===0 " @click="openRecordModel(scope.row)">检查</el-button>
</template> </template>
@ -58,8 +60,8 @@
</div> </div>
<!-- 检查表记录 --> <!-- 检查表记录 -->
<el-dialog :close-on-click-modal="false" :title="isPlan?'检查表记录':'检查表'" <el-dialog :close-on-click-modal="false" :title="isPlan?'检查表记录':'检查表'" :visible.sync="showRecord" width="1080px"
:visible.sync="showRecord" width="1080px" :before-close="handleClose" destroy-on-close> :before-close="handleClose" destroy-on-close>
<div class="full"> <div class="full">
<el-radio-group size="medium" v-model="currentTableId" @change="sendTabChange"> <el-radio-group size="medium" v-model="currentTableId" @change="sendTabChange">
<el-radio-button :label="item.id" v-for="item in tableTabs" <el-radio-button :label="item.id" v-for="item in tableTabs"
@ -111,7 +113,7 @@
</el-table> </el-table>
</div> </div>
<div class="sub-title" v-if="!hideActions">隐患登记情况</div> <div class="sub-title" v-if="!hideActions">隐患登记情况</div>
<div class="full" style="margin-bottom: 20px;" v-if="isAction && !hideActions"> <div class="full" style="margin-bottom: 20px;text-align: end;" v-if="isAction && !hideActions">
<el-button type="success" plain @click="showUpdateModel()" icon="el-icon-plus">添加</el-button> <el-button type="success" plain @click="showUpdateModel()" icon="el-icon-plus">添加</el-button>
<el-button type="danger" plain @click="callback({value:'delete'})" icon="el-icon-delete">批量删除</el-button> <el-button type="danger" plain @click="callback({value:'delete'})" icon="el-icon-delete">批量删除</el-button>
</div> </div>
@ -171,8 +173,7 @@
<el-dialog :close-on-click-modal="false" :title="isReadonly?'详情':!updateParams.id?'新增':'编辑'" <el-dialog :close-on-click-modal="false" :title="isReadonly?'详情':!updateParams.id?'新增':'编辑'"
:visible.sync="showUpdate" width="1050px" :before-close="handleClose" destroy-on-close> :visible.sync="showUpdate" width="1050px" :before-close="handleClose" destroy-on-close>
<FormComponent ref="form" :options="updateOptions" <FormComponent ref="form" :options="updateOptions" :isReadonly="isReadonly" labelWidth="140px"
:isReadonly="isReadonly" labelWidth="140px"
labelAlign="right" :data.sync="updateParams" @actionCallback="callback" :actions="updateActions" labelAlign="right" :data.sync="updateParams" @actionCallback="callback" :actions="updateActions"
:full-btn="true" @change="change" btn-position="center"></FormComponent> :full-btn="true" @change="change" btn-position="center"></FormComponent>
</el-dialog> </el-dialog>

View File

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

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

@ -82,7 +82,8 @@ export default class IntegralEvent extends BaseRecordComponent<any> {
name: "时间", name: "时间",
key: "createTime", key: "createTime",
type: "date", type: "date",
format: 'yyyy-MM-dd' subType: "datetimerange",
format: 'yyyy-MM-dd HH:mm:ss'
}]; }];
public subActions = [{ public subActions = [{
@ -111,6 +112,7 @@ export default class IntegralEvent extends BaseRecordComponent<any> {
created() { created() {
//
} }
@ -129,10 +131,12 @@ export default class IntegralEvent extends BaseRecordComponent<any> {
} }
public callback(data, type) { public callback(data, type) {
if (type) { if (type) {
if (type === 'pageSize' || type === 'pageNum') { if (type === 'pageSize' || type === 'pageNum') {
this.params[type] = data; this.params[type] = data;
} else if (type.key === "createTime") {
this.params.startTime = data ? data[0] : null;
this.params.endTime = data ? data[1] : null;
} }
this.getTableData(); this.getTableData();
return return

View File

@ -206,7 +206,7 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
key: "applyTime", key: "applyTime",
require: true, require: true,
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
format: "yyyy-MM-dd", format: "yyyy-MM-dd HH:mm:ss",
disable: true, disable: true,
}, },
{ {
@ -276,7 +276,7 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
require: true, require: true,
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
disable: true, disable: true,
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd HH:mm:ss',
showError: false, showError: false,
}, },
] ]
@ -302,7 +302,7 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
disable: true, disable: true,
showError: false, showError: false,
hide:this.subIsReadonly, hide: this.subIsReadonly,
}, { }, {
name: "单价/积分", name: "单价/积分",
type: "number", type: "number",
@ -443,11 +443,10 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
// //
public getJudgeIsIntegral() { public getJudgeIsIntegral() {
this.tableService.judgeIsIntegral().then((res: any) => { this.tableService.judgeIsIntegral().then((res: any) => {
if (res.data === true) { if (res.data === 1) {
this.getUserIntegral() this.getUserIntegral()
} else { } else {
this.$message.error("您有未完成的积分兑换"); this.$message.error(res.data === 2 ? "您有未完成的积分兑换" : '您的积分不足,无法进行兑换');
return return
} }
}) })
@ -469,7 +468,7 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
this.updateParams.originalPoints = datas.totalPoints ? datas.totalPoints : 0; this.updateParams.originalPoints = datas.totalPoints ? datas.totalPoints : 0;
this.updateParams.consumePoints = 0; this.updateParams.consumePoints = 0;
this.updateParams.residuePoints = datas.totalPoints ? datas.totalPoints : 0; this.updateParams.residuePoints = datas.totalPoints ? datas.totalPoints : 0;
this.updateParams.applyTime = moment().format('YYYY-MM-DD') this.updateParams.applyTime = moment().format('YYYY-MM-DD HH:mm:ss')
this.isReadonly = false; this.isReadonly = false;
this.buildUpdateForm(); this.buildUpdateForm();
this.showUpdate = true; this.showUpdate = true;
@ -646,10 +645,12 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
if (this.subUpdateParams.exchangeNumber > res.data.stockNumber) { if (this.subUpdateParams.exchangeNumber > res.data.stockNumber) {
this.$message.error("您的兑换数量不能超出库存"); this.$message.error("您的兑换数量不能超出库存");
this.subUpdateParams.exchangeNumber = null; this.subUpdateParams.exchangeNumber = null;
this.subUpdateParams.remainStock = null;
} }
this.countStockAndIntegral(res.data.stockNumber, res.data.goodsPrice, this.subUpdateParams.exchangeNumber) this.countStockAndIntegral(res.data.stockNumber, res.data.goodsPrice, this.subUpdateParams.exchangeNumber)
} else {
this.subUpdateParams.remainStock = null;
} }
this.buildSubUpdateForm() this.buildSubUpdateForm()
}) })
} }
@ -669,7 +670,6 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
// //
// //
public countStockAndIntegral(totalNumber, price, number) { public countStockAndIntegral(totalNumber, price, number) {
let consumePoint = price * number; let consumePoint = price * number;
if (consumePoint > this.updateParams.residuePoints) { if (consumePoint > this.updateParams.residuePoints) {
this.$message.error("您的兑换积分不足"); this.$message.error("您的兑换积分不足");
@ -686,7 +686,6 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
} }
public doSubSave(goOn) { public doSubSave(goOn) {
// //
if (this.subShowUpdate) { if (this.subShowUpdate) {
if (!this.subUpdateParams.exchangeNumber) { if (!this.subUpdateParams.exchangeNumber) {
@ -786,7 +785,7 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
this.updateParams.approvalUserId = this.account.userId; this.updateParams.approvalUserId = this.account.userId;
this.updateParams.approvalUserName = this.account.nickName; this.updateParams.approvalUserName = this.account.nickName;
this.updateParams.approvalTime = moment().format('YYYY-MM-DD'); this.updateParams.approvalTime = moment().format('YYYY-MM-DD HH:mm:ss');
this.buildApplyForm() this.buildApplyForm()
} }
@ -797,7 +796,6 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
this.updateParams.approvalResultName = this.updateParams.approvalResult === 1 ? '同意' : '不同意' this.updateParams.approvalResultName = this.updateParams.approvalResult === 1 ? '同意' : '不同意'
this.buildApplyForm() this.buildApplyForm()
} }
this.buildUpdateForm() this.buildUpdateForm()
this.showUpdate = true this.showUpdate = true
} }
@ -822,10 +820,13 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
if (!type) { if (!type) {
this.tableService.getListDetail({ id: data.id }).then((res: any) => { this.tableService.getListDetail({ id: data.id }).then((res: any) => {
if (res.code === 200) { if (res.code === 200) {
this.updateParams = res.data this.updateParams = JSON.parse(JSON.stringify(res.data))
this.updateParams.approvalResultName = this.updateParams.approvalResult === 1 ? '同意' : '不同意' this.updateParams.approvalResultName = this.updateParams.approvalResult === 1 ? '同意' : '不同意'
if (this.updateParams.pointExchangeDetails.length !== 0) {
this.updateParams.pointExchangeDetails.forEach((item, index) => { this.updateParams.pointExchangeDetails.forEach((item, index) => {
item.index = index + 1 item.index = index + 1
})
}
if (data.status === 1) { if (data.status === 1) {
this.operate = true; this.operate = true;
this.isApplyReadonly = true; this.isApplyReadonly = true;
@ -841,7 +842,17 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
this.operate = false; this.operate = false;
this.isApplyReadonly = false; this.isApplyReadonly = false;
} }
} else if (data.status === 4) {
this.operate = false;
this.isApplyReadonly = true;
this.isReadonly = true;
this.buildApplyForm()
} else { } else {
// if (this.updateParams.approvalResult === null || this.updateParams.approvalResult === undefined) {
// this.operate = false;
// } else {
// this.operate = true;
// }
this.operate = true; this.operate = true;
this.isApplyReadonly = true; this.isApplyReadonly = true;
this.isReadonly = true; this.isReadonly = true;
@ -849,7 +860,7 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
} }
this.showUpdate = true this.showUpdate = true
this.buildUpdateForm() this.buildUpdateForm()
})
} }
}) })
} else { } else {

View File

@ -119,6 +119,11 @@ export default class IntegralMall extends BaseRecordComponent<any> {
key: "stockNumber", key: "stockNumber",
require: true, require: true,
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
// rules: [
// { pattern: /^1[3|5|7|8|9]\d{9}$/, message: '', }
// ],
max: 99999,
min: 1
}, },
{ {
name: "单位", name: "单位",

View File

@ -69,7 +69,7 @@
<el-dialog :close-on-click-modal="false" v-if="!isArea" width="500px" :title="'停用/恢复登记'" <el-dialog :close-on-click-modal="false" v-if="!isArea" width="500px" :title="'停用/恢复登记'"
:visible.sync="showTurnOff"> :visible.sync="showTurnOff">
<FormComponent :options="turnOffForm" labelWidth="110px" labelAlign="right" :data.sync="turnOffParams" <FormComponent :options="turnOffForm" labelWidth="110px" labelAlign="right" :data.sync="turnOffParams"
@actionCallback="doTurnOffAction" :actions="turnOffAction" btn-position="center"> @actionCallback="doTurnOffAction" :actions="turnOffAction" btn-position="center" @change="change">
</FormComponent> </FormComponent>
</el-dialog> </el-dialog>
</div> </div>

View File

@ -5,7 +5,7 @@ import template from "./areaAnal.component.html"
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue" import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue"
import FormComponent from "hbt-common/components/common/form.component.vue" import FormComponent from "hbt-common/components/common/form.component.vue"
import TableComponent from "hbt-common/components/common/table.component.vue" import TableComponent from "hbt-common/components/common/table.component.vue"
import AreaService from "@/service/area.service" import AreaAnalService from "@/service/areaanal.service"
import FormOption from "hbt-common/models/formOptions" import FormOption from "hbt-common/models/formOptions"
import BtnOption from "hbt-common/models/btnOptions" import BtnOption from "hbt-common/models/btnOptions"
import DrawComponent from '@/components/draw.component.vue'; import DrawComponent from '@/components/draw.component.vue';
@ -23,7 +23,7 @@ import riskLevel from '@/mock/riskLevel'
}, },
}) })
export default class AreaAnalComponent extends BaseRecordComponent<any> { export default class AreaAnalComponent extends BaseRecordComponent<any> {
public tableService = new AreaService(); public tableService = new AreaAnalService();
public params = {} as any; public params = {} as any;

View File

@ -96,14 +96,16 @@ export default class DeviceManagerComponent extends BaseRecordComponent<any> {
value: "reverse" value: "reverse"
}]; }];
public formOptions: FormOption<BtnOption>[] = [{ public formOptions: FormOption<BtnOption>[] = [{
name: "区域名称", name: "设备名称",
key: "areaName", key: "name",
type: "text", type: "text",
}, { }, {
name: "单元名称", name: "设备类别",
key: "unitName", key: "type",
type: "text", type: "select",
}]; datas: this.$store.state.prevention_device_type,
clearable: true,
},];
public updateOptions: FormOption<BtnOption>[] = [] as any; public updateOptions: FormOption<BtnOption>[] = [] as any;
@ -170,6 +172,7 @@ export default class DeviceManagerComponent extends BaseRecordComponent<any> {
showError: false, showError: false,
type: "select", type: "select",
width: "100%", width: "100%",
clearable: true,
datas: this.$store.state.postList datas: this.$store.state.postList
}, { }, {
name: "安全因素", name: "安全因素",
@ -178,6 +181,7 @@ export default class DeviceManagerComponent extends BaseRecordComponent<any> {
require: true, require: true,
type: "select", type: "select",
multiple: true, multiple: true,
clearable: true,
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
showError: false, showError: false,
datas: this.$store.state.prevention_safe_reason datas: this.$store.state.prevention_safe_reason
@ -428,6 +432,7 @@ export default class DeviceManagerComponent extends BaseRecordComponent<any> {
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
} as any; } as any;
this.getTableData()
} }
// //

View File

@ -126,13 +126,15 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
}]; }];
public formOptions: FormOption<BtnOption>[] = [{ public formOptions: FormOption<BtnOption>[] = [{
name: "区域名称", name: "设备名称",
key: "areaName", key: "name",
type: "text", type: "text",
}, { }, {
name: "单元名称", name: "设备类别",
key: "unitName", key: "type",
type: "text", type: "select",
datas:this.$store.state.prevention_device_type,
clearable:true,
},]; },];
public showUpdate = false; public showUpdate = false;

View File

@ -222,6 +222,7 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
multiple: true, multiple: true,
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
require: true, require: true,
clearable:true,
datas: this.$store.state.postList datas: this.$store.state.postList
}, { }, {
name: "安全因素", name: "安全因素",
@ -229,6 +230,7 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
format: "safetyFactorName", format: "safetyFactorName",
type: "select", type: "select",
multiple: true, multiple: true,
clearable:true,
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
require: true, require: true,
showError: false, showError: false,
@ -689,8 +691,6 @@ export default class WorkManagerComponent extends BaseRecordComponent<any> {
opacity: 0.3; opacity: 0.3;
} }
.end-step {}
.description { .description {

View File

@ -5,7 +5,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="changes" 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

@ -117,6 +117,7 @@ export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
require: true, require: true,
multiple: true, multiple: true,
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
clearable:true,
datas: this.$store.state.prevention_serious_result, datas: this.$store.state.prevention_serious_result,
}, },
{ {
@ -134,6 +135,7 @@ export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
require: true, require: true,
multiple: true, multiple: true,
width: "calc(50% - 20px)", width: "calc(50% - 20px)",
clearable:true,
datas: this.$store.state.prevention_security_identifier, datas: this.$store.state.prevention_security_identifier,
}, },
{ {
@ -386,6 +388,7 @@ export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
} as any; } as any;
this.getTableData()
} }
// //

View File

@ -158,7 +158,7 @@ export default class MeasuresReportManagerComponent extends BaseRecordComponent<
} }
}); });
this.tableColumn.push({ this.tableColumn.push({
name: '来源', key: "type", render: (data) => { name: '数据来源', key: "type", render: (data) => {
return this.sourceType[data.type] return this.sourceType[data.type]
} }
}); });

View File

@ -420,6 +420,8 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
} }
public change(data, item) { public change(data, item) {
console.log('data');
// //
if (item && item.key === "chargeDeptId") { if (item && item.key === "chargeDeptId") {
this.updateParams.chargeDeptName = this.$store.getters.dept_map[data]; this.updateParams.chargeDeptName = this.$store.getters.dept_map[data];
@ -433,6 +435,21 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
this.updateParams.areaNo = this.areaNoMap[data]; this.updateParams.areaNo = this.areaNoMap[data];
this.getCreateNumber({ areaNo: this.updateParams.areaNo }) this.getCreateNumber({ areaNo: this.updateParams.areaNo })
} }
//
if (item && item.key === 'startTime') {
if (this.turnOffParams.endTime) {
if (data > this.turnOffParams.endTime) {
this.turnOffParams.endTime = null
}
}
}
//
if (item && item.key === 'endTime') {
if (data < this.turnOffParams.startTime) {
this.$message.warning('停用结束时间应大于停用开始时间');
this.turnOffParams.endTime = null
}
}
} }
public callback(data, type) { public callback(data, type) {
if (type) { if (type) {
@ -481,6 +498,7 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
} as any; } as any;
this.getTableData()
} }

View File

@ -208,6 +208,7 @@ export default class RiskCard extends BaseRecordComponent<any> {
datas: this.$store.state.prevention_security_identifier, datas: this.$store.state.prevention_security_identifier,
filterable: true, filterable: true,
multiple: true, multiple: true,
clearable:true,
}, },
{ {
name: "风险管控措施", name: "风险管控措施",

View File

@ -336,6 +336,7 @@ export default class SafeCard extends BaseRecordComponent<any> {
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
} as any; } as any;
this.getTableData()
} }
public showUpdateModel(id) { public showUpdateModel(id) {

View File

@ -44,7 +44,7 @@
<el-dialog :close-on-click-modal="false" :title="isReadonly?'详情':updateParams.id?'编辑': '新增'" <el-dialog :close-on-click-modal="false" :title="isReadonly?'详情':updateParams.id?'编辑': '新增'"
:visible.sync="showUpdate" width="952px" :before-close="handleClose" destroy-on-close> :visible.sync="showUpdate" width="1000px" :before-close="handleClose" destroy-on-close>
<FormComponent :options="updateOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams" <FormComponent :options="updateOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
:isReadonly="isReadonly" @actionCallback="subCallback" @change="changes" :actions="updateActions" :isReadonly="isReadonly" @actionCallback="subCallback" @change="changes" :actions="updateActions"
:full-btn="true" btnPosition="center"> :full-btn="true" btnPosition="center">

View File

@ -323,7 +323,7 @@ export default class LeadershipStructure extends BaseRecordComponent<any> {
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",width:"130px" });
this.subTableColumn.push({ name: '职责描述', key: "description", width: "250px", showTip: true, }); this.subTableColumn.push({ name: '职责描述', key: "description", width: "250px", showTip: true, });
} }

View File

@ -283,7 +283,7 @@ export default class ManagementSystem extends BaseRecordComponent<any> {
} }
}); });
this.tableColumn.push({ name: '编制人', key: "compileUserName" }); this.tableColumn.push({ name: '编制人', key: "compileUserName" });
this.tableColumn.push({ name: '编制时间', key: "compileTime" }); this.tableColumn.push({ name: '编制时间', key: "compileTime",width:"110px" });
} }
public callback(data, type) { public callback(data, type) {