fix:入库检验数据回显问题
This commit is contained in:
parent
51c79f1d6f
commit
ab4b0c030d
|
@ -383,13 +383,26 @@ export default {
|
|||
{
|
||||
type: "line",
|
||||
encode: { y: "运行状态", seriesName: ["运行状态"] },
|
||||
lineStyle: {
|
||||
color: function (params) {
|
||||
// 自定义每个数据点的颜色
|
||||
console.log(params.value);
|
||||
if (params.value > 0 && params.value < 15) {
|
||||
return "#21a51f";
|
||||
} else if (value > 15 && value < 45) {
|
||||
return "#ff8608";
|
||||
} else {
|
||||
return "c7c7c7";
|
||||
}
|
||||
},
|
||||
},
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: function (params) {
|
||||
var value = params.value;
|
||||
if (value < 15) {
|
||||
if (value > 0 && value < 15) {
|
||||
return "#21a51f";
|
||||
} else if (value >= 15 && value < 45) {
|
||||
} else if (value > 15 && value < 45) {
|
||||
return "#ff8608";
|
||||
} else {
|
||||
return "c7c7c7";
|
||||
|
@ -401,13 +414,21 @@ export default {
|
|||
],
|
||||
},
|
||||
modelPosition: [
|
||||
{ lng: 88.64154268696439, lat: 42.721977308996635 },
|
||||
{ lng: 88.64217853109109, lat: 42.721910071501945 },
|
||||
{ lng: 88.64628960011686, lat: 42.72184710482201 },
|
||||
{ lng: 88.64619581826986, lat: 42.7215414346846 },
|
||||
{ lng: 88.64013560274894, lat: 42.72268219734449 },
|
||||
{ lng: 88.64035358529543, lat: 42.72266224153806 },
|
||||
{ lng: 88.64013259837789, lat: 42.722622240941305 },
|
||||
{
|
||||
lng: 119.42828291697619,
|
||||
lat: 40.97419456450223,
|
||||
height: 37.725744652917264,
|
||||
},
|
||||
{
|
||||
lng: 119.4295249200144,
|
||||
lat: 40.97458969709657,
|
||||
height: 44.263260612448,
|
||||
},
|
||||
{
|
||||
lng: 119.42920127023919,
|
||||
lat: 40.97442752133717,
|
||||
height: 69.07964676765597,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
|
@ -462,17 +483,11 @@ export default {
|
|||
viewer.scene.globe.enableLighting = true;
|
||||
viewer._cesiumWidget._creditContainer.style.display = "none";
|
||||
//*****cesium加载.glb格式的文件*****//
|
||||
var url = "photon_tree.glb";
|
||||
var url = "ly.glb";
|
||||
var height = 0;
|
||||
viewer.entities.removeAll(); //加载之前先清楚所有entity
|
||||
var position = Cesium.Cartesian3.fromDegrees(
|
||||
88.64349,
|
||||
42.72285,
|
||||
// 88.69159,
|
||||
// 42.73185,
|
||||
height
|
||||
);
|
||||
var heading = Cesium.Math.toRadians(191); //310度转弧度
|
||||
var position = Cesium.Cartesian3.fromDegrees(119.4295, 40.974, height);
|
||||
var heading = Cesium.Math.toRadians(132); //310度转弧度
|
||||
var pitch = Cesium.Math.toRadians(0);
|
||||
var roll = Cesium.Math.toRadians(0);
|
||||
var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
|
||||
|
@ -480,7 +495,7 @@ export default {
|
|||
position,
|
||||
hpr
|
||||
);
|
||||
var modelScale = 2.3; // 假设模型原始单位是厘米,需要转换为米
|
||||
var modelScale = 40; // 假设模型原始单位是厘米,需要转换为米
|
||||
var modelEntity = viewer.entities.add({
|
||||
name: "photon",
|
||||
position: position,
|
||||
|
@ -495,12 +510,12 @@ export default {
|
|||
},
|
||||
});
|
||||
var destination_tree = Cesium.Cartesian3.fromDegrees(
|
||||
88.64355,
|
||||
42.715,
|
||||
119.43,
|
||||
40.965,
|
||||
500
|
||||
);
|
||||
var heading_tree = Cesium.Math.toRadians(1); // 指定航向角度
|
||||
var pitch_tree = Cesium.Math.toRadians(-30); // 俯仰角度
|
||||
var pitch_tree = Cesium.Math.toRadians(-25); // 俯仰角度
|
||||
var roll_tree = Cesium.Math.toRadians(0); // 指定滚转角度
|
||||
|
||||
var orientation_camer = new Cesium.HeadingPitchRoll(
|
||||
|
@ -598,7 +613,7 @@ export default {
|
|||
// 使用刚指定的配置项和数据显示图表。
|
||||
// myChart.setOption(option)
|
||||
this.$API.bi.dataset.exec.req("enp_edata2", params).then((res) => {
|
||||
console.log(res);
|
||||
console.log("newOption.dataset", res);
|
||||
let newOption = Object.assign({}, this.basicOption);
|
||||
newOption.dataset.source = res.data.ds0;
|
||||
myChart.setOption(newOption);
|
||||
|
@ -1010,7 +1025,7 @@ export default {
|
|||
}
|
||||
.greenIcon,
|
||||
.greenIcon > .radio-ico {
|
||||
color: #1ca50a;
|
||||
color: #faed1f;
|
||||
}
|
||||
.orangeIcon,
|
||||
.orangeIcon > .radio-ico {
|
||||
|
|
|
@ -106,8 +106,6 @@
|
|||
type="primary"
|
||||
>编辑</el-button
|
||||
>
|
||||
<!-- <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> -->
|
||||
<!-- <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> -->
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-button
|
||||
link
|
||||
|
@ -206,37 +204,10 @@
|
|||
</el-main>
|
||||
</el-drawer>
|
||||
</el-container>
|
||||
<!-- <save-dialog
|
||||
v-if="dialog.save"
|
||||
ref="saveDialog"
|
||||
:deptId ="deptId"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
></save-dialog>
|
||||
<other-dialog
|
||||
v-if="dialog.other"
|
||||
ref="otherDialog"
|
||||
@success="handleOtherSuccess"
|
||||
@closed="dialog.other = false"
|
||||
></other-dialog>
|
||||
<quastat-dialog
|
||||
v-if="dialog.check"
|
||||
ref="checkDialog"
|
||||
@success="handleCheckSuccess"
|
||||
@closed="dialog.save = false"
|
||||
></quastat-dialog> -->
|
||||
</template>
|
||||
<script>
|
||||
import saveDialog from "./handover_form.vue";
|
||||
import quastatDialog from "./quastat_form.vue";
|
||||
import otherDialog from "./other_form.vue";
|
||||
export default {
|
||||
name: "sflog",
|
||||
components: {
|
||||
saveDialog,
|
||||
otherDialog,
|
||||
quastatDialog,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
apiObj: this.$API.wpm.sflog.list,
|
||||
|
@ -335,10 +306,6 @@ export default {
|
|||
deptId: this.deptId,
|
||||
},
|
||||
});
|
||||
// this.dialog.save = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.saveDialog.open("edit").setData(row);
|
||||
// });
|
||||
},
|
||||
|
||||
//质量检验
|
||||
|
@ -348,20 +315,7 @@ export default {
|
|||
this.$refs.checkDialog.open("edit").setData(row);
|
||||
});
|
||||
},
|
||||
//其他能源物料
|
||||
sflog_other(row) {
|
||||
this.dialog.other = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.otherDialog.open("edit").setData(row);
|
||||
});
|
||||
},
|
||||
// //查看
|
||||
// table_show(row) {
|
||||
// this.dialog.save = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.checkDialog.open("edit").setData(row);
|
||||
// });
|
||||
// },
|
||||
|
||||
//删除
|
||||
async table_del(row) {
|
||||
this.$API.wpm.sflog.delete
|
||||
|
@ -374,27 +328,12 @@ export default {
|
|||
return err;
|
||||
});
|
||||
},
|
||||
//新增岗位后更新数据
|
||||
handleSaveSuccess(data, mode) {
|
||||
this.$refs.table.refresh();
|
||||
this.dialog.save = false;
|
||||
},
|
||||
handleOtherSuccess() {
|
||||
this.dialog.other = false;
|
||||
},
|
||||
handleCheckSuccess() {
|
||||
this.dialog.check = false;
|
||||
},
|
||||
closed() {
|
||||
this.dialog.save = false;
|
||||
this.$refs.table2.refresh();
|
||||
},
|
||||
handleDel(row) {
|
||||
this.$confirm(`确定删除选中的记录吗?`, "提示", {
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.$API.wpm.shift.delete.req(row.id).then((res) => {
|
||||
this.$API.wpm.sflog.delete.req(row.id).then((res) => {
|
||||
if (res.err_msg) {
|
||||
this.$message.error(res.err_msg);
|
||||
} else {
|
||||
|
|
|
@ -1,955 +0,0 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-main class="nopadding">
|
||||
<el-card style="margin: 6px; position: relative">
|
||||
<el-descriptions title="日志信息" :column="3">
|
||||
<el-descriptions-item label="所属工段:">
|
||||
<span>{{ form.mgroup_name }}</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="工作班次:" :span="3">
|
||||
{{ form.shift_name }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="开始时间:">
|
||||
<span>{{ form.start_time }}</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="结束时间:" :span="3">
|
||||
{{ form.end_time }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<el-card style="margin: 6px; position: relative">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click.stop="addExp"
|
||||
v-if="activeName == 'fourth'"
|
||||
style="
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
right: 10px;
|
||||
z-index: 100;
|
||||
"
|
||||
></el-button>
|
||||
<el-tabs
|
||||
v-model="activeName"
|
||||
class="demo-tabs"
|
||||
@tab-click="handleClick"
|
||||
height="600px"
|
||||
>
|
||||
<el-tab-pane label="班组" name="first">
|
||||
<el-form
|
||||
ref="teamForm"
|
||||
:model="form"
|
||||
label-width="100px"
|
||||
label-position="right"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="当班班组" prop="team">
|
||||
<el-select
|
||||
v-model="form.team"
|
||||
placeholder="当班班组"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
@change="teamChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in teamOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item
|
||||
label="班组班长"
|
||||
prop="leader_name"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.leader_name"
|
||||
placeholder="班组班长"
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col
|
||||
:md="12"
|
||||
:sm="24"
|
||||
v-if="
|
||||
form.shift_name == '白班' &&
|
||||
mgroupId == '3347217246321065984'
|
||||
"
|
||||
>
|
||||
<el-form-item label="煤粉热值">
|
||||
<el-input-number
|
||||
v-model="form.pcoal_heat"
|
||||
controls-position="right"
|
||||
placeholder="煤粉热值"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 石灰石破碎 -->
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="电石渣干粉">
|
||||
<el-input-number
|
||||
v-model="form.pcoal_heat"
|
||||
controls-position="right"
|
||||
placeholder="电石渣干粉"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-footer style="text-align: center">
|
||||
<el-button
|
||||
type="primary"
|
||||
:loading="isSaveing"
|
||||
@click="submit"
|
||||
>保存</el-button
|
||||
>
|
||||
</el-footer>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="检验" name="second">
|
||||
<el-form
|
||||
ref="dialogForm"
|
||||
:model="form"
|
||||
label-width="85px"
|
||||
label-position="right"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="当前班组">
|
||||
{{ form.team_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="班组组长">
|
||||
{{ form.leader_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-divider />
|
||||
</el-row>
|
||||
</el-form>
|
||||
<sc-form-table
|
||||
v-model="checkList"
|
||||
:hideAdd="hideAdd"
|
||||
:hideDelete="hideDelete"
|
||||
placeholder="暂无数据"
|
||||
>
|
||||
<el-table-column
|
||||
prop="material"
|
||||
label="关联产物"
|
||||
min-width="150"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.id">{{
|
||||
scope.row.material_name
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="testitem"
|
||||
label="质检项目"
|
||||
min-width="150"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.id">{{
|
||||
scope.row.testitem_name
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="val_avg"
|
||||
label="平均值"
|
||||
min-width="150"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-input
|
||||
v-model="scope.row.val_avg"
|
||||
placeholder="请输入内容"
|
||||
></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="num_test"
|
||||
label="检验次数"
|
||||
min-width="150"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-input
|
||||
v-model="scope.row.num_test"
|
||||
placeholder="请输入内容"
|
||||
></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="num_ok"
|
||||
label="合格次数"
|
||||
min-width="150"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-input
|
||||
v-model="scope.row.num_ok"
|
||||
placeholder="请输入内容"
|
||||
></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</sc-form-table>
|
||||
<el-footer style="text-align: center">
|
||||
<el-button
|
||||
type="primary"
|
||||
:loading="isSaveing"
|
||||
@click="submit2"
|
||||
>保存</el-button
|
||||
>
|
||||
</el-footer>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="其他成本" name="third">
|
||||
<div
|
||||
v-if="
|
||||
mgroupId == '3346491835287007232' ||
|
||||
mgroupId == '3347217651339837440' ||
|
||||
mgroupId == '3347217246321065984'
|
||||
"
|
||||
>
|
||||
<el-form
|
||||
ref="thirdForms"
|
||||
:model="thirdForm"
|
||||
label-width="100px"
|
||||
label-position="right"
|
||||
>
|
||||
<!-- 电石渣 -->
|
||||
<el-row
|
||||
v-if="mgroupId == '3346491835287007232'"
|
||||
>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="湿电石渣">
|
||||
<el-input-number
|
||||
v-model="thirdForm.num"
|
||||
controls-position="right"
|
||||
placeholder="湿电石渣"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 回转窑 -->
|
||||
<el-row
|
||||
v-if="mgroupId == '3347217246321065984'"
|
||||
>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="柴油">
|
||||
<el-input-number
|
||||
v-model="thirdForm.num"
|
||||
controls-position="right"
|
||||
placeholder="柴油"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 水泥磨 -->
|
||||
<el-row
|
||||
v-if="mgroupId == '3347217651339837440'"
|
||||
>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="助剂">
|
||||
<el-input-number
|
||||
v-model="thirdForm.num"
|
||||
controls-position="right"
|
||||
placeholder="助剂"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="包装">
|
||||
<el-input-number
|
||||
v-model="thirdForm.num"
|
||||
controls-position="right"
|
||||
placeholder="包装"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-footer style="text-align: center">
|
||||
<el-button
|
||||
type="primary"
|
||||
:loading="isSaveing"
|
||||
@click="submit"
|
||||
>保存</el-button
|
||||
>
|
||||
</el-footer>
|
||||
</div>
|
||||
<div
|
||||
v-else
|
||||
style="
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
line-height: 200px;
|
||||
text-align: center;
|
||||
"
|
||||
>
|
||||
无其他成本
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="异常" name="fourth">
|
||||
<el-table
|
||||
ref="expTable"
|
||||
:data="stlogList"
|
||||
row-key="id"
|
||||
stripe
|
||||
highlightCurrentRow
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="异常类别" prop="duration">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.duration > 0"
|
||||
>停机</span
|
||||
>
|
||||
<span v-else>其他</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="发生时间"
|
||||
prop="happen_time"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="原因类别"
|
||||
prop="cate"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="异常名称"
|
||||
prop="title"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="事件原因"
|
||||
prop="reason"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="处置措施"
|
||||
prop="measure"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="停机时长"
|
||||
prop="duration"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
fixed="right"
|
||||
align="center"
|
||||
width="120"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
size="small"
|
||||
@click="sflogexp_edit(scope.row)"
|
||||
type="primary"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-divider
|
||||
direction="vertical"
|
||||
></el-divider>
|
||||
<el-button
|
||||
link
|
||||
size="small"
|
||||
@click="sflogexp_delete(scope.row)"
|
||||
type="danger"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<p>异常详情</p>
|
||||
<el-form
|
||||
ref="expForms"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
:model="expForm"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="异常类别">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="sflogexpType"
|
||||
placeholder="异常类别"
|
||||
:disabled="1"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in typeOptions"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item
|
||||
label="异常名称"
|
||||
prop="title"
|
||||
>
|
||||
<el-input
|
||||
v-model="expForm.title"
|
||||
placeholder="异常名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item
|
||||
label="发生时间"
|
||||
prop="happen_time"
|
||||
>
|
||||
<el-date-picker
|
||||
v-model="
|
||||
expForm.happen_time
|
||||
"
|
||||
type="datetime"
|
||||
placeholder="发生时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
style="width: 100%"
|
||||
:disabled="
|
||||
expTitle !==
|
||||
'新增异常' &&
|
||||
expForm.duration > 0
|
||||
"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item
|
||||
label="原因类别"
|
||||
prop="cate"
|
||||
>
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="expForm.cate"
|
||||
placeholder="原因类别"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col
|
||||
:md="12"
|
||||
:sm="24"
|
||||
v-if="sflogexpType == 0"
|
||||
>
|
||||
<el-form-item label="停机时长">
|
||||
<el-input-number
|
||||
v-model="expForm.duration"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
controls-position="right"
|
||||
placeholder="停机时长"
|
||||
:disabled="
|
||||
expTitle !==
|
||||
'新增异常' &&
|
||||
expForm.duration > 0
|
||||
"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item
|
||||
label="异常原因"
|
||||
prop="reason"
|
||||
>
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
v-model="expForm.reason"
|
||||
placeholder="异常原因"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item
|
||||
label="处置措施"
|
||||
prop="measure"
|
||||
>
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
v-model="expForm.measure"
|
||||
placeholder="处置措施"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-table
|
||||
ref="expTable"
|
||||
:data="sflogexpList"
|
||||
row-key="id"
|
||||
stripe
|
||||
highlightCurrentRow
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column
|
||||
label="操作人"
|
||||
prop="measure"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="操作时间"
|
||||
prop="happen_time"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="原因类别"
|
||||
prop="cate"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="事件原因"
|
||||
prop="reason"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="处置措施"
|
||||
prop="measure"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
fixed="right"
|
||||
align="center"
|
||||
width="60"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
size="small"
|
||||
@click="
|
||||
sflogexp_edit(scope.row)
|
||||
"
|
||||
type="primary"
|
||||
>编辑</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-dialog :title="expTitle" v-model="visible">
|
||||
<el-form
|
||||
ref="expForms"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
:model="expForm"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="异常类别">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="sflogexpType"
|
||||
placeholder="异常类别"
|
||||
:disabled="1"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in typeOptions"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item
|
||||
label="异常名称"
|
||||
prop="title"
|
||||
>
|
||||
<el-input
|
||||
v-model="expForm.title"
|
||||
placeholder="异常名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item
|
||||
label="发生时间"
|
||||
prop="happen_time"
|
||||
>
|
||||
<el-date-picker
|
||||
v-model="expForm.happen_time"
|
||||
type="datetime"
|
||||
placeholder="发生时间"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
style="width: 100%"
|
||||
:disabled="
|
||||
expTitle !== '新增异常' &&
|
||||
expForm.duration > 0
|
||||
"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item
|
||||
label="原因类别"
|
||||
prop="cate"
|
||||
>
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="expForm.cate"
|
||||
placeholder="原因类别"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col
|
||||
:md="12"
|
||||
:sm="24"
|
||||
v-if="sflogexpType == 0"
|
||||
>
|
||||
<el-form-item label="停机时长">
|
||||
<el-input-number
|
||||
v-model="expForm.duration"
|
||||
:precision="2"
|
||||
:min="0"
|
||||
controls-position="right"
|
||||
placeholder="停机时长"
|
||||
:disabled="
|
||||
expTitle !== '新增异常' &&
|
||||
expForm.duration > 0
|
||||
"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item
|
||||
label="异常原因"
|
||||
prop="reason"
|
||||
>
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
v-model="expForm.reason"
|
||||
placeholder="异常原因"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item
|
||||
label="处置措施"
|
||||
prop="measure"
|
||||
>
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
v-model="expForm.measure"
|
||||
placeholder="处置措施"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-footer>
|
||||
<el-button
|
||||
type="primary"
|
||||
:loading="isSaveing"
|
||||
@click="submit4"
|
||||
>保存</el-button
|
||||
>
|
||||
<el-button @click="visible = false"
|
||||
>取消</el-button
|
||||
>
|
||||
</el-footer>
|
||||
</el-dialog>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
import saveDialog from "./handover_form.vue";
|
||||
import quastatDialog from "./quastat_form.vue";
|
||||
import otherDialog from "./other_form.vue";
|
||||
export default {
|
||||
name: "listSon",
|
||||
components: {
|
||||
saveDialog,
|
||||
otherDialog,
|
||||
quastatDialog,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
deptId: "",
|
||||
mgroupId: "",
|
||||
hideAdd: true,
|
||||
visible: false,
|
||||
hideDelete: true,
|
||||
isSaveing: false,
|
||||
activeName: "fourth",
|
||||
expTitle: "新增异常",
|
||||
sflogItem: {},
|
||||
form: {},
|
||||
thirdForm: {
|
||||
num: "",
|
||||
},
|
||||
expForm: {
|
||||
happen_time: "",
|
||||
cate: "",
|
||||
title: "",
|
||||
reason: "",
|
||||
measure: "",
|
||||
duration: 0,
|
||||
sflog: "",
|
||||
},
|
||||
query: {
|
||||
page: 0,
|
||||
},
|
||||
rules: {
|
||||
happen_time: [{ required: true, message: "请选择发生时间" }],
|
||||
title: [{ required: true, message: "请填写异常名称" }],
|
||||
cate: [{ required: true, message: "请选择原因类别" }],
|
||||
reason: [{ required: true, message: "请填写异常原因" }],
|
||||
measure: [{ required: true, message: "请填写处置措施" }],
|
||||
},
|
||||
sflogexpType: "1",
|
||||
typeOptions: [
|
||||
{ value: "0", name: "停机" },
|
||||
{ value: "1", name: "其他" },
|
||||
],
|
||||
options: ["工艺", "电器", "机械", "其他"],
|
||||
checkList: [],
|
||||
stlogList: [],
|
||||
teamOptions: [],
|
||||
sflogexpList: [],
|
||||
apiObj: this.$API.wpm.sflogexp.list,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.deptId = this.$route.query.deptId;
|
||||
this.mgroupId = this.$route.query.mgroupId;
|
||||
let form = this.$TOOL.data.get("sflogItem");
|
||||
this.form = JSON.parse(form);
|
||||
this.getTeam();
|
||||
this.getSflogexp();
|
||||
},
|
||||
methods: {
|
||||
handleClick(e) {
|
||||
this.activeName = e.paneName;
|
||||
if (e.paneName == "second") {
|
||||
this.getsflogItem();
|
||||
}
|
||||
},
|
||||
//******first 班组确定 ******* */
|
||||
getTeam() {
|
||||
let that = this;
|
||||
let form = {};
|
||||
form.page = 0;
|
||||
form.belong_dept = that.deptId;
|
||||
that.$API.mtm.team.list.req(form).then((res) => {
|
||||
that.teamOptions = res;
|
||||
});
|
||||
},
|
||||
teamChange(data) {
|
||||
let that = this;
|
||||
that.teamOptions.forEach((item) => {
|
||||
if (item.id == data) {
|
||||
that.form.leader_name = item.leader_name;
|
||||
that.form.leader = item.leader;
|
||||
}
|
||||
});
|
||||
},
|
||||
//班组表单提交
|
||||
submit() {
|
||||
let that = this;
|
||||
that.$refs.teamForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
that.isSaveing = true;
|
||||
let obj = {};
|
||||
obj.team = that.form.team;
|
||||
obj.shift = that.form.shift;
|
||||
obj.leader = that.form.leader;
|
||||
obj.pcoal_heat = that.form.pcoal_heat;
|
||||
that.$API.wpm.sflog.update
|
||||
.req(that.form.id, obj)
|
||||
.then((res) => {
|
||||
that.isSaveing = false;
|
||||
that.$message.success("操作成功");
|
||||
})
|
||||
.catch((res) => {
|
||||
that.isSaveing = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
//****** seconed 质量检验 ******* */
|
||||
//检验
|
||||
getsflogItem() {
|
||||
this.$API.wpm.sflog.init_test.req(this.form.id).then((res) => {
|
||||
this.checkList = res;
|
||||
});
|
||||
},
|
||||
submit2() {
|
||||
this.isSaveing = true;
|
||||
this.$API.qm.updateQuastat
|
||||
.req("bulk", this.checkList)
|
||||
.then((res) => {
|
||||
this.isSaveing = false;
|
||||
this.$message.success("操作成功");
|
||||
})
|
||||
.catch((res) => {
|
||||
this.isSaveing = false;
|
||||
});
|
||||
},
|
||||
//质量检验
|
||||
sflog_check(row) {
|
||||
this.dialog.check = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.checkDialog.open("edit").setData(row);
|
||||
});
|
||||
},
|
||||
//***** fourth 异常 ****** */
|
||||
//获取异常列表
|
||||
getSflogexp() {
|
||||
let obj = {};
|
||||
obj.page = 0;
|
||||
obj.sflog = this.form.id;
|
||||
this.$API.wpm.sflogexp.list.req(obj).then((res) => {
|
||||
this.sflogexpList = res;
|
||||
});
|
||||
},
|
||||
//异常添加
|
||||
addExp() {
|
||||
this.expForm = {};
|
||||
this.expForm.happen_time = "";
|
||||
this.expForm.cate = "";
|
||||
this.expForm.title = "";
|
||||
this.expForm.reason = "";
|
||||
this.expForm.measure = "";
|
||||
this.expForm.duration = 0;
|
||||
this.expForm.sflog = this.form.id;
|
||||
this.expTitle = "新增异常";
|
||||
this.visible = true;
|
||||
},
|
||||
//异常编辑
|
||||
sflogexp_edit(row) {
|
||||
Object.assign(this.expForm, row);
|
||||
this.expTitle = "编辑异常";
|
||||
this.expForm.handler = this.$TOOL.data.get("USER_INFO").id;
|
||||
if (this.expForm.duration > 0) {
|
||||
this.sflogexpType = "0";
|
||||
} else {
|
||||
this.sflogexpType = "1";
|
||||
}
|
||||
this.visible = true;
|
||||
},
|
||||
//异常删除
|
||||
async sflogexp_delete(row) {
|
||||
this.$confirm(`确定删除选中的记录吗?`, "提示", {
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
this.$API.wpm.sflogexp.delete
|
||||
.req(row.id)
|
||||
.then((res) => {
|
||||
this.$message.success("删除成功");
|
||||
this.$refs.expTable.refresh();
|
||||
})
|
||||
.catch((err) => {
|
||||
this.$message.success(err);
|
||||
});
|
||||
});
|
||||
},
|
||||
submit4() {
|
||||
let that = this;
|
||||
that.$refs.expForms.validate(async (valid) => {
|
||||
if (valid) {
|
||||
that.isSaveing = true;
|
||||
if (that.expTitle == "新增异常") {
|
||||
that.$API.wpm.stlog.create
|
||||
.req(that.expForm)
|
||||
.then((res) => {
|
||||
that.isSaveing = false;
|
||||
that.visible = false;
|
||||
that.$message.success("操作成功");
|
||||
this.$refs.expTable.refresh();
|
||||
})
|
||||
.catch((res) => {
|
||||
that.isSaveing = false;
|
||||
});
|
||||
} else {
|
||||
that.$API.wpm.sflogexp.update
|
||||
.req(that.expForm.id, that.expForm)
|
||||
.then((res) => {
|
||||
that.isSaveing = false;
|
||||
that.visible = false;
|
||||
that.$message.success("操作成功");
|
||||
this.$refs.expTable.refresh();
|
||||
})
|
||||
.catch((res) => {
|
||||
that.isSaveing = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
handlePrint() {
|
||||
this.$PRINT("#myReport");
|
||||
},
|
||||
exportExcel() {
|
||||
this.exportLoading = true;
|
||||
this.$XLSX("#myTable", this.tableName);
|
||||
this.exportLoading = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#numTable {
|
||||
margin-left: 37px;
|
||||
}
|
||||
#numTable td {
|
||||
height: 32px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
.numCell {
|
||||
width: 80px;
|
||||
}
|
||||
.numCell.numCell_last {
|
||||
width: 100px;
|
||||
}
|
||||
.searchHead {
|
||||
display: flex;
|
||||
}
|
||||
.middleText {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
margin: 0 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
.searchBtn {
|
||||
margin-left: 5px;
|
||||
}
|
||||
</style>
|
|
@ -607,7 +607,7 @@
|
|||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="总袋(桶)数:">
|
||||
<el-input-number
|
||||
v-model="form.count_bag"
|
||||
v-model="form.count"
|
||||
:min="0"
|
||||
style="width: 100%"
|
||||
controls-position="right"
|
||||
|
@ -618,7 +618,7 @@
|
|||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="抽样数量">
|
||||
<el-input
|
||||
v-model="form.weight_kgs_count"
|
||||
v-model="form.count_sampling"
|
||||
disabled
|
||||
placeholder="抽样数量"
|
||||
/>
|
||||
|
@ -804,7 +804,7 @@ export default {
|
|||
console.log("objitem", that.objitem);
|
||||
that.form.material_name = that.objitem.material_name;
|
||||
that.form.batch = that.objitem.batch;
|
||||
that.form.count_bag = that.objitem.count_bag;
|
||||
that.form.count = that.objitem.count;
|
||||
}
|
||||
if (
|
||||
(that.type == "do_in" && that.cate == "halfgood") ||
|
||||
|
@ -871,11 +871,11 @@ export default {
|
|||
},
|
||||
addWeight() {
|
||||
this.weight_kgs.push({ value: 0 });
|
||||
this.form.weight_kgs_count = this.weight_kgs.length;
|
||||
this.form.count_sampling = this.weight_kgs.length;
|
||||
},
|
||||
delWeight(index) {
|
||||
this.weight_kgs.splice(index, 1);
|
||||
this.form.weight_kgs_count = this.weight_kgs.length;
|
||||
this.form.count_sampling = this.weight_kgs.length;
|
||||
},
|
||||
countSun() {
|
||||
let that = this;
|
||||
|
@ -885,7 +885,7 @@ export default {
|
|||
sum = sum + item.value;
|
||||
});
|
||||
that.form.count_bag_weight_all =
|
||||
(sum / that.weight_kgs.length) * that.form.count_bag;
|
||||
(sum / that.weight_kgs.length) * that.form.count;
|
||||
},
|
||||
countChange() {},
|
||||
countNotOkSun() {
|
||||
|
@ -997,7 +997,7 @@ export default {
|
|||
let obj = {};
|
||||
obj.test_date = that.form.test_date;
|
||||
obj.test_user = that.form.test_user;
|
||||
obj.count_bag = that.objitem.count_bag;
|
||||
obj.count = that.objitem.count;
|
||||
obj.weight_kgs = arr;
|
||||
obj.is_testok = that.form.is_testok;
|
||||
console.log(obj);
|
||||
|
@ -1033,10 +1033,10 @@ export default {
|
|||
Object.assign(that.form, data);
|
||||
// that.form.test_group = that.form.split(',');
|
||||
that.weight_kgs = [];
|
||||
console.log(data.count_bag);
|
||||
console.log(data.count);
|
||||
console.log(data.weight_kgs);
|
||||
if (data.weight_kgs.length > 0) {
|
||||
that.form.weight_kgs_count = data.weight_kgs.length;
|
||||
that.form.count_sampling = data.weight_kgs.length;
|
||||
let sum = 0;
|
||||
data.weight_kgs.forEach((item) => {
|
||||
sum = sum + item;
|
||||
|
@ -1045,7 +1045,7 @@ export default {
|
|||
that.weight_kgs.push(obj);
|
||||
});
|
||||
that.form.count_bag_weight_all =
|
||||
(sum / data.weight_kgs.length) * data.count_bag;
|
||||
(sum / data.weight_kgs.length) * data.count;
|
||||
}
|
||||
},
|
||||
//设置过滤项
|
||||
|
|
Loading…
Reference in New Issue