projects/mesxc-dy #254

Merged
juzi merged 2 commits from projects/mesxc-dy into projects/mesxc-test 2024-03-20 09:00:08 +08:00
19 changed files with 327 additions and 132 deletions

View File

@ -6,3 +6,12 @@ export function getLineAll() {
method: 'get'
})
}
// 根据车间获得所有工厂产线列表
export function getLinelistByRoom(query) {
return request({
url: '/base/core-production-line/listFilter',
method: 'get',
params: query
})
}

View File

@ -123,6 +123,7 @@
filterable
clearable
style="width: 100%"
@change="setLine"
placeholder="请选择车间名称">
<el-option
v-for="(dict, index) in getDictDatas('workshop')"
@ -163,7 +164,7 @@
import { getProductAll } from '@/api/base/product'
import { getProcessFlowList, workOrderList } from '@/api/base/orderManage'
import { createCoreWO, updateCoreWO, getCode, getCoreWO } from '@/api/base/coreWorkOrder'
import { getLineAll } from '@/api/base/productionLine'
import { getLinelistByRoom, getLineAll } from '@/api/base/productionLine'
import basicAdd from '../../core/mixins/basic-add';
export default {
@ -225,6 +226,14 @@ export default {
this.getDict()
},
methods: {
setLine() {
// 线
getLinelistByRoom({
room: this.dataForm.roomNameDict
}).then(res => {
this.productLineList = res.data || []
})
},
//
materialMethodChange(val) {
if (val === 2 && !this.dataForm.processFlowId) {

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-03-13 14:47:44
* @LastEditTime: 2024-03-15 15:34:58
* @Description:
-->
<template>
@ -17,30 +17,47 @@
</small-title>
<div class="content">
<div class="formContent">
<el-form :model="dataForm" ref="dataForm" label-width="120px" label-position="top" class="demo-ruleForm" :rules="rules">
<el-row :gutter="20">
<el-col :span="8">
<div class="blodTip">工单名称</div>
<div class="lightTip">{{ dataForm.name }}</div>
<el-form-item label="工单名称" prop="name">
<!-- <el-input v-model="dataForm.name" autocomplete="off"></el-input> -->
<span>{{ dataForm.name }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<div class="blodTip">工单编码</div>
<div class="lightTip">{{ dataForm.code }}</div>
<el-form-item label="工单编码" prop="code">
<span>{{ dataForm.code }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<div class="blodTip">产品名称</div>
<div class="lightTip">{{ dataForm.productName }}</div>
<el-form-item label="产品名称" prop="productName">
<span>{{ dataForm.productName }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<div class="blodTip">产品规格</div>
<div class="lightTip">{{ dataForm.specifications }}</div>
<el-form-item label="产品规格" prop="specifications">
<span>{{ dataForm.specifications }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<div class="blodTip">实际生产数量</div>
<div class="lightTip">{{ dataForm.expectedTime }}</div>
<el-form-item label="实际生产数量" prop="actualQuantity">
<el-input v-model.number="dataForm.actualQuantity" autocomplete="off" style="width: 80%" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="实际生产完成时间" prop="finishProduceTime">
<el-date-picker
v-model="dataForm.finishProduceTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="attr-list">
@ -99,11 +116,11 @@
</div>
<div class="drawer-body__footer">
<el-button style="" type="primary" @click="goback()">关闭</el-button>
<el-button style="" @click="goback()">取消</el-button>
<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()">
编辑
</el-button>
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button> -->
</el-button> -->
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</div>
</div>
@ -117,7 +134,7 @@
<script>
import basicAdd from '../../core/mixins/basic-add';
import { getConOrderList, updateConCoreWOr, getCoreWO } from '@/api/base/coreWorkOrder';
import { getConOrderList, updateConCoreWOr, getCoreWO, statusChange } from '@/api/base/coreWorkOrder';
import SmallTitle from '../material/SmallTitle';
// import { parseTime } from '../../core/mixins/code-filter';
// import attrAdd from './attr-add';
@ -148,11 +165,43 @@ export default {
tableData: [],
visible: false,
isdetail: false,
idAttrShow: false
idAttrShow: false,
rules: {
name: [{ required: true, message: "工单名称不能为空", trigger: "blur" }],
finishProduceTime: [{ required: true, message: "实际生产完成时间不能为空", trigger: "change" }]
},
};
},
mounted() {},
methods: {
//
dataFormSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
//
if (this.dataForm.id) {
statusChange({
id: this.dataForm.id,
status: 4,
finishProduceTime: this.dataForm.finishProduceTime,
actualQuantity: this.dataForm.actualQuantity
}).then(response => {
this.$modal.msgSuccess("操作成功!工单状态稍后将会更新!");
this.visible = false;
this.$emit("refreshDataList");
});
return;
}
//
// this.urlOptions.createURL(this.dataForm).then(response => {
// this.$modal.msgSuccess("");
// this.visible = false;
// this.$emit("refreshDataList");
// });
});
},
initData() {
// this.materialAttrList.splice(0);
this.listQuery.total = 0;
@ -255,6 +304,9 @@ export default {
};
</script>
<style scoped>
/* .item .el-form-item__label {
color: red;
} */
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
display: flex;
@ -263,6 +315,7 @@ export default {
.drawer >>> .el-form-item__label {
padding: 0;
font-weight: 600;
}
.drawer >>> .el-drawer__header {

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-03-13 14:42:32
* @LastEditTime: 2024-03-15 15:40:24
* @Description:
-->
<template>
@ -97,6 +97,10 @@
<div class="blodTip">关联工艺</div>
<div class="lightTip">{{ dataForm.processFlowName }}</div>
</el-col>
<el-col :span="3">
<div class="blodTip">车间名称</div>
<div class="lightTip">{{ (dataForm.roomNameDict || dataForm.roomNameDict === 0) ? getDictDataLabel('workshop', dataForm.roomNameDict) : '-' }}</div>
</el-col>
</el-row>
</div>
</div>

View File

@ -431,6 +431,7 @@ export default {
opration = '终止'
}
console.log('22',val)
if (param.status !== 4) {
this.$confirm(`确定${opration}${'"工单' + val.data.name + '"'}?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@ -445,14 +446,18 @@ export default {
onClose: () => {
this.getDataList();
//
if (param.status === 4) {
this.allocationOrder(param);
}
// if (param.status === 4) {
// this.allocationOrder(param);
// }
},
});
});
})
.catch(() => { });
} else {
//
this.allocationOrder(param);
}
}
},
allocationOrder(val) {
@ -460,7 +465,7 @@ export default {
getConOrderList({
workOrderId: val.id,
}).then((response) => {
if (response.data.length > 0) {
this.$confirm('工单结束,可分配产量', "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@ -469,11 +474,16 @@ export default {
.then(() => {
this.allocationVisible = true;
this.$nextTick(() => {
this.$refs.allocation.init(val.id, true);
if (response.data.length > 0) {
// id
this.$refs.allocation.init(val.id);
} else {
this.$refs.allocation.init();
}
});
})
.catch(() => { });
}
// this.listQuery.total = response.data.total;
});
},

View File

@ -46,6 +46,7 @@
import BalanceChart from '../balanceChart';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import AnalysisChart from './chart.vue';
import { parseTime } from '@/utils/ruoyi'
export default {
components: {
@ -82,7 +83,7 @@ export default {
{
type: 'datePicker',
label: '时间',
dateType: 'monthrange',
dateType: 'month',
format: 'yyyy-MM',
valueFormat: 'timestamp',
rangeSeparator: '-',
@ -255,13 +256,13 @@ export default {
const date = eq.dynamicName;
eq.children.forEach((sub) => {
if (sub.dynamicName == '设备CT')
row[date + '_eq_ct'] = sub.dynamicValue;
row[date + '_eq_ct'] = sub?.dynamicValue?.toFixed(2);
if (sub.dynamicName == '设备TT')
row[date + '_eq_tt'] = sub.dynamicValue;
row[date + '_eq_tt'] = sub?.dynamicValue?.toFixed(2);
if (sub.dynamicName == '产线CT')
row[date + '_pl_ct'] = sub.dynamicValue;
row[date + '_pl_ct'] = sub.dynamicValue?.toFixed(2);
if (sub.dynamicName == '产线TT')
row[date + '_pl_tt'] = sub.dynamicValue;
row[date + '_pl_tt'] = sub.dynamicValue?.toFixed(2);
});
});
this.tableData.push(row);
@ -369,21 +370,63 @@ export default {
// this.dataListLoading = false;
});
},
changeTime(val) {
console.log(val)
if(val) {
const timeStamp = new Date(val).getMonth(); //
console.log('沃尔沃', timeStamp)
const fullyear = new Date(val).getFullYear()
let days = 0
switch (timeStamp) {
case 0:
case 2:
case 4:
case 6:
case 7:
case 9:
case 11:
days = 31
break
case 3:
case 4:
case 8:
case 10:
days = 30
break
case 1:
if ((fullyear % 400 === 0) || (fullyear % 4 === 0 && fullyear % 100 !== 0)) {
days = 29
} else {
days = 28
}
break
}
this.queryParams.startTime = new Date(fullyear, timeStamp, 1, 0, 0, 0).getTime() //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.queryParams.endTime = new Date(fullyear, timeStamp, days, 23, 59, 59).getTime() //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
} else {
this.queryParams.startTime = undefined
this.queryParams.endTime = undefined
}
},
handleSearchBarBtnClick(btn) {
switch (btn.btnName) {
case 'search':
this.queryParams.lineId = btn.lineIds || null;
this.queryParams.startTime = btn.timeArr ? btn.timeArr[0] : null;
this.queryParams.endTime = btn.timeArr ? btn.timeArr[1] : null;
console.log('2222', new Date(btn.timeArr).getFullYear())
this.changeTime(btn.timeArr)
// this.queryParams.startTime = btn.timeArr ? btn.timeArr[0] : null;
// this.queryParams.endTime = btn.timeArr ? btn.timeArr[1] : null;
if (!btn.lineIds || !btn.timeArr.length) {
if (!btn.lineIds || !btn.timeArr) {
this.$message({
message: '请选择产线和时间',
type: 'warning',
});
}
} else {
this.getList();
}
break;
}
},

View File

@ -35,20 +35,20 @@ import {
} from '@/api/equipment/analysis/statistics';
const tableProps = [
{
prop: 'recordTime',
label: '时间段',
filter: (val) => {
if (val && val.length > 0) {
return (
moment(val[0]).format('YYYY-MM-DD HH:mm:ss') +
' ~ ' +
moment(val[1]).format('YYYY-MM-DD HH:mm:ss')
);
}
return '-';
},
},
// {
// prop: 'recordTime',
// label: '',
// filter: (val) => {
// if (val && val.length > 0) {
// return (
// moment(val[0]).format('YYYY-MM-DD HH:mm:ss') +
// ' ~ ' +
// moment(val[1]).format('YYYY-MM-DD HH:mm:ss')
// );
// }
// return '-';
// },
// },
{
prop: 'lineName',
label: '产线',
@ -158,7 +158,7 @@ export default {
: '',
btnName: '导出',
name: 'export',
color: 'warning',
color: 'primary',
plain: true,
},
],

View File

@ -19,6 +19,7 @@
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-data="list"
max-height="600"
@emitFun="handleEmitFun">
<!-- <method-btn
v-if="tableBtn.length"
@ -93,17 +94,29 @@ export default {
{ prop: 'downCount', label: '故障次数' },
],
searchBarFormConfig: [
// {
// type: 'select',
// label: '',
// placeholder: '',
// param: 'month',
// selectOptions: Array(12)
// .fill(0)
// .map((v, i) => ({
// id: i + 1,
// name: `${i + 1}`,
// })),
// },
{
type: 'select',
label: '请选择月份',
placeholder: '请选择月份',
type: 'datePicker',
label: '时间',
dateType: 'month',
format: 'yyyy-MM',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
width: 240,
param: 'month',
selectOptions: Array(12)
.fill(0)
.map((v, i) => ({
id: i + 1,
name: `${i + 1}`,
})),
},
{
__index: 'line',
@ -111,6 +124,7 @@ export default {
label: '产线',
placeholder: '请选择产线',
param: 'lineId',
filterable: true
},
{
type: 'button',
@ -164,7 +178,13 @@ export default {
},
});
if (code === 0) {
this.list = data;
this.list = data.map(item => {
item.mtbf = item.mtbf?.toFixed(2)
item.mttr = item.mttr?.toFixed(2)
item.workTime = item.workTime?.toFixed(2)
item.downTime = item.downTime?.toFixed(2)
return item
});
} else {
this.list.splice(0);
}
@ -174,12 +194,14 @@ export default {
switch (btn.btnName) {
case 'search':
if (btn.month) {
this.queryParams.recordTime = [
moment()
.month(btn.month - 1)
.format('YYYY-MM') + '-01 00:00:00',
moment().month(btn.month).format('YYYY-MM') + '-01 00:00:00',
];
// this.queryParams.recordTime = [
// moment()
// .month(btn.month - 1)
// .format('YYYY-MM') + '-01 00:00:00',
// moment().month(btn.month).format('YYYY-MM') + '-01 00:00:00',
// ];
this.queryParams.recordTime = [btn.month, moment().month(new Date(btn.month).getMonth() + 1).format('YYYY-MM') + '-01 00:00:00']
console.log(btn.month, moment().month(new Date(btn.month).getMonth() + 1).format('YYYY-MM') + '-01 00:00:00')
} else {
this.queryParams.recordTime = null;
}

View File

@ -464,7 +464,9 @@ export default {
this.reset();
this.open = true;
this.title = '添加设备采集配置';
this.$nextTick(() => {
this.$refs.addOrUpdate.init()
})
},
/** 修改按钮操作 */
handleUpdate(row) {

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-03-13 16:47:02
* @LastEditTime: 2024-03-15 18:54:23
* @Description:
-->
<template>

View File

@ -99,7 +99,7 @@
<el-option
v-for="plc in plcList"
:key="plc.id"
:label="plc.name"
:label="plc.plcTableName"
:value="plc.id"></el-option>
</el-select>
</el-form-item>
@ -404,9 +404,9 @@ export default {
this.eqList = data;
});
this.$axios({
url: '/base/equipment-plc/page',
url: '/base/equipment-plc/listAll',
}).then(({ code, data }) => {
this.plcList = data.list;
this.plcList = data;
});
}
for (const section of this.sections) {

View File

@ -2,14 +2,15 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-03-04 11:14:28
* @LastEditTime: 2024-03-18 15:47:20
* @Description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="isdetail"
:wrapper-closable="true"
:before-close="beforeClose"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">
@ -269,6 +270,17 @@ export default {
this.getDict()
},
methods: {
beforeClose(done) {
if (!this.isdetail) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {});
} else {
done()
}
},
async getDict() {
//
const res = await groupClassesListAll();
@ -372,6 +384,7 @@ export default {
if (id) {
this.idAttrShow = true
} else {
this.dataForm.checkPerson = [this.$store.getters.nickname]
this.idAttrShow = false
}

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-03-01 19:44:59
* @LastEditTime: 2024-03-15 18:38:52
* @Description:
-->
<template>
@ -27,7 +27,7 @@
<el-form-item
label="部门"
prop="departmentId"
:rules="[{ required: true, message: '请选择部门', trigger: 'blur' }]">
:rules="[{ required: false, message: '请选择部门', trigger: 'blur' }]">
<el-select
v-model="dataForm.departmentId"
:placeholder="`请选择部门`"

View File

@ -17,7 +17,7 @@
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="180"
:width="120"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
@ -52,6 +52,7 @@ import basicPageMixin from '@/mixins/lb/basicPageMixin';
import addOrUpdata from './add-or-updata.vue';
import add from './add.vue';
import { parseTime } from '../../../../core/mixins/code-filter';
import { groupClassesListAll } from '@/api/monitoring/teamProduction';
// import { publicFormatter } from '@/utils/dict';
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
@ -111,6 +112,12 @@ export default {
width: 150,
filter: parseTime,
},
{
prop: 'checkPeriod',
label: '巡检频率(天/次)',
width: 150,
showOverflowtooltip: true,
},
{
prop: 'confirmTimeLimit',
label: '确认时限',

View File

@ -220,7 +220,7 @@
label="维修工"
prop="repairman"
:rules="[
{ required: true, message: '维修工不能为空', trigger: 'blur' },
{ required: false, message: '维修工不能为空', trigger: 'blur' },
]">
<el-select
v-model="form.repairman"
@ -262,7 +262,7 @@
prop="repairMode"
:rules="[
{
required: true,
required: false,
message: '维修方式不能为空',
trigger: 'blur',
},

View File

@ -83,33 +83,41 @@ export default {
data() {
return {
tableProps: [
{ prop: 'equipmentName', label: '设备名称' },
{ prop: 'equipmentCode', label: '设备编码' },
{ prop: 'inQuantity', label: '投入数' },
{ prop: 'outQuantity', label: '产出数' },
{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true },
{ prop: 'equipmentCode', label: '设备编码', minWidth: 150, showOverflowtooltip: true },
{ prop: 'inQuantity', label: '投入数', minWidth: 80, showOverflowtooltip: true },
{ prop: 'outQuantity', label: '产出数', minWidth: 80, showOverflowtooltip: true },
{
prop: 'run',
label: '是否运行',
filter: (val) => (val != null ? (val ? '是' : '否') : ''),
minWidth: 100,
showOverflowtooltip: true
},
{
prop: 'status',
label: '状态',
filter: (val) =>
val != null ? ['正常', '计划停机', '故障'][val] : '',
minWidth: 90,
showOverflowtooltip: true
},
{
prop: 'error',
label: '是否故障',
filter: (val) => (val != null ? (val ? '是' : '否') : ''),
minWidth: 100,
showOverflowtooltip: true
},
{
prop: 'quantityRecordTime',
label: '生产量记录时间',
filter: parseTime,
minWidth: 150,
showOverflowtooltip: true
},
{ prop: 'statusRecordTime', label: '状态记录时间', filter: parseTime },
{ prop: 'opt1', label: '状态可视化', name: '查看', subcomponent: btn },
{ prop: 'statusRecordTime', label: '状态记录时间', filter: parseTime, minWidth: 150, showOverflowtooltip: true },
// { prop: 'opt1', label: '', name: '', subcomponent: btn },
{ prop: 'opt2', label: '参数监控', name: '查看', subcomponent: btn },
],
searchBarForm: {

View File

@ -17,7 +17,7 @@
padding: 16px 16px 0;
border-radius: 8px;
">
<div class="blue-title">生产节拍时序图</div>
<!-- <div class="blue-title">生产节拍时序图</div> -->
<!-- <h1>设备状态时序图</h1> -->
<!-- 搜索工作栏 -->
<SearchBar
@ -76,6 +76,7 @@
<script>
import LineChart from './components/lineChart.vue';
import moment from 'moment';
// import response from './response.json';
export default {
@ -84,6 +85,7 @@ export default {
props: {},
data() {
return {
moment,
startTime: null, // new Date(2023, 8, 26, 0, 0, 0, 0).getTime(),
accumulators: new Map(),
searchBarFormConfig: [
@ -94,6 +96,7 @@ export default {
selectOptions: [],
param: 'lineId',
onchange: true,
filterable: true
},
{
type: 'select',
@ -101,11 +104,12 @@ export default {
placeholder: '请选择工段',
selectOptions: [],
param: 'sectionId',
filterable: true
},
//
{
type: 'datePicker',
label: '时间段',
label: '日期',
dateType: 'date', // datetimerange
// format: 'yyyy-MM-dd HH:mm:ss',
format: 'yyyy-MM-dd',
@ -263,7 +267,11 @@ export default {
this.initProductline();
this.initWorksection();
this.initEquipment();
// this.getList();
let end = moment().format('YYYY-MM-DD 23:59:59')
let start = moment().format('YYYY-MM-DD 00:00:00')
this.searchBarFormConfig[2].defaultSelect = start
this.queryParams.recordTime = [start, end]
this.getList();
},
methods: {
handleSearchBarBtnClick({ btnName, ...payload }) {
@ -293,8 +301,10 @@ export default {
},
handleSearchBarChanged({ param, value }) {
this.searchBarFormConfig[1].defaultSelect = null
if (!value) {
this.searchBarFormConfig[1].selectOptions = [];
// this.searchBarFormConfig[1].defaultSelect = null
return;
}
switch (param) {
@ -486,7 +496,10 @@ export default {
const { code, data } = await this.$axios({
url: '/monitoring/equipment-monitor/quantity-series',
method: 'get',
params: this.queryParams,
params: {
equipmentId: this.queryParams.equipmentId,
recordTime: this.queryParams.recordTime
}
});
this.queryParams.equipmentId = null; //

View File

@ -17,7 +17,7 @@
padding: 16px 16px 0;
border-radius: 8px;
">
<div class="blue-title">生产节拍时序图</div>
<!-- <div class="blue-title">生产节拍时序图</div> -->
<SearchBar
:formConfigs="searchBarFormConfig"
ref="search-bar"
@ -119,6 +119,7 @@ export default {
selectOptions: [],
param: 'lineId',
onchange: true,
filterable: true
},
{
type: 'select',
@ -126,6 +127,7 @@ export default {
placeholder: '请选择工段',
selectOptions: [],
param: 'sectionId',
filterable: true
},
//
{

View File

@ -272,7 +272,7 @@ export default {
{ prop: 'lineName', label: '产线' },
{ prop: 'sectionName', label: '工段' },
// { prop: 'externalCode', label: '' },
{ prop: 'equipmentId', label: '设备编码' },
{ prop: 'equipmentCode', label: '设备编码' },
{ prop: 'equipmentName', label: '设备名称' },
{ prop: 'totalQuantity', label: '加工数量' },
],