feat: mgroup增加排班规则字段

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

View File

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

View File

@ -3,74 +3,30 @@
<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"
row-key="id"
stripe
:params="query"
highlightCurrentRow
@row-click="rowClick"
>
<el-table-column type="index" width="50"/>
<el-table-column label="开始时间" prop="start_time"> <el-table-column label="开始时间" prop="start_time">
<template #default="scope"> <template #default="scope">
<span>{{ scope.row.start_time.slice(0,16)}}</span> <span>{{ scope.row.start_time.slice(0, 16) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="结束时间" prop="end_time"> <el-table-column label="结束时间" prop="end_time">
<template #default="scope"> <template #default="scope">
<span>{{ scope.row.end_time.slice(0,16)}}</span> <span>{{ scope.row.end_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="班组名称" prop="team_name"></el-table-column>
@ -79,7 +35,7 @@
<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">
@ -97,27 +53,22 @@
<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"
@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-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> </div>
@ -125,7 +76,7 @@
<tbody> <tbody>
<tr> <tr>
<td class="numCell">日期</td> <td class="numCell">日期</td>
<td class="numCell" v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}</td> <td class="numCell" v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}</td>
<td class="numCell">班次</td> <td class="numCell">班次</td>
<td class="numCell">{{ sflogItem.shift_name }}</td> <td class="numCell">{{ sflogItem.shift_name }}</td>
<td class="numCell">班组</td> <td class="numCell">班组</td>
@ -133,30 +84,30 @@
</tr> </tr>
<tr> <tr>
<td class="numCell">产量t</td> <td class="numCell">产量t</td>
<td class="numCell">{{reportItem.total_production}}</td> <td class="numCell">{{ reportItem.total_production }}</td>
<td class="numCell">台时t/h</td> <td class="numCell">台时t/h</td>
<td class="numCell">{{reportItem.production_hour}}</td> <td class="numCell">{{ reportItem.production_hour }}</td>
<td class="numCell">运转时间h</td> <td class="numCell">运转时间h</td>
<td class="numCell">{{reportItem.run_hour}}</td> <td class="numCell">{{ reportItem.run_hour }}</td>
</tr> </tr>
<tr> <tr>
<td class="numCell">运转率%</td> <td class="numCell">运转率%</td>
<td class="numCell">{{reportItem.run_rate*100}}</td> <td class="numCell">{{ reportItem.run_rate * 100 }}</td>
<td class="numCell">停机时长h</td> <td class="numCell">停机时长h</td>
<td class="numCell">{{reportItem.shut_hour}}</td> <td class="numCell">{{ reportItem.shut_hour }}</td>
<td class="numCell">煤磨分布电耗KW·h/t</td> <td class="numCell">煤磨分布电耗KW·h/t</td>
<td class="numCell">{{reportItem.elec_consume_unit}}</td> <td class="numCell">{{ reportItem.elec_consume_unit }}</td>
</tr> </tr>
<tr> <tr>
<td class="numCell">煤粉细度合格率%</td> <td class="numCell">煤粉细度合格率%</td>
<td class="numCell" v-if="reportItem.煤粉_细度_rate_pass">{{reportItem.煤粉_细度_rate_pass*100}}</td> <td class="numCell" v-if="reportItem.煤粉_细度_rate_pass">{{ reportItem.煤粉_细度_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td> <td class="numCell" v-else>0</td>
<td class="numCell">煤粉水分合格率%</td> <td class="numCell">煤粉水分合格率%</td>
<td class="numCell" v-if="reportItem.煤粉_水分_rate_pass">{{reportItem.煤粉_水分_rate_pass*100}}</td> <td class="numCell" v-if="reportItem.煤粉_水分_rate_pass">{{ reportItem.煤粉_水分_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td> <td class="numCell" v-else>0</td>
</tr> </tr>
<tr v-if="sflogexpList.length>0"> <tr v-if="sflogexpList.length > 0">
<td class="numCell" :rowspan="sflogexpList.length+1">生产情况记录</td> <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> <td class="numCell">原因</td>
@ -164,11 +115,11 @@
<td class="numCell">处置人</td> <td class="numCell">处置人</td>
</tr> </tr>
<tr v-for="item in sflogexpList" :key="item.id"> <tr v-for="item in sflogexpList" :key="item.id">
<td class="numCell">{{ item.happen_time}}</td> <td class="numCell">{{ item.happen_time }}</td>
<td class="numCell">{{ item.cate}}</td> <td class="numCell">{{ item.cate }}</td>
<td class="numCell">{{ item.reason}}</td> <td class="numCell">{{ item.reason }}</td>
<td class="numCell">{{ item.measure}}</td> <td class="numCell">{{ item.measure }}</td>
<td class="numCell">{{ item.handler}}</td> <td class="numCell">{{ item.handler }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -178,50 +129,50 @@
</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: { query: {
shift:'', shift: '',
team:'', team: '',
end_time__lt:'', end_time__lt: '',
start_time__gte:'', start_time__gte: '',
mgroup:'3347217512021835776', mgroup: '3347217512021835776',
}, },
deptId :'3347207082608115712', deptId: '3347207082608115712',
sflogItem:{}, sflogItem: {},
options:[], options: [],
optionsShift:[], optionsShift: [],
limitedExport:false, limitedExport: false,
reportItem:{}, reportItem: {},
sflogexpList:[], sflogexpList: [],
}; };
}, },
mounted(){ mounted() {
this.getTeam(); this.getTeam();
this.getShfit(); this.getShfit();
}, },
methods: { methods: {
getTeam(){ getTeam() {
let form ={}; let form = {};
form.page = 0; form.page = 0;
form.belong_dept = this.deptId; form.belong_dept = this.deptId;
this.$API.mtm.team.list.req(form).then(res=>{ this.$API.mtm.team.list.req(form).then(res => {
this.options = res; this.options = res;
}) })
}, },
getShfit(){ getShfit() {
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;
}) })
}, },
handleQuery(){ handleQuery() {
this.$refs.table.queryData(this.query); this.$refs.table.queryData(this.query);
}, },
sflog_export(){ sflog_export() {
this.limitedExport = true; this.limitedExport = true;
}, },
rowClick(row) { rowClick(row) {
@ -230,16 +181,16 @@
this.getSflogItem(row.id); this.getSflogItem(row.id);
this.getSflogexp(row.id); this.getSflogexp(row.id);
}, },
getSflogexp(id){ getSflogexp(id) {
let that = this; let that = this;
that.$API.wpm.sflogexp.list.req({page:0,sflog:id}).then(res=>{ that.$API.wpm.sflogexp.list.req({ page: 0, sflog: id }).then(res => {
that.sflogexpList = res; that.sflogexpList = res;
}) })
}, },
getSflogItem(id){ getSflogItem(id) {
let that =this; let that = this;
that.$API.enm.enstat.req({type:'sflog',sflog:id,page:0}).then(res=>{ that.$API.enm.enstat.req({ type: 'sflog', sflog: id, page: 0 }).then(res => {
if(res.length>0){ if (res.length > 0) {
that.reportItem = res[0]; that.reportItem = res[0];
} }
console.log(res[0]) console.log(res[0])
@ -249,12 +200,12 @@
sflog_edit(row) { sflog_edit(row) {
let jsonStr = JSON.stringify(row); let jsonStr = JSON.stringify(row);
this.$TOOL.data.remove("sflogItem") this.$TOOL.data.remove("sflogItem")
this.$TOOL.data.set('sflogItem',jsonStr) this.$TOOL.data.set('sflogItem', jsonStr)
this.$router.push({ this.$router.push({
name: "logDetail", name: "logDetail",
query: { query: {
mgroupId: row.mgroup, mgroupId: row.mgroup,
deptId:this.deptId deptId: this.deptId
}, },
}); });
}, },
@ -267,34 +218,40 @@
this.exportLoading = false; this.exportLoading = false;
}, },
}, },
}; };
</script> </script>
<style scoped> <style scoped>
#numTable{ #numTable {
margin-left: 37px; margin-left: 37px;
} }
#numTable td{
#numTable td {
height: 32px; height: 32px;
padding-left: 5px; padding-left: 5px;
} }
.numCell{
.numCell {
width: 80px; width: 80px;
} }
.numCell.numCell_last{
.numCell.numCell_last {
width: 100px; width: 100px;
} }
.searchHead{
display:flex .searchHead {
} display: flex
.middleText{ }
.middleText {
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
margin: 0 5px; margin: 0 5px;
display: inline-block; display: inline-block;
} }
.searchBtn{
margin-left: 5px; .searchBtn {
} margin-left: 5px;
</style> }
</style>

View File

@ -3,75 +3,31 @@
<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"
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="mgroup_name"></el-table-column> -->
<el-table-column label="开始时间" prop="start_time"> <el-table-column label="开始时间" prop="start_time">
<template #default="scope"> <template #default="scope">
<span>{{ scope.row.start_time.slice(0,16)}}</span> <span>{{ scope.row.start_time.slice(0, 16) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="结束时间" prop="end_time"> <el-table-column label="结束时间" prop="end_time">
<template #default="scope"> <template #default="scope">
<span>{{ scope.row.end_time.slice(0,16)}}</span> <span>{{ scope.row.end_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="班组名称" prop="team_name"></el-table-column>
@ -79,7 +35,7 @@
<el-table-column label="班长" prop="leader_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">
@ -97,27 +53,22 @@
<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"
@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-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> </div>
@ -125,7 +76,7 @@
<tbody> <tbody>
<tr> <tr>
<td class="numCell">日期</td> <td class="numCell">日期</td>
<td class="numCell" v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}</td> <td class="numCell" v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}</td>
<td class="numCell">班次</td> <td class="numCell">班次</td>
<td class="numCell">{{ sflogItem.shift_name }}</td> <td class="numCell">{{ sflogItem.shift_name }}</td>
<td class="numCell">班组</td> <td class="numCell">班组</td>
@ -133,52 +84,53 @@
</tr> </tr>
<tr> <tr>
<td class="numCell">产量t</td> <td class="numCell">产量t</td>
<td class="numCell">{{reportItem.total_production}}</td> <td class="numCell">{{ reportItem.total_production }}</td>
<td class="numCell">台时t/h</td> <td class="numCell">台时t/h</td>
<td class="numCell">{{reportItem.production_hour}}</td> <td class="numCell">{{ reportItem.production_hour }}</td>
<td class="numCell">运转时间h</td> <td class="numCell">运转时间h</td>
<td class="numCell">{{reportItem.run_hour}}</td> <td class="numCell">{{ reportItem.run_hour }}</td>
</tr> </tr>
<tr> <tr>
<td class="numCell">运转率%</td> <td class="numCell">运转率%</td>
<td class="numCell">{{reportItem.run_rate*100}}</td> <td class="numCell">{{ reportItem.run_rate * 100 }}</td>
<td class="numCell">停机时长h</td> <td class="numCell">停机时长h</td>
<td class="numCell">{{reportItem.shut_hour}}</td> <td class="numCell">{{ reportItem.shut_hour }}</td>
<td class="numCell">单位产品分布电耗KW·h/t</td> <td class="numCell">单位产品分布电耗KW·h/t</td>
<td class="numCell">{{reportItem.elec_consume_unit}}</td> <td class="numCell">{{ reportItem.elec_consume_unit }}</td>
</tr> </tr>
<tr> <tr>
<td class="numCell">单位产品标煤耗kgce/t</td> <td class="numCell">单位产品标煤耗kgce/t</td>
<td class="numCell">{{reportItem.coal_consume_unit}}</td> <td class="numCell">{{ reportItem.coal_consume_unit }}</td>
<td class="numCell">熟料立升重合格率%</td> <td class="numCell">熟料立升重合格率%</td>
<td class="numCell" v-if="reportItem.入磨熟料_立升重_rate_pass">{{reportItem.入磨熟料_立升重_rate_pass*100}}</td> <td class="numCell" v-if="reportItem.入磨熟料_立升重_rate_pass">{{ reportItem.入磨熟料_立升重_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td> <td class="numCell" v-else>0</td>
<td class="numCell">熟料f-CaO合格率%</td> <td class="numCell">熟料f-CaO合格率%</td>
<td class="numCell" v-if="reportItem['入磨熟料_f-CaO_rate_pass']">{{reportItem['入磨熟料_f-CaO_rate_pass']*100}}</td> <td class="numCell" v-if="reportItem['入磨熟料_f-CaO_rate_pass']">{{ reportItem['入磨熟料_f-CaO_rate_pass'] * 100 }}
</td>
<td class="numCell" v-else>0</td> <td class="numCell" v-else>0</td>
</tr> </tr>
<tr> <tr>
<td class="numCell">入窑生料细度合格率%</td> <td class="numCell">入窑生料细度合格率%</td>
<td class="numCell" v-if="reportItem.入窑生料_细度_rate_pass">{{reportItem.入窑生料_细度_rate_pass*100}}</td> <td class="numCell" v-if="reportItem.入窑生料_细度_rate_pass">{{ reportItem.入窑生料_细度_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td> <td class="numCell" v-else>0</td>
<td class="numCell">入窑生料CaO合格率%</td> <td class="numCell">入窑生料CaO合格率%</td>
<td class="numCell" v-if="reportItem.入窑生料_CaO_rate_pass">{{reportItem.入窑生料_CaO_rate_pass*100}}</td> <td class="numCell" v-if="reportItem.入窑生料_CaO_rate_pass">{{ reportItem.入窑生料_CaO_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td> <td class="numCell" v-else>0</td>
<td class="numCell">入窑生料Fe₂O₃合格率%</td> <td class="numCell">入窑生料Fe₂O₃合格率%</td>
<td class="numCell" v-if="reportItem.入窑生料_Fe2O3_rate_pass">{{reportItem.入窑生料_Fe2O3_rate_pass*100}}</td> <td class="numCell" v-if="reportItem.入窑生料_Fe2O3_rate_pass">{{ reportItem.入窑生料_Fe2O3_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td> <td class="numCell" v-else>0</td>
</tr> </tr>
<tr> <tr>
<td class="numCell">入窑生料水分合格率%</td> <td class="numCell">入窑生料水分合格率%</td>
<td class="numCell" v-if="reportItem.入窑生料_水分_rate_pass">{{reportItem.入窑生料_水分_rate_pass*100}}</td> <td class="numCell" v-if="reportItem.入窑生料_水分_rate_pass">{{ reportItem.入窑生料_水分_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td> <td class="numCell" v-else>0</td>
<td class="numCell">单位成本/</td> <td class="numCell">单位成本/</td>
<td class="numCell">{{reportItem.production_cost_unit}}</td> <td class="numCell">{{ reportItem.production_cost_unit }}</td>
<td class="numCell"></td> <td class="numCell"></td>
<td class="numCell"></td> <td class="numCell"></td>
</tr> </tr>
<tr v-if="sflogexpList.length>0"> <tr v-if="sflogexpList.length > 0">
<td class="numCell" :rowspan="sflogexpList.length+1">生产情况记录</td> <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> <td class="numCell">原因</td>
@ -186,11 +138,11 @@
<td class="numCell">处置人</td> <td class="numCell">处置人</td>
</tr> </tr>
<tr v-for="item in sflogexpList" :key="item.id"> <tr v-for="item in sflogexpList" :key="item.id">
<td class="numCell">{{ item.happen_time}}</td> <td class="numCell">{{ item.happen_time }}</td>
<td class="numCell">{{ item.cate}}</td> <td class="numCell">{{ item.cate }}</td>
<td class="numCell">{{ item.reason}}</td> <td class="numCell">{{ item.reason }}</td>
<td class="numCell">{{ item.measure}}</td> <td class="numCell">{{ item.measure }}</td>
<td class="numCell">{{ item.handler}}</td> <td class="numCell">{{ item.handler }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -198,53 +150,53 @@
</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: { query: {
shift:'', shift: '',
team:'', team: '',
end_time__lt:'', end_time__lt: '',
start_time__gte:'', start_time__gte: '',
mgroup:'3347217246321065984', mgroup: '3347217246321065984',
}, },
deptId :'3347207082608115712', deptId: '3347207082608115712',
sflogItem:{}, sflogItem: {},
options:[], options: [],
optionsShift:[], optionsShift: [],
limitedExport:false, limitedExport: false,
reportItem:{}, reportItem: {},
sflogexpList:[], sflogexpList: [],
}; };
}, },
mounted(){ mounted() {
this.getTeam(); this.getTeam();
this.getShfit(); this.getShfit();
}, },
methods: { methods: {
getTeam(){ getTeam() {
let form ={}; let form = {};
form.page = 0; form.page = 0;
form.belong_dept = this.deptId; form.belong_dept = this.deptId;
this.$API.mtm.team.list.req(form).then(res=>{ this.$API.mtm.team.list.req(form).then(res => {
this.options = res; this.options = res;
}) })
}, },
getShfit(){ getShfit() {
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;
}) })
}, },
handleQuery(){ handleQuery() {
this.$refs.table.queryData(this.query); this.$refs.table.queryData(this.query);
}, },
sflog_export(){ sflog_export() {
this.limitedExport = true; this.limitedExport = true;
}, },
rowClick(row) { rowClick(row) {
@ -253,16 +205,16 @@
this.getSflogItem(row.id); this.getSflogItem(row.id);
this.getSflogexp(row.id); this.getSflogexp(row.id);
}, },
getSflogexp(id){ getSflogexp(id) {
let that = this; let that = this;
that.$API.wpm.sflogexp.list.req({page:0,sflog:id}).then(res=>{ that.$API.wpm.sflogexp.list.req({ page: 0, sflog: id }).then(res => {
that.sflogexpList = res; that.sflogexpList = res;
}) })
}, },
getSflogItem(id){ getSflogItem(id) {
let that =this; let that = this;
that.$API.enm.enstat.req({type:'sflog',sflog:id,page:0}).then(res=>{ that.$API.enm.enstat.req({ type: 'sflog', sflog: id, page: 0 }).then(res => {
if(res.length>0){ if (res.length > 0) {
that.reportItem = res[0]; that.reportItem = res[0];
} }
console.log(res[0]) console.log(res[0])
@ -272,12 +224,12 @@
sflog_edit(row) { sflog_edit(row) {
let jsonStr = JSON.stringify(row); let jsonStr = JSON.stringify(row);
this.$TOOL.data.remove("sflogItem") this.$TOOL.data.remove("sflogItem")
this.$TOOL.data.set('sflogItem',jsonStr) this.$TOOL.data.set('sflogItem', jsonStr)
this.$router.push({ this.$router.push({
name: "logDetail", name: "logDetail",
query: { query: {
mgroupId: row.mgroup, mgroupId: row.mgroup,
deptId:this.deptId deptId: this.deptId
}, },
}); });
}, },
@ -290,35 +242,41 @@
this.exportLoading = false; this.exportLoading = false;
}, },
}, },
}; };
</script> </script>
<style scoped> <style scoped>
#numTable{ #numTable {
margin-left: 37px; margin-left: 37px;
} }
#numTable td{
#numTable td {
height: 32px; height: 32px;
padding-left: 5px; padding-left: 5px;
} }
.numCell{
.numCell {
width: 80px; width: 80px;
text-align: center; text-align: center;
} }
.numCell.numCell_last{
.numCell.numCell_last {
width: 100px; width: 100px;
} }
.searchHead{
display:flex .searchHead {
} display: flex
.middleText{ }
.middleText {
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
margin: 0 5px; margin: 0 5px;
display: inline-block; display: inline-block;
} }
.searchBtn{
margin-left: 5px; .searchBtn {
} margin-left: 5px;
</style> }
</style>

View File

@ -3,75 +3,31 @@
<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"
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="mgroup_name"></el-table-column> -->
<el-table-column label="开始时间" prop="start_time"> <el-table-column label="开始时间" prop="start_time">
<template #default="scope"> <template #default="scope">
<span>{{ scope.row.start_time.slice(0,16)}}</span> <span>{{ scope.row.start_time.slice(0, 16) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="结束时间" prop="end_time"> <el-table-column label="结束时间" prop="end_time">
<template #default="scope"> <template #default="scope">
<span>{{ scope.row.end_time.slice(0,16)}}</span> <span>{{ scope.row.end_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="班组名称" prop="team_name"></el-table-column>
@ -80,7 +36,7 @@
<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">
@ -98,27 +54,22 @@
<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"
@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-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> </div>
@ -126,7 +77,7 @@
<tbody> <tbody>
<tr> <tr>
<td class="numCell">日期</td> <td class="numCell">日期</td>
<td class="numCell" v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}</td> <td class="numCell" v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}</td>
<td class="numCell">班次</td> <td class="numCell">班次</td>
<td class="numCell">{{ sflogItem.shift_name }}</td> <td class="numCell">{{ sflogItem.shift_name }}</td>
<td class="numCell">班组</td> <td class="numCell">班组</td>
@ -134,30 +85,30 @@
</tr> </tr>
<tr> <tr>
<td class="numCell">产量t</td> <td class="numCell">产量t</td>
<td class="numCell">{{reportItem.total_production}}</td> <td class="numCell">{{ reportItem.total_production }}</td>
<td class="numCell">台时t/h</td> <td class="numCell">台时t/h</td>
<td class="numCell">{{reportItem.production_hour}}</td> <td class="numCell">{{ reportItem.production_hour }}</td>
<td class="numCell">运转时间h</td> <td class="numCell">运转时间h</td>
<td class="numCell">{{reportItem.run_hour}}</td> <td class="numCell">{{ reportItem.run_hour }}</td>
</tr> </tr>
<tr> <tr>
<td class="numCell">运转率%</td> <td class="numCell">运转率%</td>
<td class="numCell">{{reportItem.run_rate*100}}</td> <td class="numCell">{{ reportItem.run_rate * 100 }}</td>
<td class="numCell">停机时长h</td> <td class="numCell">停机时长h</td>
<td class="numCell">{{reportItem.shut_hour}}</td> <td class="numCell">{{ reportItem.shut_hour }}</td>
<td class="numCell">煤磨分布电耗KW·h/t</td> <td class="numCell">煤磨分布电耗KW·h/t</td>
<td class="numCell">{{reportItem.elec_consume_unit}}</td> <td class="numCell">{{ reportItem.elec_consume_unit }}</td>
</tr> </tr>
<tr> <tr>
<td class="numCell">煤粉细度合格率%</td> <td class="numCell">煤粉细度合格率%</td>
<td class="numCell" v-if="reportItem.煤粉_细度_rate_pass">{{reportItem.煤粉_细度_rate_pass*100}}</td> <td class="numCell" v-if="reportItem.煤粉_细度_rate_pass">{{ reportItem.煤粉_细度_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td> <td class="numCell" v-else>0</td>
<td class="numCell">煤粉水分合格率%</td> <td class="numCell">煤粉水分合格率%</td>
<td class="numCell" v-if="reportItem.煤粉_水分_rate_pass">{{reportItem.煤粉_水分_rate_pass*100}}</td> <td class="numCell" v-if="reportItem.煤粉_水分_rate_pass">{{ reportItem.煤粉_水分_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td> <td class="numCell" v-else>0</td>
</tr> </tr>
<tr v-if="sflogexpList.length>0"> <tr v-if="sflogexpList.length > 0">
<td class="numCell" :rowspan="sflogexpList.length+1">生产情况记录</td> <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> <td class="numCell">原因</td>
@ -165,11 +116,11 @@
<td class="numCell">处置人</td> <td class="numCell">处置人</td>
</tr> </tr>
<tr v-for="item in sflogexpList" :key="item.id"> <tr v-for="item in sflogexpList" :key="item.id">
<td class="numCell">{{ item.happen_time}}</td> <td class="numCell">{{ item.happen_time }}</td>
<td class="numCell">{{ item.cate}}</td> <td class="numCell">{{ item.cate }}</td>
<td class="numCell">{{ item.reason}}</td> <td class="numCell">{{ item.reason }}</td>
<td class="numCell">{{ item.measure}}</td> <td class="numCell">{{ item.measure }}</td>
<td class="numCell">{{ item.handler}}</td> <td class="numCell">{{ item.handler }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -177,10 +128,9 @@
</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() {
@ -188,43 +138,43 @@
apiObj: this.$API.wpm.sflog.list, apiObj: this.$API.wpm.sflog.list,
apiObj2: null, apiObj2: null,
query: { query: {
shift:'', shift: '',
team:'', team: '',
end_time__lt:'', end_time__lt: '',
start_time__gte:'', start_time__gte: '',
mgroup:'3347217651339837440', mgroup: '3347217651339837440',
}, },
deptId:'3347207316583170048', deptId: '3347207316583170048',
sflogItem:{}, sflogItem: {},
options:[], options: [],
optionsShift:[], optionsShift: [],
limitedExport:false, limitedExport: false,
reportItem:{}, reportItem: {},
sflogexpList:[], sflogexpList: [],
}; };
}, },
mounted(){ mounted() {
this.getTeam(); this.getTeam();
this.getShfit(); this.getShfit();
}, },
methods: { methods: {
getTeam(){ getTeam() {
let form ={}; let form = {};
form.page = 0; form.page = 0;
form.belong_dept = this.deptId; form.belong_dept = this.deptId;
this.$API.mtm.team.list.req(form).then(res=>{ this.$API.mtm.team.list.req(form).then(res => {
this.options = res; this.options = res;
}) })
}, },
getShfit(){ getShfit() {
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;
}) })
}, },
handleQuery(){ handleQuery() {
this.$refs.table.queryData(this.query); this.$refs.table.queryData(this.query);
}, },
sflog_export(){ sflog_export() {
this.limitedExport = true; this.limitedExport = true;
}, },
rowClick(row) { rowClick(row) {
@ -233,16 +183,16 @@
this.getSflogItem(row.id); this.getSflogItem(row.id);
this.getSflogexp(row.id); this.getSflogexp(row.id);
}, },
getSflogexp(id){ getSflogexp(id) {
let that = this; let that = this;
that.$API.wpm.sflogexp.list.req({page:0,sflog:id}).then(res=>{ that.$API.wpm.sflogexp.list.req({ page: 0, sflog: id }).then(res => {
that.sflogexpList = res; that.sflogexpList = res;
}) })
}, },
getSflogItem(id){ getSflogItem(id) {
let that =this; let that = this;
that.$API.enm.enstat.req({type:'sflog',sflog:id,page:0}).then(res=>{ that.$API.enm.enstat.req({ type: 'sflog', sflog: id, page: 0 }).then(res => {
if(res.length>0){ if (res.length > 0) {
that.reportItem = res[0]; that.reportItem = res[0];
} }
}) })
@ -251,12 +201,12 @@
sflog_edit(row) { sflog_edit(row) {
let jsonStr = JSON.stringify(row); let jsonStr = JSON.stringify(row);
this.$TOOL.data.remove("sflogItem") this.$TOOL.data.remove("sflogItem")
this.$TOOL.data.set('sflogItem',jsonStr) this.$TOOL.data.set('sflogItem', jsonStr)
this.$router.push({ this.$router.push({
name: "logDetail", name: "logDetail",
query: { query: {
mgroupId: row.mgroup, mgroupId: row.mgroup,
deptId:this.deptId deptId: this.deptId
}, },
}); });
}, },
@ -269,34 +219,40 @@
this.exportLoading = false; this.exportLoading = false;
}, },
}, },
}; };
</script> </script>
<style scoped> <style scoped>
#numTable{ #numTable {
margin-left: 37px; margin-left: 37px;
} }
#numTable td{
#numTable td {
height: 32px; height: 32px;
padding-left: 5px; padding-left: 5px;
} }
.numCell{
.numCell {
width: 80px; width: 80px;
} }
.numCell.numCell_last{
.numCell.numCell_last {
width: 100px; width: 100px;
} }
.searchHead{
display:flex .searchHead {
} display: flex
.middleText{ }
.middleText {
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
margin: 0 5px; margin: 0 5px;
display: inline-block; display: inline-block;
} }
.searchBtn{
margin-left: 5px; .searchBtn {
} margin-left: 5px;
</style> }
</style>

View File

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

View File

@ -3,74 +3,30 @@
<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"
row-key="id"
stripe
:params="query"
highlightCurrentRow
@row-click="rowClick"
>
<el-table-column type="index" width="50"/>
<el-table-column label="开始时间" prop="start_time"> <el-table-column label="开始时间" prop="start_time">
<template #default="scope"> <template #default="scope">
<span>{{ scope.row.start_time.slice(0,16)}}</span> <span>{{ scope.row.start_time.slice(0, 16) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="结束时间" prop="end_time"> <el-table-column label="结束时间" prop="end_time">
<template #default="scope"> <template #default="scope">
<span>{{ scope.row.end_time.slice(0,16)}}</span> <span>{{ scope.row.end_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="班组名称" prop="team_name"></el-table-column>
@ -78,7 +34,7 @@
<el-table-column label="班长" prop="leader_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">
@ -96,27 +52,22 @@
<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"
@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-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> </div>
@ -124,7 +75,7 @@
<tbody> <tbody>
<tr> <tr>
<td class="numCell">日期</td> <td class="numCell">日期</td>
<td class="numCell" v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}</td> <td class="numCell" v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}</td>
<td class="numCell">班次</td> <td class="numCell">班次</td>
<td class="numCell">{{ sflogItem.shift_name }}</td> <td class="numCell">{{ sflogItem.shift_name }}</td>
<td class="numCell">班组</td> <td class="numCell">班组</td>
@ -132,53 +83,53 @@
</tr> </tr>
<tr> <tr>
<td class="numCell">产量t</td> <td class="numCell">产量t</td>
<td class="numCell">{{reportItem.total_production}}</td> <td class="numCell">{{ reportItem.total_production }}</td>
<td class="numCell">台时t/h</td> <td class="numCell">台时t/h</td>
<td class="numCell">{{reportItem.production_hour}}</td> <td class="numCell">{{ reportItem.production_hour }}</td>
<td class="numCell">运转时间h</td> <td class="numCell">运转时间h</td>
<td class="numCell">{{reportItem.run_hour}}</td> <td class="numCell">{{ reportItem.run_hour }}</td>
</tr> </tr>
<tr> <tr>
<td class="numCell">运转率%</td> <td class="numCell">运转率%</td>
<td class="numCell">{{reportItem.run_rate*100}}</td> <td class="numCell">{{ reportItem.run_rate * 100 }}</td>
<td class="numCell">停机时长h</td> <td class="numCell">停机时长h</td>
<td class="numCell">{{reportItem.shut_hour}}</td> <td class="numCell">{{ reportItem.shut_hour }}</td>
<td class="numCell">当期单位产品电耗kW·h/t</td> <td class="numCell">当期单位产品电耗kW·h/t</td>
<td class="numCell">{{reportItem.elec_consume_unit}}</td> <td class="numCell">{{ reportItem.elec_consume_unit }}</td>
</tr> </tr>
<tr> <tr>
<td class="numCell">辅料细度合格率%</td> <td class="numCell">辅料细度合格率%</td>
<td class="numCell" v-if="reportItem.辅料_细度_rate_pass">{{reportItem.辅料_细度_rate_pass*100}}</td> <td class="numCell" v-if="reportItem.辅料_细度_rate_pass">{{ reportItem.辅料_细度_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td> <td class="numCell" v-else>0</td>
<td class="numCell">辅料Fe₂O₃合格率%</td> <td class="numCell">辅料Fe₂O₃合格率%</td>
<td class="numCell" v-if="reportItem.辅料_Fe2O3_rate_pass">{{reportItem.辅料_Fe2O3_rate_pass*100}}</td> <td class="numCell" v-if="reportItem.辅料_Fe2O3_rate_pass">{{ reportItem.辅料_Fe2O3_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td> <td class="numCell" v-else>0</td>
<td class="numCell">辅料水分合格率%</td> <td class="numCell">辅料水分合格率%</td>
<td class="numCell" v-if="reportItem.辅料_水分_rate_pass">{{reportItem.辅料_水分_rate_pass*100}}</td> <td class="numCell" v-if="reportItem.辅料_水分_rate_pass">{{ reportItem.辅料_水分_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td> <td class="numCell" v-else>0</td>
</tr> </tr>
<tr> <tr>
<td class="numCell">干混生料CaO合格率%</td> <td class="numCell">干混生料CaO合格率%</td>
<td class="numCell" v-if="reportItem.干混生料_CaO_rate_pass">{{reportItem.干混生料_CaO_rate_pass*100}}</td> <td class="numCell" v-if="reportItem.干混生料_CaO_rate_pass">{{ reportItem.干混生料_CaO_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td> <td class="numCell" v-else>0</td>
<td class="numCell">干混生料Fe₂O₃合格率%</td> <td class="numCell">干混生料Fe₂O₃合格率%</td>
<td class="numCell" v-if="reportItem.干混生料_Fe2O3_rate_pass">{{reportItem.干混生料_Fe2O3_rate_pass*100}}</td> <td class="numCell" v-if="reportItem.干混生料_Fe2O3_rate_pass">{{ reportItem.干混生料_Fe2O3_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td> <td class="numCell" v-else>0</td>
<td class="numCell">干混生料细度合格率%</td> <td class="numCell">干混生料细度合格率%</td>
<td class="numCell" v-if="reportItem.干混生料_细度_rate_pass">{{reportItem.干混生料_细度_rate_pass*100}}</td> <td class="numCell" v-if="reportItem.干混生料_细度_rate_pass">{{ reportItem.干混生料_细度_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td> <td class="numCell" v-else>0</td>
</tr> </tr>
<tr> <tr>
<td class="numCell">干混生料水分合格率%</td> <td class="numCell">干混生料水分合格率%</td>
<td class="numCell" v-if="reportItem.干混生料_水分_rate_pass">{{reportItem.干混生料_水分_rate_pass*100}}</td> <td class="numCell" v-if="reportItem.干混生料_水分_rate_pass">{{ reportItem.干混生料_水分_rate_pass * 100 }}</td>
<td class="numCell" v-else>0</td> <td class="numCell" v-else>0</td>
<td class="numCell">单位成本/</td> <td class="numCell">单位成本/</td>
<td class="numCell">{{reportItem.production_cost_unit}}</td> <td class="numCell">{{ reportItem.production_cost_unit }}</td>
<td class="numCell"></td> <td class="numCell"></td>
<td class="numCell"></td> <td class="numCell"></td>
</tr> </tr>
<tr v-if="sflogexpList.length>0"> <tr v-if="sflogexpList.length > 0">
<td class="numCell" :rowspan="sflogexpList.length+1">生产情况记录</td> <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> <td class="numCell">原因</td>
@ -186,11 +137,11 @@
<td class="numCell">处置人</td> <td class="numCell">处置人</td>
</tr> </tr>
<tr v-for="item in sflogexpList" :key="item.id"> <tr v-for="item in sflogexpList" :key="item.id">
<td class="numCell">{{ item.happen_time}}</td> <td class="numCell">{{ item.happen_time }}</td>
<td class="numCell">{{ item.cate}}</td> <td class="numCell">{{ item.cate }}</td>
<td class="numCell">{{ item.reason}}</td> <td class="numCell">{{ item.reason }}</td>
<td class="numCell">{{ item.measure}}</td> <td class="numCell">{{ item.measure }}</td>
<td class="numCell">{{ item.handler}}</td> <td class="numCell">{{ item.handler }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -217,12 +168,12 @@
@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,
@ -234,46 +185,46 @@ import otherDialog from "./other_form.vue";
apiObj: this.$API.wpm.sflog.list, apiObj: this.$API.wpm.sflog.list,
apiObj2: null, apiObj2: null,
query: { query: {
mgroup:'3346520558031773696', mgroup: '3346520558031773696',
}, },
deptId :"3345780809943797760", deptId: "3345780809943797760",
sflogItem:{}, sflogItem: {},
selection: [], selection: [],
modelValue:true, modelValue: true,
showClose:true, showClose: true,
echartType:'line', echartType: 'line',
asynDialog:false, asynDialog: false,
options:[], options: [],
optionsShift:[], optionsShift: [],
teamOptions:[], teamOptions: [],
limitedExport:false, limitedExport: false,
reportItem:{}, reportItem: {},
sflogexpList:[], sflogexpList: [],
}; };
}, },
mounted(){ mounted() {
this.getTeam(); this.getTeam();
this.getShfit(); this.getShfit();
}, },
methods: { methods: {
getTeam(){ getTeam() {
let form ={}; let form = {};
form.page = 0; form.page = 0;
form.belong_dept = this.deptId; form.belong_dept = this.deptId;
this.$API.mtm.team.list.req(form).then(res=>{ this.$API.mtm.team.list.req(form).then(res => {
this.options = res; this.options = res;
}) })
}, },
getShfit(){ getShfit() {
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;
}) })
}, },
handleQuery(){ handleQuery() {
this.$refs.table.queryData(this.query); this.$refs.table.queryData(this.query);
}, },
sflog_export(){ sflog_export() {
this.limitedExport = true; this.limitedExport = true;
}, },
rowClick(row) { rowClick(row) {
@ -282,16 +233,16 @@ import otherDialog from "./other_form.vue";
this.getSflogItem(row.id); this.getSflogItem(row.id);
this.getSflogexp(row.id); this.getSflogexp(row.id);
}, },
getSflogexp(id){ getSflogexp(id) {
let that = this; let that = this;
that.$API.wpm.sflogexp.list.req({page:0,sflog:id}).then(res=>{ that.$API.wpm.sflogexp.list.req({ page: 0, sflog: id }).then(res => {
that.sflogexpList = res; that.sflogexpList = res;
}) })
}, },
getSflogItem(id){ getSflogItem(id) {
let that =this; let that = this;
that.$API.enm.enstat.req({type:'sflog',sflog:id,page:0}).then(res=>{ that.$API.enm.enstat.req({ type: 'sflog', sflog: id, page: 0 }).then(res => {
if(res.length>0){ if (res.length > 0) {
that.reportItem = res[0]; that.reportItem = res[0];
} }
console.log(res[0]) console.log(res[0])
@ -301,12 +252,12 @@ import otherDialog from "./other_form.vue";
sflog_edit(row) { sflog_edit(row) {
let jsonStr = JSON.stringify(row); let jsonStr = JSON.stringify(row);
this.$TOOL.data.remove("sflogItem") this.$TOOL.data.remove("sflogItem")
this.$TOOL.data.set('sflogItem',jsonStr) this.$TOOL.data.set('sflogItem', jsonStr)
this.$router.push({ this.$router.push({
name: "logDetail", name: "logDetail",
query: { query: {
mgroupId: row.mgroup, mgroupId: row.mgroup,
deptId:this.deptId deptId: this.deptId
}, },
}); });
// this.dialog.save = true; // this.dialog.save = true;
@ -316,14 +267,14 @@ import otherDialog from "./other_form.vue";
}, },
// //
sflog_check(row){ sflog_check(row) {
this.dialog.check = true; this.dialog.check = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.checkDialog.open("edit").setData(row); this.$refs.checkDialog.open("edit").setData(row);
}); });
}, },
// //
sflog_other(row){ sflog_other(row) {
this.dialog.other = true; this.dialog.other = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.otherDialog.open("edit").setData(row); this.$refs.otherDialog.open("edit").setData(row);
@ -352,10 +303,10 @@ import otherDialog from "./other_form.vue";
this.$refs.table.refresh() this.$refs.table.refresh()
this.dialog.save = false; this.dialog.save = false;
}, },
handleOtherSuccess(){ handleOtherSuccess() {
this.dialog.other = false; this.dialog.other = false;
}, },
handleCheckSuccess(){ handleCheckSuccess() {
this.dialog.check = false; this.dialog.check = false;
}, },
closed() { closed() {
@ -377,7 +328,7 @@ import otherDialog from "./other_form.vue";
} }
}); });
}) })
.catch(() => {}); .catch(() => { });
}, },
handlePrint() { handlePrint() {
this.$PRINT('#myReport'); this.$PRINT('#myReport');
@ -388,34 +339,40 @@ import otherDialog from "./other_form.vue";
this.exportLoading = false; this.exportLoading = false;
}, },
}, },
}; };
</script> </script>
<style scoped> <style scoped>
#numTable{ #numTable {
margin-left: 37px; margin-left: 37px;
} }
#numTable td{
#numTable td {
height: 32px; height: 32px;
padding-left: 5px; padding-left: 5px;
} }
.numCell{
.numCell {
width: 80px; width: 80px;
} }
.numCell.numCell_last{
.numCell.numCell_last {
width: 100px; width: 100px;
} }
.searchHead{
display:flex .searchHead {
} display: flex
.middleText{ }
.middleText {
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
margin: 0 5px; margin: 0 5px;
display: inline-block; display: inline-block;
} }
.searchBtn{
margin-left: 5px; .searchBtn {
} margin-left: 5px;
</style> }
</style>

View File

@ -1,91 +1,51 @@
<template> <template>
<el-dialog <el-dialog :title="titleMap[mode]" v-model="visible" :size="1000" destroy-on-close @closed="$emit('closed')">
:title="titleMap[mode]"
v-model="visible"
:size="1000"
destroy-on-close
@closed="$emit('closed')"
>
<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" label-width="100px" label-position="right" :rules="rule1">
ref="dialogForm"
:model="form"
label-width="100px"
label-position="right"
:rules="rule1"
>
<el-row> <el-row>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="关联工段" prop="mgroup"> <el-form-item label="关联工段" prop="mgroup">
<el-input v-model="form.mgroup_name" placeholder="关联工段" disabled/> <el-input v-model="form.mgroup_name" placeholder="关联工段" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="当班班次" prop="shift"> <el-form-item label="当班班次" prop="shift">
<el-input v-model="form.shift_name" placeholder="当班班次" disabled/> <el-input v-model="form.shift_name" placeholder="当班班次" disabled />
</el-form-item> </el-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="start_time">
<el-date-picker <el-date-picker disabled v-model="form.start_time" type="datetime" format="YYYY-MM-DD HH:mm"
disabled placeholder="开始时间" style="width: 100%;" />
v-model="form.start_time"
type="datetime"
format="YYYY-MM-DD HH:mm"
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="end_time"> <el-form-item label="结束时间" prop="end_time">
<el-date-picker <el-date-picker disabled v-model="form.end_time" type="datetime" format="YYYY-MM-DD HH:mm"
disabled placeholder="结束时间" style="width: 100%;" />
v-model="form.end_time"
type="datetime"
format="YYYY-MM-DD HH:mm"
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="team"> <el-form-item label="当班班组" prop="team">
<el-select <el-select v-model="form.team" placeholder="当班班组" clearable style="width: 100%;" @change="teamChange">
v-model="form.team" <el-option v-for="item in teamOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
placeholder="当班班组"
clearable
style="width: 100%;"
@change="teamChange"
>
<el-option
v-for="item in teamOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select> </el-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="班组班长" prop="leader_name"> <el-form-item label="班组班长" prop="leader_name">
<el-input v-model="form.leader_name" placeholder="班组班长" disabled/> <el-input v-model="form.leader_name" placeholder="班组班长" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24" v-if="form.shift_name=='白班'&&mgroupId=='3347217246321065984'"> <el-col :md="12" :sm="24" v-if="form.shift_name == '白班' && mgroupId == '3347217246321065984'">
<el-form-item label="煤粉热值"> <el-form-item label="煤粉热值">
<el-input-number v-model="form.pcoal_heat" controls-position="right" placeholder="煤粉热值" /> <el-input-number v-model="form.pcoal_heat" controls-position="right" placeholder="煤粉热值" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col> <el-col>
<el-form-item label="生产情况记录"> <el-form-item label="生产情况记录">
<el-input <el-input type="textarea" :rows="4" v-model="form.note" placeholder="生产情况记录" />
type="textarea"
:rows="4"
v-model="form.note"
placeholder="生产情况记录"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -97,9 +57,9 @@
</el-footer> </el-footer>
</el-container> </el-container>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
export default { export default {
emits: ["success", "closed"], emits: ["success", "closed"],
props: { props: {
deptId: { deptId: {
@ -123,13 +83,13 @@
show: "查看交接班日志", show: "查看交接班日志",
}, },
form: { form: {
type:10, type: 10,
}, },
rules: { rules: {
name: [{required: true, message: "请输入", trigger: "blur"}], name: [{ required: true, message: "请输入", trigger: "blur" }],
number: [{required: true, message: "请输入", trigger: "blur"}], number: [{ required: true, message: "请输入", trigger: "blur" }],
keeper_name: [{required: true, message: "请输入", trigger: "blur"}], keeper_name: [{ required: true, message: "请输入", trigger: "blur" }],
belong_dept: [{required: true, message: "请选择", trigger: "blur"}] belong_dept: [{ required: true, message: "请选择", trigger: "blur" }]
}, },
visible: false, visible: false,
isSaveing: false, isSaveing: false,
@ -137,8 +97,8 @@
depOptions: [], depOptions: [],
selectionFilters: [], selectionFilters: [],
setFiltersVisible: false, setFiltersVisible: false,
teamOptions:[], teamOptions: [],
shiftOptions:[], shiftOptions: [],
}; };
}, },
mounted() { mounted() {
@ -151,18 +111,18 @@
this.getShfit(); this.getShfit();
}, },
methods: { methods: {
getTeam(){ getTeam() {
debugger; debugger;
let form ={}; let form = {};
form.page = 0; form.page = 0;
form.belong_dept = this.deptId; form.belong_dept = this.deptId;
debugger; debugger;
this.$API.mtm.team.list.req(form).then(res=>{ this.$API.mtm.team.list.req(form).then(res => {
this.teamOptions = res; this.teamOptions = res;
}) })
}, },
getShfit(){ getShfit() {
this.$API.mtm.shift.req({page:0}).then(res=>{ this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
this.shiftOptions = res; this.shiftOptions = res;
}) })
}, },
@ -172,12 +132,12 @@
this.visible = true; this.visible = true;
return this; return this;
}, },
teamChange(data){ teamChange(data) {
let that = this; let that = this;
that.teamOptions.forEach(item=>{ that.teamOptions.forEach(item => {
if(item.id==data){ if (item.id == data) {
that.form.leader_name = item.leader_name; that.form.leader_name = item.leader_name;
that.form.leader= item.leader; that.form.leader = item.leader;
} }
}) })
}, },
@ -187,13 +147,13 @@
if (valid) { if (valid) {
this.isSaveing = true; this.isSaveing = true;
try { try {
let obj={}; let obj = {};
obj.note = this.form.note; obj.note = this.form.note;
obj.team = this.form.team; obj.team = this.form.team;
obj.shift = this.form.shift; obj.shift = this.form.shift;
obj.leader = this.form.leader; obj.leader = this.form.leader;
obj.pcoal_heat = this.form.pcoal_heat; obj.pcoal_heat = this.form.pcoal_heat;
this.$API.wpm.sflog.update.req(this.form.id,obj).then(res=>{ this.$API.wpm.sflog.update.req(this.form.id, obj).then(res => {
this.isSaveing = false; this.isSaveing = false;
this.$emit("success", this.form, this.mode); this.$emit("success", this.form, this.mode);
this.visible = false; this.visible = false;
@ -210,7 +170,7 @@
}, },
// //
setData(data) { setData(data) {
Object.assign(this.form,data); Object.assign(this.form, data);
}, },
// //
setFilters(filters) { setFilters(filters) {
@ -218,8 +178,7 @@
this.setFiltersVisible = true; this.setFiltersVisible = true;
}, },
}, },
}; };
</script> </script>
<style> <style></style>
</style>

View File

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

View File

@ -3,74 +3,30 @@
<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"
row-key="id"
stripe
:params="query"
highlightCurrentRow
@row-click="rowClick"
>
<el-table-column type="index" width="50"/>
<el-table-column label="开始时间" prop="start_time"> <el-table-column label="开始时间" prop="start_time">
<template #default="scope"> <template #default="scope">
<span>{{ scope.row.start_time.slice(0,16)}}</span> <span>{{ scope.row.start_time.slice(0, 16) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="结束时间" prop="end_time"> <el-table-column label="结束时间" prop="end_time">
<template #default="scope"> <template #default="scope">
<span>{{ scope.row.end_time.slice(0,16)}}</span> <span>{{ scope.row.end_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="班组名称" prop="team_name"></el-table-column>
@ -78,7 +34,7 @@
<el-table-column label="班长" prop="leader_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="150"> <el-table-column label="操作" fixed="right" align="center" width="150">
@ -94,27 +50,22 @@
<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"
@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-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> </div>
@ -122,7 +73,7 @@
<tbody> <tbody>
<tr> <tr>
<td class="numCell">日期</td> <td class="numCell">日期</td>
<td class="numCell" v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}</td> <td class="numCell" v-if="sflogItem.end_time">{{ sflogItem.end_time.slice(0, 10) }}</td>
<td class="numCell">班次</td> <td class="numCell">班次</td>
<td class="numCell">{{ sflogItem.shift_name }}</td> <td class="numCell">{{ sflogItem.shift_name }}</td>
<td class="numCell">班组</td> <td class="numCell">班组</td>
@ -130,14 +81,14 @@
</tr> </tr>
<tr> <tr>
<td class="numCell">产量t</td> <td class="numCell">产量t</td>
<td class="numCell">{{reportItem.total_production}}</td> <td class="numCell">{{ reportItem.total_production }}</td>
<td class="numCell">单位产品分布电耗KW·h/t</td> <td class="numCell">单位产品分布电耗KW·h/t</td>
<td class="numCell">{{reportItem.elec_consume_unit}}</td> <td class="numCell">{{ reportItem.elec_consume_unit }}</td>
<td class="numCell">单位成本/</td> <td class="numCell">单位成本/</td>
<td class="numCell">{{reportItem.production_cost_unit}}</td> <td class="numCell">{{ reportItem.production_cost_unit }}</td>
</tr> </tr>
<tr v-if="sflogexpList.length>0"> <tr v-if="sflogexpList.length > 0">
<td class="numCell" :rowspan="sflogexpList.length+1">生产情况记录</td> <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> <td class="numCell">原因</td>
@ -145,11 +96,11 @@
<td class="numCell">处置人</td> <td class="numCell">处置人</td>
</tr> </tr>
<tr v-for="item in sflogexpList" :key="item.id"> <tr v-for="item in sflogexpList" :key="item.id">
<td class="numCell">{{ item.happen_time}}</td> <td class="numCell">{{ item.happen_time }}</td>
<td class="numCell">{{ item.cate}}</td> <td class="numCell">{{ item.cate }}</td>
<td class="numCell">{{ item.reason}}</td> <td class="numCell">{{ item.reason }}</td>
<td class="numCell">{{ item.measure}}</td> <td class="numCell">{{ item.measure }}</td>
<td class="numCell">{{ item.handler}}</td> <td class="numCell">{{ item.handler }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -158,47 +109,47 @@
</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: { query: {
mgroup:'3346491835287007232', mgroup: '3346491835287007232',
}, },
deptId:'3345780809943797760', deptId: '3345780809943797760',
sflogItem:{}, sflogItem: {},
options:[], options: [],
optionsShift:[], optionsShift: [],
limitedExport:false, limitedExport: false,
reportItem:{}, reportItem: {},
sflogexpList:[], sflogexpList: [],
}; };
}, },
mounted(){ mounted() {
this.getTeam(); this.getTeam();
this.getShfit(); this.getShfit();
}, },
methods: { methods: {
getTeam(){ getTeam() {
let form ={}; let form = {};
form.page = 0; form.page = 0;
form.belong_dept = this.deptId; form.belong_dept = this.deptId;
this.$API.mtm.team.list.req(form).then(res=>{ this.$API.mtm.team.list.req(form).then(res => {
this.options = res; this.options = res;
}) })
}, },
getShfit(){ getShfit() {
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;
}) })
}, },
handleQuery(){ handleQuery() {
this.$refs.table.queryData(this.query); this.$refs.table.queryData(this.query);
}, },
sflog_export(){ sflog_export() {
this.limitedExport = true; this.limitedExport = true;
}, },
rowClick(row) { rowClick(row) {
@ -207,16 +158,16 @@
this.getSflogItem(row.id); this.getSflogItem(row.id);
this.getSflogexp(row.id); this.getSflogexp(row.id);
}, },
getSflogexp(id){ getSflogexp(id) {
let that = this; let that = this;
that.$API.wpm.sflogexp.list.req({page:0,sflog:id}).then(res=>{ that.$API.wpm.sflogexp.list.req({ page: 0, sflog: id }).then(res => {
that.sflogexpList = res; that.sflogexpList = res;
}) })
}, },
getSflogItem(id){ getSflogItem(id) {
let that =this; let that = this;
that.$API.enm.enstat.req({type:'sflog',sflog:id,page:0}).then(res=>{ that.$API.enm.enstat.req({ type: 'sflog', sflog: id, page: 0 }).then(res => {
if(res.length>0){ if (res.length > 0) {
that.reportItem = res[0]; that.reportItem = res[0];
} }
console.log(res[0]) console.log(res[0])
@ -226,12 +177,12 @@
sflog_edit(row) { sflog_edit(row) {
let jsonStr = JSON.stringify(row); let jsonStr = JSON.stringify(row);
this.$TOOL.data.remove("sflogItem") this.$TOOL.data.remove("sflogItem")
this.$TOOL.data.set('sflogItem',jsonStr) this.$TOOL.data.set('sflogItem', jsonStr)
this.$router.push({ this.$router.push({
name: "logDetail", name: "logDetail",
query: { query: {
mgroupId: row.mgroup, mgroupId: row.mgroup,
deptId:this.deptId deptId: this.deptId
}, },
}); });
}, },
@ -244,34 +195,40 @@
this.exportLoading = false; this.exportLoading = false;
}, },
}, },
}; };
</script> </script>
<style scoped> <style scoped>
#numTable{ #numTable {
margin-left: 37px; margin-left: 37px;
} }
#numTable td{
#numTable td {
height: 32px; height: 32px;
padding-left: 5px; padding-left: 5px;
} }
.numCell{
.numCell {
width: 80px; width: 80px;
} }
.numCell.numCell_last{
.numCell.numCell_last {
width: 100px; width: 100px;
} }
.searchHead{
display:flex .searchHead {
} display: flex
.middleText{ }
.middleText {
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
margin: 0 5px; margin: 0 5px;
display: inline-block; display: inline-block;
} }
.searchBtn{
margin-left: 5px; .searchBtn {
} margin-left: 5px;
</style> }
</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-option
v-for="item in stateOptions"
:key="item.id"
:label="item.label"
:value="item.id"
></el-option>
</el-select> </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">
@ -131,7 +73,7 @@
</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,14 +81,14 @@
</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: {
@ -155,21 +97,21 @@
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,
}; };
@ -179,31 +121,31 @@
}, },
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.deptOptions = data;
}); });
this.$API.mtm.shift.req({page:0}).then(res=>{ this.$API.mtm.shift.list.req({ page: 0 }).then(res => {
this.shiftOptions = res; this.shiftOptions = res;
}) })
}, },
getTeam(){ getTeam() {
//team //team
this.$API.mtm.team.list.req({page:0,belong_dept:this.belongDept}).then(res=>{ this.$API.mtm.team.list.req({ page: 0, belong_dept: this.belongDept }).then(res => {
this.teamOptions = res; this.teamOptions = res;
}) })
}, },
getuser(){ getuser() {
this.$API.mtm.teammember.list.req({team:this.form.team,page:0}).then(res=>{ this.$API.mtm.teammember.list.req({ team: this.form.team, page: 0 }).then(res => {
this.userList = []; this.userList = [];
res.forEach(item=>{ res.forEach(item => {
let obj =item; let obj = item;
obj.state = 'normal'; obj.state = 'normal';
obj.note = ''; obj.note = '';
this.userList.push(obj) this.userList.push(obj)
@ -226,7 +168,7 @@
if (valid) { if (valid) {
this.isSaveing = true; this.isSaveing = true;
let arr = []; let arr = [];
this.userList.forEach(item=>{ this.userList.forEach(item => {
let obj = {}; let obj = {};
obj.team = this.form.team; obj.team = this.form.team;
obj.shift = this.form.shift; obj.shift = this.form.shift;
@ -271,10 +213,10 @@
// console.log(defaultForm); // console.log(defaultForm);
// this.form = defaultForm; // this.form = defaultForm;
this.loading = true; this.loading = true;
this.$API.hrm.employee.item.req(data.id).then(res=>{ this.$API.hrm.employee.item.req(data.id).then(res => {
this.loading = false; this.loading = false;
this.form = res this.form = res
}).catch(e=>{this.loading = false;}) }).catch(e => { this.loading = false; })
// Object.assign(this.form, data); // Object.assign(this.form, data);
}, },
// //
@ -283,8 +225,7 @@
this.setFiltersVisible = true; 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,11 +12,19 @@
<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>
@ -31,16 +39,17 @@
</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>
@ -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,9 +179,6 @@ 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){
}else{
that.form.cate = 'photon'; that.form.cate = 'photon';
that.form.need_enm = false; that.form.need_enm = false;
that.isSaveing = true; that.isSaveing = true;
@ -178,10 +198,9 @@ export default {
}) })
} }
} }
}
}); });
}, },
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,91 +3,26 @@
<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>
@ -96,12 +31,12 @@
<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);
} }
}) })
@ -202,38 +137,38 @@
}) })
}, },
// //
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(){ getData() {
let that = this; let that = this;
that.data1 = 0; that.data1 = 0;
that.data2 = 0; that.data2 = 0;
@ -242,55 +177,55 @@
that.data5 = 0; that.data5 = 0;
let params = {}; let params = {};
let arr = []; let arr = [];
params.page=0; params.page = 0;
params.mgroup=that.query.mgroup; params.mgroup = that.query.mgroup;
if(that.query.type==0){// if (that.query.type == 0) {//
arr = that.query.day.split('-'); arr = that.query.day.split('-');
params.year_s = Number(arr[0]); params.year_s = Number(arr[0]);
params.month_s = Number(arr[1]); params.month_s = Number(arr[1]);
params.day_s = Number(arr[2]); params.day_s = Number(arr[2]);
params.type="day_s" params.type = "day_s"
}else if(that.query.type==1){// } else if (that.query.type == 1) {//
arr = that.query.month.split('-'); arr = that.query.month.split('-');
params.year_s = Number(arr[0]); params.year_s = Number(arr[0]);
params.month_s = Number(arr[1]); params.month_s = Number(arr[1]);
params.type="day_s" params.type = "day_s"
}else{// } else {//
params.year_s = Number(that.query.year); params.year_s = Number(that.query.year);
params.type="month_s" params.type = "month_s"
} }
that.$API.enm.enstat.req(params).then(res=>{ that.$API.enm.enstat.req(params).then(res => {
if(res.length>0){ if (res.length > 0) {
let materials = res[0].imaterial_data; let materials = res[0].imaterial_data;
let arr = []; let arr = [];
materials.forEach(item=>{ materials.forEach(item => {
if(item.material_type==0){// if (item.material_type == 0) {//
that.data2=that.data2+4; that.data2 = that.data2 + 4;
}else if(item.material_type==30||item.material_type==20){// } else if (item.material_type == 30 || item.material_type == 20) {//
that.data1=that.data1+4; that.data1 = that.data1 + 4;
}else if(item.material_type==40){// } else if (item.material_type == 40) {//
that.data3=that.data3+4; that.data3 = that.data3 + 4;
} }
arr.push(item.material_name) arr.push(item.material_name)
arr.push('单价(元/吨)') arr.push('单价(元/吨)')
arr.push('总成本(元)') arr.push('总成本(元)')
arr.push('单位成本(元/吨)') arr.push('单位成本(元/吨)')
}) })
that.allCol = arr.length+16 that.allCol = arr.length + 16
that.materialList = arr; that.materialList = arr;
let dataArr = []; let dataArr = [];
res.forEach(itemData=>{ res.forEach(itemData => {
let time =''; let time = '';
dataArr = []; dataArr = [];
if(that.query.type==0){ if (that.query.type == 0) {
time = itemData.year_s+'.'+itemData.month_s+'.'+itemData.day_s; time = itemData.year_s + '.' + itemData.month_s + '.' + itemData.day_s;
}else if(that.query.type==1){ } else if (that.query.type == 1) {
time = itemData.year_s+'.'+itemData.month_s+'.'+itemData.day_s; time = itemData.year_s + '.' + itemData.month_s + '.' + itemData.day_s;
}else{ } else {
time = itemData.year_s+'.'+itemData.month_s; time = itemData.year_s + '.' + itemData.month_s;
} }
dataArr.push(time); dataArr.push(time);
if(that.query.type==0){ if (that.query.type == 0) {
dataArr.push(itemData.shift); dataArr.push(itemData.shift);
dataArr.push(itemData.team_name); dataArr.push(itemData.team_name);
} }
@ -298,14 +233,14 @@
dataArr.push(itemData.coal_consume_unit); dataArr.push(itemData.coal_consume_unit);
dataArr.push(itemData.cen_consume_unit); dataArr.push(itemData.cen_consume_unit);
let sub1data = itemData.imaterial_data; let sub1data = itemData.imaterial_data;
for(let i=0;i<sub1data.length;i++){ for (let i = 0; i < sub1data.length; i++) {
dataArr.push(sub1data[i].cost) dataArr.push(sub1data[i].cost)
dataArr.push(sub1data[i].price_unit) dataArr.push(sub1data[i].price_unit)
dataArr.push(sub1data[i].amount_consume) dataArr.push(sub1data[i].amount_consume)
dataArr.push(sub1data[i].cost_unit) dataArr.push(sub1data[i].cost_unit)
} }
let otherdata = itemData.other_cost_data; let otherdata = itemData.other_cost_data;
for(let j=0;j<otherdata.length;j++){ for (let j = 0; j < otherdata.length; j++) {
dataArr.push(otherdata[j].cost_unit) dataArr.push(otherdata[j].cost_unit)
} }
that.tableData1.push(dataArr) that.tableData1.push(dataArr)
@ -313,7 +248,7 @@
} }
}) })
}, },
getTableData(){ getTableData() {
this.getData(); this.getData();
}, },
@ -326,12 +261,11 @@
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,51 +4,17 @@
<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>
@ -60,49 +26,49 @@
</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