This commit is contained in:
parent
89323113d6
commit
f14ee6bb95
|
|
@ -315,7 +315,7 @@ export default {
|
|||
leave: {
|
||||
name: "提前离厂",
|
||||
req: async function (id,data) {
|
||||
return await http.post(
|
||||
return await http.put(
|
||||
`${config.API_URL}/rpm/rpj_member/${id}/leave/`,
|
||||
data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -798,6 +798,7 @@ const routes = [
|
|||
"title": "班组管理",
|
||||
"icon": "el-icon-postcard",
|
||||
"type": "menu",
|
||||
"perms": ["dataset"]
|
||||
},
|
||||
"component": "ungrouped/team"
|
||||
},
|
||||
|
|
@ -832,6 +833,15 @@ const routes = [
|
|||
"component": "ungrouped/material"
|
||||
},
|
||||
{
|
||||
"name": "priceset",
|
||||
"path": "/ungrouped/priceset",
|
||||
"meta": {
|
||||
"title": "物料价格配置",
|
||||
"icon": "el-icon-grid",
|
||||
"perms": ["dataset"]
|
||||
},
|
||||
"component": "ungrouped/priceset"
|
||||
},{
|
||||
"name": "feeset",
|
||||
"path": "/ungrouped/feeset",
|
||||
"meta": {
|
||||
|
|
@ -851,6 +861,16 @@ const routes = [
|
|||
},
|
||||
"component": "ungrouped/goalSetting"
|
||||
},
|
||||
{
|
||||
"name": "quality",
|
||||
"path": "/ungrouped/quality",
|
||||
"meta": {
|
||||
"title": "质量报表",
|
||||
"icon": "el-icon-grid",
|
||||
"perms": ["bi"]
|
||||
},
|
||||
"component": "ungrouped/quality"
|
||||
},
|
||||
{
|
||||
"name": "energy",
|
||||
"path": "/ungrouped/energy",
|
||||
|
|
@ -860,6 +880,16 @@ const routes = [
|
|||
"perms": ["bi"]
|
||||
},
|
||||
"component": "ungrouped/energy"
|
||||
},
|
||||
{
|
||||
"name": "electric",
|
||||
"path": "/ungrouped/electric",
|
||||
"meta": {
|
||||
"title": "全厂电量统计",
|
||||
"icon": "el-icon-grid",
|
||||
"perms": ["bi"]
|
||||
},
|
||||
"component": "ungrouped/electric"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -57,9 +57,6 @@
|
|||
>
|
||||
<el-table-column type="index" width="50"/>
|
||||
<!-- <el-table-column label="关联工段" prop="mgroup_name"></el-table-column> -->
|
||||
<el-table-column label="班组名称" prop="team_name"></el-table-column>
|
||||
<el-table-column label="当前班次" prop="shift_name"></el-table-column>
|
||||
<el-table-column label="班长" prop="leader_name"></el-table-column>
|
||||
<el-table-column label="开始时间" prop="start_time">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.start_time.slice(0,16)}}</span>
|
||||
|
|
@ -70,15 +67,20 @@
|
|||
<span>{{ scope.row.end_time.slice(0,16)}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="更新时间" prop="update_time">
|
||||
<el-table-column label="班组名称" prop="team_name" width="80"></el-table-column>
|
||||
<el-table-column label="当前班次" prop="shift_name" width="80"></el-table-column>
|
||||
<el-table-column label="班长" prop="leader_name" width="80"></el-table-column>
|
||||
|
||||
<el-table-column label="检验时间">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.update_time.slice(0,16)}}</span>
|
||||
<span v-if="scope.row.last_test_time">{{ scope.row.last_test_time.slice(0,16)}}</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" fixed="right" align="center" width="120">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="140">
|
||||
<template #default="scope">
|
||||
<el-button link size="small" @click="sflog_edit(scope.row)" type="primary">编辑</el-button>
|
||||
<el-button link size="small" @click="sflog_check(scope.row)" type="primary">质量检验</el-button>
|
||||
<el-button link size="small" @click="sflog_other(scope.row)" type="primary">其他能源</el-button>
|
||||
<el-button link size="small" @click="sflog_export(scope.row)" type="success">导出报表</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -160,10 +162,16 @@
|
|||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
></save-dialog>
|
||||
<other-dialog
|
||||
v-if="dialog.other"
|
||||
ref="otherDialog"
|
||||
@success="handleOtherSuccess"
|
||||
@closed="dialog.other = false"
|
||||
></other-dialog>
|
||||
<quastat-dialog
|
||||
v-if="dialog.check"
|
||||
ref="checkDialog"
|
||||
@success="handleSaveSuccess"
|
||||
@success="handleCheckSuccess"
|
||||
@closed="dialog.save = false"
|
||||
></quastat-dialog>
|
||||
</template>
|
||||
|
|
@ -171,10 +179,12 @@
|
|||
<script>
|
||||
import saveDialog from "./handover_form.vue";
|
||||
import quastatDialog from "./quastat_form.vue";
|
||||
import otherDialog from "./other_form.vue";
|
||||
export default {
|
||||
name: "listSon",
|
||||
components: {
|
||||
saveDialog,
|
||||
otherDialog,
|
||||
quastatDialog
|
||||
},
|
||||
data() {
|
||||
|
|
@ -188,6 +198,7 @@ import quastatDialog from "./quastat_form.vue";
|
|||
dialog: {
|
||||
save: false,
|
||||
check: false,
|
||||
other:false,
|
||||
},
|
||||
sflogItem:{},
|
||||
selection: [],
|
||||
|
|
@ -224,6 +235,13 @@ import quastatDialog from "./quastat_form.vue";
|
|||
this.$refs.checkDialog.open("edit").setData(row);
|
||||
});
|
||||
},
|
||||
//其他能源物料
|
||||
sflog_other(row){
|
||||
this.dialog.other = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.otherDialog.open("edit").setData(row);
|
||||
});
|
||||
},
|
||||
// //查看
|
||||
// table_show(row) {
|
||||
// this.dialog.save = true;
|
||||
|
|
@ -247,7 +265,12 @@ import quastatDialog from "./quastat_form.vue";
|
|||
this.$refs.table.refresh()
|
||||
this.dialog.save = false;
|
||||
},
|
||||
|
||||
handleOtherSuccess(){
|
||||
this.dialog.other = false;
|
||||
},
|
||||
handleCheckSuccess(){
|
||||
this.dialog.check = false;
|
||||
},
|
||||
closed() {
|
||||
this.dialog.save = false;
|
||||
this.$refs.table2.refresh();
|
||||
|
|
|
|||
|
|
@ -1,143 +0,0 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<div class="right-panel-search">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
placeholder="名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
></el-input>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleQuery"
|
||||
></el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable
|
||||
ref="table"
|
||||
:apiObj="apiObj"
|
||||
row-key="id"
|
||||
stripe
|
||||
:params="query"
|
||||
>
|
||||
<el-table-column type="index" width="50"/>
|
||||
<el-table-column label="关联工段" prop="mgroup_name"></el-table-column>
|
||||
<el-table-column label="班组名称" prop="team_name"></el-table-column>
|
||||
<el-table-column label="当前班次" prop="shift_name"></el-table-column>
|
||||
<el-table-column label="班长" prop="leader_name"></el-table-column>
|
||||
<el-table-column label="值班开始时间" prop="start_time"></el-table-column>
|
||||
<el-table-column label="值班结束时间" prop="end_time"></el-table-column>
|
||||
<el-table-column label="创建时间" prop="create_time"></el-table-column>
|
||||
<el-table-column label="备注" prop="note"></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="left">
|
||||
<template #default="scope">
|
||||
<el-link
|
||||
v-if="checkPermission(['equipment.update'])"
|
||||
type="primary"
|
||||
@click="handleEdit(scope)"
|
||||
>
|
||||
编辑
|
||||
</el-link>
|
||||
<el-link
|
||||
v-if="checkPermission(['equipment.delete'])"
|
||||
type="danger"
|
||||
@click="handleDelete(scope)"
|
||||
>
|
||||
删除
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
<save-dialog
|
||||
v-if="dialog.save"
|
||||
ref="saveDialog"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
></save-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import saveDialog from "./handover_form.vue";
|
||||
export default {
|
||||
name: "rparty",
|
||||
components: {
|
||||
saveDialog,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialog: {
|
||||
save: false,
|
||||
permission: false,
|
||||
},
|
||||
apiObj: this.$API.wpm.sflog.list,
|
||||
query: {
|
||||
page:1,
|
||||
page_size:20,
|
||||
type:20
|
||||
},
|
||||
selection: [],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//添加
|
||||
add() {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("add");
|
||||
});
|
||||
},
|
||||
//编辑
|
||||
table_edit(row) {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("edit").setData(row);
|
||||
});
|
||||
},
|
||||
//查看
|
||||
table_show(row) {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("show").setData(row);
|
||||
});
|
||||
},
|
||||
//删除
|
||||
async table_del(row) {
|
||||
|
||||
this.$API.rpm.rparty.delete
|
||||
.req(row.id)
|
||||
.then((res) => {
|
||||
this.$message.success("删除成功");
|
||||
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
},
|
||||
|
||||
//本地更新数据
|
||||
handleSaveSuccess(data, mode) {
|
||||
if (mode == "add") {
|
||||
this.$refs.table.refresh();
|
||||
} else if (mode == "edit") {
|
||||
this.$refs.table.refresh();
|
||||
}
|
||||
},
|
||||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query)
|
||||
},
|
||||
resetQuery() {
|
||||
this.query = {};
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
@ -0,0 +1,175 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
:title="titleMap[mode]"
|
||||
v-model="visible"
|
||||
:size="1000"
|
||||
destroy-on-close
|
||||
@closed="$emit('closed')"
|
||||
>
|
||||
<el-container v-loading="loading">
|
||||
<el-main style="padding: 0 20px 20px 20px">
|
||||
<el-form
|
||||
ref="dialogForm"
|
||||
:model="form"
|
||||
label-width="100px"
|
||||
label-position="right"
|
||||
:rules="rule1"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="关联工段" prop="mgroup">
|
||||
<el-input v-model="form.mgroup_name" placeholder="关联工段" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="当班班次">
|
||||
<el-input v-model="form.shift_name" placeholder="当班班次" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="开始时间" prop="start_time">
|
||||
<el-input v-model="form.start_time" placeholder="结束时间" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="结束时间" prop="end_time">
|
||||
<el-input v-model="form.end_time" placeholder="结束时间" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="当班班组" prop="team">
|
||||
<el-input v-model="form.team_name" placeholder="班组班长" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="班组班长" prop="leader_name">
|
||||
<el-input v-model="form.leader_name" placeholder="班组班长" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24" class="formUnitWrap">
|
||||
<el-form-item label="水耗统计">
|
||||
<el-input-number v-model="form.note" :precision="2" controls-position="right" placeholder="水耗统计" style="width: 100%;"></el-input-number>
|
||||
</el-form-item>
|
||||
<span class="formUnit">(t)</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-main>
|
||||
<el-footer>
|
||||
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
emits: ["success", "closed"],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
mode: "add",
|
||||
titleMap: {
|
||||
add: "其他能源录入",
|
||||
edit: "其他能源录入",
|
||||
show: "其他能源录入",
|
||||
},
|
||||
form: {
|
||||
type:10,
|
||||
},
|
||||
rules: {
|
||||
name: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
number: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
keeper_name: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
belong_dept: [{required: true, message: "请选择", trigger: "blur"}]
|
||||
},
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
keeperOptions: [],
|
||||
depOptions: [],
|
||||
selectionFilters: [],
|
||||
setFiltersVisible: false,
|
||||
teamOptions:[],
|
||||
shiftOptions:[],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
//获取班组
|
||||
this.getTeam();
|
||||
this.getShfit();
|
||||
},
|
||||
methods: {
|
||||
getTeam(){
|
||||
this.$API.mtm.team.list.req({page:0}).then(res=>{
|
||||
this.teamOptions = res;
|
||||
})
|
||||
},
|
||||
getShfit(){
|
||||
this.$API.mtm.shift.req({page:0}).then(res=>{
|
||||
this.shiftOptions = res;
|
||||
})
|
||||
},
|
||||
//显示
|
||||
open(mode = "add") {
|
||||
this.mode = mode;
|
||||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
teamChange(data){
|
||||
let that = this;
|
||||
that.teamOptions.forEach(item=>{
|
||||
if(item.id==data){
|
||||
that.form.leader_name = item.leader_name;
|
||||
that.form.leader= item.leader;
|
||||
}
|
||||
})
|
||||
},
|
||||
//表单提交方法
|
||||
submit() {
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.isSaveing = true;
|
||||
try {
|
||||
let obj={};
|
||||
obj.note = this.form.note;
|
||||
obj.team = this.form.team;
|
||||
obj.shift = this.form.shift;
|
||||
obj.leader = this.form.leader;
|
||||
this.$API.wpm.sflog.update.req(this.form.id,obj).then(res=>{
|
||||
this.isSaveing = false;
|
||||
this.$emit("success", this.form, this.mode);
|
||||
this.visible = false;
|
||||
this.$message.success("操作成功");
|
||||
return res;
|
||||
})
|
||||
} catch (err) {
|
||||
//可以处理校验错误
|
||||
this.isSaveing = false;
|
||||
return err;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//表单注入数据
|
||||
setData(data) {
|
||||
Object.assign(this.form,data);
|
||||
},
|
||||
//设置过滤项
|
||||
setFilters(filters) {
|
||||
this.selectionFilters = filters;
|
||||
this.setFiltersVisible = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.formUnit{
|
||||
position: absolute;
|
||||
right: -17px;
|
||||
top: 7px;
|
||||
}
|
||||
.formUnitWrap{
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
@ -398,6 +398,8 @@ export default {
|
|||
this.$API.rpm.member.leave.req(this.leaveId,{reason:this.reason}).then(res=>{
|
||||
this.leaveVisible = false;
|
||||
this.btnloading = false;
|
||||
this.getMemberList();
|
||||
this.getLogs();
|
||||
}).catch(e=>{
|
||||
this.btnloading = false;
|
||||
})
|
||||
|
|
|
|||
|
|
@ -0,0 +1,161 @@
|
|||
<!-- 全厂电量统计 -->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card style="margin-top:5px">
|
||||
<div ref="print" id="myReport" class="printContainer">
|
||||
<h3 style="text-align: center;">全厂电量统计</h3>
|
||||
<table border="1" cellspacing="0" :key="timeStamp" id="numTable">
|
||||
<thead style="background: #efefef;height: 40px;">
|
||||
<tr>
|
||||
<th>车间</th>
|
||||
<th>工段</th>
|
||||
<th>设备</th>
|
||||
<th>上一个小时(KW·h)</th>
|
||||
<th>昨日电量累计(KW·h)</th>
|
||||
<th>本月电量累计(KW·h)</th>
|
||||
<th>本年电量累计(KW·h)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="(item,index) in tableDatas" :key="index">
|
||||
<td class="numCell" v-if="index==0" rowspan="9">{{item[0]}}</td>
|
||||
<td class="numCell" v-else-if="index==9" rowspan="18">{{item[0]}}</td>
|
||||
<td class="numCell" v-else-if="index==27" rowspan="12">{{item[0]}}</td>
|
||||
<td class="numCell" v-else-if="index==39" rowspan="10" colspan="2">{{item[0]}}</td>
|
||||
<td class="numCell" v-else-if="index==49" colspan="3">{{item[0]}}</td>
|
||||
<td class="numCell" v-if="index==8||index==26||index==37||index==38" colspan="2">{{item[1]}}</td>
|
||||
<td class="numCell" v-else>{{item[1]}}</td>
|
||||
<td class="numCell">{{item[2]}}</td>
|
||||
|
||||
<td class="numCell">{{item[3]}}</td>
|
||||
<td class="numCell">{{item[4]}}</td>
|
||||
<td class="numCell" v-if="index!==49">{{item[5]}}</td>
|
||||
<td class="numCell" style="display:none" v-if="index==8||index==26||index==37||index==38||index==39||index==40||index==41||index==42||index==43||index==44||index==45||index==46||index==47||index==48||index==49"></td>
|
||||
<td class="numCell" v-else>{{item[6]}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
query:{
|
||||
year:'',
|
||||
month:'',
|
||||
days:'',
|
||||
},
|
||||
tableDatas:[
|
||||
['原料车间','电石渣','电石渣',1,2,3,4 ],
|
||||
['原料车间','原料磨','反击式破碎机',1,2,3,4],
|
||||
['原料车间','原料磨','立磨主电机'],
|
||||
['原料车间','原料磨','循环风机'],
|
||||
['原料车间','原料磨','烘干破主电机'],
|
||||
['原料车间','原料磨','废气风机' ],
|
||||
['原料车间','原料磨','尾排风机'],
|
||||
['原料车间','原料磨','原料磨合计' ],
|
||||
['原料车间','原料车间合计'],
|
||||
|
||||
['烧成车间','回转窑','高温风机'],
|
||||
['烧成车间','回转窑','窑主电机'],
|
||||
['烧成车间','回转窑','篦冷机一室风机电机'],
|
||||
['烧成车间','回转窑','篦冷机三室风机电机'],
|
||||
['烧成车间','回转窑','篦冷机二室风机电机'],
|
||||
['烧成车间','回转窑','篦冷机一室充气梁风机(左)电机'],
|
||||
['烧成车间','回转窑','篦冷机一室充气梁风机(右)电机'],
|
||||
['烧成车间','回转窑','窑头排风机主电机'],
|
||||
['烧成车间','回转窑','头煤粉罗茨电机(东、备用)'],
|
||||
['烧成车间','回转窑','尾煤粉罗茨电机(西)'],
|
||||
['烧成车间','回转窑','空压机3301'],
|
||||
['烧成车间','回转窑','空压机3308'],
|
||||
['烧成车间','回转窑','空压机3318'],
|
||||
['烧成车间','回转窑','回转窑合计'],
|
||||
['烧成车间','煤磨','煤磨主电机'],
|
||||
['烧成车间','煤磨','煤磨排风机主电机'],
|
||||
['烧成车间','煤磨','煤磨合计'],
|
||||
['烧成车间','烧成车间合计'],
|
||||
|
||||
['水泥车间','水泥磨','循环风机1906'],
|
||||
['水泥车间','水泥磨','系统风机'],
|
||||
['水泥车间','水泥磨','水平涡流选粉机1915'],
|
||||
['水泥车间','水泥磨','水泥磨主电机'],
|
||||
['水泥车间','水泥磨','辊压机动辊电机'],
|
||||
['水泥车间','水泥磨','辊压机定辊电机'],
|
||||
['水泥车间','水泥磨','新增磨尾风机'],
|
||||
['水泥车间','水泥磨','水泥1#空压机'],
|
||||
['水泥车间','水泥磨','水泥2#空压机'],
|
||||
['水泥车间','水泥磨','水泥磨合计计'],
|
||||
['水泥车间','水泥包装合计'],
|
||||
['水泥车间','水泥车间合计'],
|
||||
|
||||
['生活区','食堂'],
|
||||
['生活区','单元楼'],
|
||||
['生活区','单身宿舍'],
|
||||
['生活区','办公楼'],
|
||||
['生活区','余热锅炉'],
|
||||
['生活区','污水站'],
|
||||
['生活区','南门办公区'],
|
||||
['生活区','东门办公区'],
|
||||
['生活区','地磅'],
|
||||
['生活区','生活区合计'],
|
||||
['全厂电量'],
|
||||
],
|
||||
sourceData:{}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.test(0)
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
test(index){
|
||||
if(index!==8&&index==!22&&index==!26&&index==!37&&index==!38&&index!==48&&index!==49){
|
||||
console.log(index)
|
||||
}
|
||||
},
|
||||
getData(){
|
||||
this.$API.bi.dataset.exec.req('3349203178834325504',).then((res) => {
|
||||
let data0 = this.sourceData = res.data2.ds0;
|
||||
// debugger;
|
||||
console.log(this.sourceData)
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
handlePrint() {
|
||||
this.$PRINT('#myReport');
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.printContainer{
|
||||
width: 1075px;
|
||||
}
|
||||
#numTable{
|
||||
margin-left: 37px;
|
||||
}
|
||||
#numTable td{
|
||||
height: 32px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
.numCell{
|
||||
width: 80px;
|
||||
}
|
||||
.numCell.numCell_last{
|
||||
width: 100px;
|
||||
}
|
||||
.searchHead{
|
||||
display:flex
|
||||
}
|
||||
.middleText{
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
margin: 0 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
.searchBtn{
|
||||
margin-left: 5px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -2,37 +2,65 @@
|
|||
<div class="app-container">
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-select
|
||||
v-model="query.type"
|
||||
placeholder="查询类型"
|
||||
clearable
|
||||
@change="typeCange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-date-picker
|
||||
v-model="query.month"
|
||||
type="month"
|
||||
value-format="YYYY-MM"
|
||||
format="YYYY-MM"
|
||||
placeholder="查询月份"
|
||||
v-if="query.type==0"
|
||||
/>
|
||||
<el-date-picker
|
||||
v-model="query.year"
|
||||
type="year"
|
||||
value-format="YYYY"
|
||||
format="YYYY"
|
||||
placeholder="年"
|
||||
placeholder="查询年份"
|
||||
v-if="query.type==1"
|
||||
/>
|
||||
<el-date-picker
|
||||
v-model="query.month"
|
||||
type="month"
|
||||
value-format="YYYY-MM"
|
||||
format="YYYY-MM"
|
||||
placeholder="月份"
|
||||
/>
|
||||
<el-date-picker
|
||||
v-model="query.month"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
format="YYYY-MM-DD"
|
||||
placeholder="日"
|
||||
v-model="query.yearStart"
|
||||
type="year"
|
||||
value-format="YYYY"
|
||||
format="YYYY"
|
||||
placeholder="起始年份"
|
||||
v-if="query.type==2"
|
||||
/>
|
||||
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleQuery"
|
||||
@click="getTableData"
|
||||
></el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="exportExcel()"
|
||||
:loading = "exportLoading"
|
||||
>导出xlsx
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handlePrint"
|
||||
>打印
|
||||
</el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-card style="margin-top:5px">
|
||||
<div ref="print" id="myReport" class="printContainer">
|
||||
<h3 style="text-align: center;">主要设备(100KW以上)单位产品电耗数据表</h3>
|
||||
<h3 style="text-align: center;">{{ tableName }}</h3>
|
||||
<table border="1" cellspacing="0" :key="timeStamp" id="numTable">
|
||||
<thead style="background: #efefef;height: 40px;">
|
||||
<tr>
|
||||
|
|
@ -87,6 +115,7 @@
|
|||
<td class="numCell">{{item.hours}}</td>
|
||||
<td class="numCell">{{item.days}}</td>
|
||||
<td class="numCell">{{item.months}}</td>
|
||||
<td class="numCell">{{item.months}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="1" cellspacing="0" :key="timeStamp" id="numTable">
|
||||
|
|
@ -99,14 +128,11 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tr v-for="(item,index) in tableDatas2" :key="index">
|
||||
|
||||
<td v-if="index==0||index==12" rowspan="5">{{item[0]}}</td>
|
||||
<td v-else-if="index==5" rowspan="7">{{item[0]}}</td>
|
||||
|
||||
<td class="numCell" v-if="index==0||index==2||index==9||index==12||index==14" rowspan="2">{{item[1]}}</td>
|
||||
<td class="numCell" v-else-if="index==5" rowspan="4">{{item[1]}}</td>
|
||||
<td class="numCell" v-if="index==4||index==11||index==16" colspan="2">{{item[1]}}</td>
|
||||
|
||||
<td class="numCell">{{item[2]}}</td>
|
||||
<td class="numCell">{{item[3]}}</td>
|
||||
<td class="numCell">{{item[4]}}</td>
|
||||
|
|
@ -116,9 +142,6 @@
|
|||
<td class="numCell">{{item[7]}}</td>
|
||||
<td class="numCell">{{item[7]}}</td>
|
||||
<td class="numCell" v-if="index!==4&&index!==11&&index!==16">{{item[8]}}</td>
|
||||
<!--
|
||||
<td class="numCell">{{item.days}}</td>
|
||||
<td class="numCell">{{item.months}}</td> -->
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
|
@ -130,10 +153,17 @@
|
|||
data() {
|
||||
return {
|
||||
query:{
|
||||
type:0,
|
||||
year:'',
|
||||
month:'',
|
||||
days:'',
|
||||
yearStart:'',
|
||||
},
|
||||
tableName:'全场能源日统计',
|
||||
options:[
|
||||
{id:0,name:'日统计'},
|
||||
{id:1,name:'月统计'},
|
||||
{id:2,name:'年统计'},
|
||||
],
|
||||
tableDatas:[
|
||||
{month:'2023.1',name:'甲组',number:'NM001',unit:'KW·h/t',hours:'1',days:'2',months:'3'},
|
||||
{month:'2023.1',name:'乙组',number:'NM002',unit:'KW·h/t',hours:'1',days:'2',months:'3'},
|
||||
|
|
@ -168,27 +198,61 @@
|
|||
};
|
||||
},
|
||||
mounted() {
|
||||
var myDate = new Date();
|
||||
let month = myDate.getMonth()+1;
|
||||
if(month<10){
|
||||
month = '0'+month;
|
||||
}
|
||||
this.query.month = myDate.getFullYear()+'-'+month;
|
||||
this.getData();
|
||||
|
||||
},
|
||||
methods: {
|
||||
typeCange(value){
|
||||
if(value==1){
|
||||
this.tableName = '全场能源日统计'
|
||||
}else if(value==1){
|
||||
this.tableName = '全场能源月统计'
|
||||
}else{
|
||||
this.tableName = '全场能源年统计'
|
||||
}
|
||||
},
|
||||
getData(){
|
||||
this.$API.bi.dataset.exec.req('3349203178834325504',).then((res) => {
|
||||
let data0 = this.sourceData = res.data2.ds0;
|
||||
// debugger;
|
||||
console.log(this.sourceData)
|
||||
data0.forEach(item => {
|
||||
for(let i=0;i<tableDatas2.length;i++){
|
||||
if(item.车间==tableDatas2[i][0]){
|
||||
if(item.工段==tableDatas2[i][1]){
|
||||
if(item.能源分类==tableDatas2[i][2]){
|
||||
let inde = item.班日+2
|
||||
tableDatas2[i][inde] = item.消耗量
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
let that = this;
|
||||
let params = {query:{}};
|
||||
let id = '';
|
||||
let arr = [];
|
||||
if(that.query.type==0){//日
|
||||
arr = that.query.month.split('-');
|
||||
params.query.year_s = arr[0];
|
||||
params.query.month_s = arr[1];
|
||||
id='energy_day'
|
||||
}else if(that.query.type==1){//月
|
||||
params.query.year_s = that.query.year;
|
||||
id='energy_month'
|
||||
}else{//年
|
||||
params.query.year_s = that.query.yearStart;
|
||||
id='energy_year'
|
||||
}
|
||||
this.$API.bi.dataset.exec.req(id,params).then((res) => {
|
||||
that.tableName = res.name;
|
||||
let data = res.data.ds0;
|
||||
that.tableHead = data[0];
|
||||
let data0 = data.slice(1,data.length);
|
||||
console.log(this.sourceData)
|
||||
let tableDatas2 = that.tableDatas2;
|
||||
// data0.forEach(item => {
|
||||
// for(let i=0;i<tableDatas2.length;i++){
|
||||
// if(item[3]==tableDatas2[i][0]){
|
||||
// if(item[4]==tableDatas2[i][1]){
|
||||
// if(item[5]==tableDatas2[i][2]){
|
||||
// let ind = item[2]+2;
|
||||
// tableDatas2[i][ind] = item[6]
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -55,14 +55,14 @@
|
|||
<scTable ref="table" :apiObj="apiObj" row-key="id" hidePagination>
|
||||
<el-table-column label="#" type="index" width="50"></el-table-column>
|
||||
<el-table-column label="年" prop="year" min-width="100"></el-table-column>
|
||||
<el-table-column label="月" prop="month" min-width="100">
|
||||
<el-table-column label="月" prop="month" min-width="100"></el-table-column>
|
||||
<el-table-column label="单位成本" prop="cost_unit" min-width="150"></el-table-column>
|
||||
<el-table-column label="关联工段" prop="mgroup_name" min-width="150"></el-table-column>
|
||||
<el-table-column label="关联费用" prop="fee" min-width="150">
|
||||
<template #default="scope">
|
||||
<span>{{ cates_[scope.row.cate] }}</span>
|
||||
<span>{{ scope.row.fee_.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位成本" prop="cost_unit" min-width="150"></el-table-column>
|
||||
<el-table-column label="关联工段" prop="mgroup" min-width="150"></el-table-column>
|
||||
<el-table-column label="关联费用" prop="fee" min-width="150"></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="140">
|
||||
<template #default="scope">
|
||||
<el-button link size="small" @click="table_edit(scope.row)" v-auth="'team.update'" type="primary">编辑</el-button>
|
||||
|
|
@ -161,7 +161,7 @@
|
|||
//本地更新数据
|
||||
//新增岗位后更新数据
|
||||
handleSaveSuccess(data, mode) {
|
||||
this.dialog.save = true;
|
||||
this.dialog.save = false;
|
||||
this.$refs.table.refresh();
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,21 +18,9 @@
|
|||
>
|
||||
<el-row>
|
||||
<el-col :lg="12" :md="24">
|
||||
<el-form-item label="年份" prop="cost_unit">
|
||||
<el-form-item label="月份" prop="date">
|
||||
<el-date-picker
|
||||
v-model="form.year"
|
||||
type="year"
|
||||
value-format="YYYY"
|
||||
format="YYYY"
|
||||
placeholder="年"
|
||||
style="width: 100%;"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12" :md="24">
|
||||
<el-form-item label="月份" prop="cost_unit">
|
||||
<el-date-picker
|
||||
v-model="form.month"
|
||||
v-model="form.date"
|
||||
type="month"
|
||||
value-format="YYYY-MM"
|
||||
format="YYYY-MM"
|
||||
|
|
@ -158,6 +146,10 @@
|
|||
},
|
||||
//表单注入数据
|
||||
setData(data) {
|
||||
let year = data.year+'';
|
||||
let month = data.month<10?'0'+data.month:data.month+'';
|
||||
month = year+'-'+month;
|
||||
data.date = month;
|
||||
Object.assign(this.form,data);
|
||||
},
|
||||
getReceptionist(data) {
|
||||
|
|
@ -170,12 +162,17 @@
|
|||
that.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
that.isSaveing = true;
|
||||
if(that.type==='add'){
|
||||
let arr = that.form.date.split('-');
|
||||
that.form.year = arr[0];
|
||||
that.form.month = arr[1];
|
||||
if(that.mode==='add'){
|
||||
that.$API.fim.feeset.create.req(that.form).then(res=>{
|
||||
that.isSaveing = false;
|
||||
that.$emit("success", that.form, that.mode);
|
||||
that.visible = false;
|
||||
that.$message.success("操作成功");
|
||||
}).catch(res=>{
|
||||
that.isSaveing = false;
|
||||
})
|
||||
}else{
|
||||
res = that.$API.fim.feeset.update.req(that.form.id,that.form).then(res=>{
|
||||
|
|
@ -183,6 +180,8 @@
|
|||
that.$emit("success", that.form, that.mode);
|
||||
that.visible = false;
|
||||
that.$message.success("操作成功");
|
||||
}).catch(res=>{
|
||||
that.isSaveing = false;
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,11 +21,12 @@
|
|||
<span>{{ types_[scope.row.type] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检测项目" prop="testitems" min-width="150">
|
||||
<!-- <template #default="scope">
|
||||
<el-table-column label="排序" prop="sort" min-width="60"></el-table-column>
|
||||
<!-- <el-table-column label="检测项目" prop="testitems" min-width="150">
|
||||
<template #default="scope">
|
||||
<span v-for="item in scope.row.testitems">{{ item.name }}</span>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" fixed="right" align="center" width="140">
|
||||
<template #default="scope">
|
||||
<el-button link size="small" @click="roleEdit(scope.row)" v-auth="'team.update'" type="primary">编辑</el-button>
|
||||
|
|
@ -77,6 +78,14 @@
|
|||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位成本" prop="price_unit">
|
||||
<el-input-number
|
||||
v-model="form.sort"
|
||||
:precision="0"
|
||||
style="width: 100%;"
|
||||
clearable>
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="limitedVisible=false" >取 消</el-button>
|
||||
|
|
@ -90,6 +99,7 @@
|
|||
name: "",
|
||||
code: "",
|
||||
type: "",
|
||||
sort:1,
|
||||
testitems: [],
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,137 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-date-picker
|
||||
v-model="query.month"
|
||||
type="month"
|
||||
value-format="YYYY-MM"
|
||||
format="YYYY-MM"
|
||||
placeholder="月"
|
||||
style="width: 120px;margin-right: 5px;"
|
||||
/>
|
||||
<el-select
|
||||
v-model="query.fee"
|
||||
placeholder="物料"
|
||||
clearable
|
||||
style="width: 120px;margin-right: 5px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="table_add" v-auth="'role.create'"></el-button>
|
||||
</div>
|
||||
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable ref="table" :apiObj="apiObj" row-key="id" hidePagination>
|
||||
<el-table-column label="#" type="index" width="50"></el-table-column>
|
||||
<el-table-column label="年" prop="year" min-width="100"></el-table-column>
|
||||
<el-table-column label="月" prop="month" min-width="100"></el-table-column>
|
||||
<el-table-column label="关联物料" prop="material_name" min-width="150"></el-table-column>
|
||||
<el-table-column label="单价" prop="price_unit" min-width="150"></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="140">
|
||||
<template #default="scope">
|
||||
<el-button link size="small" @click="table_edit(scope.row)" v-auth="'team.update'" type="primary">编辑</el-button>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
|
||||
<template #reference>
|
||||
<el-button link size="small" v-auth="'role.delete'" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
<save-dialog
|
||||
v-if="dialog.save"
|
||||
ref="saveDialog"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
></save-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import saveDialog from "./priceset_form.vue";
|
||||
export default {
|
||||
name: 'dept',
|
||||
components: {
|
||||
saveDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
apiObj: this.$API.fim.priceset.list,
|
||||
query: {
|
||||
year:'',
|
||||
month:'',
|
||||
material:'',
|
||||
},
|
||||
dialog: {
|
||||
save: false,
|
||||
},
|
||||
selection:[],
|
||||
options:[],
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.getMaterial();
|
||||
},
|
||||
methods: {
|
||||
//获取物料列表
|
||||
getMaterial(){
|
||||
this.$API.mtm.material.list.req({page:0}).then(res=>{
|
||||
this.options = res;
|
||||
})
|
||||
},
|
||||
//添加
|
||||
table_add() {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("add");
|
||||
});
|
||||
},
|
||||
//编辑
|
||||
table_edit(row) {
|
||||
this.dialog.save = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.saveDialog.open("edit").setData(row);
|
||||
});
|
||||
},
|
||||
//删除测点集
|
||||
async table_del(row){
|
||||
var id = row.id;
|
||||
var res = await this.$API.mtm.mgroup.delete.req(id);
|
||||
if(res.err_msg){
|
||||
this.$message.error(res.err_msg)
|
||||
}else{
|
||||
this.$refs.table.refresh();
|
||||
this.$message.success("删除成功")
|
||||
}
|
||||
},
|
||||
//表格选择后回调事件
|
||||
selectionChange(selection){
|
||||
this.selection = selection;
|
||||
},
|
||||
//搜索
|
||||
handleQuery(){
|
||||
this.$refs.table.queryData(this.query)
|
||||
},
|
||||
//本地更新数据
|
||||
//新增岗位后更新数据
|
||||
handleSaveSuccess(data, mode) {
|
||||
this.dialog.save = false;
|
||||
this.$refs.table.refresh();
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.treeMain {width: 100%;height:280px;overflow: auto;border: 1px solid #dcdfe6;margin-bottom: 10px;}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,182 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
:title="titleMap[mode]"
|
||||
v-model="visible"
|
||||
:size="1000"
|
||||
destroy-on-close
|
||||
@closed="$emit('closed')"
|
||||
>
|
||||
<el-container v-loading="loading">
|
||||
<el-main style="padding: 0 20px 20px 20px">
|
||||
<el-form
|
||||
ref="dialogForm"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
style="padding: 0 10px;"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :lg="12" :md="24">
|
||||
<el-form-item label="月份" prop="date">
|
||||
<el-date-picker
|
||||
v-model="form.date"
|
||||
type="month"
|
||||
value-format="YYYY-MM"
|
||||
format="YYYY-MM"
|
||||
placeholder="月"
|
||||
style="width: 100%;"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12" :md="24">
|
||||
<el-form-item label="关联物料" prop="material">
|
||||
<el-select
|
||||
v-model="form.material"
|
||||
placeholder="关联物料"
|
||||
clearable
|
||||
style="width: 100%;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12" :md="24">
|
||||
<el-form-item label="单位成本" prop="price_unit">
|
||||
<el-input-number
|
||||
v-model="form.price_unit"
|
||||
controls-position="right"
|
||||
:precision="2"
|
||||
style="width: 100%;"
|
||||
clearable>
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-main>
|
||||
<el-footer>
|
||||
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const defaultForm = {
|
||||
date:'',
|
||||
year: "",
|
||||
month:'',
|
||||
material:'',
|
||||
price_unit:'',
|
||||
};
|
||||
export default {
|
||||
emits: ["success", "closed"],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
mode: "add",
|
||||
titleMap: {
|
||||
add: '新增物料价格',
|
||||
edit: '编辑物料价格',
|
||||
show: '查看物料价格'
|
||||
},
|
||||
//表单数据
|
||||
form: {
|
||||
},
|
||||
//验证规则
|
||||
rules: {
|
||||
date: [{required: true, message: "请选择月份", trigger: "blur"}],
|
||||
material: [{required: true, message: "请选择主要产品", trigger: "blur"}],
|
||||
price_unit: [{required: true, message: "请输入单位成本", trigger: "blur"}]
|
||||
},
|
||||
visible: false,
|
||||
isSaveing: false,
|
||||
options: [],
|
||||
setFiltersVisible: false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getMaterial();
|
||||
},
|
||||
methods: {
|
||||
//获取物料列表
|
||||
getMaterial(){
|
||||
this.$API.mtm.material.list.req({page:0,type:10}).then(res=>{
|
||||
let data = [];
|
||||
res.forEach(element => {
|
||||
if(element.type!==0){
|
||||
data.push(element)
|
||||
}
|
||||
});
|
||||
this.options = data;
|
||||
})
|
||||
},
|
||||
//显示
|
||||
open(mode = "add") {
|
||||
this.mode = mode;
|
||||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
//表单注入数据
|
||||
setData(data) {
|
||||
let year = data.year+'';
|
||||
let month = data.month<10?'0'+data.month:data.month+'';
|
||||
month = year+'-'+month;
|
||||
data.date = month;
|
||||
Object.assign(this.form,data);
|
||||
},
|
||||
getReceptionist(data) {
|
||||
this.form.leader=data.id;
|
||||
this.form.leader_name=data.name
|
||||
},
|
||||
//表单提交方法
|
||||
submit() {
|
||||
let that = this;
|
||||
that.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
that.isSaveing = true;
|
||||
let arr = that.form.date.split('-');
|
||||
that.form.year = arr[0];
|
||||
that.form.month = arr[1];
|
||||
if(that.mode==='add'){
|
||||
that.$API.fim.priceset.create.req(that.form).then(res=>{
|
||||
that.isSaveing = false;
|
||||
that.$emit("success", that.form, that.mode);
|
||||
that.visible = false;
|
||||
that.$message.success("操作成功");
|
||||
}).catch(res=>{
|
||||
that.isSaveing = false;
|
||||
})
|
||||
}else{
|
||||
res = that.$API.fim.priceset.update.req(that.form.id,that.form).then(res=>{
|
||||
that.isSaveing = false;
|
||||
that.$emit("success", that.form, that.mode);
|
||||
that.visible = false;
|
||||
that.$message.success("操作成功");
|
||||
}).catch(res=>{
|
||||
that.isSaveing = false;
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//设置过滤项
|
||||
setFilters(filters) {
|
||||
this.selectionFilters = filters;
|
||||
this.setFiltersVisible = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
|
@ -0,0 +1,239 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-select
|
||||
v-model="query.type"
|
||||
placeholder="查询类型"
|
||||
clearable
|
||||
@change="typeCange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
|
||||
<el-date-picker
|
||||
v-model="query.year"
|
||||
type="year"
|
||||
value-format="YYYY"
|
||||
format="YYYY"
|
||||
placeholder="年份"
|
||||
v-if="query.type==2"
|
||||
/>
|
||||
<el-date-picker
|
||||
v-model="query.month"
|
||||
type="month"
|
||||
value-format="YYYY-MM"
|
||||
format="YYYY-MM"
|
||||
placeholder="月份"
|
||||
v-if="query.type==1"
|
||||
/>
|
||||
|
||||
<el-date-picker
|
||||
v-model="query.day"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
format="YYYY-MM-DD"
|
||||
placeholder="日"
|
||||
v-if="query.type==0"
|
||||
/>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="getTableData"
|
||||
></el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="exportExcel()"
|
||||
:loading = "exportLoading"
|
||||
>导出xlsx
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handlePrint"
|
||||
>打印
|
||||
</el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-card style="margin-top:5px">
|
||||
<div ref="print" id="myReport" class="printContainer">
|
||||
<h3 style="text-align: center;">{{tableTime}}</h3>
|
||||
<table border="1" cellspacing="0" :key="timeStamp" id="myTable">
|
||||
<thead style="background: #efefef;height: 80px;">
|
||||
<tr colspan="7"> <th colspan="7">{{tableName}}</th></tr>
|
||||
<tr>
|
||||
<template v-for="(date,ind) in tableHead" :key="ind">
|
||||
<!-- <th v-if="ind==1" colspan="2">{{date}}</th> -->
|
||||
<th>{{date}}</th>
|
||||
</template>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="(item,index) in tableDatas" :key="index">
|
||||
|
||||
<td v-if="index==0" rowspan="7">{{item[0]}}</td>
|
||||
<td v-else-if="index==7" rowspan="8">{{item[0]}}</td>
|
||||
<td v-else-if="index==15" rowspan="3">{{item[0]}}</td>
|
||||
<td class="numCell" v-if="index==11||index==13" rowspan="2">{{item[1]}}</td>
|
||||
<td class="numCell" v-if="index==0||index==15" rowspan="3">{{item[1]}}</td>
|
||||
<td class="numCell" v-else-if="index==3||index==7" rowspan="4">{{item[1]}}</td>
|
||||
<td class="numCell">{{item[2]}}</td>
|
||||
<td class="numCell">{{item[3]}}</td>
|
||||
<td class="numCell">{{item[4]}}</td>
|
||||
<td class="numCell">{{item[5]}}</td>
|
||||
<td class="numCell">{{item[6]}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
timeStamp:0,
|
||||
query:{
|
||||
type:0,
|
||||
year:'',
|
||||
month:'',
|
||||
day:'',
|
||||
},
|
||||
options:[
|
||||
{id:0,name:'日报表'},
|
||||
{id:1,name:'月报表'},
|
||||
{id:2,name:'年报表'},
|
||||
],
|
||||
tableTime:'',
|
||||
tableName:'质检日报表',
|
||||
tableHead:['车间','物料','检验项目','平均值','检次','合次','合格率'],
|
||||
tableDatas:[
|
||||
['原料车间','辅料','细度', , , , , , ],
|
||||
['原料车间','辅料','Fe2O3', , , , , , ],
|
||||
['原料车间','辅料','水分', , , , , , ],
|
||||
['原料车间','干混生料','细度', , , , , , ],
|
||||
['原料车间','干混生料','Fe2O3', , , , , , ],
|
||||
['原料车间','干混生料','水分', , , , , , ],
|
||||
['原料车间','干混生料','CaO', , , , , , ],
|
||||
|
||||
['烧成车间','入窑生料','CaO', , , , , , ],
|
||||
['烧成车间','入窑生料','Fe2O3', , , , , , ],
|
||||
['烧成车间','入窑生料','细度'],
|
||||
['烧成车间','入窑生料','水分'],
|
||||
['烧成车间','熟料','立升重'],
|
||||
['烧成车间','熟料','f-CaO'],
|
||||
['烧成车间','煤粉','细度'],
|
||||
['烧成车间','煤粉','水分'],
|
||||
|
||||
['水泥车间','出磨水泥','比表面积'],
|
||||
['水泥车间','出磨水泥','SO3'],
|
||||
['水泥车间','出磨水泥','掺量'],
|
||||
],
|
||||
exportLoading:false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
var myDate = new Date();
|
||||
let month = myDate.getMonth()+1;
|
||||
let days = myDate.getDate();
|
||||
if(month<10){
|
||||
month = '0'+month;
|
||||
}
|
||||
if(days<10){
|
||||
days = '0'+days;
|
||||
}
|
||||
this.query.day = myDate.getFullYear()+'-'+month+'-'+days;
|
||||
debugger;
|
||||
console.log(this.query.day)
|
||||
this.getTableData();
|
||||
|
||||
},
|
||||
methods: {
|
||||
typeCange(value){
|
||||
if(value==1){
|
||||
this.tableName = '质检日报表'
|
||||
}else if(value==1){
|
||||
this.tableName = '质检月报表'
|
||||
}else{
|
||||
this.tableName = '质检年报表'
|
||||
}
|
||||
},
|
||||
getTableData(){
|
||||
let that = this;
|
||||
let params = {query:{}};
|
||||
let id = '';
|
||||
let arr = [];
|
||||
if(that.query.type==0){//日
|
||||
arr = that.query.day.split('-');
|
||||
params.query.year_s = arr[0];
|
||||
params.query.month_s = arr[1];
|
||||
params.query.day_s = arr[2];
|
||||
id='zjrbb'
|
||||
}else if(that.query.type==1){//月
|
||||
arr = that.query.month.split('-');
|
||||
params.query.year_s = arr[0];
|
||||
params.query.month_s = arr[1];
|
||||
id='zjybb'
|
||||
}else{//年
|
||||
params.query.year_s = that.query.year;
|
||||
id='zjnbb'
|
||||
}
|
||||
that.$API.bi.dataset.exec.req(id,params).then(res=>{
|
||||
that.time =
|
||||
that.tableName = res.name;
|
||||
let data = res.data.ds0;
|
||||
that.tableHead = data[0];
|
||||
that.tableDatas = data.slice(1,data.length);
|
||||
for(let i=0;i<that.tableDatas.length;i++){
|
||||
that.tableDatas[i][3] = that.tableDatas[i][3].tofixed(2);
|
||||
that.tableDatas[i][4] = that.tableDatas[i][4].tofixed(2);
|
||||
that.tableDatas[i][5] = that.tableDatas[i][5].tofixed(2);
|
||||
that.tableDatas[i][6] = that.tableDatas[i][6].tofixed(2);
|
||||
}
|
||||
that.tableDatas;
|
||||
})
|
||||
},
|
||||
handlePrint() {
|
||||
this.$PRINT('#myReport');
|
||||
},
|
||||
exportExcel() {
|
||||
this.exportLoading = true;
|
||||
this.$XLSX('#myTable', this.tableName)
|
||||
this.exportLoading = false;
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.printContainer{
|
||||
width: 1075px;
|
||||
}
|
||||
#myTable{
|
||||
margin-left: 37px;
|
||||
}
|
||||
#myTable td{
|
||||
height: 32px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
.numCell{
|
||||
width: 80px;
|
||||
}
|
||||
.numCell.numCell_last{
|
||||
width: 100px;
|
||||
}
|
||||
.searchHead{
|
||||
display:flex
|
||||
}
|
||||
.middleText{
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
margin: 0 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
.searchBtn{
|
||||
margin-left: 5px;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue