This commit is contained in:
shijing 2023-07-05 15:23:01 +08:00
parent d9181d1905
commit 89323113d6
22 changed files with 1823 additions and 943 deletions

149
src/api/model/fim.js Normal file
View File

@ -0,0 +1,149 @@
import config from "@/config"
import http from "@/utils/request"
/*EM接口*/
export default {
fee: {
name: "费用类型",
req: async function(data){
return await http.get(
`${config.API_URL}/fim/fee/`,
data
);
}
},
// 工段成本配置
feeset: {
list: {
name: "工段成本配置列表",
req: async function(data){
return await http.get(
`${config.API_URL}/fim/feeset/`,
data
);
}
},
itfim: {
name: "获取段成本配置",
req: async function(id){
return await http.get(
`${config.API_URL}/fim/feeset/${id}/`
);
}
},
update: {
name: "更新",
req: async function(id, data){
return await http.put(
`${config.API_URL}/fim/feeset/${id}/`,
data);
}
},
create: {
name: "创建",
req: async function(data){
return await http.post(
`${config.API_URL}/fim/feeset/`,
data);
}
},
delete: {
name: "删除",
req: async function(id){
return await http.delete(
`${config.API_URL}/fim/feeset/${id}/`);
}
},
deletes: {
name: "批量删除",
req: async function(data){
return await http.post(
`${config.API_URL}/fim/feeset/deletes/`,
data);
}
},
cquery: {
name: "复杂查询",
req: async function(data){
return await http.post(
`${config.API_URL}/fim/feeset/cquery/`,
data);
}
},
deleteHard: {
name: "批量物理删除",
req: async function(data){
return await http.post(
`${config.API_URL}/fim/feeset/deletes_hard/`,
data);
}
},
},
// 物料价格配置
priceset: {
list: {
name: "物料价格配置列表",
req: async function(data){
return await http.get(
`${config.API_URL}/fim/priceset/`,
data
);
}
},
itfim: {
name: "获取物料价格配置",
req: async function(id){
return await http.get(
`${config.API_URL}/fim/priceset/${id}/`
);
}
},
update: {
name: "更新",
req: async function(id, data){
return await http.put(
`${config.API_URL}/fim/priceset/${id}/`,
data);
}
},
create: {
name: "创建",
req: async function(data){
return await http.post(
`${config.API_URL}/fim/priceset/`,
data);
}
},
delete: {
name: "删除",
req: async function(id){
return await http.delete(
`${config.API_URL}/fim/priceset/${id}/`);
}
},
deletes: {
name: "批量删除",
req: async function(data){
return await http.post(
`${config.API_URL}/fim/priceset/deletes/`,
data);
}
},
cquery: {
name: "复杂查询",
req: async function(data){
return await http.post(
`${config.API_URL}/fim/priceset/cquery/`,
data);
}
},
deleteHard: {
name: "批量物理删除",
req: async function(data){
return await http.post(
`${config.API_URL}/fim/priceset/deletes_hard/`,
data);
}
},
},
}

View File

@ -208,7 +208,7 @@ export default {
name: "班次列表",
req: async function(data){
return await http.get(
`${config.API_URL}/mtm/team/`,
`${config.API_URL}/mtm/shift/`,
data
);
}

View File

@ -10,6 +10,17 @@ export default {
return await http.get(this.url, data);
}
},
//质量分析报告更新
updateQuastat: {
name: "质量报告分析",
req: async function(id,data){
return await http.put(
`${config.API_URL}/qm/quastat/${id}/`,
data
);
}
},
//班组记录添加质量分析
createQuastat: {
url: `${config.API_URL}/qm/quastat/`,

View File

@ -68,6 +68,14 @@ export default {
data);
}
},
init_test: {
name: "初始化检测录入",
req: async function(id){
return await http.get(
`${config.API_URL}/wpm/sflog/${id}/init_test/`
);
}
},
},
//停机记录
stlog: {

View File

@ -174,16 +174,6 @@ const routes = [
},
"component": "rm_enm/handoverLog"
},
{
"name": "handovereEnter",
"path": "/rm_enm/handovereEnter",
"meta": {
"title": "交接班记录",
"icon": "el-icon-grid",
"perms": ["bi"]
},
"component": "rm_enm/handovereEnter"
}
]
},
{
@ -809,7 +799,7 @@ const routes = [
"icon": "el-icon-postcard",
"type": "menu",
},
"component": "sys/team"
"component": "ungrouped/team"
},
{
"name": "mgruop",
@ -823,24 +813,34 @@ const routes = [
},
{
"name": "mpoint",
"path": "/ungrouped/mpoint",
"path": "/em/mpoint",
"meta": {
"title": "测点",
"icon": "el-icon-grid",
"perms": ["dataset"]
},
"component": "ungrouped/mpoint"
"component": "em/mpoint"
},
{
"name": "material",
"path": "/ungrouped/material",
"meta": {
"title": "产品",
"title": "物料",
"icon": "el-icon-grid",
"perms": ["dataset"]
},
"component": "ungrouped/material"
},
{
"name": "feeset",
"path": "/ungrouped/feeset",
"meta": {
"title": "工段成本配置",
"icon": "el-icon-grid",
"perms": ["dataset"]
},
"component": "ungrouped/feeset"
},
{
"name": "goalSetting",
"path": "/ungrouped/goalSetting",
@ -851,6 +851,16 @@ const routes = [
},
"component": "ungrouped/goalSetting"
},
{
"name": "energy",
"path": "/ungrouped/energy",
"meta": {
"title": "能源统计",
"icon": "el-icon-grid",
"perms": ["bi"]
},
"component": "ungrouped/energy"
}
]
},
{

View File

@ -85,7 +85,7 @@
.el-footer {
background: #fff;
border-top: 1px solid var(--el-border-color-light);
// border-top: 1px solid var(--el-border-color-light);
padding: 13px 15px;
height: 51px;
}

View File

@ -94,14 +94,19 @@
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="所属部门">
<el-cascader
<el-select
v-model="form.belong_dept"
:options="group"
:props="groupsProps"
:show-all-levels="false"
placeholder="所属部门"
clearable
style="width: 100%"
></el-cascader>
>
<el-option
v-for="item in group"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
@ -135,7 +140,6 @@
</template>
<script>
import {genTree} from "@/utils/verificate";
const defaultForm = {
state:10,
count:10,
@ -195,11 +199,6 @@ export default {
selectionFilters: [],
setFiltersVisible: false,
belong_dept_options: [],
groupsProps: {
multiple: false,
emitPath: false,
checkStrictly: true,
},
group: [],
};
},
@ -207,10 +206,11 @@ export default {
this.getGroup();
},
methods: {
//
async getGroup() {
let res = await this.$API.system.dept.list.req({ page: 0 });
this.group = genTree(res);
//
getGroup() {
this.$API.system.dept.list.req({ page_size: 3 , type:'dept'}).then(res=>{
this.group = res.results;
});
},
getReceptionist(data) {
this.form.keeper=data.id;
@ -253,15 +253,6 @@ export default {
},
//
setData(data) {
// this.loading = true
// const params = {
// id: data.id
// }
// setTimeout(async ()=>{
// var res = await this.$API.system.table.info.get(params)
// this.loading = false
// this.form = res.data
// },400)
Object.assign(this.form, data);
},
//

View File

@ -8,66 +8,30 @@
clearable
@keyup.enter="handleQuery"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
<el-button type="primary" icon="el-icon-plus" @click="table_add"></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
>
<scTable ref="table" :apiObj="apiObj" row-key="id" @selection-change="selectionChange" hidePagination>
<el-table-column label="#" type="index" width="50"></el-table-column>
<el-table-column label="测点名称" prop="name" width="240" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="测点编号" prop="code" width="180"></el-table-column>
<el-table-column label="单位" prop="unit" width="180"></el-table-column>
<el-table-column label="分类" prop="cate" width="180"></el-table-column>
<el-table-column label="创建人" prop="create_by"></el-table-column>
<el-table-column label="最后编辑人" prop="update_by"></el-table-column>
<el-table-column label="所属部门" prop="belong_dept">
<el-table-column label="名称" prop="name" min-width="100"></el-table-column>
<el-table-column label="计量物料" prop="material_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="mgroup_name" 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="140">
<template #default="scope">
{{scope.row.belong_dept_name}}
</template>
</el-table-column>
<el-table-column label="检测设备" prop="ep_monitored"></el-table-column>
<el-table-column label="所属设备" prop="ep_belong"></el-table-column>
<el-table-column label="所在集合" prop="mgroup"></el-table-column>
<el-table-column label="操作" fixed="right" align="left" width="200">
<template #default="scope">
<el-button
link
type="primary"
size="small"
@click="mplog(scope.row)"
>原始记录</el-button
>
<el-button
link
type="primary"
size="small"
@click="table_show(scope.row)"
>查看</el-button
>
<el-button
link
type="warning"
size="small"
@click="table_edit(scope.row)"
v-auth="'rparty.update'"
>编辑</el-button
>
<el-popconfirm
title="确定删除吗?"
@confirm="table_del(scope.row)"
>
<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 type="danger" size="small" v-auth="'rparty.delete'">删除</el-button>
<el-button link size="small" v-auth="'role.delete'" type="danger">删除</el-button>
</template>
</el-popconfirm>
</template>
@ -111,7 +75,7 @@ export default {
},
methods: {
//
add() {
table_add() {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add");
@ -136,27 +100,21 @@ export default {
});
},
//
async table_del(row) {
this.$API.rpm.rparty.delete
.req(row.id)
.then((res) => {
this.$message.success("删除成功");
return res;
table_del(row) {
var id = row.id;
this.$API.mtm.team.delete.req(id).then(res=>{
if(res.err_msg){
this.$message.error(res.err_msg)
}else{
this.$refs.table.refresh();
this.$message.success("删除成功")
}
})
.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)

View File

@ -17,70 +17,30 @@
>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="测点名称" prop="name">
<el-input
v-model="form.name"
type="text"
clearable
:disabled="mode != 'add'"
class="formItem"
></el-input>
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" clearable></el-input>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="测点编号" prop="code">
<el-input v-model="form.code" type="text" clearable class="formItem"></el-input>
<el-input v-model="form.code" clearable></el-input>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="单位" prop="unit">
<el-input v-model="form.unit" type="text" class="formItem" clearable></el-input>
<el-input v-model="form.unit" clearable></el-input>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="分类">
<el-select
v-model="form.cate"
placeholder="分类"
clearable
class="formItem"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="所属部门">
<el-select
v-model="form.belong_dept"
placeholder="所属部门"
clearable
class="formItem"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="检测设备">
<el-form-item label="监测设备">
<el-select
v-model="form.ep_monitored"
placeholder="检测设备"
placeholder="监测设备"
clearable
class="formItem"
style="width: 100%;"
>
<el-option
v-for="item in options"
v-for="item in monitoredOptions"
:key="item.value"
:label="item.label"
:value="item.value"
@ -89,18 +49,52 @@
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="所在集合">
<el-form-item label="所属设备">
<el-select
v-model="form.ep_belong"
placeholder="所属设备"
clearable
style="width: 100%;"
>
<el-option
v-for="item in epOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="所在集合" prop="mgroup">
<el-select
v-model="form.mgroup"
placeholder="所在集合"
clearable
class="formItem"
style="width: 100%;"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
v-for="item in mgroupOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="计量物料">
<el-select
v-model="form.material"
placeholder="计量物料"
clearable
style="width: 100%;"
>
<el-option
v-for="item in materials"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
@ -131,25 +125,49 @@ export default {
},
form: {},
rules: {
name: [{ required: true, message: "请输入" }],
number: [{ required: true, message: "请输入" }],
contacter: [{ required: true, message: "请输入" }],
phone: [{ required: true, message: "请输入" }],
name: [{required: true, message: '请输入测点名称'}],
code: [{required: true, message: '请输入测点编号'}],
unit: [{required: true, message: '请输入测点单位'}],
unmgroupit: [{required: true, message: '请请选择测点集'}],
},
visible: false,
isSaveing: false,
selectionFilters: [],
setFiltersVisible: false,
belong_dept_options: []
mgroupOptions:[],
epOptions:[],
materials:[],
monitoredOptions:[],
};
},
mounted() {
this.getDeptOptions()
this.getMgroup();
this.getEquipment();
this.getMonitored();
this.getMaterial();
},
methods: {
getDeptOptions() {
this.$API.system.dept.list.req({page:0, type__in:'dept'}).then(res=>{
this.belong_dept_options = genTree(res);
//
getMgroup(){
this.$API.mtm.mgroup.list.req({page:0}).then(res=>{
this.mgroupOptions = res;
})
},
//
getEquipment(){
this.$API.em.equipment.list.req({page:0,type:10}).then(res=>{
this.epOptions = res;
})
},
//
getMonitored(){
this.$API.em.equipment.list.req({page:0,type:20}).then(res=>{
this.monitoredOptions = res;
})
},
//
getMaterial(){
this.$API.mtm.material.list.req({page:0}).then(res=>{
this.materials = res;
})
},
//
@ -163,22 +181,20 @@ export default {
this.$refs.dialogForm.validate(async (valid) => {
if (valid) {
this.isSaveing = true;
try {
var res;
if (this.mode == "add") {
res = await this.$API.enm.mpoint.create.req(this.form);
} else if (this.mode == "edit") {
res = await this.$API.enm.mpoint.update.req(this.form.id,this.form);
}
this.$API.enm.mpoint.create.req(this.form).then(res=>{
this.isSaveing = false;
this.$emit("success", this.form, this.mode);
this.visible = false;
this.$message.success("操作成功");
return res;
} catch (err) {
//
})
} else if (this.mode == "edit") {
this.$API.enm.mpoint.update.req(this.form.id,this.form).then(res=>{
this.isSaveing = false;
return err;
this.$emit("success", this.form, this.mode);
this.visible = false;
this.$message.success("操作成功");
})
}
}
});

View File

@ -1,7 +1,10 @@
<template>
<div class="app-container">
<el-container>
<el-aside width="45%">
<el-container>
<el-header>
<div class="left-panel">
<div style="margin-right: 20px">交接班日志</div>
<el-date-picker
v-model="query.time"
type="date"
@ -10,13 +13,13 @@
placeholder="日志时间"
/>
<el-select
v-model="query.class"
v-model="query.shift"
placeholder="班次"
clearable
style="margin-left: 2px; width: 120px"
>
<el-option
v-for="item in optionsClass"
v-for="item in optionsShift"
:key="item.value"
:label="item.label"
:value="item.value"
@ -40,14 +43,59 @@
icon="el-icon-search"
@click="handleQuery"
></el-button>
<el-link type="primary" icon="el-icon-plus" v-auth="'rparty.create'"></el-link>
</div>
<div class="right-panel">
<div class="right-panel-search">
</div>
</div>
</el-header>
<el-card style="margin-top:5px">
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="query"
highlightCurrentRow
@row-click="rowClick"
>
<el-table-column type="index" width="50"/>
<!-- <el-table-column label="关联工段" prop="mgroup_name"></el-table-column> -->
<el-table-column label="班组名称" prop="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>
</template>
</el-table-column>
<el-table-column label="结束时间" prop="end_time">
<template #default="scope">
<span>{{ scope.row.end_time.slice(0,16)}}</span>
</template>
</el-table-column>
<!-- <el-table-column label="更新时间" prop="update_time">
<template #default="scope">
<span>{{ scope.row.update_time.slice(0,16)}}</span>
</template>
</el-table-column> -->
<el-table-column label="操作" fixed="right" align="center" width="120">
<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_export(scope.row)" type="success">导出报表</el-button>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-aside>
<el-container>
<el-header>
<div class="left-panel">
<div style="margin-right: 20px">
<span v-if="sflogItem.end_time">{{sflogItem.end_time.slice(0,10)}}{{ sflogItem.shift_name }}</span>
<span v-if="sflogItem.team_name">{{ sflogItem.team_name }}</span>
交接班记录</div>
</div>
</el-header>
<el-main class="nopadding">
<div ref="print" id="myReport" class="printContainer">
<h3 style="text-align: center;display: flex;justify-content: space-around;">
<span>2023.06.21</span>
@ -103,76 +151,129 @@
</tbody>
</table>
</div>
</el-card>
</div>
</el-main>
</el-container>
</el-container>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
<quastat-dialog
v-if="dialog.check"
ref="checkDialog"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></quastat-dialog>
</template>
<script>
import scEcharts from "@/components/scEcharts";
import { defineAsyncComponent } from 'vue'
import saveDialog from "./handover_form.vue";
import quastatDialog from "./quastat_form.vue";
export default {
name: "listSon",
components: {
scEcharts,
charts: defineAsyncComponent(() => import("@/components/scEnm/lineChartsdialog.vue")),
saveDialog,
quastatDialog
},
data() {
return {
chartShow: false,
myOption: null,
listQuery:{
belong_dept:'',
task2__year:'',
page:0
},
apiObj: this.$API.wpm.sflog.list,
apiObj2: null,
query: {
time:'',
team:'',
class:''
mgroup:'3346520558031773696',
},
options:[
{label:'甲班',value:1},
{label:'乙班',value:2},
{label:'丙班',value:3},
],
optionsClass:[
{label:'白班',value:1},
{label:'夜班',value:2},
],
query2: {},
dialog: {
save: false,
check: false,
},
sflogItem:{},
selection: [],
value1:1,
value3:3,
value5:5,
modelValue:true,
apiObj:'',
showClose:true,
echartType:'line',
asynDialog:false,
options:[],
optionsShift:[],
};
},
mounted() {
},
methods: {
itemClick(type,item){
this.type=type;
this.asynDialog = true;
methods: {
rowClick(row) {
this.sflogId = row.id;
this.sflogItem = row;
// this.$refs.table2.queryData({post: row.id});
},
itemClick1(type,item){
this.chartShow = false;
this.$API.bi.dataset.exec
.req('3322567213885833216')
.then((res) => {
this.myOption = JSON.parse(res.echart_options);
debugger;
console.log(this.myOption)
this.chartShow = true;
//
sflog_edit(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row);
});
},
handlePrint() {
this.$PRINT('#myReport');
//
sflog_check(row){
this.dialog.check = true;
this.$nextTick(() => {
this.$refs.checkDialog.open("edit").setData(row);
});
},
// //
// table_show(row) {
// this.dialog.save = true;
// this.$nextTick(() => {
// this.$refs.checkDialog.open("edit").setData(row);
// });
// },
//
async table_del(row) {
this.$API.wpm.sflog.delete.req(row.id)
.then((res) => {
this.$message.success("删除成功");
return res;
})
.catch((err) => {
return err;
});
},
//
handleSaveSuccess(data, mode) {
this.$refs.table.refresh()
this.dialog.save = false;
},
closed() {
this.dialog.save = false;
this.$refs.table2.refresh();
},
handleDel(row) {
this.$confirm(`确定删除选中的记录吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.wpm.shift.delete.req(row.id).then((res) => {
if (res.err_msg) {
this.$message.error(res.err_msg);
} else {
// const loading = this.$loading();
// this.$refs.table2.refresh();
// loading.close();
// this.$message.success("");
}
});
})
.catch(() => {});
},
},
};
</script>
<style>
<style scoped>
.printContainer{
width: 1075px;
}
@ -202,3 +303,4 @@
margin-left: 5px;
}
</style>

View File

@ -9,36 +9,27 @@
<el-container v-loading="loading">
<el-main style="padding: 0 20px 20px 20px">
<el-form
ref="Form"
ref="dialogForm"
:model="form"
label-width="100px"
label-position="right"
:rules="rule1"
>
<el-row>
<el-col :span="12">
<el-col :md="12" :sm="24">
<el-form-item label="关联工段" prop="mgroup">
<el-input v-model="form.mgroup" placeholder="关联工段"/>
<el-input v-model="form.mgroup_name" placeholder="关联工段" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="班组" prop="team">
<el-input v-model="form.team" placeholder="班组"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :md="12" :sm="24">
<el-form-item label="当班班次" prop="shift">
<el-input v-model="form.shift" placeholder="当班班次"/>
<el-input v-model="form.shift_name" placeholder="当班班次" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="其他备注" prop="note">
<el-input v-model="form.note" placeholder="其他备注" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :md="12" :sm="24">
<el-form-item label="开始时间" prop="start_time">
<el-date-picker
disabled
v-model="form.start_time"
type="datetime"
format="YYYY-MM-DD HH:mm"
@ -47,9 +38,10 @@
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :md="12" :sm="24">
<el-form-item label="结束时间" prop="end_time">
<el-date-picker
disabled
v-model="form.end_time"
type="datetime"
format="YYYY-MM-DD HH:mm"
@ -58,6 +50,39 @@
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="当班班组" prop="team">
<el-select
v-model="form.team"
placeholder="当班班组"
clearable
style="width: 100%;"
@change="teamChange"
>
<el-option
v-for="item in teamOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="班组班长" prop="leader_name">
<el-input v-model="form.leader_name" placeholder="班组班长" disabled/>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="生产情况记录">
<el-input
type="textarea"
:rows="4"
v-model="form.note"
placeholder="生产情况记录"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-main>
@ -68,9 +93,7 @@
</el-container>
</el-dialog>
</template>
<script>
import {genTree} from "@/utils/verificate";
export default {
emits: ["success", "closed"],
data() {
@ -78,9 +101,9 @@
loading: false,
mode: "add",
titleMap: {
add: "新增计量设备",
edit: "编辑计量设备",
show: "查看计量设备",
add: "交接班日志",
edit: "交接班日志",
show: "查看交接班日志",
},
form: {
type:10,
@ -91,71 +114,30 @@
keeper_name: [{required: true, message: "请输入", trigger: "blur"}],
belong_dept: [{required: true, message: "请选择", trigger: "blur"}]
},
options: [
{
value: 10,
label: "合格",
},
{
value: 40,
label: "禁用",
}
,
{
value: 50,
label: "报废",
},
],
useoptions: [
{
value: 1,
label: "专用",
},
{
value: 2,
label: "公用",
},
],
wayoptions: [
{
value: 1,
label: "外检",
},
{
value: 2,
label: "自检",
},
],
mgmoptions: [
{
value: 1,
label: "A",
},
{
value: 2,
label: "B",
},
{
value: 3,
label: "C",
},
],
visible: false,
isSaveing: false,
keeperOptions: [],
depOptions: [],
selectionFilters: [],
setFiltersVisible: false,
belong_dept_options: []
teamOptions:[],
shiftOptions:[],
};
},
mounted() {
this.getDeptOptions()
//
this.getTeam();
this.getShfit();
},
methods: {
getDeptOptions() {
this.$API.system.dept.list.req({page:0, type__in:'dept'}).then(res=>{
this.belong_dept_options = genTree(res);
getTeam(){
this.$API.mtm.team.list.req({page:0}).then(res=>{
this.teamOptions = res;
})
},
getShfit(){
this.$API.mtm.shift.req({page:0}).then(res=>{
this.shiftOptions = res;
})
},
//
@ -164,26 +146,33 @@
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 {
var res;
if (this.mode == "add") {
res = await this.$API.rpm.rparty.create.req(this.form);
} else if (this.mode == "edit") {
res = await this.$API.rpm.rparty.update.req(
this.form.id,
this.form
);
}
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;
@ -204,7 +193,6 @@
},
};
</script>
<style>
</style>

View File

@ -0,0 +1,253 @@
<template>
<el-dialog
:title="titleMap[mode]"
v-model="visible"
:size="1000"
destroy-on-close
id="bigDialog"
class="bigDialog"
@closed="$emit('closed')"
>
<el-container v-loading="loading">
<el-main style="padding: 0 20px 20px 20px">
<el-form
ref="dialogForm"
:model="form"
label-width="85px"
label-position="right"
:rules="rule1"
>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="关联工段">
<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="当前班组">
<el-input v-model="form.team_name" placeholder="当前班组" disabled/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="班组组长">
<el-input v-model="form.team_name" placeholder="班组组长" disabled/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="开始时间">
<el-input v-model="form.start_time" placeholder="开始时间" disabled/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="结束时间">
<el-input v-model="form.end_time" placeholder="结束时间" disabled/>
</el-form-item>
</el-col>
<el-divider />
</el-row>
<!-- <el-row>
<el-col :lg="8" :md="12">
<el-form-item label="关联产物" prop="material">
<el-select
v-model="form.material"
placeholder="关联产物"
clearable
style="width: 100%;"
>
<el-option
v-for="item in teamOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :lg="8" :md="12">
<el-form-item label="质检项目" prop="testitem">
<el-select
v-model="form.testitem"
placeholder="质检项目"
clearable
style="width: 100%;"
>
<el-option
v-for="item in teamOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :lg="8" :md="12">
<el-form-item label="平均值" prop="team">
<el-input v-model="form.number" placeholder="平均值" />
</el-form-item>
</el-col>
<el-col :lg="8" :md="12">
<el-form-item label="检验次数" prop="mgroup">
<el-input v-model="form.number" placeholder="检验次数"/>
</el-form-item>
</el-col>
<el-col :lg="8" :md="12">
<el-form-item label="合格次数" prop="number">
<el-input v-model="form.number" placeholder="合格次数"/>
</el-form-item>
</el-col>
<el-divider />
</el-row> -->
</el-form>
<sc-form-table
v-model="form.list"
:addTemplate="addTemplate"
placeholder="暂无数据"
>
<el-table-column prop="material" label="关联产物" min-width="150">
<template #default="scope">
<span v-if="scope.row.id">{{ scope.row.material_name }}</span>
</template>
</el-table-column>
<el-table-column prop="testitem" label="质检项目" min-width="150">
<template #default="scope">
<span v-if="scope.row.id">{{ scope.row.testitem_name }}</span>
</template>
</el-table-column>
<el-table-column prop="val_avg" label="平均值" min-width="150">
<template #default="scope">
<el-input
v-model="scope.row.val_avg"
placeholder="请输入内容"
></el-input>
</template>
</el-table-column>
<el-table-column prop="num_test" label="检验次数" min-width="150">
<template #default="scope">
<el-input
v-model="scope.row.num_test"
placeholder="请输入内容"
></el-input>
</template>
</el-table-column>
<el-table-column prop="num_ok" label="合格次数" min-width="150">
<template #default="scope">
<el-input
v-model="scope.row.num_ok"
placeholder="请输入内容"
></el-input>
</template>
</el-table-column>
</sc-form-table>
</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 {
addTemplate: {
material: "",
testitem: "",
val_avg: "",
num_test: "",
num_ok: "",
},
loading: false,
mode: "add",
titleMap: {
add: "质量检验",
edit: "质量检验",
show: "质量检验",
},
form: {
type:10,
list:[]
},
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() {
//
//initget
},
methods: {
//
open(mode = "add") {
this.mode = mode;
this.visible = true;
return this;
},
getReceptionist(data) {
this.form.leader=data.id;
this.form.leader_name=data.name
},
//
submit() {
this.isSaveing = true;
this.$API.qm.updateQuastat.req('bulk',this.form.list).then(res=>{
this.isSaveing = false;
this.$emit("success", this.form, this.mode);
this.visible = false;
this.$message.success("操作成功");
}).catch(res=>{
this.isSaveing = false;
})
// this.$refs.dialogForm.validate(async (valid) => {
// if (valid) {
// }
// });
},
//
setData(data) {
Object.assign(this.form,data);
this.getsflogItem(this.form.id);
},
getsflogItem(id){
this.$API.wpm.sflog.init_test.req(id).then(res=>{
this.form.list = res;
})
},
//
setFilters(filters) {
this.selectionFilters = filters;
this.setFiltersVisible = true;
},
},
};
</script>
<style scoped>
#bigDialog{
width: 90%;
}
</style>

View File

@ -0,0 +1,231 @@
<template>
<div class="app-container">
<el-header>
<div class="left-panel">
<el-date-picker
v-model="query.year"
type="year"
value-format="YYYY"
format="YYYY"
placeholder="年"
/>
<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="日"
/>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></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>
<table border="1" cellspacing="0" :key="timeStamp" id="numTable">
<thead style="background: #efefef;height: 40px;">
<tr>
<th rowspan="3">日期</th>
<th colspan="5">原料车间</th>
<th colspan="7">烧成车间</th>
<th colspan="5">水泥车间</th>
</tr>
<tr>
<th colspan="2">电石渣</th>
<th colspan="2">原料</th>
<th rowspan="2">压缩空气m3</th>
<th colspan="4">回转窑</th>
<th colspan="2">煤磨</th>
<th rowspan="2">压缩空气m3</th>
<th colspan="2">水泥磨</th>
<th colspan="2">包装</th>
<th rowspan="2">压缩空气m3</th>
</tr>
<tr>
<th>电量KW.h</th>
<th>t</th>
<th>电量KW.h</th>
<th>t</th>
<th>电量KW.h</th>
<th>煤粉t</th>
<th>t</th>
<th>蒸汽t</th>
<th>电量KW.h</th>
<th>t</th>
<th>电量KW.h</th>
<th>t</th>
<th>电量KW.h</th>
<th>t</th>
</tr>
</thead>
<tr v-for="(item,index) in tableDatas" :key="index">
<td style="width:50px">{{item.month}}</td>
<td class="numCell">{{item.name}}</td>
<td class="numCell">{{item.number}}</td>
<td class="numCell">{{item.unit}}</td>
<td class="numCell">{{item.hours}}</td>
<td class="numCell">{{item.days}}</td>
<td class="numCell">{{item.months}}</td>
<td class="numCell">{{item.hours}}</td>
<td class="numCell">{{item.days}}</td>
<td class="numCell">{{item.months}}</td>
<td class="numCell">{{item.hours}}</td>
<td class="numCell">{{item.days}}</td>
<td class="numCell">{{item.months}}</td>
<td class="numCell">{{item.months}}</td>
<td class="numCell">{{item.hours}}</td>
<td class="numCell">{{item.days}}</td>
<td class="numCell">{{item.months}}</td>
</tr>
</table>
<table border="1" cellspacing="0" :key="timeStamp" id="numTable">
<thead style="background: #efefef;height: 40px;">
<tr>
<template v-for="(date,ind) in tableHead" :key="ind">
<th v-if="ind==0" colspan="3">{{date}}</th>
<th v-else>{{date}}</th>
</template>
</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>
<td class="numCell">{{item[5]}}</td>
<td class="numCell">{{item[6]}}</td>
<td class="numCell">{{item[7]}}</td>
<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>
</el-card>
</div>
</template>
<script>
export default {
data() {
return {
query:{
year:'',
month:'',
days:'',
},
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'},
{month:'2023.1',name:'丙组',number:'NM003',unit:'KW·h/t',hours:'1',days:'2',months:'3'},
{month:'2023.2',name:'甲组',number:'NM004',unit:'KW·h/t',hours:'1',days:'2',months:'3'},
{month:'2023.2',name:'乙组',number:'NM005',unit:'KW·h/t',hours:'1',days:'2',months:'3'},
{month:'2023.2',name:'丙组',number:'NM006',unit:'KW·h/t',hours:'1',days:'2',months:'3'},
],
tableHead:['日期','1号','2号','3号','4号','5号','6号','87号','8号'],
tableDatas2:[
['原料车间','电石渣','电量KW.h',1,2,3,4,5,6],
['原料车间','电石渣','水t',1,2,3,4,5,6],
['原料车间','原料','电量KW.h',1,2,3,4,5,6],
['原料车间','原料','水t',1,2,3,4,5,6],
['原料车间','压缩空气m3',1,2,3,4,5,6],
['烧成车间','回转窑','电量KW.h',1,2,3,4,5,6],
['烧成车间','回转窑','煤粉t',1,2,3,4,5,6],
['烧成车间','回转窑','水t',1,2,3,4,5,6],
['烧成车间','回转窑','蒸汽t',1,2,3,4,5,6],
['烧成车间','煤磨','电量KW.h',1,2,3,4,5,6],
['烧成车间','煤磨','水t',1,2,3,4,5,6],
['烧成车间','压缩空气m3',1,2,3,4,5,6],
['水泥车间','电石渣','电量KW.h',1,2,3,4,5,6],
['水泥车间','电石渣','水t',1,2,3,4,5,6],
['水泥车间','原料','电量KW.h',1,2,3,4,5,6],
['水泥车间','原料','水t',1,2,3,4,5,6],
['水泥车间','压缩空气m3',1,2,3,4,5,6],
],
sourceData:{}
};
},
mounted() {
this.getData();
},
methods: {
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.消耗量
}
}
}
}
});
});
},
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>

View File

@ -0,0 +1,172 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-date-picker
v-model="query.year"
type="year"
value-format="YYYY"
format="YYYY"
placeholder="年"
style="width: 120px;margin-right: 5px;"
/>
<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 feeOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-select
v-model="query.mgroup"
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">
<template #default="scope">
<span>{{ cates_[scope.row.cate] }}</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>
<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 "./feeset_form.vue";
export default {
name: 'dept',
components: {
saveDialog
},
data() {
return {
apiObj: this.$API.fim.feeset.list,
query: {
year:'',
month:'',
fee:'',
mgroup:'',
},
dialog: {
save: false,
},
selection:[],
options:[],
feeOptions:[],
}
},
mounted(){
this.getFee();
this.getMgroup();
},
methods: {
//
getMgroup(){
this.$API.mtm.mgroup.list.req({page:0}).then(res=>{
this.options = res;
})
},
//
getFee(){
this.$API.fim.fee.req({page:0}).then(res=>{
this.feeOptions = 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 = true;
this.$refs.table.refresh();
},
}
}
</script>
<style scoped>
.treeMain {width: 100%;height:280px;overflow: auto;border: 1px solid #dcdfe6;margin-bottom: 10px;}
</style>

View File

@ -0,0 +1,203 @@
<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="cost_unit">
<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"
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="mgroup">
<el-select
v-model="form.mgroup"
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="fee">
<el-select
v-model="form.fee"
placeholder="关联费用"
clearable
style="width: 100%;"
>
<el-option
v-for="item in feeOptions"
: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="cost_unit">
<el-input-number
v-model="form.cost_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 = {
year: "",
month:'',
mgroup:'',
fee:'',
cost_unit:'',
};
export default {
emits: ["success", "closed"],
data() {
return {
loading: false,
mode: "add",
titleMap: {
add: '新增测点集',
edit: '编辑测点集',
show: '查看测点集'
},
//
form: {
},
//
rules: {
name: [{required: true, message: "请输入名称", trigger: "blur"}],
cate: [{required: true, message: "请选择分类", trigger: "blur"}],
material: [{required: true, message: "请选择主要产品", trigger: "blur"}],
belong_dept: [{required: true, message: "请选择所属部门", trigger: "blur"}]
},
visible: false,
isSaveing: false,
options: [],
feeOptions:[],
setFiltersVisible: false,
};
},
mounted() {
this.getFee();
this.getMgroup();
},
methods: {
//
getMgroup(){
this.$API.mtm.mgroup.list.req({page:0}).then(res=>{
this.options = res;
})
},
//
getFee(){
this.$API.fim.fee.req({page:0}).then(res=>{
this.feeOptions = res;
})
},
//
open(mode = "add") {
this.mode = mode;
this.visible = true;
return this;
},
//
setData(data) {
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;
if(that.type==='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("操作成功");
})
}else{
res = that.$API.fim.feeset.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("操作成功");
})
}
}
});
},
//
setFilters(filters) {
this.selectionFilters = filters;
this.setFiltersVisible = true;
},
},
};
</script>
<style>
</style>

View File

@ -197,7 +197,6 @@
</el-dialog>
</template>
<script>
import {genTree} from "@/utils/verificate";
const defaultForm = {
year: [{required: true, message: '请选择年份'}],
mgroup:'',
@ -255,11 +254,6 @@
goal_val_11: [{required: true, message: '请填写11月份目标值'}],
goal_val_12: [{required: true, message: '请填写12月份目标值'}],
},
groupsProps: {
multiple: false,
emitPath: false,
checkStrictly: true,
},
goalOptions:[],
mgroupOptions:[],
@ -271,12 +265,6 @@
this.getGoals();//
},
methods: {
// //
// async getGroup() {
// let res = await this.$API.system.dept.list.req({ page_size: 3 , type:'dept'});
// this.group = res.results;
// },
//
getGoals(){
let that = this;
@ -293,7 +281,7 @@
this.mgroupOptions = res;
})
},
//
//
roleAdd(){
this.limitedVisible = true;
this.type = "add";
@ -321,14 +309,15 @@
}
})
},
//
//
roleEdit(row){
this.type='edit';
this.form = Object.assign(defaultForm, row);
this.form.year = row.year+'';
this.limitedVisible = true;
},
//
//
async handleDel(row){
var id = row.id;
var res = await this.$API.mtm.goal.delete.req(id);

View File

@ -62,7 +62,6 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="检测项目">
<el-select
v-model="form.testitems"
@ -86,7 +85,6 @@
</el-dialog>
</template>
<script>
import {genTree} from "@/utils/verificate";
const defaultForm = {
id:"",
name: "",
@ -108,9 +106,9 @@
limitedVisible : false,
type: "add",
titleMap: {
add: '新增测点集',
edit: '编辑测点集',
show: '查看测点集'
add: '新增产品',
edit: '编辑产品',
show: '查看产品'
},
//
form: defaultForm,
@ -137,25 +135,22 @@
50:'加工工具',
60:'辅助工装',
},
}
},
mounted() {
this.getTestItem();//
this.getTestItem();//
},
methods: {
handleChange(value) {
console.log(value);
console.log(this.form.belong_dept);
},
//
getTestItem(){
this.$API.qm.getTestItem.get({page:0}).then(res=>{
this.options = res;
});
},
//
//
roleAdd(){
this.limitedVisible = true;
this.type = "add";
@ -182,14 +177,14 @@
}
})
},
//
//
roleEdit(row){
this.type='edit';
this.form = Object.assign(defaultForm, row);
this.limitedVisible = true;
},
//
//
async roleDel(row){
var id = row.id;
var res = await this.$API.mtm.material.delete.req(id);

View File

@ -2,7 +2,7 @@
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="roleAdd" v-auth="'role.create'"></el-button>
<el-button type="primary" icon="el-icon-plus" @click="table_add" v-auth="'role.create'"></el-button>
</div>
<div class="right-panel">
<div class="right-panel-search">
@ -12,7 +12,7 @@
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" @selection-change="selectionChange" hidePagination>
<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="name" min-width="100"></el-table-column>
<el-table-column label="分类" prop="cate" min-width="100">
@ -20,14 +20,14 @@
<span>{{ cates_[scope.row.cate] }}</span>
</template>
</el-table-column>
<el-table-column label="主要产品" prop="product" min-width="150"></el-table-column>
<!-- <el-table-column label="主要产品" prop="product" 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="create_time" 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="roleEdit(scope.row)" v-auth="'team.update'" type="primary">编辑</el-button>
<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="roleDel(scope.row, scope.$index)">
<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>
@ -37,170 +37,52 @@
</scTable>
</el-main>
</el-container>
<el-dialog :title="titleMap[type]" v-model="limitedVisible">
<el-form :model="form" :rules="rules" ref="addForm" label-width="80px" style="padding: 0 10px;">
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" clearable></el-input>
</el-form-item>
<el-form-item label="分类" prop="cate">
<el-select
v-model="form.cate"
placeholder="分类"
clearable
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="主要产品">
<el-select
v-model="form.material"
placeholder="分类"
clearable
>
<el-option
v-for="item in materials"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="所属部门" prop="belong_dept">
<el-select
v-model="form.belong_dept"
placeholder="分类"
clearable
>
<el-option
v-for="item in group"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="limitedVisible=false" > </el-button>
<el-button v-if="type!=='show'" type="primary" :loading="isSaving" @click="submitHandle()"> </el-button>
</template>
</el-dialog>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
</template>
<script>
import {genTree} from "@/utils/verificate";
const defaultForm = {
id:"",
name: "",
cate:'',
product:'',
belong_dept:'',
};
import saveDialog from "./mgroup_form.vue";
export default {
name: 'dept',
components: {
saveDialog
},
data() {
return {
apiObj: this.$API.mtm.mgroup.list,
search: {
keyword: null
},
query: {},
isSaving: false,
limitedVisible : false,
checkStrictly:true,
type: "add",
titleMap: {
add: '新增测点集',
edit: '编辑测点集',
show: '查看测点集'
dialog: {
save: false,
permission: false,
},
//
form: defaultForm,
//
rules: {
name: [{required: true, message: '请输入测点集名称'}],
cate: [{required: true, message: '请选择分类'}],
belong_dept: [{required: true, message: '请选择所属部门'}],
},
groupsProps: {
multiple: false,
emitPath: false,
checkStrictly: true,
},
options:[
{label:'工段',value:'section'},
{label:'其他',value:'other'},
],
selection:[],
cates_:{
'section':'工序',
'other':'其他',
},
group: [],
materials:[],
productList:[],
}
},
mounted() {
// this.getList();
this.getGroup();//
this.getMaterials();//
},
methods: {
handleChange(value) {
console.log(value);
console.log(this.form.belong_dept);
//
table_add() {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add");
});
},
getMaterials(){},
//
async getGroup() {
let res = await this.$API.system.dept.list.req({ page_size: 3 , type:'dept'});
this.group = res.results;
//
table_edit(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row);
});
},
//
getProduct(){
var res = this.$API.mtm.material.list.req({page:0});
this.materials = res.data;
},
//
roleAdd(){
this.limitedVisible = true;
this.type = "add";
this.form = Object.assign({}, defaultForm);
},
submitHandle(){
let that = this;
this.$refs.addForm.validate( (valid) => {
if (valid) {
this.isSaveing = true;
let res;
if(this.type==='add'){
res = this.$API.mtm.mgroup.create.req(that.form);
}else{
res = this.$API.mtm.mgroup.update.req(that.form.id,that.form);
}
if(res.err_msg){
this.$message.error(res.err_msg);
}else{
this.isSaveing = false;
this.limitedVisible = false;
this.$refs.table.refresh();
}
}
})
},
//
roleEdit(row){
this.type='edit';
this.form = Object.assign(defaultForm, row);
this.limitedVisible = true;
},
//
async roleDel(row){
async table_del(row){
var id = row.id;
var res = await this.$API.mtm.mgroup.delete.req(id);
if(res.err_msg){
@ -219,9 +101,11 @@
this.$refs.table.queryData(this.query)
},
//
handleSaveSuccess(){
this.$refs.table.refresh()
}
//
handleSaveSuccess(data, mode) {
this.dialog.save = true;
this.$refs.table.refresh();
},
}
}
</script>

View File

@ -0,0 +1,217 @@
<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-form-item label="名称" prop="name">
<el-input v-model="form.name" clearable></el-input>
</el-form-item>
<el-form-item label="分类" prop="cate">
<el-select
v-model="form.cate"
placeholder="分类"
clearable
style="width: 100%;"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="主要产品">
<el-select
v-model="form.product"
placeholder="主要产品"
clearable
style="width: 100%;"
>
<el-option
v-for="item in materials"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="直接材料">
<el-select
v-model="form.input_materials"
placeholder="直接材料"
clearable
multiple
style="width: 100%;"
>
<el-option
v-for="item in materials"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="检测材料">
<el-select
v-model="form.test_materials"
placeholder="检测材料"
clearable
multiple
style="width: 100%;"
>
<el-option
v-for="item in materials"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="所属部门" prop="belong_dept">
<el-select
v-model="form.belong_dept"
placeholder="所属部门"
clearable
style="width: 100%;"
>
<el-option
v-for="item in group"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-form>
</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 = {
name: "",
cate:'',
product:'',
belong_dept:'',
test_materials:'',
input_materials:'',
};
export default {
emits: ["success", "closed"],
data() {
return {
loading: false,
mode: "add",
titleMap: {
add: '新增测点集',
edit: '编辑测点集',
show: '查看测点集'
},
//
form: {
},
//
rules: {
name: [{required: true, message: "请输入名称", trigger: "blur"}],
cate: [{required: true, message: "请选择分类", trigger: "blur"}],
material: [{required: true, message: "请选择主要产品", trigger: "blur"}],
belong_dept: [{required: true, message: "请选择所属部门", trigger: "blur"}]
},
visible: false,
isSaveing: false,
options:[
{label:'工段',value:'section'},
{label:'其他',value:'other'},
],
group: [],
materials:[],
setFiltersVisible: false,
};
},
mounted() {
this.getGroup();//
this.getMaterials();//
},
methods: {
//
getGroup() {
this.$API.system.dept.list.req({ page_size: 3 , type:'dept'}).then(res=>{
this.group = res.results;
});
},
//
getMaterials(){
var res = this.$API.mtm.material.list.req({page:0}).then(res=>{
this.materials = res;
});
},
//
open(mode = "add") {
this.mode = mode;
this.visible = true;
return this;
},
//
setData(data) {
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;
if(that.type==='add'){
that.$API.mtm.mgroup.create.req(that.form).then(res=>{
that.isSaveing = false;
that.$emit("success", that.form, that.mode);
that.visible = false;
that.$message.success("操作成功");
})
}else{
res = that.$API.mtm.mgroup.update.req(that.form.id,that.form).then(res=>{
that.isSaveing = false;
that.$emit("success", that.form, that.mode);
that.visible = false;
that.$message.success("操作成功");
})
}
}
});
},
//
setFilters(filters) {
this.selectionFilters = filters;
this.setFiltersVisible = true;
},
},
};
</script>
<style>
</style>

View File

@ -1,296 +0,0 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="roleAdd" v-auth="'role.create'"></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" @selection-change="selectionChange" hidePagination>
<el-table-column label="#" type="index" width="50"></el-table-column>
<el-table-column label="名称" prop="name" min-width="100"></el-table-column>
<el-table-column label="计量物料" prop="material_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="mgroup_name" 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="140">
<template #default="scope">
<el-button link size="small" @click="roleEdit(scope.row)" v-auth="'team.update'" type="primary">编辑</el-button>
<el-divider direction="vertical"></el-divider>
<el-popconfirm title="确定删除吗?" @confirm="roleDel(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>
<el-dialog :title="titleMap[type]" v-model="limitedVisible">
<el-form :model="form" :rules="rules" ref="addForm" label-width="80px" style="padding: 0 10px;">
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" clearable></el-input>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="测点编号" prop="code">
<el-input v-model="form.code" clearable></el-input>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="单位" prop="unit">
<el-input v-model="form.unit" clearable></el-input>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="检测设备">
<el-select
v-model="form.ep_monitored"
placeholder="检测设备"
clearable
style="width: 100%;"
>
<el-option
v-for="item in monitoredOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="所属设备">
<el-select
v-model="form.ep_belong"
placeholder="所属设备"
clearable
style="width: 100%;"
>
<el-option
v-for="item in epOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="所在集合">
<el-select
v-model="form.mgroup"
placeholder="所在集合"
clearable
style="width: 100%;"
>
<el-option
v-for="item in mgroupOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="计量物料">
<el-select
v-model="form.material"
placeholder="计量物料"
clearable
style="width: 100%;"
>
<el-option
v-for="item in materials"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button @click="limitedVisible=false" > </el-button>
<el-button v-if="type!=='show'" type="primary" :loading="isSaving" @click="submitHandle()"> </el-button>
</template>
</el-dialog>
</template>
<script>
import {genTree} from "@/utils/verificate";
const defaultForm = {
id:"",
name: "",
cate:'',
product:'',
belong_dept:'',
};
export default {
name: 'dept',
data() {
return {
apiObj: this.$API.enm.mpoint.list,
search: {
keyword: null
},
query: {},
isSaving: false,
limitedVisible : false,
checkStrictly:true,
type: "add",
titleMap: {
add: '新增测点集',
edit: '编辑测点集',
show: '查看测点集'
},
//
form: defaultForm,
//
rules: {
name: [{required: true, message: '请输入测点集名称'}],
code: [{required: true, message: '请输入测点集编号'}],
unit: [{required: true, message: '请输入测点集单位'}],
},
groupsProps: {
multiple: false,
emitPath: false,
checkStrictly: true,
},
options:[
{label:'动力电',value:'elec'},
{label:'工业水',value:'water'},
{label:'煤粉',value:'water'},
{label:'蒸汽',value:'water'},
{label:'柴油',value:'water'},
{label:'压缩空气',value:'water'},
],
cates_:{
'elec':'动力电',
'water':'工业水',
},
group: [],
mgroupOptions:[],
epOptions:[],
materials:[],
monitoredOptions:[],
}
},
mounted() {
this.getMaterial();
this.getGroup();//
this.getEquipment();//
this.getMonitored();//
this.getMgroup();//
},
methods: {
handleChange(value) {
console.log(value);
console.log(this.form.belong_dept);
},
//
async getGroup() {
let res = await this.$API.system.dept.list.req({ page: 0 });
this.group = genTree(res);
},
//
getEquipment(){
this.$API.em.equipment.list.req({page:0,type:10}).then(res=>{
this.epOptions = res;
})
},
//
getMonitored(){
this.$API.em.equipment.list.req({page:0,type:20}).then(res=>{
this.monitoredOptions = res;
})
},
//
getMgroup(){
this.$API.mtm.mgroup.list.req({page:0}).then(res=>{
this.mgroupOptions = res;
})
},
//
getMaterial(){
this.$API.mtm.material.list.req({page:0}).then(res=>{
this.materials = res;
})
},
//
roleAdd(){
this.limitedVisible = true;
this.type = "add";
this.form = Object.assign({}, defaultForm);
},
submitHandle(){
let that = this;
this.$refs.addForm.validate( (valid) => {
if (valid) {
this.isSaveing = true;
let res;
if(this.type==='add'){
res = this.$API.enm.mpoint.create.req(that.form);
}else{
res = this.$API.enm.mpoint.update.req(that.form.id,that.form);
}
if(res.err_msg){
this.$message.error(res.err_msg);
}else{
this.isSaveing = false;
this.limitedVisible = false;
this.$refs.table.refresh();
}
}
})
},
//
roleEdit(row){
this.type='edit';
this.form=row;
this.limitedVisible = true;
},
//
async roleDel(row){
var id = row.id;
var res = await this.$API.mtm.team.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(){
this.$refs.table.refresh()
}
}
}
</script>
<style scoped>
.treeMain {width: 100%;height:280px;overflow: auto;border: 1px solid #dcdfe6;margin-bottom: 10px;}
</style>

View File

@ -44,15 +44,19 @@
</span>
</el-form-item>
<el-form-item label="所属部门">
<el-cascader
<el-select
v-model="form.belong_dept"
:options="group"
:props="groupsProps"
:show-all-levels="false"
placeholder="所属部门"
clearable
style="width: 100%"
@change="handleChange"
></el-cascader>
>
<el-option
v-for="item in group"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-form>
<template #footer>
@ -62,7 +66,6 @@
</el-dialog>
</template>
<script>
import {genTree} from "@/utils/verificate";
const defaultForm = {
id:"",
name: "",
@ -99,11 +102,6 @@
leader_name: [{required: true, message: '请输入班组班长'}],
belong_dept: [{required: true, message: '请选择所属部门'}],
},
groupsProps: {
multiple: false,
emitPath: false,
checkStrictly: true,
},
group: [],
}
},
@ -116,10 +114,11 @@
console.log(value);
console.log(this.form.belong_dept);
},
//
async getGroup() {
let res = await this.$API.system.dept.list.req({ page: 0 });
this.group = genTree(res);
//
getGroup() {
this.$API.system.dept.list.req({ page_size: 3 , type:'dept'}).then(res=>{
this.group = res.results;
});
},
//
getList(){