projects/mes-zhp #418

Merged
juzi merged 4 commits from projects/mes-zhp into projects/mes-test 2025-01-08 16:21:21 +08:00
10 changed files with 155 additions and 151 deletions
Showing only changes of commit 04a5359eda - Show all commits

View File

@ -78,3 +78,11 @@ export function deleteLogDet(id) {
method: 'delete'
})
}
export function getEqMaintainPlanPageData(query) {
return request({
url: '/base/equipment-maintain-plan-det/page',
method: 'get',
params: query
})
}

View File

@ -119,12 +119,12 @@ export default {
return {
searchBarKeys: ['groupId', 'equipmentName'],
tableBtn: [
this.$auth.hasPermi('equipment:bind-group:update')
? {
type: 'detail',
btnName: '查看报警',
}
: undefined,
// this.$auth.hasPermi('equipment:bind-group:update')
// ? {
// type: 'detail',
// btnName: '',
// }
// : undefined,
this.$auth.hasPermi('equipment:bind-group:update')
? {
type: 'edit',
@ -372,7 +372,7 @@ export default {
handleTableBtnClick({ data, type }) {
switch (type) {
case 'edit':
this.handleDetail(data, 'edit');
this.handleUpdate(data)
break;
case 'delete':
this.handleDelete(data);
@ -432,19 +432,19 @@ export default {
});
},
//
handleDetail(row, mode = 'detail') {
const { equipmentId, equipmentName, groupCode, groupId, groupName, id } =
row;
//
this.editMode = mode;
this.alarmForm.id = groupId;
this.alarmForm.equipmentGroupCode = groupCode;
this.alarmForm.equipmentGroupName = groupName;
this.editVisible = true;
this.$nextTick(() => {
this.$refs['drawer'].init();
});
},
// handleDetail(row, mode = 'detail') {
// const { equipmentId, equipmentName, groupCode, groupId, groupName, id } =
// row;
// //
// this.editMode = mode;
// this.alarmForm.id = groupId;
// this.alarmForm.equipmentGroupCode = groupCode;
// this.alarmForm.equipmentGroupName = groupName;
// this.editVisible = true;
// this.$nextTick(() => {
// this.$refs['drawer'].init();
// });
// },
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;

View File

@ -198,8 +198,8 @@ export default {
},
{
type: 'select',
label: '关联表编码',
placeholder: '请选择关联表编码',
label: '标识名称',
placeholder: '请选择标识名称',
param: 'plcId',
selectOptions: [],
filterable: true,

View File

@ -195,7 +195,9 @@ export default {
},
methods: {
/** 批量确认 */
async searchBarClicked(btn) {
async handleSearchBarBtnClick(btn) {
console.log(11111);
switch (btn.btnName) {
case 'batchConfirm':
if (this.$refs['waiting-list-table'].selectedPlan.length == 0) {
@ -260,6 +262,15 @@ export default {
})
.catch(() => { });
break;
case 'search':
this.getList()
break;
case 'add':
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init();
});
break;
}
},
handleSelectionChange(list) {

View File

@ -37,8 +37,8 @@
</el-form>
<div class="blue-title">保养内容</div>
<base-table v-loading="dataListLoading" :table-props="tableProps" :table-data="tableData">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" />
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" /> -->
</base-table>
</div>
</el-drawer>

View File

@ -289,7 +289,7 @@ export default {
const id = row.id;
this.info({ id }).then((response) => {
this.form = response.data;
this.form.responsible = this.form.responsible ? this.form.responsible.split(',') : undefined
// this.form.responsible = this.form.responsible ? this.form.responsible.split(',') : undefined
this.open = true;
this.title = '修改备品备件配置';
});
@ -300,7 +300,7 @@ export default {
if (!valid) {
return;
}
this.form.responsible = this.form.responsible.join(',')
// this.form.responsible = this.form.responsible.join(',')/
//
if (this.form.id != null) {
this.put(this.form).then((response) => {

View File

@ -136,8 +136,8 @@ export default {
select: true,
label: '备件名称',
prop: 'productMaterialId',
url: '/base/core-product-material/listAll', // TODO:
// options: [],
// url: '/base/core-product-material/listAll', // TODO:
options: [],
bind: {
filterable: true,
clearable: false,
@ -404,17 +404,16 @@ export default {
.catch(() => {});
},
async getDict() {
const materRes = await getMaterialTree();
let typeId = materRes.data.find((item) => item.product === 2);
const listQuery = {
typeId: typeId,
};
const materData = await getMaterialList(listQuery);
this.rows[0][0].options = (materData.data || []).map((item) => ({
label: item.name,
value: item.id,
...item
}));
// const materRes = await getMaterialTree();
// let typeId = materRes.data.find((item) => item.product === 2);
// const listQuery = {
// typeId: typeId,
// };
const materData = await getMaterialList();
this.rows[0][0].options = (materData.data || []).filter(item => item.typeId === 3)
.map(item => ({ label: item.name, value: item.id,...item }))
console.log(this.rows[0][0].options);
},
updateDialogFormZ(val) {
// console.log(this.rows[0][0].options)

View File

@ -62,8 +62,8 @@ function getTodayStart(today) {
/** 颜色配置 */
const types = [
{ name: '运行', color: '#288AFF' },
{ name: '故障', color: '#FC9C91' },
{ name: '计划停机', color: '#FFDC94' },
{ name: '故障', color: '#FC9C91' },
{ name: '空白', color: '#F2F4F9' },
];
@ -251,7 +251,7 @@ export default class GanttGraph {
y: 0,
},
data: arr.map(item => ({
name: ['运行', '故障', '计划停机'][item.status],
name: ['运行', '计划停机', '故障'][item.status],
value: [0, item.startTime, item.startTime + item.duration * 60 * 1000, 0],
itemStyle: {
color: types[item.status].color,

View File

@ -6,29 +6,19 @@
-->
<template>
<div
class="status-timegraph-container"
style="background: #f2f4f9; flex: 1; display: flex; flex-direction: column">
<el-row
class=""
style="
<div class="status-timegraph-container" style="background: #f2f4f9; flex: 1; display: flex; flex-direction: column">
<el-row class="" style="
margin-bottom: 12px;
background: #fff;
padding: 16px 16px 0;
border-radius: 8px;
">
<div class="blue-title">生产节拍时序图</div>
<SearchBar
:formConfigs="searchBarFormConfig"
ref="search-bar"
:remove-blue="true"
@select-changed="handleSearchBarSelectChange"
@headBtnClick="handleSearchBarBtnClick" />
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" :remove-blue="true"
@select-changed="handleSearchBarSelectChange" @headBtnClick="handleSearchBarBtnClick" />
</el-row>
<el-row
class=""
style="
<el-row class="" style="
height: 1px;
flex: 1;
margin-bottom: 12px;
@ -47,48 +37,28 @@
<div class="icon running"></div>
<div>运行中</div>
</div>
<div class="legend">
<div class="icon fault"></div>
<div>故障</div>
</div>
<div class="legend">
<div class="icon stop"></div>
<div>计划停机</div>
</div>
<div class="legend">
<div class="icon fault"></div>
<div>故障</div>
</div>
</el-col>
</el-row>
<div
class="main-area"
style="flex: 1; display: flex; flex-direction: column">
<div
class="graphs"
v-show="graphList.length"
id="status-chart"
style="height: 1px; flex: 1"></div>
<div class="main-area" style="flex: 1; display: flex; flex-direction: column">
<div class="graphs" v-show="graphList.length" id="status-chart" style="height: 1px; flex: 1"></div>
<h2 v-if="!graphList || graphList.length == 0" class="no-data-bg"></h2>
</div>
</el-row>
<!-- 对话框(添加 / 修改) -->
<base-dialog
dialogTitle="添加设备"
:dialogVisible="open"
width="500px"
@close="open = false"
@cancel="open = false"
<base-dialog dialogTitle="添加设备" :dialogVisible="open" width="500px" @close="open = false" @cancel="open = false"
@confirm="submitForm">
<el-select
v-if="open"
style="width: 100%"
filterable
clearable
v-model="queryParams.equipmentId"
<el-select v-if="open" style="width: 100%" filterable clearable v-model="queryParams.equipmentId"
placeholder="请选择一个设备">
<el-option
v-for="eq in eqList"
:key="eq.id"
:value="eq.id"
:label="eq.name"></el-option>
<el-option v-for="eq in eqList" :key="eq.id" :value="eq.id" :label="eq.name"></el-option>
</el-select>
</base-dialog>
</div>
@ -103,12 +73,6 @@ export default {
components: {},
props: {},
data() {
const today = new Date();
const todayStart = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate()
);
return {
chart: null,
searchBarFormConfig: [
@ -138,7 +102,7 @@ export default {
placeholder: '选择日期',
param: 'recordTime',
required: true,
defaultSelect: moment(todayStart).format('YYYY-MM-DD HH:mm:ss'),
defaultSelect:null,
},
{
type: 'button',
@ -196,9 +160,19 @@ export default {
this.initProductline();
this.initWorksection();
this.initEquipment();
},
mounted() {
const today = new Date();
const todayStart = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate()
);
this.searchBarFormConfig[2].defaultSelect = moment(todayStart).format('YYYY-MM-DD HH:mm:ss')
console.log('111111', this.searchBarFormConfig[2].defaultSelect)
// this.getList();
},
mounted() {},
// mounted() {},
watch: {
graphList: {
handler(val) {
@ -323,6 +297,7 @@ export default {
},
}).then(({ code, data }) => {
if (code == 0) {
this.searchBarFormConfig[2].defaultSelect = null
this.searchBarFormConfig[1].selectOptions = data.map((item) => {
return {
name: item.name,

View File

@ -91,6 +91,12 @@ export default {
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'button',
btnName: '返回',
name: 'return',
color: 'primary',
},
],
queryParams: {
@ -279,6 +285,8 @@ export default {
},
async handleSearchBarBtnClick({ btnName, timeVal }) {
console.log(btnName);
if (btnName === 'search') {
if (timeVal && timeVal.length > 0) {
console.log('nihc ', timeVal)
if (new Date(timeVal[1]).getTime() - new Date(timeVal[0]).getTime() <= 30 * 60 * 1000) {
@ -290,6 +298,9 @@ export default {
} else {
this.queryParams.recordTime = [];
this.$message.warning('时间段必选!')
}
} else {
this.$router.go(-1)
}
},