Merge branch 'master' of https://e.coding.net/ctcdevteam/ehs/ehs_web
This commit is contained in:
commit
3b492e35b6
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="sc-form-table" ref="scFormTable">
|
<div class="sc-form-table" ref="scFormTable">
|
||||||
<el-table :data="data" ref="table" border >
|
<el-table :data="data" ref="table" border :height="tableHeight">
|
||||||
<el-table-column type="index" width="50" fixed="left">
|
<el-table-column type="index" width="50" fixed="left">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-button v-if="!hideAdd" type="primary" icon="el-icon-plus" size="small" circle @click="rowAdd"></el-button>
|
<el-button v-if="!hideAdd" type="primary" icon="el-icon-plus" size="small" circle @click="rowAdd"></el-button>
|
||||||
|
@ -39,6 +39,10 @@
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
|
tableHeight:{
|
||||||
|
type: [Number, String],
|
||||||
|
default: 300
|
||||||
|
},
|
||||||
modelValue: { type: Array, default: () => [] },
|
modelValue: { type: Array, default: () => [] },
|
||||||
addTemplate: { type: Object, default: () => {} },
|
addTemplate: { type: Object, default: () => {} },
|
||||||
placeholder: { type: String, default: "暂无数据" },
|
placeholder: { type: String, default: "暂无数据" },
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
<span class="top-line top-line-left"></span>
|
<span class="top-line top-line-left"></span>
|
||||||
{{ bigScreenName }}
|
{{ bigScreenName }}
|
||||||
<span class="top-line top-line-right"></span>
|
<span class="top-line top-line-right"></span>
|
||||||
|
<div class="backHomeBtn" style="right: 100px;" @click.prevent="backHome">返回首页</div>
|
||||||
</header>
|
</header>
|
||||||
<div id="model" class="model">
|
<div id="model" class="model">
|
||||||
<div class="top_block">
|
<div class="top_block">
|
||||||
|
@ -726,6 +727,10 @@ export default {
|
||||||
clearInterval(this.timerOther);}
|
clearInterval(this.timerOther);}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
backHome(){
|
||||||
|
// this.$router.push({ name: "user" });
|
||||||
|
window.location.href = "http://tkx.xxhhcty.xyz:8080/#/dashboard_enm";
|
||||||
|
},
|
||||||
initializeData() {
|
initializeData() {
|
||||||
this.productNum();
|
this.productNum();
|
||||||
this.waterAirData();
|
this.waterAirData();
|
||||||
|
@ -2049,7 +2054,14 @@ export default {
|
||||||
src: url("../../utils/youShe.ttf");
|
src: url("../../utils/youShe.ttf");
|
||||||
/* 字体文件相对路径 */
|
/* 字体文件相对路径 */
|
||||||
}
|
}
|
||||||
|
.backHomeBtn{
|
||||||
|
position: absolute;
|
||||||
|
top: 10px;
|
||||||
|
right: 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 22px;
|
||||||
|
border-bottom: 2px solid rgba(54, 217, 187, 1);
|
||||||
|
}
|
||||||
.container {
|
.container {
|
||||||
background: url("/public/img/photon_bg.png") no-repeat;
|
background: url("/public/img/photon_bg.png") no-repeat;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
|
|
|
@ -883,8 +883,8 @@ export default {
|
||||||
options.series[0].data = seriesData0;
|
options.series[0].data = seriesData0;
|
||||||
options.series[1].data = seriesData1;
|
options.series[1].data = seriesData1;
|
||||||
options.series[2].data = seriesData2;
|
options.series[2].data = seriesData2;
|
||||||
options.series[3].data = seriesData3;
|
options.series[3].data = seriesData4;
|
||||||
options.series[4].data = seriesData4;
|
options.series[4].data = seriesData3;
|
||||||
let hourXAxis = [];
|
let hourXAxis = [];
|
||||||
for (let i = 0; i < 24; i++) {
|
for (let i = 0; i < 24; i++) {
|
||||||
let item = i + "时";
|
let item = i + "时";
|
||||||
|
@ -922,8 +922,8 @@ export default {
|
||||||
options.series[0].data = seriesData0;
|
options.series[0].data = seriesData0;
|
||||||
options.series[1].data = seriesData1;
|
options.series[1].data = seriesData1;
|
||||||
options.series[2].data = seriesData2;
|
options.series[2].data = seriesData2;
|
||||||
options.series[3].data = seriesData3;
|
options.series[3].data = seriesData4;
|
||||||
options.series[4].data = seriesData4;
|
options.series[4].data = seriesData3;
|
||||||
let dayXAxis = [];
|
let dayXAxis = [];
|
||||||
for (let i = 1; i <= data.length; i++) {
|
for (let i = 1; i <= data.length; i++) {
|
||||||
let item = i + "日";
|
let item = i + "日";
|
||||||
|
@ -960,8 +960,8 @@ export default {
|
||||||
options.series[0].data = seriesData0;
|
options.series[0].data = seriesData0;
|
||||||
options.series[1].data = seriesData1;
|
options.series[1].data = seriesData1;
|
||||||
options.series[2].data = seriesData2;
|
options.series[2].data = seriesData2;
|
||||||
options.series[3].data = seriesData3;
|
options.series[3].data = seriesData4;
|
||||||
options.series[4].data = seriesData4;
|
options.series[4].data = seriesData3;
|
||||||
let monthXAxis = [];
|
let monthXAxis = [];
|
||||||
for (let i = 1; i <= that.month; i++) {
|
for (let i = 1; i <= that.month; i++) {
|
||||||
let item = i + "月";
|
let item = i + "月";
|
||||||
|
|
|
@ -246,7 +246,7 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
const colors = ["#647bfe", "#91CC75", "#EE6666"];
|
const colors = ["#647bfe", "#cbd3fe", "#91CC75", "#EE6666", "#CC00CC", "#551e13"];
|
||||||
let tooltip = {
|
let tooltip = {
|
||||||
show: true,
|
show: true,
|
||||||
trigger: "axis",
|
trigger: "axis",
|
||||||
|
@ -271,8 +271,8 @@ let toolbox = {
|
||||||
};
|
};
|
||||||
let legend = {
|
let legend = {
|
||||||
top: "2%",
|
top: "2%",
|
||||||
data: ["熟料", "分布电耗", "总产量"],
|
data: ["熟料", "分布电耗", "总产量"],}
|
||||||
};
|
|
||||||
let yAxis = [
|
let yAxis = [
|
||||||
{
|
{
|
||||||
type: "value",
|
type: "value",
|
||||||
|
|
|
@ -1073,8 +1073,8 @@ export default {
|
||||||
seriesData0[ind] = item.total_production;
|
seriesData0[ind] = item.total_production;
|
||||||
seriesData1[ind] = Number(item.production_hour).toFixed(2);
|
seriesData1[ind] = Number(item.production_hour).toFixed(2);
|
||||||
seriesData2[ind] = item.run_rate;
|
seriesData2[ind] = item.run_rate;
|
||||||
seriesData3[ind] = item.production_cost_unit;
|
seriesData3[ind] = item.elec_consume_unit;
|
||||||
seriesData4[ind] = item.elec_consume_unit;
|
seriesData4[ind] = item.production_cost_unit;
|
||||||
});
|
});
|
||||||
let options = { ...that.option1 };
|
let options = { ...that.option1 };
|
||||||
options.series[0].data = seriesData0;
|
options.series[0].data = seriesData0;
|
||||||
|
@ -1112,8 +1112,8 @@ export default {
|
||||||
seriesData0[ind] = item.total_production;
|
seriesData0[ind] = item.total_production;
|
||||||
seriesData1[ind] = Number(item.production_hour).toFixed(2);
|
seriesData1[ind] = Number(item.production_hour).toFixed(2);
|
||||||
seriesData2[ind] = item.run_rate;
|
seriesData2[ind] = item.run_rate;
|
||||||
seriesData3[ind] = item.production_cost_unit;
|
seriesData3[ind] = item.elec_consume_unit;
|
||||||
seriesData4[ind] = item.elec_consume_unit;
|
seriesData4[ind] = item.production_cost_unit;
|
||||||
});
|
});
|
||||||
let options = { ...that.option2 };
|
let options = { ...that.option2 };
|
||||||
options.series[0].data = seriesData0;
|
options.series[0].data = seriesData0;
|
||||||
|
@ -1150,8 +1150,8 @@ export default {
|
||||||
seriesData0[ind] = item.total_production;
|
seriesData0[ind] = item.total_production;
|
||||||
seriesData1[ind] = Number(item.production_hour).toFixed(2);
|
seriesData1[ind] = Number(item.production_hour).toFixed(2);
|
||||||
seriesData2[ind] = item.run_rate;
|
seriesData2[ind] = item.run_rate;
|
||||||
seriesData3[ind] = item.production_cost_unit;
|
seriesData3[ind] = item.elec_consume_unit;
|
||||||
seriesData4[ind] = item.elec_consume_unit;
|
seriesData4[ind] = item.production_cost_unit;
|
||||||
});
|
});
|
||||||
let options = { ...that.option3 };
|
let options = { ...that.option3 };
|
||||||
options.series[0].data = seriesData0;
|
options.series[0].data = seriesData0;
|
||||||
|
|
|
@ -279,9 +279,10 @@ let legend = {
|
||||||
let yAxis = [
|
let yAxis = [
|
||||||
{
|
{
|
||||||
type: "value",
|
type: "value",
|
||||||
name: "产量 (t)",
|
name: "总产量 (t)",
|
||||||
position: "left",
|
position: "left",
|
||||||
alignTicks: true,
|
alignTicks: true,
|
||||||
|
nameRotate: 45,
|
||||||
axisLine: {
|
axisLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
|
@ -294,26 +295,11 @@ let yAxis = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "value",
|
type: "value",
|
||||||
name: "总电耗(KW.h)",
|
nameRotate: 45,
|
||||||
|
name: "分布电耗(KW.h)",
|
||||||
position: "left",
|
position: "left",
|
||||||
alignTicks: true,
|
alignTicks: true,
|
||||||
offset: 80,
|
offset: 100,
|
||||||
axisLine: {
|
|
||||||
show: true,
|
|
||||||
lineStyle: {
|
|
||||||
color: colors[5],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
axisLabel: {
|
|
||||||
formatter: "{value}",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: "value",
|
|
||||||
name: "分布电耗(KW.h)",
|
|
||||||
position: "right",
|
|
||||||
alignTicks: true,
|
|
||||||
offset: 80,
|
|
||||||
axisLine: {
|
axisLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
|
@ -326,9 +312,11 @@ let yAxis = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "value",
|
type: "value",
|
||||||
name: "成本(元)",
|
nameRotate: 45,
|
||||||
position: "right",
|
name: "总电耗(KW.h)",
|
||||||
|
position: "left",
|
||||||
alignTicks: true,
|
alignTicks: true,
|
||||||
|
offset: 50,
|
||||||
axisLine: {
|
axisLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
|
@ -339,12 +327,13 @@ let yAxis = [
|
||||||
formatter: "{value}",
|
formatter: "{value}",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
type: "value",
|
type: "value",
|
||||||
name: "消耗(t)",
|
nameRotate: 45,
|
||||||
|
name: "成本(元)",
|
||||||
position: "right",
|
position: "right",
|
||||||
alignTicks: true,
|
alignTicks: true,
|
||||||
offset: 130,
|
|
||||||
axisLine: {
|
axisLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
|
@ -357,10 +346,11 @@ let yAxis = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "value",
|
type: "value",
|
||||||
name: "进厂(t)",
|
name: "消耗(t)",
|
||||||
position: "right",
|
position: "right",
|
||||||
alignTicks: true,
|
alignTicks: true,
|
||||||
offset: 180,
|
nameRotate: 45,
|
||||||
|
offset: 50,
|
||||||
axisLine: {
|
axisLine: {
|
||||||
show: true,
|
show: true,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
|
@ -371,6 +361,23 @@ let yAxis = [
|
||||||
formatter: "{value}",
|
formatter: "{value}",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: "value",
|
||||||
|
name: "进厂(t)",
|
||||||
|
position: "right",
|
||||||
|
alignTicks: true,
|
||||||
|
nameRotate: 45,
|
||||||
|
offset: 100,
|
||||||
|
axisLine: {
|
||||||
|
show: true,
|
||||||
|
lineStyle: {
|
||||||
|
color: colors[5],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
formatter: "{value}",
|
||||||
|
},
|
||||||
|
},
|
||||||
];
|
];
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
@ -434,18 +441,18 @@ export default {
|
||||||
yAxisIndex: 0,
|
yAxisIndex: 0,
|
||||||
data: [],
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "总电耗",
|
|
||||||
type: "bar",
|
|
||||||
yAxisIndex: 5,
|
|
||||||
data: [],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "分布电耗",
|
name: "分布电耗",
|
||||||
type: "bar",
|
type: "bar",
|
||||||
yAxisIndex: 1,
|
yAxisIndex: 1,
|
||||||
data: [],
|
data: [],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "总电耗",
|
||||||
|
type: "bar",
|
||||||
|
yAxisIndex: 5,
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "成本",
|
name: "成本",
|
||||||
type: "bar",
|
type: "bar",
|
||||||
|
@ -488,12 +495,6 @@ export default {
|
||||||
yAxisIndex: 0,
|
yAxisIndex: 0,
|
||||||
data: [],
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "总电耗",
|
|
||||||
type: "bar",
|
|
||||||
yAxisIndex: 5,
|
|
||||||
data: [],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "分布电耗",
|
name: "分布电耗",
|
||||||
type: "bar",
|
type: "bar",
|
||||||
|
@ -501,23 +502,29 @@ export default {
|
||||||
data: [],
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "成本",
|
name: "总电耗",
|
||||||
type: "bar",
|
type: "bar",
|
||||||
yAxisIndex: 2,
|
yAxisIndex: 2,
|
||||||
data: [],
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "消耗",
|
name: "成本",
|
||||||
type: "bar",
|
type: "bar",
|
||||||
yAxisIndex: 3,
|
yAxisIndex: 3,
|
||||||
data: [],
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "进厂",
|
name: "消耗",
|
||||||
type: "bar",
|
type: "bar",
|
||||||
yAxisIndex: 4,
|
yAxisIndex: 4,
|
||||||
data: [],
|
data: [],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "进厂",
|
||||||
|
type: "bar",
|
||||||
|
yAxisIndex: 5,
|
||||||
|
data: [],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -742,21 +749,21 @@ export default {
|
||||||
seriesData5[ind] = item.elec_consume;
|
seriesData5[ind] = item.elec_consume;
|
||||||
if (item.imaterial_data.length > 0) {
|
if (item.imaterial_data.length > 0) {
|
||||||
item.imaterial_data.forEach((items_n) => {
|
item.imaterial_data.forEach((items_n) => {
|
||||||
if (items_n.material_name == "湿电石渣消耗") {
|
if (items_n.material_name == "湿电石渣消耗") {
|
||||||
seriesData3[ind] = items_n.amount_consume;
|
seriesData3[ind] = items_n.amount_consume;
|
||||||
}else if(items_n.material_name == "湿电石渣进厂"){
|
}else if(items_n.material_name == "湿电石渣进厂"){
|
||||||
seriesData4[ind] = items_n.amount_consume;
|
seriesData4[ind] = items_n.amount_consume;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
let options = { ...that.option1 };
|
let options = { ...that.option1 };
|
||||||
options.series[0].data = seriesData0;
|
options.series[0].data = seriesData0;
|
||||||
options.series[1].data = seriesData1;
|
options.series[1].data = seriesData2;
|
||||||
options.series[2].data = seriesData2;
|
options.series[2].data = seriesData5;
|
||||||
options.series[3].data = seriesData3;
|
options.series[3].data = seriesData1;
|
||||||
options.series[4].data = seriesData4;
|
options.series[4].data = seriesData3;
|
||||||
options.series[5].data = seriesData5;
|
options.series[5].data = seriesData4;
|
||||||
let dayXAxis = [];
|
let dayXAxis = [];
|
||||||
for (let i = 1; i <= data.length; i++) {
|
for (let i = 1; i <= data.length; i++) {
|
||||||
let item = i + "日";
|
let item = i + "日";
|
||||||
|
@ -779,29 +786,32 @@ export default {
|
||||||
seriesData1 = [],
|
seriesData1 = [],
|
||||||
seriesData2 = [],
|
seriesData2 = [],
|
||||||
seriesData3 = [],
|
seriesData3 = [],
|
||||||
seriesData4 = [];
|
seriesData4 = [],
|
||||||
|
seriesData5 = [];
|
||||||
let data = response;
|
let data = response;
|
||||||
data.forEach((item) => {
|
data.forEach((item) => {
|
||||||
let ind = item.month_s - 1;
|
let ind = item.month_s - 1;
|
||||||
seriesData0[ind] = item.total_production;
|
seriesData0[ind] = item.total_production;
|
||||||
seriesData1[ind] = item.production_cost_unit;
|
seriesData1[ind] = item.production_cost_unit;
|
||||||
seriesData2[ind] = item.elec_consume_unit;
|
seriesData2[ind] = item.elec_consume_unit;
|
||||||
|
seriesData5[ind] = item.elec_consume;
|
||||||
if (item.imaterial_data.length > 0) {
|
if (item.imaterial_data.length > 0) {
|
||||||
item.imaterial_data.forEach((items_n) => {
|
item.imaterial_data.forEach((items_n) => {
|
||||||
if (items_n.material_name == "湿电石渣消耗") {
|
if (items_n.material_name == "湿电石渣消耗") {
|
||||||
seriesData3[ind] = items_n.amount_consume;
|
seriesData3[ind] = Math.round(items_n.amount_consume);
|
||||||
}else if(items_n.material_name == "湿电石渣进厂"){
|
}else if(items_n.material_name == "湿电石渣进厂"){
|
||||||
seriesData4[ind] = items_n.amount_consume;
|
seriesData4[ind] = items_n.amount_consume;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
let options = { ...that.option2 };
|
let options = { ...that.option2 };
|
||||||
options.series[0].data = seriesData0;
|
options.series[0].data = seriesData0;
|
||||||
options.series[1].data = seriesData1;
|
options.series[1].data = seriesData2;
|
||||||
options.series[2].data = seriesData2;
|
options.series[2].data = seriesData5;
|
||||||
options.series[3].data = seriesData3;
|
options.series[3].data = seriesData1;
|
||||||
options.series[4].data = seriesData4;
|
options.series[4].data = seriesData3;
|
||||||
|
options.series[5].data = seriesData4;
|
||||||
let monthXAxis = [];
|
let monthXAxis = [];
|
||||||
for (let i = 1; i <= that.month; i++) {
|
for (let i = 1; i <= that.month; i++) {
|
||||||
let item = i + "月";
|
let item = i + "月";
|
||||||
|
|
|
@ -26,17 +26,19 @@
|
||||||
<sc-form-table
|
<sc-form-table
|
||||||
hideDelete
|
hideDelete
|
||||||
hideIndex
|
hideIndex
|
||||||
|
:tableHeight="200"
|
||||||
v-model="qctmatlist"
|
v-model="qctmatlist"
|
||||||
:addTemplate="mataddTemplate"
|
:addTemplate="mataddTemplate"
|
||||||
placeholder="暂无数据"
|
placeholder="暂无数据"
|
||||||
>
|
>
|
||||||
<el-table-column prop="type" label="物料">
|
<el-table-column prop="type" label="物料">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.id">{{ scope.row.material_name }}</span>
|
<span v-if="!scope.row.isEdit">{{ scope.row.material_name }}</span>
|
||||||
<xtSelect
|
<xtSelect
|
||||||
v-else
|
v-else
|
||||||
:apiObj="apiObj"
|
:apiObj="apiObj"
|
||||||
v-model="scope.row.material"
|
v-model="scope.row.material"
|
||||||
|
v-model:label="scope.row.material_name"
|
||||||
style="width:100%"
|
style="width:100%"
|
||||||
>
|
>
|
||||||
<el-table-column label="名称" prop="name"></el-table-column>
|
<el-table-column label="名称" prop="name"></el-table-column>
|
||||||
|
@ -47,7 +49,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="time" label="追溯层级">
|
<el-table-column prop="time" label="追溯层级">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.id">{{ tracing_[scope.row.tracing] }}</span>
|
<span v-if="!scope.row.isEdit">{{ tracing_[scope.row.tracing] }}</span>
|
||||||
<el-select
|
<el-select
|
||||||
v-else
|
v-else
|
||||||
v-model="scope.row.tracing"
|
v-model="scope.row.tracing"
|
||||||
|
@ -63,10 +65,18 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="open" label="操作" width="80" align="center">
|
<el-table-column prop="open" label="操作" width="125" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
v-if="!scope.row.edit"
|
v-if="scope.row.isEdit"
|
||||||
|
text
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="formTableAdd(scope.row,'mat')"
|
||||||
|
>保存</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
v-else
|
||||||
text
|
text
|
||||||
type="primary"
|
type="primary"
|
||||||
size="small"
|
size="small"
|
||||||
|
@ -74,21 +84,14 @@
|
||||||
>编辑</el-button
|
>编辑</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.id"
|
v-if="!scope.row.isEdit"
|
||||||
text
|
text
|
||||||
type="danger"
|
type="danger"
|
||||||
size="small"
|
size="small"
|
||||||
@click="formTableDel(scope.row.id,'mat')"
|
@click="formTableDel(scope.row.id,'mat')"
|
||||||
>删除</el-button
|
>删除</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
|
||||||
v-if="scope.row.edit"
|
|
||||||
text
|
|
||||||
type="primary"
|
|
||||||
size="small"
|
|
||||||
@click="formTableAdd(scope.row,'mat')"
|
|
||||||
>保存</el-button
|
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</sc-form-table>
|
</sc-form-table>
|
||||||
|
@ -97,23 +100,25 @@
|
||||||
<el-card style="width: 100%" header="检测项" shadow="hover">
|
<el-card style="width: 100%" header="检测项" shadow="hover">
|
||||||
<sc-form-table
|
<sc-form-table
|
||||||
hideIndex
|
hideIndex
|
||||||
|
:tableHeight="300"
|
||||||
v-model="qcttestitemlist"
|
v-model="qcttestitemlist"
|
||||||
:addTemplate="defectaddTemplate"
|
:addTemplate="defectaddTemplate"
|
||||||
placeholder="暂无数据"
|
placeholder="暂无数据"
|
||||||
>
|
>
|
||||||
<el-table-column prop="val" label="排序" width="80">
|
<el-table-column prop="val" label="排序" width="80">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.id">{{ scope.row.sort }}</span>
|
<span v-if="!scope.row.isEdit">{{ scope.row.sort }}</span>
|
||||||
<el-input v-else v-model="scope.row.sort" placeholder="排序"></el-input>
|
<el-input v-else v-model="scope.row.sort" placeholder="排序"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="time" label="检测项">
|
<el-table-column prop="time" label="检测项">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.id">{{scope.row.testitem_name}}</span>
|
<span v-if="!scope.row.isEdit">{{scope.row.testitem_name}}</span>
|
||||||
<xtSelect
|
<xtSelect
|
||||||
v-else
|
v-else
|
||||||
:apiObj="apiObj2"
|
:apiObj="apiObj2"
|
||||||
v-model="scope.row.testitem"
|
v-model="scope.row.testitem"
|
||||||
|
v-model:label="scope.row.testitem_name"
|
||||||
v-model:obj="testitemrow"
|
v-model:obj="testitemrow"
|
||||||
style="width:100%"
|
style="width:100%"
|
||||||
>
|
>
|
||||||
|
@ -124,14 +129,22 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="type" label="备注">
|
<el-table-column prop="type" label="备注">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.id">{{ scope.row.note }}</span>
|
<span v-if="!scope.row.isEdit">{{ scope.row.note }}</span>
|
||||||
<el-input v-else v-model="testitemrow.description" placeholder="备注"></el-input>
|
<el-input v-else v-model="testitemrow.description" placeholder="备注"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="open" label="操作" width="80" align="center">
|
<el-table-column prop="open" label="操作" width="125" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
v-if="!scope.row.edit"
|
v-if="scope.row.isEdit"
|
||||||
|
text
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="formTableAdd(scope.row,'testitem')"
|
||||||
|
>保存</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
v-else
|
||||||
text
|
text
|
||||||
type="primary"
|
type="primary"
|
||||||
size="small"
|
size="small"
|
||||||
|
@ -139,21 +152,14 @@
|
||||||
>编辑</el-button
|
>编辑</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.id"
|
v-if="!scope.row.isEdit"
|
||||||
text
|
text
|
||||||
type="danger"
|
type="danger"
|
||||||
size="small"
|
size="small"
|
||||||
@click="formTableDel(scope.row.id,'testitem')"
|
@click="formTableDel(scope.row.id,'testitem')"
|
||||||
>删除</el-button
|
>删除</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
|
||||||
v-if="scope.row.edit"
|
|
||||||
text
|
|
||||||
type="primary"
|
|
||||||
size="small"
|
|
||||||
@click="formTableAdd(scope.row,'testitem')"
|
|
||||||
>保存</el-button
|
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</sc-form-table>
|
</sc-form-table>
|
||||||
|
@ -162,24 +168,26 @@
|
||||||
<el-card style="width: 100%" header="检测缺陷项" shadow="hover">
|
<el-card style="width: 100%" header="检测缺陷项" shadow="hover">
|
||||||
<sc-form-table
|
<sc-form-table
|
||||||
hideIndex
|
hideIndex
|
||||||
|
:tableHeight="300"
|
||||||
v-model="qctdefectlist"
|
v-model="qctdefectlist"
|
||||||
:addTemplate="testitemaddTemplate"
|
:addTemplate="testitemaddTemplate"
|
||||||
placeholder="暂无数据"
|
placeholder="暂无数据"
|
||||||
>
|
>
|
||||||
<el-table-column prop="val" label="排序" width="80">
|
<el-table-column prop="val" label="排序" width="80">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.edit">{{ scope.row.sort }}</span>
|
<span v-if="!scope.row.isEdit">{{ scope.row.sort }}</span>
|
||||||
<el-input v-else v-model="scope.row.sort" placeholder="排序"></el-input>
|
<el-input v-else v-model="scope.row.sort" placeholder="排序"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="time" label="缺陷项">
|
<el-table-column prop="time" label="缺陷项">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.edit">{{scope.row.defect_name}}</span>
|
<span v-if="!scope.row.isEdit">{{scope.row.defect_name}}</span>
|
||||||
<xtSelect
|
<xtSelect
|
||||||
v-else
|
v-else
|
||||||
:apiObj="apiObj3"
|
:apiObj="apiObj3"
|
||||||
v-model="scope.row.defect"
|
v-model="scope.row.defect"
|
||||||
v-model:obj="defectrow"
|
v-model:obj="defectrow"
|
||||||
|
v-model:label="scope.row.defect_name"
|
||||||
style="width:100%"
|
style="width:100%"
|
||||||
>
|
>
|
||||||
<el-table-column label="名称" prop="name"></el-table-column>
|
<el-table-column label="名称" prop="name"></el-table-column>
|
||||||
|
@ -189,42 +197,42 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="val" label="判定表达式" min-width="150">
|
<el-table-column prop="val" label="判定表达式" min-width="150">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.edit">{{ scope.row.rule_expression }}</span>
|
<span v-if="!scope.row.isEdit">{{ scope.row.rule_expression }}</span>
|
||||||
<el-input v-else v-model="scope.row.rule_expression" placeholder="请输入判定表达式"></el-input>
|
<el-input v-else v-model="scope.row.rule_expression" placeholder="请输入判定表达式"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="type" label="备注">
|
<el-table-column prop="type" label="备注">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.edit">{{ scope.row.note }}</span>
|
<span v-if="!scope.row.isEdit">{{ scope.row.note }}</span>
|
||||||
<el-input v-else v-model="scope.row.note" placeholder="备注"></el-input>
|
<el-input v-else v-model="scope.row.note" placeholder="备注"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="open" label="操作" width="125" align="center">
|
<el-table-column prop="open" label="操作" width="125" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
v-if="!scope.row.edit"
|
v-if="scope.row.isEdit"
|
||||||
text
|
|
||||||
type="danger"
|
|
||||||
size="small"
|
|
||||||
@click="formTableDel(scope.row.id,'defect')"
|
|
||||||
>删除</el-button
|
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
v-if="scope.row.id"
|
|
||||||
text
|
|
||||||
type="primary"
|
|
||||||
size="small"
|
|
||||||
@click="formTableEdit(scope.row.id,'defect')"
|
|
||||||
>编辑</el-button
|
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
v-if="scope.row.edit"
|
|
||||||
text
|
text
|
||||||
type="primary"
|
type="primary"
|
||||||
size="small"
|
size="small"
|
||||||
@click="formTableAdd(scope.row,'defect')"
|
@click="formTableAdd(scope.row,'defect')"
|
||||||
>保存</el-button
|
>保存</el-button
|
||||||
>
|
>
|
||||||
|
<el-button
|
||||||
|
v-else
|
||||||
|
text
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="formTableEdit(scope.row,'defect')"
|
||||||
|
>编辑</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
v-if="!scope.row.isEdit"
|
||||||
|
text
|
||||||
|
type="danger"
|
||||||
|
size="small"
|
||||||
|
@click="formTableDel(scope.row.id,'defect')"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</sc-form-table>
|
</sc-form-table>
|
||||||
|
@ -323,23 +331,23 @@ export default {
|
||||||
that.qctmatlist = [],that.qctdefectlist =[],that.qcttestitemlist =[];
|
that.qctmatlist = [],that.qctdefectlist =[],that.qcttestitemlist =[];
|
||||||
that.$API.qm.qctmat.list.req({qct:that.qctItem.id,page:0}).then(res=>{
|
that.$API.qm.qctmat.list.req({qct:that.qctItem.id,page:0}).then(res=>{
|
||||||
res.forEach(item=>{
|
res.forEach(item=>{
|
||||||
let obj = object.assign({},item);
|
let obj = Object.assign({},item);
|
||||||
obj.edit = false;
|
obj.isEdit = false;
|
||||||
that.qctmatlist.push(obj);
|
that.qctmatlist.push(obj);
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
that.$API.qm.qctdefect.list.req({qct:that.qctItem.id,page:0}).then(res=>{
|
that.$API.qm.qctdefect.list.req({qct:that.qctItem.id,page:0}).then(res=>{
|
||||||
res.forEach(item=>{
|
res.forEach(item=>{
|
||||||
let obj = object.assign({},item);
|
let obj = Object.assign({},item);
|
||||||
obj.edit = false;
|
obj.isEdit = false;
|
||||||
that.qctdefectlist.push(obj);
|
that.qctdefectlist.push(obj);
|
||||||
})
|
})
|
||||||
// that.qctdefectlist = res;
|
// that.qctdefectlist = res;
|
||||||
});
|
});
|
||||||
that.$API.qm.qcttestitem.list.req({qct:that.qctItem.id,page:0}).then(res=>{
|
that.$API.qm.qcttestitem.list.req({qct:that.qctItem.id,page:0}).then(res=>{
|
||||||
res.forEach(item=>{
|
res.forEach(item=>{
|
||||||
let obj = object.assign({},item);
|
let obj = Object.assign({},item);
|
||||||
obj.edit = false;
|
obj.isEdit = false;
|
||||||
that.qcttestitemlist.push(obj);
|
that.qcttestitemlist.push(obj);
|
||||||
})
|
})
|
||||||
// that.qcttestitemlist = res;
|
// that.qcttestitemlist = res;
|
||||||
|
@ -347,30 +355,102 @@ export default {
|
||||||
},
|
},
|
||||||
//添加
|
//添加
|
||||||
formTableAdd(row,type) {
|
formTableAdd(row,type) {
|
||||||
|
console.log('formTableAdd',row);
|
||||||
|
let that = this,api = '';
|
||||||
|
if(type=='defect'){
|
||||||
|
if(row.id!==''&&row.id!==undefined&&row.id!==null){
|
||||||
|
api = that.$API.qm.qctdefect.update;
|
||||||
|
}else{
|
||||||
|
row.note = that.defectrow.note;
|
||||||
|
api = that.$API.qm.qctdefect.create;
|
||||||
|
}
|
||||||
|
}else if(type=='mat'){
|
||||||
|
if(row.id!==''&&row.id!==undefined&&row.id!==null){
|
||||||
|
api = that.$API.qm.qctmat.update;
|
||||||
|
}else{
|
||||||
|
api = that.$API.qm.qctmat.create;
|
||||||
|
}
|
||||||
|
}else if(type=='testitem'){
|
||||||
|
if(row.id!==''&&row.id!==undefined&&row.id!==null){
|
||||||
|
api = that.$API.qm.qcttestitem.update;
|
||||||
|
}else{
|
||||||
|
row.note = that.testitemrow.description;
|
||||||
|
api = that.$API.qm.qcttestitem.create;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if(row.id!==''&&row.id!==undefined&&row.id!==null){
|
||||||
|
api.req(row.id,row).then((res) => {
|
||||||
|
that.$message.success("编辑成功");
|
||||||
|
that.getLists();
|
||||||
|
return res;
|
||||||
|
}).catch((err) => {
|
||||||
|
return err;
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
api.req(row).then((res) => {
|
||||||
|
that.$message.success("添加成功");
|
||||||
|
that.getLists();
|
||||||
|
return res;
|
||||||
|
}).catch((err) => {
|
||||||
|
return err;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//添加
|
||||||
|
formTableSave(row,type) {
|
||||||
let that = this,api = '';
|
let that = this,api = '';
|
||||||
if(type=='defect'){
|
if(type=='defect'){
|
||||||
// console.log(that.defectrow);
|
|
||||||
row.note = that.defectrow.note;
|
row.note = that.defectrow.note;
|
||||||
api = that.$API.qm.qctdefect.create;
|
api = that.$API.qm.qctdefect.create;
|
||||||
}else if(type=='mat'){
|
}else if(type=='mat'){
|
||||||
api = that.$API.qm.qctmat.create;
|
api = that.$API.qm.qctmat.create;
|
||||||
}else if(type=='testitem'){
|
}else if(type=='testitem'){
|
||||||
// console.log(that.testitemrow);
|
|
||||||
row.note = that.testitemrow.description;
|
row.note = that.testitemrow.description;
|
||||||
api = that.$API.qm.qcttestitem.create;
|
api = that.$API.qm.qcttestitem.create;
|
||||||
}
|
}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
api.req(row).then((res) => {
|
if(row.id!==''&&row.id!==undefined&&row.id!==null){
|
||||||
that.$message.success("添加成功");
|
api.req(row).then((res) => {
|
||||||
that.getLists();
|
that.$message.success("添加成功");
|
||||||
return res;
|
that.getLists();
|
||||||
}).catch((err) => {
|
return res;
|
||||||
return err;
|
}).catch((err) => {
|
||||||
});
|
return err;
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
api.req(row).then((res) => {
|
||||||
|
that.$message.success("添加成功");
|
||||||
|
that.getLists();
|
||||||
|
return res;
|
||||||
|
}).catch((err) => {
|
||||||
|
return err;
|
||||||
|
});
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
formTableEdit(row,type) {
|
formTableEdit(row,type) {
|
||||||
|
if(type=='mat'){
|
||||||
|
this.qctmatlist.forEach((item, index) => {
|
||||||
|
if (item.id == row.id) {
|
||||||
|
this.qctmatlist[index].isEdit = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else if(type=='testitem'){
|
||||||
|
this.qcttestitemlist.forEach((item, index) => {
|
||||||
|
if (item.id == row.id) {
|
||||||
|
this.qcttestitemlist[index].isEdit = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else if(type=='defect'){
|
||||||
|
this.qctdefectlist.forEach((item, index) => {
|
||||||
|
if (item.id == row.id) {
|
||||||
|
this.qctdefectlist[index].isEdit = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
//删除
|
//删除
|
||||||
formTableDel(id,type) {
|
formTableDel(id,type) {
|
||||||
|
|
Loading…
Reference in New Issue