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,13 +205,16 @@ export default {
}, },
//班次 //班次
shift: { shift: {
name: "班次列表", list: {
req: async function(data){ name: "班次列表",
return await http.get( req: async function(data){
`${config.API_URL}/mtm/shift/`, return await http.get(
data `${config.API_URL}/mtm/shift/`,
); data
);
}
} }
}, },
//班组 //班组
team: { team: {

View File

@ -3,298 +3,255 @@
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<div style="margin-right: 20px">交接班日志</div> <div style="margin-right: 20px">交接班日志</div>
<el-date-picker <el-date-picker v-model="query.start_time__gte" type="date" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD"
v-model="query.start_time__gte" placeholder="开始时间" style=" width: 120px" />
type="date" <el-date-picker v-model="query.end_time__lt" type="date" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD"
value-format="YYYY-MM-DD HH:mm:ss" placeholder="结束时间" style="margin-left: 2px; width: 120px" />
format="YYYY-MM-DD" <el-select v-model="query.shift" placeholder="班次" clearable style="margin-left: 2px; width: 120px">
placeholder="开始时间" <el-option v-for="item in optionsShift" :key="item.id" :label="item.name" :value="item.id"></el-option>
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>
<el-select <el-select v-model="query.team" placeholder="班组" clearable style="margin-left: 2px; width: 120px">
v-model="query.team" <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
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-select>
<el-button <el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable <scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query" highlightCurrentRow @row-click="rowClick">
ref="table" <el-table-column type="index" width="50" />
:apiObj="apiObj" <el-table-column label="开始时间" prop="start_time">
row-key="id" <template #default="scope">
stripe <span>{{ scope.row.start_time.slice(0, 16) }}</span>
:params="query" </template>
highlightCurrentRow </el-table-column>
@row-click="rowClick" <el-table-column label="结束时间" prop="end_time">
> <template #default="scope">
<el-table-column type="index" width="50"/> <span>{{ scope.row.end_time.slice(0, 16) }}</span>
<el-table-column label="开始时间" prop="start_time"> </template>
<template #default="scope"> </el-table-column>
<span>{{ scope.row.start_time.slice(0,16)}}</span> <el-table-column label="班组名称" prop="team_name"></el-table-column>
</template> <el-table-column label="当前班次" prop="shift_name"></el-table-column>
</el-table-column> <el-table-column label="班长" prop="leader_name"></el-table-column>
<el-table-column label="结束时间" prop="end_time">
<template #default="scope">
<span>{{ scope.row.end_time.slice(0,16)}}</span>
</template>
</el-table-column>
<el-table-column label="班组名称" prop="team_name"></el-table-column>
<el-table-column label="当前班次" prop="shift_name"></el-table-column>
<el-table-column label="班长" prop="leader_name"></el-table-column>
<el-table-column label="检验时间"> <el-table-column label="检验时间">
<template #default="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="140"> <el-table-column label="操作" fixed="right" align="center" width="140">
<template #default="scope"> <template #default="scope">
<el-button link size="small" @click="sflog_edit(scope.row)" type="primary">编辑</el-button> <el-button link size="small" @click="sflog_edit(scope.row)" type="primary">编辑</el-button>
<!-- <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> --> <!-- <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> -->
<!-- <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> --> <!-- <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> -->
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical"></el-divider>
<el-button link size="small" @click="sflog_export(scope.row)" type="success">报表</el-button> <el-button link size="small" @click="sflog_export(scope.row)" type="success">报表</el-button>
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>
</el-main> </el-main>
<el-drawer v-model="limitedExport" size="60%" :show-close="false"> <el-drawer v-model="limitedExport" size="60%" :show-close="false">
<template #header="{ close, titleId, titleClass }"> <template #header="{ close, titleId, titleClass }">
<h4 :id="titleId" :class="titleClass">交接班日志</h4> <h4 :id="titleId" :class="titleClass">交接班日志</h4>
<el-button type="danger" @click="close"> <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> </el-button>
</template> </template>
<div class="left-panel"> <div class="left-panel">
<el-button <el-button type="primary" @click="exportExcel()" :loading="exportLoading">导出xlsx
type="primary" </el-button>
@click="exportExcel()" <el-button type="primary" @click="handlePrint">打印
:loading = "exportLoading" </el-button>
>导出xlsx </div>
</el-button>
<el-button
type="primary"
@click="handlePrint"
>打印
</el-button>
</div>
<el-main class="nopadding"> <el-main class="nopadding">
<div ref="print" id="myReport" class="printContainer"> <div ref="print" id="myReport" class="printContainer">
<div style="margin-right: 20px;text-align: center;font-size: 16px;font-weight: bold;margin-bottom: 20px;"> <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> <span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span>
交接班记录 交接班记录
</div>
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
<tbody>
<tr>
<td class="numCell">日期</td>
<td class="numCell" v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}</td>
<td class="numCell">班次</td>
<td class="numCell">{{ sflogItem.shift_name }}</td>
<td class="numCell">班组</td>
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
</tr>
<tr>
<td class="numCell">产量t</td>
<td class="numCell">{{reportItem.total_production}}</td>
<td class="numCell">台时t/h</td>
<td class="numCell">{{reportItem.production_hour}}</td>
<td class="numCell">运转时间h</td>
<td class="numCell">{{reportItem.run_hour}}</td>
</tr>
<tr>
<td class="numCell">运转率%</td>
<td class="numCell">{{reportItem.run_rate*100}}</td>
<td class="numCell">停机时长h</td>
<td class="numCell">{{reportItem.shut_hour}}</td>
<td class="numCell">煤磨分布电耗KW·h/t</td>
<td class="numCell">{{reportItem.elec_consume_unit}}</td>
</tr>
<tr>
<td class="numCell">煤粉细度合格率%</td>
<td class="numCell" v-if="reportItem.煤粉_细度_rate_pass">{{reportItem.煤粉_细度_rate_pass*100}}</td>
<td class="numCell" v-else>0</td>
<td class="numCell">煤粉水分合格率%</td>
<td class="numCell" v-if="reportItem.煤粉_水分_rate_pass">{{reportItem.煤粉_水分_rate_pass*100}}</td>
<td class="numCell" v-else>0</td>
</tr>
<tr v-if="sflogexpList.length>0">
<td class="numCell" :rowspan="sflogexpList.length+1">生产情况记录</td>
<td class="numCell">时间</td>
<td class="numCell">类别</td>
<td class="numCell">原因</td>
<td class="numCell">处置措施</td>
<td class="numCell">处置人</td>
</tr>
<tr v-for="item in sflogexpList" :key="item.id">
<td class="numCell">{{ item.happen_time}}</td>
<td class="numCell">{{ item.cate}}</td>
<td class="numCell">{{ item.reason}}</td>
<td class="numCell">{{ item.measure}}</td>
<td class="numCell">{{ item.handler}}</td>
</tr>
</tbody>
</table>
</div> </div>
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
<tbody>
<tr>
<td class="numCell">日期</td>
<td class="numCell" v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}</td>
<td class="numCell">班次</td>
<td class="numCell">{{ sflogItem.shift_name }}</td>
<td class="numCell">班组</td>
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
</tr>
<tr>
<td class="numCell">产量t</td>
<td class="numCell">{{ reportItem.total_production }}</td>
<td class="numCell">台时t/h</td>
<td class="numCell">{{ reportItem.production_hour }}</td>
<td class="numCell">运转时间h</td>
<td class="numCell">{{ reportItem.run_hour }}</td>
</tr>
<tr>
<td class="numCell">运转率%</td>
<td class="numCell">{{ reportItem.run_rate * 100 }}</td>
<td class="numCell">停机时长h</td>
<td class="numCell">{{ reportItem.shut_hour }}</td>
<td class="numCell">煤磨分布电耗KW·h/t</td>
<td class="numCell">{{ reportItem.elec_consume_unit }}</td>
</tr>
<tr>
<td class="numCell">煤粉细度合格率%</td>
<td class="numCell" v-if="reportItem.煤粉_细度_rate_pass">{{ reportItem.煤粉_细度_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td>
<td class="numCell">煤粉水分合格率%</td>
<td class="numCell" v-if="reportItem.煤粉_水分_rate_pass">{{ reportItem.煤粉_水分_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td>
</tr>
<tr v-if="sflogexpList.length > 0">
<td class="numCell" :rowspan="sflogexpList.length + 1">生产情况记录</td>
<td class="numCell">时间</td>
<td class="numCell">类别</td>
<td class="numCell">原因</td>
<td class="numCell">处置措施</td>
<td class="numCell">处置人</td>
</tr>
<tr v-for="item in sflogexpList" :key="item.id">
<td class="numCell">{{ item.happen_time }}</td>
<td class="numCell">{{ item.cate }}</td>
<td class="numCell">{{ item.reason }}</td>
<td class="numCell">{{ item.measure }}</td>
<td class="numCell">{{ item.handler }}</td>
</tr>
</tbody>
</table>
</div>
</el-main> </el-main>
</el-drawer> </el-drawer>
</el-container> </el-container>
</template> </template>
<script> <script>
export default { export default {
name: "sflog", name: "sflog",
data() { data() {
return { return {
apiObj: this.$API.wpm.sflog.list, apiObj: this.$API.wpm.sflog.list,
apiObj2: null, apiObj2: null,
query: {
shift: '',
team: '',
end_time__lt: '',
start_time__gte: '',
mgroup: '3347217512021835776',
},
deptId: '3347207082608115712',
sflogItem: {},
options: [],
optionsShift: [],
limitedExport: false,
reportItem: {},
sflogexpList: [],
};
},
mounted() {
this.getTeam();
this.getShfit();
},
methods: {
getTeam() {
let form = {};
form.page = 0;
form.belong_dept = this.deptId;
this.$API.mtm.team.list.req(form).then(res => {
this.options = res;
})
},
getShfit() {
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
this.optionsShift = res;
})
},
handleQuery() {
this.$refs.table.queryData(this.query);
},
sflog_export() {
this.limitedExport = true;
},
rowClick(row) {
this.sflogId = row.id;
this.sflogItem = row;
this.getSflogItem(row.id);
this.getSflogexp(row.id);
},
getSflogexp(id) {
let that = this;
that.$API.wpm.sflogexp.list.req({ page: 0, sflog: id }).then(res => {
that.sflogexpList = res;
})
},
getSflogItem(id) {
let that = this;
that.$API.enm.enstat.req({ type: 'sflog', sflog: id, page: 0 }).then(res => {
if (res.length > 0) {
that.reportItem = res[0];
}
console.log(res[0])
})
},
//
sflog_edit(row) {
let jsonStr = JSON.stringify(row);
this.$TOOL.data.remove("sflogItem")
this.$TOOL.data.set('sflogItem', jsonStr)
this.$router.push({
name: "logDetail",
query: { query: {
shift:'', mgroupId: row.mgroup,
team:'', deptId: this.deptId
end_time__lt:'',
start_time__gte:'',
mgroup:'3347217512021835776',
}, },
deptId :'3347207082608115712', });
sflogItem:{},
options:[],
optionsShift:[],
limitedExport:false,
reportItem:{},
sflogexpList:[],
};
}, },
mounted(){ handlePrint() {
this.getTeam(); this.$PRINT('#myReport');
this.getShfit();
},
methods: {
getTeam(){
let form ={};
form.page = 0;
form.belong_dept = this.deptId;
this.$API.mtm.team.list.req(form).then(res=>{
this.options = res;
})
},
getShfit(){
this.$API.mtm.shift.req({page:0}).then(res=>{
this.optionsShift = res;
})
},
handleQuery(){
this.$refs.table.queryData(this.query);
},
sflog_export(){
this.limitedExport = true;
},
rowClick(row) {
this.sflogId = row.id;
this.sflogItem = row;
this.getSflogItem(row.id);
this.getSflogexp(row.id);
},
getSflogexp(id){
let that = this;
that.$API.wpm.sflogexp.list.req({page:0,sflog:id}).then(res=>{
that.sflogexpList = res;
})
},
getSflogItem(id){
let that =this;
that.$API.enm.enstat.req({type:'sflog',sflog:id,page:0}).then(res=>{
if(res.length>0){
that.reportItem = res[0];
}
console.log(res[0])
})
},
//
sflog_edit(row) {
let jsonStr = JSON.stringify(row);
this.$TOOL.data.remove("sflogItem")
this.$TOOL.data.set('sflogItem',jsonStr)
this.$router.push({
name: "logDetail",
query: {
mgroupId: row.mgroup,
deptId:this.deptId
},
});
},
handlePrint() {
this.$PRINT('#myReport');
},
exportExcel() {
this.exportLoading = true;
this.$XLSX('#myTable', this.tableName)
this.exportLoading = false;
},
}, },
}; exportExcel() {
</script> this.exportLoading = true;
this.$XLSX('#myTable', this.tableName)
this.exportLoading = false;
},
},
};
</script>
<style scoped> <style scoped>
#numTable{ #numTable {
margin-left: 37px; margin-left: 37px;
} }
#numTable td{
height: 32px; #numTable td {
padding-left: 5px; height: 32px;
} padding-left: 5px;
.numCell{ }
width: 80px;
} .numCell {
.numCell.numCell_last{ width: 80px;
width: 100px; }
}
.searchHead{ .numCell.numCell_last {
display:flex width: 100px;
} }
.middleText{
height: 32px; .searchHead {
line-height: 32px; display: flex
margin: 0 5px; }
display: inline-block;
} .middleText {
.searchBtn{ height: 32px;
margin-left: 5px; line-height: 32px;
} margin: 0 5px;
</style> display: inline-block;
}
.searchBtn {
margin-left: 5px;
}
</style>

View File

@ -1,324 +1,282 @@
<template> <template>
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<div style="margin-right: 20px">交接班日志</div> <div style="margin-right: 20px">交接班日志</div>
<el-date-picker <el-date-picker v-model="query.start_time__gte" type="date" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD"
v-model="query.start_time__gte" placeholder="开始时间" style=" width: 120px" />
type="date" <el-date-picker v-model="query.end_time__lt" type="date" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD"
value-format="YYYY-MM-DD HH:mm:ss" placeholder="结束时间" style="margin-left: 2px; width: 120px" />
format="YYYY-MM-DD" <el-select v-model="query.shift" placeholder="班次" clearable style="margin-left: 2px; width: 120px">
placeholder="开始时间" <el-option v-for="item in optionsShift" :key="item.id" :label="item.name" :value="item.id"></el-option>
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>
<el-select <el-select v-model="query.team" placeholder="班组" clearable style="margin-left: 2px; width: 120px">
v-model="query.team" <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
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-select>
<el-button <el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable <scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query" highlightCurrentRow @row-click="rowClick">
ref="table" <el-table-column type="index" width="50" />
:apiObj="apiObj" <!-- <el-table-column label="关联工段" prop="mgroup_name"></el-table-column> -->
row-key="id" <el-table-column label="开始时间" prop="start_time">
stripe <template #default="scope">
:params="query" <span>{{ scope.row.start_time.slice(0, 16) }}</span>
highlightCurrentRow </template>
@row-click="rowClick" </el-table-column>
> <el-table-column label="结束时间" prop="end_time">
<el-table-column type="index" width="50"/> <template #default="scope">
<!-- <el-table-column label="关联工段" prop="mgroup_name"></el-table-column> --> <span>{{ scope.row.end_time.slice(0, 16) }}</span>
<el-table-column label="开始时间" prop="start_time"> </template>
<template #default="scope"> </el-table-column>
<span>{{ scope.row.start_time.slice(0,16)}}</span> <el-table-column label="班组名称" prop="team_name"></el-table-column>
</template> <el-table-column label="当前班次" prop="shift_name"></el-table-column>
</el-table-column> <el-table-column label="班长" prop="leader_name"></el-table-column>
<el-table-column label="结束时间" prop="end_time"> <el-table-column label="检验时间">
<template #default="scope"> <template #default="scope">
<span>{{ scope.row.end_time.slice(0,16)}}</span> <span v-if="scope.row.last_test_time">{{ scope.row.last_test_time.slice(0, 16) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="班组名称" prop="team_name"></el-table-column> <el-table-column label="操作" fixed="right" align="center" width="140">
<el-table-column label="当前班次" prop="shift_name"></el-table-column> <template #default="scope">
<el-table-column label="班长" prop="leader_name"></el-table-column> <el-button link size="small" @click="sflog_edit(scope.row)" type="primary">操作</el-button>
<el-table-column label="检验时间"> <!-- <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> -->
<template #default="scope"> <!-- <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> -->
<span v-if="scope.row.last_test_time">{{ scope.row.last_test_time.slice(0,16)}}</span> <el-divider direction="vertical"></el-divider>
</template> <el-button link size="small" @click="sflog_export(scope.row)" type="success">报表</el-button>
</el-table-column> </template>
<el-table-column label="操作" fixed="right" align="center" width="140"> </el-table-column>
<template #default="scope">
<el-button link size="small" @click="sflog_edit(scope.row)" type="primary">操作</el-button>
<!-- <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> -->
<!-- <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> -->
<el-divider direction="vertical"></el-divider>
<el-button link size="small" @click="sflog_export(scope.row)" type="success">报表</el-button>
</template>
</el-table-column>
</scTable> </scTable>
</el-main> </el-main>
<el-drawer v-model="limitedExport" size="60%" :show-close="false"> <el-drawer v-model="limitedExport" size="60%" :show-close="false">
<template #header="{ close, titleId, titleClass }"> <template #header="{ close, titleId, titleClass }">
<h4 :id="titleId" :class="titleClass">交接班日志</h4> <h4 :id="titleId" :class="titleClass">交接班日志</h4>
<el-button type="danger" @click="close"> <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> </el-button>
</template> </template>
<div class="left-panel"> <div class="left-panel">
<el-button <el-button type="primary" @click="exportExcel()" :loading="exportLoading">导出xlsx
type="primary" </el-button>
@click="exportExcel()" <el-button type="primary" @click="handlePrint">打印
:loading = "exportLoading" </el-button>
>导出xlsx
</el-button>
<el-button
type="primary"
@click="handlePrint"
>打印
</el-button>
</div> </div>
<el-main class="nopadding"> <el-main class="nopadding">
<div ref="print" id="myReport" class="printContainer"> <div ref="print" id="myReport" class="printContainer">
<div style="margin-right: 20px;text-align: center;font-size: 16px;font-weight: bold;margin-bottom: 20px;"> <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> <span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span>
交接班记录 交接班记录
</div>
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
<tbody>
<tr>
<td class="numCell">日期</td>
<td class="numCell" v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}</td>
<td class="numCell">班次</td>
<td class="numCell">{{ sflogItem.shift_name }}</td>
<td class="numCell">班组</td>
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
</tr>
<tr>
<td class="numCell">产量t</td>
<td class="numCell">{{reportItem.total_production}}</td>
<td class="numCell">台时t/h</td>
<td class="numCell">{{reportItem.production_hour}}</td>
<td class="numCell">运转时间h</td>
<td class="numCell">{{reportItem.run_hour}}</td>
</tr>
<tr>
<td class="numCell">运转率%</td>
<td class="numCell">{{reportItem.run_rate*100}}</td>
<td class="numCell">停机时长h</td>
<td class="numCell">{{reportItem.shut_hour}}</td>
<td class="numCell">单位产品分布电耗KW·h/t</td>
<td class="numCell">{{reportItem.elec_consume_unit}}</td>
</tr>
<tr>
<td class="numCell">单位产品标煤耗kgce/t</td>
<td class="numCell">{{reportItem.coal_consume_unit}}</td>
<td class="numCell">熟料立升重合格率%</td>
<td class="numCell" v-if="reportItem.入磨熟料_立升重_rate_pass">{{reportItem.入磨熟料_立升重_rate_pass*100}}</td>
<td class="numCell" v-else>0</td>
<td class="numCell">熟料f-CaO合格率%</td>
<td class="numCell" v-if="reportItem['入磨熟料_f-CaO_rate_pass']">{{reportItem['入磨熟料_f-CaO_rate_pass']*100}}</td>
<td class="numCell" v-else>0</td>
</tr>
<tr>
<td class="numCell">入窑生料细度合格率%</td>
<td class="numCell" v-if="reportItem.入窑生料_细度_rate_pass">{{reportItem.入窑生料_细度_rate_pass*100}}</td>
<td class="numCell" v-else>0</td>
<td class="numCell">入窑生料CaO合格率%</td>
<td class="numCell" v-if="reportItem.入窑生料_CaO_rate_pass">{{reportItem.入窑生料_CaO_rate_pass*100}}</td>
<td class="numCell" v-else>0</td>
<td class="numCell">入窑生料Fe₂O₃合格率%</td>
<td class="numCell" v-if="reportItem.入窑生料_Fe2O3_rate_pass">{{reportItem.入窑生料_Fe2O3_rate_pass*100}}</td>
<td class="numCell" v-else>0</td>
</tr>
<tr>
<td class="numCell">入窑生料水分合格率%</td>
<td class="numCell" v-if="reportItem.入窑生料_水分_rate_pass">{{reportItem.入窑生料_水分_rate_pass*100}}</td>
<td class="numCell" v-else>0</td>
<td class="numCell">单位成本/</td>
<td class="numCell">{{reportItem.production_cost_unit}}</td>
<td class="numCell"></td>
<td class="numCell"></td>
</tr>
<tr v-if="sflogexpList.length>0">
<td class="numCell" :rowspan="sflogexpList.length+1">生产情况记录</td>
<td class="numCell">时间</td>
<td class="numCell">类别</td>
<td class="numCell">原因</td>
<td class="numCell">处置措施</td>
<td class="numCell">处置人</td>
</tr>
<tr v-for="item in sflogexpList" :key="item.id">
<td class="numCell">{{ item.happen_time}}</td>
<td class="numCell">{{ item.cate}}</td>
<td class="numCell">{{ item.reason}}</td>
<td class="numCell">{{ item.measure}}</td>
<td class="numCell">{{ item.handler}}</td>
</tr>
</tbody>
</table>
</div> </div>
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
<tbody>
<tr>
<td class="numCell">日期</td>
<td class="numCell" v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}</td>
<td class="numCell">班次</td>
<td class="numCell">{{ sflogItem.shift_name }}</td>
<td class="numCell">班组</td>
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
</tr>
<tr>
<td class="numCell">产量t</td>
<td class="numCell">{{ reportItem.total_production }}</td>
<td class="numCell">台时t/h</td>
<td class="numCell">{{ reportItem.production_hour }}</td>
<td class="numCell">运转时间h</td>
<td class="numCell">{{ reportItem.run_hour }}</td>
</tr>
<tr>
<td class="numCell">运转率%</td>
<td class="numCell">{{ reportItem.run_rate * 100 }}</td>
<td class="numCell">停机时长h</td>
<td class="numCell">{{ reportItem.shut_hour }}</td>
<td class="numCell">单位产品分布电耗KW·h/t</td>
<td class="numCell">{{ reportItem.elec_consume_unit }}</td>
</tr>
<tr>
<td class="numCell">单位产品标煤耗kgce/t</td>
<td class="numCell">{{ reportItem.coal_consume_unit }}</td>
<td class="numCell">熟料立升重合格率%</td>
<td class="numCell" v-if="reportItem.入磨熟料_立升重_rate_pass">{{ reportItem.入磨熟料_立升重_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td>
<td class="numCell">熟料f-CaO合格率%</td>
<td class="numCell" v-if="reportItem['入磨熟料_f-CaO_rate_pass']">{{ reportItem['入磨熟料_f-CaO_rate_pass'] * 100 }}
</td>
<td class="numCell" v-else>0</td>
</tr>
<tr>
<td class="numCell">入窑生料细度合格率%</td>
<td class="numCell" v-if="reportItem.入窑生料_细度_rate_pass">{{ reportItem.入窑生料_细度_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td>
<td class="numCell">入窑生料CaO合格率%</td>
<td class="numCell" v-if="reportItem.入窑生料_CaO_rate_pass">{{ reportItem.入窑生料_CaO_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td>
<td class="numCell">入窑生料Fe₂O₃合格率%</td>
<td class="numCell" v-if="reportItem.入窑生料_Fe2O3_rate_pass">{{ reportItem.入窑生料_Fe2O3_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td>
</tr>
<tr>
<td class="numCell">入窑生料水分合格率%</td>
<td class="numCell" v-if="reportItem.入窑生料_水分_rate_pass">{{ reportItem.入窑生料_水分_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td>
<td class="numCell">单位成本/</td>
<td class="numCell">{{ reportItem.production_cost_unit }}</td>
<td class="numCell"></td>
<td class="numCell"></td>
</tr>
<tr v-if="sflogexpList.length > 0">
<td class="numCell" :rowspan="sflogexpList.length + 1">生产情况记录</td>
<td class="numCell">时间</td>
<td class="numCell">类别</td>
<td class="numCell">原因</td>
<td class="numCell">处置措施</td>
<td class="numCell">处置人</td>
</tr>
<tr v-for="item in sflogexpList" :key="item.id">
<td class="numCell">{{ item.happen_time }}</td>
<td class="numCell">{{ item.cate }}</td>
<td class="numCell">{{ item.reason }}</td>
<td class="numCell">{{ item.measure }}</td>
<td class="numCell">{{ item.handler }}</td>
</tr>
</tbody>
</table>
</div>
</el-main> </el-main>
</el-drawer> </el-drawer>
</el-container> </el-container>
</template> </template>
<script> <script>
export default { export default {
name: "sflog", name: "sflog",
data() { data() {
return { return {
apiObj: this.$API.wpm.sflog.list, apiObj: this.$API.wpm.sflog.list,
apiObj2: null, apiObj2: null,
query: {
shift: '',
team: '',
end_time__lt: '',
start_time__gte: '',
mgroup: '3347217246321065984',
},
deptId: '3347207082608115712',
sflogItem: {},
options: [],
optionsShift: [],
limitedExport: false,
reportItem: {},
sflogexpList: [],
};
},
mounted() {
this.getTeam();
this.getShfit();
},
methods: {
getTeam() {
let form = {};
form.page = 0;
form.belong_dept = this.deptId;
this.$API.mtm.team.list.req(form).then(res => {
this.options = res;
})
},
getShfit() {
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
this.optionsShift = res;
})
},
handleQuery() {
this.$refs.table.queryData(this.query);
},
sflog_export() {
this.limitedExport = true;
},
rowClick(row) {
this.sflogId = row.id;
this.sflogItem = row;
this.getSflogItem(row.id);
this.getSflogexp(row.id);
},
getSflogexp(id) {
let that = this;
that.$API.wpm.sflogexp.list.req({ page: 0, sflog: id }).then(res => {
that.sflogexpList = res;
})
},
getSflogItem(id) {
let that = this;
that.$API.enm.enstat.req({ type: 'sflog', sflog: id, page: 0 }).then(res => {
if (res.length > 0) {
that.reportItem = res[0];
}
console.log(res[0])
})
},
//
sflog_edit(row) {
let jsonStr = JSON.stringify(row);
this.$TOOL.data.remove("sflogItem")
this.$TOOL.data.set('sflogItem', jsonStr)
this.$router.push({
name: "logDetail",
query: { query: {
shift:'', mgroupId: row.mgroup,
team:'', deptId: this.deptId
end_time__lt:'',
start_time__gte:'',
mgroup:'3347217246321065984',
}, },
});
deptId :'3347207082608115712',
sflogItem:{},
options:[],
optionsShift:[],
limitedExport:false,
reportItem:{},
sflogexpList:[],
};
}, },
mounted(){ handlePrint() {
this.getTeam(); this.$PRINT('#myReport');
this.getShfit();
},
methods: {
getTeam(){
let form ={};
form.page = 0;
form.belong_dept = this.deptId;
this.$API.mtm.team.list.req(form).then(res=>{
this.options = res;
})
},
getShfit(){
this.$API.mtm.shift.req({page:0}).then(res=>{
this.optionsShift = res;
})
},
handleQuery(){
this.$refs.table.queryData(this.query);
},
sflog_export(){
this.limitedExport = true;
},
rowClick(row) {
this.sflogId = row.id;
this.sflogItem = row;
this.getSflogItem(row.id);
this.getSflogexp(row.id);
},
getSflogexp(id){
let that = this;
that.$API.wpm.sflogexp.list.req({page:0,sflog:id}).then(res=>{
that.sflogexpList = res;
})
},
getSflogItem(id){
let that =this;
that.$API.enm.enstat.req({type:'sflog',sflog:id,page:0}).then(res=>{
if(res.length>0){
that.reportItem = res[0];
}
console.log(res[0])
})
},
//
sflog_edit(row) {
let jsonStr = JSON.stringify(row);
this.$TOOL.data.remove("sflogItem")
this.$TOOL.data.set('sflogItem',jsonStr)
this.$router.push({
name: "logDetail",
query: {
mgroupId: row.mgroup,
deptId:this.deptId
},
});
},
handlePrint() {
this.$PRINT('#myReport');
},
exportExcel() {
this.exportLoading = true;
this.$XLSX('#myTable', this.tableName)
this.exportLoading = false;
},
}, },
}; exportExcel() {
</script> this.exportLoading = true;
this.$XLSX('#myTable', this.tableName)
this.exportLoading = false;
},
},
};
</script>
<style scoped> <style scoped>
#numTable{ #numTable {
margin-left: 37px; margin-left: 37px;
} }
#numTable td{
height: 32px; #numTable td {
padding-left: 5px; height: 32px;
} padding-left: 5px;
.numCell{ }
width: 80px;
text-align: center; .numCell {
} width: 80px;
.numCell.numCell_last{ text-align: center;
width: 100px; }
}
.searchHead{ .numCell.numCell_last {
display:flex width: 100px;
} }
.middleText{
height: 32px; .searchHead {
line-height: 32px; display: flex
margin: 0 5px; }
display: inline-block;
} .middleText {
.searchBtn{ height: 32px;
margin-left: 5px; line-height: 32px;
} margin: 0 5px;
</style> display: inline-block;
}
.searchBtn {
margin-left: 5px;
}
</style>

View File

@ -1,302 +1,258 @@
<template> <template>
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<div style="margin-right: 20px">交接班日志</div> <div style="margin-right: 20px">交接班日志</div>
<el-date-picker <el-date-picker v-model="query.start_time__gte" type="date" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD"
v-model="query.start_time__gte" placeholder="开始时间" style=" width: 120px" />
type="date" <el-date-picker v-model="query.end_time__lt" type="date" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD"
value-format="YYYY-MM-DD HH:mm:ss" placeholder="结束时间" style="margin-left: 2px; width: 120px" />
format="YYYY-MM-DD" <el-select v-model="query.shift" placeholder="班次" clearable style="margin-left: 2px; width: 120px">
placeholder="开始时间" <el-option v-for="item in optionsShift" :key="item.id" :label="item.name" :value="item.id"></el-option>
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>
<el-select <el-select v-model="query.team" placeholder="班组" clearable style="margin-left: 2px; width: 120px">
v-model="query.team" <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
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-select>
<el-button <el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
type="primary" </div>
icon="el-icon-search" </el-header>
@click="handleQuery" <el-main class="nopadding">
></el-button> <scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query" highlightCurrentRow @row-click="rowClick">
</div> <el-table-column type="index" width="50" />
</el-header> <!-- <el-table-column label="关联工段" prop="mgroup_name"></el-table-column> -->
<el-main class="nopadding"> <el-table-column label="开始时间" prop="start_time">
<scTable <template #default="scope">
ref="table" <span>{{ scope.row.start_time.slice(0, 16) }}</span>
:apiObj="apiObj" </template>
row-key="id" </el-table-column>
stripe <el-table-column label="结束时间" prop="end_time">
:params="query" <template #default="scope">
highlightCurrentRow <span>{{ scope.row.end_time.slice(0, 16) }}</span>
@row-click="rowClick" </template>
> </el-table-column>
<el-table-column type="index" width="50"/> <el-table-column label="班组名称" prop="team_name"></el-table-column>
<!-- <el-table-column label="关联工段" prop="mgroup_name"></el-table-column> --> <el-table-column label="当前班次" prop="shift_name"></el-table-column>
<el-table-column label="开始时间" prop="start_time"> <el-table-column label="班长" prop="leader_name"></el-table-column>
<template #default="scope">
<span>{{ scope.row.start_time.slice(0,16)}}</span>
</template>
</el-table-column>
<el-table-column label="结束时间" prop="end_time">
<template #default="scope">
<span>{{ scope.row.end_time.slice(0,16)}}</span>
</template>
</el-table-column>
<el-table-column label="班组名称" prop="team_name"></el-table-column>
<el-table-column label="当前班次" prop="shift_name"></el-table-column>
<el-table-column label="班长" prop="leader_name"></el-table-column>
<el-table-column label="检验时间"> <el-table-column label="检验时间">
<template #default="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="140"> <el-table-column label="操作" fixed="right" align="center" width="140">
<template #default="scope"> <template #default="scope">
<el-button link size="small" @click="sflog_edit(scope.row)" type="primary">编辑</el-button> <el-button link size="small" @click="sflog_edit(scope.row)" type="primary">编辑</el-button>
<!-- <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> --> <!-- <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> -->
<!-- <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> --> <!-- <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> -->
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical"></el-divider>
<el-button link size="small" @click="sflog_export(scope.row)" type="success">报表</el-button> <el-button link size="small" @click="sflog_export(scope.row)" type="success">报表</el-button>
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>
</el-main> </el-main>
<el-drawer v-model="limitedExport" size="60%" :show-close="false"> <el-drawer v-model="limitedExport" size="60%" :show-close="false">
<template #header="{ close, titleId, titleClass }"> <template #header="{ close, titleId, titleClass }">
<h4 :id="titleId" :class="titleClass">交接班日志</h4> <h4 :id="titleId" :class="titleClass">交接班日志</h4>
<el-button type="danger" @click="close"> <el-button type="danger" @click="close">
<el-icon class="el-icon--left"><CircleCloseFilled /></el-icon> <el-icon class="el-icon--left">
关闭 <CircleCloseFilled />
</el-button> </el-icon>
</template> 关闭
<div class="left-panel"> </el-button>
<el-button </template>
type="primary" <div class="left-panel">
@click="exportExcel()" <el-button type="primary" @click="exportExcel()" :loading="exportLoading">导出xlsx
:loading = "exportLoading" </el-button>
>导出xlsx <el-button type="primary" @click="handlePrint">打印
</el-button> </el-button>
<el-button </div>
type="primary" <el-main class="nopadding">
@click="handlePrint" <div ref="print" id="myReport" class="printContainer">
>打印 <div style="margin-right: 20px;text-align: center;font-size: 16px;font-weight: bold;margin-bottom: 20px;">
</el-button> <span v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}{{ sflogItem.shift_name }}</span>
<span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span>
交接班记录
</div>
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
<tbody>
<tr>
<td class="numCell">日期</td>
<td class="numCell" v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}</td>
<td class="numCell">班次</td>
<td class="numCell">{{ sflogItem.shift_name }}</td>
<td class="numCell">班组</td>
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
</tr>
<tr>
<td class="numCell">产量t</td>
<td class="numCell">{{ reportItem.total_production }}</td>
<td class="numCell">台时t/h</td>
<td class="numCell">{{ reportItem.production_hour }}</td>
<td class="numCell">运转时间h</td>
<td class="numCell">{{ reportItem.run_hour }}</td>
</tr>
<tr>
<td class="numCell">运转率%</td>
<td class="numCell">{{ reportItem.run_rate * 100 }}</td>
<td class="numCell">停机时长h</td>
<td class="numCell">{{ reportItem.shut_hour }}</td>
<td class="numCell">煤磨分布电耗KW·h/t</td>
<td class="numCell">{{ reportItem.elec_consume_unit }}</td>
</tr>
<tr>
<td class="numCell">煤粉细度合格率%</td>
<td class="numCell" v-if="reportItem.煤粉_细度_rate_pass">{{ reportItem.煤粉_细度_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td>
<td class="numCell">煤粉水分合格率%</td>
<td class="numCell" v-if="reportItem.煤粉_水分_rate_pass">{{ reportItem.煤粉_水分_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td>
</tr>
<tr v-if="sflogexpList.length > 0">
<td class="numCell" :rowspan="sflogexpList.length + 1">生产情况记录</td>
<td class="numCell">时间</td>
<td class="numCell">类别</td>
<td class="numCell">原因</td>
<td class="numCell">处置措施</td>
<td class="numCell">处置人</td>
</tr>
<tr v-for="item in sflogexpList" :key="item.id">
<td class="numCell">{{ item.happen_time }}</td>
<td class="numCell">{{ item.cate }}</td>
<td class="numCell">{{ item.reason }}</td>
<td class="numCell">{{ item.measure }}</td>
<td class="numCell">{{ item.handler }}</td>
</tr>
</tbody>
</table>
</div> </div>
<el-main class="nopadding"> </el-main>
<div ref="print" id="myReport" class="printContainer"> </el-drawer>
<div style="margin-right: 20px;text-align: center;font-size: 16px;font-weight: bold;margin-bottom: 20px;"> </el-container>
<span v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}{{ sflogItem.shift_name }}</span> </template>
<span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span> <script>
交接班记录 export default {
</div> name: "sflog",
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
<tbody>
<tr>
<td class="numCell">日期</td>
<td class="numCell" v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}</td>
<td class="numCell">班次</td>
<td class="numCell">{{ sflogItem.shift_name }}</td>
<td class="numCell">班组</td>
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
</tr>
<tr>
<td class="numCell">产量t</td>
<td class="numCell">{{reportItem.total_production}}</td>
<td class="numCell">台时t/h</td>
<td class="numCell">{{reportItem.production_hour}}</td>
<td class="numCell">运转时间h</td>
<td class="numCell">{{reportItem.run_hour}}</td>
</tr>
<tr>
<td class="numCell">运转率%</td>
<td class="numCell">{{reportItem.run_rate*100}}</td>
<td class="numCell">停机时长h</td>
<td class="numCell">{{reportItem.shut_hour}}</td>
<td class="numCell">煤磨分布电耗KW·h/t</td>
<td class="numCell">{{reportItem.elec_consume_unit}}</td>
</tr>
<tr>
<td class="numCell">煤粉细度合格率%</td>
<td class="numCell" v-if="reportItem.煤粉_细度_rate_pass">{{reportItem.煤粉_细度_rate_pass*100}}</td>
<td class="numCell" v-else>0</td>
<td class="numCell">煤粉水分合格率%</td>
<td class="numCell" v-if="reportItem.煤粉_水分_rate_pass">{{reportItem.煤粉_水分_rate_pass*100}}</td>
<td class="numCell" v-else>0</td>
</tr>
<tr v-if="sflogexpList.length>0">
<td class="numCell" :rowspan="sflogexpList.length+1">生产情况记录</td>
<td class="numCell">时间</td>
<td class="numCell">类别</td>
<td class="numCell">原因</td>
<td class="numCell">处置措施</td>
<td class="numCell">处置人</td>
</tr>
<tr v-for="item in sflogexpList" :key="item.id">
<td class="numCell">{{ item.happen_time}}</td>
<td class="numCell">{{ item.cate}}</td>
<td class="numCell">{{ item.reason}}</td>
<td class="numCell">{{ item.measure}}</td>
<td class="numCell">{{ item.handler}}</td>
</tr>
</tbody>
</table>
</div>
</el-main>
</el-drawer>
</el-container>
</template> data() {
<script> return {
export default { apiObj: this.$API.wpm.sflog.list,
name: "sflog", apiObj2: null,
query: {
data() { shift: '',
return { team: '',
apiObj: this.$API.wpm.sflog.list, end_time__lt: '',
apiObj2: null, start_time__gte: '',
mgroup: '3347217651339837440',
},
deptId: '3347207316583170048',
sflogItem: {},
options: [],
optionsShift: [],
limitedExport: false,
reportItem: {},
sflogexpList: [],
};
},
mounted() {
this.getTeam();
this.getShfit();
},
methods: {
getTeam() {
let form = {};
form.page = 0;
form.belong_dept = this.deptId;
this.$API.mtm.team.list.req(form).then(res => {
this.options = res;
})
},
getShfit() {
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
this.optionsShift = res;
})
},
handleQuery() {
this.$refs.table.queryData(this.query);
},
sflog_export() {
this.limitedExport = true;
},
rowClick(row) {
this.sflogId = row.id;
this.sflogItem = row;
this.getSflogItem(row.id);
this.getSflogexp(row.id);
},
getSflogexp(id) {
let that = this;
that.$API.wpm.sflogexp.list.req({ page: 0, sflog: id }).then(res => {
that.sflogexpList = res;
})
},
getSflogItem(id) {
let that = this;
that.$API.enm.enstat.req({ type: 'sflog', sflog: id, page: 0 }).then(res => {
if (res.length > 0) {
that.reportItem = res[0];
}
})
},
//
sflog_edit(row) {
let jsonStr = JSON.stringify(row);
this.$TOOL.data.remove("sflogItem")
this.$TOOL.data.set('sflogItem', jsonStr)
this.$router.push({
name: "logDetail",
query: { query: {
shift:'', mgroupId: row.mgroup,
team:'', deptId: this.deptId
end_time__lt:'',
start_time__gte:'',
mgroup:'3347217651339837440',
}, },
deptId:'3347207316583170048', });
sflogItem:{},
options:[],
optionsShift:[],
limitedExport:false,
reportItem:{},
sflogexpList:[],
};
}, },
mounted(){ handlePrint() {
this.getTeam(); this.$PRINT('#myReport');
this.getShfit();
},
methods: {
getTeam(){
let form ={};
form.page = 0;
form.belong_dept = this.deptId;
this.$API.mtm.team.list.req(form).then(res=>{
this.options = res;
})
},
getShfit(){
this.$API.mtm.shift.req({page:0}).then(res=>{
this.optionsShift = res;
})
},
handleQuery(){
this.$refs.table.queryData(this.query);
},
sflog_export(){
this.limitedExport = true;
},
rowClick(row) {
this.sflogId = row.id;
this.sflogItem = row;
this.getSflogItem(row.id);
this.getSflogexp(row.id);
},
getSflogexp(id){
let that = this;
that.$API.wpm.sflogexp.list.req({page:0,sflog:id}).then(res=>{
that.sflogexpList = res;
})
},
getSflogItem(id){
let that =this;
that.$API.enm.enstat.req({type:'sflog',sflog:id,page:0}).then(res=>{
if(res.length>0){
that.reportItem = res[0];
}
})
},
//
sflog_edit(row) {
let jsonStr = JSON.stringify(row);
this.$TOOL.data.remove("sflogItem")
this.$TOOL.data.set('sflogItem',jsonStr)
this.$router.push({
name: "logDetail",
query: {
mgroupId: row.mgroup,
deptId:this.deptId
},
});
},
handlePrint() {
this.$PRINT('#myReport');
},
exportExcel() {
this.exportLoading = true;
this.$XLSX('#myTable', this.tableName)
this.exportLoading = false;
},
}, },
}; exportExcel() {
</script> this.exportLoading = true;
this.$XLSX('#myTable', this.tableName)
this.exportLoading = false;
},
},
};
</script>
<style scoped> <style scoped>
#numTable{ #numTable {
margin-left: 37px; margin-left: 37px;
} }
#numTable td{
height: 32px; #numTable td {
padding-left: 5px; height: 32px;
} padding-left: 5px;
.numCell{ }
width: 80px;
} .numCell {
.numCell.numCell_last{ width: 80px;
width: 100px; }
}
.searchHead{ .numCell.numCell_last {
display:flex width: 100px;
} }
.middleText{
height: 32px; .searchHead {
line-height: 32px; display: flex
margin: 0 5px; }
display: inline-block;
} .middleText {
.searchBtn{ height: 32px;
margin-left: 5px; line-height: 32px;
} margin: 0 5px;
</style> display: inline-block;
}
.searchBtn {
margin-left: 5px;
}
</style>

View File

@ -1,281 +1,237 @@
<template> <template>
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<div style="margin-right: 20px">交接班日志</div> <div style="margin-right: 20px">交接班日志</div>
<el-date-picker <el-date-picker v-model="query.start_time__gte" type="date" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD"
v-model="query.start_time__gte" placeholder="开始时间" style=" width: 120px" />
type="date" <el-date-picker v-model="query.end_time__lt" type="date" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD"
value-format="YYYY-MM-DD HH:mm:ss" placeholder="结束时间" style="margin-left: 2px; width: 120px" />
format="YYYY-MM-DD" <el-select v-model="query.shift" placeholder="班次" clearable style="margin-left: 2px; width: 120px">
placeholder="开始时间" <el-option v-for="item in optionsShift" :key="item.id" :label="item.name" :value="item.id"></el-option>
style=" width: 120px" </el-select>
/> <el-select v-model="query.team" placeholder="班组" clearable style="margin-left: 2px; width: 120px">
<el-date-picker <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
v-model="query.end_time__lt" </el-select>
type="date" <el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
value-format="YYYY-MM-DD HH:mm:ss" </div>
format="YYYY-MM-DD" </el-header>
placeholder="结束时间" <el-main class="nopadding">
style="margin-left: 2px; width: 120px" <scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query" highlightCurrentRow @row-click="rowClick">
/> <el-table-column type="index" width="50" />
<el-select <!-- <el-table-column label="关联工段" prop="mgroup_name"></el-table-column> -->
v-model="query.shift" <el-table-column label="开始时间" prop="start_time">
placeholder="班次" <template #default="scope">
clearable <span>{{ scope.row.start_time.slice(0, 16) }}</span>
style="margin-left: 2px; width: 120px" </template>
> </el-table-column>
<el-option <el-table-column label="结束时间" prop="end_time">
v-for="item in optionsShift" <template #default="scope">
:key="item.id" <span>{{ scope.row.end_time.slice(0, 16) }}</span>
:label="item.name" </template>
:value="item.id" </el-table-column>
></el-option> <el-table-column label="班组名称" prop="team_name"></el-table-column>
</el-select> <el-table-column label="当前班次" prop="shift_name"></el-table-column>
<el-select <el-table-column label="班长" prop="leader_name"></el-table-column>
v-model="query.team"
placeholder="班组"
clearable
style="margin-left: 2px; width: 120px"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="query"
highlightCurrentRow
@row-click="rowClick"
>
<el-table-column type="index" width="50"/>
<!-- <el-table-column label="关联工段" prop="mgroup_name"></el-table-column> -->
<el-table-column label="开始时间" prop="start_time">
<template #default="scope">
<span>{{ scope.row.start_time.slice(0,16)}}</span>
</template>
</el-table-column>
<el-table-column label="结束时间" prop="end_time">
<template #default="scope">
<span>{{ scope.row.end_time.slice(0,16)}}</span>
</template>
</el-table-column>
<el-table-column label="班组名称" prop="team_name"></el-table-column>
<el-table-column label="当前班次" prop="shift_name"></el-table-column>
<el-table-column label="班长" prop="leader_name"></el-table-column>
<el-table-column label="检验时间"> <el-table-column label="检验时间">
<template #default="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="140"> <el-table-column label="操作" fixed="right" align="center" width="140">
<template #default="scope"> <template #default="scope">
<el-button link size="small" @click="sflog_edit(scope.row)" type="primary">编辑</el-button> <el-button link size="small" @click="sflog_edit(scope.row)" type="primary">编辑</el-button>
<!-- <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> --> <!-- <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> -->
<!-- <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> --> <!-- <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> -->
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical"></el-divider>
<el-button link size="small" @click="sflog_export(scope.row)" type="success">报表</el-button> <el-button link size="small" @click="sflog_export(scope.row)" type="success">报表</el-button>
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>
</el-main> </el-main>
<el-drawer v-model="limitedExport" size="60%" :show-close="false"> <el-drawer v-model="limitedExport" size="60%" :show-close="false">
<template #header="{ close, titleId, titleClass }"> <template #header="{ close, titleId, titleClass }">
<h4 :id="titleId" :class="titleClass">交接班日志</h4> <h4 :id="titleId" :class="titleClass">交接班日志</h4>
<el-button type="danger" @click="close"> <el-button type="danger" @click="close">
<el-icon class="el-icon--left"><CircleCloseFilled /></el-icon> <el-icon class="el-icon--left">
关闭 <CircleCloseFilled />
</el-button> </el-icon>
</template> 关闭
<div class="left-panel"> </el-button>
<el-button </template>
type="primary" <div class="left-panel">
@click="exportExcel()" <el-button type="primary" @click="exportExcel()" :loading="exportLoading">导出xlsx
:loading = "exportLoading" </el-button>
>导出xlsx <el-button type="primary" @click="handlePrint">打印
</el-button> </el-button>
<el-button </div>
type="primary" <el-main class="nopadding">
@click="handlePrint" <div ref="print" id="myReport" class="printContainer">
>打印 <div style="margin-right: 20px;text-align: center;font-size: 16px;font-weight: bold;margin-bottom: 20px;">
</el-button> <span v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}{{ sflogItem.shift_name }}</span>
<span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span>
交接班记录
</div>
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
<tbody>
<tr>
<td class="numCell">日期</td>
<td class="numCell" v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}</td>
<td class="numCell">班次</td>
<td class="numCell">{{ sflogItem.shift_name }}</td>
<td class="numCell">班组</td>
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
</tr>
<tr>
<td class="numCell">产量t</td>
<td class="numCell">{{ reportItem.total_production }}</td>
<td class="numCell">单位产品分布电耗KW·h/t</td>
<td class="numCell">{{ reportItem.elec_consume_unit }}</td>
</tr>
<tr v-if="sflogexpList.length > 0">
<td class="numCell" :rowspan="sflogexpList.length + 1">生产情况记录</td>
<td class="numCell">时间</td>
<td class="numCell">类别</td>
<td class="numCell">原因</td>
<td class="numCell">处置措施</td>
<td class="numCell">处置人</td>
</tr>
<tr v-for="item in sflogexpList" :key="item.id">
<td class="numCell">{{ item.happen_time }}</td>
<td class="numCell">{{ item.cate }}</td>
<td class="numCell">{{ item.reason }}</td>
<td class="numCell">{{ item.measure }}</td>
<td class="numCell">{{ item.handler }}</td>
</tr>
</tbody>
</table>
</div> </div>
<el-main class="nopadding"> </el-main>
<div ref="print" id="myReport" class="printContainer"> </el-drawer>
<div style="margin-right: 20px;text-align: center;font-size: 16px;font-weight: bold;margin-bottom: 20px;"> </el-container>
<span v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}{{ sflogItem.shift_name }}</span> </template>
<span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span> <script>
交接班记录 export default {
</div> name: "packsflog",
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable"> data() {
<tbody> return {
<tr> apiObj: this.$API.wpm.sflog.list,
<td class="numCell">日期</td> apiObj2: null,
<td class="numCell" v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}</td> query: {
<td class="numCell">班次</td> mgroup: '3347217757455728640',
<td class="numCell">{{ sflogItem.shift_name }}</td> },
<td class="numCell">班组</td> deptId: '3347207316583170048',
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
</tr>
<tr>
<td class="numCell">产量t</td>
<td class="numCell">{{reportItem.total_production}}</td>
<td class="numCell">单位产品分布电耗KW·h/t</td>
<td class="numCell">{{reportItem.elec_consume_unit}}</td>
</tr>
<tr v-if="sflogexpList.length>0">
<td class="numCell" :rowspan="sflogexpList.length+1">生产情况记录</td>
<td class="numCell">时间</td>
<td class="numCell">类别</td>
<td class="numCell">原因</td>
<td class="numCell">处置措施</td>
<td class="numCell">处置人</td>
</tr>
<tr v-for="item in sflogexpList" :key="item.id">
<td class="numCell">{{ item.happen_time}}</td>
<td class="numCell">{{ item.cate}}</td>
<td class="numCell">{{ item.reason}}</td>
<td class="numCell">{{ item.measure}}</td>
<td class="numCell">{{ item.handler}}</td>
</tr>
</tbody>
</table>
</div>
</el-main>
</el-drawer>
</el-container>
</template> sflogItem: {},
<script> options: [],
export default { optionsShift: [],
name: "packsflog", limitedExport: false,
data() { reportItem: {},
return { sflogexpList: [],
apiObj: this.$API.wpm.sflog.list, };
apiObj2: null, },
mounted() {
this.getTeam();
this.getShfit();
},
methods: {
getTeam() {
let form = {};
form.page = 0;
form.belong_dept = this.deptId;
this.$API.mtm.team.list.req(form).then(res => {
this.options = res;
})
},
getShfit() {
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
this.optionsShift = res;
})
},
handleQuery() {
this.$refs.table.queryData(this.query);
},
sflog_export() {
this.limitedExport = true;
},
rowClick(row) {
this.sflogId = row.id;
this.sflogItem = row;
this.getSflogItem(row.id);
this.getSflogexp(row.id);
},
getSflogexp(id) {
let that = this;
that.$API.wpm.sflogexp.list.req({ page: 0, sflog: id }).then(res => {
that.sflogexpList = res;
})
},
getSflogItem(id) {
let that = this;
that.$API.enm.enstat.req({ type: 'sflog', sflog: id, page: 0 }).then(res => {
if (res.length > 0) {
that.reportItem = res[0];
}
console.log(res[0])
})
},
//
sflog_edit(row) {
let jsonStr = JSON.stringify(row);
this.$TOOL.data.remove("sflogItem")
this.$TOOL.data.set('sflogItem', jsonStr)
this.$router.push({
name: "logDetail",
query: { query: {
mgroup:'3347217757455728640', mgroupId: row.mgroup,
deptId: this.deptId
}, },
deptId:'3347207316583170048', });
sflogItem:{},
options:[],
optionsShift:[],
limitedExport:false,
reportItem:{},
sflogexpList:[],
};
}, },
mounted(){ handlePrint() {
this.getTeam(); this.$PRINT('#myReport');
this.getShfit();
},
methods: {
getTeam(){
let form ={};
form.page = 0;
form.belong_dept = this.deptId;
this.$API.mtm.team.list.req(form).then(res=>{
this.options = res;
})
},
getShfit(){
this.$API.mtm.shift.req({page:0}).then(res=>{
this.optionsShift = res;
})
},
handleQuery(){
this.$refs.table.queryData(this.query);
},
sflog_export(){
this.limitedExport = true;
},
rowClick(row) {
this.sflogId = row.id;
this.sflogItem = row;
this.getSflogItem(row.id);
this.getSflogexp(row.id);
},
getSflogexp(id){
let that = this;
that.$API.wpm.sflogexp.list.req({page:0,sflog:id}).then(res=>{
that.sflogexpList = res;
})
},
getSflogItem(id){
let that =this;
that.$API.enm.enstat.req({type:'sflog',sflog:id,page:0}).then(res=>{
if(res.length>0){
that.reportItem = res[0];
}
console.log(res[0])
})
},
//
sflog_edit(row) {
let jsonStr = JSON.stringify(row);
this.$TOOL.data.remove("sflogItem")
this.$TOOL.data.set('sflogItem',jsonStr)
this.$router.push({
name: "logDetail",
query: {
mgroupId: row.mgroup,
deptId:this.deptId
},
});
},
handlePrint() {
this.$PRINT('#myReport');
},
exportExcel() {
this.exportLoading = true;
this.$XLSX('#myTable', this.tableName)
this.exportLoading = false;
},
}, },
}; exportExcel() {
</script> this.exportLoading = true;
this.$XLSX('#myTable', this.tableName)
this.exportLoading = false;
},
},
};
</script>
<style scoped> <style scoped>
#numTable{ #numTable {
margin-left: 37px; margin-left: 37px;
} }
#numTable td{
height: 32px; #numTable td {
padding-left: 5px; height: 32px;
} padding-left: 5px;
.numCell{ }
width: 80px;
} .numCell {
.numCell.numCell_last{ width: 80px;
width: 100px; }
}
.searchHead{ .numCell.numCell_last {
display:flex width: 100px;
} }
.middleText{
height: 32px; .searchHead {
line-height: 32px; display: flex
margin: 0 5px; }
display: inline-block;
} .middleText {
.searchBtn{ height: 32px;
margin-left: 5px; line-height: 32px;
} margin: 0 5px;
</style> display: inline-block;
}
.searchBtn {
margin-left: 5px;
}
</style>

View File

@ -1,204 +1,155 @@
<template> <template>
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<div style="margin-right: 20px">交接班日志</div> <div style="margin-right: 20px">交接班日志</div>
<el-date-picker <el-date-picker v-model="query.start_time__gte" type="date" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD"
v-model="query.start_time__gte" placeholder="开始时间" style=" width: 120px" />
type="date" <el-date-picker v-model="query.end_time__lt" type="date" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD"
value-format="YYYY-MM-DD HH:mm:ss" placeholder="结束时间" style="margin-left: 2px; width: 120px" />
format="YYYY-MM-DD" <el-select v-model="query.shift" placeholder="班次" clearable style="margin-left: 2px; width: 120px">
placeholder="开始时间" <el-option v-for="item in optionsShift" :key="item.id" :label="item.name" :value="item.id"></el-option>
style=" width: 120px" </el-select>
/> <el-select v-model="query.team" placeholder="班组" clearable style="margin-left: 2px; width: 120px">
<el-date-picker <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
v-model="query.end_time__lt" </el-select>
type="date" <el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
value-format="YYYY-MM-DD HH:mm:ss" </div>
format="YYYY-MM-DD" </el-header>
placeholder="结束时间" <el-main class="nopadding">
style="margin-left: 2px; width: 120px" <scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query" highlightCurrentRow @row-click="rowClick">
/> <el-table-column type="index" width="50" />
<el-select <el-table-column label="开始时间" prop="start_time">
v-model="query.shift" <template #default="scope">
placeholder="班次" <span>{{ scope.row.start_time.slice(0, 16) }}</span>
clearable </template>
style="margin-left: 2px; width: 120px" </el-table-column>
> <el-table-column label="结束时间" prop="end_time">
<el-option <template #default="scope">
v-for="item in optionsShift" <span>{{ scope.row.end_time.slice(0, 16) }}</span>
:key="item.id" </template>
:label="item.name" </el-table-column>
:value="item.id" <el-table-column label="班组名称" prop="team_name"></el-table-column>
></el-option> <el-table-column label="当前班次" prop="shift_name"></el-table-column>
</el-select> <el-table-column label="班长" prop="leader_name"></el-table-column>
<el-select <el-table-column label="检验时间">
v-model="query.team" <template #default="scope">
placeholder="班组" <span v-if="scope.row.last_test_time">{{ scope.row.last_test_time.slice(0, 16) }}</span>
clearable </template>
style="margin-left: 2px; width: 120px" </el-table-column>
> <el-table-column label="操作" fixed="right" align="center" width="140">
<el-option <template #default="scope">
v-for="item in options" <el-button link size="small" @click="sflog_edit(scope.row)" type="primary">编辑</el-button>
:key="item.id" <!-- <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> -->
:label="item.name" <!-- <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> -->
:value="item.id" <el-divider direction="vertical"></el-divider>
></el-option> <el-button link size="small" @click="sflog_export(scope.row)" type="success">报表</el-button>
</el-select> </template>
<el-button </el-table-column>
type="primary" </scTable>
icon="el-icon-search" </el-main>
@click="handleQuery" <el-drawer v-model="limitedExport" size="60%" :show-close="false">
></el-button> <template #header="{ close, titleId, titleClass }">
</div> <h4 :id="titleId" :class="titleClass">交接班日志</h4>
</el-header> <el-button type="danger" @click="close">
<el-icon class="el-icon--left">
<CircleCloseFilled />
</el-icon>
关闭
</el-button>
</template>
<div class="left-panel">
<el-button type="primary" @click="exportExcel()" :loading="exportLoading">导出xlsx
</el-button>
<el-button type="primary" @click="handlePrint">打印
</el-button>
</div>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable <div ref="print" id="myReport" class="printContainer">
ref="table" <div style="margin-right: 20px;text-align: center;font-size: 16px;font-weight: bold;margin-bottom: 20px;">
:apiObj="apiObj" <span v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}{{ sflogItem.shift_name }}</span>
row-key="id" <span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span>
stripe 交接班记录
:params="query" </div>
highlightCurrentRow <table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
@row-click="rowClick" <tbody>
> <tr>
<el-table-column type="index" width="50"/> <td class="numCell">日期</td>
<el-table-column label="开始时间" prop="start_time"> <td class="numCell" v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}</td>
<template #default="scope"> <td class="numCell">班次</td>
<span>{{ scope.row.start_time.slice(0,16)}}</span> <td class="numCell">{{ sflogItem.shift_name }}</td>
</template> <td class="numCell">班组</td>
</el-table-column> <td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
<el-table-column label="结束时间" prop="end_time"> </tr>
<template #default="scope"> <tr>
<span>{{ scope.row.end_time.slice(0,16)}}</span> <td class="numCell">产量t</td>
</template> <td class="numCell">{{ reportItem.total_production }}</td>
</el-table-column> <td class="numCell">台时t/h</td>
<el-table-column label="班组名称" prop="team_name"></el-table-column> <td class="numCell">{{ reportItem.production_hour }}</td>
<el-table-column label="当前班次" prop="shift_name"></el-table-column> <td class="numCell">运转时间h</td>
<el-table-column label="班长" prop="leader_name"></el-table-column> <td class="numCell">{{ reportItem.run_hour }}</td>
<el-table-column label="检验时间"> </tr>
<template #default="scope"> <tr>
<span v-if="scope.row.last_test_time">{{ scope.row.last_test_time.slice(0,16)}}</span> <td class="numCell">运转率%</td>
</template> <td class="numCell">{{ reportItem.run_rate * 100 }}</td>
</el-table-column> <td class="numCell">停机时长h</td>
<el-table-column label="操作" fixed="right" align="center" width="140"> <td class="numCell">{{ reportItem.shut_hour }}</td>
<template #default="scope"> <td class="numCell">当期单位产品电耗kW·h/t</td>
<el-button link size="small" @click="sflog_edit(scope.row)" type="primary">编辑</el-button> <td class="numCell">{{ reportItem.elec_consume_unit }}</td>
<!-- <el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button> --> </tr>
<!-- <el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button> --> <tr>
<el-divider direction="vertical"></el-divider> <td class="numCell">辅料细度合格率%</td>
<el-button link size="small" @click="sflog_export(scope.row)" type="success">报表</el-button> <td class="numCell" v-if="reportItem.辅料_细度_rate_pass">{{ reportItem.辅料_细度_rate_pass * 100 }}</td>
</template> <td class="numCell" v-else>0</td>
</el-table-column> <td class="numCell">辅料Fe₂O₃合格率%</td>
</scTable> <td class="numCell" v-if="reportItem.辅料_Fe2O3_rate_pass">{{ reportItem.辅料_Fe2O3_rate_pass * 100 }}</td>
</el-main> <td class="numCell" v-else>0</td>
<el-drawer v-model="limitedExport" size="60%" :show-close="false"> <td class="numCell">辅料水分合格率%</td>
<template #header="{ close, titleId, titleClass }"> <td class="numCell" v-if="reportItem.辅料_水分_rate_pass">{{ reportItem.辅料_水分_rate_pass * 100 }}</td>
<h4 :id="titleId" :class="titleClass">交接班日志</h4> <td class="numCell" v-else>0</td>
<el-button type="danger" @click="close"> </tr>
<el-icon class="el-icon--left"><CircleCloseFilled /></el-icon> <tr>
关闭 <td class="numCell">干混生料CaO合格率%</td>
</el-button> <td class="numCell" v-if="reportItem.干混生料_CaO_rate_pass">{{ reportItem.干混生料_CaO_rate_pass * 100 }}</td>
</template> <td class="numCell" v-else>0</td>
<div class="left-panel"> <td class="numCell">干混生料Fe₂O₃合格率%</td>
<el-button <td class="numCell" v-if="reportItem.干混生料_Fe2O3_rate_pass">{{ reportItem.干混生料_Fe2O3_rate_pass * 100 }}</td>
type="primary" <td class="numCell" v-else>0</td>
@click="exportExcel()" <td class="numCell">干混生料细度合格率%</td>
:loading = "exportLoading" <td class="numCell" v-if="reportItem.干混生料_细度_rate_pass">{{ reportItem.干混生料_细度_rate_pass * 100 }}</td>
>导出xlsx <td class="numCell" v-else>0</td>
</el-button> </tr>
<el-button <tr>
type="primary" <td class="numCell">干混生料水分合格率%</td>
@click="handlePrint" <td class="numCell" v-if="reportItem.干混生料_水分_rate_pass">{{ reportItem.干混生料_水分_rate_pass * 100 }}</td>
>打印 <td class="numCell" v-else>0</td>
</el-button> <td class="numCell">单位成本/</td>
<td class="numCell">{{ reportItem.production_cost_unit }}</td>
<td class="numCell"></td>
<td class="numCell"></td>
</tr>
<tr v-if="sflogexpList.length > 0">
<td class="numCell" :rowspan="sflogexpList.length + 1">生产情况记录</td>
<td class="numCell">时间</td>
<td class="numCell">类别</td>
<td class="numCell">原因</td>
<td class="numCell">处置措施</td>
<td class="numCell">处置人</td>
</tr>
<tr v-for="item in sflogexpList" :key="item.id">
<td class="numCell">{{ item.happen_time }}</td>
<td class="numCell">{{ item.cate }}</td>
<td class="numCell">{{ item.reason }}</td>
<td class="numCell">{{ item.measure }}</td>
<td class="numCell">{{ item.handler }}</td>
</tr>
</tbody>
</table>
</div> </div>
<el-main class="nopadding"> </el-main>
<div ref="print" id="myReport" class="printContainer"> </el-drawer>
<div style="margin-right: 20px;text-align: center;font-size: 16px;font-weight: bold;margin-bottom: 20px;"> </el-container>
<span v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}{{ sflogItem.shift_name }}</span> <!-- <save-dialog
<span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span>
交接班记录
</div>
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
<tbody>
<tr>
<td class="numCell">日期</td>
<td class="numCell" v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}</td>
<td class="numCell">班次</td>
<td class="numCell">{{ sflogItem.shift_name }}</td>
<td class="numCell">班组</td>
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
</tr>
<tr>
<td class="numCell">产量t</td>
<td class="numCell">{{reportItem.total_production}}</td>
<td class="numCell">台时t/h</td>
<td class="numCell">{{reportItem.production_hour}}</td>
<td class="numCell">运转时间h</td>
<td class="numCell">{{reportItem.run_hour}}</td>
</tr>
<tr>
<td class="numCell">运转率%</td>
<td class="numCell">{{reportItem.run_rate*100}}</td>
<td class="numCell">停机时长h</td>
<td class="numCell">{{reportItem.shut_hour}}</td>
<td class="numCell">当期单位产品电耗kW·h/t</td>
<td class="numCell">{{reportItem.elec_consume_unit}}</td>
</tr>
<tr>
<td class="numCell">辅料细度合格率%</td>
<td class="numCell" v-if="reportItem.辅料_细度_rate_pass">{{reportItem.辅料_细度_rate_pass*100}}</td>
<td class="numCell" v-else>0</td>
<td class="numCell">辅料Fe₂O₃合格率%</td>
<td class="numCell" v-if="reportItem.辅料_Fe2O3_rate_pass">{{reportItem.辅料_Fe2O3_rate_pass*100}}</td>
<td class="numCell" v-else>0</td>
<td class="numCell">辅料水分合格率%</td>
<td class="numCell" v-if="reportItem.辅料_水分_rate_pass">{{reportItem.辅料_水分_rate_pass*100}}</td>
<td class="numCell" v-else>0</td>
</tr>
<tr>
<td class="numCell">干混生料CaO合格率%</td>
<td class="numCell" v-if="reportItem.干混生料_CaO_rate_pass">{{reportItem.干混生料_CaO_rate_pass*100}}</td>
<td class="numCell" v-else>0</td>
<td class="numCell">干混生料Fe₂O₃合格率%</td>
<td class="numCell" v-if="reportItem.干混生料_Fe2O3_rate_pass">{{reportItem.干混生料_Fe2O3_rate_pass*100}}</td>
<td class="numCell" v-else>0</td>
<td class="numCell">干混生料细度合格率%</td>
<td class="numCell" v-if="reportItem.干混生料_细度_rate_pass">{{reportItem.干混生料_细度_rate_pass*100}}</td>
<td class="numCell" v-else>0</td>
</tr>
<tr>
<td class="numCell">干混生料水分合格率%</td>
<td class="numCell" v-if="reportItem.干混生料_水分_rate_pass">{{reportItem.干混生料_水分_rate_pass*100}}</td>
<td class="numCell" v-else>0</td>
<td class="numCell">单位成本/</td>
<td class="numCell">{{reportItem.production_cost_unit}}</td>
<td class="numCell"></td>
<td class="numCell"></td>
</tr>
<tr v-if="sflogexpList.length>0">
<td class="numCell" :rowspan="sflogexpList.length+1">生产情况记录</td>
<td class="numCell">时间</td>
<td class="numCell">类别</td>
<td class="numCell">原因</td>
<td class="numCell">处置措施</td>
<td class="numCell">处置人</td>
</tr>
<tr v-for="item in sflogexpList" :key="item.id">
<td class="numCell">{{ item.happen_time}}</td>
<td class="numCell">{{ item.cate}}</td>
<td class="numCell">{{ item.reason}}</td>
<td class="numCell">{{ item.measure}}</td>
<td class="numCell">{{ item.handler}}</td>
</tr>
</tbody>
</table>
</div>
</el-main>
</el-drawer>
</el-container>
<!-- <save-dialog
v-if="dialog.save" v-if="dialog.save"
ref="saveDialog" ref="saveDialog"
:deptId ="deptId" :deptId ="deptId"
@ -217,205 +168,211 @@
@success="handleCheckSuccess" @success="handleCheckSuccess"
@closed="dialog.save = false" @closed="dialog.save = false"
></quastat-dialog> --> ></quastat-dialog> -->
</template> </template>
<script> <script>
import saveDialog from "./handover_form.vue"; import saveDialog from "./handover_form.vue";
import quastatDialog from "./quastat_form.vue"; import quastatDialog from "./quastat_form.vue";
import otherDialog from "./other_form.vue"; import otherDialog from "./other_form.vue";
export default { export default {
name: "sflog", name: "sflog",
components: { components: {
saveDialog, saveDialog,
otherDialog, otherDialog,
quastatDialog quastatDialog
},
data() {
return {
apiObj: this.$API.wpm.sflog.list,
apiObj2: null,
query: {
mgroup: '3346520558031773696',
},
deptId: "3345780809943797760",
sflogItem: {},
selection: [],
modelValue: true,
showClose: true,
echartType: 'line',
asynDialog: false,
options: [],
optionsShift: [],
teamOptions: [],
limitedExport: false,
reportItem: {},
sflogexpList: [],
};
},
mounted() {
this.getTeam();
this.getShfit();
},
methods: {
getTeam() {
let form = {};
form.page = 0;
form.belong_dept = this.deptId;
this.$API.mtm.team.list.req(form).then(res => {
this.options = res;
})
}, },
data() { getShfit() {
return { this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
apiObj: this.$API.wpm.sflog.list, this.optionsShift = res;
apiObj2: null, })
},
handleQuery() {
this.$refs.table.queryData(this.query);
},
sflog_export() {
this.limitedExport = true;
},
rowClick(row) {
this.sflogId = row.id;
this.sflogItem = row;
this.getSflogItem(row.id);
this.getSflogexp(row.id);
},
getSflogexp(id) {
let that = this;
that.$API.wpm.sflogexp.list.req({ page: 0, sflog: id }).then(res => {
that.sflogexpList = res;
})
},
getSflogItem(id) {
let that = this;
that.$API.enm.enstat.req({ type: 'sflog', sflog: id, page: 0 }).then(res => {
if (res.length > 0) {
that.reportItem = res[0];
}
console.log(res[0])
})
},
//
sflog_edit(row) {
let jsonStr = JSON.stringify(row);
this.$TOOL.data.remove("sflogItem")
this.$TOOL.data.set('sflogItem', jsonStr)
this.$router.push({
name: "logDetail",
query: { query: {
mgroup:'3346520558031773696', mgroupId: row.mgroup,
deptId: this.deptId
}, },
deptId :"3345780809943797760", });
// this.dialog.save = true;
sflogItem:{}, // this.$nextTick(() => {
selection: [], // this.$refs.saveDialog.open("edit").setData(row);
modelValue:true, // });
showClose:true,
echartType:'line',
asynDialog:false,
options:[],
optionsShift:[],
teamOptions:[],
limitedExport:false,
reportItem:{},
sflogexpList:[],
};
}, },
mounted(){
this.getTeam(); //
this.getShfit(); sflog_check(row) {
}, this.dialog.check = true;
methods: { this.$nextTick(() => {
getTeam(){ this.$refs.checkDialog.open("edit").setData(row);
let form ={}; });
form.page = 0; },
form.belong_dept = this.deptId; //
this.$API.mtm.team.list.req(form).then(res=>{ sflog_other(row) {
this.options = res; this.dialog.other = true;
this.$nextTick(() => {
this.$refs.otherDialog.open("edit").setData(row);
});
},
// //
// table_show(row) {
// this.dialog.save = true;
// this.$nextTick(() => {
// this.$refs.checkDialog.open("edit").setData(row);
// });
// },
//
async table_del(row) {
this.$API.wpm.sflog.delete.req(row.id)
.then((res) => {
this.$message.success("删除成功");
return res;
}) })
}, .catch((err) => {
getShfit(){ return err;
this.$API.mtm.shift.req({page:0}).then(res=>{ });
this.optionsShift = res; },
}) //
}, handleSaveSuccess(data, mode) {
handleQuery(){ this.$refs.table.refresh()
this.$refs.table.queryData(this.query); this.dialog.save = false;
}, },
sflog_export(){ handleOtherSuccess() {
this.limitedExport = true; this.dialog.other = false;
}, },
rowClick(row) { handleCheckSuccess() {
this.sflogId = row.id; this.dialog.check = false;
this.sflogItem = row; },
this.getSflogItem(row.id); closed() {
this.getSflogexp(row.id); this.dialog.save = false;
}, this.$refs.table2.refresh();
getSflogexp(id){ },
let that = this; handleDel(row) {
that.$API.wpm.sflogexp.list.req({page:0,sflog:id}).then(res=>{ this.$confirm(`确定删除选中的记录吗?`, "提示", {
that.sflogexpList = res; type: "warning",
}) }).then(() => {
}, this.$API.wpm.shift.delete.req(row.id).then((res) => {
getSflogItem(id){ if (res.err_msg) {
let that =this; this.$message.error(res.err_msg);
that.$API.enm.enstat.req({type:'sflog',sflog:id,page:0}).then(res=>{ } else {
if(res.length>0){ // const loading = this.$loading();
that.reportItem = res[0]; // this.$refs.table2.refresh();
// loading.close();
// this.$message.success("");
} }
console.log(res[0])
})
},
//
sflog_edit(row) {
let jsonStr = JSON.stringify(row);
this.$TOOL.data.remove("sflogItem")
this.$TOOL.data.set('sflogItem',jsonStr)
this.$router.push({
name: "logDetail",
query: {
mgroupId: row.mgroup,
deptId:this.deptId
},
}); });
// this.dialog.save = true; })
// this.$nextTick(() => { .catch(() => { });
// this.$refs.saveDialog.open("edit").setData(row);
// });
},
//
sflog_check(row){
this.dialog.check = true;
this.$nextTick(() => {
this.$refs.checkDialog.open("edit").setData(row);
});
},
//
sflog_other(row){
this.dialog.other = true;
this.$nextTick(() => {
this.$refs.otherDialog.open("edit").setData(row);
});
},
// //
// table_show(row) {
// this.dialog.save = true;
// this.$nextTick(() => {
// this.$refs.checkDialog.open("edit").setData(row);
// });
// },
//
async table_del(row) {
this.$API.wpm.sflog.delete.req(row.id)
.then((res) => {
this.$message.success("删除成功");
return res;
})
.catch((err) => {
return err;
});
},
//
handleSaveSuccess(data, mode) {
this.$refs.table.refresh()
this.dialog.save = false;
},
handleOtherSuccess(){
this.dialog.other = false;
},
handleCheckSuccess(){
this.dialog.check = false;
},
closed() {
this.dialog.save = false;
this.$refs.table2.refresh();
},
handleDel(row) {
this.$confirm(`确定删除选中的记录吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.wpm.shift.delete.req(row.id).then((res) => {
if (res.err_msg) {
this.$message.error(res.err_msg);
} else {
// const loading = this.$loading();
// this.$refs.table2.refresh();
// loading.close();
// this.$message.success("");
}
});
})
.catch(() => {});
},
handlePrint() {
this.$PRINT('#myReport');
},
exportExcel() {
this.exportLoading = true;
this.$XLSX('#myTable', this.tableName)
this.exportLoading = false;
},
}, },
}; handlePrint() {
</script> this.$PRINT('#myReport');
},
exportExcel() {
this.exportLoading = true;
this.$XLSX('#myTable', this.tableName)
this.exportLoading = false;
},
},
};
</script>
<style scoped> <style scoped>
#numTable{ #numTable {
margin-left: 37px; margin-left: 37px;
} }
#numTable td{
height: 32px; #numTable td {
padding-left: 5px; height: 32px;
} padding-left: 5px;
.numCell{ }
width: 80px;
} .numCell {
.numCell.numCell_last{ width: 80px;
width: 100px; }
}
.searchHead{ .numCell.numCell_last {
display:flex width: 100px;
} }
.middleText{
height: 32px; .searchHead {
line-height: 32px; display: flex
margin: 0 5px; }
display: inline-block;
} .middleText {
.searchBtn{ height: 32px;
margin-left: 5px; line-height: 32px;
} margin: 0 5px;
</style> display: inline-block;
}
.searchBtn {
margin-left: 5px;
}
</style>

View File

@ -1,225 +1,184 @@
<template> <template>
<el-dialog <el-dialog :title="titleMap[mode]" v-model="visible" :size="1000" destroy-on-close @closed="$emit('closed')">
:title="titleMap[mode]" <el-container v-loading="loading">
v-model="visible" <el-main style="padding: 0 20px 20px 20px">
:size="1000" <el-form ref="dialogForm" :model="form" label-width="100px" label-position="right" :rules="rule1">
destroy-on-close <el-row>
@closed="$emit('closed')" <el-col :md="12" :sm="24">
> <el-form-item label="关联工段" prop="mgroup">
<el-container v-loading="loading"> <el-input v-model="form.mgroup_name" placeholder="关联工段" disabled />
<el-main style="padding: 0 20px 20px 20px"> </el-form-item>
<el-form </el-col>
ref="dialogForm" <el-col :md="12" :sm="24">
:model="form" <el-form-item label="当班班次" prop="shift">
label-width="100px" <el-input v-model="form.shift_name" placeholder="当班班次" disabled />
label-position="right" </el-form-item>
:rules="rule1" </el-col>
> <el-col :md="12" :sm="24">
<el-row> <el-form-item label="开始时间" prop="start_time">
<el-col :md="12" :sm="24"> <el-date-picker disabled v-model="form.start_time" type="datetime" format="YYYY-MM-DD HH:mm"
<el-form-item label="关联工段" prop="mgroup"> placeholder="开始时间" style="width: 100%;" />
<el-input v-model="form.mgroup_name" placeholder="关联工段" disabled/> </el-form-item>
</el-form-item> </el-col>
</el-col> <el-col :md="12" :sm="24">
<el-col :md="12" :sm="24"> <el-form-item label="结束时间" prop="end_time">
<el-form-item label="当班班次" prop="shift"> <el-date-picker disabled v-model="form.end_time" type="datetime" format="YYYY-MM-DD HH:mm"
<el-input v-model="form.shift_name" placeholder="当班班次" disabled/> placeholder="结束时间" style="width: 100%;" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="开始时间" prop="start_time"> <el-form-item label="当班班组" prop="team">
<el-date-picker <el-select v-model="form.team" placeholder="当班班组" clearable style="width: 100%;" @change="teamChange">
disabled <el-option v-for="item in teamOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
v-model="form.start_time" </el-select>
type="datetime" </el-form-item>
format="YYYY-MM-DD HH:mm" </el-col>
placeholder="开始时间" <el-col :md="12" :sm="24">
style="width: 100%;" <el-form-item label="班组班长" prop="leader_name">
/> <el-input v-model="form.leader_name" placeholder="班组班长" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24" v-if="form.shift_name == '白班' && mgroupId == '3347217246321065984'">
<el-form-item label="结束时间" prop="end_time"> <el-form-item label="煤粉热值">
<el-date-picker <el-input-number v-model="form.pcoal_heat" controls-position="right" placeholder="煤粉热值" />
disabled </el-form-item>
v-model="form.end_time" </el-col>
type="datetime" <el-col>
format="YYYY-MM-DD HH:mm" <el-form-item label="生产情况记录">
placeholder="结束时间" <el-input type="textarea" :rows="4" v-model="form.note" placeholder="生产情况记录" />
style="width: 100%;" </el-form-item>
/> </el-col>
</el-form-item> </el-row>
</el-col> </el-form>
<el-col :md="12" :sm="24"> </el-main>
<el-form-item label="当班班组" prop="team"> <el-footer>
<el-select <el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
v-model="form.team" <el-button @click="visible = false">取消</el-button>
placeholder="当班班组" </el-footer>
clearable </el-container>
style="width: 100%;" </el-dialog>
@change="teamChange" </template>
> <script>
<el-option export default {
v-for="item in teamOptions" emits: ["success", "closed"],
:key="item.id" props: {
:label="item.name" deptId: {
:value="item.id" // v-model
></el-option> type: [String],
</el-select> default: "",
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="班组班长" prop="leader_name">
<el-input v-model="form.leader_name" placeholder="班组班长" disabled/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="form.shift_name=='白班'&&mgroupId=='3347217246321065984'">
<el-form-item label="煤粉热值">
<el-input-number v-model="form.pcoal_heat" controls-position="right" placeholder="煤粉热值" />
</el-form-item>
</el-col>
<el-col>
<el-form-item label="生产情况记录">
<el-input
type="textarea"
:rows="4"
v-model="form.note"
placeholder="生产情况记录"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-main>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
<el-button @click="visible = false">取消</el-button>
</el-footer>
</el-container>
</el-dialog>
</template>
<script>
export default {
emits: ["success", "closed"],
props: {
deptId: {
// v-model
type: [String],
default: "",
},
mgroupId: {
// v-model
type: [String],
default: "",
},
}, },
data() { mgroupId: {
return { // v-model
loading: false, type: [String],
mode: "add", default: "",
titleMap: {
add: "交接班日志",
edit: "交接班日志",
show: "查看交接班日志",
},
form: {
type:10,
},
rules: {
name: [{required: true, message: "请输入", trigger: "blur"}],
number: [{required: true, message: "请输入", trigger: "blur"}],
keeper_name: [{required: true, message: "请输入", trigger: "blur"}],
belong_dept: [{required: true, message: "请选择", trigger: "blur"}]
},
visible: false,
isSaveing: false,
keeperOptions: [],
depOptions: [],
selectionFilters: [],
setFiltersVisible: false,
teamOptions:[],
shiftOptions:[],
};
}, },
mounted() { },
this.mgroup = this.mgroupId; data() {
return {
loading: false,
mode: "add",
titleMap: {
add: "交接班日志",
edit: "交接班日志",
show: "查看交接班日志",
},
form: {
type: 10,
},
rules: {
name: [{ required: true, message: "请输入", trigger: "blur" }],
number: [{ required: true, message: "请输入", trigger: "blur" }],
keeper_name: [{ required: true, message: "请输入", trigger: "blur" }],
belong_dept: [{ required: true, message: "请选择", trigger: "blur" }]
},
visible: false,
isSaveing: false,
keeperOptions: [],
depOptions: [],
selectionFilters: [],
setFiltersVisible: false,
teamOptions: [],
shiftOptions: [],
};
},
mounted() {
this.mgroup = this.mgroupId;
debugger;
console.log(this.deptId)
console.log(this.mgroupId)
//
this.getTeam();
this.getShfit();
},
methods: {
getTeam() {
debugger; debugger;
console.log(this.deptId) let form = {};
console.log(this.mgroupId) form.page = 0;
// form.belong_dept = this.deptId;
this.getTeam(); debugger;
this.getShfit(); this.$API.mtm.team.list.req(form).then(res => {
this.teamOptions = res;
})
}, },
methods: { getShfit() {
getTeam(){ this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
debugger; this.shiftOptions = res;
let form ={}; })
form.page = 0; },
form.belong_dept = this.deptId; //
debugger; open(mode = "add") {
this.$API.mtm.team.list.req(form).then(res=>{ this.mode = mode;
this.teamOptions = res; this.visible = true;
}) return this;
}, },
getShfit(){ teamChange(data) {
this.$API.mtm.shift.req({page:0}).then(res=>{ let that = this;
this.shiftOptions = res; that.teamOptions.forEach(item => {
}) if (item.id == data) {
}, that.form.leader_name = item.leader_name;
// that.form.leader = item.leader;
open(mode = "add") { }
this.mode = mode; })
this.visible = true; },
return this; //
}, submit() {
teamChange(data){ this.$refs.dialogForm.validate(async (valid) => {
let that = this; if (valid) {
that.teamOptions.forEach(item=>{ this.isSaveing = true;
if(item.id==data){ try {
that.form.leader_name = item.leader_name; let obj = {};
that.form.leader= item.leader; 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;
submit() { this.$API.wpm.sflog.update.req(this.form.id, obj).then(res => {
this.$refs.dialogForm.validate(async (valid) => {
if (valid) {
this.isSaveing = true;
try {
let obj={};
obj.note = this.form.note;
obj.team = this.form.team;
obj.shift = this.form.shift;
obj.leader = this.form.leader;
obj.pcoal_heat = this.form.pcoal_heat;
this.$API.wpm.sflog.update.req(this.form.id,obj).then(res=>{
this.isSaveing = false;
this.$emit("success", this.form, this.mode);
this.visible = false;
this.$message.success("操作成功");
return res;
})
} catch (err) {
//
this.isSaveing = false; this.isSaveing = false;
return err; this.$emit("success", this.form, this.mode);
} this.visible = false;
this.$message.success("操作成功");
return res;
})
} catch (err) {
//
this.isSaveing = false;
return err;
} }
}); }
}, });
//
setData(data) {
Object.assign(this.form,data);
},
//
setFilters(filters) {
this.selectionFilters = filters;
this.setFiltersVisible = true;
},
}, },
}; //
</script> setData(data) {
<style> Object.assign(this.form, data);
</style> },
//
setFilters(filters) {
this.selectionFilters = filters;
this.setFiltersVisible = true;
},
},
};
</script>
<style></style>

View File

@ -1,189 +1,174 @@
<template> <template>
<el-dialog <el-dialog :title="titleMap[mode]" v-model="visible" :size="1000" destroy-on-close @closed="$emit('closed')">
:title="titleMap[mode]" <el-container v-loading="loading">
v-model="visible" <el-main style="padding: 0 20px 20px 20px">
:size="1000" <el-form ref="dialogForm" :model="form" label-width="100px" label-position="right" :rules="rules">
destroy-on-close <el-row>
@closed="$emit('closed')" <el-col :md="12" :sm="24">
> <el-form-item label="关联工段" prop="mgroup">
<el-container v-loading="loading"> <el-input v-model="form.mgroup_name" placeholder="关联工段" disabled />
<el-main style="padding: 0 20px 20px 20px"> </el-form-item>
<el-form </el-col>
ref="dialogForm" <el-col :md="12" :sm="24">
:model="form" <el-form-item label="当班班次">
label-width="100px" <el-input v-model="form.shift_name" placeholder="当班班次" disabled />
label-position="right" </el-form-item>
:rules="rules" </el-col>
> <el-col :md="12" :sm="24">
<el-row> <el-form-item label="开始时间" prop="start_time">
<el-col :md="12" :sm="24"> <el-input v-model="form.start_time" placeholder="结束时间" disabled />
<el-form-item label="关联工段" prop="mgroup"> </el-form-item>
<el-input v-model="form.mgroup_name" placeholder="关联工段" disabled/> </el-col>
</el-form-item> <el-col :md="12" :sm="24">
</el-col> <el-form-item label="结束时间" prop="end_time">
<el-col :md="12" :sm="24"> <el-input v-model="form.end_time" placeholder="结束时间" disabled />
<el-form-item label="当班班次"> </el-form-item>
<el-input v-model="form.shift_name" placeholder="当班班次" disabled/> </el-col>
</el-form-item> <el-col :md="12" :sm="24">
</el-col> <el-form-item label="当班班组" prop="team">
<el-col :md="12" :sm="24"> <el-input v-model="form.team_name" placeholder="班组班长" disabled />
<el-form-item label="开始时间" prop="start_time"> </el-form-item>
<el-input v-model="form.start_time" placeholder="结束时间" disabled/> </el-col>
</el-form-item> <el-col :md="12" :sm="24">
</el-col> <el-form-item label="班组班长" prop="leader_name">
<el-col :md="12" :sm="24"> <el-input v-model="form.leader_name" placeholder="班组班长" disabled />
<el-form-item label="结束时间" prop="end_time"> </el-form-item>
<el-input v-model="form.end_time" placeholder="结束时间" disabled/> </el-col>
</el-form-item> <el-col :md="12" :sm="24">
</el-col> <el-form-item label="检测时间" prop="time">
<el-col :md="12" :sm="24"> <el-date-picker v-model="form.time" type="datetime" value-format="YYYY-MM-DD HH:mm"
<el-form-item label="当班班组" prop="team"> format="YYYY-MM-DD HH:mm" placeholder="检测时间" />
<el-input v-model="form.team_name" placeholder="班组班长" disabled/> </el-form-item>
</el-form-item> </el-col>
</el-col> <el-col :md="12" :sm="24" class="formUnitWrap">
<el-col :md="12" :sm="24"> <el-form-item label="水耗统计" prop="val">
<el-form-item label="班组班长" prop="leader_name"> <el-input-number v-model="form.val" :precision="2" controls-position="right" placeholder="水耗统计"
<el-input v-model="form.leader_name" placeholder="班组班长" disabled/> style="width: 100%;"></el-input-number>
</el-form-item> </el-form-item>
</el-col> <span class="formUnit">(t)</span>
<el-col :md="12" :sm="24"> </el-col>
<el-form-item label="检测时间" prop="time"> </el-row>
<el-date-picker </el-form>
v-model="form.time" </el-main>
type="datetime" <el-footer>
value-format="YYYY-MM-DD HH:mm" <el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
format="YYYY-MM-DD HH:mm" <el-button @click="visible = false">取消</el-button>
placeholder="检测时间" </el-footer>
/> </el-container>
</el-form-item> </el-dialog>
</el-col> </template>
<el-col :md="12" :sm="24" class="formUnitWrap"> <script>
<el-form-item label="水耗统计" prop="val"> export default {
<el-input-number v-model="form.val" :precision="2" controls-position="right" placeholder="水耗统计" style="width: 100%;"></el-input-number> emits: ["success", "closed"],
</el-form-item> data() {
<span class="formUnit">(t)</span> return {
</el-col> loading: false,
</el-row> mode: "add",
</el-form> titleMap: {
</el-main> add: "其他能源录入",
<el-footer> edit: "其他能源录入",
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button> show: "其他能源录入",
<el-button @click="visible = false">取消</el-button> },
</el-footer> form: {
</el-container> type: 10,
</el-dialog> },
</template> rules: {
<script> val: [{ required: true, message: "请输入检测值", trigger: "blur" }],
export default { time: [{ required: true, message: "请选择检测时间", trigger: "blur" }]
emits: ["success", "closed"], },
data() { visible: false,
return { isSaveing: false,
loading: false, keeperOptions: [],
mode: "add", depOptions: [],
titleMap: { selectionFilters: [],
add: "其他能源录入", setFiltersVisible: false,
edit: "其他能源录入", teamOptions: [],
show: "其他能源录入", shiftOptions: [],
}, };
form: { },
type:10, mounted() {
}, //
rules: { this.getTeam();
val: [{required: true, message: "请输入检测值", trigger: "blur"}], this.getShfit();
time: [{required: true, message: "请选择检测时间", trigger: "blur"}] },
}, methods: {
visible: false, getTeam() {
isSaveing: false, this.$API.mtm.team.list.req({ page: 0 }).then(res => {
keeperOptions: [], this.teamOptions = res;
depOptions: [], })
selectionFilters: [],
setFiltersVisible: false,
teamOptions:[],
shiftOptions:[],
};
}, },
mounted() { getShfit() {
// this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
this.getTeam(); this.shiftOptions = res;
this.getShfit(); })
}, },
methods: { //
getTeam(){ open(mode = "add") {
this.$API.mtm.team.list.req({page:0}).then(res=>{ this.mode = mode;
this.teamOptions = res; this.visible = true;
}) return this;
}, },
getShfit(){ teamChange(data) {
this.$API.mtm.shift.req({page:0}).then(res=>{ let that = this;
this.shiftOptions = res; that.teamOptions.forEach(item => {
}) if (item.id == data) {
}, that.form.leader_name = item.leader_name;
// that.form.leader = item.leader;
open(mode = "add") { }
this.mode = mode; })
this.visible = true; },
return this; //
}, submit() {
teamChange(data){ this.$refs.dialogForm.validate(async (valid) => {
let that = this; if (valid) {
that.teamOptions.forEach(item=>{ this.isSaveing = true;
if(item.id==data){ try {
that.form.leader_name = item.leader_name; let obj = {};
that.form.leader= item.leader; 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);
submit() { obj.val = this.form.val;
this.$refs.dialogForm.validate(async (valid) => { obj.sflog = this.form.id;
if (valid) { obj.material = '3349350755361792000';
this.isSaveing = true; obj.mpoint = '3349214860667219968';
try { this.$API.enm.mpoint.statCreate.req(obj).then(res => {
let obj={};
debugger;
obj.year_s = this.form.time.slice(0,4);
obj.month_s = this.form.time.slice(5,7);
obj.day_s = this.form.time.slice(8,10);
obj.hour = this.form.time.slice(11,13);
obj.val = this.form.val;
obj.sflog = this.form.id;
obj.material = '3349350755361792000';
obj.mpoint = '3349214860667219968';
this.$API.enm.mpoint.statCreate.req(obj).then(res=>{
this.isSaveing = false;
this.$emit("success", this.form, this.mode);
this.visible = false;
this.$message.success("操作成功");
return res;
})
} catch (err) {
//
this.isSaveing = false; this.isSaveing = false;
return err; this.$emit("success", this.form, this.mode);
} this.visible = false;
this.$message.success("操作成功");
return res;
})
} catch (err) {
//
this.isSaveing = false;
return err;
} }
}); }
}, });
//
setData(data) {
Object.assign(this.form,data);
},
//
setFilters(filters) {
this.selectionFilters = filters;
this.setFiltersVisible = true;
},
}, },
}; //
</script> setData(data) {
<style> Object.assign(this.form, data);
.formUnit{ },
position: absolute; //
right: -17px; setFilters(filters) {
top: 7px; this.selectionFilters = filters;
} this.setFiltersVisible = true;
.formUnitWrap{ },
position: relative; },
} };
</style> </script>
<style>
.formUnit {
position: absolute;
right: -17px;
top: 7px;
}
.formUnitWrap {
position: relative;
}
</style>

View File

@ -1,277 +1,234 @@
<template> <template>
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<div style="margin-right: 20px">交接班日志</div> <div style="margin-right: 20px">交接班日志</div>
<el-date-picker <el-date-picker v-model="query.start_time__gte" type="date" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD"
v-model="query.start_time__gte" placeholder="开始时间" style=" width: 120px" />
type="date" <el-date-picker v-model="query.end_time__lt" type="date" value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD"
value-format="YYYY-MM-DD HH:mm:ss" placeholder="结束时间" style="margin-left: 2px; width: 120px" />
format="YYYY-MM-DD" <el-select v-model="query.shift" placeholder="班次" clearable style="margin-left: 2px; width: 120px">
placeholder="开始时间" <el-option v-for="item in optionsShift" :key="item.id" :label="item.name" :value="item.id"></el-option>
style=" width: 120px" </el-select>
/> <el-select v-model="query.team" placeholder="班组" clearable style="margin-left: 2px; width: 120px">
<el-date-picker <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
v-model="query.end_time__lt" </el-select>
type="date" <el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
value-format="YYYY-MM-DD HH:mm:ss" </div>
format="YYYY-MM-DD" </el-header>
placeholder="结束时间" <el-main class="nopadding">
style="margin-left: 2px; width: 120px" <scTable ref="table" :apiObj="apiObj" row-key="id" stripe :params="query" highlightCurrentRow @row-click="rowClick">
/> <el-table-column type="index" width="50" />
<el-select <el-table-column label="开始时间" prop="start_time">
v-model="query.shift" <template #default="scope">
placeholder="班次" <span>{{ scope.row.start_time.slice(0, 16) }}</span>
clearable </template>
style="margin-left: 2px; width: 120px" </el-table-column>
> <el-table-column label="结束时间" prop="end_time">
<el-option <template #default="scope">
v-for="item in optionsShift" <span>{{ scope.row.end_time.slice(0, 16) }}</span>
:key="item.id" </template>
:label="item.name" </el-table-column>
:value="item.id" <el-table-column label="班组名称" prop="team_name"></el-table-column>
></el-option> <el-table-column label="当前班次" prop="shift_name"></el-table-column>
</el-select> <el-table-column label="班长" prop="leader_name"></el-table-column>
<el-select <el-table-column label="检验时间">
v-model="query.team" <template #default="scope">
placeholder="班组" <span v-if="scope.row.last_test_time">{{ scope.row.last_test_time.slice(0, 16) }}</span>
clearable </template>
style="margin-left: 2px; width: 120px" </el-table-column>
> <el-table-column label="操作" fixed="right" align="center" width="150">
<el-option <template #default="scope">
v-for="item in options" <el-button link size="small" @click="sflog_edit(scope.row)" type="primary">编辑</el-button>
:key="item.id" <el-divider direction="vertical"></el-divider>
:label="item.name" <el-button link size="small" @click="sflog_export(scope.row)" type="success">报表</el-button>
:value="item.id" </template>
></el-option> </el-table-column>
</el-select> </scTable>
<el-button </el-main>
type="primary" <el-drawer v-model="limitedExport" size="60%" :show-close="false">
icon="el-icon-search" <template #header="{ close, titleId, titleClass }">
@click="handleQuery" <h4 :id="titleId" :class="titleClass">交接班日志</h4>
></el-button> <el-button type="danger" @click="close">
</div> <el-icon class="el-icon--left">
</el-header> <CircleCloseFilled />
</el-icon>
关闭
</el-button>
</template>
<div class="left-panel">
<el-button type="primary" @click="exportExcel()" :loading="exportLoading">导出xlsx
</el-button>
<el-button type="primary" @click="handlePrint">打印
</el-button>
</div>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable <div ref="print" id="myReport" class="printContainer">
ref="table" <div style="margin-right: 20px;text-align: center;font-size: 16px;font-weight: bold;margin-bottom: 20px;">
:apiObj="apiObj" <span v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}{{ sflogItem.shift_name }}</span>
row-key="id" <span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span>
stripe 交接班记录
:params="query" </div>
highlightCurrentRow <table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
@row-click="rowClick" <tbody>
> <tr>
<el-table-column type="index" width="50"/> <td class="numCell">日期</td>
<el-table-column label="开始时间" prop="start_time"> <td class="numCell" v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}</td>
<template #default="scope"> <td class="numCell">班次</td>
<span>{{ scope.row.start_time.slice(0,16)}}</span> <td class="numCell">{{ sflogItem.shift_name }}</td>
</template> <td class="numCell">班组</td>
</el-table-column> <td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
<el-table-column label="结束时间" prop="end_time"> </tr>
<template #default="scope"> <tr>
<span>{{ scope.row.end_time.slice(0,16)}}</span> <td class="numCell">产量t</td>
</template> <td class="numCell">{{ reportItem.total_production }}</td>
</el-table-column> <td class="numCell">单位产品分布电耗KW·h/t</td>
<el-table-column label="班组名称" prop="team_name"></el-table-column> <td class="numCell">{{ reportItem.elec_consume_unit }}</td>
<el-table-column label="当前班次" prop="shift_name"></el-table-column> <td class="numCell">单位成本/</td>
<el-table-column label="班长" prop="leader_name"></el-table-column> <td class="numCell">{{ reportItem.production_cost_unit }}</td>
<el-table-column label="检验时间"> </tr>
<template #default="scope"> <tr v-if="sflogexpList.length > 0">
<span v-if="scope.row.last_test_time">{{ scope.row.last_test_time.slice(0,16)}}</span> <td class="numCell" :rowspan="sflogexpList.length + 1">生产情况记录</td>
</template> <td class="numCell">时间</td>
</el-table-column> <td class="numCell">类别</td>
<el-table-column label="操作" fixed="right" align="center" width="150"> <td class="numCell">原因</td>
<template #default="scope"> <td class="numCell">处置措施</td>
<el-button link size="small" @click="sflog_edit(scope.row)" type="primary">编辑</el-button> <td class="numCell">处置人</td>
<el-divider direction="vertical"></el-divider> </tr>
<el-button link size="small" @click="sflog_export(scope.row)" type="success">报表</el-button> <tr v-for="item in sflogexpList" :key="item.id">
</template> <td class="numCell">{{ item.happen_time }}</td>
</el-table-column> <td class="numCell">{{ item.cate }}</td>
</scTable> <td class="numCell">{{ item.reason }}</td>
</el-main> <td class="numCell">{{ item.measure }}</td>
<el-drawer v-model="limitedExport" size="60%" :show-close="false"> <td class="numCell">{{ item.handler }}</td>
<template #header="{ close, titleId, titleClass }"> </tr>
<h4 :id="titleId" :class="titleClass">交接班日志</h4> </tbody>
<el-button type="danger" @click="close"> </table>
<el-icon class="el-icon--left"><CircleCloseFilled /></el-icon>
关闭
</el-button>
</template>
<div class="left-panel">
<el-button
type="primary"
@click="exportExcel()"
:loading = "exportLoading"
>导出xlsx
</el-button>
<el-button
type="primary"
@click="handlePrint"
>打印
</el-button>
</div> </div>
<el-main class="nopadding"> </el-main>
<div ref="print" id="myReport" class="printContainer"> </el-drawer>
<div style="margin-right: 20px;text-align: center;font-size: 16px;font-weight: bold;margin-bottom: 20px;"> </el-container>
<span v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}{{ sflogItem.shift_name }}</span>
<span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span>
交接班记录
</div>
<table border="1" width="1000" cellspacing="0" :key="timeStamp" id="myTable">
<tbody>
<tr>
<td class="numCell">日期</td>
<td class="numCell" v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}</td>
<td class="numCell">班次</td>
<td class="numCell">{{ sflogItem.shift_name }}</td>
<td class="numCell">班组</td>
<td class="numCell"><span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span></td>
</tr>
<tr>
<td class="numCell">产量t</td>
<td class="numCell">{{reportItem.total_production}}</td>
<td class="numCell">单位产品分布电耗KW·h/t</td>
<td class="numCell">{{reportItem.elec_consume_unit}}</td>
<td class="numCell">单位成本/</td>
<td class="numCell">{{reportItem.production_cost_unit}}</td>
</tr>
<tr v-if="sflogexpList.length>0">
<td class="numCell" :rowspan="sflogexpList.length+1">生产情况记录</td>
<td class="numCell">时间</td>
<td class="numCell">类别</td>
<td class="numCell">原因</td>
<td class="numCell">处置措施</td>
<td class="numCell">处置人</td>
</tr>
<tr v-for="item in sflogexpList" :key="item.id">
<td class="numCell">{{ item.happen_time}}</td>
<td class="numCell">{{ item.cate}}</td>
<td class="numCell">{{ item.reason}}</td>
<td class="numCell">{{ item.measure}}</td>
<td class="numCell">{{ item.handler}}</td>
</tr>
</tbody>
</table>
</div>
</el-main>
</el-drawer>
</el-container>
</template> </template>
<script> <script>
export default { export default {
name: "sflog", name: "sflog",
data() { data() {
return { return {
apiObj: this.$API.wpm.sflog.list, apiObj: this.$API.wpm.sflog.list,
apiObj2: null, apiObj2: null,
query: {
mgroup: '3346491835287007232',
},
deptId: '3345780809943797760',
sflogItem: {},
options: [],
optionsShift: [],
limitedExport: false,
reportItem: {},
sflogexpList: [],
};
},
mounted() {
this.getTeam();
this.getShfit();
},
methods: {
getTeam() {
let form = {};
form.page = 0;
form.belong_dept = this.deptId;
this.$API.mtm.team.list.req(form).then(res => {
this.options = res;
})
},
getShfit() {
this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
this.optionsShift = res;
})
},
handleQuery() {
this.$refs.table.queryData(this.query);
},
sflog_export() {
this.limitedExport = true;
},
rowClick(row) {
this.sflogId = row.id;
this.sflogItem = row;
this.getSflogItem(row.id);
this.getSflogexp(row.id);
},
getSflogexp(id) {
let that = this;
that.$API.wpm.sflogexp.list.req({ page: 0, sflog: id }).then(res => {
that.sflogexpList = res;
})
},
getSflogItem(id) {
let that = this;
that.$API.enm.enstat.req({ type: 'sflog', sflog: id, page: 0 }).then(res => {
if (res.length > 0) {
that.reportItem = res[0];
}
console.log(res[0])
})
},
//
sflog_edit(row) {
let jsonStr = JSON.stringify(row);
this.$TOOL.data.remove("sflogItem")
this.$TOOL.data.set('sflogItem', jsonStr)
this.$router.push({
name: "logDetail",
query: { query: {
mgroup:'3346491835287007232', mgroupId: row.mgroup,
deptId: this.deptId
}, },
deptId:'3345780809943797760', });
sflogItem:{},
options:[],
optionsShift:[],
limitedExport:false,
reportItem:{},
sflogexpList:[],
};
}, },
mounted(){ handlePrint() {
this.getTeam(); this.$PRINT('#myReport');
this.getShfit();
},
methods: {
getTeam(){
let form ={};
form.page = 0;
form.belong_dept = this.deptId;
this.$API.mtm.team.list.req(form).then(res=>{
this.options = res;
})
},
getShfit(){
this.$API.mtm.shift.req({page:0}).then(res=>{
this.optionsShift = res;
})
},
handleQuery(){
this.$refs.table.queryData(this.query);
},
sflog_export(){
this.limitedExport = true;
},
rowClick(row) {
this.sflogId = row.id;
this.sflogItem = row;
this.getSflogItem(row.id);
this.getSflogexp(row.id);
},
getSflogexp(id){
let that = this;
that.$API.wpm.sflogexp.list.req({page:0,sflog:id}).then(res=>{
that.sflogexpList = res;
})
},
getSflogItem(id){
let that =this;
that.$API.enm.enstat.req({type:'sflog',sflog:id,page:0}).then(res=>{
if(res.length>0){
that.reportItem = res[0];
}
console.log(res[0])
})
},
//
sflog_edit(row) {
let jsonStr = JSON.stringify(row);
this.$TOOL.data.remove("sflogItem")
this.$TOOL.data.set('sflogItem',jsonStr)
this.$router.push({
name: "logDetail",
query: {
mgroupId: row.mgroup,
deptId:this.deptId
},
});
},
handlePrint() {
this.$PRINT('#myReport');
},
exportExcel() {
this.exportLoading = true;
this.$XLSX('#myTable', this.tableName)
this.exportLoading = false;
},
}, },
}; exportExcel() {
</script> this.exportLoading = true;
this.$XLSX('#myTable', this.tableName)
this.exportLoading = false;
},
},
};
</script>
<style scoped> <style scoped>
#numTable{ #numTable {
margin-left: 37px; margin-left: 37px;
} }
#numTable td{
height: 32px; #numTable td {
padding-left: 5px; height: 32px;
} padding-left: 5px;
.numCell{ }
width: 80px;
} .numCell {
.numCell.numCell_last{ width: 80px;
width: 100px; }
}
.searchHead{ .numCell.numCell_last {
display:flex width: 100px;
} }
.middleText{
height: 32px; .searchHead {
line-height: 32px; display: flex
margin: 0 5px; }
display: inline-block;
} .middleText {
.searchBtn{ height: 32px;
margin-left: 5px; line-height: 32px;
} margin: 0 5px;
</style> display: inline-block;
}
.searchBtn {
margin-left: 5px;
}
</style>

View File

@ -1,32 +1,13 @@
<template> <template>
<el-drawer <el-drawer :title="titleMap[mode]" v-model="visible" :size="1000" destroy-on-close @closed="closeDrawer">
:title="titleMap[mode]"
v-model="visible"
:size="1000"
destroy-on-close
@closed="closeDrawer"
>
<el-container v-loading="loading"> <el-container v-loading="loading">
<el-main style="padding: 0 20px 20px 20px"> <el-main style="padding: 0 20px 20px 20px">
<el-form <el-form ref="dialogForm" :model="form" :rules="rules" :disabled="mode === 'show'" label-width="120px">
ref="dialogForm"
:model="form"
:rules="rules"
:disabled="mode==='show'"
label-width="120px"
>
<el-row> <el-row>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="所属部门"> <el-form-item label="所属部门">
<el-select <el-select v-model="belongDept" clearable style="width:100%" @change="getTeam">
v-model="belongDept" <el-option v-for="item in deptOptions" :key="item.id" :label="item.name"
clearable
style="width:100%"
@change="getTeam"
>
<el-option v-for="item in deptOptions"
:key="item.id"
:label="item.name"
:value="item.id"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
@ -34,49 +15,25 @@
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="班次"> <el-form-item label="班次">
<el-select <el-select v-model="form.shift" placeholder="班次" clearable style="width:100%">
v-model="form.shift" <el-option v-for="item in shiftOptions" :key="item.id" :label="item.name"
placeholder="班次" :value="item.id"></el-option>
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-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="班组"> <el-form-item label="班组">
<el-select <el-select v-model="form.team" placeholder="班组" clearable style="width:100%"
v-model="form.team" @change="getuser">
placeholder="班组" <el-option v-for="item in teamOptions" :key="item.id" :label="item.name"
clearable :value="item.id"></el-option>
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-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="工作日期"> <el-form-item label="工作日期">
<el-date-picker <el-date-picker v-model="form.work_date" type="date" placeholder="工作日期" format="YYYY-MM-DD"
v-model="form.work_date" value-format="YYYY-MM-DD" style="width:100%" />
type="date"
placeholder="工作日期"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
style="width:100%"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :md="12" :sm="24"> <!-- <el-col :md="12" :sm="24">
@ -86,36 +43,21 @@
</el-col> --> </el-col> -->
</el-row> </el-row>
</el-form> </el-form>
<sc-form-table <sc-form-table v-model="userList" :addTemplate="addTemplate" placeholder="暂无数据">
v-model="userList"
:addTemplate="addTemplate"
placeholder="暂无数据"
>
<el-table-column prop="user_name" label="姓名"></el-table-column> <el-table-column prop="user_name" label="姓名"></el-table-column>
<el-table-column prop="mgroup_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="post_name" label="岗位"></el-table-column>
<el-table-column prop="type" label="到岗状态"> <el-table-column prop="type" label="到岗状态">
<template #default="scope"> <template #default="scope">
<el-select <el-select v-model="scope.row.state" filterable placeholder="到岗状态">
v-model="scope.row.state" <el-option v-for="item in stateOptions" :key="item.id" :label="item.label"
filterable :value="item.id"></el-option>
placeholder="到岗状态" </el-select>
>
<el-option
v-for="item in stateOptions"
:key="item.id"
:label="item.label"
:value="item.id"
></el-option>
</el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="note" label="备注"> <el-table-column prop="note" label="备注">
<template #default="scope"> <template #default="scope">
<el-input <el-input v-model="scope.row.note" placeholder="请输入内容"></el-input>
v-model="scope.row.note"
placeholder="请输入内容"
></el-input>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="open" label="操作" width="80" align="center"> <!-- <el-table-column prop="open" label="操作" width="80" align="center">
@ -129,9 +71,9 @@
> >
</template> </template>
</el-table-column> --> </el-table-column> -->
</sc-form-table> </sc-form-table>
</el-main> </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 type="primary" :loading="isSaveing" @click="submit">保存</el-button>
<el-button @click="visible = false">取消</el-button> <el-button @click="visible = false">取消</el-button>
</el-footer> </el-footer>
@ -139,152 +81,151 @@
</el-drawer> </el-drawer>
</template> </template>
<script> <script>
const defaultForm = { const defaultForm = {
list:[], list: [],
}; };
export default { export default {
emits: ["success", "closed"], emits: ["success", "closed"],
data() { data() {
return { return {
belongDept:'', belongDept: '',
loading: false, loading: false,
mode: "add", mode: "add",
titleMap: { titleMap: {
add: '新增记录', add: '新增记录',
edit: '编辑记录', edit: '编辑记录',
show: '查看记录' show: '查看记录'
}, },
stateOptions:[ stateOptions: [
{label: "待定", id: "pending"}, { label: "待定", id: "pending" },
{label: "正常", id: "normal"}, { label: "正常", id: "normal" },
{label: "迟到", id: "late"}, { label: "迟到", id: "late" },
{label: "早退", id: "early_leave"}, { label: "早退", id: "early_leave" },
{label: "未到岗", id: "absent"}, { label: "未到岗", id: "absent" },
{label: "请假", id: "leave"}, { label: "请假", id: "leave" },
], ],
visible: false, visible: false,
isSaveing: false, isSaveing: false,
form: defaultForm, form: defaultForm,
userList:[], userList: [],
teamOptions:[], teamOptions: [],
deptOptions: ['6车间','7车间','8车间','10车间'], deptOptions: ['6车间', '7车间', '8车间', '10车间'],
shiftOptions:[], shiftOptions: [],
selectionFilters: [], selectionFilters: [],
setFiltersVisible: false, setFiltersVisible: false,
}; };
}, },
mounted() { mounted() {
this.getShiftOptions(); this.getShiftOptions();
}, },
methods: { methods: {
getShiftOptions() { 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 = []; let data = [];
res.forEach(item => { res.forEach(item => {
if(item.parent=='3423856735881117696'){ if (item.parent == '3423856735881117696') {
data.push(item) data.push(item)
}
});
this.deptOptions = data;
});
this.$API.mtm.shift.req({page:0}).then(res=>{
this.shiftOptions = res;
})
},
getTeam(){
//team
this.$API.mtm.team.list.req({page:0,belong_dept:this.belongDept}).then(res=>{
this.teamOptions = res;
})
},
getuser(){
this.$API.mtm.teammember.list.req({team:this.form.team,page:0}).then(res=>{
this.userList = [];
res.forEach(item=>{
let obj =item;
obj.state = 'normal';
obj.note = '';
this.userList.push(obj)
})
})
},
//
open(mode) {
this.mode = mode;
this.visible = true;
return this;
},
closeDrawer() {
this.visible = false;
this.$emit('closed');
},
//
submit() {
this.$refs.dialogForm.validate((valid) => {
if (valid) {
this.isSaveing = true;
let arr = [];
this.userList.forEach(item=>{
let obj = {};
obj.team = this.form.team;
obj.shift = this.form.shift;
obj.work_date = this.form.work_date;
obj.user = item.user;
obj.state = item.state;
obj.note = item.note;
obj.post = item.post;
arr.push(obj)
})
if (this.mode === 'add') {
this.$API.hrm.attendance.create.req(arr)
.then(res => {
this.isSaveing = false;
this.visible = false;
this.$emit("success");
this.$message.success("操作成功");
return res
}).catch(err => {
this.isSaveing = false;
return err
})
} else {
this.$API.hrm.attendance.update.req(this.form.id, this.form)
.then(res => {
this.isSaveing = false;
this.visible = false;
this.$emit("success", this.form, this.mode);
this.$message.success("操作成功");
return res
}).catch(err => {
this.isSaveing = false;
return err
})
}
} }
}); });
}, this.deptOptions = data;
// });
setData(data) { this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
//debugger; this.shiftOptions = res;
// console.log(defaultForm); })
// this.form = defaultForm;
this.loading = true;
this.$API.hrm.employee.item.req(data.id).then(res=>{
this.loading = false;
this.form = res
}).catch(e=>{this.loading = false;})
// Object.assign(this.form, data);
},
//
setFilters(filters) {
this.selectionFilters = filters;
this.setFiltersVisible = true;
},
}, },
}; getTeam() {
//team
this.$API.mtm.team.list.req({ page: 0, belong_dept: this.belongDept }).then(res => {
this.teamOptions = res;
})
},
getuser() {
this.$API.mtm.teammember.list.req({ team: this.form.team, page: 0 }).then(res => {
this.userList = [];
res.forEach(item => {
let obj = item;
obj.state = 'normal';
obj.note = '';
this.userList.push(obj)
})
})
},
//
open(mode) {
this.mode = mode;
this.visible = true;
return this;
},
closeDrawer() {
this.visible = false;
this.$emit('closed');
},
//
submit() {
this.$refs.dialogForm.validate((valid) => {
if (valid) {
this.isSaveing = true;
let arr = [];
this.userList.forEach(item => {
let obj = {};
obj.team = this.form.team;
obj.shift = this.form.shift;
obj.work_date = this.form.work_date;
obj.user = item.user;
obj.state = item.state;
obj.note = item.note;
obj.post = item.post;
arr.push(obj)
})
if (this.mode === 'add') {
this.$API.hrm.attendance.create.req(arr)
.then(res => {
this.isSaveing = false;
this.visible = false;
this.$emit("success");
this.$message.success("操作成功");
return res
}).catch(err => {
this.isSaveing = false;
return err
})
} else {
this.$API.hrm.attendance.update.req(this.form.id, this.form)
.then(res => {
this.isSaveing = false;
this.visible = false;
this.$emit("success", this.form, this.mode);
this.$message.success("操作成功");
return res
}).catch(err => {
this.isSaveing = false;
return err
})
}
}
});
},
//
setData(data) {
//debugger;
// console.log(defaultForm);
// this.form = defaultForm;
this.loading = true;
this.$API.hrm.employee.item.req(data.id).then(res => {
this.loading = false;
this.form = res
}).catch(e => { this.loading = false; })
// Object.assign(this.form, data);
},
//
setFilters(filters) {
this.selectionFilters = filters;
this.setFiltersVisible = true;
},
},
};
</script> </script>
<style> <style></style>
</style>

View File

@ -19,6 +19,13 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="所属部门" prop="belong_dept_name" min-width="150"></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="sort" min-width="80"></el-table-column>
<el-table-column label="创建时间" prop="create_time" min-width="150"></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"> <el-table-column label="操作" fixed="right" align="center" width="180">
@ -36,11 +43,7 @@
</scTable> </scTable>
</el-main> </el-main>
</el-container> </el-container>
<save-dialog <save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save = false">
v-if="dialog.save"
ref="saveDialog"
@success="handleSaveSuccess"
@closed="dialog.save = false">
</save-dialog> </save-dialog>
</template> </template>
<script> <script>

View File

@ -12,16 +12,24 @@
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </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-form-item label="所属部门">
<el-select v-model="form.belong_dept" placeholder="所属部门" clearable style="width: 100%;"> <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-option v-for="item in group" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </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-form-item label="排序">
<el-input-number v-model="form.sort" :min="1" /> <el-input-number v-model="form.sort" :min="1" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<sc-form-table ref="table" v-model="materialList" :addTemplate="addTemplate" placeholder="暂无数据"> <sc-form-table ref="table" v-model="materialList" :addTemplate="addTemplate" placeholder="暂无数据">
<el-table-column prop="type" label="输入物料" min-width="120" align="center"> <el-table-column prop="type" label="输入物料" min-width="120" align="center">
<template #default="scope"> <template #default="scope">
<el-select v-model="scope.row.material_in" style="width: 100%"> <el-select v-model="scope.row.material_in" style="width: 100%">
@ -31,19 +39,20 @@
</el-table-column> </el-table-column>
<el-table-column prop="type" label="输出物料" min-width="120" align="center"> <el-table-column prop="type" label="输出物料" min-width="120" align="center">
<template #default="scope"> <template #default="scope">
<el-select v-model="scope.row.material_out" filterable style="width: 100%" > <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-option v-for="item in materials" :key="item" :label="item" :value="item"></el-option>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="type" label="操作" min-width="80" align="center"> <el-table-column prop="type" label="操作" min-width="80" align="center">
<template #default="scope"> <template #default="scope">
<el-button type="primary" v-if="scope.row.isedit" @click="submitForm(scope.row,scope.$index)">确定</el-button> <el-button type="primary" v-if="scope.row.isedit"
<el-button type="warning" v-else @click="editForm(scope.row,scope.$index)">编辑</el-button> @click="submitForm(scope.row, scope.$index)">确定</el-button>
<el-button type="danger" @click="delForm(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> </template>
</el-table-column> </el-table-column>
</sc-form-table> </sc-form-table>
</el-main> </el-main>
<el-footer> <el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button> <el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
@ -74,6 +83,7 @@ export default {
}, },
// //
form: { form: {
shift_rule: ''
}, },
// //
rules: { rules: {
@ -83,16 +93,18 @@ export default {
}, },
visible: false, visible: false,
isSaveing: false, isSaveing: false,
shiftOptions: [],
options: [], options: [],
group: [], group: [],
routes:[], routes: [],
materials: [], materials: [],
setFiltersVisible: false, setFiltersVisible: false,
materialList:[{material_in:'',material_out:'',mgroup:'',isedit:true}], materialList: [{ material_in: '', material_out: '', mgroup: '', isedit: true }],
addTemplate:{material_in:'',material_out:'',mgroup:'',isedit:true} addTemplate: { material_in: '', material_out: '', mgroup: '', isedit: true }
}; };
}, },
mounted() { mounted() {
this.getShifts();
this.getGroup();// this.getGroup();//
this.getProcess();// this.getProcess();//
this.getMaterial();// this.getMaterial();//
@ -110,25 +122,36 @@ export default {
this.options = res; this.options = res;
}); });
}, },
getMaterial(){ getShifts() {
this.$API.mtm.material.list.req({ page: 0,is_hidden:false,type__in:'10,20' }).then(res => { 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; this.materials = res;
}); });
}, },
getRoute(id){ getRoute(id) {
let that = this; 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; that.routes = res;
if(res.length>0){ if (res.length > 0) {
res.forEach(item=>{ res.forEach(item => {
let obj = {}; let obj = {};
obj.material_in=item.material_in; obj.material_in = item.material_in;
obj.material_out=item.material_out; obj.material_out = item.material_out;
obj.mgroup = id; obj.mgroup = id;
obj.isedit=false; obj.isedit = false;
}) })
that.materialList.push(obj); that.materialList.push(obj);
}else{} } else { }
}); });
}, },
// //
@ -142,7 +165,7 @@ export default {
Object.assign(this.form, data); Object.assign(this.form, data);
this.getRoute(data.id); this.getRoute(data.id);
}, },
setMgroup(id){ setMgroup(id) {
this.form.mgroup = id; this.form.mgroup = id;
}, },
getReceptionist(data) { getReceptionist(data) {
@ -156,32 +179,28 @@ export default {
let that = this; let that = this;
that.$refs.dialogForm.validate(async (valid) => { that.$refs.dialogForm.validate(async (valid) => {
if (valid) { if (valid) {
if(this.mode){ that.form.cate = 'photon';
that.form.need_enm = false;
}else{ that.isSaveing = true;
that.form.cate = 'photon'; if (that.mode === 'add') {
that.form.need_enm = false; that.$API.mtm.mgroup.create.req(that.form).then(res => {
that.isSaveing = true; that.isSaveing = false;
if (that.mode === 'add') { that.$emit("success", that.form, that.mode);
that.$API.mtm.mgroup.create.req(that.form).then(res => { that.visible = false;
that.isSaveing = false; that.$message.success("操作成功");
that.$emit("success", that.form, that.mode); })
that.visible = false; } else {
that.$message.success("操作成功"); that.$API.mtm.mgroup.update.req(that.form.id, that.form).then(res => {
}) that.isSaveing = false;
} else { that.$emit("success", that.form, that.mode);
that.$API.mtm.mgroup.update.req(that.form.id, that.form).then(res => { that.visible = false;
that.isSaveing = false; that.$message.success("操作成功");
that.$emit("success", that.form, that.mode); })
that.visible = false;
that.$message.success("操作成功");
})
}
} }
} }
}); });
}, },
submitForm(row,index){ submitForm(row, index) {
let that = this; let that = this;
let obj = {}; let obj = {};
obj.material_in = row.material_in; obj.material_in = row.material_in;
@ -191,18 +210,18 @@ export default {
this.$API.mtm.route.update.req(row.id, obj).then(res => { this.$API.mtm.route.update.req(row.id, obj).then(res => {
that.materialList[index].isedit = false; that.materialList[index].isedit = false;
}) })
} else{ } else {
obj.mgroup = that.form.id; obj.mgroup = that.form.id;
this.$API.mtm.route.create.req(obj).then(res => { this.$API.mtm.route.create.req(obj).then(res => {
that.materialList[index].isedit = false; that.materialList[index].isedit = false;
}) })
} }
}, },
editForm(row,index){ editForm(row, index) {
let that = this; let that = this;
that.materialList[index].isedit = true; that.materialList[index].isedit = true;
}, },
delForm(row,index){ delForm(row, index) {
let that = this; let that = this;
this.$API.mtm.route.delete.req(row.id).then(res => { this.$API.mtm.route.delete.req(row.id).then(res => {
that.getRoute(that.form.id); that.getRoute(that.form.id);

View File

@ -3,105 +3,40 @@
<div class="app-container"> <div class="app-container">
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-select <el-select v-model="query.mgroup" placeholder="工段" clearable @change="mgroupChange" class="headerSearch">
v-model="query.mgroup" <el-option v-for="item in mgroupOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
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>
<el-select <el-select v-model="query.type" placeholder="查询类型" clearable class="headerSearch" @change="typeCange">
v-model="query.type" <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
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-select>
<el-date-picker <el-date-picker v-model="query.day" type="date" value-format="YYYY-MM-DD" format="YYYY-MM-DD"
v-model="query.day" placeholder="日" class="headerSearch" v-if="query.type == 0" />
type="date"
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
placeholder="日"
class="headerSearch"
v-if="query.type==0"
/>
<!-- 选择班次 --> <!-- 选择班次 -->
<el-select <el-select v-if="query.type == 0" v-model="query.shift" placeholder="班次" clearable class="headerSearch">
v-if="query.type==0" <el-option v-for="item in optionsShift" :key="item.id" :label="item.name" :value="item.id"></el-option>
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-select>
<el-date-picker <el-date-picker v-model="query.month" type="month" value-format="YYYY-MM" format="YYYY-MM" placeholder="月份"
v-model="query.month" class="headerSearch" v-if="query.type == 1" />
type="month" <el-date-picker v-model="query.year" type="year" value-format="YYYY" format="YYYY" placeholder="年份"
value-format="YYYY-MM" class="headerSearch" v-if="query.type == 2" />
format="YYYY-MM" <el-button type="primary" icon="el-icon-search" @click="getTableData"></el-button>
placeholder="月份" <el-button type="primary" @click="exportExcel()" :loading="exportLoading">导出xlsx
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>
<el-button <el-button type="primary" @click="handlePrint">打印
type="primary"
@click="handlePrint"
>打印
</el-button> </el-button>
</div> </div>
</el-header> </el-header>
<el-card style="margin-top:5px"> <el-card style="margin-top:5px">
<div ref="print" id="myReport" class="printContainer"> <div ref="print" id="myReport" class="printContainer">
<table border="1" cellspacing="0" :key="timeStamp" id="myTable" class="myTable"> <table border="1" cellspacing="0" :key="timeStamp" id="myTable" class="myTable">
<thead class="myTableHead"> <thead class="myTableHead">
<tr> <tr>
<th :colspan="allCol">{{tableName}}</th> <th :colspan="allCol">{{ tableName }}</th>
</tr> </tr>
<tr> <tr>
<th rowspan="3">日期</th> <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">实际产量t</th>
<th rowspan="3">总成本</th> <th rowspan="3">总成本</th>
<th rowspan="3">单位成本/</th> <th rowspan="3">单位成本/</th>
@ -110,9 +45,9 @@
<th colspan="8">制造费用</th> <th colspan="8">制造费用</th>
</tr> </tr>
<tr> <tr>
<th v-if="data1>0" :colspan="data1">原材料</th> <th v-if="data1 > 0" :colspan="data1">原材料</th>
<th v-if="data3>0" :colspan="data3">辅助材料</th> <th v-if="data3 > 0" :colspan="data3">辅助材料</th>
<th v-if="data2>0" :colspan="data2">/</th> <th v-if="data2 > 0" :colspan="data2">/</th>
<th>车间人员工资</th> <th>车间人员工资</th>
<th>劳务工资</th> <th>劳务工资</th>
<th>倒运费用</th> <th>倒运费用</th>
@ -124,7 +59,7 @@
<th>摊销</th> <th>摊销</th>
</tr> </tr>
<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> <th>单位成本/</th>
<th>单位成本/</th> <th>单位成本/</th>
@ -137,62 +72,62 @@
<th>无形资产摊销单位成本/</th> <th>无形资产摊销单位成本/</th>
</tr> </tr>
</thead> </thead>
<tr v-for="(item,index) in tableData1" :key="index"> <tr v-for="(item, index) in tableData1" :key="index">
<td class="tableCell" v-for="(item1,index1) in item" :key="index1">{{ item1 }}</td> <td class="tableCell" v-for="(item1, index1) in item" :key="index1">{{ item1 }}</td>
</tr> </tr>
</table> </table>
</div> </div>
</el-card> </el-card>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
query:{ query: {
type:1, type: 1,
day:'', day: '',
month:'', month: '',
year:'', year: '',
shift:'', shift: '',
}, },
allCol:16, allCol: 16,
data1:0,// data1: 0,//
data2:0,// data2: 0,//
data3:0,// data3: 0,//
data4:0,// data4: 0,//
data5:0,// data5: 0,//
materialList:[], materialList: [],
mgroupOptions:[], mgroupOptions: [],
tableName:'班组成本计算', tableName: '班组成本计算',
options:[ options: [
{id:0,name:'班统计'}, { id: 0, name: '班统计' },
{id:1,name:'日统计'}, { id: 1, name: '日统计' },
{id:2,name:'月统计'}, { id: 2, name: '月统计' },
], ],
tableNmae:'', tableNmae: '',
tableData1:[], tableData1: [],
optionsShift:[], optionsShift: [],
sourceData:{} sourceData: {}
}; };
}, },
mounted() { mounted() {
var myDate = new Date(); var myDate = new Date();
let month = myDate.getMonth()+1; let month = myDate.getMonth() + 1;
if(month<10){ if (month < 10) {
month = '0'+month; month = '0' + month;
} }
this.query.month = myDate.getFullYear()+'-'+month; this.query.month = myDate.getFullYear() + '-' + month;
this.getShift(); this.getShift();
this.getMgroup(); this.getMgroup();
}, },
methods: { methods: {
// //
getMgroup(){ getMgroup() {
this.$API.mtm.mgroup.list.req({page:0}).then(res=>{ this.$API.mtm.mgroup.list.req({ page: 0 }).then(res => {
res.forEach(item=>{ res.forEach(item => {
if(item.name!=='煤磨'&&item.name!=='水泥包装'){ if (item.name !== '煤磨' && item.name !== '水泥包装') {
this.mgroupOptions.push(item); this.mgroupOptions.push(item);
} }
}) })
@ -200,138 +135,137 @@
this.query.mgroup = this.mgroupOptions[0].id; this.query.mgroup = this.mgroupOptions[0].id;
this.tableName = '电石渣干粉核算' this.tableName = '电石渣干粉核算'
}) })
}, },
// //
getShift(){ getShift() {
this.$API.mtm.shift.req({page:0}).then(res=>{ this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
this.optionsShift = res; this.optionsShift = res;
}) })
}, },
mgroupChange(value){ mgroupChange(value) {
let arr = this.mgroupOptions.filter(item=>{ let arr = this.mgroupOptions.filter(item => {
return item.id==value return item.id == value
}) })
let name = arr[0].name; let name = arr[0].name;
if(name=='电石渣'){ if (name == '电石渣') {
this.tableName = '电石渣干粉核算' this.tableName = '电石渣干粉核算'
}else if(name=='原料磨'){ } else if (name == '原料磨') {
this.tableName = '生料核算' this.tableName = '生料核算'
}else if(name=='回转窑'){ } else if (name == '回转窑') {
this.tableName = '熟料核算' this.tableName = '熟料核算'
}else if(name=='水泥磨'){ } else if (name == '水泥磨') {
this.tableName = '水泥核算' this.tableName = '水泥核算'
} }
}, },
// //
typeCange(value){ typeCange(value) {
if(value==1){ if (value == 1) {
this.tableName = '班组成本计算' this.tableName = '班组成本计算'
}else if(value==1){ } else if (value == 1) {
this.tableName = '日成本计算' this.tableName = '日成本计算'
}else{ } else {
this.tableName = '月成本计算' this.tableName = '月成本计算'
}
},
getData() {
let that = this;
that.data1 = 0;
that.data2 = 0;
that.data3 = 0;
that.data4 = 0;
that.data5 = 0;
let params = {};
let arr = [];
params.page = 0;
params.mgroup = that.query.mgroup;
if (that.query.type == 0) {//
arr = that.query.day.split('-');
params.year_s = Number(arr[0]);
params.month_s = Number(arr[1]);
params.day_s = Number(arr[2]);
params.type = "day_s"
} else if (that.query.type == 1) {//
arr = that.query.month.split('-');
params.year_s = Number(arr[0]);
params.month_s = Number(arr[1]);
params.type = "day_s"
} else {//
params.year_s = Number(that.query.year);
params.type = "month_s"
}
that.$API.enm.enstat.req(params).then(res => {
if (res.length > 0) {
let materials = res[0].imaterial_data;
let arr = [];
materials.forEach(item => {
if (item.material_type == 0) {//
that.data2 = that.data2 + 4;
} else if (item.material_type == 30 || item.material_type == 20) {//
that.data1 = that.data1 + 4;
} else if (item.material_type == 40) {//
that.data3 = that.data3 + 4;
}
arr.push(item.material_name)
arr.push('单价(元/吨)')
arr.push('总成本(元)')
arr.push('单位成本(元/吨)')
})
that.allCol = arr.length + 16
that.materialList = arr;
let dataArr = [];
res.forEach(itemData => {
let time = '';
dataArr = [];
if (that.query.type == 0) {
time = itemData.year_s + '.' + itemData.month_s + '.' + itemData.day_s;
} else if (that.query.type == 1) {
time = itemData.year_s + '.' + itemData.month_s + '.' + itemData.day_s;
} else {
time = itemData.year_s + '.' + itemData.month_s;
}
dataArr.push(time);
if (that.query.type == 0) {
dataArr.push(itemData.shift);
dataArr.push(itemData.team_name);
}
dataArr.push(itemData.total_production);
dataArr.push(itemData.coal_consume_unit);
dataArr.push(itemData.cen_consume_unit);
let sub1data = itemData.imaterial_data;
for (let i = 0; i < sub1data.length; i++) {
dataArr.push(sub1data[i].cost)
dataArr.push(sub1data[i].price_unit)
dataArr.push(sub1data[i].amount_consume)
dataArr.push(sub1data[i].cost_unit)
}
let otherdata = itemData.other_cost_data;
for (let j = 0; j < otherdata.length; j++) {
dataArr.push(otherdata[j].cost_unit)
}
that.tableData1.push(dataArr)
})
} }
}, })
getData(){ },
let that = this; getTableData() {
that.data1 = 0; this.getData();
that.data2 = 0; },
that.data3 = 0;
that.data4 = 0;
that.data5 = 0;
let params = {};
let arr = [];
params.page=0;
params.mgroup=that.query.mgroup;
if(that.query.type==0){//
arr = that.query.day.split('-');
params.year_s = Number(arr[0]);
params.month_s = Number(arr[1]);
params.day_s = Number(arr[2]);
params.type="day_s"
}else if(that.query.type==1){//
arr = that.query.month.split('-');
params.year_s = Number(arr[0]);
params.month_s = Number(arr[1]);
params.type="day_s"
}else{//
params.year_s = Number(that.query.year);
params.type="month_s"
}
that.$API.enm.enstat.req(params).then(res=>{
if(res.length>0){
let materials = res[0].imaterial_data;
let arr = [];
materials.forEach(item=>{
if(item.material_type==0){//
that.data2=that.data2+4;
}else if(item.material_type==30||item.material_type==20){//
that.data1=that.data1+4;
}else if(item.material_type==40){//
that.data3=that.data3+4;
}
arr.push(item.material_name)
arr.push('单价(元/吨)')
arr.push('总成本(元)')
arr.push('单位成本(元/吨)')
})
that.allCol = arr.length+16
that.materialList = arr;
let dataArr = [];
res.forEach(itemData=>{
let time ='';
dataArr = [];
if(that.query.type==0){
time = itemData.year_s+'.'+itemData.month_s+'.'+itemData.day_s;
}else if(that.query.type==1){
time = itemData.year_s+'.'+itemData.month_s+'.'+itemData.day_s;
}else{
time = itemData.year_s+'.'+itemData.month_s;
}
dataArr.push(time);
if(that.query.type==0){
dataArr.push(itemData.shift);
dataArr.push(itemData.team_name);
}
dataArr.push(itemData.total_production);
dataArr.push(itemData.coal_consume_unit);
dataArr.push(itemData.cen_consume_unit);
let sub1data = itemData.imaterial_data;
for(let i=0;i<sub1data.length;i++){
dataArr.push(sub1data[i].cost)
dataArr.push(sub1data[i].price_unit)
dataArr.push(sub1data[i].amount_consume)
dataArr.push(sub1data[i].cost_unit)
}
let otherdata = itemData.other_cost_data;
for(let j=0;j<otherdata.length;j++){
dataArr.push(otherdata[j].cost_unit)
}
that.tableData1.push(dataArr)
})
}
})
},
getTableData(){
this.getData();
},
handlePrint() { handlePrint() {
this.$PRINT('#myReport'); this.$PRINT('#myReport');
}, },
exportExcel() { exportExcel() {
this.exportLoading = true; this.exportLoading = true;
this.$XLSX('#myTable', this.tableName) this.$XLSX('#myTable', this.tableName)
this.exportLoading = false; this.exportLoading = false;
}, },
} }
}; };
</script> </script>
<style scoped> <style scoped>
.printContainer{ .printContainer {
width:100%; width: 100%;
overflow-x:scroll; overflow-x: scroll;
} }
</style> </style>

View File

@ -4,105 +4,71 @@
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<div style="margin-right: 20px">质量检验</div> <div style="margin-right: 20px">质量检验</div>
<el-date-picker <el-date-picker v-model="query.start_time__gte" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
v-model="query.start_time__gte" format="YYYY-MM-DD HH:mm:ss" placeholder="开始时间" />
type="datetime" <el-date-picker v-model="query.end_time__day" type="date" value-format="YYYY-MM-DD" format="YYYY-MM-DD"
value-format="YYYY-MM-DD HH:mm:ss" placeholder="结束时间" />
format="YYYY-MM-DD HH:mm:ss" <el-select v-model="query.shift" placeholder="班次" clearable style="margin-left: 2px; width: 120px">
placeholder="开始时间" <el-option v-for="item in optionsShift" :key="item.id" :label="item.name" :value="item.id"></el-option>
/>
<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>
<el-select <el-select v-model="query.team" placeholder="班组" clearable style="margin-left: 2px; width: 120px">
v-model="query.team" <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id"></el-option>
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-select>
<el-button <el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div> </div>
</el-header> </el-header>
<el-main> <el-main>
<el-row gutter="6"> <el-row gutter="6">
<el-col :span="12"><el-card style="height: 300px;"></el-card></el-col> <el-col :span="12"><el-card style="height: 300px;"></el-card></el-col>
<el-col :span="12"><el-card style="height: 300px;"></el-card></el-col> <el-col :span="12"><el-card style="height: 300px;"></el-card></el-col>
<el-col :span="12"><el-card style="height: 300px;"></el-card></el-col> <el-col :span="12"><el-card style="height: 300px;"></el-card></el-col>
<el-col :span="12"><el-card style="height: 300px;"></el-card></el-col> <el-col :span="12"><el-card style="height: 300px;"></el-card></el-col>
</el-row> </el-row>
</el-main> </el-main>
</el-container> </el-container>
</template> </template>
<script> <script>
export default { export default {
name: "listSon", name: "listSon",
data() { data() {
return { return {
query: { query: {
mgroup:'3346520558031773696', mgroup: '3346520558031773696',
}, },
options:[], options: [],
optionsShift:[], optionsShift: [],
}; };
}, },
mounted(){ mounted() {
this.getTeam(); this.getTeam();
this.getShift(); this.getShift();
}, },
methods: { methods: {
getTeam(){ getTeam() {
this.$API.mtm.team.list.req({page:0}).then(res=>{ this.$API.mtm.team.list.req({ page: 0 }).then(res => {
this.options = res; this.options = res;
}) })
}, },
getShift(){ getShift() {
this.$API.mtm.shift.req({page:0}).then(res=>{ this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
this.optionsShift = res; this.optionsShift = res;
}) })
}, },
// //
sflog_check(row){ sflog_check(row) {
this.dialog.check = true; this.dialog.check = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.checkDialog.open("edit").setData(row); this.$refs.checkDialog.open("edit").setData(row);
}); });
}, },
handleQuery(){ handleQuery() {
this.$API.wpm.sflog.list.req(this.query).then(res=>{ this.$API.wpm.sflog.list.req(this.query).then(res => {
debugger; debugger;
console.log(res) console.log(res)
}) })
}, },
}, },
}; };
</script> </script>

File diff suppressed because it is too large Load Diff