factory_web/src/views/enm_rm/handoverLog.vue

377 lines
13 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<el-container>
<el-header>
<div class="left-panel">
<div style="margin-right: 20px">交接班日志</div>
<el-date-picker
v-model="query.start_time__gte"
type="date"
value-format="YYYY-MM-DD HH:mm:ss"
format="YYYY-MM-DD"
placeholder="开始时间"
style=" width: 120px"
/>
<el-date-picker
v-model="query.end_time__lt"
type="date"
value-format="YYYY-MM-DD HH:mm:ss"
format="YYYY-MM-DD"
placeholder="结束时间"
style="margin-left: 2px; width: 120px"
/>
<el-select
v-model="query.shift"
placeholder="班次"
clearable
style="margin-left: 2px; width: 120px"
>
<el-option
v-for="item in optionsShift"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-select
v-model="query.team"
placeholder="班组"
clearable
style="margin-left: 2px; width: 120px"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="query"
highlightCurrentRow
@row-click="rowClick"
>
<el-table-column type="index" width="50"/>
<!-- <el-table-column label="关联工段" prop="mgroup_name"></el-table-column> -->
<el-table-column label="开始时间" prop="start_time">
<template #default="scope">
<span>{{ scope.row.start_time.slice(0,16)}}</span>
</template>
</el-table-column>
<el-table-column label="结束时间" prop="end_time">
<template #default="scope">
<span>{{ scope.row.end_time.slice(0,16)}}</span>
</template>
</el-table-column>
<el-table-column label="班组名称" prop="team_name" width="80"></el-table-column>
<el-table-column label="当前班次" prop="shift_name" width="80"></el-table-column>
<el-table-column label="班长" prop="leader_name" width="80"></el-table-column>
<el-table-column label="检验时间">
<template #default="scope">
<span v-if="scope.row.last_test_time">{{ scope.row.last_test_time.slice(0,16)}}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="140">
<template #default="scope">
<el-button link size="small" @click="sflog_edit(scope.row)" 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-button link size="small" @click="sflog_export(scope.row)" type="success">报表</el-button>
</template>
</el-table-column>
</scTable>
</el-main>
<el-drawer v-model="limitedExport" size="60%" :show-close="false">
<template #header="{ close, titleId, titleClass }">
<h4 :id="titleId" :class="titleClass">交接班日志</h4>
<el-button type="danger" @click="close">
<el-icon class="el-icon--left"><CircleCloseFilled /></el-icon>
关闭
</el-button>
</template>
<el-main class="nopadding">
<div ref="print" id="myReport" class="printContainer">
<div style="margin-right: 20px;text-align: center;font-size: 16px;font-weight: bold;margin-bottom: 20px;">
<span v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}{{ sflogItem.shift_name }}</span>
<span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span>
交接班记录
</div>
<h3 style="text-align: center;display: flex;justify-content: space-around;">
<span>2023.06.21</span>
<span>白班</span>
<span>甲班</span>
</h3>
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
<tbody>
<tr>
<td class="numCell">产量t</td>
<td class="numCell">{{value1}}</td>
<td class="numCell">台时t/h</td>
<td class="numCell">{{value3}}</td>
<td class="numCell">运转时间h</td>
<td class="numCell">{{value5}}</td>
</tr>
<tr>
<td class="numCell">运转率%</td>
<td class="numCell">{{value1}}</td>
<td class="numCell">停机时长h</td>
<td class="numCell">{{value3}}</td>
<td class="numCell">当期单位产品电耗kW·h/t</td>
<td class="numCell">{{value5}}</td>
</tr>
<tr>
<td class="numCell">辅料细度合格率%</td>
<td class="numCell">{{value1}}</td>
<td class="numCell">辅料Fe₂O₃合格率%</td>
<td class="numCell">{{value3}}</td>
<td class="numCell">辅料水分合格率%</td>
<td class="numCell">{{value5}}</td>
</tr>
<tr>
<td class="numCell">干混生料CaO合格率%</td>
<td class="numCell">{{value1}}</td>
<td class="numCell">干混生料Fe₂O₃合格率%</td>
<td class="numCell">{{value3}}</td>
<td class="numCell">干混生料细度合格率%</td>
<td class="numCell">{{value5}}</td>
</tr>
<tr>
<td class="numCell">干混生料水分合格率%</td>
<td class="numCell">{{value1}}</td>
<td class="numCell">单位成本/</td>
<td class="numCell">{{value3}}</td>
<td class="numCell"></td>
<td class="numCell"></td>
</tr>
<tr>
<td class="numCell">生产情况记录</td>
<td class="numCell" colspan="5">时间类别原因处置措施处置人</td>
</tr>
</tbody>
</table>
</div>
</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: "listSon",
components: {
saveDialog,
otherDialog,
quastatDialog
},
data() {
return {
apiObj: this.$API.wpm.sflog.list,
apiObj2: null,
query: {
mgroup:'3346520558031773696',
},
deptId :"3345780809943797760",
query2: {},
dialog: {
save: false,
check: false,
other:false,
},
sflogItem:{},
selection: [],
value1:1,
value3:3,
value5:5,
modelValue:true,
showClose:true,
echartType:'line',
asynDialog:false,
options:[],
optionsShift:[],
teamOptions:[],
limitedExport:false,
};
},
mounted(){
this.getTeam();
this.getShfit();
},
methods: {
getTeam(){
let form ={};
form.page = 0;
form.belong_dept = this.deptId;
this.$API.mtm.team.list.req(form).then(res=>{
this.options = res;
})
},
getShfit(){
this.$API.mtm.shift.req({page:0}).then(res=>{
this.optionsShift = res;
})
},
handleQuery(){
this.$refs.table.queryData(this.query);
},
sflog_export(){
this.limitedExport = true;
},
rowClick(row) {
this.sflogId = row.id;
this.sflogItem = row;
// this.$refs.table2.queryData({post: row.id});
},
//编辑
sflog_edit(row) {
// let jsonStr = JSON.stringify(row);
// this.$TOOL.data.remove("sflogItem")
// this.$TOOL.data.set('sflogItem',jsonStr)
// this.$router.push({
// name: "logDetail",
// query: {
// mgroupId: row.mgroup
// },
// });
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row);
});
},
//质量检验
sflog_check(row){
this.dialog.check = true;
this.$nextTick(() => {
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.req(row.id)
.then((res) => {
this.$message.success("删除成功");
return res;
})
.catch((err) => {
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) => {
if (res.err_msg) {
this.$message.error(res.err_msg);
} else {
// const loading = this.$loading();
// this.$refs.table2.refresh();
// loading.close();
// this.$message.success("操作成功");
}
});
})
.catch(() => {});
},
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>