-
+
-
-
+
+
+
-
-
+
+
+
+
+
+
+
+
- 已处置
- 误报忽略
+ 已处置
+ 误报忽略
-
-
+
+
+
-
- 违章再教育
- 加入黑名单
+
+ 违章再教育
+ 加入黑名单
-
+
@@ -235,51 +397,54 @@ import {
aiAnalyseHardWareAlarmRecordEdit,
getViolatorList,
aiAnalyseHardWareRecordEditApi,
- carDangerDetectRecordAdd
-} from '@/assets/js/api/carViolation';
-import { getDictionaryItemApi } from '@/assets/js/api/companyDiagram.js';
-import { getWorkerInfoList, selectHierarchyEnterpriseListApi } from '@/assets/js/api/laborPerson.js';
-import { getQualityRegionListApi } from '@/assets/js/api/quality.js';
-import { isJSON } from '@/util/nowDate';
+ carDangerDetectRecordAdd,
+} from "@/assets/js/api/carViolation";
+import { getDictionaryItemApi } from "@/assets/js/api/companyDiagram.js";
+import {
+ getWorkerInfoList,
+ selectHierarchyEnterpriseListApi,
+} from "@/assets/js/api/laborPerson.js";
+import { getQualityRegionListApi } from "@/assets/js/api/quality.js";
+import { isJSON } from "@/util/nowDate";
export default {
data() {
return {
handleResultStatus: [
- { name: '未处置', value: false },
- { name: '已处置', value: true }
+ { name: "未处置", value: false },
+ { name: "已处置", value: true },
],
// 对应的字段
defaultProps: {
- children: 'children',
- label: 'enterpriseName'
+ children: "children",
+ label: "enterpriseName",
},
treeList: [],
areaList: [],
- areaSelectVal: '',
+ areaSelectVal: "",
// 对应的字段
defaultAreaProps: {
- children: 'children',
- label: 'regionName'
+ children: "children",
+ label: "regionName",
},
- selectVal: '',
- selectEnterpriseVal: '',
+ selectVal: "",
+ selectEnterpriseVal: "",
isDetail: false,
- pageType: 'list',
+ pageType: "list",
workerList: [],
pageInfo: {
pageNo: 1, //页数
pageSize: 10, //条数
- total: 0 //总条数
+ total: 0, //总条数
},
- itemId: '',
+ itemId: "",
formInline: {
- alarmType: '',
- handleDone: '',
- endTime: '',
- startTime: '',
- hardwareId: '',
- qualityRegionId: '',
- enterpriseId: ''
+ alarmType: "",
+ handleDone: "",
+ endTime: "",
+ startTime: "",
+ hardwareId: "",
+ qualityRegionId: "",
+ enterpriseId: "",
},
dateRangeArr: [],
alarmTypeArrList: [],
@@ -288,53 +453,71 @@ export default {
workerInfoList: [],
handleResult: 1,
handleType: 1,
- dutyId: '',
- alarmDesc: '',
- alarmType: '',
- deductScore: 0
+ dutyId: "",
+ alarmDesc: "",
+ alarmType: "",
+ carNumber: "",
+ currentSpeed: "",
+ deductScore: 0,
},
fileUplodList: [],
addEditRules: {
alarmType: [
{
required: true,
- message: '请选择',
- trigger: 'change'
- }
+ message: "请选择",
+ trigger: "change",
+ },
],
alarmDesc: [
{
required: true,
- message: '必填',
- trigger: 'blur'
- }
+ message: "必填",
+ trigger: "blur",
+ },
+ ],
+ carNumber: [
+ {
+ required: true,
+ message: "必填",
+ trigger: "blur",
+ },
+ ],
+ currentSpeed: [
+ {
+ required: true,
+ message: "必填",
+ trigger: "blur",
+ },
],
selectList: [
{
- type: 'array',
+ type: "array",
required: true,
- message: '请选择',
+ message: "请选择",
validator: this.validateSelectList,
- trigger: 'blur'
- }
+ trigger: "blur",
+ },
],
handleType: [
{
required: true,
- message: '必填',
- trigger: 'blur'
- }
- ]
+ message: "必填",
+ trigger: "blur",
+ },
+ ],
},
workerListOptions: [],
selectList: [],
- title: '处置详情',
+ title: "处置详情",
isType: -1,
- projectInfo: {}
+ projectInfo: {},
};
},
created() {
- this.projectInfo = isJSON(localStorage.getItem('projectInfo')) ? JSON.parse(localStorage.getItem('projectInfo')) : {};
+ this.projectInfo = isJSON(localStorage.getItem("projectInfo"))
+ ? JSON.parse(localStorage.getItem("projectInfo"))
+ : {};
},
mounted() {
this.selectNowDate();
@@ -346,32 +529,32 @@ export default {
},
computed: {
imageUrlUp() {
- return img => {
- return img.includes('http://') ? img : this.$store.state.FILEURL + img;
+ return (img) => {
+ return img.includes("http://") ? img : this.$store.state.FILEURL + img;
};
- }
+ },
},
methods: {
validateSelectList(rule, value, callback) {
console.log(value, rule);
if (this.selectList.length == 0) {
- callback(new Error('请选择人员'));
+ callback(new Error("请选择人员"));
} else {
callback();
}
},
handleExceed() {
- this.$message.warning('文件超出最大限制,请删除上份文件!');
+ this.$message.warning("文件超出最大限制,请删除上份文件!");
},
// 删除文件
handleRemove(file, fileList) {
this.fileUplodList = fileList;
},
handleSuccess(res, file, type) {
- if (res.status == 'SUCCESS') {
+ if (res.status == "SUCCESS") {
this.fileUplodList.push({
name: file.name,
- url: this.$store.state.FILEURL + file.response.data[0].imageUrl
+ url: this.$store.state.FILEURL + file.response.data[0].imageUrl,
});
}
},
@@ -379,7 +562,7 @@ export default {
treeClick(data) {
console.log(data);
if (data.status == 1) {
- this.$message.warning('无法选中已禁用组织');
+ this.$message.warning("无法选中已禁用组织");
} else {
this.selectEnterpriseVal = data.enterpriseName;
this.formInline.enterpriseId = data.enterpriseId;
@@ -388,8 +571,8 @@ export default {
},
getTreeList() {
selectHierarchyEnterpriseListApi({
- projectSn: this.$store.state.projectSn
- }).then(result => {
+ projectSn: this.$store.state.projectSn,
+ }).then((result) => {
if (result.success) {
this.treeList = result.result;
}
@@ -398,10 +581,10 @@ export default {
//获取承包商/厂区
getPositionList() {
let data = {
- projectSn: this.$store.state.projectSn
+ projectSn: this.$store.state.projectSn,
};
- getQualityRegionListApi(data).then(res => {
- console.log('res=================', res);
+ getQualityRegionListApi(data).then((res) => {
+ console.log("res=================", res);
if (res.code == 200) {
this.areaList = res.result;
console.log(this.areaList, 135456);
@@ -411,23 +594,23 @@ export default {
selectChange(val) {
console.log(val, 123);
if (!val) {
- this.selectVal = '';
- this.areaSelectVal = '';
- this.formInline.qualityRegionId = '';
+ this.selectVal = "";
+ this.areaSelectVal = "";
+ this.formInline.qualityRegionId = "";
}
},
selectEnterpriseChange(val) {
console.log(val, 123);
if (!val) {
- this.selectEnterpriseVal = '';
- this.formInline.enterpriseId = '';
+ this.selectEnterpriseVal = "";
+ this.formInline.enterpriseId = "";
}
},
// 树形控件点击
treeAreaClick(data) {
console.log(data);
if (data.status == 1) {
- this.$message.warning('无法选中已禁用组织');
+ this.$message.warning("无法选中已禁用组织");
} else {
this.selectVal = data.regionName;
this.areaSelectVal = data.id;
@@ -439,12 +622,12 @@ export default {
dutySelectChange(e) {
// const item = this.dutyList.find(item => item.userId === e)
// this.addEditForm.dutyUserName = item.realName
- const newArray = e.map(item => ({ id: item }));
+ const newArray = e.map((item) => ({ id: item }));
this.addEditForm.workerInfoList = newArray;
// if (this.selectList.length > 0) {
// this.$refs.addEditForm.clearValidate("selectList");
// }
- console.log('下拉选择', newArray);
+ console.log("下拉选择", newArray);
},
close() {
this.$nextTick(() => {
@@ -459,12 +642,12 @@ export default {
getPersonDetail(itemId) {
let data = {
projectSn: this.$store.state.projectSn,
- carDangerDetectRecordId: itemId
+ carDangerDetectRecordId: itemId,
};
- getViolatorList(data).then(res => {
+ getViolatorList(data).then((res) => {
if (res.code == 200) {
- this.selectList = res.result.map(items => items.id);
- console.log('回显选择人员', this.selectList);
+ this.selectList = res.result.map((items) => items.id);
+ console.log("回显选择人员", this.selectList);
} else {
this.$message.error(res.message);
}
@@ -475,12 +658,12 @@ export default {
getDutyPerson() {
let data = {
projectSn: this.$store.state.projectSn,
- isFilterQualityRegionEnterprise: 1
+ isFilterQualityRegionEnterprise: 1,
};
- getWorkerInfoList(data).then(res => {
+ getWorkerInfoList(data).then((res) => {
if (res.code == 200) {
this.workerListOptions = res.result.records;
- console.log('获取施工人员下拉', this.workerListOptions);
+ console.log("获取施工人员下拉", this.workerListOptions);
} else {
this.$message.error(res.message);
}
@@ -492,20 +675,22 @@ export default {
this.isDetail = false;
this.isType = type;
if (type == 1) {
- this.title = '新增';
+ this.title = "新增";
this.addEditForm = {
workerInfoList: [],
handleResult: 1,
handleType: 1,
- dutyId: '',
- alarmDesc: '',
- alarmType: '',
- deductScore: 0
+ dutyId: "",
+ alarmDesc: "",
+ carNumber: "",
+ currentSpeed: "",
+ alarmType: "",
+ deductScore: 0,
};
this.selectList = [];
this.fileUplodList = [];
} else if (type == 2) {
- this.title = '处置详情';
+ this.title = "处置详情";
this.addEditForm = JSON.parse(JSON.stringify(item));
this.addEditForm.handleResult = 1;
this.addEditForm.alarmType = item.alarmType.toString();
@@ -514,18 +699,18 @@ export default {
this.getPersonDetail(item.id);
this.fileUplodList = [
{
- url: item.imageUrl
- }
+ url: item.imageUrl,
+ },
];
}
this.recordShow = true;
- console.log('打开处置弹窗', item);
+ console.log("打开处置弹窗", item);
},
// 打开 详情处置弹窗
openDialogDetail(item) {
- this.title = '处置详情';
+ this.title = "处置详情";
this.isDetail = true;
this.isType = -1;
this.addEditForm = JSON.parse(JSON.stringify(item));
@@ -535,20 +720,20 @@ export default {
// this.selectList = item.workerInfoList;
this.fileUplodList = [
{
- url: item.imageUrl
- }
+ url: item.imageUrl,
+ },
];
this.recordShow = true;
- console.log('打开处置弹窗', item);
+ console.log("打开处置弹窗", item);
},
// 保存
addBtn() {
let params = JSON.parse(JSON.stringify(this.addEditForm));
- console.log('保存', params);
+ console.log("保存", params);
params.projectSn = this.$store.state.projectSn;
if (!params.id) {
- params.imageUrl = this.fileUplodList.length > 0 ? this.fileUplodList[0].url : '';
+ params.imageUrl = this.fileUplodList.length > 0 ? this.fileUplodList[0].url : "";
}
params.handleResult = 1;
@@ -556,15 +741,15 @@ export default {
params.handleDone = true;
}
- this.$refs.addEditForm.validate(valid => {
+ this.$refs.addEditForm.validate((valid) => {
// if (this.selectList.length > 0) {
// this.$refs.addEditForm.clearValidate("selectList");
// }
console.log(valid);
if (valid) {
- console.log('保存1', params);
+ console.log("保存1", params);
if (params.id) {
- aiAnalyseHardWareRecordEditApi(params).then(result => {
+ aiAnalyseHardWareRecordEditApi(params).then((result) => {
if (result.success) {
this.$message.success(result.message);
this.getList();
@@ -574,8 +759,8 @@ export default {
} else {
carDangerDetectRecordAdd({
...params,
- isPushed: 1
- }).then(result => {
+ isPushed: 1,
+ }).then((result) => {
if (result.success) {
this.$message.success(result.message);
this.getList();
@@ -592,11 +777,11 @@ export default {
let params = JSON.parse(JSON.stringify(this.addEditForm));
params.projectSn = this.$store.state.projectSn;
params.handleType = 2;
- this.$refs.addEditForm.validate(valid => {
+ this.$refs.addEditForm.validate((valid) => {
if (valid) {
- console.log('误报忽略', params);
+ console.log("误报忽略", params);
// aiAnalyseHardWareAlarmRecordEdit(params).then(result => {
- aiAnalyseHardWareRecordEditApi(params).then(result => {
+ aiAnalyseHardWareRecordEditApi(params).then((result) => {
if (result.success) {
this.$message.success(result.message);
this.getList();
@@ -612,11 +797,11 @@ export default {
//获取字典施工阶段
getDictionaryList() {
getDictionaryItemApi({
- dictionaryEncoding: 'ai_analyse_hard_ware_alarm_record_type',
- projectSn: this.$store.state.projectSn
- }).then(res => {
+ dictionaryEncoding: "car_danger_detect_record_alarm_type",
+ projectSn: this.$store.state.projectSn,
+ }).then((res) => {
if (res.result.length > 0) {
- console.log('获取字典施工阶段', res.result);
+ console.log("获取字典施工阶段", res.result);
this.alarmTypeArrList = res.result;
}
});
@@ -630,14 +815,14 @@ export default {
hours = date.getHours(), //获取当前小时数(0-23)
minutes = date.getMinutes(), //获取当前分钟数(0-59)
seconds = date.getSeconds();
- month >= 1 && month <= 9 ? (month = '0' + month) : '';
- day >= 0 && day <= 9 ? (day = '0' + day) : '';
- hours >= 0 && hours <= 9 ? (hours = '0' + hours) : '';
- minutes >= 0 && minutes <= 9 ? (minutes = '0' + minutes) : '';
- seconds >= 0 && seconds <= 9 ? (seconds = '0' + seconds) : '';
+ month >= 1 && month <= 9 ? (month = "0" + month) : "";
+ day >= 0 && day <= 9 ? (day = "0" + day) : "";
+ hours >= 0 && hours <= 9 ? (hours = "0" + hours) : "";
+ minutes >= 0 && minutes <= 9 ? (minutes = "0" + minutes) : "";
+ seconds >= 0 && seconds <= 9 ? (seconds = "0" + seconds) : "";
// var timer = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds // 获取至当前的时间
- var timer = year + '-' + month + '-' + day + ' ' + '23:59:59';
- var timer2 = year + '-' + month + '-' + day + ' ' + '00:00:00';
+ var timer = year + "-" + month + "-" + day + " " + "23:59:59";
+ var timer2 = year + "-" + month + "-" + day + " " + "00:00:00";
this.dateRangeArr = [timer2, timer];
this.formInline.startTime = this.dateRangeArr[0];
this.formInline.endTime = this.dateRangeArr[1];
@@ -645,8 +830,8 @@ export default {
// return timer;
},
getTypeName(val) {
- let text = '';
- this.alarmTypeArrList.forEach(item => {
+ let text = "";
+ this.alarmTypeArrList.forEach((item) => {
if (item.data == val) {
text = item.name;
}
@@ -658,25 +843,25 @@ export default {
this.formInline.startTime = this.dateRangeArr[0];
this.formInline.endTime = this.dateRangeArr[1];
} else {
- this.formInline.startTime = '';
- this.formInline.endTime = '';
+ this.formInline.startTime = "";
+ this.formInline.endTime = "";
}
},
refresh() {
this.pageInfo.pageNo = 1;
- this.formInline.hardwareId = '';
- this.formInline.startTime = '';
- this.formInline.endTime = '';
- this.formInline.alarmType = '';
- this.formInline.handleDone = '';
+ this.formInline.hardwareId = "";
+ this.formInline.startTime = "";
+ this.formInline.endTime = "";
+ this.formInline.alarmType = "";
+ this.formInline.handleDone = "";
this.dateRangeArr = [];
// 区域内容清空
- this.selectVal = '';
- this.areaSelectVal = '';
- this.formInline.qualityRegionId = '';
+ this.selectVal = "";
+ this.areaSelectVal = "";
+ this.formInline.qualityRegionId = "";
// 企业内容情况
- this.selectEnterpriseVal = '';
- this.formInline.enterpriseId = '';
+ this.selectEnterpriseVal = "";
+ this.formInline.enterpriseId = "";
this.getList();
},
getList(val) {
@@ -686,7 +871,7 @@ export default {
let json = Object.assign(this.pageInfo, this.formInline);
json.projectSn = this.$store.state.projectSn;
json.isPushed = 1;
- aiAnalyseHardWareAlarmRecordApi(json).then(res => {
+ aiAnalyseHardWareAlarmRecordApi(json).then((res) => {
this.workerList = res.result.records;
// let tempArr = []
// this.workerList.map(item => {
@@ -704,7 +889,7 @@ export default {
});
},
goBack() {
- this.pageType = 'list';
+ this.pageType = "list";
this.getList();
},
// addFn() {
@@ -713,27 +898,31 @@ export default {
// },
editBefore(item) {
this.itemId = item.id;
- this.pageType = 'detail';
+ this.pageType = "detail";
},
deleteBefore(item) {
- this.$confirm(this.$t('message.sixComplete.carWash.tipText') + '?', this.$t('message.sixComplete.carWash.tip'), {
- confirmButtonText: this.$t('message.sixComplete.carWash.confirm'),
- cancelButtonText: this.$t('message.sixComplete.carWash.cancel'),
- type: 'warning'
- })
+ this.$confirm(
+ this.$t("message.sixComplete.carWash.tipText") + "?",
+ this.$t("message.sixComplete.carWash.tip"),
+ {
+ confirmButtonText: this.$t("message.sixComplete.carWash.confirm"),
+ cancelButtonText: this.$t("message.sixComplete.carWash.cancel"),
+ type: "warning",
+ }
+ )
.then(() => {
- workerSafeEducationDeleteApi({ id: item.id }).then(res => {
+ workerSafeEducationDeleteApi({ id: item.id }).then((res) => {
this.$message({
- type: 'success',
- message: this.$t('message.sixComplete.carWash.deleteSuccess') + '!'
+ type: "success",
+ message: this.$t("message.sixComplete.carWash.deleteSuccess") + "!",
});
this.getList();
});
})
.catch(() => {
this.$message({
- type: 'info',
- message: this.$t('message.sixComplete.carWash.cancelDelete')
+ type: "info",
+ message: this.$t("message.sixComplete.carWash.cancelDelete"),
});
});
},
@@ -746,8 +935,8 @@ export default {
console.log(val);
this.pageInfo.pageNo = val;
this.getList();
- }
- }
+ },
+ },
};