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

View File

@ -10,6 +10,17 @@ export default {
return await http.get(this.url, data); 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: { createQuastat: {
url: `${config.API_URL}/qm/quastat/`, url: `${config.API_URL}/qm/quastat/`,

View File

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

View File

@ -174,16 +174,6 @@ const routes = [
}, },
"component": "rm_enm/handoverLog" "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", "icon": "el-icon-postcard",
"type": "menu", "type": "menu",
}, },
"component": "sys/team" "component": "ungrouped/team"
}, },
{ {
"name": "mgruop", "name": "mgruop",
@ -823,24 +813,34 @@ const routes = [
}, },
{ {
"name": "mpoint", "name": "mpoint",
"path": "/ungrouped/mpoint", "path": "/em/mpoint",
"meta": { "meta": {
"title": "测点", "title": "测点",
"icon": "el-icon-grid", "icon": "el-icon-grid",
"perms": ["dataset"] "perms": ["dataset"]
}, },
"component": "ungrouped/mpoint" "component": "em/mpoint"
}, },
{ {
"name": "material", "name": "material",
"path": "/ungrouped/material", "path": "/ungrouped/material",
"meta": { "meta": {
"title": "产品", "title": "物料",
"icon": "el-icon-grid", "icon": "el-icon-grid",
"perms": ["dataset"] "perms": ["dataset"]
}, },
"component": "ungrouped/material" "component": "ungrouped/material"
}, },
{
"name": "feeset",
"path": "/ungrouped/feeset",
"meta": {
"title": "工段成本配置",
"icon": "el-icon-grid",
"perms": ["dataset"]
},
"component": "ungrouped/feeset"
},
{ {
"name": "goalSetting", "name": "goalSetting",
"path": "/ungrouped/goalSetting", "path": "/ungrouped/goalSetting",
@ -851,6 +851,16 @@ const routes = [
}, },
"component": "ungrouped/goalSetting" "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 { .el-footer {
background: #fff; background: #fff;
border-top: 1px solid var(--el-border-color-light); // border-top: 1px solid var(--el-border-color-light);
padding: 13px 15px; padding: 13px 15px;
height: 51px; height: 51px;
} }

View File

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

View File

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

View File

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

View File

@ -1,56 +1,104 @@
<template> <template>
<div class="app-container"> <el-container>
<el-header> <el-aside width="45%">
<el-container>
<el-header>
<div class="left-panel"> <div class="left-panel">
<el-date-picker <div style="margin-right: 20px">交接班日志</div>
<el-date-picker
v-model="query.time" v-model="query.time"
type="date" type="date"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
format="YYYY-MM-DD" format="YYYY-MM-DD"
placeholder="日志时间" placeholder="日志时间"
/> />
<el-select <el-select
v-model="query.class" v-model="query.shift"
placeholder="班次" placeholder="班次"
clearable clearable
style="margin-left: 2px; width: 120px" style="margin-left: 2px; width: 120px"
> >
<el-option <el-option
v-for="item in optionsClass" v-for="item in optionsShift"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
></el-option> ></el-option>
</el-select> </el-select>
<el-select <el-select
v-model="query.team" v-model="query.team"
placeholder="班组" placeholder="班组"
clearable clearable
style="margin-left: 2px; width: 120px" style="margin-left: 2px; width: 120px"
> >
<el-option <el-option
v-for="item in options" v-for="item in options"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
></el-option> ></el-option>
</el-select> </el-select>
<el-button <el-button
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleQuery" @click="handleQuery"
></el-button> ></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> </div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:params="query"
highlightCurrentRow
@row-click="rowClick"
>
<el-table-column type="index" width="50"/>
<!-- <el-table-column label="关联工段" prop="mgroup_name"></el-table-column> -->
<el-table-column label="班组名称" prop="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-header>
<el-card style="margin-top:5px"> <el-main class="nopadding">
<div ref="print" id="myReport" class="printContainer"> <div ref="print" id="myReport" class="printContainer">
<h3 style="text-align: center;display: flex;justify-content: space-around;"> <h3 style="text-align: center;display: flex;justify-content: space-around;">
<span>2023.06.21 </span> <span>2023.06.21</span>
<span>白班</span> <span>白班</span>
<span>甲班</span> <span>甲班</span>
</h3> </h3>
@ -103,77 +151,130 @@
</tbody> </tbody>
</table> </table>
</div> </div>
</el-card> </el-main>
</div> </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> </template>
<script>
import scEcharts from "@/components/scEcharts"; <script>
import { defineAsyncComponent } from 'vue' import saveDialog from "./handover_form.vue";
export default { import quastatDialog from "./quastat_form.vue";
components: { export default {
scEcharts, name: "listSon",
charts: defineAsyncComponent(() => import("@/components/scEnm/lineChartsdialog.vue")), components: {
saveDialog,
quastatDialog
},
data() {
return {
apiObj: this.$API.wpm.sflog.list,
apiObj2: null,
query: {
mgroup:'3346520558031773696',
}, },
data() { query2: {},
return { dialog: {
chartShow: false, save: false,
myOption: null, check: false,
listQuery:{
belong_dept:'',
task2__year:'',
page:0
},
query:{
time:'',
team:'',
class:''
},
options:[
{label:'甲班',value:1},
{label:'乙班',value:2},
{label:'丙班',value:3},
],
optionsClass:[
{label:'白班',value:1},
{label:'夜班',value:2},
],
value1:1,
value3:3,
value5:5,
modelValue:true,
apiObj:'',
showClose:true,
echartType:'line',
asynDialog:false,
};
}, },
mounted() { sflogItem:{},
}, selection: [],
methods: { value1:1,
value3:3,
itemClick(type,item){ value5:5,
this.type=type; modelValue:true,
this.asynDialog = true; showClose:true,
}, echartType:'line',
itemClick1(type,item){ asynDialog:false,
this.chartShow = false; options:[],
this.$API.bi.dataset.exec optionsShift:[],
.req('3322567213885833216')
.then((res) => { };
this.myOption = JSON.parse(res.echart_options); },
debugger;
console.log(this.myOption) methods: {
this.chartShow = true; rowClick(row) {
}); this.sflogId = row.id;
}, this.sflogItem = row;
handlePrint() { // this.$refs.table2.queryData({post: row.id});
this.$PRINT('#myReport'); },
}, //
} sflog_edit(row) {
}; this.dialog.save = true;
</script> this.$nextTick(() => {
<style> this.$refs.saveDialog.open("edit").setData(row);
.printContainer{ });
},
//
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 scoped>
.printContainer{
width: 1075px; width: 1075px;
} }
#numTable{ #numTable{
@ -201,4 +302,5 @@
.searchBtn{ .searchBtn{
margin-left: 5px; margin-left: 5px;
} }
</style> </style>

View File

@ -9,57 +9,82 @@
<el-container v-loading="loading"> <el-container v-loading="loading">
<el-main style="padding: 0 20px 20px 20px"> <el-main style="padding: 0 20px 20px 20px">
<el-form <el-form
ref="Form" ref="dialogForm"
:model="form" :model="form"
label-width="100px" label-width="100px"
label-position="right" label-position="right"
:rules="rule1" :rules="rule1"
> >
<el-row> <el-row>
<el-col :span="12"> <el-col :md="12" :sm="24">
<el-form-item label="关联工段" prop="mgroup"> <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-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :md="12" :sm="24">
<el-form-item label="班组" prop="team"> <el-form-item label="当班班次" prop="shift">
<el-input v-model="form.team" placeholder="班组"/> <el-input v-model="form.shift_name" placeholder="当班班次" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :md="12" :sm="24">
<el-form-item label="当班班次" prop="shift"> <el-form-item label="开始时间" prop="start_time">
<el-input v-model="form.shift" placeholder="当班班次"/> <el-date-picker
</el-form-item> disabled
</el-col> v-model="form.start_time"
<el-col :span="12"> type="datetime"
<el-form-item label="其他备注" prop="note"> format="YYYY-MM-DD HH:mm"
<el-input v-model="form.note" placeholder="其他备注" /> placeholder="基础月份"
</el-form-item> style="width: 100%;"
</el-col> />
<el-col :span="12"> </el-form-item>
<el-form-item label="开始时间" prop="start_time"> </el-col>
<el-date-picker <el-col :md="12" :sm="24">
v-model="form.start_time" <el-form-item label="结束时间" prop="end_time">
type="datetime" <el-date-picker
format="YYYY-MM-DD HH:mm" disabled
placeholder="基础月份" v-model="form.end_time"
type="datetime"
format="YYYY-MM-DD HH:mm"
placeholder="对比月份"
style="width: 100%;"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="当班班组" prop="team">
<el-select
v-model="form.team"
placeholder="当班班组"
clearable
style="width: 100%;" style="width: 100%;"
/> @change="teamChange"
</el-form-item> >
</el-col> <el-option
<el-col :span="12"> v-for="item in teamOptions"
<el-form-item label="结束时间" prop="end_time"> :key="item.id"
<el-date-picker :label="item.name"
v-model="form.end_time" :value="item.id"
type="datetime" ></el-option>
format="YYYY-MM-DD HH:mm" </el-select>
placeholder="对比月份" </el-form-item>
style="width: 100%;" </el-col>
/> <el-col :md="12" :sm="24">
</el-form-item> <el-form-item label="班组班长" prop="leader_name">
</el-col> <el-input v-model="form.leader_name" placeholder="班组班长" disabled/>
</el-row> </el-form-item>
</el-form> </el-col>
<el-col>
<el-form-item label="生产情况记录">
<el-input
type="textarea"
:rows="4"
v-model="form.note"
placeholder="生产情况记录"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-main> </el-main>
<el-footer> <el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button> <el-button type="primary" :loading="isSaveing" @click="submit">保存</el-button>
@ -68,9 +93,7 @@
</el-container> </el-container>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import {genTree} from "@/utils/verificate";
export default { export default {
emits: ["success", "closed"], emits: ["success", "closed"],
data() { data() {
@ -78,9 +101,9 @@
loading: false, loading: false,
mode: "add", mode: "add",
titleMap: { titleMap: {
add: "新增计量设备", add: "交接班日志",
edit: "编辑计量设备", edit: "交接班日志",
show: "查看计量设备", show: "查看交接班日志",
}, },
form: { form: {
type:10, type:10,
@ -91,72 +114,31 @@
keeper_name: [{required: true, message: "请输入", trigger: "blur"}], keeper_name: [{required: true, message: "请输入", trigger: "blur"}],
belong_dept: [{required: true, message: "请选择", trigger: "blur"}] belong_dept: [{required: true, message: "请选择", trigger: "blur"}]
}, },
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, visible: false,
isSaveing: false, isSaveing: false,
keeperOptions: [], keeperOptions: [],
depOptions: [], depOptions: [],
selectionFilters: [], selectionFilters: [],
setFiltersVisible: false, setFiltersVisible: false,
belong_dept_options: [] teamOptions:[],
shiftOptions:[],
}; };
}, },
mounted() { mounted() {
this.getDeptOptions() //
this.getTeam();
this.getShfit();
}, },
methods: { methods: {
getDeptOptions() { getTeam(){
this.$API.system.dept.list.req({page:0, type__in:'dept'}).then(res=>{ this.$API.mtm.team.list.req({page:0}).then(res=>{
this.belong_dept_options = genTree(res); this.teamOptions = res;
}) })
},
getShfit(){
this.$API.mtm.shift.req({page:0}).then(res=>{
this.shiftOptions = res;
})
}, },
// //
open(mode = "add") { open(mode = "add") {
@ -164,26 +146,33 @@
this.visible = true; this.visible = true;
return this; 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() { submit() {
this.$refs.dialogForm.validate(async (valid) => { this.$refs.dialogForm.validate(async (valid) => {
if (valid) { if (valid) {
this.isSaveing = true; this.isSaveing = true;
try { try {
var res; let obj={};
if (this.mode == "add") { obj.note = this.form.note;
res = await this.$API.rpm.rparty.create.req(this.form); obj.team = this.form.team;
} else if (this.mode == "edit") { obj.shift = this.form.shift;
res = await this.$API.rpm.rparty.update.req( obj.leader = this.form.leader;
this.form.id, this.$API.wpm.sflog.update.req(this.form.id,obj).then(res=>{
this.form this.isSaveing = false;
); this.$emit("success", this.form, this.mode);
} this.visible = false;
this.isSaveing = false; this.$message.success("操作成功");
this.$emit("success", this.form, this.mode); return res;
this.visible = false; })
this.$message.success("操作成功");
return res;
} catch (err) { } catch (err) {
// //
this.isSaveing = false; this.isSaveing = false;
@ -194,7 +183,7 @@
}, },
// //
setData(data) { setData(data) {
Object.assign(this.form, data); Object.assign(this.form,data);
}, },
// //
setFilters(filters) { setFilters(filters) {
@ -204,7 +193,6 @@
}, },
}; };
</script> </script>
<style> <style>
</style> </style>

View File

@ -28,7 +28,7 @@
stripe stripe
:params="query" :params="query"
> >
<el-table-column type="index" width="50"/> <el-table-column type="index" width="50"/>
<el-table-column label="关联工段" prop="mgroup_name"></el-table-column> <el-table-column label="关联工段" prop="mgroup_name"></el-table-column>
<el-table-column label="班组名称" prop="team_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="shift_name"></el-table-column>
@ -133,8 +133,8 @@
} }
}, },
handleQuery() { handleQuery() {
this.$refs.table.queryData(this.query) this.$refs.table.queryData(this.query)
}, },
resetQuery() { resetQuery() {
this.query = {}; this.query = {};
}, },

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

View File

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

View File

@ -2,7 +2,7 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <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>
<div class="right-panel"> <div class="right-panel">
<div class="right-panel-search"> <div class="right-panel-search">
@ -12,7 +12,7 @@
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <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="#" type="index" width="50"></el-table-column>
<el-table-column label="名称" prop="name" min-width="100"></el-table-column> <el-table-column label="名称" prop="name" min-width="100"></el-table-column>
<el-table-column label="分类" prop="cate" min-width="100"> <el-table-column label="分类" prop="cate" min-width="100">
@ -20,14 +20,14 @@
<span>{{ cates_[scope.row.cate] }}</span> <span>{{ cates_[scope.row.cate] }}</span>
</template> </template>
</el-table-column> </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="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="创建时间" prop="create_time" min-width="150"></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="140"> <el-table-column label="操作" fixed="right" align="center" width="140">
<template #default="scope"> <template #default="scope">
<el-button link size="small" @click="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-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> <template #reference>
<el-button link size="small" v-auth="'role.delete'" type="danger">删除</el-button> <el-button link size="small" v-auth="'role.delete'" type="danger">删除</el-button>
</template> </template>
@ -37,170 +37,52 @@
</scTable> </scTable>
</el-main> </el-main>
</el-container> </el-container>
<el-dialog :title="titleMap[type]" v-model="limitedVisible"> <save-dialog
<el-form :model="form" :rules="rules" ref="addForm" label-width="80px" style="padding: 0 10px;"> v-if="dialog.save"
<el-form-item label="名称" prop="name"> ref="saveDialog"
<el-input v-model="form.name" clearable></el-input> @success="handleSaveSuccess"
</el-form-item> @closed="dialog.save = false"
<el-form-item label="分类" prop="cate"> ></save-dialog>
<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>
</template> </template>
<script> <script>
import {genTree} from "@/utils/verificate"; import saveDialog from "./mgroup_form.vue";
const defaultForm = {
id:"",
name: "",
cate:'',
product:'',
belong_dept:'',
};
export default { export default {
name: 'dept', name: 'dept',
components: {
saveDialog
},
data() { data() {
return { return {
apiObj: this.$API.mtm.mgroup.list, apiObj: this.$API.mtm.mgroup.list,
search: {
keyword: null
},
query: {}, query: {},
isSaving: false, dialog: {
limitedVisible : false, save: false,
checkStrictly:true, permission: false,
type: "add",
titleMap: {
add: '新增测点集',
edit: '编辑测点集',
show: '查看测点集'
}, },
// selection:[],
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'},
],
cates_:{ cates_:{
'section':'工序', 'section':'工序',
'other':'其他', 'other':'其他',
}, },
group: [],
materials:[],
productList:[],
} }
}, },
mounted() {
// this.getList();
this.getGroup();//
this.getMaterials();//
},
methods: { methods: {
handleChange(value) { //
console.log(value); table_add() {
console.log(this.form.belong_dept); this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add");
});
}, },
getMaterials(){}, //
// table_edit(row) {
async getGroup() { this.dialog.save = true;
let res = await this.$API.system.dept.list.req({ page_size: 3 , type:'dept'}); this.$nextTick(() => {
this.group = res.results; 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 id = row.id;
var res = await this.$API.mtm.mgroup.delete.req(id); var res = await this.$API.mtm.mgroup.delete.req(id);
if(res.err_msg){ if(res.err_msg){
@ -219,9 +101,11 @@
this.$refs.table.queryData(this.query) this.$refs.table.queryData(this.query)
}, },
// //
handleSaveSuccess(){ //
this.$refs.table.refresh() handleSaveSuccess(data, mode) {
} this.dialog.save = true;
this.$refs.table.refresh();
},
} }
} }
</script> </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> </span>
</el-form-item> </el-form-item>
<el-form-item label="所属部门"> <el-form-item label="所属部门">
<el-cascader <el-select
v-model="form.belong_dept" v-model="form.belong_dept"
:options="group" placeholder="所属部门"
:props="groupsProps"
:show-all-levels="false"
clearable clearable
style="width: 100%" 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-item>
</el-form> </el-form>
<template #footer> <template #footer>
@ -62,7 +66,6 @@
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import {genTree} from "@/utils/verificate";
const defaultForm = { const defaultForm = {
id:"", id:"",
name: "", name: "",
@ -99,11 +102,6 @@
leader_name: [{required: true, message: '请输入班组班长'}], leader_name: [{required: true, message: '请输入班组班长'}],
belong_dept: [{required: true, message: '请选择所属部门'}], belong_dept: [{required: true, message: '请选择所属部门'}],
}, },
groupsProps: {
multiple: false,
emitPath: false,
checkStrictly: true,
},
group: [], group: [],
} }
}, },
@ -116,10 +114,11 @@
console.log(value); console.log(value);
console.log(this.form.belong_dept); console.log(this.form.belong_dept);
}, },
// //
async getGroup() { getGroup() {
let res = await this.$API.system.dept.list.req({ page: 0 }); this.$API.system.dept.list.req({ page_size: 3 , type:'dept'}).then(res=>{
this.group = genTree(res); this.group = res.results;
});
}, },
// //
getList(){ getList(){