test #47

Merged
gtz217 merged 273 commits from test into master 2023-10-17 08:53:54 +08:00
4 changed files with 63 additions and 20 deletions
Showing only changes of commit 90695acefd - Show all commits

View File

@ -118,12 +118,12 @@ export default {
{ {
width: 128, width: 128,
prop: 'workTime', prop: 'workTime',
label: '工作时长', label: '工作时长[h]',
}, },
{ {
width: 128, width: 128,
prop: 'workRate', prop: 'workRate',
label: '百分比', label: '百分比[%]',
filter: (val) => (val != null ? +val.toFixed(3) : '-'), filter: (val) => (val != null ? +val.toFixed(3) : '-'),
}, },
], ],
@ -134,9 +134,9 @@ export default {
{ {
width: 128, width: 128,
prop: 'stopTime', prop: 'stopTime',
label: '停机时长', label: '停机时长[h]',
}, },
{ width: 128, prop: 'stopRate', label: '百分比' }, { width: 128, prop: 'stopRate', label: '百分比[%]' },
], ],
}, },
{ {
@ -145,10 +145,10 @@ export default {
{ {
width: 128, width: 128,
prop: 'downTime', prop: 'downTime',
label: '故障时长', label: '故障时长[h]',
filter: (val) => (val != null ? +val.toFixed(3) : '-'), filter: (val) => (val != null ? +val.toFixed(3) : '-'),
}, },
{ width: 128, prop: 'downRate', label: '百分比' }, { width: 128, prop: 'downRate', label: '百分比[%]' },
{ {
width: 128, width: 128,
prop: 'timeEfficiency', prop: 'timeEfficiency',

View File

@ -24,6 +24,7 @@
:formConfigs="searchBarFormConfig" :formConfigs="searchBarFormConfig"
ref="search-bar" ref="search-bar"
:remove-blue="true" :remove-blue="true"
@select-changed="handleSearchBarSelectChange"
@headBtnClick="handleSearchBarBtnClick" /> @headBtnClick="handleSearchBarBtnClick" />
</el-row> </el-row>
@ -195,6 +196,7 @@ export default {
placeholder: '请选择产线', placeholder: '请选择产线',
selectOptions: [], selectOptions: [],
param: 'lineId', param: 'lineId',
onchange: true,
}, },
{ {
type: 'select', type: 'select',
@ -592,6 +594,28 @@ export default {
} }
}, },
handleSearchBarSelectChange({ param, value }) {
switch (param) {
case 'lineId':
this.$axios({
url: '/base/workshop-section/listByParentId',
method: 'get',
params: {
id: value,
},
}).then(({ code, data }) => {
if (code == 0) {
this.searchBarFormConfig[1].selectOptions = data.map((item) => {
return {
name: item.name,
id: item.id,
};
});
}
});
}
},
handleSearchBarBtnClick({ btnName, ...payload }) { handleSearchBarBtnClick({ btnName, ...payload }) {
switch (btnName) { switch (btnName) {
case 'search': case 'search':

View File

@ -8,7 +8,7 @@
<template> <template>
<el-form <el-form
ref="form" ref="form"
:model="dataForm" :model="innerDataForm"
label-width="100px" label-width="100px"
v-loading="formLoading"> v-loading="formLoading">
<el-row :gutter="20"> <el-row :gutter="20">
@ -18,11 +18,11 @@
prop="inspectionDetId" prop="inspectionDetId"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]"> :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select <el-select
v-model="dataForm.inspectionDetId" v-model="innerDataForm.inspectionDetId"
placeholder="请选择检测内容" placeholder="请选择检测内容"
filterable filterable
clearable clearable
@change="$emit('update', dataForm)"> @change="handleInspectionDetChange">
<el-option <el-option
v-for="opt in inspectionDetList" v-for="opt in inspectionDetList"
:key="opt.value" :key="opt.value"
@ -38,11 +38,11 @@
prop="source" prop="source"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]"> :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select <el-select
v-model="dataForm.source" v-model="innerDataForm.source"
placeholder="请选择来源" placeholder="请选择来源"
filterable filterable
clearable clearable
@change="$emit('update', dataForm)"> @change="$emit('update', innerDataForm)">
<el-option <el-option
v-for="opt in [ v-for="opt in [
{ label: '手动', value: 1 }, { label: '手动', value: 1 },
@ -165,6 +165,7 @@ export default {
productionLineList: [], productionLineList: [],
sectionList: [], sectionList: [],
innerDataForm: {}, innerDataForm: {},
cacheInspectionDetList: null,
}; };
}, },
mounted() { mounted() {
@ -175,15 +176,18 @@ export default {
); );
}, },
watch: { watch: {
'innerDataForm.productionLineId': { // 'innerDataForm.productionLineId': {
handler: async function (plId) { // handler: async function (plId) {
if (plId) await this.getWorksectionList(plId); // if (plId) await this.getWorksectionList(plId);
}, // },
immediate: true, // immediate: true,
}, // },
dataForm: { dataForm: {
handler: function (dataForm) { handler: function (dataForm) {
this.innerDataForm = JSON.parse(JSON.stringify(dataForm)); this.innerDataForm = Object.assign({}, dataForm);
if (dataForm.productionLineId)
this.getWorksectionList(dataForm.productionLineId);
}, },
immediate: true, immediate: true,
}, },
@ -196,16 +200,28 @@ export default {
resetFields(args) { resetFields(args) {
return this.$refs.form.resetFields(args); return this.$refs.form.resetFields(args);
}, },
handleInspectionDetChange(value) {
const { id, content } = this.cacheInspectionDetList.find(
(item) => item.id == value
);
this.innerDataForm.inspectionDetId = id;
this.innerDataForm.inspectionDetContent = content;
this.$emit('update', this.innerDataForm);
},
async handleProductlineChange(id) { async handleProductlineChange(id) {
await this.getWorksectionList(id); // await this.getWorksectionList(id);
this.innerDataForm.sectionId = null; this.innerDataForm.sectionId = null;
this.$emit('update', this.innerDataForm); this.$emit('update', this.innerDataForm);
}, },
// getCode // getCode
async getCode(url) { async getCode(url) {
const response = await this.$axios(url); const response = await this.$axios(url);
return response.data; return response.data;
}, },
// 线 // 线
async getProductLineList() { async getProductLineList() {
const response = await this.$axios('/base/production-line/listAll'); const response = await this.$axios('/base/production-line/listAll');
@ -214,16 +230,19 @@ export default {
value: item.id, value: item.id,
})); }));
}, },
// //
async getInspectionDetList() { async getInspectionDetList() {
const response = await this.$axios( const response = await this.$axios(
'/base/quality-inspection-det/listAll' '/base/quality-inspection-det/listAll'
); );
this.cacheInspectionDetList = response.data;
this.inspectionDetList = response.data.map((item) => ({ this.inspectionDetList = response.data.map((item) => ({
label: item.content, label: item.content,
value: item.id, value: item.id,
})); }));
}, },
// //
async getWorksectionList(plId) { async getWorksectionList(plId) {
const response = await this.$axios( const response = await this.$axios(

View File

@ -147,7 +147,7 @@ export default {
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
name: '单位/片', name: '检测数量',
nameTextStyle: { nameTextStyle: {
color: '#999', color: '#999',
fontSize: 14, fontSize: 14,