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

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2024-03-13 14:47:44 * @LastEditTime: 2024-03-15 15:34:58
* @Description: * @Description:
--> -->
<template> <template>
@ -17,30 +17,47 @@
</small-title> </small-title>
<div class="content"> <div class="content">
<div class="formContent"> <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-row :gutter="20">
<el-col :span="8"> <el-col :span="8">
<div class="blodTip">工单名称</div> <el-form-item label="工单名称" prop="name">
<div class="lightTip">{{ dataForm.name }}</div> <!-- <el-input v-model="dataForm.name" autocomplete="off"></el-input> -->
<span>{{ dataForm.name }}</span>
</el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<div class="blodTip">工单编码</div> <el-form-item label="工单编码" prop="code">
<div class="lightTip">{{ dataForm.code }}</div> <span>{{ dataForm.code }}</span>
</el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<div class="blodTip">产品名称</div> <el-form-item label="产品名称" prop="productName">
<div class="lightTip">{{ dataForm.productName }}</div> <span>{{ dataForm.productName }}</span>
</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="8">
<div class="blodTip">产品规格</div> <el-form-item label="产品规格" prop="specifications">
<div class="lightTip">{{ dataForm.specifications }}</div> <span>{{ dataForm.specifications }}</span>
</el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<div class="blodTip">实际生产数量</div> <el-form-item label="实际生产数量" prop="actualQuantity">
<div class="lightTip">{{ dataForm.expectedTime }}</div> <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-col>
</el-row> </el-row>
</el-form>
</div> </div>
<div class="attr-list"> <div class="attr-list">
@ -99,11 +116,11 @@
</div> </div>
<div class="drawer-body__footer"> <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 v-if="isdetail" type="primary" @click="goEdit()">
编辑 编辑
</el-button> </el-button> -->
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button> --> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</div> </div>
</div> </div>
@ -117,7 +134,7 @@
<script> <script>
import basicAdd from '../../core/mixins/basic-add'; 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 SmallTitle from '../material/SmallTitle';
// import { parseTime } from '../../core/mixins/code-filter'; // import { parseTime } from '../../core/mixins/code-filter';
// import attrAdd from './attr-add'; // import attrAdd from './attr-add';
@ -148,11 +165,43 @@ export default {
tableData: [], tableData: [],
visible: false, visible: false,
isdetail: false, isdetail: false,
idAttrShow: false idAttrShow: false,
rules: {
name: [{ required: true, message: "工单名称不能为空", trigger: "blur" }],
finishProduceTime: [{ required: true, message: "实际生产完成时间不能为空", trigger: "change" }]
},
}; };
}, },
mounted() {}, mounted() {},
methods: { 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() { initData() {
// this.materialAttrList.splice(0); // this.materialAttrList.splice(0);
this.listQuery.total = 0; this.listQuery.total = 0;
@ -255,6 +304,9 @@ export default {
}; };
</script> </script>
<style scoped> <style scoped>
/* .item .el-form-item__label {
color: red;
} */
.drawer >>> .el-drawer { .drawer >>> .el-drawer {
border-radius: 8px 0 0 8px; border-radius: 8px 0 0 8px;
display: flex; display: flex;
@ -263,6 +315,7 @@ export default {
.drawer >>> .el-form-item__label { .drawer >>> .el-form-item__label {
padding: 0; padding: 0;
font-weight: 600;
} }
.drawer >>> .el-drawer__header { .drawer >>> .el-drawer__header {

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2024-03-13 14:42:32 * @LastEditTime: 2024-03-15 15:40:24
* @Description: * @Description:
--> -->
<template> <template>
@ -97,6 +97,10 @@
<div class="blodTip">关联工艺</div> <div class="blodTip">关联工艺</div>
<div class="lightTip">{{ dataForm.processFlowName }}</div> <div class="lightTip">{{ dataForm.processFlowName }}</div>
</el-col> </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> </el-row>
</div> </div>
</div> </div>

View File

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

View File

@ -46,6 +46,7 @@
import BalanceChart from '../balanceChart'; import BalanceChart from '../balanceChart';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import AnalysisChart from './chart.vue'; import AnalysisChart from './chart.vue';
import { parseTime } from '@/utils/ruoyi'
export default { export default {
components: { components: {
@ -82,7 +83,7 @@ export default {
{ {
type: 'datePicker', type: 'datePicker',
label: '时间', label: '时间',
dateType: 'monthrange', dateType: 'month',
format: 'yyyy-MM', format: 'yyyy-MM',
valueFormat: 'timestamp', valueFormat: 'timestamp',
rangeSeparator: '-', rangeSeparator: '-',
@ -255,13 +256,13 @@ export default {
const date = eq.dynamicName; const date = eq.dynamicName;
eq.children.forEach((sub) => { eq.children.forEach((sub) => {
if (sub.dynamicName == '设备CT') if (sub.dynamicName == '设备CT')
row[date + '_eq_ct'] = sub.dynamicValue; row[date + '_eq_ct'] = sub?.dynamicValue?.toFixed(2);
if (sub.dynamicName == '设备TT') if (sub.dynamicName == '设备TT')
row[date + '_eq_tt'] = sub.dynamicValue; row[date + '_eq_tt'] = sub?.dynamicValue?.toFixed(2);
if (sub.dynamicName == '产线CT') if (sub.dynamicName == '产线CT')
row[date + '_pl_ct'] = sub.dynamicValue; row[date + '_pl_ct'] = sub.dynamicValue?.toFixed(2);
if (sub.dynamicName == '产线TT') if (sub.dynamicName == '产线TT')
row[date + '_pl_tt'] = sub.dynamicValue; row[date + '_pl_tt'] = sub.dynamicValue?.toFixed(2);
}); });
}); });
this.tableData.push(row); this.tableData.push(row);
@ -369,21 +370,63 @@ export default {
// this.dataListLoading = false; // 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) { handleSearchBarBtnClick(btn) {
switch (btn.btnName) { switch (btn.btnName) {
case 'search': case 'search':
this.queryParams.lineId = btn.lineIds || null; this.queryParams.lineId = btn.lineIds || null;
this.queryParams.startTime = btn.timeArr ? btn.timeArr[0] : null; console.log('2222', new Date(btn.timeArr).getFullYear())
this.queryParams.endTime = btn.timeArr ? btn.timeArr[1] : null; 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({ this.$message({
message: '请选择产线和时间', message: '请选择产线和时间',
type: 'warning', type: 'warning',
}); });
} } else {
this.getList(); this.getList();
}
break; break;
} }
}, },

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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