feat: mgroup增加排班规则字段

This commit is contained in:
caoqianming 2023-11-23 16:07:48 +08:00
parent dd2fc9a455
commit 5d8621cac0
15 changed files with 2746 additions and 3575 deletions

View File

@ -205,6 +205,7 @@ export default {
},
//班次
shift: {
list: {
name: "班次列表",
req: async function(data){
return await http.get(
@ -212,6 +213,8 @@ export default {
data
);
}
}
},
//班组
team: {

View File

@ -3,74 +3,30 @@
<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"/>
<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>
<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>
<span>{{ scope.row.end_time.slice(0, 16) }}</span>
</template>
</el-table-column>
<el-table-column label="班组名称" prop="team_name"></el-table-column>
@ -79,7 +35,7 @@
<el-table-column label="检验时间">
<template #default="scope">
<span v-if="scope.row.last_test_time">{{ scope.row.last_test_time.slice(0,16)}}</span>
<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">
@ -97,27 +53,22 @@
<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 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-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.end_time">{{ sflogItem.end_time.slice(0, 10) }}{{ sflogItem.shift_name }}</span>
<span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span>
交接班记录
</div>
@ -125,7 +76,7 @@
<tbody>
<tr>
<td class="numCell">日期</td>
<td class="numCell" v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}</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>
@ -133,30 +84,30 @@
</tr>
<tr>
<td class="numCell">产量t</td>
<td class="numCell">{{reportItem.total_production}}</td>
<td class="numCell">{{ reportItem.total_production }}</td>
<td class="numCell">台时t/h</td>
<td class="numCell">{{reportItem.production_hour}}</td>
<td class="numCell">{{ reportItem.production_hour }}</td>
<td class="numCell">运转时间h</td>
<td class="numCell">{{reportItem.run_hour}}</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">{{ reportItem.run_rate * 100 }}</td>
<td class="numCell">停机时长h</td>
<td class="numCell">{{reportItem.shut_hour}}</td>
<td class="numCell">{{ reportItem.shut_hour }}</td>
<td class="numCell">煤磨分布电耗KW·h/t</td>
<td class="numCell">{{reportItem.elec_consume_unit}}</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-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-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>
<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>
@ -164,11 +115,11 @@
<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>
<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>
@ -178,50 +129,50 @@
</el-container>
</template>
<script>
export default {
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',
shift: '',
team: '',
end_time__lt: '',
start_time__gte: '',
mgroup: '3347217512021835776',
},
deptId :'3347207082608115712',
sflogItem:{},
options:[],
optionsShift:[],
limitedExport:false,
reportItem:{},
sflogexpList:[],
deptId: '3347207082608115712',
sflogItem: {},
options: [],
optionsShift: [],
limitedExport: false,
reportItem: {},
sflogexpList: [],
};
},
mounted(){
mounted() {
this.getTeam();
this.getShfit();
},
methods: {
getTeam(){
let form ={};
getTeam() {
let form = {};
form.page = 0;
form.belong_dept = this.deptId;
this.$API.mtm.team.list.req(form).then(res=>{
this.$API.mtm.team.list.req(form).then(res => {
this.options = res;
})
},
getShfit(){
this.$API.mtm.shift.req({page:0}).then(res=>{
getShfit() {
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
this.optionsShift = res;
})
},
handleQuery(){
handleQuery() {
this.$refs.table.queryData(this.query);
},
sflog_export(){
sflog_export() {
this.limitedExport = true;
},
rowClick(row) {
@ -230,16 +181,16 @@
this.getSflogItem(row.id);
this.getSflogexp(row.id);
},
getSflogexp(id){
getSflogexp(id) {
let that = this;
that.$API.wpm.sflogexp.list.req({page:0,sflog:id}).then(res=>{
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){
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])
@ -249,12 +200,12 @@
sflog_edit(row) {
let jsonStr = JSON.stringify(row);
this.$TOOL.data.remove("sflogItem")
this.$TOOL.data.set('sflogItem',jsonStr)
this.$TOOL.data.set('sflogItem', jsonStr)
this.$router.push({
name: "logDetail",
query: {
mgroupId: row.mgroup,
deptId:this.deptId
deptId: this.deptId
},
});
},
@ -267,34 +218,40 @@
this.exportLoading = false;
},
},
};
</script>
};
</script>
<style scoped>
#numTable{
<style scoped>
#numTable {
margin-left: 37px;
}
#numTable td{
}
#numTable td {
height: 32px;
padding-left: 5px;
}
.numCell{
}
.numCell {
width: 80px;
}
.numCell.numCell_last{
}
.numCell.numCell_last {
width: 100px;
}
.searchHead{
display:flex
}
.middleText{
}
.searchHead {
display: flex
}
.middleText {
height: 32px;
line-height: 32px;
margin: 0 5px;
display: inline-block;
}
.searchBtn{
margin-left: 5px;
}
</style>
}
.searchBtn {
margin-left: 5px;
}
</style>

View File

@ -3,75 +3,31 @@
<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"/>
<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>
<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>
<span>{{ scope.row.end_time.slice(0, 16) }}</span>
</template>
</el-table-column>
<el-table-column label="班组名称" prop="team_name"></el-table-column>
@ -79,7 +35,7 @@
<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>
<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">
@ -97,27 +53,22 @@
<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 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-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.end_time">{{ sflogItem.end_time.slice(0, 10) }}{{ sflogItem.shift_name }}</span>
<span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span>
交接班记录
</div>
@ -125,7 +76,7 @@
<tbody>
<tr>
<td class="numCell">日期</td>
<td class="numCell" v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}</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>
@ -133,52 +84,53 @@
</tr>
<tr>
<td class="numCell">产量t</td>
<td class="numCell">{{reportItem.total_production}}</td>
<td class="numCell">{{ reportItem.total_production }}</td>
<td class="numCell">台时t/h</td>
<td class="numCell">{{reportItem.production_hour}}</td>
<td class="numCell">{{ reportItem.production_hour }}</td>
<td class="numCell">运转时间h</td>
<td class="numCell">{{reportItem.run_hour}}</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">{{ reportItem.run_rate * 100 }}</td>
<td class="numCell">停机时长h</td>
<td class="numCell">{{reportItem.shut_hour}}</td>
<td class="numCell">{{ reportItem.shut_hour }}</td>
<td class="numCell">单位产品分布电耗KW·h/t</td>
<td class="numCell">{{reportItem.elec_consume_unit}}</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">{{ 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-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-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-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-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-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-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">{{ 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>
<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>
@ -186,11 +138,11 @@
<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>
<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>
@ -198,53 +150,53 @@
</el-main>
</el-drawer>
</el-container>
</template>
<script>
export default {
</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',
shift: '',
team: '',
end_time__lt: '',
start_time__gte: '',
mgroup: '3347217246321065984',
},
deptId :'3347207082608115712',
sflogItem:{},
options:[],
optionsShift:[],
limitedExport:false,
reportItem:{},
sflogexpList:[],
deptId: '3347207082608115712',
sflogItem: {},
options: [],
optionsShift: [],
limitedExport: false,
reportItem: {},
sflogexpList: [],
};
},
mounted(){
mounted() {
this.getTeam();
this.getShfit();
},
methods: {
getTeam(){
let form ={};
getTeam() {
let form = {};
form.page = 0;
form.belong_dept = this.deptId;
this.$API.mtm.team.list.req(form).then(res=>{
this.$API.mtm.team.list.req(form).then(res => {
this.options = res;
})
},
getShfit(){
this.$API.mtm.shift.req({page:0}).then(res=>{
getShfit() {
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
this.optionsShift = res;
})
},
handleQuery(){
handleQuery() {
this.$refs.table.queryData(this.query);
},
sflog_export(){
sflog_export() {
this.limitedExport = true;
},
rowClick(row) {
@ -253,16 +205,16 @@
this.getSflogItem(row.id);
this.getSflogexp(row.id);
},
getSflogexp(id){
getSflogexp(id) {
let that = this;
that.$API.wpm.sflogexp.list.req({page:0,sflog:id}).then(res=>{
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){
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])
@ -272,12 +224,12 @@
sflog_edit(row) {
let jsonStr = JSON.stringify(row);
this.$TOOL.data.remove("sflogItem")
this.$TOOL.data.set('sflogItem',jsonStr)
this.$TOOL.data.set('sflogItem', jsonStr)
this.$router.push({
name: "logDetail",
query: {
mgroupId: row.mgroup,
deptId:this.deptId
deptId: this.deptId
},
});
},
@ -290,35 +242,41 @@
this.exportLoading = false;
},
},
};
</script>
};
</script>
<style scoped>
#numTable{
<style scoped>
#numTable {
margin-left: 37px;
}
#numTable td{
}
#numTable td {
height: 32px;
padding-left: 5px;
}
.numCell{
}
.numCell {
width: 80px;
text-align: center;
}
.numCell.numCell_last{
}
.numCell.numCell_last {
width: 100px;
}
.searchHead{
display:flex
}
.middleText{
}
.searchHead {
display: flex
}
.middleText {
height: 32px;
line-height: 32px;
margin: 0 5px;
display: inline-block;
}
.searchBtn{
margin-left: 5px;
}
</style>
}
.searchBtn {
margin-left: 5px;
}
</style>

View File

@ -3,75 +3,31 @@
<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"/>
<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>
<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>
<span>{{ scope.row.end_time.slice(0, 16) }}</span>
</template>
</el-table-column>
<el-table-column label="班组名称" prop="team_name"></el-table-column>
@ -80,7 +36,7 @@
<el-table-column label="检验时间">
<template #default="scope">
<span v-if="scope.row.last_test_time">{{ scope.row.last_test_time.slice(0,16)}}</span>
<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">
@ -98,27 +54,22 @@
<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 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-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.end_time">{{ sflogItem.end_time.slice(0, 10) }}{{ sflogItem.shift_name }}</span>
<span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span>
交接班记录
</div>
@ -126,7 +77,7 @@
<tbody>
<tr>
<td class="numCell">日期</td>
<td class="numCell" v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}</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>
@ -134,30 +85,30 @@
</tr>
<tr>
<td class="numCell">产量t</td>
<td class="numCell">{{reportItem.total_production}}</td>
<td class="numCell">{{ reportItem.total_production }}</td>
<td class="numCell">台时t/h</td>
<td class="numCell">{{reportItem.production_hour}}</td>
<td class="numCell">{{ reportItem.production_hour }}</td>
<td class="numCell">运转时间h</td>
<td class="numCell">{{reportItem.run_hour}}</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">{{ reportItem.run_rate * 100 }}</td>
<td class="numCell">停机时长h</td>
<td class="numCell">{{reportItem.shut_hour}}</td>
<td class="numCell">{{ reportItem.shut_hour }}</td>
<td class="numCell">煤磨分布电耗KW·h/t</td>
<td class="numCell">{{reportItem.elec_consume_unit}}</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-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-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>
<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>
@ -165,11 +116,11 @@
<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>
<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>
@ -177,10 +128,9 @@
</el-main>
</el-drawer>
</el-container>
</template>
<script>
export default {
</template>
<script>
export default {
name: "sflog",
data() {
@ -188,43 +138,43 @@
apiObj: this.$API.wpm.sflog.list,
apiObj2: null,
query: {
shift:'',
team:'',
end_time__lt:'',
start_time__gte:'',
mgroup:'3347217651339837440',
shift: '',
team: '',
end_time__lt: '',
start_time__gte: '',
mgroup: '3347217651339837440',
},
deptId:'3347207316583170048',
sflogItem:{},
options:[],
optionsShift:[],
limitedExport:false,
reportItem:{},
sflogexpList:[],
deptId: '3347207316583170048',
sflogItem: {},
options: [],
optionsShift: [],
limitedExport: false,
reportItem: {},
sflogexpList: [],
};
},
mounted(){
mounted() {
this.getTeam();
this.getShfit();
},
methods: {
getTeam(){
let form ={};
getTeam() {
let form = {};
form.page = 0;
form.belong_dept = this.deptId;
this.$API.mtm.team.list.req(form).then(res=>{
this.$API.mtm.team.list.req(form).then(res => {
this.options = res;
})
},
getShfit(){
this.$API.mtm.shift.req({page:0}).then(res=>{
getShfit() {
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
this.optionsShift = res;
})
},
handleQuery(){
handleQuery() {
this.$refs.table.queryData(this.query);
},
sflog_export(){
sflog_export() {
this.limitedExport = true;
},
rowClick(row) {
@ -233,16 +183,16 @@
this.getSflogItem(row.id);
this.getSflogexp(row.id);
},
getSflogexp(id){
getSflogexp(id) {
let that = this;
that.$API.wpm.sflogexp.list.req({page:0,sflog:id}).then(res=>{
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){
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];
}
})
@ -251,12 +201,12 @@
sflog_edit(row) {
let jsonStr = JSON.stringify(row);
this.$TOOL.data.remove("sflogItem")
this.$TOOL.data.set('sflogItem',jsonStr)
this.$TOOL.data.set('sflogItem', jsonStr)
this.$router.push({
name: "logDetail",
query: {
mgroupId: row.mgroup,
deptId:this.deptId
deptId: this.deptId
},
});
},
@ -269,34 +219,40 @@
this.exportLoading = false;
},
},
};
</script>
};
</script>
<style scoped>
#numTable{
<style scoped>
#numTable {
margin-left: 37px;
}
#numTable td{
}
#numTable td {
height: 32px;
padding-left: 5px;
}
.numCell{
}
.numCell {
width: 80px;
}
.numCell.numCell_last{
}
.numCell.numCell_last {
width: 100px;
}
.searchHead{
display:flex
}
.middleText{
}
.searchHead {
display: flex
}
.middleText {
height: 32px;
line-height: 32px;
margin: 0 5px;
display: inline-block;
}
.searchBtn{
margin-left: 5px;
}
</style>
}
.searchBtn {
margin-left: 5px;
}
</style>

View File

@ -3,75 +3,31 @@
<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"/>
<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>
<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>
<span>{{ scope.row.end_time.slice(0, 16) }}</span>
</template>
</el-table-column>
<el-table-column label="班组名称" prop="team_name"></el-table-column>
@ -80,7 +36,7 @@
<el-table-column label="检验时间">
<template #default="scope">
<span v-if="scope.row.last_test_time">{{ scope.row.last_test_time.slice(0,16)}}</span>
<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">
@ -98,27 +54,22 @@
<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 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-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.end_time">{{ sflogItem.end_time.slice(0, 10) }}{{ sflogItem.shift_name }}</span>
<span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span>
交接班记录
</div>
@ -126,7 +77,7 @@
<tbody>
<tr>
<td class="numCell">日期</td>
<td class="numCell" v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}</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>
@ -134,12 +85,12 @@
</tr>
<tr>
<td class="numCell">产量t</td>
<td class="numCell">{{reportItem.total_production}}</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">{{ reportItem.elec_consume_unit }}</td>
</tr>
<tr v-if="sflogexpList.length>0">
<td class="numCell" :rowspan="sflogexpList.length+1">生产情况记录</td>
<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>
@ -147,11 +98,11 @@
<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>
<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>
@ -159,50 +110,49 @@
</el-main>
</el-drawer>
</el-container>
</template>
<script>
export default {
</template>
<script>
export default {
name: "packsflog",
data() {
return {
apiObj: this.$API.wpm.sflog.list,
apiObj2: null,
query: {
mgroup:'3347217757455728640',
mgroup: '3347217757455728640',
},
deptId:'3347207316583170048',
deptId: '3347207316583170048',
sflogItem:{},
options:[],
optionsShift:[],
limitedExport:false,
reportItem:{},
sflogexpList:[],
sflogItem: {},
options: [],
optionsShift: [],
limitedExport: false,
reportItem: {},
sflogexpList: [],
};
},
mounted(){
mounted() {
this.getTeam();
this.getShfit();
},
methods: {
getTeam(){
let form ={};
getTeam() {
let form = {};
form.page = 0;
form.belong_dept = this.deptId;
this.$API.mtm.team.list.req(form).then(res=>{
this.$API.mtm.team.list.req(form).then(res => {
this.options = res;
})
},
getShfit(){
this.$API.mtm.shift.req({page:0}).then(res=>{
getShfit() {
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
this.optionsShift = res;
})
},
handleQuery(){
handleQuery() {
this.$refs.table.queryData(this.query);
},
sflog_export(){
sflog_export() {
this.limitedExport = true;
},
rowClick(row) {
@ -211,16 +161,16 @@
this.getSflogItem(row.id);
this.getSflogexp(row.id);
},
getSflogexp(id){
getSflogexp(id) {
let that = this;
that.$API.wpm.sflogexp.list.req({page:0,sflog:id}).then(res=>{
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){
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])
@ -230,12 +180,12 @@
sflog_edit(row) {
let jsonStr = JSON.stringify(row);
this.$TOOL.data.remove("sflogItem")
this.$TOOL.data.set('sflogItem',jsonStr)
this.$TOOL.data.set('sflogItem', jsonStr)
this.$router.push({
name: "logDetail",
query: {
mgroupId: row.mgroup,
deptId:this.deptId
deptId: this.deptId
},
});
},
@ -248,34 +198,40 @@
this.exportLoading = false;
},
},
};
</script>
};
</script>
<style scoped>
#numTable{
<style scoped>
#numTable {
margin-left: 37px;
}
#numTable td{
}
#numTable td {
height: 32px;
padding-left: 5px;
}
.numCell{
}
.numCell {
width: 80px;
}
.numCell.numCell_last{
}
.numCell.numCell_last {
width: 100px;
}
.searchHead{
display:flex
}
.middleText{
}
.searchHead {
display: flex
}
.middleText {
height: 32px;
line-height: 32px;
margin: 0 5px;
display: inline-block;
}
.searchBtn{
margin-left: 5px;
}
</style>
}
.searchBtn {
margin-left: 5px;
}
</style>

View File

@ -3,74 +3,30 @@
<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"/>
<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>
<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>
<span>{{ scope.row.end_time.slice(0, 16) }}</span>
</template>
</el-table-column>
<el-table-column label="班组名称" prop="team_name"></el-table-column>
@ -78,7 +34,7 @@
<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>
<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">
@ -96,27 +52,22 @@
<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 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-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.end_time">{{ sflogItem.end_time.slice(0, 10) }}{{ sflogItem.shift_name }}</span>
<span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span>
交接班记录
</div>
@ -124,7 +75,7 @@
<tbody>
<tr>
<td class="numCell">日期</td>
<td class="numCell" v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}</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>
@ -132,53 +83,53 @@
</tr>
<tr>
<td class="numCell">产量t</td>
<td class="numCell">{{reportItem.total_production}}</td>
<td class="numCell">{{ reportItem.total_production }}</td>
<td class="numCell">台时t/h</td>
<td class="numCell">{{reportItem.production_hour}}</td>
<td class="numCell">{{ reportItem.production_hour }}</td>
<td class="numCell">运转时间h</td>
<td class="numCell">{{reportItem.run_hour}}</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">{{ reportItem.run_rate * 100 }}</td>
<td class="numCell">停机时长h</td>
<td class="numCell">{{reportItem.shut_hour}}</td>
<td class="numCell">{{ reportItem.shut_hour }}</td>
<td class="numCell">当期单位产品电耗kW·h/t</td>
<td class="numCell">{{reportItem.elec_consume_unit}}</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-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-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-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-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-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-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-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">{{ 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>
<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>
@ -186,11 +137,11 @@
<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>
<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>
@ -217,12 +168,12 @@
@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 {
export default {
name: "sflog",
components: {
saveDialog,
@ -234,46 +185,46 @@ import otherDialog from "./other_form.vue";
apiObj: this.$API.wpm.sflog.list,
apiObj2: null,
query: {
mgroup:'3346520558031773696',
mgroup: '3346520558031773696',
},
deptId :"3345780809943797760",
deptId: "3345780809943797760",
sflogItem:{},
sflogItem: {},
selection: [],
modelValue:true,
showClose:true,
echartType:'line',
asynDialog:false,
options:[],
optionsShift:[],
teamOptions:[],
limitedExport:false,
reportItem:{},
sflogexpList:[],
modelValue: true,
showClose: true,
echartType: 'line',
asynDialog: false,
options: [],
optionsShift: [],
teamOptions: [],
limitedExport: false,
reportItem: {},
sflogexpList: [],
};
},
mounted(){
mounted() {
this.getTeam();
this.getShfit();
},
methods: {
getTeam(){
let form ={};
getTeam() {
let form = {};
form.page = 0;
form.belong_dept = this.deptId;
this.$API.mtm.team.list.req(form).then(res=>{
this.$API.mtm.team.list.req(form).then(res => {
this.options = res;
})
},
getShfit(){
this.$API.mtm.shift.req({page:0}).then(res=>{
getShfit() {
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
this.optionsShift = res;
})
},
handleQuery(){
handleQuery() {
this.$refs.table.queryData(this.query);
},
sflog_export(){
sflog_export() {
this.limitedExport = true;
},
rowClick(row) {
@ -282,16 +233,16 @@ import otherDialog from "./other_form.vue";
this.getSflogItem(row.id);
this.getSflogexp(row.id);
},
getSflogexp(id){
getSflogexp(id) {
let that = this;
that.$API.wpm.sflogexp.list.req({page:0,sflog:id}).then(res=>{
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){
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])
@ -301,12 +252,12 @@ import otherDialog from "./other_form.vue";
sflog_edit(row) {
let jsonStr = JSON.stringify(row);
this.$TOOL.data.remove("sflogItem")
this.$TOOL.data.set('sflogItem',jsonStr)
this.$TOOL.data.set('sflogItem', jsonStr)
this.$router.push({
name: "logDetail",
query: {
mgroupId: row.mgroup,
deptId:this.deptId
deptId: this.deptId
},
});
// this.dialog.save = true;
@ -316,14 +267,14 @@ import otherDialog from "./other_form.vue";
},
//
sflog_check(row){
sflog_check(row) {
this.dialog.check = true;
this.$nextTick(() => {
this.$refs.checkDialog.open("edit").setData(row);
});
},
//
sflog_other(row){
sflog_other(row) {
this.dialog.other = true;
this.$nextTick(() => {
this.$refs.otherDialog.open("edit").setData(row);
@ -352,10 +303,10 @@ import otherDialog from "./other_form.vue";
this.$refs.table.refresh()
this.dialog.save = false;
},
handleOtherSuccess(){
handleOtherSuccess() {
this.dialog.other = false;
},
handleCheckSuccess(){
handleCheckSuccess() {
this.dialog.check = false;
},
closed() {
@ -377,7 +328,7 @@ import otherDialog from "./other_form.vue";
}
});
})
.catch(() => {});
.catch(() => { });
},
handlePrint() {
this.$PRINT('#myReport');
@ -388,34 +339,40 @@ import otherDialog from "./other_form.vue";
this.exportLoading = false;
},
},
};
</script>
};
</script>
<style scoped>
#numTable{
<style scoped>
#numTable {
margin-left: 37px;
}
#numTable td{
}
#numTable td {
height: 32px;
padding-left: 5px;
}
.numCell{
}
.numCell {
width: 80px;
}
.numCell.numCell_last{
}
.numCell.numCell_last {
width: 100px;
}
.searchHead{
display:flex
}
.middleText{
}
.searchHead {
display: flex
}
.middleText {
height: 32px;
line-height: 32px;
margin: 0 5px;
display: inline-block;
}
.searchBtn{
margin-left: 5px;
}
</style>
}
.searchBtn {
margin-left: 5px;
}
</style>

View File

@ -1,91 +1,51 @@
<template>
<el-dialog
:title="titleMap[mode]"
v-model="visible"
:size="1000"
destroy-on-close
@closed="$emit('closed')"
>
<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-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-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-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-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-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 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-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-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-input type="textarea" :rows="4" v-model="form.note" placeholder="生产情况记录" />
</el-form-item>
</el-col>
</el-row>
@ -97,9 +57,9 @@
</el-footer>
</el-container>
</el-dialog>
</template>
<script>
export default {
</template>
<script>
export default {
emits: ["success", "closed"],
props: {
deptId: {
@ -123,13 +83,13 @@
show: "查看交接班日志",
},
form: {
type:10,
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"}]
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,
@ -137,8 +97,8 @@
depOptions: [],
selectionFilters: [],
setFiltersVisible: false,
teamOptions:[],
shiftOptions:[],
teamOptions: [],
shiftOptions: [],
};
},
mounted() {
@ -151,18 +111,18 @@
this.getShfit();
},
methods: {
getTeam(){
getTeam() {
debugger;
let form ={};
let form = {};
form.page = 0;
form.belong_dept = this.deptId;
debugger;
this.$API.mtm.team.list.req(form).then(res=>{
this.$API.mtm.team.list.req(form).then(res => {
this.teamOptions = res;
})
},
getShfit(){
this.$API.mtm.shift.req({page:0}).then(res=>{
getShfit() {
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
this.shiftOptions = res;
})
},
@ -172,12 +132,12 @@
this.visible = true;
return this;
},
teamChange(data){
teamChange(data) {
let that = this;
that.teamOptions.forEach(item=>{
if(item.id==data){
that.teamOptions.forEach(item => {
if (item.id == data) {
that.form.leader_name = item.leader_name;
that.form.leader= item.leader;
that.form.leader = item.leader;
}
})
},
@ -187,13 +147,13 @@
if (valid) {
this.isSaveing = true;
try {
let obj={};
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.$API.wpm.sflog.update.req(this.form.id, obj).then(res => {
this.isSaveing = false;
this.$emit("success", this.form, this.mode);
this.visible = false;
@ -210,7 +170,7 @@
},
//
setData(data) {
Object.assign(this.form,data);
Object.assign(this.form, data);
},
//
setFilters(filters) {
@ -218,8 +178,7 @@
this.setFiltersVisible = true;
},
},
};
</script>
<style>
</style>
};
</script>
<style></style>

View File

@ -1,65 +1,49 @@
<template>
<el-dialog
:title="titleMap[mode]"
v-model="visible"
:size="1000"
destroy-on-close
@closed="$emit('closed')"
>
<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-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-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-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-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-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-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-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-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-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>
@ -72,9 +56,9 @@
</el-footer>
</el-container>
</el-dialog>
</template>
<script>
export default {
</template>
<script>
export default {
emits: ["success", "closed"],
data() {
return {
@ -86,11 +70,11 @@
show: "其他能源录入",
},
form: {
type:10,
type: 10,
},
rules: {
val: [{required: true, message: "请输入检测值", trigger: "blur"}],
time: [{required: true, message: "请选择检测时间", trigger: "blur"}]
val: [{ required: true, message: "请输入检测值", trigger: "blur" }],
time: [{ required: true, message: "请选择检测时间", trigger: "blur" }]
},
visible: false,
isSaveing: false,
@ -98,8 +82,8 @@
depOptions: [],
selectionFilters: [],
setFiltersVisible: false,
teamOptions:[],
shiftOptions:[],
teamOptions: [],
shiftOptions: [],
};
},
mounted() {
@ -108,13 +92,13 @@
this.getShfit();
},
methods: {
getTeam(){
this.$API.mtm.team.list.req({page:0}).then(res=>{
getTeam() {
this.$API.mtm.team.list.req({ page: 0 }).then(res => {
this.teamOptions = res;
})
},
getShfit(){
this.$API.mtm.shift.req({page:0}).then(res=>{
getShfit() {
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
this.shiftOptions = res;
})
},
@ -124,12 +108,12 @@
this.visible = true;
return this;
},
teamChange(data){
teamChange(data) {
let that = this;
that.teamOptions.forEach(item=>{
if(item.id==data){
that.teamOptions.forEach(item => {
if (item.id == data) {
that.form.leader_name = item.leader_name;
that.form.leader= item.leader;
that.form.leader = item.leader;
}
})
},
@ -139,17 +123,17 @@
if (valid) {
this.isSaveing = true;
try {
let obj={};
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.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.$API.enm.mpoint.statCreate.req(obj).then(res => {
this.isSaveing = false;
this.$emit("success", this.form, this.mode);
this.visible = false;
@ -166,7 +150,7 @@
},
//
setData(data) {
Object.assign(this.form,data);
Object.assign(this.form, data);
},
//
setFilters(filters) {
@ -174,16 +158,17 @@
this.setFiltersVisible = true;
},
},
};
</script>
<style>
.formUnit{
};
</script>
<style>
.formUnit {
position: absolute;
right: -17px;
top: 7px;
}
.formUnitWrap{
position: relative;
}
</style>
}
.formUnitWrap {
position: relative;
}
</style>

View File

@ -3,74 +3,30 @@
<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"/>
<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>
<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>
<span>{{ scope.row.end_time.slice(0, 16) }}</span>
</template>
</el-table-column>
<el-table-column label="班组名称" prop="team_name"></el-table-column>
@ -78,7 +34,7 @@
<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>
<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">
@ -94,27 +50,22 @@
<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 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-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.end_time">{{ sflogItem.end_time.slice(0, 10) }}{{ sflogItem.shift_name }}</span>
<span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span>
交接班记录
</div>
@ -122,7 +73,7 @@
<tbody>
<tr>
<td class="numCell">日期</td>
<td class="numCell" v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}</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>
@ -130,14 +81,14 @@
</tr>
<tr>
<td class="numCell">产量t</td>
<td class="numCell">{{reportItem.total_production}}</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">{{ reportItem.elec_consume_unit }}</td>
<td class="numCell">单位成本/</td>
<td class="numCell">{{reportItem.production_cost_unit}}</td>
<td class="numCell">{{ reportItem.production_cost_unit }}</td>
</tr>
<tr v-if="sflogexpList.length>0">
<td class="numCell" :rowspan="sflogexpList.length+1">生产情况记录</td>
<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>
@ -145,11 +96,11 @@
<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>
<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>
@ -158,47 +109,47 @@
</el-drawer>
</el-container>
</template>
<script>
export default {
<script>
export default {
name: "sflog",
data() {
return {
apiObj: this.$API.wpm.sflog.list,
apiObj2: null,
query: {
mgroup:'3346491835287007232',
mgroup: '3346491835287007232',
},
deptId:'3345780809943797760',
sflogItem:{},
options:[],
optionsShift:[],
limitedExport:false,
reportItem:{},
sflogexpList:[],
deptId: '3345780809943797760',
sflogItem: {},
options: [],
optionsShift: [],
limitedExport: false,
reportItem: {},
sflogexpList: [],
};
},
mounted(){
mounted() {
this.getTeam();
this.getShfit();
},
methods: {
getTeam(){
let form ={};
getTeam() {
let form = {};
form.page = 0;
form.belong_dept = this.deptId;
this.$API.mtm.team.list.req(form).then(res=>{
this.$API.mtm.team.list.req(form).then(res => {
this.options = res;
})
},
getShfit(){
this.$API.mtm.shift.req({page:0}).then(res=>{
getShfit() {
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
this.optionsShift = res;
})
},
handleQuery(){
handleQuery() {
this.$refs.table.queryData(this.query);
},
sflog_export(){
sflog_export() {
this.limitedExport = true;
},
rowClick(row) {
@ -207,16 +158,16 @@
this.getSflogItem(row.id);
this.getSflogexp(row.id);
},
getSflogexp(id){
getSflogexp(id) {
let that = this;
that.$API.wpm.sflogexp.list.req({page:0,sflog:id}).then(res=>{
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){
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])
@ -226,12 +177,12 @@
sflog_edit(row) {
let jsonStr = JSON.stringify(row);
this.$TOOL.data.remove("sflogItem")
this.$TOOL.data.set('sflogItem',jsonStr)
this.$TOOL.data.set('sflogItem', jsonStr)
this.$router.push({
name: "logDetail",
query: {
mgroupId: row.mgroup,
deptId:this.deptId
deptId: this.deptId
},
});
},
@ -244,34 +195,40 @@
this.exportLoading = false;
},
},
};
</script>
};
</script>
<style scoped>
#numTable{
<style scoped>
#numTable {
margin-left: 37px;
}
#numTable td{
}
#numTable td {
height: 32px;
padding-left: 5px;
}
.numCell{
}
.numCell {
width: 80px;
}
.numCell.numCell_last{
}
.numCell.numCell_last {
width: 100px;
}
.searchHead{
display:flex
}
.middleText{
}
.searchHead {
display: flex
}
.middleText {
height: 32px;
line-height: 32px;
margin: 0 5px;
display: inline-block;
}
.searchBtn{
margin-left: 5px;
}
</style>
}
.searchBtn {
margin-left: 5px;
}
</style>

View File

@ -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 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">
@ -131,7 +73,7 @@
</el-table-column> -->
</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,14 +81,14 @@
</el-drawer>
</template>
<script>
const defaultForm = {
list:[],
};
export default {
const defaultForm = {
list: [],
};
export default {
emits: ["success", "closed"],
data() {
return {
belongDept:'',
belongDept: '',
loading: false,
mode: "add",
titleMap: {
@ -155,21 +97,21 @@
show: '查看记录'
},
stateOptions:[
{label: "待定", id: "pending"},
{label: "正常", id: "normal"},
{label: "迟到", id: "late"},
{label: "早退", id: "early_leave"},
{label: "未到岗", id: "absent"},
{label: "请假", id: "leave"},
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:[],
userList: [],
teamOptions: [],
deptOptions: ['6车间', '7车间', '8车间', '10车间'],
shiftOptions: [],
selectionFilters: [],
setFiltersVisible: false,
};
@ -179,31 +121,31 @@
},
methods: {
getShiftOptions() {
this.$API.system.dept.list.req({ page: 0,type:'dept'}).then(res=>{
this.$API.system.dept.list.req({ page: 0, type: 'dept' }).then(res => {
let data = [];
res.forEach(item => {
if(item.parent=='3423856735881117696'){
if (item.parent == '3423856735881117696') {
data.push(item)
}
});
this.deptOptions = data;
});
this.$API.mtm.shift.req({page:0}).then(res=>{
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
this.shiftOptions = res;
})
},
getTeam(){
getTeam() {
//team
this.$API.mtm.team.list.req({page:0,belong_dept:this.belongDept}).then(res=>{
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=>{
getuser() {
this.$API.mtm.teammember.list.req({ team: this.form.team, page: 0 }).then(res => {
this.userList = [];
res.forEach(item=>{
let obj =item;
res.forEach(item => {
let obj = item;
obj.state = 'normal';
obj.note = '';
this.userList.push(obj)
@ -226,7 +168,7 @@
if (valid) {
this.isSaveing = true;
let arr = [];
this.userList.forEach(item=>{
this.userList.forEach(item => {
let obj = {};
obj.team = this.form.team;
obj.shift = this.form.shift;
@ -271,10 +213,10 @@
// console.log(defaultForm);
// this.form = defaultForm;
this.loading = true;
this.$API.hrm.employee.item.req(data.id).then(res=>{
this.$API.hrm.employee.item.req(data.id).then(res => {
this.loading = false;
this.form = res
}).catch(e=>{this.loading = false;})
}).catch(e => { this.loading = false; })
// Object.assign(this.form, data);
},
//
@ -283,8 +225,7 @@
this.setFiltersVisible = true;
},
},
};
};
</script>
<style>
</style>
<style></style>

View File

@ -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>

View File

@ -12,11 +12,19 @@
<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>
@ -31,16 +39,17 @@
</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>
@ -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,9 +179,6 @@ 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;
@ -178,10 +198,9 @@ export default {
})
}
}
}
});
},
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);

View File

@ -3,91 +3,26 @@
<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>
@ -96,12 +31,12 @@
<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 {
export default {
data() {
return {
query:{
type:1,
day:'',
month:'',
year:'',
shift:'',
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:'月统计'},
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:{}
tableNmae: '',
tableData1: [],
optionsShift: [],
sourceData: {}
};
},
mounted() {
var myDate = new Date();
let month = myDate.getMonth()+1;
if(month<10){
month = '0'+month;
let month = myDate.getMonth() + 1;
if (month < 10) {
month = '0' + month;
}
this.query.month = myDate.getFullYear()+'-'+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!=='水泥包装'){
getMgroup() {
this.$API.mtm.mgroup.list.req({ page: 0 }).then(res => {
res.forEach(item => {
if (item.name !== '煤磨' && item.name !== '水泥包装') {
this.mgroupOptions.push(item);
}
})
@ -202,38 +137,38 @@
})
},
//
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
mgroupChange(value) {
let arr = this.mgroupOptions.filter(item => {
return item.id == value
})
let name = arr[0].name;
if(name=='电石渣'){
if (name == '电石渣') {
this.tableName = '电石渣干粉核算'
}else if(name=='原料磨'){
} else if (name == '原料磨') {
this.tableName = '生料核算'
}else if(name=='回转窑'){
} else if (name == '回转窑') {
this.tableName = '熟料核算'
}else if(name=='水泥磨'){
} else if (name == '水泥磨') {
this.tableName = '水泥核算'
}
},
//
typeCange(value){
if(value==1){
typeCange(value) {
if (value == 1) {
this.tableName = '班组成本计算'
}else if(value==1){
} else if (value == 1) {
this.tableName = '日成本计算'
}else{
} else {
this.tableName = '月成本计算'
}
},
getData(){
getData() {
let that = this;
that.data1 = 0;
that.data2 = 0;
@ -242,55 +177,55 @@
that.data5 = 0;
let params = {};
let arr = [];
params.page=0;
params.mgroup=that.query.mgroup;
if(that.query.type==0){//
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){//
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.type = "day_s"
} else {//
params.year_s = Number(that.query.year);
params.type="month_s"
params.type = "month_s"
}
that.$API.enm.enstat.req(params).then(res=>{
if(res.length>0){
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;
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.allCol = arr.length + 16
that.materialList = arr;
let dataArr = [];
res.forEach(itemData=>{
let time ='';
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;
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){
if (that.query.type == 0) {
dataArr.push(itemData.shift);
dataArr.push(itemData.team_name);
}
@ -298,14 +233,14 @@
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++){
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++){
for (let j = 0; j < otherdata.length; j++) {
dataArr.push(otherdata[j].cost_unit)
}
that.tableData1.push(dataArr)
@ -313,7 +248,7 @@
}
})
},
getTableData(){
getTableData() {
this.getData();
},
@ -326,12 +261,11 @@
this.exportLoading = false;
},
}
};
};
</script>
<style scoped>
.printContainer{
width:100%;
overflow-x:scroll;
}
.printContainer {
width: 100%;
overflow-x: scroll;
}
</style>

View File

@ -4,51 +4,17 @@
<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>
@ -60,49 +26,49 @@
</el-row>
</el-main>
</el-container>
</template>
<script>
export default {
</template>
<script>
export default {
name: "listSon",
data() {
return {
query: {
mgroup:'3346520558031773696',
mgroup: '3346520558031773696',
},
options:[],
optionsShift:[],
options: [],
optionsShift: [],
};
},
mounted(){
mounted() {
this.getTeam();
this.getShift();
},
methods: {
getTeam(){
this.$API.mtm.team.list.req({page:0}).then(res=>{
getTeam() {
this.$API.mtm.team.list.req({ page: 0 }).then(res => {
this.options = res;
})
},
getShift(){
this.$API.mtm.shift.req({page:0}).then(res=>{
getShift() {
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
this.optionsShift = res;
})
},
//
sflog_check(row){
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=>{
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