This commit is contained in:
朱文强 2024-04-03 15:11:06 +08:00
rodzic d8a2b3d301
commit 89e51af775
6 zmienionych plików z 383 dodań i 187 usunięć

49
src/api/oth/equipment.js Normal file
Wyświetl plik

@ -0,0 +1,49 @@
/*
* @Author: zwq
* @Date: 2024-04-02 14:13:57
* @LastEditors: zwq
* @LastEditTime: 2024-04-03 10:54:07
* @Description:
*/
import request from '@/utils/request'
// 获得设备保养记录日志分页
export function getEquipmentLogPage(query) {
return request({
url: '/asrs/mes-equipment-parts-maintenance-log/page',
method: 'get',
params: query
})
}
// 获得设备保养操作日志分页
export function getEquipmentPage(query) {
return request({
url: '/asrs/mes-equipment-parts-maintenance/page',
method: 'get',
params: query
})
}
// 润滑
export function update(data) {
return request({
url: '/asrs/mes-equipment-parts-maintenance/oiling',
method: 'post',
data: data
})
}
// 更换
export function up(data) {
return request({
url: '/asrs/mes-equipment-parts-maintenance/update',
method: 'post',
data: data
})
}
// 清洗
export function clean(data) {
return request({
url: '/asrs/mes-equipment-parts-maintenance/clean',
method: 'post',
data: data
})
}

Wyświetl plik

@ -1,147 +0,0 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import basicPage from '../mixins/basic-page';
import { parseTime } from '../mixins/code-filter';
import { getHeavenlyEyeLogPage } from '@/api/oth/heavenlyEyeLog';
const tableProps = [
{
prop: 'reqInterface',
label: '请求接口',
},
{
prop: 'reqParameter',
label: '请求参数',
},
{
prop: 'errorCode',
label: '返回编码',
},
{
prop: 'cmd',
label: '返回请求接口',
},
{
prop: 'msgId',
label: '返回msgId',
},
{
prop: 'retStatus',
label: '返回状态',
},
{
prop: 'fastName',
label: '返回指定区域',
},
{
prop: 'areaName',
label: '返回复合区域',
},
{
prop: 'list',
label: '返回集合',
},
{
prop: 'createTime',
label: '时间',
filter: parseTime,
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getHeavenlyEyeLogPage,
},
tableProps,
tableData: [],
formConfig: [
{
type: 'input',
label: '请求接口',
placeholder: '请求接口',
param: 'code',
},
{
type: 'input',
label: '请求参数',
placeholder: '请求参数',
param: 'name',
},
{
type: 'datePicker',
label: '订单出货日期',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'button',
btnName: '重置',
name: 'reset',
},
],
};
},
components: {},
created() {},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.reqInterface = val.code;
this.listQuery.reqParameter = val.name;
this.listQuery.createTime = val.searchTime;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : '';
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : '';
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>

Wyświetl plik

@ -0,0 +1,85 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2024-04-03 10:59:47
* @Description:
-->
<template>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="120px">
<el-form-item label="部件编号" prop="partCode">
<el-input v-model="dataForm.partCode" readonly />
</el-form-item>
<el-form-item label="部件名称" prop="partName">
<el-input v-model="dataForm.partName" readonly />
</el-form-item>
<el-form-item :label="label" prop="time">
<el-date-picker
v-model="dataForm.time"
type="date"
placeholder="选择日期"
format="yyyy-MM-dd"
value-format="timestamp" />
</el-form-item>
</el-form>
</template>
<script>
import { up, clean, update } from '@/api/oth/equipment';
export default {
data() {
return {
dataForm: {
id: undefined,
time: undefined,
partName: undefined,
partCode: undefined,
},
url: '',
dataRule: {
time: [{ required: true, message: '日期不能为空', trigger: 'change' }],
},
label: '日期',
labelArr: ['下次更换日期', '下次清洗日期', '下次润滑日期'],
value: 'partReplaceTime'
};
},
methods: {
init(data, type) {
this.dataForm.id = data.id;
this.visible = true;
this.label = this.labelArr[type - 1];
this.url = [up, clean, update][type - 1];
this.value = ['partReplaceTime','partCleanTime','partLubricationTime'][type - 1]
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
this.dataForm.partCode = data.partCode;
this.dataForm.partName = data.partName;
});
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false;
}
this.dataForm[this.value] = this.dataForm.time
this.url(this.dataForm).then((response) => {
this.$modal.msgSuccess('操作成功');
this.visible = false;
this.$emit('refreshDataList');
});
});
},
formClear() {
this.$refs.dataForm.resetFields();
},
},
};
</script>

Wyświetl plik

@ -0,0 +1,204 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="140"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"/>
</base-dialog>
</div>
</template>
<script>
import AddOrUpdate from './add-or-updata';
import basicPage from '../mixins/basic-page';
import { parseTime } from '../mixins/code-filter';
import { getEquipmentPage } from '@/api/oth/equipment';
const tableProps = [
{
prop: 'partCode',
label: '部件编号',
},
{
prop: 'partName',
label: '部件名称',
},
{
prop: 'partReplaceLastTime',
label: '上次更换时间',
filter: (val)=>parseTime(val,'{y}-{m}-{d}'),
},
{
prop: 'partReplaceTime',
label: '需要更换时间',
filter: (val)=>parseTime(val,'{y}-{m}-{d}'),
},
{
prop: 'partCleanLastTime',
label: '上次清洗时间',
filter: (val)=>parseTime(val,'{y}-{m}-{d}'),
},
{
prop: 'partCleanTime',
label: '需要清洗时间',
filter: (val)=>parseTime(val,'{y}-{m}-{d}'),
},
{
prop: 'partLubricationLastTime',
label: '上次润滑时间',
filter: (val)=>parseTime(val,'{y}-{m}-{d}'),
},
{
prop: 'partLubricationTime',
label: '需要润滑时间',
filter: (val)=>parseTime(val,'{y}-{m}-{d}'),
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getEquipmentPage,
},
tableProps,
tableBtn: [
{
type: 'up',
btnName: '更换',
},
{
type: 'clean',
btnName: '清洗',
},
{
type: 'update',
btnName: '润滑',
},
],
tableData: [],
formConfig: [
{
type: 'input',
label: '部件编号',
placeholder: '部件编号',
param: 'code',
},
{
type: 'input',
label: '部件名称',
placeholder: '部件名称',
param: 'name',
},
{
type: 'datePicker',
label: '日期',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'button',
btnName: '重置',
name: 'reset',
},
],
};
},
components: { AddOrUpdate },
created() {
this.listQuery.warehouseId = undefined;
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.partCode = val.code;
this.listQuery.partName = val.name;
this.listQuery.partReplaceLastTime = val.searchTime;
this.listQuery.partReplaceTime = val.searchTime;
this.listQuery.partCleanLastTime = val.searchTime;
this.listQuery.partCleanTime = val.searchTime;
this.listQuery.partLubricationLastTime = val.searchTime;
this.listQuery.partLubricationTime = val.searchTime;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
default:
console.log(val);
}
},
//tableBtn
otherMethods(val) {
if (val.type === "clean") {
this.addOrUpdateVisible = true;
this.addOrEditTitle = "清洗";
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data,2);
});
} else if (val.type === "update") {
this.addOrUpdateVisible = true;
this.addOrEditTitle = "润滑";
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data,3);
});
} else if (val.type === "up") {
this.addOrUpdateVisible = true;
this.addOrEditTitle = "更换";
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data,1);
});
}
},
},
};
</script>

Wyświetl plik

@ -9,8 +9,7 @@
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
</base-table>
:table-data="tableData"></base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
@ -21,50 +20,43 @@
<script>
import basicPage from '../mixins/basic-page';
import codeFilter from '../mixins/code-filter';
import { parseTime } from '../mixins/code-filter';
import { getHeavenlyEyeLogPage } from '@/api/oth/heavenlyEyeLog';
import { getEquipmentLogPage } from '@/api/oth/equipment';
const tableProps = [
{
prop: 'reqInterface',
label: '请求接口',
prop: 'partCode',
label: '部件编号',
},
{
prop: 'reqParameter',
label: '请求参数',
prop: 'partName',
label: '部件名称',
},
{
prop: 'errorCode',
label: '返回编码',
prop: 'maintenanceType',
label: '保养类型',
filter: codeFilter('maintenanceType'),
},
{
prop: 'cmd',
label: '返回请求接口',
prop: 'maintenanceTime',
label: '保养时间',
filter: (val)=>parseTime(val,'{y}-{m}-{d}'),
},
];
const mainTaskType = [
{
name: '更换',
id: 1,
},
{
prop: 'msgId',
label: '返回msgId',
name: '清洗',
id: 2,
},
{
prop: 'retStatus',
label: '返回状态',
},
{
prop: 'fastName',
label: '返回指定区域',
},
{
prop: 'areaName',
label: '返回复合区域',
},
{
prop: 'list',
label: '返回集合',
},
{
prop: 'createTime',
label: '时间',
filter: parseTime,
name: '润滑',
id: 3,
},
];
export default {
@ -72,7 +64,7 @@ export default {
data() {
return {
urlOptions: {
getDataListURL: getHeavenlyEyeLogPage,
getDataListURL: getEquipmentLogPage,
},
tableProps,
tableData: [],
@ -100,6 +92,13 @@ export default {
endPlaceholder: '结束时间',
param: 'searchTime',
},
{
type: 'select',
label: '保养类型',
selectOptions: mainTaskType,
param: 'type',
defaultSelect: '',
},
{
type: 'button',
btnName: '搜索',
@ -115,18 +114,19 @@ export default {
};
},
components: {},
created() {},
created() {
this.listQuery.warehouseId = undefined;
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.reqInterface = val.code;
this.listQuery.reqParameter = val.name;
this.listQuery.createTime = val.searchTime;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : '';
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : '';
this.listQuery.partCode = val.code;
this.listQuery.partName = val.name;
this.listQuery.maintenanceTime = val.searchTime;
this.listQuery.maintenanceType = val.type;
this.getDataList();
break;
case 'reset':

Wyświetl plik

@ -2,7 +2,7 @@
/*
* @Date: 2020-12-29 16:49:28
* @LastEditors: zwq
* @LastEditTime: 2024-03-13 14:22:22
* @LastEditTime: 2024-04-02 14:16:16
* @FilePath: \basic-admin\src\filters\basicData\index.js
* @Description:
*/
@ -56,6 +56,11 @@ const table = {
1: '否',
2: '是',
},
maintenanceType: {
1: '更换',
2: '清洗',
3: '润滑',
},
specification:{
0: '卷',
},