feat: mgroup增加排班规则字段
This commit is contained in:
parent
dd2fc9a455
commit
5d8621cac0
|
|
@ -205,13 +205,16 @@ export default {
|
|||
},
|
||||
//班次
|
||||
shift: {
|
||||
name: "班次列表",
|
||||
req: async function(data){
|
||||
return await http.get(
|
||||
`${config.API_URL}/mtm/shift/`,
|
||||
data
|
||||
);
|
||||
list: {
|
||||
name: "班次列表",
|
||||
req: async function(data){
|
||||
return await http.get(
|
||||
`${config.API_URL}/mtm/shift/`,
|
||||
data
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
//班组
|
||||
team: {
|
||||
|
|
|
|||
|
|
@ -3,298 +3,255 @@
|
|||
<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-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 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>
|
||||
<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="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"></el-table-column>
|
||||
<el-table-column label="当前班次" prop="shift_name"></el-table-column>
|
||||
<el-table-column label="班长" prop="leader_name"></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-divider direction="vertical"></el-divider>
|
||||
<el-button link size="small" @click="sflog_export(scope.row)" type="success">报表</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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="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"></el-table-column>
|
||||
<el-table-column label="当前班次" prop="shift_name"></el-table-column>
|
||||
<el-table-column label="班长" prop="leader_name"></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-divider direction="vertical"></el-divider>
|
||||
<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-icon class="el-icon--left">
|
||||
<CircleCloseFilled />
|
||||
</el-icon>
|
||||
关闭
|
||||
</el-button>
|
||||
</template>
|
||||
<div class="left-panel">
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="exportExcel()"
|
||||
:loading = "exportLoading"
|
||||
>导出xlsx
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handlePrint"
|
||||
>打印
|
||||
</el-button>
|
||||
</div>
|
||||
<el-button type="primary" @click="exportExcel()" :loading="exportLoading">导出xlsx
|
||||
</el-button>
|
||||
<el-button type="primary" @click="handlePrint">打印
|
||||
</el-button>
|
||||
</div>
|
||||
<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>
|
||||
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="numCell">日期</td>
|
||||
<td class="numCell" v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}</td>
|
||||
<td class="numCell">班次</td>
|
||||
<td class="numCell">{{ sflogItem.shift_name }}</td>
|
||||
<td class="numCell">班组</td>
|
||||
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">产量(t)</td>
|
||||
<td class="numCell">{{reportItem.total_production}}</td>
|
||||
<td class="numCell">台时(t/h)</td>
|
||||
<td class="numCell">{{reportItem.production_hour}}</td>
|
||||
<td class="numCell">运转时间(h)</td>
|
||||
<td class="numCell">{{reportItem.run_hour}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">运转率(%)</td>
|
||||
<td class="numCell">{{reportItem.run_rate*100}}</td>
|
||||
<td class="numCell">停机时长(h)</td>
|
||||
<td class="numCell">{{reportItem.shut_hour}}</td>
|
||||
<td class="numCell">煤磨分布电耗(KW·h/t)</td>
|
||||
<td class="numCell">{{reportItem.elec_consume_unit}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">煤粉细度合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.煤粉_细度_rate_pass">{{reportItem.煤粉_细度_rate_pass*100}}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">煤粉水分合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.煤粉_水分_rate_pass">{{reportItem.煤粉_水分_rate_pass*100}}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
</tr>
|
||||
<tr v-if="sflogexpList.length>0">
|
||||
<td class="numCell" :rowspan="sflogexpList.length+1">生产情况记录</td>
|
||||
<td class="numCell">时间</td>
|
||||
<td class="numCell">类别</td>
|
||||
<td class="numCell">原因</td>
|
||||
<td class="numCell">处置措施</td>
|
||||
<td class="numCell">处置人</td>
|
||||
</tr>
|
||||
<tr v-for="item in sflogexpList" :key="item.id">
|
||||
<td class="numCell">{{ item.happen_time}}</td>
|
||||
<td class="numCell">{{ item.cate}}</td>
|
||||
<td class="numCell">{{ item.reason}}</td>
|
||||
<td class="numCell">{{ item.measure}}</td>
|
||||
<td class="numCell">{{ item.handler}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<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>
|
||||
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="numCell">日期</td>
|
||||
<td class="numCell" v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}</td>
|
||||
<td class="numCell">班次</td>
|
||||
<td class="numCell">{{ sflogItem.shift_name }}</td>
|
||||
<td class="numCell">班组</td>
|
||||
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">产量(t)</td>
|
||||
<td class="numCell">{{ reportItem.total_production }}</td>
|
||||
<td class="numCell">台时(t/h)</td>
|
||||
<td class="numCell">{{ reportItem.production_hour }}</td>
|
||||
<td class="numCell">运转时间(h)</td>
|
||||
<td class="numCell">{{ reportItem.run_hour }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">运转率(%)</td>
|
||||
<td class="numCell">{{ reportItem.run_rate * 100 }}</td>
|
||||
<td class="numCell">停机时长(h)</td>
|
||||
<td class="numCell">{{ reportItem.shut_hour }}</td>
|
||||
<td class="numCell">煤磨分布电耗(KW·h/t)</td>
|
||||
<td class="numCell">{{ reportItem.elec_consume_unit }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">煤粉细度合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.煤粉_细度_rate_pass">{{ reportItem.煤粉_细度_rate_pass * 100 }}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">煤粉水分合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.煤粉_水分_rate_pass">{{ reportItem.煤粉_水分_rate_pass * 100 }}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
</tr>
|
||||
<tr v-if="sflogexpList.length > 0">
|
||||
<td class="numCell" :rowspan="sflogexpList.length + 1">生产情况记录</td>
|
||||
<td class="numCell">时间</td>
|
||||
<td class="numCell">类别</td>
|
||||
<td class="numCell">原因</td>
|
||||
<td class="numCell">处置措施</td>
|
||||
<td class="numCell">处置人</td>
|
||||
</tr>
|
||||
<tr v-for="item in sflogexpList" :key="item.id">
|
||||
<td class="numCell">{{ item.happen_time }}</td>
|
||||
<td class="numCell">{{ item.cate }}</td>
|
||||
<td class="numCell">{{ item.reason }}</td>
|
||||
<td class="numCell">{{ item.measure }}</td>
|
||||
<td class="numCell">{{ item.handler }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</el-main>
|
||||
</el-drawer>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "sflog",
|
||||
data() {
|
||||
return {
|
||||
apiObj: this.$API.wpm.sflog.list,
|
||||
apiObj2: null,
|
||||
export default {
|
||||
name: "sflog",
|
||||
data() {
|
||||
return {
|
||||
apiObj: this.$API.wpm.sflog.list,
|
||||
apiObj2: null,
|
||||
query: {
|
||||
shift: '',
|
||||
team: '',
|
||||
end_time__lt: '',
|
||||
start_time__gte: '',
|
||||
mgroup: '3347217512021835776',
|
||||
},
|
||||
deptId: '3347207082608115712',
|
||||
sflogItem: {},
|
||||
options: [],
|
||||
optionsShift: [],
|
||||
limitedExport: false,
|
||||
reportItem: {},
|
||||
sflogexpList: [],
|
||||
};
|
||||
},
|
||||
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.list.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.getSflogItem(row.id);
|
||||
this.getSflogexp(row.id);
|
||||
},
|
||||
getSflogexp(id) {
|
||||
let that = this;
|
||||
that.$API.wpm.sflogexp.list.req({ page: 0, sflog: id }).then(res => {
|
||||
that.sflogexpList = res;
|
||||
})
|
||||
},
|
||||
getSflogItem(id) {
|
||||
let that = this;
|
||||
that.$API.enm.enstat.req({ type: 'sflog', sflog: id, page: 0 }).then(res => {
|
||||
if (res.length > 0) {
|
||||
that.reportItem = res[0];
|
||||
}
|
||||
console.log(res[0])
|
||||
})
|
||||
},
|
||||
//编辑
|
||||
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: {
|
||||
shift:'',
|
||||
team:'',
|
||||
end_time__lt:'',
|
||||
start_time__gte:'',
|
||||
mgroup:'3347217512021835776',
|
||||
mgroupId: row.mgroup,
|
||||
deptId: this.deptId
|
||||
},
|
||||
deptId :'3347207082608115712',
|
||||
sflogItem:{},
|
||||
options:[],
|
||||
optionsShift:[],
|
||||
limitedExport:false,
|
||||
reportItem:{},
|
||||
sflogexpList:[],
|
||||
};
|
||||
});
|
||||
},
|
||||
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.getSflogItem(row.id);
|
||||
this.getSflogexp(row.id);
|
||||
},
|
||||
getSflogexp(id){
|
||||
let that = this;
|
||||
that.$API.wpm.sflogexp.list.req({page:0,sflog:id}).then(res=>{
|
||||
that.sflogexpList = res;
|
||||
})
|
||||
},
|
||||
getSflogItem(id){
|
||||
let that =this;
|
||||
that.$API.enm.enstat.req({type:'sflog',sflog:id,page:0}).then(res=>{
|
||||
if(res.length>0){
|
||||
that.reportItem = res[0];
|
||||
}
|
||||
console.log(res[0])
|
||||
})
|
||||
},
|
||||
//编辑
|
||||
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,
|
||||
deptId:this.deptId
|
||||
},
|
||||
});
|
||||
},
|
||||
handlePrint() {
|
||||
this.$PRINT('#myReport');
|
||||
},
|
||||
exportExcel() {
|
||||
this.exportLoading = true;
|
||||
this.$XLSX('#myTable', this.tableName)
|
||||
this.exportLoading = false;
|
||||
},
|
||||
handlePrint() {
|
||||
this.$PRINT('#myReport');
|
||||
},
|
||||
};
|
||||
</script>
|
||||
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>
|
||||
<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>
|
||||
|
||||
|
|
@ -1,324 +1,282 @@
|
|||
<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-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 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>
|
||||
<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"></el-table-column>
|
||||
<el-table-column label="当前班次" prop="shift_name"></el-table-column>
|
||||
<el-table-column label="班长" prop="leader_name"></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-divider direction="vertical"></el-divider>
|
||||
<el-button link size="small" @click="sflog_export(scope.row)" type="success">报表</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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"></el-table-column>
|
||||
<el-table-column label="当前班次" prop="shift_name"></el-table-column>
|
||||
<el-table-column label="班长" prop="leader_name"></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-divider direction="vertical"></el-divider>
|
||||
<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-icon class="el-icon--left">
|
||||
<CircleCloseFilled />
|
||||
</el-icon>
|
||||
关闭
|
||||
</el-button>
|
||||
</template>
|
||||
<div class="left-panel">
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="exportExcel()"
|
||||
:loading = "exportLoading"
|
||||
>导出xlsx
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handlePrint"
|
||||
>打印
|
||||
</el-button>
|
||||
<el-button type="primary" @click="exportExcel()" :loading="exportLoading">导出xlsx
|
||||
</el-button>
|
||||
<el-button type="primary" @click="handlePrint">打印
|
||||
</el-button>
|
||||
</div>
|
||||
<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>
|
||||
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="numCell">日期</td>
|
||||
<td class="numCell" v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}</td>
|
||||
<td class="numCell">班次</td>
|
||||
<td class="numCell">{{ sflogItem.shift_name }}</td>
|
||||
<td class="numCell">班组</td>
|
||||
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">产量(t)</td>
|
||||
<td class="numCell">{{reportItem.total_production}}</td>
|
||||
<td class="numCell">台时(t/h)</td>
|
||||
<td class="numCell">{{reportItem.production_hour}}</td>
|
||||
<td class="numCell">运转时间(h)</td>
|
||||
<td class="numCell">{{reportItem.run_hour}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">运转率(%)</td>
|
||||
<td class="numCell">{{reportItem.run_rate*100}}</td>
|
||||
<td class="numCell">停机时长(h)</td>
|
||||
<td class="numCell">{{reportItem.shut_hour}}</td>
|
||||
<td class="numCell">单位产品分布电耗(KW·h/t)</td>
|
||||
<td class="numCell">{{reportItem.elec_consume_unit}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">单位产品标煤耗(kgce/t)</td>
|
||||
<td class="numCell">{{reportItem.coal_consume_unit}}</td>
|
||||
<td class="numCell">熟料立升重合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.入磨熟料_立升重_rate_pass">{{reportItem.入磨熟料_立升重_rate_pass*100}}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">熟料f-CaO合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem['入磨熟料_f-CaO_rate_pass']">{{reportItem['入磨熟料_f-CaO_rate_pass']*100}}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">入窑生料细度合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.入窑生料_细度_rate_pass">{{reportItem.入窑生料_细度_rate_pass*100}}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">入窑生料CaO合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.入窑生料_CaO_rate_pass">{{reportItem.入窑生料_CaO_rate_pass*100}}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">入窑生料Fe₂O₃合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.入窑生料_Fe2O3_rate_pass">{{reportItem.入窑生料_Fe2O3_rate_pass*100}}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">入窑生料水分合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.入窑生料_水分_rate_pass">{{reportItem.入窑生料_水分_rate_pass*100}}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">单位成本(元/吨)</td>
|
||||
<td class="numCell">{{reportItem.production_cost_unit}}</td>
|
||||
<td class="numCell"></td>
|
||||
<td class="numCell"></td>
|
||||
</tr>
|
||||
<tr v-if="sflogexpList.length>0">
|
||||
<td class="numCell" :rowspan="sflogexpList.length+1">生产情况记录</td>
|
||||
<td class="numCell">时间</td>
|
||||
<td class="numCell">类别</td>
|
||||
<td class="numCell">原因</td>
|
||||
<td class="numCell">处置措施</td>
|
||||
<td class="numCell">处置人</td>
|
||||
</tr>
|
||||
<tr v-for="item in sflogexpList" :key="item.id">
|
||||
<td class="numCell">{{ item.happen_time}}</td>
|
||||
<td class="numCell">{{ item.cate}}</td>
|
||||
<td class="numCell">{{ item.reason}}</td>
|
||||
<td class="numCell">{{ item.measure}}</td>
|
||||
<td class="numCell">{{ item.handler}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<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>
|
||||
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="numCell">日期</td>
|
||||
<td class="numCell" v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}</td>
|
||||
<td class="numCell">班次</td>
|
||||
<td class="numCell">{{ sflogItem.shift_name }}</td>
|
||||
<td class="numCell">班组</td>
|
||||
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">产量(t)</td>
|
||||
<td class="numCell">{{ reportItem.total_production }}</td>
|
||||
<td class="numCell">台时(t/h)</td>
|
||||
<td class="numCell">{{ reportItem.production_hour }}</td>
|
||||
<td class="numCell">运转时间(h)</td>
|
||||
<td class="numCell">{{ reportItem.run_hour }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">运转率(%)</td>
|
||||
<td class="numCell">{{ reportItem.run_rate * 100 }}</td>
|
||||
<td class="numCell">停机时长(h)</td>
|
||||
<td class="numCell">{{ reportItem.shut_hour }}</td>
|
||||
<td class="numCell">单位产品分布电耗(KW·h/t)</td>
|
||||
<td class="numCell">{{ reportItem.elec_consume_unit }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">单位产品标煤耗(kgce/t)</td>
|
||||
<td class="numCell">{{ reportItem.coal_consume_unit }}</td>
|
||||
<td class="numCell">熟料立升重合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.入磨熟料_立升重_rate_pass">{{ reportItem.入磨熟料_立升重_rate_pass * 100 }}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">熟料f-CaO合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem['入磨熟料_f-CaO_rate_pass']">{{ reportItem['入磨熟料_f-CaO_rate_pass'] * 100 }}
|
||||
</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">入窑生料细度合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.入窑生料_细度_rate_pass">{{ reportItem.入窑生料_细度_rate_pass * 100 }}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">入窑生料CaO合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.入窑生料_CaO_rate_pass">{{ reportItem.入窑生料_CaO_rate_pass * 100 }}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">入窑生料Fe₂O₃合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.入窑生料_Fe2O3_rate_pass">{{ reportItem.入窑生料_Fe2O3_rate_pass * 100 }}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">入窑生料水分合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.入窑生料_水分_rate_pass">{{ reportItem.入窑生料_水分_rate_pass * 100 }}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">单位成本(元/吨)</td>
|
||||
<td class="numCell">{{ reportItem.production_cost_unit }}</td>
|
||||
<td class="numCell"></td>
|
||||
<td class="numCell"></td>
|
||||
</tr>
|
||||
<tr v-if="sflogexpList.length > 0">
|
||||
<td class="numCell" :rowspan="sflogexpList.length + 1">生产情况记录</td>
|
||||
<td class="numCell">时间</td>
|
||||
<td class="numCell">类别</td>
|
||||
<td class="numCell">原因</td>
|
||||
<td class="numCell">处置措施</td>
|
||||
<td class="numCell">处置人</td>
|
||||
</tr>
|
||||
<tr v-for="item in sflogexpList" :key="item.id">
|
||||
<td class="numCell">{{ item.happen_time }}</td>
|
||||
<td class="numCell">{{ item.cate }}</td>
|
||||
<td class="numCell">{{ item.reason }}</td>
|
||||
<td class="numCell">{{ item.measure }}</td>
|
||||
<td class="numCell">{{ item.handler }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</el-main>
|
||||
</el-drawer>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "sflog",
|
||||
data() {
|
||||
return {
|
||||
apiObj: this.$API.wpm.sflog.list,
|
||||
apiObj2: null,
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "sflog",
|
||||
data() {
|
||||
return {
|
||||
apiObj: this.$API.wpm.sflog.list,
|
||||
apiObj2: null,
|
||||
query: {
|
||||
shift: '',
|
||||
team: '',
|
||||
end_time__lt: '',
|
||||
start_time__gte: '',
|
||||
mgroup: '3347217246321065984',
|
||||
},
|
||||
|
||||
deptId: '3347207082608115712',
|
||||
sflogItem: {},
|
||||
options: [],
|
||||
optionsShift: [],
|
||||
limitedExport: false,
|
||||
reportItem: {},
|
||||
sflogexpList: [],
|
||||
};
|
||||
},
|
||||
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.list.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.getSflogItem(row.id);
|
||||
this.getSflogexp(row.id);
|
||||
},
|
||||
getSflogexp(id) {
|
||||
let that = this;
|
||||
that.$API.wpm.sflogexp.list.req({ page: 0, sflog: id }).then(res => {
|
||||
that.sflogexpList = res;
|
||||
})
|
||||
},
|
||||
getSflogItem(id) {
|
||||
let that = this;
|
||||
that.$API.enm.enstat.req({ type: 'sflog', sflog: id, page: 0 }).then(res => {
|
||||
if (res.length > 0) {
|
||||
that.reportItem = res[0];
|
||||
}
|
||||
console.log(res[0])
|
||||
})
|
||||
},
|
||||
//编辑
|
||||
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: {
|
||||
shift:'',
|
||||
team:'',
|
||||
end_time__lt:'',
|
||||
start_time__gte:'',
|
||||
mgroup:'3347217246321065984',
|
||||
mgroupId: row.mgroup,
|
||||
deptId: this.deptId
|
||||
},
|
||||
|
||||
deptId :'3347207082608115712',
|
||||
sflogItem:{},
|
||||
options:[],
|
||||
optionsShift:[],
|
||||
limitedExport:false,
|
||||
reportItem:{},
|
||||
sflogexpList:[],
|
||||
};
|
||||
});
|
||||
},
|
||||
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.getSflogItem(row.id);
|
||||
this.getSflogexp(row.id);
|
||||
},
|
||||
getSflogexp(id){
|
||||
let that = this;
|
||||
that.$API.wpm.sflogexp.list.req({page:0,sflog:id}).then(res=>{
|
||||
that.sflogexpList = res;
|
||||
})
|
||||
},
|
||||
getSflogItem(id){
|
||||
let that =this;
|
||||
that.$API.enm.enstat.req({type:'sflog',sflog:id,page:0}).then(res=>{
|
||||
if(res.length>0){
|
||||
that.reportItem = res[0];
|
||||
}
|
||||
console.log(res[0])
|
||||
})
|
||||
},
|
||||
//编辑
|
||||
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,
|
||||
deptId:this.deptId
|
||||
},
|
||||
});
|
||||
},
|
||||
handlePrint() {
|
||||
this.$PRINT('#myReport');
|
||||
},
|
||||
exportExcel() {
|
||||
this.exportLoading = true;
|
||||
this.$XLSX('#myTable', this.tableName)
|
||||
this.exportLoading = false;
|
||||
},
|
||||
handlePrint() {
|
||||
this.$PRINT('#myReport');
|
||||
},
|
||||
};
|
||||
</script>
|
||||
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;
|
||||
text-align: center;
|
||||
}
|
||||
.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>
|
||||
<style scoped>
|
||||
#numTable {
|
||||
margin-left: 37px;
|
||||
}
|
||||
|
||||
#numTable td {
|
||||
height: 32px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.numCell {
|
||||
width: 80px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.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>
|
||||
|
||||
|
|
@ -1,302 +1,258 @@
|
|||
<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-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 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"></el-table-column>
|
||||
<el-table-column label="当前班次" prop="shift_name"></el-table-column>
|
||||
<el-table-column label="班长" prop="leader_name"></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-divider direction="vertical"></el-divider>
|
||||
<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>
|
||||
<div class="left-panel">
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="exportExcel()"
|
||||
:loading = "exportLoading"
|
||||
>导出xlsx
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handlePrint"
|
||||
>打印
|
||||
</el-button>
|
||||
<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"></el-table-column>
|
||||
<el-table-column label="当前班次" prop="shift_name"></el-table-column>
|
||||
<el-table-column label="班长" prop="leader_name"></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-divider direction="vertical"></el-divider>
|
||||
<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>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" @click="exportExcel()" :loading="exportLoading">导出xlsx
|
||||
</el-button>
|
||||
<el-button type="primary" @click="handlePrint">打印
|
||||
</el-button>
|
||||
</div>
|
||||
<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>
|
||||
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="numCell">日期</td>
|
||||
<td class="numCell" v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}</td>
|
||||
<td class="numCell">班次</td>
|
||||
<td class="numCell">{{ sflogItem.shift_name }}</td>
|
||||
<td class="numCell">班组</td>
|
||||
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">产量(t)</td>
|
||||
<td class="numCell">{{ reportItem.total_production }}</td>
|
||||
<td class="numCell">台时(t/h)</td>
|
||||
<td class="numCell">{{ reportItem.production_hour }}</td>
|
||||
<td class="numCell">运转时间(h)</td>
|
||||
<td class="numCell">{{ reportItem.run_hour }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">运转率(%)</td>
|
||||
<td class="numCell">{{ reportItem.run_rate * 100 }}</td>
|
||||
<td class="numCell">停机时长(h)</td>
|
||||
<td class="numCell">{{ reportItem.shut_hour }}</td>
|
||||
<td class="numCell">煤磨分布电耗(KW·h/t)</td>
|
||||
<td class="numCell">{{ reportItem.elec_consume_unit }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">煤粉细度合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.煤粉_细度_rate_pass">{{ reportItem.煤粉_细度_rate_pass * 100 }}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">煤粉水分合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.煤粉_水分_rate_pass">{{ reportItem.煤粉_水分_rate_pass * 100 }}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
</tr>
|
||||
<tr v-if="sflogexpList.length > 0">
|
||||
<td class="numCell" :rowspan="sflogexpList.length + 1">生产情况记录</td>
|
||||
<td class="numCell">时间</td>
|
||||
<td class="numCell">类别</td>
|
||||
<td class="numCell">原因</td>
|
||||
<td class="numCell">处置措施</td>
|
||||
<td class="numCell">处置人</td>
|
||||
</tr>
|
||||
<tr v-for="item in sflogexpList" :key="item.id">
|
||||
<td class="numCell">{{ item.happen_time }}</td>
|
||||
<td class="numCell">{{ item.cate }}</td>
|
||||
<td class="numCell">{{ item.reason }}</td>
|
||||
<td class="numCell">{{ item.measure }}</td>
|
||||
<td class="numCell">{{ item.handler }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<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>
|
||||
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="numCell">日期</td>
|
||||
<td class="numCell" v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}</td>
|
||||
<td class="numCell">班次</td>
|
||||
<td class="numCell">{{ sflogItem.shift_name }}</td>
|
||||
<td class="numCell">班组</td>
|
||||
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">产量(t)</td>
|
||||
<td class="numCell">{{reportItem.total_production}}</td>
|
||||
<td class="numCell">台时(t/h)</td>
|
||||
<td class="numCell">{{reportItem.production_hour}}</td>
|
||||
<td class="numCell">运转时间(h)</td>
|
||||
<td class="numCell">{{reportItem.run_hour}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">运转率(%)</td>
|
||||
<td class="numCell">{{reportItem.run_rate*100}}</td>
|
||||
<td class="numCell">停机时长(h)</td>
|
||||
<td class="numCell">{{reportItem.shut_hour}}</td>
|
||||
<td class="numCell">煤磨分布电耗(KW·h/t)</td>
|
||||
<td class="numCell">{{reportItem.elec_consume_unit}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">煤粉细度合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.煤粉_细度_rate_pass">{{reportItem.煤粉_细度_rate_pass*100}}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">煤粉水分合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.煤粉_水分_rate_pass">{{reportItem.煤粉_水分_rate_pass*100}}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
</tr>
|
||||
<tr v-if="sflogexpList.length>0">
|
||||
<td class="numCell" :rowspan="sflogexpList.length+1">生产情况记录</td>
|
||||
<td class="numCell">时间</td>
|
||||
<td class="numCell">类别</td>
|
||||
<td class="numCell">原因</td>
|
||||
<td class="numCell">处置措施</td>
|
||||
<td class="numCell">处置人</td>
|
||||
</tr>
|
||||
<tr v-for="item in sflogexpList" :key="item.id">
|
||||
<td class="numCell">{{ item.happen_time}}</td>
|
||||
<td class="numCell">{{ item.cate}}</td>
|
||||
<td class="numCell">{{ item.reason}}</td>
|
||||
<td class="numCell">{{ item.measure}}</td>
|
||||
<td class="numCell">{{ item.handler}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</el-main>
|
||||
</el-drawer>
|
||||
</el-container>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "sflog",
|
||||
|
||||
data() {
|
||||
return {
|
||||
apiObj: this.$API.wpm.sflog.list,
|
||||
apiObj2: null,
|
||||
</el-main>
|
||||
</el-drawer>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "sflog",
|
||||
|
||||
data() {
|
||||
return {
|
||||
apiObj: this.$API.wpm.sflog.list,
|
||||
apiObj2: null,
|
||||
query: {
|
||||
shift: '',
|
||||
team: '',
|
||||
end_time__lt: '',
|
||||
start_time__gte: '',
|
||||
mgroup: '3347217651339837440',
|
||||
},
|
||||
deptId: '3347207316583170048',
|
||||
sflogItem: {},
|
||||
options: [],
|
||||
optionsShift: [],
|
||||
limitedExport: false,
|
||||
reportItem: {},
|
||||
sflogexpList: [],
|
||||
};
|
||||
},
|
||||
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.list.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.getSflogItem(row.id);
|
||||
this.getSflogexp(row.id);
|
||||
},
|
||||
getSflogexp(id) {
|
||||
let that = this;
|
||||
that.$API.wpm.sflogexp.list.req({ page: 0, sflog: id }).then(res => {
|
||||
that.sflogexpList = res;
|
||||
})
|
||||
},
|
||||
getSflogItem(id) {
|
||||
let that = this;
|
||||
that.$API.enm.enstat.req({ type: 'sflog', sflog: id, page: 0 }).then(res => {
|
||||
if (res.length > 0) {
|
||||
that.reportItem = res[0];
|
||||
}
|
||||
})
|
||||
},
|
||||
//编辑
|
||||
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: {
|
||||
shift:'',
|
||||
team:'',
|
||||
end_time__lt:'',
|
||||
start_time__gte:'',
|
||||
mgroup:'3347217651339837440',
|
||||
mgroupId: row.mgroup,
|
||||
deptId: this.deptId
|
||||
},
|
||||
deptId:'3347207316583170048',
|
||||
sflogItem:{},
|
||||
options:[],
|
||||
optionsShift:[],
|
||||
limitedExport:false,
|
||||
reportItem:{},
|
||||
sflogexpList:[],
|
||||
};
|
||||
});
|
||||
},
|
||||
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.getSflogItem(row.id);
|
||||
this.getSflogexp(row.id);
|
||||
},
|
||||
getSflogexp(id){
|
||||
let that = this;
|
||||
that.$API.wpm.sflogexp.list.req({page:0,sflog:id}).then(res=>{
|
||||
that.sflogexpList = res;
|
||||
})
|
||||
},
|
||||
getSflogItem(id){
|
||||
let that =this;
|
||||
that.$API.enm.enstat.req({type:'sflog',sflog:id,page:0}).then(res=>{
|
||||
if(res.length>0){
|
||||
that.reportItem = res[0];
|
||||
}
|
||||
})
|
||||
},
|
||||
//编辑
|
||||
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,
|
||||
deptId:this.deptId
|
||||
},
|
||||
});
|
||||
},
|
||||
handlePrint() {
|
||||
this.$PRINT('#myReport');
|
||||
},
|
||||
exportExcel() {
|
||||
this.exportLoading = true;
|
||||
this.$XLSX('#myTable', this.tableName)
|
||||
this.exportLoading = false;
|
||||
},
|
||||
handlePrint() {
|
||||
this.$PRINT('#myReport');
|
||||
},
|
||||
};
|
||||
</script>
|
||||
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>
|
||||
<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>
|
||||
|
||||
|
|
@ -1,281 +1,237 @@
|
|||
<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>
|
||||
<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"></el-table-column>
|
||||
<el-table-column label="当前班次" prop="shift_name"></el-table-column>
|
||||
<el-table-column label="班长" prop="leader_name"></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-divider direction="vertical"></el-divider>
|
||||
<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>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" @click="exportExcel()" :loading="exportLoading">导出xlsx
|
||||
</el-button>
|
||||
<el-button type="primary" @click="handlePrint">打印
|
||||
</el-button>
|
||||
</div>
|
||||
<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>
|
||||
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="numCell">日期</td>
|
||||
<td class="numCell" v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}</td>
|
||||
<td class="numCell">班次</td>
|
||||
<td class="numCell">{{ sflogItem.shift_name }}</td>
|
||||
<td class="numCell">班组</td>
|
||||
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">产量(t)</td>
|
||||
<td class="numCell">{{ reportItem.total_production }}</td>
|
||||
<td class="numCell">单位产品分布电耗(KW·h/t)</td>
|
||||
<td class="numCell">{{ reportItem.elec_consume_unit }}</td>
|
||||
</tr>
|
||||
<tr v-if="sflogexpList.length > 0">
|
||||
<td class="numCell" :rowspan="sflogexpList.length + 1">生产情况记录</td>
|
||||
<td class="numCell">时间</td>
|
||||
<td class="numCell">类别</td>
|
||||
<td class="numCell">原因</td>
|
||||
<td class="numCell">处置措施</td>
|
||||
<td class="numCell">处置人</td>
|
||||
</tr>
|
||||
<tr v-for="item in sflogexpList" :key="item.id">
|
||||
<td class="numCell">{{ item.happen_time }}</td>
|
||||
<td class="numCell">{{ item.cate }}</td>
|
||||
<td class="numCell">{{ item.reason }}</td>
|
||||
<td class="numCell">{{ item.measure }}</td>
|
||||
<td class="numCell">{{ item.handler }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</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"></el-table-column>
|
||||
<el-table-column label="当前班次" prop="shift_name"></el-table-column>
|
||||
<el-table-column label="班长" prop="leader_name"></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-divider direction="vertical"></el-divider>
|
||||
<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>
|
||||
<div class="left-panel">
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="exportExcel()"
|
||||
:loading = "exportLoading"
|
||||
>导出xlsx
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handlePrint"
|
||||
>打印
|
||||
</el-button>
|
||||
</div>
|
||||
<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>
|
||||
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="numCell">日期</td>
|
||||
<td class="numCell" v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}</td>
|
||||
<td class="numCell">班次</td>
|
||||
<td class="numCell">{{ sflogItem.shift_name }}</td>
|
||||
<td class="numCell">班组</td>
|
||||
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">产量(t)</td>
|
||||
<td class="numCell">{{reportItem.total_production}}</td>
|
||||
<td class="numCell">单位产品分布电耗(KW·h/t)</td>
|
||||
<td class="numCell">{{reportItem.elec_consume_unit}}</td>
|
||||
</tr>
|
||||
<tr v-if="sflogexpList.length>0">
|
||||
<td class="numCell" :rowspan="sflogexpList.length+1">生产情况记录</td>
|
||||
<td class="numCell">时间</td>
|
||||
<td class="numCell">类别</td>
|
||||
<td class="numCell">原因</td>
|
||||
<td class="numCell">处置措施</td>
|
||||
<td class="numCell">处置人</td>
|
||||
</tr>
|
||||
<tr v-for="item in sflogexpList" :key="item.id">
|
||||
<td class="numCell">{{ item.happen_time}}</td>
|
||||
<td class="numCell">{{ item.cate}}</td>
|
||||
<td class="numCell">{{ item.reason}}</td>
|
||||
<td class="numCell">{{ item.measure}}</td>
|
||||
<td class="numCell">{{ item.handler}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</el-main>
|
||||
</el-drawer>
|
||||
</el-container>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "packsflog",
|
||||
data() {
|
||||
return {
|
||||
apiObj: this.$API.wpm.sflog.list,
|
||||
apiObj2: null,
|
||||
</el-main>
|
||||
</el-drawer>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "packsflog",
|
||||
data() {
|
||||
return {
|
||||
apiObj: this.$API.wpm.sflog.list,
|
||||
apiObj2: null,
|
||||
query: {
|
||||
mgroup: '3347217757455728640',
|
||||
},
|
||||
deptId: '3347207316583170048',
|
||||
|
||||
sflogItem: {},
|
||||
options: [],
|
||||
optionsShift: [],
|
||||
limitedExport: false,
|
||||
reportItem: {},
|
||||
sflogexpList: [],
|
||||
};
|
||||
},
|
||||
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.list.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.getSflogItem(row.id);
|
||||
this.getSflogexp(row.id);
|
||||
},
|
||||
getSflogexp(id) {
|
||||
let that = this;
|
||||
that.$API.wpm.sflogexp.list.req({ page: 0, sflog: id }).then(res => {
|
||||
that.sflogexpList = res;
|
||||
})
|
||||
},
|
||||
getSflogItem(id) {
|
||||
let that = this;
|
||||
that.$API.enm.enstat.req({ type: 'sflog', sflog: id, page: 0 }).then(res => {
|
||||
if (res.length > 0) {
|
||||
that.reportItem = res[0];
|
||||
}
|
||||
console.log(res[0])
|
||||
})
|
||||
},
|
||||
//编辑
|
||||
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: {
|
||||
mgroup:'3347217757455728640',
|
||||
mgroupId: row.mgroup,
|
||||
deptId: this.deptId
|
||||
},
|
||||
deptId:'3347207316583170048',
|
||||
|
||||
sflogItem:{},
|
||||
options:[],
|
||||
optionsShift:[],
|
||||
limitedExport:false,
|
||||
reportItem:{},
|
||||
sflogexpList:[],
|
||||
};
|
||||
});
|
||||
},
|
||||
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.getSflogItem(row.id);
|
||||
this.getSflogexp(row.id);
|
||||
},
|
||||
getSflogexp(id){
|
||||
let that = this;
|
||||
that.$API.wpm.sflogexp.list.req({page:0,sflog:id}).then(res=>{
|
||||
that.sflogexpList = res;
|
||||
})
|
||||
},
|
||||
getSflogItem(id){
|
||||
let that =this;
|
||||
that.$API.enm.enstat.req({type:'sflog',sflog:id,page:0}).then(res=>{
|
||||
if(res.length>0){
|
||||
that.reportItem = res[0];
|
||||
}
|
||||
console.log(res[0])
|
||||
})
|
||||
},
|
||||
//编辑
|
||||
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,
|
||||
deptId:this.deptId
|
||||
},
|
||||
});
|
||||
},
|
||||
handlePrint() {
|
||||
this.$PRINT('#myReport');
|
||||
},
|
||||
exportExcel() {
|
||||
this.exportLoading = true;
|
||||
this.$XLSX('#myTable', this.tableName)
|
||||
this.exportLoading = false;
|
||||
},
|
||||
handlePrint() {
|
||||
this.$PRINT('#myReport');
|
||||
},
|
||||
};
|
||||
</script>
|
||||
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>
|
||||
<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>
|
||||
|
||||
|
|
@ -1,204 +1,155 @@
|
|||
<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-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="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"></el-table-column>
|
||||
<el-table-column label="当前班次" prop="shift_name"></el-table-column>
|
||||
<el-table-column label="班长" prop="leader_name"></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-divider direction="vertical"></el-divider>
|
||||
<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>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" @click="exportExcel()" :loading="exportLoading">导出xlsx
|
||||
</el-button>
|
||||
<el-button type="primary" @click="handlePrint">打印
|
||||
</el-button>
|
||||
</div>
|
||||
<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="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"></el-table-column>
|
||||
<el-table-column label="当前班次" prop="shift_name"></el-table-column>
|
||||
<el-table-column label="班长" prop="leader_name"></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-divider direction="vertical"></el-divider>
|
||||
<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>
|
||||
<div class="left-panel">
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="exportExcel()"
|
||||
:loading = "exportLoading"
|
||||
>导出xlsx
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handlePrint"
|
||||
>打印
|
||||
</el-button>
|
||||
<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>
|
||||
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="numCell">日期</td>
|
||||
<td class="numCell" v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}</td>
|
||||
<td class="numCell">班次</td>
|
||||
<td class="numCell">{{ sflogItem.shift_name }}</td>
|
||||
<td class="numCell">班组</td>
|
||||
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">产量(t)</td>
|
||||
<td class="numCell">{{ reportItem.total_production }}</td>
|
||||
<td class="numCell">台时(t/h)</td>
|
||||
<td class="numCell">{{ reportItem.production_hour }}</td>
|
||||
<td class="numCell">运转时间(h)</td>
|
||||
<td class="numCell">{{ reportItem.run_hour }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">运转率(%)</td>
|
||||
<td class="numCell">{{ reportItem.run_rate * 100 }}</td>
|
||||
<td class="numCell">停机时长(h)</td>
|
||||
<td class="numCell">{{ reportItem.shut_hour }}</td>
|
||||
<td class="numCell">当期单位产品电耗(kW·h/t)</td>
|
||||
<td class="numCell">{{ reportItem.elec_consume_unit }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">辅料细度合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.辅料_细度_rate_pass">{{ reportItem.辅料_细度_rate_pass * 100 }}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">辅料Fe₂O₃合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.辅料_Fe2O3_rate_pass">{{ reportItem.辅料_Fe2O3_rate_pass * 100 }}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">辅料水分合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.辅料_水分_rate_pass">{{ reportItem.辅料_水分_rate_pass * 100 }}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">干混生料CaO合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.干混生料_CaO_rate_pass">{{ reportItem.干混生料_CaO_rate_pass * 100 }}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">干混生料Fe₂O₃合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.干混生料_Fe2O3_rate_pass">{{ reportItem.干混生料_Fe2O3_rate_pass * 100 }}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">干混生料细度合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.干混生料_细度_rate_pass">{{ reportItem.干混生料_细度_rate_pass * 100 }}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">干混生料水分合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.干混生料_水分_rate_pass">{{ reportItem.干混生料_水分_rate_pass * 100 }}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">单位成本(元/吨)</td>
|
||||
<td class="numCell">{{ reportItem.production_cost_unit }}</td>
|
||||
<td class="numCell"></td>
|
||||
<td class="numCell"></td>
|
||||
</tr>
|
||||
<tr v-if="sflogexpList.length > 0">
|
||||
<td class="numCell" :rowspan="sflogexpList.length + 1">生产情况记录</td>
|
||||
<td class="numCell">时间</td>
|
||||
<td class="numCell">类别</td>
|
||||
<td class="numCell">原因</td>
|
||||
<td class="numCell">处置措施</td>
|
||||
<td class="numCell">处置人</td>
|
||||
</tr>
|
||||
<tr v-for="item in sflogexpList" :key="item.id">
|
||||
<td class="numCell">{{ item.happen_time }}</td>
|
||||
<td class="numCell">{{ item.cate }}</td>
|
||||
<td class="numCell">{{ item.reason }}</td>
|
||||
<td class="numCell">{{ item.measure }}</td>
|
||||
<td class="numCell">{{ item.handler }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<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>
|
||||
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="numCell">日期</td>
|
||||
<td class="numCell" v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}</td>
|
||||
<td class="numCell">班次</td>
|
||||
<td class="numCell">{{ sflogItem.shift_name }}</td>
|
||||
<td class="numCell">班组</td>
|
||||
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">产量(t)</td>
|
||||
<td class="numCell">{{reportItem.total_production}}</td>
|
||||
<td class="numCell">台时(t/h)</td>
|
||||
<td class="numCell">{{reportItem.production_hour}}</td>
|
||||
<td class="numCell">运转时间(h)</td>
|
||||
<td class="numCell">{{reportItem.run_hour}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">运转率(%)</td>
|
||||
<td class="numCell">{{reportItem.run_rate*100}}</td>
|
||||
<td class="numCell">停机时长(h)</td>
|
||||
<td class="numCell">{{reportItem.shut_hour}}</td>
|
||||
<td class="numCell">当期单位产品电耗(kW·h/t)</td>
|
||||
<td class="numCell">{{reportItem.elec_consume_unit}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">辅料细度合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.辅料_细度_rate_pass">{{reportItem.辅料_细度_rate_pass*100}}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">辅料Fe₂O₃合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.辅料_Fe2O3_rate_pass">{{reportItem.辅料_Fe2O3_rate_pass*100}}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">辅料水分合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.辅料_水分_rate_pass">{{reportItem.辅料_水分_rate_pass*100}}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">干混生料CaO合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.干混生料_CaO_rate_pass">{{reportItem.干混生料_CaO_rate_pass*100}}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">干混生料Fe₂O₃合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.干混生料_Fe2O3_rate_pass">{{reportItem.干混生料_Fe2O3_rate_pass*100}}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">干混生料细度合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.干混生料_细度_rate_pass">{{reportItem.干混生料_细度_rate_pass*100}}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">干混生料水分合格率(%)</td>
|
||||
<td class="numCell" v-if="reportItem.干混生料_水分_rate_pass">{{reportItem.干混生料_水分_rate_pass*100}}</td>
|
||||
<td class="numCell" v-else>0</td>
|
||||
<td class="numCell">单位成本(元/吨)</td>
|
||||
<td class="numCell">{{reportItem.production_cost_unit}}</td>
|
||||
<td class="numCell"></td>
|
||||
<td class="numCell"></td>
|
||||
</tr>
|
||||
<tr v-if="sflogexpList.length>0">
|
||||
<td class="numCell" :rowspan="sflogexpList.length+1">生产情况记录</td>
|
||||
<td class="numCell">时间</td>
|
||||
<td class="numCell">类别</td>
|
||||
<td class="numCell">原因</td>
|
||||
<td class="numCell">处置措施</td>
|
||||
<td class="numCell">处置人</td>
|
||||
</tr>
|
||||
<tr v-for="item in sflogexpList" :key="item.id">
|
||||
<td class="numCell">{{ item.happen_time}}</td>
|
||||
<td class="numCell">{{ item.cate}}</td>
|
||||
<td class="numCell">{{ item.reason}}</td>
|
||||
<td class="numCell">{{ item.measure}}</td>
|
||||
<td class="numCell">{{ item.handler}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</el-main>
|
||||
</el-drawer>
|
||||
</el-container>
|
||||
<!-- <save-dialog
|
||||
</el-main>
|
||||
</el-drawer>
|
||||
</el-container>
|
||||
<!-- <save-dialog
|
||||
v-if="dialog.save"
|
||||
ref="saveDialog"
|
||||
:deptId ="deptId"
|
||||
|
|
@ -217,205 +168,211 @@
|
|||
@success="handleCheckSuccess"
|
||||
@closed="dialog.save = false"
|
||||
></quastat-dialog> -->
|
||||
</template>
|
||||
<script>
|
||||
</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
|
||||
export default {
|
||||
name: "sflog",
|
||||
components: {
|
||||
saveDialog,
|
||||
otherDialog,
|
||||
quastatDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
apiObj: this.$API.wpm.sflog.list,
|
||||
apiObj2: null,
|
||||
query: {
|
||||
mgroup: '3346520558031773696',
|
||||
},
|
||||
deptId: "3345780809943797760",
|
||||
|
||||
sflogItem: {},
|
||||
selection: [],
|
||||
modelValue: true,
|
||||
showClose: true,
|
||||
echartType: 'line',
|
||||
asynDialog: false,
|
||||
options: [],
|
||||
optionsShift: [],
|
||||
teamOptions: [],
|
||||
limitedExport: false,
|
||||
reportItem: {},
|
||||
sflogexpList: [],
|
||||
};
|
||||
},
|
||||
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;
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
apiObj: this.$API.wpm.sflog.list,
|
||||
apiObj2: null,
|
||||
getShfit() {
|
||||
this.$API.mtm.shift.list.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.getSflogItem(row.id);
|
||||
this.getSflogexp(row.id);
|
||||
},
|
||||
getSflogexp(id) {
|
||||
let that = this;
|
||||
that.$API.wpm.sflogexp.list.req({ page: 0, sflog: id }).then(res => {
|
||||
that.sflogexpList = res;
|
||||
})
|
||||
},
|
||||
getSflogItem(id) {
|
||||
let that = this;
|
||||
that.$API.enm.enstat.req({ type: 'sflog', sflog: id, page: 0 }).then(res => {
|
||||
if (res.length > 0) {
|
||||
that.reportItem = res[0];
|
||||
}
|
||||
console.log(res[0])
|
||||
})
|
||||
},
|
||||
//编辑
|
||||
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: {
|
||||
mgroup:'3346520558031773696',
|
||||
mgroupId: row.mgroup,
|
||||
deptId: this.deptId
|
||||
},
|
||||
deptId :"3345780809943797760",
|
||||
|
||||
sflogItem:{},
|
||||
selection: [],
|
||||
modelValue:true,
|
||||
showClose:true,
|
||||
echartType:'line',
|
||||
asynDialog:false,
|
||||
options:[],
|
||||
optionsShift:[],
|
||||
teamOptions:[],
|
||||
limitedExport:false,
|
||||
reportItem:{},
|
||||
sflogexpList:[],
|
||||
};
|
||||
});
|
||||
// this.dialog.save = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.saveDialog.open("edit").setData(row);
|
||||
// });
|
||||
},
|
||||
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;
|
||||
|
||||
//质量检验
|
||||
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;
|
||||
})
|
||||
},
|
||||
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.getSflogItem(row.id);
|
||||
this.getSflogexp(row.id);
|
||||
},
|
||||
getSflogexp(id){
|
||||
let that = this;
|
||||
that.$API.wpm.sflogexp.list.req({page:0,sflog:id}).then(res=>{
|
||||
that.sflogexpList = res;
|
||||
})
|
||||
},
|
||||
getSflogItem(id){
|
||||
let that =this;
|
||||
that.$API.enm.enstat.req({type:'sflog',sflog:id,page:0}).then(res=>{
|
||||
if(res.length>0){
|
||||
that.reportItem = res[0];
|
||||
.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("操作成功");
|
||||
}
|
||||
console.log(res[0])
|
||||
})
|
||||
},
|
||||
//编辑
|
||||
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,
|
||||
deptId:this.deptId
|
||||
},
|
||||
});
|
||||
// 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;
|
||||
},
|
||||
})
|
||||
.catch(() => { });
|
||||
},
|
||||
};
|
||||
</script>
|
||||
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>
|
||||
<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>
|
||||
|
||||
|
|
@ -1,225 +1,184 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
:title="titleMap[mode]"
|
||||
v-model="visible"
|
||||
:size="1000"
|
||||
destroy-on-close
|
||||
@closed="$emit('closed')"
|
||||
>
|
||||
<el-container v-loading="loading">
|
||||
<el-main style="padding: 0 20px 20px 20px">
|
||||
<el-form
|
||||
ref="dialogForm"
|
||||
:model="form"
|
||||
label-width="100px"
|
||||
label-position="right"
|
||||
:rules="rule1"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="关联工段" prop="mgroup">
|
||||
<el-input v-model="form.mgroup_name" placeholder="关联工段" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="当班班次" prop="shift">
|
||||
<el-input v-model="form.shift_name" placeholder="当班班次" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="开始时间" prop="start_time">
|
||||
<el-date-picker
|
||||
disabled
|
||||
v-model="form.start_time"
|
||||
type="datetime"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
placeholder="开始时间"
|
||||
style="width: 100%;"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="结束时间" prop="end_time">
|
||||
<el-date-picker
|
||||
disabled
|
||||
v-model="form.end_time"
|
||||
type="datetime"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
placeholder="结束时间"
|
||||
style="width: 100%;"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<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>
|
||||
<el-form-item label="生产情况记录">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
v-model="form.note"
|
||||
placeholder="生产情况记录"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-main>
|
||||
<el-footer>
|
||||
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
emits: ["success", "closed"],
|
||||
props: {
|
||||
deptId: {
|
||||
// 接受外部v-model传入的值
|
||||
type: [String],
|
||||
default: "",
|
||||
},
|
||||
mgroupId: {
|
||||
// 接受外部v-model传入的值
|
||||
type: [String],
|
||||
default: "",
|
||||
},
|
||||
<el-dialog :title="titleMap[mode]" v-model="visible" :size="1000" destroy-on-close @closed="$emit('closed')">
|
||||
<el-container v-loading="loading">
|
||||
<el-main style="padding: 0 20px 20px 20px">
|
||||
<el-form ref="dialogForm" :model="form" label-width="100px" label-position="right" :rules="rule1">
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="关联工段" prop="mgroup">
|
||||
<el-input v-model="form.mgroup_name" placeholder="关联工段" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="当班班次" prop="shift">
|
||||
<el-input v-model="form.shift_name" placeholder="当班班次" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="开始时间" prop="start_time">
|
||||
<el-date-picker disabled v-model="form.start_time" type="datetime" format="YYYY-MM-DD HH:mm"
|
||||
placeholder="开始时间" style="width: 100%;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="结束时间" prop="end_time">
|
||||
<el-date-picker disabled v-model="form.end_time" type="datetime" format="YYYY-MM-DD HH:mm"
|
||||
placeholder="结束时间" style="width: 100%;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<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>
|
||||
<el-form-item label="生产情况记录">
|
||||
<el-input type="textarea" :rows="4" v-model="form.note" placeholder="生产情况记录" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-main>
|
||||
<el-footer>
|
||||
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
emits: ["success", "closed"],
|
||||
props: {
|
||||
deptId: {
|
||||
// 接受外部v-model传入的值
|
||||
type: [String],
|
||||
default: "",
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
mode: "add",
|
||||
titleMap: {
|
||||
add: "交接班日志",
|
||||
edit: "交接班日志",
|
||||
show: "查看交接班日志",
|
||||
},
|
||||
form: {
|
||||
type:10,
|
||||
},
|
||||
rules: {
|
||||
name: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
number: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
keeper_name: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
belong_dept: [{required: true, message: "请选择", trigger: "blur"}]
|
||||
},
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
keeperOptions: [],
|
||||
depOptions: [],
|
||||
selectionFilters: [],
|
||||
setFiltersVisible: false,
|
||||
teamOptions:[],
|
||||
shiftOptions:[],
|
||||
};
|
||||
mgroupId: {
|
||||
// 接受外部v-model传入的值
|
||||
type: [String],
|
||||
default: "",
|
||||
},
|
||||
mounted() {
|
||||
this.mgroup = this.mgroupId;
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
mode: "add",
|
||||
titleMap: {
|
||||
add: "交接班日志",
|
||||
edit: "交接班日志",
|
||||
show: "查看交接班日志",
|
||||
},
|
||||
form: {
|
||||
type: 10,
|
||||
},
|
||||
rules: {
|
||||
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
number: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
keeper_name: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
belong_dept: [{ required: true, message: "请选择", trigger: "blur" }]
|
||||
},
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
keeperOptions: [],
|
||||
depOptions: [],
|
||||
selectionFilters: [],
|
||||
setFiltersVisible: false,
|
||||
teamOptions: [],
|
||||
shiftOptions: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.mgroup = this.mgroupId;
|
||||
debugger;
|
||||
console.log(this.deptId)
|
||||
console.log(this.mgroupId)
|
||||
//获取班组
|
||||
this.getTeam();
|
||||
this.getShfit();
|
||||
},
|
||||
methods: {
|
||||
getTeam() {
|
||||
debugger;
|
||||
console.log(this.deptId)
|
||||
console.log(this.mgroupId)
|
||||
//获取班组
|
||||
this.getTeam();
|
||||
this.getShfit();
|
||||
let form = {};
|
||||
form.page = 0;
|
||||
form.belong_dept = this.deptId;
|
||||
debugger;
|
||||
this.$API.mtm.team.list.req(form).then(res => {
|
||||
this.teamOptions = res;
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getTeam(){
|
||||
debugger;
|
||||
let form ={};
|
||||
form.page = 0;
|
||||
form.belong_dept = this.deptId;
|
||||
debugger;
|
||||
this.$API.mtm.team.list.req(form).then(res=>{
|
||||
this.teamOptions = res;
|
||||
})
|
||||
},
|
||||
getShfit(){
|
||||
this.$API.mtm.shift.req({page:0}).then(res=>{
|
||||
this.shiftOptions = res;
|
||||
})
|
||||
},
|
||||
//显示
|
||||
open(mode = "add") {
|
||||
this.mode = mode;
|
||||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
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() {
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
try {
|
||||
let obj={};
|
||||
obj.note = this.form.note;
|
||||
obj.team = this.form.team;
|
||||
obj.shift = this.form.shift;
|
||||
obj.leader = this.form.leader;
|
||||
obj.pcoal_heat = this.form.pcoal_heat;
|
||||
this.$API.wpm.sflog.update.req(this.form.id,obj).then(res=>{
|
||||
this.isSaveing = false;
|
||||
this.$emit("success", this.form, this.mode);
|
||||
this.visible = false;
|
||||
this.$message.success("操作成功");
|
||||
return res;
|
||||
})
|
||||
} catch (err) {
|
||||
//可以处理校验错误
|
||||
getShfit() {
|
||||
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
|
||||
this.shiftOptions = res;
|
||||
})
|
||||
},
|
||||
//显示
|
||||
open(mode = "add") {
|
||||
this.mode = mode;
|
||||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
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() {
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
try {
|
||||
let obj = {};
|
||||
obj.note = this.form.note;
|
||||
obj.team = this.form.team;
|
||||
obj.shift = this.form.shift;
|
||||
obj.leader = this.form.leader;
|
||||
obj.pcoal_heat = this.form.pcoal_heat;
|
||||
this.$API.wpm.sflog.update.req(this.form.id, obj).then(res => {
|
||||
this.isSaveing = false;
|
||||
return err;
|
||||
}
|
||||
this.$emit("success", this.form, this.mode);
|
||||
this.visible = false;
|
||||
this.$message.success("操作成功");
|
||||
return res;
|
||||
})
|
||||
} catch (err) {
|
||||
//可以处理校验错误
|
||||
this.isSaveing = false;
|
||||
return err;
|
||||
}
|
||||
});
|
||||
},
|
||||
//表单注入数据
|
||||
setData(data) {
|
||||
Object.assign(this.form,data);
|
||||
},
|
||||
//设置过滤项
|
||||
setFilters(filters) {
|
||||
this.selectionFilters = filters;
|
||||
this.setFiltersVisible = true;
|
||||
},
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
//表单注入数据
|
||||
setData(data) {
|
||||
Object.assign(this.form, data);
|
||||
},
|
||||
//设置过滤项
|
||||
setFilters(filters) {
|
||||
this.selectionFilters = filters;
|
||||
this.setFiltersVisible = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style></style>
|
||||
|
||||
|
|
@ -1,189 +1,174 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
:title="titleMap[mode]"
|
||||
v-model="visible"
|
||||
:size="1000"
|
||||
destroy-on-close
|
||||
@closed="$emit('closed')"
|
||||
>
|
||||
<el-container v-loading="loading">
|
||||
<el-main style="padding: 0 20px 20px 20px">
|
||||
<el-form
|
||||
ref="dialogForm"
|
||||
:model="form"
|
||||
label-width="100px"
|
||||
label-position="right"
|
||||
:rules="rules"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="关联工段" prop="mgroup">
|
||||
<el-input v-model="form.mgroup_name" placeholder="关联工段" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="当班班次">
|
||||
<el-input v-model="form.shift_name" placeholder="当班班次" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="开始时间" prop="start_time">
|
||||
<el-input v-model="form.start_time" placeholder="结束时间" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="结束时间" prop="end_time">
|
||||
<el-input v-model="form.end_time" placeholder="结束时间" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="当班班组" prop="team">
|
||||
<el-input v-model="form.team_name" placeholder="班组班长" disabled/>
|
||||
</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">
|
||||
<el-form-item label="检测时间" prop="time">
|
||||
<el-date-picker
|
||||
v-model="form.time"
|
||||
type="datetime"
|
||||
value-format="YYYY-MM-DD HH:mm"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
placeholder="检测时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24" class="formUnitWrap">
|
||||
<el-form-item label="水耗统计" prop="val">
|
||||
<el-input-number v-model="form.val" :precision="2" controls-position="right" placeholder="水耗统计" style="width: 100%;"></el-input-number>
|
||||
</el-form-item>
|
||||
<span class="formUnit">(t)</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-main>
|
||||
<el-footer>
|
||||
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
emits: ["success", "closed"],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
mode: "add",
|
||||
titleMap: {
|
||||
add: "其他能源录入",
|
||||
edit: "其他能源录入",
|
||||
show: "其他能源录入",
|
||||
},
|
||||
form: {
|
||||
type:10,
|
||||
},
|
||||
rules: {
|
||||
val: [{required: true, message: "请输入检测值", trigger: "blur"}],
|
||||
time: [{required: true, message: "请选择检测时间", trigger: "blur"}]
|
||||
},
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
keeperOptions: [],
|
||||
depOptions: [],
|
||||
selectionFilters: [],
|
||||
setFiltersVisible: false,
|
||||
teamOptions:[],
|
||||
shiftOptions:[],
|
||||
};
|
||||
<el-dialog :title="titleMap[mode]" v-model="visible" :size="1000" destroy-on-close @closed="$emit('closed')">
|
||||
<el-container v-loading="loading">
|
||||
<el-main style="padding: 0 20px 20px 20px">
|
||||
<el-form ref="dialogForm" :model="form" label-width="100px" label-position="right" :rules="rules">
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="关联工段" prop="mgroup">
|
||||
<el-input v-model="form.mgroup_name" placeholder="关联工段" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="当班班次">
|
||||
<el-input v-model="form.shift_name" placeholder="当班班次" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="开始时间" prop="start_time">
|
||||
<el-input v-model="form.start_time" placeholder="结束时间" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="结束时间" prop="end_time">
|
||||
<el-input v-model="form.end_time" placeholder="结束时间" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="当班班组" prop="team">
|
||||
<el-input v-model="form.team_name" placeholder="班组班长" disabled />
|
||||
</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">
|
||||
<el-form-item label="检测时间" prop="time">
|
||||
<el-date-picker v-model="form.time" type="datetime" value-format="YYYY-MM-DD HH:mm"
|
||||
format="YYYY-MM-DD HH:mm" placeholder="检测时间" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24" class="formUnitWrap">
|
||||
<el-form-item label="水耗统计" prop="val">
|
||||
<el-input-number v-model="form.val" :precision="2" controls-position="right" placeholder="水耗统计"
|
||||
style="width: 100%;"></el-input-number>
|
||||
</el-form-item>
|
||||
<span class="formUnit">(t)</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-main>
|
||||
<el-footer>
|
||||
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
emits: ["success", "closed"],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
mode: "add",
|
||||
titleMap: {
|
||||
add: "其他能源录入",
|
||||
edit: "其他能源录入",
|
||||
show: "其他能源录入",
|
||||
},
|
||||
form: {
|
||||
type: 10,
|
||||
},
|
||||
rules: {
|
||||
val: [{ required: true, message: "请输入检测值", trigger: "blur" }],
|
||||
time: [{ required: true, message: "请选择检测时间", trigger: "blur" }]
|
||||
},
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
keeperOptions: [],
|
||||
depOptions: [],
|
||||
selectionFilters: [],
|
||||
setFiltersVisible: false,
|
||||
teamOptions: [],
|
||||
shiftOptions: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
//获取班组
|
||||
this.getTeam();
|
||||
this.getShfit();
|
||||
},
|
||||
methods: {
|
||||
getTeam() {
|
||||
this.$API.mtm.team.list.req({ page: 0 }).then(res => {
|
||||
this.teamOptions = res;
|
||||
})
|
||||
},
|
||||
mounted() {
|
||||
//获取班组
|
||||
this.getTeam();
|
||||
this.getShfit();
|
||||
getShfit() {
|
||||
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
|
||||
this.shiftOptions = res;
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getTeam(){
|
||||
this.$API.mtm.team.list.req({page:0}).then(res=>{
|
||||
this.teamOptions = res;
|
||||
})
|
||||
},
|
||||
getShfit(){
|
||||
this.$API.mtm.shift.req({page:0}).then(res=>{
|
||||
this.shiftOptions = res;
|
||||
})
|
||||
},
|
||||
//显示
|
||||
open(mode = "add") {
|
||||
this.mode = mode;
|
||||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
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() {
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
try {
|
||||
let obj={};
|
||||
debugger;
|
||||
obj.year_s = this.form.time.slice(0,4);
|
||||
obj.month_s = this.form.time.slice(5,7);
|
||||
obj.day_s = this.form.time.slice(8,10);
|
||||
obj.hour = this.form.time.slice(11,13);
|
||||
obj.val = this.form.val;
|
||||
obj.sflog = this.form.id;
|
||||
obj.material = '3349350755361792000';
|
||||
obj.mpoint = '3349214860667219968';
|
||||
this.$API.enm.mpoint.statCreate.req(obj).then(res=>{
|
||||
this.isSaveing = false;
|
||||
this.$emit("success", this.form, this.mode);
|
||||
this.visible = false;
|
||||
this.$message.success("操作成功");
|
||||
return res;
|
||||
})
|
||||
} catch (err) {
|
||||
//可以处理校验错误
|
||||
//显示
|
||||
open(mode = "add") {
|
||||
this.mode = mode;
|
||||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
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() {
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
try {
|
||||
let obj = {};
|
||||
debugger;
|
||||
obj.year_s = this.form.time.slice(0, 4);
|
||||
obj.month_s = this.form.time.slice(5, 7);
|
||||
obj.day_s = this.form.time.slice(8, 10);
|
||||
obj.hour = this.form.time.slice(11, 13);
|
||||
obj.val = this.form.val;
|
||||
obj.sflog = this.form.id;
|
||||
obj.material = '3349350755361792000';
|
||||
obj.mpoint = '3349214860667219968';
|
||||
this.$API.enm.mpoint.statCreate.req(obj).then(res => {
|
||||
this.isSaveing = false;
|
||||
return err;
|
||||
}
|
||||
this.$emit("success", this.form, this.mode);
|
||||
this.visible = false;
|
||||
this.$message.success("操作成功");
|
||||
return res;
|
||||
})
|
||||
} catch (err) {
|
||||
//可以处理校验错误
|
||||
this.isSaveing = false;
|
||||
return err;
|
||||
}
|
||||
});
|
||||
},
|
||||
//表单注入数据
|
||||
setData(data) {
|
||||
Object.assign(this.form,data);
|
||||
},
|
||||
//设置过滤项
|
||||
setFilters(filters) {
|
||||
this.selectionFilters = filters;
|
||||
this.setFiltersVisible = true;
|
||||
},
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.formUnit{
|
||||
position: absolute;
|
||||
right: -17px;
|
||||
top: 7px;
|
||||
}
|
||||
.formUnitWrap{
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
//表单注入数据
|
||||
setData(data) {
|
||||
Object.assign(this.form, data);
|
||||
},
|
||||
//设置过滤项
|
||||
setFilters(filters) {
|
||||
this.selectionFilters = filters;
|
||||
this.setFiltersVisible = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.formUnit {
|
||||
position: absolute;
|
||||
right: -17px;
|
||||
top: 7px;
|
||||
}
|
||||
|
||||
.formUnitWrap {
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
@ -1,277 +1,234 @@
|
|||
<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-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="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"></el-table-column>
|
||||
<el-table-column label="当前班次" prop="shift_name"></el-table-column>
|
||||
<el-table-column label="班长" prop="leader_name"></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="150">
|
||||
<template #default="scope">
|
||||
<el-button link size="small" @click="sflog_edit(scope.row)" type="primary">编辑</el-button>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<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>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" @click="exportExcel()" :loading="exportLoading">导出xlsx
|
||||
</el-button>
|
||||
<el-button type="primary" @click="handlePrint">打印
|
||||
</el-button>
|
||||
</div>
|
||||
<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="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"></el-table-column>
|
||||
<el-table-column label="当前班次" prop="shift_name"></el-table-column>
|
||||
<el-table-column label="班长" prop="leader_name"></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="150">
|
||||
<template #default="scope">
|
||||
<el-button link size="small" @click="sflog_edit(scope.row)" type="primary">编辑</el-button>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<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>
|
||||
<div class="left-panel">
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="exportExcel()"
|
||||
:loading = "exportLoading"
|
||||
>导出xlsx
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handlePrint"
|
||||
>打印
|
||||
</el-button>
|
||||
<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>
|
||||
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="numCell">日期</td>
|
||||
<td class="numCell" v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}</td>
|
||||
<td class="numCell">班次</td>
|
||||
<td class="numCell">{{ sflogItem.shift_name }}</td>
|
||||
<td class="numCell">班组</td>
|
||||
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">产量(t)</td>
|
||||
<td class="numCell">{{ reportItem.total_production }}</td>
|
||||
<td class="numCell">单位产品分布电耗(KW·h/t)</td>
|
||||
<td class="numCell">{{ reportItem.elec_consume_unit }}</td>
|
||||
<td class="numCell">单位成本(元/吨)</td>
|
||||
<td class="numCell">{{ reportItem.production_cost_unit }}</td>
|
||||
</tr>
|
||||
<tr v-if="sflogexpList.length > 0">
|
||||
<td class="numCell" :rowspan="sflogexpList.length + 1">生产情况记录</td>
|
||||
<td class="numCell">时间</td>
|
||||
<td class="numCell">类别</td>
|
||||
<td class="numCell">原因</td>
|
||||
<td class="numCell">处置措施</td>
|
||||
<td class="numCell">处置人</td>
|
||||
</tr>
|
||||
<tr v-for="item in sflogexpList" :key="item.id">
|
||||
<td class="numCell">{{ item.happen_time }}</td>
|
||||
<td class="numCell">{{ item.cate }}</td>
|
||||
<td class="numCell">{{ item.reason }}</td>
|
||||
<td class="numCell">{{ item.measure }}</td>
|
||||
<td class="numCell">{{ item.handler }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<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>
|
||||
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="numCell">日期</td>
|
||||
<td class="numCell" v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}</td>
|
||||
<td class="numCell">班次</td>
|
||||
<td class="numCell">{{ sflogItem.shift_name }}</td>
|
||||
<td class="numCell">班组</td>
|
||||
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="numCell">产量(t)</td>
|
||||
<td class="numCell">{{reportItem.total_production}}</td>
|
||||
<td class="numCell">单位产品分布电耗(KW·h/t)</td>
|
||||
<td class="numCell">{{reportItem.elec_consume_unit}}</td>
|
||||
<td class="numCell">单位成本(元/吨)</td>
|
||||
<td class="numCell">{{reportItem.production_cost_unit}}</td>
|
||||
</tr>
|
||||
<tr v-if="sflogexpList.length>0">
|
||||
<td class="numCell" :rowspan="sflogexpList.length+1">生产情况记录</td>
|
||||
<td class="numCell">时间</td>
|
||||
<td class="numCell">类别</td>
|
||||
<td class="numCell">原因</td>
|
||||
<td class="numCell">处置措施</td>
|
||||
<td class="numCell">处置人</td>
|
||||
</tr>
|
||||
<tr v-for="item in sflogexpList" :key="item.id">
|
||||
<td class="numCell">{{ item.happen_time}}</td>
|
||||
<td class="numCell">{{ item.cate}}</td>
|
||||
<td class="numCell">{{ item.reason}}</td>
|
||||
<td class="numCell">{{ item.measure}}</td>
|
||||
<td class="numCell">{{ item.handler}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</el-main>
|
||||
</el-drawer>
|
||||
</el-container>
|
||||
</el-main>
|
||||
</el-drawer>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "sflog",
|
||||
data() {
|
||||
return {
|
||||
apiObj: this.$API.wpm.sflog.list,
|
||||
apiObj2: null,
|
||||
<script>
|
||||
export default {
|
||||
name: "sflog",
|
||||
data() {
|
||||
return {
|
||||
apiObj: this.$API.wpm.sflog.list,
|
||||
apiObj2: null,
|
||||
query: {
|
||||
mgroup: '3346491835287007232',
|
||||
},
|
||||
deptId: '3345780809943797760',
|
||||
sflogItem: {},
|
||||
options: [],
|
||||
optionsShift: [],
|
||||
limitedExport: false,
|
||||
reportItem: {},
|
||||
sflogexpList: [],
|
||||
};
|
||||
},
|
||||
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.list.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.getSflogItem(row.id);
|
||||
this.getSflogexp(row.id);
|
||||
},
|
||||
getSflogexp(id) {
|
||||
let that = this;
|
||||
that.$API.wpm.sflogexp.list.req({ page: 0, sflog: id }).then(res => {
|
||||
that.sflogexpList = res;
|
||||
})
|
||||
},
|
||||
getSflogItem(id) {
|
||||
let that = this;
|
||||
that.$API.enm.enstat.req({ type: 'sflog', sflog: id, page: 0 }).then(res => {
|
||||
if (res.length > 0) {
|
||||
that.reportItem = res[0];
|
||||
}
|
||||
console.log(res[0])
|
||||
})
|
||||
},
|
||||
//编辑
|
||||
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: {
|
||||
mgroup:'3346491835287007232',
|
||||
mgroupId: row.mgroup,
|
||||
deptId: this.deptId
|
||||
},
|
||||
deptId:'3345780809943797760',
|
||||
sflogItem:{},
|
||||
options:[],
|
||||
optionsShift:[],
|
||||
limitedExport:false,
|
||||
reportItem:{},
|
||||
sflogexpList:[],
|
||||
};
|
||||
});
|
||||
},
|
||||
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.getSflogItem(row.id);
|
||||
this.getSflogexp(row.id);
|
||||
},
|
||||
getSflogexp(id){
|
||||
let that = this;
|
||||
that.$API.wpm.sflogexp.list.req({page:0,sflog:id}).then(res=>{
|
||||
that.sflogexpList = res;
|
||||
})
|
||||
},
|
||||
getSflogItem(id){
|
||||
let that =this;
|
||||
that.$API.enm.enstat.req({type:'sflog',sflog:id,page:0}).then(res=>{
|
||||
if(res.length>0){
|
||||
that.reportItem = res[0];
|
||||
}
|
||||
console.log(res[0])
|
||||
})
|
||||
},
|
||||
//编辑
|
||||
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,
|
||||
deptId:this.deptId
|
||||
},
|
||||
});
|
||||
},
|
||||
handlePrint() {
|
||||
this.$PRINT('#myReport');
|
||||
},
|
||||
exportExcel() {
|
||||
this.exportLoading = true;
|
||||
this.$XLSX('#myTable', this.tableName)
|
||||
this.exportLoading = false;
|
||||
},
|
||||
handlePrint() {
|
||||
this.$PRINT('#myReport');
|
||||
},
|
||||
};
|
||||
</script>
|
||||
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>
|
||||
<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>
|
||||
|
||||
|
|
@ -1,32 +1,13 @@
|
|||
<template>
|
||||
<el-drawer
|
||||
:title="titleMap[mode]"
|
||||
v-model="visible"
|
||||
:size="1000"
|
||||
destroy-on-close
|
||||
@closed="closeDrawer"
|
||||
>
|
||||
<el-drawer :title="titleMap[mode]" v-model="visible" :size="1000" destroy-on-close @closed="closeDrawer">
|
||||
<el-container v-loading="loading">
|
||||
<el-main style="padding: 0 20px 20px 20px">
|
||||
<el-form
|
||||
ref="dialogForm"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:disabled="mode==='show'"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-form ref="dialogForm" :model="form" :rules="rules" :disabled="mode === 'show'" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="所属部门">
|
||||
<el-select
|
||||
v-model="belongDept"
|
||||
clearable
|
||||
style="width:100%"
|
||||
@change="getTeam"
|
||||
>
|
||||
<el-option v-for="item in deptOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
<el-select v-model="belongDept" clearable style="width:100%" @change="getTeam">
|
||||
<el-option v-for="item in deptOptions" :key="item.id" :label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
|
@ -34,49 +15,25 @@
|
|||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="班次">
|
||||
<el-select
|
||||
v-model="form.shift"
|
||||
placeholder="班次"
|
||||
clearable
|
||||
style="width:100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in shiftOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
<el-select v-model="form.shift" placeholder="班次" clearable style="width:100%">
|
||||
<el-option v-for="item in shiftOptions" :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="班组">
|
||||
<el-select
|
||||
v-model="form.team"
|
||||
placeholder="班组"
|
||||
clearable
|
||||
style="width:100%"
|
||||
@change="getuser"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in teamOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
<el-select v-model="form.team" placeholder="班组" clearable style="width:100%"
|
||||
@change="getuser">
|
||||
<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="工作日期">
|
||||
<el-date-picker
|
||||
v-model="form.work_date"
|
||||
type="date"
|
||||
placeholder="工作日期"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width:100%"
|
||||
/>
|
||||
<el-date-picker v-model="form.work_date" type="date" placeholder="工作日期" format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD" style="width:100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :md="12" :sm="24">
|
||||
|
|
@ -86,36 +43,21 @@
|
|||
</el-col> -->
|
||||
</el-row>
|
||||
</el-form>
|
||||
<sc-form-table
|
||||
v-model="userList"
|
||||
:addTemplate="addTemplate"
|
||||
placeholder="暂无数据"
|
||||
>
|
||||
<sc-form-table v-model="userList" :addTemplate="addTemplate" placeholder="暂无数据">
|
||||
<el-table-column prop="user_name" label="姓名"></el-table-column>
|
||||
<el-table-column prop="mgroup_name" label="工段"></el-table-column>
|
||||
<el-table-column prop="post_name" label="岗位"></el-table-column>
|
||||
<el-table-column prop="type" label="到岗状态">
|
||||
<template #default="scope">
|
||||
<el-select
|
||||
v-model="scope.row.state"
|
||||
filterable
|
||||
placeholder="到岗状态"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in stateOptions"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-select v-model="scope.row.state" filterable placeholder="到岗状态">
|
||||
<el-option v-for="item in stateOptions" :key="item.id" :label="item.label"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="note" label="备注">
|
||||
<template #default="scope">
|
||||
<el-input
|
||||
v-model="scope.row.note"
|
||||
placeholder="请输入内容"
|
||||
></el-input>
|
||||
<el-input v-model="scope.row.note" placeholder="请输入内容"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="open" label="操作" width="80" align="center">
|
||||
|
|
@ -129,9 +71,9 @@
|
|||
>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</sc-form-table>
|
||||
</sc-form-table>
|
||||
</el-main>
|
||||
<el-footer v-if="mode!=='show'">
|
||||
<el-footer v-if="mode !== 'show'">
|
||||
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
</el-footer>
|
||||
|
|
@ -139,152 +81,151 @@
|
|||
</el-drawer>
|
||||
</template>
|
||||
<script>
|
||||
const defaultForm = {
|
||||
list:[],
|
||||
};
|
||||
export default {
|
||||
emits: ["success", "closed"],
|
||||
data() {
|
||||
return {
|
||||
belongDept:'',
|
||||
loading: false,
|
||||
mode: "add",
|
||||
titleMap: {
|
||||
add: '新增记录',
|
||||
edit: '编辑记录',
|
||||
show: '查看记录'
|
||||
},
|
||||
|
||||
stateOptions:[
|
||||
{label: "待定", id: "pending"},
|
||||
{label: "正常", id: "normal"},
|
||||
{label: "迟到", id: "late"},
|
||||
{label: "早退", id: "early_leave"},
|
||||
{label: "未到岗", id: "absent"},
|
||||
{label: "请假", id: "leave"},
|
||||
],
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
form: defaultForm,
|
||||
userList:[],
|
||||
teamOptions:[],
|
||||
deptOptions: ['6车间','7车间','8车间','10车间'],
|
||||
shiftOptions:[],
|
||||
selectionFilters: [],
|
||||
setFiltersVisible: false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getShiftOptions();
|
||||
},
|
||||
methods: {
|
||||
getShiftOptions() {
|
||||
this.$API.system.dept.list.req({ page: 0,type:'dept'}).then(res=>{
|
||||
let data = [];
|
||||
res.forEach(item => {
|
||||
if(item.parent=='3423856735881117696'){
|
||||
data.push(item)
|
||||
}
|
||||
});
|
||||
this.deptOptions = data;
|
||||
});
|
||||
this.$API.mtm.shift.req({page:0}).then(res=>{
|
||||
this.shiftOptions = res;
|
||||
})
|
||||
const defaultForm = {
|
||||
list: [],
|
||||
};
|
||||
export default {
|
||||
emits: ["success", "closed"],
|
||||
data() {
|
||||
return {
|
||||
belongDept: '',
|
||||
loading: false,
|
||||
mode: "add",
|
||||
titleMap: {
|
||||
add: '新增记录',
|
||||
edit: '编辑记录',
|
||||
show: '查看记录'
|
||||
},
|
||||
getTeam(){
|
||||
//获取team
|
||||
this.$API.mtm.team.list.req({page:0,belong_dept:this.belongDept}).then(res=>{
|
||||
this.teamOptions = res;
|
||||
})
|
||||
|
||||
},
|
||||
getuser(){
|
||||
this.$API.mtm.teammember.list.req({team:this.form.team,page:0}).then(res=>{
|
||||
this.userList = [];
|
||||
res.forEach(item=>{
|
||||
let obj =item;
|
||||
obj.state = 'normal';
|
||||
obj.note = '';
|
||||
this.userList.push(obj)
|
||||
})
|
||||
})
|
||||
},
|
||||
//显示
|
||||
open(mode) {
|
||||
this.mode = mode;
|
||||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
closeDrawer() {
|
||||
this.visible = false;
|
||||
this.$emit('closed');
|
||||
},
|
||||
//表单提交方法
|
||||
submit() {
|
||||
this.$refs.dialogForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
let arr = [];
|
||||
this.userList.forEach(item=>{
|
||||
let obj = {};
|
||||
obj.team = this.form.team;
|
||||
obj.shift = this.form.shift;
|
||||
obj.work_date = this.form.work_date;
|
||||
obj.user = item.user;
|
||||
obj.state = item.state;
|
||||
obj.note = item.note;
|
||||
obj.post = item.post;
|
||||
arr.push(obj)
|
||||
})
|
||||
if (this.mode === 'add') {
|
||||
this.$API.hrm.attendance.create.req(arr)
|
||||
.then(res => {
|
||||
this.isSaveing = false;
|
||||
this.visible = false;
|
||||
this.$emit("success");
|
||||
this.$message.success("操作成功");
|
||||
return res
|
||||
}).catch(err => {
|
||||
this.isSaveing = false;
|
||||
return err
|
||||
})
|
||||
} else {
|
||||
this.$API.hrm.attendance.update.req(this.form.id, this.form)
|
||||
.then(res => {
|
||||
this.isSaveing = false;
|
||||
this.visible = false;
|
||||
this.$emit("success", this.form, this.mode);
|
||||
this.$message.success("操作成功");
|
||||
return res
|
||||
}).catch(err => {
|
||||
this.isSaveing = false;
|
||||
return err
|
||||
})
|
||||
}
|
||||
|
||||
stateOptions: [
|
||||
{ label: "待定", id: "pending" },
|
||||
{ label: "正常", id: "normal" },
|
||||
{ label: "迟到", id: "late" },
|
||||
{ label: "早退", id: "early_leave" },
|
||||
{ label: "未到岗", id: "absent" },
|
||||
{ label: "请假", id: "leave" },
|
||||
],
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
form: defaultForm,
|
||||
userList: [],
|
||||
teamOptions: [],
|
||||
deptOptions: ['6车间', '7车间', '8车间', '10车间'],
|
||||
shiftOptions: [],
|
||||
selectionFilters: [],
|
||||
setFiltersVisible: false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getShiftOptions();
|
||||
},
|
||||
methods: {
|
||||
getShiftOptions() {
|
||||
this.$API.system.dept.list.req({ page: 0, type: 'dept' }).then(res => {
|
||||
let data = [];
|
||||
res.forEach(item => {
|
||||
if (item.parent == '3423856735881117696') {
|
||||
data.push(item)
|
||||
}
|
||||
});
|
||||
},
|
||||
//表单注入数据
|
||||
setData(data) {
|
||||
//debugger;
|
||||
// console.log(defaultForm);
|
||||
// this.form = defaultForm;
|
||||
this.loading = true;
|
||||
this.$API.hrm.employee.item.req(data.id).then(res=>{
|
||||
this.loading = false;
|
||||
this.form = res
|
||||
}).catch(e=>{this.loading = false;})
|
||||
// Object.assign(this.form, data);
|
||||
},
|
||||
//设置过滤项
|
||||
setFilters(filters) {
|
||||
this.selectionFilters = filters;
|
||||
this.setFiltersVisible = true;
|
||||
},
|
||||
this.deptOptions = data;
|
||||
});
|
||||
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
|
||||
this.shiftOptions = res;
|
||||
})
|
||||
},
|
||||
};
|
||||
getTeam() {
|
||||
//获取team
|
||||
this.$API.mtm.team.list.req({ page: 0, belong_dept: this.belongDept }).then(res => {
|
||||
this.teamOptions = res;
|
||||
})
|
||||
|
||||
},
|
||||
getuser() {
|
||||
this.$API.mtm.teammember.list.req({ team: this.form.team, page: 0 }).then(res => {
|
||||
this.userList = [];
|
||||
res.forEach(item => {
|
||||
let obj = item;
|
||||
obj.state = 'normal';
|
||||
obj.note = '';
|
||||
this.userList.push(obj)
|
||||
})
|
||||
})
|
||||
},
|
||||
//显示
|
||||
open(mode) {
|
||||
this.mode = mode;
|
||||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
closeDrawer() {
|
||||
this.visible = false;
|
||||
this.$emit('closed');
|
||||
},
|
||||
//表单提交方法
|
||||
submit() {
|
||||
this.$refs.dialogForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
let arr = [];
|
||||
this.userList.forEach(item => {
|
||||
let obj = {};
|
||||
obj.team = this.form.team;
|
||||
obj.shift = this.form.shift;
|
||||
obj.work_date = this.form.work_date;
|
||||
obj.user = item.user;
|
||||
obj.state = item.state;
|
||||
obj.note = item.note;
|
||||
obj.post = item.post;
|
||||
arr.push(obj)
|
||||
})
|
||||
if (this.mode === 'add') {
|
||||
this.$API.hrm.attendance.create.req(arr)
|
||||
.then(res => {
|
||||
this.isSaveing = false;
|
||||
this.visible = false;
|
||||
this.$emit("success");
|
||||
this.$message.success("操作成功");
|
||||
return res
|
||||
}).catch(err => {
|
||||
this.isSaveing = false;
|
||||
return err
|
||||
})
|
||||
} else {
|
||||
this.$API.hrm.attendance.update.req(this.form.id, this.form)
|
||||
.then(res => {
|
||||
this.isSaveing = false;
|
||||
this.visible = false;
|
||||
this.$emit("success", this.form, this.mode);
|
||||
this.$message.success("操作成功");
|
||||
return res
|
||||
}).catch(err => {
|
||||
this.isSaveing = false;
|
||||
return err
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//表单注入数据
|
||||
setData(data) {
|
||||
//debugger;
|
||||
// console.log(defaultForm);
|
||||
// this.form = defaultForm;
|
||||
this.loading = true;
|
||||
this.$API.hrm.employee.item.req(data.id).then(res => {
|
||||
this.loading = false;
|
||||
this.form = res
|
||||
}).catch(e => { this.loading = false; })
|
||||
// Object.assign(this.form, data);
|
||||
},
|
||||
//设置过滤项
|
||||
setFilters(filters) {
|
||||
this.selectionFilters = filters;
|
||||
this.setFiltersVisible = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
<style></style>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,13 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="所属部门" prop="belong_dept_name" min-width="150"></el-table-column>
|
||||
<el-table-column label="班次规则" prop="shift_rule" min-width="80"></el-table-column>
|
||||
<el-table-column label="能源监测" prop="need_enm" min-width="80">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.need_enm">是</span>
|
||||
<span v-else>否</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="排序" prop="sort" min-width="80"></el-table-column>
|
||||
<el-table-column label="创建时间" prop="create_time" min-width="150"></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="180">
|
||||
|
|
@ -36,11 +43,7 @@
|
|||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
<save-dialog
|
||||
v-if="dialog.save"
|
||||
ref="saveDialog"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false">
|
||||
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save = false">
|
||||
</save-dialog>
|
||||
</template>
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -12,16 +12,24 @@
|
|||
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="能源监测" prop="need_enm">
|
||||
<el-switch v-model="form.need_enm"></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属部门">
|
||||
<el-select v-model="form.belong_dept" placeholder="所属部门" clearable style="width: 100%;">
|
||||
<el-option v-for="item in group" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="排班规则">
|
||||
<el-select v-model="form.shift_rule" style="width: 100%">
|
||||
<el-option v-for="item in shiftOptions" :key="item" :label="item" :value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序">
|
||||
<el-input-number v-model="form.sort" :min="1" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<sc-form-table ref="table" v-model="materialList" :addTemplate="addTemplate" placeholder="暂无数据">
|
||||
<sc-form-table ref="table" v-model="materialList" :addTemplate="addTemplate" placeholder="暂无数据">
|
||||
<el-table-column prop="type" label="输入物料" min-width="120" align="center">
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.material_in" style="width: 100%">
|
||||
|
|
@ -31,19 +39,20 @@
|
|||
</el-table-column>
|
||||
<el-table-column prop="type" label="输出物料" min-width="120" align="center">
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.material_out" filterable style="width: 100%" >
|
||||
<el-option v-for="item in materials" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
<el-select v-model="scope.row.material_out" filterable style="width: 100%">
|
||||
<el-option v-for="item in materials" :key="item" :label="item" :value="item"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="type" label="操作" min-width="80" align="center">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" v-if="scope.row.isedit" @click="submitForm(scope.row,scope.$index)">确定</el-button>
|
||||
<el-button type="warning" v-else @click="editForm(scope.row,scope.$index)">编辑</el-button>
|
||||
<el-button type="danger" @click="delForm(scope.row,scope.$index)">删除</el-button>
|
||||
<el-button type="primary" v-if="scope.row.isedit"
|
||||
@click="submitForm(scope.row, scope.$index)">确定</el-button>
|
||||
<el-button type="warning" v-else @click="editForm(scope.row, scope.$index)">编辑</el-button>
|
||||
<el-button type="danger" @click="delForm(scope.row, scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</sc-form-table>
|
||||
</sc-form-table>
|
||||
</el-main>
|
||||
<el-footer>
|
||||
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
|
||||
|
|
@ -74,6 +83,7 @@ export default {
|
|||
},
|
||||
//表单数据
|
||||
form: {
|
||||
shift_rule: ''
|
||||
},
|
||||
//验证规则
|
||||
rules: {
|
||||
|
|
@ -83,16 +93,18 @@ export default {
|
|||
},
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
shiftOptions: [],
|
||||
options: [],
|
||||
group: [],
|
||||
routes:[],
|
||||
routes: [],
|
||||
materials: [],
|
||||
setFiltersVisible: false,
|
||||
materialList:[{material_in:'',material_out:'',mgroup:'',isedit:true}],
|
||||
addTemplate:{material_in:'',material_out:'',mgroup:'',isedit:true}
|
||||
materialList: [{ material_in: '', material_out: '', mgroup: '', isedit: true }],
|
||||
addTemplate: { material_in: '', material_out: '', mgroup: '', isedit: true }
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getShifts();
|
||||
this.getGroup();//获取部门
|
||||
this.getProcess();//获取工序
|
||||
this.getMaterial();//获取物料
|
||||
|
|
@ -110,25 +122,36 @@ export default {
|
|||
this.options = res;
|
||||
});
|
||||
},
|
||||
getMaterial(){
|
||||
this.$API.mtm.material.list.req({ page: 0,is_hidden:false,type__in:'10,20' }).then(res => {
|
||||
getShifts() {
|
||||
let shiftList = []
|
||||
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
|
||||
for (var i = 0; i < res.length; i++) {
|
||||
if (shiftList.indexOf(res[i].rule) == -1) {
|
||||
shiftList.push(res[i].rule)
|
||||
}
|
||||
}
|
||||
this.shiftOptions = shiftList;
|
||||
});
|
||||
},
|
||||
getMaterial() {
|
||||
this.$API.mtm.material.list.req({ page: 0, is_hidden: false, type__in: '10,20' }).then(res => {
|
||||
this.materials = res;
|
||||
});
|
||||
},
|
||||
getRoute(id){
|
||||
getRoute(id) {
|
||||
let that = this;
|
||||
that.$API.mtm.route.list.req({ mgroup: id,page:0 }).then(res => {
|
||||
that.$API.mtm.route.list.req({ mgroup: id, page: 0 }).then(res => {
|
||||
that.routes = res;
|
||||
if(res.length>0){
|
||||
res.forEach(item=>{
|
||||
if (res.length > 0) {
|
||||
res.forEach(item => {
|
||||
let obj = {};
|
||||
obj.material_in=item.material_in;
|
||||
obj.material_out=item.material_out;
|
||||
obj.material_in = item.material_in;
|
||||
obj.material_out = item.material_out;
|
||||
obj.mgroup = id;
|
||||
obj.isedit=false;
|
||||
obj.isedit = false;
|
||||
})
|
||||
that.materialList.push(obj);
|
||||
}else{}
|
||||
} else { }
|
||||
});
|
||||
},
|
||||
//显示
|
||||
|
|
@ -142,7 +165,7 @@ export default {
|
|||
Object.assign(this.form, data);
|
||||
this.getRoute(data.id);
|
||||
},
|
||||
setMgroup(id){
|
||||
setMgroup(id) {
|
||||
this.form.mgroup = id;
|
||||
},
|
||||
getReceptionist(data) {
|
||||
|
|
@ -156,32 +179,28 @@ export default {
|
|||
let that = this;
|
||||
that.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
if(this.mode){
|
||||
|
||||
}else{
|
||||
that.form.cate = 'photon';
|
||||
that.form.need_enm = false;
|
||||
that.isSaveing = true;
|
||||
if (that.mode === 'add') {
|
||||
that.$API.mtm.mgroup.create.req(that.form).then(res => {
|
||||
that.isSaveing = false;
|
||||
that.$emit("success", that.form, that.mode);
|
||||
that.visible = false;
|
||||
that.$message.success("操作成功");
|
||||
})
|
||||
} else {
|
||||
that.$API.mtm.mgroup.update.req(that.form.id, that.form).then(res => {
|
||||
that.isSaveing = false;
|
||||
that.$emit("success", that.form, that.mode);
|
||||
that.visible = false;
|
||||
that.$message.success("操作成功");
|
||||
})
|
||||
}
|
||||
}
|
||||
that.form.cate = 'photon';
|
||||
that.form.need_enm = false;
|
||||
that.isSaveing = true;
|
||||
if (that.mode === 'add') {
|
||||
that.$API.mtm.mgroup.create.req(that.form).then(res => {
|
||||
that.isSaveing = false;
|
||||
that.$emit("success", that.form, that.mode);
|
||||
that.visible = false;
|
||||
that.$message.success("操作成功");
|
||||
})
|
||||
} else {
|
||||
that.$API.mtm.mgroup.update.req(that.form.id, that.form).then(res => {
|
||||
that.isSaveing = false;
|
||||
that.$emit("success", that.form, that.mode);
|
||||
that.visible = false;
|
||||
that.$message.success("操作成功");
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
submitForm(row,index){
|
||||
submitForm(row, index) {
|
||||
let that = this;
|
||||
let obj = {};
|
||||
obj.material_in = row.material_in;
|
||||
|
|
@ -191,18 +210,18 @@ export default {
|
|||
this.$API.mtm.route.update.req(row.id, obj).then(res => {
|
||||
that.materialList[index].isedit = false;
|
||||
})
|
||||
} else{
|
||||
} else {
|
||||
obj.mgroup = that.form.id;
|
||||
this.$API.mtm.route.create.req(obj).then(res => {
|
||||
that.materialList[index].isedit = false;
|
||||
})
|
||||
}
|
||||
},
|
||||
editForm(row,index){
|
||||
editForm(row, index) {
|
||||
let that = this;
|
||||
that.materialList[index].isedit = true;
|
||||
},
|
||||
delForm(row,index){
|
||||
delForm(row, index) {
|
||||
let that = this;
|
||||
this.$API.mtm.route.delete.req(row.id).then(res => {
|
||||
that.getRoute(that.form.id);
|
||||
|
|
|
|||
|
|
@ -3,105 +3,40 @@
|
|||
<div class="app-container">
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-select
|
||||
v-model="query.mgroup"
|
||||
placeholder="工段"
|
||||
clearable
|
||||
@change="mgroupChange"
|
||||
class="headerSearch"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in mgroupOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
<el-select v-model="query.mgroup" placeholder="工段" clearable @change="mgroupChange" class="headerSearch">
|
||||
<el-option v-for="item in mgroupOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="query.type"
|
||||
placeholder="查询类型"
|
||||
clearable
|
||||
class="headerSearch"
|
||||
@change="typeCange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
<el-select v-model="query.type" placeholder="查询类型" clearable class="headerSearch" @change="typeCange">
|
||||
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
<el-date-picker
|
||||
v-model="query.day"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
format="YYYY-MM-DD"
|
||||
placeholder="日"
|
||||
class="headerSearch"
|
||||
v-if="query.type==0"
|
||||
/>
|
||||
<el-date-picker v-model="query.day" type="date" value-format="YYYY-MM-DD" format="YYYY-MM-DD"
|
||||
placeholder="日" class="headerSearch" v-if="query.type == 0" />
|
||||
<!-- 选择班次 -->
|
||||
<el-select
|
||||
v-if="query.type==0"
|
||||
v-model="query.shift"
|
||||
placeholder="班次"
|
||||
clearable
|
||||
class="headerSearch"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in optionsShift"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
<el-select v-if="query.type == 0" v-model="query.shift" placeholder="班次" clearable class="headerSearch">
|
||||
<el-option v-for="item in optionsShift" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
<el-date-picker
|
||||
v-model="query.month"
|
||||
type="month"
|
||||
value-format="YYYY-MM"
|
||||
format="YYYY-MM"
|
||||
placeholder="月份"
|
||||
class="headerSearch"
|
||||
v-if="query.type==1"
|
||||
/>
|
||||
<el-date-picker
|
||||
v-model="query.year"
|
||||
type="year"
|
||||
value-format="YYYY"
|
||||
format="YYYY"
|
||||
placeholder="年份"
|
||||
class="headerSearch"
|
||||
v-if="query.type==2"
|
||||
/>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="getTableData"
|
||||
></el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="exportExcel()"
|
||||
:loading = "exportLoading"
|
||||
>导出xlsx
|
||||
<el-date-picker v-model="query.month" type="month" value-format="YYYY-MM" format="YYYY-MM" placeholder="月份"
|
||||
class="headerSearch" v-if="query.type == 1" />
|
||||
<el-date-picker v-model="query.year" type="year" value-format="YYYY" format="YYYY" placeholder="年份"
|
||||
class="headerSearch" v-if="query.type == 2" />
|
||||
<el-button type="primary" icon="el-icon-search" @click="getTableData"></el-button>
|
||||
<el-button type="primary" @click="exportExcel()" :loading="exportLoading">导出xlsx
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handlePrint"
|
||||
>打印
|
||||
<el-button type="primary" @click="handlePrint">打印
|
||||
</el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-card style="margin-top:5px">
|
||||
<div ref="print" id="myReport" class="printContainer">
|
||||
<table border="1" cellspacing="0" :key="timeStamp" id="myTable" class="myTable">
|
||||
<table border="1" cellspacing="0" :key="timeStamp" id="myTable" class="myTable">
|
||||
<thead class="myTableHead">
|
||||
<tr>
|
||||
<th :colspan="allCol">{{tableName}}</th>
|
||||
<th :colspan="allCol">{{ tableName }}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="3">日期</th>
|
||||
<th rowspan="3" v-if="query.type==0">班次</th>
|
||||
<th rowspan="3" v-if="query.type==0">班组</th>
|
||||
<th rowspan="3" v-if="query.type == 0">班次</th>
|
||||
<th rowspan="3" v-if="query.type == 0">班组</th>
|
||||
<th rowspan="3">实际产量(t)</th>
|
||||
<th rowspan="3">总成本(元)</th>
|
||||
<th rowspan="3">单位成本(元/吨)</th>
|
||||
|
|
@ -110,9 +45,9 @@
|
|||
<th colspan="8">制造费用</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th v-if="data1>0" :colspan="data1">原材料</th>
|
||||
<th v-if="data3>0" :colspan="data3">辅助材料</th>
|
||||
<th v-if="data2>0" :colspan="data2">电/水</th>
|
||||
<th v-if="data1 > 0" :colspan="data1">原材料</th>
|
||||
<th v-if="data3 > 0" :colspan="data3">辅助材料</th>
|
||||
<th v-if="data2 > 0" :colspan="data2">电/水</th>
|
||||
<th>车间人员工资</th>
|
||||
<th>劳务工资</th>
|
||||
<th>倒运费用</th>
|
||||
|
|
@ -124,7 +59,7 @@
|
|||
<th>摊销</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th v-for="(item,index) in materialList" :key="index">{{ item }}</th>
|
||||
<th v-for="(item, index) in materialList" :key="index">{{ item }}</th>
|
||||
<th>单位成本(元/吨)</th>
|
||||
<th>单位成本(元/吨)</th>
|
||||
<th>单位成本(元/吨)</th>
|
||||
|
|
@ -137,62 +72,62 @@
|
|||
<th>无形资产摊销单位成本(元/吨)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="(item,index) in tableData1" :key="index">
|
||||
<td class="tableCell" v-for="(item1,index1) in item" :key="index1">{{ item1 }}</td>
|
||||
<tr v-for="(item, index) in tableData1" :key="index">
|
||||
<td class="tableCell" v-for="(item1, index1) in item" :key="index1">{{ item1 }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
query:{
|
||||
type:1,
|
||||
day:'',
|
||||
month:'',
|
||||
year:'',
|
||||
shift:'',
|
||||
},
|
||||
allCol:16,
|
||||
data1:0,//原材料
|
||||
data2:0,//电和水
|
||||
data3:0,//辅助材料
|
||||
data4:0,//助剂
|
||||
data5:0,//包装
|
||||
materialList:[],
|
||||
mgroupOptions:[],
|
||||
tableName:'班组成本计算',
|
||||
options:[
|
||||
{id:0,name:'班统计'},
|
||||
{id:1,name:'日统计'},
|
||||
{id:2,name:'月统计'},
|
||||
],
|
||||
tableNmae:'',
|
||||
tableData1:[],
|
||||
optionsShift:[],
|
||||
sourceData:{}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
var myDate = new Date();
|
||||
let month = myDate.getMonth()+1;
|
||||
if(month<10){
|
||||
month = '0'+month;
|
||||
}
|
||||
this.query.month = myDate.getFullYear()+'-'+month;
|
||||
this.getShift();
|
||||
this.getMgroup();
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
query: {
|
||||
type: 1,
|
||||
day: '',
|
||||
month: '',
|
||||
year: '',
|
||||
shift: '',
|
||||
},
|
||||
allCol: 16,
|
||||
data1: 0,//原材料
|
||||
data2: 0,//电和水
|
||||
data3: 0,//辅助材料
|
||||
data4: 0,//助剂
|
||||
data5: 0,//包装
|
||||
materialList: [],
|
||||
mgroupOptions: [],
|
||||
tableName: '班组成本计算',
|
||||
options: [
|
||||
{ id: 0, name: '班统计' },
|
||||
{ id: 1, name: '日统计' },
|
||||
{ id: 2, name: '月统计' },
|
||||
],
|
||||
tableNmae: '',
|
||||
tableData1: [],
|
||||
optionsShift: [],
|
||||
sourceData: {}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
var myDate = new Date();
|
||||
let month = myDate.getMonth() + 1;
|
||||
if (month < 10) {
|
||||
month = '0' + month;
|
||||
}
|
||||
this.query.month = myDate.getFullYear() + '-' + month;
|
||||
this.getShift();
|
||||
this.getMgroup();
|
||||
|
||||
},
|
||||
methods: {
|
||||
//获取工段列表
|
||||
getMgroup(){
|
||||
this.$API.mtm.mgroup.list.req({page:0}).then(res=>{
|
||||
res.forEach(item=>{
|
||||
if(item.name!=='煤磨'&&item.name!=='水泥包装'){
|
||||
},
|
||||
methods: {
|
||||
//获取工段列表
|
||||
getMgroup() {
|
||||
this.$API.mtm.mgroup.list.req({ page: 0 }).then(res => {
|
||||
res.forEach(item => {
|
||||
if (item.name !== '煤磨' && item.name !== '水泥包装') {
|
||||
this.mgroupOptions.push(item);
|
||||
}
|
||||
})
|
||||
|
|
@ -200,138 +135,137 @@
|
|||
this.query.mgroup = this.mgroupOptions[0].id;
|
||||
this.tableName = '电石渣干粉核算'
|
||||
})
|
||||
},
|
||||
//班组列表
|
||||
getShift(){
|
||||
this.$API.mtm.shift.req({page:0}).then(res=>{
|
||||
},
|
||||
//班组列表
|
||||
getShift() {
|
||||
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
|
||||
this.optionsShift = res;
|
||||
})
|
||||
},
|
||||
mgroupChange(value){
|
||||
let arr = this.mgroupOptions.filter(item=>{
|
||||
return item.id==value
|
||||
})
|
||||
let name = arr[0].name;
|
||||
if(name=='电石渣'){
|
||||
this.tableName = '电石渣干粉核算'
|
||||
}else if(name=='原料磨'){
|
||||
this.tableName = '生料核算'
|
||||
}else if(name=='回转窑'){
|
||||
this.tableName = '熟料核算'
|
||||
}else if(name=='水泥磨'){
|
||||
this.tableName = '水泥核算'
|
||||
})
|
||||
},
|
||||
mgroupChange(value) {
|
||||
let arr = this.mgroupOptions.filter(item => {
|
||||
return item.id == value
|
||||
})
|
||||
let name = arr[0].name;
|
||||
if (name == '电石渣') {
|
||||
this.tableName = '电石渣干粉核算'
|
||||
} else if (name == '原料磨') {
|
||||
this.tableName = '生料核算'
|
||||
} else if (name == '回转窑') {
|
||||
this.tableName = '熟料核算'
|
||||
} else if (name == '水泥磨') {
|
||||
this.tableName = '水泥核算'
|
||||
}
|
||||
|
||||
},
|
||||
//查询类型
|
||||
typeCange(value) {
|
||||
if (value == 1) {
|
||||
this.tableName = '班组成本计算'
|
||||
} else if (value == 1) {
|
||||
this.tableName = '日成本计算'
|
||||
} else {
|
||||
this.tableName = '月成本计算'
|
||||
}
|
||||
},
|
||||
getData() {
|
||||
let that = this;
|
||||
that.data1 = 0;
|
||||
that.data2 = 0;
|
||||
that.data3 = 0;
|
||||
that.data4 = 0;
|
||||
that.data5 = 0;
|
||||
let params = {};
|
||||
let arr = [];
|
||||
params.page = 0;
|
||||
params.mgroup = that.query.mgroup;
|
||||
if (that.query.type == 0) {//班
|
||||
arr = that.query.day.split('-');
|
||||
params.year_s = Number(arr[0]);
|
||||
params.month_s = Number(arr[1]);
|
||||
params.day_s = Number(arr[2]);
|
||||
params.type = "day_s"
|
||||
} else if (that.query.type == 1) {//日
|
||||
arr = that.query.month.split('-');
|
||||
params.year_s = Number(arr[0]);
|
||||
params.month_s = Number(arr[1]);
|
||||
params.type = "day_s"
|
||||
} else {//月
|
||||
params.year_s = Number(that.query.year);
|
||||
params.type = "month_s"
|
||||
}
|
||||
that.$API.enm.enstat.req(params).then(res => {
|
||||
if (res.length > 0) {
|
||||
let materials = res[0].imaterial_data;
|
||||
let arr = [];
|
||||
materials.forEach(item => {
|
||||
if (item.material_type == 0) {//电水
|
||||
that.data2 = that.data2 + 4;
|
||||
} else if (item.material_type == 30 || item.material_type == 20) {//原材料
|
||||
that.data1 = that.data1 + 4;
|
||||
} else if (item.material_type == 40) {//辅助材料
|
||||
that.data3 = that.data3 + 4;
|
||||
}
|
||||
arr.push(item.material_name)
|
||||
arr.push('单价(元/吨)')
|
||||
arr.push('总成本(元)')
|
||||
arr.push('单位成本(元/吨)')
|
||||
})
|
||||
that.allCol = arr.length + 16
|
||||
that.materialList = arr;
|
||||
let dataArr = [];
|
||||
res.forEach(itemData => {
|
||||
let time = '';
|
||||
dataArr = [];
|
||||
if (that.query.type == 0) {
|
||||
time = itemData.year_s + '.' + itemData.month_s + '.' + itemData.day_s;
|
||||
} else if (that.query.type == 1) {
|
||||
time = itemData.year_s + '.' + itemData.month_s + '.' + itemData.day_s;
|
||||
} else {
|
||||
time = itemData.year_s + '.' + itemData.month_s;
|
||||
}
|
||||
dataArr.push(time);
|
||||
if (that.query.type == 0) {
|
||||
dataArr.push(itemData.shift);
|
||||
dataArr.push(itemData.team_name);
|
||||
}
|
||||
dataArr.push(itemData.total_production);
|
||||
dataArr.push(itemData.coal_consume_unit);
|
||||
dataArr.push(itemData.cen_consume_unit);
|
||||
let sub1data = itemData.imaterial_data;
|
||||
for (let i = 0; i < sub1data.length; i++) {
|
||||
dataArr.push(sub1data[i].cost)
|
||||
dataArr.push(sub1data[i].price_unit)
|
||||
dataArr.push(sub1data[i].amount_consume)
|
||||
dataArr.push(sub1data[i].cost_unit)
|
||||
}
|
||||
let otherdata = itemData.other_cost_data;
|
||||
for (let j = 0; j < otherdata.length; j++) {
|
||||
dataArr.push(otherdata[j].cost_unit)
|
||||
}
|
||||
that.tableData1.push(dataArr)
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
//查询类型
|
||||
typeCange(value){
|
||||
if(value==1){
|
||||
this.tableName = '班组成本计算'
|
||||
}else if(value==1){
|
||||
this.tableName = '日成本计算'
|
||||
}else{
|
||||
this.tableName = '月成本计算'
|
||||
}
|
||||
},
|
||||
getData(){
|
||||
let that = this;
|
||||
that.data1 = 0;
|
||||
that.data2 = 0;
|
||||
that.data3 = 0;
|
||||
that.data4 = 0;
|
||||
that.data5 = 0;
|
||||
let params = {};
|
||||
let arr = [];
|
||||
params.page=0;
|
||||
params.mgroup=that.query.mgroup;
|
||||
if(that.query.type==0){//班
|
||||
arr = that.query.day.split('-');
|
||||
params.year_s = Number(arr[0]);
|
||||
params.month_s = Number(arr[1]);
|
||||
params.day_s = Number(arr[2]);
|
||||
params.type="day_s"
|
||||
}else if(that.query.type==1){//日
|
||||
arr = that.query.month.split('-');
|
||||
params.year_s = Number(arr[0]);
|
||||
params.month_s = Number(arr[1]);
|
||||
params.type="day_s"
|
||||
}else{//月
|
||||
params.year_s = Number(that.query.year);
|
||||
params.type="month_s"
|
||||
}
|
||||
that.$API.enm.enstat.req(params).then(res=>{
|
||||
if(res.length>0){
|
||||
let materials = res[0].imaterial_data;
|
||||
let arr = [];
|
||||
materials.forEach(item=>{
|
||||
if(item.material_type==0){//电水
|
||||
that.data2=that.data2+4;
|
||||
}else if(item.material_type==30||item.material_type==20){//原材料
|
||||
that.data1=that.data1+4;
|
||||
}else if(item.material_type==40){//辅助材料
|
||||
that.data3=that.data3+4;
|
||||
}
|
||||
arr.push(item.material_name)
|
||||
arr.push('单价(元/吨)')
|
||||
arr.push('总成本(元)')
|
||||
arr.push('单位成本(元/吨)')
|
||||
})
|
||||
that.allCol = arr.length+16
|
||||
that.materialList = arr;
|
||||
let dataArr = [];
|
||||
res.forEach(itemData=>{
|
||||
let time ='';
|
||||
dataArr = [];
|
||||
if(that.query.type==0){
|
||||
time = itemData.year_s+'.'+itemData.month_s+'.'+itemData.day_s;
|
||||
}else if(that.query.type==1){
|
||||
time = itemData.year_s+'.'+itemData.month_s+'.'+itemData.day_s;
|
||||
}else{
|
||||
time = itemData.year_s+'.'+itemData.month_s;
|
||||
}
|
||||
dataArr.push(time);
|
||||
if(that.query.type==0){
|
||||
dataArr.push(itemData.shift);
|
||||
dataArr.push(itemData.team_name);
|
||||
}
|
||||
dataArr.push(itemData.total_production);
|
||||
dataArr.push(itemData.coal_consume_unit);
|
||||
dataArr.push(itemData.cen_consume_unit);
|
||||
let sub1data = itemData.imaterial_data;
|
||||
for(let i=0;i<sub1data.length;i++){
|
||||
dataArr.push(sub1data[i].cost)
|
||||
dataArr.push(sub1data[i].price_unit)
|
||||
dataArr.push(sub1data[i].amount_consume)
|
||||
dataArr.push(sub1data[i].cost_unit)
|
||||
}
|
||||
let otherdata = itemData.other_cost_data;
|
||||
for(let j=0;j<otherdata.length;j++){
|
||||
dataArr.push(otherdata[j].cost_unit)
|
||||
}
|
||||
that.tableData1.push(dataArr)
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getTableData(){
|
||||
this.getData();
|
||||
},
|
||||
|
||||
handlePrint() {
|
||||
this.$PRINT('#myReport');
|
||||
},
|
||||
exportExcel() {
|
||||
this.exportLoading = true;
|
||||
this.$XLSX('#myTable', this.tableName)
|
||||
this.exportLoading = false;
|
||||
},
|
||||
}
|
||||
};
|
||||
})
|
||||
},
|
||||
getTableData() {
|
||||
this.getData();
|
||||
},
|
||||
|
||||
handlePrint() {
|
||||
this.$PRINT('#myReport');
|
||||
},
|
||||
exportExcel() {
|
||||
this.exportLoading = true;
|
||||
this.$XLSX('#myTable', this.tableName)
|
||||
this.exportLoading = false;
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.printContainer{
|
||||
width:100%;
|
||||
overflow-x:scroll;
|
||||
}
|
||||
|
||||
.printContainer {
|
||||
width: 100%;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -4,105 +4,71 @@
|
|||
<el-header>
|
||||
<div class="left-panel">
|
||||
<div style="margin-right: 20px">质量检验</div>
|
||||
<el-date-picker
|
||||
v-model="query.start_time__gte"
|
||||
type="datetime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
placeholder="开始时间"
|
||||
/>
|
||||
<el-date-picker
|
||||
v-model="query.end_time__day"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
format="YYYY-MM-DD"
|
||||
placeholder="结束时间"
|
||||
/>
|
||||
<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-date-picker v-model="query.start_time__gte" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
|
||||
format="YYYY-MM-DD HH:mm:ss" placeholder="开始时间" />
|
||||
<el-date-picker v-model="query.end_time__day" type="date" value-format="YYYY-MM-DD" format="YYYY-MM-DD"
|
||||
placeholder="结束时间" />
|
||||
<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 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>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main>
|
||||
<el-row gutter="6">
|
||||
<el-col :span="12"><el-card style="height: 300px;"></el-card></el-col>
|
||||
<el-col :span="12"><el-card style="height: 300px;"></el-card></el-col>
|
||||
<el-col :span="12"><el-card style="height: 300px;"></el-card></el-col>
|
||||
<el-col :span="12"><el-card style="height: 300px;"></el-card></el-col>
|
||||
</el-row>
|
||||
<el-row gutter="6">
|
||||
<el-col :span="12"><el-card style="height: 300px;"></el-card></el-col>
|
||||
<el-col :span="12"><el-card style="height: 300px;"></el-card></el-col>
|
||||
<el-col :span="12"><el-card style="height: 300px;"></el-card></el-col>
|
||||
<el-col :span="12"><el-card style="height: 300px;"></el-card></el-col>
|
||||
</el-row>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "listSon",
|
||||
data() {
|
||||
return {
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "listSon",
|
||||
data() {
|
||||
return {
|
||||
query: {
|
||||
mgroup:'3346520558031773696',
|
||||
},
|
||||
options:[],
|
||||
optionsShift:[],
|
||||
};
|
||||
},
|
||||
mounted(){
|
||||
mgroup: '3346520558031773696',
|
||||
},
|
||||
options: [],
|
||||
optionsShift: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getTeam();
|
||||
this.getShift();
|
||||
},
|
||||
methods: {
|
||||
getTeam(){
|
||||
this.$API.mtm.team.list.req({page:0}).then(res=>{
|
||||
this.options = res;
|
||||
},
|
||||
methods: {
|
||||
getTeam() {
|
||||
this.$API.mtm.team.list.req({ page: 0 }).then(res => {
|
||||
this.options = res;
|
||||
})
|
||||
},
|
||||
getShift(){
|
||||
this.$API.mtm.shift.req({page:0}).then(res=>{
|
||||
this.optionsShift = res;
|
||||
getShift() {
|
||||
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
|
||||
this.optionsShift = res;
|
||||
})
|
||||
},
|
||||
//质量检验
|
||||
sflog_check(row){
|
||||
this.dialog.check = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.checkDialog.open("edit").setData(row);
|
||||
});
|
||||
},
|
||||
handleQuery(){
|
||||
this.$API.wpm.sflog.list.req(this.query).then(res=>{
|
||||
//质量检验
|
||||
sflog_check(row) {
|
||||
this.dialog.check = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.checkDialog.open("edit").setData(row);
|
||||
});
|
||||
},
|
||||
handleQuery() {
|
||||
this.$API.wpm.sflog.list.req(this.query).then(res => {
|
||||
debugger;
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue