This commit is contained in:
helloDy
2024-02-29 15:54:23 +08:00
parent f8d033c97a
commit 93eb12aeb7
21 changed files with 277 additions and 150 deletions

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-02-28 16:05:10
* @LastEditTime: 2024-02-29 14:59:28
* @Description:
-->
<template>
@@ -57,8 +57,8 @@
<el-option
v-for="d in groupOptions"
:key="d.id"
:label="d.name"
:value="d.id" />
:label="d.label"
:value="d.label" />
</el-select>
</el-form-item>
</el-col>
@@ -72,7 +72,8 @@
multiple
clearable
:disabled="isdetail"
filterable>
filterable
style="width: 100%">
<el-option
v-for="opt in inspectorOptions"
:key="opt.value"
@@ -165,6 +166,7 @@ import attrAdd from './attr-add';
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
import { getCoreDepartmentList } from "@/api/base/coreDepartment";
import { groupClassesListAll } from '@/api/monitoring/teamProduction'
import { getDictDataLabel } from '@/utils/dict';
const tableBtn = [
{
@@ -245,8 +247,8 @@ export default {
id: undefined,
name: '',
departmentId: undefined,
groupClass: undefined,
checkPerson: undefined,
groupClass: [],
checkPerson: [],
planCheckTime: undefined
},
detList: [],
@@ -270,7 +272,10 @@ export default {
async getDict() {
// 班次列表
const res = await groupClassesListAll();
this.groupOptions = res.data || [];
this.groupOptions = res.data.map((item) => {
item.label = item.name + ' - ' + getDictDataLabel('workshop', item.roomNameDict)
return item
}) || [];
// 部门列表
const res1 = await getCoreDepartmentList();
this.departmentOptions = res1.data || []
@@ -317,6 +322,7 @@ export default {
initData() {
this.detList.splice(0);
this.listQuery.total = 0;
this.isshowConfirm = false;
},
handleClick(raw) {
if (raw.type === 'delete') {
@@ -376,6 +382,16 @@ export default {
// 获取巡检单详情
this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data
if (this.dataForm.groupClass && this.dataForm.groupClass !== ''){
this.dataForm.groupClass = response.data?.groupClass.split(',')
} else {
this.dataForm.groupClass = []
}
if (this.dataForm.checkPerson && this.dataForm.checkPerson !== '') {
this.dataForm.checkPerson = response.data?.checkPerson.split(',')
} else {
this.dataForm.checkPerson = []
}
});
// 获取巡检内容列表
this.getList();

View File

@@ -63,7 +63,7 @@ import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import addRecord from './addRecord.vue';
import AddContent from './addContent.vue';
import { exportCheckLogExcel, deleteEqCheckLog } from '@/api/equipment/base/inspection/record'
import { exportCheckOrderExcel, deleteEqCheckLog } from '@/api/equipment/base/inspection/record'
import { parseTime } from '../../../../core/mixins/code-filter';
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
@@ -130,19 +130,25 @@ export default {
// { prop: 'responsible', label: '巡检人' },
],
searchBarFormConfig: [
// {
// type: 'select',
// label: '巡检单名称',
// placeholder: '请选择巡检单',
// param: 'name',
// filterable: true
// },
{
type: 'select',
type: 'input',
label: '巡检单名称',
placeholder: '请选择巡检单',
param: 'name',
filterable: true
placeholder: '请输入巡检单',
param: 'name'
},
// 开始结束时间
{
type: 'datePicker',
label: '巡检时间',
dateType: 'daterange', // datetimerange
format: 'yyyy-MM-dd',
dateType: 'datetimerange', // datetimerange
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始日期',
@@ -257,7 +263,12 @@ export default {
};
},
created() {
this.initSearchBar();
let end = moment().format('YYYY-MM-DD 08:00:00')
const current = new Date()
let start = parseTime(new Date(current.getFullYear(), current.getMonth(), current.getDate() - 3, 8, 0, 0))
this.searchBarFormConfig[1].defaultSelect = [start, end]
this.queryParams.actualCheckTime = [start, end]
// this.initSearchBar();
this.getList();
},
methods: {
@@ -272,22 +283,23 @@ export default {
break;
}
},
initSearchBar() {
this.http('/base/core-equipment/page', 'get', {
special: false,
pageNo: 1,
pageSize: 99,
}).then(({ data }) => {
this.$set(
this.searchBarFormConfig[0],
'selectOptions',
(data?.list || []).map((item) => ({
name: item.name,
id: item.id,
}))
);
});
},
// initSearchBar() {
// this.http('/base/equipment-check-order/page', 'get', {
// special: false,
// pageNo: 1,
// pageSize: 99,
// status: 2
// }).then(({ data }) => {
// this.$set(
// this.searchBarFormConfig[0],
// 'selectOptions',
// (data?.list || []).map((item) => ({
// name: item.name,
// id: item.id,
// }))
// );
// });
// },
/** 查询列表 */
getList() {
this.loading = true;
@@ -419,7 +431,7 @@ export default {
.confirm('是否确认导出所有设备巡检记录?')
.then(() => {
this.exportLoading = true;
return exportCheckLogExcel(params);
return exportCheckOrderExcel(params);
})
.then((response) => {
this.$download.excel(response, '设备巡检记录.xls');

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-02-24 20:50:51
* @LastEditTime: 2024-02-29 14:58:37
* @Description:
-->
<template>
@@ -53,6 +53,7 @@
type="datetime"
:placeholder="`请选择计划巡检时间`"
value-format="timestamp"
:default-time="'8:00:00'"
style="width: 100%" />
</el-form-item>
</el-col>
@@ -77,8 +78,8 @@
<el-option
v-for="d in groupOptions"
:key="d.id"
:label="d.name"
:value="d.id" />
:label="d.label"
:value="d.label" />
</el-select>
</el-form-item>
</el-col>
@@ -98,6 +99,7 @@ import basicAdd from '../../../../core/mixins/basic-add';
import { getCheckOrder, getOrderCode, createCheckOrder, updateCheckOrder } from "@/api/equipment/base/inspection/settings";
import { getCoreDepartmentList } from "@/api/base/coreDepartment";
import { groupClassesListAll } from '@/api/monitoring/teamProduction'
import { getDictDataLabel } from '@/utils/dict';
// import { getEquipmentAll } from '@/api/base/equipment'
export default {
@@ -139,16 +141,48 @@ export default {
}
};
},
created() {
const currenttime = new Date()
this.dataForm.planCheckTime = new Date(currenttime.getFullYear(), currenttime.getMonth(), currenttime.getDate(), 8, 0, 0).getTime()
console.log('11', this.dataForm.planCheckTime, currenttime)
},
mounted() {
this.getDict()
},
methods: {
init(id) {
this.dataForm.id = id || "";
this.visible = true;
if (this.urlOptions.getOption) {
this.getArr()
}
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
if (this.dataForm.id) {
this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data
if (response.data.groupClass === '') {
this.dataForm.groupClass = []
} else {
this.dataForm.groupClass = response.data?.groupClass.split(',') || undefined
}
});
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
}
});
},
async getDict() {
// 部门列表
const res = await getCoreDepartmentList();
this.departmentOptions = res.data || [];
const res1 = await groupClassesListAll();
this.groupOptions = res1.data || [];
this.groupOptions = res1.data.map((item) => {
item.label = item.name + ' - ' + getDictDataLabel('workshop', item.roomNameDict)
return item
}) || [];
// const res = await getEquipmentAll()
// this.eqList = res.data
},

View File

@@ -97,11 +97,11 @@ export default {
{ prop: 'name', label: '巡检单名称', width: 110, showOverflowtooltip: true },
{ prop: 'code', label: '巡检单编码', minWidth: 150, showOverflowtooltip: true },
{ prop: 'department', label: '部门', showOverflowtooltip: true },
{ prop: 'planCheckTime', label: '计划巡检时间', filter: parseTime },
{ prop: 'planCheckTime', label: '计划巡检时间', width: 150, filter: parseTime },
{ prop: 'confirmTimeLimit', label: '确认时限', showOverflowtooltip: true },
{ prop: 'groupClass', label: '班次', showOverflowtooltip: true },
{ prop: 'checkPerson', label: '创建人', minWidth: 150, showOverflowtooltip: true },
{ prop: 'createTime', label: '创建时间', filter: parseTime },
{ prop: 'creator', label: '创建人', showOverflowtooltip: true },
{ prop: 'createTime', label: '创建时间', width: 150, filter: parseTime },
// { prop: 'responsible', label: '负责人' },
{ prop: 'remark', label: '备注' } // TODO: 操作 选项,四个,群里询问
],
@@ -195,17 +195,20 @@ export default {
pageSize: 10,
equipmentId: null,
name: null,
special: false
special: false,
status: 0
},
// 表单参数
form: {},
basePath: '/base/equipment-check-order',
mode: null,
groupList: []
};
},
created() {
this.initSearchBar();
this.getList();
this.getGroup();
},
methods: {
handleConfirm() {
@@ -227,6 +230,11 @@ export default {
);
});
},
getGroup() {
groupClassesListAll().then(res => {
this.groupList = res.data || []
})
},
/** 查询列表 */
getList() {
this.loading = true;