projects/mesxc-dy #247
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2024-02-21 13:43:02
|
||||
* @LastEditTime: 2024-02-21 15:00:17
|
||||
* @LastEditTime: 2024-03-14 19:12:31
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
@ -33,3 +33,21 @@ export function listByParentId(query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得产线工段设备树形结构
|
||||
export function getTree(query) {
|
||||
return request({
|
||||
url: '/base/core-factory/getTree',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得设备分组列表
|
||||
export function getgroupAllList(query) {
|
||||
return request({
|
||||
url: '/base/equipment-group/listAll',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ import { parseTime } from '../../core/mixins/code-filter';
|
||||
import {
|
||||
getcoreAlarmLogPage
|
||||
} from '@/api/base/coreAlarmLog';
|
||||
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
|
||||
import {DICT_TYPE, getDictDatas, publicFormatter } from "@/utils/dict";
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
@ -50,7 +50,8 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'alarmGrade',
|
||||
label: '报警级别'
|
||||
label: '报警级别',
|
||||
filter: publicFormatter(DICT_TYPE.EQU_ALARM_LEVEL)
|
||||
},
|
||||
{
|
||||
prop: 'alarmReason',
|
||||
|
@ -7,10 +7,11 @@
|
||||
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible="visible"
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
:wrapper-closable="true"
|
||||
class="drawer"
|
||||
:before-close="beforeClose"
|
||||
custom-class="mes-drawer"
|
||||
size="60%"
|
||||
@closed="$emit('destroy')">
|
||||
@ -81,12 +82,12 @@
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<div v-if="mode == 'edit'" class="drawer-body__footer">
|
||||
<el-button style="" @click="handleCancel">取消</el-button>
|
||||
<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
|
||||
<!-- <el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-else type="primary" @click="handleConfirm">保存</el-button>
|
||||
</el-button> -->
|
||||
<el-button type="primary" @click="handleConfirm">保存</el-button>
|
||||
<!-- sections的第二项必须是 属性列表 -->
|
||||
<!-- <el-button
|
||||
v-if="sections[1].allowAdd"
|
||||
@ -298,6 +299,17 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
beforeClose(done) {
|
||||
if (this.mode.includes('edit')) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done();
|
||||
})
|
||||
.catch(_ => {});
|
||||
} else {
|
||||
done()
|
||||
}
|
||||
},
|
||||
handleTableBtnClick({ type, data }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
|
@ -486,6 +486,7 @@ export default {
|
||||
pageSize: 10,
|
||||
code: '',
|
||||
name: '',
|
||||
special: false
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
|
@ -298,9 +298,9 @@ export default {
|
||||
// 工段排序
|
||||
sort: undefined,
|
||||
// 产线统计类型
|
||||
lineDataType: undefined,
|
||||
lineDataType: 0,
|
||||
// 工段统计类型
|
||||
sectionDataType: undefined,
|
||||
sectionDataType: 0,
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-12-14 13:52:42
|
||||
* @LastEditTime: 2024-03-14 10:02:53
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -169,7 +169,7 @@ export default {
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.updateURL(this.dataForm).then(response => {
|
||||
if (this.test.length > 1 || this.test[0].name) {
|
||||
if (this.test.length > 1 || this.test[0]?.name) {
|
||||
this.test.forEach(check => {
|
||||
check.hotMaterialId = this.dataForm.id
|
||||
if (check.id) {
|
||||
@ -191,7 +191,7 @@ export default {
|
||||
}
|
||||
// 添加的提交
|
||||
this.urlOptions.createURL(this.dataForm).then(response => {
|
||||
if (this.test.length > 1 || this.test[0].name) {
|
||||
if (this.test.length > 1 || this.test[0]?.name) {
|
||||
this.test.forEach(check => {
|
||||
check.hotMaterialId = response.data
|
||||
createHotMaterialCheck(check).then(res => {
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-02-29 15:01:25
|
||||
* @LastEditTime: 2024-03-13 13:54:01
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -254,7 +254,7 @@ export default {
|
||||
dataRule: {
|
||||
code: [{ required: true, message: "产品编码不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "产品名称不能为空", trigger: "blur" }],
|
||||
specifications: [{ required: true, message: "规格不能为空", trigger: "blur" }],
|
||||
specifications: [{ required: false, message: "规格不能为空", trigger: "blur" }],
|
||||
materialType: [{ required: true, message: "物料类型不能为空", trigger: "change" }],
|
||||
productType: [{ required: true, message: "产品类型不能为空", trigger: "change" }]
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-03-01 19:52:55
|
||||
* @LastEditTime: 2024-03-13 13:54:48
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -33,6 +33,7 @@
|
||||
<el-select
|
||||
v-model="dataForm.roomNameDict"
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%"
|
||||
placeholder="请选择车间名称">
|
||||
<el-option
|
||||
|
@ -84,7 +84,7 @@
|
||||
<el-radio :label="1">产品基础BOM</el-radio>
|
||||
<el-radio :label="2">工艺扩展BOM</el-radio>
|
||||
</el-radio-group> -->
|
||||
<el-select v-model="dataForm.materialMethod" placeholder="请选择物料计算方式" style="width: 100%;" @change="materialMethodChange">
|
||||
<el-select v-model="dataForm.materialMethod" placeholder="请选择物料计算方式" style="width: 100%;" clearable @change="materialMethodChange">
|
||||
<el-option key="1" label="产品基础BOM" :value="1" />
|
||||
<el-option key="2" label="工艺扩展BOM" :value="2" />
|
||||
</el-select>
|
||||
@ -92,7 +92,7 @@
|
||||
</el-col>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="优先级" prop="priority">
|
||||
<el-select v-model="dataForm.priority" placeholder="请选择优先级" style="width: 100%;">
|
||||
<el-select v-model="dataForm.priority" clearable placeholder="请选择优先级" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)"
|
||||
:key="item.value"
|
||||
@ -104,7 +104,7 @@
|
||||
</el-col>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="工单类型" prop="type">
|
||||
<el-select v-model="dataForm.type" placeholder="请选择工单类型" style="width: 100%;">
|
||||
<el-select v-model="dataForm.type" clearable placeholder="请选择工单类型" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in workOrderTypeList"
|
||||
:key="item.id"
|
||||
@ -121,6 +121,7 @@
|
||||
<el-select
|
||||
v-model="dataForm.roomNameDict"
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%"
|
||||
placeholder="请选择车间名称">
|
||||
<el-option
|
||||
@ -133,7 +134,7 @@
|
||||
</el-col>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="关联产线" prop="productLineIds">
|
||||
<el-select v-model="dataForm.productLineIds" placeholder="请选择关联产线" multiple style="width: 100%;">
|
||||
<el-select v-model="dataForm.productLineIds" clearable placeholder="请选择关联产线" multiple style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in productLineList"
|
||||
:key="item.id"
|
||||
@ -145,7 +146,7 @@
|
||||
</el-col>
|
||||
<el-col :span='8'>
|
||||
<el-form-item label="负责人" prop="workers">
|
||||
<el-input v-model="dataForm.workers" placeholder="请输入负责人"></el-input>
|
||||
<el-input v-model="dataForm.workers" clearable placeholder="请输入负责人"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -204,7 +205,8 @@ export default {
|
||||
planAssignQuantity: [{ required: true, message: "计划投入数量不能为空", trigger: "blur" }],
|
||||
planQuantity: [{ required: true, message: "计划生产数量不能为空", trigger: "blur" }],
|
||||
roomNameDict: [{ required: true, message: "车间名称不能为空", trigger: "blur" }],
|
||||
productLineIds: [{ required: true, message: "关联产线不能为空", trigger: "change" }]
|
||||
productLineIds: [{ required: true, message: "关联产线不能为空", trigger: "change" }],
|
||||
materialMethod: [{ required: true, message: "物料计算方式不能为空", trigger: "change" }]
|
||||
},
|
||||
productList: [],
|
||||
processFlowList: [],
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-02-29 10:01:52
|
||||
* @LastEditTime: 2024-03-13 14:47:44
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -18,15 +18,28 @@
|
||||
<div class="content">
|
||||
<div class="formContent">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">工单名称:{{ dataForm.name }}</el-col>
|
||||
<el-col :span="12">工单编码:{{ dataForm.code }}</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">工单名称</div>
|
||||
<div class="lightTip">{{ dataForm.name }}</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">工单编码</div>
|
||||
<div class="lightTip">{{ dataForm.code }}</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">产品名称</div>
|
||||
<div class="lightTip">{{ dataForm.productName }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">产品名称:{{ dataForm.productName }}</el-col>
|
||||
<el-col :span="12">产品规格:{{ dataForm.specifications }}</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">实际生产数量:{{ dataForm.expectedTime }}</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">产品规格</div>
|
||||
<div class="lightTip">{{ dataForm.specifications }}</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">实际生产数量</div>
|
||||
<div class="lightTip">{{ dataForm.expectedTime }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
@ -296,4 +309,18 @@ export default {
|
||||
margin-bottom: 10px;
|
||||
width: 100%;
|
||||
}
|
||||
.blodTip {
|
||||
height: 16px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: rgba(0,0,0,0.85);
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.lightTip {
|
||||
/* height: 16px; */
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: rgba(102,102,102,0.75);
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
</style>
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-02-29 15:35:02
|
||||
* @LastEditTime: 2024-03-13 14:42:32
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -274,6 +274,10 @@ const tableProps1 = [
|
||||
prop: 'remaining',
|
||||
label: '剩余生产预计消耗'
|
||||
},
|
||||
{
|
||||
prop: 'num',
|
||||
label: '库存数量'
|
||||
}
|
||||
];
|
||||
|
||||
export default {
|
||||
|
@ -28,7 +28,7 @@
|
||||
<el-form-item
|
||||
label="报警级别"
|
||||
prop="grade"
|
||||
:rules="[{ required: true, message: '报警级别不能为空', trigger: 'blur' }]">
|
||||
:rules="[{ required: false, message: '报警级别不能为空', trigger: 'blur' }]">
|
||||
<el-select
|
||||
:disabled="disabled"
|
||||
v-model="dataForm.grade"
|
||||
|
@ -7,10 +7,11 @@
|
||||
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible="visible"
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
:wrapper-closable="true"
|
||||
class="drawer"
|
||||
:before-close="beforeClose"
|
||||
custom-class="mes-drawer"
|
||||
:size="size || '50%'"
|
||||
@closed="$emit('destroy')">
|
||||
@ -43,7 +44,51 @@
|
||||
:rows="formRows" /> -->
|
||||
|
||||
<!-- <el-row v-if="mode.includes('detail')" style="margin-bottom: 24px"> -->
|
||||
<el-row style="margin-bottom: 24px">
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="dataForm"
|
||||
label-width="100px"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="设备"
|
||||
prop="equipmentId"
|
||||
:rules="[{ required: true, message: '设备不能为空', trigger: 'change' }]">
|
||||
<el-select
|
||||
:disabled="isdetail"
|
||||
v-model="dataForm.equipmentId"
|
||||
placeholder="请选择设备"
|
||||
@change="$emit('update', dataForm)">
|
||||
<el-option
|
||||
v-for="opt in equipmentList"
|
||||
:key="opt.id"
|
||||
:label="opt.name"
|
||||
:value="opt.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="报警分组"
|
||||
prop="groupId"
|
||||
:rules="[{ required: true, message: '报警分组不能为空', trigger: 'change' }]">
|
||||
<el-select
|
||||
:disabled="isdetail"
|
||||
v-model="dataForm.groupId"
|
||||
placeholder="请选择报警分组"
|
||||
@change="$emit('update', dataForm)">
|
||||
<el-option
|
||||
v-for="opt in grouList"
|
||||
:key="opt.id"
|
||||
:label="opt.name"
|
||||
:value="opt.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<!-- <el-row style="margin-bottom: 24px">
|
||||
<el-col :span="8">
|
||||
<div
|
||||
class="title"
|
||||
@ -62,7 +107,7 @@
|
||||
{{ form.code }}
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
<!-- <el-row v-else style="margin-bottom: 24px" :gutter="20">
|
||||
<el-form ref="form" :model="form">
|
||||
<el-col :span="8">
|
||||
@ -128,12 +173,11 @@
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<div v-if="!mode.includes('detail')" class="drawer-body__footer">
|
||||
<el-button style="" @click="handleCancel">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
v-if="!mode.includes('detail')"
|
||||
@click="handleCancel">
|
||||
@click="handleSave">
|
||||
确定
|
||||
</el-button>
|
||||
</div>
|
||||
@ -163,6 +207,8 @@
|
||||
<script>
|
||||
import BaseInfoForm from '@/components/DialogForm';
|
||||
import DialogForm from './dialogForm';
|
||||
import { getEquipmentList, getgroupAllList } from '@/api/equipment/base/config/config'
|
||||
import { updateEquipmentBindGroup } from '@/api/base/equipmentBindGroup';
|
||||
|
||||
const SmallTitle = {
|
||||
name: 'SmallTitle',
|
||||
@ -191,16 +237,21 @@ const SmallTitle = {
|
||||
|
||||
export default {
|
||||
components: { SmallTitle, DialogForm, BaseInfoForm },
|
||||
props: ['sections', 'defaultMode', 'dataId', 'size'], // dataId 作为一个通用的存放id的字段
|
||||
props: ['sections', 'defaultMode', 'dataId', 'size', 'equipmentId', 'id'], // dataId 作为一个通用的存放id的字段
|
||||
data() {
|
||||
return {
|
||||
mode: '',
|
||||
visible: false,
|
||||
showForm: false,
|
||||
isdetail: false,
|
||||
formLoading: false,
|
||||
grouList: [],
|
||||
equipmentList: [],
|
||||
total: 0,
|
||||
form: {},
|
||||
list: [],
|
||||
attrTitle: '',
|
||||
dataForm: {},
|
||||
attrForm: {
|
||||
id: null,
|
||||
equipmentGroupId: '',
|
||||
@ -325,6 +376,34 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// handleSave() {
|
||||
// updateEquipmentBindGroup(this.form).then((response) => {
|
||||
// this.$modal.msgSuccess('修改成功');
|
||||
// this.open = false;
|
||||
// this.getList();
|
||||
// });
|
||||
// },
|
||||
async getDict() {
|
||||
const res = await getEquipmentList({
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
special: false
|
||||
})
|
||||
this.equipmentList = res.data.list
|
||||
const groupRes = await getgroupAllList()
|
||||
this.grouList = groupRes.data
|
||||
},
|
||||
beforeClose(done) {
|
||||
if (this.mode.includes('edit')) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done();
|
||||
})
|
||||
.catch(_ => {});
|
||||
} else {
|
||||
done()
|
||||
}
|
||||
},
|
||||
handleTableBtnClick({ type, data }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
@ -342,6 +421,16 @@ export default {
|
||||
|
||||
init() {
|
||||
this.visible = true;
|
||||
// 设备分组传值
|
||||
// this.dataForm = {
|
||||
// equipmentId: this.equipmentId,
|
||||
// groupId: this.dataId
|
||||
// }
|
||||
this.getDict()
|
||||
this.$set(this.dataForm, 'equipmentId', this.equipmentId)
|
||||
this.$set(this.dataForm, 'groupId', this.dataId)
|
||||
this.$set(this.dataForm, 'id', this.id)
|
||||
this.isdetail = this.mode === 'detail' ? true : false
|
||||
},
|
||||
|
||||
async getAttrList() {
|
||||
@ -360,9 +449,9 @@ export default {
|
||||
if (valid) {
|
||||
const isEdit = !this.mode.includes('detail');
|
||||
await this.$axios({
|
||||
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
|
||||
url: '/base/equipment-bind-group/update',
|
||||
method: isEdit ? 'put' : 'post',
|
||||
data: this.form,
|
||||
data: this.dataForm,
|
||||
});
|
||||
this.$modal.msgSuccess(`${isEdit ? '更新' : '创建'}成功`);
|
||||
this.visible = false;
|
||||
|
@ -48,6 +48,8 @@
|
||||
size="45%"
|
||||
:default-mode="editMode"
|
||||
:data-id="alarmForm.id"
|
||||
:equipment-id="equipmentId"
|
||||
:id="id"
|
||||
:sections="[
|
||||
{
|
||||
name: '基本信息',
|
||||
@ -220,7 +222,7 @@ export default {
|
||||
{
|
||||
select: true,
|
||||
label: '设备',
|
||||
url: '/base/core-equipment/page?pageNo=1&pageSize=100',
|
||||
url: '/base/core-equipment/page?pageNo=1&pageSize=100&special=false',
|
||||
prop: 'equipmentId',
|
||||
bind: {
|
||||
filterable: true,
|
||||
@ -266,6 +268,8 @@ export default {
|
||||
equipmentGroupCode: undefined,
|
||||
equipmentGroupName: undefined,
|
||||
},
|
||||
equipmentId: undefined,
|
||||
id: undefined,
|
||||
editVisible: false,
|
||||
editMode: '',
|
||||
drawerBaseInfoRows: [
|
||||
@ -440,6 +444,8 @@ export default {
|
||||
this.alarmForm.id = groupId;
|
||||
this.alarmForm.equipmentGroupCode = groupCode;
|
||||
this.alarmForm.equipmentGroupName = groupName;
|
||||
this.equipmentId = equipmentId;
|
||||
this.id = id;
|
||||
this.editVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['drawer'].init();
|
||||
|
@ -379,7 +379,7 @@ export default {
|
||||
});
|
||||
this.searchBarFormConfig[1].selectOptions = plcList.map((item) => {
|
||||
return {
|
||||
name: item.name,
|
||||
name: item.code,
|
||||
id: item.id,
|
||||
};
|
||||
});
|
||||
@ -463,7 +463,8 @@ export default {
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = '添加设备与实时采集关系表(一对多)';
|
||||
this.title = '添加设备采集配置';
|
||||
this.$refs.addOrUpdate.init()
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
@ -472,7 +473,7 @@ export default {
|
||||
getEquipmentPlcConnect(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = '修改设备与实时采集关系表(一对多)';
|
||||
this.title = '修改设备采集配置';
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-02-22 10:08:13
|
||||
* @LastEditTime: 2024-03-13 16:47:02
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -39,9 +39,9 @@
|
||||
|
||||
<script>
|
||||
import basicAdd from '../../../../core/mixins/basic-add';
|
||||
import { createCorePL, updateCorePL, getCorePL, getCode, getCorePLList } from "@/api/base/coreProductionLine";
|
||||
import { createCorePL, updateCorePL, getCorePL, getCode } from "@/api/base/coreProductionLine";
|
||||
import { createEquipmentPlcConnect, updateEquipmentPlcConnect } from '@/api/base/equipmentPlcConnect';
|
||||
import { getplcAllList, listByParentId } from "@/api/equipment/base/config/config";
|
||||
import { getplcAllList, getTree } from "@/api/equipment/base/config/config";
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
@ -95,22 +95,29 @@ export default {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
})
|
||||
},
|
||||
async getDict() {
|
||||
// 关联表名列表
|
||||
const res = await getplcAllList();
|
||||
this.plcList = res.data;
|
||||
// 产线列表
|
||||
const res1 = await getCorePLList();
|
||||
// 树形结构
|
||||
const res1 = await getTree();
|
||||
this.plLineList = res1.data;
|
||||
this.plLineList.forEach(item => {
|
||||
listByParentId({ id: item.id }).then(resp => {
|
||||
if (resp.data.length > 0) {
|
||||
// item.children = resp.data
|
||||
this.$set(item, 'children', resp.data)
|
||||
// this.$forceUpdate()
|
||||
}
|
||||
})
|
||||
})
|
||||
// const res1 = await getCorePLList();
|
||||
// this.plLineList = res1.data;
|
||||
// this.plLineList.forEach(item => {
|
||||
// listByParentId({ id: item.id }).then(resp => {
|
||||
// if (resp.data.length > 0) {
|
||||
// // item.children = resp.data
|
||||
// this.$set(item, 'children', resp.data)
|
||||
// // this.$forceUpdate()
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
|
@ -98,12 +98,12 @@ export default {
|
||||
addContent: false,
|
||||
searchBarKeys: ['name', 'actualCheckTime'],
|
||||
tableBtn: [
|
||||
// this.$auth.hasPermi('equipment:check-record:detail')
|
||||
// ? {
|
||||
// type: 'detail',
|
||||
// btnName: '详情',
|
||||
// }
|
||||
// : undefined,
|
||||
this.$auth.hasPermi('equipment:check-record:detail')
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
}
|
||||
: undefined,
|
||||
// this.$auth.hasPermi('equipment:check-record:update')
|
||||
// ? {
|
||||
// type: 'edit',
|
||||
@ -122,7 +122,7 @@ export default {
|
||||
{ prop: 'department', label: '部门' },
|
||||
{ prop: 'actualCheckTime', label: '巡检时间', filter: parseTime },
|
||||
{ prop: 'groupClass', label: '班次' },
|
||||
{ prop: 'opt', label: '巡检内容', name: '详情', subcomponent: btn },
|
||||
// { prop: 'opt', label: '巡检内容', name: '详情', subcomponent: btn },
|
||||
{ prop: 'remark', label: '备注' }
|
||||
// { prop: 'origin', label: '数据来源', filter: (val) => ['', '手动', 'PDA'][val] },
|
||||
// { prop: 'sectionName', label: '计划巡检时间' },
|
||||
@ -416,10 +416,14 @@ export default {
|
||||
.catch(() => {});
|
||||
},
|
||||
handleDetail({ id }) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.addContent = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id, true);
|
||||
this.$refs.addContent.init(id, true);
|
||||
});
|
||||
// this.addOrUpdateVisible = true
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.addOrUpdate.init(id, true);
|
||||
// });
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
|
@ -73,7 +73,7 @@ const remainBox = {
|
||||
color() {
|
||||
if (this.value) {
|
||||
const v = +this.value;
|
||||
return v < 0 ? 'red' : v >= 0 && v < 2 ? 'yellow' : 'green';
|
||||
return v <= 1 ? 'red' : v > 1 && v <= 2 ? 'yellow' : 'green';
|
||||
}
|
||||
return 'unset';
|
||||
},
|
||||
@ -84,9 +84,10 @@ const remainBox = {
|
||||
style={`background: ${
|
||||
this.color
|
||||
}; position:absolute; inset: 0; padding: 0 10px; display: flex; align-items: center; color: ${
|
||||
this.color == 'red' ? '#fff' : 'unset'
|
||||
// this.color == 'red' ? '#fff' : 'unset'
|
||||
'#fff'
|
||||
}`}>
|
||||
{this.injectData[this.injectData.prop] || ''}
|
||||
{this.injectData[this.injectData.prop]?.toFixed(0) || ''}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
@ -128,22 +129,26 @@ export default {
|
||||
// width: 180,
|
||||
// filter: parseTime(createTime),
|
||||
// },
|
||||
{ prop: 'code', label: '保养计划单号' },
|
||||
{ prop: 'name', label: '保养计划名称' },
|
||||
{ prop: 'departmentName', label: '部门' },
|
||||
{ prop: 'lineName', label: '产线名' },
|
||||
{ prop: 'code', label: '保养计划单号', minWidth: 118, showOverflowtooltip: true },
|
||||
{ prop: 'name', label: '保养计划名称', minWidth: 118, showOverflowtooltip: true },
|
||||
{ prop: 'departmentName', label: '部门', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'lineName', label: '产线名', minWidth: 100, showOverflowtooltip: true },
|
||||
{
|
||||
prop: 'lastPlanMaintainTime',
|
||||
label: '上次计划保养时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'lastMaintainTime',
|
||||
label: '上次实际保养时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{ prop: 'nextPlanMaintainTime', label: '下次计划保养时间', filter: parseTime },
|
||||
{ prop: 'maintainer', label: '计划保养人员' },
|
||||
{ prop: 'nextPlanMaintainTime', label: '下次计划保养时间', filter: parseTime, minWidth: 160, showOverflowtooltip: true },
|
||||
{ prop: 'maintainer', label: '计划保养人员', minWidth: 160, showOverflowtooltip: true },
|
||||
// { prop: 'equipmentName', label: '设备名称' },
|
||||
// { prop: 'equipmentCode', label: '设备编码' },
|
||||
// { prop: 'maintenancePeriod', label: '保养频率' },
|
||||
@ -153,11 +158,12 @@ export default {
|
||||
// filter: publicFormatter(this.DICT_TYPE.MAINTAIN_TYPE),
|
||||
// },
|
||||
// { prop: 'opt1', label: '设备保养', name: '操作', subcomponent: btn },
|
||||
{ prop: 'opt2', label: '保养内容', name: '详情', subcomponent: btn },
|
||||
{ prop: 'opt2', label: '保养内容', name: '详情', subcomponent: btn, width: 100 },
|
||||
{
|
||||
prop: 'remainDays',
|
||||
label: '距离下次保养剩余时间(天)',
|
||||
subcomponent: remainBox,
|
||||
minWidth: 210,
|
||||
}
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
@ -232,23 +238,24 @@ export default {
|
||||
.catch(() => { });
|
||||
},
|
||||
initSearchBar() {
|
||||
this.http('/base/core-equipment/page', 'get', {
|
||||
special: false,
|
||||
pageNo: 1,
|
||||
pageSize: 99
|
||||
}).then(({ data }) => {
|
||||
this.$set(
|
||||
this.searchBarFormConfig[1],
|
||||
'selectOptions',
|
||||
(data?.list || []).map((item) => ({
|
||||
name: item.name,
|
||||
id: item.id,
|
||||
}))
|
||||
);
|
||||
});
|
||||
// this.http('/base/core-equipment/page', 'get', {
|
||||
// special: false,
|
||||
// pageNo: 1,
|
||||
// pageSize: 99
|
||||
// }).then(({ data }) => {
|
||||
// this.$set(
|
||||
// this.searchBarFormConfig[1],
|
||||
// 'selectOptions',
|
||||
// (data?.list || []).map((item) => ({
|
||||
// name: item.name,
|
||||
// id: item.id,
|
||||
// }))
|
||||
// );
|
||||
// });
|
||||
this.http('/base/equipment-maintain-plan/page', 'get', {
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
special: false
|
||||
}).then(({ data }) => {
|
||||
this.$set(
|
||||
this.searchBarFormConfig[0],
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-02-28 19:52:13
|
||||
* @LastEditTime: 2024-03-13 15:55:36
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -67,7 +67,7 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="确认时限(h)" prop="confirmTimeLimit">
|
||||
<el-input-number v-model="dataForm.confirmTimeLimit" :min="0" controls-position="right" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入单位平方数" />
|
||||
<el-input-number v-model="dataForm.confirmTimeLimit" :min="0" controls-position="right" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入确认时限" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -64,6 +64,7 @@ import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import Editor from '@/components/Editor';
|
||||
import { deleteEqMaintainLog, exportMaintainLogExcel } from '@/api/equipment/base/maintain/record';
|
||||
import AddContent from './addContent.vue';
|
||||
import { parseTime } from '../../../../core/mixins/code-filter';
|
||||
|
||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
@ -174,6 +175,7 @@ export default {
|
||||
endPlaceholder: '结束日期',
|
||||
defaultTime: ['00:00:00', '23:59:59'],
|
||||
param: 'startTime',
|
||||
defaultSelect: []
|
||||
// width: 350,
|
||||
},
|
||||
// {
|
||||
@ -349,23 +351,28 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
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.startTime = [start, end]
|
||||
this.initSearchBar();
|
||||
if (this.$route.query) {
|
||||
// this.queryParams.equipmentId =
|
||||
// this.$route.query?.equipmentId ?? undefined;
|
||||
this.queryParams.maintainPlanId =
|
||||
this.$route.query?.maintainPlanId ?? undefined;
|
||||
// this.queryParams.relatePlan = this.$route.query?.relatePlan ?? undefined;
|
||||
this.queryParams.startTime = this.$route.query?.createTime ?? undefined;
|
||||
// this.searchBarFormConfig[0].defaultSelect =
|
||||
// this.$route.query.equipmentId ?? undefined;
|
||||
this.searchBarFormConfig[0].defaultSelect =
|
||||
this.$route.query.maintainPlanId ?? undefined;
|
||||
this.searchBarFormConfig[1].defaultSelect =
|
||||
this.$route.query?.createTime ?? undefined;
|
||||
// this.searchBarFormConfig[3].defaultSelect =
|
||||
// Number(this.$route.query.relatePlan) ?? undefined;
|
||||
}
|
||||
// if (this.$route.query) {
|
||||
// // this.queryParams.equipmentId =
|
||||
// // this.$route.query?.equipmentId ?? undefined;
|
||||
// this.queryParams.maintainPlanId =
|
||||
// this.$route.query?.maintainPlanId ?? undefined;
|
||||
// // this.queryParams.relatePlan = this.$route.query?.relatePlan ?? undefined;
|
||||
// this.queryParams.startTime = this.$route.query?.createTime ?? undefined;
|
||||
// // this.searchBarFormConfig[0].defaultSelect =
|
||||
// // this.$route.query.equipmentId ?? undefined;
|
||||
// this.searchBarFormConfig[0].defaultSelect =
|
||||
// this.$route.query.maintainPlanId ?? undefined;
|
||||
// this.searchBarFormConfig[1].defaultSelect =
|
||||
// this.$route.query?.createTime ?? undefined;
|
||||
// // this.searchBarFormConfig[3].defaultSelect =
|
||||
// // Number(this.$route.query.relatePlan) ?? undefined;
|
||||
// }
|
||||
this.getList();
|
||||
if (this.$route.query.addRecord) {
|
||||
this.handleAdd()
|
||||
|
Loading…
Reference in New Issue
Block a user